@gofynd/fdk-client-javascript 1.4.15-beta.4 → 1.4.15-beta.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.
Files changed (34) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationClient.js +277 -0
  4. package/sdk/application/Catalog/CatalogApplicationClient.js +408 -0
  5. package/sdk/application/Common/CommonApplicationClient.js +21 -0
  6. package/sdk/application/Communication/CommunicationApplicationClient.js +29 -0
  7. package/sdk/application/Configuration/ConfigurationApplicationClient.js +147 -0
  8. package/sdk/application/Content/ContentApplicationClient.js +243 -0
  9. package/sdk/application/FileStorage/FileStorageApplicationClient.js +43 -0
  10. package/sdk/application/Lead/LeadApplicationClient.js +73 -0
  11. package/sdk/application/Logistic/LogisticApplicationClient.js +153 -0
  12. package/sdk/application/Order/OrderApplicationClient.js +187 -0
  13. package/sdk/application/Payment/PaymentApplicationClient.js +427 -0
  14. package/sdk/application/Rewards/RewardsApplicationClient.js +68 -0
  15. package/sdk/application/Share/ShareApplicationClient.js +96 -0
  16. package/sdk/application/Theme/ThemeApplicationClient.js +64 -0
  17. package/sdk/application/User/UserApplicationClient.js +412 -0
  18. package/sdk/application/Webhook/WebhookApplicationClient.js +13 -0
  19. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  20. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  21. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +10 -0
  22. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +118 -0
  23. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +53 -1
  24. package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +29 -0
  25. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +0 -10
  26. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +0 -119
  27. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +1 -58
  28. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +0 -30
  29. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  30. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  31. package/sdk/public/Configuration/ConfigurationPublicClient.js +16 -0
  32. package/sdk/public/Content/ContentPublicClient.js +15 -0
  33. package/sdk/public/Partner/PartnerPublicClient.js +15 -0
  34. package/sdk/public/Webhook/WebhookPublicClient.js +40 -0
@@ -379,16 +379,7 @@ export = ThemePlatformModel;
379
379
  */
380
380
  /**
381
381
  * @typedef GlobalSchema
382
- * @property {Prop[]} [props]
383
- */
384
- /**
385
- * @typedef Prop
386
- * @property {string} [type] - The type of the property
387
- * @property {string} [category] - The category of the property
388
- * @property {string} [value] - The value of the property
389
- * @property {string} [id] - The ID of the property
390
- * @property {string} [label] - The label of the property
391
- * @property {string} [info] - Additional information about the property
382
+ * @property {Object[]} [props]
392
383
  */
393
384
  /**
394
385
  * @typedef Assets
@@ -590,7 +581,7 @@ export = ThemePlatformModel;
590
581
  declare class ThemePlatformModel {
591
582
  }
592
583
  declare namespace ThemePlatformModel {
593
- export { GetExtensionSectionRes, ExtensionSection, PropExtension, AssetsExtension, ThemeReq, CompanyThemeSchema, MarketplaceThemeId, CompanyThemeMeta, ThemePayment, ThemeImages, AvailablePageSchema, AvailablePageSectionMetaAttributes, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSeo, AvailablePageSchemaSections, AvailablePagePredicate, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AllAvailablePageSchema, AddThemeRequestSchema, FontsSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, FontsSchemaItems, FontsSchemaItemsFiles, ThemesSchema, ThemeUpgradableResponse, UpdateThemeNameRequestBody, UpdateThemeRequestBody, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, ThemeMeta, Release, Images, CustomProps, GlobalSchema, Prop, Assets, UMDJs, CommonJS, CSS, SectionItem, Preset, Page, Section, Block, Predicate, Screen, ThemeUserSchema, Route, SectionProps, SectionPreset, BlockProps, TextProp, CheckboxProp, RangeProp, ImagePickerProp, UrlProp, ThemeVersions, DummyResponse, AppliedThemes, CompanyPrivateTheme, ActionPage, PageType };
584
+ export { GetExtensionSectionRes, ExtensionSection, PropExtension, AssetsExtension, ThemeReq, CompanyThemeSchema, MarketplaceThemeId, CompanyThemeMeta, ThemePayment, ThemeImages, AvailablePageSchema, AvailablePageSectionMetaAttributes, SEOMetaItem, SEOMetaItems, SEOSitemap, SEObreadcrumb, Action, AvailablePageSeo, AvailablePageSchemaSections, AvailablePagePredicate, AvailablePageScreenPredicate, AvailablePageUserPredicate, AvailablePageRoutePredicate, AvailablePagePlatformPredicate, AvailablePageSchedulePredicate, AllAvailablePageSchema, AddThemeRequestSchema, FontsSchema, BlitzkriegApiErrorSchema, BlitzkriegInternalServerErrorSchema, FontsSchemaItems, FontsSchemaItemsFiles, ThemesSchema, ThemeUpgradableResponse, UpdateThemeNameRequestBody, UpdateThemeRequestBody, Font, FontVariants, FontVariant, Config, ThemeConfiguration, OverlayPopup, DividerStrokeHighlight, UserAlerts, OrderTracking, ThemeConfigListPage, ThemeConfigListPageSettingsProps, CustomConfig, ThemeMeta, Release, Images, CustomProps, GlobalSchema, Assets, UMDJs, CommonJS, CSS, SectionItem, Preset, Page, Section, Block, Predicate, Screen, ThemeUserSchema, Route, SectionProps, SectionPreset, BlockProps, TextProp, CheckboxProp, RangeProp, ImagePickerProp, UrlProp, ThemeVersions, DummyResponse, AppliedThemes, CompanyPrivateTheme, ActionPage, PageType };
594
585
  }
595
586
  /** @returns {GetExtensionSectionRes} */
