@gofynd/fdk-client-javascript 0.1.35

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 (277) hide show
  1. package/.github/workflows/on_create_release.yml +23 -0
  2. package/.github/workflows/on_merge_main.yml +38 -0
  3. package/.github/workflows/on_pull_request.yml +35 -0
  4. package/.prettierrc +5 -0
  5. package/LICENSE +21 -0
  6. package/README.md +118 -0
  7. package/application.d.ts +3 -0
  8. package/application.js +6 -0
  9. package/common.d.ts +4 -0
  10. package/common.js +9 -0
  11. package/documentation/application/CART.md +7290 -0
  12. package/documentation/application/CATALOG.md +9570 -0
  13. package/documentation/application/COMMON.md +448 -0
  14. package/documentation/application/COMMUNICATION.md +463 -0
  15. package/documentation/application/CONFIGURATION.md +2902 -0
  16. package/documentation/application/CONTENT.md +3350 -0
  17. package/documentation/application/FILESTORAGE.md +491 -0
  18. package/documentation/application/LEAD.md +1891 -0
  19. package/documentation/application/LOGISTIC.md +439 -0
  20. package/documentation/application/ORDER.md +3428 -0
  21. package/documentation/application/PAYMENT.md +5035 -0
  22. package/documentation/application/POSCART.md +7889 -0
  23. package/documentation/application/README.md +21 -0
  24. package/documentation/application/REWARDS.md +714 -0
  25. package/documentation/application/SHARE.md +729 -0
  26. package/documentation/application/THEME.md +5796 -0
  27. package/documentation/application/USER.md +4326 -0
  28. package/documentation/platform/ANALYTICS.md +1150 -0
  29. package/documentation/platform/AUDITTRAIL.md +572 -0
  30. package/documentation/platform/BILLING.md +2396 -0
  31. package/documentation/platform/CART.md +5539 -0
  32. package/documentation/platform/CATALOG.md +21624 -0
  33. package/documentation/platform/COMMON.md +448 -0
  34. package/documentation/platform/COMMUNICATION.md +5714 -0
  35. package/documentation/platform/COMPANYPROFILE.md +2141 -0
  36. package/documentation/platform/CONFIGURATION.md +7335 -0
  37. package/documentation/platform/CONTENT.md +8989 -0
  38. package/documentation/platform/DISCOUNT.md +773 -0
  39. package/documentation/platform/FILESTORAGE.md +994 -0
  40. package/documentation/platform/INVENTORY.md +1775 -0
  41. package/documentation/platform/LEAD.md +4736 -0
  42. package/documentation/platform/ORDER.md +3764 -0
  43. package/documentation/platform/PARTNER.md +216 -0
  44. package/documentation/platform/PAYMENT.md +3444 -0
  45. package/documentation/platform/README.md +27 -0
  46. package/documentation/platform/REWARDS.md +871 -0
  47. package/documentation/platform/SHARE.md +602 -0
  48. package/documentation/platform/THEME.md +35725 -0
  49. package/documentation/platform/USER.md +2305 -0
  50. package/documentation/platform/WEBHOOK.md +587 -0
  51. package/documentation/public/CONFIGURATION.md +448 -0
  52. package/documentation/public/INVENTORY.md +686 -0
  53. package/documentation/public/WEBHOOK.md +348 -0
  54. package/index.d.ts +10 -0
  55. package/index.js +18 -0
  56. package/jest.config.d.ts +4 -0
  57. package/jest.config.js +6 -0
  58. package/package.json +35 -0
  59. package/platform.d.ts +3 -0
  60. package/platform.js +6 -0
  61. package/public.d.ts +3 -0
  62. package/public.js +6 -0
  63. package/sdk/application/ApplicationAPIClient.d.ts +11 -0
  64. package/sdk/application/ApplicationAPIClient.js +44 -0
  65. package/sdk/application/ApplicationClient.d.ts +40 -0
  66. package/sdk/application/ApplicationClient.js +84 -0
  67. package/sdk/application/ApplicationConfig.d.ts +19 -0
  68. package/sdk/application/ApplicationConfig.js +55 -0
  69. package/sdk/application/ApplicationModels.d.ts +826 -0
  70. package/sdk/application/ApplicationModels.js +10474 -0
  71. package/sdk/application/client/CartApplicationClient.d.ts +432 -0
  72. package/sdk/application/client/CartApplicationClient.js +1066 -0
  73. package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
  74. package/sdk/application/client/CatalogApplicationClient.js +1629 -0
  75. package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
  76. package/sdk/application/client/CommonApplicationClient.js +105 -0
  77. package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
  78. package/sdk/application/client/CommunicationApplicationClient.js +131 -0
  79. package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
  80. package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
  81. package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
  82. package/sdk/application/client/ContentApplicationClient.js +785 -0
  83. package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
  84. package/sdk/application/client/FileStorageApplicationClient.js +214 -0
  85. package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
  86. package/sdk/application/client/LeadApplicationClient.js +264 -0
  87. package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
  88. package/sdk/application/client/LogisticApplicationClient.js +128 -0
  89. package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
  90. package/sdk/application/client/OrderApplicationClient.js +479 -0
  91. package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
  92. package/sdk/application/client/PaymentApplicationClient.js +1378 -0
  93. package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
  94. package/sdk/application/client/PosCartApplicationClient.js +1123 -0
  95. package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
  96. package/sdk/application/client/RewardsApplicationClient.js +293 -0
  97. package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
  98. package/sdk/application/client/ShareApplicationClient.js +268 -0
  99. package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
  100. package/sdk/application/client/ThemeApplicationClient.js +161 -0
  101. package/sdk/application/client/UserApplicationClient.d.ts +446 -0
  102. package/sdk/application/client/UserApplicationClient.js +1275 -0
  103. package/sdk/application/constructUrl.d.ts +5 -0
  104. package/sdk/application/constructUrl.js +13 -0
  105. package/sdk/application/index.d.ts +2 -0
  106. package/sdk/application/index.js +4 -0
  107. package/sdk/application/models/CartValidator.d.ts +29 -0
  108. package/sdk/application/models/CartValidator.js +223 -0
  109. package/sdk/application/models/CatalogValidator.d.ts +33 -0
  110. package/sdk/application/models/CatalogValidator.js +233 -0
  111. package/sdk/application/models/CommonValidator.d.ts +5 -0
  112. package/sdk/application/models/CommonValidator.js +18 -0
  113. package/sdk/application/models/CommunicationValidator.d.ts +6 -0
  114. package/sdk/application/models/CommunicationValidator.js +20 -0
  115. package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
  116. package/sdk/application/models/ConfigurationValidator.js +88 -0
  117. package/sdk/application/models/ContentValidator.d.ts +22 -0
  118. package/sdk/application/models/ContentValidator.js +106 -0
  119. package/sdk/application/models/FileStorageValidator.d.ts +6 -0
  120. package/sdk/application/models/FileStorageValidator.js +24 -0
  121. package/sdk/application/models/LeadValidator.d.ts +10 -0
  122. package/sdk/application/models/LeadValidator.js +48 -0
  123. package/sdk/application/models/LogisticValidator.d.ts +6 -0
  124. package/sdk/application/models/LogisticValidator.js +22 -0
  125. package/sdk/application/models/OrderValidator.d.ts +15 -0
  126. package/sdk/application/models/OrderValidator.js +87 -0
  127. package/sdk/application/models/PaymentValidator.d.ts +40 -0
  128. package/sdk/application/models/PaymentValidator.js +235 -0
  129. package/sdk/application/models/PosCartValidator.d.ts +30 -0
  130. package/sdk/application/models/PosCartValidator.js +232 -0
  131. package/sdk/application/models/RewardsValidator.d.ts +10 -0
  132. package/sdk/application/models/RewardsValidator.js +43 -0
  133. package/sdk/application/models/ShareValidator.d.ts +10 -0
  134. package/sdk/application/models/ShareValidator.js +44 -0
  135. package/sdk/application/models/ThemeValidator.d.ts +7 -0
  136. package/sdk/application/models/ThemeValidator.js +27 -0
  137. package/sdk/application/models/UserValidator.d.ts +38 -0
  138. package/sdk/application/models/UserValidator.js +233 -0
  139. package/sdk/common/AxiosHelper.d.ts +1 -0
  140. package/sdk/common/AxiosHelper.js +141 -0
  141. package/sdk/common/Constant.d.ts +294 -0
  142. package/sdk/common/Constant.js +332 -0
  143. package/sdk/common/FDKError.d.ts +26 -0
  144. package/sdk/common/FDKError.js +51 -0
  145. package/sdk/common/Logger.d.ts +2 -0
  146. package/sdk/common/Logger.js +85 -0
  147. package/sdk/common/Paginator.d.ts +16 -0
  148. package/sdk/common/Paginator.js +26 -0
  149. package/sdk/common/RequestSigner.d.ts +1 -0
  150. package/sdk/common/RequestSigner.js +306 -0
  151. package/sdk/common/Utility.d.ts +9 -0
  152. package/sdk/common/Utility.js +86 -0
  153. package/sdk/common/utils.d.ts +14 -0
  154. package/sdk/common/utils.js +165 -0
  155. package/sdk/platform/OAuthClient.d.ts +26 -0
  156. package/sdk/platform/OAuthClient.js +221 -0
  157. package/sdk/platform/PlatformAPIClient.d.ts +12 -0
  158. package/sdk/platform/PlatformAPIClient.js +43 -0
  159. package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
  160. package/sdk/platform/PlatformApplicationClient.js +23185 -0
  161. package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
  162. package/sdk/platform/PlatformApplicationModels.js +21262 -0
  163. package/sdk/platform/PlatformClient.d.ts +9535 -0
  164. package/sdk/platform/PlatformClient.js +12336 -0
  165. package/sdk/platform/PlatformConfig.d.ts +29 -0
  166. package/sdk/platform/PlatformConfig.js +36 -0
  167. package/sdk/platform/PlatformModels.d.ts +1396 -0
  168. package/sdk/platform/PlatformModels.js +19222 -0
  169. package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
  170. package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
  171. package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
  172. package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
  173. package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
  174. package/sdk/platform/client/BillingPlatformClient.js +381 -0
  175. package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
  176. package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
  177. package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
  178. package/sdk/platform/client/CommonPlatformClient.js +84 -0
  179. package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
  180. package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
  181. package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
  182. package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
  183. package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
  184. package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
  185. package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
  186. package/sdk/platform/client/DiscountPlatformClient.js +364 -0
  187. package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
  188. package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
  189. package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
  190. package/sdk/platform/client/InventoryPlatformClient.js +409 -0
  191. package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
  192. package/sdk/platform/client/LeadPlatformClient.js +439 -0
  193. package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
  194. package/sdk/platform/client/OrderPlatformClient.js +521 -0
  195. package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
  196. package/sdk/platform/client/PaymentPlatformClient.js +331 -0
  197. package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
  198. package/sdk/platform/client/WebhookPlatformClient.js +207 -0
  199. package/sdk/platform/index.d.ts +2 -0
  200. package/sdk/platform/index.js +4 -0
  201. package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
  202. package/sdk/platform/models/AnalyticsValidator.js +36 -0
  203. package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
  204. package/sdk/platform/models/AuditTrailValidator.js +26 -0
  205. package/sdk/platform/models/BillingValidator.d.ts +15 -0
  206. package/sdk/platform/models/BillingValidator.js +72 -0
  207. package/sdk/platform/models/CartValidator.d.ts +0 -0
  208. package/sdk/platform/models/CartValidator.js +0 -0
  209. package/sdk/platform/models/CatalogValidator.d.ts +74 -0
  210. package/sdk/platform/models/CatalogValidator.js +484 -0
  211. package/sdk/platform/models/CommonValidator.d.ts +5 -0
  212. package/sdk/platform/models/CommonValidator.js +18 -0
  213. package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
  214. package/sdk/platform/models/CommunicationValidator.js +11 -0
  215. package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
  216. package/sdk/platform/models/CompanyProfileValidator.js +93 -0
  217. package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
  218. package/sdk/platform/models/ConfigurationValidator.js +134 -0
  219. package/sdk/platform/models/ContentValidator.d.ts +0 -0
  220. package/sdk/platform/models/ContentValidator.js +0 -0
  221. package/sdk/platform/models/DiscountValidator.d.ts +13 -0
  222. package/sdk/platform/models/DiscountValidator.js +75 -0
  223. package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
  224. package/sdk/platform/models/FileStorageValidator.js +44 -0
  225. package/sdk/platform/models/InventoryValidator.d.ts +15 -0
  226. package/sdk/platform/models/InventoryValidator.js +81 -0
  227. package/sdk/platform/models/LeadValidator.d.ts +14 -0
  228. package/sdk/platform/models/LeadValidator.js +78 -0
  229. package/sdk/platform/models/OrderValidator.d.ts +14 -0
  230. package/sdk/platform/models/OrderValidator.js +110 -0
  231. package/sdk/platform/models/PartnerValidator.d.ts +0 -0
  232. package/sdk/platform/models/PartnerValidator.js +0 -0
  233. package/sdk/platform/models/PaymentValidator.d.ts +13 -0
  234. package/sdk/platform/models/PaymentValidator.js +65 -0
  235. package/sdk/platform/models/RewardsValidator.d.ts +0 -0
  236. package/sdk/platform/models/RewardsValidator.js +0 -0
  237. package/sdk/platform/models/ShareValidator.d.ts +0 -0
  238. package/sdk/platform/models/ShareValidator.js +0 -0
  239. package/sdk/platform/models/ThemeValidator.d.ts +0 -0
  240. package/sdk/platform/models/ThemeValidator.js +0 -0
  241. package/sdk/platform/models/UserValidator.d.ts +0 -0
  242. package/sdk/platform/models/UserValidator.js +0 -0
  243. package/sdk/platform/models/WebhookValidator.d.ts +9 -0
  244. package/sdk/platform/models/WebhookValidator.js +42 -0
  245. package/sdk/public/PublicAPIClient.d.ts +11 -0
  246. package/sdk/public/PublicAPIClient.js +38 -0
  247. package/sdk/public/PublicClient.d.ts +12 -0
  248. package/sdk/public/PublicClient.js +24 -0
  249. package/sdk/public/PublicConfig.d.ts +10 -0
  250. package/sdk/public/PublicConfig.js +12 -0
  251. package/sdk/public/PublicModels.d.ts +50 -0
  252. package/sdk/public/PublicModels.js +712 -0
  253. package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
  254. package/sdk/public/client/ConfigurationPublicClient.js +102 -0
  255. package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
  256. package/sdk/public/client/InventoryPublicClient.js +239 -0
  257. package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
  258. package/sdk/public/client/WebhookPublicClient.js +92 -0
  259. package/sdk/public/constructUrl.d.ts +5 -0
  260. package/sdk/public/constructUrl.js +13 -0
  261. package/sdk/public/index.d.ts +2 -0
  262. package/sdk/public/index.js +4 -0
  263. package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
  264. package/sdk/public/models/ConfigurationValidator.js +18 -0
  265. package/sdk/public/models/InventoryValidator.d.ts +9 -0
  266. package/sdk/public/models/InventoryValidator.js +43 -0
  267. package/sdk/public/models/WebhookValidator.d.ts +5 -0
  268. package/sdk/public/models/WebhookValidator.js +14 -0
  269. package/tests/application/catalog.spec.js +47 -0
  270. package/tests/common/action-url.spec.js +35 -0
  271. package/tests/common/schema/action-url.json +163 -0
  272. package/tests/common/schema/url-action.json +667 -0
  273. package/tests/common/url-action.spec.js +48 -0
  274. package/tests/helpers/cookie.helper.js +31 -0
  275. package/tests/helpers/oauth.helper.js +43 -0
  276. package/tests/platform/catalog.spec.js +49 -0
  277. package/tests/public/location.spec.js +39 -0
