-
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
235 additions
and
28 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.
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](./models/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.
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,54 @@ | ||
# 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>" | ||
} | ||
]; | ||
``` |
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,47 @@ | ||
The main class of the library. It is used to create a client for the Print.one API. | ||
|
||
# Constructor | ||
|
||
```js | ||
import { PrintOne } from '@print-one/print-one-js' | ||
|
||
const client = new PrintOne(apiKey); | ||
``` | ||
|
||
# Methods | ||
|
||
## `.getSelf()` | ||
|
||
Get the company that the API key belongs to. | ||
|
||
#### Returns: [`Promise<Company>`](./Company.md) | ||
|
||
#### Example | ||
|
||
```js | ||
const company = await client.getSelf(); | ||
``` | ||
|
||
## `.getCustomFiles([options])` | ||
|
||
Get all custom files of the company. | ||
|
||
#### Parameters | ||
|
||
| Name | Type | Default | Description | | ||
|------------------|---------------------------|------------------|-----------------------------------------------------------------------------------------------------------| | ||
| `options.limit` | `number` | `10` | The maximum number of custom files to return. | | ||
| `options.page` | `number` | `1` | The page of custom files to return. | | ||
| `options.sortBy` | [`sort`](./../Sorting.md) | `createdAt:DESC` | The field(s) to sort the custom files by. Can be `createdAt`, `fileName`, `size`, `id` or `fileExtension` | | ||
|
||
#### Returns: [`Promise<CustomFile[]>`](./CustomFile.md) | ||
|
||
#### Example | ||
|
||
```js | ||
const customFiles = await client.getCustomFiles({ | ||
limit: 20, | ||
page: 2, | ||
sortBy: "fileName:ASC" | ||
}); | ||
``` |
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
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