@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
|
@@ -1,228 +1,151 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
3
|
class CommonModel {
|
|
4
|
-
static
|
|
5
|
-
return Joi.object({
|
|
6
|
-
application: CommonModel.Application(),
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
static Currency() {
|
|
4
|
+
static Application() {
|
|
11
5
|
return Joi.object({
|
|
6
|
+
__v: Joi.number(),
|
|
12
7
|
_id: Joi.string().allow(""),
|
|
13
|
-
|
|
8
|
+
app_type: Joi.string().allow(""),
|
|
9
|
+
auth: CommonModel.ApplicationAuth(),
|
|
10
|
+
banner: CommonModel.SecureUrl(),
|
|
11
|
+
cache_ttl: Joi.number(),
|
|
12
|
+
channel_type: Joi.string().allow(""),
|
|
13
|
+
company_id: Joi.number(),
|
|
14
|
+
cors: CommonModel.ApplicationCors(),
|
|
15
|
+
created_at: Joi.string().allow(""),
|
|
16
|
+
description: Joi.string().allow(""),
|
|
17
|
+
domain: CommonModel.Domain(),
|
|
18
|
+
domains: Joi.array().items(CommonModel.Domain()),
|
|
19
|
+
favicon: CommonModel.SecureUrl(),
|
|
14
20
|
is_active: Joi.boolean(),
|
|
15
|
-
|
|
21
|
+
is_internal: Joi.boolean(),
|
|
22
|
+
logo: CommonModel.SecureUrl(),
|
|
23
|
+
meta: Joi.array().items(CommonModel.ApplicationMeta()),
|
|
24
|
+
mobile_logo: CommonModel.SecureUrl(),
|
|
16
25
|
name: Joi.string().allow(""),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
created_at: Joi.string().allow(""),
|
|
21
|
-
|
|
26
|
+
owner: Joi.string().allow(""),
|
|
27
|
+
redirections: Joi.array().items(CommonModel.ApplicationRedirections()),
|
|
28
|
+
token: Joi.string().allow(""),
|
|
22
29
|
updated_at: Joi.string().allow(""),
|
|
23
|
-
|
|
24
|
-
decimal_digits: Joi.number(),
|
|
25
|
-
|
|
26
|
-
symbol: Joi.string().allow(""),
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
static Domain() {
|
|
31
|
-
return Joi.object({
|
|
32
|
-
verified: Joi.boolean(),
|
|
33
|
-
|
|
34
|
-
is_primary: Joi.boolean(),
|
|
35
|
-
|
|
36
|
-
is_shortlink: Joi.boolean(),
|
|
37
|
-
|
|
38
|
-
_id: Joi.string().allow(""),
|
|
39
|
-
|
|
40
|
-
name: Joi.string().allow(""),
|
|
41
|
-
|
|
42
|
-
is_predefined: Joi.boolean(),
|
|
30
|
+
website: CommonModel.ApplicationWebsite(),
|
|
43
31
|
});
|
|
44
32
|
}
|
|
45
|
-
|
|
46
|
-
static ApplicationWebsite() {
|
|
33
|
+
static ApplicationAuth() {
|
|
47
34
|
return Joi.object({
|
|
48
35
|
enabled: Joi.boolean(),
|
|
49
|
-
|
|
50
|
-
basepath: Joi.string().allow(""),
|
|
51
36
|
});
|
|
52
37
|
}
|
|
53
|
-
|
|
54
38
|
static ApplicationCors() {
|
|
55
39
|
return Joi.object({
|
|
56
40
|
domains: Joi.array().items(Joi.string().allow("")),
|
|
57
41
|
});
|
|
58
42
|
}
|
|
59
|
-
|
|
60
|
-
static ApplicationAuth() {
|
|
43
|
+
static ApplicationMeta() {
|
|
61
44
|
return Joi.object({
|
|
62
|
-
|
|
45
|
+
name: Joi.string().allow(""),
|
|
46
|
+
value: Joi.string().allow(""),
|
|
63
47
|
});
|
|
64
48
|
}
|
|
65
|
-
|
|
66
49
|
static ApplicationRedirections() {
|
|
67
50
|
return Joi.object({
|
|
68
51
|
redirect_from: Joi.string().allow(""),
|
|
69
|
-
|
|
70
52
|
redirect_to: Joi.string().allow(""),
|
|
71
|
-
|
|
72
53
|
type: Joi.string().allow(""),
|
|
73
54
|
});
|
|
74
55
|
}
|
|
75
|
-
|
|
76
|
-
static ApplicationMeta() {
|
|
77
|
-
return Joi.object({
|
|
78
|
-
name: Joi.string().allow(""),
|
|
79
|
-
|
|
80
|
-
value: Joi.string().allow(""),
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
static SecureUrl() {
|
|
85
|
-
return Joi.object({
|
|
86
|
-
secure_url: Joi.string().allow(""),
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
static Application() {
|
|
56
|
+
static ApplicationResponse() {
|
|
91
57
|
return Joi.object({
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
cors: CommonModel.ApplicationCors(),
|
|
95
|
-
|
|
96
|
-
auth: CommonModel.ApplicationAuth(),
|
|
97
|
-
|
|
98
|
-
description: Joi.string().allow(""),
|
|
99
|
-
|
|
100
|
-
channel_type: Joi.string().allow(""),
|
|
101
|
-
|
|
102
|
-
cache_ttl: Joi.number(),
|
|
103
|
-
|
|
104
|
-
is_internal: Joi.boolean(),
|
|
105
|
-
|
|
106
|
-
is_active: Joi.boolean(),
|
|
107
|
-
|
|
108
|
-
_id: Joi.string().allow(""),
|
|
109
|
-
|
|
110
|
-
name: Joi.string().allow(""),
|
|
111
|
-
|
|
112
|
-
owner: Joi.string().allow(""),
|
|
113
|
-
|
|
114
|
-
company_id: Joi.number(),
|
|
115
|
-
|
|
116
|
-
token: Joi.string().allow(""),
|
|
117
|
-
|
|
118
|
-
redirections: Joi.array().items(CommonModel.ApplicationRedirections()),
|
|
119
|
-
|
|
120
|
-
meta: Joi.array().items(CommonModel.ApplicationMeta()),
|
|
121
|
-
|
|
122
|
-
created_at: Joi.string().allow(""),
|
|
123
|
-
|
|
124
|
-
updated_at: Joi.string().allow(""),
|
|
125
|
-
|
|
126
|
-
__v: Joi.number(),
|
|
127
|
-
|
|
128
|
-
banner: CommonModel.SecureUrl(),
|
|
129
|
-
|
|
130
|
-
logo: CommonModel.SecureUrl(),
|
|
131
|
-
|
|
132
|
-
favicon: CommonModel.SecureUrl(),
|
|
133
|
-
|
|
134
|
-
domains: Joi.array().items(CommonModel.Domain()),
|
|
135
|
-
|
|
136
|
-
app_type: Joi.string().allow(""),
|
|
137
|
-
|
|
138
|
-
mobile_logo: CommonModel.SecureUrl(),
|
|
139
|
-
|
|
140
|
-
domain: CommonModel.Domain(),
|
|
58
|
+
application: CommonModel.Application(),
|
|
141
59
|
});
|
|
142
60
|
}
|
|
143
|
-
|
|
144
|
-
static NotFound() {
|
|
61
|
+
static ApplicationWebsite() {
|
|
145
62
|
return Joi.object({
|
|
146
|
-
|
|
63
|
+
basepath: Joi.string().allow(""),
|
|
64
|
+
enabled: Joi.boolean(),
|
|
147
65
|
});
|
|
148
66
|
}
|
|
149
|
-
|
|
150
67
|
static BadRequest() {
|
|
151
68
|
return Joi.object({
|
|
152
69
|
message: Joi.string().allow(""),
|
|
153
70
|
});
|
|
154
71
|
}
|
|
155
|
-
|
|
156
|
-
static Page() {
|
|
157
|
-
return Joi.object({
|
|
158
|
-
item_total: Joi.number(),
|
|
159
|
-
|
|
160
|
-
next_id: Joi.string().allow(""),
|
|
161
|
-
|
|
162
|
-
has_previous: Joi.boolean(),
|
|
163
|
-
|
|
164
|
-
has_next: Joi.boolean(),
|
|
165
|
-
|
|
166
|
-
current: Joi.number(),
|
|
167
|
-
|
|
168
|
-
type: Joi.string().allow("").required(),
|
|
169
|
-
|
|
170
|
-
size: Joi.number(),
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
static LocationDefaultLanguage() {
|
|
72
|
+
static Currency() {
|
|
175
73
|
return Joi.object({
|
|
176
|
-
|
|
177
|
-
|
|
74
|
+
_id: Joi.string().allow(""),
|
|
178
75
|
code: Joi.string().allow(""),
|
|
76
|
+
created_at: Joi.string().allow(""),
|
|
77
|
+
decimal_digits: Joi.number(),
|
|
78
|
+
is_active: Joi.boolean(),
|
|
79
|
+
name: Joi.string().allow(""),
|
|
80
|
+
symbol: Joi.string().allow(""),
|
|
81
|
+
updated_at: Joi.string().allow(""),
|
|
179
82
|
});
|
|
180
83
|
}
|
|
181
|
-
|
|
182
|
-
static LocationDefaultCurrency() {
|
|
84
|
+
static Domain() {
|
|
183
85
|
return Joi.object({
|
|
86
|
+
_id: Joi.string().allow(""),
|
|
87
|
+
is_predefined: Joi.boolean(),
|
|
88
|
+
is_primary: Joi.boolean(),
|
|
89
|
+
is_shortlink: Joi.boolean(),
|
|
184
90
|
name: Joi.string().allow(""),
|
|
185
|
-
|
|
186
|
-
symbol: Joi.string().allow(""),
|
|
187
|
-
|
|
188
|
-
code: Joi.string().allow(""),
|
|
91
|
+
verified: Joi.boolean(),
|
|
189
92
|
});
|
|
190
93
|
}
|
|
191
|
-
|
|
192
94
|
static LocationCountry() {
|
|
193
95
|
return Joi.object({
|
|
96
|
+
__v: Joi.number(),
|
|
97
|
+
_id: Joi.string().allow(""),
|
|
194
98
|
capital: Joi.string().allow(""),
|
|
195
|
-
|
|
196
99
|
currency: Joi.string().allow(""),
|
|
197
|
-
|
|
100
|
+
default_currency: CommonModel.LocationDefaultCurrency(),
|
|
101
|
+
default_language: CommonModel.LocationDefaultLanguage(),
|
|
198
102
|
iso2: Joi.string().allow(""),
|
|
199
|
-
|
|
200
103
|
iso3: Joi.string().allow(""),
|
|
201
|
-
|
|
202
104
|
name: Joi.string().allow(""),
|
|
203
|
-
|
|
204
105
|
parent: Joi.string().allow(""),
|
|
205
|
-
|
|
206
106
|
phone_code: Joi.string().allow(""),
|
|
207
|
-
|
|
208
107
|
type: Joi.string().allow(""),
|
|
209
|
-
|
|
210
108
|
uid: Joi.number(),
|
|
211
|
-
|
|
212
|
-
__v: Joi.number(),
|
|
213
|
-
|
|
214
|
-
_id: Joi.string().allow(""),
|
|
215
|
-
|
|
216
|
-
default_currency: CommonModel.LocationDefaultCurrency(),
|
|
217
|
-
|
|
218
|
-
default_language: CommonModel.LocationDefaultLanguage(),
|
|
219
109
|
});
|
|
220
110
|
}
|
|
221
|
-
|
|
111
|
+
static LocationDefaultCurrency() {
|
|
112
|
+
return Joi.object({
|
|
113
|
+
code: Joi.string().allow(""),
|
|
114
|
+
name: Joi.string().allow(""),
|
|
115
|
+
symbol: Joi.string().allow(""),
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
static LocationDefaultLanguage() {
|
|
119
|
+
return Joi.object({
|
|
120
|
+
code: Joi.string().allow(""),
|
|
121
|
+
name: Joi.string().allow(""),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
222
124
|
static Locations() {
|
|
223
125
|
return Joi.object({
|
|
224
126
|
items: Joi.array().items(Joi.any()),
|
|
225
127
|
});
|
|
226
128
|
}
|
|
129
|
+
static NotFound() {
|
|
130
|
+
return Joi.object({
|
|
131
|
+
message: Joi.string().allow(""),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
static Page() {
|
|
135
|
+
return Joi.object({
|
|
136
|
+
current: Joi.number(),
|
|
137
|
+
has_next: Joi.boolean(),
|
|
138
|
+
has_previous: Joi.boolean(),
|
|
139
|
+
item_total: Joi.number(),
|
|
140
|
+
next_id: Joi.string().allow(""),
|
|
141
|
+
size: Joi.number(),
|
|
142
|
+
type: Joi.string().allow("").required(),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
static SecureUrl() {
|
|
146
|
+
return Joi.object({
|
|
147
|
+
secure_url: Joi.string().allow(""),
|
|
148
|
+
});
|
|
149
|
+
}
|
|
227
150
|
}
|
|
228
151
|
module.exports = CommonModel;
|
|
@@ -2,17 +2,17 @@ const Joi = require("joi");
|
|
|
2
2
|
|
|
3
3
|
const CommonModel = require("./CommonApplicationModel");
|
|
4
4
|
class CommonValidator {
|
|
5
|
-
static
|
|
5
|
+
static getLocations() {
|
|
6
6
|
return Joi.object({
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
locationType: Joi.string().allow(""),
|
|
8
|
+
id: Joi.string().allow(""),
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
static
|
|
12
|
+
static searchApplication() {
|
|
13
13
|
return Joi.object({
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
authorization: Joi.string().allow(""),
|
|
15
|
+
query: Joi.string().allow(""),
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -4,8 +4,8 @@ declare class Communication {
|
|
|
4
4
|
_conf: any;
|
|
5
5
|
_relativeUrls: {
|
|
6
6
|
getCommunicationConsent: string;
|
|
7
|
-
upsertCommunicationConsent: string;
|
|
8
7
|
upsertAppPushtoken: string;
|
|
8
|
+
upsertCommunicationConsent: string;
|
|
9
9
|
};
|
|
10
10
|
_urls: {};
|
|
11
11
|
updateUrls(urls: any): void;
|
|
@@ -16,16 +16,6 @@ declare class Communication {
|
|
|
16
16
|
* @description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
17
17
|
*/
|
|
18
18
|
getCommunicationConsent({}?: any): Promise<CommunicationConsent>;
|
|
19
|
-
/**
|
|
20
|
-
* @param {Object} arg - Arg object.
|
|
21
|
-
* @param {CommunicationConsentReq} arg.body
|
|
22
|
-
* @returns {Promise<CommunicationConsentRes>} - Success response
|
|
23
|
-
* @summary: Upsert communication consent
|
|
24
|
-
* @description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
25
|
-
*/
|
|
26
|
-
upsertCommunicationConsent({ body }?: {
|
|
27
|
-
body: CommunicationConsentReq;
|
|
28
|
-
}): Promise<CommunicationConsentRes>;
|
|
29
19
|
/**
|
|
30
20
|
* @param {Object} arg - Arg object.
|
|
31
21
|
* @param {PushtokenReq} arg.body
|
|
@@ -36,4 +26,14 @@ declare class Communication {
|
|
|
36
26
|
upsertAppPushtoken({ body }?: {
|
|
37
27
|
body: PushtokenReq;
|
|
38
28
|
}): Promise<PushtokenRes>;
|
|
29
|
+
/**
|
|
30
|
+
* @param {Object} arg - Arg object.
|
|
31
|
+
* @param {CommunicationConsentReq} arg.body
|
|
32
|
+
* @returns {Promise<CommunicationConsentRes>} - Success response
|
|
33
|
+
* @summary: Upsert communication consent
|
|
34
|
+
* @description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
35
|
+
*/
|
|
36
|
+
upsertCommunicationConsent({ body }?: {
|
|
37
|
+
body: CommunicationConsentReq;
|
|
38
|
+
}): Promise<CommunicationConsentRes>;
|
|
39
39
|
}
|
|
@@ -3,6 +3,8 @@ const constructUrl = require("../constructUrl");
|
|
|
3
3
|
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
5
5
|
const CommunicationValidator = require("./CommunicationApplicationValidator");
|
|
6
|
+
const CommunicationModel = require("./CommunicationApplicationModel");
|
|
7
|
+
const { Logger } = require("./../../common/Logger");
|
|
6
8
|
|
|
7
9
|
class Communication {
|
|
8
10
|
constructor(_conf) {
|
|
@@ -10,9 +12,9 @@ class Communication {
|
|
|
10
12
|
this._relativeUrls = {
|
|
11
13
|
getCommunicationConsent:
|
|
12
14
|
"/service/application/communication/v1.0/consent",
|
|
15
|
+
upsertAppPushtoken: "/service/application/communication/v1.0/pn-token",
|
|
13
16
|
upsertCommunicationConsent:
|
|
14
17
|
"/service/application/communication/v1.0/consent",
|
|
15
|
-
upsertAppPushtoken: "/service/application/communication/v1.0/pn-token",
|
|
16
18
|
};
|
|
17
19
|
this._urls = Object.entries(this._relativeUrls).reduce(
|
|
18
20
|
(urls, [method, relativeUrl]) => {
|
|
@@ -36,7 +38,7 @@ class Communication {
|
|
|
36
38
|
* @summary: Get communication consent
|
|
37
39
|
* @description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
38
40
|
*/
|
|
39
|
-
getCommunicationConsent({} = {}) {
|
|
41
|
+
async getCommunicationConsent({} = {}) {
|
|
40
42
|
const { error } = CommunicationValidator.getCommunicationConsent().validate(
|
|
41
43
|
{},
|
|
42
44
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -53,15 +55,18 @@ class Communication {
|
|
|
53
55
|
{ abortEarly: false, allowUnknown: false }
|
|
54
56
|
);
|
|
55
57
|
if (warrning) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
+
Logger({
|
|
59
|
+
level: "WARN",
|
|
60
|
+
message: "Parameter Validation warrnings for getCommunicationConsent",
|
|
61
|
+
});
|
|
62
|
+
Logger({ level: "WARN", message: warrning });
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
const query_params = {};
|
|
61
66
|
|
|
62
67
|
const xHeaders = {};
|
|
63
68
|
|
|
64
|
-
|
|
69
|
+
const response = await APIClient.execute(
|
|
65
70
|
this._conf,
|
|
66
71
|
"get",
|
|
67
72
|
constructUrl({
|
|
@@ -72,19 +77,34 @@ class Communication {
|
|
|
72
77
|
undefined,
|
|
73
78
|
xHeaders
|
|
74
79
|
);
|
|
80
|
+
|
|
81
|
+
const {
|
|
82
|
+
error: res_error,
|
|
83
|
+
} = CommunicationModel.CommunicationConsent().validate(response, {
|
|
84
|
+
abortEarly: false,
|
|
85
|
+
allowUnknown: false,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (res_error) {
|
|
89
|
+
Logger({
|
|
90
|
+
level: "WARN",
|
|
91
|
+
message: "Response Validation Warnnings for getCommunicationConsent",
|
|
92
|
+
});
|
|
93
|
+
Logger({ level: "WARN", message: res_error });
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return response;
|
|
75
97
|
}
|
|
76
98
|
|
|
77
99
|
/**
|
|
78
100
|
* @param {Object} arg - Arg object.
|
|
79
|
-
* @param {
|
|
80
|
-
* @returns {Promise<
|
|
81
|
-
* @summary: Upsert
|
|
82
|
-
* @description: Use this API to update and insert the
|
|
101
|
+
* @param {PushtokenReq} arg.body
|
|
102
|
+
* @returns {Promise<PushtokenRes>} - Success response
|
|
103
|
+
* @summary: Upsert push token of a user
|
|
104
|
+
* @description: Use this API to update and insert the push token of the user.
|
|
83
105
|
*/
|
|
84
|
-
|
|
85
|
-
const {
|
|
86
|
-
error,
|
|
87
|
-
} = CommunicationValidator.upsertCommunicationConsent().validate(
|
|
106
|
+
async upsertAppPushtoken({ body } = {}) {
|
|
107
|
+
const { error } = CommunicationValidator.upsertAppPushtoken().validate(
|
|
88
108
|
{ body },
|
|
89
109
|
{ abortEarly: false, allowUnknown: true }
|
|
90
110
|
);
|
|
@@ -95,43 +115,63 @@ class Communication {
|
|
|
95
115
|
// Showing warrnings if extra unknown parameters are found
|
|
96
116
|
const {
|
|
97
117
|
error: warrning,
|
|
98
|
-
} = CommunicationValidator.
|
|
118
|
+
} = CommunicationValidator.upsertAppPushtoken().validate(
|
|
99
119
|
{ body },
|
|
100
120
|
{ abortEarly: false, allowUnknown: false }
|
|
101
121
|
);
|
|
102
122
|
if (warrning) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
123
|
+
Logger({
|
|
124
|
+
level: "WARN",
|
|
125
|
+
message: "Parameter Validation warrnings for upsertAppPushtoken",
|
|
126
|
+
});
|
|
127
|
+
Logger({ level: "WARN", message: warrning });
|
|
107
128
|
}
|
|
108
129
|
|
|
109
130
|
const query_params = {};
|
|
110
131
|
|
|
111
132
|
const xHeaders = {};
|
|
112
133
|
|
|
113
|
-
|
|
134
|
+
const response = await APIClient.execute(
|
|
114
135
|
this._conf,
|
|
115
136
|
"post",
|
|
116
137
|
constructUrl({
|
|
117
|
-
url: this._urls["
|
|
138
|
+
url: this._urls["upsertAppPushtoken"],
|
|
118
139
|
params: {},
|
|
119
140
|
}),
|
|
120
141
|
query_params,
|
|
121
142
|
body,
|
|
122
143
|
xHeaders
|
|
123
144
|
);
|
|
145
|
+
|
|
146
|
+
const {
|
|
147
|
+
error: res_error,
|
|
148
|
+
} = CommunicationModel.PushtokenRes().validate(response, {
|
|
149
|
+
abortEarly: false,
|
|
150
|
+
allowUnknown: false,
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (res_error) {
|
|
154
|
+
Logger({
|
|
155
|
+
level: "WARN",
|
|
156
|
+
message: "Response Validation Warnnings for upsertAppPushtoken",
|
|
157
|
+
});
|
|
158
|
+
Logger({ level: "WARN", message: res_error });
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return response;
|
|
124
162
|
}
|
|
125
163
|
|
|
126
164
|
/**
|
|
127
165
|
* @param {Object} arg - Arg object.
|
|
128
|
-
* @param {
|
|
129
|
-
* @returns {Promise<
|
|
130
|
-
* @summary: Upsert
|
|
131
|
-
* @description: Use this API to update and insert the
|
|
166
|
+
* @param {CommunicationConsentReq} arg.body
|
|
167
|
+
* @returns {Promise<CommunicationConsentRes>} - Success response
|
|
168
|
+
* @summary: Upsert communication consent
|
|
169
|
+
* @description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
132
170
|
*/
|
|
133
|
-
|
|
134
|
-
const {
|
|
171
|
+
async upsertCommunicationConsent({ body } = {}) {
|
|
172
|
+
const {
|
|
173
|
+
error,
|
|
174
|
+
} = CommunicationValidator.upsertCommunicationConsent().validate(
|
|
135
175
|
{ body },
|
|
136
176
|
{ abortEarly: false, allowUnknown: true }
|
|
137
177
|
);
|
|
@@ -142,30 +182,51 @@ class Communication {
|
|
|
142
182
|
// Showing warrnings if extra unknown parameters are found
|
|
143
183
|
const {
|
|
144
184
|
error: warrning,
|
|
145
|
-
} = CommunicationValidator.
|
|
185
|
+
} = CommunicationValidator.upsertCommunicationConsent().validate(
|
|
146
186
|
{ body },
|
|
147
187
|
{ abortEarly: false, allowUnknown: false }
|
|
148
188
|
);
|
|
149
189
|
if (warrning) {
|
|
150
|
-
|
|
151
|
-
|
|
190
|
+
Logger({
|
|
191
|
+
level: "WARN",
|
|
192
|
+
message:
|
|
193
|
+
"Parameter Validation warrnings for upsertCommunicationConsent",
|
|
194
|
+
});
|
|
195
|
+
Logger({ level: "WARN", message: warrning });
|
|
152
196
|
}
|
|
153
197
|
|
|
154
198
|
const query_params = {};
|
|
155
199
|
|
|
156
200
|
const xHeaders = {};
|
|
157
201
|
|
|
158
|
-
|
|
202
|
+
const response = await APIClient.execute(
|
|
159
203
|
this._conf,
|
|
160
204
|
"post",
|
|
161
205
|
constructUrl({
|
|
162
|
-
url: this._urls["
|
|
206
|
+
url: this._urls["upsertCommunicationConsent"],
|
|
163
207
|
params: {},
|
|
164
208
|
}),
|
|
165
209
|
query_params,
|
|
166
210
|
body,
|
|
167
211
|
xHeaders
|
|
168
212
|
);
|
|
213
|
+
|
|
214
|
+
const {
|
|
215
|
+
error: res_error,
|
|
216
|
+
} = CommunicationModel.CommunicationConsentRes().validate(response, {
|
|
217
|
+
abortEarly: false,
|
|
218
|
+
allowUnknown: false,
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
if (res_error) {
|
|
222
|
+
Logger({
|
|
223
|
+
level: "WARN",
|
|
224
|
+
message: "Response Validation Warnnings for upsertCommunicationConsent",
|
|
225
|
+
});
|
|
226
|
+
Logger({ level: "WARN", message: res_error });
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
return response;
|
|
169
230
|
}
|
|
170
231
|
}
|
|
171
232
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export = CommunicationModel;
|
|
2
2
|
declare class CommunicationModel {
|
|
3
|
-
static
|
|
4
|
-
static
|
|
3
|
+
static BadRequestSchema(): any;
|
|
4
|
+
static CommunicationConsent(): any;
|
|
5
|
+
static CommunicationConsentChannels(): any;
|
|
5
6
|
static CommunicationConsentChannelsEmail(): any;
|
|
6
7
|
static CommunicationConsentChannelsSms(): any;
|
|
7
8
|
static CommunicationConsentChannelsWhatsapp(): any;
|
|
8
|
-
static
|
|
9
|
-
static
|
|
10
|
-
static BadRequestSchema(): any;
|
|
9
|
+
static CommunicationConsentReq(): any;
|
|
10
|
+
static CommunicationConsentRes(): any;
|
|
11
11
|
static NotFound(): any;
|
|
12
|
+
static Page(): any;
|
|
12
13
|
static PushtokenReq(): any;
|
|
13
14
|
static PushtokenRes(): any;
|
|
14
|
-
static Page(): any;
|
|
15
15
|
}
|