@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
|
@@ -13,17 +13,15 @@ class Rewards {
|
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* @param {Object} arg - Arg object.
|
|
16
|
-
* @param {string} arg.
|
|
17
|
-
* @
|
|
18
|
-
* @
|
|
19
|
-
* @
|
|
20
|
-
* @description: List of giveaways of the current application.
|
|
16
|
+
* @param {string} arg.audienceId - Audience id
|
|
17
|
+
* @returns {Promise<GiveawayAudience>} - Success response
|
|
18
|
+
* @summary: Get the Giveaway audience status
|
|
19
|
+
* @description: Get giveaway audience status
|
|
21
20
|
*/
|
|
22
|
-
async
|
|
23
|
-
const { error } = RewardsValidator.
|
|
21
|
+
async getGiveawayAudienceStatus({ audienceId } = {}) {
|
|
22
|
+
const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
24
23
|
{
|
|
25
|
-
|
|
26
|
-
pageSize,
|
|
24
|
+
audienceId,
|
|
27
25
|
},
|
|
28
26
|
{ abortEarly: false, allowUnknown: true }
|
|
29
27
|
);
|
|
@@ -32,36 +30,35 @@ class Rewards {
|
|
|
32
30
|
}
|
|
33
31
|
|
|
34
32
|
// Showing warrnings if extra unknown parameters are found
|
|
35
|
-
const {
|
|
33
|
+
const {
|
|
34
|
+
error: warrning,
|
|
35
|
+
} = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
36
36
|
{
|
|
37
|
-
|
|
38
|
-
pageSize,
|
|
37
|
+
audienceId,
|
|
39
38
|
},
|
|
40
39
|
{ abortEarly: false, allowUnknown: false }
|
|
41
40
|
);
|
|
42
41
|
if (warrning) {
|
|
43
42
|
Logger({
|
|
44
43
|
level: "WARN",
|
|
45
|
-
message: "Parameter Validation warrnings for
|
|
44
|
+
message: "Parameter Validation warrnings for getGiveawayAudienceStatus",
|
|
46
45
|
});
|
|
47
46
|
Logger({ level: "WARN", message: warrning });
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
const query_params = {};
|
|
51
|
-
query_params["page_id"] = pageId;
|
|
52
|
-
query_params["page_size"] = pageSize;
|
|
53
50
|
|
|
54
51
|
const response = await PlatformAPIClient.execute(
|
|
55
52
|
this.config,
|
|
56
53
|
"get",
|
|
57
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
54
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/audience/${audienceId}/status`,
|
|
58
55
|
query_params,
|
|
59
56
|
undefined
|
|
60
57
|
);
|
|
61
58
|
|
|
62
59
|
const {
|
|
63
60
|
error: res_error,
|
|
64
|
-
} = RewardsModel.
|
|
61
|
+
} = RewardsModel.GiveawayAudience().validate(response, {
|
|
65
62
|
abortEarly: false,
|
|
66
63
|
allowUnknown: false,
|
|
67
64
|
});
|
|
@@ -69,7 +66,7 @@ class Rewards {
|
|
|
69
66
|
if (res_error) {
|
|
70
67
|
Logger({
|
|
71
68
|
level: "WARN",
|
|
72
|
-
message: "Response Validation Warnnings for
|
|
69
|
+
message: "Response Validation Warnnings for getGiveawayAudienceStatus",
|
|
73
70
|
});
|
|
74
71
|
Logger({ level: "WARN", message: res_error });
|
|
75
72
|
}
|
|
@@ -79,15 +76,15 @@ class Rewards {
|
|
|
79
76
|
|
|
80
77
|
/**
|
|
81
78
|
* @param {Object} arg - Arg object.
|
|
82
|
-
* @param {
|
|
79
|
+
* @param {string} arg.id - Giveaway ID
|
|
83
80
|
* @returns {Promise<Giveaway>} - Success response
|
|
84
|
-
* @summary:
|
|
85
|
-
* @description:
|
|
81
|
+
* @summary: Get giveaway by ID.
|
|
82
|
+
* @description: Get giveaway by ID.
|
|
86
83
|
*/
|
|
87
|
-
async
|
|
88
|
-
const { error } = RewardsValidator.
|
|
84
|
+
async getGiveawayById({ id } = {}) {
|
|
85
|
+
const { error } = RewardsValidator.getGiveawayById().validate(
|
|
89
86
|
{
|
|
90
|
-
|
|
87
|
+
id,
|
|
91
88
|
},
|
|
92
89
|
{ abortEarly: false, allowUnknown: true }
|
|
93
90
|
);
|
|
@@ -96,16 +93,16 @@ class Rewards {
|
|
|
96
93
|
}
|
|
97
94
|
|
|
98
95
|
// Showing warrnings if extra unknown parameters are found
|
|
99
|
-
const { error: warrning } = RewardsValidator.
|
|
96
|
+
const { error: warrning } = RewardsValidator.getGiveawayById().validate(
|
|
100
97
|
{
|
|
101
|
-
|
|
98
|
+
id,
|
|
102
99
|
},
|
|
103
100
|
{ abortEarly: false, allowUnknown: false }
|
|
104
101
|
);
|
|
105
102
|
if (warrning) {
|
|
106
103
|
Logger({
|
|
107
104
|
level: "WARN",
|
|
108
|
-
message: "Parameter Validation warrnings for
|
|
105
|
+
message: "Parameter Validation warrnings for getGiveawayById",
|
|
109
106
|
});
|
|
110
107
|
Logger({ level: "WARN", message: warrning });
|
|
111
108
|
}
|
|
@@ -114,10 +111,10 @@ class Rewards {
|
|
|
114
111
|
|
|
115
112
|
const response = await PlatformAPIClient.execute(
|
|
116
113
|
this.config,
|
|
117
|
-
"
|
|
118
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
114
|
+
"get",
|
|
115
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
119
116
|
query_params,
|
|
120
|
-
|
|
117
|
+
undefined
|
|
121
118
|
);
|
|
122
119
|
|
|
123
120
|
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
@@ -128,7 +125,7 @@ class Rewards {
|
|
|
128
125
|
if (res_error) {
|
|
129
126
|
Logger({
|
|
130
127
|
level: "WARN",
|
|
131
|
-
message: "Response Validation Warnnings for
|
|
128
|
+
message: "Response Validation Warnnings for getGiveawayById",
|
|
132
129
|
});
|
|
133
130
|
Logger({ level: "WARN", message: res_error });
|
|
134
131
|
}
|
|
@@ -138,15 +135,19 @@ class Rewards {
|
|
|
138
135
|
|
|
139
136
|
/**
|
|
140
137
|
* @param {Object} arg - Arg object.
|
|
141
|
-
* @param {string} arg.
|
|
142
|
-
* @
|
|
143
|
-
*
|
|
144
|
-
*
|
|
138
|
+
* @param {string} arg.name - The name given to the offer.
|
|
139
|
+
* @param {string} arg.cookie - User's session cookie. This cookie is set in
|
|
140
|
+
* browser cookie when logged-in to fynd's authentication system i.e.
|
|
141
|
+
* `Grimlock` or by using grimlock-backend SDK for backend implementation.
|
|
142
|
+
* @returns {Promise<Offer>} - Success response
|
|
143
|
+
* @summary: Get offer by name
|
|
144
|
+
* @description: Use this API to get the offer details and configuration by entering the name of the offer.
|
|
145
145
|
*/
|
|
146
|
-
async
|
|
147
|
-
const { error } = RewardsValidator.
|
|
146
|
+
async getOfferByName({ name, cookie } = {}) {
|
|
147
|
+
const { error } = RewardsValidator.getOfferByName().validate(
|
|
148
148
|
{
|
|
149
|
-
|
|
149
|
+
name,
|
|
150
|
+
cookie,
|
|
150
151
|
},
|
|
151
152
|
{ abortEarly: false, allowUnknown: true }
|
|
152
153
|
);
|
|
@@ -155,16 +156,17 @@ class Rewards {
|
|
|
155
156
|
}
|
|
156
157
|
|
|
157
158
|
// Showing warrnings if extra unknown parameters are found
|
|
158
|
-
const { error: warrning } = RewardsValidator.
|
|
159
|
+
const { error: warrning } = RewardsValidator.getOfferByName().validate(
|
|
159
160
|
{
|
|
160
|
-
|
|
161
|
+
name,
|
|
162
|
+
cookie,
|
|
161
163
|
},
|
|
162
164
|
{ abortEarly: false, allowUnknown: false }
|
|
163
165
|
);
|
|
164
166
|
if (warrning) {
|
|
165
167
|
Logger({
|
|
166
168
|
level: "WARN",
|
|
167
|
-
message: "Parameter Validation warrnings for
|
|
169
|
+
message: "Parameter Validation warrnings for getOfferByName",
|
|
168
170
|
});
|
|
169
171
|
Logger({ level: "WARN", message: warrning });
|
|
170
172
|
}
|
|
@@ -174,12 +176,12 @@ class Rewards {
|
|
|
174
176
|
const response = await PlatformAPIClient.execute(
|
|
175
177
|
this.config,
|
|
176
178
|
"get",
|
|
177
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
179
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
178
180
|
query_params,
|
|
179
181
|
undefined
|
|
180
182
|
);
|
|
181
183
|
|
|
182
|
-
const { error: res_error } = RewardsModel.
|
|
184
|
+
const { error: res_error } = RewardsModel.Offer().validate(response, {
|
|
183
185
|
abortEarly: false,
|
|
184
186
|
allowUnknown: false,
|
|
185
187
|
});
|
|
@@ -187,7 +189,7 @@ class Rewards {
|
|
|
187
189
|
if (res_error) {
|
|
188
190
|
Logger({
|
|
189
191
|
level: "WARN",
|
|
190
|
-
message: "Response Validation Warnnings for
|
|
192
|
+
message: "Response Validation Warnnings for getOfferByName",
|
|
191
193
|
});
|
|
192
194
|
Logger({ level: "WARN", message: res_error });
|
|
193
195
|
}
|
|
@@ -197,18 +199,13 @@ class Rewards {
|
|
|
197
199
|
|
|
198
200
|
/**
|
|
199
201
|
* @param {Object} arg - Arg object.
|
|
200
|
-
* @
|
|
201
|
-
* @
|
|
202
|
-
* @
|
|
203
|
-
* @summary: Updates the giveaway by it's ID.
|
|
204
|
-
* @description: Updates the giveaway by it's ID.
|
|
202
|
+
* @returns {Promise<ConfigurationRes>} - Success response
|
|
203
|
+
* @summary: Get all valid android paths
|
|
204
|
+
* @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fradualent device.
|
|
205
205
|
*/
|
|
206
|
-
async
|
|
207
|
-
const { error } = RewardsValidator.
|
|
208
|
-
{
|
|
209
|
-
id,
|
|
210
|
-
body,
|
|
211
|
-
},
|
|
206
|
+
async getRewardsConfiguration({} = {}) {
|
|
207
|
+
const { error } = RewardsValidator.getRewardsConfiguration().validate(
|
|
208
|
+
{},
|
|
212
209
|
{ abortEarly: false, allowUnknown: true }
|
|
213
210
|
);
|
|
214
211
|
if (error) {
|
|
@@ -216,17 +213,16 @@ class Rewards {
|
|
|
216
213
|
}
|
|
217
214
|
|
|
218
215
|
// Showing warrnings if extra unknown parameters are found
|
|
219
|
-
const {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
},
|
|
216
|
+
const {
|
|
217
|
+
error: warrning,
|
|
218
|
+
} = RewardsValidator.getRewardsConfiguration().validate(
|
|
219
|
+
{},
|
|
224
220
|
{ abortEarly: false, allowUnknown: false }
|
|
225
221
|
);
|
|
226
222
|
if (warrning) {
|
|
227
223
|
Logger({
|
|
228
224
|
level: "WARN",
|
|
229
|
-
message: "Parameter Validation warrnings for
|
|
225
|
+
message: "Parameter Validation warrnings for getRewardsConfiguration",
|
|
230
226
|
});
|
|
231
227
|
Logger({ level: "WARN", message: warrning });
|
|
232
228
|
}
|
|
@@ -235,13 +231,15 @@ class Rewards {
|
|
|
235
231
|
|
|
236
232
|
const response = await PlatformAPIClient.execute(
|
|
237
233
|
this.config,
|
|
238
|
-
"
|
|
239
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
234
|
+
"get",
|
|
235
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
240
236
|
query_params,
|
|
241
|
-
|
|
237
|
+
undefined
|
|
242
238
|
);
|
|
243
239
|
|
|
244
|
-
const {
|
|
240
|
+
const {
|
|
241
|
+
error: res_error,
|
|
242
|
+
} = RewardsModel.ConfigurationRes().validate(response, {
|
|
245
243
|
abortEarly: false,
|
|
246
244
|
allowUnknown: false,
|
|
247
245
|
});
|
|
@@ -249,7 +247,7 @@ class Rewards {
|
|
|
249
247
|
if (res_error) {
|
|
250
248
|
Logger({
|
|
251
249
|
level: "WARN",
|
|
252
|
-
message: "Response Validation Warnnings for
|
|
250
|
+
message: "Response Validation Warnnings for getRewardsConfiguration",
|
|
253
251
|
});
|
|
254
252
|
Logger({ level: "WARN", message: res_error });
|
|
255
253
|
}
|
|
@@ -259,15 +257,20 @@ class Rewards {
|
|
|
259
257
|
|
|
260
258
|
/**
|
|
261
259
|
* @param {Object} arg - Arg object.
|
|
262
|
-
* @param {string} arg.
|
|
263
|
-
* @
|
|
264
|
-
*
|
|
265
|
-
* @
|
|
260
|
+
* @param {string} arg.userId - User id
|
|
261
|
+
* @param {string} [arg.pageId] - PageID is the ID of the requested page.
|
|
262
|
+
* For first request it should be kept empty.
|
|
263
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
264
|
+
* @returns {Promise<HistoryRes>} - Success response
|
|
265
|
+
* @summary: Get all transactions of reward points
|
|
266
|
+
* @description: Use this API to get a list of points transactions.
|
|
266
267
|
*/
|
|
267
|
-
async
|
|
268
|
-
const { error } = RewardsValidator.
|
|
268
|
+
async getUserPointsHistory({ userId, pageId, pageSize } = {}) {
|
|
269
|
+
const { error } = RewardsValidator.getUserPointsHistory().validate(
|
|
269
270
|
{
|
|
270
|
-
|
|
271
|
+
userId,
|
|
272
|
+
pageId,
|
|
273
|
+
pageSize,
|
|
271
274
|
},
|
|
272
275
|
{ abortEarly: false, allowUnknown: true }
|
|
273
276
|
);
|
|
@@ -278,33 +281,35 @@ class Rewards {
|
|
|
278
281
|
// Showing warrnings if extra unknown parameters are found
|
|
279
282
|
const {
|
|
280
283
|
error: warrning,
|
|
281
|
-
} = RewardsValidator.
|
|
284
|
+
} = RewardsValidator.getUserPointsHistory().validate(
|
|
282
285
|
{
|
|
283
|
-
|
|
286
|
+
userId,
|
|
287
|
+
pageId,
|
|
288
|
+
pageSize,
|
|
284
289
|
},
|
|
285
290
|
{ abortEarly: false, allowUnknown: false }
|
|
286
291
|
);
|
|
287
292
|
if (warrning) {
|
|
288
293
|
Logger({
|
|
289
294
|
level: "WARN",
|
|
290
|
-
message: "Parameter Validation warrnings for
|
|
295
|
+
message: "Parameter Validation warrnings for getUserPointsHistory",
|
|
291
296
|
});
|
|
292
297
|
Logger({ level: "WARN", message: warrning });
|
|
293
298
|
}
|
|
294
299
|
|
|
295
300
|
const query_params = {};
|
|
301
|
+
query_params["page_id"] = pageId;
|
|
302
|
+
query_params["page_size"] = pageSize;
|
|
296
303
|
|
|
297
304
|
const response = await PlatformAPIClient.execute(
|
|
298
305
|
this.config,
|
|
299
306
|
"get",
|
|
300
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
307
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/points/history/`,
|
|
301
308
|
query_params,
|
|
302
309
|
undefined
|
|
303
310
|
);
|
|
304
311
|
|
|
305
|
-
const {
|
|
306
|
-
error: res_error,
|
|
307
|
-
} = RewardsModel.GiveawayAudience().validate(response, {
|
|
312
|
+
const { error: res_error } = RewardsModel.HistoryRes().validate(response, {
|
|
308
313
|
abortEarly: false,
|
|
309
314
|
allowUnknown: false,
|
|
310
315
|
});
|
|
@@ -312,7 +317,7 @@ class Rewards {
|
|
|
312
317
|
if (res_error) {
|
|
313
318
|
Logger({
|
|
314
319
|
level: "WARN",
|
|
315
|
-
message: "Response Validation Warnnings for
|
|
320
|
+
message: "Response Validation Warnnings for getUserPointsHistory",
|
|
316
321
|
});
|
|
317
322
|
Logger({ level: "WARN", message: res_error });
|
|
318
323
|
}
|
|
@@ -322,13 +327,53 @@ class Rewards {
|
|
|
322
327
|
|
|
323
328
|
/**
|
|
324
329
|
* @param {Object} arg - Arg object.
|
|
325
|
-
* @
|
|
326
|
-
* @
|
|
327
|
-
* @
|
|
330
|
+
* @param {string} arg.userId - User id
|
|
331
|
+
* @param {string} arg.companyId - Company id
|
|
332
|
+
* @param {string} arg.applicationId - Application id
|
|
333
|
+
* @param {number} [arg.pageSize] - The number of items to retrieve in each page.
|
|
334
|
+
* @summary: Get all transactions of reward points
|
|
335
|
+
* @description: Use this API to get a list of points transactions.
|
|
328
336
|
*/
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
337
|
+
getUserPointsHistoryPaginator({
|
|
338
|
+
userId,
|
|
339
|
+
companyId,
|
|
340
|
+
applicationId,
|
|
341
|
+
pageSize,
|
|
342
|
+
} = {}) {
|
|
343
|
+
const paginator = new Paginator();
|
|
344
|
+
const callback = async () => {
|
|
345
|
+
const pageId = paginator.nextId;
|
|
346
|
+
const pageNo = paginator.pageNo;
|
|
347
|
+
const pageType = "cursor";
|
|
348
|
+
const data = await this.getUserPointsHistory({
|
|
349
|
+
userId: userId,
|
|
350
|
+
companyId: companyId,
|
|
351
|
+
applicationId: applicationId,
|
|
352
|
+
pageId: pageId,
|
|
353
|
+
pageSize: pageSize,
|
|
354
|
+
});
|
|
355
|
+
paginator.setPaginator({
|
|
356
|
+
hasNext: data.page.has_next ? true : false,
|
|
357
|
+
nextId: data.page.next_id,
|
|
358
|
+
});
|
|
359
|
+
return data;
|
|
360
|
+
};
|
|
361
|
+
paginator.setCallback(callback.bind(this));
|
|
362
|
+
return paginator;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* @param {Object} arg - Arg object.
|
|
367
|
+
* @param {Giveaway} arg.body
|
|
368
|
+
* @returns {Promise<Giveaway>} - Success response
|
|
369
|
+
* @summary: List of giveaways of the current application.
|
|
370
|
+
* @description: Adds a new giveaway.
|
|
371
|
+
*/
|
|
372
|
+
async saveGiveAway({ body } = {}) {
|
|
373
|
+
const { error } = RewardsValidator.saveGiveAway().validate(
|
|
374
|
+
{
|
|
375
|
+
body,
|
|
376
|
+
},
|
|
332
377
|
{ abortEarly: false, allowUnknown: true }
|
|
333
378
|
);
|
|
334
379
|
if (error) {
|
|
@@ -336,14 +381,16 @@ class Rewards {
|
|
|
336
381
|
}
|
|
337
382
|
|
|
338
383
|
// Showing warrnings if extra unknown parameters are found
|
|
339
|
-
const { error: warrning } = RewardsValidator.
|
|
340
|
-
{
|
|
384
|
+
const { error: warrning } = RewardsValidator.saveGiveAway().validate(
|
|
385
|
+
{
|
|
386
|
+
body,
|
|
387
|
+
},
|
|
341
388
|
{ abortEarly: false, allowUnknown: false }
|
|
342
389
|
);
|
|
343
390
|
if (warrning) {
|
|
344
391
|
Logger({
|
|
345
392
|
level: "WARN",
|
|
346
|
-
message: "Parameter Validation warrnings for
|
|
393
|
+
message: "Parameter Validation warrnings for saveGiveAway",
|
|
347
394
|
});
|
|
348
395
|
Logger({ level: "WARN", message: warrning });
|
|
349
396
|
}
|
|
@@ -352,20 +399,21 @@ class Rewards {
|
|
|
352
399
|
|
|
353
400
|
const response = await PlatformAPIClient.execute(
|
|
354
401
|
this.config,
|
|
355
|
-
"
|
|
356
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
402
|
+
"post",
|
|
403
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
357
404
|
query_params,
|
|
358
|
-
|
|
405
|
+
body
|
|
359
406
|
);
|
|
360
407
|
|
|
361
|
-
const { error: res_error } =
|
|
362
|
-
|
|
363
|
-
|
|
408
|
+
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
409
|
+
abortEarly: false,
|
|
410
|
+
allowUnknown: false,
|
|
411
|
+
});
|
|
364
412
|
|
|
365
413
|
if (res_error) {
|
|
366
414
|
Logger({
|
|
367
415
|
level: "WARN",
|
|
368
|
-
message: "Response Validation Warnnings for
|
|
416
|
+
message: "Response Validation Warnnings for saveGiveAway",
|
|
369
417
|
});
|
|
370
418
|
Logger({ level: "WARN", message: res_error });
|
|
371
419
|
}
|
|
@@ -375,19 +423,15 @@ class Rewards {
|
|
|
375
423
|
|
|
376
424
|
/**
|
|
377
425
|
* @param {Object} arg - Arg object.
|
|
378
|
-
* @param {
|
|
379
|
-
* @
|
|
380
|
-
*
|
|
381
|
-
*
|
|
382
|
-
* @returns {Promise<Offer>} - Success response
|
|
383
|
-
* @summary: Get offer by name
|
|
384
|
-
* @description: Use this API to get the offer details and configuration by entering the name of the offer.
|
|
426
|
+
* @param {ConfigurationRequest} arg.body
|
|
427
|
+
* @returns {Promise<SetConfigurationRes>} - Success response
|
|
428
|
+
* @summary: Updates the collection with given android paths.
|
|
429
|
+
* @description: Updates the configuration or inserts new records.
|
|
385
430
|
*/
|
|
386
|
-
async
|
|
387
|
-
const { error } = RewardsValidator.
|
|
388
|
-
{
|
|
389
|
-
|
|
390
|
-
cookie,
|
|
431
|
+
async setRewardsConfiguration({ body } = {}) {
|
|
432
|
+
const { error } = RewardsValidator.setRewardsConfiguration().validate(
|
|
433
|
+
{
|
|
434
|
+
body,
|
|
391
435
|
},
|
|
392
436
|
{ abortEarly: false, allowUnknown: true }
|
|
393
437
|
);
|
|
@@ -396,17 +440,18 @@ class Rewards {
|
|
|
396
440
|
}
|
|
397
441
|
|
|
398
442
|
// Showing warrnings if extra unknown parameters are found
|
|
399
|
-
const {
|
|
443
|
+
const {
|
|
444
|
+
error: warrning,
|
|
445
|
+
} = RewardsValidator.setRewardsConfiguration().validate(
|
|
400
446
|
{
|
|
401
|
-
|
|
402
|
-
cookie,
|
|
447
|
+
body,
|
|
403
448
|
},
|
|
404
449
|
{ abortEarly: false, allowUnknown: false }
|
|
405
450
|
);
|
|
406
451
|
if (warrning) {
|
|
407
452
|
Logger({
|
|
408
453
|
level: "WARN",
|
|
409
|
-
message: "Parameter Validation warrnings for
|
|
454
|
+
message: "Parameter Validation warrnings for setRewardsConfiguration",
|
|
410
455
|
});
|
|
411
456
|
Logger({ level: "WARN", message: warrning });
|
|
412
457
|
}
|
|
@@ -415,13 +460,15 @@ class Rewards {
|
|
|
415
460
|
|
|
416
461
|
const response = await PlatformAPIClient.execute(
|
|
417
462
|
this.config,
|
|
418
|
-
"
|
|
419
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
463
|
+
"post",
|
|
464
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/configuration/`,
|
|
420
465
|
query_params,
|
|
421
|
-
|
|
466
|
+
body
|
|
422
467
|
);
|
|
423
468
|
|
|
424
|
-
const {
|
|
469
|
+
const {
|
|
470
|
+
error: res_error,
|
|
471
|
+
} = RewardsModel.SetConfigurationRes().validate(response, {
|
|
425
472
|
abortEarly: false,
|
|
426
473
|
allowUnknown: false,
|
|
427
474
|
});
|
|
@@ -429,7 +476,7 @@ class Rewards {
|
|
|
429
476
|
if (res_error) {
|
|
430
477
|
Logger({
|
|
431
478
|
level: "WARN",
|
|
432
|
-
message: "Response Validation Warnnings for
|
|
479
|
+
message: "Response Validation Warnnings for setRewardsConfiguration",
|
|
433
480
|
});
|
|
434
481
|
Logger({ level: "WARN", message: res_error });
|
|
435
482
|
}
|
|
@@ -439,17 +486,17 @@ class Rewards {
|
|
|
439
486
|
|
|
440
487
|
/**
|
|
441
488
|
* @param {Object} arg - Arg object.
|
|
442
|
-
* @param {string} arg.
|
|
443
|
-
* @param {
|
|
444
|
-
* @returns {Promise<
|
|
445
|
-
* @summary:
|
|
446
|
-
* @description:
|
|
489
|
+
* @param {string} arg.pageId - Pagination page id
|
|
490
|
+
* @param {number} arg.pageSize - Pagination page size
|
|
491
|
+
* @returns {Promise<GiveawayResponse>} - Success response
|
|
492
|
+
* @summary: List of giveaways of the current application.
|
|
493
|
+
* @description: List of giveaways of the current application.
|
|
447
494
|
*/
|
|
448
|
-
async
|
|
449
|
-
const { error } = RewardsValidator.
|
|
495
|
+
async showGiveaways({ pageId, pageSize } = {}) {
|
|
496
|
+
const { error } = RewardsValidator.showGiveaways().validate(
|
|
450
497
|
{
|
|
451
|
-
|
|
452
|
-
|
|
498
|
+
pageId,
|
|
499
|
+
pageSize,
|
|
453
500
|
},
|
|
454
501
|
{ abortEarly: false, allowUnknown: true }
|
|
455
502
|
);
|
|
@@ -458,32 +505,36 @@ class Rewards {
|
|
|
458
505
|
}
|
|
459
506
|
|
|
460
507
|
// Showing warrnings if extra unknown parameters are found
|
|
461
|
-
const { error: warrning } = RewardsValidator.
|
|
508
|
+
const { error: warrning } = RewardsValidator.showGiveaways().validate(
|
|
462
509
|
{
|
|
463
|
-
|
|
464
|
-
|
|
510
|
+
pageId,
|
|
511
|
+
pageSize,
|
|
465
512
|
},
|
|
466
513
|
{ abortEarly: false, allowUnknown: false }
|
|
467
514
|
);
|
|
468
515
|
if (warrning) {
|
|
469
516
|
Logger({
|
|
470
517
|
level: "WARN",
|
|
471
|
-
message: "Parameter Validation warrnings for
|
|
518
|
+
message: "Parameter Validation warrnings for showGiveaways",
|
|
472
519
|
});
|
|
473
520
|
Logger({ level: "WARN", message: warrning });
|
|
474
521
|
}
|
|
475
522
|
|
|
476
523
|
const query_params = {};
|
|
524
|
+
query_params["page_id"] = pageId;
|
|
525
|
+
query_params["page_size"] = pageSize;
|
|
477
526
|
|
|
478
527
|
const response = await PlatformAPIClient.execute(
|
|
479
528
|
this.config,
|
|
480
|
-
"
|
|
481
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
529
|
+
"get",
|
|
530
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways`,
|
|
482
531
|
query_params,
|
|
483
|
-
|
|
532
|
+
undefined
|
|
484
533
|
);
|
|
485
534
|
|
|
486
|
-
const {
|
|
535
|
+
const {
|
|
536
|
+
error: res_error,
|
|
537
|
+
} = RewardsModel.GiveawayResponse().validate(response, {
|
|
487
538
|
abortEarly: false,
|
|
488
539
|
allowUnknown: false,
|
|
489
540
|
});
|
|
@@ -491,7 +542,7 @@ class Rewards {
|
|
|
491
542
|
if (res_error) {
|
|
492
543
|
Logger({
|
|
493
544
|
level: "WARN",
|
|
494
|
-
message: "Response Validation Warnnings for
|
|
545
|
+
message: "Response Validation Warnnings for showGiveaways",
|
|
495
546
|
});
|
|
496
547
|
Logger({ level: "WARN", message: res_error });
|
|
497
548
|
}
|
|
@@ -501,18 +552,13 @@ class Rewards {
|
|
|
501
552
|
|
|
502
553
|
/**
|
|
503
554
|
* @param {Object} arg - Arg object.
|
|
504
|
-
* @
|
|
505
|
-
* @
|
|
506
|
-
* @
|
|
507
|
-
* @summary: Update user status
|
|
508
|
-
* @description: Use this API to update the user status active/archive
|
|
555
|
+
* @returns {Promise<Offer[]>} - Success response
|
|
556
|
+
* @summary: List of offers of the current application.
|
|
557
|
+
* @description: List of offers of the current application.
|
|
509
558
|
*/
|
|
510
|
-
async
|
|
511
|
-
const { error } = RewardsValidator.
|
|
512
|
-
{
|
|
513
|
-
userId,
|
|
514
|
-
body,
|
|
515
|
-
},
|
|
559
|
+
async showOffers({} = {}) {
|
|
560
|
+
const { error } = RewardsValidator.showOffers().validate(
|
|
561
|
+
{},
|
|
516
562
|
{ abortEarly: false, allowUnknown: true }
|
|
517
563
|
);
|
|
518
564
|
if (error) {
|
|
@@ -520,17 +566,14 @@ class Rewards {
|
|
|
520
566
|
}
|
|
521
567
|
|
|
522
568
|
// Showing warrnings if extra unknown parameters are found
|
|
523
|
-
const { error: warrning } = RewardsValidator.
|
|
524
|
-
{
|
|
525
|
-
userId,
|
|
526
|
-
body,
|
|
527
|
-
},
|
|
569
|
+
const { error: warrning } = RewardsValidator.showOffers().validate(
|
|
570
|
+
{},
|
|
528
571
|
{ abortEarly: false, allowUnknown: false }
|
|
529
572
|
);
|
|
530
573
|
if (warrning) {
|
|
531
574
|
Logger({
|
|
532
575
|
level: "WARN",
|
|
533
|
-
message: "Parameter Validation warrnings for
|
|
576
|
+
message: "Parameter Validation warrnings for showOffers",
|
|
534
577
|
});
|
|
535
578
|
Logger({ level: "WARN", message: warrning });
|
|
536
579
|
}
|
|
@@ -539,21 +582,20 @@ class Rewards {
|
|
|
539
582
|
|
|
540
583
|
const response = await PlatformAPIClient.execute(
|
|
541
584
|
this.config,
|
|
542
|
-
"
|
|
543
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
585
|
+
"get",
|
|
586
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/`,
|
|
544
587
|
query_params,
|
|
545
|
-
|
|
588
|
+
undefined
|
|
546
589
|
);
|
|
547
590
|
|
|
548
|
-
const { error: res_error } =
|
|
549
|
-
|
|
550
|
-
allowUnknown: false
|
|
551
|
-
});
|
|
591
|
+
const { error: res_error } = Joi.array()
|
|
592
|
+
.items(RewardsModel.Offer())
|
|
593
|
+
.validate(response, { abortEarly: false, allowUnknown: false });
|
|
552
594
|
|
|
553
595
|
if (res_error) {
|
|
554
596
|
Logger({
|
|
555
597
|
level: "WARN",
|
|
556
|
-
message: "Response Validation Warnnings for
|
|
598
|
+
message: "Response Validation Warnnings for showOffers",
|
|
557
599
|
});
|
|
558
600
|
Logger({ level: "WARN", message: res_error });
|
|
559
601
|
}
|
|
@@ -563,15 +605,17 @@ class Rewards {
|
|
|
563
605
|
|
|
564
606
|
/**
|
|
565
607
|
* @param {Object} arg - Arg object.
|
|
566
|
-
* @param {string} arg.
|
|
567
|
-
* @
|
|
568
|
-
* @
|
|
569
|
-
* @
|
|
608
|
+
* @param {string} arg.id - Giveaway ID
|
|
609
|
+
* @param {Giveaway} arg.body
|
|
610
|
+
* @returns {Promise<Giveaway>} - Success response
|
|
611
|
+
* @summary: Updates the giveaway by it's ID.
|
|
612
|
+
* @description: Updates the giveaway by it's ID.
|
|
570
613
|
*/
|
|
571
|
-
async
|
|
572
|
-
const { error } = RewardsValidator.
|
|
614
|
+
async updateGiveAway({ id, body } = {}) {
|
|
615
|
+
const { error } = RewardsValidator.updateGiveAway().validate(
|
|
573
616
|
{
|
|
574
|
-
|
|
617
|
+
id,
|
|
618
|
+
body,
|
|
575
619
|
},
|
|
576
620
|
{ abortEarly: false, allowUnknown: true }
|
|
577
621
|
);
|
|
@@ -580,16 +624,17 @@ class Rewards {
|
|
|
580
624
|
}
|
|
581
625
|
|
|
582
626
|
// Showing warrnings if extra unknown parameters are found
|
|
583
|
-
const { error: warrning } = RewardsValidator.
|
|
627
|
+
const { error: warrning } = RewardsValidator.updateGiveAway().validate(
|
|
584
628
|
{
|
|
585
|
-
|
|
629
|
+
id,
|
|
630
|
+
body,
|
|
586
631
|
},
|
|
587
632
|
{ abortEarly: false, allowUnknown: false }
|
|
588
633
|
);
|
|
589
634
|
if (warrning) {
|
|
590
635
|
Logger({
|
|
591
636
|
level: "WARN",
|
|
592
|
-
message: "Parameter Validation warrnings for
|
|
637
|
+
message: "Parameter Validation warrnings for updateGiveAway",
|
|
593
638
|
});
|
|
594
639
|
Logger({ level: "WARN", message: warrning });
|
|
595
640
|
}
|
|
@@ -598,13 +643,13 @@ class Rewards {
|
|
|
598
643
|
|
|
599
644
|
const response = await PlatformAPIClient.execute(
|
|
600
645
|
this.config,
|
|
601
|
-
"
|
|
602
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
646
|
+
"put",
|
|
647
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/giveaways/${id}`,
|
|
603
648
|
query_params,
|
|
604
|
-
|
|
649
|
+
body
|
|
605
650
|
);
|
|
606
651
|
|
|
607
|
-
const { error: res_error } = RewardsModel.
|
|
652
|
+
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
608
653
|
abortEarly: false,
|
|
609
654
|
allowUnknown: false,
|
|
610
655
|
});
|
|
@@ -612,7 +657,7 @@ class Rewards {
|
|
|
612
657
|
if (res_error) {
|
|
613
658
|
Logger({
|
|
614
659
|
level: "WARN",
|
|
615
|
-
message: "Response Validation Warnnings for
|
|
660
|
+
message: "Response Validation Warnnings for updateGiveAway",
|
|
616
661
|
});
|
|
617
662
|
Logger({ level: "WARN", message: res_error });
|
|
618
663
|
}
|
|
@@ -622,20 +667,17 @@ class Rewards {
|
|
|
622
667
|
|
|
623
668
|
/**
|
|
624
669
|
* @param {Object} arg - Arg object.
|
|
625
|
-
* @param {string} arg.
|
|
626
|
-
* @param {
|
|
627
|
-
*
|
|
628
|
-
* @
|
|
629
|
-
* @
|
|
630
|
-
* @summary: Get all transactions of reward points
|
|
631
|
-
* @description: Use this API to get a list of points transactions.
|
|
670
|
+
* @param {string} arg.name - The name given to the offer.
|
|
671
|
+
* @param {Offer} arg.body
|
|
672
|
+
* @returns {Promise<Offer>} - Success response
|
|
673
|
+
* @summary: Update offer by name
|
|
674
|
+
* @description: Use this API to update the offer details
|
|
632
675
|
*/
|
|
633
|
-
async
|
|
634
|
-
const { error } = RewardsValidator.
|
|
676
|
+
async updateOfferByName({ name, body } = {}) {
|
|
677
|
+
const { error } = RewardsValidator.updateOfferByName().validate(
|
|
635
678
|
{
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
pageSize,
|
|
679
|
+
name,
|
|
680
|
+
body,
|
|
639
681
|
},
|
|
640
682
|
{ abortEarly: false, allowUnknown: true }
|
|
641
683
|
);
|
|
@@ -644,37 +686,32 @@ class Rewards {
|
|
|
644
686
|
}
|
|
645
687
|
|
|
646
688
|
// Showing warrnings if extra unknown parameters are found
|
|
647
|
-
const {
|
|
648
|
-
error: warrning,
|
|
649
|
-
} = RewardsValidator.getUserPointsHistory().validate(
|
|
689
|
+
const { error: warrning } = RewardsValidator.updateOfferByName().validate(
|
|
650
690
|
{
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
pageSize,
|
|
691
|
+
name,
|
|
692
|
+
body,
|
|
654
693
|
},
|
|
655
694
|
{ abortEarly: false, allowUnknown: false }
|
|
656
695
|
);
|
|
657
696
|
if (warrning) {
|
|
658
697
|
Logger({
|
|
659
698
|
level: "WARN",
|
|
660
|
-
message: "Parameter Validation warrnings for
|
|
699
|
+
message: "Parameter Validation warrnings for updateOfferByName",
|
|
661
700
|
});
|
|
662
701
|
Logger({ level: "WARN", message: warrning });
|
|
663
702
|
}
|
|
664
703
|
|
|
665
704
|
const query_params = {};
|
|
666
|
-
query_params["page_id"] = pageId;
|
|
667
|
-
query_params["page_size"] = pageSize;
|
|
668
705
|
|
|
669
706
|
const response = await PlatformAPIClient.execute(
|
|
670
707
|
this.config,
|
|
671
|
-
"
|
|
672
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
708
|
+
"put",
|
|
709
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/offers/${name}/`,
|
|
673
710
|
query_params,
|
|
674
|
-
|
|
711
|
+
body
|
|
675
712
|
);
|
|
676
713
|
|
|
677
|
-
const { error: res_error } = RewardsModel.
|
|
714
|
+
const { error: res_error } = RewardsModel.Offer().validate(response, {
|
|
678
715
|
abortEarly: false,
|
|
679
716
|
allowUnknown: false,
|
|
680
717
|
});
|
|
@@ -682,7 +719,7 @@ class Rewards {
|
|
|
682
719
|
if (res_error) {
|
|
683
720
|
Logger({
|
|
684
721
|
level: "WARN",
|
|
685
|
-
message: "Response Validation Warnnings for
|
|
722
|
+
message: "Response Validation Warnnings for updateOfferByName",
|
|
686
723
|
});
|
|
687
724
|
Logger({ level: "WARN", message: res_error });
|
|
688
725
|
}
|
|
@@ -693,49 +730,17 @@ class Rewards {
|
|
|
693
730
|
/**
|
|
694
731
|
* @param {Object} arg - Arg object.
|
|
695
732
|
* @param {string} arg.userId - User id
|
|
696
|
-
* @param {
|
|
697
|
-
* @
|
|
698
|
-
* @
|
|
699
|
-
* @
|
|
700
|
-
* @description: Use this API to get a list of points transactions.
|
|
701
|
-
*/
|
|
702
|
-
getUserPointsHistoryPaginator({
|
|
703
|
-
userId,
|
|
704
|
-
companyId,
|
|
705
|
-
applicationId,
|
|
706
|
-
pageSize,
|
|
707
|
-
} = {}) {
|
|
708
|
-
const paginator = new Paginator();
|
|
709
|
-
const callback = async () => {
|
|
710
|
-
const pageId = paginator.nextId;
|
|
711
|
-
const pageNo = paginator.pageNo;
|
|
712
|
-
const pageType = "cursor";
|
|
713
|
-
const data = await this.getUserPointsHistory({
|
|
714
|
-
userId: userId,
|
|
715
|
-
companyId: companyId,
|
|
716
|
-
applicationId: applicationId,
|
|
717
|
-
pageId: pageId,
|
|
718
|
-
pageSize: pageSize,
|
|
719
|
-
});
|
|
720
|
-
paginator.setPaginator({
|
|
721
|
-
hasNext: data.page.has_next ? true : false,
|
|
722
|
-
nextId: data.page.next_id,
|
|
723
|
-
});
|
|
724
|
-
return data;
|
|
725
|
-
};
|
|
726
|
-
paginator.setCallback(callback.bind(this));
|
|
727
|
-
return paginator;
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* @param {Object} arg - Arg object.
|
|
732
|
-
* @returns {Promise<ConfigurationRes>} - Success response
|
|
733
|
-
* @summary: Get all valid android paths
|
|
734
|
-
* @description: Use this API to get a list of valid android paths required by the Rewards INIT API to validate a fradualent device.
|
|
733
|
+
* @param {AppUser} arg.body
|
|
734
|
+
* @returns {Promise<AppUser>} - Success response
|
|
735
|
+
* @summary: Update user status
|
|
736
|
+
* @description: Use this API to update the user status active/archive
|
|
735
737
|
*/
|
|
736
|
-
async
|
|
737
|
-
const { error } = RewardsValidator.
|
|
738
|
-
{
|
|
738
|
+
async updateUserStatus({ userId, body } = {}) {
|
|
739
|
+
const { error } = RewardsValidator.updateUserStatus().validate(
|
|
740
|
+
{
|
|
741
|
+
userId,
|
|
742
|
+
body,
|
|
743
|
+
},
|
|
739
744
|
{ abortEarly: false, allowUnknown: true }
|
|
740
745
|
);
|
|
741
746
|
if (error) {
|
|
@@ -743,16 +748,17 @@ class Rewards {
|
|
|
743
748
|
}
|
|
744
749
|
|
|
745
750
|
// Showing warrnings if extra unknown parameters are found
|
|
746
|
-
const {
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
751
|
+
const { error: warrning } = RewardsValidator.updateUserStatus().validate(
|
|
752
|
+
{
|
|
753
|
+
userId,
|
|
754
|
+
body,
|
|
755
|
+
},
|
|
750
756
|
{ abortEarly: false, allowUnknown: false }
|
|
751
757
|
);
|
|
752
758
|
if (warrning) {
|
|
753
759
|
Logger({
|
|
754
760
|
level: "WARN",
|
|
755
|
-
message: "Parameter Validation warrnings for
|
|
761
|
+
message: "Parameter Validation warrnings for updateUserStatus",
|
|
756
762
|
});
|
|
757
763
|
Logger({ level: "WARN", message: warrning });
|
|
758
764
|
}
|
|
@@ -761,15 +767,13 @@ class Rewards {
|
|
|
761
767
|
|
|
762
768
|
const response = await PlatformAPIClient.execute(
|
|
763
769
|
this.config,
|
|
764
|
-
"
|
|
765
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
770
|
+
"patch",
|
|
771
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
766
772
|
query_params,
|
|
767
|
-
|
|
773
|
+
body
|
|
768
774
|
);
|
|
769
775
|
|
|
770
|
-
const {
|
|
771
|
-
error: res_error,
|
|
772
|
-
} = RewardsModel.ConfigurationRes().validate(response, {
|
|
776
|
+
const { error: res_error } = RewardsModel.AppUser().validate(response, {
|
|
773
777
|
abortEarly: false,
|
|
774
778
|
allowUnknown: false,
|
|
775
779
|
});
|
|
@@ -777,7 +781,7 @@ class Rewards {
|
|
|
777
781
|
if (res_error) {
|
|
778
782
|
Logger({
|
|
779
783
|
level: "WARN",
|
|
780
|
-
message: "Response Validation Warnnings for
|
|
784
|
+
message: "Response Validation Warnnings for updateUserStatus",
|
|
781
785
|
});
|
|
782
786
|
Logger({ level: "WARN", message: res_error });
|
|
783
787
|
}
|
|
@@ -787,15 +791,15 @@ class Rewards {
|
|
|
787
791
|
|
|
788
792
|
/**
|
|
789
793
|
* @param {Object} arg - Arg object.
|
|
790
|
-
* @param {
|
|
791
|
-
* @returns {Promise<
|
|
792
|
-
* @summary:
|
|
793
|
-
* @description:
|
|
794
|
+
* @param {string} arg.userId - User id
|
|
795
|
+
* @returns {Promise<UserRes>} - Success response
|
|
796
|
+
* @summary: Get user reward details
|
|
797
|
+
* @description: Use this API to get the user reward details
|
|
794
798
|
*/
|
|
795
|
-
async
|
|
796
|
-
const { error } = RewardsValidator.
|
|
799
|
+
async user({ userId } = {}) {
|
|
800
|
+
const { error } = RewardsValidator.user().validate(
|
|
797
801
|
{
|
|
798
|
-
|
|
802
|
+
userId,
|
|
799
803
|
},
|
|
800
804
|
{ abortEarly: false, allowUnknown: true }
|
|
801
805
|
);
|
|
@@ -804,18 +808,16 @@ class Rewards {
|
|
|
804
808
|
}
|
|
805
809
|
|
|
806
810
|
// Showing warrnings if extra unknown parameters are found
|
|
807
|
-
const {
|
|
808
|
-
error: warrning,
|
|
809
|
-
} = RewardsValidator.setRewardsConfiguration().validate(
|
|
811
|
+
const { error: warrning } = RewardsValidator.user().validate(
|
|
810
812
|
{
|
|
811
|
-
|
|
813
|
+
userId,
|
|
812
814
|
},
|
|
813
815
|
{ abortEarly: false, allowUnknown: false }
|
|
814
816
|
);
|
|
815
817
|
if (warrning) {
|
|
816
818
|
Logger({
|
|
817
819
|
level: "WARN",
|
|
818
|
-
message: "Parameter Validation warrnings for
|
|
820
|
+
message: "Parameter Validation warrnings for user",
|
|
819
821
|
});
|
|
820
822
|
Logger({ level: "WARN", message: warrning });
|
|
821
823
|
}
|
|
@@ -824,15 +826,13 @@ class Rewards {
|
|
|
824
826
|
|
|
825
827
|
const response = await PlatformAPIClient.execute(
|
|
826
828
|
this.config,
|
|
827
|
-
"
|
|
828
|
-
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/
|
|
829
|
+
"get",
|
|
830
|
+
`/service/platform/rewards/v1.0/company/${this.config.companyId}/application/${this.applicationId}/users/${userId}/`,
|
|
829
831
|
query_params,
|
|
830
|
-
|
|
832
|
+
undefined
|
|
831
833
|
);
|
|
832
834
|
|
|
833
|
-
const {
|
|
834
|
-
error: res_error,
|
|
835
|
-
} = RewardsModel.SetConfigurationRes().validate(response, {
|
|
835
|
+
const { error: res_error } = RewardsModel.UserRes().validate(response, {
|
|
836
836
|
abortEarly: false,
|
|
837
837
|
allowUnknown: false,
|
|
838
838
|
});
|
|
@@ -840,7 +840,7 @@ class Rewards {
|
|
|
840
840
|
if (res_error) {
|
|
841
841
|
Logger({
|
|
842
842
|
level: "WARN",
|
|
843
|
-
message: "Response Validation Warnnings for
|
|
843
|
+
message: "Response Validation Warnnings for user",
|
|
844
844
|
});
|
|
845
845
|
Logger({ level: "WARN", message: res_error });
|
|
846
846
|
}
|