@gofynd/fdk-client-javascript 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/documentation/application/CART.md +5934 -4502
- package/documentation/application/CATALOG.md +6338 -7245
- package/documentation/application/COMMON.md +95 -222
- package/documentation/application/COMMUNICATION.md +106 -186
- package/documentation/application/CONFIGURATION.md +903 -1597
- package/documentation/application/CONTENT.md +562 -1270
- package/documentation/application/FILESTORAGE.md +84 -220
- package/documentation/application/LEAD.md +314 -660
- package/documentation/application/LOGISTIC.md +229 -305
- package/documentation/application/ORDER.md +642 -1137
- package/documentation/application/PAYMENT.md +2285 -3031
- package/documentation/application/POSCART.md +6079 -4642
- package/documentation/application/REWARDS.md +94 -248
- package/documentation/application/SHARE.md +152 -250
- package/documentation/application/THEME.md +952 -1235
- package/documentation/application/USER.md +1228 -1765
- package/documentation/platform/ANALYTICS.md +207 -349
- package/documentation/platform/AUDITTRAIL.md +121 -204
- package/documentation/platform/BILLING.md +865 -1376
- package/documentation/platform/CART.md +2814 -3662
- package/documentation/platform/CATALOG.md +15266 -17619
- package/documentation/platform/COMMON.md +95 -222
- package/documentation/platform/COMMUNICATION.md +1632 -2380
- package/documentation/platform/COMPANYPROFILE.md +572 -957
- package/documentation/platform/CONFIGURATION.md +3050 -4073
- package/documentation/platform/CONTENT.md +3509 -4121
- package/documentation/platform/DISCOUNT.md +140 -236
- package/documentation/platform/FILESTORAGE.md +187 -323
- package/documentation/platform/INVENTORY.md +268 -911
- package/documentation/platform/LEAD.md +2195 -2541
- package/documentation/platform/ORDER.md +3750 -5636
- package/documentation/platform/PARTNER.md +9 -36
- package/documentation/platform/PAYMENT.md +903 -1213
- package/documentation/platform/REWARDS.md +183 -347
- package/documentation/platform/SHARE.md +120 -213
- package/documentation/platform/THEME.md +12956 -13239
- package/documentation/platform/USER.md +975 -1120
- package/documentation/platform/WEBHOOK.md +78 -184
- package/documentation/public/CONFIGURATION.md +95 -222
- package/documentation/public/INVENTORY.md +100 -282
- package/documentation/public/WEBHOOK.md +27 -133
- package/package.json +1 -1
- package/sdk/application/ApplicationConfig.js +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +1058 -547
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +489 -886
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1545 -949
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +692 -1258
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +76 -36
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +92 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +638 -312
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +581 -213
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -75
- package/sdk/application/Content/ContentApplicationModel.js +468 -875
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +121 -59
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +230 -96
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +30 -19
- package/sdk/application/Logistic/LogisticApplicationClient.js +196 -47
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -8
- package/sdk/application/Order/OrderApplicationClient.d.ts +86 -86
- package/sdk/application/Order/OrderApplicationClient.js +448 -215
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +357 -661
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +1525 -750
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +565 -1033
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +1137 -606
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +61 -60
- package/sdk/application/PosCart/PosCartApplicationModel.js +477 -873
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +253 -113
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +221 -96
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +115 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +1201 -543
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +1 -1
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +55 -47
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +308 -151
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +20 -20
- package/sdk/platform/Analytics/AnalyticsPlatformClient.d.ts +8 -4
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +103 -16
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +16 -12
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +131 -44
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +6 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +68 -56
- package/sdk/platform/Billing/BillingPlatformClient.js +416 -171
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +25 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +176 -159
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +837 -500
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +11 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +63 -63
- package/sdk/platform/Cart/CartPlatformModel.d.ts +86 -85
- package/sdk/platform/Cart/CartPlatformModel.js +677 -1211
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +582 -529
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2642 -1533
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +708 -590
- package/sdk/platform/Catalog/CatalogPlatformClient.js +3103 -1362
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +293 -284
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2149 -3660
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -64
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +235 -216
- package/sdk/platform/Common/CommonPlatformClient.d.ts +14 -12
- package/sdk/platform/Common/CommonPlatformClient.js +80 -37
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +6 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +333 -293
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1687 -855
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +87 -87
- package/sdk/platform/Communication/CommunicationPlatformClient.d.ts +2 -1
- package/sdk/platform/Communication/CommunicationPlatformClient.js +28 -4
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +70 -57
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +463 -182
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +28 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +294 -557
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +24 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +175 -137
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1168 -521
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +69 -63
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +137 -119
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +691 -316
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +38 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +542 -461
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +2600 -1160
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +50 -49
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +159 -152
- package/sdk/platform/Content/ContentPlatformModel.d.ts +79 -75
- package/sdk/platform/Content/ContentPlatformModel.js +486 -867
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +72 -61
- package/sdk/platform/Discount/DiscountPlatformClient.js +424 -198
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +29 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +26 -22
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +145 -59
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +8 -8
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +58 -52
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +240 -114
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +11 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +76 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +461 -197
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +84 -71
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +441 -182
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +28 -28
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +86 -75
- package/sdk/platform/Lead/LeadPlatformClient.js +434 -212
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +24 -24
- package/sdk/platform/OAuthClient.js +8 -8
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +14 -11
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +113 -49
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +6 -6
- package/sdk/platform/Order/OrderPlatformClient.d.ts +367 -315
- package/sdk/platform/Order/OrderPlatformClient.js +1775 -893
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -192
- package/sdk/platform/Order/OrderPlatformModel.js +1591 -2822
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +160 -155
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +4 -2
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +52 -8
- package/sdk/platform/Partner/PartnerPlatformModel.js +6 -22
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +65 -54
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +395 -164
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +23 -23
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +55 -45
- package/sdk/platform/Payment/PaymentPlatformClient.js +362 -147
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +220 -408
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +21 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10153
- package/sdk/platform/PlatformApplicationClient.js +1584 -13691
- package/sdk/platform/PlatformClient.d.ts +7918 -7666
- package/sdk/platform/PlatformClient.js +8701 -9926
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +91 -78
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +507 -253
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +34 -34
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +16 -12
- package/sdk/platform/Share/SharePlatformApplicationClient.js +130 -52
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +6 -6
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +148 -124
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +770 -295
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +44 -44
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +146 -67
- package/sdk/platform/User/UserPlatformApplicationClient.js +742 -155
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +61 -23
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +35 -29
- package/sdk/platform/Webhook/WebhookPlatformClient.js +218 -91
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +14 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +81 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +228 -105
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +51 -10
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/tests/application/catalog.spec.js +7 -0
|
@@ -2,6 +2,8 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
3
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
4
|
const RewardsValidator = require("./RewardsPlatformApplicationValidator");
|
|
5
|
+
const RewardsModel = require("./RewardsPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
5
7
|
|
|
6
8
|
class Rewards {
|
|
7
9
|
constructor(config, applicationId) {
|
|
@@ -11,16 +13,15 @@ class Rewards {
|
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* @param {Object} arg - Arg object.
|
|
14
|
-
* @param {string} arg.
|
|
15
|
-
* @
|
|
16
|
-
* @summary:
|
|
17
|
-
* @description:
|
|
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
|
|
18
20
|
*/
|
|
19
|
-
|
|
20
|
-
const { error } = RewardsValidator.
|
|
21
|
+
async getGiveawayAudienceStatus({ audienceId } = {}) {
|
|
22
|
+
const { error } = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
21
23
|
{
|
|
22
|
-
|
|
23
|
-
pageSize,
|
|
24
|
+
audienceId,
|
|
24
25
|
},
|
|
25
26
|
{ abortEarly: false, allowUnknown: true }
|
|
26
27
|
);
|
|
@@ -29,41 +30,61 @@ class Rewards {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
// Showing warrnings if extra unknown parameters are found
|
|
32
|
-
const {
|
|
33
|
+
const {
|
|
34
|
+
error: warrning,
|
|
35
|
+
} = RewardsValidator.getGiveawayAudienceStatus().validate(
|
|
33
36
|
{
|
|
34
|
-
|
|
35
|
-
pageSize,
|
|
37
|
+
audienceId,
|
|
36
38
|
},
|
|
37
39
|
{ abortEarly: false, allowUnknown: false }
|
|
38
40
|
);
|
|
39
41
|
if (warrning) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
Logger({
|
|
43
|
+
level: "WARN",
|
|
44
|
+
message: "Parameter Validation warrnings for getGiveawayAudienceStatus",
|
|
45
|
+
});
|
|
46
|
+
Logger({ level: "WARN", message: warrning });
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
const query_params = {};
|
|
45
|
-
query_params["page_id"] = pageId;
|
|
46
|
-
query_params["page_size"] = pageSize;
|
|
47
50
|
|
|
48
|
-
|
|
51
|
+
const response = await PlatformAPIClient.execute(
|
|
49
52
|
this.config,
|
|
50
53
|
"get",
|
|
51
|
-
`/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`,
|
|
52
55
|
query_params,
|
|
53
56
|
undefined
|
|
54
57
|
);
|
|
58
|
+
|
|
59
|
+
const {
|
|
60
|
+
error: res_error,
|
|
61
|
+
} = RewardsModel.GiveawayAudience().validate(response, {
|
|
62
|
+
abortEarly: false,
|
|
63
|
+
allowUnknown: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
if (res_error) {
|
|
67
|
+
Logger({
|
|
68
|
+
level: "WARN",
|
|
69
|
+
message: "Response Validation Warnnings for getGiveawayAudienceStatus",
|
|
70
|
+
});
|
|
71
|
+
Logger({ level: "WARN", message: res_error });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return response;
|
|
55
75
|
}
|
|
56
76
|
|
|
57
77
|
/**
|
|
58
78
|
* @param {Object} arg - Arg object.
|
|
59
|
-
* @param {
|
|
60
|
-
* @
|
|
61
|
-
* @
|
|
79
|
+
* @param {string} arg.id - Giveaway ID
|
|
80
|
+
* @returns {Promise<Giveaway>} - Success response
|
|
81
|
+
* @summary: Get giveaway by ID.
|
|
82
|
+
* @description: Get giveaway by ID.
|
|
62
83
|
*/
|
|
63
|
-
|
|
64
|
-
const { error } = RewardsValidator.
|
|
84
|
+
async getGiveawayById({ id } = {}) {
|
|
85
|
+
const { error } = RewardsValidator.getGiveawayById().validate(
|
|
65
86
|
{
|
|
66
|
-
|
|
87
|
+
id,
|
|
67
88
|
},
|
|
68
89
|
{ abortEarly: false, allowUnknown: true }
|
|
69
90
|
);
|
|
@@ -72,38 +93,61 @@ class Rewards {
|
|
|
72
93
|
}
|
|
73
94
|
|
|
74
95
|
// Showing warrnings if extra unknown parameters are found
|
|
75
|
-
const { error: warrning } = RewardsValidator.
|
|
96
|
+
const { error: warrning } = RewardsValidator.getGiveawayById().validate(
|
|
76
97
|
{
|
|
77
|
-
|
|
98
|
+
id,
|
|
78
99
|
},
|
|
79
100
|
{ abortEarly: false, allowUnknown: false }
|
|
80
101
|
);
|
|
81
102
|
if (warrning) {
|
|
82
|
-
|
|
83
|
-
|
|
103
|
+
Logger({
|
|
104
|
+
level: "WARN",
|
|
105
|
+
message: "Parameter Validation warrnings for getGiveawayById",
|
|
106
|
+
});
|
|
107
|
+
Logger({ level: "WARN", message: warrning });
|
|
84
108
|
}
|
|
85
109
|
|
|
86
110
|
const query_params = {};
|
|
87
111
|
|
|
88
|
-
|
|
112
|
+
const response = await PlatformAPIClient.execute(
|
|
89
113
|
this.config,
|
|
90
|
-
"
|
|
91
|
-
`/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}`,
|
|
92
116
|
query_params,
|
|
93
|
-
|
|
117
|
+
undefined
|
|
94
118
|
);
|
|
119
|
+
|
|
120
|
+
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
121
|
+
abortEarly: false,
|
|
122
|
+
allowUnknown: false,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
if (res_error) {
|
|
126
|
+
Logger({
|
|
127
|
+
level: "WARN",
|
|
128
|
+
message: "Response Validation Warnnings for getGiveawayById",
|
|
129
|
+
});
|
|
130
|
+
Logger({ level: "WARN", message: res_error });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return response;
|
|
95
134
|
}
|
|
96
135
|
|
|
97
136
|
/**
|
|
98
137
|
* @param {Object} arg - Arg object.
|
|
99
|
-
* @param {string} arg.
|
|
100
|
-
* @
|
|
101
|
-
*
|
|
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.
|
|
102
145
|
*/
|
|
103
|
-
|
|
104
|
-
const { error } = RewardsValidator.
|
|
146
|
+
async getOfferByName({ name, cookie } = {}) {
|
|
147
|
+
const { error } = RewardsValidator.getOfferByName().validate(
|
|
105
148
|
{
|
|
106
|
-
|
|
149
|
+
name,
|
|
150
|
+
cookie,
|
|
107
151
|
},
|
|
108
152
|
{ abortEarly: false, allowUnknown: true }
|
|
109
153
|
);
|
|
@@ -112,41 +156,56 @@ class Rewards {
|
|
|
112
156
|
}
|
|
113
157
|
|
|
114
158
|
// Showing warrnings if extra unknown parameters are found
|
|
115
|
-
const { error: warrning } = RewardsValidator.
|
|
159
|
+
const { error: warrning } = RewardsValidator.getOfferByName().validate(
|
|
116
160
|
{
|
|
117
|
-
|
|
161
|
+
name,
|
|
162
|
+
cookie,
|
|
118
163
|
},
|
|
119
164
|
{ abortEarly: false, allowUnknown: false }
|
|
120
165
|
);
|
|
121
166
|
if (warrning) {
|
|
122
|
-
|
|
123
|
-
|
|
167
|
+
Logger({
|
|
168
|
+
level: "WARN",
|
|
169
|
+
message: "Parameter Validation warrnings for getOfferByName",
|
|
170
|
+
});
|
|
171
|
+
Logger({ level: "WARN", message: warrning });
|
|
124
172
|
}
|
|
125
173
|
|
|
126
174
|
const query_params = {};
|
|
127
175
|
|
|
128
|
-
|
|
176
|
+
const response = await PlatformAPIClient.execute(
|
|
129
177
|
this.config,
|
|
130
178
|
"get",
|
|
131
|
-
`/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}/`,
|
|
132
180
|
query_params,
|
|
133
181
|
undefined
|
|
134
182
|
);
|
|
183
|
+
|
|
184
|
+
const { error: res_error } = RewardsModel.Offer().validate(response, {
|
|
185
|
+
abortEarly: false,
|
|
186
|
+
allowUnknown: false,
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (res_error) {
|
|
190
|
+
Logger({
|
|
191
|
+
level: "WARN",
|
|
192
|
+
message: "Response Validation Warnnings for getOfferByName",
|
|
193
|
+
});
|
|
194
|
+
Logger({ level: "WARN", message: res_error });
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return response;
|
|
135
198
|
}
|
|
136
199
|
|
|
137
200
|
/**
|
|
138
201
|
* @param {Object} arg - Arg object.
|
|
139
|
-
* @
|
|
140
|
-
* @
|
|
141
|
-
* @
|
|
142
|
-
* @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.
|
|
143
205
|
*/
|
|
144
|
-
|
|
145
|
-
const { error } = RewardsValidator.
|
|
146
|
-
{
|
|
147
|
-
id,
|
|
148
|
-
body,
|
|
149
|
-
},
|
|
206
|
+
async getRewardsConfiguration({} = {}) {
|
|
207
|
+
const { error } = RewardsValidator.getRewardsConfiguration().validate(
|
|
208
|
+
{},
|
|
150
209
|
{ abortEarly: false, allowUnknown: true }
|
|
151
210
|
);
|
|
152
211
|
if (error) {
|
|
@@ -154,39 +213,64 @@ class Rewards {
|
|
|
154
213
|
}
|
|
155
214
|
|
|
156
215
|
// Showing warrnings if extra unknown parameters are found
|
|
157
|
-
const {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
},
|
|
216
|
+
const {
|
|
217
|
+
error: warrning,
|
|
218
|
+
} = RewardsValidator.getRewardsConfiguration().validate(
|
|
219
|
+
{},
|
|
162
220
|
{ abortEarly: false, allowUnknown: false }
|
|
163
221
|
);
|
|
164
222
|
if (warrning) {
|
|
165
|
-
|
|
166
|
-
|
|
223
|
+
Logger({
|
|
224
|
+
level: "WARN",
|
|
225
|
+
message: "Parameter Validation warrnings for getRewardsConfiguration",
|
|
226
|
+
});
|
|
227
|
+
Logger({ level: "WARN", message: warrning });
|
|
167
228
|
}
|
|
168
229
|
|
|
169
230
|
const query_params = {};
|
|
170
231
|
|
|
171
|
-
|
|
232
|
+
const response = await PlatformAPIClient.execute(
|
|
172
233
|
this.config,
|
|
173
|
-
"
|
|
174
|
-
`/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/`,
|
|
175
236
|
query_params,
|
|
176
|
-
|
|
237
|
+
undefined
|
|
177
238
|
);
|
|
239
|
+
|
|
240
|
+
const {
|
|
241
|
+
error: res_error,
|
|
242
|
+
} = RewardsModel.ConfigurationRes().validate(response, {
|
|
243
|
+
abortEarly: false,
|
|
244
|
+
allowUnknown: false,
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
if (res_error) {
|
|
248
|
+
Logger({
|
|
249
|
+
level: "WARN",
|
|
250
|
+
message: "Response Validation Warnnings for getRewardsConfiguration",
|
|
251
|
+
});
|
|
252
|
+
Logger({ level: "WARN", message: res_error });
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return response;
|
|
178
256
|
}
|
|
179
257
|
|
|
180
258
|
/**
|
|
181
259
|
* @param {Object} arg - Arg object.
|
|
182
|
-
* @param {string} arg.
|
|
183
|
-
* @
|
|
184
|
-
*
|
|
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.
|
|
185
267
|
*/
|
|
186
|
-
|
|
187
|
-
const { error } = RewardsValidator.
|
|
268
|
+
async getUserPointsHistory({ userId, pageId, pageSize } = {}) {
|
|
269
|
+
const { error } = RewardsValidator.getUserPointsHistory().validate(
|
|
188
270
|
{
|
|
189
|
-
|
|
271
|
+
userId,
|
|
272
|
+
pageId,
|
|
273
|
+
pageSize,
|
|
190
274
|
},
|
|
191
275
|
{ abortEarly: false, allowUnknown: true }
|
|
192
276
|
);
|
|
@@ -197,38 +281,99 @@ class Rewards {
|
|
|
197
281
|
// Showing warrnings if extra unknown parameters are found
|
|
198
282
|
const {
|
|
199
283
|
error: warrning,
|
|
200
|
-
} = RewardsValidator.
|
|
284
|
+
} = RewardsValidator.getUserPointsHistory().validate(
|
|
201
285
|
{
|
|
202
|
-
|
|
286
|
+
userId,
|
|
287
|
+
pageId,
|
|
288
|
+
pageSize,
|
|
203
289
|
},
|
|
204
290
|
{ abortEarly: false, allowUnknown: false }
|
|
205
291
|
);
|
|
206
292
|
if (warrning) {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
293
|
+
Logger({
|
|
294
|
+
level: "WARN",
|
|
295
|
+
message: "Parameter Validation warrnings for getUserPointsHistory",
|
|
296
|
+
});
|
|
297
|
+
Logger({ level: "WARN", message: warrning });
|
|
211
298
|
}
|
|
212
299
|
|
|
213
300
|
const query_params = {};
|
|
301
|
+
query_params["page_id"] = pageId;
|
|
302
|
+
query_params["page_size"] = pageSize;
|
|
214
303
|
|
|
215
|
-
|
|
304
|
+
const response = await PlatformAPIClient.execute(
|
|
216
305
|
this.config,
|
|
217
306
|
"get",
|
|
218
|
-
`/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/`,
|
|
219
308
|
query_params,
|
|
220
309
|
undefined
|
|
221
310
|
);
|
|
311
|
+
|
|
312
|
+
const { error: res_error } = RewardsModel.HistoryRes().validate(response, {
|
|
313
|
+
abortEarly: false,
|
|
314
|
+
allowUnknown: false,
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
if (res_error) {
|
|
318
|
+
Logger({
|
|
319
|
+
level: "WARN",
|
|
320
|
+
message: "Response Validation Warnnings for getUserPointsHistory",
|
|
321
|
+
});
|
|
322
|
+
Logger({ level: "WARN", message: res_error });
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return response;
|
|
222
326
|
}
|
|
223
327
|
|
|
224
328
|
/**
|
|
225
329
|
* @param {Object} arg - Arg object.
|
|
226
|
-
* @
|
|
227
|
-
* @
|
|
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.
|
|
228
336
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
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
|
+
},
|
|
232
377
|
{ abortEarly: false, allowUnknown: true }
|
|
233
378
|
);
|
|
234
379
|
if (error) {
|
|
@@ -236,40 +381,57 @@ class Rewards {
|
|
|
236
381
|
}
|
|
237
382
|
|
|
238
383
|
// Showing warrnings if extra unknown parameters are found
|
|
239
|
-
const { error: warrning } = RewardsValidator.
|
|
240
|
-
{
|
|
384
|
+
const { error: warrning } = RewardsValidator.saveGiveAway().validate(
|
|
385
|
+
{
|
|
386
|
+
body,
|
|
387
|
+
},
|
|
241
388
|
{ abortEarly: false, allowUnknown: false }
|
|
242
389
|
);
|
|
243
390
|
if (warrning) {
|
|
244
|
-
|
|
245
|
-
|
|
391
|
+
Logger({
|
|
392
|
+
level: "WARN",
|
|
393
|
+
message: "Parameter Validation warrnings for saveGiveAway",
|
|
394
|
+
});
|
|
395
|
+
Logger({ level: "WARN", message: warrning });
|
|
246
396
|
}
|
|
247
397
|
|
|
248
398
|
const query_params = {};
|
|
249
399
|
|
|
250
|
-
|
|
400
|
+
const response = await PlatformAPIClient.execute(
|
|
251
401
|
this.config,
|
|
252
|
-
"
|
|
253
|
-
`/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`,
|
|
254
404
|
query_params,
|
|
255
|
-
|
|
405
|
+
body
|
|
256
406
|
);
|
|
407
|
+
|
|
408
|
+
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
409
|
+
abortEarly: false,
|
|
410
|
+
allowUnknown: false,
|
|
411
|
+
});
|
|
412
|
+
|
|
413
|
+
if (res_error) {
|
|
414
|
+
Logger({
|
|
415
|
+
level: "WARN",
|
|
416
|
+
message: "Response Validation Warnnings for saveGiveAway",
|
|
417
|
+
});
|
|
418
|
+
Logger({ level: "WARN", message: res_error });
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
return response;
|
|
257
422
|
}
|
|
258
423
|
|
|
259
424
|
/**
|
|
260
425
|
* @param {Object} arg - Arg object.
|
|
261
|
-
* @param {
|
|
262
|
-
* @
|
|
263
|
-
*
|
|
264
|
-
*
|
|
265
|
-
* @summary: Get offer by name
|
|
266
|
-
* @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.
|
|
267
430
|
*/
|
|
268
|
-
|
|
269
|
-
const { error } = RewardsValidator.
|
|
431
|
+
async setRewardsConfiguration({ body } = {}) {
|
|
432
|
+
const { error } = RewardsValidator.setRewardsConfiguration().validate(
|
|
270
433
|
{
|
|
271
|
-
|
|
272
|
-
cookie,
|
|
434
|
+
body,
|
|
273
435
|
},
|
|
274
436
|
{ abortEarly: false, allowUnknown: true }
|
|
275
437
|
);
|
|
@@ -278,41 +440,63 @@ class Rewards {
|
|
|
278
440
|
}
|
|
279
441
|
|
|
280
442
|
// Showing warrnings if extra unknown parameters are found
|
|
281
|
-
const {
|
|
443
|
+
const {
|
|
444
|
+
error: warrning,
|
|
445
|
+
} = RewardsValidator.setRewardsConfiguration().validate(
|
|
282
446
|
{
|
|
283
|
-
|
|
284
|
-
cookie,
|
|
447
|
+
body,
|
|
285
448
|
},
|
|
286
449
|
{ abortEarly: false, allowUnknown: false }
|
|
287
450
|
);
|
|
288
451
|
if (warrning) {
|
|
289
|
-
|
|
290
|
-
|
|
452
|
+
Logger({
|
|
453
|
+
level: "WARN",
|
|
454
|
+
message: "Parameter Validation warrnings for setRewardsConfiguration",
|
|
455
|
+
});
|
|
456
|
+
Logger({ level: "WARN", message: warrning });
|
|
291
457
|
}
|
|
292
458
|
|
|
293
459
|
const query_params = {};
|
|
294
460
|
|
|
295
|
-
|
|
461
|
+
const response = await PlatformAPIClient.execute(
|
|
296
462
|
this.config,
|
|
297
|
-
"
|
|
298
|
-
`/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/`,
|
|
299
465
|
query_params,
|
|
300
|
-
|
|
466
|
+
body
|
|
301
467
|
);
|
|
468
|
+
|
|
469
|
+
const {
|
|
470
|
+
error: res_error,
|
|
471
|
+
} = RewardsModel.SetConfigurationRes().validate(response, {
|
|
472
|
+
abortEarly: false,
|
|
473
|
+
allowUnknown: false,
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
if (res_error) {
|
|
477
|
+
Logger({
|
|
478
|
+
level: "WARN",
|
|
479
|
+
message: "Response Validation Warnnings for setRewardsConfiguration",
|
|
480
|
+
});
|
|
481
|
+
Logger({ level: "WARN", message: res_error });
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return response;
|
|
302
485
|
}
|
|
303
486
|
|
|
304
487
|
/**
|
|
305
488
|
* @param {Object} arg - Arg object.
|
|
306
|
-
* @param {string} arg.
|
|
307
|
-
* @param {
|
|
308
|
-
* @
|
|
309
|
-
* @
|
|
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.
|
|
310
494
|
*/
|
|
311
|
-
|
|
312
|
-
const { error } = RewardsValidator.
|
|
495
|
+
async showGiveaways({ pageId, pageSize } = {}) {
|
|
496
|
+
const { error } = RewardsValidator.showGiveaways().validate(
|
|
313
497
|
{
|
|
314
|
-
|
|
315
|
-
|
|
498
|
+
pageId,
|
|
499
|
+
pageSize,
|
|
316
500
|
},
|
|
317
501
|
{ abortEarly: false, allowUnknown: true }
|
|
318
502
|
);
|
|
@@ -321,42 +505,60 @@ class Rewards {
|
|
|
321
505
|
}
|
|
322
506
|
|
|
323
507
|
// Showing warrnings if extra unknown parameters are found
|
|
324
|
-
const { error: warrning } = RewardsValidator.
|
|
508
|
+
const { error: warrning } = RewardsValidator.showGiveaways().validate(
|
|
325
509
|
{
|
|
326
|
-
|
|
327
|
-
|
|
510
|
+
pageId,
|
|
511
|
+
pageSize,
|
|
328
512
|
},
|
|
329
513
|
{ abortEarly: false, allowUnknown: false }
|
|
330
514
|
);
|
|
331
515
|
if (warrning) {
|
|
332
|
-
|
|
333
|
-
|
|
516
|
+
Logger({
|
|
517
|
+
level: "WARN",
|
|
518
|
+
message: "Parameter Validation warrnings for showGiveaways",
|
|
519
|
+
});
|
|
520
|
+
Logger({ level: "WARN", message: warrning });
|
|
334
521
|
}
|
|
335
522
|
|
|
336
523
|
const query_params = {};
|
|
524
|
+
query_params["page_id"] = pageId;
|
|
525
|
+
query_params["page_size"] = pageSize;
|
|
337
526
|
|
|
338
|
-
|
|
527
|
+
const response = await PlatformAPIClient.execute(
|
|
339
528
|
this.config,
|
|
340
|
-
"
|
|
341
|
-
`/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`,
|
|
342
531
|
query_params,
|
|
343
|
-
|
|
532
|
+
undefined
|
|
344
533
|
);
|
|
534
|
+
|
|
535
|
+
const {
|
|
536
|
+
error: res_error,
|
|
537
|
+
} = RewardsModel.GiveawayResponse().validate(response, {
|
|
538
|
+
abortEarly: false,
|
|
539
|
+
allowUnknown: false,
|
|
540
|
+
});
|
|
541
|
+
|
|
542
|
+
if (res_error) {
|
|
543
|
+
Logger({
|
|
544
|
+
level: "WARN",
|
|
545
|
+
message: "Response Validation Warnnings for showGiveaways",
|
|
546
|
+
});
|
|
547
|
+
Logger({ level: "WARN", message: res_error });
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
return response;
|
|
345
551
|
}
|
|
346
552
|
|
|
347
553
|
/**
|
|
348
554
|
* @param {Object} arg - Arg object.
|
|
349
|
-
* @
|
|
350
|
-
* @
|
|
351
|
-
* @
|
|
352
|
-
* @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.
|
|
353
558
|
*/
|
|
354
|
-
|
|
355
|
-
const { error } = RewardsValidator.
|
|
356
|
-
{
|
|
357
|
-
userId,
|
|
358
|
-
body,
|
|
359
|
-
},
|
|
559
|
+
async showOffers({} = {}) {
|
|
560
|
+
const { error } = RewardsValidator.showOffers().validate(
|
|
561
|
+
{},
|
|
360
562
|
{ abortEarly: false, allowUnknown: true }
|
|
361
563
|
);
|
|
362
564
|
if (error) {
|
|
@@ -364,39 +566,56 @@ class Rewards {
|
|
|
364
566
|
}
|
|
365
567
|
|
|
366
568
|
// Showing warrnings if extra unknown parameters are found
|
|
367
|
-
const { error: warrning } = RewardsValidator.
|
|
368
|
-
{
|
|
369
|
-
userId,
|
|
370
|
-
body,
|
|
371
|
-
},
|
|
569
|
+
const { error: warrning } = RewardsValidator.showOffers().validate(
|
|
570
|
+
{},
|
|
372
571
|
{ abortEarly: false, allowUnknown: false }
|
|
373
572
|
);
|
|
374
573
|
if (warrning) {
|
|
375
|
-
|
|
376
|
-
|
|
574
|
+
Logger({
|
|
575
|
+
level: "WARN",
|
|
576
|
+
message: "Parameter Validation warrnings for showOffers",
|
|
577
|
+
});
|
|
578
|
+
Logger({ level: "WARN", message: warrning });
|
|
377
579
|
}
|
|
378
580
|
|
|
379
581
|
const query_params = {};
|
|
380
582
|
|
|
381
|
-
|
|
583
|
+
const response = await PlatformAPIClient.execute(
|
|
382
584
|
this.config,
|
|
383
|
-
"
|
|
384
|
-
`/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/`,
|
|
385
587
|
query_params,
|
|
386
|
-
|
|
588
|
+
undefined
|
|
387
589
|
);
|
|
590
|
+
|
|
591
|
+
const { error: res_error } = Joi.array()
|
|
592
|
+
.items(RewardsModel.Offer())
|
|
593
|
+
.validate(response, { abortEarly: false, allowUnknown: false });
|
|
594
|
+
|
|
595
|
+
if (res_error) {
|
|
596
|
+
Logger({
|
|
597
|
+
level: "WARN",
|
|
598
|
+
message: "Response Validation Warnnings for showOffers",
|
|
599
|
+
});
|
|
600
|
+
Logger({ level: "WARN", message: res_error });
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
return response;
|
|
388
604
|
}
|
|
389
605
|
|
|
390
606
|
/**
|
|
391
607
|
* @param {Object} arg - Arg object.
|
|
392
|
-
* @param {string} arg.
|
|
393
|
-
* @
|
|
394
|
-
* @
|
|
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.
|
|
395
613
|
*/
|
|
396
|
-
|
|
397
|
-
const { error } = RewardsValidator.
|
|
614
|
+
async updateGiveAway({ id, body } = {}) {
|
|
615
|
+
const { error } = RewardsValidator.updateGiveAway().validate(
|
|
398
616
|
{
|
|
399
|
-
|
|
617
|
+
id,
|
|
618
|
+
body,
|
|
400
619
|
},
|
|
401
620
|
{ abortEarly: false, allowUnknown: true }
|
|
402
621
|
);
|
|
@@ -405,43 +624,60 @@ class Rewards {
|
|
|
405
624
|
}
|
|
406
625
|
|
|
407
626
|
// Showing warrnings if extra unknown parameters are found
|
|
408
|
-
const { error: warrning } = RewardsValidator.
|
|
627
|
+
const { error: warrning } = RewardsValidator.updateGiveAway().validate(
|
|
409
628
|
{
|
|
410
|
-
|
|
629
|
+
id,
|
|
630
|
+
body,
|
|
411
631
|
},
|
|
412
632
|
{ abortEarly: false, allowUnknown: false }
|
|
413
633
|
);
|
|
414
634
|
if (warrning) {
|
|
415
|
-
|
|
416
|
-
|
|
635
|
+
Logger({
|
|
636
|
+
level: "WARN",
|
|
637
|
+
message: "Parameter Validation warrnings for updateGiveAway",
|
|
638
|
+
});
|
|
639
|
+
Logger({ level: "WARN", message: warrning });
|
|
417
640
|
}
|
|
418
641
|
|
|
419
642
|
const query_params = {};
|
|
420
643
|
|
|
421
|
-
|
|
644
|
+
const response = await PlatformAPIClient.execute(
|
|
422
645
|
this.config,
|
|
423
|
-
"
|
|
424
|
-
`/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}`,
|
|
425
648
|
query_params,
|
|
426
|
-
|
|
649
|
+
body
|
|
427
650
|
);
|
|
651
|
+
|
|
652
|
+
const { error: res_error } = RewardsModel.Giveaway().validate(response, {
|
|
653
|
+
abortEarly: false,
|
|
654
|
+
allowUnknown: false,
|
|
655
|
+
});
|
|
656
|
+
|
|
657
|
+
if (res_error) {
|
|
658
|
+
Logger({
|
|
659
|
+
level: "WARN",
|
|
660
|
+
message: "Response Validation Warnnings for updateGiveAway",
|
|
661
|
+
});
|
|
662
|
+
Logger({ level: "WARN", message: res_error });
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return response;
|
|
428
666
|
}
|
|
429
667
|
|
|
430
668
|
/**
|
|
431
669
|
* @param {Object} arg - Arg object.
|
|
432
|
-
* @param {string} arg.
|
|
433
|
-
* @param {
|
|
434
|
-
*
|
|
435
|
-
* @
|
|
436
|
-
* @
|
|
437
|
-
* @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
|
|
438
675
|
*/
|
|
439
|
-
|
|
440
|
-
const { error } = RewardsValidator.
|
|
676
|
+
async updateOfferByName({ name, body } = {}) {
|
|
677
|
+
const { error } = RewardsValidator.updateOfferByName().validate(
|
|
441
678
|
{
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
pageSize,
|
|
679
|
+
name,
|
|
680
|
+
body,
|
|
445
681
|
},
|
|
446
682
|
{ abortEarly: false, allowUnknown: true }
|
|
447
683
|
);
|
|
@@ -450,79 +686,61 @@ class Rewards {
|
|
|
450
686
|
}
|
|
451
687
|
|
|
452
688
|
// Showing warrnings if extra unknown parameters are found
|
|
453
|
-
const {
|
|
454
|
-
error: warrning,
|
|
455
|
-
} = RewardsValidator.getUserPointsHistory().validate(
|
|
689
|
+
const { error: warrning } = RewardsValidator.updateOfferByName().validate(
|
|
456
690
|
{
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
pageSize,
|
|
691
|
+
name,
|
|
692
|
+
body,
|
|
460
693
|
},
|
|
461
694
|
{ abortEarly: false, allowUnknown: false }
|
|
462
695
|
);
|
|
463
696
|
if (warrning) {
|
|
464
|
-
|
|
465
|
-
|
|
697
|
+
Logger({
|
|
698
|
+
level: "WARN",
|
|
699
|
+
message: "Parameter Validation warrnings for updateOfferByName",
|
|
700
|
+
});
|
|
701
|
+
Logger({ level: "WARN", message: warrning });
|
|
466
702
|
}
|
|
467
703
|
|
|
468
704
|
const query_params = {};
|
|
469
|
-
query_params["page_id"] = pageId;
|
|
470
|
-
query_params["page_size"] = pageSize;
|
|
471
705
|
|
|
472
|
-
|
|
706
|
+
const response = await PlatformAPIClient.execute(
|
|
473
707
|
this.config,
|
|
474
|
-
"
|
|
475
|
-
`/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}/`,
|
|
476
710
|
query_params,
|
|
477
|
-
|
|
711
|
+
body
|
|
478
712
|
);
|
|
479
|
-
}
|
|
480
713
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
getUserPointsHistoryPaginator({
|
|
491
|
-
userId,
|
|
492
|
-
companyId,
|
|
493
|
-
applicationId,
|
|
494
|
-
pageSize,
|
|
495
|
-
} = {}) {
|
|
496
|
-
const paginator = new Paginator();
|
|
497
|
-
const callback = async () => {
|
|
498
|
-
const pageId = paginator.nextId;
|
|
499
|
-
const pageNo = paginator.pageNo;
|
|
500
|
-
const pageType = "cursor";
|
|
501
|
-
const data = await this.getUserPointsHistory({
|
|
502
|
-
userId: userId,
|
|
503
|
-
companyId: companyId,
|
|
504
|
-
applicationId: applicationId,
|
|
505
|
-
pageId: pageId,
|
|
506
|
-
pageSize: pageSize,
|
|
507
|
-
});
|
|
508
|
-
paginator.setPaginator({
|
|
509
|
-
hasNext: data.page.has_next ? true : false,
|
|
510
|
-
nextId: data.page.next_id,
|
|
714
|
+
const { error: res_error } = RewardsModel.Offer().validate(response, {
|
|
715
|
+
abortEarly: false,
|
|
716
|
+
allowUnknown: false,
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
if (res_error) {
|
|
720
|
+
Logger({
|
|
721
|
+
level: "WARN",
|
|
722
|
+
message: "Response Validation Warnnings for updateOfferByName",
|
|
511
723
|
});
|
|
512
|
-
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
return
|
|
724
|
+
Logger({ level: "WARN", message: res_error });
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
return response;
|
|
516
728
|
}
|
|
517
729
|
|
|
518
730
|
/**
|
|
519
731
|
* @param {Object} arg - Arg object.
|
|
520
|
-
* @
|
|
521
|
-
* @
|
|
732
|
+
* @param {string} arg.userId - User id
|
|
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
|
|
522
737
|
*/
|
|
523
|
-
|
|
524
|
-
const { error } = RewardsValidator.
|
|
525
|
-
{
|
|
738
|
+
async updateUserStatus({ userId, body } = {}) {
|
|
739
|
+
const { error } = RewardsValidator.updateUserStatus().validate(
|
|
740
|
+
{
|
|
741
|
+
userId,
|
|
742
|
+
body,
|
|
743
|
+
},
|
|
526
744
|
{ abortEarly: false, allowUnknown: true }
|
|
527
745
|
);
|
|
528
746
|
if (error) {
|
|
@@ -530,38 +748,58 @@ class Rewards {
|
|
|
530
748
|
}
|
|
531
749
|
|
|
532
750
|
// Showing warrnings if extra unknown parameters are found
|
|
533
|
-
const {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
751
|
+
const { error: warrning } = RewardsValidator.updateUserStatus().validate(
|
|
752
|
+
{
|
|
753
|
+
userId,
|
|
754
|
+
body,
|
|
755
|
+
},
|
|
537
756
|
{ abortEarly: false, allowUnknown: false }
|
|
538
757
|
);
|
|
539
758
|
if (warrning) {
|
|
540
|
-
|
|
541
|
-
|
|
759
|
+
Logger({
|
|
760
|
+
level: "WARN",
|
|
761
|
+
message: "Parameter Validation warrnings for updateUserStatus",
|
|
762
|
+
});
|
|
763
|
+
Logger({ level: "WARN", message: warrning });
|
|
542
764
|
}
|
|
543
765
|
|
|
544
766
|
const query_params = {};
|
|
545
767
|
|
|
546
|
-
|
|
768
|
+
const response = await PlatformAPIClient.execute(
|
|
547
769
|
this.config,
|
|
548
|
-
"
|
|
549
|
-
`/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}/`,
|
|
550
772
|
query_params,
|
|
551
|
-
|
|
773
|
+
body
|
|
552
774
|
);
|
|
775
|
+
|
|
776
|
+
const { error: res_error } = RewardsModel.AppUser().validate(response, {
|
|
777
|
+
abortEarly: false,
|
|
778
|
+
allowUnknown: false,
|
|
779
|
+
});
|
|
780
|
+
|
|
781
|
+
if (res_error) {
|
|
782
|
+
Logger({
|
|
783
|
+
level: "WARN",
|
|
784
|
+
message: "Response Validation Warnnings for updateUserStatus",
|
|
785
|
+
});
|
|
786
|
+
Logger({ level: "WARN", message: res_error });
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return response;
|
|
553
790
|
}
|
|
554
791
|
|
|
555
792
|
/**
|
|
556
793
|
* @param {Object} arg - Arg object.
|
|
557
|
-
* @param {
|
|
558
|
-
* @
|
|
559
|
-
* @
|
|
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
|
|
560
798
|
*/
|
|
561
|
-
|
|
562
|
-
const { error } = RewardsValidator.
|
|
799
|
+
async user({ userId } = {}) {
|
|
800
|
+
const { error } = RewardsValidator.user().validate(
|
|
563
801
|
{
|
|
564
|
-
|
|
802
|
+
userId,
|
|
565
803
|
},
|
|
566
804
|
{ abortEarly: false, allowUnknown: true }
|
|
567
805
|
);
|
|
@@ -570,28 +808,44 @@ class Rewards {
|
|
|
570
808
|
}
|
|
571
809
|
|
|
572
810
|
// Showing warrnings if extra unknown parameters are found
|
|
573
|
-
const {
|
|
574
|
-
error: warrning,
|
|
575
|
-
} = RewardsValidator.setRewardsConfiguration().validate(
|
|
811
|
+
const { error: warrning } = RewardsValidator.user().validate(
|
|
576
812
|
{
|
|
577
|
-
|
|
813
|
+
userId,
|
|
578
814
|
},
|
|
579
815
|
{ abortEarly: false, allowUnknown: false }
|
|
580
816
|
);
|
|
581
817
|
if (warrning) {
|
|
582
|
-
|
|
583
|
-
|
|
818
|
+
Logger({
|
|
819
|
+
level: "WARN",
|
|
820
|
+
message: "Parameter Validation warrnings for user",
|
|
821
|
+
});
|
|
822
|
+
Logger({ level: "WARN", message: warrning });
|
|
584
823
|
}
|
|
585
824
|
|
|
586
825
|
const query_params = {};
|
|
587
826
|
|
|
588
|
-
|
|
827
|
+
const response = await PlatformAPIClient.execute(
|
|
589
828
|
this.config,
|
|
590
|
-
"
|
|
591
|
-
`/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}/`,
|
|
592
831
|
query_params,
|
|
593
|
-
|
|
832
|
+
undefined
|
|
594
833
|
);
|
|
834
|
+
|
|
835
|
+
const { error: res_error } = RewardsModel.UserRes().validate(response, {
|
|
836
|
+
abortEarly: false,
|
|
837
|
+
allowUnknown: false,
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
if (res_error) {
|
|
841
|
+
Logger({
|
|
842
|
+
level: "WARN",
|
|
843
|
+
message: "Response Validation Warnnings for user",
|
|
844
|
+
});
|
|
845
|
+
Logger({ level: "WARN", message: res_error });
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
return response;
|
|
595
849
|
}
|
|
596
850
|
}
|
|
597
851
|
module.exports = Rewards;
|