@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,2462 @@
1
+ const Paginator = require("../../common/Paginator");
2
+ const PlatformAPIClient = require("../PlatformAPIClient");
3
+ const { FDKClientValidationError } = require("../../common/FDKError");
4
+ const CatalogValidator = require("../models/CatalogValidator");
5
+ class Catalog {
6
+ constructor(config) {
7
+ this.config = config;
8
+ }
9
+
10
+ /**
11
+ * @param {Object} arg - Arg object.
12
+ * @param {string} [arg.q] - A search string that is searched with product
13
+ * bundle name.
14
+ * @param {string[]} [arg.slug] - Slugs of bundles to be retrieved.
15
+ * @summary: List all Product Bundles
16
+ * @description: Get all product bundles for a particular company
17
+ */
18
+ getProductBundle({ q, slug } = {}) {
19
+ const { error } = CatalogValidator.getProductBundle().validate(
20
+ {
21
+ q,
22
+ slug,
23
+ },
24
+ { abortEarly: false, allowUnknown: true }
25
+ );
26
+ if (error) {
27
+ return Promise.reject(new FDKClientValidationError(error));
28
+ }
29
+
30
+ const query_params = {};
31
+ query_params["q"] = q;
32
+ query_params["slug"] = slug;
33
+
34
+ const xHeaders = {};
35
+
36
+ return PlatformAPIClient.execute(
37
+ this.config,
38
+ "get",
39
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
40
+ query_params,
41
+ undefined,
42
+ xHeaders
43
+ );
44
+ }
45
+
46
+ /**
47
+ * @param {Object} arg - Arg object.
48
+ * @param {ProductBundleRequest} arg.body
49
+ * @summary: Create Product Bundle
50
+ * @description: Create Product Bundle. See `ProductBundleRequest` for the request body parameter need to create a product bundle. On successful request, returns in `ProductBundleRequest` with id
51
+ */
52
+ createProductBundle({ body } = {}) {
53
+ const { error } = CatalogValidator.createProductBundle().validate(
54
+ {
55
+ body,
56
+ },
57
+ { abortEarly: false, allowUnknown: true }
58
+ );
59
+ if (error) {
60
+ return Promise.reject(new FDKClientValidationError(error));
61
+ }
62
+
63
+ const query_params = {};
64
+
65
+ const xHeaders = {};
66
+
67
+ return PlatformAPIClient.execute(
68
+ this.config,
69
+ "post",
70
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/`,
71
+ query_params,
72
+ body,
73
+ xHeaders
74
+ );
75
+ }
76
+
77
+ /**
78
+ * @param {Object} arg - Arg object.
79
+ * @param {string} arg.id - A `id` is a unique identifier for a particular
80
+ * detail. Pass the `id` of the keywords which you want to retrieve.
81
+ * @summary: Get a particular Product Bundle details
82
+ * @description: Get a particular Bundle details by its `id`. If successful, returns a Product bundle resource in the response body specified in `GetProductBundleResponse`
83
+ */
84
+ getProductBundleDetail({ id } = {}) {
85
+ const { error } = CatalogValidator.getProductBundleDetail().validate(
86
+ {
87
+ id,
88
+ },
89
+ { abortEarly: false, allowUnknown: true }
90
+ );
91
+ if (error) {
92
+ return Promise.reject(new FDKClientValidationError(error));
93
+ }
94
+
95
+ const query_params = {};
96
+
97
+ const xHeaders = {};
98
+
99
+ return PlatformAPIClient.execute(
100
+ this.config,
101
+ "get",
102
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/${id}/`,
103
+ query_params,
104
+ undefined,
105
+ xHeaders
106
+ );
107
+ }
108
+
109
+ /**
110
+ * @param {Object} arg - Arg object.
111
+ * @param {string} arg.id - A `id` is a unique identifier for a particular
112
+ * detail. Pass the `id` of the keywords which you want to delete.
113
+ * @param {ProductBundleUpdateRequest} arg.body
114
+ * @summary: Update a Product Bundle
115
+ * @description: Update a Product Bundle by its id. On successful request, returns the updated product bundle
116
+ */
117
+ updateProductBundle({ id, body } = {}) {
118
+ const { error } = CatalogValidator.updateProductBundle().validate(
119
+ {
120
+ id,
121
+ body,
122
+ },
123
+ { abortEarly: false, allowUnknown: true }
124
+ );
125
+ if (error) {
126
+ return Promise.reject(new FDKClientValidationError(error));
127
+ }
128
+
129
+ const query_params = {};
130
+
131
+ const xHeaders = {};
132
+
133
+ return PlatformAPIClient.execute(
134
+ this.config,
135
+ "put",
136
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-bundle/${id}/`,
137
+ query_params,
138
+ body,
139
+ xHeaders
140
+ );
141
+ }
142
+
143
+ /**
144
+ * @param {Object} arg - Arg object.
145
+ * @param {boolean} [arg.active] - Filter size guide on basis of active, in-active
146
+ * @param {string} [arg.q] - Query that is to be searched.
147
+ * @param {string} [arg.tag] - To filter size guide on basis of tag.
148
+ * @param {number} [arg.pageNo] - The page number to navigate through the
149
+ * given set of results
150
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
151
+ * page. Default is 10.
152
+ * @summary: Get list of size guides
153
+ * @description: This API allows to view all the size guides associated to the seller.
154
+ */
155
+ getSizeGuides({ active, q, tag, pageNo, pageSize } = {}) {
156
+ const { error } = CatalogValidator.getSizeGuides().validate(
157
+ {
158
+ active,
159
+ q,
160
+ tag,
161
+ pageNo,
162
+ pageSize,
163
+ },
164
+ { abortEarly: false, allowUnknown: true }
165
+ );
166
+ if (error) {
167
+ return Promise.reject(new FDKClientValidationError(error));
168
+ }
169
+
170
+ const query_params = {};
171
+ query_params["active"] = active;
172
+ query_params["q"] = q;
173
+ query_params["tag"] = tag;
174
+ query_params["page_no"] = pageNo;
175
+ query_params["page_size"] = pageSize;
176
+
177
+ const xHeaders = {};
178
+
179
+ return PlatformAPIClient.execute(
180
+ this.config,
181
+ "get",
182
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
183
+ query_params,
184
+ undefined,
185
+ xHeaders
186
+ );
187
+ }
188
+
189
+ /**
190
+ * @param {Object} arg - Arg object.
191
+ * @param {ValidateSizeGuide} arg.body
192
+ * @summary: Create a size guide.
193
+ * @description: This API allows to create a size guide associated to a brand.
194
+ */
195
+ createSizeGuide({ body } = {}) {
196
+ const { error } = CatalogValidator.createSizeGuide().validate(
197
+ {
198
+ body,
199
+ },
200
+ { abortEarly: false, allowUnknown: true }
201
+ );
202
+ if (error) {
203
+ return Promise.reject(new FDKClientValidationError(error));
204
+ }
205
+
206
+ const query_params = {};
207
+
208
+ const xHeaders = {};
209
+
210
+ return PlatformAPIClient.execute(
211
+ this.config,
212
+ "post",
213
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide`,
214
+ query_params,
215
+ body,
216
+ xHeaders
217
+ );
218
+ }
219
+
220
+ /**
221
+ * @param {Object} arg - Arg object.
222
+ * @param {string} arg.id - Id of the size guide to be viewed.
223
+ * @summary: Get a single size guide.
224
+ * @description: This API helps to get data associated to a size guide.
225
+ */
226
+ getSizeGuide({ id } = {}) {
227
+ const { error } = CatalogValidator.getSizeGuide().validate(
228
+ {
229
+ id,
230
+ },
231
+ { abortEarly: false, allowUnknown: true }
232
+ );
233
+ if (error) {
234
+ return Promise.reject(new FDKClientValidationError(error));
235
+ }
236
+
237
+ const query_params = {};
238
+
239
+ const xHeaders = {};
240
+
241
+ return PlatformAPIClient.execute(
242
+ this.config,
243
+ "get",
244
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide/${id}/`,
245
+ query_params,
246
+ undefined,
247
+ xHeaders
248
+ );
249
+ }
250
+
251
+ /**
252
+ * @param {Object} arg - Arg object.
253
+ * @param {string} arg.id - Mongo id of the size guide to be edited
254
+ * @param {ValidateSizeGuide} arg.body
255
+ * @summary: Edit a size guide.
256
+ * @description: This API allows to edit a size guide.
257
+ */
258
+ updateSizeGuide({ id, body } = {}) {
259
+ const { error } = CatalogValidator.updateSizeGuide().validate(
260
+ {
261
+ id,
262
+ body,
263
+ },
264
+ { abortEarly: false, allowUnknown: true }
265
+ );
266
+ if (error) {
267
+ return Promise.reject(new FDKClientValidationError(error));
268
+ }
269
+
270
+ const query_params = {};
271
+
272
+ const xHeaders = {};
273
+
274
+ return PlatformAPIClient.execute(
275
+ this.config,
276
+ "put",
277
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/sizeguide/${id}/`,
278
+ query_params,
279
+ body,
280
+ xHeaders
281
+ );
282
+ }
283
+
284
+ /**
285
+ * @param {Object} arg - Arg object.
286
+ * @param {string} arg.sellerAppId - Id of the seller application which is
287
+ * serving the invetory/catalog of the company
288
+ * @summary: Analytics data of catalog and inventory that are being cross-selled.
289
+ * @description: Analytics data of catalog and inventory that are being cross-selled.
290
+ */
291
+ getSellerInsights({ sellerAppId } = {}) {
292
+ const { error } = CatalogValidator.getSellerInsights().validate(
293
+ {
294
+ sellerAppId,
295
+ },
296
+ { abortEarly: false, allowUnknown: true }
297
+ );
298
+ if (error) {
299
+ return Promise.reject(new FDKClientValidationError(error));
300
+ }
301
+
302
+ const query_params = {};
303
+
304
+ const xHeaders = {};
305
+
306
+ return PlatformAPIClient.execute(
307
+ this.config,
308
+ "get",
309
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/cross-selling/${sellerAppId}/analytics/insights/`,
310
+ query_params,
311
+ undefined,
312
+ xHeaders
313
+ );
314
+ }
315
+
316
+ /**
317
+ * @param {Object} arg - Arg object.
318
+ * @param {string} arg.marketplace - The marketplace for which the detail
319
+ * needs to be retrieved.
320
+ * @param {OptInPostRequest} arg.body
321
+ * @summary: Create/Update opt-in infomation.
322
+ * @description: Use this API to create/update opt-in information for given platform. If successful, returns data in the response body as specified in `OptInPostResponseSchema`
323
+ */
324
+ createMarketplaceOptin({ marketplace, body } = {}) {
325
+ const { error } = CatalogValidator.createMarketplaceOptin().validate(
326
+ {
327
+ marketplace,
328
+ body,
329
+ },
330
+ { abortEarly: false, allowUnknown: true }
331
+ );
332
+ if (error) {
333
+ return Promise.reject(new FDKClientValidationError(error));
334
+ }
335
+
336
+ const query_params = {};
337
+
338
+ const xHeaders = {};
339
+
340
+ return PlatformAPIClient.execute(
341
+ this.config,
342
+ "post",
343
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/${marketplace}/optin/`,
344
+ query_params,
345
+ body,
346
+ xHeaders
347
+ );
348
+ }
349
+
350
+ /**
351
+ * @param {Object} arg - Arg object.
352
+ * @summary: Get opt-in infomation.
353
+ * @description: Use this API to fetch opt-in information for all the platforms. If successful, returns a logs in the response body as specified in `GetOptInPlatformSchema`
354
+ */
355
+ getMarketplaceOptinDetail({} = {}) {
356
+ const { error } = CatalogValidator.getMarketplaceOptinDetail().validate(
357
+ {},
358
+ { abortEarly: false, allowUnknown: true }
359
+ );
360
+ if (error) {
361
+ return Promise.reject(new FDKClientValidationError(error));
362
+ }
363
+
364
+ const query_params = {};
365
+
366
+ const xHeaders = {};
367
+
368
+ return PlatformAPIClient.execute(
369
+ this.config,
370
+ "get",
371
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/`,
372
+ query_params,
373
+ undefined,
374
+ xHeaders
375
+ );
376
+ }
377
+
378
+ /**
379
+ * @param {Object} arg - Arg object.
380
+ * @summary: Get the Company details.
381
+ * @description: Get the details of the company associated with the given company_id passed.
382
+ */
383
+ getCompanyDetail({} = {}) {
384
+ const { error } = CatalogValidator.getCompanyDetail().validate(
385
+ {},
386
+ { abortEarly: false, allowUnknown: true }
387
+ );
388
+ if (error) {
389
+ return Promise.reject(new FDKClientValidationError(error));
390
+ }
391
+
392
+ const query_params = {};
393
+
394
+ const xHeaders = {};
395
+
396
+ return PlatformAPIClient.execute(
397
+ this.config,
398
+ "get",
399
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/company-details/`,
400
+ query_params,
401
+ undefined,
402
+ xHeaders
403
+ );
404
+ }
405
+
406
+ /**
407
+ * @param {Object} arg - Arg object.
408
+ * @param {boolean} [arg.isActive] - The is_active status for the optin id.
409
+ * @param {boolean} [arg.q] - The search value to filter the list.
410
+ * @param {number} [arg.pageNo] - The number of page for the company id.
411
+ * @param {number} [arg.pageSize] - Number of records that can be seen on
412
+ * the page for the company id.
413
+ * @param {string} [arg.marketplace] - The marketplace platform associated
414
+ * with the company id.
415
+ * @summary: Get the Company Brand details of Optin.
416
+ * @description: Get the details of the Brands associated with the given company_id passed.
417
+ */
418
+ getCompanyBrandDetail({ isActive, q, pageNo, pageSize, marketplace } = {}) {
419
+ const { error } = CatalogValidator.getCompanyBrandDetail().validate(
420
+ {
421
+ isActive,
422
+ q,
423
+ pageNo,
424
+ pageSize,
425
+ marketplace,
426
+ },
427
+ { abortEarly: false, allowUnknown: true }
428
+ );
429
+ if (error) {
430
+ return Promise.reject(new FDKClientValidationError(error));
431
+ }
432
+
433
+ const query_params = {};
434
+ query_params["is_active"] = isActive;
435
+ query_params["q"] = q;
436
+ query_params["page_no"] = pageNo;
437
+ query_params["page_size"] = pageSize;
438
+ query_params["marketplace"] = marketplace;
439
+
440
+ const xHeaders = {};
441
+
442
+ return PlatformAPIClient.execute(
443
+ this.config,
444
+ "get",
445
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/company-brand-details/`,
446
+ query_params,
447
+ undefined,
448
+ xHeaders
449
+ );
450
+ }
451
+
452
+ /**
453
+ * @param {Object} arg - Arg object.
454
+ * @summary: Get the Company metrics
455
+ * @description: Get the Company metrics associated with the company ID passed.
456
+ */
457
+ getCompanyMetrics({} = {}) {
458
+ const { error } = CatalogValidator.getCompanyMetrics().validate(
459
+ {},
460
+ { abortEarly: false, allowUnknown: true }
461
+ );
462
+ if (error) {
463
+ return Promise.reject(new FDKClientValidationError(error));
464
+ }
465
+
466
+ const query_params = {};
467
+
468
+ const xHeaders = {};
469
+
470
+ return PlatformAPIClient.execute(
471
+ this.config,
472
+ "get",
473
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/company-metrics/`,
474
+ query_params,
475
+ undefined,
476
+ xHeaders
477
+ );
478
+ }
479
+
480
+ /**
481
+ * @param {Object} arg - Arg object.
482
+ * @param {string} [arg.q] - The search related the store for the company id.
483
+ * @param {number} [arg.pageNo] - The number of page for the company id.
484
+ * @param {number} [arg.pageSize] - Number of records that can be seen on
485
+ * the page for the company id.
486
+ * @summary: Get the Store details.
487
+ * @description: Get the details of the store associated with the company ID passed.
488
+ */
489
+ getStoreDetail({ q, pageNo, pageSize } = {}) {
490
+ const { error } = CatalogValidator.getStoreDetail().validate(
491
+ {
492
+ q,
493
+ pageNo,
494
+ pageSize,
495
+ },
496
+ { abortEarly: false, allowUnknown: true }
497
+ );
498
+ if (error) {
499
+ return Promise.reject(new FDKClientValidationError(error));
500
+ }
501
+
502
+ const query_params = {};
503
+ query_params["q"] = q;
504
+ query_params["page_no"] = pageNo;
505
+ query_params["page_size"] = pageSize;
506
+
507
+ const xHeaders = {};
508
+
509
+ return PlatformAPIClient.execute(
510
+ this.config,
511
+ "get",
512
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/marketplaces/location-details/`,
513
+ query_params,
514
+ undefined,
515
+ xHeaders
516
+ );
517
+ }
518
+
519
+ /**
520
+ * @param {Object} arg - Arg object.
521
+ * @param {string} arg.attributeSlug - Slug of the attribute for which you
522
+ * want to view the genders
523
+ * @summary: Get gender attribute details
524
+ * @description: This API allows to view the gender attribute details.
525
+ */
526
+ getGenderAttribute({ attributeSlug } = {}) {
527
+ const { error } = CatalogValidator.getGenderAttribute().validate(
528
+ {
529
+ attributeSlug,
530
+ },
531
+ { abortEarly: false, allowUnknown: true }
532
+ );
533
+ if (error) {
534
+ return Promise.reject(new FDKClientValidationError(error));
535
+ }
536
+
537
+ const query_params = {};
538
+
539
+ const xHeaders = {};
540
+
541
+ return PlatformAPIClient.execute(
542
+ this.config,
543
+ "get",
544
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/${attributeSlug}`,
545
+ query_params,
546
+ undefined,
547
+ xHeaders
548
+ );
549
+ }
550
+
551
+ /**
552
+ * @param {Object} arg - Arg object.
553
+ * @param {string} arg.departments - A `department` is name of a departments
554
+ * whose category needs to be listed. Can specify multiple departments.
555
+ * @param {string} arg.itemType - An `item_type` is the type of item, it can
556
+ * be `set`, `standard`, `digital`, etc.
557
+ * @summary: List Department specifiec product categories
558
+ * @description: Allows you to list all product categories values for the departments specified
559
+ */
560
+ listProductTemplateCategories({ departments, itemType } = {}) {
561
+ const { error } = CatalogValidator.listProductTemplateCategories().validate(
562
+ {
563
+ departments,
564
+ itemType,
565
+ },
566
+ { abortEarly: false, allowUnknown: true }
567
+ );
568
+ if (error) {
569
+ return Promise.reject(new FDKClientValidationError(error));
570
+ }
571
+
572
+ const query_params = {};
573
+ query_params["departments"] = departments;
574
+ query_params["item_type"] = itemType;
575
+
576
+ const xHeaders = {};
577
+
578
+ return PlatformAPIClient.execute(
579
+ this.config,
580
+ "get",
581
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/templates/categories/`,
582
+ query_params,
583
+ undefined,
584
+ xHeaders
585
+ );
586
+ }
587
+
588
+ /**
589
+ * @param {Object} arg - Arg object.
590
+ * @param {number} [arg.pageNo] - The page number to navigate through the
591
+ * given set of results
592
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
593
+ * page. Default is 10.
594
+ * @param {string} [arg.name] - Can search departments by passing name.
595
+ * @param {string} [arg.search] - Can search departments by passing name of
596
+ * the department in search parameter.
597
+ * @param {boolean} [arg.isActive] - Can query for departments based on
598
+ * whether they are active or inactive.
599
+ * @summary: List all Departments.
600
+ * @description: Allows you to list all departments, also can search using name and filter active and incative departments, and item type.
601
+ */
602
+ listDepartmentsData({ pageNo, pageSize, name, search, isActive } = {}) {
603
+ const { error } = CatalogValidator.listDepartmentsData().validate(
604
+ {
605
+ pageNo,
606
+ pageSize,
607
+ name,
608
+ search,
609
+ isActive,
610
+ },
611
+ { abortEarly: false, allowUnknown: true }
612
+ );
613
+ if (error) {
614
+ return Promise.reject(new FDKClientValidationError(error));
615
+ }
616
+
617
+ const query_params = {};
618
+ query_params["page_no"] = pageNo;
619
+ query_params["page_size"] = pageSize;
620
+ query_params["name"] = name;
621
+ query_params["search"] = search;
622
+ query_params["is_active"] = isActive;
623
+
624
+ const xHeaders = {};
625
+
626
+ return PlatformAPIClient.execute(
627
+ this.config,
628
+ "get",
629
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/`,
630
+ query_params,
631
+ undefined,
632
+ xHeaders
633
+ );
634
+ }
635
+
636
+ /**
637
+ * @param {Object} arg - Arg object.
638
+ * @param {DepartmentCreateUpdate} arg.body
639
+ * @summary: Create the department.
640
+ * @description: Create departments using the API.
641
+ */
642
+ createDepartments({ body } = {}) {
643
+ const { error } = CatalogValidator.createDepartments().validate(
644
+ {
645
+ body,
646
+ },
647
+ { abortEarly: false, allowUnknown: true }
648
+ );
649
+ if (error) {
650
+ return Promise.reject(new FDKClientValidationError(error));
651
+ }
652
+
653
+ const query_params = {};
654
+
655
+ const xHeaders = {};
656
+
657
+ return PlatformAPIClient.execute(
658
+ this.config,
659
+ "post",
660
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/`,
661
+ query_params,
662
+ body,
663
+ xHeaders
664
+ );
665
+ }
666
+
667
+ /**
668
+ * @param {Object} arg - Arg object.
669
+ * @param {string} arg.uid - A `uid` is a unique identifier of a department.
670
+ * @summary: Get specific departments details by passing in unique id of the department.
671
+ * @description: Allows you to get department data, by uid.
672
+ */
673
+ getDepartmentData({ uid } = {}) {
674
+ const { error } = CatalogValidator.getDepartmentData().validate(
675
+ {
676
+ uid,
677
+ },
678
+ { abortEarly: false, allowUnknown: true }
679
+ );
680
+ if (error) {
681
+ return Promise.reject(new FDKClientValidationError(error));
682
+ }
683
+
684
+ const query_params = {};
685
+
686
+ const xHeaders = {};
687
+
688
+ return PlatformAPIClient.execute(
689
+ this.config,
690
+ "get",
691
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
692
+ query_params,
693
+ undefined,
694
+ xHeaders
695
+ );
696
+ }
697
+
698
+ /**
699
+ * @param {Object} arg - Arg object.
700
+ * @param {string} arg.uid - A `uid` is a unique identifier of a department.
701
+ * @param {DepartmentCreateUpdate} arg.body
702
+ * @summary: Update the department by their uid.
703
+ * @description: Update the department by their uid using this API.
704
+ */
705
+ updateDepartment({ uid, body } = {}) {
706
+ const { error } = CatalogValidator.updateDepartment().validate(
707
+ {
708
+ uid,
709
+ body,
710
+ },
711
+ { abortEarly: false, allowUnknown: true }
712
+ );
713
+ if (error) {
714
+ return Promise.reject(new FDKClientValidationError(error));
715
+ }
716
+
717
+ const query_params = {};
718
+
719
+ const xHeaders = {};
720
+
721
+ return PlatformAPIClient.execute(
722
+ this.config,
723
+ "put",
724
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/departments/${uid}/`,
725
+ query_params,
726
+ body,
727
+ xHeaders
728
+ );
729
+ }
730
+
731
+ /**
732
+ * @param {Object} arg - Arg object.
733
+ * @param {string} arg.department - A `department` is the name of a
734
+ * particular department.
735
+ * @summary: List all Templates
736
+ * @description: Allows you to list all product templates, also can filter by department
737
+ */
738
+ listProductTemplate({ department } = {}) {
739
+ const { error } = CatalogValidator.listProductTemplate().validate(
740
+ {
741
+ department,
742
+ },
743
+ { abortEarly: false, allowUnknown: true }
744
+ );
745
+ if (error) {
746
+ return Promise.reject(new FDKClientValidationError(error));
747
+ }
748
+
749
+ const query_params = {};
750
+ query_params["department"] = department;
751
+
752
+ const xHeaders = {};
753
+
754
+ return PlatformAPIClient.execute(
755
+ this.config,
756
+ "get",
757
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/templates/`,
758
+ query_params,
759
+ undefined,
760
+ xHeaders
761
+ );
762
+ }
763
+
764
+ /**
765
+ * @param {Object} arg - Arg object.
766
+ * @param {string} arg.slug - A `slug` is a unique identifier for a
767
+ * particular template.
768
+ * @summary: Validate Product Template Schema
769
+ * @description: Allows you to list all product templates validation values for all the fields present in the database
770
+ */
771
+ validateProductTemplate({ slug } = {}) {
772
+ const { error } = CatalogValidator.validateProductTemplate().validate(
773
+ {
774
+ slug,
775
+ },
776
+ { abortEarly: false, allowUnknown: true }
777
+ );
778
+ if (error) {
779
+ return Promise.reject(new FDKClientValidationError(error));
780
+ }
781
+
782
+ const query_params = {};
783
+
784
+ const xHeaders = {};
785
+
786
+ return PlatformAPIClient.execute(
787
+ this.config,
788
+ "get",
789
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/templates/${slug}/validation/schema/`,
790
+ query_params,
791
+ undefined,
792
+ xHeaders
793
+ );
794
+ }
795
+
796
+ /**
797
+ * @param {Object} arg - Arg object.
798
+ * @param {string} arg.slug - A `slug` is a unique identifier for a
799
+ * particular template.
800
+ * @summary: Download Product Template View
801
+ * @description: Allows you to download product template data
802
+ */
803
+ downloadProductTemplateViews({ slug } = {}) {
804
+ const { error } = CatalogValidator.downloadProductTemplateViews().validate(
805
+ {
806
+ slug,
807
+ },
808
+ { abortEarly: false, allowUnknown: true }
809
+ );
810
+ if (error) {
811
+ return Promise.reject(new FDKClientValidationError(error));
812
+ }
813
+
814
+ const query_params = {};
815
+
816
+ const xHeaders = {};
817
+
818
+ return PlatformAPIClient.execute(
819
+ this.config,
820
+ "get",
821
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/templates/${slug}/download/`,
822
+ query_params,
823
+ undefined,
824
+ xHeaders
825
+ );
826
+ }
827
+
828
+ /**
829
+ * @param {Object} arg - Arg object.
830
+ * @param {string} arg.itemType - An `item_type` defines the type of item.
831
+ * @summary: Download Product Template View
832
+ * @description: Allows you to download product template data
833
+ */
834
+ downloadProductTemplateView({ itemType } = {}) {
835
+ const { error } = CatalogValidator.downloadProductTemplateView().validate(
836
+ {
837
+ itemType,
838
+ },
839
+ { abortEarly: false, allowUnknown: true }
840
+ );
841
+ if (error) {
842
+ return Promise.reject(new FDKClientValidationError(error));
843
+ }
844
+
845
+ const query_params = {};
846
+ query_params["item_type"] = itemType;
847
+
848
+ const xHeaders = {};
849
+
850
+ return PlatformAPIClient.execute(
851
+ this.config,
852
+ "get",
853
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/templates/download/`,
854
+ query_params,
855
+ undefined,
856
+ xHeaders
857
+ );
858
+ }
859
+
860
+ /**
861
+ * @param {Object} arg - Arg object.
862
+ * @param {string} arg.itemType - An `item_type` defines the type of item.
863
+ * The default value is standard.
864
+ * @summary: Validate Product Template Schema
865
+ * @description: Allows you to list all product templates validation values for all the fields present in the database
866
+ */
867
+ validateProductTemplateSchema({ itemType } = {}) {
868
+ const { error } = CatalogValidator.validateProductTemplateSchema().validate(
869
+ {
870
+ itemType,
871
+ },
872
+ { abortEarly: false, allowUnknown: true }
873
+ );
874
+ if (error) {
875
+ return Promise.reject(new FDKClientValidationError(error));
876
+ }
877
+
878
+ const query_params = {};
879
+ query_params["item_type"] = itemType;
880
+
881
+ const xHeaders = {};
882
+
883
+ return PlatformAPIClient.execute(
884
+ this.config,
885
+ "get",
886
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/templates/validation/schema/`,
887
+ query_params,
888
+ undefined,
889
+ xHeaders
890
+ );
891
+ }
892
+
893
+ /**
894
+ * @param {Object} arg - Arg object.
895
+ * @summary: List HSN Codes
896
+ * @description: Allows you to list all hsn Codes
897
+ */
898
+ listHSNCodes({} = {}) {
899
+ const { error } = CatalogValidator.listHSNCodes().validate(
900
+ {},
901
+ { abortEarly: false, allowUnknown: true }
902
+ );
903
+ if (error) {
904
+ return Promise.reject(new FDKClientValidationError(error));
905
+ }
906
+
907
+ const query_params = {};
908
+
909
+ const xHeaders = {};
910
+
911
+ return PlatformAPIClient.execute(
912
+ this.config,
913
+ "get",
914
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/hsn/`,
915
+ query_params,
916
+ undefined,
917
+ xHeaders
918
+ );
919
+ }
920
+
921
+ /**
922
+ * @param {Object} arg - Arg object.
923
+ * @summary: Allows you to list all product templates export list details
924
+ * @description: Can view details including trigger data, task id , etc.
925
+ */
926
+ listProductTemplateExportDetails({} = {}) {
927
+ const {
928
+ error,
929
+ } = CatalogValidator.listProductTemplateExportDetails().validate(
930
+ {},
931
+ { abortEarly: false, allowUnknown: true }
932
+ );
933
+ if (error) {
934
+ return Promise.reject(new FDKClientValidationError(error));
935
+ }
936
+
937
+ const query_params = {};
938
+
939
+ const xHeaders = {};
940
+
941
+ return PlatformAPIClient.execute(
942
+ this.config,
943
+ "get",
944
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/downloads/`,
945
+ query_params,
946
+ undefined,
947
+ xHeaders
948
+ );
949
+ }
950
+
951
+ /**
952
+ * @param {Object} arg - Arg object.
953
+ * @param {string} arg.filter - A `filter` is the unique identifier of the
954
+ * type of value required.
955
+ * @summary: Allows you to list all values for Templates, Brands or Type
956
+ * @description: The filter type query parameter defines what type of data to return. The type of query returns the valid values for the same
957
+ */
958
+ listTemplateBrandTypeValues({ filter } = {}) {
959
+ const { error } = CatalogValidator.listTemplateBrandTypeValues().validate(
960
+ {
961
+ filter,
962
+ },
963
+ { abortEarly: false, allowUnknown: true }
964
+ );
965
+ if (error) {
966
+ return Promise.reject(new FDKClientValidationError(error));
967
+ }
968
+
969
+ const query_params = {};
970
+ query_params["filter"] = filter;
971
+
972
+ const xHeaders = {};
973
+
974
+ return PlatformAPIClient.execute(
975
+ this.config,
976
+ "get",
977
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/downloads/configuration/`,
978
+ query_params,
979
+ undefined,
980
+ xHeaders
981
+ );
982
+ }
983
+
984
+ /**
985
+ * @param {Object} arg - Arg object.
986
+ * @param {string} [arg.level] - Get category for multiple levels
987
+ * @param {string} [arg.departments] - Get category for multiple departments filtered
988
+ * @param {string} [arg.q] - Get multiple categories filtered by search string
989
+ * @param {number} [arg.pageNo] - The page number to navigate through the
990
+ * given set of results
991
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
992
+ * page. Default is 10.
993
+ * @summary: Get product categories list
994
+ * @description: This API gets meta associated to product categories.
995
+ */
996
+ listCategories({ level, departments, q, pageNo, pageSize } = {}) {
997
+ const { error } = CatalogValidator.listCategories().validate(
998
+ {
999
+ level,
1000
+ departments,
1001
+ q,
1002
+ pageNo,
1003
+ pageSize,
1004
+ },
1005
+ { abortEarly: false, allowUnknown: true }
1006
+ );
1007
+ if (error) {
1008
+ return Promise.reject(new FDKClientValidationError(error));
1009
+ }
1010
+
1011
+ const query_params = {};
1012
+ query_params["level"] = level;
1013
+ query_params["departments"] = departments;
1014
+ query_params["q"] = q;
1015
+ query_params["page_no"] = pageNo;
1016
+ query_params["page_size"] = pageSize;
1017
+
1018
+ const xHeaders = {};
1019
+
1020
+ return PlatformAPIClient.execute(
1021
+ this.config,
1022
+ "get",
1023
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/category/`,
1024
+ query_params,
1025
+ undefined,
1026
+ xHeaders
1027
+ );
1028
+ }
1029
+
1030
+ /**
1031
+ * @param {Object} arg - Arg object.
1032
+ * @param {CategoryRequestBody} arg.body
1033
+ * @summary: Create product categories
1034
+ * @description: This API lets user create product categories
1035
+ */
1036
+ createCategories({ body } = {}) {
1037
+ const { error } = CatalogValidator.createCategories().validate(
1038
+ {
1039
+ body,
1040
+ },
1041
+ { abortEarly: false, allowUnknown: true }
1042
+ );
1043
+ if (error) {
1044
+ return Promise.reject(new FDKClientValidationError(error));
1045
+ }
1046
+
1047
+ const query_params = {};
1048
+
1049
+ const xHeaders = {};
1050
+
1051
+ return PlatformAPIClient.execute(
1052
+ this.config,
1053
+ "post",
1054
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/category/`,
1055
+ query_params,
1056
+ body,
1057
+ xHeaders
1058
+ );
1059
+ }
1060
+
1061
+ /**
1062
+ * @param {Object} arg - Arg object.
1063
+ * @param {string} arg.uid - Category unique id
1064
+ * @summary: Get product category by uid
1065
+ * @description: This API gets meta associated to product categories.
1066
+ */
1067
+ getCategoryData({ uid } = {}) {
1068
+ const { error } = CatalogValidator.getCategoryData().validate(
1069
+ {
1070
+ uid,
1071
+ },
1072
+ { abortEarly: false, allowUnknown: true }
1073
+ );
1074
+ if (error) {
1075
+ return Promise.reject(new FDKClientValidationError(error));
1076
+ }
1077
+
1078
+ const query_params = {};
1079
+
1080
+ const xHeaders = {};
1081
+
1082
+ return PlatformAPIClient.execute(
1083
+ this.config,
1084
+ "get",
1085
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/category/${uid}/`,
1086
+ query_params,
1087
+ undefined,
1088
+ xHeaders
1089
+ );
1090
+ }
1091
+
1092
+ /**
1093
+ * @param {Object} arg - Arg object.
1094
+ * @param {string} arg.uid - Category unique id
1095
+ * @param {CategoryRequestBody} arg.body
1096
+ * @summary: Update product categories
1097
+ * @description: Update a product category using this apu
1098
+ */
1099
+ updateCategory({ uid, body } = {}) {
1100
+ const { error } = CatalogValidator.updateCategory().validate(
1101
+ {
1102
+ uid,
1103
+ body,
1104
+ },
1105
+ { abortEarly: false, allowUnknown: true }
1106
+ );
1107
+ if (error) {
1108
+ return Promise.reject(new FDKClientValidationError(error));
1109
+ }
1110
+
1111
+ const query_params = {};
1112
+
1113
+ const xHeaders = {};
1114
+
1115
+ return PlatformAPIClient.execute(
1116
+ this.config,
1117
+ "put",
1118
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/category/${uid}/`,
1119
+ query_params,
1120
+ body,
1121
+ xHeaders
1122
+ );
1123
+ }
1124
+
1125
+ /**
1126
+ * @param {Object} arg - Arg object.
1127
+ * @param {number[]} [arg.brandIds] - Get multiple products filtered by Brand Ids
1128
+ * @param {number[]} [arg.categoryIds] - Get multiple products filtered by
1129
+ * Category Ids
1130
+ * @param {number[]} [arg.itemIds] - Get multiple products filtered by Item Ids
1131
+ * @param {number[]} [arg.departmentIds] - Get multiple products filtered by
1132
+ * Department Ids
1133
+ * @param {string[]} [arg.itemCode] - Get multiple products filtered by Item Code
1134
+ * @param {string} [arg.q] - Get multiple products filtered by q string
1135
+ * @param {string[]} [arg.tags] - Get multiple products filtered by tags
1136
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1137
+ * given set of results
1138
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1139
+ * page. Default is 10.
1140
+ * @summary: Get product list
1141
+ * @description: This API gets meta associated to products.
1142
+ */
1143
+ getProducts({
1144
+ brandIds,
1145
+ categoryIds,
1146
+ itemIds,
1147
+ departmentIds,
1148
+ itemCode,
1149
+ q,
1150
+ tags,
1151
+ pageNo,
1152
+ pageSize,
1153
+ } = {}) {
1154
+ const { error } = CatalogValidator.getProducts().validate(
1155
+ {
1156
+ brandIds,
1157
+ categoryIds,
1158
+ itemIds,
1159
+ departmentIds,
1160
+ itemCode,
1161
+ q,
1162
+ tags,
1163
+ pageNo,
1164
+ pageSize,
1165
+ },
1166
+ { abortEarly: false, allowUnknown: true }
1167
+ );
1168
+ if (error) {
1169
+ return Promise.reject(new FDKClientValidationError(error));
1170
+ }
1171
+
1172
+ const query_params = {};
1173
+ query_params["brand_ids"] = brandIds;
1174
+ query_params["category_ids"] = categoryIds;
1175
+ query_params["item_ids"] = itemIds;
1176
+ query_params["department_ids"] = departmentIds;
1177
+ query_params["item_code"] = itemCode;
1178
+ query_params["q"] = q;
1179
+ query_params["tags"] = tags;
1180
+ query_params["page_no"] = pageNo;
1181
+ query_params["page_size"] = pageSize;
1182
+
1183
+ const xHeaders = {};
1184
+
1185
+ return PlatformAPIClient.execute(
1186
+ this.config,
1187
+ "get",
1188
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/`,
1189
+ query_params,
1190
+ undefined,
1191
+ xHeaders
1192
+ );
1193
+ }
1194
+
1195
+ /**
1196
+ * @param {Object} arg - Arg object.
1197
+ * @param {ProductCreateUpdate} arg.body
1198
+ * @summary: Create a product.
1199
+ * @description: This API allows to create product.
1200
+ */
1201
+ createProduct({ body } = {}) {
1202
+ const { error } = CatalogValidator.createProduct().validate(
1203
+ {
1204
+ body,
1205
+ },
1206
+ { abortEarly: false, allowUnknown: true }
1207
+ );
1208
+ if (error) {
1209
+ return Promise.reject(new FDKClientValidationError(error));
1210
+ }
1211
+
1212
+ const query_params = {};
1213
+
1214
+ const xHeaders = {};
1215
+
1216
+ return PlatformAPIClient.execute(
1217
+ this.config,
1218
+ "post",
1219
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/`,
1220
+ query_params,
1221
+ body,
1222
+ xHeaders
1223
+ );
1224
+ }
1225
+
1226
+ /**
1227
+ * @param {Object} arg - Arg object.
1228
+ * @param {string} arg.category - It is the name of the l3 cateogry
1229
+ * @param {boolean} [arg.filter] - If true, returns filtered values, else
1230
+ * returns all the attributes
1231
+ * @summary: Get list of all the attributes by their l3_categories
1232
+ * @description: This API allows to list all the attributes by their l3_categories.
1233
+ */
1234
+ getProductAttributes({ category, filter } = {}) {
1235
+ const { error } = CatalogValidator.getProductAttributes().validate(
1236
+ {
1237
+ category,
1238
+ filter,
1239
+ },
1240
+ { abortEarly: false, allowUnknown: true }
1241
+ );
1242
+ if (error) {
1243
+ return Promise.reject(new FDKClientValidationError(error));
1244
+ }
1245
+
1246
+ const query_params = {};
1247
+ query_params["category"] = category;
1248
+ query_params["filter"] = filter;
1249
+
1250
+ const xHeaders = {};
1251
+
1252
+ return PlatformAPIClient.execute(
1253
+ this.config,
1254
+ "get",
1255
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/product-attributes/`,
1256
+ query_params,
1257
+ undefined,
1258
+ xHeaders
1259
+ );
1260
+ }
1261
+
1262
+ /**
1263
+ * @param {Object} arg - Arg object.
1264
+ * @param {string} [arg.itemCode] - Item code of the product.
1265
+ * @param {number} arg.itemId - Item Id of the product.
1266
+ * @param {number} [arg.brandUid] - Brand Id of the product.
1267
+ * @summary: Get a single product.
1268
+ * @description: This API helps to get data associated to a particular product.
1269
+ */
1270
+ getProduct({ itemId, itemCode, brandUid } = {}) {
1271
+ const { error } = CatalogValidator.getProduct().validate(
1272
+ {
1273
+ itemId,
1274
+ itemCode,
1275
+ brandUid,
1276
+ },
1277
+ { abortEarly: false, allowUnknown: true }
1278
+ );
1279
+ if (error) {
1280
+ return Promise.reject(new FDKClientValidationError(error));
1281
+ }
1282
+
1283
+ const query_params = {};
1284
+ query_params["item_code"] = itemCode;
1285
+ query_params["brand_uid"] = brandUid;
1286
+
1287
+ const xHeaders = {};
1288
+
1289
+ return PlatformAPIClient.execute(
1290
+ this.config,
1291
+ "get",
1292
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1293
+ query_params,
1294
+ undefined,
1295
+ xHeaders
1296
+ );
1297
+ }
1298
+
1299
+ /**
1300
+ * @param {Object} arg - Arg object.
1301
+ * @param {number} arg.itemId - Id of the product to be updated.
1302
+ * @param {ProductCreateUpdate} arg.body
1303
+ * @summary: Edit a product.
1304
+ * @description: This API allows to edit product.
1305
+ */
1306
+ editProduct({ itemId, body } = {}) {
1307
+ const { error } = CatalogValidator.editProduct().validate(
1308
+ {
1309
+ itemId,
1310
+ body,
1311
+ },
1312
+ { abortEarly: false, allowUnknown: true }
1313
+ );
1314
+ if (error) {
1315
+ return Promise.reject(new FDKClientValidationError(error));
1316
+ }
1317
+
1318
+ const query_params = {};
1319
+
1320
+ const xHeaders = {};
1321
+
1322
+ return PlatformAPIClient.execute(
1323
+ this.config,
1324
+ "put",
1325
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1326
+ query_params,
1327
+ body,
1328
+ xHeaders
1329
+ );
1330
+ }
1331
+
1332
+ /**
1333
+ * @param {Object} arg - Arg object.
1334
+ * @param {number} arg.itemId - Id of the product to be updated.
1335
+ * @summary: Delete a product.
1336
+ * @description: This API allows to delete product.
1337
+ */
1338
+ deleteProduct({ itemId } = {}) {
1339
+ const { error } = CatalogValidator.deleteProduct().validate(
1340
+ {
1341
+ itemId,
1342
+ },
1343
+ { abortEarly: false, allowUnknown: true }
1344
+ );
1345
+ if (error) {
1346
+ return Promise.reject(new FDKClientValidationError(error));
1347
+ }
1348
+
1349
+ const query_params = {};
1350
+
1351
+ const xHeaders = {};
1352
+
1353
+ return PlatformAPIClient.execute(
1354
+ this.config,
1355
+ "delete",
1356
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/`,
1357
+ query_params,
1358
+ undefined,
1359
+ xHeaders
1360
+ );
1361
+ }
1362
+
1363
+ /**
1364
+ * @param {Object} arg - Arg object.
1365
+ * @summary: Validate product/size data
1366
+ * @description: This API validates product data.
1367
+ */
1368
+ getProductValidation({} = {}) {
1369
+ const { error } = CatalogValidator.getProductValidation().validate(
1370
+ {},
1371
+ { abortEarly: false, allowUnknown: true }
1372
+ );
1373
+ if (error) {
1374
+ return Promise.reject(new FDKClientValidationError(error));
1375
+ }
1376
+
1377
+ const query_params = {};
1378
+
1379
+ const xHeaders = {};
1380
+
1381
+ return PlatformAPIClient.execute(
1382
+ this.config,
1383
+ "get",
1384
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/validation/`,
1385
+ query_params,
1386
+ undefined,
1387
+ xHeaders
1388
+ );
1389
+ }
1390
+
1391
+ /**
1392
+ * @param {Object} arg - Arg object.
1393
+ * @param {string} [arg.itemCode] - Item code of the product size.
1394
+ * @param {number} arg.itemId - Item Id of the product size.
1395
+ * @param {number} [arg.brandUid] - Brand Id of the product size.
1396
+ * @param {number} [arg.uid] - Id of the product size.
1397
+ * @summary: Get a single product size.
1398
+ * @description: This API helps to get data associated to a particular product size.
1399
+ */
1400
+ getProductSize({ itemId, itemCode, brandUid, uid } = {}) {
1401
+ const { error } = CatalogValidator.getProductSize().validate(
1402
+ {
1403
+ itemId,
1404
+ itemCode,
1405
+ brandUid,
1406
+ uid,
1407
+ },
1408
+ { abortEarly: false, allowUnknown: true }
1409
+ );
1410
+ if (error) {
1411
+ return Promise.reject(new FDKClientValidationError(error));
1412
+ }
1413
+
1414
+ const query_params = {};
1415
+ query_params["item_code"] = itemCode;
1416
+ query_params["brand_uid"] = brandUid;
1417
+ query_params["uid"] = uid;
1418
+
1419
+ const xHeaders = {};
1420
+
1421
+ return PlatformAPIClient.execute(
1422
+ this.config,
1423
+ "get",
1424
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/`,
1425
+ query_params,
1426
+ undefined,
1427
+ xHeaders
1428
+ );
1429
+ }
1430
+
1431
+ /**
1432
+ * @param {Object} arg - Arg object.
1433
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1434
+ * given set of results
1435
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1436
+ * page. Default is 12.
1437
+ * @summary: Get a list of all bulk product upload jobs.
1438
+ * @description: This API helps to get bulk product upload jobs data.
1439
+ */
1440
+ getProductBulkUploadHistory({ pageNo, pageSize } = {}) {
1441
+ const { error } = CatalogValidator.getProductBulkUploadHistory().validate(
1442
+ {
1443
+ pageNo,
1444
+ pageSize,
1445
+ },
1446
+ { abortEarly: false, allowUnknown: true }
1447
+ );
1448
+ if (error) {
1449
+ return Promise.reject(new FDKClientValidationError(error));
1450
+ }
1451
+
1452
+ const query_params = {};
1453
+ query_params["page_no"] = pageNo;
1454
+ query_params["page_size"] = pageSize;
1455
+
1456
+ const xHeaders = {};
1457
+
1458
+ return PlatformAPIClient.execute(
1459
+ this.config,
1460
+ "get",
1461
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk`,
1462
+ query_params,
1463
+ undefined,
1464
+ xHeaders
1465
+ );
1466
+ }
1467
+
1468
+ /**
1469
+ * @param {Object} arg - Arg object.
1470
+ * @param {BulkJob} arg.body
1471
+ * @summary: Create a Bulk product to upload job.
1472
+ * @description: This API helps to create a bulk products upload job.
1473
+ */
1474
+ createBulkProductUploadJob({ body } = {}) {
1475
+ const { error } = CatalogValidator.createBulkProductUploadJob().validate(
1476
+ {
1477
+ body,
1478
+ },
1479
+ { abortEarly: false, allowUnknown: true }
1480
+ );
1481
+ if (error) {
1482
+ return Promise.reject(new FDKClientValidationError(error));
1483
+ }
1484
+
1485
+ const query_params = {};
1486
+
1487
+ const xHeaders = {};
1488
+
1489
+ return PlatformAPIClient.execute(
1490
+ this.config,
1491
+ "post",
1492
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk`,
1493
+ query_params,
1494
+ body,
1495
+ xHeaders
1496
+ );
1497
+ }
1498
+
1499
+ /**
1500
+ * @param {Object} arg - Arg object.
1501
+ * @param {number} arg.batchId - Batch Id of the bulk product job to be deleted.
1502
+ * @summary: Delete Bulk product job.
1503
+ * @description: This API allows to delete bulk product job associated with company.
1504
+ */
1505
+ deleteProductBulkJob({ batchId } = {}) {
1506
+ const { error } = CatalogValidator.deleteProductBulkJob().validate(
1507
+ {
1508
+ batchId,
1509
+ },
1510
+ { abortEarly: false, allowUnknown: true }
1511
+ );
1512
+ if (error) {
1513
+ return Promise.reject(new FDKClientValidationError(error));
1514
+ }
1515
+
1516
+ const query_params = {};
1517
+
1518
+ const xHeaders = {};
1519
+
1520
+ return PlatformAPIClient.execute(
1521
+ this.config,
1522
+ "delete",
1523
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk/${batchId}`,
1524
+ query_params,
1525
+ undefined,
1526
+ xHeaders
1527
+ );
1528
+ }
1529
+
1530
+ /**
1531
+ * @param {Object} arg - Arg object.
1532
+ * @param {string} arg.batchId - Batch Id in which assets to be uploaded.
1533
+ * @param {BulkProductRequest} arg.body
1534
+ * @summary: Create products in bulk associated with given batch Id.
1535
+ * @description: This API helps to create products in bulk push to kafka for approval/creation.
1536
+ */
1537
+ createProductsInBulk({ batchId, body } = {}) {
1538
+ const { error } = CatalogValidator.createProductsInBulk().validate(
1539
+ {
1540
+ batchId,
1541
+ body,
1542
+ },
1543
+ { abortEarly: false, allowUnknown: true }
1544
+ );
1545
+ if (error) {
1546
+ return Promise.reject(new FDKClientValidationError(error));
1547
+ }
1548
+
1549
+ const query_params = {};
1550
+
1551
+ const xHeaders = {};
1552
+
1553
+ return PlatformAPIClient.execute(
1554
+ this.config,
1555
+ "post",
1556
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/bulk/${batchId}`,
1557
+ query_params,
1558
+ body,
1559
+ xHeaders
1560
+ );
1561
+ }
1562
+
1563
+ /**
1564
+ * @param {Object} arg - Arg object.
1565
+ * @summary: Get a list of all tags associated with company.
1566
+ * @description: This API helps to get tags data associated to a particular company.
1567
+ */
1568
+ getProductTags({} = {}) {
1569
+ const { error } = CatalogValidator.getProductTags().validate(
1570
+ {},
1571
+ { abortEarly: false, allowUnknown: true }
1572
+ );
1573
+ if (error) {
1574
+ return Promise.reject(new FDKClientValidationError(error));
1575
+ }
1576
+
1577
+ const query_params = {};
1578
+
1579
+ const xHeaders = {};
1580
+
1581
+ return PlatformAPIClient.execute(
1582
+ this.config,
1583
+ "get",
1584
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/tags`,
1585
+ query_params,
1586
+ undefined,
1587
+ xHeaders
1588
+ );
1589
+ }
1590
+
1591
+ /**
1592
+ * @param {Object} arg - Arg object.
1593
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1594
+ * given set of results
1595
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1596
+ * page. Default is 12.
1597
+ * @summary: Get a list of all bulk asset jobs.
1598
+ * @description: This API helps to get bulk asset jobs data associated to a particular company.
1599
+ */
1600
+ getProductAssetsInBulk({ pageNo, pageSize } = {}) {
1601
+ const { error } = CatalogValidator.getProductAssetsInBulk().validate(
1602
+ {
1603
+ pageNo,
1604
+ pageSize,
1605
+ },
1606
+ { abortEarly: false, allowUnknown: true }
1607
+ );
1608
+ if (error) {
1609
+ return Promise.reject(new FDKClientValidationError(error));
1610
+ }
1611
+
1612
+ const query_params = {};
1613
+ query_params["page_no"] = pageNo;
1614
+ query_params["page_size"] = pageSize;
1615
+
1616
+ const xHeaders = {};
1617
+
1618
+ return PlatformAPIClient.execute(
1619
+ this.config,
1620
+ "get",
1621
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/assets/bulk/`,
1622
+ query_params,
1623
+ undefined,
1624
+ xHeaders
1625
+ );
1626
+ }
1627
+
1628
+ /**
1629
+ * @param {Object} arg - Arg object.
1630
+ * @param {ProductBulkAssets} arg.body
1631
+ * @summary: Create a Bulk asset upload Job.
1632
+ * @description: This API helps to create a bulk asset upload job.
1633
+ */
1634
+ createProductAssetsInBulk({ body } = {}) {
1635
+ const { error } = CatalogValidator.createProductAssetsInBulk().validate(
1636
+ {
1637
+ body,
1638
+ },
1639
+ { abortEarly: false, allowUnknown: true }
1640
+ );
1641
+ if (error) {
1642
+ return Promise.reject(new FDKClientValidationError(error));
1643
+ }
1644
+
1645
+ const query_params = {};
1646
+
1647
+ const xHeaders = {};
1648
+
1649
+ return PlatformAPIClient.execute(
1650
+ this.config,
1651
+ "post",
1652
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/assets/bulk/`,
1653
+ query_params,
1654
+ body,
1655
+ xHeaders
1656
+ );
1657
+ }
1658
+
1659
+ /**
1660
+ * @param {Object} arg - Arg object.
1661
+ * @param {number} arg.itemId - Item Id of the product associated with size
1662
+ * to be deleted.
1663
+ * @param {number} arg.size - Size to be deleted.
1664
+ * @summary: Delete a Size associated with product.
1665
+ * @description: This API allows to delete size associated with product.
1666
+ */
1667
+ deleteSize({ itemId, size } = {}) {
1668
+ const { error } = CatalogValidator.deleteSize().validate(
1669
+ {
1670
+ itemId,
1671
+ size,
1672
+ },
1673
+ { abortEarly: false, allowUnknown: true }
1674
+ );
1675
+ if (error) {
1676
+ return Promise.reject(new FDKClientValidationError(error));
1677
+ }
1678
+
1679
+ const query_params = {};
1680
+
1681
+ const xHeaders = {};
1682
+
1683
+ return PlatformAPIClient.execute(
1684
+ this.config,
1685
+ "delete",
1686
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}`,
1687
+ query_params,
1688
+ undefined,
1689
+ xHeaders
1690
+ );
1691
+ }
1692
+
1693
+ /**
1694
+ * @param {Object} arg - Arg object.
1695
+ * @param {string} arg.itemId - Item code of the product of which size is to be get.
1696
+ * @param {string} arg.size - Size of which inventory is to get.
1697
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1698
+ * given set of results
1699
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1700
+ * page. Default is 12.
1701
+ * @param {string} [arg.q] - Search with help of store code.
1702
+ * @param {boolean} [arg.sellable] - Filter on whether product is in stock or not.
1703
+ * @summary: Get Inventory for company
1704
+ * @description: This API allows get Inventory data for particular company grouped by size and store.
1705
+ */
1706
+ getInventoryBySize({ itemId, size, pageNo, pageSize, q, sellable } = {}) {
1707
+ const { error } = CatalogValidator.getInventoryBySize().validate(
1708
+ {
1709
+ itemId,
1710
+ size,
1711
+ pageNo,
1712
+ pageSize,
1713
+ q,
1714
+ sellable,
1715
+ },
1716
+ { abortEarly: false, allowUnknown: true }
1717
+ );
1718
+ if (error) {
1719
+ return Promise.reject(new FDKClientValidationError(error));
1720
+ }
1721
+
1722
+ const query_params = {};
1723
+ query_params["page_no"] = pageNo;
1724
+ query_params["page_size"] = pageSize;
1725
+ query_params["q"] = q;
1726
+ query_params["sellable"] = sellable;
1727
+
1728
+ const xHeaders = {};
1729
+
1730
+ return PlatformAPIClient.execute(
1731
+ this.config,
1732
+ "get",
1733
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}`,
1734
+ query_params,
1735
+ undefined,
1736
+ xHeaders
1737
+ );
1738
+ }
1739
+
1740
+ /**
1741
+ * @param {Object} arg - Arg object.
1742
+ * @param {number} arg.itemId - Item code of the product of which size is to be get.
1743
+ * @param {string} arg.size - Size in which inventory is to be added.
1744
+ * @param {InventoryRequest} arg.body
1745
+ * @summary: Add Inventory for particular size and store.
1746
+ * @description: This API allows add Inventory for particular size and store.
1747
+ */
1748
+ addInventory({ itemId, size, body } = {}) {
1749
+ const { error } = CatalogValidator.addInventory().validate(
1750
+ {
1751
+ itemId,
1752
+ size,
1753
+ body,
1754
+ },
1755
+ { abortEarly: false, allowUnknown: true }
1756
+ );
1757
+ if (error) {
1758
+ return Promise.reject(new FDKClientValidationError(error));
1759
+ }
1760
+
1761
+ const query_params = {};
1762
+
1763
+ const xHeaders = {};
1764
+
1765
+ return PlatformAPIClient.execute(
1766
+ this.config,
1767
+ "post",
1768
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}`,
1769
+ query_params,
1770
+ body,
1771
+ xHeaders
1772
+ );
1773
+ }
1774
+
1775
+ /**
1776
+ * @param {Object} arg - Arg object.
1777
+ * @param {string} arg.itemId - Item code of the product of which size is to be get.
1778
+ * @param {string} arg.sizeIdentifier - Size Identifier (Seller Identifier
1779
+ * or Primary Identifier) of which inventory is to get.
1780
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1781
+ * given set of results
1782
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1783
+ * page. Default is 12.
1784
+ * @param {string} [arg.q] - Search with help of store code.
1785
+ * @param {number[]} [arg.locationIds] - Search by store ids.
1786
+ * @summary: Get Inventory for company
1787
+ * @description: This API allows get Inventory data for particular company grouped by size and store.
1788
+ */
1789
+ getInventoryBySizeIdentifier({
1790
+ itemId,
1791
+ sizeIdentifier,
1792
+ pageNo,
1793
+ pageSize,
1794
+ q,
1795
+ locationIds,
1796
+ } = {}) {
1797
+ const { error } = CatalogValidator.getInventoryBySizeIdentifier().validate(
1798
+ {
1799
+ itemId,
1800
+ sizeIdentifier,
1801
+ pageNo,
1802
+ pageSize,
1803
+ q,
1804
+ locationIds,
1805
+ },
1806
+ { abortEarly: false, allowUnknown: true }
1807
+ );
1808
+ if (error) {
1809
+ return Promise.reject(new FDKClientValidationError(error));
1810
+ }
1811
+
1812
+ const query_params = {};
1813
+ query_params["page_no"] = pageNo;
1814
+ query_params["page_size"] = pageSize;
1815
+ query_params["q"] = q;
1816
+ query_params["location_ids"] = locationIds;
1817
+
1818
+ const xHeaders = {};
1819
+
1820
+ return PlatformAPIClient.execute(
1821
+ this.config,
1822
+ "get",
1823
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/inventory/${sizeIdentifier}`,
1824
+ query_params,
1825
+ undefined,
1826
+ xHeaders
1827
+ );
1828
+ }
1829
+
1830
+ /**
1831
+ * @param {Object} arg - Arg object.
1832
+ * @param {string} arg.size - Size that is to be deleted.
1833
+ * @param {number} arg.itemId - Id of the product associated with Inventory
1834
+ * to be deleted.
1835
+ * @param {number} arg.locationId - Location ID of store of which inventory
1836
+ * is to be deleted.
1837
+ * @summary: Delete a Inventory.
1838
+ * @description: This API allows to delete inventory of a particular product for particular company.
1839
+ */
1840
+ deleteInventory({ size, itemId, locationId } = {}) {
1841
+ const { error } = CatalogValidator.deleteInventory().validate(
1842
+ {
1843
+ size,
1844
+ itemId,
1845
+ locationId,
1846
+ },
1847
+ { abortEarly: false, allowUnknown: true }
1848
+ );
1849
+ if (error) {
1850
+ return Promise.reject(new FDKClientValidationError(error));
1851
+ }
1852
+
1853
+ const query_params = {};
1854
+
1855
+ const xHeaders = {};
1856
+
1857
+ return PlatformAPIClient.execute(
1858
+ this.config,
1859
+ "delete",
1860
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/products/${itemId}/sizes/${size}/location/${locationId}/`,
1861
+ query_params,
1862
+ undefined,
1863
+ xHeaders
1864
+ );
1865
+ }
1866
+
1867
+ /**
1868
+ * @param {Object} arg - Arg object.
1869
+ * @param {number} [arg.pageNo] - The page number to navigate through the
1870
+ * given set of results
1871
+ * @param {number} [arg.pageSize] - Number of items to retrieve in each
1872
+ * page. Default is 12.
1873
+ * @summary: Get a list of all bulk Inventory upload jobs.
1874
+ * @description: This API helps to get bulk Inventory upload jobs data.
1875
+ */
1876
+ getInventoryBulkUploadHistory({ pageNo, pageSize } = {}) {
1877
+ const { error } = CatalogValidator.getInventoryBulkUploadHistory().validate(
1878
+ {
1879
+ pageNo,
1880
+ pageSize,
1881
+ },
1882
+ { abortEarly: false, allowUnknown: true }
1883
+ );
1884
+ if (error) {
1885
+ return Promise.reject(new FDKClientValidationError(error));
1886
+ }
1887
+
1888
+ const query_params = {};
1889
+ query_params["page_no"] = pageNo;
1890
+ query_params["page_size"] = pageSize;
1891
+
1892
+ const xHeaders = {};
1893
+
1894
+ return PlatformAPIClient.execute(
1895
+ this.config,
1896
+ "get",
1897
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/`,
1898
+ query_params,
1899
+ undefined,
1900
+ xHeaders
1901
+ );
1902
+ }
1903
+
1904
+ /**
1905
+ * @param {Object} arg - Arg object.
1906
+ * @param {BulkJob} arg.body
1907
+ * @summary: Create a Bulk Inventory upload Job.
1908
+ * @description: This API helps to create a bulk Inventory upload job.
1909
+ */
1910
+ createBulkInventoryJob({ body } = {}) {
1911
+ const { error } = CatalogValidator.createBulkInventoryJob().validate(
1912
+ {
1913
+ body,
1914
+ },
1915
+ { abortEarly: false, allowUnknown: true }
1916
+ );
1917
+ if (error) {
1918
+ return Promise.reject(new FDKClientValidationError(error));
1919
+ }
1920
+
1921
+ const query_params = {};
1922
+
1923
+ const xHeaders = {};
1924
+
1925
+ return PlatformAPIClient.execute(
1926
+ this.config,
1927
+ "post",
1928
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/`,
1929
+ query_params,
1930
+ body,
1931
+ xHeaders
1932
+ );
1933
+ }
1934
+
1935
+ /**
1936
+ * @param {Object} arg - Arg object.
1937
+ * @param {string} arg.batchId - Batch Id of the bulk delete job.
1938
+ * @summary: Delete Bulk Inventory job.
1939
+ * @description: This API allows to delete bulk Inventory job associated with company.
1940
+ */
1941
+ deleteBulkInventoryJob({ batchId } = {}) {
1942
+ const { error } = CatalogValidator.deleteBulkInventoryJob().validate(
1943
+ {
1944
+ batchId,
1945
+ },
1946
+ { abortEarly: false, allowUnknown: true }
1947
+ );
1948
+ if (error) {
1949
+ return Promise.reject(new FDKClientValidationError(error));
1950
+ }
1951
+
1952
+ const query_params = {};
1953
+
1954
+ const xHeaders = {};
1955
+
1956
+ return PlatformAPIClient.execute(
1957
+ this.config,
1958
+ "delete",
1959
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/${batchId}/`,
1960
+ query_params,
1961
+ undefined,
1962
+ xHeaders
1963
+ );
1964
+ }
1965
+
1966
+ /**
1967
+ * @param {Object} arg - Arg object.
1968
+ * @param {string} arg.batchId - Batch Id of the bulk create job.
1969
+ * @param {InventoryBulkRequest} arg.body
1970
+ * @summary: Create products in bulk associated with given batch Id.
1971
+ * @description: This API helps to create products in bulk push to kafka for approval/creation.
1972
+ */
1973
+ createBulkInventory({ batchId, body } = {}) {
1974
+ const { error } = CatalogValidator.createBulkInventory().validate(
1975
+ {
1976
+ batchId,
1977
+ body,
1978
+ },
1979
+ { abortEarly: false, allowUnknown: true }
1980
+ );
1981
+ if (error) {
1982
+ return Promise.reject(new FDKClientValidationError(error));
1983
+ }
1984
+
1985
+ const query_params = {};
1986
+
1987
+ const xHeaders = {};
1988
+
1989
+ return PlatformAPIClient.execute(
1990
+ this.config,
1991
+ "post",
1992
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/bulk/${batchId}/`,
1993
+ query_params,
1994
+ body,
1995
+ xHeaders
1996
+ );
1997
+ }
1998
+
1999
+ /**
2000
+ * @param {Object} arg - Arg object.
2001
+ * @summary: Get Inventory export history.
2002
+ * @description: This API helps to get Inventory export history.
2003
+ */
2004
+ getInventoryExport({} = {}) {
2005
+ const { error } = CatalogValidator.getInventoryExport().validate(
2006
+ {},
2007
+ { abortEarly: false, allowUnknown: true }
2008
+ );
2009
+ if (error) {
2010
+ return Promise.reject(new FDKClientValidationError(error));
2011
+ }
2012
+
2013
+ const query_params = {};
2014
+
2015
+ const xHeaders = {};
2016
+
2017
+ return PlatformAPIClient.execute(
2018
+ this.config,
2019
+ "get",
2020
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/`,
2021
+ query_params,
2022
+ undefined,
2023
+ xHeaders
2024
+ );
2025
+ }
2026
+
2027
+ /**
2028
+ * @param {Object} arg - Arg object.
2029
+ * @param {InventoryExportRequest} arg.body
2030
+ * @summary: Create a Inventory export Job.
2031
+ * @description: This API helps to create a Inventory export job.
2032
+ */
2033
+ createInventoryExportJob({ body } = {}) {
2034
+ const { error } = CatalogValidator.createInventoryExportJob().validate(
2035
+ {
2036
+ body,
2037
+ },
2038
+ { abortEarly: false, allowUnknown: true }
2039
+ );
2040
+ if (error) {
2041
+ return Promise.reject(new FDKClientValidationError(error));
2042
+ }
2043
+
2044
+ const query_params = {};
2045
+
2046
+ const xHeaders = {};
2047
+
2048
+ return PlatformAPIClient.execute(
2049
+ this.config,
2050
+ "post",
2051
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/`,
2052
+ query_params,
2053
+ body,
2054
+ xHeaders
2055
+ );
2056
+ }
2057
+
2058
+ /**
2059
+ * @param {Object} arg - Arg object.
2060
+ * @param {string} [arg.filterType] - Filter type from any one of ['brand',
2061
+ * 'store', 'type']
2062
+ * @summary: Get List of different filters for inventory export
2063
+ * @description: This API allows get List of different filters like brand, store, and type for inventory export.
2064
+ */
2065
+ exportInventoryConfig({ filterType } = {}) {
2066
+ const { error } = CatalogValidator.exportInventoryConfig().validate(
2067
+ {
2068
+ filterType,
2069
+ },
2070
+ { abortEarly: false, allowUnknown: true }
2071
+ );
2072
+ if (error) {
2073
+ return Promise.reject(new FDKClientValidationError(error));
2074
+ }
2075
+
2076
+ const query_params = {};
2077
+ query_params["filter_type"] = filterType;
2078
+
2079
+ const xHeaders = {};
2080
+
2081
+ return PlatformAPIClient.execute(
2082
+ this.config,
2083
+ "get",
2084
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/inventory/download/configuration/`,
2085
+ query_params,
2086
+ undefined,
2087
+ xHeaders
2088
+ );
2089
+ }
2090
+
2091
+ /**
2092
+ * @param {Object} arg - Arg object.
2093
+ * @param {number} arg.itemId - Item code of the product of which size is to be get.
2094
+ * @param {string} arg.sellerIdentifier - Size Identifier (Seller Identifier
2095
+ * or Primary Identifier) of which inventory is to get.
2096
+ * @param {InventoryRequestSchemaV2} arg.body
2097
+ * @summary: Add Inventory for particular size and store.
2098
+ * @description: This API allows add Inventory for particular size and store.
2099
+ */
2100
+ deleteRealtimeInventory({ itemId, sellerIdentifier, body } = {}) {
2101
+ const { error } = CatalogValidator.deleteRealtimeInventory().validate(
2102
+ {
2103
+ itemId,
2104
+ sellerIdentifier,
2105
+ body,
2106
+ },
2107
+ { abortEarly: false, allowUnknown: true }
2108
+ );
2109
+ if (error) {
2110
+ return Promise.reject(new FDKClientValidationError(error));
2111
+ }
2112
+
2113
+ const query_params = {};
2114
+
2115
+ const xHeaders = {};
2116
+
2117
+ return PlatformAPIClient.execute(
2118
+ this.config,
2119
+ "delete",
2120
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/inventory/${sellerIdentifier}/`,
2121
+ query_params,
2122
+ body,
2123
+ xHeaders
2124
+ );
2125
+ }
2126
+
2127
+ /**
2128
+ * @param {Object} arg - Arg object.
2129
+ * @param {number} arg.itemId - Item code of the product of which size is to be get.
2130
+ * @param {string} arg.sellerIdentifier - Size Identifier (Seller Identifier
2131
+ * or Primary Identifier) of which inventory is to get.
2132
+ * @param {InventoryRequestSchemaV2} arg.body
2133
+ * @summary: Add Inventory for particular size and store.
2134
+ * @description: This API allows add Inventory for particular size and store.
2135
+ */
2136
+ updateRealtimeInventory({ itemId, sellerIdentifier, body } = {}) {
2137
+ const { error } = CatalogValidator.updateRealtimeInventory().validate(
2138
+ {
2139
+ itemId,
2140
+ sellerIdentifier,
2141
+ body,
2142
+ },
2143
+ { abortEarly: false, allowUnknown: true }
2144
+ );
2145
+ if (error) {
2146
+ return Promise.reject(new FDKClientValidationError(error));
2147
+ }
2148
+
2149
+ const query_params = {};
2150
+
2151
+ const xHeaders = {};
2152
+
2153
+ return PlatformAPIClient.execute(
2154
+ this.config,
2155
+ "post",
2156
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/products/${itemId}/inventory/${sellerIdentifier}/`,
2157
+ query_params,
2158
+ body,
2159
+ xHeaders
2160
+ );
2161
+ }
2162
+
2163
+ /**
2164
+ * @param {Object} arg - Arg object.
2165
+ * @param {InventoryRequestSchemaV2} arg.body
2166
+ * @summary: Add Inventory for particular size and store.
2167
+ * @description: This API allows add Inventory for particular size and store.
2168
+ */
2169
+ updateInventories({ body } = {}) {
2170
+ const { error } = CatalogValidator.updateInventories().validate(
2171
+ {
2172
+ body,
2173
+ },
2174
+ { abortEarly: false, allowUnknown: true }
2175
+ );
2176
+ if (error) {
2177
+ return Promise.reject(new FDKClientValidationError(error));
2178
+ }
2179
+
2180
+ const query_params = {};
2181
+
2182
+ const xHeaders = {};
2183
+
2184
+ return PlatformAPIClient.execute(
2185
+ this.config,
2186
+ "post",
2187
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/inventory/`,
2188
+ query_params,
2189
+ body,
2190
+ xHeaders
2191
+ );
2192
+ }
2193
+
2194
+ /**
2195
+ * @param {Object} arg - Arg object.
2196
+ * @param {number} [arg.pageNo] - Page no
2197
+ * @param {number} [arg.pageSize] - Page size
2198
+ * @param {string} [arg.q] - Search using hsn code.
2199
+ * @summary: Hsn Code List.
2200
+ * @description: Hsn Code List.
2201
+ */
2202
+ getAllHsnCodes({ pageNo, pageSize, q } = {}) {
2203
+ const { error } = CatalogValidator.getAllHsnCodes().validate(
2204
+ {
2205
+ pageNo,
2206
+ pageSize,
2207
+ q,
2208
+ },
2209
+ { abortEarly: false, allowUnknown: true }
2210
+ );
2211
+ if (error) {
2212
+ return Promise.reject(new FDKClientValidationError(error));
2213
+ }
2214
+
2215
+ const query_params = {};
2216
+ query_params["page_no"] = pageNo;
2217
+ query_params["page_size"] = pageSize;
2218
+ query_params["q"] = q;
2219
+
2220
+ const xHeaders = {};
2221
+
2222
+ return PlatformAPIClient.execute(
2223
+ this.config,
2224
+ "get",
2225
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/`,
2226
+ query_params,
2227
+ undefined,
2228
+ xHeaders
2229
+ );
2230
+ }
2231
+
2232
+ /**
2233
+ * @param {Object} arg - Arg object.
2234
+ * @param {HsnUpsert} arg.body
2235
+ * @summary: Create Hsn Code.
2236
+ * @description: Create Hsn Code.
2237
+ */
2238
+ createHsnCode({ body } = {}) {
2239
+ const { error } = CatalogValidator.createHsnCode().validate(
2240
+ {
2241
+ body,
2242
+ },
2243
+ { abortEarly: false, allowUnknown: true }
2244
+ );
2245
+ if (error) {
2246
+ return Promise.reject(new FDKClientValidationError(error));
2247
+ }
2248
+
2249
+ const query_params = {};
2250
+
2251
+ const xHeaders = {};
2252
+
2253
+ return PlatformAPIClient.execute(
2254
+ this.config,
2255
+ "post",
2256
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/`,
2257
+ query_params,
2258
+ body,
2259
+ xHeaders
2260
+ );
2261
+ }
2262
+
2263
+ /**
2264
+ * @param {Object} arg - Arg object.
2265
+ * @param {string} arg.id - Unique id
2266
+ * @summary: Fetch Hsn Code.
2267
+ * @description: Fetch Hsn Code.
2268
+ */
2269
+ getHsnCode({ id } = {}) {
2270
+ const { error } = CatalogValidator.getHsnCode().validate(
2271
+ {
2272
+ id,
2273
+ },
2274
+ { abortEarly: false, allowUnknown: true }
2275
+ );
2276
+ if (error) {
2277
+ return Promise.reject(new FDKClientValidationError(error));
2278
+ }
2279
+
2280
+ const query_params = {};
2281
+
2282
+ const xHeaders = {};
2283
+
2284
+ return PlatformAPIClient.execute(
2285
+ this.config,
2286
+ "get",
2287
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/${id}/`,
2288
+ query_params,
2289
+ undefined,
2290
+ xHeaders
2291
+ );
2292
+ }
2293
+
2294
+ /**
2295
+ * @param {Object} arg - Arg object.
2296
+ * @param {string} arg.id - Unique id
2297
+ * @param {HsnUpsert} arg.body
2298
+ * @summary: Update Hsn Code.
2299
+ * @description: Update Hsn Code.
2300
+ */
2301
+ updateHsnCode({ id, body } = {}) {
2302
+ const { error } = CatalogValidator.updateHsnCode().validate(
2303
+ {
2304
+ id,
2305
+ body,
2306
+ },
2307
+ { abortEarly: false, allowUnknown: true }
2308
+ );
2309
+ if (error) {
2310
+ return Promise.reject(new FDKClientValidationError(error));
2311
+ }
2312
+
2313
+ const query_params = {};
2314
+
2315
+ const xHeaders = {};
2316
+
2317
+ return PlatformAPIClient.execute(
2318
+ this.config,
2319
+ "put",
2320
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/${id}/`,
2321
+ query_params,
2322
+ body,
2323
+ xHeaders
2324
+ );
2325
+ }
2326
+
2327
+ /**
2328
+ * @param {Object} arg - Arg object.
2329
+ * @param {BulkHsnUpsert} arg.body
2330
+ * @summary: Bulk Create or Update Hsn Code.
2331
+ * @description: Bulk Create or Update Hsn Code.
2332
+ */
2333
+ bulkHsnCode({ body } = {}) {
2334
+ const { error } = CatalogValidator.bulkHsnCode().validate(
2335
+ {
2336
+ body,
2337
+ },
2338
+ { abortEarly: false, allowUnknown: true }
2339
+ );
2340
+ if (error) {
2341
+ return Promise.reject(new FDKClientValidationError(error));
2342
+ }
2343
+
2344
+ const query_params = {};
2345
+
2346
+ const xHeaders = {};
2347
+
2348
+ return PlatformAPIClient.execute(
2349
+ this.config,
2350
+ "post",
2351
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/hsn/bulk/`,
2352
+ query_params,
2353
+ body,
2354
+ xHeaders
2355
+ );
2356
+ }
2357
+
2358
+ /**
2359
+ * @param {Object} arg - Arg object.
2360
+ * @param {number} [arg.pageNo] - Page no
2361
+ * @param {number} [arg.pageSize] - Page size
2362
+ * @param {string} [arg.q] - Search using hsn code, description, reporting_hsn
2363
+ * @param {string} [arg.type] - Search using type
2364
+ * @summary: Hsn Code List.
2365
+ * @description: Hsn Code List.
2366
+ */
2367
+ getAllProductHsnCodes({ pageNo, pageSize, q, type } = {}) {
2368
+ const { error } = CatalogValidator.getAllProductHsnCodes().validate(
2369
+ {
2370
+ pageNo,
2371
+ pageSize,
2372
+ q,
2373
+ type,
2374
+ },
2375
+ { abortEarly: false, allowUnknown: true }
2376
+ );
2377
+ if (error) {
2378
+ return Promise.reject(new FDKClientValidationError(error));
2379
+ }
2380
+
2381
+ const query_params = {};
2382
+ query_params["page_no"] = pageNo;
2383
+ query_params["page_size"] = pageSize;
2384
+ query_params["q"] = q;
2385
+ query_params["type"] = type;
2386
+
2387
+ const xHeaders = {};
2388
+
2389
+ return PlatformAPIClient.execute(
2390
+ this.config,
2391
+ "get",
2392
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/hsn/`,
2393
+ query_params,
2394
+ undefined,
2395
+ xHeaders
2396
+ );
2397
+ }
2398
+
2399
+ /**
2400
+ * @param {Object} arg - Arg object.
2401
+ * @param {string} arg.reportingHsn - Reporting_hsn
2402
+ * @summary: Hsn Code List.
2403
+ * @description: Hsn Code List.
2404
+ */
2405
+ getSingleProductHSNCode({ reportingHsn } = {}) {
2406
+ const { error } = CatalogValidator.getSingleProductHSNCode().validate(
2407
+ {
2408
+ reportingHsn,
2409
+ },
2410
+ { abortEarly: false, allowUnknown: true }
2411
+ );
2412
+ if (error) {
2413
+ return Promise.reject(new FDKClientValidationError(error));
2414
+ }
2415
+
2416
+ const query_params = {};
2417
+
2418
+ const xHeaders = {};
2419
+
2420
+ return PlatformAPIClient.execute(
2421
+ this.config,
2422
+ "get",
2423
+ `/service/platform/catalog/v2.0/company/${this.config.companyId}/hsn/${reportingHsn}`,
2424
+ query_params,
2425
+ undefined,
2426
+ xHeaders
2427
+ );
2428
+ }
2429
+
2430
+ /**
2431
+ * @param {Object} arg - Arg object.
2432
+ * @param {AssignStore} arg.body
2433
+ * @summary: Location Reassignment
2434
+ * @description:
2435
+ */
2436
+ getOptimalLocations({ body } = {}) {
2437
+ const { error } = CatalogValidator.getOptimalLocations().validate(
2438
+ {
2439
+ body,
2440
+ },
2441
+ { abortEarly: false, allowUnknown: true }
2442
+ );
2443
+ if (error) {
2444
+ return Promise.reject(new FDKClientValidationError(error));
2445
+ }
2446
+
2447
+ const query_params = {};
2448
+
2449
+ const xHeaders = {};
2450
+
2451
+ return PlatformAPIClient.execute(
2452
+ this.config,
2453
+ "post",
2454
+ `/service/platform/catalog/v1.0/company/${this.config.companyId}/location/reassign/`,
2455
+ query_params,
2456
+ body,
2457
+ xHeaders
2458
+ );
2459
+ }
2460
+ }
2461
+
2462
+ module.exports = Catalog;