zudello-integration-sdk 1.0.29 → 1.0.31
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudello-integration-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.31",
|
|
4
4
|
"description": "Zudello Integrations SDK",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"axios": "^1.6.7",
|
|
16
16
|
"circular-json": "^0.5.9",
|
|
17
17
|
"dotenv": "^16.4.5",
|
|
18
|
+
"https": "^1.0.0",
|
|
18
19
|
"lodash": "^4.17.21",
|
|
19
20
|
"moment-timezone": "^0.5.45",
|
|
20
21
|
"perf_hooks": "^0.0.1",
|
package/src/sdk/Zudello.js
CHANGED
|
@@ -188,6 +188,7 @@ class ZudelloSDK extends BaseSDK {
|
|
|
188
188
|
simplified = false,
|
|
189
189
|
submit = false,
|
|
190
190
|
updateStatus = false,
|
|
191
|
+
enrich = false
|
|
191
192
|
}) {
|
|
192
193
|
const validateIsEmpty = this.validator.isEmpty({ model, data });
|
|
193
194
|
|
|
@@ -199,6 +200,7 @@ class ZudelloSDK extends BaseSDK {
|
|
|
199
200
|
data: [data],
|
|
200
201
|
staticFields: {
|
|
201
202
|
...this.staticFieldsForUpdate,
|
|
203
|
+
enrich,
|
|
202
204
|
model,
|
|
203
205
|
module,
|
|
204
206
|
submodule,
|
|
@@ -115,7 +115,7 @@ class UniversalModule {
|
|
|
115
115
|
* @returns {object} Universal Request Response.
|
|
116
116
|
*/
|
|
117
117
|
async attach({ url, method, qs = {}, body = {} }) {
|
|
118
|
-
const validateIsEmpty = this.module.validator.isEmpty({ url,
|
|
118
|
+
const validateIsEmpty = this.module.validator.isEmpty({ url, body });
|
|
119
119
|
|
|
120
120
|
if (!validateIsEmpty.valid) {
|
|
121
121
|
return this.module.responseHandler.error(validateIsEmpty.errors);
|
package/src/utils/apiInstance.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
const axios = require('axios')
|
|
4
|
+
const https = require('https')
|
|
4
5
|
const CircularJSON = require('circular-json')
|
|
5
6
|
const ResponseHandler = require('./responseHandler')
|
|
6
7
|
|
|
@@ -14,7 +15,9 @@ class ApiInstance {
|
|
|
14
15
|
|
|
15
16
|
this.responseHandler = new ResponseHandler()
|
|
16
17
|
|
|
17
|
-
this.axiosInstance = axios.create(
|
|
18
|
+
this.axiosInstance = axios.create({
|
|
19
|
+
httpsAgent: new https.Agent({ keepAlive: true })
|
|
20
|
+
})
|
|
18
21
|
this.axiosInstance.interceptors.request.use((config) => {
|
|
19
22
|
if (this.bearerToken) {
|
|
20
23
|
config.headers.Authorization = `Bearer ${this.bearerToken}`
|