@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
|
@@ -1,252 +1,169 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
2
|
|
|
3
3
|
class AnalyticsModel {
|
|
4
|
-
static
|
|
5
|
-
return Joi.object({
|
|
6
|
-
key: Joi.string().allow(""),
|
|
7
|
-
|
|
8
|
-
url: Joi.string().allow(""),
|
|
9
|
-
|
|
10
|
-
title: Joi.string().allow(""),
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
static ErrorRes() {
|
|
15
|
-
return Joi.object({
|
|
16
|
-
message: Joi.string().allow(""),
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static StatsGroups() {
|
|
21
|
-
return Joi.object({
|
|
22
|
-
groups: Joi.array().items(AnalyticsModel.StatGroup()),
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static StatsGroupComponent() {
|
|
27
|
-
return Joi.object({
|
|
28
|
-
key: Joi.string().allow(""),
|
|
29
|
-
|
|
30
|
-
url: Joi.string().allow(""),
|
|
31
|
-
|
|
32
|
-
title: Joi.string().allow(""),
|
|
33
|
-
|
|
34
|
-
type: Joi.string().allow(""),
|
|
35
|
-
|
|
36
|
-
filters: Joi.any(),
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static StatsGroupComponents() {
|
|
41
|
-
return Joi.object({
|
|
42
|
-
title: Joi.string().allow(""),
|
|
43
|
-
|
|
44
|
-
components: Joi.array().items(AnalyticsModel.StatsGroupComponent()),
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
static StatsRes() {
|
|
49
|
-
return Joi.object({
|
|
50
|
-
key: Joi.string().allow(""),
|
|
51
|
-
|
|
52
|
-
title: Joi.string().allow(""),
|
|
53
|
-
|
|
54
|
-
type: Joi.string().allow(""),
|
|
55
|
-
|
|
56
|
-
data: Joi.any(),
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
static ReceivedAt() {
|
|
4
|
+
static AbandonCartDetail() {
|
|
61
5
|
return Joi.object({
|
|
62
|
-
|
|
6
|
+
_id: Joi.string().allow(""),
|
|
7
|
+
address: Joi.any(),
|
|
8
|
+
articles: Joi.array().items(Joi.any()),
|
|
9
|
+
breakup: Joi.any(),
|
|
10
|
+
cart_value: Joi.string().allow(""),
|
|
11
|
+
user_id: Joi.string().allow(""),
|
|
63
12
|
});
|
|
64
13
|
}
|
|
65
|
-
|
|
66
14
|
static AbandonCartsDetail() {
|
|
67
15
|
return Joi.object({
|
|
68
|
-
|
|
69
|
-
|
|
16
|
+
context_app_application_id: Joi.string().allow(""),
|
|
17
|
+
context_traits_email: Joi.string().allow(""),
|
|
70
18
|
context_traits_first_name: Joi.string().allow(""),
|
|
71
|
-
|
|
72
19
|
context_traits_last_name: Joi.string().allow(""),
|
|
73
|
-
|
|
74
20
|
context_traits_phone_number: Joi.string().allow(""),
|
|
75
|
-
|
|
76
|
-
context_traits_email: Joi.string().allow(""),
|
|
77
|
-
|
|
78
|
-
context_app_application_id: Joi.string().allow(""),
|
|
79
|
-
|
|
80
21
|
properties_breakup_values_raw_total: Joi.string().allow(""),
|
|
81
|
-
|
|
22
|
+
properties_cart_id: Joi.string().allow(""),
|
|
82
23
|
received_at: AnalyticsModel.ReceivedAt(),
|
|
83
24
|
});
|
|
84
25
|
}
|
|
85
|
-
|
|
86
|
-
static Page() {
|
|
87
|
-
return Joi.object({
|
|
88
|
-
item_total: Joi.number(),
|
|
89
|
-
|
|
90
|
-
next_id: Joi.string().allow(""),
|
|
91
|
-
|
|
92
|
-
has_previous: Joi.boolean(),
|
|
93
|
-
|
|
94
|
-
has_next: Joi.boolean(),
|
|
95
|
-
|
|
96
|
-
current: Joi.number(),
|
|
97
|
-
|
|
98
|
-
type: Joi.string().allow("").required(),
|
|
99
|
-
|
|
100
|
-
size: Joi.number(),
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
|
|
104
26
|
static AbandonCartsList() {
|
|
105
27
|
return Joi.object({
|
|
106
|
-
items: Joi.array().items(AnalyticsModel.AbandonCartsDetail()),
|
|
107
|
-
|
|
108
28
|
cart_total: Joi.string().allow(""),
|
|
109
|
-
|
|
29
|
+
items: Joi.array().items(AnalyticsModel.AbandonCartsDetail()),
|
|
110
30
|
page: AnalyticsModel.Page(),
|
|
111
31
|
});
|
|
112
32
|
}
|
|
113
|
-
|
|
114
|
-
static AbandonCartDetail() {
|
|
33
|
+
static ErrorRes() {
|
|
115
34
|
return Joi.object({
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
user_id: Joi.string().allow(""),
|
|
119
|
-
|
|
120
|
-
cart_value: Joi.string().allow(""),
|
|
121
|
-
|
|
122
|
-
articles: Joi.array().items(Joi.any()),
|
|
123
|
-
|
|
124
|
-
breakup: Joi.any(),
|
|
125
|
-
|
|
126
|
-
address: Joi.any(),
|
|
35
|
+
message: Joi.string().allow(""),
|
|
127
36
|
});
|
|
128
37
|
}
|
|
129
|
-
|
|
130
38
|
static ExportJobReq() {
|
|
131
39
|
return Joi.object({
|
|
132
|
-
marketplace_name: Joi.string().allow(""),
|
|
133
|
-
|
|
134
|
-
start_time: Joi.string().allow(""),
|
|
135
|
-
|
|
136
40
|
end_time: Joi.string().allow(""),
|
|
137
|
-
|
|
138
41
|
event_type: Joi.string().allow(""),
|
|
139
|
-
|
|
42
|
+
marketplace_name: Joi.string().allow(""),
|
|
43
|
+
start_time: Joi.string().allow(""),
|
|
140
44
|
trace_id: Joi.string().allow(""),
|
|
141
45
|
});
|
|
142
46
|
}
|
|
143
|
-
|
|
144
47
|
static ExportJobRes() {
|
|
145
48
|
return Joi.object({
|
|
146
|
-
status: Joi.string().allow(""),
|
|
147
|
-
|
|
148
49
|
job_id: Joi.string().allow(""),
|
|
50
|
+
status: Joi.string().allow(""),
|
|
149
51
|
});
|
|
150
52
|
}
|
|
151
|
-
|
|
152
53
|
static ExportJobStatusRes() {
|
|
153
54
|
return Joi.object({
|
|
154
|
-
status: Joi.string().allow(""),
|
|
155
|
-
|
|
156
|
-
job_id: Joi.string().allow(""),
|
|
157
|
-
|
|
158
55
|
download_url: Joi.string().allow(""),
|
|
56
|
+
job_id: Joi.string().allow(""),
|
|
57
|
+
status: Joi.string().allow(""),
|
|
159
58
|
});
|
|
160
59
|
}
|
|
161
|
-
|
|
162
60
|
static GetLogsListReq() {
|
|
163
61
|
return Joi.object({
|
|
164
|
-
marketplace_name: Joi.string().allow(""),
|
|
165
|
-
|
|
166
|
-
start_date: Joi.string().allow(""),
|
|
167
|
-
|
|
168
62
|
company_id: Joi.string().allow(""),
|
|
169
|
-
|
|
170
63
|
end_date: Joi.string().allow(""),
|
|
64
|
+
marketplace_name: Joi.string().allow(""),
|
|
65
|
+
start_date: Joi.string().allow(""),
|
|
171
66
|
});
|
|
172
67
|
}
|
|
173
|
-
|
|
174
|
-
static MkpLogsResp() {
|
|
68
|
+
static GetLogsListRes() {
|
|
175
69
|
return Joi.object({
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
70
|
+
items: Joi.array().items(AnalyticsModel.MkpLogsResp()),
|
|
71
|
+
page: AnalyticsModel.Page(),
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
static LogInfo() {
|
|
75
|
+
return Joi.object({
|
|
76
|
+
_id: Joi.string().allow(""),
|
|
77
|
+
article_id: Joi.string().allow(""),
|
|
78
|
+
brand_id: Joi.number(),
|
|
79
|
+
company_id: Joi.number(),
|
|
80
|
+
event: Joi.string().allow(""),
|
|
180
81
|
event_type: Joi.string().allow(""),
|
|
181
|
-
|
|
82
|
+
item_id: Joi.number(),
|
|
83
|
+
marketplace_name: Joi.string().allow(""),
|
|
84
|
+
seller_identifier: Joi.string().allow(""),
|
|
85
|
+
status: Joi.string().allow(""),
|
|
86
|
+
store_code: Joi.string().allow(""),
|
|
87
|
+
store_id: Joi.number(),
|
|
182
88
|
trace_id: Joi.string().allow(""),
|
|
183
|
-
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
static MkpLogsResp() {
|
|
92
|
+
return Joi.object({
|
|
184
93
|
count: Joi.string().allow(""),
|
|
185
|
-
|
|
94
|
+
end_time_iso: Joi.string().allow(""),
|
|
95
|
+
event_type: Joi.string().allow(""),
|
|
96
|
+
start_time_iso: Joi.string().allow(""),
|
|
186
97
|
status: Joi.string().allow(""),
|
|
98
|
+
trace_id: Joi.string().allow(""),
|
|
187
99
|
});
|
|
188
100
|
}
|
|
189
|
-
|
|
190
|
-
static GetLogsListRes() {
|
|
101
|
+
static Page() {
|
|
191
102
|
return Joi.object({
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
103
|
+
current: Joi.number(),
|
|
104
|
+
has_next: Joi.boolean(),
|
|
105
|
+
has_previous: Joi.boolean(),
|
|
106
|
+
item_total: Joi.number(),
|
|
107
|
+
next_id: Joi.string().allow(""),
|
|
108
|
+
size: Joi.number(),
|
|
109
|
+
type: Joi.string().allow("").required(),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
static ReceivedAt() {
|
|
113
|
+
return Joi.object({
|
|
114
|
+
value: Joi.string().allow(""),
|
|
195
115
|
});
|
|
196
116
|
}
|
|
197
|
-
|
|
198
117
|
static SearchLogReq() {
|
|
199
118
|
return Joi.object({
|
|
200
|
-
marketplace_name: Joi.string().allow(""),
|
|
201
|
-
|
|
202
|
-
start_date: Joi.string().allow(""),
|
|
203
|
-
|
|
204
119
|
company_id: Joi.string().allow(""),
|
|
205
|
-
|
|
206
120
|
end_date: Joi.string().allow(""),
|
|
207
|
-
|
|
208
121
|
identifier: Joi.string().allow(""),
|
|
209
|
-
|
|
210
122
|
identifier_value: Joi.string().allow(""),
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
static LogInfo() {
|
|
215
|
-
return Joi.object({
|
|
216
|
-
_id: Joi.string().allow(""),
|
|
217
|
-
|
|
218
|
-
status: Joi.string().allow(""),
|
|
219
|
-
|
|
220
|
-
event_type: Joi.string().allow(""),
|
|
221
|
-
|
|
222
123
|
marketplace_name: Joi.string().allow(""),
|
|
223
|
-
|
|
224
|
-
event: Joi.string().allow(""),
|
|
225
|
-
|
|
226
|
-
trace_id: Joi.string().allow(""),
|
|
227
|
-
|
|
228
|
-
company_id: Joi.number(),
|
|
229
|
-
|
|
230
|
-
brand_id: Joi.number(),
|
|
231
|
-
|
|
232
|
-
store_code: Joi.string().allow(""),
|
|
233
|
-
|
|
234
|
-
store_id: Joi.number(),
|
|
235
|
-
|
|
236
|
-
item_id: Joi.number(),
|
|
237
|
-
|
|
238
|
-
article_id: Joi.string().allow(""),
|
|
239
|
-
|
|
240
|
-
seller_identifier: Joi.string().allow(""),
|
|
124
|
+
start_date: Joi.string().allow(""),
|
|
241
125
|
});
|
|
242
126
|
}
|
|
243
|
-
|
|
244
127
|
static SearchLogRes() {
|
|
245
128
|
return Joi.object({
|
|
246
129
|
items: Joi.array().items(AnalyticsModel.LogInfo()),
|
|
247
|
-
|
|
248
130
|
page: AnalyticsModel.Page(),
|
|
249
131
|
});
|
|
250
132
|
}
|
|
133
|
+
static StatGroup() {
|
|
134
|
+
return Joi.object({
|
|
135
|
+
key: Joi.string().allow(""),
|
|
136
|
+
title: Joi.string().allow(""),
|
|
137
|
+
url: Joi.string().allow(""),
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
static StatsGroupComponent() {
|
|
141
|
+
return Joi.object({
|
|
142
|
+
filters: Joi.any(),
|
|
143
|
+
key: Joi.string().allow(""),
|
|
144
|
+
title: Joi.string().allow(""),
|
|
145
|
+
type: Joi.string().allow(""),
|
|
146
|
+
url: Joi.string().allow(""),
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
static StatsGroupComponents() {
|
|
150
|
+
return Joi.object({
|
|
151
|
+
components: Joi.array().items(AnalyticsModel.StatsGroupComponent()),
|
|
152
|
+
title: Joi.string().allow(""),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
static StatsGroups() {
|
|
156
|
+
return Joi.object({
|
|
157
|
+
groups: Joi.array().items(AnalyticsModel.StatGroup()),
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
static StatsRes() {
|
|
161
|
+
return Joi.object({
|
|
162
|
+
data: Joi.any(),
|
|
163
|
+
key: Joi.string().allow(""),
|
|
164
|
+
title: Joi.string().allow(""),
|
|
165
|
+
type: Joi.string().allow(""),
|
|
166
|
+
});
|
|
167
|
+
}
|
|
251
168
|
}
|
|
252
169
|
module.exports = AnalyticsModel;
|
|
@@ -2,37 +2,41 @@ export = AuditTrail;
|
|
|
2
2
|
declare class AuditTrail {
|
|
3
3
|
constructor(config: any);
|
|
4
4
|
config: any;
|
|
5
|
-
/**
|
|
6
|
-
* @param {Object} arg - Arg object.
|
|
7
|
-
* @param {string} arg.qs - Logs Query
|
|
8
|
-
* @summary: Get paginated audit logs
|
|
9
|
-
* @description: Get a paginated set of logs that can be filtered using the available set of parameters and get the relevant group of logs
|
|
10
|
-
*/
|
|
11
|
-
getAuditLogs({ qs }?: {
|
|
12
|
-
qs: string;
|
|
13
|
-
}): Promise<any>;
|
|
14
5
|
/**
|
|
15
6
|
* @param {Object} arg - Arg object.
|
|
16
7
|
* @param {RequestBodyAuditLog} arg.body
|
|
8
|
+
* @returns {Promise<CreateLogResponse>} - Success response
|
|
17
9
|
* @summary: Create logs for auditing later on
|
|
18
10
|
* @description: Create a log instance that stores all the relevant info to be logged
|
|
19
11
|
*/
|
|
20
12
|
createAuditLog({ body }?: {
|
|
21
13
|
body: RequestBodyAuditLog;
|
|
22
|
-
}): Promise<
|
|
14
|
+
}): Promise<CreateLogResponse>;
|
|
23
15
|
/**
|
|
24
16
|
* @param {Object} arg - Arg object.
|
|
25
17
|
* @param {string} arg.id - Log uuid
|
|
18
|
+
* @returns {Promise<LogSchemaResponse>} - Success response
|
|
26
19
|
* @summary: Get audit log
|
|
27
20
|
* @description: Get detailed log information by their id
|
|
28
21
|
*/
|
|
29
22
|
getAuditLog({ id }?: {
|
|
30
23
|
id: string;
|
|
31
|
-
}): Promise<
|
|
24
|
+
}): Promise<LogSchemaResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* @param {Object} arg - Arg object.
|
|
27
|
+
* @param {string} arg.qs - Logs Query
|
|
28
|
+
* @returns {Promise<LogSchemaResponse>} - Success response
|
|
29
|
+
* @summary: Get paginated audit logs
|
|
30
|
+
* @description: Get a paginated set of logs that can be filtered using the available set of parameters and get the relevant group of logs
|
|
31
|
+
*/
|
|
32
|
+
getAuditLogs({ qs }?: {
|
|
33
|
+
qs: string;
|
|
34
|
+
}): Promise<LogSchemaResponse>;
|
|
32
35
|
/**
|
|
33
36
|
* @param {Object} arg - Arg object.
|
|
37
|
+
* @returns {Promise<EntityTypesResponse>} - Success response
|
|
34
38
|
* @summary: Get entity types
|
|
35
39
|
* @description: Get a consolidated list of entity types from all the logs stored on the db, which further helps to filter the logs better
|
|
36
40
|
*/
|
|
37
|
-
getEntityTypes({}?: any): Promise<
|
|
41
|
+
getEntityTypes({}?: any): Promise<EntityTypesResponse>;
|
|
38
42
|
}
|
|
@@ -2,6 +2,9 @@ const Paginator = require("../../common/Paginator");
|
|
|
2
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
3
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
4
|
const AuditTrailValidator = require("./AuditTrailPlatformValidator");
|
|
5
|
+
const AuditTrailModel = require("./AuditTrailPlatformModel");
|
|
6
|
+
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
|
|
5
8
|
class AuditTrail {
|
|
6
9
|
constructor(config) {
|
|
7
10
|
this.config = config;
|
|
@@ -9,14 +12,15 @@ class AuditTrail {
|
|
|
9
12
|
|
|
10
13
|
/**
|
|
11
14
|
* @param {Object} arg - Arg object.
|
|
12
|
-
* @param {
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
+
* @param {RequestBodyAuditLog} arg.body
|
|
16
|
+
* @returns {Promise<CreateLogResponse>} - Success response
|
|
17
|
+
* @summary: Create logs for auditing later on
|
|
18
|
+
* @description: Create a log instance that stores all the relevant info to be logged
|
|
15
19
|
*/
|
|
16
|
-
|
|
17
|
-
const { error } = AuditTrailValidator.
|
|
20
|
+
async createAuditLog({ body } = {}) {
|
|
21
|
+
const { error } = AuditTrailValidator.createAuditLog().validate(
|
|
18
22
|
{
|
|
19
|
-
|
|
23
|
+
body,
|
|
20
24
|
},
|
|
21
25
|
{ abortEarly: false, allowUnknown: true }
|
|
22
26
|
);
|
|
@@ -25,42 +29,62 @@ class AuditTrail {
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
// Showing warrnings if extra unknown parameters are found
|
|
28
|
-
const { error: warrning } = AuditTrailValidator.
|
|
32
|
+
const { error: warrning } = AuditTrailValidator.createAuditLog().validate(
|
|
29
33
|
{
|
|
30
|
-
|
|
34
|
+
body,
|
|
31
35
|
},
|
|
32
36
|
{ abortEarly: false, allowUnknown: false }
|
|
33
37
|
);
|
|
34
38
|
if (warrning) {
|
|
35
|
-
|
|
36
|
-
|
|
39
|
+
Logger({
|
|
40
|
+
level: "WARN",
|
|
41
|
+
message: "Parameter Validation warrnings for createAuditLog",
|
|
42
|
+
});
|
|
43
|
+
Logger({ level: "WARN", message: warrning });
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
const query_params = {};
|
|
40
|
-
query_params["qs"] = qs;
|
|
41
47
|
|
|
42
48
|
const xHeaders = {};
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
const response = await PlatformAPIClient.execute(
|
|
45
51
|
this.config,
|
|
46
|
-
"
|
|
52
|
+
"post",
|
|
47
53
|
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/`,
|
|
48
54
|
query_params,
|
|
49
|
-
|
|
55
|
+
body,
|
|
50
56
|
xHeaders
|
|
51
57
|
);
|
|
58
|
+
|
|
59
|
+
const {
|
|
60
|
+
error: res_error,
|
|
61
|
+
} = AuditTrailModel.CreateLogResponse().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 createAuditLog",
|
|
70
|
+
});
|
|
71
|
+
Logger({ level: "WARN", message: res_error });
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return response;
|
|
52
75
|
}
|
|
53
76
|
|
|
54
77
|
/**
|
|
55
78
|
* @param {Object} arg - Arg object.
|
|
56
|
-
* @param {
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
79
|
+
* @param {string} arg.id - Log uuid
|
|
80
|
+
* @returns {Promise<LogSchemaResponse>} - Success response
|
|
81
|
+
* @summary: Get audit log
|
|
82
|
+
* @description: Get detailed log information by their id
|
|
59
83
|
*/
|
|
60
|
-
|
|
61
|
-
const { error } = AuditTrailValidator.
|
|
84
|
+
async getAuditLog({ id } = {}) {
|
|
85
|
+
const { error } = AuditTrailValidator.getAuditLog().validate(
|
|
62
86
|
{
|
|
63
|
-
|
|
87
|
+
id,
|
|
64
88
|
},
|
|
65
89
|
{ abortEarly: false, allowUnknown: true }
|
|
66
90
|
);
|
|
@@ -69,41 +93,62 @@ class AuditTrail {
|
|
|
69
93
|
}
|
|
70
94
|
|
|
71
95
|
// Showing warrnings if extra unknown parameters are found
|
|
72
|
-
const { error: warrning } = AuditTrailValidator.
|
|
96
|
+
const { error: warrning } = AuditTrailValidator.getAuditLog().validate(
|
|
73
97
|
{
|
|
74
|
-
|
|
98
|
+
id,
|
|
75
99
|
},
|
|
76
100
|
{ abortEarly: false, allowUnknown: false }
|
|
77
101
|
);
|
|
78
102
|
if (warrning) {
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
Logger({
|
|
104
|
+
level: "WARN",
|
|
105
|
+
message: "Parameter Validation warrnings for getAuditLog",
|
|
106
|
+
});
|
|
107
|
+
Logger({ level: "WARN", message: warrning });
|
|
81
108
|
}
|
|
82
109
|
|
|
83
110
|
const query_params = {};
|
|
84
111
|
|
|
85
112
|
const xHeaders = {};
|
|
86
113
|
|
|
87
|
-
|
|
114
|
+
const response = await PlatformAPIClient.execute(
|
|
88
115
|
this.config,
|
|
89
|
-
"
|
|
90
|
-
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs
|
|
116
|
+
"get",
|
|
117
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/${id}`,
|
|
91
118
|
query_params,
|
|
92
|
-
|
|
119
|
+
undefined,
|
|
93
120
|
xHeaders
|
|
94
121
|
);
|
|
122
|
+
|
|
123
|
+
const {
|
|
124
|
+
error: res_error,
|
|
125
|
+
} = AuditTrailModel.LogSchemaResponse().validate(response, {
|
|
126
|
+
abortEarly: false,
|
|
127
|
+
allowUnknown: false,
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
if (res_error) {
|
|
131
|
+
Logger({
|
|
132
|
+
level: "WARN",
|
|
133
|
+
message: "Response Validation Warnnings for getAuditLog",
|
|
134
|
+
});
|
|
135
|
+
Logger({ level: "WARN", message: res_error });
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return response;
|
|
95
139
|
}
|
|
96
140
|
|
|
97
141
|
/**
|
|
98
142
|
* @param {Object} arg - Arg object.
|
|
99
|
-
* @param {string} arg.
|
|
100
|
-
* @
|
|
101
|
-
* @
|
|
143
|
+
* @param {string} arg.qs - Logs Query
|
|
144
|
+
* @returns {Promise<LogSchemaResponse>} - Success response
|
|
145
|
+
* @summary: Get paginated audit logs
|
|
146
|
+
* @description: Get a paginated set of logs that can be filtered using the available set of parameters and get the relevant group of logs
|
|
102
147
|
*/
|
|
103
|
-
|
|
104
|
-
const { error } = AuditTrailValidator.
|
|
148
|
+
async getAuditLogs({ qs } = {}) {
|
|
149
|
+
const { error } = AuditTrailValidator.getAuditLogs().validate(
|
|
105
150
|
{
|
|
106
|
-
|
|
151
|
+
qs,
|
|
107
152
|
},
|
|
108
153
|
{ abortEarly: false, allowUnknown: true }
|
|
109
154
|
);
|
|
@@ -112,37 +157,59 @@ class AuditTrail {
|
|
|
112
157
|
}
|
|
113
158
|
|
|
114
159
|
// Showing warrnings if extra unknown parameters are found
|
|
115
|
-
const { error: warrning } = AuditTrailValidator.
|
|
160
|
+
const { error: warrning } = AuditTrailValidator.getAuditLogs().validate(
|
|
116
161
|
{
|
|
117
|
-
|
|
162
|
+
qs,
|
|
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 getAuditLogs",
|
|
170
|
+
});
|
|
171
|
+
Logger({ level: "WARN", message: warrning });
|
|
124
172
|
}
|
|
125
173
|
|
|
126
174
|
const query_params = {};
|
|
175
|
+
query_params["qs"] = qs;
|
|
127
176
|
|
|
128
177
|
const xHeaders = {};
|
|
129
178
|
|
|
130
|
-
|
|
179
|
+
const response = await PlatformAPIClient.execute(
|
|
131
180
|
this.config,
|
|
132
181
|
"get",
|
|
133
|
-
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs
|
|
182
|
+
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/logs/`,
|
|
134
183
|
query_params,
|
|
135
184
|
undefined,
|
|
136
185
|
xHeaders
|
|
137
186
|
);
|
|
187
|
+
|
|
188
|
+
const {
|
|
189
|
+
error: res_error,
|
|
190
|
+
} = AuditTrailModel.LogSchemaResponse().validate(response, {
|
|
191
|
+
abortEarly: false,
|
|
192
|
+
allowUnknown: false,
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (res_error) {
|
|
196
|
+
Logger({
|
|
197
|
+
level: "WARN",
|
|
198
|
+
message: "Response Validation Warnnings for getAuditLogs",
|
|
199
|
+
});
|
|
200
|
+
Logger({ level: "WARN", message: res_error });
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return response;
|
|
138
204
|
}
|
|
139
205
|
|
|
140
206
|
/**
|
|
141
207
|
* @param {Object} arg - Arg object.
|
|
208
|
+
* @returns {Promise<EntityTypesResponse>} - Success response
|
|
142
209
|
* @summary: Get entity types
|
|
143
210
|
* @description: Get a consolidated list of entity types from all the logs stored on the db, which further helps to filter the logs better
|
|
144
211
|
*/
|
|
145
|
-
getEntityTypes({} = {}) {
|
|
212
|
+
async getEntityTypes({} = {}) {
|
|
146
213
|
const { error } = AuditTrailValidator.getEntityTypes().validate(
|
|
147
214
|
{},
|
|
148
215
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -157,15 +224,18 @@ class AuditTrail {
|
|
|
157
224
|
{ abortEarly: false, allowUnknown: false }
|
|
158
225
|
);
|
|
159
226
|
if (warrning) {
|
|
160
|
-
|
|
161
|
-
|
|
227
|
+
Logger({
|
|
228
|
+
level: "WARN",
|
|
229
|
+
message: "Parameter Validation warrnings for getEntityTypes",
|
|
230
|
+
});
|
|
231
|
+
Logger({ level: "WARN", message: warrning });
|
|
162
232
|
}
|
|
163
233
|
|
|
164
234
|
const query_params = {};
|
|
165
235
|
|
|
166
236
|
const xHeaders = {};
|
|
167
237
|
|
|
168
|
-
|
|
238
|
+
const response = await PlatformAPIClient.execute(
|
|
169
239
|
this.config,
|
|
170
240
|
"get",
|
|
171
241
|
`/service/platform/audit-trail/v1.0/company/${this.config.companyId}/entity-types`,
|
|
@@ -173,6 +243,23 @@ class AuditTrail {
|
|
|
173
243
|
undefined,
|
|
174
244
|
xHeaders
|
|
175
245
|
);
|
|
246
|
+
|
|
247
|
+
const {
|
|
248
|
+
error: res_error,
|
|
249
|
+
} = AuditTrailModel.EntityTypesResponse().validate(response, {
|
|
250
|
+
abortEarly: false,
|
|
251
|
+
allowUnknown: false,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
if (res_error) {
|
|
255
|
+
Logger({
|
|
256
|
+
level: "WARN",
|
|
257
|
+
message: "Response Validation Warnnings for getEntityTypes",
|
|
258
|
+
});
|
|
259
|
+
Logger({ level: "WARN", message: res_error });
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return response;
|
|
176
263
|
}
|
|
177
264
|
}
|
|
178
265
|
|