@gofynd/fdk-client-javascript 0.1.35 → 0.1.36

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 (109) hide show
  1. package/README.md +1 -1
  2. package/documentation/application/CART.md +256 -239
  3. package/documentation/application/CATALOG.md +413 -409
  4. package/documentation/application/COMMON.md +4 -0
  5. package/documentation/application/COMMUNICATION.md +4 -0
  6. package/documentation/application/CONFIGURATION.md +4 -0
  7. package/documentation/application/CONTENT.md +7 -20
  8. package/documentation/application/FILESTORAGE.md +85 -0
  9. package/documentation/application/LEAD.md +6 -2
  10. package/documentation/application/LOGISTIC.md +4 -0
  11. package/documentation/application/ORDER.md +307 -303
  12. package/documentation/application/PAYMENT.md +445 -259
  13. package/documentation/application/POSCART.md +317 -300
  14. package/documentation/application/REWARDS.md +153 -160
  15. package/documentation/application/SHARE.md +4 -0
  16. package/documentation/application/THEME.md +4 -0
  17. package/documentation/application/USER.md +4 -0
  18. package/documentation/platform/ANALYTICS.md +4 -0
  19. package/documentation/platform/AUDITTRAIL.md +4 -0
  20. package/documentation/platform/BILLING.md +4 -0
  21. package/documentation/platform/CART.md +480 -463
  22. package/documentation/platform/CATALOG.md +3895 -2942
  23. package/documentation/platform/COMMON.md +4 -0
  24. package/documentation/platform/COMMUNICATION.md +4 -0
  25. package/documentation/platform/COMPANYPROFILE.md +224 -193
  26. package/documentation/platform/CONFIGURATION.md +4 -0
  27. package/documentation/platform/CONTENT.md +8 -21
  28. package/documentation/platform/DISCOUNT.md +4 -0
  29. package/documentation/platform/FILESTORAGE.md +85 -0
  30. package/documentation/platform/INVENTORY.md +4 -0
  31. package/documentation/platform/LEAD.md +6 -2
  32. package/documentation/platform/ORDER.md +6298 -1448
  33. package/documentation/platform/PARTNER.md +12 -8
  34. package/documentation/platform/PAYMENT.md +107 -103
  35. package/documentation/platform/README.md +2 -2
  36. package/documentation/platform/REWARDS.md +219 -152
  37. package/documentation/platform/SHARE.md +4 -0
  38. package/documentation/platform/THEME.md +4 -0
  39. package/documentation/platform/USER.md +4 -0
  40. package/documentation/platform/WEBHOOK.md +4 -0
  41. package/documentation/public/CONFIGURATION.md +4 -0
  42. package/documentation/public/INVENTORY.md +4 -0
  43. package/documentation/public/WEBHOOK.md +4 -0
  44. package/package.json +1 -1
  45. package/sdk/application/ApplicationModels.d.ts +77 -73
  46. package/sdk/application/ApplicationModels.js +1751 -1725
  47. package/sdk/application/client/CartApplicationClient.d.ts +36 -36
  48. package/sdk/application/client/CatalogApplicationClient.d.ts +39 -39
  49. package/sdk/application/client/CatalogApplicationClient.js +16 -16
  50. package/sdk/application/client/CommonApplicationClient.d.ts +2 -2
  51. package/sdk/application/client/CommunicationApplicationClient.d.ts +5 -5
  52. package/sdk/application/client/ConfigurationApplicationClient.d.ts +17 -17
  53. package/sdk/application/client/ContentApplicationClient.d.ts +19 -19
  54. package/sdk/application/client/FileStorageApplicationClient.d.ts +14 -6
  55. package/sdk/application/client/FileStorageApplicationClient.js +2 -0
  56. package/sdk/application/client/LeadApplicationClient.d.ts +10 -10
  57. package/sdk/application/client/LogisticApplicationClient.d.ts +5 -5
  58. package/sdk/application/client/OrderApplicationClient.d.ts +15 -15
  59. package/sdk/application/client/OrderApplicationClient.js +1 -1
  60. package/sdk/application/client/PaymentApplicationClient.d.ts +79 -57
  61. package/sdk/application/client/PaymentApplicationClient.js +66 -0
  62. package/sdk/application/client/PosCartApplicationClient.d.ts +38 -38
  63. package/sdk/application/client/RewardsApplicationClient.d.ts +34 -34
  64. package/sdk/application/client/RewardsApplicationClient.js +77 -77
  65. package/sdk/application/client/ShareApplicationClient.d.ts +8 -8
  66. package/sdk/application/client/ThemeApplicationClient.d.ts +4 -4
  67. package/sdk/application/client/UserApplicationClient.d.ts +63 -63
  68. package/sdk/application/models/CatalogValidator.d.ts +1 -1
  69. package/sdk/application/models/CatalogValidator.js +2 -2
  70. package/sdk/application/models/PaymentValidator.d.ts +2 -0
  71. package/sdk/application/models/PaymentValidator.js +12 -0
  72. package/sdk/application/models/RewardsValidator.d.ts +3 -3
  73. package/sdk/application/models/RewardsValidator.js +12 -12
  74. package/sdk/common/AxiosHelper.js +1 -1
  75. package/sdk/common/Constant.d.ts +9 -0
  76. package/sdk/common/Constant.js +11 -0
  77. package/sdk/platform/PlatformApplicationClient.d.ts +8600 -7286
  78. package/sdk/platform/PlatformApplicationClient.js +4338 -3678
  79. package/sdk/platform/PlatformApplicationModels.d.ts +21 -26
  80. package/sdk/platform/PlatformApplicationModels.js +5561 -4301
  81. package/sdk/platform/PlatformClient.d.ts +3448 -2801
  82. package/sdk/platform/PlatformClient.js +3903 -3108
  83. package/sdk/platform/PlatformModels.d.ts +352 -278
  84. package/sdk/platform/PlatformModels.js +5230 -3942
  85. package/sdk/platform/client/AnalyticsPlatformClient.d.ts +5 -5
  86. package/sdk/platform/client/AuditTrailPlatformClient.d.ts +1 -1
  87. package/sdk/platform/client/BillingPlatformClient.d.ts +4 -4
  88. package/sdk/platform/client/CatalogPlatformClient.d.ts +209 -150
  89. package/sdk/platform/client/CatalogPlatformClient.js +441 -294
  90. package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +8 -8
  91. package/sdk/platform/client/ConfigurationPlatformClient.d.ts +9 -9
  92. package/sdk/platform/client/DiscountPlatformClient.d.ts +4 -4
  93. package/sdk/platform/client/FileStoragePlatformClient.d.ts +20 -4
  94. package/sdk/platform/client/FileStoragePlatformClient.js +49 -0
  95. package/sdk/platform/client/InventoryPlatformClient.d.ts +3 -3
  96. package/sdk/platform/client/LeadPlatformClient.d.ts +6 -6
  97. package/sdk/platform/client/OrderPlatformClient.d.ts +557 -131
  98. package/sdk/platform/client/OrderPlatformClient.js +1551 -247
  99. package/sdk/platform/client/PaymentPlatformClient.d.ts +4 -4
  100. package/sdk/platform/client/WebhookPlatformClient.d.ts +2 -2
  101. package/sdk/platform/models/CatalogValidator.d.ts +24 -21
  102. package/sdk/platform/models/CatalogValidator.js +103 -72
  103. package/sdk/platform/models/OrderValidator.d.ts +43 -11
  104. package/sdk/platform/models/OrderValidator.js +312 -51
  105. package/sdk/public/client/ConfigurationPublicClient.d.ts +2 -2
  106. package/sdk/public/client/InventoryPublicClient.d.ts +7 -7
  107. package/sdk/public/client/WebhookPublicClient.d.ts +3 -3
  108. package/tests/common/schema/action-url.json +15 -0
  109. package/tests/common/schema/url-action.json +16 -0
