@gofynd/fdk-client-javascript 0.1.37 → 1.0.1
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 +24 -0
- package/application.d.ts +2 -1
- package/application.js +2 -1
- package/documentation/application/CART.md +315 -289
- package/documentation/application/CATALOG.md +438 -415
- package/documentation/application/FILESTORAGE.md +2 -0
- package/documentation/application/LEAD.md +18 -18
- package/documentation/application/LOGISTIC.md +45 -45
- package/documentation/application/ORDER.md +277 -277
- package/documentation/application/PAYMENT.md +251 -251
- package/documentation/application/POSCART.md +318 -292
- package/documentation/application/REWARDS.md +1 -0
- package/documentation/application/USER.md +19 -14
- package/documentation/platform/CART.md +465 -462
- package/documentation/platform/CATALOG.md +2792 -2711
- package/documentation/platform/COMPANYPROFILE.md +200 -362
- package/documentation/platform/DISCOUNT.md +86 -0
- package/documentation/platform/FILESTORAGE.md +2 -0
- package/documentation/platform/LEAD.md +60 -60
- package/documentation/platform/ORDER.md +1451 -1654
- package/documentation/platform/PAYMENT.md +94 -94
- package/documentation/platform/REWARDS.md +145 -0
- package/documentation/platform/USER.md +24 -14
- package/index.d.ts +4 -1
- package/index.js +13 -4
- package/package.json +9 -9
- package/platform.d.ts +2 -1
- package/platform.js +3 -2
- package/public.d.ts +1 -0
- package/public.js +3 -2
- package/sdk/application/ApplicationAPIClient.js +3 -1
- package/sdk/application/ApplicationClient.d.ts +16 -16
- package/sdk/application/ApplicationClient.js +32 -16
- package/sdk/application/ApplicationConfig.js +3 -2
- package/sdk/application/ApplicationModels.d.ts +0 -832
- package/sdk/application/ApplicationModels.js +3 -10574
- package/sdk/application/{client → Cart}/CartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → Cart}/CartApplicationClient.js +316 -8
- package/sdk/application/Cart/CartApplicationModel.d.ts +81 -0
- package/sdk/application/Cart/CartApplicationModel.js +1136 -0
- package/sdk/application/{models/CartValidator.js → Cart/CartApplicationValidator.js} +17 -12
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.d.ts +8 -5
- package/sdk/application/{client → Catalog}/CatalogApplicationClient.js +389 -8
- package/sdk/application/Catalog/CatalogApplicationModel.d.ts +117 -0
- package/sdk/application/Catalog/CatalogApplicationModel.js +1606 -0
- package/sdk/application/{models/CatalogValidator.js → Catalog/CatalogApplicationValidator.js} +4 -1
- package/sdk/application/{client → Common}/CommonApplicationClient.js +24 -2
- package/sdk/application/Common/CommonApplicationModel.d.ts +20 -0
- package/sdk/application/Common/CommonApplicationModel.js +228 -0
- package/sdk/{platform/models/CommonValidator.js → application/Common/CommonApplicationValidator.js} +3 -1
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.js +43 -2
- package/sdk/application/Communication/CommunicationApplicationModel.d.ts +15 -0
- package/sdk/application/Communication/CommunicationApplicationModel.js +144 -0
- package/sdk/application/{models/CommunicationValidator.js → Communication/CommunicationApplicationValidator.js} +5 -3
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.js +202 -2
- package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +111 -0
- package/sdk/application/Configuration/ConfigurationApplicationModel.js +1182 -0
- package/sdk/application/{models/ConfigurationValidator.js → Configuration/ConfigurationApplicationValidator.js} +4 -2
- package/sdk/application/{client → Content}/ContentApplicationClient.js +217 -2
- package/sdk/application/Content/ContentApplicationModel.d.ts +105 -0
- package/sdk/application/Content/ContentApplicationModel.js +1349 -0
- package/sdk/application/{models/ContentValidator.js → Content/ContentApplicationValidator.js} +3 -1
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.js +35 -2
- package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +21 -0
- package/sdk/application/FileStorage/FileStorageApplicationModel.js +244 -0
- package/sdk/application/{models/FileStorageValidator.js → FileStorage/FileStorageApplicationValidator.js} +6 -4
- package/sdk/application/{client → Lead}/LeadApplicationClient.js +83 -2
- package/sdk/application/Lead/LeadApplicationModel.d.ts +55 -0
- package/sdk/application/Lead/LeadApplicationModel.js +690 -0
- package/sdk/application/{models/LeadValidator.js → Lead/LeadApplicationValidator.js} +6 -4
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.js +46 -2
- package/sdk/application/Logistic/LogisticApplicationModel.d.ts +26 -0
- package/sdk/application/Logistic/LogisticApplicationModel.js +286 -0
- package/sdk/application/{models/LogisticValidator.js → Logistic/LogisticApplicationValidator.js} +5 -3
- package/sdk/application/{client → Order}/OrderApplicationClient.js +148 -2
- package/sdk/application/Order/OrderApplicationModel.d.ts +67 -0
- package/sdk/application/Order/OrderApplicationModel.js +872 -0
- package/sdk/application/{models/OrderValidator.js → Order/OrderApplicationValidator.js} +5 -3
- package/sdk/application/{client → Payment}/PaymentApplicationClient.js +530 -2
- package/sdk/application/Payment/PaymentApplicationModel.d.ts +96 -0
- package/sdk/application/Payment/PaymentApplicationModel.js +1318 -0
- package/sdk/application/{models/PaymentValidator.js → Payment/PaymentApplicationValidator.js} +25 -23
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.d.ts +9 -3
- package/sdk/application/{client → PosCart}/PosCartApplicationClient.js +343 -8
- package/sdk/application/PosCart/PosCartApplicationModel.d.ts +79 -0
- package/sdk/application/PosCart/PosCartApplicationModel.js +1132 -0
- package/sdk/application/{models/PosCartValidator.js → PosCart/PosCartApplicationValidator.js} +18 -13
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.js +83 -2
- package/sdk/application/Rewards/RewardsApplicationModel.d.ts +23 -0
- package/sdk/application/Rewards/RewardsApplicationModel.js +276 -0
- package/sdk/application/{models/RewardsValidator.js → Rewards/RewardsApplicationValidator.js} +6 -4
- package/sdk/application/{client → Share}/ShareApplicationClient.js +89 -2
- package/sdk/application/Share/ShareApplicationModel.d.ts +16 -0
- package/sdk/application/Share/ShareApplicationModel.js +178 -0
- package/sdk/application/{models/ShareValidator.js → Share/ShareApplicationValidator.js} +4 -2
- package/sdk/application/{client → Theme}/ThemeApplicationClient.js +46 -2
- package/sdk/application/Theme/ThemeApplicationModel.d.ts +49 -0
- package/sdk/application/Theme/ThemeApplicationModel.js +486 -0
- package/sdk/application/{models/ThemeValidator.js → Theme/ThemeApplicationValidator.js} +3 -1
- package/sdk/application/{client → User}/UserApplicationClient.js +407 -2
- package/sdk/application/User/UserApplicationModel.d.ts +95 -0
- package/sdk/application/User/UserApplicationModel.js +998 -0
- package/sdk/application/{models/UserValidator.js → User/UserApplicationValidator.js} +31 -29
- package/sdk/application/index.d.ts +18 -0
- package/sdk/application/index.js +33 -0
- package/sdk/common/AxiosHelper.js +23 -10
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +6 -0
- package/sdk/common/curlHelper.d.ts +2 -0
- package/sdk/common/curlHelper.js +95 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.d.ts +101 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationClient.js +399 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.d.ts +11 -0
- package/sdk/platform/Analytics/AnalyticsPlatformApplicationValidator.js +56 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.js +60 -2
- package/sdk/platform/Analytics/AnalyticsPlatformModel.d.ts +23 -0
- package/sdk/platform/Analytics/AnalyticsPlatformModel.js +252 -0
- package/sdk/platform/{models/AnalyticsValidator.js → Analytics/AnalyticsPlatformValidator.js} +5 -4
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.js +48 -2
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +18 -0
- package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +144 -0
- package/sdk/platform/{models/AuditTrailValidator.js → AuditTrail/AuditTrailPlatformValidator.js} +3 -2
- package/sdk/platform/{client → Billing}/BillingPlatformClient.js +162 -2
- package/sdk/platform/Billing/BillingPlatformModel.d.ts +65 -0
- package/sdk/platform/Billing/BillingPlatformModel.js +906 -0
- package/sdk/platform/{models/BillingValidator.js → Billing/BillingPlatformValidator.js} +6 -5
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +293 -0
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +1001 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +20 -0
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +138 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +104 -0
- package/sdk/platform/Cart/CartPlatformModel.js +1516 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +856 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +2927 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +56 -0
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +389 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.js +1402 -349
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +317 -0
- package/sdk/platform/Catalog/CatalogPlatformModel.js +4702 -0
- package/sdk/platform/{models/CatalogValidator.js → Catalog/CatalogPlatformValidator.js} +92 -91
- package/sdk/platform/{client → Common}/CommonPlatformClient.js +28 -2
- package/sdk/platform/Common/CommonPlatformModel.d.ts +20 -0
- package/sdk/platform/Common/CommonPlatformModel.js +228 -0
- package/sdk/{application/models/CommonValidator.js → platform/Common/CommonPlatformValidator.js} +2 -1
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +611 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +2243 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.d.ts +43 -0
- package/sdk/platform/Communication/CommunicationPlatformApplicationValidator.js +277 -0
- package/sdk/platform/{client → Communication}/CommunicationPlatformClient.js +17 -2
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +102 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +1312 -0
- package/sdk/platform/{models/CommunicationValidator.js → Communication/CommunicationPlatformValidator.js} +2 -1
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.d.ts +0 -9
- package/sdk/platform/{client → CompanyProfile}/CompanyProfilePlatformClient.js +176 -28
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +44 -0
- package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +706 -0
- package/sdk/platform/{models/CompanyProfileValidator.d.ts → CompanyProfile/CompanyProfilePlatformValidator.d.ts} +0 -1
- package/sdk/platform/{models/CompanyProfileValidator.js → CompanyProfile/CompanyProfilePlatformValidator.js} +9 -14
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.d.ts +309 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationClient.js +1322 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.d.ts +31 -0
- package/sdk/platform/Configuration/ConfigurationPlatformApplicationValidator.js +164 -0
- package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.js +284 -2
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +185 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2072 -0
- package/sdk/platform/{models/ConfigurationValidator.js → Configuration/ConfigurationPlatformValidator.js} +9 -8
- package/sdk/platform/Content/ContentPlatformApplicationClient.d.ts +781 -0
- package/sdk/platform/Content/ContentPlatformApplicationClient.js +3074 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +71 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +422 -0
- package/sdk/platform/Content/ContentPlatformModel.d.ts +105 -0
- package/sdk/platform/Content/ContentPlatformModel.js +1349 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.d.ts +11 -0
- package/sdk/platform/{client → Discount}/DiscountPlatformClient.js +187 -2
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +15 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +176 -0
- package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts} +1 -0
- package/sdk/platform/{models/DiscountValidator.js → Discount/DiscountPlatformValidator.js} +13 -5
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +114 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +301 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/FileStorage/FileStoragePlatformApplicationValidator.js +38 -0
- package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.js +78 -2
- package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +21 -0
- package/sdk/platform/FileStorage/FileStoragePlatformModel.js +244 -0
- package/sdk/platform/{models/FileStorageValidator.js → FileStorage/FileStoragePlatformValidator.js} +6 -5
- package/sdk/platform/{client → Inventory}/InventoryPlatformClient.js +163 -2
- package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +62 -0
- package/sdk/platform/Inventory/InventoryPlatformModel.js +1178 -0
- package/sdk/platform/{models/InventoryValidator.js → Inventory/InventoryPlatformValidator.js} +5 -4
- package/sdk/platform/Lead/LeadPlatformApplicationClient.d.ts +138 -0
- package/sdk/platform/Lead/LeadPlatformApplicationClient.js +559 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Lead/LeadPlatformApplicationValidator.js +90 -0
- package/sdk/platform/{client → Lead}/LeadPlatformClient.js +142 -2
- package/sdk/platform/Lead/LeadPlatformModel.d.ts +55 -0
- package/sdk/platform/Lead/LeadPlatformModel.js +690 -0
- package/sdk/platform/{models/LeadValidator.js → Lead/LeadPlatformValidator.js} +7 -6
- package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +59 -0
- package/sdk/platform/Order/OrderPlatformApplicationClient.js +207 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +6 -0
- package/sdk/platform/Order/OrderPlatformApplicationValidator.js +37 -0
- package/sdk/platform/{client → Order}/OrderPlatformClient.d.ts +24 -55
- package/sdk/platform/{client → Order}/OrderPlatformClient.js +693 -146
- package/sdk/platform/Order/OrderPlatformModel.d.ts +222 -0
- package/sdk/platform/Order/OrderPlatformModel.js +3466 -0
- package/sdk/platform/{models/OrderValidator.d.ts → Order/OrderPlatformValidator.d.ts} +2 -3
- package/sdk/platform/{models/OrderValidator.js → Order/OrderPlatformValidator.js} +32 -48
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.d.ts +30 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationClient.js +100 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.d.ts +5 -0
- package/sdk/platform/Partner/PartnerPlatformApplicationValidator.js +20 -0
- package/sdk/platform/Partner/PartnerPlatformModel.d.ts +7 -0
- package/sdk/platform/Partner/PartnerPlatformModel.js +54 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +108 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +498 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +14 -0
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +73 -0
- package/sdk/platform/{client → Payment}/PaymentPlatformClient.js +141 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +44 -0
- package/sdk/platform/Payment/PaymentPlatformModel.js +552 -0
- package/sdk/platform/{models/PaymentValidator.js → Payment/PaymentPlatformValidator.js} +6 -5
- package/sdk/platform/PlatformAPIClient.js +2 -1
- package/sdk/platform/PlatformApplicationClient.d.ts +2824 -18486
- package/sdk/platform/PlatformApplicationClient.js +3772 -13928
- package/sdk/platform/PlatformClient.d.ts +2824 -2881
- package/sdk/platform/PlatformClient.js +3710 -3145
- package/sdk/platform/PlatformConfig.js +2 -1
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.d.ts +150 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationClient.js +597 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.d.ts +16 -0
- package/sdk/platform/Rewards/RewardsPlatformApplicationValidator.js +91 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +24 -0
- package/sdk/platform/Rewards/RewardsPlatformModel.js +294 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.d.ts +72 -0
- package/sdk/platform/Share/SharePlatformApplicationClient.js +235 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.d.ts +7 -0
- package/sdk/platform/Share/SharePlatformApplicationValidator.js +35 -0
- package/sdk/platform/Share/SharePlatformModel.d.ts +15 -0
- package/sdk/platform/Share/SharePlatformModel.js +170 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.d.ts +238 -0
- package/sdk/platform/Theme/ThemePlatformApplicationClient.js +997 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.d.ts +27 -0
- package/sdk/platform/Theme/ThemePlatformApplicationValidator.js +155 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +49 -0
- package/sdk/platform/Theme/ThemePlatformModel.js +486 -0
- package/sdk/platform/User/UserPlatformApplicationClient.d.ts +121 -0
- package/sdk/platform/User/UserPlatformApplicationClient.js +506 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.d.ts +15 -0
- package/sdk/platform/User/UserPlatformApplicationValidator.js +79 -0
- package/sdk/platform/User/UserPlatformModel.d.ts +95 -0
- package/sdk/platform/User/UserPlatformModel.js +998 -0
- package/sdk/platform/{client → Webhook}/WebhookPlatformClient.js +92 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +17 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +208 -0
- package/sdk/platform/{models/WebhookValidator.js → Webhook/WebhookPlatformValidator.js} +4 -3
- package/sdk/platform/index.d.ts +24 -0
- package/sdk/platform/index.js +45 -0
- package/sdk/public/{client → Configuration}/ConfigurationPublicClient.js +26 -1
- package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +20 -0
- package/sdk/public/Configuration/ConfigurationPublicModel.js +230 -0
- package/sdk/public/{models/ConfigurationValidator.js → Configuration/ConfigurationPublicValidator.js} +3 -1
- package/sdk/public/{client → Inventory}/InventoryPublicClient.js +76 -1
- package/sdk/public/Inventory/InventoryPublicModel.d.ts +22 -0
- package/sdk/public/Inventory/InventoryPublicModel.js +334 -0
- package/sdk/public/{models/InventoryValidator.js → Inventory/InventoryPublicValidator.js} +4 -2
- package/sdk/public/PublicClient.d.ts +3 -3
- package/sdk/public/PublicClient.js +8 -3
- package/sdk/public/{client → Webhook}/WebhookPublicClient.js +30 -1
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +17 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +208 -0
- package/sdk/public/{models/WebhookValidator.js → Webhook/WebhookPublicValidator.js} +4 -2
- package/sdk/public/index.d.ts +5 -0
- package/sdk/public/index.js +7 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +0 -328
- package/sdk/platform/PlatformApplicationModels.js +0 -22658
- package/sdk/platform/PlatformModels.d.ts +0 -1477
- package/sdk/platform/PlatformModels.js +0 -20646
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/RewardsValidator.d.ts +0 -0
- package/sdk/platform/models/RewardsValidator.js +0 -0
- package/sdk/platform/models/ShareValidator.d.ts +0 -0
- package/sdk/platform/models/ShareValidator.js +0 -0
- package/sdk/platform/models/ThemeValidator.d.ts +0 -0
- package/sdk/platform/models/ThemeValidator.js +0 -0
- package/sdk/platform/models/UserValidator.d.ts +0 -0
- package/sdk/platform/models/UserValidator.js +0 -0
- package/sdk/public/PublicModels.d.ts +0 -50
- package/sdk/public/PublicModels.js +0 -712
- package/sdk/application/{models/CartValidator.d.ts → Cart/CartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/CatalogValidator.d.ts → Catalog/CatalogApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Common}/CommonApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommonValidator.d.ts → Common/CommonApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Communication}/CommunicationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/CommunicationValidator.d.ts → Communication/CommunicationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Configuration}/ConfigurationApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Content}/ContentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ContentValidator.d.ts → Content/ContentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → FileStorage}/FileStorageApplicationClient.d.ts +0 -0
- package/sdk/application/{models/FileStorageValidator.d.ts → FileStorage/FileStorageApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Lead}/LeadApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LeadValidator.d.ts → Lead/LeadApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Logistic}/LogisticApplicationClient.d.ts +0 -0
- package/sdk/application/{models/LogisticValidator.d.ts → Logistic/LogisticApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Order}/OrderApplicationClient.d.ts +0 -0
- package/sdk/application/{models/OrderValidator.d.ts → Order/OrderApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Payment}/PaymentApplicationClient.d.ts +0 -0
- package/sdk/application/{models/PaymentValidator.d.ts → Payment/PaymentApplicationValidator.d.ts} +0 -0
- package/sdk/application/{models/PosCartValidator.d.ts → PosCart/PosCartApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Rewards}/RewardsApplicationClient.d.ts +0 -0
- package/sdk/application/{models/RewardsValidator.d.ts → Rewards/RewardsApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Share}/ShareApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ShareValidator.d.ts → Share/ShareApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → Theme}/ThemeApplicationClient.d.ts +0 -0
- package/sdk/application/{models/ThemeValidator.d.ts → Theme/ThemeApplicationValidator.d.ts} +0 -0
- package/sdk/application/{client → User}/UserApplicationClient.d.ts +0 -0
- package/sdk/application/{models/UserValidator.d.ts → User/UserApplicationValidator.d.ts} +0 -0
- package/sdk/platform/{client → Analytics}/AnalyticsPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AnalyticsValidator.d.ts → Analytics/AnalyticsPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → AuditTrail}/AuditTrailPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/AuditTrailValidator.d.ts → AuditTrail/AuditTrailPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Billing}/BillingPlatformClient.d.ts +0 -0
- package/sdk/platform/{models/BillingValidator.d.ts → Billing/BillingPlatformValidator.d.ts} +0 -0
- package/sdk/platform/{client → Catalog}/CatalogPlatformClient.d.ts +149 -149
- package/sdk/platform/{models/CatalogValidator.d.ts → Catalog/CatalogPlatformValidator.d.ts} +21 -21
- /package/sdk/platform/{client → Common}/CommonPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommonValidator.d.ts → Common/CommonPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Communication}/CommunicationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/CommunicationValidator.d.ts → Communication/CommunicationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Configuration}/ConfigurationPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → FileStorage}/FileStoragePlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/FileStorageValidator.d.ts → FileStorage/FileStoragePlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Inventory}/InventoryPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/InventoryValidator.d.ts → Inventory/InventoryPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Lead}/LeadPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/LeadValidator.d.ts → Lead/LeadPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Payment}/PaymentPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/PaymentValidator.d.ts → Payment/PaymentPlatformValidator.d.ts} +0 -0
- /package/sdk/platform/{client → Webhook}/WebhookPlatformClient.d.ts +0 -0
- /package/sdk/platform/{models/WebhookValidator.d.ts → Webhook/WebhookPlatformValidator.d.ts} +0 -0
- /package/sdk/public/{client → Configuration}/ConfigurationPublicClient.d.ts +0 -0
- /package/sdk/public/{models/ConfigurationValidator.d.ts → Configuration/ConfigurationPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Inventory}/InventoryPublicClient.d.ts +0 -0
- /package/sdk/public/{models/InventoryValidator.d.ts → Inventory/InventoryPublicValidator.d.ts} +0 -0
- /package/sdk/public/{client → Webhook}/WebhookPublicClient.d.ts +0 -0
- /package/sdk/public/{models/WebhookValidator.d.ts → Webhook/WebhookPublicValidator.d.ts} +0 -0
|
@@ -57,6 +57,17 @@ declare class Discount {
|
|
|
57
57
|
id: string;
|
|
58
58
|
body: CreateUpdateDiscount;
|
|
59
59
|
}): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* @param {Object} arg - Arg object.
|
|
62
|
+
* @param {string} arg.id - Job ID of the discount.
|
|
63
|
+
* @param {BulkDiscount} arg.body
|
|
64
|
+
* @summary: Create custom discount from bulk.
|
|
65
|
+
* @description: Create custom discounts through API.
|
|
66
|
+
*/
|
|
67
|
+
upsertDiscountItems({ id, body }?: {
|
|
68
|
+
id: string;
|
|
69
|
+
body: BulkDiscount;
|
|
70
|
+
}): Promise<any>;
|
|
60
71
|
/**
|
|
61
72
|
* @param {Object} arg - Arg object.
|
|
62
73
|
* @param {string} [arg.discount] - Discount
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const Paginator = require("../../common/Paginator");
|
|
2
|
-
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
2
|
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
-
const
|
|
3
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
4
|
+
const DiscountValidator = require("./DiscountPlatformValidator");
|
|
5
5
|
class Discount {
|
|
6
6
|
constructor(config) {
|
|
7
7
|
this.config = config;
|
|
@@ -51,6 +51,26 @@ class Discount {
|
|
|
51
51
|
return Promise.reject(new FDKClientValidationError(error));
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
+
// Showing warrnings if extra unknown parameters are found
|
|
55
|
+
const { error: warrning } = DiscountValidator.getDiscounts().validate(
|
|
56
|
+
{
|
|
57
|
+
view,
|
|
58
|
+
q,
|
|
59
|
+
pageNo,
|
|
60
|
+
pageSize,
|
|
61
|
+
archived,
|
|
62
|
+
month,
|
|
63
|
+
year,
|
|
64
|
+
type,
|
|
65
|
+
appIds,
|
|
66
|
+
},
|
|
67
|
+
{ abortEarly: false, allowUnknown: false }
|
|
68
|
+
);
|
|
69
|
+
if (warrning) {
|
|
70
|
+
console.log("Parameter Validation warrnings for getDiscounts");
|
|
71
|
+
console.log(warrning);
|
|
72
|
+
}
|
|
73
|
+
|
|
54
74
|
const query_params = {};
|
|
55
75
|
query_params["view"] = view;
|
|
56
76
|
query_params["q"] = q;
|
|
@@ -91,6 +111,18 @@ class Discount {
|
|
|
91
111
|
return Promise.reject(new FDKClientValidationError(error));
|
|
92
112
|
}
|
|
93
113
|
|
|
114
|
+
// Showing warrnings if extra unknown parameters are found
|
|
115
|
+
const { error: warrning } = DiscountValidator.createDiscount().validate(
|
|
116
|
+
{
|
|
117
|
+
body,
|
|
118
|
+
},
|
|
119
|
+
{ abortEarly: false, allowUnknown: false }
|
|
120
|
+
);
|
|
121
|
+
if (warrning) {
|
|
122
|
+
console.log("Parameter Validation warrnings for createDiscount");
|
|
123
|
+
console.log(warrning);
|
|
124
|
+
}
|
|
125
|
+
|
|
94
126
|
const query_params = {};
|
|
95
127
|
|
|
96
128
|
const xHeaders = {};
|
|
@@ -122,6 +154,18 @@ class Discount {
|
|
|
122
154
|
return Promise.reject(new FDKClientValidationError(error));
|
|
123
155
|
}
|
|
124
156
|
|
|
157
|
+
// Showing warrnings if extra unknown parameters are found
|
|
158
|
+
const { error: warrning } = DiscountValidator.getDiscount().validate(
|
|
159
|
+
{
|
|
160
|
+
id,
|
|
161
|
+
},
|
|
162
|
+
{ abortEarly: false, allowUnknown: false }
|
|
163
|
+
);
|
|
164
|
+
if (warrning) {
|
|
165
|
+
console.log("Parameter Validation warrnings for getDiscount");
|
|
166
|
+
console.log(warrning);
|
|
167
|
+
}
|
|
168
|
+
|
|
125
169
|
const query_params = {};
|
|
126
170
|
|
|
127
171
|
const xHeaders = {};
|
|
@@ -155,6 +199,19 @@ class Discount {
|
|
|
155
199
|
return Promise.reject(new FDKClientValidationError(error));
|
|
156
200
|
}
|
|
157
201
|
|
|
202
|
+
// Showing warrnings if extra unknown parameters are found
|
|
203
|
+
const { error: warrning } = DiscountValidator.updateDiscount().validate(
|
|
204
|
+
{
|
|
205
|
+
id,
|
|
206
|
+
body,
|
|
207
|
+
},
|
|
208
|
+
{ abortEarly: false, allowUnknown: false }
|
|
209
|
+
);
|
|
210
|
+
if (warrning) {
|
|
211
|
+
console.log("Parameter Validation warrnings for updateDiscount");
|
|
212
|
+
console.log(warrning);
|
|
213
|
+
}
|
|
214
|
+
|
|
158
215
|
const query_params = {};
|
|
159
216
|
|
|
160
217
|
const xHeaders = {};
|
|
@@ -169,6 +226,54 @@ class Discount {
|
|
|
169
226
|
);
|
|
170
227
|
}
|
|
171
228
|
|
|
229
|
+
/**
|
|
230
|
+
* @param {Object} arg - Arg object.
|
|
231
|
+
* @param {string} arg.id - Job ID of the discount.
|
|
232
|
+
* @param {BulkDiscount} arg.body
|
|
233
|
+
* @summary: Create custom discount from bulk.
|
|
234
|
+
* @description: Create custom discounts through API.
|
|
235
|
+
*/
|
|
236
|
+
upsertDiscountItems({ id, body } = {}) {
|
|
237
|
+
const { error } = DiscountValidator.upsertDiscountItems().validate(
|
|
238
|
+
{
|
|
239
|
+
id,
|
|
240
|
+
body,
|
|
241
|
+
},
|
|
242
|
+
{ abortEarly: false, allowUnknown: true }
|
|
243
|
+
);
|
|
244
|
+
if (error) {
|
|
245
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Showing warrnings if extra unknown parameters are found
|
|
249
|
+
const {
|
|
250
|
+
error: warrning,
|
|
251
|
+
} = DiscountValidator.upsertDiscountItems().validate(
|
|
252
|
+
{
|
|
253
|
+
id,
|
|
254
|
+
body,
|
|
255
|
+
},
|
|
256
|
+
{ abortEarly: false, allowUnknown: false }
|
|
257
|
+
);
|
|
258
|
+
if (warrning) {
|
|
259
|
+
console.log("Parameter Validation warrnings for upsertDiscountItems");
|
|
260
|
+
console.log(warrning);
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
const query_params = {};
|
|
264
|
+
|
|
265
|
+
const xHeaders = {};
|
|
266
|
+
|
|
267
|
+
return PlatformAPIClient.execute(
|
|
268
|
+
this.config,
|
|
269
|
+
"post",
|
|
270
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/items/`,
|
|
271
|
+
query_params,
|
|
272
|
+
body,
|
|
273
|
+
xHeaders
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
|
|
172
277
|
/**
|
|
173
278
|
* @param {Object} arg - Arg object.
|
|
174
279
|
* @param {string} [arg.discount] - Discount
|
|
@@ -188,6 +293,21 @@ class Discount {
|
|
|
188
293
|
return Promise.reject(new FDKClientValidationError(error));
|
|
189
294
|
}
|
|
190
295
|
|
|
296
|
+
// Showing warrnings if extra unknown parameters are found
|
|
297
|
+
const {
|
|
298
|
+
error: warrning,
|
|
299
|
+
} = DiscountValidator.validateDiscountFile().validate(
|
|
300
|
+
{
|
|
301
|
+
body,
|
|
302
|
+
discount,
|
|
303
|
+
},
|
|
304
|
+
{ abortEarly: false, allowUnknown: false }
|
|
305
|
+
);
|
|
306
|
+
if (warrning) {
|
|
307
|
+
console.log("Parameter Validation warrnings for validateDiscountFile");
|
|
308
|
+
console.log(warrning);
|
|
309
|
+
}
|
|
310
|
+
|
|
191
311
|
const query_params = {};
|
|
192
312
|
query_params["discount"] = discount;
|
|
193
313
|
|
|
@@ -222,6 +342,21 @@ class Discount {
|
|
|
222
342
|
return Promise.reject(new FDKClientValidationError(error));
|
|
223
343
|
}
|
|
224
344
|
|
|
345
|
+
// Showing warrnings if extra unknown parameters are found
|
|
346
|
+
const {
|
|
347
|
+
error: warrning,
|
|
348
|
+
} = DiscountValidator.downloadDiscountFile().validate(
|
|
349
|
+
{
|
|
350
|
+
type,
|
|
351
|
+
body,
|
|
352
|
+
},
|
|
353
|
+
{ abortEarly: false, allowUnknown: false }
|
|
354
|
+
);
|
|
355
|
+
if (warrning) {
|
|
356
|
+
console.log("Parameter Validation warrnings for downloadDiscountFile");
|
|
357
|
+
console.log(warrning);
|
|
358
|
+
}
|
|
359
|
+
|
|
225
360
|
const query_params = {};
|
|
226
361
|
|
|
227
362
|
const xHeaders = {};
|
|
@@ -253,6 +388,18 @@ class Discount {
|
|
|
253
388
|
return Promise.reject(new FDKClientValidationError(error));
|
|
254
389
|
}
|
|
255
390
|
|
|
391
|
+
// Showing warrnings if extra unknown parameters are found
|
|
392
|
+
const { error: warrning } = DiscountValidator.getValidationJob().validate(
|
|
393
|
+
{
|
|
394
|
+
id,
|
|
395
|
+
},
|
|
396
|
+
{ abortEarly: false, allowUnknown: false }
|
|
397
|
+
);
|
|
398
|
+
if (warrning) {
|
|
399
|
+
console.log("Parameter Validation warrnings for getValidationJob");
|
|
400
|
+
console.log(warrning);
|
|
401
|
+
}
|
|
402
|
+
|
|
256
403
|
const query_params = {};
|
|
257
404
|
|
|
258
405
|
const xHeaders = {};
|
|
@@ -284,6 +431,20 @@ class Discount {
|
|
|
284
431
|
return Promise.reject(new FDKClientValidationError(error));
|
|
285
432
|
}
|
|
286
433
|
|
|
434
|
+
// Showing warrnings if extra unknown parameters are found
|
|
435
|
+
const {
|
|
436
|
+
error: warrning,
|
|
437
|
+
} = DiscountValidator.cancelValidationJob().validate(
|
|
438
|
+
{
|
|
439
|
+
id,
|
|
440
|
+
},
|
|
441
|
+
{ abortEarly: false, allowUnknown: false }
|
|
442
|
+
);
|
|
443
|
+
if (warrning) {
|
|
444
|
+
console.log("Parameter Validation warrnings for cancelValidationJob");
|
|
445
|
+
console.log(warrning);
|
|
446
|
+
}
|
|
447
|
+
|
|
287
448
|
const query_params = {};
|
|
288
449
|
|
|
289
450
|
const xHeaders = {};
|
|
@@ -315,6 +476,18 @@ class Discount {
|
|
|
315
476
|
return Promise.reject(new FDKClientValidationError(error));
|
|
316
477
|
}
|
|
317
478
|
|
|
479
|
+
// Showing warrnings if extra unknown parameters are found
|
|
480
|
+
const { error: warrning } = DiscountValidator.getDownloadJob().validate(
|
|
481
|
+
{
|
|
482
|
+
id,
|
|
483
|
+
},
|
|
484
|
+
{ abortEarly: false, allowUnknown: false }
|
|
485
|
+
);
|
|
486
|
+
if (warrning) {
|
|
487
|
+
console.log("Parameter Validation warrnings for getDownloadJob");
|
|
488
|
+
console.log(warrning);
|
|
489
|
+
}
|
|
490
|
+
|
|
318
491
|
const query_params = {};
|
|
319
492
|
|
|
320
493
|
const xHeaders = {};
|
|
@@ -346,6 +519,18 @@ class Discount {
|
|
|
346
519
|
return Promise.reject(new FDKClientValidationError(error));
|
|
347
520
|
}
|
|
348
521
|
|
|
522
|
+
// Showing warrnings if extra unknown parameters are found
|
|
523
|
+
const { error: warrning } = DiscountValidator.cancelDownloadJob().validate(
|
|
524
|
+
{
|
|
525
|
+
id,
|
|
526
|
+
},
|
|
527
|
+
{ abortEarly: false, allowUnknown: false }
|
|
528
|
+
);
|
|
529
|
+
if (warrning) {
|
|
530
|
+
console.log("Parameter Validation warrnings for cancelDownloadJob");
|
|
531
|
+
console.log(warrning);
|
|
532
|
+
}
|
|
533
|
+
|
|
349
534
|
const query_params = {};
|
|
350
535
|
|
|
351
536
|
const xHeaders = {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export = DiscountModel;
|
|
2
|
+
declare class DiscountModel {
|
|
3
|
+
static ValidityObject(): any;
|
|
4
|
+
static CreateUpdateDiscount(): any;
|
|
5
|
+
static DiscountJob(): any;
|
|
6
|
+
static ListOrCalender(): any;
|
|
7
|
+
static DiscountItems(): any;
|
|
8
|
+
static BulkDiscount(): any;
|
|
9
|
+
static FileJobResponse(): any;
|
|
10
|
+
static DownloadFileJob(): any;
|
|
11
|
+
static CancelJobResponse(): any;
|
|
12
|
+
static Page(): any;
|
|
13
|
+
static UserDetails(): any;
|
|
14
|
+
static BadRequestObject(): any;
|
|
15
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
const Joi = require("joi");
|
|
2
|
+
|
|
3
|
+
class DiscountModel {
|
|
4
|
+
static ValidityObject() {
|
|
5
|
+
return Joi.object({
|
|
6
|
+
start: Joi.string().allow("").required(),
|
|
7
|
+
|
|
8
|
+
end: Joi.string().allow("").required(),
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
static CreateUpdateDiscount() {
|
|
13
|
+
return Joi.object({
|
|
14
|
+
name: Joi.string().allow("").required(),
|
|
15
|
+
|
|
16
|
+
company_id: Joi.number().required(),
|
|
17
|
+
|
|
18
|
+
is_active: Joi.boolean().required(),
|
|
19
|
+
|
|
20
|
+
app_ids: Joi.array().items(Joi.string().allow("")).required(),
|
|
21
|
+
|
|
22
|
+
extension_ids: Joi.array().items(Joi.string().allow("")).required(),
|
|
23
|
+
|
|
24
|
+
job_type: Joi.string().allow("").required(),
|
|
25
|
+
|
|
26
|
+
discount_type: Joi.string().allow("").required(),
|
|
27
|
+
|
|
28
|
+
discount_level: Joi.string().allow("").required(),
|
|
29
|
+
|
|
30
|
+
value: Joi.number(),
|
|
31
|
+
|
|
32
|
+
file_path: Joi.string().allow(""),
|
|
33
|
+
|
|
34
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
35
|
+
|
|
36
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
37
|
+
|
|
38
|
+
validity: DiscountModel.ValidityObject().required(),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static DiscountJob() {
|
|
43
|
+
return Joi.object({
|
|
44
|
+
_id: Joi.string().allow("").required(),
|
|
45
|
+
|
|
46
|
+
name: Joi.string().allow("").required(),
|
|
47
|
+
|
|
48
|
+
company_id: Joi.number().required(),
|
|
49
|
+
|
|
50
|
+
is_active: Joi.boolean().required(),
|
|
51
|
+
|
|
52
|
+
app_ids: Joi.array().items(Joi.string().allow("")),
|
|
53
|
+
|
|
54
|
+
job_type: Joi.string().allow(""),
|
|
55
|
+
|
|
56
|
+
discount_type: Joi.string().allow(""),
|
|
57
|
+
|
|
58
|
+
discount_level: Joi.string().allow(""),
|
|
59
|
+
|
|
60
|
+
value: Joi.number(),
|
|
61
|
+
|
|
62
|
+
file_path: Joi.string().allow(""),
|
|
63
|
+
|
|
64
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
65
|
+
|
|
66
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
67
|
+
|
|
68
|
+
validity: DiscountModel.ValidityObject().required(),
|
|
69
|
+
|
|
70
|
+
created_on: Joi.string().allow("").required(),
|
|
71
|
+
|
|
72
|
+
modified_on: Joi.string().allow("").required(),
|
|
73
|
+
|
|
74
|
+
created_by: DiscountModel.UserDetails().required(),
|
|
75
|
+
|
|
76
|
+
modified_by: DiscountModel.UserDetails().required(),
|
|
77
|
+
|
|
78
|
+
meta: Joi.any(),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static ListOrCalender() {
|
|
83
|
+
return Joi.object({
|
|
84
|
+
items: Joi.array().items(DiscountModel.DiscountJob()).required(),
|
|
85
|
+
|
|
86
|
+
page: DiscountModel.Page().required(),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
static DiscountItems() {
|
|
91
|
+
return Joi.object({
|
|
92
|
+
item_code: Joi.string().allow(""),
|
|
93
|
+
|
|
94
|
+
brand_uid: Joi.number(),
|
|
95
|
+
|
|
96
|
+
seller_identifier: Joi.string().allow(""),
|
|
97
|
+
|
|
98
|
+
discount_type: Joi.string().allow("").required(),
|
|
99
|
+
|
|
100
|
+
value: Joi.number().required(),
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static BulkDiscount() {
|
|
105
|
+
return Joi.object({
|
|
106
|
+
company_id: Joi.number().required(),
|
|
107
|
+
|
|
108
|
+
items: Joi.array().items(DiscountModel.DiscountItems()).required(),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
static FileJobResponse() {
|
|
113
|
+
return Joi.object({
|
|
114
|
+
stage: Joi.string().allow("").required(),
|
|
115
|
+
|
|
116
|
+
total: Joi.number().required(),
|
|
117
|
+
|
|
118
|
+
failed: Joi.number().required(),
|
|
119
|
+
|
|
120
|
+
company_id: Joi.number().required(),
|
|
121
|
+
|
|
122
|
+
body: Joi.any(),
|
|
123
|
+
|
|
124
|
+
type: Joi.string().allow("").required(),
|
|
125
|
+
|
|
126
|
+
file_type: Joi.string().allow("").required(),
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static DownloadFileJob() {
|
|
131
|
+
return Joi.object({
|
|
132
|
+
brand_ids: Joi.array().items(Joi.number()),
|
|
133
|
+
|
|
134
|
+
store_ids: Joi.array().items(Joi.number()),
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
static CancelJobResponse() {
|
|
139
|
+
return Joi.object({
|
|
140
|
+
success: Joi.boolean().required(),
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
static Page() {
|
|
145
|
+
return Joi.object({
|
|
146
|
+
item_total: Joi.number(),
|
|
147
|
+
|
|
148
|
+
next_id: Joi.string().allow(""),
|
|
149
|
+
|
|
150
|
+
has_previous: Joi.boolean(),
|
|
151
|
+
|
|
152
|
+
has_next: Joi.boolean(),
|
|
153
|
+
|
|
154
|
+
current: Joi.number(),
|
|
155
|
+
|
|
156
|
+
type: Joi.string().allow("").required(),
|
|
157
|
+
|
|
158
|
+
size: Joi.number(),
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
static UserDetails() {
|
|
163
|
+
return Joi.object({
|
|
164
|
+
username: Joi.string().allow("").required(),
|
|
165
|
+
|
|
166
|
+
user_id: Joi.string().allow("").required(),
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
static BadRequestObject() {
|
|
171
|
+
return Joi.object({
|
|
172
|
+
message: Joi.string().allow("").required(),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
module.exports = DiscountModel;
|
package/sdk/platform/{models/DiscountValidator.d.ts → Discount/DiscountPlatformValidator.d.ts}
RENAMED
|
@@ -4,6 +4,7 @@ declare class DiscountValidator {
|
|
|
4
4
|
static createDiscount(): any;
|
|
5
5
|
static getDiscount(): any;
|
|
6
6
|
static updateDiscount(): any;
|
|
7
|
+
static upsertDiscountItems(): any;
|
|
7
8
|
static validateDiscountFile(): any;
|
|
8
9
|
static downloadDiscountFile(): any;
|
|
9
10
|
static getValidationJob(): any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const Joi = require("joi");
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
const DiscountModel = require("./DiscountPlatformModel");
|
|
3
4
|
class DiscountValidator {
|
|
4
5
|
static getDiscounts() {
|
|
5
6
|
return Joi.object({
|
|
@@ -17,7 +18,7 @@ class DiscountValidator {
|
|
|
17
18
|
|
|
18
19
|
static createDiscount() {
|
|
19
20
|
return Joi.object({
|
|
20
|
-
body:
|
|
21
|
+
body: DiscountModel.CreateUpdateDiscount().required(),
|
|
21
22
|
}).required();
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -30,21 +31,28 @@ class DiscountValidator {
|
|
|
30
31
|
static updateDiscount() {
|
|
31
32
|
return Joi.object({
|
|
32
33
|
id: Joi.string().allow("").required(),
|
|
33
|
-
body:
|
|
34
|
+
body: DiscountModel.CreateUpdateDiscount().required(),
|
|
35
|
+
}).required();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static upsertDiscountItems() {
|
|
39
|
+
return Joi.object({
|
|
40
|
+
id: Joi.string().allow("").required(),
|
|
41
|
+
body: DiscountModel.BulkDiscount().required(),
|
|
34
42
|
}).required();
|
|
35
43
|
}
|
|
36
44
|
|
|
37
45
|
static validateDiscountFile() {
|
|
38
46
|
return Joi.object({
|
|
39
47
|
discount: Joi.string().allow(""),
|
|
40
|
-
body:
|
|
48
|
+
body: DiscountModel.DiscountJob().required(),
|
|
41
49
|
}).required();
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
static downloadDiscountFile() {
|
|
45
53
|
return Joi.object({
|
|
46
54
|
type: Joi.string().allow("").required(),
|
|
47
|
-
body:
|
|
55
|
+
body: DiscountModel.DownloadFileJob().required(),
|
|
48
56
|
}).required();
|
|
49
57
|
}
|
|
50
58
|
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export = FileStorage;
|
|
2
|
+
declare class FileStorage {
|
|
3
|
+
constructor(config: any, applicationId: any);
|
|
4
|
+
config: any;
|
|
5
|
+
applicationId: any;
|
|
6
|
+
/**
|
|
7
|
+
* @param {Object} arg - Arg object.
|
|
8
|
+
* @param {string} arg.namespace - Bucket name
|
|
9
|
+
* @param {StartRequest} arg.body
|
|
10
|
+
* @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.
|
|
11
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
12
|
+
*
|
|
13
|
+
* It has three Major Steps:
|
|
14
|
+
* Start
|
|
15
|
+
* Upload
|
|
16
|
+
* Complete
|
|
17
|
+
*
|
|
18
|
+
* ### Start
|
|
19
|
+
* Initiates the assets upload using `appStartUpload`.
|
|
20
|
+
* It returns the storage link in response.
|
|
21
|
+
*
|
|
22
|
+
* ### Upload
|
|
23
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
24
|
+
* Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body.
|
|
25
|
+
*
|
|
26
|
+
* ### Complete
|
|
27
|
+
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
28
|
+
* This operation will return the url for the uploaded file.
|
|
29
|
+
*/
|
|
30
|
+
appStartUpload({ namespace, body }?: {
|
|
31
|
+
namespace: string;
|
|
32
|
+
body: StartRequest;
|
|
33
|
+
}): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* @param {Object} arg - Arg object.
|
|
36
|
+
* @param {string} arg.namespace - Bucket name
|
|
37
|
+
* @param {StartResponse} arg.body
|
|
38
|
+
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
39
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
40
|
+
*
|
|
41
|
+
* It has three Major Steps:
|
|
42
|
+
* Start
|
|
43
|
+
* Upload
|
|
44
|
+
* Complete
|
|
45
|
+
*
|
|
46
|
+
* ### Start
|
|
47
|
+
* Initiates the assets upload using `appStartUpload`.
|
|
48
|
+
* It returns the storage link in response.
|
|
49
|
+
*
|
|
50
|
+
* ### Upload
|
|
51
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
52
|
+
* Make a `PUT` request on storage link received from `appStartUpload` api with file (Buffer or Blob) as a request body.
|
|
53
|
+
*
|
|
54
|
+
* ### Complete
|
|
55
|
+
* After successfully upload, call `appCompleteUpload` api to complete the upload process.
|
|
56
|
+
* This operation will return the url for the uploaded file.
|
|
57
|
+
*/
|
|
58
|
+
appCompleteUpload({ namespace, body }?: {
|
|
59
|
+
namespace: string;
|
|
60
|
+
body: StartResponse;
|
|
61
|
+
}): Promise<any>;
|
|
62
|
+
/**
|
|
63
|
+
* @param {Object} arg - Arg object.
|
|
64
|
+
* @param {boolean} [arg.sync] - Sync
|
|
65
|
+
* @param {BulkRequest} arg.body
|
|
66
|
+
* @summary: Copy Files
|
|
67
|
+
* @description: Copy Files
|
|
68
|
+
*/
|
|
69
|
+
appCopyFiles({ body, sync }?: {
|
|
70
|
+
sync?: boolean;
|
|
71
|
+
body: BulkRequest;
|
|
72
|
+
}): Promise<any>;
|
|
73
|
+
/**
|
|
74
|
+
* @param {Object} arg - Arg object.
|
|
75
|
+
* @param {string} arg.namespace - Bucket name
|
|
76
|
+
* @param {number} [arg.pageNo] - Page no
|
|
77
|
+
* @summary: Browse Files
|
|
78
|
+
* @description: Browse Files
|
|
79
|
+
*/
|
|
80
|
+
browse({ namespace, pageNo }?: {
|
|
81
|
+
namespace: string;
|
|
82
|
+
pageNo?: number;
|
|
83
|
+
}): Promise<any>;
|
|
84
|
+
/**
|
|
85
|
+
* @param {Object} arg - Arg object.
|
|
86
|
+
* @param {string} arg.namespace - Bucket name
|
|
87
|
+
* @param {number} arg.companyId - Company_id
|
|
88
|
+
* @param {number} arg.applicationId - Application_id
|
|
89
|
+
* @summary: Browse Files
|
|
90
|
+
* @description: Browse Files
|
|
91
|
+
*/
|
|
92
|
+
browsePaginator({ namespace, companyId, applicationId }?: {
|
|
93
|
+
namespace: string;
|
|
94
|
+
companyId: number;
|
|
95
|
+
applicationId: number;
|
|
96
|
+
}): Paginator;
|
|
97
|
+
/**
|
|
98
|
+
* @param data
|
|
99
|
+
* @param {string} file_name
|
|
100
|
+
* @param {string} content_type
|
|
101
|
+
* @param {string} namespace
|
|
102
|
+
* @param {number} size
|
|
103
|
+
* @param {number} tags
|
|
104
|
+
*/
|
|
105
|
+
upload({ data, file_name, content_type, namespace, size, tags, }?: {
|
|
106
|
+
data: any;
|
|
107
|
+
file_name: any;
|
|
108
|
+
content_type: any;
|
|
109
|
+
namespace: any;
|
|
110
|
+
size: any;
|
|
111
|
+
tags: any;
|
|
112
|
+
}): Promise<any>;
|
|
113
|
+
}
|
|
114
|
+
import Paginator = require("../../common/Paginator");
|