zudello-integration-sdk 1.0.87 → 1.0.88
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
package/src/sdk/Base.js
CHANGED
|
@@ -28,7 +28,7 @@ class BaseSDK {
|
|
|
28
28
|
this.apiInstance = new ApiInstance()
|
|
29
29
|
this.validator = new Validator()
|
|
30
30
|
this.responseHandler = new ResponseHandler()
|
|
31
|
-
this.logger =
|
|
31
|
+
this.logger = Logger.init()
|
|
32
32
|
|
|
33
33
|
this.organizationUUID = config.envs.ORGANIZATION_UUID
|
|
34
34
|
this.teamUUID = config.envs.TEAM_UUID
|
package/src/utils/formHelper.js
CHANGED
|
@@ -8,7 +8,7 @@ const config = require('./config')
|
|
|
8
8
|
class FormHelper {
|
|
9
9
|
constructor(data) {
|
|
10
10
|
this.apiInstance = new ApiInstance()
|
|
11
|
-
this.logger =
|
|
11
|
+
this.logger = Logger.init()
|
|
12
12
|
|
|
13
13
|
this.teamUUID = config.envs.TEAM_UUID
|
|
14
14
|
this.apiURL = config.envs.ZUDELLO_API_URL
|
package/src/utils/globalState.js
CHANGED
|
@@ -18,6 +18,14 @@ class GlobalState {
|
|
|
18
18
|
this._registerAutoSync()
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
static init() {
|
|
22
|
+
if (!GlobalState._instance) {
|
|
23
|
+
GlobalState._instance = new GlobalState()
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return GlobalState._instance
|
|
27
|
+
}
|
|
28
|
+
|
|
21
29
|
_loadState () {
|
|
22
30
|
try {
|
|
23
31
|
this.globalState = JSON.parse(config.envs.GLOBAL_STATE || '{}')
|
package/src/utils/logger.js
CHANGED
|
@@ -17,6 +17,14 @@ class Logger {
|
|
|
17
17
|
this._registerAutoSync()
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
static init() {
|
|
21
|
+
if (!Logger._instance) {
|
|
22
|
+
Logger._instance = new Logger()
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return Logger._instance
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
_registerAutoSync() {
|
|
21
29
|
const syncOnExit = async () => {
|
|
22
30
|
if (this._synced) {
|
|
@@ -155,7 +163,7 @@ class Logger {
|
|
|
155
163
|
return
|
|
156
164
|
}
|
|
157
165
|
|
|
158
|
-
const globalStateClass =
|
|
166
|
+
const globalStateClass = GlobalState.init()
|
|
159
167
|
await appendJsonArray(config.envs.AWS_BUCKET, globalStateClass.globalState.logFilePath, this.getLogs())
|
|
160
168
|
}
|
|
161
169
|
}
|
package/src/utils/modelHelper.js
CHANGED
|
@@ -8,7 +8,7 @@ const config = require('./config')
|
|
|
8
8
|
class ResponseHelper {
|
|
9
9
|
constructor(data) {
|
|
10
10
|
this.apiInstance = new ApiInstance()
|
|
11
|
-
this.logger =
|
|
11
|
+
this.logger = Logger.init()
|
|
12
12
|
|
|
13
13
|
this.teamUUID = config.envs.TEAM_UUID
|
|
14
14
|
this.apiURL = config.envs.ZUDELLO_API_URL
|