@gofynd/fdk-client-javascript 1.3.6-beta.1 → 1.3.6
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/README.md +1 -1
- package/package.json +2 -2
- package/sdk/application/ApplicationConfig.d.ts +11 -3
- package/sdk/application/ApplicationConfig.js +21 -3
- package/sdk/application/Cart/CartApplicationClient.js +228 -113
- package/sdk/application/Catalog/CatalogApplicationClient.js +244 -121
- package/sdk/application/Common/CommonApplicationClient.js +20 -9
- package/sdk/application/Communication/CommunicationApplicationClient.js +28 -13
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +132 -65
- package/sdk/application/Content/ContentApplicationClient.js +156 -77
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +28 -13
- package/sdk/application/Lead/LeadApplicationClient.js +60 -29
- package/sdk/application/Logistic/LogisticApplicationClient.js +44 -21
- package/sdk/application/Order/OrderApplicationClient.js +100 -49
- package/sdk/application/Payment/PaymentApplicationClient.js +340 -169
- package/sdk/application/PosCart/PosCartApplicationClient.js +220 -109
- package/sdk/application/Rewards/RewardsApplicationClient.js +60 -29
- package/sdk/application/Share/ShareApplicationClient.js +60 -29
- package/sdk/application/Theme/ThemeApplicationClient.js +36 -17
- package/sdk/application/User/UserApplicationClient.js +324 -161
- package/sdk/common/AxiosHelper.js +3 -3
- package/sdk/common/FDKError.d.ts +4 -0
- package/sdk/common/FDKError.js +9 -0
- package/sdk/partner/FileStorage/FileStoragePartnerClient.d.ts +16 -40
- package/sdk/partner/FileStorage/FileStoragePartnerClient.js +160 -38
- package/sdk/partner/PartnerConfig.d.ts +10 -0
- package/sdk/partner/PartnerConfig.js +10 -1
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +96 -199
- package/sdk/partner/Theme/ThemePartnerClient.js +935 -170
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +36 -17
- package/sdk/platform/Billing/BillingPlatformClient.js +140 -69
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +456 -228
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +512 -256
- package/sdk/platform/Catalog/CatalogPlatformClient.js +620 -309
- package/sdk/platform/Common/CommonPlatformClient.js +20 -9
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +472 -236
- package/sdk/platform/Communication/CommunicationPlatformClient.js +12 -5
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +14 -1
- package/sdk/platform/Communication/CommunicationPlatformModel.js +16 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +116 -57
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +256 -128
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +148 -73
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +552 -276
- package/sdk/platform/Discount/DiscountPlatformClient.js +92 -45
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +88 -44
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +52 -25
- package/sdk/platform/Finance/FinancePlatformClient.js +196 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +100 -49
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +104 -52
- package/sdk/platform/Lead/LeadPlatformClient.js +92 -45
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +26 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +239 -5
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +57 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +55 -0
- package/sdk/platform/Order/OrderPlatformClient.js +356 -177
- package/sdk/platform/Order/OrderPlatformModel.d.ts +44 -5
- package/sdk/platform/Order/OrderPlatformModel.js +52 -4
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +16 -8
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +336 -168
- package/sdk/platform/Payment/PaymentPlatformClient.js +84 -41
- package/sdk/platform/PlatformConfig.d.ts +10 -0
- package/sdk/platform/PlatformConfig.js +10 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +96 -48
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +112 -56
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +148 -73
- package/sdk/platform/Share/SharePlatformApplicationClient.js +40 -20
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +224 -112
- package/sdk/platform/Theme/ThemePlatformClient.js +28 -13
- package/sdk/platform/User/UserPlatformApplicationClient.js +144 -72
- package/sdk/platform/Webhook/WebhookPlatformClient.js +132 -65
- package/sdk/public/Configuration/ConfigurationPublicClient.js +20 -9
- package/sdk/public/Inventory/InventoryPublicClient.js +52 -25
- package/sdk/public/Partner/PartnerPublicClient.js +12 -5
- package/sdk/public/PublicConfig.d.ts +11 -1
- package/sdk/public/PublicConfig.js +10 -1
- package/sdk/public/Webhook/WebhookPublicClient.js +20 -9
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const constructUrl = require("../constructUrl");
|
|
4
7
|
const Paginator = require("../../common/Paginator");
|
|
5
8
|
const ConfigurationPublicValidator = require("./ConfigurationPublicValidator");
|
|
@@ -98,10 +101,14 @@ class Configuration {
|
|
|
98
101
|
});
|
|
99
102
|
|
|
100
103
|
if (res_error) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
105
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
106
|
+
} else {
|
|
107
|
+
Logger({
|
|
108
|
+
level: "WARN",
|
|
109
|
+
message: `Response Validation Warnings for public > Configuration > getLocations \n ${res_error}`,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
105
112
|
}
|
|
106
113
|
|
|
107
114
|
return response;
|
|
@@ -174,10 +181,14 @@ class Configuration {
|
|
|
174
181
|
});
|
|
175
182
|
|
|
176
183
|
if (res_error) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
184
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
185
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
186
|
+
} else {
|
|
187
|
+
Logger({
|
|
188
|
+
level: "WARN",
|
|
189
|
+
message: `Response Validation Warnings for public > Configuration > searchApplication \n ${res_error}`,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
181
192
|
}
|
|
182
193
|
|
|
183
194
|
return response;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const constructUrl = require("../constructUrl");
|
|
4
7
|
const Paginator = require("../../common/Paginator");
|
|
5
8
|
const InventoryPublicValidator = require("./InventoryPublicValidator");
|
|
@@ -103,10 +106,14 @@ class Inventory {
|
|
|
103
106
|
);
|
|
104
107
|
|
|
105
108
|
if (res_error) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
109
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
110
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
111
|
+
} else {
|
|
112
|
+
Logger({
|
|
113
|
+
level: "WARN",
|
|
114
|
+
message: `Response Validation Warnings for public > Inventory > getApiKey \n ${res_error}`,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
110
117
|
}
|
|
111
118
|
|
|
112
119
|
return response;
|
|
@@ -180,10 +187,14 @@ class Inventory {
|
|
|
180
187
|
);
|
|
181
188
|
|
|
182
189
|
if (res_error) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
191
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
192
|
+
} else {
|
|
193
|
+
Logger({
|
|
194
|
+
level: "WARN",
|
|
195
|
+
message: `Response Validation Warnings for public > Inventory > getConfigByApiKey \n ${res_error}`,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
187
198
|
}
|
|
188
199
|
|
|
189
200
|
return response;
|
|
@@ -255,10 +266,14 @@ class Inventory {
|
|
|
255
266
|
);
|
|
256
267
|
|
|
257
268
|
if (res_error) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
269
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
270
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
271
|
+
} else {
|
|
272
|
+
Logger({
|
|
273
|
+
level: "WARN",
|
|
274
|
+
message: `Response Validation Warnings for public > Inventory > getJobByCode \n ${res_error}`,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
262
277
|
}
|
|
263
278
|
|
|
264
279
|
return response;
|
|
@@ -331,10 +346,14 @@ class Inventory {
|
|
|
331
346
|
});
|
|
332
347
|
|
|
333
348
|
if (res_error) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
349
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
350
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
351
|
+
} else {
|
|
352
|
+
Logger({
|
|
353
|
+
level: "WARN",
|
|
354
|
+
message: `Response Validation Warnings for public > Inventory > getJobCodesMetrics \n ${res_error}`,
|
|
355
|
+
});
|
|
356
|
+
}
|
|
338
357
|
}
|
|
339
358
|
|
|
340
359
|
return response;
|
|
@@ -413,10 +432,14 @@ class Inventory {
|
|
|
413
432
|
);
|
|
414
433
|
|
|
415
434
|
if (res_error) {
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
435
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
436
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
437
|
+
} else {
|
|
438
|
+
Logger({
|
|
439
|
+
level: "WARN",
|
|
440
|
+
message: `Response Validation Warnings for public > Inventory > getJobConfigByIntegrationType \n ${res_error}`,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
420
443
|
}
|
|
421
444
|
|
|
422
445
|
return response;
|
|
@@ -489,10 +512,14 @@ class Inventory {
|
|
|
489
512
|
);
|
|
490
513
|
|
|
491
514
|
if (res_error) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
515
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
516
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
517
|
+
} else {
|
|
518
|
+
Logger({
|
|
519
|
+
level: "WARN",
|
|
520
|
+
message: `Response Validation Warnings for public > Inventory > saveJobCodesMetrics \n ${res_error}`,
|
|
521
|
+
});
|
|
522
|
+
}
|
|
496
523
|
}
|
|
497
524
|
|
|
498
525
|
return response;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const constructUrl = require("../constructUrl");
|
|
4
7
|
const Paginator = require("../../common/Paginator");
|
|
5
8
|
const PartnerPublicValidator = require("./PartnerPublicValidator");
|
|
@@ -97,10 +100,14 @@ class Partner {
|
|
|
97
100
|
});
|
|
98
101
|
|
|
99
102
|
if (res_error) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
104
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
105
|
+
} else {
|
|
106
|
+
Logger({
|
|
107
|
+
level: "WARN",
|
|
108
|
+
message: `Response Validation Warnings for public > Partner > getPanelExtensionDetails \n ${res_error}`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
104
111
|
}
|
|
105
112
|
|
|
106
113
|
return response;
|
|
@@ -16,16 +16,26 @@ declare class PublicConfig {
|
|
|
16
16
|
* @param {string} [_conf.language] - The language for localization.
|
|
17
17
|
* @param {string} [_conf.currency] - The currency for pricing and financial
|
|
18
18
|
* calculations.
|
|
19
|
+
* @param {object} [options] - Additional options.
|
|
20
|
+
* @param {boolean} [options.strictResponseCheck=false] - Strict check for
|
|
21
|
+
* response schema validation. Passing this `true` will check response
|
|
22
|
+
* against response schema and throw FDKResponseValidationError if it
|
|
23
|
+
* doesn't match. Default is `false`
|
|
19
24
|
*/
|
|
20
25
|
constructor(_conf: {
|
|
21
26
|
domain?: string;
|
|
22
27
|
userAgent?: string;
|
|
23
28
|
language?: string;
|
|
24
29
|
currency?: string;
|
|
25
|
-
},
|
|
30
|
+
}, options?: {
|
|
31
|
+
strictResponseCheck?: boolean;
|
|
32
|
+
});
|
|
26
33
|
domain: string;
|
|
27
34
|
userAgent: string;
|
|
28
35
|
language: string;
|
|
29
36
|
currency: string;
|
|
30
37
|
extraHeaders: any[];
|
|
38
|
+
options: {
|
|
39
|
+
strictResponseCheck: boolean;
|
|
40
|
+
};
|
|
31
41
|
}
|
|
@@ -15,13 +15,22 @@ class PublicConfig {
|
|
|
15
15
|
* @param {string} [_conf.language] - The language for localization.
|
|
16
16
|
* @param {string} [_conf.currency] - The currency for pricing and financial
|
|
17
17
|
* calculations.
|
|
18
|
+
* @param {object} [options] - Additional options.
|
|
19
|
+
* @param {boolean} [options.strictResponseCheck=false] - Strict check for
|
|
20
|
+
* response schema validation. Passing this `true` will check response
|
|
21
|
+
* against response schema and throw FDKResponseValidationError if it
|
|
22
|
+
* doesn't match. Default is `false`
|
|
18
23
|
*/
|
|
19
|
-
constructor(_conf,
|
|
24
|
+
constructor(_conf, options) {
|
|
20
25
|
this.domain = _conf.domain || "https://api.fynd.com";
|
|
21
26
|
this.userAgent = _conf.userAgent || "";
|
|
22
27
|
this.language = _conf.language;
|
|
23
28
|
this.currency = _conf.currency;
|
|
24
29
|
this.extraHeaders = [];
|
|
30
|
+
this.options = {
|
|
31
|
+
...{ strictResponseCheck: false },
|
|
32
|
+
...options,
|
|
33
|
+
};
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
const PublicAPIClient = require("../PublicAPIClient");
|
|
2
|
-
const {
|
|
2
|
+
const {
|
|
3
|
+
FDKClientValidationError,
|
|
4
|
+
FDKResponseValidationError,
|
|
5
|
+
} = require("../../common/FDKError");
|
|
3
6
|
const constructUrl = require("../constructUrl");
|
|
4
7
|
const Paginator = require("../../common/Paginator");
|
|
5
8
|
const WebhookPublicValidator = require("./WebhookPublicValidator");
|
|
@@ -96,10 +99,14 @@ class Webhook {
|
|
|
96
99
|
});
|
|
97
100
|
|
|
98
101
|
if (res_error) {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
103
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
104
|
+
} else {
|
|
105
|
+
Logger({
|
|
106
|
+
level: "WARN",
|
|
107
|
+
message: `Response Validation Warnings for public > Webhook > fetchAllWebhookEvents \n ${res_error}`,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
103
110
|
}
|
|
104
111
|
|
|
105
112
|
return response;
|
|
@@ -172,10 +179,14 @@ class Webhook {
|
|
|
172
179
|
});
|
|
173
180
|
|
|
174
181
|
if (res_error) {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
182
|
+
if (this._conf.options.strictResponseCheck === true) {
|
|
183
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
184
|
+
} else {
|
|
185
|
+
Logger({
|
|
186
|
+
level: "WARN",
|
|
187
|
+
message: `Response Validation Warnings for public > Webhook > queryWebhookEventDetails \n ${res_error}`,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
179
190
|
}
|
|
180
191
|
|
|
181
192
|
return response;
|