@@ -15,7 +15,7 @@ declare class CompanyProfile {
15
15
  * @description: This API allows to edit the company profile of the seller account.
16
16
  */
17
17
  updateCompany({ body }?: {
18
- body: any;
18
+ body: UpdateCompany;
19
19
  }): Promise<any>;
20
20
  /**
21
21
  * @param {Object} arg - Arg object.
@@ -41,7 +41,7 @@ declare class CompanyProfile {
41
41
  */
42
42
  editBrand({ brandId, body }?: {
43
43
  brandId: string;
44
- body: any;
44
+ body: CreateUpdateBrandRequestSerializer;
45
45
  }): Promise<any>;
46
46
  /**
47
47
  * @param {Object} arg - Arg object.
@@ -50,7 +50,7 @@ declare class CompanyProfile {
50
50
  * @description: This API allows to create a brand associated to a company.
51
51
  */
52
52
  createBrand({ body }?: {
53
- body: any;
53
+ body: CreateUpdateBrandRequestSerializer;
54
54
  }): Promise<any>;
55
55
  /**
56
56
  * @param {Object} arg - Arg object.
@@ -86,7 +86,7 @@ declare class CompanyProfile {
86
86
  * @description: This API allows to create a company brand mapping, for a already existing brand in the system.
87
87
  */
88
88
  createCompanyBrandMapping({ body }?: {
89
- body: any;
89
+ body: CompanyBrandPostRequestSerializer;
90
90
  }): Promise<any>;
91
91
  /**
92
92
  * @param {Object} arg - Arg object.
@@ -138,7 +138,7 @@ declare class CompanyProfile {
138
138
  * @description: This API allows to edit a location associated to a company.
139
139
  */
140
140
  createLocation({ body }?: {
141
- body: any;
141
+ body: LocationSerializer;
142
142
  }): Promise<any>;
143
143
  /**
144
144
  * @param {Object} arg - Arg object.
@@ -158,7 +158,7 @@ declare class CompanyProfile {
158
158
  */
159
159
  updateLocation({ locationId, body }?: {
160
160
  locationId: string;
161
- body: any;
161
+ body: LocationSerializer;
162
162
  }): Promise<any>;
163
163
  /**
164
164
  * @param {Object} arg - Arg object.
@@ -167,7 +167,7 @@ declare class CompanyProfile {
167
167
  * @description: This API allows to create a location associated to a company.
168
168
  */
169
169
  createLocationBulk({ body }?: {
170
- body: any;
170
+ body: BulkLocationSerializer;
171
171
  }): Promise<any>;
172
172
  /**
173
173
  * @param {Object} arg - Arg object.
@@ -176,7 +176,7 @@ declare class CompanyProfile {
176
176
  * @description:
177
177
  */
178
178
  getOptimalLocations({ body }?: {
179
- body: any;
179
+ body: AssignStoreRequestValidator;
180
180
  }): Promise<any>;
181
181
  }