@@ -0,0 +1,649 @@
1
+ const APIClient = require("../ApplicationAPIClient");
2
+ const Paginator = require("../../common/Paginator");
3
+ const constructUrl = require("../constructUrl");
4
+ const { FDKClientValidationError } = require("../../common/FDKError");
5
+ const ConfigurationValidator = require("../models/ConfigurationValidator");
6
+
7
+ class Configuration {
8
+ constructor(_conf) {
9
+ this._conf = _conf;
10
+ this._relativeUrls = {
11
+ getApplication: "/service/application/configuration/v1.0/application",
12
+ getOwnerInfo: "/service/application/configuration/v1.0/about",
13
+ getBasicDetails: "/service/application/configuration/v1.0/detail",
14
+ getIntegrationTokens: "/service/application/configuration/v1.0/token",
15
+ getOrderingStores:
16
+ "/service/application/configuration/v1.0/ordering-store/stores",
17
+ getStoreDetailById:
18
+ "/service/application/configuration/v1.0/ordering-store/stores/{store_id}",
19
+ getFeatures: "/service/application/configuration/v1.0/feature",
20
+ getContactInfo: "/service/application/configuration/v1.0/information",
21
+ getCurrencies: "/service/application/configuration/v1.0/currencies",
22
+ getCurrencyById: "/service/application/configuration/v1.0/currency/{id}",
23
+ getAppCurrencies: "/service/application/configuration/v1.0/currency",
24
+ getLanguages: "/service/application/configuration/v1.0/languages",
25
+ getOrderingStoreCookie:
26
+ "/service/application/configuration/v1.0/ordering-store/select",
27
+ removeOrderingStoreCookie:
28
+ "/service/application/configuration/v1.0/ordering-store/select",
29
+ getAppStaffList: "/service/application/configuration/v1.0/staff/list",
30
+ getAppStaffs: "/service/application/configuration/v1.0/staff",
31
+ };
32
+ this._urls = Object.entries(this._relativeUrls).reduce(
33
+ (urls, [method, relativeUrl]) => {
34
+ urls[method] = `${_conf.domain}${relativeUrl}`;
35
+ return urls;
36
+ },
37
+ {}
38
+ );
39
+ }
40
+
41
+ updateUrls(urls) {
42
+ this._urls = {
43
+ ...this._urls,
44
+ ...urls,
45
+ };
46
+ }
47
+
48
+ /**
49
+ * @param {Object} arg - Arg object.
50
+ * @returns {Promise<Application>} - Success response
51
+ * @summary: Get current application details
52
+ * @description: Use this API to get the current application details which includes configurations that indicate the status of the website, domain, ID, tokens, images, etc.
53
+ */
54
+ getApplication({} = {}) {
55
+ const { error } = ConfigurationValidator.getApplication().validate(
56
+ {},
57
+ { abortEarly: false, allowUnknown: true }
58
+ );
59
+ if (error) {
60
+ return Promise.reject(new FDKClientValidationError(error));
61
+ }
62
+ const query_params = {};
63
+
64
+ const xHeaders = {};
65
+
66
+ return APIClient.execute(
67
+ this._conf,
68
+ "get",
69
+ constructUrl({
70
+ url: this._urls["getApplication"],
71
+ params: {},
72
+ }),
73
+ query_params,
74
+ undefined,
75
+ xHeaders
76
+ );
77
+ }
78
+
79
+ /**
80
+ * @param {Object} arg - Arg object.
81
+ * @returns {Promise<ApplicationAboutResponse>} - Success response
82
+ * @summary: Get application, owner and seller information
83
+ * @description: Use this API to get the current application details which includes channel name, description, banner, logo, favicon, domain details, etc. This API also retrieves the seller and owner information such as address, email address, and phone number.
84
+ */
85
+ getOwnerInfo({} = {}) {
86
+ const { error } = ConfigurationValidator.getOwnerInfo().validate(
87
+ {},
88
+ { abortEarly: false, allowUnknown: true }
89
+ );
90
+ if (error) {
91
+ return Promise.reject(new FDKClientValidationError(error));
92
+ }
93
+ const query_params = {};
94
+
95
+ const xHeaders = {};
96
+
97
+ return APIClient.execute(
98
+ this._conf,
99
+ "get",
100
+ constructUrl({
101
+ url: this._urls["getOwnerInfo"],
102
+ params: {},
103
+ }),
104
+ query_params,
105
+ undefined,
106
+ xHeaders
107
+ );
108
+ }
109
+
110
+ /**
111
+ * @param {Object} arg - Arg object.
112
+ * @returns {Promise<ApplicationDetail>} - Success response
113
+ * @summary: Get basic application details
114
+ * @description: Use this API to retrieve only the basic details of the application which includes channel name, description, banner, logo, favicon, domain details, etc.
115
+ */
116
+ getBasicDetails({} = {}) {
117
+ const { error } = ConfigurationValidator.getBasicDetails().validate(
118
+ {},
119
+ { abortEarly: false, allowUnknown: true }
120
+ );
121
+ if (error) {
122
+ return Promise.reject(new FDKClientValidationError(error));
123
+ }
124
+ const query_params = {};
125
+
126
+ const xHeaders = {};
127
+
128
+ return APIClient.execute(
129
+ this._conf,
130
+ "get",
131
+ constructUrl({
132
+ url: this._urls["getBasicDetails"],
133
+ params: {},
134
+ }),
135
+ query_params,
136
+ undefined,
137
+ xHeaders
138
+ );
139
+ }
140
+
141
+ /**
142
+ * @param {Object} arg - Arg object.
143
+ * @returns {Promise<AppTokenResponse>} - Success response
144
+ * @summary: Get integration tokens
145
+ * @description: Use this API to retrieve the tokens used while integrating Firebase, MoEngage, Segment, GTM, Freshchat, Safetynet, Google Map and Facebook. **Note** - Token values are encrypted with AES encryption using a secret key. Kindly reach out to the developers for obtaining the secret key.
146
+ */
147
+ getIntegrationTokens({} = {}) {
148
+ const { error } = ConfigurationValidator.getIntegrationTokens().validate(
149
+ {},
150
+ { abortEarly: false, allowUnknown: true }
151
+ );
152
+ if (error) {
153
+ return Promise.reject(new FDKClientValidationError(error));
154
+ }
155
+ const query_params = {};
156
+
157
+ const xHeaders = {};
158
+
159
+ return APIClient.execute(
160
+ this._conf,
161
+ "get",
162
+ constructUrl({
163
+ url: this._urls["getIntegrationTokens"],
164
+ params: {},
165
+ }),
166
+ query_params,
167
+ undefined,
168
+ xHeaders
169
+ );
170
+ }
171
+
172
+ /**
173
+ * @param {Object} arg - Arg object.
174
+ * @param {number} [arg.pageNo] - The page number to navigate through the
175
+ * given set of results. Default value is 1.
176
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
177
+ * page. Default value is 10.
178
+ * @param {string} [arg.q] - Store code or name of the ordering store.
179
+ * @returns {Promise<OrderingStores>} - Success response
180
+ * @summary: Get deployment stores
181
+ * @description: Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders).
182
+ */
183
+ getOrderingStores({ pageNo, pageSize, q } = {}) {
184
+ const { error } = ConfigurationValidator.getOrderingStores().validate(
185
+ { pageNo, pageSize, q },
186
+ { abortEarly: false, allowUnknown: true }
187
+ );
188
+ if (error) {
189
+ return Promise.reject(new FDKClientValidationError(error));
190
+ }
191
+ const query_params = {};
192
+ query_params["page_no"] = pageNo;
193
+ query_params["page_size"] = pageSize;
194
+ query_params["q"] = q;
195
+
196
+ const xHeaders = {};
197
+
198
+ return APIClient.execute(
199
+ this._conf,
200
+ "get",
201
+ constructUrl({
202
+ url: this._urls["getOrderingStores"],
203
+ params: {},
204
+ }),
205
+ query_params,
206
+ undefined,
207
+ xHeaders
208
+ );
209
+ }
210
+
211
+ /**
212
+ * @param {Object} arg - Arg object.
213
+ * @param {number} [arg.pageSize] - The number of items to retrieve in each
214
+ * page. Default value is 10.
215
+ * @param {string} [arg.q] - Store code or name of the ordering store.
216
+ * @summary: Get deployment stores
217
+ * @description: Use this API to retrieve the details of all the deployment stores (the selling locations where the application will be utilized for placing orders).
218
+ */
219
+ getOrderingStoresPaginator({ pageSize, q } = {}) {
220
+ const paginator = new Paginator();
221
+ const callback = async () => {
222
+ const pageId = paginator.nextId;
223
+ const pageNo = paginator.pageNo;
224
+ const pageType = "number";
225
+ const data = await this.getOrderingStores({
226
+ pageNo: pageNo,
227
+ pageSize: pageSize,
228
+ q: q,
229
+ });
230
+ paginator.setPaginator({
231
+ hasNext: data.page.has_next ? true : false,
232
+ nextId: data.page.next_id,
233
+ });
234
+ return data;
235
+ };
236
+ paginator.setCallback(callback);
237
+ return paginator;
238
+ }
239
+
240
+ /**
241
+ * @param {Object} arg - Arg object.
242
+ * @param {number} arg.storeId - Store uid
243
+ * @returns {Promise<OrderingStore>} - Success response
244
+ * @summary: Get ordering store details
245
+ * @description: Use this API to retrieve the details of given stores uid (the selling locations where the application will be utilized for placing orders).
246
+ */
247
+ getStoreDetailById({ storeId } = {}) {
248
+ const { error } = ConfigurationValidator.getStoreDetailById().validate(
249
+ { storeId },
250
+ { abortEarly: false, allowUnknown: true }
251
+ );
252
+ if (error) {
253
+ return Promise.reject(new FDKClientValidationError(error));
254
+ }
255
+ const query_params = {};
256
+
257
+ const xHeaders = {};
258
+
259
+ return APIClient.execute(
260
+ this._conf,
261
+ "get",
262
+ constructUrl({
263
+ url: this._urls["getStoreDetailById"],
264
+ params: { storeId },
265
+ }),
266
+ query_params,
267
+ undefined,
268
+ xHeaders
269
+ );
270
+ }
271
+
272
+ /**
273
+ * @param {Object} arg - Arg object.
274
+ * @returns {Promise<AppFeatureResponse>} - Success response
275
+ * @summary: Get features of application
276
+ * @description: Use this API to retrieve the configuration of features such as product detail, landing page, options in the login/registration screen, communication opt-in, cart options and many more.
277
+ */
278
+ getFeatures({} = {}) {
279
+ const { error } = ConfigurationValidator.getFeatures().validate(
280
+ {},
281
+ { abortEarly: false, allowUnknown: true }
282
+ );
283
+ if (error) {
284
+ return Promise.reject(new FDKClientValidationError(error));
285
+ }
286
+ const query_params = {};
287
+
288
+ const xHeaders = {};
289
+
290
+ return APIClient.execute(
291
+ this._conf,
292
+ "get",
293
+ constructUrl({
294
+ url: this._urls["getFeatures"],
295
+ params: {},
296
+ }),
297
+ query_params,
298
+ undefined,
299
+ xHeaders
300
+ );
301
+ }
302
+
303
+ /**
304
+ * @param {Object} arg - Arg object.
305
+ * @returns {Promise<ApplicationInformation>} - Success response
306
+ * @summary: Get application information
307
+ * @description: Use this API to retrieve information about the social links, address and contact information of the company/seller/brand operating the application.
308
+ */
309
+ getContactInfo({} = {}) {
310
+ const { error } = ConfigurationValidator.getContactInfo().validate(
311
+ {},
312
+ { abortEarly: false, allowUnknown: true }
313
+ );
314
+ if (error) {
315
+ return Promise.reject(new FDKClientValidationError(error));
316
+ }
317
+ const query_params = {};
318
+
319
+ const xHeaders = {};
320
+
321
+ return APIClient.execute(
322
+ this._conf,
323
+ "get",
324
+ constructUrl({
325
+ url: this._urls["getContactInfo"],
326
+ params: {},
327
+ }),
328
+ query_params,
329
+ undefined,
330
+ xHeaders
331
+ );
332
+ }
333
+
334
+ /**
335
+ * @param {Object} arg - Arg object.
336
+ * @returns {Promise<CurrenciesResponse>} - Success response
337
+ * @summary: Get all currencies list
338
+ * @description: Use this API to get a list of currencies available. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
339
+ */
340
+ getCurrencies({} = {}) {
341
+ const { error } = ConfigurationValidator.getCurrencies().validate(
342
+ {},
343
+ { abortEarly: false, allowUnknown: true }
344
+ );
345
+ if (error) {
346
+ return Promise.reject(new FDKClientValidationError(error));
347
+ }
348
+ const query_params = {};
349
+
350
+ const xHeaders = {};
351
+
352
+ return APIClient.execute(
353
+ this._conf,
354
+ "get",
355
+ constructUrl({
356
+ url: this._urls["getCurrencies"],
357
+ params: {},
358
+ }),
359
+ query_params,
360
+ undefined,
361
+ xHeaders
362
+ );
363
+ }
364
+
365
+ /**
366
+ * @param {Object} arg - Arg object.
367
+ * @param {string} arg.id - Object ID assigned to the currency
368
+ * @returns {Promise<Currency>} - Success response
369
+ * @summary: Get currency by its ID
370
+ * @description: Use this API to retrieve a currency using its ID.
371
+ */
372
+ getCurrencyById({ id } = {}) {
373
+ const { error } = ConfigurationValidator.getCurrencyById().validate(
374
+ { id },
375
+ { abortEarly: false, allowUnknown: true }
376
+ );
377
+ if (error) {
378
+ return Promise.reject(new FDKClientValidationError(error));
379
+ }
380
+ const query_params = {};
381
+
382
+ const xHeaders = {};
383
+
384
+ return APIClient.execute(
385
+ this._conf,
386
+ "get",
387
+ constructUrl({
388
+ url: this._urls["getCurrencyById"],
389
+ params: { id },
390
+ }),
391
+ query_params,
392
+ undefined,
393
+ xHeaders
394
+ );
395
+ }
396
+
397
+ /**
398
+ * @param {Object} arg - Arg object.
399
+ * @returns {Promise<AppCurrencyResponse>} - Success response
400
+ * @summary: Get currencies enabled in the application
401
+ * @description: Use this API to get a list of currencies allowed in the current application. Moreover, get the name, code, symbol, and the decimal digits of the currencies.
402
+ */
403
+ getAppCurrencies({} = {}) {
404
+ const { error } = ConfigurationValidator.getAppCurrencies().validate(
405
+ {},
406
+ { abortEarly: false, allowUnknown: true }
407
+ );
408
+ if (error) {
409
+ return Promise.reject(new FDKClientValidationError(error));
410
+ }
411
+ const query_params = {};
412
+
413
+ const xHeaders = {};
414
+
415
+ return APIClient.execute(
416
+ this._conf,
417
+ "get",
418
+ constructUrl({
419
+ url: this._urls["getAppCurrencies"],
420
+ params: {},
421
+ }),
422
+ query_params,
423
+ undefined,
424
+ xHeaders
425
+ );
426
+ }
427
+
428
+ /**
429
+ * @param {Object} arg - Arg object.
430
+ * @returns {Promise<LanguageResponse>} - Success response
431
+ * @summary: Get list of languages
432
+ * @description: Use this API to get a list of languages supported in the application.
433
+ */
434
+ getLanguages({} = {}) {
435
+ const { error } = ConfigurationValidator.getLanguages().validate(
436
+ {},
437
+ { abortEarly: false, allowUnknown: true }
438
+ );
439
+ if (error) {
440
+ return Promise.reject(new FDKClientValidationError(error));
441
+ }
442
+ const query_params = {};
443
+
444
+ const xHeaders = {};
445
+
446
+ return APIClient.execute(
447
+ this._conf,
448
+ "get",
449
+ constructUrl({
450
+ url: this._urls["getLanguages"],
451
+ params: {},
452
+ }),
453
+ query_params,
454
+ undefined,
455
+ xHeaders
456
+ );
457
+ }
458
+
459
+ /**
460
+ * @param {Object} arg - Arg object.
461
+ * @param {OrderingStoreSelectRequest} arg.body
462
+ * @returns {Promise<SuccessMessageResponse>} - Success response
463
+ * @summary: Get an Ordering Store signed cookie on selection of ordering store.
464
+ * @description: Use this API to get an Ordering Store signed cookie upon selecting an ordering store. This will be used by the cart service to verify a coupon against the selected ordering store in cart.
465
+ */
466
+ getOrderingStoreCookie({ body } = {}) {
467
+ const { error } = ConfigurationValidator.getOrderingStoreCookie().validate(
468
+ { body },
469
+ { abortEarly: false, allowUnknown: true }
470
+ );
471
+ if (error) {
472
+ return Promise.reject(new FDKClientValidationError(error));
473
+ }
474
+ const query_params = {};
475
+
476
+ const xHeaders = {};
477
+
478
+ return APIClient.execute(
479
+ this._conf,
480
+ "post",
481
+ constructUrl({
482
+ url: this._urls["getOrderingStoreCookie"],
483
+ params: {},
484
+ }),
485
+ query_params,
486
+ body,
487
+ xHeaders
488
+ );
489
+ }
490
+
491
+ /**
492
+ * @param {Object} arg - Arg object.
493
+ * @returns {Promise<SuccessMessageResponse>} - Success response
494
+ * @summary: Unset the Ordering Store signed cookie.
495
+ * @description: Use this API to unset the Ordering Store cookie upon changing the sales channel, by its domain URL, in the Universal Fynd Store app.
496
+ */
497
+ removeOrderingStoreCookie({} = {}) {
498
+ const {
499
+ error,
500
+ } = ConfigurationValidator.removeOrderingStoreCookie().validate(
501
+ {},
502
+ { abortEarly: false, allowUnknown: true }
503
+ );
504
+ if (error) {
505
+ return Promise.reject(new FDKClientValidationError(error));
506
+ }
507
+ const query_params = {};
508
+
509
+ const xHeaders = {};
510
+
511
+ return APIClient.execute(
512
+ this._conf,
513
+ "delete",
514
+ constructUrl({
515
+ url: this._urls["removeOrderingStoreCookie"],
516
+ params: {},
517
+ }),
518
+ query_params,
519
+ undefined,
520
+ xHeaders
521
+ );
522
+ }
523
+
524
+ /**
525
+ * @param {Object} arg - Arg object.
526
+ * @param {number} [arg.pageNo] -
527
+ * @param {number} [arg.pageSize] -
528
+ * @param {boolean} [arg.orderIncent] - This is a boolean value. Select
529
+ * `true` to retrieve the staff members eligible for getting incentives on orders.
530
+ * @param {number} [arg.orderingStore] - ID of the ordering store. Helps in
531
+ * retrieving staff members working at a particular ordering store.
532
+ * @param {string} [arg.user] - Mongo ID of the staff. Helps in retrieving
533
+ * the details of a particular staff member.
534
+ * @returns {Promise<AppStaffListResponse>} - Success response
535
+ * @summary: Get a list of staff.
536
+ * @description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application.
537
+ */
538
+ getAppStaffList({ pageNo, pageSize, orderIncent, orderingStore, user } = {}) {
539
+ const { error } = ConfigurationValidator.getAppStaffList().validate(
540
+ { pageNo, pageSize, orderIncent, orderingStore, user },
541
+ { abortEarly: false, allowUnknown: true }
542
+ );
543
+ if (error) {
544
+ return Promise.reject(new FDKClientValidationError(error));
545
+ }
546
+ const query_params = {};
547
+ query_params["page_no"] = pageNo;
548
+ query_params["page_size"] = pageSize;
549
+ query_params["order_incent"] = orderIncent;
550
+ query_params["ordering_store"] = orderingStore;
551
+ query_params["user"] = user;
552
+
553
+ const xHeaders = {};
554
+
555
+ return APIClient.execute(
556
+ this._conf,
557
+ "get",
558
+ constructUrl({
559
+ url: this._urls["getAppStaffList"],
560
+ params: {},
561
+ }),
562
+ query_params,
563
+ undefined,
564
+ xHeaders
565
+ );
566
+ }
567
+
568
+ /**
569
+ * @param {Object} arg - Arg object.
570
+ * @param {number} [arg.pageSize] -
571
+ * @param {boolean} [arg.orderIncent] - This is a boolean value. Select
572
+ * `true` to retrieve the staff members eligible for getting incentives on orders.
573
+ * @param {number} [arg.orderingStore] - ID of the ordering store. Helps in
574
+ * retrieving staff members working at a particular ordering store.
575
+ * @param {string} [arg.user] - Mongo ID of the staff. Helps in retrieving
576
+ * the details of a particular staff member.
577
+ * @summary: Get a list of staff.
578
+ * @description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application.
579
+ */
580
+ getAppStaffListPaginator({
581
+ pageSize,
582
+ orderIncent,
583
+ orderingStore,
584
+ user,
585
+ } = {}) {
586
+ const paginator = new Paginator();
587
+ const callback = async () => {
588
+ const pageId = paginator.nextId;
589
+ const pageNo = paginator.pageNo;
590
+ const pageType = "number";
591
+ const data = await this.getAppStaffList({
592
+ pageNo: pageNo,
593
+ pageSize: pageSize,
594
+ orderIncent: orderIncent,
595
+ orderingStore: orderingStore,
596
+ user: user,
597
+ });
598
+ paginator.setPaginator({
599
+ hasNext: data.page.has_next ? true : false,
600
+ nextId: data.page.next_id,
601
+ });
602
+ return data;
603
+ };
604
+ paginator.setCallback(callback);
605
+ return paginator;
606
+ }
607
+
608
+ /**
609
+ * @param {Object} arg - Arg object.
610
+ * @param {boolean} [arg.orderIncent] - This is a boolean value. Select
611
+ * `true` to retrieve the staff members eligible for getting incentives on orders.
612
+ * @param {number} [arg.orderingStore] - ID of the ordering store. Helps in
613
+ * retrieving staff members working at a particular ordering store.
614
+ * @param {string} [arg.user] - Mongo ID of the staff. Helps in retrieving
615
+ * the details of a particular staff member.
616
+ * @returns {Promise<AppStaffResponse>} - Success response
617
+ * @summary: Get a list of staff.
618
+ * @description: Use this API to get a list of staff including the names, employee code, incentive status, assigned ordering stores, and title of each staff added to the application.
619
+ */
620
+ getAppStaffs({ orderIncent, orderingStore, user } = {}) {
621
+ const { error } = ConfigurationValidator.getAppStaffs().validate(
622
+ { orderIncent, orderingStore, user },
623
+ { abortEarly: false, allowUnknown: true }
624
+ );
625
+ if (error) {
626
+ return Promise.reject(new FDKClientValidationError(error));
627
+ }
628
+ const query_params = {};
629
+ query_params["order_incent"] = orderIncent;
630
+ query_params["ordering_store"] = orderingStore;
631
+ query_params["user"] = user;
632
+
633
+ const xHeaders = {};
634
+
635
+ return APIClient.execute(
636
+ this._conf,
637
+ "get",
638
+ constructUrl({
639
+ url: this._urls["getAppStaffs"],
640
+ params: {},
641
+ }),
642
+ query_params,
643
+ undefined,
644
+ xHeaders
645
+ );
646
+ }
647
+ }
648
+
649
+ module.exports = Configuration;