@gofynd/fdk-client-javascript 1.0.1 → 1.0.3
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/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +562 -1270
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +15266 -17619
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3509 -4121
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3750 -5636
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +1058 -547
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +76 -36
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +581 -213
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
- package/sdk/application/Content/ContentApplicationModel.js +468 -875
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +230 -96
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
- package/sdk/application/Order/OrderApplicationClient.js +448 -215
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +357 -661
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
- package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +221 -96
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +1201 -543
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
- package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
- package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
- package/sdk/platform/Common/CommonPlatformClient.js +80 -37
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
- package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
- package/sdk/platform/Content/ContentPlatformModel.js +486 -867
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
- package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
- package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
- package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
- package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
- package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
- package/sdk/platform/PlatformApplicationClient.js +1584 -13691
- package/sdk/platform/PlatformClient.d.ts +7918 -7666
- package/sdk/platform/PlatformClient.js +8701 -9926
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
- package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
- package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
- package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -2,11 +2,29 @@ export = Webhook;
|
|
|
2
2
|
declare class Webhook {
|
|
3
3
|
constructor(config: any);
|
|
4
4
|
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @returns {Promise<EventConfigResponse>} - Success response
|
|
8
|
+
* @summary:
|
|
9
|
+
* @description: Get All Webhook Events
|
|
10
|
+
*/
|
|
11
|
+
fetchAllEventConfigurations({}?: any): Promise<EventConfigResponse>;
|
|
12
|
+
/**
|
|
13
|
+
* @param {Object} arg - Arg object.
|
|
14
|
+
* @param {number} arg.subscriberId - Subscriber ID
|
|
15
|
+
* @returns {Promise<SubscriberResponse>} - Success response
|
|
16
|
+
* @summary: Get Subscriber By Subscriber ID
|
|
17
|
+
* @description: Get Subscriber By Subscriber ID
|
|
18
|
+
*/
|
|
19
|
+
getSubscriberById({ subscriberId }?: {
|
|
20
|
+
subscriberId: number;
|
|
21
|
+
}): Promise<SubscriberResponse>;
|
|
5
22
|
/**
|
|
6
23
|
* @param {Object} arg - Arg object.
|
|
7
24
|
* @param {number} [arg.pageNo] - Page Number
|
|
8
25
|
* @param {number} [arg.pageSize] - Page Size
|
|
9
26
|
* @param {string} [arg.extensionId] - Extension ID
|
|
27
|
+
* @returns {Promise<SubscriberResponse>} - Success response
|
|
10
28
|
* @summary: Get Subscribers By Company ID
|
|
11
29
|
* @description: Get Subscribers By CompanyId
|
|
12
30
|
*/
|
|
@@ -14,30 +32,13 @@ declare class Webhook {
|
|
|
14
32
|
pageNo?: number;
|
|
15
33
|
pageSize?: number;
|
|
16
34
|
extensionId?: string;
|
|
17
|
-
}): Promise<
|
|
18
|
-
/**
|
|
19
|
-
* @param {Object} arg - Arg object.
|
|
20
|
-
* @param {SubscriberConfig} arg.body
|
|
21
|
-
* @summary: Register Subscriber
|
|
22
|
-
* @description: Register Subscriber
|
|
23
|
-
*/
|
|
24
|
-
registerSubscriberToEvent({ body }?: {
|
|
25
|
-
body: SubscriberConfig;
|
|
26
|
-
}): Promise<any>;
|
|
27
|
-
/**
|
|
28
|
-
* @param {Object} arg - Arg object.
|
|
29
|
-
* @param {SubscriberConfig} arg.body
|
|
30
|
-
* @summary: Update Subscriber
|
|
31
|
-
* @description: Update Subscriber
|
|
32
|
-
*/
|
|
33
|
-
updateSubscriberConfig({ body }?: {
|
|
34
|
-
body: SubscriberConfig;
|
|
35
|
-
}): Promise<any>;
|
|
35
|
+
}): Promise<SubscriberResponse>;
|
|
36
36
|
/**
|
|
37
37
|
* @param {Object} arg - Arg object.
|
|
38
38
|
* @param {number} [arg.pageNo] - Page Number
|
|
39
39
|
* @param {number} [arg.pageSize] - Page Size
|
|
40
40
|
* @param {string} arg.extensionId - Extension ID
|
|
41
|
+
* @returns {Promise<SubscriberConfigList>} - Success response
|
|
41
42
|
* @summary: Get Subscribers By Extension ID
|
|
42
43
|
* @description: Get Subscribers By ExtensionID
|
|
43
44
|
*/
|
|
@@ -45,20 +46,25 @@ declare class Webhook {
|
|
|
45
46
|
pageNo?: number;
|
|
46
47
|
pageSize?: number;
|
|
47
48
|
extensionId: string;
|
|
48
|
-
}): Promise<
|
|
49
|
+
}): Promise<SubscriberConfigList>;
|
|
49
50
|
/**
|
|
50
51
|
* @param {Object} arg - Arg object.
|
|
51
|
-
* @param {
|
|
52
|
-
* @
|
|
53
|
-
* @
|
|
52
|
+
* @param {SubscriberConfig} arg.body
|
|
53
|
+
* @returns {Promise<SubscriberConfig>} - Success response
|
|
54
|
+
* @summary: Register Subscriber
|
|
55
|
+
* @description: Register Subscriber
|
|
54
56
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}): Promise<
|
|
57
|
+
registerSubscriberToEvent({ body }?: {
|
|
58
|
+
body: SubscriberConfig;
|
|
59
|
+
}): Promise<SubscriberConfig>;
|
|
58
60
|
/**
|
|
59
61
|
* @param {Object} arg - Arg object.
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
62
|
+
* @param {SubscriberConfig} arg.body
|
|
63
|
+
* @returns {Promise<SubscriberConfig>} - Success response
|
|
64
|
+
* @summary: Update Subscriber
|
|
65
|
+
* @description: Update Subscriber
|
|
62
66
|
*/
|
|
63
|
-
|
|
67
|
+
updateSubscriberConfig({ body }?: {
|
|
68
|
+
body: SubscriberConfig;
|
|
69
|
+
}): Promise<SubscriberConfig>;
|
|
64
70
|
}
|
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const WebhookValidator = require("./WebhookPlatformValidator");
|
|
5
|
+
const WebhookModel = require("./WebhookPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class Webhook {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -9,19 +12,13 @@ class Webhook {
|
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
|
-
* @
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @summary: Get Subscribers By Company ID
|
|
16
|
-
* @description: Get Subscribers By CompanyId
|
|
15
|
+
* @returns {Promise<EventConfigResponse>} - Success response
|
|
16
|
+
* @summary:
|
|
17
|
+
* @description: Get All Webhook Events
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
|
-
const { error } = WebhookValidator.
|
|
20
|
-
{
|
|
21
|
-
pageNo,
|
|
22
|
-
pageSize,
|
|
23
|
-
extensionId,
|
|
24
|
-
},
|
|
19
|
+
async fetchAllEventConfigurations({} = {}) {
|
|
20
|
+
const { error } = WebhookValidator.fetchAllEventConfigurations().validate(
|
|
21
|
+
{},
|
|
25
22
|
{ abortEarly: false, allowUnknown: true }
|
|
26
23
|
);
|
|
27
24
|
if (error) {
|
|
@@ -31,46 +28,62 @@ class Webhook {
|
|
|
31
28
|
// Showing warrnings if extra unknown parameters are found
|
|
32
29
|
const {
|
|
33
30
|
error: warrning,
|
|
34
|
-
} = WebhookValidator.
|
|
35
|
-
{
|
|
36
|
-
pageNo,
|
|
37
|
-
pageSize,
|
|
38
|
-
extensionId,
|
|
39
|
-
},
|
|
31
|
+
} = WebhookValidator.fetchAllEventConfigurations().validate(
|
|
32
|
+
{},
|
|
40
33
|
{ abortEarly: false, allowUnknown: false }
|
|
41
34
|
);
|
|
42
35
|
if (warrning) {
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
Logger({
|
|
37
|
+
level: "WARN",
|
|
38
|
+
message:
|
|
39
|
+
"Parameter Validation warrnings for fetchAllEventConfigurations",
|
|
40
|
+
});
|
|
41
|
+
Logger({ level: "WARN", message: warrning });
|
|
45
42
|
}
|
|
46
43
|
|
|
47
44
|
const query_params = {};
|
|
48
|
-
query_params["page_no"] = pageNo;
|
|
49
|
-
query_params["page_size"] = pageSize;
|
|
50
|
-
query_params["extension_id"] = extensionId;
|
|
51
45
|
|
|
52
46
|
const xHeaders = {};
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
const response = await PlatformAPIClient.execute(
|
|
55
49
|
this.config,
|
|
56
50
|
"get",
|
|
57
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/
|
|
51
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/events`,
|
|
58
52
|
query_params,
|
|
59
53
|
undefined,
|
|
60
54
|
xHeaders
|
|
61
55
|
);
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
error: res_error,
|
|
59
|
+
} = WebhookModel.EventConfigResponse().validate(response, {
|
|
60
|
+
abortEarly: false,
|
|
61
|
+
allowUnknown: false,
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
if (res_error) {
|
|
65
|
+
Logger({
|
|
66
|
+
level: "WARN",
|
|
67
|
+
message:
|
|
68
|
+
"Response Validation Warnnings for fetchAllEventConfigurations",
|
|
69
|
+
});
|
|
70
|
+
Logger({ level: "WARN", message: res_error });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return response;
|
|
62
74
|
}
|
|
63
75
|
|
|
64
76
|
/**
|
|
65
77
|
* @param {Object} arg - Arg object.
|
|
66
|
-
* @param {
|
|
67
|
-
* @
|
|
68
|
-
* @
|
|
78
|
+
* @param {number} arg.subscriberId - Subscriber ID
|
|
79
|
+
* @returns {Promise<SubscriberResponse>} - Success response
|
|
80
|
+
* @summary: Get Subscriber By Subscriber ID
|
|
81
|
+
* @description: Get Subscriber By Subscriber ID
|
|
69
82
|
*/
|
|
70
|
-
|
|
71
|
-
const { error } = WebhookValidator.
|
|
83
|
+
async getSubscriberById({ subscriberId } = {}) {
|
|
84
|
+
const { error } = WebhookValidator.getSubscriberById().validate(
|
|
72
85
|
{
|
|
73
|
-
|
|
86
|
+
subscriberId,
|
|
74
87
|
},
|
|
75
88
|
{ abortEarly: false, allowUnknown: true }
|
|
76
89
|
);
|
|
@@ -79,45 +92,66 @@ class Webhook {
|
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
// Showing warrnings if extra unknown parameters are found
|
|
82
|
-
const {
|
|
83
|
-
error: warrning,
|
|
84
|
-
} = WebhookValidator.registerSubscriberToEvent().validate(
|
|
95
|
+
const { error: warrning } = WebhookValidator.getSubscriberById().validate(
|
|
85
96
|
{
|
|
86
|
-
|
|
97
|
+
subscriberId,
|
|
87
98
|
},
|
|
88
99
|
{ abortEarly: false, allowUnknown: false }
|
|
89
100
|
);
|
|
90
101
|
if (warrning) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
102
|
+
Logger({
|
|
103
|
+
level: "WARN",
|
|
104
|
+
message: "Parameter Validation warrnings for getSubscriberById",
|
|
105
|
+
});
|
|
106
|
+
Logger({ level: "WARN", message: warrning });
|
|
95
107
|
}
|
|
96
108
|
|
|
97
109
|
const query_params = {};
|
|
98
110
|
|
|
99
111
|
const xHeaders = {};
|
|
100
112
|
|
|
101
|
-
|
|
113
|
+
const response = await PlatformAPIClient.execute(
|
|
102
114
|
this.config,
|
|
103
|
-
"
|
|
104
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
115
|
+
"get",
|
|
116
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber/${subscriberId}`,
|
|
105
117
|
query_params,
|
|
106
|
-
|
|
118
|
+
undefined,
|
|
107
119
|
xHeaders
|
|
108
120
|
);
|
|
121
|
+
|
|
122
|
+
const {
|
|
123
|
+
error: res_error,
|
|
124
|
+
} = WebhookModel.SubscriberResponse().validate(response, {
|
|
125
|
+
abortEarly: false,
|
|
126
|
+
allowUnknown: false,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
if (res_error) {
|
|
130
|
+
Logger({
|
|
131
|
+
level: "WARN",
|
|
132
|
+
message: "Response Validation Warnnings for getSubscriberById",
|
|
133
|
+
});
|
|
134
|
+
Logger({ level: "WARN", message: res_error });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return response;
|
|
109
138
|
}
|
|
110
139
|
|
|
111
140
|
/**
|
|
112
141
|
* @param {Object} arg - Arg object.
|
|
113
|
-
* @param {
|
|
114
|
-
* @
|
|
115
|
-
* @
|
|
142
|
+
* @param {number} [arg.pageNo] - Page Number
|
|
143
|
+
* @param {number} [arg.pageSize] - Page Size
|
|
144
|
+
* @param {string} [arg.extensionId] - Extension ID
|
|
145
|
+
* @returns {Promise<SubscriberResponse>} - Success response
|
|
146
|
+
* @summary: Get Subscribers By Company ID
|
|
147
|
+
* @description: Get Subscribers By CompanyId
|
|
116
148
|
*/
|
|
117
|
-
|
|
118
|
-
const { error } = WebhookValidator.
|
|
149
|
+
async getSubscribersByCompany({ pageNo, pageSize, extensionId } = {}) {
|
|
150
|
+
const { error } = WebhookValidator.getSubscribersByCompany().validate(
|
|
119
151
|
{
|
|
120
|
-
|
|
152
|
+
pageNo,
|
|
153
|
+
pageSize,
|
|
154
|
+
extensionId,
|
|
121
155
|
},
|
|
122
156
|
{ abortEarly: false, allowUnknown: true }
|
|
123
157
|
);
|
|
@@ -128,29 +162,54 @@ class Webhook {
|
|
|
128
162
|
// Showing warrnings if extra unknown parameters are found
|
|
129
163
|
const {
|
|
130
164
|
error: warrning,
|
|
131
|
-
} = WebhookValidator.
|
|
165
|
+
} = WebhookValidator.getSubscribersByCompany().validate(
|
|
132
166
|
{
|
|
133
|
-
|
|
167
|
+
pageNo,
|
|
168
|
+
pageSize,
|
|
169
|
+
extensionId,
|
|
134
170
|
},
|
|
135
171
|
{ abortEarly: false, allowUnknown: false }
|
|
136
172
|
);
|
|
137
173
|
if (warrning) {
|
|
138
|
-
|
|
139
|
-
|
|
174
|
+
Logger({
|
|
175
|
+
level: "WARN",
|
|
176
|
+
message: "Parameter Validation warrnings for getSubscribersByCompany",
|
|
177
|
+
});
|
|
178
|
+
Logger({ level: "WARN", message: warrning });
|
|
140
179
|
}
|
|
141
180
|
|
|
142
181
|
const query_params = {};
|
|
182
|
+
query_params["page_no"] = pageNo;
|
|
183
|
+
query_params["page_size"] = pageSize;
|
|
184
|
+
query_params["extension_id"] = extensionId;
|
|
143
185
|
|
|
144
186
|
const xHeaders = {};
|
|
145
187
|
|
|
146
|
-
|
|
188
|
+
const response = await PlatformAPIClient.execute(
|
|
147
189
|
this.config,
|
|
148
|
-
"
|
|
190
|
+
"get",
|
|
149
191
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
150
192
|
query_params,
|
|
151
|
-
|
|
193
|
+
undefined,
|
|
152
194
|
xHeaders
|
|
153
195
|
);
|
|
196
|
+
|
|
197
|
+
const {
|
|
198
|
+
error: res_error,
|
|
199
|
+
} = WebhookModel.SubscriberResponse().validate(response, {
|
|
200
|
+
abortEarly: false,
|
|
201
|
+
allowUnknown: false,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
if (res_error) {
|
|
205
|
+
Logger({
|
|
206
|
+
level: "WARN",
|
|
207
|
+
message: "Response Validation Warnnings for getSubscribersByCompany",
|
|
208
|
+
});
|
|
209
|
+
Logger({ level: "WARN", message: res_error });
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return response;
|
|
154
213
|
}
|
|
155
214
|
|
|
156
215
|
/**
|
|
@@ -158,10 +217,11 @@ class Webhook {
|
|
|
158
217
|
* @param {number} [arg.pageNo] - Page Number
|
|
159
218
|
* @param {number} [arg.pageSize] - Page Size
|
|
160
219
|
* @param {string} arg.extensionId - Extension ID
|
|
220
|
+
* @returns {Promise<SubscriberConfigList>} - Success response
|
|
161
221
|
* @summary: Get Subscribers By Extension ID
|
|
162
222
|
* @description: Get Subscribers By ExtensionID
|
|
163
223
|
*/
|
|
164
|
-
getSubscribersByExtensionId({ extensionId, pageNo, pageSize } = {}) {
|
|
224
|
+
async getSubscribersByExtensionId({ extensionId, pageNo, pageSize } = {}) {
|
|
165
225
|
const { error } = WebhookValidator.getSubscribersByExtensionId().validate(
|
|
166
226
|
{
|
|
167
227
|
extensionId,
|
|
@@ -186,10 +246,12 @@ class Webhook {
|
|
|
186
246
|
{ abortEarly: false, allowUnknown: false }
|
|
187
247
|
);
|
|
188
248
|
if (warrning) {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
249
|
+
Logger({
|
|
250
|
+
level: "WARN",
|
|
251
|
+
message:
|
|
252
|
+
"Parameter Validation warrnings for getSubscribersByExtensionId",
|
|
253
|
+
});
|
|
254
|
+
Logger({ level: "WARN", message: warrning });
|
|
193
255
|
}
|
|
194
256
|
|
|
195
257
|
const query_params = {};
|
|
@@ -198,7 +260,7 @@ class Webhook {
|
|
|
198
260
|
|
|
199
261
|
const xHeaders = {};
|
|
200
262
|
|
|
201
|
-
|
|
263
|
+
const response = await PlatformAPIClient.execute(
|
|
202
264
|
this.config,
|
|
203
265
|
"get",
|
|
204
266
|
`/service/platform/webhook/v1.0/company/${this.config.companyId}/extension/${extensionId}/subscriber`,
|
|
@@ -206,18 +268,37 @@ class Webhook {
|
|
|
206
268
|
undefined,
|
|
207
269
|
xHeaders
|
|
208
270
|
);
|
|
271
|
+
|
|
272
|
+
const {
|
|
273
|
+
error: res_error,
|
|
274
|
+
} = WebhookModel.SubscriberConfigList().validate(response, {
|
|
275
|
+
abortEarly: false,
|
|
276
|
+
allowUnknown: false,
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
if (res_error) {
|
|
280
|
+
Logger({
|
|
281
|
+
level: "WARN",
|
|
282
|
+
message:
|
|
283
|
+
"Response Validation Warnnings for getSubscribersByExtensionId",
|
|
284
|
+
});
|
|
285
|
+
Logger({ level: "WARN", message: res_error });
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
return response;
|
|
209
289
|
}
|
|
210
290
|
|
|
211
291
|
/**
|
|
212
292
|
* @param {Object} arg - Arg object.
|
|
213
|
-
* @param {
|
|
214
|
-
* @
|
|
215
|
-
* @
|
|
293
|
+
* @param {SubscriberConfig} arg.body
|
|
294
|
+
* @returns {Promise<SubscriberConfig>} - Success response
|
|
295
|
+
* @summary: Register Subscriber
|
|
296
|
+
* @description: Register Subscriber
|
|
216
297
|
*/
|
|
217
|
-
|
|
218
|
-
const { error } = WebhookValidator.
|
|
298
|
+
async registerSubscriberToEvent({ body } = {}) {
|
|
299
|
+
const { error } = WebhookValidator.registerSubscriberToEvent().validate(
|
|
219
300
|
{
|
|
220
|
-
|
|
301
|
+
body,
|
|
221
302
|
},
|
|
222
303
|
{ abortEarly: false, allowUnknown: true }
|
|
223
304
|
);
|
|
@@ -226,39 +307,65 @@ class Webhook {
|
|
|
226
307
|
}
|
|
227
308
|
|
|
228
309
|
// Showing warrnings if extra unknown parameters are found
|
|
229
|
-
const {
|
|
310
|
+
const {
|
|
311
|
+
error: warrning,
|
|
312
|
+
} = WebhookValidator.registerSubscriberToEvent().validate(
|
|
230
313
|
{
|
|
231
|
-
|
|
314
|
+
body,
|
|
232
315
|
},
|
|
233
316
|
{ abortEarly: false, allowUnknown: false }
|
|
234
317
|
);
|
|
235
318
|
if (warrning) {
|
|
236
|
-
|
|
237
|
-
|
|
319
|
+
Logger({
|
|
320
|
+
level: "WARN",
|
|
321
|
+
message: "Parameter Validation warrnings for registerSubscriberToEvent",
|
|
322
|
+
});
|
|
323
|
+
Logger({ level: "WARN", message: warrning });
|
|
238
324
|
}
|
|
239
325
|
|
|
240
326
|
const query_params = {};
|
|
241
327
|
|
|
242
328
|
const xHeaders = {};
|
|
243
329
|
|
|
244
|
-
|
|
330
|
+
const response = await PlatformAPIClient.execute(
|
|
245
331
|
this.config,
|
|
246
|
-
"
|
|
247
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber
|
|
332
|
+
"post",
|
|
333
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
248
334
|
query_params,
|
|
249
|
-
|
|
335
|
+
body,
|
|
250
336
|
xHeaders
|
|
251
337
|
);
|
|
338
|
+
|
|
339
|
+
const {
|
|
340
|
+
error: res_error,
|
|
341
|
+
} = WebhookModel.SubscriberConfig().validate(response, {
|
|
342
|
+
abortEarly: false,
|
|
343
|
+
allowUnknown: false,
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
if (res_error) {
|
|
347
|
+
Logger({
|
|
348
|
+
level: "WARN",
|
|
349
|
+
message: "Response Validation Warnnings for registerSubscriberToEvent",
|
|
350
|
+
});
|
|
351
|
+
Logger({ level: "WARN", message: res_error });
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
return response;
|
|
252
355
|
}
|
|
253
356
|
|
|
254
357
|
/**
|
|
255
358
|
* @param {Object} arg - Arg object.
|
|
256
|
-
* @
|
|
257
|
-
* @
|
|
359
|
+
* @param {SubscriberConfig} arg.body
|
|
360
|
+
* @returns {Promise<SubscriberConfig>} - Success response
|
|
361
|
+
* @summary: Update Subscriber
|
|
362
|
+
* @description: Update Subscriber
|
|
258
363
|
*/
|
|
259
|
-
|
|
260
|
-
const { error } = WebhookValidator.
|
|
261
|
-
{
|
|
364
|
+
async updateSubscriberConfig({ body } = {}) {
|
|
365
|
+
const { error } = WebhookValidator.updateSubscriberConfig().validate(
|
|
366
|
+
{
|
|
367
|
+
body,
|
|
368
|
+
},
|
|
262
369
|
{ abortEarly: false, allowUnknown: true }
|
|
263
370
|
);
|
|
264
371
|
if (error) {
|
|
@@ -268,29 +375,49 @@ class Webhook {
|
|
|
268
375
|
// Showing warrnings if extra unknown parameters are found
|
|
269
376
|
const {
|
|
270
377
|
error: warrning,
|
|
271
|
-
} = WebhookValidator.
|
|
272
|
-
{
|
|
378
|
+
} = WebhookValidator.updateSubscriberConfig().validate(
|
|
379
|
+
{
|
|
380
|
+
body,
|
|
381
|
+
},
|
|
273
382
|
{ abortEarly: false, allowUnknown: false }
|
|
274
383
|
);
|
|
275
384
|
if (warrning) {
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
385
|
+
Logger({
|
|
386
|
+
level: "WARN",
|
|
387
|
+
message: "Parameter Validation warrnings for updateSubscriberConfig",
|
|
388
|
+
});
|
|
389
|
+
Logger({ level: "WARN", message: warrning });
|
|
280
390
|
}
|
|
281
391
|
|
|
282
392
|
const query_params = {};
|
|
283
393
|
|
|
284
394
|
const xHeaders = {};
|
|
285
395
|
|
|
286
|
-
|
|
396
|
+
const response = await PlatformAPIClient.execute(
|
|
287
397
|
this.config,
|
|
288
|
-
"
|
|
289
|
-
`/service/platform/webhook/v1.0/company/${this.config.companyId}/
|
|
398
|
+
"put",
|
|
399
|
+
`/service/platform/webhook/v1.0/company/${this.config.companyId}/subscriber`,
|
|
290
400
|
query_params,
|
|
291
|
-
|
|
401
|
+
body,
|
|
292
402
|
xHeaders
|
|
293
403
|
);
|
|
404
|
+
|
|
405
|
+
const {
|
|
406
|
+
error: res_error,
|
|
407
|
+
} = WebhookModel.SubscriberConfig().validate(response, {
|
|
408
|
+
abortEarly: false,
|
|
409
|
+
allowUnknown: false,
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
if (res_error) {
|
|
413
|
+
Logger({
|
|
414
|
+
level: "WARN",
|
|
415
|
+
message: "Response Validation Warnnings for updateSubscriberConfig",
|
|
416
|
+
});
|
|
417
|
+
Logger({ level: "WARN", message: res_error });
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return response;
|
|
294
421
|
}
|
|
295
422
|
}
|
|
296
423
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export = WebhookModel;
|
|
2
2
|
declare class WebhookModel {
|
|
3
|
+
static Association(): any;
|
|
4
|
+
static AuthMeta(): any;
|
|
3
5
|
static EventConfig(): any;
|
|
6
|
+
static EventConfigBase(): any;
|
|
4
7
|
static EventConfigList(): any;
|
|
5
8
|
static EventConfigResponse(): any;
|
|
6
|
-
static SubscriberConfigList(): any;
|
|
7
|
-
static Page(): any;
|
|
8
|
-
static EventProcessedStatus(): any;
|
|
9
9
|
static EventPayload(): any;
|
|
10
|
+
static EventProcessedStatus(): any;
|
|
11
|
+
static Page(): any;
|
|
10
12
|
static SubscriberConfig(): any;
|
|
11
|
-
static
|
|
13
|
+
static SubscriberConfigList(): any;
|
|
12
14
|
static SubscriberEvent(): any;
|
|
13
|
-
static
|
|
14
|
-
static Association(): any;
|
|
15
|
-
static EventConfigBase(): any;
|
|
15
|
+
static SubscriberResponse(): any;
|
|
16
16
|
static SubscriberStatus(): any;
|
|
17
17
|
}
|