@gofynd/fdk-client-javascript 1.0.2 → 1.0.4
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 +31 -2
- package/index.d.ts +4 -4
- package/index.js +9 -10
- package/package.json +14 -14
- package/sdk/APIClient.d.ts +11 -0
- package/sdk/APIClient.js +35 -0
- package/sdk/Client.d.ts +6 -0
- package/sdk/Client.js +17 -0
- package/sdk/Config.d.ts +9 -0
- package/sdk/Config.js +17 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +595 -594
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +490 -885
- 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 +1079 -1078
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
- 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 +43 -42
- 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 +32 -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 +350 -349
- 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 +216 -215
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +468 -884
- 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 +65 -64
- 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 +109 -108
- 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 +31 -22
- package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
- 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 -9
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +247 -246
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +361 -656
- 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 +781 -780
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- 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 +646 -645
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
- 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 +122 -121
- 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 +94 -93
- 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 +38 -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 +619 -618
- 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 +18 -7
- package/sdk/constructUrl.d.ts +5 -0
- package/sdk/constructUrl.js +13 -0
- package/sdk/index.d.ts +3 -0
- package/sdk/index.js +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
- 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 +7 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
- 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 +26 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +40 -51
- 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 +7 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
- 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 +39 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +485 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
- 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 +30 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
- 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 +12 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
- 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 +29 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
- 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 +25 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7972 -7888
- package/sdk/platform/PlatformClient.js +8678 -10107
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
- 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 +15 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -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 +115 -113
- 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 +2 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/.github/workflows/on_create_release.yml +0 -23
- package/.github/workflows/on_merge_main.yml +0 -38
- package/.github/workflows/on_pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/documentation/application/CART.md +0 -7339
- package/documentation/application/CATALOG.md +0 -9597
- package/documentation/application/COMMON.md +0 -452
- package/documentation/application/COMMUNICATION.md +0 -467
- package/documentation/application/CONFIGURATION.md +0 -2906
- package/documentation/application/CONTENT.md +0 -3351
- package/documentation/application/FILESTORAGE.md +0 -578
- package/documentation/application/LEAD.md +0 -1895
- package/documentation/application/LOGISTIC.md +0 -765
- package/documentation/application/ORDER.md +0 -3432
- package/documentation/application/PAYMENT.md +0 -5221
- package/documentation/application/POSCART.md +0 -7938
- package/documentation/application/README.md +0 -21
- package/documentation/application/REWARDS.md +0 -708
- package/documentation/application/SHARE.md +0 -733
- package/documentation/application/THEME.md +0 -5800
- package/documentation/application/USER.md +0 -4335
- package/documentation/platform/ANALYTICS.md +0 -1154
- package/documentation/platform/AUDITTRAIL.md +0 -576
- package/documentation/platform/BILLING.md +0 -2400
- package/documentation/platform/CART.md +0 -5559
- package/documentation/platform/CATALOG.md +0 -23261
- package/documentation/platform/COMMON.md +0 -452
- package/documentation/platform/COMMUNICATION.md +0 -5718
- package/documentation/platform/COMPANYPROFILE.md +0 -2031
- package/documentation/platform/CONFIGURATION.md +0 -7339
- package/documentation/platform/CONTENT.md +0 -9098
- package/documentation/platform/DISCOUNT.md +0 -863
- package/documentation/platform/FILESTORAGE.md +0 -1081
- package/documentation/platform/INVENTORY.md +0 -1779
- package/documentation/platform/LEAD.md +0 -4740
- package/documentation/platform/ORDER.md +0 -8486
- package/documentation/platform/PARTNER.md +0 -220
- package/documentation/platform/PAYMENT.md +0 -3448
- package/documentation/platform/README.md +0 -27
- package/documentation/platform/REWARDS.md +0 -1083
- package/documentation/platform/SHARE.md +0 -606
- package/documentation/platform/THEME.md +0 -35729
- package/documentation/platform/USER.md +0 -2319
- package/documentation/platform/WEBHOOK.md +0 -591
- package/documentation/public/CONFIGURATION.md +0 -452
- package/documentation/public/INVENTORY.md +0 -690
- package/documentation/public/WEBHOOK.md +0 -352
- package/jest.config.d.ts +0 -4
- package/jest.config.js +0 -6
- package/tests/application/catalog.spec.js +0 -47
- package/tests/common/action-url.spec.js +0 -35
- package/tests/common/schema/action-url.json +0 -178
- package/tests/common/schema/url-action.json +0 -683
- package/tests/common/url-action.spec.js +0 -48
- package/tests/helpers/cookie.helper.js +0 -31
- package/tests/helpers/oauth.helper.js +0 -43
- package/tests/platform/catalog.spec.js +0 -49
- package/tests/public/location.spec.js +0 -39
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const DiscountValidator = require("./DiscountPlatformValidator");
|
|
5
5
|
const DiscountModel = require("./DiscountPlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class Discount {
|
|
9
10
|
constructor(config) {
|
|
@@ -12,42 +13,15 @@ class Discount {
|
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* @param {Object} arg - Arg object.
|
|
15
|
-
* @param {string}
|
|
16
|
-
* @
|
|
17
|
-
*
|
|
18
|
-
* @
|
|
19
|
-
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
20
|
-
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
21
|
-
* @param {number} [arg.month] - Month. Default is current month.
|
|
22
|
-
* @param {number} [arg.year] - Year. Default is current year.
|
|
23
|
-
* @param {string} [arg.type] - Basic or custom.
|
|
24
|
-
* @param {string[]} [arg.appIds] - Application ids.
|
|
25
|
-
* @returns {Promise<ListOrCalender>} - Success response
|
|
26
|
-
* @summary: Fetch discount list.
|
|
27
|
-
* @description: Fetch discount list.
|
|
16
|
+
* @param {string} arg.id - Id
|
|
17
|
+
* @returns {Promise<CancelJobResponse>} - Success response
|
|
18
|
+
* @summary: Cancel Download Job.
|
|
19
|
+
* @description: Cancel Download Job.
|
|
28
20
|
*/
|
|
29
|
-
async
|
|
30
|
-
|
|
31
|
-
q,
|
|
32
|
-
pageNo,
|
|
33
|
-
pageSize,
|
|
34
|
-
archived,
|
|
35
|
-
month,
|
|
36
|
-
year,
|
|
37
|
-
type,
|
|
38
|
-
appIds,
|
|
39
|
-
} = {}) {
|
|
40
|
-
const { error } = DiscountValidator.getDiscounts().validate(
|
|
21
|
+
async cancelDownloadJob({ id } = {}) {
|
|
22
|
+
const { error } = DiscountValidator.cancelDownloadJob().validate(
|
|
41
23
|
{
|
|
42
|
-
|
|
43
|
-
q,
|
|
44
|
-
pageNo,
|
|
45
|
-
pageSize,
|
|
46
|
-
archived,
|
|
47
|
-
month,
|
|
48
|
-
year,
|
|
49
|
-
type,
|
|
50
|
-
appIds,
|
|
24
|
+
id,
|
|
51
25
|
},
|
|
52
26
|
{ abortEarly: false, allowUnknown: true }
|
|
53
27
|
);
|
|
@@ -56,45 +30,28 @@ class Discount {
|
|
|
56
30
|
}
|
|
57
31
|
|
|
58
32
|
// Showing warrnings if extra unknown parameters are found
|
|
59
|
-
const { error: warrning } = DiscountValidator.
|
|
33
|
+
const { error: warrning } = DiscountValidator.cancelDownloadJob().validate(
|
|
60
34
|
{
|
|
61
|
-
|
|
62
|
-
q,
|
|
63
|
-
pageNo,
|
|
64
|
-
pageSize,
|
|
65
|
-
archived,
|
|
66
|
-
month,
|
|
67
|
-
year,
|
|
68
|
-
type,
|
|
69
|
-
appIds,
|
|
35
|
+
id,
|
|
70
36
|
},
|
|
71
37
|
{ abortEarly: false, allowUnknown: false }
|
|
72
38
|
);
|
|
73
39
|
if (warrning) {
|
|
74
40
|
Logger({
|
|
75
41
|
level: "WARN",
|
|
76
|
-
message: "Parameter Validation warrnings for
|
|
42
|
+
message: "Parameter Validation warrnings for cancelDownloadJob",
|
|
77
43
|
});
|
|
78
44
|
Logger({ level: "WARN", message: warrning });
|
|
79
45
|
}
|
|
80
46
|
|
|
81
47
|
const query_params = {};
|
|
82
|
-
query_params["view"] = view;
|
|
83
|
-
query_params["q"] = q;
|
|
84
|
-
query_params["page_no"] = pageNo;
|
|
85
|
-
query_params["page_size"] = pageSize;
|
|
86
|
-
query_params["archived"] = archived;
|
|
87
|
-
query_params["month"] = month;
|
|
88
|
-
query_params["year"] = year;
|
|
89
|
-
query_params["type"] = type;
|
|
90
|
-
query_params["app_ids"] = appIds;
|
|
91
48
|
|
|
92
49
|
const xHeaders = {};
|
|
93
50
|
|
|
94
51
|
const response = await PlatformAPIClient.execute(
|
|
95
52
|
this.config,
|
|
96
|
-
"
|
|
97
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
53
|
+
"delete",
|
|
54
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
98
55
|
query_params,
|
|
99
56
|
undefined,
|
|
100
57
|
xHeaders
|
|
@@ -102,7 +59,7 @@ class Discount {
|
|
|
102
59
|
|
|
103
60
|
const {
|
|
104
61
|
error: res_error,
|
|
105
|
-
} = DiscountModel.
|
|
62
|
+
} = DiscountModel.CancelJobResponse().validate(response, {
|
|
106
63
|
abortEarly: false,
|
|
107
64
|
allowUnknown: false,
|
|
108
65
|
});
|
|
@@ -110,7 +67,7 @@ class Discount {
|
|
|
110
67
|
if (res_error) {
|
|
111
68
|
Logger({
|
|
112
69
|
level: "WARN",
|
|
113
|
-
message: "Response Validation Warnnings for
|
|
70
|
+
message: "Response Validation Warnnings for cancelDownloadJob",
|
|
114
71
|
});
|
|
115
72
|
Logger({ level: "WARN", message: res_error });
|
|
116
73
|
}
|
|
@@ -120,15 +77,15 @@ class Discount {
|
|
|
120
77
|
|
|
121
78
|
/**
|
|
122
79
|
* @param {Object} arg - Arg object.
|
|
123
|
-
* @param {
|
|
124
|
-
* @returns {Promise<
|
|
125
|
-
* @summary:
|
|
126
|
-
* @description:
|
|
80
|
+
* @param {string} arg.id - Id
|
|
81
|
+
* @returns {Promise<CancelJobResponse>} - Success response
|
|
82
|
+
* @summary: Cancel Validation Job.
|
|
83
|
+
* @description: Cancel Validation Job.
|
|
127
84
|
*/
|
|
128
|
-
async
|
|
129
|
-
const { error } = DiscountValidator.
|
|
85
|
+
async cancelValidationJob({ id } = {}) {
|
|
86
|
+
const { error } = DiscountValidator.cancelValidationJob().validate(
|
|
130
87
|
{
|
|
131
|
-
|
|
88
|
+
id,
|
|
132
89
|
},
|
|
133
90
|
{ abortEarly: false, allowUnknown: true }
|
|
134
91
|
);
|
|
@@ -137,16 +94,18 @@ class Discount {
|
|
|
137
94
|
}
|
|
138
95
|
|
|
139
96
|
// Showing warrnings if extra unknown parameters are found
|
|
140
|
-
const {
|
|
97
|
+
const {
|
|
98
|
+
error: warrning,
|
|
99
|
+
} = DiscountValidator.cancelValidationJob().validate(
|
|
141
100
|
{
|
|
142
|
-
|
|
101
|
+
id,
|
|
143
102
|
},
|
|
144
103
|
{ abortEarly: false, allowUnknown: false }
|
|
145
104
|
);
|
|
146
105
|
if (warrning) {
|
|
147
106
|
Logger({
|
|
148
107
|
level: "WARN",
|
|
149
|
-
message: "Parameter Validation warrnings for
|
|
108
|
+
message: "Parameter Validation warrnings for cancelValidationJob",
|
|
150
109
|
});
|
|
151
110
|
Logger({ level: "WARN", message: warrning });
|
|
152
111
|
}
|
|
@@ -157,22 +116,24 @@ class Discount {
|
|
|
157
116
|
|
|
158
117
|
const response = await PlatformAPIClient.execute(
|
|
159
118
|
this.config,
|
|
160
|
-
"
|
|
161
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
119
|
+
"delete",
|
|
120
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
|
|
162
121
|
query_params,
|
|
163
|
-
|
|
122
|
+
undefined,
|
|
164
123
|
xHeaders
|
|
165
124
|
);
|
|
166
125
|
|
|
167
|
-
const {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
126
|
+
const {
|
|
127
|
+
error: res_error,
|
|
128
|
+
} = DiscountModel.CancelJobResponse().validate(response, {
|
|
129
|
+
abortEarly: false,
|
|
130
|
+
allowUnknown: false,
|
|
131
|
+
});
|
|
171
132
|
|
|
172
133
|
if (res_error) {
|
|
173
134
|
Logger({
|
|
174
135
|
level: "WARN",
|
|
175
|
-
message: "Response Validation Warnnings for
|
|
136
|
+
message: "Response Validation Warnnings for cancelValidationJob",
|
|
176
137
|
});
|
|
177
138
|
Logger({ level: "WARN", message: res_error });
|
|
178
139
|
}
|
|
@@ -182,15 +143,15 @@ class Discount {
|
|
|
182
143
|
|
|
183
144
|
/**
|
|
184
145
|
* @param {Object} arg - Arg object.
|
|
185
|
-
* @param {
|
|
146
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
186
147
|
* @returns {Promise<DiscountJob>} - Success response
|
|
187
|
-
* @summary:
|
|
188
|
-
* @description:
|
|
148
|
+
* @summary: Create Discount.
|
|
149
|
+
* @description: Create Discount.
|
|
189
150
|
*/
|
|
190
|
-
async
|
|
191
|
-
const { error } = DiscountValidator.
|
|
151
|
+
async createDiscount({ body } = {}) {
|
|
152
|
+
const { error } = DiscountValidator.createDiscount().validate(
|
|
192
153
|
{
|
|
193
|
-
|
|
154
|
+
body,
|
|
194
155
|
},
|
|
195
156
|
{ abortEarly: false, allowUnknown: true }
|
|
196
157
|
);
|
|
@@ -199,16 +160,16 @@ class Discount {
|
|
|
199
160
|
}
|
|
200
161
|
|
|
201
162
|
// Showing warrnings if extra unknown parameters are found
|
|
202
|
-
const { error: warrning } = DiscountValidator.
|
|
163
|
+
const { error: warrning } = DiscountValidator.createDiscount().validate(
|
|
203
164
|
{
|
|
204
|
-
|
|
165
|
+
body,
|
|
205
166
|
},
|
|
206
167
|
{ abortEarly: false, allowUnknown: false }
|
|
207
168
|
);
|
|
208
169
|
if (warrning) {
|
|
209
170
|
Logger({
|
|
210
171
|
level: "WARN",
|
|
211
|
-
message: "Parameter Validation warrnings for
|
|
172
|
+
message: "Parameter Validation warrnings for createDiscount",
|
|
212
173
|
});
|
|
213
174
|
Logger({ level: "WARN", message: warrning });
|
|
214
175
|
}
|
|
@@ -219,10 +180,10 @@ class Discount {
|
|
|
219
180
|
|
|
220
181
|
const response = await PlatformAPIClient.execute(
|
|
221
182
|
this.config,
|
|
222
|
-
"
|
|
223
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/job
|
|
183
|
+
"post",
|
|
184
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
224
185
|
query_params,
|
|
225
|
-
|
|
186
|
+
body,
|
|
226
187
|
xHeaders
|
|
227
188
|
);
|
|
228
189
|
|
|
@@ -234,7 +195,7 @@ class Discount {
|
|
|
234
195
|
if (res_error) {
|
|
235
196
|
Logger({
|
|
236
197
|
level: "WARN",
|
|
237
|
-
message: "Response Validation Warnnings for
|
|
198
|
+
message: "Response Validation Warnnings for createDiscount",
|
|
238
199
|
});
|
|
239
200
|
Logger({ level: "WARN", message: res_error });
|
|
240
201
|
}
|
|
@@ -244,16 +205,16 @@ class Discount {
|
|
|
244
205
|
|
|
245
206
|
/**
|
|
246
207
|
* @param {Object} arg - Arg object.
|
|
247
|
-
* @param {string} arg.
|
|
248
|
-
* @param {
|
|
249
|
-
* @returns {Promise<
|
|
250
|
-
* @summary:
|
|
251
|
-
* @description:
|
|
208
|
+
* @param {string} arg.type - Type
|
|
209
|
+
* @param {DownloadFileJob} arg.body
|
|
210
|
+
* @returns {Promise<FileJobResponse>} - Success response
|
|
211
|
+
* @summary: Validate File.
|
|
212
|
+
* @description: Validate File.
|
|
252
213
|
*/
|
|
253
|
-
async
|
|
254
|
-
const { error } = DiscountValidator.
|
|
214
|
+
async downloadDiscountFile({ type, body } = {}) {
|
|
215
|
+
const { error } = DiscountValidator.downloadDiscountFile().validate(
|
|
255
216
|
{
|
|
256
|
-
|
|
217
|
+
type,
|
|
257
218
|
body,
|
|
258
219
|
},
|
|
259
220
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -263,9 +224,11 @@ class Discount {
|
|
|
263
224
|
}
|
|
264
225
|
|
|
265
226
|
// Showing warrnings if extra unknown parameters are found
|
|
266
|
-
const {
|
|
227
|
+
const {
|
|
228
|
+
error: warrning,
|
|
229
|
+
} = DiscountValidator.downloadDiscountFile().validate(
|
|
267
230
|
{
|
|
268
|
-
|
|
231
|
+
type,
|
|
269
232
|
body,
|
|
270
233
|
},
|
|
271
234
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -273,7 +236,7 @@ class Discount {
|
|
|
273
236
|
if (warrning) {
|
|
274
237
|
Logger({
|
|
275
238
|
level: "WARN",
|
|
276
|
-
message: "Parameter Validation warrnings for
|
|
239
|
+
message: "Parameter Validation warrnings for downloadDiscountFile",
|
|
277
240
|
});
|
|
278
241
|
Logger({ level: "WARN", message: warrning });
|
|
279
242
|
}
|
|
@@ -284,22 +247,24 @@ class Discount {
|
|
|
284
247
|
|
|
285
248
|
const response = await PlatformAPIClient.execute(
|
|
286
249
|
this.config,
|
|
287
|
-
"
|
|
288
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
250
|
+
"post",
|
|
251
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
|
|
289
252
|
query_params,
|
|
290
253
|
body,
|
|
291
254
|
xHeaders
|
|
292
255
|
);
|
|
293
256
|
|
|
294
|
-
const {
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
257
|
+
const {
|
|
258
|
+
error: res_error,
|
|
259
|
+
} = DiscountModel.FileJobResponse().validate(response, {
|
|
260
|
+
abortEarly: false,
|
|
261
|
+
allowUnknown: false,
|
|
262
|
+
});
|
|
298
263
|
|
|
299
264
|
if (res_error) {
|
|
300
265
|
Logger({
|
|
301
266
|
level: "WARN",
|
|
302
|
-
message: "Response Validation Warnnings for
|
|
267
|
+
message: "Response Validation Warnnings for downloadDiscountFile",
|
|
303
268
|
});
|
|
304
269
|
Logger({ level: "WARN", message: res_error });
|
|
305
270
|
}
|
|
@@ -309,17 +274,15 @@ class Discount {
|
|
|
309
274
|
|
|
310
275
|
/**
|
|
311
276
|
* @param {Object} arg - Arg object.
|
|
312
|
-
* @param {string} arg.id -
|
|
313
|
-
* @
|
|
314
|
-
* @
|
|
315
|
-
* @
|
|
316
|
-
* @description: Create custom discounts through API.
|
|
277
|
+
* @param {string} arg.id - Unique id.
|
|
278
|
+
* @returns {Promise<DiscountJob>} - Success response
|
|
279
|
+
* @summary: Fetch discount.
|
|
280
|
+
* @description: Fetch discount.
|
|
317
281
|
*/
|
|
318
|
-
async
|
|
319
|
-
const { error } = DiscountValidator.
|
|
282
|
+
async getDiscount({ id } = {}) {
|
|
283
|
+
const { error } = DiscountValidator.getDiscount().validate(
|
|
320
284
|
{
|
|
321
285
|
id,
|
|
322
|
-
body,
|
|
323
286
|
},
|
|
324
287
|
{ abortEarly: false, allowUnknown: true }
|
|
325
288
|
);
|
|
@@ -328,19 +291,16 @@ class Discount {
|
|
|
328
291
|
}
|
|
329
292
|
|
|
330
293
|
// Showing warrnings if extra unknown parameters are found
|
|
331
|
-
const {
|
|
332
|
-
error: warrning,
|
|
333
|
-
} = DiscountValidator.upsertDiscountItems().validate(
|
|
294
|
+
const { error: warrning } = DiscountValidator.getDiscount().validate(
|
|
334
295
|
{
|
|
335
296
|
id,
|
|
336
|
-
body,
|
|
337
297
|
},
|
|
338
298
|
{ abortEarly: false, allowUnknown: false }
|
|
339
299
|
);
|
|
340
300
|
if (warrning) {
|
|
341
301
|
Logger({
|
|
342
302
|
level: "WARN",
|
|
343
|
-
message: "Parameter Validation warrnings for
|
|
303
|
+
message: "Parameter Validation warrnings for getDiscount",
|
|
344
304
|
});
|
|
345
305
|
Logger({ level: "WARN", message: warrning });
|
|
346
306
|
}
|
|
@@ -351,22 +311,22 @@ class Discount {
|
|
|
351
311
|
|
|
352
312
|
const response = await PlatformAPIClient.execute(
|
|
353
313
|
this.config,
|
|
354
|
-
"
|
|
355
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}
|
|
314
|
+
"get",
|
|
315
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
356
316
|
query_params,
|
|
357
|
-
|
|
317
|
+
undefined,
|
|
358
318
|
xHeaders
|
|
359
319
|
);
|
|
360
320
|
|
|
361
|
-
const { error: res_error } =
|
|
362
|
-
|
|
363
|
-
allowUnknown: false
|
|
364
|
-
|
|
321
|
+
const { error: res_error } = DiscountModel.DiscountJob().validate(
|
|
322
|
+
response,
|
|
323
|
+
{ abortEarly: false, allowUnknown: false }
|
|
324
|
+
);
|
|
365
325
|
|
|
366
326
|
if (res_error) {
|
|
367
327
|
Logger({
|
|
368
328
|
level: "WARN",
|
|
369
|
-
message: "Response Validation Warnnings for
|
|
329
|
+
message: "Response Validation Warnnings for getDiscount",
|
|
370
330
|
});
|
|
371
331
|
Logger({ level: "WARN", message: res_error });
|
|
372
332
|
}
|
|
@@ -376,17 +336,42 @@ class Discount {
|
|
|
376
336
|
|
|
377
337
|
/**
|
|
378
338
|
* @param {Object} arg - Arg object.
|
|
379
|
-
* @param {string} [arg.
|
|
380
|
-
* @param {
|
|
381
|
-
*
|
|
382
|
-
* @
|
|
383
|
-
* @
|
|
339
|
+
* @param {string} [arg.view] - Listing or calender. Default is listing.
|
|
340
|
+
* @param {string} [arg.q] - The search query. This can be a partial or
|
|
341
|
+
* complete name of a discount.
|
|
342
|
+
* @param {number} [arg.pageNo] - Page number. Default is 1.
|
|
343
|
+
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
344
|
+
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
345
|
+
* @param {number} [arg.month] - Month. Default is current month.
|
|
346
|
+
* @param {number} [arg.year] - Year. Default is current year.
|
|
347
|
+
* @param {string} [arg.type] - Basic or custom.
|
|
348
|
+
* @param {string[]} [arg.appIds] - Application ids.
|
|
349
|
+
* @returns {Promise<ListOrCalender>} - Success response
|
|
350
|
+
* @summary: Fetch discount list.
|
|
351
|
+
* @description: Fetch discount list.
|
|
384
352
|
*/
|
|
385
|
-
async
|
|
386
|
-
|
|
353
|
+
async getDiscounts({
|
|
354
|
+
view,
|
|
355
|
+
q,
|
|
356
|
+
pageNo,
|
|
357
|
+
pageSize,
|
|
358
|
+
archived,
|
|
359
|
+
month,
|
|
360
|
+
year,
|
|
361
|
+
type,
|
|
362
|
+
appIds,
|
|
363
|
+
} = {}) {
|
|
364
|
+
const { error } = DiscountValidator.getDiscounts().validate(
|
|
387
365
|
{
|
|
388
|
-
|
|
389
|
-
|
|
366
|
+
view,
|
|
367
|
+
q,
|
|
368
|
+
pageNo,
|
|
369
|
+
pageSize,
|
|
370
|
+
archived,
|
|
371
|
+
month,
|
|
372
|
+
year,
|
|
373
|
+
type,
|
|
374
|
+
appIds,
|
|
390
375
|
},
|
|
391
376
|
{ abortEarly: false, allowUnknown: true }
|
|
392
377
|
);
|
|
@@ -395,40 +380,53 @@ class Discount {
|
|
|
395
380
|
}
|
|
396
381
|
|
|
397
382
|
// Showing warrnings if extra unknown parameters are found
|
|
398
|
-
const {
|
|
399
|
-
error: warrning,
|
|
400
|
-
} = DiscountValidator.validateDiscountFile().validate(
|
|
383
|
+
const { error: warrning } = DiscountValidator.getDiscounts().validate(
|
|
401
384
|
{
|
|
402
|
-
|
|
403
|
-
|
|
385
|
+
view,
|
|
386
|
+
q,
|
|
387
|
+
pageNo,
|
|
388
|
+
pageSize,
|
|
389
|
+
archived,
|
|
390
|
+
month,
|
|
391
|
+
year,
|
|
392
|
+
type,
|
|
393
|
+
appIds,
|
|
404
394
|
},
|
|
405
395
|
{ abortEarly: false, allowUnknown: false }
|
|
406
396
|
);
|
|
407
397
|
if (warrning) {
|
|
408
398
|
Logger({
|
|
409
399
|
level: "WARN",
|
|
410
|
-
message: "Parameter Validation warrnings for
|
|
400
|
+
message: "Parameter Validation warrnings for getDiscounts",
|
|
411
401
|
});
|
|
412
402
|
Logger({ level: "WARN", message: warrning });
|
|
413
403
|
}
|
|
414
404
|
|
|
415
405
|
const query_params = {};
|
|
416
|
-
query_params["
|
|
406
|
+
query_params["view"] = view;
|
|
407
|
+
query_params["q"] = q;
|
|
408
|
+
query_params["page_no"] = pageNo;
|
|
409
|
+
query_params["page_size"] = pageSize;
|
|
410
|
+
query_params["archived"] = archived;
|
|
411
|
+
query_params["month"] = month;
|
|
412
|
+
query_params["year"] = year;
|
|
413
|
+
query_params["type"] = type;
|
|
414
|
+
query_params["app_ids"] = appIds;
|
|
417
415
|
|
|
418
416
|
const xHeaders = {};
|
|
419
417
|
|
|
420
418
|
const response = await PlatformAPIClient.execute(
|
|
421
419
|
this.config,
|
|
422
|
-
"
|
|
423
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
420
|
+
"get",
|
|
421
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
424
422
|
query_params,
|
|
425
|
-
|
|
423
|
+
undefined,
|
|
426
424
|
xHeaders
|
|
427
425
|
);
|
|
428
426
|
|
|
429
427
|
const {
|
|
430
428
|
error: res_error,
|
|
431
|
-
} = DiscountModel.
|
|
429
|
+
} = DiscountModel.ListOrCalender().validate(response, {
|
|
432
430
|
abortEarly: false,
|
|
433
431
|
allowUnknown: false,
|
|
434
432
|
});
|
|
@@ -436,7 +434,7 @@ class Discount {
|
|
|
436
434
|
if (res_error) {
|
|
437
435
|
Logger({
|
|
438
436
|
level: "WARN",
|
|
439
|
-
message: "Response Validation Warnnings for
|
|
437
|
+
message: "Response Validation Warnnings for getDiscounts",
|
|
440
438
|
});
|
|
441
439
|
Logger({ level: "WARN", message: res_error });
|
|
442
440
|
}
|
|
@@ -446,17 +444,15 @@ class Discount {
|
|
|
446
444
|
|
|
447
445
|
/**
|
|
448
446
|
* @param {Object} arg - Arg object.
|
|
449
|
-
* @param {string} arg.
|
|
450
|
-
* @param {DownloadFileJob} arg.body
|
|
447
|
+
* @param {string} arg.id - Id
|
|
451
448
|
* @returns {Promise<FileJobResponse>} - Success response
|
|
452
|
-
* @summary:
|
|
453
|
-
* @description:
|
|
449
|
+
* @summary: Download File Job.
|
|
450
|
+
* @description: Download File Job.
|
|
454
451
|
*/
|
|
455
|
-
async
|
|
456
|
-
const { error } = DiscountValidator.
|
|
452
|
+
async getDownloadJob({ id } = {}) {
|
|
453
|
+
const { error } = DiscountValidator.getDownloadJob().validate(
|
|
457
454
|
{
|
|
458
|
-
|
|
459
|
-
body,
|
|
455
|
+
id,
|
|
460
456
|
},
|
|
461
457
|
{ abortEarly: false, allowUnknown: true }
|
|
462
458
|
);
|
|
@@ -465,19 +461,16 @@ class Discount {
|
|
|
465
461
|
}
|
|
466
462
|
|
|
467
463
|
// Showing warrnings if extra unknown parameters are found
|
|
468
|
-
const {
|
|
469
|
-
error: warrning,
|
|
470
|
-
} = DiscountValidator.downloadDiscountFile().validate(
|
|
464
|
+
const { error: warrning } = DiscountValidator.getDownloadJob().validate(
|
|
471
465
|
{
|
|
472
|
-
|
|
473
|
-
body,
|
|
466
|
+
id,
|
|
474
467
|
},
|
|
475
468
|
{ abortEarly: false, allowUnknown: false }
|
|
476
469
|
);
|
|
477
470
|
if (warrning) {
|
|
478
471
|
Logger({
|
|
479
472
|
level: "WARN",
|
|
480
|
-
message: "Parameter Validation warrnings for
|
|
473
|
+
message: "Parameter Validation warrnings for getDownloadJob",
|
|
481
474
|
});
|
|
482
475
|
Logger({ level: "WARN", message: warrning });
|
|
483
476
|
}
|
|
@@ -488,10 +481,10 @@ class Discount {
|
|
|
488
481
|
|
|
489
482
|
const response = await PlatformAPIClient.execute(
|
|
490
483
|
this.config,
|
|
491
|
-
"
|
|
492
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/${
|
|
484
|
+
"get",
|
|
485
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
493
486
|
query_params,
|
|
494
|
-
|
|
487
|
+
undefined,
|
|
495
488
|
xHeaders
|
|
496
489
|
);
|
|
497
490
|
|
|
@@ -505,7 +498,7 @@ class Discount {
|
|
|
505
498
|
if (res_error) {
|
|
506
499
|
Logger({
|
|
507
500
|
level: "WARN",
|
|
508
|
-
message: "Response Validation Warnnings for
|
|
501
|
+
message: "Response Validation Warnnings for getDownloadJob",
|
|
509
502
|
});
|
|
510
503
|
Logger({ level: "WARN", message: res_error });
|
|
511
504
|
}
|
|
@@ -580,14 +573,16 @@ class Discount {
|
|
|
580
573
|
/**
|
|
581
574
|
* @param {Object} arg - Arg object.
|
|
582
575
|
* @param {string} arg.id - Id
|
|
583
|
-
* @
|
|
584
|
-
* @
|
|
585
|
-
* @
|
|
576
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
577
|
+
* @returns {Promise<DiscountJob>} - Success response
|
|
578
|
+
* @summary: Create Discount.
|
|
579
|
+
* @description: Create Discount.
|
|
586
580
|
*/
|
|
587
|
-
async
|
|
588
|
-
const { error } = DiscountValidator.
|
|
581
|
+
async updateDiscount({ id, body } = {}) {
|
|
582
|
+
const { error } = DiscountValidator.updateDiscount().validate(
|
|
589
583
|
{
|
|
590
584
|
id,
|
|
585
|
+
body,
|
|
591
586
|
},
|
|
592
587
|
{ abortEarly: false, allowUnknown: true }
|
|
593
588
|
);
|
|
@@ -596,18 +591,17 @@ class Discount {
|
|
|
596
591
|
}
|
|
597
592
|
|
|
598
593
|
// Showing warrnings if extra unknown parameters are found
|
|
599
|
-
const {
|
|
600
|
-
error: warrning,
|
|
601
|
-
} = DiscountValidator.cancelValidationJob().validate(
|
|
594
|
+
const { error: warrning } = DiscountValidator.updateDiscount().validate(
|
|
602
595
|
{
|
|
603
596
|
id,
|
|
597
|
+
body,
|
|
604
598
|
},
|
|
605
599
|
{ abortEarly: false, allowUnknown: false }
|
|
606
600
|
);
|
|
607
601
|
if (warrning) {
|
|
608
602
|
Logger({
|
|
609
603
|
level: "WARN",
|
|
610
|
-
message: "Parameter Validation warrnings for
|
|
604
|
+
message: "Parameter Validation warrnings for updateDiscount",
|
|
611
605
|
});
|
|
612
606
|
Logger({ level: "WARN", message: warrning });
|
|
613
607
|
}
|
|
@@ -618,24 +612,22 @@ class Discount {
|
|
|
618
612
|
|
|
619
613
|
const response = await PlatformAPIClient.execute(
|
|
620
614
|
this.config,
|
|
621
|
-
"
|
|
622
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
615
|
+
"put",
|
|
616
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
623
617
|
query_params,
|
|
624
|
-
|
|
618
|
+
body,
|
|
625
619
|
xHeaders
|
|
626
620
|
);
|
|
627
621
|
|
|
628
|
-
const {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
allowUnknown: false,
|
|
633
|
-
});
|
|
622
|
+
const { error: res_error } = DiscountModel.DiscountJob().validate(
|
|
623
|
+
response,
|
|
624
|
+
{ abortEarly: false, allowUnknown: false }
|
|
625
|
+
);
|
|
634
626
|
|
|
635
627
|
if (res_error) {
|
|
636
628
|
Logger({
|
|
637
629
|
level: "WARN",
|
|
638
|
-
message: "Response Validation Warnnings for
|
|
630
|
+
message: "Response Validation Warnnings for updateDiscount",
|
|
639
631
|
});
|
|
640
632
|
Logger({ level: "WARN", message: res_error });
|
|
641
633
|
}
|
|
@@ -645,15 +637,17 @@ class Discount {
|
|
|
645
637
|
|
|
646
638
|
/**
|
|
647
639
|
* @param {Object} arg - Arg object.
|
|
648
|
-
* @param {string} arg.id -
|
|
649
|
-
* @
|
|
650
|
-
* @
|
|
651
|
-
* @
|
|
640
|
+
* @param {string} arg.id - Job ID of the discount.
|
|
641
|
+
* @param {BulkDiscount} arg.body
|
|
642
|
+
* @returns {Promise<Object>} - Success response
|
|
643
|
+
* @summary: Create custom discount from bulk.
|
|
644
|
+
* @description: Create custom discounts through API.
|
|
652
645
|
*/
|
|
653
|
-
async
|
|
654
|
-
const { error } = DiscountValidator.
|
|
646
|
+
async upsertDiscountItems({ id, body } = {}) {
|
|
647
|
+
const { error } = DiscountValidator.upsertDiscountItems().validate(
|
|
655
648
|
{
|
|
656
649
|
id,
|
|
650
|
+
body,
|
|
657
651
|
},
|
|
658
652
|
{ abortEarly: false, allowUnknown: true }
|
|
659
653
|
);
|
|
@@ -662,16 +656,19 @@ class Discount {
|
|
|
662
656
|
}
|
|
663
657
|
|
|
664
658
|
// Showing warrnings if extra unknown parameters are found
|
|
665
|
-
const {
|
|
659
|
+
const {
|
|
660
|
+
error: warrning,
|
|
661
|
+
} = DiscountValidator.upsertDiscountItems().validate(
|
|
666
662
|
{
|
|
667
663
|
id,
|
|
664
|
+
body,
|
|
668
665
|
},
|
|
669
666
|
{ abortEarly: false, allowUnknown: false }
|
|
670
667
|
);
|
|
671
668
|
if (warrning) {
|
|
672
669
|
Logger({
|
|
673
670
|
level: "WARN",
|
|
674
|
-
message: "Parameter Validation warrnings for
|
|
671
|
+
message: "Parameter Validation warrnings for upsertDiscountItems",
|
|
675
672
|
});
|
|
676
673
|
Logger({ level: "WARN", message: warrning });
|
|
677
674
|
}
|
|
@@ -682,16 +679,14 @@ class Discount {
|
|
|
682
679
|
|
|
683
680
|
const response = await PlatformAPIClient.execute(
|
|
684
681
|
this.config,
|
|
685
|
-
"
|
|
686
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/
|
|
682
|
+
"post",
|
|
683
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
|
|
687
684
|
query_params,
|
|
688
|
-
|
|
685
|
+
body,
|
|
689
686
|
xHeaders
|
|
690
687
|
);
|
|
691
688
|
|
|
692
|
-
const {
|
|
693
|
-
error: res_error,
|
|
694
|
-
} = DiscountModel.FileJobResponse().validate(response, {
|
|
689
|
+
const { error: res_error } = Joi.any().validate(response, {
|
|
695
690
|
abortEarly: false,
|
|
696
691
|
allowUnknown: false,
|
|
697
692
|
});
|
|
@@ -699,7 +694,7 @@ class Discount {
|
|
|
699
694
|
if (res_error) {
|
|
700
695
|
Logger({
|
|
701
696
|
level: "WARN",
|
|
702
|
-
message: "Response Validation Warnnings for
|
|
697
|
+
message: "Response Validation Warnnings for upsertDiscountItems",
|
|
703
698
|
});
|
|
704
699
|
Logger({ level: "WARN", message: res_error });
|
|
705
700
|
}
|
|
@@ -709,15 +704,17 @@ class Discount {
|
|
|
709
704
|
|
|
710
705
|
/**
|
|
711
706
|
* @param {Object} arg - Arg object.
|
|
712
|
-
* @param {string} arg.
|
|
713
|
-
* @
|
|
714
|
-
* @
|
|
715
|
-
* @
|
|
707
|
+
* @param {string} [arg.discount] - Discount
|
|
708
|
+
* @param {DiscountJob} arg.body
|
|
709
|
+
* @returns {Promise<FileJobResponse>} - Success response
|
|
710
|
+
* @summary: Validate File.
|
|
711
|
+
* @description: Validate File.
|
|
716
712
|
*/
|
|
717
|
-
async
|
|
718
|
-
const { error } = DiscountValidator.
|
|
713
|
+
async validateDiscountFile({ body, discount } = {}) {
|
|
714
|
+
const { error } = DiscountValidator.validateDiscountFile().validate(
|
|
719
715
|
{
|
|
720
|
-
|
|
716
|
+
body,
|
|
717
|
+
discount,
|
|
721
718
|
},
|
|
722
719
|
{ abortEarly: false, allowUnknown: true }
|
|
723
720
|
);
|
|
@@ -726,36 +723,40 @@ class Discount {
|
|
|
726
723
|
}
|
|
727
724
|
|
|
728
725
|
// Showing warrnings if extra unknown parameters are found
|
|
729
|
-
const {
|
|
726
|
+
const {
|
|
727
|
+
error: warrning,
|
|
728
|
+
} = DiscountValidator.validateDiscountFile().validate(
|
|
730
729
|
{
|
|
731
|
-
|
|
730
|
+
body,
|
|
731
|
+
discount,
|
|
732
732
|
},
|
|
733
733
|
{ abortEarly: false, allowUnknown: false }
|
|
734
734
|
);
|
|
735
735
|
if (warrning) {
|
|
736
736
|
Logger({
|
|
737
737
|
level: "WARN",
|
|
738
|
-
message: "Parameter Validation warrnings for
|
|
738
|
+
message: "Parameter Validation warrnings for validateDiscountFile",
|
|
739
739
|
});
|
|
740
740
|
Logger({ level: "WARN", message: warrning });
|
|
741
741
|
}
|
|
742
742
|
|
|
743
743
|
const query_params = {};
|
|
744
|
+
query_params["discount"] = discount;
|
|
744
745
|
|
|
745
746
|
const xHeaders = {};
|
|
746
747
|
|
|
747
748
|
const response = await PlatformAPIClient.execute(
|
|
748
749
|
this.config,
|
|
749
|
-
"
|
|
750
|
-
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/
|
|
750
|
+
"post",
|
|
751
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
|
|
751
752
|
query_params,
|
|
752
|
-
|
|
753
|
+
body,
|
|
753
754
|
xHeaders
|
|
754
755
|
);
|
|
755
756
|
|
|
756
757
|
const {
|
|
757
758
|
error: res_error,
|
|
758
|
-
} = DiscountModel.
|
|
759
|
+
} = DiscountModel.FileJobResponse().validate(response, {
|
|
759
760
|
abortEarly: false,
|
|
760
761
|
allowUnknown: false,
|
|
761
762
|
});
|
|
@@ -763,7 +764,7 @@ class Discount {
|
|
|
763
764
|
if (res_error) {
|
|
764
765
|
Logger({
|
|
765
766
|
level: "WARN",
|
|
766
|
-
message: "Response Validation Warnnings for
|
|
767
|
+
message: "Response Validation Warnnings for validateDiscountFile",
|
|
767
768
|
});
|
|
768
769
|
Logger({ level: "WARN", message: res_error });
|
|
769
770
|
}
|