182
182
  import Paginator = require("../../common/Paginator");
@@ -9,7 +9,7 @@ declare class Configuration {
9
9
  * @description: Create new application
10
10
  */
11
11
  createApplication({ body }?: {
12
- body: any;
12
+ body: CreateApplicationRequest;
13
13
  }): Promise<any>;
14
14
  /**
15
15
  * @param {Object} arg - Arg object.
@@ -48,7 +48,7 @@ declare class Configuration {
48
48
  * @description: Check domain availibility before linking to application. Also sends domain suggestions with similar to queried domain. \ Custom domain search is currently powered by GoDaddy provider.
49
49
  */
50
50
  getDomainAvailibility({ body }?: {
51
- body: any;
51
+ body: DomainSuggestionsRequest;
52
52
  }): Promise<any>;
53
53
  /**
54
54
  * @param {Object} arg - Arg object.
@@ -133,7 +133,7 @@ declare class Configuration {
133
133
  updateLevelIntegration({ id, level, body }?: {
134
134
  id: string;
135
135
  level: string;
136
- body: any;
136
+ body: UpdateIntegrationLevelRequest;
137
137
  }): Promise<any>;
138
138
  /**
139
139
  * @param {Object} arg - Arg object.
@@ -161,7 +161,7 @@ declare class Configuration {
161
161
  id: string;
162
162
  level: string;
163
163
  uid: number;
164
- body: any;
164
+ body: IntegrationLevel;
165
165
  }): Promise<any>;
166
166
  /**
167
167
  * @param {Object} arg - Arg object.
@@ -196,7 +196,7 @@ declare class Configuration {
196
196
  getCompanyByBrands({ body, pageNo, pageSize }?: {
197
197
  pageNo?: number;
198
198
  pageSize?: number;
199
- body: any;
199
+ body: CompanyByBrandsRequest;
200
200
  }): Promise<any>;
201
201
  /**
202
202
  * @param {Object} arg - Arg object.
@@ -207,7 +207,7 @@ declare class Configuration {
207
207
  */
208
208
  getCompanyByBrandsPaginator({ pageSize, body }?: {
209
209
  pageSize?: number;
210
- body: any;
210
+ body: CompanyByBrandsRequest;
211
211
  }): Paginator;
212
212
  /**
213
213
  * @param {Object} arg - Arg object.
@@ -220,7 +220,7 @@ declare class Configuration {
220
220
  getStoreByBrands({ body, pageNo, pageSize }?: {
221
221
  pageNo?: number;
222
222
  pageSize?: number;
223
- body: any;
223
+ body: StoreByBrandsRequest;
224
224
  }): Promise<any>;
225
225
  /**
226
226
  * @param {Object} arg - Arg object.
@@ -231,7 +231,7 @@ declare class Configuration {
231
231
  */
232
232
  getStoreByBrandsPaginator({ pageSize, body }?: {
233
233
  pageSize?: number;
234
- body: any;
234
+ body: StoreByBrandsRequest;
235
235
  }): Paginator;
236
236
  /**
237
237
  * @param {Object} arg - Arg object.
@@ -271,7 +271,7 @@ declare class Configuration {
271
271
  */
272
272
  optOutFromApplication({ id, body }?: {
273
273
  id: string;
274
- body: any;
274
+ body: OptOutInventory;
275
275
  }): Promise<any>;
276
276
  }
