@gofynd/fdk-client-javascript 3.4.0 → 3.4.2

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 (31) hide show
  1. package/README.md +23 -26
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationClient.d.ts +3 -2
  4. package/sdk/application/ApplicationClient.js +25 -19
  5. package/sdk/common/utils.js +6 -3
  6. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +111 -43
  7. package/sdk/partner/Logistics/LogisticsPartnerModel.js +65 -33
  8. package/sdk/partner/PartnerClient.d.ts +5 -2
  9. package/sdk/partner/PartnerClient.js +21 -7
  10. package/sdk/platform/Cart/CartPlatformModel.d.ts +181 -10
  11. package/sdk/platform/Cart/CartPlatformModel.js +95 -8
  12. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +40 -1
  13. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +260 -1
  14. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +68 -1
  15. package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +49 -0
  16. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +26 -1
  17. package/sdk/platform/Catalog/CatalogPlatformModel.js +27 -0
  18. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +2 -0
  19. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +2 -0
  20. package/sdk/platform/Content/ContentPlatformModel.d.ts +14 -19
  21. package/sdk/platform/Content/ContentPlatformModel.js +6 -20
  22. package/sdk/platform/Order/OrderPlatformModel.d.ts +218 -17
  23. package/sdk/platform/Order/OrderPlatformModel.js +366 -14
  24. package/sdk/platform/Order/OrderPlatformValidator.d.ts +15 -15
  25. package/sdk/platform/Order/OrderPlatformValidator.js +9 -9
  26. package/sdk/platform/PlatformClient.d.ts +5 -2
  27. package/sdk/platform/PlatformClient.js +32 -18
  28. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +50 -4
  29. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +22 -2
  30. package/sdk/public/PublicClient.d.ts +3 -2
  31. package/sdk/public/PublicClient.js +13 -7
package/README.md CHANGED
@@ -23,14 +23,13 @@ Using this method, you can `require` fdk-client-javascript like so:
23
23
 
24
24
  ```js
25
25
  const {
26
- ApplicationConfig,
27
26
  ApplicationClient,
28
27
  } = require("fdk-client-javascript");
29
28
  ```
30
29
 
31
30
  #### Browser
32
31
 
33
- you can load fdk-client-javascript's application browser bundle from CDN; `ApplicationConfig` and `ApplicationClient` will be attached to browser's `window` object.
32
+ you can load fdk-client-javascript's application browser bundle from CDN; `ApplicationClient` and `ApplicationModels` will be attached to browser's `window` object.
34
33
 
35
34
  ```html
36
35
  <script src="https://cdn.jsdelivr.net/gh/gofynd/fdk-client-javascript@<version>/dist/application.js"></script>
@@ -43,12 +42,12 @@ Install Specific version
43
42
  ```
44
43
 
45
44
  ```js
46
- const { ApplicationConfig, ApplicationClient } = window;
45
+ const { ApplicationClient } = window;
47
46
  ```
48
47
 
49
48
  ### Logging
50
49
 
51
- For logging support user can pass `logLevel` in `ApplicationConfig` or `PlatformConfig` while declaration.
50
+ For logging support user can pass `logLevel` in `ApplicationClient` or `PlatformClient` while declaration.
52
51
 
53
52
  ```
54
53
  Available logging levels: TRACE, DEBUG, INFO, WARN, ERROR.
@@ -59,14 +58,12 @@ Default log level: ERROR
59
58
  ### Sample Usage - ApplicationClient
60
59
 
61
60
  ```javascript
