@gofynd/fdk-client-javascript 1.1.6 → 1.2.0
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 +12 -0
- package/index.js +0 -3
- package/package.json +1 -1
- package/sdk/application/ApplicationAPIClient.d.ts +15 -1
- package/sdk/application/ApplicationAPIClient.js +8 -1
- package/sdk/application/ApplicationClient.d.ts +37 -6
- package/sdk/application/ApplicationClient.js +31 -0
- package/sdk/application/ApplicationConfig.d.ts +52 -12
- package/sdk/application/ApplicationConfig.js +37 -2
- package/sdk/application/ApplicationModels.d.ts +46 -1
- package/sdk/application/ApplicationModels.js +18 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +172 -357
- package/sdk/application/Cart/CartApplicationClient.js +620 -483
- package/sdk/application/Cart/CartApplicationModel.d.ts +2054 -96
- package/sdk/application/Cart/CartApplicationModel.js +1224 -93
- package/sdk/application/Cart/CartApplicationValidator.d.ts +508 -30
- package/sdk/application/Cart/CartApplicationValidator.js +270 -15
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +234 -413
- package/sdk/application/Catalog/CatalogApplicationClient.js +777 -630
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +2218 -117
- package/sdk/application/Catalog/CatalogApplicationModel.js +1499 -170
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +798 -31
- package/sdk/application/Catalog/CatalogApplicationValidator.js +318 -3
- package/sdk/application/Common/CommonApplicationClient.d.ts +14 -21
- package/sdk/application/Common/CommonApplicationClient.js +50 -33
- package/sdk/application/Common/CommonApplicationModel.d.ts +448 -19
- package/sdk/application/Common/CommonApplicationModel.js +224 -16
- package/sdk/application/Common/CommonApplicationValidator.d.ts +42 -4
- package/sdk/application/Common/CommonApplicationValidator.js +21 -3
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +25 -18
- package/sdk/application/Communication/CommunicationApplicationClient.js +74 -47
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +190 -14
- package/sdk/application/Communication/CommunicationApplicationModel.js +124 -7
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +27 -4
- package/sdk/application/Communication/CommunicationApplicationValidator.js +21 -5
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +113 -112
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +381 -260
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +2453 -110
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1254 -108
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +160 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +88 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +120 -138
- package/sdk/application/Content/ContentApplicationClient.js +409 -277
- package/sdk/application/Content/ContentApplicationModel.d.ts +1627 -105
- package/sdk/application/Content/ContentApplicationModel.js +1202 -109
- package/sdk/application/Content/ContentApplicationValidator.d.ts +214 -12
- package/sdk/application/Content/ContentApplicationValidator.js +113 -3
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +20 -29
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +68 -47
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +299 -20
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +209 -16
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +55 -5
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +33 -6
- package/sdk/application/Lead/LeadApplicationClient.d.ts +50 -53
- package/sdk/application/Lead/LeadApplicationClient.js +169 -103
- package/sdk/application/Lead/LeadApplicationModel.d.ts +1405 -54
- package/sdk/application/Lead/LeadApplicationModel.js +619 -73
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +91 -9
- package/sdk/application/Lead/LeadApplicationValidator.js +51 -6
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +34 -33
- package/sdk/application/Logistic/LogisticApplicationClient.js +110 -73
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +399 -28
- package/sdk/application/Logistic/LogisticApplicationModel.js +293 -24
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +48 -6
- package/sdk/application/Logistic/LogisticApplicationValidator.js +34 -6
- package/sdk/application/Order/OrderApplicationClient.d.ts +81 -133
- package/sdk/application/Order/OrderApplicationClient.js +297 -217
- package/sdk/application/Order/OrderApplicationModel.d.ts +1101 -66
- package/sdk/application/Order/OrderApplicationModel.js +776 -57
- package/sdk/application/Order/OrderApplicationValidator.d.ts +249 -14
- package/sdk/application/Order/OrderApplicationValidator.js +114 -5
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +341 -356
- package/sdk/application/Payment/PaymentApplicationClient.js +1077 -703
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +3125 -99
- package/sdk/application/Payment/PaymentApplicationModel.js +1158 -62
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +494 -41
- package/sdk/application/Payment/PaymentApplicationValidator.js +297 -25
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +178 -350
- package/sdk/application/PosCart/PosCartApplicationClient.js +636 -491
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1823 -89
- package/sdk/application/PosCart/PosCartApplicationModel.js +1117 -85
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +480 -29
- package/sdk/application/PosCart/PosCartApplicationValidator.js +262 -15
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +49 -47
- package/sdk/application/Rewards/RewardsApplicationClient.js +160 -102
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +343 -22
- package/sdk/application/Rewards/RewardsApplicationModel.js +230 -15
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +70 -7
- package/sdk/application/Rewards/RewardsApplicationValidator.js +45 -6
- package/sdk/application/Share/ShareApplicationClient.d.ts +44 -50
- package/sdk/application/Share/ShareApplicationClient.js +165 -97
- package/sdk/application/Share/ShareApplicationModel.d.ts +230 -15
- package/sdk/application/Share/ShareApplicationModel.js +154 -16
- package/sdk/application/Share/ShareApplicationValidator.d.ts +86 -8
- package/sdk/application/Share/ShareApplicationValidator.js +48 -4
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +25 -27
- package/sdk/application/Theme/ThemeApplicationClient.js +83 -54
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +621 -48
- package/sdk/application/Theme/ThemeApplicationModel.js +464 -40
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +49 -5
- package/sdk/application/Theme/ThemeApplicationValidator.js +26 -3
- package/sdk/application/User/UserApplicationClient.d.ts +219 -303
- package/sdk/application/User/UserApplicationClient.js +819 -522
- package/sdk/application/User/UserApplicationModel.d.ts +1390 -101
- package/sdk/application/User/UserApplicationModel.js +983 -44
- package/sdk/application/User/UserApplicationValidator.d.ts +457 -33
- package/sdk/application/User/UserApplicationValidator.js +265 -31
- package/sdk/common/AxiosHelper.js +8 -2
- package/sdk/common/Paginator.d.ts +27 -12
- package/sdk/common/Paginator.js +15 -0
- package/sdk/common/RequestSigner.js +0 -1
- package/sdk/partner/PartnerAPIClient.d.ts +15 -1
- package/sdk/partner/PartnerAPIClient.js +8 -1
- package/sdk/partner/PartnerClient.d.ts +20 -3
- package/sdk/partner/PartnerClient.js +17 -0
- package/sdk/partner/PartnerConfig.d.ts +40 -14
- package/sdk/partner/PartnerConfig.js +31 -6
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +26 -25
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +82 -53
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +202 -17
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +139 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +42 -5
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +26 -4
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +88 -97
- package/sdk/platform/Billing/BillingPlatformClient.js +310 -191
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +1211 -68
- package/sdk/platform/Billing/BillingPlatformModel.js +824 -59
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +153 -12
- package/sdk/platform/Billing/BillingPlatformValidator.js +87 -8
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +392 -634
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1480 -957
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +827 -57
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +492 -34
- package/sdk/platform/Cart/CartPlatformModel.d.ts +3639 -175
- package/sdk/platform/Cart/CartPlatformModel.js +2368 -212
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +438 -615
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1449 -984
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +1081 -49
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +482 -23
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +573 -824
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1773 -1264
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +6871 -326
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4215 -349
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +1331 -71
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +611 -30
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -21
- package/sdk/platform/Common/CommonPlatformClient.js +48 -33
- package/sdk/platform/Common/CommonPlatformModel.d.ts +448 -19
- package/sdk/platform/Common/CommonPlatformModel.js +224 -16
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +42 -4
- package/sdk/platform/Common/CommonPlatformValidator.js +21 -3
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +457 -279
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1423 -553
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +581 -42
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +294 -22
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +18 -5
- package/sdk/platform/Communication/CommunicationPlatformClient.js +58 -19
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1630 -102
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1150 -85
- package/sdk/platform/Communication/CommunicationPlatformValidator.d.ts +16 -3
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +11 -3
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +102 -111
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +321 -225
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +830 -43
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +612 -78
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +180 -13
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +98 -10
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +232 -212
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +737 -438
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +293 -22
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +184 -17
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +166 -178
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +519 -310
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +4504 -188
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2242 -204
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +332 -19
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +153 -10
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +495 -560
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1777 -987
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +872 -62
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +487 -35
- package/sdk/platform/Content/ContentPlatformModel.d.ts +1661 -108
- package/sdk/platform/Content/ContentPlatformModel.js +1217 -113
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +67 -101
- package/sdk/platform/Discount/DiscountPlatformClient.js +240 -176
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +242 -15
- package/sdk/platform/Discount/DiscountPlatformModel.js +162 -10
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +185 -13
- package/sdk/platform/Discount/DiscountPlatformValidator.js +88 -8
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +32 -41
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +106 -74
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +77 -6
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +41 -6
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +39 -54
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +124 -99
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +299 -20
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +207 -16
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +98 -8
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +54 -7
- package/sdk/platform/Finance/FinancePlatformClient.d.ts +85 -91
- package/sdk/platform/Finance/FinancePlatformClient.js +272 -180
- package/sdk/platform/Finance/FinancePlatformModel.d.ts +619 -50
- package/sdk/platform/Finance/FinancePlatformModel.js +458 -30
- package/sdk/platform/Finance/FinancePlatformValidator.d.ts +123 -15
- package/sdk/platform/Finance/FinancePlatformValidator.js +95 -16
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +99 -97
- package/sdk/platform/Inventory/InventoryPlatformClient.js +288 -199
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +1354 -61
- package/sdk/platform/Inventory/InventoryPlatformModel.js +916 -83
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +168 -12
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +82 -6
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +86 -106
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +326 -186
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +180 -14
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +94 -9
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +75 -101
- package/sdk/platform/Lead/LeadPlatformClient.js +240 -174
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +1403 -54
- package/sdk/platform/Lead/LeadPlatformModel.js +618 -73
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +173 -12
- package/sdk/platform/Lead/LeadPlatformValidator.js +85 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +18 -14
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +56 -29
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +26 -4
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +16 -3
- package/sdk/platform/Order/OrderPlatformClient.d.ts +343 -556
- package/sdk/platform/Order/OrderPlatformClient.js +969 -762
- package/sdk/platform/Order/OrderPlatformModel.d.ts +4967 -247
- package/sdk/platform/Order/OrderPlatformModel.js +3249 -259
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +758 -37
- package/sdk/platform/Order/OrderPlatformValidator.js +351 -22
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +28 -36
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +103 -59
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +66 -6
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +32 -4
- package/sdk/platform/Partner/PartnerPlatformClient.d.ts +68 -107
- package/sdk/platform/Partner/PartnerPlatformClient.js +253 -174
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +767 -45
- package/sdk/platform/Partner/PartnerPlatformModel.js +524 -41
- package/sdk/platform/Partner/PartnerPlatformValidator.d.ts +207 -13
- package/sdk/platform/Partner/PartnerPlatformValidator.js +87 -5
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +255 -260
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +860 -504
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +348 -30
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +221 -19
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +73 -73
- package/sdk/platform/Payment/PaymentPlatformClient.js +238 -154
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2658 -93
- package/sdk/platform/Payment/PaymentPlatformModel.js +1035 -36
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +111 -11
- package/sdk/platform/Payment/PaymentPlatformValidator.js +68 -7
- package/sdk/platform/PlatformAPIClient.d.ts +16 -1
- package/sdk/platform/PlatformAPIClient.js +9 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +22 -1798
- package/sdk/platform/PlatformApplicationClient.js +17 -1899
- package/sdk/platform/PlatformClient.d.ts +29 -12579
- package/sdk/platform/PlatformClient.js +26 -15085
- package/sdk/platform/PlatformConfig.d.ts +37 -11
- package/sdk/platform/PlatformConfig.js +32 -6
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +80 -92
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +307 -177
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +149 -12
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +82 -8
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +371 -23
- package/sdk/platform/Rewards/RewardsPlatformModel.js +246 -16
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.d.ts +120 -89
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationClient.js +349 -201
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.d.ts +128 -12
- package/sdk/platform/Serviceability/ServiceabilityPlatformApplicationValidator.js +85 -11
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +148 -178
- package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +454 -329
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1399 -96
- package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1022 -71
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +280 -18
- package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +134 -11
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +38 -47
- package/sdk/platform/Share/SharePlatformApplicationClient.js +137 -73
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +87 -7
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +42 -5
- package/sdk/platform/Share/SharePlatformModel.d.ts +250 -16
- package/sdk/platform/Share/SharePlatformModel.js +165 -17
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +149 -183
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +579 -330
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +308 -24
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +162 -10
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +621 -48
- package/sdk/platform/Theme/ThemePlatformModel.js +464 -40
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +119 -151
- package/sdk/platform/User/UserPlatformApplicationClient.js +411 -244
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +235 -18
- package/sdk/platform/User/UserPlatformApplicationValidator.js +126 -12
- package/sdk/platform/User/UserPlatformModel.d.ts +1390 -101
- package/sdk/platform/User/UserPlatformModel.js +983 -44
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +38 -47
- package/sdk/platform/Webhook/WebhookPlatformClient.js +137 -87
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +242 -16
- package/sdk/platform/Webhook/WebhookPlatformModel.js +167 -18
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +83 -7
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +43 -5
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +14 -21
- package/sdk/public/Configuration/ConfigurationPublicClient.js +46 -33
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +473 -19
- package/sdk/public/Configuration/ConfigurationPublicModel.js +224 -16
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +42 -4
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +21 -3
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +48 -48
- package/sdk/public/Inventory/InventoryPublicClient.js +146 -98
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +392 -21
- package/sdk/public/Inventory/InventoryPublicModel.js +267 -27
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +90 -8
- package/sdk/public/Inventory/InventoryPublicValidator.js +44 -4
- package/sdk/public/PublicClient.d.ts +19 -3
- package/sdk/public/PublicClient.js +16 -0
- package/sdk/public/PublicConfig.d.ts +27 -6
- package/sdk/public/PublicConfig.js +17 -1
- package/sdk/public/Webhook/WebhookPublicClient.d.ts +13 -11
- package/sdk/public/Webhook/WebhookPublicClient.js +42 -27
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +242 -16
- package/sdk/public/Webhook/WebhookPublicModel.js +167 -18
- package/sdk/public/Webhook/WebhookPublicValidator.d.ts +18 -3
- package/sdk/public/Webhook/WebhookPublicValidator.js +14 -4
|
@@ -2,8 +2,8 @@ const ApplicationAPIClient = require("../ApplicationAPIClient");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const constructUrl = require("../constructUrl");
|
|
4
4
|
const Paginator = require("../../common/Paginator");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const CommunicationApplicationValidator = require("./CommunicationApplicationValidator");
|
|
6
|
+
const CommunicationApplicationModel = require("./CommunicationApplicationModel");
|
|
7
7
|
const { Logger } = require("./../../common/Logger");
|
|
8
8
|
const Joi = require("joi");
|
|
9
9
|
|
|
@@ -34,13 +34,17 @@ class Communication {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* @param {
|
|
38
|
-
* @returns {Promise<CommunicationConsent>} -
|
|
37
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
38
|
+
* @returns {Promise<CommunicationApplicationModel.CommunicationConsent>} -
|
|
39
|
+
* Success response
|
|
40
|
+
* @name getCommunicationConsent
|
|
39
41
|
* @summary: Get communication consent
|
|
40
|
-
* @description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
42
|
+
* @description: Use this API to retrieve the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/communication/getCommunicationConsent/).
|
|
41
43
|
*/
|
|
42
|
-
async getCommunicationConsent({} = {}) {
|
|
43
|
-
const {
|
|
44
|
+
async getCommunicationConsent({ headers } = { headers: false }) {
|
|
45
|
+
const {
|
|
46
|
+
error,
|
|
47
|
+
} = CommunicationApplicationValidator.getCommunicationConsent().validate(
|
|
44
48
|
{},
|
|
45
49
|
{ abortEarly: false, allowUnknown: true }
|
|
46
50
|
);
|
|
@@ -51,16 +55,15 @@ class Communication {
|
|
|
51
55
|
// Showing warrnings if extra unknown parameters are found
|
|
52
56
|
const {
|
|
53
57
|
error: warrning,
|
|
54
|
-
} =
|
|
58
|
+
} = CommunicationApplicationValidator.getCommunicationConsent().validate(
|
|
55
59
|
{},
|
|
56
60
|
{ abortEarly: false, allowUnknown: false }
|
|
57
61
|
);
|
|
58
62
|
if (warrning) {
|
|
59
63
|
Logger({
|
|
60
64
|
level: "WARN",
|
|
61
|
-
message:
|
|
65
|
+
message: `Parameter Validation warrnings for application > Communication > getCommunicationConsent \n ${warrning}`,
|
|
62
66
|
});
|
|
63
|
-
Logger({ level: "WARN", message: warrning });
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
const query_params = {};
|
|
@@ -76,36 +79,45 @@ class Communication {
|
|
|
76
79
|
}),
|
|
77
80
|
query_params,
|
|
78
81
|
undefined,
|
|
79
|
-
xHeaders
|
|
82
|
+
xHeaders,
|
|
83
|
+
{ headers }
|
|
80
84
|
);
|
|
81
85
|
|
|
86
|
+
let responseData = response;
|
|
87
|
+
if (headers) {
|
|
88
|
+
responseData = response[0];
|
|
89
|
+
}
|
|
90
|
+
|
|
82
91
|
const {
|
|
83
92
|
error: res_error,
|
|
84
|
-
} =
|
|
85
|
-
|
|
86
|
-
allowUnknown: false
|
|
87
|
-
|
|
93
|
+
} = CommunicationApplicationModel.CommunicationConsent().validate(
|
|
94
|
+
responseData,
|
|
95
|
+
{ abortEarly: false, allowUnknown: false }
|
|
96
|
+
);
|
|
88
97
|
|
|
89
98
|
if (res_error) {
|
|
90
99
|
Logger({
|
|
91
100
|
level: "WARN",
|
|
92
|
-
message:
|
|
101
|
+
message: `Response Validation Warnnings for application > Communication > getCommunicationConsent \n ${res_error}`,
|
|
93
102
|
});
|
|
94
|
-
Logger({ level: "WARN", message: res_error });
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
return response;
|
|
98
106
|
}
|
|
99
107
|
|
|
100
108
|
/**
|
|
101
|
-
* @param {
|
|
102
|
-
*
|
|
103
|
-
* @
|
|
109
|
+
* @param {CommunicationApplicationValidator.UpsertAppPushtokenParam} arg -
|
|
110
|
+
* Arg object.
|
|
111
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
112
|
+
* @returns {Promise<CommunicationApplicationModel.PushtokenRes>} - Success response
|
|
113
|
+
* @name upsertAppPushtoken
|
|
104
114
|
* @summary: Upsert push token of a user
|
|
105
|
-
* @description: Use this API to update and insert the push token of the user.
|
|
115
|
+
* @description: Use this API to update and insert the push token of the user. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/communication/upsertAppPushtoken/).
|
|
106
116
|
*/
|
|
107
|
-
async upsertAppPushtoken({ body } = {}) {
|
|
108
|
-
const {
|
|
117
|
+
async upsertAppPushtoken({ body } = {}, { headers } = { headers: false }) {
|
|
118
|
+
const {
|
|
119
|
+
error,
|
|
120
|
+
} = CommunicationApplicationValidator.upsertAppPushtoken().validate(
|
|
109
121
|
{ body },
|
|
110
122
|
{ abortEarly: false, allowUnknown: true }
|
|
111
123
|
);
|
|
@@ -116,16 +128,15 @@ class Communication {
|
|
|
116
128
|
// Showing warrnings if extra unknown parameters are found
|
|
117
129
|
const {
|
|
118
130
|
error: warrning,
|
|
119
|
-
} =
|
|
131
|
+
} = CommunicationApplicationValidator.upsertAppPushtoken().validate(
|
|
120
132
|
{ body },
|
|
121
133
|
{ abortEarly: false, allowUnknown: false }
|
|
122
134
|
);
|
|
123
135
|
if (warrning) {
|
|
124
136
|
Logger({
|
|
125
137
|
level: "WARN",
|
|
126
|
-
message:
|
|
138
|
+
message: `Parameter Validation warrnings for application > Communication > upsertAppPushtoken \n ${warrning}`,
|
|
127
139
|
});
|
|
128
|
-
Logger({ level: "WARN", message: warrning });
|
|
129
140
|
}
|
|
130
141
|
|
|
131
142
|
const query_params = {};
|
|
@@ -141,12 +152,18 @@ class Communication {
|
|
|
141
152
|
}),
|
|
142
153
|
query_params,
|
|
143
154
|
body,
|
|
144
|
-
xHeaders
|
|
155
|
+
xHeaders,
|
|
156
|
+
{ headers }
|
|
145
157
|
);
|
|
146
158
|
|
|
159
|
+
let responseData = response;
|
|
160
|
+
if (headers) {
|
|
161
|
+
responseData = response[0];
|
|
162
|
+
}
|
|
163
|
+
|
|
147
164
|
const {
|
|
148
165
|
error: res_error,
|
|
149
|
-
} =
|
|
166
|
+
} = CommunicationApplicationModel.PushtokenRes().validate(responseData, {
|
|
150
167
|
abortEarly: false,
|
|
151
168
|
allowUnknown: false,
|
|
152
169
|
});
|
|
@@ -154,25 +171,32 @@ class Communication {
|
|
|
154
171
|
if (res_error) {
|
|
155
172
|
Logger({
|
|
156
173
|
level: "WARN",
|
|
157
|
-
message:
|
|
174
|
+
message: `Response Validation Warnnings for application > Communication > upsertAppPushtoken \n ${res_error}`,
|
|
158
175
|
});
|
|
159
|
-
Logger({ level: "WARN", message: res_error });
|
|
160
176
|
}
|
|
161
177
|
|
|
162
178
|
return response;
|
|
163
179
|
}
|
|
164
180
|
|
|
165
181
|
/**
|
|
166
|
-
* @param {
|
|
167
|
-
*
|
|
168
|
-
*
|
|
182
|
+
* @param {CommunicationApplicationValidator.UpsertCommunicationConsentParam} arg
|
|
183
|
+
* - Arg object.
|
|
184
|
+
*
|
|
185
|
+
* @param {import("../ApplicationAPIClient").Options} - Options
|
|
186
|
+
* @returns {Promise<CommunicationApplicationModel.CommunicationConsentRes>}
|
|
187
|
+
* - Success response
|
|
188
|
+
*
|
|
189
|
+
* @name upsertCommunicationConsent
|
|
169
190
|
* @summary: Upsert communication consent
|
|
170
|
-
* @description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp.
|
|
191
|
+
* @description: Use this API to update and insert the consent provided by the user for receiving communication messages over Email/SMS/WhatsApp. - Check out [method documentation](https://partners.fynd.com/help/docs/sdk/application/communication/upsertCommunicationConsent/).
|
|
171
192
|
*/
|
|
172
|
-
async upsertCommunicationConsent(
|
|
193
|
+
async upsertCommunicationConsent(
|
|
194
|
+
{ body } = {},
|
|
195
|
+
{ headers } = { headers: false }
|
|
196
|
+
) {
|
|
173
197
|
const {
|
|
174
198
|
error,
|
|
175
|
-
} =
|
|
199
|
+
} = CommunicationApplicationValidator.upsertCommunicationConsent().validate(
|
|
176
200
|
{ body },
|
|
177
201
|
{ abortEarly: false, allowUnknown: true }
|
|
178
202
|
);
|
|
@@ -183,17 +207,15 @@ class Communication {
|
|
|
183
207
|
// Showing warrnings if extra unknown parameters are found
|
|
184
208
|
const {
|
|
185
209
|
error: warrning,
|
|
186
|
-
} =
|
|
210
|
+
} = CommunicationApplicationValidator.upsertCommunicationConsent().validate(
|
|
187
211
|
{ body },
|
|
188
212
|
{ abortEarly: false, allowUnknown: false }
|
|
189
213
|
);
|
|
190
214
|
if (warrning) {
|
|
191
215
|
Logger({
|
|
192
216
|
level: "WARN",
|
|
193
|
-
message:
|
|
194
|
-
"Parameter Validation warrnings for upsertCommunicationConsent",
|
|
217
|
+
message: `Parameter Validation warrnings for application > Communication > upsertCommunicationConsent \n ${warrning}`,
|
|
195
218
|
});
|
|
196
|
-
Logger({ level: "WARN", message: warrning });
|
|
197
219
|
}
|
|
198
220
|
|
|
199
221
|
const query_params = {};
|
|
@@ -209,22 +231,27 @@ class Communication {
|
|
|
209
231
|
}),
|
|
210
232
|
query_params,
|
|
211
233
|
body,
|
|
212
|
-
xHeaders
|
|
234
|
+
xHeaders,
|
|
235
|
+
{ headers }
|
|
213
236
|
);
|
|
214
237
|
|
|
238
|
+
let responseData = response;
|
|
239
|
+
if (headers) {
|
|
240
|
+
responseData = response[0];
|
|
241
|
+
}
|
|
242
|
+
|
|
215
243
|
const {
|
|
216
244
|
error: res_error,
|
|
217
|
-
} =
|
|
218
|
-
|
|
219
|
-
allowUnknown: false
|
|
220
|
-
|
|
245
|
+
} = CommunicationApplicationModel.CommunicationConsentRes().validate(
|
|
246
|
+
responseData,
|
|
247
|
+
{ abortEarly: false, allowUnknown: false }
|
|
248
|
+
);
|
|
221
249
|
|
|
222
250
|
if (res_error) {
|
|
223
251
|
Logger({
|
|
224
252
|
level: "WARN",
|
|
225
|
-
message:
|
|
253
|
+
message: `Response Validation Warnnings for application > Communication > upsertCommunicationConsent \n ${res_error}`,
|
|
226
254
|
});
|
|
227
|
-
Logger({ level: "WARN", message: res_error });
|
|
228
255
|
}
|
|
229
256
|
|
|
230
257
|
return response;
|
|
@@ -1,15 +1,191 @@
|
|
|
1
|
-
export =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
export = CommunicationApplicationModel;
|
|
2
|
+
/**
|
|
3
|
+
* @typedef BadRequestSchema
|
|
4
|
+
* @property {string} [message] - Failure message.
|
|
5
|
+
* @property {string} [status] - Response status.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef CommunicationConsent
|
|
9
|
+
* @property {string} [app_id]
|
|
10
|
+
* @property {CommunicationConsentChannels} [channels]
|
|
11
|
+
* @property {string} [user_id]
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* @typedef CommunicationConsentChannels
|
|
15
|
+
* @property {CommunicationConsentChannelsEmail} [email]
|
|
16
|
+
* @property {CommunicationConsentChannelsSms} [sms]
|
|
17
|
+
* @property {CommunicationConsentChannelsWhatsapp} [whatsapp]
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* @typedef CommunicationConsentChannelsEmail
|
|
21
|
+
* @property {string} [display_name]
|
|
22
|
+
* @property {string} [response]
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* @typedef CommunicationConsentChannelsSms
|
|
26
|
+
* @property {string} [display_name]
|
|
27
|
+
* @property {string} [response]
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* @typedef CommunicationConsentChannelsWhatsapp
|
|
31
|
+
* @property {string} [country_code]
|
|
32
|
+
* @property {string} [display_name]
|
|
33
|
+
* @property {string} [phone_number]
|
|
34
|
+
* @property {string} [response]
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* @typedef CommunicationConsentReq
|
|
38
|
+
* @property {string} [action]
|
|
39
|
+
* @property {string} [channel]
|
|
40
|
+
* @property {string} [response]
|
|
41
|
+
*/
|
|
42
|
+
/**
|
|
43
|
+
* @typedef CommunicationConsentRes
|
|
44
|
+
* @property {string} [app_id]
|
|
45
|
+
* @property {CommunicationConsentChannels} [channels]
|
|
46
|
+
* @property {string} [user_id]
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* @typedef NotFound
|
|
50
|
+
* @property {string} [message] - Failure message.
|
|
51
|
+
*/
|
|
52
|
+
/**
|
|
53
|
+
* @typedef Page
|
|
54
|
+
* @property {number} [current]
|
|
55
|
+
* @property {boolean} [has_next]
|
|
56
|
+
* @property {boolean} [has_previous]
|
|
57
|
+
* @property {number} [item_total]
|
|
58
|
+
* @property {string} [next_id]
|
|
59
|
+
* @property {number} [size]
|
|
60
|
+
* @property {string} type
|
|
61
|
+
*/
|
|
62
|
+
/**
|
|
63
|
+
* @typedef PushtokenReq
|
|
64
|
+
* @property {string} [action]
|
|
65
|
+
* @property {string} [bundle_identifier]
|
|
66
|
+
* @property {string} [push_token]
|
|
67
|
+
* @property {string} [type]
|
|
68
|
+
* @property {string} [unique_device_id]
|
|
69
|
+
*/
|
|
70
|
+
/**
|
|
71
|
+
* @typedef PushtokenRes
|
|
72
|
+
* @property {string} [_id]
|
|
73
|
+
* @property {string} [application_id]
|
|
74
|
+
* @property {string} [bundle_identifier]
|
|
75
|
+
* @property {string} [created_at]
|
|
76
|
+
* @property {string} [expired_at]
|
|
77
|
+
* @property {string} [platform]
|
|
78
|
+
* @property {string} [push_token]
|
|
79
|
+
* @property {string} [type]
|
|
80
|
+
* @property {string} [unique_device_id]
|
|
81
|
+
* @property {string} [updated_at]
|
|
82
|
+
* @property {string} [user_id]
|
|
83
|
+
*/
|
|
84
|
+
declare class CommunicationApplicationModel {
|
|
15
85
|
}
|
|
86
|
+
declare namespace CommunicationApplicationModel {
|
|
87
|
+
export { BadRequestSchema, CommunicationConsent, CommunicationConsentChannels, CommunicationConsentChannelsEmail, CommunicationConsentChannelsSms, CommunicationConsentChannelsWhatsapp, CommunicationConsentReq, CommunicationConsentRes, NotFound, Page, PushtokenReq, PushtokenRes };
|
|
88
|
+
}
|
|
89
|
+
/** @returns {BadRequestSchema} */
|
|
90
|
+
declare function BadRequestSchema(): BadRequestSchema;
|
|
91
|
+
type BadRequestSchema = {
|
|
92
|
+
/**
|
|
93
|
+
* - Failure message.
|
|
94
|
+
*/
|
|
95
|
+
message?: string;
|
|
96
|
+
/**
|
|
97
|
+
* - Response status.
|
|
98
|
+
*/
|
|
99
|
+
status?: string;
|
|
100
|
+
};
|
|
101
|
+
/** @returns {CommunicationConsent} */
|
|
102
|
+
declare function CommunicationConsent(): CommunicationConsent;
|
|
103
|
+
type CommunicationConsent = {
|
|
104
|
+
app_id?: string;
|
|
105
|
+
channels?: CommunicationConsentChannels;
|
|
106
|
+
user_id?: string;
|
|
107
|
+
};
|
|
108
|
+
/** @returns {CommunicationConsentChannels} */
|
|
109
|
+
declare function CommunicationConsentChannels(): CommunicationConsentChannels;
|
|
110
|
+
type CommunicationConsentChannels = {
|
|
111
|
+
email?: CommunicationConsentChannelsEmail;
|
|
112
|
+
sms?: CommunicationConsentChannelsSms;
|
|
113
|
+
whatsapp?: CommunicationConsentChannelsWhatsapp;
|
|
114
|
+
};
|
|
115
|
+
/** @returns {CommunicationConsentChannelsEmail} */
|
|
116
|
+
declare function CommunicationConsentChannelsEmail(): CommunicationConsentChannelsEmail;
|
|
117
|
+
type CommunicationConsentChannelsEmail = {
|
|
118
|
+
display_name?: string;
|
|
119
|
+
response?: string;
|
|
120
|
+
};
|
|
121
|
+
/** @returns {CommunicationConsentChannelsSms} */
|
|
122
|
+
declare function CommunicationConsentChannelsSms(): CommunicationConsentChannelsSms;
|
|
123
|
+
type CommunicationConsentChannelsSms = {
|
|
124
|
+
display_name?: string;
|
|
125
|
+
response?: string;
|
|
126
|
+
};
|
|
127
|
+
/** @returns {CommunicationConsentChannelsWhatsapp} */
|
|
128
|
+
declare function CommunicationConsentChannelsWhatsapp(): CommunicationConsentChannelsWhatsapp;
|
|
129
|
+
type CommunicationConsentChannelsWhatsapp = {
|
|
130
|
+
country_code?: string;
|
|
131
|
+
display_name?: string;
|
|
132
|
+
phone_number?: string;
|
|
133
|
+
response?: string;
|
|
134
|
+
};
|
|
135
|
+
/** @returns {CommunicationConsentReq} */
|
|
136
|
+
declare function CommunicationConsentReq(): CommunicationConsentReq;
|
|
137
|
+
type CommunicationConsentReq = {
|
|
138
|
+
action?: string;
|
|
139
|
+
channel?: string;
|
|
140
|
+
response?: string;
|
|
141
|
+
};
|
|
142
|
+
/** @returns {CommunicationConsentRes} */
|
|
143
|
+
declare function CommunicationConsentRes(): CommunicationConsentRes;
|
|
144
|
+
type CommunicationConsentRes = {
|
|
145
|
+
app_id?: string;
|
|
146
|
+
channels?: CommunicationConsentChannels;
|
|
147
|
+
user_id?: string;
|
|
148
|
+
};
|
|
149
|
+
/** @returns {NotFound} */
|
|
150
|
+
declare function NotFound(): NotFound;
|
|
151
|
+
type NotFound = {
|
|
152
|
+
/**
|
|
153
|
+
* - Failure message.
|
|
154
|
+
*/
|
|
155
|
+
message?: string;
|
|
156
|
+
};
|
|
157
|
+
/** @returns {Page} */
|
|
158
|
+
declare function Page(): Page;
|
|
159
|
+
type Page = {
|
|
160
|
+
current?: number;
|
|
161
|
+
has_next?: boolean;
|
|
162
|
+
has_previous?: boolean;
|
|
163
|
+
item_total?: number;
|
|
164
|
+
next_id?: string;
|
|
165
|
+
size?: number;
|
|
166
|
+
type: string;
|
|
167
|
+
};
|
|
168
|
+
/** @returns {PushtokenReq} */
|
|
169
|
+
declare function PushtokenReq(): PushtokenReq;
|
|
170
|
+
type PushtokenReq = {
|
|
171
|
+
action?: string;
|
|
172
|
+
bundle_identifier?: string;
|
|
173
|
+
push_token?: string;
|
|
174
|
+
type?: string;
|
|
175
|
+
unique_device_id?: string;
|
|
176
|
+
};
|
|
177
|
+
/** @returns {PushtokenRes} */
|
|
178
|
+
declare function PushtokenRes(): PushtokenRes;
|
|
179
|
+
type PushtokenRes = {
|
|
180
|
+
_id?: string;
|
|
181
|
+
application_id?: string;
|
|
182
|
+
bundle_identifier?: string;
|
|
183
|
+
created_at?: string;
|
|
184
|
+
expired_at?: string;
|
|
185
|
+
platform?: string;
|
|
186
|
+
push_token?: string;
|
|
187
|
+
type?: string;
|
|
188
|
+
unique_device_id?: string;
|
|
189
|
+
updated_at?: string;
|
|
190
|
+
user_id?: string;
|
|
191
|
+
};
|
|
@@ -1,38 +1,143 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @typedef BadRequestSchema
|
|
5
|
+
* @property {string} [message] - Failure message.
|
|
6
|
+
* @property {string} [status] - Response status.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef CommunicationConsent
|
|
11
|
+
* @property {string} [app_id]
|
|
12
|
+
* @property {CommunicationConsentChannels} [channels]
|
|
13
|
+
* @property {string} [user_id]
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @typedef CommunicationConsentChannels
|
|
18
|
+
* @property {CommunicationConsentChannelsEmail} [email]
|
|
19
|
+
* @property {CommunicationConsentChannelsSms} [sms]
|
|
20
|
+
* @property {CommunicationConsentChannelsWhatsapp} [whatsapp]
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @typedef CommunicationConsentChannelsEmail
|
|
25
|
+
* @property {string} [display_name]
|
|
26
|
+
* @property {string} [response]
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @typedef CommunicationConsentChannelsSms
|
|
31
|
+
* @property {string} [display_name]
|
|
32
|
+
* @property {string} [response]
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @typedef CommunicationConsentChannelsWhatsapp
|
|
37
|
+
* @property {string} [country_code]
|
|
38
|
+
* @property {string} [display_name]
|
|
39
|
+
* @property {string} [phone_number]
|
|
40
|
+
* @property {string} [response]
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @typedef CommunicationConsentReq
|
|
45
|
+
* @property {string} [action]
|
|
46
|
+
* @property {string} [channel]
|
|
47
|
+
* @property {string} [response]
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @typedef CommunicationConsentRes
|
|
52
|
+
* @property {string} [app_id]
|
|
53
|
+
* @property {CommunicationConsentChannels} [channels]
|
|
54
|
+
* @property {string} [user_id]
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @typedef NotFound
|
|
59
|
+
* @property {string} [message] - Failure message.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @typedef Page
|
|
64
|
+
* @property {number} [current]
|
|
65
|
+
* @property {boolean} [has_next]
|
|
66
|
+
* @property {boolean} [has_previous]
|
|
67
|
+
* @property {number} [item_total]
|
|
68
|
+
* @property {string} [next_id]
|
|
69
|
+
* @property {number} [size]
|
|
70
|
+
* @property {string} type
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @typedef PushtokenReq
|
|
75
|
+
* @property {string} [action]
|
|
76
|
+
* @property {string} [bundle_identifier]
|
|
77
|
+
* @property {string} [push_token]
|
|
78
|
+
* @property {string} [type]
|
|
79
|
+
* @property {string} [unique_device_id]
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @typedef PushtokenRes
|
|
84
|
+
* @property {string} [_id]
|
|
85
|
+
* @property {string} [application_id]
|
|
86
|
+
* @property {string} [bundle_identifier]
|
|
87
|
+
* @property {string} [created_at]
|
|
88
|
+
* @property {string} [expired_at]
|
|
89
|
+
* @property {string} [platform]
|
|
90
|
+
* @property {string} [push_token]
|
|
91
|
+
* @property {string} [type]
|
|
92
|
+
* @property {string} [unique_device_id]
|
|
93
|
+
* @property {string} [updated_at]
|
|
94
|
+
* @property {string} [user_id]
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
class CommunicationApplicationModel {
|
|
98
|
+
/** @returns {BadRequestSchema} */
|
|
4
99
|
static BadRequestSchema() {
|
|
5
100
|
return Joi.object({
|
|
6
101
|
message: Joi.string().allow(""),
|
|
7
102
|
status: Joi.string().allow(""),
|
|
8
103
|
});
|
|
9
104
|
}
|
|
105
|
+
|
|
106
|
+
/** @returns {CommunicationConsent} */
|
|
10
107
|
static CommunicationConsent() {
|
|
11
108
|
return Joi.object({
|
|
12
109
|
app_id: Joi.string().allow(""),
|
|
13
|
-
channels:
|
|
110
|
+
channels: CommunicationApplicationModel.CommunicationConsentChannels(),
|
|
14
111
|
user_id: Joi.string().allow(""),
|
|
15
112
|
});
|
|
16
113
|
}
|
|
114
|
+
|
|
115
|
+
/** @returns {CommunicationConsentChannels} */
|
|
17
116
|
static CommunicationConsentChannels() {
|
|
18
117
|
return Joi.object({
|
|
19
|
-
email:
|
|
20
|
-
sms:
|
|
21
|
-
whatsapp:
|
|
118
|
+
email: CommunicationApplicationModel.CommunicationConsentChannelsEmail(),
|
|
119
|
+
sms: CommunicationApplicationModel.CommunicationConsentChannelsSms(),
|
|
120
|
+
whatsapp: CommunicationApplicationModel.CommunicationConsentChannelsWhatsapp(),
|
|
22
121
|
});
|
|
23
122
|
}
|
|
123
|
+
|
|
124
|
+
/** @returns {CommunicationConsentChannelsEmail} */
|
|
24
125
|
static CommunicationConsentChannelsEmail() {
|
|
25
126
|
return Joi.object({
|
|
26
127
|
display_name: Joi.string().allow(""),
|
|
27
128
|
response: Joi.string().allow(""),
|
|
28
129
|
});
|
|
29
130
|
}
|
|
131
|
+
|
|
132
|
+
/** @returns {CommunicationConsentChannelsSms} */
|
|
30
133
|
static CommunicationConsentChannelsSms() {
|
|
31
134
|
return Joi.object({
|
|
32
135
|
display_name: Joi.string().allow(""),
|
|
33
136
|
response: Joi.string().allow(""),
|
|
34
137
|
});
|
|
35
138
|
}
|
|
139
|
+
|
|
140
|
+
/** @returns {CommunicationConsentChannelsWhatsapp} */
|
|
36
141
|
static CommunicationConsentChannelsWhatsapp() {
|
|
37
142
|
return Joi.object({
|
|
38
143
|
country_code: Joi.string().allow(""),
|
|
@@ -41,6 +146,8 @@ class CommunicationModel {
|
|
|
41
146
|
response: Joi.string().allow(""),
|
|
42
147
|
});
|
|
43
148
|
}
|
|
149
|
+
|
|
150
|
+
/** @returns {CommunicationConsentReq} */
|
|
44
151
|
static CommunicationConsentReq() {
|
|
45
152
|
return Joi.object({
|
|
46
153
|
action: Joi.string().allow(""),
|
|
@@ -48,18 +155,24 @@ class CommunicationModel {
|
|
|
48
155
|
response: Joi.string().allow(""),
|
|
49
156
|
});
|
|
50
157
|
}
|
|
158
|
+
|
|
159
|
+
/** @returns {CommunicationConsentRes} */
|
|
51
160
|
static CommunicationConsentRes() {
|
|
52
161
|
return Joi.object({
|
|
53
162
|
app_id: Joi.string().allow(""),
|
|
54
|
-
channels:
|
|
163
|
+
channels: CommunicationApplicationModel.CommunicationConsentChannels(),
|
|
55
164
|
user_id: Joi.string().allow(""),
|
|
56
165
|
});
|
|
57
166
|
}
|
|
167
|
+
|
|
168
|
+
/** @returns {NotFound} */
|
|
58
169
|
static NotFound() {
|
|
59
170
|
return Joi.object({
|
|
60
171
|
message: Joi.string().allow(""),
|
|
61
172
|
});
|
|
62
173
|
}
|
|
174
|
+
|
|
175
|
+
/** @returns {Page} */
|
|
63
176
|
static Page() {
|
|
64
177
|
return Joi.object({
|
|
65
178
|
current: Joi.number(),
|
|
@@ -71,6 +184,8 @@ class CommunicationModel {
|
|
|
71
184
|
type: Joi.string().allow("").required(),
|
|
72
185
|
});
|
|
73
186
|
}
|
|
187
|
+
|
|
188
|
+
/** @returns {PushtokenReq} */
|
|
74
189
|
static PushtokenReq() {
|
|
75
190
|
return Joi.object({
|
|
76
191
|
action: Joi.string().allow(""),
|
|
@@ -80,6 +195,8 @@ class CommunicationModel {
|
|
|
80
195
|
unique_device_id: Joi.string().allow(""),
|
|
81
196
|
});
|
|
82
197
|
}
|
|
198
|
+
|
|
199
|
+
/** @returns {PushtokenRes} */
|
|
83
200
|
static PushtokenRes() {
|
|
84
201
|
return Joi.object({
|
|
85
202
|
_id: Joi.string().allow(""),
|
|
@@ -96,4 +213,4 @@ class CommunicationModel {
|
|
|
96
213
|
});
|
|
97
214
|
}
|
|
98
215
|
}
|
|
99
|
-
module.exports =
|
|
216
|
+
module.exports = CommunicationApplicationModel;
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
-
export =
|
|
2
|
-
|
|
1
|
+
export = CommunicationApplicationValidator;
|
|
2
|
+
/** @typedef GetCommunicationConsentParam */
|
|
3
|
+
/**
|
|
4
|
+
* @typedef UpsertAppPushtokenParam
|
|
5
|
+
* @property {CommunicationApplicationModel.PushtokenReq} body
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @typedef UpsertCommunicationConsentParam
|
|
9
|
+
* @property {CommunicationApplicationModel.CommunicationConsentReq} body
|
|
10
|
+
*/
|
|
11
|
+
declare class CommunicationApplicationValidator {
|
|
12
|
+
/** @returns {GetCommunicationConsentParam} */
|
|
3
13
|
static getCommunicationConsent(): any;
|
|
4
|
-
|
|
5
|
-
static
|
|
14
|
+
/** @returns {UpsertAppPushtokenParam} */
|
|
15
|
+
static upsertAppPushtoken(): UpsertAppPushtokenParam;
|
|
16
|
+
/** @returns {UpsertCommunicationConsentParam} */
|
|
17
|
+
static upsertCommunicationConsent(): UpsertCommunicationConsentParam;
|
|
6
18
|
}
|
|
19
|
+
declare namespace CommunicationApplicationValidator {
|
|
20
|
+
export { GetCommunicationConsentParam, UpsertAppPushtokenParam, UpsertCommunicationConsentParam };
|
|
21
|
+
}
|
|
22
|
+
type UpsertAppPushtokenParam = {
|
|
23
|
+
body: CommunicationApplicationModel.PushtokenReq;
|
|
24
|
+
};
|
|
25
|
+
type UpsertCommunicationConsentParam = {
|
|
26
|
+
body: CommunicationApplicationModel.CommunicationConsentReq;
|
|
27
|
+
};
|
|
28
|
+
type GetCommunicationConsentParam = any;
|
|
29
|
+
import CommunicationApplicationModel = require("./CommunicationApplicationModel");
|