@gofynd/fdk-client-javascript 1.0.4 → 1.1.1

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 (121) hide show
  1. package/README.md +19 -0
  2. package/index.d.ts +4 -1
  3. package/index.js +19 -3
  4. package/package.json +13 -4
  5. package/partner.d.ts +4 -0
  6. package/partner.js +7 -0
  7. package/sdk/application/ApplicationAPIClient.js +2 -4
  8. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +6 -1
  9. package/sdk/application/Catalog/CatalogApplicationClient.js +11 -2
  10. package/sdk/application/Catalog/CatalogApplicationModel.js +4 -2
  11. package/sdk/application/Catalog/CatalogApplicationValidator.js +2 -0
  12. package/sdk/application/Content/ContentApplicationModel.js +0 -5
  13. package/sdk/application/Lead/LeadApplicationModel.js +1 -0
  14. package/sdk/application/Order/OrderApplicationClient.d.ts +0 -15
  15. package/sdk/application/Order/OrderApplicationClient.js +0 -68
  16. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -17
  17. package/sdk/application/Order/OrderApplicationModel.js +0 -111
  18. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -1
  19. package/sdk/application/Order/OrderApplicationValidator.js +0 -7
  20. package/sdk/common/AxiosHelper.js +1 -1
  21. package/sdk/common/BaseOAuthClient.d.ts +17 -0
  22. package/sdk/common/BaseOAuthClient.js +67 -0
  23. package/sdk/common/Constant.d.ts +0 -18
  24. package/sdk/common/Constant.js +0 -22
  25. package/sdk/common/RequestSigner.js +0 -5
  26. package/sdk/partner/OAuthClient.d.ts +14 -0
  27. package/sdk/partner/OAuthClient.js +112 -0
  28. package/sdk/{APIClient.d.ts → partner/PartnerAPIClient.d.ts} +2 -1
  29. package/sdk/{APIClient.js → partner/PartnerAPIClient.js} +13 -6
  30. package/sdk/{Client.d.ts → partner/PartnerClient.d.ts} +2 -2
  31. package/sdk/{Client.js → partner/PartnerClient.js} +2 -2
  32. package/sdk/partner/PartnerConfig.d.ts +30 -0
  33. package/sdk/partner/PartnerConfig.js +39 -0
  34. package/sdk/partner/index.d.ts +3 -0
  35. package/sdk/partner/index.js +5 -0
  36. package/sdk/platform/Billing/BillingPlatformClient.d.ts +24 -0
  37. package/sdk/platform/Billing/BillingPlatformClient.js +134 -0
  38. package/sdk/platform/Billing/BillingPlatformModel.d.ts +4 -0
  39. package/sdk/platform/Billing/BillingPlatformModel.js +44 -0
  40. package/sdk/platform/Billing/BillingPlatformValidator.d.ts +2 -0
  41. package/sdk/platform/Billing/BillingPlatformValidator.js +14 -0
  42. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +29 -0
  43. package/sdk/platform/Cart/CartPlatformApplicationClient.js +181 -0
  44. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +3 -0
  45. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +17 -0
  46. package/sdk/platform/Cart/CartPlatformModel.d.ts +4 -0
  47. package/sdk/platform/Cart/CartPlatformModel.js +37 -0
  48. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +3 -1
  49. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +5 -0
  50. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +1 -0
  51. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +1 -1
  52. package/sdk/platform/Catalog/CatalogPlatformClient.js +1 -1
  53. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -5
  54. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +0 -183
  55. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +0 -417
  56. package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +0 -10
  57. package/sdk/platform/Communication/CommunicationPlatformClient.js +0 -26
  58. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +4 -0
  59. package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -22
  60. package/sdk/platform/Configuration/ConfigurationPlatformClient.js +0 -56
  61. package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +22 -1
  62. package/sdk/platform/Content/ContentPlatformApplicationClient.js +123 -2
  63. package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +2 -0
  64. package/sdk/platform/Content/ContentPlatformApplicationValidator.js +12 -0
  65. package/sdk/platform/Content/ContentPlatformModel.js +0 -5
  66. package/sdk/platform/Discount/DiscountPlatformClient.d.ts +2 -2
  67. package/sdk/platform/Discount/DiscountPlatformClient.js +1 -1
  68. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +1 -0
  69. package/sdk/platform/Discount/DiscountPlatformModel.js +15 -0
  70. package/sdk/platform/Discount/DiscountPlatformValidator.js +1 -1
  71. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +1 -1
  72. package/sdk/platform/Lead/LeadPlatformModel.js +1 -0
  73. package/sdk/platform/OAuthClient.js +3 -9
  74. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +1 -47
  75. package/sdk/platform/Order/OrderPlatformApplicationClient.js +5 -201
  76. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -3
  77. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +1 -26
  78. package/sdk/platform/Order/OrderPlatformClient.d.ts +51 -183
  79. package/sdk/platform/Order/OrderPlatformClient.js +243 -931
  80. package/sdk/platform/Order/OrderPlatformModel.d.ts +4 -20
  81. package/sdk/platform/Order/OrderPlatformModel.js +38 -182
  82. package/sdk/platform/Order/OrderPlatformValidator.d.ts +3 -12
  83. package/sdk/platform/Order/OrderPlatformValidator.js +19 -95
  84. package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +24 -10
  85. package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +111 -44
  86. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +2 -1
  87. package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +13 -5
  88. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2 -0
  89. package/sdk/platform/Payment/PaymentPlatformModel.js +12 -0
  90. package/sdk/platform/PlatformApplicationClient.d.ts +16 -41
  91. package/sdk/platform/PlatformApplicationClient.js +17 -45
  92. package/sdk/platform/PlatformClient.d.ts +124 -263
  93. package/sdk/platform/PlatformClient.js +148 -315
  94. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +14 -16
  95. package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +63 -77
  96. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +1 -1
  97. package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +7 -8
  98. package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +11 -0
  99. package/sdk/platform/Share/SharePlatformApplicationClient.js +61 -0
  100. package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -0
  101. package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -0
  102. package/sdk/platform/Share/SharePlatformModel.d.ts +2 -0
  103. package/sdk/platform/Share/SharePlatformModel.js +11 -0
  104. package/sdk/platform/index.d.ts +0 -1
  105. package/sdk/platform/index.js +0 -2
  106. package/sdk/Config.d.ts +0 -9
  107. package/sdk/Config.js +0 -17
  108. package/sdk/constructUrl.d.ts +0 -5
  109. package/sdk/constructUrl.js +0 -13
  110. package/sdk/index.d.ts +0 -3
  111. package/sdk/index.js +0 -5
  112. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +0 -109
  113. package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +0 -558
  114. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +0 -11
  115. package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +0 -56
  116. package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +0 -88
  117. package/sdk/platform/Analytics/AnalyticsPlatformClient.js +0 -361
  118. package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +0 -23
  119. package/sdk/platform/Analytics/AnalyticsPlatformModel.js +0 -169
  120. package/sdk/platform/Analytics/AnalyticsPlatformValidator.d.ts +0 -7
  121. package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +0 -38
