@arrowsphere/api-client 3.50.0-rc.bdj.1 → 3.50.0-rc.bdj.2
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/CHANGELOG.md +0 -6
- package/build/customers/customersClient.js +5 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
4
4
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
5
5
|
|
|
6
|
-
## [3.50.0] - 2023-08-17
|
|
7
|
-
|
|
8
|
-
### Changed
|
|
9
|
-
|
|
10
|
-
- Adds create & update customer
|
|
11
|
-
|
|
12
6
|
## [3.49.0] - 2023-08-16
|
|
13
7
|
|
|
14
8
|
### Changed
|
|
@@ -11,6 +11,7 @@ const customerContact_1 = require("./entities/customers/customerContact/customer
|
|
|
11
11
|
const customer_1 = require("./entities/customers/customer");
|
|
12
12
|
const contact_1 = require("./entities/customers/contact/contact");
|
|
13
13
|
const lodash_1 = require("lodash");
|
|
14
|
+
const http2_1 = require("http2");
|
|
14
15
|
var CustomerContactPayloadFields;
|
|
15
16
|
(function (CustomerContactPayloadFields) {
|
|
16
17
|
CustomerContactPayloadFields["COLUMN_FIRST_NAME"] = "firstName";
|
|
@@ -65,16 +66,11 @@ class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
65
66
|
async createCustomer(payload, parameters = {}) {
|
|
66
67
|
this.path = '';
|
|
67
68
|
try {
|
|
68
|
-
|
|
69
|
-
const response = {
|
|
70
|
-
status: 201,
|
|
71
|
-
data,
|
|
72
|
-
};
|
|
73
|
-
return response;
|
|
69
|
+
return await this.post(payload, parameters);
|
|
74
70
|
}
|
|
75
71
|
catch (error) {
|
|
76
72
|
const response = {
|
|
77
|
-
status: (0, lodash_1.get)(error, 'httpCode', (0, lodash_1.get)(error, 'code',
|
|
73
|
+
status: (0, lodash_1.get)(error, 'httpCode', (0, lodash_1.get)(error, 'code', http2_1.constants.HTTP_STATUS_INTERNAL_SERVER_ERROR)),
|
|
78
74
|
message: (0, lodash_1.get)(error, 'httpError', (0, lodash_1.get)(error, 'message', 'An error has occurred')),
|
|
79
75
|
};
|
|
80
76
|
return response;
|
|
@@ -83,16 +79,11 @@ class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
|
|
|
83
79
|
async updateCustomer(customerReference, payload, parameters = {}) {
|
|
84
80
|
this.path = `/${customerReference}`;
|
|
85
81
|
try {
|
|
86
|
-
|
|
87
|
-
const response = {
|
|
88
|
-
status: 200,
|
|
89
|
-
data,
|
|
90
|
-
};
|
|
91
|
-
return response;
|
|
82
|
+
return await this.patch(payload, parameters);
|
|
92
83
|
}
|
|
93
84
|
catch (error) {
|
|
94
85
|
const response = {
|
|
95
|
-
status: (0, lodash_1.get)(error, 'httpCode', (0, lodash_1.get)(error, 'code',
|
|
86
|
+
status: (0, lodash_1.get)(error, 'httpCode', (0, lodash_1.get)(error, 'code', http2_1.constants.HTTP_STATUS_INTERNAL_SERVER_ERROR)),
|
|
96
87
|
message: (0, lodash_1.get)(error, 'httpError', (0, lodash_1.get)(error, 'message', 'An error has occurred')),
|
|
97
88
|
};
|
|
98
89
|
return response;
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"type": "git",
|
|
5
5
|
"url": "https://github.com/ArrowSphere/nodejs-api-client.git"
|
|
6
6
|
},
|
|
7
|
-
"version": "3.50.0-rc.bdj.
|
|
7
|
+
"version": "3.50.0-rc.bdj.2",
|
|
8
8
|
"description": "Node.js client for ArrowSphere's public API",
|
|
9
9
|
"main": "build/index.js",
|
|
10
10
|
"types": "build/index.d.ts",
|