596
587
  declare function GetExtensionSectionRes(): GetExtensionSectionRes;
@@ -1286,35 +1277,7 @@ type CustomProps = {
1286
1277
  /** @returns {GlobalSchema} */
1287
1278
  declare function GlobalSchema(): GlobalSchema;
1288
1279
  type GlobalSchema = {
1289
- props?: Prop[];
1290
- };
1291
- /** @returns {Prop} */
1292
- declare function Prop(): Prop;
1293
- type Prop = {
1294
- /**
1295
- * - The type of the property
1296
- */
1297
- type?: string;
1298
- /**
1299
- * - The category of the property
1300
- */
1301
- category?: string;
1302
- /**
1303
- * - The value of the property
1304
- */
1305
- value?: string;
1306
- /**
1307
- * - The ID of the property
1308
- */
1309
- id?: string;
1310
- /**
1311
- * - The label of the property
1312
- */
1313
- label?: string;
1314
- /**
1315
- * - Additional information about the property
1316
- */
1317
- info?: string;
1280
+ props?: any[];
1318
1281
  };
1319
1282
  /** @returns {Assets} */
1320
1283
  declare function Assets(): Assets;
@@ -432,17 +432,7 @@ const Joi = require("joi");
432
432
 
433
433
  /**
434
434
  * @typedef GlobalSchema
435
- * @property {Prop[]} [props]
436
- */
437
-
438
- /**
439
- * @typedef Prop
440
- * @property {string} [type] - The type of the property
441
- * @property {string} [category] - The category of the property
442
- * @property {string} [value] - The value of the property
443
- * @property {string} [id] - The ID of the property
444
- * @property {string} [label] - The label of the property
445
- * @property {string} [info] - Additional information about the property
435
+ * @property {Object[]} [props]
446
436
  */
447
437
 
448
438
  /**
@@ -1206,19 +1196,7 @@ class ThemePlatformModel {
1206
1196
  /** @returns {GlobalSchema} */
1207
1197
  static GlobalSchema() {
1208
1198
  return Joi.object({
1209
- props: Joi.array().items(ThemePlatformModel.Prop()),
1210
- });
1211
- }
1212
-
1213
- /** @returns {Prop} */
1214
- static Prop() {
1215
- return Joi.object({
1216
- type: Joi.string().allow(""),
1217
- category: Joi.string().allow(""),
1218
- value: Joi.string().allow(""),
1219
- id: Joi.string().allow(""),
1220
- label: Joi.string().allow(""),
1221
- info: Joi.string().allow(""),
1199
+ props: Joi.array().items(Joi.any()),
1222
1200
  });
1223
1201
  }
1224
1202
 
@@ -49,6 +49,14 @@ class Configuration {
49
49
  { locationType, id, requestHeaders } = { requestHeaders: {} },
50
50
  { responseHeaders } = { responseHeaders: false }
51
51
  ) {
52
+ let invalidInput = [];
53
+ if (invalidInput.length) {
54
+ const error = new Error();
55
+ error.message = "Missing required field";
56
+ error.details = invalidInput;
57
+ return Promise.reject(new FDKClientValidationError(error));
58
+ }
59
+
52
60
  const { error } = ConfigurationPublicValidator.getLocations().validate(
53
61
  { locationType, id },
54
62
  { abortEarly: false, allowUnknown: true }
@@ -129,6 +137,14 @@ class Configuration {
129
137
  { authorization, query, requestHeaders } = { requestHeaders: {} },
130
138
  { responseHeaders } = { responseHeaders: false }
131
139
  ) {
140
+ let invalidInput = [];
141
+ if (invalidInput.length) {
142
+ const error = new Error();
143
+ error.message = "Missing required field";
144
+ error.details = invalidInput;
145
+ return Promise.reject(new FDKClientValidationError(error));
146
+ }
147
+
132
148
  const { error } = ConfigurationPublicValidator.searchApplication().validate(
133
149
  { authorization, query },
134
150
  { abortEarly: false, allowUnknown: true }
@@ -47,6 +47,21 @@ class Content {
47
47
  { entity, requestHeaders } = { requestHeaders: {} },
48
48
  { responseHeaders } = { responseHeaders: false }
49
49
  ) {
50
+ let invalidInput = [];
51
+
52
+ if (!entity) {
53
+ invalidInput.push({
54
+ message: `The 'entity' field is required.`,
55
+ path: ["entity"],
56
+ });
57
+ }
58
+ if (invalidInput.length) {
59
+ const error = new Error();
60
+ error.message = "Missing required field";
61
+ error.details = invalidInput;
62
+ return Promise.reject(new FDKClientValidationError(error));
63
+ }
64
+
50
65
  const { error } = ContentPublicValidator.getCredentialsByEntity().validate(
51
66
  { entity },
52
67
  { abortEarly: false, allowUnknown: true }
@@ -48,6 +48,21 @@ class Partner {
48
48
  { slug, requestHeaders } = { requestHeaders: {} },
49
49
  { responseHeaders } = { responseHeaders: false }
50
50
  ) {
51
+ let invalidInput = [];
52
+
53
+ if (!slug) {
54
+ invalidInput.push({
55
+ message: `The 'slug' field is required.`,
56
+ path: ["slug"],
57
+ });
58
+ }
59
+ if (invalidInput.length) {
60
+ const error = new Error();
61
+ error.message = "Missing required field";
62
+ error.details = invalidInput;
63
+ return Promise.reject(new FDKClientValidationError(error));
64
+ }
65
+
51
66
  const {
52
67
  error,
53
68
  } = PartnerPublicValidator.getPanelExtensionDetails().validate(
@@ -55,6 +55,14 @@ class Webhook {
55
55
  { requestHeaders } = { requestHeaders: {} },
56
56
  { responseHeaders } = { responseHeaders: false }
57
57
  ) {
58
+ let invalidInput = [];
59
+ if (invalidInput.length) {
60
+ const error = new Error();
61
+ error.message = "Missing required field";
62
+ error.details = invalidInput;
63
+ return Promise.reject(new FDKClientValidationError(error));
64
+ }
65
+
58
66
  const { error } = WebhookPublicValidator.fetchAllWebhookEvents().validate(
59
67
  {},
60
68
  { abortEarly: false, allowUnknown: true }
@@ -133,6 +141,14 @@ class Webhook {
133
141
  { requestHeaders } = { requestHeaders: {} },
134
142
  { responseHeaders } = { responseHeaders: false }
135
143
  ) {
144
+ let invalidInput = [];
145
+ if (invalidInput.length) {
146
+ const error = new Error();
147
+ error.message = "Missing required field";
148
+ error.details = invalidInput;
149
+ return Promise.reject(new FDKClientValidationError(error));
150
+ }
151
+
136
152
  const { error } = WebhookPublicValidator.notifyDepricatedEvent().validate(
137
153
  {},
138
154
  { abortEarly: false, allowUnknown: true }
@@ -211,6 +227,14 @@ class Webhook {
211
227
  { body, requestHeaders } = { requestHeaders: {} },
212
228
  { responseHeaders } = { responseHeaders: false }
213
229
  ) {
230
+ let invalidInput = [];
231
+ if (invalidInput.length) {
232
+ const error = new Error();
233
+ error.message = "Missing required field";
234
+ error.details = invalidInput;
235
+ return Promise.reject(new FDKClientValidationError(error));
236
+ }
237
+
214
238
  const {
215
239
  error,
216
240
  } = WebhookPublicValidator.queryWebhookEventDetails().validate(
@@ -291,6 +315,14 @@ class Webhook {
291
315
  { body, requestHeaders } = { requestHeaders: {} },
292
316
  { responseHeaders } = { responseHeaders: false }
293
317
  ) {
318
+ let invalidInput = [];
319
+ if (invalidInput.length) {
320
+ const error = new Error();
321
+ error.message = "Missing required field";
322
+ error.details = invalidInput;
323
+ return Promise.reject(new FDKClientValidationError(error));
324
+ }
325
+
294
326
  const {
295
327
  error,
296
328
  } = WebhookPublicValidator.testHandlerTransformation().validate(
@@ -371,6 +403,14 @@ class Webhook {
371
403
  { body, requestHeaders } = { requestHeaders: {} },
372
404
  { responseHeaders } = { responseHeaders: false }
373
405
  ) {
406
+ let invalidInput = [];
407
+ if (invalidInput.length) {
408
+ const error = new Error();
409
+ error.message = "Missing required field";
410
+ error.details = invalidInput;
411
+ return Promise.reject(new FDKClientValidationError(error));
412
+ }
413
+
374
414
  const { error } = WebhookPublicValidator.validateSchema().validate(
375
415
  { body },
376
416
  { abortEarly: false, allowUnknown: true }