@gofynd/fdk-client-javascript 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/index.d.ts +4 -4
- package/index.js +9 -10
- package/package.json +14 -14
- package/sdk/APIClient.d.ts +11 -0
- package/sdk/APIClient.js +35 -0
- package/sdk/Client.d.ts +6 -0
- package/sdk/Client.js +17 -0
- package/sdk/Config.d.ts +9 -0
- package/sdk/Config.js +17 -0
- package/sdk/application/Cart/CartApplicationClient.d.ts +243 -243
- package/sdk/application/Cart/CartApplicationClient.js +595 -594
- package/sdk/application/Cart/CartApplicationModel.d.ts +64 -63
- package/sdk/application/Cart/CartApplicationModel.js +490 -885
- package/sdk/application/Cart/CartApplicationValidator.d.ts +17 -17
- package/sdk/application/Cart/CartApplicationValidator.js +98 -98
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +358 -358
- package/sdk/application/Catalog/CatalogApplicationClient.js +1079 -1078
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +90 -90
- package/sdk/application/Catalog/CatalogApplicationModel.js +683 -1249
- package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +19 -19
- package/sdk/application/Catalog/CatalogApplicationValidator.js +110 -110
- package/sdk/application/Common/CommonApplicationClient.d.ts +13 -13
- package/sdk/application/Common/CommonApplicationClient.js +43 -42
- package/sdk/application/Common/CommonApplicationModel.d.ts +12 -12
- package/sdk/application/Common/CommonApplicationModel.js +83 -160
- package/sdk/application/Common/CommonApplicationValidator.d.ts +1 -1
- package/sdk/application/Common/CommonApplicationValidator.js +6 -6
- package/sdk/application/Communication/CommunicationApplicationClient.d.ts +11 -11
- package/sdk/application/Communication/CommunicationApplicationClient.js +32 -31
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +6 -6
- package/sdk/application/Communication/CommunicationApplicationModel.js +38 -83
- package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +1 -1
- package/sdk/application/Communication/CommunicationApplicationValidator.js +4 -4
- package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +116 -116
- package/sdk/application/Configuration/ConfigurationApplicationClient.js +350 -349
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +85 -85
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +480 -851
- package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +8 -8
- package/sdk/application/Configuration/ConfigurationApplicationValidator.js +33 -33
- package/sdk/application/Content/ContentApplicationClient.d.ts +67 -67
- package/sdk/application/Content/ContentApplicationClient.js +216 -215
- package/sdk/application/Content/ContentApplicationModel.d.ts +76 -76
- package/sdk/application/Content/ContentApplicationModel.js +468 -884
- package/sdk/application/Content/ContentApplicationValidator.d.ts +5 -5
- package/sdk/application/Content/ContentApplicationValidator.js +24 -24
- package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +25 -25
- package/sdk/application/FileStorage/FileStorageApplicationClient.js +65 -64
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +13 -13
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +86 -169
- package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +1 -1
- package/sdk/application/FileStorage/FileStorageApplicationValidator.js +7 -7
- package/sdk/application/Lead/LeadApplicationClient.d.ts +24 -24
- package/sdk/application/Lead/LeadApplicationClient.js +109 -108
- package/sdk/application/Lead/LeadApplicationModel.d.ts +35 -35
- package/sdk/application/Lead/LeadApplicationModel.js +267 -474
- package/sdk/application/Lead/LeadApplicationValidator.d.ts +2 -2
- package/sdk/application/Lead/LeadApplicationValidator.js +11 -11
- package/sdk/application/Logistic/LogisticApplicationClient.d.ts +31 -22
- package/sdk/application/Logistic/LogisticApplicationClient.js +115 -49
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +17 -14
- package/sdk/application/Logistic/LogisticApplicationModel.js +133 -201
- package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +3 -2
- package/sdk/application/Logistic/LogisticApplicationValidator.js +14 -9
- package/sdk/application/Order/OrderApplicationClient.d.ts +85 -85
- package/sdk/application/Order/OrderApplicationClient.js +247 -246
- package/sdk/application/Order/OrderApplicationModel.d.ts +50 -50
- package/sdk/application/Order/OrderApplicationModel.js +361 -656
- package/sdk/application/Order/OrderApplicationValidator.d.ts +7 -7
- package/sdk/application/Order/OrderApplicationValidator.js +28 -28
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +318 -318
- package/sdk/application/Payment/PaymentApplicationClient.js +781 -780
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +72 -72
- package/sdk/application/Payment/PaymentApplicationModel.js +570 -1038
- package/sdk/application/Payment/PaymentApplicationValidator.d.ts +28 -28
- package/sdk/application/Payment/PaymentApplicationValidator.js +107 -107
- package/sdk/application/PosCart/PosCartApplicationClient.d.ts +254 -254
- package/sdk/application/PosCart/PosCartApplicationClient.js +646 -645
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +64 -63
- package/sdk/application/PosCart/PosCartApplicationModel.js +476 -870
- package/sdk/application/PosCart/PosCartApplicationValidator.d.ts +18 -18
- package/sdk/application/PosCart/PosCartApplicationValidator.js +103 -103
- package/sdk/application/Rewards/RewardsApplicationClient.d.ts +27 -27
- package/sdk/application/Rewards/RewardsApplicationClient.js +122 -121
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +14 -14
- package/sdk/application/Rewards/RewardsApplicationModel.js +96 -191
- package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +3 -3
- package/sdk/application/Rewards/RewardsApplicationValidator.js +12 -12
- package/sdk/application/Share/ShareApplicationClient.d.ts +37 -37
- package/sdk/application/Share/ShareApplicationClient.js +94 -93
- package/sdk/application/Share/ShareApplicationModel.d.ts +8 -8
- package/sdk/application/Share/ShareApplicationModel.js +63 -123
- package/sdk/application/Share/ShareApplicationValidator.d.ts +4 -4
- package/sdk/application/Share/ShareApplicationValidator.js +12 -12
- package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -8
- package/sdk/application/Theme/ThemeApplicationClient.js +38 -37
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +34 -34
- package/sdk/application/Theme/ThemeApplicationModel.js +190 -336
- package/sdk/application/Theme/ThemeApplicationValidator.d.ts +1 -1
- package/sdk/application/Theme/ThemeApplicationValidator.js +4 -4
- package/sdk/application/User/UserApplicationClient.d.ts +280 -280
- package/sdk/application/User/UserApplicationClient.js +619 -618
- package/sdk/application/User/UserApplicationModel.d.ts +79 -72
- package/sdk/application/User/UserApplicationModel.js +440 -689
- package/sdk/application/User/UserApplicationValidator.d.ts +24 -24
- package/sdk/application/User/UserApplicationValidator.js +89 -89
- package/sdk/common/AxiosHelper.js +18 -7
- package/sdk/constructUrl.d.ts +5 -0
- package/sdk/constructUrl.js +13 -0
- package/sdk/index.d.ts +3 -0
- package/sdk/index.js +5 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +51 -51
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +182 -180
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +21 -21
- package/sdk/platform/Analytics/AnalyticsPlatformClient.js +5 -4
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +11 -11
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +95 -178
- package/sdk/platform/Analytics/AnalyticsPlatformValidator.js +1 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformClient.js +44 -43
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +10 -10
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +50 -89
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.d.ts +1 -1
- package/sdk/platform/AuditTrail/AuditTrailPlatformValidator.js +7 -6
- package/sdk/platform/Billing/BillingPlatformClient.d.ts +60 -60
- package/sdk/platform/Billing/BillingPlatformClient.js +184 -183
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +40 -40
- package/sdk/platform/Billing/BillingPlatformModel.js +342 -668
- package/sdk/platform/Billing/BillingPlatformValidator.d.ts +8 -8
- package/sdk/platform/Billing/BillingPlatformValidator.js +26 -25
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +192 -165
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +686 -510
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +14 -11
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +77 -61
- package/sdk/platform/Cart/CartPlatformModel.d.ts +84 -83
- package/sdk/platform/Cart/CartPlatformModel.js +676 -1206
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +632 -632
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1558 -1556
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +40 -40
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +175 -175
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +688 -688
- package/sdk/platform/Catalog/CatalogPlatformClient.js +1556 -1559
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +291 -291
- package/sdk/platform/Catalog/CatalogPlatformModel.js +2133 -3910
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +66 -66
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +229 -228
- package/sdk/platform/Common/CommonPlatformClient.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformClient.js +40 -51
- package/sdk/platform/Common/CommonPlatformModel.d.ts +12 -12
- package/sdk/platform/Common/CommonPlatformModel.js +83 -160
- package/sdk/platform/Common/CommonPlatformValidator.d.ts +1 -1
- package/sdk/platform/Common/CommonPlatformValidator.js +7 -6
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +326 -326
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +945 -943
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +30 -30
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +88 -88
- package/sdk/platform/Communication/CommunicationPlatformClient.js +4 -3
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +67 -67
- package/sdk/platform/Communication/CommunicationPlatformModel.js +522 -974
- package/sdk/platform/Communication/CommunicationPlatformValidator.js +1 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.d.ts +55 -55
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformClient.js +217 -216
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +27 -27
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +279 -542
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.d.ts +7 -7
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformValidator.js +25 -24
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +163 -153
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +617 -552
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +22 -21
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +70 -64
- package/sdk/platform/Configuration/ConfigurationPlatformClient.d.ts +125 -125
- package/sdk/platform/Configuration/ConfigurationPlatformClient.js +348 -347
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +148 -146
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +854 -1508
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.d.ts +9 -9
- package/sdk/platform/Configuration/ConfigurationPlatformValidator.js +39 -38
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +524 -534
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +1287 -1346
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +49 -50
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +153 -159
- package/sdk/platform/Content/ContentPlatformModel.d.ts +78 -78
- package/sdk/platform/Content/ContentPlatformModel.js +485 -907
- package/sdk/platform/Discount/DiscountPlatformClient.d.ts +65 -65
- package/sdk/platform/Discount/DiscountPlatformClient.js +219 -218
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +7 -7
- package/sdk/platform/Discount/DiscountPlatformModel.js +60 -121
- package/sdk/platform/Discount/DiscountPlatformValidator.d.ts +6 -6
- package/sdk/platform/Discount/DiscountPlatformValidator.js +30 -29
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +25 -25
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +83 -61
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +9 -9
- package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +53 -53
- package/sdk/platform/FileStorage/FileStoragePlatformClient.js +147 -125
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +13 -13
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +86 -169
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.d.ts +3 -3
- package/sdk/platform/FileStorage/FileStoragePlatformValidator.js +12 -11
- package/sdk/platform/Inventory/InventoryPlatformClient.d.ts +63 -63
- package/sdk/platform/Inventory/InventoryPlatformClient.js +231 -230
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +30 -30
- package/sdk/platform/Inventory/InventoryPlatformModel.js +497 -964
- package/sdk/platform/Inventory/InventoryPlatformValidator.d.ts +7 -7
- package/sdk/platform/Inventory/InventoryPlatformValidator.js +29 -28
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +73 -73
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +203 -201
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +7 -7
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +29 -29
- package/sdk/platform/Lead/LeadPlatformClient.d.ts +80 -80
- package/sdk/platform/Lead/LeadPlatformClient.js +215 -214
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +35 -35
- package/sdk/platform/Lead/LeadPlatformModel.js +267 -474
- package/sdk/platform/Lead/LeadPlatformValidator.d.ts +6 -6
- package/sdk/platform/Lead/LeadPlatformValidator.js +25 -24
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +68 -66
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +7 -7
- package/sdk/platform/Order/OrderPlatformClient.d.ts +357 -357
- package/sdk/platform/Order/OrderPlatformClient.js +1046 -1033
- package/sdk/platform/Order/OrderPlatformModel.d.ts +198 -196
- package/sdk/platform/Order/OrderPlatformModel.js +1575 -2861
- package/sdk/platform/Order/OrderPlatformValidator.d.ts +32 -32
- package/sdk/platform/Order/OrderPlatformValidator.js +161 -160
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +3 -1
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +1 -1
- package/sdk/platform/Partner/PartnerPlatformModel.js +10 -26
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +58 -58
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +178 -178
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +6 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +24 -24
- package/sdk/platform/Payment/PaymentPlatformClient.d.ts +42 -42
- package/sdk/platform/Payment/PaymentPlatformClient.js +156 -155
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +27 -27
- package/sdk/platform/Payment/PaymentPlatformModel.js +222 -410
- package/sdk/platform/Payment/PaymentPlatformValidator.d.ts +4 -4
- package/sdk/platform/Payment/PaymentPlatformValidator.js +22 -21
- package/sdk/platform/PlatformApplicationClient.d.ts +1496 -10325
- package/sdk/platform/PlatformApplicationClient.js +1584 -13899
- package/sdk/platform/PlatformClient.d.ts +7972 -7888
- package/sdk/platform/PlatformClient.js +8678 -10107
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +85 -85
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +299 -280
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +8 -8
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +35 -35
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +15 -15
- package/sdk/platform/Rewards/RewardsPlatformModel.js +92 -194
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +10 -10
- package/sdk/platform/Share/SharePlatformApplicationClient.js +62 -60
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +1 -1
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +7 -7
- package/sdk/platform/Share/SharePlatformModel.d.ts +8 -8
- package/sdk/platform/Share/SharePlatformModel.js +60 -118
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +132 -132
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +314 -312
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +15 -15
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +45 -45
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +34 -34
- package/sdk/platform/Theme/ThemePlatformModel.js +190 -336
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +136 -69
- package/sdk/platform/User/UserPlatformApplicationClient.js +507 -166
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +12 -7
- package/sdk/platform/User/UserPlatformApplicationValidator.js +62 -24
- package/sdk/platform/User/UserPlatformModel.d.ts +79 -72
- package/sdk/platform/User/UserPlatformModel.js +440 -689
- package/sdk/platform/Webhook/WebhookPlatformClient.d.ts +31 -31
- package/sdk/platform/Webhook/WebhookPlatformClient.js +91 -90
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +7 -7
- package/sdk/platform/Webhook/WebhookPlatformModel.js +68 -136
- package/sdk/platform/Webhook/WebhookPlatformValidator.d.ts +3 -3
- package/sdk/platform/Webhook/WebhookPlatformValidator.js +15 -14
- package/sdk/public/Configuration/ConfigurationPublicClient.d.ts +13 -13
- package/sdk/public/Configuration/ConfigurationPublicClient.js +40 -38
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +12 -12
- package/sdk/public/Configuration/ConfigurationPublicModel.js +85 -162
- package/sdk/public/Configuration/ConfigurationPublicValidator.d.ts +1 -1
- package/sdk/public/Configuration/ConfigurationPublicValidator.js +6 -6
- package/sdk/public/Inventory/InventoryPublicClient.d.ts +34 -34
- package/sdk/public/Inventory/InventoryPublicClient.js +115 -113
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +10 -10
- package/sdk/public/Inventory/InventoryPublicModel.js +119 -245
- package/sdk/public/Inventory/InventoryPublicValidator.d.ts +3 -3
- package/sdk/public/Inventory/InventoryPublicValidator.js +15 -15
- package/sdk/public/Webhook/WebhookPublicClient.js +2 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +7 -7
- package/sdk/public/Webhook/WebhookPublicModel.js +68 -136
- package/.github/workflows/on_create_release.yml +0 -23
- package/.github/workflows/on_merge_main.yml +0 -38
- package/.github/workflows/on_pull_request.yml +0 -35
- package/.prettierrc +0 -5
- package/documentation/application/CART.md +0 -7339
- package/documentation/application/CATALOG.md +0 -9597
- package/documentation/application/COMMON.md +0 -452
- package/documentation/application/COMMUNICATION.md +0 -467
- package/documentation/application/CONFIGURATION.md +0 -2906
- package/documentation/application/CONTENT.md +0 -3351
- package/documentation/application/FILESTORAGE.md +0 -578
- package/documentation/application/LEAD.md +0 -1895
- package/documentation/application/LOGISTIC.md +0 -765
- package/documentation/application/ORDER.md +0 -3432
- package/documentation/application/PAYMENT.md +0 -5221
- package/documentation/application/POSCART.md +0 -7938
- package/documentation/application/README.md +0 -21
- package/documentation/application/REWARDS.md +0 -708
- package/documentation/application/SHARE.md +0 -733
- package/documentation/application/THEME.md +0 -5800
- package/documentation/application/USER.md +0 -4335
- package/documentation/platform/ANALYTICS.md +0 -1154
- package/documentation/platform/AUDITTRAIL.md +0 -576
- package/documentation/platform/BILLING.md +0 -2400
- package/documentation/platform/CART.md +0 -5559
- package/documentation/platform/CATALOG.md +0 -23261
- package/documentation/platform/COMMON.md +0 -452
- package/documentation/platform/COMMUNICATION.md +0 -5718
- package/documentation/platform/COMPANYPROFILE.md +0 -2031
- package/documentation/platform/CONFIGURATION.md +0 -7339
- package/documentation/platform/CONTENT.md +0 -9098
- package/documentation/platform/DISCOUNT.md +0 -863
- package/documentation/platform/FILESTORAGE.md +0 -1081
- package/documentation/platform/INVENTORY.md +0 -1779
- package/documentation/platform/LEAD.md +0 -4740
- package/documentation/platform/ORDER.md +0 -8486
- package/documentation/platform/PARTNER.md +0 -220
- package/documentation/platform/PAYMENT.md +0 -3448
- package/documentation/platform/README.md +0 -27
- package/documentation/platform/REWARDS.md +0 -1083
- package/documentation/platform/SHARE.md +0 -606
- package/documentation/platform/THEME.md +0 -35729
- package/documentation/platform/USER.md +0 -2319
- package/documentation/platform/WEBHOOK.md +0 -591
- package/documentation/public/CONFIGURATION.md +0 -452
- package/documentation/public/INVENTORY.md +0 -690
- package/documentation/public/WEBHOOK.md +0 -352
- package/jest.config.d.ts +0 -4
- package/jest.config.js +0 -6
- package/tests/application/catalog.spec.js +0 -47
- package/tests/common/action-url.spec.js +0 -35
- package/tests/common/schema/action-url.json +0 -178
- package/tests/common/schema/url-action.json +0 -683
- package/tests/common/url-action.spec.js +0 -48
- package/tests/helpers/cookie.helper.js +0 -31
- package/tests/helpers/oauth.helper.js +0 -43
- package/tests/platform/catalog.spec.js +0 -49
- package/tests/public/location.spec.js +0 -39
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
1
|
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
2
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
3
|
+
const Paginator = require("../../common/Paginator");
|
|
4
4
|
const CompanyProfileValidator = require("./CompanyProfilePlatformValidator");
|
|
5
5
|
const CompanyProfileModel = require("./CompanyProfilePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
7
8
|
|
|
8
9
|
class CompanyProfile {
|
|
9
10
|
constructor(config) {
|
|
@@ -73,13 +74,79 @@ class CompanyProfile {
|
|
|
73
74
|
|
|
74
75
|
/**
|
|
75
76
|
* @param {Object} arg - Arg object.
|
|
76
|
-
* @param {
|
|
77
|
+
* @param {CreateUpdateBrandRequestSerializer} arg.body
|
|
77
78
|
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
78
|
-
* @summary:
|
|
79
|
-
* @description: This API allows to
|
|
79
|
+
* @summary: Create a Brand.
|
|
80
|
+
* @description: This API allows to create a brand associated to a company.
|
|
80
81
|
*/
|
|
81
|
-
async
|
|
82
|
-
const { error } = CompanyProfileValidator.
|
|
82
|
+
async createBrand({ body } = {}) {
|
|
83
|
+
const { error } = CompanyProfileValidator.createBrand().validate(
|
|
84
|
+
{
|
|
85
|
+
body,
|
|
86
|
+
},
|
|
87
|
+
{ abortEarly: false, allowUnknown: true }
|
|
88
|
+
);
|
|
89
|
+
if (error) {
|
|
90
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Showing warrnings if extra unknown parameters are found
|
|
94
|
+
const { error: warrning } = CompanyProfileValidator.createBrand().validate(
|
|
95
|
+
{
|
|
96
|
+
body,
|
|
97
|
+
},
|
|
98
|
+
{ abortEarly: false, allowUnknown: false }
|
|
99
|
+
);
|
|
100
|
+
if (warrning) {
|
|
101
|
+
Logger({
|
|
102
|
+
level: "WARN",
|
|
103
|
+
message: "Parameter Validation warrnings for createBrand",
|
|
104
|
+
});
|
|
105
|
+
Logger({ level: "WARN", message: warrning });
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const query_params = {};
|
|
109
|
+
|
|
110
|
+
const xHeaders = {};
|
|
111
|
+
|
|
112
|
+
const response = await PlatformAPIClient.execute(
|
|
113
|
+
this.config,
|
|
114
|
+
"post",
|
|
115
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/brand/`,
|
|
116
|
+
query_params,
|
|
117
|
+
body,
|
|
118
|
+
xHeaders
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const {
|
|
122
|
+
error: res_error,
|
|
123
|
+
} = CompanyProfileModel.ProfileSuccessResponse().validate(response, {
|
|
124
|
+
abortEarly: false,
|
|
125
|
+
allowUnknown: false,
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (res_error) {
|
|
129
|
+
Logger({
|
|
130
|
+
level: "WARN",
|
|
131
|
+
message: "Response Validation Warnnings for createBrand",
|
|
132
|
+
});
|
|
133
|
+
Logger({ level: "WARN", message: res_error });
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return response;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param {Object} arg - Arg object.
|
|
141
|
+
* @param {CompanyBrandPostRequestSerializer} arg.body
|
|
142
|
+
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
143
|
+
* @summary: Create a company brand mapping.
|
|
144
|
+
* @description: This API allows to create a company brand mapping, for a already existing brand in the system.
|
|
145
|
+
*/
|
|
146
|
+
async createCompanyBrandMapping({ body } = {}) {
|
|
147
|
+
const {
|
|
148
|
+
error,
|
|
149
|
+
} = CompanyProfileValidator.createCompanyBrandMapping().validate(
|
|
83
150
|
{
|
|
84
151
|
body,
|
|
85
152
|
},
|
|
@@ -92,7 +159,7 @@ class CompanyProfile {
|
|
|
92
159
|
// Showing warrnings if extra unknown parameters are found
|
|
93
160
|
const {
|
|
94
161
|
error: warrning,
|
|
95
|
-
} = CompanyProfileValidator.
|
|
162
|
+
} = CompanyProfileValidator.createCompanyBrandMapping().validate(
|
|
96
163
|
{
|
|
97
164
|
body,
|
|
98
165
|
},
|
|
@@ -101,7 +168,7 @@ class CompanyProfile {
|
|
|
101
168
|
if (warrning) {
|
|
102
169
|
Logger({
|
|
103
170
|
level: "WARN",
|
|
104
|
-
message: "Parameter Validation warrnings for
|
|
171
|
+
message: "Parameter Validation warrnings for createCompanyBrandMapping",
|
|
105
172
|
});
|
|
106
173
|
Logger({ level: "WARN", message: warrning });
|
|
107
174
|
}
|
|
@@ -112,8 +179,8 @@ class CompanyProfile {
|
|
|
112
179
|
|
|
113
180
|
const response = await PlatformAPIClient.execute(
|
|
114
181
|
this.config,
|
|
115
|
-
"
|
|
116
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}`,
|
|
182
|
+
"post",
|
|
183
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/company-brand`,
|
|
117
184
|
query_params,
|
|
118
185
|
body,
|
|
119
186
|
xHeaders
|
|
@@ -129,7 +196,7 @@ class CompanyProfile {
|
|
|
129
196
|
if (res_error) {
|
|
130
197
|
Logger({
|
|
131
198
|
level: "WARN",
|
|
132
|
-
message: "Response Validation Warnnings for
|
|
199
|
+
message: "Response Validation Warnnings for createCompanyBrandMapping",
|
|
133
200
|
});
|
|
134
201
|
Logger({ level: "WARN", message: res_error });
|
|
135
202
|
}
|
|
@@ -139,13 +206,16 @@ class CompanyProfile {
|
|
|
139
206
|
|
|
140
207
|
/**
|
|
141
208
|
* @param {Object} arg - Arg object.
|
|
142
|
-
* @
|
|
143
|
-
* @
|
|
144
|
-
* @
|
|
209
|
+
* @param {LocationSerializer} arg.body
|
|
210
|
+
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
211
|
+
* @summary: Create a location associated to a company.
|
|
212
|
+
* @description: This API allows to edit a location associated to a company.
|
|
145
213
|
*/
|
|
146
|
-
async
|
|
147
|
-
const { error } = CompanyProfileValidator.
|
|
148
|
-
{
|
|
214
|
+
async createLocation({ body } = {}) {
|
|
215
|
+
const { error } = CompanyProfileValidator.createLocation().validate(
|
|
216
|
+
{
|
|
217
|
+
body,
|
|
218
|
+
},
|
|
149
219
|
{ abortEarly: false, allowUnknown: true }
|
|
150
220
|
);
|
|
151
221
|
if (error) {
|
|
@@ -155,14 +225,16 @@ class CompanyProfile {
|
|
|
155
225
|
// Showing warrnings if extra unknown parameters are found
|
|
156
226
|
const {
|
|
157
227
|
error: warrning,
|
|
158
|
-
} = CompanyProfileValidator.
|
|
159
|
-
{
|
|
228
|
+
} = CompanyProfileValidator.createLocation().validate(
|
|
229
|
+
{
|
|
230
|
+
body,
|
|
231
|
+
},
|
|
160
232
|
{ abortEarly: false, allowUnknown: false }
|
|
161
233
|
);
|
|
162
234
|
if (warrning) {
|
|
163
235
|
Logger({
|
|
164
236
|
level: "WARN",
|
|
165
|
-
message: "Parameter Validation warrnings for
|
|
237
|
+
message: "Parameter Validation warrnings for createLocation",
|
|
166
238
|
});
|
|
167
239
|
Logger({ level: "WARN", message: warrning });
|
|
168
240
|
}
|
|
@@ -173,16 +245,16 @@ class CompanyProfile {
|
|
|
173
245
|
|
|
174
246
|
const response = await PlatformAPIClient.execute(
|
|
175
247
|
this.config,
|
|
176
|
-
"
|
|
177
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/
|
|
248
|
+
"post",
|
|
249
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/location`,
|
|
178
250
|
query_params,
|
|
179
|
-
|
|
251
|
+
body,
|
|
180
252
|
xHeaders
|
|
181
253
|
);
|
|
182
254
|
|
|
183
255
|
const {
|
|
184
256
|
error: res_error,
|
|
185
|
-
} = CompanyProfileModel.
|
|
257
|
+
} = CompanyProfileModel.ProfileSuccessResponse().validate(response, {
|
|
186
258
|
abortEarly: false,
|
|
187
259
|
allowUnknown: false,
|
|
188
260
|
});
|
|
@@ -190,7 +262,7 @@ class CompanyProfile {
|
|
|
190
262
|
if (res_error) {
|
|
191
263
|
Logger({
|
|
192
264
|
level: "WARN",
|
|
193
|
-
message: "Response Validation Warnnings for
|
|
265
|
+
message: "Response Validation Warnnings for createLocation",
|
|
194
266
|
});
|
|
195
267
|
Logger({ level: "WARN", message: res_error });
|
|
196
268
|
}
|
|
@@ -200,15 +272,15 @@ class CompanyProfile {
|
|
|
200
272
|
|
|
201
273
|
/**
|
|
202
274
|
* @param {Object} arg - Arg object.
|
|
203
|
-
* @param {
|
|
204
|
-
* @returns {Promise<
|
|
205
|
-
* @summary:
|
|
206
|
-
* @description: This API
|
|
275
|
+
* @param {BulkLocationSerializer} arg.body
|
|
276
|
+
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
277
|
+
* @summary: Create a location asscoiated to a company in bulk.
|
|
278
|
+
* @description: This API allows to create a location associated to a company.
|
|
207
279
|
*/
|
|
208
|
-
async
|
|
209
|
-
const { error } = CompanyProfileValidator.
|
|
280
|
+
async createLocationBulk({ body } = {}) {
|
|
281
|
+
const { error } = CompanyProfileValidator.createLocationBulk().validate(
|
|
210
282
|
{
|
|
211
|
-
|
|
283
|
+
body,
|
|
212
284
|
},
|
|
213
285
|
{ abortEarly: false, allowUnknown: true }
|
|
214
286
|
);
|
|
@@ -217,16 +289,18 @@ class CompanyProfile {
|
|
|
217
289
|
}
|
|
218
290
|
|
|
219
291
|
// Showing warrnings if extra unknown parameters are found
|
|
220
|
-
const {
|
|
292
|
+
const {
|
|
293
|
+
error: warrning,
|
|
294
|
+
} = CompanyProfileValidator.createLocationBulk().validate(
|
|
221
295
|
{
|
|
222
|
-
|
|
296
|
+
body,
|
|
223
297
|
},
|
|
224
298
|
{ abortEarly: false, allowUnknown: false }
|
|
225
299
|
);
|
|
226
300
|
if (warrning) {
|
|
227
301
|
Logger({
|
|
228
302
|
level: "WARN",
|
|
229
|
-
message: "Parameter Validation warrnings for
|
|
303
|
+
message: "Parameter Validation warrnings for createLocationBulk",
|
|
230
304
|
});
|
|
231
305
|
Logger({ level: "WARN", message: warrning });
|
|
232
306
|
}
|
|
@@ -237,16 +311,16 @@ class CompanyProfile {
|
|
|
237
311
|
|
|
238
312
|
const response = await PlatformAPIClient.execute(
|
|
239
313
|
this.config,
|
|
240
|
-
"
|
|
241
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/
|
|
314
|
+
"post",
|
|
315
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/location/bulk`,
|
|
242
316
|
query_params,
|
|
243
|
-
|
|
317
|
+
body,
|
|
244
318
|
xHeaders
|
|
245
319
|
);
|
|
246
320
|
|
|
247
321
|
const {
|
|
248
322
|
error: res_error,
|
|
249
|
-
} = CompanyProfileModel.
|
|
323
|
+
} = CompanyProfileModel.ProfileSuccessResponse().validate(response, {
|
|
250
324
|
abortEarly: false,
|
|
251
325
|
allowUnknown: false,
|
|
252
326
|
});
|
|
@@ -254,7 +328,7 @@ class CompanyProfile {
|
|
|
254
328
|
if (res_error) {
|
|
255
329
|
Logger({
|
|
256
330
|
level: "WARN",
|
|
257
|
-
message: "Response Validation Warnnings for
|
|
331
|
+
message: "Response Validation Warnnings for createLocationBulk",
|
|
258
332
|
});
|
|
259
333
|
Logger({ level: "WARN", message: res_error });
|
|
260
334
|
}
|
|
@@ -331,15 +405,15 @@ class CompanyProfile {
|
|
|
331
405
|
|
|
332
406
|
/**
|
|
333
407
|
* @param {Object} arg - Arg object.
|
|
334
|
-
* @param {
|
|
335
|
-
* @returns {Promise<
|
|
336
|
-
* @summary:
|
|
337
|
-
* @description: This API
|
|
408
|
+
* @param {string} arg.brandId - Id of the brand to be viewed.
|
|
409
|
+
* @returns {Promise<GetBrandResponseSerializer>} - Success response
|
|
410
|
+
* @summary: Get a single brand.
|
|
411
|
+
* @description: This API helps to get data associated to a particular brand.
|
|
338
412
|
*/
|
|
339
|
-
async
|
|
340
|
-
const { error } = CompanyProfileValidator.
|
|
413
|
+
async getBrand({ brandId } = {}) {
|
|
414
|
+
const { error } = CompanyProfileValidator.getBrand().validate(
|
|
341
415
|
{
|
|
342
|
-
|
|
416
|
+
brandId,
|
|
343
417
|
},
|
|
344
418
|
{ abortEarly: false, allowUnknown: true }
|
|
345
419
|
);
|
|
@@ -348,16 +422,16 @@ class CompanyProfile {
|
|
|
348
422
|
}
|
|
349
423
|
|
|
350
424
|
// Showing warrnings if extra unknown parameters are found
|
|
351
|
-
const { error: warrning } = CompanyProfileValidator.
|
|
425
|
+
const { error: warrning } = CompanyProfileValidator.getBrand().validate(
|
|
352
426
|
{
|
|
353
|
-
|
|
427
|
+
brandId,
|
|
354
428
|
},
|
|
355
429
|
{ abortEarly: false, allowUnknown: false }
|
|
356
430
|
);
|
|
357
431
|
if (warrning) {
|
|
358
432
|
Logger({
|
|
359
433
|
level: "WARN",
|
|
360
|
-
message: "Parameter Validation warrnings for
|
|
434
|
+
message: "Parameter Validation warrnings for getBrand",
|
|
361
435
|
});
|
|
362
436
|
Logger({ level: "WARN", message: warrning });
|
|
363
437
|
}
|
|
@@ -368,16 +442,16 @@ class CompanyProfile {
|
|
|
368
442
|
|
|
369
443
|
const response = await PlatformAPIClient.execute(
|
|
370
444
|
this.config,
|
|
371
|
-
"
|
|
372
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/brand
|
|
445
|
+
"get",
|
|
446
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/brand/${brandId}`,
|
|
373
447
|
query_params,
|
|
374
|
-
|
|
448
|
+
undefined,
|
|
375
449
|
xHeaders
|
|
376
450
|
);
|
|
377
451
|
|
|
378
452
|
const {
|
|
379
453
|
error: res_error,
|
|
380
|
-
} = CompanyProfileModel.
|
|
454
|
+
} = CompanyProfileModel.GetBrandResponseSerializer().validate(response, {
|
|
381
455
|
abortEarly: false,
|
|
382
456
|
allowUnknown: false,
|
|
383
457
|
});
|
|
@@ -385,7 +459,7 @@ class CompanyProfile {
|
|
|
385
459
|
if (res_error) {
|
|
386
460
|
Logger({
|
|
387
461
|
level: "WARN",
|
|
388
|
-
message: "Response Validation Warnnings for
|
|
462
|
+
message: "Response Validation Warnnings for getBrand",
|
|
389
463
|
});
|
|
390
464
|
Logger({ level: "WARN", message: res_error });
|
|
391
465
|
}
|
|
@@ -493,23 +567,82 @@ class CompanyProfile {
|
|
|
493
567
|
});
|
|
494
568
|
return data;
|
|
495
569
|
};
|
|
496
|
-
paginator.setCallback(callback);
|
|
570
|
+
paginator.setCallback(callback.bind(this));
|
|
497
571
|
return paginator;
|
|
498
572
|
}
|
|
499
573
|
|
|
500
574
|
/**
|
|
501
575
|
* @param {Object} arg - Arg object.
|
|
502
|
-
* @
|
|
503
|
-
* @
|
|
504
|
-
* @
|
|
505
|
-
* @description: This API allows to create a company brand mapping, for a already existing brand in the system.
|
|
576
|
+
* @returns {Promise<MetricsSerializer>} - Success response
|
|
577
|
+
* @summary: Get company metrics
|
|
578
|
+
* @description: This API allows to view the company metrics, i.e. the status of its brand and stores. Also its allows to view the number of products, company documents & store documents which are verified and unverified.
|
|
506
579
|
*/
|
|
507
|
-
async
|
|
580
|
+
async getCompanyMetrics({} = {}) {
|
|
581
|
+
const { error } = CompanyProfileValidator.getCompanyMetrics().validate(
|
|
582
|
+
{},
|
|
583
|
+
{ abortEarly: false, allowUnknown: true }
|
|
584
|
+
);
|
|
585
|
+
if (error) {
|
|
586
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
// Showing warrnings if extra unknown parameters are found
|
|
508
590
|
const {
|
|
509
|
-
error,
|
|
510
|
-
} = CompanyProfileValidator.
|
|
591
|
+
error: warrning,
|
|
592
|
+
} = CompanyProfileValidator.getCompanyMetrics().validate(
|
|
593
|
+
{},
|
|
594
|
+
{ abortEarly: false, allowUnknown: false }
|
|
595
|
+
);
|
|
596
|
+
if (warrning) {
|
|
597
|
+
Logger({
|
|
598
|
+
level: "WARN",
|
|
599
|
+
message: "Parameter Validation warrnings for getCompanyMetrics",
|
|
600
|
+
});
|
|
601
|
+
Logger({ level: "WARN", message: warrning });
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
const query_params = {};
|
|
605
|
+
|
|
606
|
+
const xHeaders = {};
|
|
607
|
+
|
|
608
|
+
const response = await PlatformAPIClient.execute(
|
|
609
|
+
this.config,
|
|
610
|
+
"get",
|
|
611
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/metrics`,
|
|
612
|
+
query_params,
|
|
613
|
+
undefined,
|
|
614
|
+
xHeaders
|
|
615
|
+
);
|
|
616
|
+
|
|
617
|
+
const {
|
|
618
|
+
error: res_error,
|
|
619
|
+
} = CompanyProfileModel.MetricsSerializer().validate(response, {
|
|
620
|
+
abortEarly: false,
|
|
621
|
+
allowUnknown: false,
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
if (res_error) {
|
|
625
|
+
Logger({
|
|
626
|
+
level: "WARN",
|
|
627
|
+
message: "Response Validation Warnnings for getCompanyMetrics",
|
|
628
|
+
});
|
|
629
|
+
Logger({ level: "WARN", message: res_error });
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return response;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* @param {Object} arg - Arg object.
|
|
637
|
+
* @param {string} arg.locationId - Id of the location which you want to view.
|
|
638
|
+
* @returns {Promise<GetLocationSerializer>} - Success response
|
|
639
|
+
* @summary: Get details of a specific location.
|
|
640
|
+
* @description: This API helps to get data associated to a specific location.
|
|
641
|
+
*/
|
|
642
|
+
async getLocationDetail({ locationId } = {}) {
|
|
643
|
+
const { error } = CompanyProfileValidator.getLocationDetail().validate(
|
|
511
644
|
{
|
|
512
|
-
|
|
645
|
+
locationId,
|
|
513
646
|
},
|
|
514
647
|
{ abortEarly: false, allowUnknown: true }
|
|
515
648
|
);
|
|
@@ -520,16 +653,16 @@ class CompanyProfile {
|
|
|
520
653
|
// Showing warrnings if extra unknown parameters are found
|
|
521
654
|
const {
|
|
522
655
|
error: warrning,
|
|
523
|
-
} = CompanyProfileValidator.
|
|
656
|
+
} = CompanyProfileValidator.getLocationDetail().validate(
|
|
524
657
|
{
|
|
525
|
-
|
|
658
|
+
locationId,
|
|
526
659
|
},
|
|
527
660
|
{ abortEarly: false, allowUnknown: false }
|
|
528
661
|
);
|
|
529
662
|
if (warrning) {
|
|
530
663
|
Logger({
|
|
531
664
|
level: "WARN",
|
|
532
|
-
message: "Parameter Validation warrnings for
|
|
665
|
+
message: "Parameter Validation warrnings for getLocationDetail",
|
|
533
666
|
});
|
|
534
667
|
Logger({ level: "WARN", message: warrning });
|
|
535
668
|
}
|
|
@@ -540,16 +673,16 @@ class CompanyProfile {
|
|
|
540
673
|
|
|
541
674
|
const response = await PlatformAPIClient.execute(
|
|
542
675
|
this.config,
|
|
543
|
-
"
|
|
544
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/
|
|
676
|
+
"get",
|
|
677
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/location/${locationId}`,
|
|
545
678
|
query_params,
|
|
546
|
-
|
|
679
|
+
undefined,
|
|
547
680
|
xHeaders
|
|
548
681
|
);
|
|
549
682
|
|
|
550
683
|
const {
|
|
551
684
|
error: res_error,
|
|
552
|
-
} = CompanyProfileModel.
|
|
685
|
+
} = CompanyProfileModel.GetLocationSerializer().validate(response, {
|
|
553
686
|
abortEarly: false,
|
|
554
687
|
allowUnknown: false,
|
|
555
688
|
});
|
|
@@ -557,7 +690,7 @@ class CompanyProfile {
|
|
|
557
690
|
if (res_error) {
|
|
558
691
|
Logger({
|
|
559
692
|
level: "WARN",
|
|
560
|
-
message: "Response Validation Warnnings for
|
|
693
|
+
message: "Response Validation Warnnings for getLocationDetail",
|
|
561
694
|
});
|
|
562
695
|
Logger({ level: "WARN", message: res_error });
|
|
563
696
|
}
|
|
@@ -694,19 +827,19 @@ class CompanyProfile {
|
|
|
694
827
|
});
|
|
695
828
|
return data;
|
|
696
829
|
};
|
|
697
|
-
paginator.setCallback(callback);
|
|
830
|
+
paginator.setCallback(callback.bind(this));
|
|
698
831
|
return paginator;
|
|
699
832
|
}
|
|
700
833
|
|
|
701
834
|
/**
|
|
702
835
|
* @param {Object} arg - Arg object.
|
|
703
|
-
* @param {
|
|
836
|
+
* @param {UpdateCompany} arg.body
|
|
704
837
|
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
705
|
-
* @summary:
|
|
706
|
-
* @description: This API allows to edit
|
|
838
|
+
* @summary: Edit company profile
|
|
839
|
+
* @description: This API allows to edit the company profile of the seller account.
|
|
707
840
|
*/
|
|
708
|
-
async
|
|
709
|
-
const { error } = CompanyProfileValidator.
|
|
841
|
+
async updateCompany({ body } = {}) {
|
|
842
|
+
const { error } = CompanyProfileValidator.updateCompany().validate(
|
|
710
843
|
{
|
|
711
844
|
body,
|
|
712
845
|
},
|
|
@@ -719,7 +852,7 @@ class CompanyProfile {
|
|
|
719
852
|
// Showing warrnings if extra unknown parameters are found
|
|
720
853
|
const {
|
|
721
854
|
error: warrning,
|
|
722
|
-
} = CompanyProfileValidator.
|
|
855
|
+
} = CompanyProfileValidator.updateCompany().validate(
|
|
723
856
|
{
|
|
724
857
|
body,
|
|
725
858
|
},
|
|
@@ -728,7 +861,7 @@ class CompanyProfile {
|
|
|
728
861
|
if (warrning) {
|
|
729
862
|
Logger({
|
|
730
863
|
level: "WARN",
|
|
731
|
-
message: "Parameter Validation warrnings for
|
|
864
|
+
message: "Parameter Validation warrnings for updateCompany",
|
|
732
865
|
});
|
|
733
866
|
Logger({ level: "WARN", message: warrning });
|
|
734
867
|
}
|
|
@@ -739,8 +872,8 @@ class CompanyProfile {
|
|
|
739
872
|
|
|
740
873
|
const response = await PlatformAPIClient.execute(
|
|
741
874
|
this.config,
|
|
742
|
-
"
|
|
743
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}
|
|
875
|
+
"patch",
|
|
876
|
+
`/service/platform/company-profile/v1.0/company/${this.config.companyId}`,
|
|
744
877
|
query_params,
|
|
745
878
|
body,
|
|
746
879
|
xHeaders
|
|
@@ -756,73 +889,7 @@ class CompanyProfile {
|
|
|
756
889
|
if (res_error) {
|
|
757
890
|
Logger({
|
|
758
891
|
level: "WARN",
|
|
759
|
-
message: "Response Validation Warnnings for
|
|
760
|
-
});
|
|
761
|
-
Logger({ level: "WARN", message: res_error });
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
return response;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
|
-
/**
|
|
768
|
-
* @param {Object} arg - Arg object.
|
|
769
|
-
* @param {string} arg.locationId - Id of the location which you want to view.
|
|
770
|
-
* @returns {Promise<GetLocationSerializer>} - Success response
|
|
771
|
-
* @summary: Get details of a specific location.
|
|
772
|
-
* @description: This API helps to get data associated to a specific location.
|
|
773
|
-
*/
|
|
774
|
-
async getLocationDetail({ locationId } = {}) {
|
|
775
|
-
const { error } = CompanyProfileValidator.getLocationDetail().validate(
|
|
776
|
-
{
|
|
777
|
-
locationId,
|
|
778
|
-
},
|
|
779
|
-
{ abortEarly: false, allowUnknown: true }
|
|
780
|
-
);
|
|
781
|
-
if (error) {
|
|
782
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
// Showing warrnings if extra unknown parameters are found
|
|
786
|
-
const {
|
|
787
|
-
error: warrning,
|
|
788
|
-
} = CompanyProfileValidator.getLocationDetail().validate(
|
|
789
|
-
{
|
|
790
|
-
locationId,
|
|
791
|
-
},
|
|
792
|
-
{ abortEarly: false, allowUnknown: false }
|
|
793
|
-
);
|
|
794
|
-
if (warrning) {
|
|
795
|
-
Logger({
|
|
796
|
-
level: "WARN",
|
|
797
|
-
message: "Parameter Validation warrnings for getLocationDetail",
|
|
798
|
-
});
|
|
799
|
-
Logger({ level: "WARN", message: warrning });
|
|
800
|
-
}
|
|
801
|
-
|
|
802
|
-
const query_params = {};
|
|
803
|
-
|
|
804
|
-
const xHeaders = {};
|
|
805
|
-
|
|
806
|
-
const response = await PlatformAPIClient.execute(
|
|
807
|
-
this.config,
|
|
808
|
-
"get",
|
|
809
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/location/${locationId}`,
|
|
810
|
-
query_params,
|
|
811
|
-
undefined,
|
|
812
|
-
xHeaders
|
|
813
|
-
);
|
|
814
|
-
|
|
815
|
-
const {
|
|
816
|
-
error: res_error,
|
|
817
|
-
} = CompanyProfileModel.GetLocationSerializer().validate(response, {
|
|
818
|
-
abortEarly: false,
|
|
819
|
-
allowUnknown: false,
|
|
820
|
-
});
|
|
821
|
-
|
|
822
|
-
if (res_error) {
|
|
823
|
-
Logger({
|
|
824
|
-
level: "WARN",
|
|
825
|
-
message: "Response Validation Warnnings for getLocationDetail",
|
|
892
|
+
message: "Response Validation Warnnings for updateCompany",
|
|
826
893
|
});
|
|
827
894
|
Logger({ level: "WARN", message: res_error });
|
|
828
895
|
}
|
|
@@ -898,72 +965,6 @@ class CompanyProfile {
|
|
|
898
965
|
|
|
899
966
|
return response;
|
|
900
967
|
}
|
|
901
|
-
|
|
902
|
-
/**
|
|
903
|
-
* @param {Object} arg - Arg object.
|
|
904
|
-
* @param {BulkLocationSerializer} arg.body
|
|
905
|
-
* @returns {Promise<ProfileSuccessResponse>} - Success response
|
|
906
|
-
* @summary: Create a location asscoiated to a company in bulk.
|
|
907
|
-
* @description: This API allows to create a location associated to a company.
|
|
908
|
-
*/
|
|
909
|
-
async createLocationBulk({ body } = {}) {
|
|
910
|
-
const { error } = CompanyProfileValidator.createLocationBulk().validate(
|
|
911
|
-
{
|
|
912
|
-
body,
|
|
913
|
-
},
|
|
914
|
-
{ abortEarly: false, allowUnknown: true }
|
|
915
|
-
);
|
|
916
|
-
if (error) {
|
|
917
|
-
return Promise.reject(new FDKClientValidationError(error));
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
// Showing warrnings if extra unknown parameters are found
|
|
921
|
-
const {
|
|
922
|
-
error: warrning,
|
|
923
|
-
} = CompanyProfileValidator.createLocationBulk().validate(
|
|
924
|
-
{
|
|
925
|
-
body,
|
|
926
|
-
},
|
|
927
|
-
{ abortEarly: false, allowUnknown: false }
|
|
928
|
-
);
|
|
929
|
-
if (warrning) {
|
|
930
|
-
Logger({
|
|
931
|
-
level: "WARN",
|
|
932
|
-
message: "Parameter Validation warrnings for createLocationBulk",
|
|
933
|
-
});
|
|
934
|
-
Logger({ level: "WARN", message: warrning });
|
|
935
|
-
}
|
|
936
|
-
|
|
937
|
-
const query_params = {};
|
|
938
|
-
|
|
939
|
-
const xHeaders = {};
|
|
940
|
-
|
|
941
|
-
const response = await PlatformAPIClient.execute(
|
|
942
|
-
this.config,
|
|
943
|
-
"post",
|
|
944
|
-
`/service/platform/company-profile/v1.0/company/${this.config.companyId}/location/bulk`,
|
|
945
|
-
query_params,
|
|
946
|
-
body,
|
|
947
|
-
xHeaders
|
|
948
|
-
);
|
|
949
|
-
|
|
950
|
-
const {
|
|
951
|
-
error: res_error,
|
|
952
|
-
} = CompanyProfileModel.ProfileSuccessResponse().validate(response, {
|
|
953
|
-
abortEarly: false,
|
|
954
|
-
allowUnknown: false,
|
|
955
|
-
});
|
|
956
|
-
|
|
957
|
-
if (res_error) {
|
|
958
|
-
Logger({
|
|
959
|
-
level: "WARN",
|
|
960
|
-
message: "Response Validation Warnnings for createLocationBulk",
|
|
961
|
-
});
|
|
962
|
-
Logger({ level: "WARN", message: res_error });
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
return response;
|
|
966
|
-
}
|
|
967
968
|
}
|
|
968
969
|
|
|
969
970
|
module.exports = CompanyProfile;
|