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