@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,945 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
- ##### [Back to Platform docs](./README.md)
7
-
8
- ## FileStorage Methods
9
- File Storage
10
-
11
- * [upload](#upload)
12
-
13
- * [appCompleteUpload](#appcompleteupload)
14
- * [appCopyFiles](#appcopyfiles)
15
- * [appStartUpload](#appstartupload)
16
- * [browse](#browse)
17
- * [browse](#browse)
18
- * [completeUpload](#completeupload)
19
- * [copyFiles](#copyfiles)
20
- * [getSignUrls](#getsignurls)
21
- * [proxy](#proxy)
22
- * [startUpload](#startupload)
23
-
24
-
25
-
26
- ## Methods with example and description
27
-
28
-
29
-
30
-
31
- ### upload
32
- method which internally calls `startUpload` and `completeUpload` method to handle the whole file upload flow.
33
-
34
-
35
- ```javascript
36
- // Promise
37
- const promise = fileStorage.upload({
38
- data,
39
- file_name,
40
- content_type,
41
- namespace,
42
- size,
43
- tags,
44
- });
45
-
46
- // Async/Await
47
- const data = await fileStorage.upload({
48
- data,
49
- file_name,
50
- content_type,
51
- namespace,
52
- size,
53
- tags,
54
- });
55
- ```
56
- | Argument | Type | Required | Description |
57
- | --------- | ----- | -------- | ----------- |
58
- | data | file | yes | File which needs to be uploaded |
59
- | file_name | string | yes | Name of the file |
60
- | content_type | string | yes | type of file |
61
- | namespace | string | yes | Name of the bucket created for storing objects |
62
- | size | number | yes | File size |
63
- | tags | [string] | yes | |
64
-
65
-
66
- Use this API to perform the upload of an arbitrarily sized buffer or blob.
67
-
68
-
69
-
70
- *Returned Response:*
71
-
72
- [CompleteResponse](#CompleteResponse)
73
-
74
-
75
-
76
- <details>
77
- <summary><i>&nbsp; Example:</i></summary>
78
-
79
- ```json
80
- {
81
- "file_name":"logo.png",
82
- "file_path":"/path/to/file/logo.png",
83
- "success":true,
84
- "namespace":"namespace",
85
- "content_type":"image/png",
86
- "size":1024,
87
- "operation":"putObject",
88
- "tags":[],
89
- "cdn":{
90
- "url":"https://cdn.pixelbin.io/v2/logo.png",
91
- "absolute_url":"https://cdn.pixelbin.io/v2/logo.png",
92
- "relative_url":"logo.png"
93
- },
94
- "_id":"63dbbxxxxxxxxxxxxdecc69f",
95
- "created_by":{
96
- "username":"username_gofynd_com"
97
- },
98
- "created_on":"2023-01-01T12:00:00.000Z",
99
- "modified_on":"2023-01-01T00:00:00.000Z"
100
- }
101
- ```
102
- </details>
103
-
104
- ---
105
-
106
-
107
-
108
-
109
-
110
- ### appCompleteUpload
111
- This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
112
-
113
-
114
-
115
- ```javascript
116
- // Promise
117
- const promise = client.application("<APPLICATION_ID>").fileStorage.appCompleteUpload({ namespace : value,
118
- body : value });
119
-
120
- // Async/Await
121
- const data = await client.application("<APPLICATION_ID>").fileStorage.appCompleteUpload({ namespace : value,
122
- body : value });
123
- ```
124
-
125
-
126
-
127
-
128
-
129
- | Argument | Type | Required | Description |
130
- | --------- | ----- | -------- | ----------- |
131
- | namespace | string | yes | bucket name |
132
- | body | [StartResponse](#StartResponse) | yes | Request body |
133
-
134
-
135
- Uploads an arbitrarily sized buffer or blob.
136
-
137
- It has three Major Steps:
138
- * Start
139
- * Upload
140
- * Complete
141
-
142
- ### Start
143
- Initiates the assets upload using `appStartUpload`.
144
- It returns the storage link in response.
145
-
146
- ### Upload
147
- Use the storage link to upload a file (Buffer or Blob) to the File Storage.
148
- Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body.
149
-
150
- ### Complete
151
- After successfully upload, call `appCompleteUpload` api to complete the upload process.
152
- This operation will return the url for the uploaded file.
153
-
154
-
155
- *Returned Response:*
156
-
157
-
158
-
159
-
160
- [CompleteResponse](#CompleteResponse)
161
-
162
- Success
163
-
164
-
165
-
166
-
167
- <details>
168
- <summary><i>&nbsp; Example:</i></summary>
169
-
170
- ```json
171
-
172
- ```
173
- </details>
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
-
182
-
183
- ---
184
-
185
-
186
- ### appCopyFiles
187
- Copy Files
188
-
189
-
190
-
191
- ```javascript
192
- // Promise
193
- const promise = client.application("<APPLICATION_ID>").fileStorage.appCopyFiles({ body : value,
194
- sync : value });
195
-
196
- // Async/Await
197
- const data = await client.application("<APPLICATION_ID>").fileStorage.appCopyFiles({ body : value,
198
- sync : value });
199
- ```
200
-
201
-
202
-
203
-
204
-
205
- | Argument | Type | Required | Description |
206
- | --------- | ----- | -------- | ----------- |
207
- | sync | boolean | no | sync |
208
- | body | [BulkRequest](#BulkRequest) | yes | Request body |
209
-
210
-
211
- Copy Files
212
-
213
- *Returned Response:*
214
-
215
-
216
-
217
-
218
- [BulkUploadResponse](#BulkUploadResponse)
219
-
220
- Success
221
-
222
-
223
-
224
-
225
- <details>
226
- <summary><i>&nbsp; Example:</i></summary>
227
-
228
- ```json
229
- {
230
- "tracking_url": "https://xxx.xxx.xxx/2",
231
- "task": {
232
- "id": "2",
233
- "name": "__default__",
234
- "data": {
235
- "urls": [
236
- "https://xxx.xxx.xxx/files.csv"
237
- ],
238
- "destination": {
239
- "namespace": "/domaine/path",
240
- "rewrite": "{{namespace}}/bar/{{dest.path}}"
241
- }
242
- },
243
- "opts": {
244
- "attempts": 1,
245
- "delay": 0,
246
- "timestamp": 1613534206645
247
- },
248
- "progress": 0,
249
- "delay": 0,
250
- "timestamp": 1613534206645,
251
- "attempts_made": 0,
252
- "stacktrace": [],
253
- "finished_on": 1613534206645,
254
- "processed_on": 1613534206645
255
- }
256
- }
257
- ```
258
- </details>
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
- ---
269
-
270
-
271
- ### appStartUpload
272
- This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
273
-
274
-
275
-
276
- ```javascript
277
- // Promise
278
- const promise = client.application("<APPLICATION_ID>").fileStorage.appStartUpload({ namespace : value,
279
- body : value });
280
-
281
- // Async/Await
282
- const data = await client.application("<APPLICATION_ID>").fileStorage.appStartUpload({ namespace : value,
283
- body : value });
284
- ```
285
-
286
-
287
-
288
-
289
-
290
- | Argument | Type | Required | Description |
291
- | --------- | ----- | -------- | ----------- |
292
- | namespace | string | yes | bucket name |
293
- | body | [StartRequest](#StartRequest) | yes | Request body |
294
-
295
-
296
- Uploads an arbitrarily sized buffer or blob.
297
-
298
- It has three Major Steps:
299
- * Start
300
- * Upload
301
- * Complete
302
-
303
- ### Start
304
- Initiates the assets upload using `appStartUpload`.
305
- It returns the storage link in response.
306
-
307
- ### Upload
308
- Use the storage link to upload a file (Buffer or Blob) to the File Storage.
309
- Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body.
310
-
311
- ### Complete
312
- After successfully upload, call `appCompleteUpload` api to complete the upload process.
313
- This operation will return the url for the uploaded file.
314
-
315
-
316
- *Returned Response:*
317
-
318
-
319
-
320
-
321
- [StartResponse](#StartResponse)
322
-
323
- Success
324
-
325
-
326
-
327
-
328
- <details>
329
- <summary><i>&nbsp; Example:</i></summary>
330
-
331
- ```json
332
-
333
- ```
334
- </details>
335
-
336
-
337
-
338
-
339
-
340
-
341
-
342
-
343
-
344
- ---
345
-
346
-
347
- ### browse
348
- Browse Files
349
-
350
-
351
-
352
- ```javascript
353
- // Promise
354
- const promise = client.fileStorage.browse({ namespace : value,
355
- pageNo : value });
356
-
357
- // Async/Await
358
- const data = await client.fileStorage.browse({ namespace : value,
359
- pageNo : value });
360
- ```
361
-
362
-
363
-
364
-
365
-
366
- | Argument | Type | Required | Description |
367
- | --------- | ----- | -------- | ----------- |
368
- | namespace | string | yes | bucket name |
369
- | pageNo | number | no | page no |
370
-
371
-
372
-
373
- Browse Files
374
-
375
- *Returned Response:*
376
-
377
-
378
-
379
-
380
- [BrowseResponse](#BrowseResponse)
381
-
382
- Success
383
-
384
-
385
-
386
-
387
- <details>
388
- <summary><i>&nbsp; Example:</i></summary>
389
-
390
- ```json
391
-
392
- ```
393
- </details>
394
-
395
-
396
-
397
-
398
-
399
-
400
-
401
-
402
-
403
- ---
404
-
405
-
406
- ### browse
407
- Browse Files
408
-
409
-
410
-
411
- ```javascript
412
- // Promise
413
- const promise = client.application("<APPLICATION_ID>").fileStorage.browse({ namespace : value,
414
- pageNo : value });
415
-
416
- // Async/Await
417
- const data = await client.application("<APPLICATION_ID>").fileStorage.browse({ namespace : value,
418
- pageNo : value });
419
- ```
420
-
421
-
422
-
423
-
424
-
425
- | Argument | Type | Required | Description |
426
- | --------- | ----- | -------- | ----------- |
427
- | namespace | string | yes | bucket name |
428
- | pageNo | number | no | page no |
429
-
430
-
431
-
432
- Browse Files
433
-
434
- *Returned Response:*
435
-
436
-
437
-
438
-
439
- [BrowseResponse](#BrowseResponse)
440
-
441
- Success
442
-
443
-
444
-
445
-
446
- <details>
447
- <summary><i>&nbsp; Example:</i></summary>
448
-
449
- ```json
450
-
451
- ```
452
- </details>
453
-
454
-
455
-
456
-
457
-
458
-
459
-
460
-
461
-
462
- ---
463
-
464
-
465
- ### completeUpload
466
- This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
467
-
468
-
469
-
470
- ```javascript
471
- // Promise
472
- const promise = client.fileStorage.completeUpload({ namespace : value,
473
- body : value });
474
-
475
- // Async/Await
476
- const data = await client.fileStorage.completeUpload({ namespace : value,
477
- body : value });
478
- ```
479
-
480
-
481
-
482
-
483
-
484
- | Argument | Type | Required | Description |
485
- | --------- | ----- | -------- | ----------- |
486
- | namespace | string | yes | bucket name |
487
- | body | [StartResponse](#StartResponse) | yes | Request body |
488
-
489
-
490
- Uploads an arbitrarily sized buffer or blob.
491
-
492
- It has three Major Steps:
493
- * Start
494
- * Upload
495
- * Complete
496
-
497
- ### Start
498
- Initiates the assets upload using `startUpload`.
499
- It returns the storage link in response.
500
-
501
- ### Upload
502
- Use the storage link to upload a file (Buffer or Blob) to the File Storage.
503
- Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
504
-
505
- ### Complete
506
- After successfully upload, call `completeUpload` api to complete the upload process.
507
- This operation will return the url for the uploaded file.
508
-
509
-
510
- *Returned Response:*
511
-
512
-
513
-
514
-
515
- [CompleteResponse](#CompleteResponse)
516
-
517
- Success
518
-
519
-
520
-
521
-
522
- <details>
523
- <summary><i>&nbsp; Example:</i></summary>
524
-
525
- ```json
526
-
527
- ```
528
- </details>
529
-
530
-
531
-
532
-
533
-
534
-
535
-
536
-
537
-
538
- ---
539
-
540
-
541
- ### copyFiles
542
- Copy Files
543
-
544
-
545
-
546
- ```javascript
547
- // Promise
548
- const promise = client.fileStorage.copyFiles({ body : value,
549
- sync : value });
550
-
551
- // Async/Await
552
- const data = await client.fileStorage.copyFiles({ body : value,
553
- sync : value });
554
- ```
555
-
556
-
557
-
558
-
559
-
560
- | Argument | Type | Required | Description |
561
- | --------- | ----- | -------- | ----------- |
562
- | sync | boolean | no | sync |
563
- | body | [BulkRequest](#BulkRequest) | yes | Request body |
564
-
565
-
566
- Copy Files
567
-
568
- *Returned Response:*
569
-
570
-
571
-
572
-
573
- [BulkUploadResponse](#BulkUploadResponse)
574
-
575
- Success
576
-
577
-
578
-
579
-
580
- <details>
581
- <summary><i>&nbsp; Example:</i></summary>
582
-
583
- ```json
584
- {
585
- "tracking_url": "https://xxx.xxx.xxx/2",
586
- "task": {
587
- "id": "2",
588
- "name": "__default__",
589
- "data": {
590
- "urls": [
591
- "https://xxx.xxx.xxx/files.csv"
592
- ],
593
- "destination": {
594
- "namespace": "/domaine/path",
595
- "rewrite": "{{namespace}}/bar/{{dest.path}}"
596
- }
597
- },
598
- "opts": {
599
- "attempts": 1,
600
- "delay": 0,
601
- "timestamp": 1613534206645
602
- },
603
- "progress": 0,
604
- "delay": 0,
605
- "timestamp": 1613534206645,
606
- "attempts_made": 0,
607
- "stacktrace": [],
608
- "finished_on": 1613534206645,
609
- "processed_on": 1613534206645
610
- }
611
- }
612
- ```
613
- </details>
614
-
615
-
616
-
617
-
618
-
619
-
620
-
621
-
622
-
623
- ---
624
-
625
-
626
- ### getSignUrls
627
- Gives signed urls to access private files
628
-
629
-
630
-
631
- ```javascript
632
- // Promise
633
- const promise = client.fileStorage.getSignUrls({ body : value });
634
-
635
- // Async/Await
636
- const data = await client.fileStorage.getSignUrls({ body : value });
637
- ```
638
-
639
-
640
-
641
-
642
-
643
- | Argument | Type | Required | Description |
644
- | --------- | ----- | -------- | ----------- |
645
- | body | [SignUrlRequest](#SignUrlRequest) | yes | Request body |
646
-
647
-
648
- Describe here
649
-
650
- *Returned Response:*
651
-
652
-
653
-
654
-
655
- [SignUrlResponse](#SignUrlResponse)
656
-
657
- Success
658
-
659
-
660
-
661
-
662
- <details>
663
- <summary><i>&nbsp; Example:</i></summary>
664
-
665
- ```json
666
-
667
- ```
668
- </details>
669
-
670
-
671
-
672
-
673
-
674
-
675
-
676
-
677
-
678
- ---
679
-
680
-
681
- ### proxy
682
- Proxy
683
-
684
-
685
-
686
- ```javascript
687
- // Promise
688
- const promise = client.fileStorage.proxy({ url : value });
689
-
690
- // Async/Await
691
- const data = await client.fileStorage.proxy({ url : value });
692
- ```
693
-
694
-
695
-
696
-
697
-
698
- | Argument | Type | Required | Description |
699
- | --------- | ----- | -------- | ----------- |
700
- | url | string | yes | url |
701
-
702
-
703
-
704
- Proxy
705
-
706
- *Returned Response:*
707
-
708
-
709
-
710
-
711
- [string](#string)
712
-
713
- Success
714
-
715
-
716
-
717
-
718
- <details>
719
- <summary><i>&nbsp; Example:</i></summary>
720
-
721
- ```json
722
-
723
- ```
724
- </details>
725
-
726
-
727
-
728
-
729
-
730
-
731
-
732
-
733
-
734
- ---
735
-
736
-
737
- ### startUpload
738
- This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
739
-
740
-
741
-
742
- ```javascript
743
- // Promise
744
- const promise = client.fileStorage.startUpload({ namespace : value,
745
- body : value });
746
-
747
- // Async/Await
748
- const data = await client.fileStorage.startUpload({ namespace : value,
749
- body : value });
750
- ```
751
-
752
-
753
-
754
-
755
-
756
- | Argument | Type | Required | Description |
757
- | --------- | ----- | -------- | ----------- |
758
- | namespace | string | yes | bucket name |
759
- | body | [StartRequest](#StartRequest) | yes | Request body |
760
-
761
-
762
- Uploads an arbitrarily sized buffer or blob.
763
-
764
- It has three Major Steps:
765
- * Start
766
- * Upload
767
- * Complete
768
-
769
- ### Start
770
- Initiates the assets upload using `startUpload`.
771
- It returns the storage link in response.
772
-
773
- ### Upload
774
- Use the storage link to upload a file (Buffer or Blob) to the File Storage.
775
- Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
776
-
777
- ### Complete
778
- After successfully upload, call `completeUpload` api to complete the upload process.
779
- This operation will return the url for the uploaded file.
780
-
781
-
782
- *Returned Response:*
783
-
784
-
785
-
786
-
787
- [StartResponse](#StartResponse)
788
-
789
- Success
790
-
791
-
792
-
793
-
794
- <details>
795
- <summary><i>&nbsp; Example:</i></summary>
796
-
797
- ```json
798
-
799
- ```
800
- </details>
801
-
802
-
803
-
804
-
805
-
806
-
807
-
808
-
809
-
810
- ---
811
-
812
-
813
-
814
- ### Schemas
815
-
816
-
817
- #### [BrowseResponse](#BrowseResponse)
818
-
819
- | Properties | Type | Nullable | Description |
820
- | ---------- | ---- | -------- | ----------- || items | [[DbRecord](#DbRecord)] | yes | || page | [Page](#Page) | yes | |
821
-
822
- ---
823
-
824
- #### [BulkRequest](#BulkRequest)
825
-
826
- | Properties | Type | Nullable | Description |
827
- | ---------- | ---- | -------- | ----------- || configuration | [ReqConfiguration](#ReqConfiguration) | no | || destination | [Destination](#Destination) | yes | || urls | [string] | yes | |
828
-
829
- ---
830
-
831
- #### [BulkUploadResponse](#BulkUploadResponse)
832
-
833
- | Properties | Type | Nullable | Description |
834
- | ---------- | ---- | -------- | ----------- || task | [CopyFileTask](#CopyFileTask) | yes | || tracking_url | string | yes | |
835
-
836
- ---
837
-
838
- #### [CDN](#CDN)
839
-
840
- | Properties | Type | Nullable | Description |
841
- | ---------- | ---- | -------- | ----------- || absolute_url | string | no | || relative_url | string | no | || url | string | yes | |
842
-
843
- ---
844
-
845
- #### [CompleteResponse](#CompleteResponse)
846
-
847
- | Properties | Type | Nullable | Description |
848
- | ---------- | ---- | -------- | ----------- || _id | string | yes | || cdn | [CDN](#CDN) | yes | || content_type | string | yes | || created_on | string | yes | || file_name | string | yes | || file_path | string | yes | || modified_on | string | yes | || namespace | string | yes | || operation | string | yes | || size | number | yes | || success | boolean | yes | || tags | [string] | no | || upload | [Upload](#Upload) | yes | |
849
-
850
- ---
851
-
852
- #### [CopyFileTask](#CopyFileTask)
853
-
854
- | Properties | Type | Nullable | Description |
855
- | ---------- | ---- | -------- | ----------- || attempts_made | number | yes | || data | [BulkRequest](#BulkRequest) | yes | || delay | number | yes | || finished_on | number | yes | || id | string | yes | || name | string | yes | || opts | [Opts](#Opts) | yes | || processed_on | number | yes | || progress | number | yes | || stacktrace | [string] | no | || timestamp | number | yes | |
856
-
857
- ---
858
-
859
- #### [DbRecord](#DbRecord)
860
-
861
- | Properties | Type | Nullable | Description |
862
- | ---------- | ---- | -------- | ----------- || _id | string | yes | || cdn | [CDN](#CDN) | yes | || content_type | string | yes | || created_on | string | yes | || file_name | string | yes | || file_path | string | yes | || modified_on | string | yes | || namespace | string | yes | || operation | string | no | || success | boolean | yes | || tags | [string] | yes | || upload | [Upload](#Upload) | yes | |
863
-
864
- ---
865
-
866
- #### [Destination](#Destination)
867
-
868
- | Properties | Type | Nullable | Description |
869
- | ---------- | ---- | -------- | ----------- || basepath | string | no | || namespace | string | yes | || rewrite | string | yes | |
870
-
871
- ---
872
-
873
- #### [FailedResponse](#FailedResponse)
874
-
875
- | Properties | Type | Nullable | Description |
876
- | ---------- | ---- | -------- | ----------- || message | string | yes | |
877
-
878
- ---
879
-
880
- #### [Opts](#Opts)
881
-
882
- | Properties | Type | Nullable | Description |
883
- | ---------- | ---- | -------- | ----------- || attempts | number | no | || delay | number | no | || timestamp | number | no | |
884
-
885
- ---
886
-
887
- #### [Page](#Page)
888
-
889
- | Properties | Type | Nullable | Description |
890
- | ---------- | ---- | -------- | ----------- || current | number | no | || has_next | boolean | no | || has_previous | boolean | no | || item_total | number | no | || next_id | string | no | || size | number | no | || type | number | yes | |
891
-
892
- ---
893
-
894
- #### [ReqConfiguration](#ReqConfiguration)
895
-
896
- | Properties | Type | Nullable | Description |
897
- | ---------- | ---- | -------- | ----------- || concurrency | number | no | |
898
-
899
- ---
900
-
901
- #### [SignUrlRequest](#SignUrlRequest)
902
-
903
- | Properties | Type | Nullable | Description |
904
- | ---------- | ---- | -------- | ----------- || expiry | number | yes | || urls | [string] | yes | |
905
-
906
- ---
907
-
908
- #### [SignUrlResponse](#SignUrlResponse)
909
-
910
- | Properties | Type | Nullable | Description |
911
- | ---------- | ---- | -------- | ----------- || urls | [[Urls](#Urls)] | yes | |
912
-
913
- ---
914
-
915
- #### [StartRequest](#StartRequest)
916
-
917
- | Properties | Type | Nullable | Description |
918
- | ---------- | ---- | -------- | ----------- || content_type | string | yes | || file_name | string | yes | || params | string | no | || size | number | yes | || tags | [string] | no | |
919
-
920
- ---
921
-
922
- #### [StartResponse](#StartResponse)
923
-
924
- | Properties | Type | Nullable | Description |
925
- | ---------- | ---- | -------- | ----------- || cdn | [CDN](#CDN) | yes | || content_type | string | yes | || file_name | string | yes | || file_path | string | yes | || method | string | no | || namespace | string | yes | || operation | string | yes | || size | number | yes | || tags | [string] | no | || upload | [Upload](#Upload) | yes | |
926
-
927
- ---
928
-
929
- #### [Upload](#Upload)
930
-
931
- | Properties | Type | Nullable | Description |
932
- | ---------- | ---- | -------- | ----------- || expiry | number | yes | || url | string | yes | |
933
-
934
- ---
935
-
936
- #### [Urls](#Urls)
937
-
938
- | Properties | Type | Nullable | Description |
939
- | ---------- | ---- | -------- | ----------- || expiry | number | yes | || signed_url | string | yes | || url | string | yes | |
940
-
941
- ---
942
-
943
-
944
-
945
-