@gofynd/fdk-client-javascript 1.0.3 → 1.0.4

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 (175) hide show
  1. package/README.md +31 -2
  2. package/index.d.ts +4 -4
  3. package/index.js +9 -10
  4. package/package.json +14 -14
  5. package/sdk/APIClient.d.ts +11 -0
  6. package/sdk/APIClient.js +35 -0
  7. package/sdk/Client.d.ts +6 -0
  8. package/sdk/Client.js +17 -0
  9. package/sdk/Config.d.ts +9 -0
  10. package/sdk/Config.js +17 -0
  11. package/sdk/application/Cart/CartApplicationClient.js +29 -28
  12. package/sdk/application/Cart/CartApplicationModel.js +3 -1
  13. package/sdk/application/Catalog/CatalogApplicationClient.js +43 -42
  14. package/sdk/application/Catalog/CatalogApplicationModel.js +1 -1
  15. package/sdk/application/Common/CommonApplicationClient.js +5 -4
  16. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -5
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +21 -20
  18. package/sdk/application/Content/ContentApplicationClient.js +26 -25
  19. package/sdk/application/Content/ContentApplicationModel.js +1 -0
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.js +6 -5
  21. package/sdk/application/Lead/LeadApplicationClient.js +10 -9
  22. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +1 -3
  23. package/sdk/application/Logistic/LogisticApplicationClient.js +11 -12
  24. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -1
  25. package/sdk/application/Order/OrderApplicationClient.js +15 -14
  26. package/sdk/application/Order/OrderApplicationModel.js +9 -0
  27. package/sdk/application/Payment/PaymentApplicationClient.js +42 -41
  28. package/sdk/application/PosCart/PosCartApplicationClient.js +30 -29
  29. package/sdk/application/PosCart/PosCartApplicationModel.js +3 -1
  30. package/sdk/application/Rewards/RewardsApplicationClient.js +11 -10
  31. package/sdk/application/Share/ShareApplicationClient.js +10 -9
  32. package/sdk/application/Theme/ThemeApplicationClient.js +7 -6
  33. package/sdk/application/User/UserApplicationClient.js +38 -37
  34. package/sdk/common/AxiosHelper.js +17 -6
  35. package/sdk/constructUrl.d.ts +5 -0
  36. package/sdk/constructUrl.js +13 -0
  37. package/sdk/index.d.ts +3 -0
  38. package/sdk/index.js +5 -0
  39. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +3 -1
  40. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +1 -1
  41. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
  42. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
  43. package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +3 -2
  44. package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +1 -0
  45. package/sdk/platform/Billing/BillingPlatformClient.js +3 -2
  46. package/sdk/platform/Billing/BillingPlatformValidator.js +1 -0
  47. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +27 -0
  48. package/sdk/platform/Cart/CartPlatformApplicationClient.js +177 -1
  49. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  50. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -1
  51. package/sdk/platform/Cart/CartPlatformModel.js +7 -3
  52. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +3 -1
  53. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -1
  54. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +2 -2
  55. package/sdk/platform/Catalog/CatalogPlatformClient.js +6 -9
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +7 -7
  57. package/sdk/platform/Catalog/CatalogPlatformValidator.js +2 -1
  58. package/sdk/platform/Common/CommonPlatformClient.js +7 -18
  59. package/sdk/platform/Common/CommonPlatformValidator.js +1 -0
  60. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +3 -1
  61. package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +1 -1
  62. package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
  63. package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
  64. package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +5 -4
  65. package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +1 -0
  66. package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +3 -1
  67. package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +1 -1
  68. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +9 -8
  69. package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +1 -0
  70. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
  71. package/sdk/platform/Content/ContentPlatformApplicationClient.js +3 -62
  72. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +0 -1
  73. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +1 -7
  74. package/sdk/platform/Content/ContentPlatformModel.js +1 -0
  75. package/sdk/platform/Discount/DiscountPlatformClient.js +3 -2
  76. package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -0
  77. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -3
  78. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +27 -5
  79. package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +1 -1
  80. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -3
  81. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +28 -6
  82. package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +1 -0
  83. package/sdk/platform/Inventory/InventoryPlatformClient.js +3 -2
  84. package/sdk/platform/Inventory/InventoryPlatformValidator.js +1 -0
  85. package/sdk/platform/Lead/LeadPlatformApplicationClient.js +3 -1
  86. package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +1 -1
  87. package/sdk/platform/Lead/LeadPlatformClient.js +4 -3
  88. package/sdk/platform/Lead/LeadPlatformValidator.js +1 -0
  89. package/sdk/platform/Order/OrderPlatformApplicationClient.js +3 -1
  90. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -1
  91. package/sdk/platform/Order/OrderPlatformClient.d.ts +1 -1
  92. package/sdk/platform/Order/OrderPlatformClient.js +16 -3
  93. package/sdk/platform/Order/OrderPlatformModel.js +1 -0
  94. package/sdk/platform/Order/OrderPlatformValidator.js +1 -0
  95. package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
  96. package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
  97. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +1 -1
  98. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +14 -14
  99. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +1 -1
  100. package/sdk/platform/Payment/PaymentPlatformClient.js +3 -2
  101. package/sdk/platform/Payment/PaymentPlatformValidator.js +1 -0
  102. package/sdk/platform/PlatformClient.d.ts +13 -9
  103. package/sdk/platform/PlatformClient.js +13 -9
  104. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +4 -4
  105. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +36 -17
  106. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +1 -1
  107. package/sdk/platform/Share/SharePlatformApplicationClient.js +3 -1
  108. package/sdk/platform/Share/SharePlatformApplicationValidator.js +1 -1
  109. package/sdk/platform/Theme/ThemePlatformApplicationClient.js +3 -1
  110. package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +1 -1
  111. package/sdk/platform/User/UserPlatformApplicationClient.js +3 -1
  112. package/sdk/platform/User/UserPlatformApplicationValidator.js +1 -1
  113. package/sdk/platform/Webhook/WebhookPlatformClient.js +3 -2
  114. package/sdk/platform/Webhook/WebhookPlatformValidator.js +1 -0
  115. package/sdk/public/Configuration/ConfigurationPublicClient.js +2 -0
  116. package/sdk/public/Inventory/InventoryPublicClient.js +2 -0
  117. package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
  118. package/.github/workflows/on_create_release.yml +0 -23
  119. package/.github/workflows/on_merge_main.yml +0 -38
  120. package/.github/workflows/on_pull_request.yml +0 -35
  121. package/.prettierrc +0 -5
  122. package/documentation/application/CART.md +0 -8771
  123. package/documentation/application/CATALOG.md +0 -8690
  124. package/documentation/application/COMMON.md +0 -325
  125. package/documentation/application/COMMUNICATION.md +0 -387
  126. package/documentation/application/CONFIGURATION.md +0 -2212
  127. package/documentation/application/CONTENT.md +0 -2629
  128. package/documentation/application/FILESTORAGE.md +0 -442
  129. package/documentation/application/LEAD.md +0 -1549
  130. package/documentation/application/LOGISTIC.md +0 -689
  131. package/documentation/application/ORDER.md +0 -2937
  132. package/documentation/application/PAYMENT.md +0 -4475
  133. package/documentation/application/POSCART.md +0 -9375
  134. package/documentation/application/README.md +0 -21
  135. package/documentation/application/REWARDS.md +0 -554
  136. package/documentation/application/SHARE.md +0 -635
  137. package/documentation/application/THEME.md +0 -5517
  138. package/documentation/application/USER.md +0 -3798
  139. package/documentation/platform/ANALYTICS.md +0 -1012
  140. package/documentation/platform/AUDITTRAIL.md +0 -493
  141. package/documentation/platform/BILLING.md +0 -1889
  142. package/documentation/platform/CART.md +0 -4711
  143. package/documentation/platform/CATALOG.md +0 -20522
  144. package/documentation/platform/COMMON.md +0 -325
  145. package/documentation/platform/COMMUNICATION.md +0 -4970
  146. package/documentation/platform/COMPANYPROFILE.md +0 -1646
  147. package/documentation/platform/CONFIGURATION.md +0 -6316
  148. package/documentation/platform/CONTENT.md +0 -8364
  149. package/documentation/platform/DISCOUNT.md +0 -767
  150. package/documentation/platform/FILESTORAGE.md +0 -945
  151. package/documentation/platform/INVENTORY.md +0 -1136
  152. package/documentation/platform/LEAD.md +0 -4394
  153. package/documentation/platform/ORDER.md +0 -6525
  154. package/documentation/platform/PARTNER.md +0 -193
  155. package/documentation/platform/PAYMENT.md +0 -3138
  156. package/documentation/platform/README.md +0 -27
  157. package/documentation/platform/REWARDS.md +0 -919
  158. package/documentation/platform/SHARE.md +0 -513
  159. package/documentation/platform/THEME.md +0 -35446
  160. package/documentation/platform/USER.md +0 -2174
  161. package/documentation/platform/WEBHOOK.md +0 -485
  162. package/documentation/public/CONFIGURATION.md +0 -325
  163. package/documentation/public/INVENTORY.md +0 -508
  164. package/documentation/public/WEBHOOK.md +0 -246
  165. package/jest.config.d.ts +0 -4
  166. package/jest.config.js +0 -6
  167. package/tests/application/catalog.spec.js +0 -54
  168. package/tests/common/action-url.spec.js +0 -35
  169. package/tests/common/schema/action-url.json +0 -178
  170. package/tests/common/schema/url-action.json +0 -683
  171. package/tests/common/url-action.spec.js +0 -48
  172. package/tests/helpers/cookie.helper.js +0 -31
  173. package/tests/helpers/oauth.helper.js +0 -43
  174. package/tests/platform/catalog.spec.js +0 -49
  175. package/tests/public/location.spec.js +0 -39
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const ConfigurationValidator = require("./ConfigurationPlatformValidator");
5
5
  const ConfigurationModel = require("./ConfigurationPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Configuration {
9
10
  constructor(config) {
@@ -175,7 +176,7 @@ class Configuration {
175
176
  });
176
177
  return data;
177
178
  };