277
277
  import Paginator = require("../../common/Paginator");
@@ -35,7 +35,7 @@ declare class Discount {
35
35
  * @description: Create Discount.
36
36
  */
37
37
  createDiscount({ body }?: {
38
- body: any;
38
+ body: CreateUpdateDiscount;
39
39
  }): Promise<any>;
40
40
  /**
41
41
  * @param {Object} arg - Arg object.
@@ -55,7 +55,7 @@ declare class Discount {
55
55
  */
56
56
  updateDiscount({ id, body }?: {
57
57
  id: string;
58
- body: any;
58
+ body: CreateUpdateDiscount;
59
59
  }): Promise<any>;
60
60
  /**
61
61
  * @param {Object} arg - Arg object.
@@ -66,7 +66,7 @@ declare class Discount {
66
66
  */
67
67
  validateDiscountFile({ body, discount }?: {
68
68
  discount?: string;
69
- body: any;
69
+ body: DiscountJob;
70
70
  }): Promise<any>;
71
71
  /**
72
72
  * @param {Object} arg - Arg object.
@@ -77,7 +77,7 @@ declare class Discount {
77
77
  */
78
78
  downloadDiscountFile({ type, body }?: {
79
79
  type: string;
80
- body: any;
80
+ body: DownloadFileJob;
81
81
  }): Promise<any>;
82
82
  /**
83
83
  * @param {Object} arg - Arg object.
@@ -28,7 +28,7 @@ declare class FileStorage {
28
28
  */
29
29
  startUpload({ namespace, body }?: {
30
30
  namespace: string;
31
- body: any;
31
+ body: StartRequest;
32
32
  }): Promise<any>;
33
33
  /**
34
34
  * @param {Object} arg - Arg object.
@@ -56,7 +56,7 @@ declare class FileStorage {
56
56
  */
57
57
  completeUpload({ namespace, body }?: {
58
58
  namespace: string;
59
- body: any;
59
+ body: StartResponse;
60
60
  }): Promise<any>;
61
61
  /**
62
62
  * @param {Object} arg - Arg object.
@@ -65,7 +65,7 @@ declare class FileStorage {
65
65
  * @description: Describe here
66
66
  */
67
67
  getSignUrls({ body }?: {
68
- body: any;
68
+ body: SignUrlRequest;
69
69
  }): Promise<any>;
70
70
  /**
71
71
  * @param {Object} arg - Arg object.
@@ -76,7 +76,7 @@ declare class FileStorage {
76
76
  */
77
77
  copyFiles({ body, sync }?: {
78
78
  sync?: boolean;
79
- body: any;
79
+ body: BulkRequest;
80
80
  }): Promise<any>;
81
81
  /**
82
82
  * @param {Object} arg - Arg object.
@@ -107,5 +107,21 @@ declare class FileStorage {
107
107
  proxy({ url }?: {
108
108
  url: string;
109
109
  }): Promise<any>;
110
+ /**
111
+ * @param data
112
+ * @param {string} file_name
113
+ * @param {string} content_type
114
+ * @param {string} namespace
115
+ * @param {number} size
116
+ * @param {number} tags
117
+ */
118
+ upload({ data, file_name, content_type, namespace, size, tags, }?: {
119
+ data: any;
120
+ file_name: any;
121
+ content_type: any;
122
+ namespace: any;
123
+ size: any;
124
+ tags: any;
125
+ }): Promise<any>;
110
126
  }
111
127
  import Paginator = require("../../common/Paginator");
@@ -265,4 +265,53 @@ class FileStorage {
265
265
  }
