@sp-api-sdk/invoices-api-2024-06-19 2.1.2 → 2.1.4

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.
@@ -109,7 +109,7 @@ const InvoicesApiAxiosParamCreator = function (configuration) {
109
109
  // verify required parameter 'invoiceType' is not null or undefined
110
110
  (0, common_1.assertParamExists)('getGovernmentInvoiceDocument', 'invoiceType', invoiceType);
111
111
  const localVarPath = `/tax/invoices/2024-06-19/governmentInvoiceRequests/{shipmentId}`
112
- .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
112
+ .replace('{shipmentId}', encodeURIComponent(String(shipmentId)));
113
113
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
114
114
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
115
115
  let baseOptions;
@@ -209,7 +209,7 @@ const InvoicesApiAxiosParamCreator = function (configuration) {
209
209
  // verify required parameter 'invoiceId' is not null or undefined
210
210
  (0, common_1.assertParamExists)('getInvoice', 'invoiceId', invoiceId);
211
211
  const localVarPath = `/tax/invoices/2024-06-19/invoices/{invoiceId}`
212
- .replace(`{${"invoiceId"}}`, encodeURIComponent(String(invoiceId)));
212
+ .replace('{invoiceId}', encodeURIComponent(String(invoiceId)));
213
213
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
214
214
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
215
215
  let baseOptions;
@@ -359,7 +359,7 @@ const InvoicesApiAxiosParamCreator = function (configuration) {
359
359
  // verify required parameter 'invoicesDocumentId' is not null or undefined
360
360
  (0, common_1.assertParamExists)('getInvoicesDocument', 'invoicesDocumentId', invoicesDocumentId);
361
361
  const localVarPath = `/tax/invoices/2024-06-19/documents/{invoicesDocumentId}`
362
- .replace(`{${"invoicesDocumentId"}}`, encodeURIComponent(String(invoicesDocumentId)));
362
+ .replace('{invoicesDocumentId}', encodeURIComponent(String(invoicesDocumentId)));
363
363
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
364
364
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
365
365
  let baseOptions;
@@ -388,7 +388,7 @@ const InvoicesApiAxiosParamCreator = function (configuration) {
388
388
  // verify required parameter 'exportId' is not null or undefined
389
389
  (0, common_1.assertParamExists)('getInvoicesExport', 'exportId', exportId);
390
390
  const localVarPath = `/tax/invoices/2024-06-19/exports/{exportId}`
391
- .replace(`{${"exportId"}}`, encodeURIComponent(String(exportId)));
391
+ .replace('{exportId}', encodeURIComponent(String(exportId)));
392
392
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
393
393
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
394
394
  let baseOptions;
@@ -819,14 +819,14 @@ class InvoicesApi extends base_1.BaseAPI {
819
819
  exports.InvoicesApi = InvoicesApi;
820
820
  exports.GetInvoicesSortOrderEnum = {
821
821
  Desc: 'DESC',
822
- Asc: 'ASC'
822
+ Asc: 'ASC',
823
823
  };
824
824
  exports.GetInvoicesSortByEnum = {
825
- StartDateTime: 'START_DATE_TIME'
825
+ StartDateTime: 'START_DATE_TIME',
826
826
  };
827
827
  exports.GetInvoicesExportsStatusEnum = {
828
828
  Requested: 'REQUESTED',
829
829
  Processing: 'PROCESSING',
830
830
  Done: 'DONE',
831
- Error: 'ERROR'
831
+ Error: 'ERROR',
832
832
  };
@@ -90,6 +90,7 @@ exports.setSearchParams = setSearchParams;
90
90
  * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
91
91
  * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
92
92
  */
93
+ // @ts-ignore
93
94
  const replaceWithSerializableTypeIfNeeded = function (key, value) {
94
95
  if (value instanceof Set) {
95
96
  return Array.from(value);
@@ -91,8 +91,8 @@ class Configuration {
91
91
  * @return True if the given MIME is JSON, false otherwise.
92
92
  */
93
93
  isJsonMime(mime) {
94
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
95
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
94
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
95
+ return mime !== null && jsonMime.test(mime);
96
96
  }
97
97
  }
98
98
  exports.Configuration = Configuration;
@@ -21,5 +21,5 @@ exports.ExportStatus = {
21
21
  Requested: 'REQUESTED',
22
22
  Processing: 'PROCESSING',
23
23
  Done: 'DONE',
24
- Error: 'ERROR'
24
+ Error: 'ERROR',
25
25
  };
@@ -18,5 +18,5 @@ exports.FileFormat = void 0;
18
18
  * Supported invoice file extensions.
19
19
  */
20
20
  exports.FileFormat = {
21
- Xml: 'XML'
21
+ Xml: 'XML',
22
22
  };
@@ -20,5 +20,5 @@ exports.GovernmentInvoiceCreationStatus = void 0;
20
20
  exports.GovernmentInvoiceCreationStatus = {
21
21
  Processing: 'PROCESSING',
22
22
  Success: 'SUCCESS',
23
- Error: 'ERROR'
23
+ Error: 'ERROR',
24
24
  };
@@ -103,7 +103,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration) {
103
103
  // verify required parameter 'invoiceType' is not null or undefined
104
104
  assertParamExists('getGovernmentInvoiceDocument', 'invoiceType', invoiceType);
105
105
  const localVarPath = `/tax/invoices/2024-06-19/governmentInvoiceRequests/{shipmentId}`
106
- .replace(`{${"shipmentId"}}`, encodeURIComponent(String(shipmentId)));
106
+ .replace('{shipmentId}', encodeURIComponent(String(shipmentId)));
107
107
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
108
108
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
109
109
  let baseOptions;
@@ -203,7 +203,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration) {
203
203
  // verify required parameter 'invoiceId' is not null or undefined
204
204
  assertParamExists('getInvoice', 'invoiceId', invoiceId);
205
205
  const localVarPath = `/tax/invoices/2024-06-19/invoices/{invoiceId}`
206
- .replace(`{${"invoiceId"}}`, encodeURIComponent(String(invoiceId)));
206
+ .replace('{invoiceId}', encodeURIComponent(String(invoiceId)));
207
207
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
208
208
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
209
209
  let baseOptions;
@@ -353,7 +353,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration) {
353
353
  // verify required parameter 'invoicesDocumentId' is not null or undefined
354
354
  assertParamExists('getInvoicesDocument', 'invoicesDocumentId', invoicesDocumentId);
355
355
  const localVarPath = `/tax/invoices/2024-06-19/documents/{invoicesDocumentId}`
356
- .replace(`{${"invoicesDocumentId"}}`, encodeURIComponent(String(invoicesDocumentId)));
356
+ .replace('{invoicesDocumentId}', encodeURIComponent(String(invoicesDocumentId)));
357
357
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
358
358
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
359
359
  let baseOptions;
@@ -382,7 +382,7 @@ export const InvoicesApiAxiosParamCreator = function (configuration) {
382
382
  // verify required parameter 'exportId' is not null or undefined
383
383
  assertParamExists('getInvoicesExport', 'exportId', exportId);
384
384
  const localVarPath = `/tax/invoices/2024-06-19/exports/{exportId}`
385
- .replace(`{${"exportId"}}`, encodeURIComponent(String(exportId)));
385
+ .replace('{exportId}', encodeURIComponent(String(exportId)));
386
386
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
387
387
  const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
388
388
  let baseOptions;
@@ -809,14 +809,14 @@ export class InvoicesApi extends BaseAPI {
809
809
  }
810
810
  export const GetInvoicesSortOrderEnum = {
811
811
  Desc: 'DESC',
812
- Asc: 'ASC'
812
+ Asc: 'ASC',
813
813
  };
814
814
  export const GetInvoicesSortByEnum = {
815
- StartDateTime: 'START_DATE_TIME'
815
+ StartDateTime: 'START_DATE_TIME',
816
816
  };
817
817
  export const GetInvoicesExportsStatusEnum = {
818
818
  Requested: 'REQUESTED',
819
819
  Processing: 'PROCESSING',
820
820
  Done: 'DONE',
821
- Error: 'ERROR'
821
+ Error: 'ERROR',
822
822
  };
@@ -81,6 +81,7 @@ export const setSearchParams = function (url, ...objects) {
81
81
  * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
82
82
  * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
83
83
  */
84
+ // @ts-ignore
84
85
  export const replaceWithSerializableTypeIfNeeded = function (key, value) {
85
86
  if (value instanceof Set) {
86
87
  return Array.from(value);
@@ -88,7 +88,7 @@ export class Configuration {
88
88
  * @return True if the given MIME is JSON, false otherwise.
89
89
  */
90
90
  isJsonMime(mime) {
91
- const jsonMime = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
92
- return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
91
+ const jsonMime = /^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$/i;
92
+ return mime !== null && jsonMime.test(mime);
93
93
  }
94
94
  }
@@ -18,5 +18,5 @@ export const ExportStatus = {
18
18
  Requested: 'REQUESTED',
19
19
  Processing: 'PROCESSING',
20
20
  Done: 'DONE',
21
- Error: 'ERROR'
21
+ Error: 'ERROR',
22
22
  };
@@ -15,5 +15,5 @@
15
15
  * Supported invoice file extensions.
16
16
  */
17
17
  export const FileFormat = {
18
- Xml: 'XML'
18
+ Xml: 'XML',
19
19
  };
@@ -17,5 +17,5 @@
17
17
  export const GovernmentInvoiceCreationStatus = {
18
18
  Processing: 'PROCESSING',
19
19
  Success: 'SUCCESS',
20
- Error: 'ERROR'
20
+ Error: 'ERROR',
21
21
  };
@@ -28,7 +28,7 @@ export declare const setSearchParams: (url: URL, ...objects: any[]) => void;
28
28
  * This function will run for every key-value pair encountered by JSON.stringify while traversing an object.
29
29
  * Converting a set to a string will return an empty object, so an intermediate conversion to an array is required.
30
30
  */
31
- export declare const replaceWithSerializableTypeIfNeeded: (key: any, value: any) => any;
31
+ export declare const replaceWithSerializableTypeIfNeeded: (key: string, value: any) => any;
32
32
  export declare const serializeDataIfNeeded: (value: any, requestOptions: any, configuration?: Configuration) => any;
33
33
  export declare const toPathString: (url: URL) => string;
34
34
  export declare const createRequestFunction: (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) => <T = unknown, R = AxiosResponse<T>>(axios?: AxiosInstance, basePath?: string) => Promise<R>;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sp-api-sdk/invoices-api-2024-06-19",
3
3
  "author": "Bertrand Marron <bertrand@bizon.solutions>",
4
4
  "description": "Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.",
5
- "version": "2.1.2",
5
+ "version": "2.1.4",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/es/index.js",
8
8
  "types": "dist/types/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "dist/**/*.d.ts"
19
19
  ],
20
20
  "dependencies": {
21
- "@sp-api-sdk/common": "2.1.29",
22
- "axios": "^1.13.5"
21
+ "@sp-api-sdk/common": "2.1.31",
22
+ "axios": "^1.15.2"
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",
@@ -40,5 +40,5 @@
40
40
  "sp sdk",
41
41
  "invoices api"
42
42
  ],
43
- "gitHead": "2c1fe783fb7c2204e7e19d4f85fa2bdf822e4593"
43
+ "gitHead": "cc3ed7e58346bf7a4110ed8f1353aae840f294e2"
44
44
  }