178
- paginator.setCallback(callback);
179
+ paginator.setCallback(callback.bind(this));
179
180
  return paginator;
180
181
  }
181
182
 
@@ -272,7 +273,7 @@ class Configuration {
272
273
  });
273
274
  return data;
274
275
  };
275
- paginator.setCallback(callback);
276
+ paginator.setCallback(callback.bind(this));
276
277
  return paginator;
277
278
  }
278
279
 
@@ -441,7 +442,7 @@ class Configuration {
441
442
  });
442
443
  return data;
443
444
  };
444
- paginator.setCallback(callback);
445
+ paginator.setCallback(callback.bind(this));
445
446
  return paginator;
446
447
  }
447
448
 
@@ -1028,7 +1029,7 @@ class Configuration {
1028
1029
  });
1029
1030
  return data;
1030
1031
  };
1031
- paginator.setCallback(callback);
1032
+ paginator.setCallback(callback.bind(this));
1032
1033
  return paginator;
1033
1034
  }
1034
1035
 
@@ -1135,7 +1136,7 @@ class Configuration {
1135
1136
  });
1136
1137
  return data;
1137
1138
  };
1138
- paginator.setCallback(callback);
1139
+ paginator.setCallback(callback.bind(this));
1139
1140
  return paginator;
1140
1141
  }
