@sp-api-sdk/invoices-api-2024-06-19 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +97 -0
- package/dist/cjs/index.js +19 -0
- package/dist/cjs/src/api-model/api/invoices-api.js +610 -0
- package/dist/cjs/src/api-model/api.js +30 -0
- package/dist/cjs/src/api-model/base.js +71 -0
- package/dist/cjs/src/api-model/common.js +145 -0
- package/dist/cjs/src/api-model/configuration.js +99 -0
- package/dist/cjs/src/api-model/index.js +32 -0
- package/dist/cjs/src/api-model/models/attribute-option.js +15 -0
- package/dist/cjs/src/api-model/models/error-list.js +15 -0
- package/dist/cjs/src/api-model/models/export-invoices-request.js +15 -0
- package/dist/cjs/src/api-model/models/export-invoices-response.js +15 -0
- package/dist/cjs/src/api-model/models/export-status.js +27 -0
- package/dist/cjs/src/api-model/models/export.js +15 -0
- package/dist/cjs/src/api-model/models/file-format.js +24 -0
- package/dist/cjs/src/api-model/models/get-invoice-response.js +15 -0
- package/dist/cjs/src/api-model/models/get-invoices-attributes-response.js +15 -0
- package/dist/cjs/src/api-model/models/get-invoices-document-response.js +15 -0
- package/dist/cjs/src/api-model/models/get-invoices-export-response.js +15 -0
- package/dist/cjs/src/api-model/models/get-invoices-exports-response.js +15 -0
- package/dist/cjs/src/api-model/models/get-invoices-response.js +15 -0
- package/dist/cjs/src/api-model/models/index.js +34 -0
- package/dist/cjs/src/api-model/models/invoice.js +15 -0
- package/dist/cjs/src/api-model/models/invoices-attributes.js +15 -0
- package/dist/cjs/src/api-model/models/invoices-document.js +15 -0
- package/dist/cjs/src/api-model/models/model-error.js +15 -0
- package/dist/cjs/src/api-model/models/transaction-identifier.js +15 -0
- package/dist/cjs/src/client.js +63 -0
- package/dist/es/index.js +3 -0
- package/dist/es/src/api-model/api/invoices-api.js +600 -0
- package/dist/es/src/api-model/api.js +14 -0
- package/dist/es/src/api-model/base.js +63 -0
- package/dist/es/src/api-model/common.js +133 -0
- package/dist/es/src/api-model/configuration.js +95 -0
- package/dist/es/src/api-model/index.js +16 -0
- package/dist/es/src/api-model/models/attribute-option.js +14 -0
- package/dist/es/src/api-model/models/error-list.js +14 -0
- package/dist/es/src/api-model/models/export-invoices-request.js +14 -0
- package/dist/es/src/api-model/models/export-invoices-response.js +14 -0
- package/dist/es/src/api-model/models/export-status.js +24 -0
- package/dist/es/src/api-model/models/export.js +14 -0
- package/dist/es/src/api-model/models/file-format.js +21 -0
- package/dist/es/src/api-model/models/get-invoice-response.js +14 -0
- package/dist/es/src/api-model/models/get-invoices-attributes-response.js +14 -0
- package/dist/es/src/api-model/models/get-invoices-document-response.js +14 -0
- package/dist/es/src/api-model/models/get-invoices-export-response.js +14 -0
- package/dist/es/src/api-model/models/get-invoices-exports-response.js +14 -0
- package/dist/es/src/api-model/models/get-invoices-response.js +14 -0
- package/dist/es/src/api-model/models/index.js +18 -0
- package/dist/es/src/api-model/models/invoice.js +14 -0
- package/dist/es/src/api-model/models/invoices-attributes.js +14 -0
- package/dist/es/src/api-model/models/invoices-document.js +14 -0
- package/dist/es/src/api-model/models/model-error.js +14 -0
- package/dist/es/src/api-model/models/transaction-identifier.js +14 -0
- package/dist/es/src/client.js +59 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/src/api-model/api/invoices-api.d.ts +520 -0
- package/dist/types/src/api-model/api.d.ts +12 -0
- package/dist/types/src/api-model/base.d.ts +66 -0
- package/dist/types/src/api-model/common.d.ts +65 -0
- package/dist/types/src/api-model/configuration.d.ts +91 -0
- package/dist/types/src/api-model/index.d.ts +14 -0
- package/dist/types/src/api-model/models/attribute-option.d.ts +30 -0
- package/dist/types/src/api-model/models/error-list.d.ts +24 -0
- package/dist/types/src/api-model/models/export-invoices-request.d.ts +80 -0
- package/dist/types/src/api-model/models/export-invoices-response.d.ts +24 -0
- package/dist/types/src/api-model/models/export-status.d.ts +23 -0
- package/dist/types/src/api-model/models/export.d.ts +55 -0
- package/dist/types/src/api-model/models/file-format.d.ts +20 -0
- package/dist/types/src/api-model/models/get-invoice-response.d.ts +25 -0
- package/dist/types/src/api-model/models/get-invoices-attributes-response.d.ts +25 -0
- package/dist/types/src/api-model/models/get-invoices-document-response.d.ts +25 -0
- package/dist/types/src/api-model/models/get-invoices-export-response.d.ts +25 -0
- package/dist/types/src/api-model/models/get-invoices-exports-response.d.ts +31 -0
- package/dist/types/src/api-model/models/get-invoices-response.d.ts +31 -0
- package/dist/types/src/api-model/models/index.d.ts +18 -0
- package/dist/types/src/api-model/models/invoice.d.ts +79 -0
- package/dist/types/src/api-model/models/invoices-attributes.d.ts +43 -0
- package/dist/types/src/api-model/models/invoices-document.d.ts +30 -0
- package/dist/types/src/api-model/models/model-error.d.ts +36 -0
- package/dist/types/src/api-model/models/transaction-identifier.d.ts +30 -0
- package/dist/types/src/client.d.ts +6 -0
- package/package.json +44 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 Bizon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# `invoices-api-2024-06-19`
|
|
2
|
+
|
|
3
|
+
Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@sp-api-sdk/invoices-api-2024-06-19)
|
|
6
|
+
[](https://github.com/xojs/xo)
|
|
7
|
+
|
|
8
|
+
## Documentation
|
|
9
|
+
|
|
10
|
+
Learn more about this Selling Partner API by visiting the [official documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
11
|
+
|
|
12
|
+
Also, see the [generated documentation](https://bizon.github.io/selling-partner-api-sdk/modules/_sp_api_sdk_invoices_api_2024_06_19.html) for this API client.
|
|
13
|
+
|
|
14
|
+
## Installing
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install @sp-api-sdk/invoices-api-2024-06-19
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Getting Started
|
|
21
|
+
|
|
22
|
+
```javascript
|
|
23
|
+
import {SellingPartnerApiAuth} from '@sp-api-sdk/auth'
|
|
24
|
+
import {InvoicesApiClient} from '@sp-api-sdk/invoices-api-2024-06-19'
|
|
25
|
+
|
|
26
|
+
const auth = new SellingPartnerApiAuth({
|
|
27
|
+
clientId: process.env.LWA_CLIENT_ID,
|
|
28
|
+
clientSecret: process.env.LWA_CLIENT_SECRET,
|
|
29
|
+
refreshToken: 'Atzr|…',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const client = new InvoicesApiClient({
|
|
33
|
+
auth,
|
|
34
|
+
region: 'eu',
|
|
35
|
+
})
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Rate Limiting
|
|
39
|
+
|
|
40
|
+
In order to retry rate limited requests (HTTP 429), you can configure the API client as such:
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
const client = new InvoicesApiClient({
|
|
44
|
+
auth,
|
|
45
|
+
region: 'eu',
|
|
46
|
+
rateLimiting: {
|
|
47
|
+
retry: true,
|
|
48
|
+
// Optionally specify a callback that will be called on every retry.
|
|
49
|
+
onRetry: (retryInfo) => {
|
|
50
|
+
console.log(retryInfo)
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The rate limits used for each route are specified in the [API documentation](https://developer-docs.amazon.com/sp-api/docs).
|
|
57
|
+
|
|
58
|
+
## Logging
|
|
59
|
+
|
|
60
|
+
You can enable logging for both SP-API requests and responses by configuring the `logging.request` and `logging.response` properties.
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
const client = new InvoicesApiClient({
|
|
64
|
+
auth,
|
|
65
|
+
region: 'eu',
|
|
66
|
+
logging: {
|
|
67
|
+
request: {
|
|
68
|
+
logger: console.debug
|
|
69
|
+
},
|
|
70
|
+
response: {
|
|
71
|
+
logger: console.debug
|
|
72
|
+
},
|
|
73
|
+
error: true,
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Specifying `true` will use the default options, specifying an object will allow you to override the default options.
|
|
79
|
+
This uses [axios-logger](https://github.com/hg-pyun/axios-logger) under the hood.
|
|
80
|
+
By default, if enabled, the `request` and `response` loggers will use `console.info` and the `error` logger will use `console.error`.
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
MIT
|
|
86
|
+
|
|
87
|
+
## Miscellaneous
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
╚⊙ ⊙╝
|
|
91
|
+
╚═(███)═╝
|
|
92
|
+
╚═(███)═╝
|
|
93
|
+
╚═(███)═╝
|
|
94
|
+
╚═(███)═╝
|
|
95
|
+
╚═(███)═╝
|
|
96
|
+
╚═(███)═╝
|
|
97
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./src/client"), exports);
|
|
18
|
+
__exportStar(require("./src/api-model/api"), exports);
|
|
19
|
+
__exportStar(require("./src/api-model/models"), exports);
|