-
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
18 changed files
with
1,065 additions
and
37 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
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,43 @@ | ||
Contains all information about a given Company | ||
|
||
# Fields | ||
|
||
| Name | Type | Description | | ||
|-------------------------|-----------------------|---------------------------------------------------| | ||
| `id` | `string` | The ID of the company. | | ||
| `firstName` | `string` | The first name of the contact person. | | ||
| `lastName` | `string` | The last name of the contact person. | | ||
| `email` | `string` | The email address of the company. | | ||
| `invoiceEmail` | `string` | The email address for invoices. | | ||
| `financialContactName` | `string` | The name of the financial contact. | | ||
| `finacialContactEmail` | `string` | The email address for financial contact. | | ||
| `technicalContactName` | `string` | The name of the technical contact. | | ||
| `technicalContactEmail` | `string` | The email address for technical contact. | | ||
| `phoneNumber` | `string` | The phone number of the contact person. | | ||
| `companyName` | `string` | The name of the company. | | ||
| `street` | `string` | The street of the company. | | ||
| `houseNumber` | `string` | The house number of the company. | | ||
| `country` | `string` | The country of the company. | | ||
| `postalCode` | `string` | The postal code of the company. | | ||
| `city` | `string` | The city of the company. | | ||
| `cocNumber` | `string` | The Chamber of Commerce number. | | ||
| `vatNumber` | `string` | The VAT number of the company. | | ||
| `iban` | `string` | The IBAN number of the company. | | ||
| `createdAt` | `Date` | The date and time the company was created. | | ||
| `updatedAt` | `Date` | The date and time the company was last updated. | | ||
| `emailVerifiedAt` | `Date` \| `undefined` | The date and time the email address was verified. | | ||
|
||
# Methods | ||
|
||
## [`PrintOne.getSelf()`](./PrintOne#getself) | ||
|
||
Get the company that the API key belongs to. | ||
|
||
**Returns: [`Promise<Company>`](./Company)** | ||
|
||
**Example** | ||
|
||
```js | ||
const company = await client.getSelf(); | ||
``` | ||
|
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,89 @@ | ||
Contains information about CustomFiles and methods to download. | ||
|
||
# Fields | ||
|
||
| Name | Type | Description | | ||
|-----------------|----------|-----------------------------------------------| | ||
| `id` | `string` | The ID of the CustomFile. | | ||
| `fileName` | `string` | The name of the CustomFile. | | ||
| `fileExtension` | `string` | The extension of the CustomFile. | | ||
| `size` | `number` | The size of the CustomFile in bytes. | | ||
| `createdAt` | `Date` | The date and time the CustomFile was created. | | ||
|
||
# Methods | ||
|
||
## `.download()` | ||
|
||
Download the CustomFile. | ||
|
||
**Returns: `Promise<ArrayBuffer>`** | ||
|
||
**Example** | ||
|
||
```js | ||
const file = await customFile.download(); | ||
``` | ||
|
||
--- | ||
|
||
## `.delete()` | ||
|
||
Delete the CustomFile. | ||
|
||
**Returns: `Promise<void>`** | ||
|
||
**Example** | ||
|
||
```js | ||
await customFile.delete(); | ||
``` | ||
|
||
--- | ||
|
||
## [`PrintOne.getCustomFiles([options])`](./PrintOne#getcustomfilesoptions) | ||
|
||
Get all custom files. | ||
|
||
**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`](./Filtering#Sorting) | `createdAt:DESC` | The field(s) to sort the custom files by. Can be `createdAt`, `fileName`, `size`, `id` or `fileExtension` | | ||
|
||
**Returns: [`Promise<CustomFile[]>`](./CustomFile)** | ||
|
||
**Example** | ||
|
||
```js | ||
const customFiles = await client.getCustomFiles({ | ||
limit: 20, | ||
page: 2, | ||
sortBy: "fileName:ASC" | ||
}); | ||
``` | ||
|
||
--- | ||
|
||
## [`PrintOne.uploadCustomFile(fileName, file)`](./PrintOne#uploadcustomfilefilename-file) | ||
|
||
Upload a custom file. The file must be a image or font. | ||
|
||
**Parameters** | ||
|
||
| Name | Type | Description | | ||
|------------|---------------|----------------------------------------------| | ||
| `fileName` | `string` | The name of the file. | | ||
| `file` | `ArrayBuffer` | The file to upload. Must be a image or font. | | ||
|
||
**Returns: [`Promise<CustomFile>`](./CustomFile)** | ||
|
||
**Example** | ||
|
||
```js | ||
import fs from "fs"; | ||
|
||
const data = fs.readFileSync("example.png").buffer; | ||
const file = await client.uploadCustomFile("example.png", data); | ||
``` |
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" | ||
} | ||
}; | ||
``` |
Oops, something went wrong.