-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
465 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Update documentation | ||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
paths: | ||
- docs/** | ||
|
||
concurrency: | ||
group: wiki | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Update documentation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: spenserblack/[email protected] | ||
with: | ||
path: docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Sorting | ||
|
||
The sorting options for the API. Are defined using the following format: | ||
|
||
```js | ||
const sortBy = "<field>:<order>"; | ||
``` | ||
|
||
Or: | ||
|
||
```js | ||
const sortBy = { | ||
order: "<order>", | ||
field: "<field>" | ||
}; | ||
``` | ||
|
||
Where `<field>` is the field to sort by and `<order>` is the order to sort in. | ||
It can also be an array of the above formats. | ||
|
||
## Examples | ||
|
||
```js | ||
// Simplest form | ||
const sortBy = "<field>:ASC"; | ||
const sortBy = "<field>:DESC"; | ||
``` | ||
|
||
```js | ||
// Multiple fields | ||
const sortBy = ["<field1>:ASC", "<field2>:DESC"]; | ||
``` | ||
|
||
```js | ||
// Object form | ||
const sortBy = { | ||
order: "ASC", | ||
field: "<field>" | ||
}; | ||
``` | ||
|
||
```js | ||
// Multiple fields in object form | ||
const sortBy = [ | ||
{ | ||
order: "ASC", | ||
field: "<field1>" | ||
}, | ||
{ | ||
order: "DESC", | ||
field: "<field2>" | ||
} | ||
]; | ||
``` | ||
|
||
# Filtering | ||
|
||
## Contains | ||
|
||
Filtering a field which is a list of strings can be done using the `contains` filter. It is defined using the following format: | ||
|
||
```js | ||
const contains = "<value>"; | ||
``` | ||
|
||
Or if all field values must be contained: | ||
|
||
```js | ||
const contains = { | ||
all: ["<value1>", "<value2>"] | ||
}; | ||
``` | ||
|
||
Or if any field value must be contained: | ||
|
||
```js | ||
const contains = { | ||
some: ["<value1>", "<value2>"] | ||
}; | ||
``` | ||
|
||
Where `<value>` is the value to filter by. | ||
|
||
## Date | ||
|
||
Filtering a field which is a date can be done using the `date` filter. It is defined using the following format: | ||
|
||
```js | ||
const date = { | ||
from?: "<date>", | ||
to?: "<date>" | ||
}; | ||
``` | ||
|
||
Where `<date>` is the date to filter by. | ||
|
||
## Examples | ||
|
||
```js | ||
// Between two dates | ||
const filter = { | ||
date: { | ||
from: "2019-01-01", | ||
to: "2019-12-31" | ||
} | ||
}; | ||
``` | ||
|
||
```js | ||
// After a date | ||
const filter = { | ||
date: { | ||
from: "2019-01-01" | ||
} | ||
}; | ||
``` | ||
|
||
```js | ||
// Before a date | ||
const filter = { | ||
date: { | ||
to: "2019-12-31" | ||
} | ||
}; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Print-one-js | ||
|
||
> The official javascript client for [Print.one](https://print.one) | ||
## Installation | ||
|
||
```bash | ||
npm install @print-one/print-one-js | ||
``` | ||
|
||
## Getting started | ||
|
||
1. Get your API token from [Print.one](https://portal.print.one/devs/apikeys) | ||
2. Create a new client with your API token | ||
|
||
```js | ||
import { PrintOne } from '@print-one/print-one-js' | ||
|
||
const client = new PrintOne('<YOUR API TOKEN>'); | ||
``` | ||
3. Start using the client | ||
- See examples [here](./Examples.md) | ||
- See all available methods [here](./PrintOne.md) | ||
- See all available models [here](./Models.md) | ||
|
||
## Help | ||
|
||
- For documentation and more examples, see the [documentation](https://github.com/Print-one/print-one-js/wiki). | ||
- With problems, questions or suggestions, please file an [issue](https://github.com/Print-one/print-one-js/issues). | ||
- For other questions, feel free to contact us | ||
at [our support page](https://printone.atlassian.net/servicedesk/customer/portals). | ||
|
Empty file.
Oops, something went wrong.