@gofynd/fdk-client-javascript 1.4.8-beta.3 → 1.4.8
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.
- package/README.md +26 -1
- package/package.json +2 -2
- package/sdk/application/ApplicationClient.d.ts +8 -0
- package/sdk/application/ApplicationClient.js +14 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +20 -20
- package/sdk/application/Cart/CartApplicationClient.js +20 -20
- package/sdk/application/Cart/CartApplicationModel.d.ts +2446 -664
- package/sdk/application/Cart/CartApplicationModel.js +783 -552
- package/sdk/application/Cart/CartApplicationValidator.d.ts +268 -194
- package/sdk/application/Cart/CartApplicationValidator.js +100 -114
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +53 -53
- package/sdk/application/Catalog/CatalogApplicationClient.js +53 -53
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2012 -503
- package/sdk/application/Catalog/CatalogApplicationModel.js +603 -453
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +64 -64
- package/sdk/application/Catalog/CatalogApplicationValidator.js +32 -32
- package/sdk/application/Common/CommonApplicationClient.d.ts +2 -2
- package/sdk/application/Common/CommonApplicationClient.js +2 -2
- package/sdk/application/Common/CommonApplicationModel.d.ts +170 -90
- package/sdk/application/Common/CommonApplicationModel.js +59 -58
- package/sdk/application/Common/CommonApplicationValidator.d.ts +8 -5
- package/sdk/application/Common/CommonApplicationValidator.js +3 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +2 -2
- package/sdk/application/Communication/CommunicationApplicationClient.js +2 -2
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +170 -35
- package/sdk/application/Communication/CommunicationApplicationModel.js +54 -33
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +15 -15
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +15 -15
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +624 -443
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +259 -248
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +32 -24
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +14 -13
- package/sdk/application/Content/ContentApplicationClient.d.ts +16 -16
- package/sdk/application/Content/ContentApplicationClient.js +16 -16
- package/sdk/application/Content/ContentApplicationModel.d.ts +1205 -282
- package/sdk/application/Content/ContentApplicationModel.js +341 -277
- package/sdk/application/Content/ContentApplicationValidator.d.ts +28 -17
- package/sdk/application/Content/ContentApplicationValidator.js +11 -10
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +3 -3
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +146 -37
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +38 -36
- package/sdk/application/Lead/LeadApplicationClient.d.ts +3 -3
- package/sdk/application/Lead/LeadApplicationClient.js +3 -3
- package/sdk/application/Lead/LeadApplicationModel.d.ts +195 -134
- package/sdk/application/Lead/LeadApplicationModel.js +110 -67
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +8 -8
- package/sdk/application/Lead/LeadApplicationValidator.js +4 -4
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +10 -10
- package/sdk/application/Logistic/LogisticApplicationClient.js +10 -10
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +1039 -221
- package/sdk/application/Logistic/LogisticApplicationModel.js +342 -199
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +76 -82
- package/sdk/application/Logistic/LogisticApplicationValidator.js +38 -41
- package/sdk/application/Order/OrderApplicationClient.d.ts +10 -10
- package/sdk/application/Order/OrderApplicationClient.js +10 -10
- package/sdk/application/Order/OrderApplicationModel.d.ts +1400 -325
- package/sdk/application/Order/OrderApplicationModel.js +391 -317
- package/sdk/application/Order/OrderApplicationValidator.d.ts +32 -30
- package/sdk/application/Order/OrderApplicationValidator.js +15 -14
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +43 -43
- package/sdk/application/Payment/PaymentApplicationClient.js +43 -43
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +1111 -1022
- package/sdk/application/Payment/PaymentApplicationModel.js +537 -521
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +82 -49
- package/sdk/application/Payment/PaymentApplicationValidator.js +30 -30
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +28 -7
- package/sdk/application/Rewards/RewardsApplicationModel.js +7 -7
- package/sdk/application/Share/ShareApplicationModel.d.ts +178 -38
- package/sdk/application/Share/ShareApplicationModel.js +53 -37
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -2
- package/sdk/application/Share/ShareApplicationValidator.js +2 -1
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +4 -4
- package/sdk/application/Theme/ThemeApplicationClient.js +14 -8
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +528 -287
- package/sdk/application/Theme/ThemeApplicationModel.js +208 -172
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +17 -12
- package/sdk/application/Theme/ThemeApplicationValidator.js +8 -6
- package/sdk/application/User/UserApplicationClient.d.ts +36 -36
- package/sdk/application/User/UserApplicationClient.js +36 -36
- package/sdk/application/User/UserApplicationModel.d.ts +1062 -255
- package/sdk/application/User/UserApplicationModel.js +298 -244
- package/sdk/application/User/UserApplicationValidator.d.ts +80 -80
- package/sdk/application/User/UserApplicationValidator.js +40 -40
- package/sdk/application/Webhook/WebhookApplicationClient.d.ts +1 -1
- package/sdk/application/Webhook/WebhookApplicationClient.js +1 -1
- package/sdk/application/Webhook/WebhookApplicationModel.d.ts +20 -5
- package/sdk/application/Webhook/WebhookApplicationModel.js +5 -5
- package/sdk/common/Clickstream.js +95 -15
- package/sdk/common/Constant.d.ts +9 -0
- package/sdk/common/Constant.js +11 -0
- package/sdk/common/Utility.js +19 -0
- package/sdk/common/utils.js +8 -1
- package/sdk/partner/Lead/LeadPartnerModel.d.ts +28 -7
- package/sdk/partner/Lead/LeadPartnerModel.js +7 -7
- package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +28 -7
- package/sdk/partner/Logistics/LogisticsPartnerModel.js +7 -7
- package/sdk/partner/PartnerClient.d.ts +8 -0
- package/sdk/partner/PartnerClient.js +14 -0
- package/sdk/partner/Theme/ThemePartnerClient.d.ts +20 -0
- package/sdk/partner/Theme/ThemePartnerClient.js +158 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +45 -6
- package/sdk/partner/Theme/ThemePartnerModel.js +33 -4
- package/sdk/partner/Theme/ThemePartnerValidator.d.ts +2 -0
- package/sdk/partner/Theme/ThemePartnerValidator.js +14 -0
- package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +28 -7
- package/sdk/partner/Webhook/WebhookPartnerModel.js +7 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +28 -7
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +7 -7
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +21 -10
- package/sdk/platform/Billing/BillingPlatformClient.js +167 -83
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +2849 -565
- package/sdk/platform/Billing/BillingPlatformModel.js +935 -556
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +30 -14
- package/sdk/platform/Billing/BillingPlatformValidator.js +31 -16
- package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -7
- package/sdk/platform/Cart/CartPlatformModel.js +8 -8
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +12 -2
- package/sdk/platform/Catalog/CatalogPlatformClient.js +41 -1
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +46 -12
- package/sdk/platform/Catalog/CatalogPlatformModel.js +14 -11
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +17 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +28 -7
- package/sdk/platform/Communication/CommunicationPlatformModel.js +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +7 -7
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +0 -97
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +77 -782
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +24 -701
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +7 -539
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +1 -183
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +0 -134
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +0 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +0 -79
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +1 -15
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +0 -13
- package/sdk/platform/Content/ContentPlatformModel.d.ts +58 -17
- package/sdk/platform/Content/ContentPlatformModel.js +28 -15
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +28 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +7 -7
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +127 -25
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +37 -25
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +28 -28
- package/sdk/platform/Finance/FinancePlatformClient.js +28 -28
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +1583 -347
- package/sdk/platform/Finance/FinancePlatformModel.js +463 -351
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +28 -7
- package/sdk/platform/Lead/LeadPlatformModel.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +22 -0
- package/sdk/platform/Order/OrderPlatformClient.js +165 -0
- package/sdk/platform/Order/OrderPlatformModel.d.ts +613 -39
- package/sdk/platform/Order/OrderPlatformModel.js +359 -41
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -1
- package/sdk/platform/Order/OrderPlatformValidator.js +28 -0
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +30 -9
- package/sdk/platform/Payment/PaymentPlatformModel.js +9 -9
- package/sdk/platform/PlatformClient.d.ts +8 -0
- package/sdk/platform/PlatformClient.js +14 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +28 -7
- package/sdk/platform/Rewards/RewardsPlatformModel.js +7 -7
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +12 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +12 -9
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +120 -22
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +76 -21
- package/sdk/platform/Share/SharePlatformModel.d.ts +28 -7
- package/sdk/platform/Share/SharePlatformModel.js +7 -7
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +18 -5
- package/sdk/platform/Theme/ThemePlatformModel.js +7 -4
- package/sdk/platform/User/UserPlatformModel.d.ts +18 -18
- package/sdk/platform/User/UserPlatformModel.js +9 -9
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +28 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +7 -7
- package/sdk/public/Billing/BillingPublicClient.d.ts +11 -0
- package/sdk/public/Billing/BillingPublicClient.js +80 -0
- package/sdk/public/Billing/BillingPublicModel.d.ts +584 -99
- package/sdk/public/Billing/BillingPublicModel.js +252 -87
- package/sdk/public/Billing/BillingPublicValidator.d.ts +10 -1
- package/sdk/public/Billing/BillingPublicValidator.js +12 -0
- package/sdk/public/PublicClient.d.ts +0 -2
- package/sdk/public/PublicClient.js +0 -4
- package/sdk/public/index.d.ts +0 -1
- package/sdk/public/index.js +0 -2
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +0 -87
- package/sdk/public/Inventory/InventoryPublicClient.js +0 -529
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +0 -393
- package/sdk/public/Inventory/InventoryPublicModel.js +0 -448
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +0 -91
- package/sdk/public/Inventory/InventoryPublicValidator.js +0 -85
|
@@ -40,13 +40,13 @@ export = LeadPlatformModel;
|
|
|
40
40
|
*/
|
|
41
41
|
/**
|
|
42
42
|
* @typedef Page
|
|
43
|
-
* @property {number} [item_total]
|
|
44
|
-
* @property {string} [next_id]
|
|
45
|
-
* @property {boolean} [has_previous]
|
|
46
|
-
* @property {boolean} [has_next]
|
|
47
|
-
* @property {number} [current]
|
|
48
|
-
* @property {string} type
|
|
49
|
-
* @property {number} [size]
|
|
43
|
+
* @property {number} [item_total] - The total number of items on the page.
|
|
44
|
+
* @property {string} [next_id] - The identifier for the next page.
|
|
45
|
+
* @property {boolean} [has_previous] - Indicates whether there is a previous page.
|
|
46
|
+
* @property {boolean} [has_next] - Indicates whether there is a next page.
|
|
47
|
+
* @property {number} [current] - The current page number.
|
|
48
|
+
* @property {string} type - The type of the page, such as 'PageType'.
|
|
49
|
+
* @property {number} [size] - The number of items per page.
|
|
50
50
|
*/
|
|
51
51
|
/**
|
|
52
52
|
* @typedef TicketHistoryList
|
|
@@ -340,12 +340,33 @@ type TicketList = {
|
|
|
340
340
|
/** @returns {Page} */
|
|
341
341
|
declare function Page(): Page;
|
|
342
342
|
type Page = {
|
|
343
|
+
/**
|
|
344
|
+
* - The total number of items on the page.
|
|
345
|
+
*/
|
|
343
346
|
item_total?: number;
|
|
347
|
+
/**
|
|
348
|
+
* - The identifier for the next page.
|
|
349
|
+
*/
|
|
344
350
|
next_id?: string;
|
|
351
|
+
/**
|
|
352
|
+
* - Indicates whether there is a previous page.
|
|
353
|
+
*/
|
|
345
354
|
has_previous?: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* - Indicates whether there is a next page.
|
|
357
|
+
*/
|
|
346
358
|
has_next?: boolean;
|
|
359
|
+
/**
|
|
360
|
+
* - The current page number.
|
|
361
|
+
*/
|
|
347
362
|
current?: number;
|
|
363
|
+
/**
|
|
364
|
+
* - The type of the page, such as 'PageType'.
|
|
365
|
+
*/
|
|
348
366
|
type: string;
|
|
367
|
+
/**
|
|
368
|
+
* - The number of items per page.
|
|
369
|
+
*/
|
|
349
370
|
size?: number;
|
|
350
371
|
};
|
|
351
372
|
/** @returns {TicketHistoryList} */
|
|
@@ -46,13 +46,13 @@ const Joi = require("joi");
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* @typedef Page
|
|
49
|
-
* @property {number} [item_total]
|
|
50
|
-
* @property {string} [next_id]
|
|
51
|
-
* @property {boolean} [has_previous]
|
|
52
|
-
* @property {boolean} [has_next]
|
|
53
|
-
* @property {number} [current]
|
|
54
|
-
* @property {string} type
|
|
55
|
-
* @property {number} [size]
|
|
49
|
+
* @property {number} [item_total] - The total number of items on the page.
|
|
50
|
+
* @property {string} [next_id] - The identifier for the next page.
|
|
51
|
+
* @property {boolean} [has_previous] - Indicates whether there is a previous page.
|
|
52
|
+
* @property {boolean} [has_next] - Indicates whether there is a next page.
|
|
53
|
+
* @property {number} [current] - The current page number.
|
|
54
|
+
* @property {string} type - The type of the page, such as 'PageType'.
|
|
55
|
+
* @property {number} [size] - The number of items per page.
|
|
56
56
|
*/
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -2,6 +2,16 @@ export = Order;
|
|
|
2
2
|
declare class Order {
|
|
3
3
|
constructor(config: any);
|
|
4
4
|
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {OrderPlatformValidator.AddStateManagerConfigParam} arg - Arg object
|
|
7
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
8
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
9
|
+
* @returns {Promise<OrderPlatformModel.ConfigUpdatedResponse>} - Success response
|
|
10
|
+
* @name addStateManagerConfig
|
|
11
|
+
* @summary: Allows esm config updation
|
|
12
|
+
* @description: Update ESM config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/addStateManagerConfig/).
|
|
13
|
+
*/
|
|
14
|
+
addStateManagerConfig({ body, requestHeaders }?: OrderPlatformValidator.AddStateManagerConfigParam, { responseHeaders }?: object): Promise<OrderPlatformModel.ConfigUpdatedResponse>;
|
|
5
15
|
/**
|
|
6
16
|
* @param {OrderPlatformValidator.AttachOrderUserParam} arg - Arg object
|
|
7
17
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -385,6 +395,18 @@ declare class Order {
|
|
|
385
395
|
* @description: Get a list of shipments based on the filters provided - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getShipments/).
|
|
386
396
|
*/
|
|
387
397
|
getShipments({ lane, bagStatus, statusOverrideLane, timeToDispatch, searchType, searchValue, fromDate, toDate, startDate, endDate, dpIds, stores, salesChannels, pageNo, pageSize, fetchActiveShipment, allowInactive, excludeLockedShipments, paymentMethods, channelShipmentId, channelOrderId, customMeta, orderingChannel, companyAffiliateTag, myOrders, platformUserId, sortType, showCrossCompanyData, tags, customerId, orderType, requestHeaders, }?: OrderPlatformValidator.GetShipmentsParam, { responseHeaders }?: object): Promise<OrderPlatformModel.ShipmentInternalPlatformViewResponse>;
|
|
398
|
+
/**
|
|
399
|
+
* @param {OrderPlatformValidator.GetStateManagerConfigParam} arg - Arg object
|
|
400
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
401
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
402
|
+
* @returns {Promise<Object>} - Success response
|
|
403
|
+
* @name getStateManagerConfig
|
|
404
|
+
* @summary: Retrieves Entity State Manager configuration which includes flags, hooks, and filters, for a specific application within a company's setup.
|
|
405
|
+
* @description: This endpoint retrieves the ESM (Entity State Manager) configuration for a specific application within a company. The retrieval is based on parameters such as application ID, ordering channel, and entity type.
|
|
406
|
+
* The ESM config stores order processing configuration. Each document in the ESM config collection of Order Management System - OMS's database is a JSON object representing the configuration of a specific application ID. This includes filters, hooks, flags set on different state-transitions. This configuration is picked and accordingly features are enabled.
|
|
407
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateManagerConfig/).
|
|
408
|
+
*/
|
|
409
|
+
getStateManagerConfig({ appId, orderingChannel, entity, requestHeaders }?: OrderPlatformValidator.GetStateManagerConfigParam, { responseHeaders }?: object): Promise<any>;
|
|
388
410
|
/**
|
|
389
411
|
* @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
|
|
390
412
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -14,6 +14,85 @@ class Order {
|
|
|
14
14
|
this.config = config;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {OrderPlatformValidator.AddStateManagerConfigParam} arg - Arg object
|
|
19
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
20
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
21
|
+
* @returns {Promise<OrderPlatformModel.ConfigUpdatedResponse>} - Success response
|
|
22
|
+
* @name addStateManagerConfig
|
|
23
|
+
* @summary: Allows esm config updation
|
|
24
|
+
* @description: Update ESM config - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/addStateManagerConfig/).
|
|
25
|
+
*/
|
|
26
|
+
async addStateManagerConfig(
|
|
27
|
+
{ body, requestHeaders } = { requestHeaders: {} },
|
|
28
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
29
|
+
) {
|
|
30
|
+
const { error } = OrderPlatformValidator.addStateManagerConfig().validate(
|
|
31
|
+
{
|
|
32
|
+
body,
|
|
33
|
+
},
|
|
34
|
+
{ abortEarly: false, allowUnknown: true }
|
|
35
|
+
);
|
|
36
|
+
if (error) {
|
|
37
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Showing warrnings if extra unknown parameters are found
|
|
41
|
+
const {
|
|
42
|
+
error: warrning,
|
|
43
|
+
} = OrderPlatformValidator.addStateManagerConfig().validate(
|
|
44
|
+
{
|
|
45
|
+
body,
|
|
46
|
+
},
|
|
47
|
+
{ abortEarly: false, allowUnknown: false }
|
|
48
|
+
);
|
|
49
|
+
if (warrning) {
|
|
50
|
+
Logger({
|
|
51
|
+
level: "WARN",
|
|
52
|
+
message: `Parameter Validation warrnings for platform > Order > addStateManagerConfig \n ${warrning}`,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const query_params = {};
|
|
57
|
+
|
|
58
|
+
const xHeaders = {};
|
|
59
|
+
|
|
60
|
+
const response = await PlatformAPIClient.execute(
|
|
61
|
+
this.config,
|
|
62
|
+
"post",
|
|
63
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/manager/config`,
|
|
64
|
+
query_params,
|
|
65
|
+
body,
|
|
66
|
+
{ ...xHeaders, ...requestHeaders },
|
|
67
|
+
{ responseHeaders }
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
let responseData = response;
|
|
71
|
+
if (responseHeaders) {
|
|
72
|
+
responseData = response[0];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const {
|
|
76
|
+
error: res_error,
|
|
77
|
+
} = OrderPlatformModel.ConfigUpdatedResponse().validate(responseData, {
|
|
78
|
+
abortEarly: false,
|
|
79
|
+
allowUnknown: true,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
if (res_error) {
|
|
83
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
84
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
85
|
+
} else {
|
|
86
|
+
Logger({
|
|
87
|
+
level: "WARN",
|
|
88
|
+
message: `Response Validation Warnings for platform > Order > addStateManagerConfig \n ${res_error}`,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return response;
|
|
94
|
+
}
|
|
95
|
+
|
|
17
96
|
/**
|
|
18
97
|
* @param {OrderPlatformValidator.AttachOrderUserParam} arg - Arg object
|
|
19
98
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
@@ -3474,6 +3553,92 @@ class Order {
|
|
|
3474
3553
|
return response;
|
|
3475
3554
|
}
|
|
3476
3555
|
|
|
3556
|
+
/**
|
|
3557
|
+
* @param {OrderPlatformValidator.GetStateManagerConfigParam} arg - Arg object
|
|
3558
|
+
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|
|
3559
|
+
* @param {import("../PlatformAPIClient").Options} - Options
|
|
3560
|
+
* @returns {Promise<Object>} - Success response
|
|
3561
|
+
* @name getStateManagerConfig
|
|
3562
|
+
* @summary: Retrieves Entity State Manager configuration which includes flags, hooks, and filters, for a specific application within a company's setup.
|
|
3563
|
+
* @description: This endpoint retrieves the ESM (Entity State Manager) configuration for a specific application within a company. The retrieval is based on parameters such as application ID, ordering channel, and entity type.
|
|
3564
|
+
* The ESM config stores order processing configuration. Each document in the ESM config collection of Order Management System - OMS's database is a JSON object representing the configuration of a specific application ID. This includes filters, hooks, flags set on different state-transitions. This configuration is picked and accordingly features are enabled.
|
|
3565
|
+
* - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/platform/order/getStateManagerConfig/).
|
|
3566
|
+
*/
|
|
3567
|
+
async getStateManagerConfig(
|
|
3568
|
+
{ appId, orderingChannel, entity, requestHeaders } = { requestHeaders: {} },
|
|
3569
|
+
{ responseHeaders } = { responseHeaders: false }
|
|
3570
|
+
) {
|
|
3571
|
+
const { error } = OrderPlatformValidator.getStateManagerConfig().validate(
|
|
3572
|
+
{
|
|
3573
|
+
appId,
|
|
3574
|
+
orderingChannel,
|
|
3575
|
+
entity,
|
|
3576
|
+
},
|
|
3577
|
+
{ abortEarly: false, allowUnknown: true }
|
|
3578
|
+
);
|
|
3579
|
+
if (error) {
|
|
3580
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3583
|
+
// Showing warrnings if extra unknown parameters are found
|
|
3584
|
+
const {
|
|
3585
|
+
error: warrning,
|
|
3586
|
+
} = OrderPlatformValidator.getStateManagerConfig().validate(
|
|
3587
|
+
{
|
|
3588
|
+
appId,
|
|
3589
|
+
orderingChannel,
|
|
3590
|
+
entity,
|
|
3591
|
+
},
|
|
3592
|
+
{ abortEarly: false, allowUnknown: false }
|
|
3593
|
+
);
|
|
3594
|
+
if (warrning) {
|
|
3595
|
+
Logger({
|
|
3596
|
+
level: "WARN",
|
|
3597
|
+
message: `Parameter Validation warrnings for platform > Order > getStateManagerConfig \n ${warrning}`,
|
|
3598
|
+
});
|
|
3599
|
+
}
|
|
3600
|
+
|
|
3601
|
+
const query_params = {};
|
|
3602
|
+
query_params["app_id"] = appId;
|
|
3603
|
+
query_params["ordering_channel"] = orderingChannel;
|
|
3604
|
+
query_params["entity"] = entity;
|
|
3605
|
+
|
|
3606
|
+
const xHeaders = {};
|
|
3607
|
+
|
|
3608
|
+
const response = await PlatformAPIClient.execute(
|
|
3609
|
+
this.config,
|
|
3610
|
+
"get",
|
|
3611
|
+
`/service/platform/order-manage/v1.0/company/${this.config.companyId}/state/manager/config`,
|
|
3612
|
+
query_params,
|
|
3613
|
+
undefined,
|
|
3614
|
+
{ ...xHeaders, ...requestHeaders },
|
|
3615
|
+
{ responseHeaders }
|
|
3616
|
+
);
|
|
3617
|
+
|
|
3618
|
+
let responseData = response;
|
|
3619
|
+
if (responseHeaders) {
|
|
3620
|
+
responseData = response[0];
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
const { error: res_error } = Joi.any().validate(responseData, {
|
|
3624
|
+
abortEarly: false,
|
|
3625
|
+
allowUnknown: true,
|
|
3626
|
+
});
|
|
3627
|
+
|
|
3628
|
+
if (res_error) {
|
|
3629
|
+
if (this.config.options.strictResponseCheck === true) {
|
|
3630
|
+
return Promise.reject(new FDKResponseValidationError(res_error));
|
|
3631
|
+
} else {
|
|
3632
|
+
Logger({
|
|
3633
|
+
level: "WARN",
|
|
3634
|
+
message: `Response Validation Warnings for platform > Order > getStateManagerConfig \n ${res_error}`,
|
|
3635
|
+
});
|
|
3636
|
+
}
|
|
3637
|
+
}
|
|
3638
|
+
|
|
3639
|
+
return response;
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3477
3642
|
/**
|
|
3478
3643
|
* @param {OrderPlatformValidator.GetStateTransitionMapParam} arg - Arg object
|
|
3479
3644
|
* @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
|