@dotdev/apparel21-sdk
Advanced tools
Comparing version 0.0.26 to 0.0.27
@@ -5,2 +5,8 @@ # Changelog | ||
### [0.0.27](https://gitlab.com/dotdevv/packages/apparel21-sdk/compare/v0.0.26...v0.0.27) (2021-09-27) | ||
### Bug Fixes | ||
- person update endpoint only supports version_2.0 ([2dbc476](https://gitlab.com/dotdevv/packages/apparel21-sdk/commit/2dbc476895ead9c3e1b88bdafc02f5f479153d08)) | ||
### [0.0.26](https://gitlab.com/dotdevv/packages/apparel21-sdk/compare/v0.0.25...v0.0.26) (2021-09-15) | ||
@@ -7,0 +13,0 @@ |
@@ -49,2 +49,3 @@ import semver from 'semver'; | ||
* @property {any} data: [Optional] Request data. | ||
* @property {string} version: [Optional] fixed version value in headers. | ||
*/ | ||
@@ -51,0 +52,0 @@ request: RequestFunction; |
@@ -45,8 +45,9 @@ "use strict"; | ||
* @property {any} data: [Optional] Request data. | ||
* @property {string} version: [Optional] fixed version value in headers. | ||
*/ | ||
this.request = async ({ uri = '/', query = {}, method = 'GET', format = 'xml', data, }) => { | ||
this.request = async ({ uri = '/', query = {}, method = 'GET', format = 'xml', data, version, }) => { | ||
const headers = { | ||
'Content-type': 'text/xml', | ||
...(uri !== '/' && { | ||
Accept: this.versionLt('2021.2') ? 'version_2.0' : 'version_4.0', | ||
Accept: version || this.versionLt('2021.2') ? 'version_2.0' : 'version_4.0', | ||
}), | ||
@@ -53,0 +54,0 @@ }; |
@@ -26,2 +26,3 @@ import currency from 'currency.js'; | ||
data?: any; | ||
version?: 'version_1.0' | 'version_2.0' | 'version_4.0'; | ||
} | ||
@@ -28,0 +29,0 @@ export interface ReferenceType { |
@@ -96,3 +96,3 @@ import { Person, GetPersonQuery, RequestFunction, UpdatePersonInput, CreatePersonInput, ReturnOrder, OrderInput } from '../common/types'; | ||
*/ | ||
updatePerson: (updatePersonInput: UpdatePersonInput) => Promise<any>; | ||
updatePerson: (updatePersonInput: UpdatePersonInput) => Promise<Person>; | ||
/** | ||
@@ -99,0 +99,0 @@ * POST /Persons/{id}/Orders |
@@ -136,7 +136,9 @@ "use strict"; | ||
}); | ||
return await this.request({ | ||
const { Person } = await this.request({ | ||
uri: url, | ||
method: 'PUT', | ||
data: xml, | ||
version: 'version_2.0', | ||
}); | ||
return persons_1.formatPersons([Person])[0]; | ||
}; | ||
@@ -143,0 +145,0 @@ /** |
@@ -51,3 +51,3 @@ "use strict"; | ||
const moduleMatches = config.url.match(/\/(?<module>\w+)$/); | ||
const module = moduleMatches && moduleMatches.groups ? moduleMatches.groups.module : ""; | ||
const module = moduleMatches && moduleMatches.groups ? moduleMatches.groups.module : ''; | ||
if (module) { | ||
@@ -54,0 +54,0 @@ const locationUrl = res.headers?.location || ''; |
{ | ||
"name": "@dotdev/apparel21-sdk", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"license": "UNLICENSED", | ||
@@ -5,0 +5,0 @@ "description": "Apparel21 Interface Library", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
212058
3360