266
266
  }
267
267
 
268
+ /**
269
+ * @param data
270
+ * @param {string} file_name
271
+ * @param {string} content_type
272
+ * @param {string} namespace
273
+ * @param {number} size
274
+ * @param {number} tags
275
+ */
276
+ FileStorage.prototype.upload = function ({
277
+ data,
278
+ file_name,
279
+ content_type,
280
+ namespace,
281
+ size,
282
+ tags,
283
+ } = {}) {
284
+ return new Promise(async (resolve, reject) => {
285
+ try {
286
+ const dataObj = await this.startUpload({
287
+ namespace,
288
+ body: {
289
+ file_name,
290
+ content_type,
291
+ size: size,
292
+ tags: tags,
293
+ },
294
+ });
295
+ if (dataObj.upload && dataObj.upload.url) {
296
+ await axios.put(dataObj.upload.url, data, {
297
+ withCredentials: false,
298
+ headers: { "Content-Type": content_type },
299
+ });
300
+ } else {
301
+ reject({ message: "Failed to upload file" });
302
+ }
303
+ delete dataObj.tags;
304
+
305
+ const completeRes = await this.completeUpload({
306
+ namespace,
307
+ body: dataObj,
308
+ });
309
+
310
+ resolve(completeRes);
311
+ } catch (err) {
312
+ reject(err);
313
+ }
314
+ });
315
+ };
316
+
268
317
  module.exports = FileStorage;
@@ -20,7 +20,7 @@ declare class Inventory {
20
20
  * @description: REST Endpoint that updates a job config
21
21
  */
22
22
  updateJob({ body }?: {
23
- body: any;
23
+ body: JobConfigDTO;
24
24
  }): Promise<any>;
25
25
  /**
26
26
  * @param {Object} arg - Arg object.
@@ -29,7 +29,7 @@ declare class Inventory {
29
29
  * @description: REST Endpoint that creates a new job config
30
30
  */
31
31
  createJob({ body }?: {
32
- body: any;
32
+ body: JobConfigDTO;
33
33
  }): Promise<any>;
34
34
  /**
35
35
  * @param {Object} arg - Arg object.
@@ -38,7 +38,7 @@ declare class Inventory {
38
38
  * @description: REST Endpoint that returns all configuration detail of a company
39
39
  */
40
40
  suppressStores({ body }?: {
41
- body: any;
41
+ body: SuppressStorePayload;
42
42
  }): Promise<any>;
43
43
  /**
44
44
  * @param {Object} arg - Arg object.
@@ -24,7 +24,7 @@ declare class Lead {
24
24
  filters?: boolean;
25
25
  q?: string;
26
26
  status?: string;
27
- priority?: any;
27
+ priority?: PriorityEnum;
28
28
  category?: string;
29
29
  pageNo?: number;
30
30
  pageSize?: number;
@@ -49,7 +49,7 @@ declare class Lead {
49
49
  filters?: boolean;
50
50
  q?: string;
51
51
  status?: string;
52
- priority?: any;
52
+ priority?: PriorityEnum;
53
53
  category?: string;
54
54
  pageSize?: number;
55
55
  }): Paginator;
@@ -60,7 +60,7 @@ declare class Lead {
60
60
  * @description: Creates a company level ticket
61
61
  */
62
62
  createTicket({ body }?: {
63
- body: any;
63
+ body: AddTicketPayload;
64
64
  }): Promise<any>;
65
65
  /**
66
66
  * @param {Object} arg - Arg object.
@@ -80,7 +80,7 @@ declare class Lead {
80
80
  */
81
81
  editTicket({ id, body }?: {
82
82
  id: string;
83
- body: any;
83
+ body: EditTicketPayload;
84
84
  }): Promise<any>;
85
85
  /**
86
86
  * @param {Object} arg - Arg object.
@@ -91,7 +91,7 @@ declare class Lead {
91
91
  */
92
92
  createHistory({ id, body }?: {
93
93
  id: string;
94
- body: any;
94
+ body: TicketHistoryPayload;
95
95
  }): Promise<any>;
96
96
  /**
97
97
  * @param {Object} arg - Arg object.
@@ -120,7 +120,7 @@ declare class Lead {
120
120
  */
121
121
  submitFeedback({ id, body }?: {
122
122
  id: string;
123
- body: any;
123
+ body: TicketFeedbackPayload;
124
124
  }): Promise<any>;
125
125
  /**
126
126
  * @param {Object} arg - Arg object.