@gofynd/fdk-client-javascript 0.1.35
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/.github/workflows/on_create_release.yml +23 -0
- package/.github/workflows/on_merge_main.yml +38 -0
- package/.github/workflows/on_pull_request.yml +35 -0
- package/.prettierrc +5 -0
- package/LICENSE +21 -0
- package/README.md +118 -0
- package/application.d.ts +3 -0
- package/application.js +6 -0
- package/common.d.ts +4 -0
- package/common.js +9 -0
- package/documentation/application/CART.md +7290 -0
- package/documentation/application/CATALOG.md +9570 -0
- package/documentation/application/COMMON.md +448 -0
- package/documentation/application/COMMUNICATION.md +463 -0
- package/documentation/application/CONFIGURATION.md +2902 -0
- package/documentation/application/CONTENT.md +3350 -0
- package/documentation/application/FILESTORAGE.md +491 -0
- package/documentation/application/LEAD.md +1891 -0
- package/documentation/application/LOGISTIC.md +439 -0
- package/documentation/application/ORDER.md +3428 -0
- package/documentation/application/PAYMENT.md +5035 -0
- package/documentation/application/POSCART.md +7889 -0
- package/documentation/application/README.md +21 -0
- package/documentation/application/REWARDS.md +714 -0
- package/documentation/application/SHARE.md +729 -0
- package/documentation/application/THEME.md +5796 -0
- package/documentation/application/USER.md +4326 -0
- package/documentation/platform/ANALYTICS.md +1150 -0
- package/documentation/platform/AUDITTRAIL.md +572 -0
- package/documentation/platform/BILLING.md +2396 -0
- package/documentation/platform/CART.md +5539 -0
- package/documentation/platform/CATALOG.md +21624 -0
- package/documentation/platform/COMMON.md +448 -0
- package/documentation/platform/COMMUNICATION.md +5714 -0
- package/documentation/platform/COMPANYPROFILE.md +2141 -0
- package/documentation/platform/CONFIGURATION.md +7335 -0
- package/documentation/platform/CONTENT.md +8989 -0
- package/documentation/platform/DISCOUNT.md +773 -0
- package/documentation/platform/FILESTORAGE.md +994 -0
- package/documentation/platform/INVENTORY.md +1775 -0
- package/documentation/platform/LEAD.md +4736 -0
- package/documentation/platform/ORDER.md +3764 -0
- package/documentation/platform/PARTNER.md +216 -0
- package/documentation/platform/PAYMENT.md +3444 -0
- package/documentation/platform/README.md +27 -0
- package/documentation/platform/REWARDS.md +871 -0
- package/documentation/platform/SHARE.md +602 -0
- package/documentation/platform/THEME.md +35725 -0
- package/documentation/platform/USER.md +2305 -0
- package/documentation/platform/WEBHOOK.md +587 -0
- package/documentation/public/CONFIGURATION.md +448 -0
- package/documentation/public/INVENTORY.md +686 -0
- package/documentation/public/WEBHOOK.md +348 -0
- package/index.d.ts +10 -0
- package/index.js +18 -0
- package/jest.config.d.ts +4 -0
- package/jest.config.js +6 -0
- package/package.json +35 -0
- package/platform.d.ts +3 -0
- package/platform.js +6 -0
- package/public.d.ts +3 -0
- package/public.js +6 -0
- package/sdk/application/ApplicationAPIClient.d.ts +11 -0
- package/sdk/application/ApplicationAPIClient.js +44 -0
- package/sdk/application/ApplicationClient.d.ts +40 -0
- package/sdk/application/ApplicationClient.js +84 -0
- package/sdk/application/ApplicationConfig.d.ts +19 -0
- package/sdk/application/ApplicationConfig.js +55 -0
- package/sdk/application/ApplicationModels.d.ts +826 -0
- package/sdk/application/ApplicationModels.js +10474 -0
- package/sdk/application/client/CartApplicationClient.d.ts +432 -0
- package/sdk/application/client/CartApplicationClient.js +1066 -0
- package/sdk/application/client/CatalogApplicationClient.d.ts +694 -0
- package/sdk/application/client/CatalogApplicationClient.js +1629 -0
- package/sdk/application/client/CommonApplicationClient.d.ts +38 -0
- package/sdk/application/client/CommonApplicationClient.js +105 -0
- package/sdk/application/client/CommunicationApplicationClient.d.ts +39 -0
- package/sdk/application/client/CommunicationApplicationClient.js +131 -0
- package/sdk/application/client/ConfigurationApplicationClient.d.ts +210 -0
- package/sdk/application/client/ConfigurationApplicationClient.js +649 -0
- package/sdk/application/client/ContentApplicationClient.d.ts +256 -0
- package/sdk/application/client/ContentApplicationClient.js +785 -0
- package/sdk/application/client/FileStorageApplicationClient.d.ts +88 -0
- package/sdk/application/client/FileStorageApplicationClient.js +214 -0
- package/sdk/application/client/LeadApplicationClient.d.ts +90 -0
- package/sdk/application/client/LeadApplicationClient.js +264 -0
- package/sdk/application/client/LogisticApplicationClient.d.ts +42 -0
- package/sdk/application/client/LogisticApplicationClient.js +128 -0
- package/sdk/application/client/OrderApplicationClient.d.ts +190 -0
- package/sdk/application/client/OrderApplicationClient.js +479 -0
- package/sdk/application/client/PaymentApplicationClient.d.ts +454 -0
- package/sdk/application/client/PaymentApplicationClient.js +1378 -0
- package/sdk/application/client/PosCartApplicationClient.d.ts +449 -0
- package/sdk/application/client/PosCartApplicationClient.js +1123 -0
- package/sdk/application/client/RewardsApplicationClient.d.ts +93 -0
- package/sdk/application/client/RewardsApplicationClient.js +293 -0
- package/sdk/application/client/ShareApplicationClient.d.ts +87 -0
- package/sdk/application/client/ShareApplicationClient.js +268 -0
- package/sdk/application/client/ThemeApplicationClient.d.ts +52 -0
- package/sdk/application/client/ThemeApplicationClient.js +161 -0
- package/sdk/application/client/UserApplicationClient.d.ts +446 -0
- package/sdk/application/client/UserApplicationClient.js +1275 -0
- package/sdk/application/constructUrl.d.ts +5 -0
- package/sdk/application/constructUrl.js +13 -0
- package/sdk/application/index.d.ts +2 -0
- package/sdk/application/index.js +4 -0
- package/sdk/application/models/CartValidator.d.ts +29 -0
- package/sdk/application/models/CartValidator.js +223 -0
- package/sdk/application/models/CatalogValidator.d.ts +33 -0
- package/sdk/application/models/CatalogValidator.js +233 -0
- package/sdk/application/models/CommonValidator.d.ts +5 -0
- package/sdk/application/models/CommonValidator.js +18 -0
- package/sdk/application/models/CommunicationValidator.d.ts +6 -0
- package/sdk/application/models/CommunicationValidator.js +20 -0
- package/sdk/application/models/ConfigurationValidator.d.ts +19 -0
- package/sdk/application/models/ConfigurationValidator.js +88 -0
- package/sdk/application/models/ContentValidator.d.ts +22 -0
- package/sdk/application/models/ContentValidator.js +106 -0
- package/sdk/application/models/FileStorageValidator.d.ts +6 -0
- package/sdk/application/models/FileStorageValidator.js +24 -0
- package/sdk/application/models/LeadValidator.d.ts +10 -0
- package/sdk/application/models/LeadValidator.js +48 -0
- package/sdk/application/models/LogisticValidator.d.ts +6 -0
- package/sdk/application/models/LogisticValidator.js +22 -0
- package/sdk/application/models/OrderValidator.d.ts +15 -0
- package/sdk/application/models/OrderValidator.js +87 -0
- package/sdk/application/models/PaymentValidator.d.ts +40 -0
- package/sdk/application/models/PaymentValidator.js +235 -0
- package/sdk/application/models/PosCartValidator.d.ts +30 -0
- package/sdk/application/models/PosCartValidator.js +232 -0
- package/sdk/application/models/RewardsValidator.d.ts +10 -0
- package/sdk/application/models/RewardsValidator.js +43 -0
- package/sdk/application/models/ShareValidator.d.ts +10 -0
- package/sdk/application/models/ShareValidator.js +44 -0
- package/sdk/application/models/ThemeValidator.d.ts +7 -0
- package/sdk/application/models/ThemeValidator.js +27 -0
- package/sdk/application/models/UserValidator.d.ts +38 -0
- package/sdk/application/models/UserValidator.js +233 -0
- package/sdk/common/AxiosHelper.d.ts +1 -0
- package/sdk/common/AxiosHelper.js +141 -0
- package/sdk/common/Constant.d.ts +294 -0
- package/sdk/common/Constant.js +332 -0
- package/sdk/common/FDKError.d.ts +26 -0
- package/sdk/common/FDKError.js +51 -0
- package/sdk/common/Logger.d.ts +2 -0
- package/sdk/common/Logger.js +85 -0
- package/sdk/common/Paginator.d.ts +16 -0
- package/sdk/common/Paginator.js +26 -0
- package/sdk/common/RequestSigner.d.ts +1 -0
- package/sdk/common/RequestSigner.js +306 -0
- package/sdk/common/Utility.d.ts +9 -0
- package/sdk/common/Utility.js +86 -0
- package/sdk/common/utils.d.ts +14 -0
- package/sdk/common/utils.js +165 -0
- package/sdk/platform/OAuthClient.d.ts +26 -0
- package/sdk/platform/OAuthClient.js +221 -0
- package/sdk/platform/PlatformAPIClient.d.ts +12 -0
- package/sdk/platform/PlatformAPIClient.js +43 -0
- package/sdk/platform/PlatformApplicationClient.d.ts +24398 -0
- package/sdk/platform/PlatformApplicationClient.js +23185 -0
- package/sdk/platform/PlatformApplicationModels.d.ts +333 -0
- package/sdk/platform/PlatformApplicationModels.js +21262 -0
- package/sdk/platform/PlatformClient.d.ts +9535 -0
- package/sdk/platform/PlatformClient.js +12336 -0
- package/sdk/platform/PlatformConfig.d.ts +29 -0
- package/sdk/platform/PlatformConfig.js +36 -0
- package/sdk/platform/PlatformModels.d.ts +1396 -0
- package/sdk/platform/PlatformModels.js +19222 -0
- package/sdk/platform/client/AnalyticsPlatformClient.d.ts +84 -0
- package/sdk/platform/client/AnalyticsPlatformClient.js +215 -0
- package/sdk/platform/client/AuditTrailPlatformClient.d.ts +38 -0
- package/sdk/platform/client/AuditTrailPlatformClient.js +133 -0
- package/sdk/platform/client/BillingPlatformClient.d.ts +109 -0
- package/sdk/platform/client/BillingPlatformClient.js +381 -0
- package/sdk/platform/client/CatalogPlatformClient.d.ts +806 -0
- package/sdk/platform/client/CatalogPlatformClient.js +2462 -0
- package/sdk/platform/client/CommonPlatformClient.d.ts +30 -0
- package/sdk/platform/client/CommonPlatformClient.js +84 -0
- package/sdk/platform/client/CommunicationPlatformClient.d.ts +26 -0
- package/sdk/platform/client/CommunicationPlatformClient.js +72 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.d.ts +182 -0
- package/sdk/platform/client/CompanyProfilePlatformClient.js +540 -0
- package/sdk/platform/client/ConfigurationPlatformClient.d.ts +277 -0
- package/sdk/platform/client/ConfigurationPlatformClient.js +806 -0
- package/sdk/platform/client/DiscountPlatformClient.d.ts +118 -0
- package/sdk/platform/client/DiscountPlatformClient.js +364 -0
- package/sdk/platform/client/FileStoragePlatformClient.d.ts +111 -0
- package/sdk/platform/client/FileStoragePlatformClient.js +268 -0
- package/sdk/platform/client/InventoryPlatformClient.d.ts +125 -0
- package/sdk/platform/client/InventoryPlatformClient.js +409 -0
- package/sdk/platform/client/LeadPlatformClient.d.ts +150 -0
- package/sdk/platform/client/LeadPlatformClient.js +439 -0
- package/sdk/platform/client/OrderPlatformClient.d.ts +190 -0
- package/sdk/platform/client/OrderPlatformClient.js +521 -0
- package/sdk/platform/client/PaymentPlatformClient.d.ts +98 -0
- package/sdk/platform/client/PaymentPlatformClient.js +331 -0
- package/sdk/platform/client/WebhookPlatformClient.d.ts +64 -0
- package/sdk/platform/client/WebhookPlatformClient.js +207 -0
- package/sdk/platform/index.d.ts +2 -0
- package/sdk/platform/index.js +4 -0
- package/sdk/platform/models/AnalyticsValidator.d.ts +7 -0
- package/sdk/platform/models/AnalyticsValidator.js +36 -0
- package/sdk/platform/models/AuditTrailValidator.d.ts +7 -0
- package/sdk/platform/models/AuditTrailValidator.js +26 -0
- package/sdk/platform/models/BillingValidator.d.ts +15 -0
- package/sdk/platform/models/BillingValidator.js +72 -0
- package/sdk/platform/models/CartValidator.d.ts +0 -0
- package/sdk/platform/models/CartValidator.js +0 -0
- package/sdk/platform/models/CatalogValidator.d.ts +74 -0
- package/sdk/platform/models/CatalogValidator.js +484 -0
- package/sdk/platform/models/CommonValidator.d.ts +5 -0
- package/sdk/platform/models/CommonValidator.js +18 -0
- package/sdk/platform/models/CommunicationValidator.d.ts +4 -0
- package/sdk/platform/models/CommunicationValidator.js +11 -0
- package/sdk/platform/models/CompanyProfileValidator.d.ts +17 -0
- package/sdk/platform/models/CompanyProfileValidator.js +93 -0
- package/sdk/platform/models/ConfigurationValidator.d.ts +21 -0
- package/sdk/platform/models/ConfigurationValidator.js +134 -0
- package/sdk/platform/models/ContentValidator.d.ts +0 -0
- package/sdk/platform/models/ContentValidator.js +0 -0
- package/sdk/platform/models/DiscountValidator.d.ts +13 -0
- package/sdk/platform/models/DiscountValidator.js +75 -0
- package/sdk/platform/models/FileStorageValidator.d.ts +9 -0
- package/sdk/platform/models/FileStorageValidator.js +44 -0
- package/sdk/platform/models/InventoryValidator.d.ts +15 -0
- package/sdk/platform/models/InventoryValidator.js +81 -0
- package/sdk/platform/models/LeadValidator.d.ts +14 -0
- package/sdk/platform/models/LeadValidator.js +78 -0
- package/sdk/platform/models/OrderValidator.d.ts +14 -0
- package/sdk/platform/models/OrderValidator.js +110 -0
- package/sdk/platform/models/PartnerValidator.d.ts +0 -0
- package/sdk/platform/models/PartnerValidator.js +0 -0
- package/sdk/platform/models/PaymentValidator.d.ts +13 -0
- package/sdk/platform/models/PaymentValidator.js +65 -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/platform/models/WebhookValidator.d.ts +9 -0
- package/sdk/platform/models/WebhookValidator.js +42 -0
- package/sdk/public/PublicAPIClient.d.ts +11 -0
- package/sdk/public/PublicAPIClient.js +38 -0
- package/sdk/public/PublicClient.d.ts +12 -0
- package/sdk/public/PublicClient.js +24 -0
- package/sdk/public/PublicConfig.d.ts +10 -0
- package/sdk/public/PublicConfig.js +12 -0
- package/sdk/public/PublicModels.d.ts +50 -0
- package/sdk/public/PublicModels.js +712 -0
- package/sdk/public/client/ConfigurationPublicClient.d.ts +38 -0
- package/sdk/public/client/ConfigurationPublicClient.js +102 -0
- package/sdk/public/client/InventoryPublicClient.d.ts +81 -0
- package/sdk/public/client/InventoryPublicClient.js +239 -0
- package/sdk/public/client/WebhookPublicClient.d.ts +28 -0
- package/sdk/public/client/WebhookPublicClient.js +92 -0
- package/sdk/public/constructUrl.d.ts +5 -0
- package/sdk/public/constructUrl.js +13 -0
- package/sdk/public/index.d.ts +2 -0
- package/sdk/public/index.js +4 -0
- package/sdk/public/models/ConfigurationValidator.d.ts +5 -0
- package/sdk/public/models/ConfigurationValidator.js +18 -0
- package/sdk/public/models/InventoryValidator.d.ts +9 -0
- package/sdk/public/models/InventoryValidator.js +43 -0
- package/sdk/public/models/WebhookValidator.d.ts +5 -0
- package/sdk/public/models/WebhookValidator.js +14 -0
- package/tests/application/catalog.spec.js +47 -0
- package/tests/common/action-url.spec.js +35 -0
- package/tests/common/schema/action-url.json +163 -0
- package/tests/common/schema/url-action.json +667 -0
- package/tests/common/url-action.spec.js +48 -0
- package/tests/helpers/cookie.helper.js +31 -0
- package/tests/helpers/oauth.helper.js +43 -0
- package/tests/platform/catalog.spec.js +49 -0
- package/tests/public/location.spec.js +39 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
export = Discount;
|
|
2
|
+
declare class Discount {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} [arg.view] - Listing or calender. Default is listing.
|
|
8
|
+
* @param {string} [arg.q] - The search query. This can be a partial or
|
|
9
|
+
* complete name of a discount.
|
|
10
|
+
* @param {number} [arg.pageNo] - Page number. Default is 1.
|
|
11
|
+
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
12
|
+
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
13
|
+
* @param {number} [arg.month] - Month. Default is current month.
|
|
14
|
+
* @param {number} [arg.year] - Year. Default is current year.
|
|
15
|
+
* @param {string} [arg.type] - Basic or custom.
|
|
16
|
+
* @param {string[]} [arg.appIds] - Application ids.
|
|
17
|
+
* @summary: Fetch discount list.
|
|
18
|
+
* @description: Fetch discount list.
|
|
19
|
+
*/
|
|
20
|
+
getDiscounts({ view, q, pageNo, pageSize, archived, month, year, type, appIds, }?: {
|
|
21
|
+
view?: string;
|
|
22
|
+
q?: string;
|
|
23
|
+
pageNo?: number;
|
|
24
|
+
pageSize?: number;
|
|
25
|
+
archived?: boolean;
|
|
26
|
+
month?: number;
|
|
27
|
+
year?: number;
|
|
28
|
+
type?: string;
|
|
29
|
+
appIds?: string[];
|
|
30
|
+
}): Promise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* @param {Object} arg - Arg object.
|
|
33
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
34
|
+
* @summary: Create Discount.
|
|
35
|
+
* @description: Create Discount.
|
|
36
|
+
*/
|
|
37
|
+
createDiscount({ body }?: {
|
|
38
|
+
body: any;
|
|
39
|
+
}): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* @param {Object} arg - Arg object.
|
|
42
|
+
* @param {string} arg.id - Unique id.
|
|
43
|
+
* @summary: Fetch discount.
|
|
44
|
+
* @description: Fetch discount.
|
|
45
|
+
*/
|
|
46
|
+
getDiscount({ id }?: {
|
|
47
|
+
id: string;
|
|
48
|
+
}): Promise<any>;
|
|
49
|
+
/**
|
|
50
|
+
* @param {Object} arg - Arg object.
|
|
51
|
+
* @param {string} arg.id - Id
|
|
52
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
53
|
+
* @summary: Create Discount.
|
|
54
|
+
* @description: Create Discount.
|
|
55
|
+
*/
|
|
56
|
+
updateDiscount({ id, body }?: {
|
|
57
|
+
id: string;
|
|
58
|
+
body: any;
|
|
59
|
+
}): Promise<any>;
|
|
60
|
+
/**
|
|
61
|
+
* @param {Object} arg - Arg object.
|
|
62
|
+
* @param {string} [arg.discount] - Discount
|
|
63
|
+
* @param {DiscountJob} arg.body
|
|
64
|
+
* @summary: Validate File.
|
|
65
|
+
* @description: Validate File.
|
|
66
|
+
*/
|
|
67
|
+
validateDiscountFile({ body, discount }?: {
|
|
68
|
+
discount?: string;
|
|
69
|
+
body: any;
|
|
70
|
+
}): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* @param {Object} arg - Arg object.
|
|
73
|
+
* @param {string} arg.type - Type
|
|
74
|
+
* @param {DownloadFileJob} arg.body
|
|
75
|
+
* @summary: Validate File.
|
|
76
|
+
* @description: Validate File.
|
|
77
|
+
*/
|
|
78
|
+
downloadDiscountFile({ type, body }?: {
|
|
79
|
+
type: string;
|
|
80
|
+
body: any;
|
|
81
|
+
}): Promise<any>;
|
|
82
|
+
/**
|
|
83
|
+
* @param {Object} arg - Arg object.
|
|
84
|
+
* @param {string} arg.id - Id
|
|
85
|
+
* @summary: Validate File Job.
|
|
86
|
+
* @description: Validate File Job.
|
|
87
|
+
*/
|
|
88
|
+
getValidationJob({ id }?: {
|
|
89
|
+
id: string;
|
|
90
|
+
}): Promise<any>;
|
|
91
|
+
/**
|
|
92
|
+
* @param {Object} arg - Arg object.
|
|
93
|
+
* @param {string} arg.id - Id
|
|
94
|
+
* @summary: Cancel Validation Job.
|
|
95
|
+
* @description: Cancel Validation Job.
|
|
96
|
+
*/
|
|
97
|
+
cancelValidationJob({ id }?: {
|
|
98
|
+
id: string;
|
|
99
|
+
}): Promise<any>;
|
|
100
|
+
/**
|
|
101
|
+
* @param {Object} arg - Arg object.
|
|
102
|
+
* @param {string} arg.id - Id
|
|
103
|
+
* @summary: Download File Job.
|
|
104
|
+
* @description: Download File Job.
|
|
105
|
+
*/
|
|
106
|
+
getDownloadJob({ id }?: {
|
|
107
|
+
id: string;
|
|
108
|
+
}): Promise<any>;
|
|
109
|
+
/**
|
|
110
|
+
* @param {Object} arg - Arg object.
|
|
111
|
+
* @param {string} arg.id - Id
|
|
112
|
+
* @summary: Cancel Download Job.
|
|
113
|
+
* @description: Cancel Download Job.
|
|
114
|
+
*/
|
|
115
|
+
cancelDownloadJob({ id }?: {
|
|
116
|
+
id: string;
|
|
117
|
+
}): Promise<any>;
|
|
118
|
+
}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
const Paginator = require("../../common/Paginator");
|
|
2
|
+
const PlatformAPIClient = require("../PlatformAPIClient");
|
|
3
|
+
const { FDKClientValidationError } = require("../../common/FDKError");
|
|
4
|
+
const DiscountValidator = require("../models/DiscountValidator");
|
|
5
|
+
class Discount {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @param {Object} arg - Arg object.
|
|
12
|
+
* @param {string} [arg.view] - Listing or calender. Default is listing.
|
|
13
|
+
* @param {string} [arg.q] - The search query. This can be a partial or
|
|
14
|
+
* complete name of a discount.
|
|
15
|
+
* @param {number} [arg.pageNo] - Page number. Default is 1.
|
|
16
|
+
* @param {number} [arg.pageSize] - Page size. Default is 12.
|
|
17
|
+
* @param {boolean} [arg.archived] - Archived. Default is false.
|
|
18
|
+
* @param {number} [arg.month] - Month. Default is current month.
|
|
19
|
+
* @param {number} [arg.year] - Year. Default is current year.
|
|
20
|
+
* @param {string} [arg.type] - Basic or custom.
|
|
21
|
+
* @param {string[]} [arg.appIds] - Application ids.
|
|
22
|
+
* @summary: Fetch discount list.
|
|
23
|
+
* @description: Fetch discount list.
|
|
24
|
+
*/
|
|
25
|
+
getDiscounts({
|
|
26
|
+
view,
|
|
27
|
+
q,
|
|
28
|
+
pageNo,
|
|
29
|
+
pageSize,
|
|
30
|
+
archived,
|
|
31
|
+
month,
|
|
32
|
+
year,
|
|
33
|
+
type,
|
|
34
|
+
appIds,
|
|
35
|
+
} = {}) {
|
|
36
|
+
const { error } = DiscountValidator.getDiscounts().validate(
|
|
37
|
+
{
|
|
38
|
+
view,
|
|
39
|
+
q,
|
|
40
|
+
pageNo,
|
|
41
|
+
pageSize,
|
|
42
|
+
archived,
|
|
43
|
+
month,
|
|
44
|
+
year,
|
|
45
|
+
type,
|
|
46
|
+
appIds,
|
|
47
|
+
},
|
|
48
|
+
{ abortEarly: false, allowUnknown: true }
|
|
49
|
+
);
|
|
50
|
+
if (error) {
|
|
51
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const query_params = {};
|
|
55
|
+
query_params["view"] = view;
|
|
56
|
+
query_params["q"] = q;
|
|
57
|
+
query_params["page_no"] = pageNo;
|
|
58
|
+
query_params["page_size"] = pageSize;
|
|
59
|
+
query_params["archived"] = archived;
|
|
60
|
+
query_params["month"] = month;
|
|
61
|
+
query_params["year"] = year;
|
|
62
|
+
query_params["type"] = type;
|
|
63
|
+
query_params["app_ids"] = appIds;
|
|
64
|
+
|
|
65
|
+
const xHeaders = {};
|
|
66
|
+
|
|
67
|
+
return PlatformAPIClient.execute(
|
|
68
|
+
this.config,
|
|
69
|
+
"get",
|
|
70
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
71
|
+
query_params,
|
|
72
|
+
undefined,
|
|
73
|
+
xHeaders
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @param {Object} arg - Arg object.
|
|
79
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
80
|
+
* @summary: Create Discount.
|
|
81
|
+
* @description: Create Discount.
|
|
82
|
+
*/
|
|
83
|
+
createDiscount({ body } = {}) {
|
|
84
|
+
const { error } = DiscountValidator.createDiscount().validate(
|
|
85
|
+
{
|
|
86
|
+
body,
|
|
87
|
+
},
|
|
88
|
+
{ abortEarly: false, allowUnknown: true }
|
|
89
|
+
);
|
|
90
|
+
if (error) {
|
|
91
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const query_params = {};
|
|
95
|
+
|
|
96
|
+
const xHeaders = {};
|
|
97
|
+
|
|
98
|
+
return PlatformAPIClient.execute(
|
|
99
|
+
this.config,
|
|
100
|
+
"post",
|
|
101
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/`,
|
|
102
|
+
query_params,
|
|
103
|
+
body,
|
|
104
|
+
xHeaders
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @param {Object} arg - Arg object.
|
|
110
|
+
* @param {string} arg.id - Unique id.
|
|
111
|
+
* @summary: Fetch discount.
|
|
112
|
+
* @description: Fetch discount.
|
|
113
|
+
*/
|
|
114
|
+
getDiscount({ id } = {}) {
|
|
115
|
+
const { error } = DiscountValidator.getDiscount().validate(
|
|
116
|
+
{
|
|
117
|
+
id,
|
|
118
|
+
},
|
|
119
|
+
{ abortEarly: false, allowUnknown: true }
|
|
120
|
+
);
|
|
121
|
+
if (error) {
|
|
122
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const query_params = {};
|
|
126
|
+
|
|
127
|
+
const xHeaders = {};
|
|
128
|
+
|
|
129
|
+
return PlatformAPIClient.execute(
|
|
130
|
+
this.config,
|
|
131
|
+
"get",
|
|
132
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
133
|
+
query_params,
|
|
134
|
+
undefined,
|
|
135
|
+
xHeaders
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* @param {Object} arg - Arg object.
|
|
141
|
+
* @param {string} arg.id - Id
|
|
142
|
+
* @param {CreateUpdateDiscount} arg.body
|
|
143
|
+
* @summary: Create Discount.
|
|
144
|
+
* @description: Create Discount.
|
|
145
|
+
*/
|
|
146
|
+
updateDiscount({ id, body } = {}) {
|
|
147
|
+
const { error } = DiscountValidator.updateDiscount().validate(
|
|
148
|
+
{
|
|
149
|
+
id,
|
|
150
|
+
body,
|
|
151
|
+
},
|
|
152
|
+
{ abortEarly: false, allowUnknown: true }
|
|
153
|
+
);
|
|
154
|
+
if (error) {
|
|
155
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const query_params = {};
|
|
159
|
+
|
|
160
|
+
const xHeaders = {};
|
|
161
|
+
|
|
162
|
+
return PlatformAPIClient.execute(
|
|
163
|
+
this.config,
|
|
164
|
+
"put",
|
|
165
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/job/${id}/`,
|
|
166
|
+
query_params,
|
|
167
|
+
body,
|
|
168
|
+
xHeaders
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @param {Object} arg - Arg object.
|
|
174
|
+
* @param {string} [arg.discount] - Discount
|
|
175
|
+
* @param {DiscountJob} arg.body
|
|
176
|
+
* @summary: Validate File.
|
|
177
|
+
* @description: Validate File.
|
|
178
|
+
*/
|
|
179
|
+
validateDiscountFile({ body, discount } = {}) {
|
|
180
|
+
const { error } = DiscountValidator.validateDiscountFile().validate(
|
|
181
|
+
{
|
|
182
|
+
body,
|
|
183
|
+
discount,
|
|
184
|
+
},
|
|
185
|
+
{ abortEarly: false, allowUnknown: true }
|
|
186
|
+
);
|
|
187
|
+
if (error) {
|
|
188
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const query_params = {};
|
|
192
|
+
query_params["discount"] = discount;
|
|
193
|
+
|
|
194
|
+
const xHeaders = {};
|
|
195
|
+
|
|
196
|
+
return PlatformAPIClient.execute(
|
|
197
|
+
this.config,
|
|
198
|
+
"post",
|
|
199
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/`,
|
|
200
|
+
query_params,
|
|
201
|
+
body,
|
|
202
|
+
xHeaders
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @param {Object} arg - Arg object.
|
|
208
|
+
* @param {string} arg.type - Type
|
|
209
|
+
* @param {DownloadFileJob} arg.body
|
|
210
|
+
* @summary: Validate File.
|
|
211
|
+
* @description: Validate File.
|
|
212
|
+
*/
|
|
213
|
+
downloadDiscountFile({ type, body } = {}) {
|
|
214
|
+
const { error } = DiscountValidator.downloadDiscountFile().validate(
|
|
215
|
+
{
|
|
216
|
+
type,
|
|
217
|
+
body,
|
|
218
|
+
},
|
|
219
|
+
{ abortEarly: false, allowUnknown: true }
|
|
220
|
+
);
|
|
221
|
+
if (error) {
|
|
222
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
const query_params = {};
|
|
226
|
+
|
|
227
|
+
const xHeaders = {};
|
|
228
|
+
|
|
229
|
+
return PlatformAPIClient.execute(
|
|
230
|
+
this.config,
|
|
231
|
+
"post",
|
|
232
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/${type}/download/`,
|
|
233
|
+
query_params,
|
|
234
|
+
body,
|
|
235
|
+
xHeaders
|
|
236
|
+
);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @param {Object} arg - Arg object.
|
|
241
|
+
* @param {string} arg.id - Id
|
|
242
|
+
* @summary: Validate File Job.
|
|
243
|
+
* @description: Validate File Job.
|
|
244
|
+
*/
|
|
245
|
+
getValidationJob({ id } = {}) {
|
|
246
|
+
const { error } = DiscountValidator.getValidationJob().validate(
|
|
247
|
+
{
|
|
248
|
+
id,
|
|
249
|
+
},
|
|
250
|
+
{ abortEarly: false, allowUnknown: true }
|
|
251
|
+
);
|
|
252
|
+
if (error) {
|
|
253
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
const query_params = {};
|
|
257
|
+
|
|
258
|
+
const xHeaders = {};
|
|
259
|
+
|
|
260
|
+
return PlatformAPIClient.execute(
|
|
261
|
+
this.config,
|
|
262
|
+
"get",
|
|
263
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
|
|
264
|
+
query_params,
|
|
265
|
+
undefined,
|
|
266
|
+
xHeaders
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {Object} arg - Arg object.
|
|
272
|
+
* @param {string} arg.id - Id
|
|
273
|
+
* @summary: Cancel Validation Job.
|
|
274
|
+
* @description: Cancel Validation Job.
|
|
275
|
+
*/
|
|
276
|
+
cancelValidationJob({ id } = {}) {
|
|
277
|
+
const { error } = DiscountValidator.cancelValidationJob().validate(
|
|
278
|
+
{
|
|
279
|
+
id,
|
|
280
|
+
},
|
|
281
|
+
{ abortEarly: false, allowUnknown: true }
|
|
282
|
+
);
|
|
283
|
+
if (error) {
|
|
284
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
const query_params = {};
|
|
288
|
+
|
|
289
|
+
const xHeaders = {};
|
|
290
|
+
|
|
291
|
+
return PlatformAPIClient.execute(
|
|
292
|
+
this.config,
|
|
293
|
+
"delete",
|
|
294
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/validation/${id}/`,
|
|
295
|
+
query_params,
|
|
296
|
+
undefined,
|
|
297
|
+
xHeaders
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @param {Object} arg - Arg object.
|
|
303
|
+
* @param {string} arg.id - Id
|
|
304
|
+
* @summary: Download File Job.
|
|
305
|
+
* @description: Download File Job.
|
|
306
|
+
*/
|
|
307
|
+
getDownloadJob({ id } = {}) {
|
|
308
|
+
const { error } = DiscountValidator.getDownloadJob().validate(
|
|
309
|
+
{
|
|
310
|
+
id,
|
|
311
|
+
},
|
|
312
|
+
{ abortEarly: false, allowUnknown: true }
|
|
313
|
+
);
|
|
314
|
+
if (error) {
|
|
315
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
const query_params = {};
|
|
319
|
+
|
|
320
|
+
const xHeaders = {};
|
|
321
|
+
|
|
322
|
+
return PlatformAPIClient.execute(
|
|
323
|
+
this.config,
|
|
324
|
+
"get",
|
|
325
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
326
|
+
query_params,
|
|
327
|
+
undefined,
|
|
328
|
+
xHeaders
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* @param {Object} arg - Arg object.
|
|
334
|
+
* @param {string} arg.id - Id
|
|
335
|
+
* @summary: Cancel Download Job.
|
|
336
|
+
* @description: Cancel Download Job.
|
|
337
|
+
*/
|
|
338
|
+
cancelDownloadJob({ id } = {}) {
|
|
339
|
+
const { error } = DiscountValidator.cancelDownloadJob().validate(
|
|
340
|
+
{
|
|
341
|
+
id,
|
|
342
|
+
},
|
|
343
|
+
{ abortEarly: false, allowUnknown: true }
|
|
344
|
+
);
|
|
345
|
+
if (error) {
|
|
346
|
+
return Promise.reject(new FDKClientValidationError(error));
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const query_params = {};
|
|
350
|
+
|
|
351
|
+
const xHeaders = {};
|
|
352
|
+
|
|
353
|
+
return PlatformAPIClient.execute(
|
|
354
|
+
this.config,
|
|
355
|
+
"delete",
|
|
356
|
+
`/service/platform/discount/v1.0/company/${this.config.companyId}/file/download/${id}/`,
|
|
357
|
+
query_params,
|
|
358
|
+
undefined,
|
|
359
|
+
xHeaders
|
|
360
|
+
);
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
module.exports = Discount;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export = FileStorage;
|
|
2
|
+
declare class FileStorage {
|
|
3
|
+
constructor(config: any);
|
|
4
|
+
config: any;
|
|
5
|
+
/**
|
|
6
|
+
* @param {Object} arg - Arg object.
|
|
7
|
+
* @param {string} arg.namespace - Bucket name
|
|
8
|
+
* @param {StartRequest} arg.body
|
|
9
|
+
* @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.
|
|
10
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
11
|
+
*
|
|
12
|
+
* It has three Major Steps:
|
|
13
|
+
* Start
|
|
14
|
+
* Upload
|
|
15
|
+
* Complete
|
|
16
|
+
*
|
|
17
|
+
* ### Start
|
|
18
|
+
* Initiates the assets upload using `startUpload`.
|
|
19
|
+
* It returns the storage link in response.
|
|
20
|
+
*
|
|
21
|
+
* ### Upload
|
|
22
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
23
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
24
|
+
*
|
|
25
|
+
* ### Complete
|
|
26
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
27
|
+
* This operation will return the url for the uploaded file.
|
|
28
|
+
*/
|
|
29
|
+
startUpload({ namespace, body }?: {
|
|
30
|
+
namespace: string;
|
|
31
|
+
body: any;
|
|
32
|
+
}): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* @param {Object} arg - Arg object.
|
|
35
|
+
* @param {string} arg.namespace - Bucket name
|
|
36
|
+
* @param {StartResponse} arg.body
|
|
37
|
+
* @summary: This will complete the upload process. After successfully uploading file, you can call this operation to complete the upload process.
|
|
38
|
+
* @description: Uploads an arbitrarily sized buffer or blob.
|
|
39
|
+
*
|
|
40
|
+
* It has three Major Steps:
|
|
41
|
+
* Start
|
|
42
|
+
* Upload
|
|
43
|
+
* Complete
|
|
44
|
+
*
|
|
45
|
+
* ### Start
|
|
46
|
+
* Initiates the assets upload using `startUpload`.
|
|
47
|
+
* It returns the storage link in response.
|
|
48
|
+
*
|
|
49
|
+
* ### Upload
|
|
50
|
+
* Use the storage link to upload a file (Buffer or Blob) to the File Storage.
|
|
51
|
+
* Make a `PUT` request on storage link received from `startUpload` api with file (Buffer or Blob) as a request body.
|
|
52
|
+
*
|
|
53
|
+
* ### Complete
|
|
54
|
+
* After successfully upload, call `completeUpload` api to complete the upload process.
|
|
55
|
+
* This operation will return the url for the uploaded file.
|
|
56
|
+
*/
|
|
57
|
+
completeUpload({ namespace, body }?: {
|
|
58
|
+
namespace: string;
|
|
59
|
+
body: any;
|
|
60
|
+
}): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* @param {Object} arg - Arg object.
|
|
63
|
+
* @param {SignUrlRequest} arg.body
|
|
64
|
+
* @summary: Gives signed urls to access private files
|
|
65
|
+
* @description: Describe here
|
|
66
|
+
*/
|
|
67
|
+
getSignUrls({ body }?: {
|
|
68
|
+
body: any;
|
|
69
|
+
}): Promise<any>;
|
|
70
|
+
/**
|
|
71
|
+
* @param {Object} arg - Arg object.
|
|
72
|
+
* @param {boolean} [arg.sync] - Sync
|
|
73
|
+
* @param {BulkRequest} arg.body
|
|
74
|
+
* @summary: Copy Files
|
|
75
|
+
* @description: Copy Files
|
|
76
|
+
*/
|
|
77
|
+
copyFiles({ body, sync }?: {
|
|
78
|
+
sync?: boolean;
|
|
79
|
+
body: any;
|
|
80
|
+
}): Promise<any>;
|
|
81
|
+
/**
|
|
82
|
+
* @param {Object} arg - Arg object.
|
|
83
|
+
* @param {string} arg.namespace - Bucket name
|
|
84
|
+
* @param {number} [arg.pageNo] - Page no
|
|
85
|
+
* @summary: Browse Files
|
|
86
|
+
* @description: Browse Files
|
|
87
|
+
*/
|
|
88
|
+
browse({ namespace, pageNo }?: {
|
|
89
|
+
namespace: string;
|
|
90
|
+
pageNo?: number;
|
|
91
|
+
}): Promise<any>;
|
|
92
|
+
/**
|
|
93
|
+
* @param {Object} arg - Arg object.
|
|
94
|
+
* @param {string} arg.namespace - Bucket name
|
|
95
|
+
* @summary: Browse Files
|
|
96
|
+
* @description: Browse Files
|
|
97
|
+
*/
|
|
98
|
+
browsePaginator({ namespace }?: {
|
|
99
|
+
namespace: string;
|
|
100
|
+
}): Paginator;
|
|
101
|
+
/**
|
|
102
|
+
* @param {Object} arg - Arg object.
|
|
103
|
+
* @param {string} arg.url - Url
|
|
104
|
+
* @summary: Proxy
|
|
105
|
+
* @description: Proxy
|
|
106
|
+
*/
|
|
107
|
+
proxy({ url }?: {
|
|
108
|
+
url: string;
|
|
109
|
+
}): Promise<any>;
|
|
110
|
+
}
|
|
111
|
+
import Paginator = require("../../common/Paginator");
|