package/README.md CHANGED
@@ -13,6 +13,8 @@ Get started with the Javascript Development SDK for Fynd Platform
13
13
 
14
14
  ### Usage
15
15
 
16
+ #### Node
17
+
16
18
  ```
17
19
  npm install @gofynd/fdk-client-javascript
18
20
  ```
@@ -26,6 +28,22 @@ const {
26
28
  } = require("fdk-client-javascript");
27
29
  ```
28
30
 
31
+ #### Browser
32
+ you can load fdk-client-javascript's application browser bundle from CDN; `ApplicationConfig`, `ApplicationClient` and `ApplicationModels` will be attached to browser's `window` object.
33
+
34
+ ```html
35
+ <script src="https://cdn.jsdelivr.net/gh/gofynd/fdk-client-javascript@<version>/dist/application.js"></script>
36
+ ```
37
+ Install Specific version
38
+ ```html
39
+ <script src="https://cdn.jsdelivr.net/gh/gofynd/fdk-client-javascript@1.0.1/dist/application.js"></script>
40
+ ```
41
+
42
+ ```js
43
+ const { ApplicationConfig, ApplicationClient } = window;
44
+ ```
45
+
46
+
29
47
  ### Logging
30
48
 
31
49
  For logging support user can pass `logLevel` in `ApplicationConfig` or `PlatformConfig` while declaration.
@@ -168,4 +186,5 @@ import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";
168
186
  - [Public Front](documentation/public/README.md)
169
187
  - [Application Front](documentation/application/README.md)
170
188
  - [Platform Front](documentation/platform/README.md)
189
+ - [Partner Front](documentation/partner/README.md)
171
190
 
package/index.d.ts CHANGED
@@ -7,7 +7,10 @@ import { ApplicationModel } from "./sdk/application";
7
7
  import { PlatformConfig } from "./sdk/platform";
8
8
  import { PlatformClient } from "./sdk/platform";
9
9
  import { PlatformModel } from "./sdk/platform";
10
+ import { PartnerConfig } from "./sdk/partner";
11
+ import { PartnerClient } from "./sdk/partner";
12
+ import { PartnerModel } from "./sdk/partner";
10
13
  import { fdkAxios } from "./sdk/common/AxiosHelper";
11
14
  import Utility = require("./sdk/common/Utility");
12
15
  import Constant = require("./sdk/common/Constant");
13
- export { PublicConfig, PublicClient, PublicModel, ApplicationConfig, ApplicationClient, ApplicationModel, PlatformConfig, PlatformClient, PlatformModel, fdkAxios as FdkAxios, Utility, Constant };
16
+ export { PublicConfig, PublicClient, PublicModel, ApplicationConfig, ApplicationClient, ApplicationModel, PlatformConfig, PlatformClient, PlatformModel, PartnerConfig, PartnerClient, PartnerModel, fdkAxios as FdkAxios, Utility, Constant };
package/index.js CHANGED
@@ -1,25 +1,41 @@
1
1
 
2
- const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
3
- const { ApplicationConfig, ApplicationClient, ApplicationModel } = require('./sdk/application');
4
- const { PlatformConfig, PlatformClient, PlatformModel } = require('./sdk/platform');
2
+ const { PublicConfig, PublicClient, PublicModel } = require('./sdk/public');
3
+ const { ApplicationConfig, ApplicationClient, ApplicationModel } = require('./sdk/application');
4
+ const { PlatformConfig, PlatformClient, PlatformModel } = require('./sdk/platform');
5
+
6
+ const { PartnerConfig, PartnerClient, PartnerModel } = require('./sdk/partner');
5
7
  const {fdkAxios} = require('./sdk/common/AxiosHelper');
6
8
  const Utility = require('./sdk/common/Utility');
7
9
  const Constant = require('./sdk/common/Constant');
8
10
 
9
11
  module.exports = {
10
12
 
13
+
11
14
  PublicConfig,
12
15
  PublicClient,
13
16
  PublicModel,
14
17
 
18
+
19
+
15
20
  ApplicationConfig,
16
21
  ApplicationClient,
17
22
  ApplicationModel,
18
23
 
24
+
25
+
19
26
  PlatformConfig,
20
27
  PlatformClient,
21
28
  PlatformModel,
22
29
 
30
+
31
+
32
+
33
+
34
+ PartnerConfig,
35
+ PartnerClient,
36
+ PartnerModel,
37
+
38
+
23
39
  FdkAxios: fdkAxios,
24
40
  Utility,
25
41
  Constant,
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "v1.0.4",
3
+ "version": "1.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "jest --coverage",
8
+ "test:standalone": "npm run build && npx cypress run",
9
+ "build": "webpack",
8
10
  "prettier": "npx prettier -w ./sdk ./tests && npx tsc"
9
11
  },
10
12
  "author": "Jigar Dafda<jigar.dafda@gmail.com>",
@@ -13,23 +15,30 @@
13
15
  "axios": "^0.27.2",
14
16
  "camelcase": "^6.3.0",
15
17
  "crypto-js": "^4.1.1",
18
+ "isomorphic-base64": "^1.0.2",
16
19
  "joi": "^17.7.0",
17
20
  "loglevel": "^1.8.1",
18
- "query-string": "^6.14.1"
21
+ "query-string": "^7.1.3"
19
22
  },
20
23
  "devDependencies": {
21
24
  "axios-cookiejar-support": "^4.0.6",
22
25
  "axios-mock-adapter": "^1.21.2",
26
+ "clean-webpack-plugin": "^4.0.0",
23
27
  "coveralls": "^3.1.1",
28
+ "cypress": "^9.2.0",
24
29
  "dotenv": "^16.0.3",
25
30
  "jest": "^29.5.0",
26
- "tough-cookie": "^4.1.2"
31
+ "tough-cookie": "^4.1.2",
32
+ "webpack": "^5.81.0",
33
+ "webpack-cli": "^5.0.2"
27
34
  },
28
35
  "files": [
29
36
  "sdk/**/*.js",
30
37
  "sdk/**/*.d.ts",
31
38
  "./*.js",
32
39
  "./*.d.ts",
33
- "!jest.config.*"
40
+ "!**.config.*",
41
+ "!dist",
42
+ "!cypress"
34
43
  ]
35
44
  }
package/partner.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { PartnerConfig } from "./sdk/partner";
2
+ import { PartnerClient } from "./sdk/partner";
3
+ import { PartnerModel } from "./sdk/partner";
4
+ export { PartnerConfig, PartnerClient, PartnerModel };
package/partner.js ADDED
@@ -0,0 +1,7 @@
1
+ const {PartnerConfig, PartnerClient, PartnerModel } = require('./sdk/partner');
2
+
3
+ module.exports = {
4
+ PartnerConfig: PartnerConfig,
5
+ PartnerClient: PartnerClient,
6
+ PartnerModel: PartnerModel
7
+ };
@@ -1,4 +1,5 @@
1
1
  const { fdkAxios } = require("../common/AxiosHelper");
2
+ const { btoa } = require("isomorphic-base64");
2
3
 
3
4
  class APIClient {
4
5
  /**
@@ -10,10 +11,7 @@ class APIClient {
10
11
  */
11
12
 
12
13
  static execute(conf, method, url, query, body, xHeaders) {
13
- const token = Buffer.from(
14
- `${conf.applicationID}:${conf.applicationToken}`,
15
- "utf8"
16
- ).toString("base64");
14
+ const token = btoa(`${conf.applicationID}:${conf.applicationToken}`);
17
15
 
18
16
  let headers = { Authorization: "Bearer " + token };
19
17
  if (conf.cookie) {
@@ -146,17 +146,22 @@ declare class Catalog {
146
146
  * either ascending or descending order. See the supported values below.
147
147
  * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
148
148
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
149
+ * @param {number} [arg.pageNo] - Page Number to retrieve next set of results.
150
+ * @param {string} [arg.pageType] - Page Type to retrieve set of results can
151
+ * be cursor or number.
149
152
  * @returns {Promise<ProductListingResponse>} - Success response
150
153
  * @summary: Get the items in a collection
151
154
  * @description: Get items in a collection specified by its `slug`.
152
155
  */
153
- getCollectionItemsBySlug({ slug, f, filters, sortOn, pageId, pageSize, }?: {
156
+ getCollectionItemsBySlug({ slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType, }?: {
154
157
  slug: string;
155
158
  f?: string;
156
159
  filters?: boolean;
157
160
  sortOn?: string;
158
161
  pageId?: string;
159
162
  pageSize?: number;
163
+ pageNo?: number;
164
+ pageType?: string;
160
165
  }): Promise<ProductListingResponse>;
161
166
  /**
162
167
  * @param {Object} arg - Arg object.
@@ -530,6 +530,9 @@ class Catalog {
530
530
  * either ascending or descending order. See the supported values below.
531
531
  * @param {string} [arg.pageId] - Page ID to retrieve next set of results.
532
532
  * @param {number} [arg.pageSize] - The number of items to retrieve in each page.
533
+ * @param {number} [arg.pageNo] - Page Number to retrieve next set of results.
534
+ * @param {string} [arg.pageType] - Page Type to retrieve set of results can
535
+ * be cursor or number.
533
536
  * @returns {Promise<ProductListingResponse>} - Success response
534
537
  * @summary: Get the items in a collection
535
538
  * @description: Get items in a collection specified by its `slug`.
@@ -541,9 +544,11 @@ class Catalog {
541
544
  sortOn,
542
545
  pageId,
543
546
  pageSize,
547
+ pageNo,
548
+ pageType,
544
549
  } = {}) {
545
550
  const { error } = CatalogValidator.getCollectionItemsBySlug().validate(
546
- { slug, f, filters, sortOn, pageId, pageSize },
551
+ { slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
547
552
  { abortEarly: false, allowUnknown: true }
548
553
  );
549
554
  if (error) {
@@ -554,7 +559,7 @@ class Catalog {
554
559
  const {
555
560
  error: warrning,
556
561
  } = CatalogValidator.getCollectionItemsBySlug().validate(
557
- { slug, f, filters, sortOn, pageId, pageSize },
562
+ { slug, f, filters, sortOn, pageId, pageSize, pageNo, pageType },
558
563
  { abortEarly: false, allowUnknown: false }
559
564
  );
560
565
  if (warrning) {
@@ -571,6 +576,8 @@ class Catalog {
571
576
  query_params["sort_on"] = sortOn;
572
577
  query_params["page_id"] = pageId;
573
578
  query_params["page_size"] = pageSize;
579
+ query_params["page_no"] = pageNo;
580
+ query_params["page_type"] = pageType;
574
581
 
575
582
  const xHeaders = {};
576
583
 
@@ -641,6 +648,8 @@ class Catalog {
641
648
  sortOn: sortOn,
642
649
  pageId: pageId,
643
650
  pageSize: pageSize,
651
+ pageNo: pageNo,
652
+ pageType: pageType,
644
653
  });
645
654
  paginator.setPaginator({
646
655
  hasNext: data.page.has_next ? true : false,
@@ -16,7 +16,7 @@ class CatalogModel {
16
16
  }
17
17
  static ApplicationStoreListing() {
18
18
  return Joi.object({
19
- filters: Joi.array().items(CatalogModel.StoreDepartments()),
19
+ filters: Joi.array().items(Joi.any()),
20
20
  items: Joi.array().items(CatalogModel.AppStore()),
21
21
  page: CatalogModel.Page(),
22
22
  });
@@ -29,6 +29,7 @@ class CatalogModel {
29
29
  departments: Joi.array().items(CatalogModel.StoreDepartments()),
30
30
  manager: CatalogModel.StoreManagerSerializer(),
31
31
  name: Joi.string().allow(""),
32
+ store_code: Joi.string().allow(""),
32
33
  uid: Joi.number(),
33
34
  });
34
35
  }
@@ -940,7 +941,7 @@ class CatalogModel {
940
941
  }
941
942
  static StoreDepartments() {
942
943
  return Joi.object({
943
- logo: Joi.string().allow(""),
944
+ logo: Joi.any(),
944
945
  name: Joi.string().allow(""),
945
946
  priority_order: Joi.number(),
946
947
  slug: Joi.string().allow(""),
@@ -964,6 +965,7 @@ class CatalogModel {
964
965
  departments: Joi.array().items(CatalogModel.StoreDepartments()),
965
966
  manager: CatalogModel.StoreManagerSerializer(),
966
967
  name: Joi.string().allow(""),
968
+ store_code: Joi.string().allow(""),
967
969
  timing: Joi.array().items(CatalogModel.StoreTiming()),
968
970
  uid: Joi.number(),
969
971
  });
@@ -49,6 +49,8 @@ class CatalogValidator {
49
49
  sortOn: Joi.string().allow(""),
50
50
  pageId: Joi.string().allow(""),
51
51
  pageSize: Joi.number(),
52
+ pageNo: Joi.number(),
53
+ pageType: Joi.string().allow(""),
52
54
  }).required();
53
55
  }
54
56
 
@@ -347,7 +347,6 @@ class ContentModel {
347
347
  static Detail() {
348
348
  return Joi.object({
349
349
  description: Joi.string().allow(""),
350
- image_url: Joi.string().allow(""),
351
350
  title: Joi.string().allow(""),
352
351
  });
353
352
  }
@@ -886,10 +885,6 @@ class ContentModel {
886
885
 
887
886
  "product",
888
887
 
889
- "product-reviews",
890
-
891
- "add-product-review",
892
-
893
888
  "product-request",
894
889
 
895
890
  "products",
@@ -258,6 +258,7 @@ class LeadModel {
258
258
  support_email: LeadModel.CommunicationDetails(),
259
259
  support_faq: LeadModel.CommunicationDetails(),
260
260
  support_phone: LeadModel.CommunicationDetails(),
261
+ type: Joi.string().allow(""),
261
262
  });
262
263
  }
263
264
  static Ticket() {
@@ -13,7 +13,6 @@ declare class Order {
13
13
  getShipmentReasons: string;
14
14
  sendOtpToShipmentCustomer: string;
15
15
  trackShipment: string;
16
- updateShipmentStatus: string;
17
16
  verifyOtpShipmentCustomer: string;
18
17
  };
19
18
  _urls: {};
@@ -156,20 +155,6 @@ declare class Order {
156
155
  trackShipment({ shipmentId }?: {
157
156
  shipmentId: string;
158
157
  }): Promise<ShipmentTrack>;
159
- /**
160
- * @param {Object} arg - Arg object.
161
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
162
- * multiple items and may get divided into one or more shipment, each
163
- * having its own ID.
164
- * @param {UpdateShipmentStatusRequest} arg.body
165
- * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
166
- * @summary: Update the shipment status
167
- * @description: Use this API to update the status of a shipment using its shipment ID.
168
- */
169
- updateShipmentStatus({ shipmentId, body }?: {
170
- shipmentId: string;
171
- body: UpdateShipmentStatusRequest;
172
- }): Promise<ShipmentApplicationStatusResponse>;
173
158
  /**
174
159
  * @param {Object} arg - Arg object.
175
160
  * @param {string} arg.orderId - A unique number used for identifying and
@@ -29,8 +29,6 @@ class Order {
29
29
  "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/send/",
30
30
  trackShipment:
31
31
  "/service/application/order/v1.0/orders/shipments/{shipment_id}/track",
32
- updateShipmentStatus:
33
- "/service/application/order/v1.0/orders/shipments/{shipment_id}/status",
34
32
  verifyOtpShipmentCustomer:
35
33
  "/service/application/order/v1.0/orders/{order_id}/shipments/{shipment_id}/otp/verify/",
36
34
  };
@@ -719,72 +717,6 @@ class Order {
719
717
  return response;
720
718
  }
721
719
 
722
- /**
723
- * @param {Object} arg - Arg object.
724
- * @param {string} arg.shipmentId - ID of the shipment. An order may contain
725
- * multiple items and may get divided into one or more shipment, each
726
- * having its own ID.
727
- * @param {UpdateShipmentStatusRequest} arg.body
728
- * @returns {Promise<ShipmentApplicationStatusResponse>} - Success response
729
- * @summary: Update the shipment status
730
- * @description: Use this API to update the status of a shipment using its shipment ID.
731
- */
732
- async updateShipmentStatus({ shipmentId, body } = {}) {
733
- const { error } = OrderValidator.updateShipmentStatus().validate(
734
- { shipmentId, body },
735
- { abortEarly: false, allowUnknown: true }
736
- );
737
- if (error) {
738
- return Promise.reject(new FDKClientValidationError(error));
739
- }
740
-
741
- // Showing warrnings if extra unknown parameters are found
742
- const { error: warrning } = OrderValidator.updateShipmentStatus().validate(
743
- { shipmentId, body },
744
- { abortEarly: false, allowUnknown: false }
745
- );
746
- if (warrning) {
747
- Logger({
748
- level: "WARN",
749
- message: "Parameter Validation warrnings for updateShipmentStatus",
750
- });
751
- Logger({ level: "WARN", message: warrning });
752
- }
753
-
754
- const query_params = {};
755
-
756
- const xHeaders = {};
757
-
758
- const response = await ApplicationAPIClient.execute(
759
- this._conf,
760
- "put",
761
- constructUrl({
762
- url: this._urls["updateShipmentStatus"],
763
- params: { shipmentId },
764
- }),
765
- query_params,
766
- body,
767
- xHeaders
768
- );
769
-
770
- const {
771
- error: res_error,
772
- } = OrderModel.ShipmentApplicationStatusResponse().validate(response, {
773
- abortEarly: false,
774
- allowUnknown: false,
775
- });
776
-
777
- if (res_error) {
778
- Logger({
779
- level: "WARN",
780
- message: "Response Validation Warnnings for updateShipmentStatus",
781
- });
782
- Logger({ level: "WARN", message: res_error });
783
- }
784
-
785
- return response;
786
- }
787
-
788
720
  /**
789
721
  * @param {Object} arg - Arg object.
790
722
  * @param {string} arg.orderId - A unique number used for identifying and
@@ -11,12 +11,7 @@ declare class OrderModel {
11
11
  static BreakupValues(): any;
12
12
  static CurrentStatus(): any;
13
13
  static CustomerDetailsResponse(): any;
14
- static DataUpdates(): any;
15
14
  static DeliveryAddress(): any;
16
- static EntitiesDataUpdates(): any;
17
- static EntitiesReasons(): any;
18
- static EntityReasonData(): any;
19
- static ErrorResponse(): any;
20
15
  static FinancialBreakup(): any;
21
16
  static FulfillingCompany(): any;
22
17
  static FulfillingStore(): any;
@@ -32,35 +27,23 @@ declare class OrderModel {
32
27
  static OrderSchema(): any;
33
28
  static OrderStatuses(): any;
34
29
  static Prices(): any;
35
- static Products(): any;
36
- static ProductsDataUpdates(): any;
37
- static ProductsDataUpdatesFilters(): any;
38
- static ProductsReasons(): any;
39
- static ProductsReasonsData(): any;
40
- static ProductsReasonsFilters(): any;
41
30
  static Promise(): any;
42
31
  static QuestionSet(): any;
43
- static ReasonsData(): any;
44
32
  static ResponseGetInvoiceShipment(): any;
45
33
  static SendOtpToCustomerResponse(): any;
46
- static ShipmentApplicationStatusResponse(): any;
47
34
  static ShipmentBagReasons(): any;
48
35
  static ShipmentById(): any;
49
36
  static ShipmentPayment(): any;
50
37
  static ShipmentReason(): any;
51
38
  static ShipmentReasons(): any;
52
39
  static Shipments(): any;
53
- static ShipmentsRequest(): any;
54
40
  static ShipmentStatus(): any;
55
41
  static ShipmentTotalDetails(): any;
56
42
  static ShipmentTrack(): any;
57
43
  static ShipmentUserInfo(): any;
58
- static StatuesRequest(): any;
59
- static StatusesBodyResponse(): any;
60
44
  static TimeStampData(): any;
61
45
  static Track(): any;
62
46
  static TrackingDetails(): any;
63
- static UpdateShipmentStatusRequest(): any;
64
47
  static UserInfo(): any;
65
48
  static VerifyOtp(): any;
66
49
  static VerifyOtpResponse(): any;
@@ -105,12 +105,6 @@ class OrderModel {
105
105
  shipment_id: Joi.string().allow(""),
106
106
  });
107
107
  }
108
- static DataUpdates() {
109
- return Joi.object({
110
- entities: Joi.array().items(OrderModel.EntitiesDataUpdates()),
111
- products: Joi.array().items(OrderModel.ProductsDataUpdates()),
112
- });
113
- }
114
108
  static DeliveryAddress() {
115
109
  return Joi.object({
116
110
  address: Joi.string().allow(""),
@@ -137,33 +131,6 @@ class OrderModel {
137
131
  version: Joi.string().allow(""),
138
132
  });
139
133
  }
140
- static EntitiesDataUpdates() {
141
- return Joi.object({
142
- data: Joi.any(),
143
- filters: Joi.array().items(Joi.any()),
144
- });
145
- }
146
- static EntitiesReasons() {
147
- return Joi.object({
148
- data: OrderModel.EntityReasonData(),
149
- filters: Joi.array().items(Joi.any()),
150
- });
151
- }
152
- static EntityReasonData() {
153
- return Joi.object({
154
- reason_id: Joi.number(),
155
- reason_text: Joi.string().allow(""),
156
- });
157
- }
158
- static ErrorResponse() {
159
- return Joi.object({
160
- code: Joi.string().allow("").allow(null),
161
- exception: Joi.string().allow("").allow(null),
162
- message: Joi.string().allow("").allow(null),
163
- stack_trace: Joi.string().allow("").allow(null),
164
- status: Joi.number(),
165
- });
166
- }
167
134
  static FinancialBreakup() {
168
135
  return Joi.object({
169
136
  added_to_fynd_cash: Joi.boolean(),
@@ -319,44 +286,6 @@ class OrderModel {
319
286
  value_of_good: Joi.number(),
320
287
  });
321
288
  }
322
- static Products() {
323
- return Joi.object({
324
- identifier: Joi.string().allow(""),
325
- line_number: Joi.number(),
326
- quantity: Joi.number(),
327
- });
328
- }
329
- static ProductsDataUpdates() {
330
- return Joi.object({
331
- data: Joi.any(),
332
- filters: Joi.array().items(OrderModel.ProductsDataUpdatesFilters()),
333
- });
334
- }
335
- static ProductsDataUpdatesFilters() {
336
- return Joi.object({
337
- identifier: Joi.string().allow(""),
338
- line_number: Joi.number(),
339
- });
340
- }
341
- static ProductsReasons() {
342
- return Joi.object({
343
- data: OrderModel.ProductsReasonsData(),
344
- filters: Joi.array().items(OrderModel.ProductsReasonsFilters()),
345
- });
346
- }
347
- static ProductsReasonsData() {
348
- return Joi.object({
349
- reason_id: Joi.number(),
350
- reason_text: Joi.string().allow(""),
351
- });
352
- }
353
- static ProductsReasonsFilters() {
354
- return Joi.object({
355
- identifier: Joi.string().allow(""),
356
- line_number: Joi.number(),
357
- quantity: Joi.number(),
358
- });
359
- }
360
289
  static Promise() {
361
290
  return Joi.object({
362
291
  show_promise: Joi.boolean(),
@@ -369,12 +298,6 @@ class OrderModel {
369
298
  id: Joi.number(),
370
299
  });
371
300
  }
372
- static ReasonsData() {
373
- return Joi.object({
374
- entities: Joi.array().items(OrderModel.EntitiesReasons()),
375
- products: Joi.array().items(OrderModel.ProductsReasons()),
376
- });
377
- }
378
301
  static ResponseGetInvoiceShipment() {
379
302
  return Joi.object({
380
303
  presigned_type: Joi.string().allow("").required(),
@@ -391,11 +314,6 @@ class OrderModel {
391
314
  success: Joi.boolean(),
392
315
  });
393
316
  }
394
- static ShipmentApplicationStatusResponse() {
395
- return Joi.object({
396
- statuses: Joi.array().items(OrderModel.StatusesBodyResponse()),
397
- });
398
- }
399
317
  static ShipmentBagReasons() {
400
318
  return Joi.object({
401
319
  reasons: Joi.array().items(OrderModel.BagReasons()),
@@ -472,14 +390,6 @@ class OrderModel {
472
390
  user_info: OrderModel.ShipmentUserInfo(),
473
391
  });
474
392
  }
475
- static ShipmentsRequest() {
476
- return Joi.object({
477
- data_updates: OrderModel.DataUpdates(),
478
- identifier: Joi.string().allow("").required(),
479
- products: Joi.array().items(OrderModel.Products()),
480
- reasons: OrderModel.ReasonsData(),
481
- });
482
- }
483
393
  static ShipmentStatus() {
484
394
  return Joi.object({
485
395
  hex_code: Joi.string().allow(""),
@@ -506,18 +416,6 @@ class OrderModel {
506
416
  mobile: Joi.string().allow(""),
507
417
  });
508
418
  }
509
- static StatuesRequest() {
510
- return Joi.object({
511
- exclude_bags_next_state: Joi.string().allow(""),
512
- shipments: Joi.array().items(OrderModel.ShipmentsRequest()),
513
- status: Joi.string().allow(""),
514
- });
515
- }
516
- static StatusesBodyResponse() {
517
- return Joi.object({
518
- shipments: Joi.array().items(Joi.any()),
519
- });
520
- }
521
419
  static TimeStampData() {
522
420
  return Joi.object({
523
421
  max: Joi.string().allow(""),
@@ -545,15 +443,6 @@ class OrderModel {
545
443
  tracking_details: Joi.array().items(OrderModel.NestedTrackingDetails()),
546
444
  });
547
445
  }
548
- static UpdateShipmentStatusRequest() {
549
- return Joi.object({
550
- force_transition: Joi.boolean(),
551
- lock_after_transition: Joi.boolean(),
552
- statuses: Joi.array().items(OrderModel.StatuesRequest()),
553
- task: Joi.boolean(),
554
- unlock_before_transition: Joi.boolean(),
555
- });
556
- }
557
446
  static UserInfo() {
558
447
  return Joi.object({
559
448
  email: Joi.string().allow(""),
@@ -10,6 +10,5 @@ declare class OrderValidator {
10
10
  static getShipmentReasons(): any;
11
11
  static sendOtpToShipmentCustomer(): any;
12
12
  static trackShipment(): any;
13
- static updateShipmentStatus(): any;
14
13
  static verifyOtpShipmentCustomer(): any;
15
14
  }
@@ -70,13 +70,6 @@ class OrderValidator {
70
70
  }).required();
71
71
  }
72
72
 
73
- static updateShipmentStatus() {
74
- return Joi.object({
75
- shipmentId: Joi.string().allow("").required(),
76
- body: OrderModel.UpdateShipmentStatusRequest().required(),
77
- }).required();
78
- }
79
-
80
73
  static verifyOtpShipmentCustomer() {
81
74
  return Joi.object({
82
75
  orderId: Joi.string().allow("").required(),
@@ -38,7 +38,7 @@ function requestInterceptorFn() {
38
38
  }
39
39
  const { host, pathname, search } = new URL(url);
40
40
  const { data, headers, method, params } = config;
41
- headers["x-fp-sdk-version"] = "1.0.3";
41
+ headers["x-fp-sdk-version"] = "1.1.1";
42
42
  let querySearchObj = querystring.parse(search);
43
43
  querySearchObj = { ...querySearchObj, ...params };
44
44
  let queryParam = "";