1141
1142
 
@@ -1237,7 +1238,7 @@ class Configuration {
1237
1238
  });
1238
1239
  return data;
1239
1240
  };
1240
- paginator.setCallback(callback);
1241
+ paginator.setCallback(callback.bind(this));
1241
1242
  return paginator;
1242
1243
  }
1243
1244
 
@@ -132,4 +132,5 @@ class ConfigurationValidator {
132
132
  }).required();
133
133
  }
134
134
  }
135
+
135
136
  module.exports = ConfigurationValidator;
@@ -826,16 +826,6 @@ declare class Content {
826
826
  pathId: string;
827
827
  body: PathMappingSchema;
828
828
  }): Promise<PathMappingSchema>;
829
- /**
830
- * @param {Object} arg - Arg object.
831
- * @param {SeoComponent} arg.body
832
- * @returns {Promise<SeoSchema>} - Success response
833
- * @summary: Update SEO of application
834
- * @description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc.
835
- */
836
- updateSEOConfiguration({ body }?: {
837
- body: SeoComponent;
838
- }): Promise<SeoSchema>;
839
829
  /**
840
830
  * @param {Object} arg - Arg object.
841
831
  * @param {string} arg.id - ID allotted to the slideshow.
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
1
  const PlatformAPIClient = require("../PlatformAPIClient");
3
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const ContentValidator = require("./ContentPlatformApplicationValidator");
5
5
  const ContentModel = require("./ContentPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Content {
9
10
  constructor(config, applicationId) {
@@ -4325,67 +4326,6 @@ class Content {
4325
4326
  return response;
4326
4327
  }
4327
4328
 
4328
- /**
4329
- * @param {Object} arg - Arg object.
4330
- * @param {SeoComponent} arg.body
4331
- * @returns {Promise<SeoSchema>} - Success response
4332
- * @summary: Update SEO of application
4333
- * @description: Use this API to edit the SEO details of an application. This includes the sitemap, robot.txt, custom meta tags, etc.
4334
- */
4335
- async updateSEOConfiguration({ body } = {}) {
4336
- const { error } = ContentValidator.updateSEOConfiguration().validate(
4337
- {
4338
- body,
4339
- },
4340
- { abortEarly: false, allowUnknown: true }
4341
- );
4342
- if (error) {
4343
- return Promise.reject(new FDKClientValidationError(error));
4344
- }
4345
-
4346
- // Showing warrnings if extra unknown parameters are found
4347
- const {
4348
- error: warrning,
4349
- } = ContentValidator.updateSEOConfiguration().validate(
4350
- {
4351
- body,
4352
- },
4353
- { abortEarly: false, allowUnknown: false }
4354
- );
4355
- if (warrning) {
4356
- Logger({
4357
- level: "WARN",
4358
- message: "Parameter Validation warrnings for updateSEOConfiguration",
4359
- });
4360
- Logger({ level: "WARN", message: warrning });
4361
- }
4362
-
4363
- const query_params = {};
4364
-
4365
- const response = await PlatformAPIClient.execute(
4366
- this.config,
4367
- "post",
4368
- `/service/platform/content/v1.0/company/${this.config.companyId}/application/${this.applicationId}/seo`,
4369
- query_params,
4370
- body
4371
- );
4372
-
4373
- const { error: res_error } = ContentModel.SeoSchema().validate(response, {
4374
- abortEarly: false,
4375
- allowUnknown: false,
4376
- });
4377
-
4378
- if (res_error) {
4379
- Logger({
4380
- level: "WARN",
4381
- message: "Response Validation Warnnings for updateSEOConfiguration",
4382
- });
4383
- Logger({ level: "WARN", message: res_error });
4384
- }
4385
-
4386
- return response;
4387
- }
4388
-
4389
4329
  /**
4390
4330
  * @param {Object} arg - Arg object.
4391
4331
  * @param {string} arg.id - ID allotted to the slideshow.
@@ -4511,4 +4451,5 @@ class Content {
4511
4451
  return response;
4512
4452
  }
4513
4453
  }
4454
+
4514
4455
  module.exports = Content;
@@ -66,7 +66,6 @@ declare class ContentValidator {
66
66
  static updatePage(): any;
67
67
  static updatePagePreview(): any;
68
68
  static updatePathRedirectionRules(): any;
69
- static updateSEOConfiguration(): any;
70
69
  static updateSlideshow(): any;
71
70
  static updateSupportInformation(): any;
72
71
  }
@@ -1,6 +1,6 @@
1
1
  const Joi = require("joi");
2
- const ContentModel = require("./ContentPlatformModel");
3
2
 
3
+ const ContentModel = require("./ContentPlatformModel");
4
4
  class ContentValidator {
5
5
  static addDataLoader() {
6
6
  return Joi.object({
@@ -406,12 +406,6 @@ class ContentValidator {
406
406
  }).required();
407
407
  }
408
408
 
409
- static updateSEOConfiguration() {
410
- return Joi.object({
411
- body: ContentModel.SeoComponent().required(),
412
- }).required();
413
- }
414
-
415
409
  static updateSlideshow() {
416
410
  return Joi.object({
417
411
  id: Joi.string().allow("").required(),
@@ -347,6 +347,7 @@ class ContentModel {
347
347
  static Detail() {
348
348
  return Joi.object({
349
349
  description: Joi.string().allow(""),
350
+ image_url: Joi.string().allow(""),
350
351
  title: Joi.string().allow(""),
351
352
  });
352
353
  }
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const DiscountValidator = require("./DiscountPlatformValidator");
5
5
  const DiscountModel = require("./DiscountPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Discount {
9
10
  constructor(config) {
@@ -80,4 +80,5 @@ class DiscountValidator {
80
80
  }).required();
81
81
  }
82
82
  }
83
+
83
84
  module.exports = DiscountValidator;
@@ -28,7 +28,7 @@ declare class FileStorage {
28
28
  * After successfully upload, call `appCompleteUpload` api to complete the upload process.
29
29
  * This operation will return the url for the uploaded file.
30
30
  */
