@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,12 @@
|
|
|
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 FileStorageValidator = require("./FileStoragePlatformValidator");
|
|
5
5
|
const FileStorageModel = require("./FileStoragePlatformModel");
|
|
6
6
|
const { Logger } = require("./../../common/Logger");
|
|
7
|
+
const Joi = require("joi");
|
|
8
|
+
|
|
9
|
+
const axios = require("axios");
|
|
7
10
|
|
|
8
11
|
class FileStorage {
|
|
9
12
|
constructor(config) {
|
|
@@ -13,33 +16,21 @@ class FileStorage {
|
|
|
13
16
|
/**
|
|
14
17
|
* @param {Object} arg - Arg object.
|
|
15
18
|
* @param {string} arg.namespace - Bucket name
|
|
16
|
-
* @param {
|
|
17
|
-
* @returns {Promise<
|
|
18
|
-
* @summary:
|
|
19
|
-
* @description:
|
|
20
|
-
*
|
|
21
|
-
* It has three Major Steps:
|
|
22
|
-
* Start
|
|
23
|
-
* Upload
|
|
24
|
-
* Complete
|
|
25
|
-
*
|
|
26
|
-
* ### Start
|
|
27
|
-
* Initiates the assets upload using `startUpload`.
|
|
28
|
-
* It returns the storage link in response.
|
|
29
|
-
*
|
|
30
|
-
* ### Upload
|
|
31
|
-
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
32
|
-
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
33
|
-
*
|
|
34
|
-
* ### Complete
|
|
35
|
-
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
36
|
-
* This operation will return the url for the uploaded file.
|
|
19
|
+
* @param {number} [arg.pageNo] - Page no
|
|
20
|
+
* @returns {Promise<BrowseResponse>} - Success response
|
|
21
|
+
* @summary: Browse Files
|
|
22
|
+
* @description: Browse Files
|
|
37
23
|
*/
|
|
38
|
-
async
|
|
39
|
-
|
|
24
|
+
async browse({
|
|
25
|
+
namespace,
|
|
26
|
+
|
|
27
|
+
pageNo,
|
|
28
|
+
} = {}) {
|
|
29
|
+
const { error } = FileStorageValidator.browse().validate(
|
|
40
30
|
{
|
|
41
31
|
namespace,
|
|
42
|
-
|
|
32
|
+
|
|
33
|
+
pageNo,
|
|
43
34
|
},
|
|
44
35
|
{ abortEarly: false, allowUnknown: true }
|
|
45
36
|
);
|
|
@@ -48,37 +39,39 @@ class FileStorage {
|
|
|
48
39
|
}
|
|
49
40
|
|
|
50
41
|
// Showing warrnings if extra unknown parameters are found
|
|
51
|
-
const { error: warrning } = FileStorageValidator.
|
|
42
|
+
const { error: warrning } = FileStorageValidator.browse().validate(
|
|
52
43
|
{
|
|
53
44
|
namespace,
|
|
54
|
-
|
|
45
|
+
|
|
46
|
+
pageNo,
|
|
55
47
|
},
|
|
56
48
|
{ abortEarly: false, allowUnknown: false }
|
|
57
49
|
);
|
|
58
50
|
if (warrning) {
|
|
59
51
|
Logger({
|
|
60
52
|
level: "WARN",
|
|
61
|
-
message: "Parameter Validation warrnings for
|
|
53
|
+
message: "Parameter Validation warrnings for browse",
|
|
62
54
|
});
|
|
63
55
|
Logger({ level: "WARN", message: warrning });
|
|
64
56
|
}
|
|
65
57
|
|
|
66
58
|
const query_params = {};
|
|
59
|
+
query_params["page_no"] = pageNo;
|
|
67
60
|
|
|
68
61
|
const xHeaders = {};
|
|
69
62
|
|
|
70
63
|
const response = await PlatformAPIClient.execute(
|
|
71
64
|
this.config,
|
|
72
|
-
"
|
|
73
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/
|
|
65
|
+
"get",
|
|
66
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/browse/`,
|
|
74
67
|
query_params,
|
|
75
|
-
|
|
68
|
+
undefined,
|
|
76
69
|
xHeaders
|
|
77
70
|
);
|
|
78
71
|
|
|
79
72
|
const {
|
|
80
73
|
error: res_error,
|
|
81
|
-
} = FileStorageModel.
|
|
74
|
+
} = FileStorageModel.BrowseResponse().validate(response, {
|
|
82
75
|
abortEarly: false,
|
|
83
76
|
allowUnknown: false,
|
|
84
77
|
});
|
|
@@ -86,7 +79,7 @@ class FileStorage {
|
|
|
86
79
|
if (res_error) {
|
|
87
80
|
Logger({
|
|
88
81
|
level: "WARN",
|
|
89
|
-
message: "Response Validation Warnnings for
|
|
82
|
+
message: "Response Validation Warnnings for browse",
|
|
90
83
|
});
|
|
91
84
|
Logger({ level: "WARN", message: res_error });
|
|
92
85
|
}
|
|
@@ -94,6 +87,33 @@ class FileStorage {
|
|
|
94
87
|
return response;
|
|
95
88
|
}
|
|
96
89
|
|
|
90
|
+
/**
|
|
91
|
+
* @param {Object} arg - Arg object.
|
|
92
|
+
* @param {string} arg.namespace - Bucket name
|
|
93
|
+
* @summary: Browse Files
|
|
94
|
+
* @description: Browse Files
|
|
95
|
+
*/
|
|
96
|
+
browsePaginator({ namespace } = {}) {
|
|
97
|
+
const paginator = new Paginator();
|
|
98
|
+
const callback = async () => {
|
|
99
|
+
const pageId = paginator.nextId;
|
|
100
|
+
const pageNo = paginator.pageNo;
|
|
101
|
+
const pageType = "number";
|
|
102
|
+
const data = await this.browse({
|
|
103
|
+
namespace: namespace,
|
|
104
|
+
|
|
105
|
+
pageNo: pageNo,
|
|
106
|
+
});
|
|
107
|
+
paginator.setPaginator({
|
|
108
|
+
hasNext: data.page.has_next ? true : false,
|
|
109
|
+
nextId: data.page.next_id,
|
|
110
|
+
});
|
|
111
|
+
return data;
|
|
112
|
+
};
|
|
113
|
+
paginator.setCallback(callback.bind(this));
|
|
114
|
+
return paginator;
|
|
115
|
+
}
|
|
116
|
+
|
|
97
117
|
/**
|
|
98
118
|
* @param {Object} arg - Arg object.
|
|
99
119
|
* @param {string} arg.namespace - Bucket name
|
|
@@ -119,10 +139,15 @@ class FileStorage {
|
|
|
119
139
|
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
120
140
|
* This operation will return the url for the uploaded file.
|
|
121
141
|
*/
|
|
122
|
-
async completeUpload({
|
|
142
|
+
async completeUpload({
|
|
143
|
+
namespace,
|
|
144
|
+
|
|
145
|
+
body,
|
|
146
|
+
} = {}) {
|
|
123
147
|
const { error } = FileStorageValidator.completeUpload().validate(
|
|
124
148
|
{
|
|
125
149
|
namespace,
|
|
150
|
+
|
|
126
151
|
body,
|
|
127
152
|
},
|
|
128
153
|
{ abortEarly: false, allowUnknown: true }
|
|
@@ -135,6 +160,7 @@ class FileStorage {
|
|
|
135
160
|
const { error: warrning } = FileStorageValidator.completeUpload().validate(
|
|
136
161
|
{
|
|
137
162
|
namespace,
|
|
163
|
+
|
|
138
164
|
body,
|
|
139
165
|
},
|
|
140
166
|
{ abortEarly: false, allowUnknown: false }
|
|
@@ -180,15 +206,17 @@ class FileStorage {
|
|
|
180
206
|
|
|
181
207
|
/**
|
|
182
208
|
* @param {Object} arg - Arg object.
|
|
183
|
-
* @param {
|
|
184
|
-
* @
|
|
185
|
-
* @
|
|
186
|
-
* @
|
|
209
|
+
* @param {boolean} [arg.sync] - Sync
|
|
210
|
+
* @param {BulkRequest} arg.body
|
|
211
|
+
* @returns {Promise<BulkUploadResponse>} - Success response
|
|
212
|
+
* @summary: Copy Files
|
|
213
|
+
* @description: Copy Files
|
|
187
214
|
*/
|
|
188
|
-
async
|
|
189
|
-
const { error } = FileStorageValidator.
|
|
215
|
+
async copyFiles({ body, sync } = {}) {
|
|
216
|
+
const { error } = FileStorageValidator.copyFiles().validate(
|
|
190
217
|
{
|
|
191
218
|
body,
|
|
219
|
+
sync,
|
|
192
220
|
},
|
|
193
221
|
{ abortEarly: false, allowUnknown: true }
|
|
194
222
|
);
|
|
@@ -197,28 +225,30 @@ class FileStorage {
|
|
|
197
225
|
}
|
|
198
226
|
|
|
199
227
|
// Showing warrnings if extra unknown parameters are found
|
|
200
|
-
const { error: warrning } = FileStorageValidator.
|
|
228
|
+
const { error: warrning } = FileStorageValidator.copyFiles().validate(
|
|
201
229
|
{
|
|
202
230
|
body,
|
|
231
|
+
sync,
|
|
203
232
|
},
|
|
204
233
|
{ abortEarly: false, allowUnknown: false }
|
|
205
234
|
);
|
|
206
235
|
if (warrning) {
|
|
207
236
|
Logger({
|
|
208
237
|
level: "WARN",
|
|
209
|
-
message: "Parameter Validation warrnings for
|
|
238
|
+
message: "Parameter Validation warrnings for copyFiles",
|
|
210
239
|
});
|
|
211
240
|
Logger({ level: "WARN", message: warrning });
|
|
212
241
|
}
|
|
213
242
|
|
|
214
243
|
const query_params = {};
|
|
244
|
+
query_params["sync"] = sync;
|
|
215
245
|
|
|
216
246
|
const xHeaders = {};
|
|
217
247
|
|
|
218
248
|
const response = await PlatformAPIClient.execute(
|
|
219
249
|
this.config,
|
|
220
250
|
"post",
|
|
221
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/
|
|
251
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/uploads/copy/`,
|
|
222
252
|
query_params,
|
|
223
253
|
body,
|
|
224
254
|
xHeaders
|
|
@@ -226,7 +256,7 @@ class FileStorage {
|
|
|
226
256
|
|
|
227
257
|
const {
|
|
228
258
|
error: res_error,
|
|
229
|
-
} = FileStorageModel.
|
|
259
|
+
} = FileStorageModel.BulkUploadResponse().validate(response, {
|
|
230
260
|
abortEarly: false,
|
|
231
261
|
allowUnknown: false,
|
|
232
262
|
});
|
|
@@ -234,7 +264,7 @@ class FileStorage {
|
|
|
234
264
|
if (res_error) {
|
|
235
265
|
Logger({
|
|
236
266
|
level: "WARN",
|
|
237
|
-
message: "Response Validation Warnnings for
|
|
267
|
+
message: "Response Validation Warnnings for copyFiles",
|
|
238
268
|
});
|
|
239
269
|
Logger({ level: "WARN", message: res_error });
|
|
240
270
|
}
|
|
@@ -244,17 +274,15 @@ class FileStorage {
|
|
|
244
274
|
|
|
245
275
|
/**
|
|
246
276
|
* @param {Object} arg - Arg object.
|
|
247
|
-
* @param {
|
|
248
|
-
* @
|
|
249
|
-
* @
|
|
250
|
-
* @
|
|
251
|
-
* @description: Copy Files
|
|
277
|
+
* @param {SignUrlRequest} arg.body
|
|
278
|
+
* @returns {Promise<SignUrlResponse>} - Success response
|
|
279
|
+
* @summary: Gives signed urls to access private files
|
|
280
|
+
* @description: Describe here
|
|
252
281
|
*/
|
|
253
|
-
async
|
|
254
|
-
const { error } = FileStorageValidator.
|
|
282
|
+
async getSignUrls({ body } = {}) {
|
|
283
|
+
const { error } = FileStorageValidator.getSignUrls().validate(
|
|
255
284
|
{
|
|
256
285
|
body,
|
|
257
|
-
sync,
|
|
258
286
|
},
|
|
259
287
|
{ abortEarly: false, allowUnknown: true }
|
|
260
288
|
);
|
|
@@ -263,30 +291,28 @@ class FileStorage {
|
|
|
263
291
|
}
|
|
264
292
|
|
|
265
293
|
// Showing warrnings if extra unknown parameters are found
|
|
266
|
-
const { error: warrning } = FileStorageValidator.
|
|
294
|
+
const { error: warrning } = FileStorageValidator.getSignUrls().validate(
|
|
267
295
|
{
|
|
268
296
|
body,
|
|
269
|
-
sync,
|
|
270
297
|
},
|
|
271
298
|
{ abortEarly: false, allowUnknown: false }
|
|
272
299
|
);
|
|
273
300
|
if (warrning) {
|
|
274
301
|
Logger({
|
|
275
302
|
level: "WARN",
|
|
276
|
-
message: "Parameter Validation warrnings for
|
|
303
|
+
message: "Parameter Validation warrnings for getSignUrls",
|
|
277
304
|
});
|
|
278
305
|
Logger({ level: "WARN", message: warrning });
|
|
279
306
|
}
|
|
280
307
|
|
|
281
308
|
const query_params = {};
|
|
282
|
-
query_params["sync"] = sync;
|
|
283
309
|
|
|
284
310
|
const xHeaders = {};
|
|
285
311
|
|
|
286
312
|
const response = await PlatformAPIClient.execute(
|
|
287
313
|
this.config,
|
|
288
314
|
"post",
|
|
289
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/
|
|
315
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/sign-urls/`,
|
|
290
316
|
query_params,
|
|
291
317
|
body,
|
|
292
318
|
xHeaders
|
|
@@ -294,7 +320,7 @@ class FileStorage {
|
|
|
294
320
|
|
|
295
321
|
const {
|
|
296
322
|
error: res_error,
|
|
297
|
-
} = FileStorageModel.
|
|
323
|
+
} = FileStorageModel.SignUrlResponse().validate(response, {
|
|
298
324
|
abortEarly: false,
|
|
299
325
|
allowUnknown: false,
|
|
300
326
|
});
|
|
@@ -302,7 +328,7 @@ class FileStorage {
|
|
|
302
328
|
if (res_error) {
|
|
303
329
|
Logger({
|
|
304
330
|
level: "WARN",
|
|
305
|
-
message: "Response Validation Warnnings for
|
|
331
|
+
message: "Response Validation Warnnings for getSignUrls",
|
|
306
332
|
});
|
|
307
333
|
Logger({ level: "WARN", message: res_error });
|
|
308
334
|
}
|
|
@@ -312,17 +338,15 @@ class FileStorage {
|
|
|
312
338
|
|
|
313
339
|
/**
|
|
314
340
|
* @param {Object} arg - Arg object.
|
|
315
|
-
* @param {string} arg.
|
|
316
|
-
* @
|
|
317
|
-
* @
|
|
318
|
-
* @
|
|
319
|
-
* @description: Browse Files
|
|
341
|
+
* @param {string} arg.url - Url
|
|
342
|
+
* @returns {Promise<string>} - Success response
|
|
343
|
+
* @summary: Proxy
|
|
344
|
+
* @description: Proxy
|
|
320
345
|
*/
|
|
321
|
-
async
|
|
322
|
-
const { error } = FileStorageValidator.
|
|
346
|
+
async proxy({ url } = {}) {
|
|
347
|
+
const { error } = FileStorageValidator.proxy().validate(
|
|
323
348
|
{
|
|
324
|
-
|
|
325
|
-
pageNo,
|
|
349
|
+
url,
|
|
326
350
|
},
|
|
327
351
|
{ abortEarly: false, allowUnknown: true }
|
|
328
352
|
);
|
|
@@ -331,46 +355,42 @@ class FileStorage {
|
|
|
331
355
|
}
|
|
332
356
|
|
|
333
357
|
// Showing warrnings if extra unknown parameters are found
|
|
334
|
-
const { error: warrning } = FileStorageValidator.
|
|
358
|
+
const { error: warrning } = FileStorageValidator.proxy().validate(
|
|
335
359
|
{
|
|
336
|
-
|
|
337
|
-
pageNo,
|
|
360
|
+
url,
|
|
338
361
|
},
|
|
339
362
|
{ abortEarly: false, allowUnknown: false }
|
|
340
363
|
);
|
|
341
364
|
if (warrning) {
|
|
342
365
|
Logger({
|
|
343
366
|
level: "WARN",
|
|
344
|
-
message: "Parameter Validation warrnings for
|
|
367
|
+
message: "Parameter Validation warrnings for proxy",
|
|
345
368
|
});
|
|
346
369
|
Logger({ level: "WARN", message: warrning });
|
|
347
370
|
}
|
|
348
371
|
|
|
349
372
|
const query_params = {};
|
|
350
|
-
query_params["
|
|
373
|
+
query_params["url"] = url;
|
|
351
374
|
|
|
352
375
|
const xHeaders = {};
|
|
353
376
|
|
|
354
377
|
const response = await PlatformAPIClient.execute(
|
|
355
378
|
this.config,
|
|
356
|
-
"
|
|
357
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/
|
|
379
|
+
"post",
|
|
380
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/proxy/`,
|
|
358
381
|
query_params,
|
|
359
382
|
undefined,
|
|
360
383
|
xHeaders
|
|
361
384
|
);
|
|
362
385
|
|
|
363
|
-
const {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
abortEarly: false,
|
|
367
|
-
allowUnknown: false,
|
|
368
|
-
});
|
|
386
|
+
const { error: res_error } = Joi.string()
|
|
387
|
+
.allow("")
|
|
388
|
+
.validate(response, { abortEarly: false, allowUnknown: false });
|
|
369
389
|
|
|
370
390
|
if (res_error) {
|
|
371
391
|
Logger({
|
|
372
392
|
level: "WARN",
|
|
373
|
-
message: "Response Validation Warnnings for
|
|
393
|
+
message: "Response Validation Warnnings for proxy",
|
|
374
394
|
});
|
|
375
395
|
Logger({ level: "WARN", message: res_error });
|
|
376
396
|
}
|
|
@@ -381,40 +401,38 @@ class FileStorage {
|
|
|
381
401
|
/**
|
|
382
402
|
* @param {Object} arg - Arg object.
|
|
383
403
|
* @param {string} arg.namespace - Bucket name
|
|
384
|
-
* @
|
|
385
|
-
* @
|
|
404
|
+
* @param {StartRequest} arg.body
|
|
405
|
+
* @returns {Promise<StartResponse>} - Success response
|
|
406
|
+
* @summary: This operation initiates upload and returns storage link which is valid for 30 Minutes. You can use that storage link to make subsequent upload request with file buffer or blob.
|
|
407
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
408
|
+
*
|
|
409
|
+
* It has three Major Steps:
|
|
410
|
+
* Start
|
|
411
|
+
* Upload
|
|
412
|
+
* Complete
|
|
413
|
+
*
|
|
414
|
+
* ### Start
|
|
415
|
+
* Initiates the assets upload using `startUpload`.
|
|
416
|
+
* It returns the storage link in response.
|
|
417
|
+
*
|
|
418
|
+
* ### Upload
|
|
419
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
420
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
421
|
+
*
|
|
422
|
+
* ### Complete
|
|
423
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
424
|
+
* This operation will return the url for the uploaded file.
|
|
386
425
|
*/
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
const callback = async () => {
|
|
390
|
-
const pageId = paginator.nextId;
|
|
391
|
-
const pageNo = paginator.pageNo;
|
|
392
|
-
const pageType = "number";
|
|
393
|
-
const data = await this.browse({
|
|
394
|
-
namespace: namespace,
|
|
395
|
-
pageNo: pageNo,
|
|
396
|
-
});
|
|
397
|
-
paginator.setPaginator({
|
|
398
|
-
hasNext: data.page.has_next ? true : false,
|
|
399
|
-
nextId: data.page.next_id,
|
|
400
|
-
});
|
|
401
|
-
return data;
|
|
402
|
-
};
|
|
403
|
-
paginator.setCallback(callback);
|
|
404
|
-
return paginator;
|
|
405
|
-
}
|
|
426
|
+
async startUpload({
|
|
427
|
+
namespace,
|
|
406
428
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
* @returns {Promise<string>} - Success response
|
|
411
|
-
* @summary: Proxy
|
|
412
|
-
* @description: Proxy
|
|
413
|
-
*/
|
|
414
|
-
async proxy({ url } = {}) {
|
|
415
|
-
const { error } = FileStorageValidator.proxy().validate(
|
|
429
|
+
body,
|
|
430
|
+
} = {}) {
|
|
431
|
+
const { error } = FileStorageValidator.startUpload().validate(
|
|
416
432
|
{
|
|
417
|
-
|
|
433
|
+
namespace,
|
|
434
|
+
|
|
435
|
+
body,
|
|
418
436
|
},
|
|
419
437
|
{ abortEarly: false, allowUnknown: true }
|
|
420
438
|
);
|
|
@@ -423,42 +441,46 @@ class FileStorage {
|
|
|
423
441
|
}
|
|
424
442
|
|
|
425
443
|
// Showing warrnings if extra unknown parameters are found
|
|
426
|
-
const { error: warrning } = FileStorageValidator.
|
|
444
|
+
const { error: warrning } = FileStorageValidator.startUpload().validate(
|
|
427
445
|
{
|
|
428
|
-
|
|
446
|
+
namespace,
|
|
447
|
+
|
|
448
|
+
body,
|
|
429
449
|
},
|
|
430
450
|
{ abortEarly: false, allowUnknown: false }
|
|
431
451
|
);
|
|
432
452
|
if (warrning) {
|
|
433
453
|
Logger({
|
|
434
454
|
level: "WARN",
|
|
435
|
-
message: "Parameter Validation warrnings for
|
|
455
|
+
message: "Parameter Validation warrnings for startUpload",
|
|
436
456
|
});
|
|
437
457
|
Logger({ level: "WARN", message: warrning });
|
|
438
458
|
}
|
|
439
459
|
|
|
440
460
|
const query_params = {};
|
|
441
|
-
query_params["url"] = url;
|
|
442
461
|
|
|
443
462
|
const xHeaders = {};
|
|
444
463
|
|
|
445
464
|
const response = await PlatformAPIClient.execute(
|
|
446
465
|
this.config,
|
|
447
466
|
"post",
|
|
448
|
-
`/service/platform/assets/v1.0/company/${this.config.companyId}/
|
|
467
|
+
`/service/platform/assets/v1.0/company/${this.config.companyId}/namespaces/${namespace}/upload/start/`,
|
|
449
468
|
query_params,
|
|
450
|
-
|
|
469
|
+
body,
|
|
451
470
|
xHeaders
|
|
452
471
|
);
|
|
453
472
|
|
|
454
|
-
const {
|
|
455
|
-
|
|
456
|
-
|
|
473
|
+
const {
|
|
474
|
+
error: res_error,
|
|
475
|
+
} = FileStorageModel.StartResponse().validate(response, {
|
|
476
|
+
abortEarly: false,
|
|
477
|
+
allowUnknown: false,
|
|
478
|
+
});
|
|
457
479
|
|
|
458
480
|
if (res_error) {
|
|
459
481
|
Logger({
|
|
460
482
|
level: "WARN",
|
|
461
|
-
message: "Response Validation Warnnings for
|
|
483
|
+
message: "Response Validation Warnnings for startUpload",
|
|
462
484
|
});
|
|
463
485
|
Logger({ level: "WARN", message: res_error });
|
|
464
486
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export = FileStorageModel;
|
|
2
2
|
declare class FileStorageModel {
|
|
3
|
-
static
|
|
3
|
+
static BrowseResponse(): any;
|
|
4
|
+
static BulkRequest(): any;
|
|
5
|
+
static BulkUploadResponse(): any;
|
|
4
6
|
static CDN(): any;
|
|
5
|
-
static Upload(): any;
|
|
6
|
-
static StartResponse(): any;
|
|
7
|
-
static StartRequest(): any;
|
|
8
7
|
static CompleteResponse(): any;
|
|
9
|
-
static Opts(): any;
|
|
10
8
|
static CopyFileTask(): any;
|
|
11
|
-
static
|
|
12
|
-
static ReqConfiguration(): any;
|
|
9
|
+
static DbRecord(): any;
|
|
13
10
|
static Destination(): any;
|
|
14
|
-
static
|
|
15
|
-
static
|
|
16
|
-
static SignUrlResponse(): any;
|
|
17
|
-
static SignUrlRequest(): any;
|
|
11
|
+
static FailedResponse(): any;
|
|
12
|
+
static Opts(): any;
|
|
18
13
|
static Page(): any;
|
|
19
|
-
static
|
|
20
|
-
static
|
|
14
|
+
static ReqConfiguration(): any;
|
|
15
|
+
static SignUrlRequest(): any;
|
|
16
|
+
static SignUrlResponse(): any;
|
|
17
|
+
static StartRequest(): any;
|
|
18
|
+
static StartResponse(): any;
|
|
19
|
+
static Upload(): any;
|
|
20
|
+
static Urls(): any;
|
|
21
21
|
}
|