@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,325 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
- ##### [Back to Application docs](./README.md)
7
-
8
- ## Common Methods
9
- Application configuration apis
10
-
11
- * [getLocations](#getlocations)
12
- * [searchApplication](#searchapplication)
13
-
14
-
15
-
16
- ## Methods with example and description
17
-
18
-
19
-
20
-
21
- ### getLocations
22
- Get countries, states, cities
23
-
24
-
25
-
26
- ```javascript
27
- // Promise
28
- const promise = common.getLocations({ locationType : value,
29
- id : value });
30
-
31
- // Async/Await
32
- const data = await common.getLocations({ locationType : value,
33
- id : value });
34
- ```
35
-
36
-
37
-
38
-
39
-
40
- | Argument | Type | Required | Description |
41
- | --------- | ----- | -------- | ----------- |
42
- | locationType | string | no | Provide location type to query on. Possible values : country, state, city |
43
- | id | string | no | Field is optional when location_type is country. If querying for state, provide id of country. If querying for city, provide id of state. |
44
-
45
-
46
-
47
-
48
-
49
- *Returned Response:*
50
-
51
-
52
-
53
-
54
- [Locations](#Locations)
55
-
56
- Success
57
-
58
-
59
-
60
-
61
- <details>
62
- <summary><i>&nbsp; Example:</i></summary>
63
-
64
- ```json
65
-
66
- ```
67
- </details>
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
-
77
- ---
78
-
79
-
80
- ### searchApplication
81
- Search Application
82
-
83
-
84
-
85
- ```javascript
86
- // Promise
87
- const promise = common.searchApplication({ authorization : value,
88
- query : value });
89
-
90
- // Async/Await
91
- const data = await common.searchApplication({ authorization : value,
92
- query : value });
93
- ```
94
-
95
-
96
-
97
-
98
-
99
- | Argument | Type | Required | Description |
100
- | --------- | ----- | -------- | ----------- |
101
- | authorization | string | no | |
102
- | query | string | no | Provide application name |
103
-
104
-
105
-
106
- Provide application name or domain url
107
-
108
- *Returned Response:*
109
-
110
-
111
-
112
-
113
- [ApplicationResponse](#ApplicationResponse)
114
-
115
- Success
116
-
117
-
118
-
119
-
120
- <details>
121
- <summary><i>&nbsp; Example:</i></summary>
122
-
123
- ```json
124
- {
125
- "application": {
126
- "website": {
127
- "enabled": true,
128
- "basepath": "/"
129
- },
130
- "cors": {
131
- "domains": []
132
- },
133
- "auth": {
134
- "enabled": true
135
- },
136
- "description": "test",
137
- "channel_type": "store",
138
- "cache_ttl": -1,
139
- "internal": false,
140
- "is_active": true,
141
- "mode": "live",
142
- "_id": "620b931ee7bfb11f910bf4a3",
143
- "company_id": 2,
144
- "name": "test",
145
- "owner": "5b9b98150df588546aaea6d2",
146
- "logo": {
147
- "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png"
148
- },
149
- "favicon": {
150
- "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/free-logo/original/olqHM8LNr-JioMart-Groceries.png"
151
- },
152
- "banner": {
153
- "secure_url": "https://hdn-1.addsale.com/x0/company/164/applications/5efc9913f474c329718e3690/application/pictures/landscape-banner/original/D2fr98CUH-JioMart-Groceries.png"
154
- },
155
- "token": "tPQv0nc23",
156
- "tokens": [
157
- {
158
- "token": "tPQv0nc23",
159
- "created_at": "2022-02-15T11:48:46.909Z"
160
- }
161
- ],
162
- "domains": [
163
- {
164
- "verified": true,
165
- "is_primary": true,
166
- "is_shortlink": true,
167
- "_id": "620b931ee7bfb11f910bf4a4",
168
- "name": "qckvv5lhp.hostfynd.dev"
169
- }
170
- ],
171
- "redirections": [],
172
- "meta": [],
173
- "created_at": "2022-02-15T11:48:46.909Z",
174
- "modified_at": "2022-02-15T11:48:46.909Z",
175
- "__v": 0,
176
- "domain": {
177
- "verified": true,
178
- "is_primary": true,
179
- "is_shortlink": true,
180
- "_id": "620b931ee7bfb11f910bf4a4",
181
- "name": "qckvv5lhp.hostfynd.dev"
182
- },
183
- "id": "620b931ee7bfb11f910bf4a3"
184
- }
185
- }
186
- ```
187
- </details>
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
- ---
198
-
199
-
200
-
201
- ### Schemas
202
-
203
-
204
- #### [Application](#Application)
205
-
206
- | Properties | Type | Nullable | Description |
207
- | ---------- | ---- | -------- | ----------- || __v | number | no | || _id | string | no | || app_type | string | no | || auth | [ApplicationAuth](#ApplicationAuth) | no | || banner | [SecureUrl](#SecureUrl) | no | || cache_ttl | number | no | || channel_type | string | no | || company_id | number | no | || cors | [ApplicationCors](#ApplicationCors) | no | || created_at | string | no | || description | string | no | || domain | [Domain](#Domain) | no | || domains | [[Domain](#Domain)] | no | || favicon | [SecureUrl](#SecureUrl) | no | || is_active | boolean | no | || is_internal | boolean | no | || logo | [SecureUrl](#SecureUrl) | no | || meta | [[ApplicationMeta](#ApplicationMeta)] | no | || mobile_logo | [SecureUrl](#SecureUrl) | no | || name | string | no | || owner | string | no | || redirections | [[ApplicationRedirections](#ApplicationRedirections)] | no | || token | string | no | || updated_at | string | no | || website | [ApplicationWebsite](#ApplicationWebsite) | no | |
208
-
209
- ---
210
-
211
- #### [ApplicationAuth](#ApplicationAuth)
212
-
213
- | Properties | Type | Nullable | Description |
214
- | ---------- | ---- | -------- | ----------- || enabled | boolean | no | |
215
-
216
- ---
217
-
218
- #### [ApplicationCors](#ApplicationCors)
219
-
220
- | Properties | Type | Nullable | Description |
221
- | ---------- | ---- | -------- | ----------- || domains | [string] | no | |
222
-
223
- ---
224
-
225
- #### [ApplicationMeta](#ApplicationMeta)
226
-
227
- | Properties | Type | Nullable | Description |
228
- | ---------- | ---- | -------- | ----------- || name | string | no | || value | string | no | |
229
-
230
- ---
231
-
232
- #### [ApplicationRedirections](#ApplicationRedirections)
233
-
234
- | Properties | Type | Nullable | Description |
235
- | ---------- | ---- | -------- | ----------- || redirect_from | string | no | || redirect_to | string | no | || type | string | no | |
236
-
237
- ---
238
-
239
- #### [ApplicationResponse](#ApplicationResponse)
240
-
241
- | Properties | Type | Nullable | Description |
242
- | ---------- | ---- | -------- | ----------- || application | [Application](#Application) | no | |
243
-
244
- ---
245
-
246
- #### [ApplicationWebsite](#ApplicationWebsite)
247
-
248
- | Properties | Type | Nullable | Description |
249
- | ---------- | ---- | -------- | ----------- || basepath | string | no | || enabled | boolean | no | |
250
-
251
- ---
252
-
253
- #### [BadRequest](#BadRequest)
254
-
255
- | Properties | Type | Nullable | Description |
256
- | ---------- | ---- | -------- | ----------- || message | string | no | |
257
-
258
- ---
259
-
260
- #### [Currency](#Currency)
261
-
262
- | Properties | Type | Nullable | Description |
263
- | ---------- | ---- | -------- | ----------- || _id | string | no | || code | string | no | || created_at | string | no | || decimal_digits | number | no | || is_active | boolean | no | || name | string | no | || symbol | string | no | || updated_at | string | no | |
264
-
265
- ---
266
-
267
- #### [Domain](#Domain)
268
-
269
- | Properties | Type | Nullable | Description |
270
- | ---------- | ---- | -------- | ----------- || _id | string | no | || is_predefined | boolean | no | || is_primary | boolean | no | || is_shortlink | boolean | no | || name | string | no | || verified | boolean | no | |
271
-
272
- ---
273
-
274
- #### [LocationCountry](#LocationCountry)
275
-
276
- | Properties | Type | Nullable | Description |
277
- | ---------- | ---- | -------- | ----------- || __v | number | no | || _id | string | no | || capital | string | no | || currency | string | no | || default_currency | [LocationDefaultCurrency](#LocationDefaultCurrency) | no | || default_language | [LocationDefaultLanguage](#LocationDefaultLanguage) | no | || iso2 | string | no | || iso3 | string | no | || name | string | no | || parent | string | no | || phone_code | string | no | || type | string | no | || uid | number | no | |
278
-
279
- ---
280
-
281
- #### [LocationDefaultCurrency](#LocationDefaultCurrency)
282
-
283
- | Properties | Type | Nullable | Description |
284
- | ---------- | ---- | -------- | ----------- || code | string | no | || name | string | no | || symbol | string | no | |
285
-
286
- ---
287
-
288
- #### [LocationDefaultLanguage](#LocationDefaultLanguage)
289
-
290
- | Properties | Type | Nullable | Description |
291
- | ---------- | ---- | -------- | ----------- || code | string | no | || name | string | no | |
292
-
293
- ---
294
-
295
- #### [Locations](#Locations)
296
-
297
- | Properties | Type | Nullable | Description |
298
- | ---------- | ---- | -------- | ----------- || items | [string] | no | |
299
-
300
- ---
301
-
302
- #### [NotFound](#NotFound)
303
-
304
- | Properties | Type | Nullable | Description |
305
- | ---------- | ---- | -------- | ----------- || message | string | no | |
306
-
307
- ---
308
-
309
- #### [Page](#Page)
310
-
311
- | Properties | Type | Nullable | Description |
312
- | ---------- | ---- | -------- | ----------- || current | number | no | || has_next | boolean | no | || has_previous | boolean | no | || item_total | number | no | || next_id | string | no | || size | number | no | || type | string | yes | |
313
-
314
- ---
315
-
316
- #### [SecureUrl](#SecureUrl)
317
-
318
- | Properties | Type | Nullable | Description |
319
- | ---------- | ---- | -------- | ----------- || secure_url | string | no | |
320
-
321
- ---
322
-
323
-
324
-
325
-
@@ -1,387 +0,0 @@
1
-
2
-
3
-
4
-
5
-
6
- ##### [Back to Application docs](./README.md)
7
-
8
- ## Communication Methods
9
- Manages email, sms, push notifications sent to users
10
-
11
- * [getCommunicationConsent](#getcommunicationconsent)
12
- * [upsertAppPushtoken](#upsertapppushtoken)
13
- * [upsertCommunicationConsent](#upsertcommunicationconsent)
14
-
15
-
16
-
17
- ## Methods with example and description
18
-
19
-
20
-
21
-
22
- ### getCommunicationConsent
23
- Get communication consent
24
-
25
-
26
-
27
- ```javascript
28
- // Promise
29
- const promise = communication.getCommunicationConsent();
30
-
31
- // Async/Await
32
- const data = await communication.getCommunicationConsent();
33
- ```
34
-
35
-
36
-
37
-
38
-
39
-
40
- Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
41
-
42
- *Returned Response:*
43
-
44
-
45
-
46
-
47
- [CommunicationConsent](#CommunicationConsent)
48
-
49
- Success. Returns all available communication opt-ins along with the consent details. Check the example shown below or refer `CommunicationConsent` for more details.
50
-
51
-
52
-
53
-
54
- <details>
55
- <summary><i>&nbsp; Examples:</i></summary>
56
-
57
-
58
- <details>
59
- <summary><i>&nbsp; default</i></summary>
60
-
61
- ```json
62
- {
63
- "value": {
64
- "app_id": "000000000000000000000004",
65
- "user_id": "5e56021c4bda3ccab6d9f884",
66
- "channels": {
67
- "email": {
68
- "response": "yes",
69
- "display_name": "Email"
70
- },
71
- "sms": {
72
- "response": "yes",
73
- "display_name": "SMS"
74
- },
75
- "whatsapp": {
76
- "response": "yes",
77
- "display_name": "WhatsApp",
78
- "country_code": "91",
79
- "phone_number": "9869821300"
80
- }
81
- }
82
- }
83
- }
84
- ```
85
- </details>
86
-
87
- </details>
88
-
89
-
90
-
91
-
92
-
93
-
94
-
95
-
96
-
97
- ---
98
-
99
-
100
- ### upsertAppPushtoken
101
- Upsert push token of a user
102
-
103
-
104
-
105
- ```javascript
106
- // Promise
107
- const promise = communication.upsertAppPushtoken({ body : value });
108
-
109
- // Async/Await
110
- const data = await communication.upsertAppPushtoken({ body : value });
111
- ```
112
-
113
-
114
-
115
-
116
-
117
- | Argument | Type | Required | Description |
118
- | --------- | ----- | -------- | ----------- |
119
- | body | [PushtokenReq](#PushtokenReq) | yes | Request body |
120
-
121
-
122
- Use this API to update and insert the push token of the user.
123
-
124
- *Returned Response:*
125
-
126
-
127
-
128
-
129
- [PushtokenRes](#PushtokenRes)
130
-
131
- Success. Check the example shown below or refer `PushtokenRes` for more details.
132
-
133
-
134
-
135
-
136
- <details>
137
- <summary><i>&nbsp; Examples:</i></summary>
138
-
139
-
140
- <details>
141
- <summary><i>&nbsp; create</i></summary>
142
-
143
- ```json
144
- {
145
- "value": {
146
- "_id": "601b6924d8ea9a061570a09f",
147
- "bundle_identifier": "000002",
148
- "push_token": "45",
149
- "unique_device_id": "3",
150
- "type": "fynd-platform",
151
- "platform": "web",
152
- "application_id": "000000000000000000000004",
153
- "user_id": "5e56021c4bda3ccab6d9f884",
154
- "created_at": "2021-02-04T03:25:24.765Z",
155
- "updated_at": "2021-02-04T03:25:51.152Z"
156
- }
157
- }
158
- ```
159
- </details>
160
-
161
- <details>
162
- <summary><i>&nbsp; update</i></summary>
163
-
164
- ```json
165
- {
166
- "value": {
167
- "_id": "601b6924d8ea9a061570a09f",
168
- "bundle_identifier": "000002",
169
- "push_token": "45",
170
- "unique_device_id": "3",
171
- "type": "fynd-platform",
172
- "platform": "web",
173
- "application_id": "000000000000000000000004",
174
- "user_id": "5e56021c4bda3ccab6d9f884",
175
- "created_at": "2021-02-04T03:25:24.765Z",
176
- "updated_at": "2021-02-04T03:25:51.152Z"
177
- }
178
- }
179
- ```
180
- </details>
181
-
182
- <details>
183
- <summary><i>&nbsp; reset</i></summary>
184
-
185
- ```json
186
- {
187
- "value": {
188
- "_id": "601b6924d8ea9a061570a09f",
189
- "bundle_identifier": "000002",
190
- "push_token": "45",
191
- "unique_device_id": "3",
192
- "type": "fynd-platform",
193
- "platform": "web",
194
- "application_id": "000000000000000000000004",
195
- "user_id": "5e56021c4bda3ccab6d9f884",
196
- "created_at": "2021-02-04T03:25:24.765Z",
197
- "updated_at": "2021-02-04T03:25:51.152Z",
198
- "expired_at": "2021-02-05T03:25:51.138Z"
199
- }
200
- }
201
- ```
202
- </details>
203
-
204
- </details>
205
-
206
-
207
-
208
-
209
-
210
-
211
-
212
-
213
-
214
- ---
215
-
216
-
217
- ### upsertCommunicationConsent
218
- Upsert communication consent
219
-
220
-
221
-
222
- ```javascript
223
- // Promise
224
- const promise = communication.upsertCommunicationConsent({ body : value });
225
-
226
- // Async/Await
227
- const data = await communication.upsertCommunicationConsent({ body : value });
228
- ```
229
-
230
-
231
-
232
-
233
-
234
- | Argument | Type | Required | Description |
235
- | --------- | ----- | -------- | ----------- |
236
- | body | [CommunicationConsentReq](#CommunicationConsentReq) | yes | Request body |
237
-
238
-
239
- Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
240
-
241
- *Returned Response:*
242
-
243
-
244
-
245
-
246
- [CommunicationConsentRes](#CommunicationConsentRes)
247
-
248
- Success. Updates the channels for which user has consented. Check the example shown below or refer `CommunicationConsentRes` for more details.
249
-
250
-
251
-
252
-
253
- <details>
254
- <summary><i>&nbsp; Examples:</i></summary>
255
-
256
-
257
- <details>
258
- <summary><i>&nbsp; default</i></summary>
259
-
260
- ```json
261
- {
262
- "value": {
263
- "appId": "000000000000000000000004",
264
- "userId": "5e56021c4bda3ccab6d9f884",
265
- "channels": {
266
- "email": {
267
- "response": "yes",
268
- "displayName": "Email"
269
- },
270
- "sms": {
271
- "response": "yes",
272
- "displayName": "SMS"
273
- },
274
- "whatsapp": {
275
- "response": "noaction",
276
- "displayName": "WhatsApp"
277
- }
278
- }
279
- }
280
- }
281
- ```
282
- </details>
283
-
284
- </details>
285
-
286
-
287
-
288
-
289
-
290
-
291
-
292
-
293
-
294
- ---
295
-
296
-
297
-
298
- ### Schemas
299
-
300
-
301
- #### [BadRequestSchema](#BadRequestSchema)
302
-
303
- | Properties | Type | Nullable | Description |
304
- | ---------- | ---- | -------- | ----------- || message | string | no | || status | string | no | |
305
-
306
- ---
307
-
308
- #### [CommunicationConsent](#CommunicationConsent)
309
-
310
- | Properties | Type | Nullable | Description |
311
- | ---------- | ---- | -------- | ----------- || app_id | string | no | || channels | [CommunicationConsentChannels](#CommunicationConsentChannels) | no | || user_id | string | no | |
312
-
313
- ---
314
-
315
- #### [CommunicationConsentChannels](#CommunicationConsentChannels)
316
-
317
- | Properties | Type | Nullable | Description |
318
- | ---------- | ---- | -------- | ----------- || email | [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail) | no | || sms | [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms) | no | || whatsapp | [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp) | no | |
319
-
320
- ---
321
-
322
- #### [CommunicationConsentChannelsEmail](#CommunicationConsentChannelsEmail)
323
-
324
- | Properties | Type | Nullable | Description |
325
- | ---------- | ---- | -------- | ----------- || display_name | string | no | || response | string | no | |
326
-
327
- ---
328
-
329
- #### [CommunicationConsentChannelsSms](#CommunicationConsentChannelsSms)
330
-
331
- | Properties | Type | Nullable | Description |
332
- | ---------- | ---- | -------- | ----------- || display_name | string | no | || response | string | no | |
333
-
334
- ---
335
-
336
- #### [CommunicationConsentChannelsWhatsapp](#CommunicationConsentChannelsWhatsapp)
337
-
338
- | Properties | Type | Nullable | Description |
339
- | ---------- | ---- | -------- | ----------- || country_code | string | no | || display_name | string | no | || phone_number | string | no | || response | string | no | |
340
-
341
- ---
342
-
343
- #### [CommunicationConsentReq](#CommunicationConsentReq)
344
-
345
- | Properties | Type | Nullable | Description |
346
- | ---------- | ---- | -------- | ----------- || action | string | no | || channel | string | no | || response | string | no | |
347
-
348
- ---
349
-
350
- #### [CommunicationConsentRes](#CommunicationConsentRes)
351
-
352
- | Properties | Type | Nullable | Description |
353
- | ---------- | ---- | -------- | ----------- || app_id | string | no | || channels | [CommunicationConsentChannels](#CommunicationConsentChannels) | no | || user_id | string | no | |
354
-
355
- ---
356
-
357
- #### [NotFound](#NotFound)
358
-
359
- | Properties | Type | Nullable | Description |
360
- | ---------- | ---- | -------- | ----------- || message | string | no | |
361
-
362
- ---
363
-
364
- #### [Page](#Page)
365
-
366
- | Properties | Type | Nullable | Description |
367
- | ---------- | ---- | -------- | ----------- || current | number | no | || has_next | boolean | no | || has_previous | boolean | no | || item_total | number | no | || next_id | string | no | || size | number | no | || type | string | yes | |
368
-
369
- ---
370
-
371
- #### [PushtokenReq](#PushtokenReq)
372
-
373
- | Properties | Type | Nullable | Description |
374
- | ---------- | ---- | -------- | ----------- || action | string | no | || bundle_identifier | string | no | || push_token | string | no | || type | string | no | || unique_device_id | string | no | |
375
-
376
- ---
377
-
378
- #### [PushtokenRes](#PushtokenRes)
379
-
380
- | Properties | Type | Nullable | Description |
381
- | ---------- | ---- | -------- | ----------- || _id | string | no | || application_id | string | no | || bundle_identifier | string | no | || created_at | string | no | || expired_at | string | no | || platform | string | no | || push_token | string | no | || type | string | no | || unique_device_id | string | no | || updated_at | string | no | || user_id | string | no | |
382
-
383
- ---
384
-
385
-
386
-
387
-