31
- appCompleteUpload({ namespace, body }?: {
31
+ appCompleteUpload({ namespace, body, }?: {
32
32
  namespace: string;
33
33
  body: StartResponse;
34
34
  }): Promise<CompleteResponse>;
@@ -69,7 +69,7 @@ declare class FileStorage {
69
69
  * After successfully upload, call `appCompleteUpload` api to complete the upload process.
70
70
  * This operation will return the url for the uploaded file.
71
71
  */
72
- appStartUpload({ namespace, body }?: {
72
+ appStartUpload({ namespace, body, }?: {
73
73
  namespace: string;
74
74
  body: StartRequest;
75
75
  }): Promise<StartResponse>;
@@ -81,7 +81,7 @@ declare class FileStorage {
81
81
  * @summary: Browse Files
82
82
  * @description: Browse Files
83
83
  */
84
- browse({ namespace, pageNo }?: {
84
+ browse({ namespace, pageNo, }?: {
85
85
  namespace: string;
86
86
  pageNo?: number;
87
87
  }): Promise<BrowseResponse>;
@@ -1,9 +1,12 @@
1
- const Paginator = require("../../common/Paginator");
2
1
  const PlatformAPIClient = require("../PlatformAPIClient");
3
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const FileStorageValidator = require("./FileStoragePlatformApplicationValidator");
5
5
  const FileStorageModel = require("./FileStoragePlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
8
+
9
+ const axios = require("axios");
7
10
 
8
11
  class FileStorage {
9
12
  constructor(config, applicationId) {
@@ -36,10 +39,15 @@ class FileStorage {
36
39
  * After successfully upload, call `appCompleteUpload` api to complete the upload process.
37
40
  * This operation will return the url for the uploaded file.
38
41
  */
39
- async appCompleteUpload({ namespace, body } = {}) {
42
+ async appCompleteUpload({
43
+ namespace,
44
+
45
+ body,
46
+ } = {}) {
40
47
  const { error } = FileStorageValidator.appCompleteUpload().validate(
41
48
  {
42
49
  namespace,
50
+
43
51
  body,
44
52
  },
45
53
  { abortEarly: false, allowUnknown: true }
@@ -54,6 +62,7 @@ class FileStorage {
54
62
  } = FileStorageValidator.appCompleteUpload().validate(
55
63
  {
56
64
  namespace,
65
+
57
66
  body,
58
67
  },
59
68
  { abortEarly: false, allowUnknown: false }
@@ -184,10 +193,15 @@ class FileStorage {
184
193
  * After successfully upload, call `appCompleteUpload` api to complete the upload process.
185
194
  * This operation will return the url for the uploaded file.
186
195
  */
187
- async appStartUpload({ namespace, body } = {}) {
196
+ async appStartUpload({
197
+ namespace,
198
+
199
+ body,
200
+ } = {}) {
188
201
  const { error } = FileStorageValidator.appStartUpload().validate(
189
202
  {
190
203
  namespace,
204
+
191
205
  body,
192
206
  },
193
207
  { abortEarly: false, allowUnknown: true }
@@ -200,6 +214,7 @@ class FileStorage {
200
214
  const { error: warrning } = FileStorageValidator.appStartUpload().validate(
201
215
  {
202
216
  namespace,
217
+
203
218
  body,
204
219
  },
205
220
  { abortEarly: false, allowUnknown: false }
@@ -248,10 +263,15 @@ class FileStorage {
248
263
  * @summary: Browse Files
249
264
  * @description: Browse Files
250
265
  */
251
- async browse({ namespace, pageNo } = {}) {
266
+ async browse({
267
+ namespace,
268
+
269
+ pageNo,
270
+ } = {}) {
252
271
  const { error } = FileStorageValidator.browse().validate(
253
272
  {
254
273
  namespace,
274
+
255
275
  pageNo,
256
276
  },
257
277
  { abortEarly: false, allowUnknown: true }
@@ -264,6 +284,7 @@ class FileStorage {
264
284
  const { error: warrning } = FileStorageValidator.browse().validate(
265
285
  {
266
286
  namespace,
287
+
267
288
  pageNo,
268
289
  },
269
290
  { abortEarly: false, allowUnknown: false }
@@ -335,7 +356,6 @@ class FileStorage {
335
356
  return paginator;
336
357
  }
337
358
  }
338
- module.exports = FileStorage;
339
359
 
340
360
  /**
341
361
  * @param data
@@ -385,3 +405,5 @@ FileStorage.prototype.upload = function ({
385
405
  }
386
406
  });
387
407
  };
408
+
409
+ module.exports = FileStorage;
@@ -1,6 +1,6 @@
1
1
  const Joi = require("joi");
2
- const FileStorageModel = require("./FileStoragePlatformModel");
3
2
 
3
+ const FileStorageModel = require("./FileStoragePlatformModel");
4
4
  class FileStorageValidator {
5
5
  static appCompleteUpload() {
6
6
  return Joi.object({
@@ -10,7 +10,7 @@ declare class FileStorage {
10
10
  * @summary: Browse Files
11
11
  * @description: Browse Files
12
12
  */
13
- browse({ namespace, pageNo }?: {
13
+ browse({ namespace, pageNo, }?: {
14
14
  namespace: string;
15
15
  pageNo?: number;
16
16
  }): Promise<BrowseResponse>;
@@ -48,7 +48,7 @@ declare class FileStorage {
48
48
  * After successfully upload, call `completeUpload` api to complete the upload process.
49
49
  * This operation will return the url for the uploaded file.
50
50
  */
51
- completeUpload({ namespace, body }?: {
51
+ completeUpload({ namespace, body, }?: {
52
52
  namespace: string;
53
53
  body: StartResponse;
54
54
  }): Promise<CompleteResponse>;
@@ -109,7 +109,7 @@ declare class FileStorage {
109
109
  * After successfully upload, call `completeUpload` api to complete the upload process.
110
110
  * This operation will return the url for the uploaded file.
111
111
  */
112
- startUpload({ namespace, body }?: {
112
+ startUpload({ namespace, body, }?: {
113
113
  namespace: string;
114
114
  body: StartRequest;
115
115
  }): Promise<StartResponse>;
@@ -1,9 +1,12 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const FileStorageValidator = require("./FileStoragePlatformValidator");
5
5
  const FileStorageModel = require("./FileStoragePlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
8
+
9
+ const axios = require("axios");
7
10
 
8
11
  class FileStorage {
9
12
  constructor(config) {
@@ -18,10 +21,15 @@ class FileStorage {
18
21
  * @summary: Browse Files
19
22
  * @description: Browse Files
20
23
  */
21
- async browse({ namespace, pageNo } = {}) {
24
+ async browse({
25
+ namespace,
26
+
27
+ pageNo,
28
+ } = {}) {
22
29
  const { error } = FileStorageValidator.browse().validate(
23
30
  {
24
31
  namespace,
32
+
25
33
  pageNo,
26
34
  },
27
35
  { abortEarly: false, allowUnknown: true }
@@ -34,6 +42,7 @@ class FileStorage {
34
42
  const { error: warrning } = FileStorageValidator.browse().validate(
35
43
  {
36
44
  namespace,
45
+
37
46
  pageNo,
38
47
  },
39
48
  { abortEarly: false, allowUnknown: false }
@@ -92,6 +101,7 @@ class FileStorage {
92
101
  const pageType = "number";
93
102
  const data = await this.browse({
94
103
  namespace: namespace,
104
+
95
105
  pageNo: pageNo,
96
106
  });
97
107
  paginator.setPaginator({
@@ -100,7 +110,7 @@ class FileStorage {
100
110
  });
101
111
  return data;
102
112
  };
103
- paginator.setCallback(callback);
113
+ paginator.setCallback(callback.bind(this));
104
114
  return paginator;
105
115
  }
106
116
 
@@ -129,10 +139,15 @@ class FileStorage {
129
139
  * After successfully upload, call `completeUpload` api to complete the upload process.
130
140
  * This operation will return the url for the uploaded file.
131
141
  */
132
- async completeUpload({ namespace, body } = {}) {
142
+ async completeUpload({
143
+ namespace,
144
+
145
+ body,
146
+ } = {}) {
133
147
  const { error } = FileStorageValidator.completeUpload().validate(
134
148
  {
135
149
  namespace,
150
+
136
151
  body,
137
152
  },
138
153
  { abortEarly: false, allowUnknown: true }
@@ -145,6 +160,7 @@ class FileStorage {
145
160
  const { error: warrning } = FileStorageValidator.completeUpload().validate(
146
161
  {
147
162
  namespace,
163
+
148
164
  body,
149
165
  },
150
166
  { abortEarly: false, allowUnknown: false }
@@ -407,10 +423,15 @@ class FileStorage {
407
423
  * After successfully upload, call `completeUpload` api to complete the upload process.
408
424
  * This operation will return the url for the uploaded file.
409
425
  */
410
- async startUpload({ namespace, body } = {}) {
426
+ async startUpload({
427
+ namespace,
428
+
429
+ body,
430
+ } = {}) {
411
431
  const { error } = FileStorageValidator.startUpload().validate(
412
432
  {
413
433
  namespace,
434
+
414
435
  body,
415
436
  },
416
437
  { abortEarly: false, allowUnknown: true }
@@ -423,6 +444,7 @@ class FileStorage {
423
444
  const { error: warrning } = FileStorageValidator.startUpload().validate(
424
445
  {
425
446
  namespace,
447
+
426
448
  body,
427
449
  },
428
450
  { abortEarly: false, allowUnknown: false }
@@ -42,4 +42,5 @@ class FileStorageValidator {
42
42
  }).required();
43
43
  }
44
44
  }
45
+
45
46
  module.exports = FileStorageValidator;
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const InventoryValidator = require("./InventoryPlatformValidator");
5
5
  const InventoryModel = require("./InventoryPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Inventory {
9
10
  constructor(config) {
@@ -79,4 +79,5 @@ class InventoryValidator {
79
79
  }).required();
80
80
  }
81
81
  }
82
+
82
83
  module.exports = InventoryValidator;
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
1
  const PlatformAPIClient = require("../PlatformAPIClient");
3
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const LeadValidator = require("./LeadPlatformApplicationValidator");
5
5
  const LeadModel = require("./LeadPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Lead {
9
10
  constructor(config, applicationId) {
@@ -815,4 +816,5 @@ class Lead {
815
816
  return response;
816
817
  }
817
818
  }
819
+
818
820
  module.exports = Lead;
@@ -1,6 +1,6 @@
1
1
  const Joi = require("joi");
2
- const LeadModel = require("./LeadPlatformModel");
3
2
 
3
+ const LeadModel = require("./LeadPlatformModel");
4
4
  class LeadValidator {
5
5
  static closeVideoRoom() {
6
6
  return Joi.object({
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
- const { FDKClientValidationError } = require("../../common/FDKError");
3
1
  const PlatformAPIClient = require("../PlatformAPIClient");
2
+ const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const LeadValidator = require("./LeadPlatformValidator");
5
5
  const LeadModel = require("./LeadPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Lead {
9
10
  constructor(config) {
@@ -600,7 +601,7 @@ class Lead {
600
601
  });
601
602
  return data;
602
603
  };
603
- paginator.setCallback(callback);
604
+ paginator.setCallback(callback.bind(this));
604
605
  return paginator;
605
606
  }
606
607
 
@@ -76,4 +76,5 @@ class LeadValidator {
76
76
  }).required();
77
77
  }
78
78
  }
79
+
79
80
  module.exports = LeadValidator;
@@ -1,9 +1,10 @@
1
- const Paginator = require("../../common/Paginator");
2
1
  const PlatformAPIClient = require("../PlatformAPIClient");
3
2
  const { FDKClientValidationError } = require("../../common/FDKError");
3
+ const Paginator = require("../../common/Paginator");
4
4
  const OrderValidator = require("./OrderPlatformApplicationValidator");
5
5
  const OrderModel = require("./OrderPlatformModel");
6
6
  const { Logger } = require("./../../common/Logger");
7
+ const Joi = require("joi");
7
8
 
8
9
  class Order {
9
10
  constructor(config, applicationId) {
@@ -268,4 +269,5 @@ class Order {
268
269
  return response;
269
270
  }
270
271
  }
272
+
271
273
  module.exports = Order;
@@ -1,6 +1,6 @@
1
1
  const Joi = require("joi");
2
- const OrderModel = require("./OrderPlatformModel");
3
2
 
3
+ const OrderModel = require("./OrderPlatformModel");
4
4
  class OrderValidator {
5
5
  static getAppOrderShipmentDetails() {
6
6
  return Joi.object({
@@ -43,7 +43,7 @@ declare class Order {
43
43
  * @summary:
44
44
  * @description:
45
45
  */
46
- click2Call({ caller, receiver, bagId, callingTo, callerId }?: {
46
+ click2Call({ caller, receiver, bagId, callingTo, callerId, }?: {
47
47
  caller: string;
48
48
  receiver: string;
49
49
  bagId: string;