62
- const config = new ApplicationConfig({
61
+ const applicationClient = new ApplicationClient({
63
62
  applicationID: "YOUR_APPLICATION_ID",
64
63
  applicationToken: "YOUR_APPLICATION_TOKEN",
65
64
  locationDetails: "LOCATION_DETAILS_OBJECT"
66
65
  });
67
66
 
68
- const applicationClient = new ApplicationClient(config);
69
-
70
67
  applicationClient.setLocationDetails({
71
68
  pincode:"385001",
72
69
  country: "India",
@@ -92,21 +89,23 @@ getProductDetails();
92
89
  ### Sample Usage - PlatformClient
93
90
 
94
91
  ```javascript
95
- const { PlatformConfig, PlatformClient } = require("fdk-client-javascript");
96
-
97
- let platformConfig = new PlatformConfig({
98
- companyId: "COMPANY_ID",
99
- apiKey: "API_KEY",
100
- apiSecret: "API_SECRET",
101
- domain: "DOMAIN",
102
- useAutoRenewTimer: true // Setting `true` will use timer based logic to refresh the access token. With `false` will issue refresh token just before any api call when it is expired.
103
- });
92
+ const { PlatformClient } = require("fdk-client-javascript");
104
93
 
105
94
  async function getData() {
106
95
  try {
107
- // TODO: get token using OAuth
108
- platformConfig.oauthClient.setToken(token.access_token);
109
- const client = new PlatformClient(platformConfig);
96
+ const client = new PlatformClient({
97
+ companyId: "COMPANY_ID",
98
+ apiKey: "API_KEY",
99
+ apiSecret: "API_SECRET",
100
+ domain: "DOMAIN",
101
+ useAutoRenewTimer: true // Setting `true` will use timer based logic to refresh the access token. With `false` will issue refresh token just before any api call when it is expired.
102
+ });
103
+
104
+ const token = await platformClient.getAccesstokenObj({
105
+ grant_type: 'client_credentials'
106
+ })
107
+
108
+ platformClient.setToken(token);
110
109
 
111
110
  // API's without application_id
112
111
  const tickets = await client.lead.getTickets();
@@ -219,17 +218,15 @@ To print the curl command in the console for all network calls made using `appli
219
218
 
220
219
  ```javascript
221
220
  const {
222
- ApplicationClient, ApplicationConfig,
221
+ ApplicationClient,
223
222
  } = require("fdk-client-javascript");
224
223
 
225
- let applicationConfig = new ApplicationConfig({
224
+ let applicationClient = new ApplicationClient({
226
225
  applicationID: "YOUR_APPLICATION_ID",
227
226
  applicationToken: "YOUR_APPLICATION_TOKEN",
227
+ logLevel: "debug"
228
228
  });
229
229
 
230
- applicationConfig.setLogLevel("debug");
231
- let applicationClient = new ApplicationClient(applicationConfig);
232
-
233
230
  let response = await applicationClient.theme.getAppliedTheme();
234
231
  console.log("Active Theme: ", response.information.name);
235
232
  ```
@@ -237,7 +234,7 @@ console.log("Active Theme: ", response.information.name);
237
234
  The above code will log the curl command in the console
238
235
 
239
236
  ```bash
240
- curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.4.0' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
237
+ curl --request GET "https://api.fynd.com/service/application/theme/v1.0/applied-theme" --header 'authorization: Bearer <authorization-token>' --header 'x-fp-sdk-version: 3.4.2' --header 'x-fp-date: 20230222T115108Z' --header 'x-fp-signature: v1.1:1e3ab3b02b5bc626e3c32a37ee844266ade02bbcbaafc28fc7a0e46a76a7a1a8'
241
238
  Active Theme: Emerge
242
239
  ```
243
240
 
@@ -248,7 +245,7 @@ Active Theme: Emerge
248
245
  fdk-client-javascript includes Typescript definitions.
249
246
 
250
247
  ```typescript
251
- import { ApplicationConfig, ApplicationClient } from "fdk-client-javascript";
248
+ import { ApplicationClient } from "fdk-client-javascript";
252
249
  ```
253
250
 
254
251
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gofynd/fdk-client-javascript",
3
- "version": "3.4.0",
3
+ "version": "3.4.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -6,8 +6,8 @@ export = ApplicationClient;
6
6
  */
7
7
  declare class ApplicationClient {
8
8
  /** @param {import("./ApplicationConfig")} config - The application configuration. */
9
- constructor(config: import("./ApplicationConfig"));
10
- config: import("./ApplicationConfig");
9
+ constructor(config: import("./ApplicationConfig"), options: any);
10
+ config: ApplicationConfig;
11
11
  cart: Cart;
12
12
  catalog: Catalog;
13
13
  common: Common;
@@ -65,6 +65,7 @@ declare class ApplicationClient {
65
65
  responseHeaders?: boolean;
66
66
  }): Promise<import("axios").AxiosResponse<any, any>>;
67
67
  }
68
+ import ApplicationConfig = require("./ApplicationConfig");
68
69
  import Cart = require("./Cart/CartApplicationClient");
69
70
  import Catalog = require("./Catalog/CatalogApplicationClient");
70
71
  import Common = require("./Common/CommonApplicationClient");
@@ -19,6 +19,7 @@ const { FDKClientValidationError } = require("../common/FDKError");
19
19
  const { Logger } = require("../common/Logger");
20
20
  const { convertStringToBase64 } = require("../common/utils");
21
21
  const { execute } = require("./ApplicationAPIClient");
22
+ const ApplicationConfig = require("./ApplicationConfig");
22
23
 
23
24
  /**
24
25
  * Represents the client for the application.
@@ -27,25 +28,30 @@ const { execute } = require("./ApplicationAPIClient");
27
28
  */
28
29
  class ApplicationClient {
29
30
  /** @param {import("./ApplicationConfig")} config - The application configuration. */
30
- constructor(config) {
31
- this.config = config;
32
- this.cart = new Cart(config);
33
- this.catalog = new Catalog(config);
34
- this.common = new Common(config);
35
- this.communication = new Communication(config);
36
- this.configuration = new Configuration(config);
37
- this.content = new Content(config);
38
- this.fileStorage = new FileStorage(config);
39
- this.finance = new Finance(config);
40
- this.lead = new Lead(config);
41
- this.logistic = new Logistic(config);
42
- this.order = new Order(config);
43
- this.payment = new Payment(config);
44
- this.rewards = new Rewards(config);
45
- this.share = new Share(config);
46
- this.theme = new Theme(config);
47
- this.user = new User(config);
48
- this.webhook = new Webhook(config);
31
+ constructor(config, options) {
32
+ if (config instanceof ApplicationConfig) {
33
+ this.config = config;
34
+ } else {
35
+ let applicationConfig = new ApplicationConfig(config, options);
36
+ this.config = applicationConfig;
37
+ }
38
+ this.cart = new Cart(this.config);
39
+ this.catalog = new Catalog(this.config);
40
+ this.common = new Common(this.config);
41
+ this.communication = new Communication(this.config);
42
+ this.configuration = new Configuration(this.config);
43
+ this.content = new Content(this.config);
44
+ this.fileStorage = new FileStorage(this.config);
45
+ this.finance = new Finance(this.config);
46
+ this.lead = new Lead(this.config);
47
+ this.logistic = new Logistic(this.config);
48
+ this.order = new Order(this.config);
49
+ this.payment = new Payment(this.config);
50
+ this.rewards = new Rewards(this.config);
51
+ this.share = new Share(this.config);
52
+ this.theme = new Theme(this.config);
53
+ this.user = new User(this.config);
54
+ this.webhook = new Webhook(this.config);
49
55
  }
50
56
 
51
57
  /**
@@ -57,9 +57,12 @@ const generateUrlWithParams = (item = {}, params) => {
57
57
  let url = "";
58
58
  for (let linkSubString of linkArr) {
59
59
  if (linkSubString.startsWith(":")) {
60
- linkSubString = linkSubString.slice(1);
61
- url += `${joinedParamsObj[linkSubString]}`;
62
- } else url += `${linkSubString}`;
60
+ const paramKey = linkSubString.slice(1);
61
+ const paramVal = joinedParamsObj[paramKey];
62
+ url += paramVal || ""; // Prevent undefined
63
+ } else {
64
+ url += linkSubString;
65
+ }
63
66
  url += "/";
64
67
  }
65
68
  url = trimChar(url);
@@ -31,6 +31,12 @@ export = LogisticsPartnerModel;
31
31
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
32
32
  * quantity of items allowed in a non-quality check shipment.
33
33
  * @property {CourierPartnerSchemeFeatures} feature
34
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
35
+ * forward pickup (nullable), having 24hour time format HH:MM.
36
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
37
+ * reverse pickup (nullable), having 24hour time format HH:MM.
38
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
39
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
34
40
  */
35
41
  /**
36
42
  * @typedef BulkRegionServiceabilityTatDetails
@@ -360,9 +366,10 @@ export = LogisticsPartnerModel;
360
366
  * fetch or modify scheme details.
361
367
  * @property {string} name - Name of the scheme.
362
368
  * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
363
- * forward pickup (nullable).
369
+ * forward pickup (nullable), having 24hour time format HH:MM.
364
370
  * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
365
- * reverse pickup (nullable).
371
+ * reverse pickup (nullable), having 24hour time format HH:MM.
372
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
366
373
  * @property {CourierPartnerSchemeDefaultTat} [default_tat]
367
374
  * @property {ArithmeticOperations} weight
368
375
  * @property {ArithmeticOperations} [volumetric_weight]
@@ -417,6 +424,12 @@ export = LogisticsPartnerModel;
417
424
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
418
425
  * quantity of items allowed in a non-quality check shipment.
419
426
  * @property {CourierPartnerSchemeFeatures} feature
427
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
428
+ * forward pickup (nullable), having 24hour time format HH:MM.
429
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
430
+ * reverse pickup (nullable), having 24hour time format HH:MM.
431
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
432
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
420
433
  */
421
434
  /**
422
435
  * @typedef CourierPartnerSchemeList
@@ -447,6 +460,12 @@ export = LogisticsPartnerModel;
447
460
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
448
461
  * quantity of items allowed in a non-quality check shipment.
449
462
  * @property {CourierPartnerSchemeFeatures} feature
463
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
464
+ * forward pickup (nullable), having 24hour time format HH:MM.
465
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
466
+ * reverse pickup (nullable), having 24hour time format HH:MM.
467
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
468
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
450
469
  */
451
470
  /**
452
471
  * @typedef GetCountries
@@ -534,6 +553,18 @@ export = LogisticsPartnerModel;
534
553
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
535
554
  * quantity of items allowed in a non-quality check shipment.
536
555
  */
556
+ /**
557
+ * @typedef CourierPartnerSchemeDefaultTat
558
+ * @property {boolean} [enabled] - Indicates whether the default turn around
559
+ * time (tat) to be used for the given scheme or not.
560
+ * @property {CourierPartnerSchemeTat} [tat]
561
+ */
562
+ /**
563
+ * @typedef CourierPartnerSchemeTat
564
+ * @property {number} [min] - Minimum turn around time (tat) value for a scheme.
565
+ * @property {number} [max] - Maximum turn around time (tat) value for a scheme.
566
+ * @property {string} [unit] - Unit for the turn around time (tat) values for a scheme.
567
+ */
537
568
  /**
538
569
  * @typedef Error
539
570
  * @property {string} [type] - The type of the error.
@@ -575,18 +606,6 @@ export = LogisticsPartnerModel;
575
606
  * @property {string} stage - A string indicating the current stage of the scheme.
576
607
  * @property {CourierPartnerSchemeFeatures} feature
577
608
  */
578
- /**
579
- * @typedef CourierPartnerSchemeDefaultTat
580
- * @property {boolean} [enabled] - Indicates whether the default turn around
581
- * time (tat) to be used for the given scheme or not.
582
- * @property {CourierPartnerSchemeTat} [tat]
583
- */
584
- /**
585
- * @typedef CourierPartnerSchemeTat
586
- * @property {number} [min] - Minimum turn around time (tat) value for a scheme.
587
- * @property {number} [max] - Maximum turn around time (tat) value for a scheme.
588
- * @property {string} [unit] - Unit for the turn around time (tat) values for a scheme.
589
- */
590
609
  /**
591
610
  * @typedef GetCountriesItems
592
611
  * @property {string} [id] - A string serving as the unique identifier.
@@ -633,7 +652,7 @@ export = LogisticsPartnerModel;
633
652
  declare class LogisticsPartnerModel {
634
653
  }
635
654
  declare namespace LogisticsPartnerModel {
636
- export { CourierPartnerSchemeModelSchema, BulkRegionServiceabilityTatDetails, BulkRegionServiceabilityTatResultItemData, CommonErrorResult, BulkFailureResult, FailureResult, BulkRegionServiceabilityTatResult, RegionTatItemResult, RegionServiceabilityItemResult, ServiceabilityDetailsResult, ServiceabilityDetails, RegionServiceabilityResult, RegionServiceabilityDetails, RegionTatDetails, RegionTatResult, BulkRegionJobDetails, BulkRegionResultItemData, BulkRegionResult, CourierAccountDetailsBody, CompanyCourierPartnerAccountListResult, CourierAccountResult, CourierPartnerSchemeDetailsModel, CourierPartnerPutSchema, CourierPartnerSchemeList, CourierPartnerSchemeUpdateDetails, GetCountries, TATUpdateDetails, StandardError, ValidationErrors, CreatedBy, ModifiedBy, ArithmeticOperations, CourierPartnerSchemeFeatures, Error, Page, TATDetails, CourierPartnerSchemeModel, CourierPartnerSchemeDefaultTat, CourierPartnerSchemeTat, GetCountriesItems, HierarchyItems, CurrencyObject, ValidationError };
655
+ export { CourierPartnerSchemeModelSchema, BulkRegionServiceabilityTatDetails, BulkRegionServiceabilityTatResultItemData, CommonErrorResult, BulkFailureResult, FailureResult, BulkRegionServiceabilityTatResult, RegionTatItemResult, RegionServiceabilityItemResult, ServiceabilityDetailsResult, ServiceabilityDetails, RegionServiceabilityResult, RegionServiceabilityDetails, RegionTatDetails, RegionTatResult, BulkRegionJobDetails, BulkRegionResultItemData, BulkRegionResult, CourierAccountDetailsBody, CompanyCourierPartnerAccountListResult, CourierAccountResult, CourierPartnerSchemeDetailsModel, CourierPartnerPutSchema, CourierPartnerSchemeList, CourierPartnerSchemeUpdateDetails, GetCountries, TATUpdateDetails, StandardError, ValidationErrors, CreatedBy, ModifiedBy, ArithmeticOperations, CourierPartnerSchemeFeatures, CourierPartnerSchemeDefaultTat, CourierPartnerSchemeTat, Error, Page, TATDetails, CourierPartnerSchemeModel, GetCountriesItems, HierarchyItems, CurrencyObject, ValidationError };
637
656
  }
638
657
  /** @returns {CourierPartnerSchemeModelSchema} */
639
658
  declare function CourierPartnerSchemeModelSchema(): CourierPartnerSchemeModelSchema;
@@ -713,6 +732,21 @@ type CourierPartnerSchemeModelSchema = {
713
732
  */
714
733
  non_qc_shipment_item_quantity?: number;
715
734
  feature: CourierPartnerSchemeFeatures;
735
+ /**
736
+ * - Default cutoff time for
737
+ * forward pickup (nullable), having 24hour time format HH:MM.
738
+ */
739
+ default_forward_pickup_cutoff?: string;
740
+ /**
741
+ * - Default cutoff time for
742
+ * reverse pickup (nullable), having 24hour time format HH:MM.
743
+ */
744
+ default_reverse_pickup_cutoff?: string;
745
+ /**
746
+ * - Timezone for default cutoff time.
747
+ */
748
+ default_cutoff_timezone?: string;
749
+ default_tat?: CourierPartnerSchemeDefaultTat;
716
750
  };
717
751
  /** @returns {BulkRegionServiceabilityTatDetails} */
718
752
  declare function BulkRegionServiceabilityTatDetails(): BulkRegionServiceabilityTatDetails;
@@ -1496,14 +1530,18 @@ type CourierPartnerSchemeDetailsModel = {
1496
1530
  name: string;
1497
1531
  /**
1498
1532
  * - Default cutoff time for
1499
- * forward pickup (nullable).
1533
+ * forward pickup (nullable), having 24hour time format HH:MM.
1500
1534
  */
1501
1535
  default_forward_pickup_cutoff?: string;
1502
1536
  /**
1503
1537
  * - Default cutoff time for
1504
- * reverse pickup (nullable).
1538
+ * reverse pickup (nullable), having 24hour time format HH:MM.
1505
1539
  */
1506
1540
  default_reverse_pickup_cutoff?: string;
1541
+ /**
1542
+ * - Timezone for default cutoff time.
1543
+ */
1544
+ default_cutoff_timezone?: string;
1507
1545
  default_tat?: CourierPartnerSchemeDefaultTat;
1508
1546
  weight: ArithmeticOperations;
1509
1547
  volumetric_weight?: ArithmeticOperations;
@@ -1631,6 +1669,21 @@ type CourierPartnerPutSchema = {
1631
1669
  */
1632
1670
  non_qc_shipment_item_quantity?: number;
1633
1671
  feature: CourierPartnerSchemeFeatures;
1672
+ /**
1673
+ * - Default cutoff time for
1674
+ * forward pickup (nullable), having 24hour time format HH:MM.
1675
+ */
1676
+ default_forward_pickup_cutoff?: string;
1677
+ /**
1678
+ * - Default cutoff time for
1679
+ * reverse pickup (nullable), having 24hour time format HH:MM.
1680
+ */
1681
+ default_reverse_pickup_cutoff?: string;
1682
+ /**
1683
+ * - Timezone for default cutoff time.
1684
+ */
1685
+ default_cutoff_timezone?: string;
1686
+ default_tat?: CourierPartnerSchemeDefaultTat;
1634
1687
  };
1635
1688
  /** @returns {CourierPartnerSchemeList} */
1636
1689
  declare function CourierPartnerSchemeList(): CourierPartnerSchemeList;
@@ -1696,6 +1749,21 @@ type CourierPartnerSchemeUpdateDetails = {
1696
1749
  */
1697
1750
  non_qc_shipment_item_quantity?: number;
1698
1751
  feature: CourierPartnerSchemeFeatures;
1752
+ /**
1753
+ * - Default cutoff time for
1754
+ * forward pickup (nullable), having 24hour time format HH:MM.
1755
+ */
1756
+ default_forward_pickup_cutoff?: string;
1757
+ /**
1758
+ * - Default cutoff time for
1759
+ * reverse pickup (nullable), having 24hour time format HH:MM.
1760
+ */
1761
+ default_reverse_pickup_cutoff?: string;
1762
+ /**
1763
+ * - Timezone for default cutoff time.
1764
+ */
1765
+ default_cutoff_timezone?: string;
1766
+ default_tat?: CourierPartnerSchemeDefaultTat;
1699
1767
  };
1700
1768
  /** @returns {GetCountries} */
1701
1769
  declare function GetCountries(): GetCountries;
@@ -1884,6 +1952,32 @@ type CourierPartnerSchemeFeatures = {
1884
1952
  */
1885
1953
  non_qc_shipment_item_quantity?: number;
1886
1954
  };
1955
+ /** @returns {CourierPartnerSchemeDefaultTat} */
1956
+ declare function CourierPartnerSchemeDefaultTat(): CourierPartnerSchemeDefaultTat;
1957
+ type CourierPartnerSchemeDefaultTat = {
1958
+ /**
1959
+ * - Indicates whether the default turn around
1960
+ * time (tat) to be used for the given scheme or not.
1961
+ */
1962
+ enabled?: boolean;
1963
+ tat?: CourierPartnerSchemeTat;
1964
+ };
1965
+ /** @returns {CourierPartnerSchemeTat} */
1966
+ declare function CourierPartnerSchemeTat(): CourierPartnerSchemeTat;
1967
+ type CourierPartnerSchemeTat = {
1968
+ /**
1969
+ * - Minimum turn around time (tat) value for a scheme.
1970
+ */
1971
+ min?: number;
1972
+ /**
1973
+ * - Maximum turn around time (tat) value for a scheme.
1974
+ */
1975
+ max?: number;
1976
+ /**
1977
+ * - Unit for the turn around time (tat) values for a scheme.
1978
+ */
1979
+ unit?: string;
1980
+ };
1887
1981
  /** @returns {Error} */
1888
1982
  declare function Error(): Error;
1889
1983
  type Error = {
@@ -1992,32 +2086,6 @@ type CourierPartnerSchemeModel = {
1992
2086
  stage: string;
1993
2087
  feature: CourierPartnerSchemeFeatures;
1994
2088
  };
1995
- /** @returns {CourierPartnerSchemeDefaultTat} */
1996
- declare function CourierPartnerSchemeDefaultTat(): CourierPartnerSchemeDefaultTat;
1997
- type CourierPartnerSchemeDefaultTat = {
1998
- /**
1999
- * - Indicates whether the default turn around
2000
- * time (tat) to be used for the given scheme or not.
2001
- */
2002
- enabled?: boolean;
2003
- tat?: CourierPartnerSchemeTat;
2004
- };
2005
- /** @returns {CourierPartnerSchemeTat} */
2006
- declare function CourierPartnerSchemeTat(): CourierPartnerSchemeTat;
2007
- type CourierPartnerSchemeTat = {
2008
- /**
2009
- * - Minimum turn around time (tat) value for a scheme.
2010
- */
2011
- min?: number;
2012
- /**
2013
- * - Maximum turn around time (tat) value for a scheme.
2014
- */
2015
- max?: number;
2016
- /**
2017
- * - Unit for the turn around time (tat) values for a scheme.
2018
- */
2019
- unit?: string;
2020
- };
2021
2089
  /** @returns {GetCountriesItems} */
2022
2090
  declare function GetCountriesItems(): GetCountriesItems;
2023
2091
  type GetCountriesItems = {
@@ -32,6 +32,12 @@ const Joi = require("joi");
32
32
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
33
33
  * quantity of items allowed in a non-quality check shipment.
34
34
  * @property {CourierPartnerSchemeFeatures} feature
35
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
36
+ * forward pickup (nullable), having 24hour time format HH:MM.
37
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
38
+ * reverse pickup (nullable), having 24hour time format HH:MM.
39
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
40
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
35
41
  */
36
42
 
37
43
  /**
@@ -382,9 +388,10 @@ const Joi = require("joi");
382
388
  * fetch or modify scheme details.
383
389
  * @property {string} name - Name of the scheme.
384
390
  * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
385
- * forward pickup (nullable).
391
+ * forward pickup (nullable), having 24hour time format HH:MM.
386
392
  * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
387
- * reverse pickup (nullable).
393
+ * reverse pickup (nullable), having 24hour time format HH:MM.
394
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
388
395
  * @property {CourierPartnerSchemeDefaultTat} [default_tat]
389
396
  * @property {ArithmeticOperations} weight
390
397
  * @property {ArithmeticOperations} [volumetric_weight]
@@ -440,6 +447,12 @@ const Joi = require("joi");
440
447
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
441
448
  * quantity of items allowed in a non-quality check shipment.
442
449
  * @property {CourierPartnerSchemeFeatures} feature
450
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
451
+ * forward pickup (nullable), having 24hour time format HH:MM.
452
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
453
+ * reverse pickup (nullable), having 24hour time format HH:MM.
454
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
455
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
443
456
  */
444
457
 
445
458
  /**
@@ -472,6 +485,12 @@ const Joi = require("joi");
472
485
  * @property {number} [non_qc_shipment_item_quantity] - Defines the maximum
473
486
  * quantity of items allowed in a non-quality check shipment.
474
487
  * @property {CourierPartnerSchemeFeatures} feature
488
+ * @property {string} [default_forward_pickup_cutoff] - Default cutoff time for
489
+ * forward pickup (nullable), having 24hour time format HH:MM.
490
+ * @property {string} [default_reverse_pickup_cutoff] - Default cutoff time for
491
+ * reverse pickup (nullable), having 24hour time format HH:MM.
492
+ * @property {string} [default_cutoff_timezone] - Timezone for default cutoff time.
493
+ * @property {CourierPartnerSchemeDefaultTat} [default_tat]
475
494
  */
476
495
 
477
496
  /**
@@ -568,6 +587,20 @@ const Joi = require("joi");
568
587
  * quantity of items allowed in a non-quality check shipment.
569
588
  */
570
589
 
590
+ /**
591
+ * @typedef CourierPartnerSchemeDefaultTat
592
+ * @property {boolean} [enabled] - Indicates whether the default turn around
593
+ * time (tat) to be used for the given scheme or not.
594
+ * @property {CourierPartnerSchemeTat} [tat]
595
+ */
596
+
597
+ /**
598
+ * @typedef CourierPartnerSchemeTat
599
+ * @property {number} [min] - Minimum turn around time (tat) value for a scheme.
600
+ * @property {number} [max] - Maximum turn around time (tat) value for a scheme.
601
+ * @property {string} [unit] - Unit for the turn around time (tat) values for a scheme.
602
+ */
603
+
571
604
  /**
572
605
  * @typedef Error
573
606
  * @property {string} [type] - The type of the error.
@@ -613,20 +646,6 @@ const Joi = require("joi");
613
646
  * @property {CourierPartnerSchemeFeatures} feature
614
647
  */
615
648
 
616
- /**
617
- * @typedef CourierPartnerSchemeDefaultTat
618
- * @property {boolean} [enabled] - Indicates whether the default turn around
619
- * time (tat) to be used for the given scheme or not.
620
- * @property {CourierPartnerSchemeTat} [tat]
621
- */
622
-
623
- /**
624
- * @typedef CourierPartnerSchemeTat
625
- * @property {number} [min] - Minimum turn around time (tat) value for a scheme.
626
- * @property {number} [max] - Maximum turn around time (tat) value for a scheme.
627
- * @property {string} [unit] - Unit for the turn around time (tat) values for a scheme.
628
- */
629
-
630
649
  /**
631
650
  * @typedef GetCountriesItems
632
651
  * @property {string} [id] - A string serving as the unique identifier.
@@ -698,6 +717,10 @@ class LogisticsPartnerModel {
698
717
  qc_shipment_item_quantity: Joi.number().allow(null),
699
718
  non_qc_shipment_item_quantity: Joi.number().allow(null),
700
719
  feature: LogisticsPartnerModel.CourierPartnerSchemeFeatures().required(),
720
+ default_forward_pickup_cutoff: Joi.string().allow("").allow(null),
721
+ default_reverse_pickup_cutoff: Joi.string().allow("").allow(null),
722
+ default_cutoff_timezone: Joi.string().allow("").allow(null),
723
+ default_tat: LogisticsPartnerModel.CourierPartnerSchemeDefaultTat(),
701
724
  });
702
725
  }
703
726
 
@@ -990,6 +1013,7 @@ class LogisticsPartnerModel {
990
1013
  name: Joi.string().allow("").required(),
991
1014
  default_forward_pickup_cutoff: Joi.string().allow("").allow(null),
992
1015
  default_reverse_pickup_cutoff: Joi.string().allow("").allow(null),
1016
+ default_cutoff_timezone: Joi.string().allow("").allow(null),
993
1017
  default_tat: LogisticsPartnerModel.CourierPartnerSchemeDefaultTat(),
994
1018
  weight: LogisticsPartnerModel.ArithmeticOperations().required(),
995
1019
  volumetric_weight: LogisticsPartnerModel.ArithmeticOperations(),
@@ -1029,6 +1053,10 @@ class LogisticsPartnerModel {
1029
1053
  qc_shipment_item_quantity: Joi.number().allow(null),
1030
1054
  non_qc_shipment_item_quantity: Joi.number().allow(null),
1031
1055
  feature: LogisticsPartnerModel.CourierPartnerSchemeFeatures().required(),
1056
+ default_forward_pickup_cutoff: Joi.string().allow("").allow(null),
1057
+ default_reverse_pickup_cutoff: Joi.string().allow("").allow(null),
1058
+ default_cutoff_timezone: Joi.string().allow("").allow(null),
1059
+ default_tat: LogisticsPartnerModel.CourierPartnerSchemeDefaultTat(),
1032
1060
  });
1033
1061
  }
1034
1062
 
@@ -1058,6 +1086,10 @@ class LogisticsPartnerModel {
1058
1086
  qc_shipment_item_quantity: Joi.number().allow(null),
1059
1087
  non_qc_shipment_item_quantity: Joi.number().allow(null),
1060
1088
  feature: LogisticsPartnerModel.CourierPartnerSchemeFeatures().required(),
1089
+ default_forward_pickup_cutoff: Joi.string().allow("").allow(null),
1090
+ default_reverse_pickup_cutoff: Joi.string().allow("").allow(null),
1091
+ default_cutoff_timezone: Joi.string().allow("").allow(null),
1092
+ default_tat: LogisticsPartnerModel.CourierPartnerSchemeDefaultTat(),
1061
1093
  });
1062
1094
  }
1063
1095
 
@@ -1147,6 +1179,23 @@ class LogisticsPartnerModel {
1147
1179
  });
1148
1180
  }
1149
1181
 
1182
+ /** @returns {CourierPartnerSchemeDefaultTat} */
1183
+ static CourierPartnerSchemeDefaultTat() {
1184
+ return Joi.object({
1185
+ enabled: Joi.boolean(),
1186
+ tat: LogisticsPartnerModel.CourierPartnerSchemeTat(),
1187
+ });
1188
+ }
1189
+
1190
+ /** @returns {CourierPartnerSchemeTat} */
1191
+ static CourierPartnerSchemeTat() {
1192
+ return Joi.object({
1193
+ min: Joi.number(),
1194
+ max: Joi.number(),
1195
+ unit: Joi.string().allow(""),
1196
+ });
1197
+ }
1198
+
1150
1199
  /** @returns {Error} */
1151
1200
  static Error() {
1152
1201
  return Joi.object({
@@ -1195,23 +1244,6 @@ class LogisticsPartnerModel {
1195
1244
  });
1196
1245
  }
1197
1246
 
1198
- /** @returns {CourierPartnerSchemeDefaultTat} */
1199
- static CourierPartnerSchemeDefaultTat() {
1200
- return Joi.object({
1201
- enabled: Joi.boolean(),
1202
- tat: LogisticsPartnerModel.CourierPartnerSchemeTat(),
1203
- });
1204
- }
1205
-
1206
- /** @returns {CourierPartnerSchemeTat} */
1207
- static CourierPartnerSchemeTat() {
1208
- return Joi.object({
1209
- min: Joi.number(),
1210
- max: Joi.number(),
1211
- unit: Joi.string().allow(""),
1212
- });
1213
- }
1214
-
1215
1247
  /** @returns {GetCountriesItems} */
1216
1248
  static GetCountriesItems() {
1217
1249
  return Joi.object({
@@ -11,8 +11,8 @@ declare class PartnerClient {
11
11
  * @param {import("./PartnerConfig")} config - The configuration for the
12
12
  * partner client.
13
13
  */
14
- constructor(config: import("./PartnerConfig"));
15
- config: import("./PartnerConfig");
14
+ constructor(config: import("./PartnerConfig"), options: any);
15
+ config: PartnerConfig;
16
16
  fileStorage: FileStorage;
17
17
  lead: Lead;
18
18
  logistics: Logistics;
@@ -33,7 +33,10 @@ declare class PartnerClient {
33
33
  headers: any;
34
34
  responseHeaders?: boolean;
35
35
  }): Promise<import("axios").AxiosResponse<any, any>>;
36
+ getAccesstokenObj(options: any): Promise<import("axios").AxiosResponse<any, any>>;
37
+ setToken(token: any): void;
36
38
  }
39
+ import PartnerConfig = require("./PartnerConfig");
37
40
  import FileStorage = require("./FileStorage/FileStoragePartnerClient");
38
41
  import Lead = require("./Lead/LeadPartnerClient");
39
42
  import Logistics = require("./Logistics/LogisticsPartnerClient");