@voucherify/sdk 2.9.2 → 2.9.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/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,131 +1,170 @@
|
|
|
1
|
-
import { AsyncActions } from './AsyncActions';
|
|
2
|
-
import { Campaigns } from './Campaigns';
|
|
3
|
-
import { Distributions } from './Distributions';
|
|
4
|
-
import { Events } from './Events';
|
|
5
|
-
import { Vouchers } from './Vouchers';
|
|
6
|
-
import { Validations } from './Validations';
|
|
7
|
-
import { Redemptions } from './Redemptions';
|
|
8
|
-
import { Promotions } from './Promotions';
|
|
9
|
-
import { Customers } from './Customers';
|
|
10
|
-
import { Consents } from './Consents';
|
|
11
|
-
import { Orders } from './Orders';
|
|
12
|
-
import { Products } from './Products';
|
|
13
|
-
import { Rewards } from './Rewards';
|
|
14
|
-
import { Loyalties } from './Loyalties';
|
|
15
|
-
import { ValidationRules } from './ValidationRules';
|
|
16
|
-
import { Segments } from './Segments';
|
|
17
|
-
import { ApiLimitsHandler } from './ApiLimitsHandler';
|
|
18
|
-
import { MetadataSchemas } from './MetadataSchemas';
|
|
19
|
-
import { Categories } from './Categories';
|
|
20
|
-
import { ProductCollections } from './ProductCollections';
|
|
21
|
-
import { Qualifications } from './Qualifications';
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* })
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* ```javascript
|
|
87
|
-
* const voucherify = VoucherifyServerSide({
|
|
88
|
-
* applicationId: 'YOUR-APPLICATION-ID',
|
|
89
|
-
* secretKey: 'YOUR-SECRET-KEY'
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
*
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
1
|
+
import { AsyncActions } from './AsyncActions.js';
|
|
2
|
+
import { Campaigns } from './Campaigns.js';
|
|
3
|
+
import { Distributions } from './Distributions.js';
|
|
4
|
+
import { Events } from './Events.js';
|
|
5
|
+
import { Vouchers } from './Vouchers.js';
|
|
6
|
+
import { Validations } from './Validations.js';
|
|
7
|
+
import { Redemptions } from './Redemptions.js';
|
|
8
|
+
import { Promotions } from './Promotions.js';
|
|
9
|
+
import { Customers } from './Customers.js';
|
|
10
|
+
import { Consents } from './Consents.js';
|
|
11
|
+
import { Orders } from './Orders.js';
|
|
12
|
+
import { Products } from './Products.js';
|
|
13
|
+
import { Rewards } from './Rewards.js';
|
|
14
|
+
import { Loyalties } from './Loyalties.js';
|
|
15
|
+
import { ValidationRules } from './ValidationRules.js';
|
|
16
|
+
import { Segments } from './Segments.js';
|
|
17
|
+
import { ApiLimitsHandler } from './ApiLimitsHandler.js';
|
|
18
|
+
import { MetadataSchemas } from './MetadataSchemas.js';
|
|
19
|
+
import { Categories } from './Categories.js';
|
|
20
|
+
import { ProductCollections } from './ProductCollections.js';
|
|
21
|
+
import { Qualifications } from './Qualifications.js';
|
|
22
|
+
import './types/AsyncActions.js';
|
|
23
|
+
import './RequestController.js';
|
|
24
|
+
import './types/Campaigns.js';
|
|
25
|
+
import './types/Vouchers.js';
|
|
26
|
+
import './types/Orders.js';
|
|
27
|
+
import './types/Customers.js';
|
|
28
|
+
import './types/DiscountVoucher.js';
|
|
29
|
+
import './types/ValidationRules.js';
|
|
30
|
+
import './types/ApplicableTo.js';
|
|
31
|
+
import './types/Distributions.js';
|
|
32
|
+
import './Exports.js';
|
|
33
|
+
import './types/Exports.js';
|
|
34
|
+
import './types/Events.js';
|
|
35
|
+
import './Balance.js';
|
|
36
|
+
import './types/Balance.js';
|
|
37
|
+
import './types/Validations.js';
|
|
38
|
+
import './types/Stackable.js';
|
|
39
|
+
import './types/Rewards.js';
|
|
40
|
+
import './types/Gift.js';
|
|
41
|
+
import './types/Products.js';
|
|
42
|
+
import './types/Loyalties.js';
|
|
43
|
+
import './types/Categories.js';
|
|
44
|
+
import './types/ValidationError.js';
|
|
45
|
+
import './types/ValidateSession.js';
|
|
46
|
+
import './types/Promotions.js';
|
|
47
|
+
import './types/PromotionTiers.js';
|
|
48
|
+
import './types/Redemptions.js';
|
|
49
|
+
import './PromotionTiers.js';
|
|
50
|
+
import './PromotionsStacks.js';
|
|
51
|
+
import './types/PromotionsStacks.js';
|
|
52
|
+
import './types/Consents.js';
|
|
53
|
+
import './types/Segments.js';
|
|
54
|
+
import './types/MetadataSchemas.js';
|
|
55
|
+
import './types/ProductCollections.js';
|
|
56
|
+
import './types/UtilityTypes.js';
|
|
57
|
+
import './types/Qualifications.js';
|
|
58
|
+
|
|
59
|
+
interface VoucherifyServerSideOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Optionally, you can add `apiUrl` to the client options if you want to use Voucherify running in a specific region.
|
|
62
|
+
*
|
|
63
|
+
* ```javascript
|
|
64
|
+
* const voucherify = VoucherifyServerSide({
|
|
65
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
66
|
+
* secretKey: 'YOUR-SECRET-KEY',
|
|
67
|
+
* apiUrl: 'https://<region>.api.voucherify.io'
|
|
68
|
+
* })
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
apiUrl?: string;
|
|
72
|
+
/**
|
|
73
|
+
* [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
|
|
74
|
+
*
|
|
75
|
+
* ```javascript
|
|
76
|
+
* const voucherify = VoucherifyServerSide({
|
|
77
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
78
|
+
* secretKey: 'YOUR-SECRET-KEY'
|
|
79
|
+
* })
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
applicationId: string;
|
|
83
|
+
/**
|
|
84
|
+
* [Log-in](https://app.voucherify.io/#/login) to Voucherify web interface and obtain your `Application Keys` from [Configuration](https://app.voucherify.io/#/app/core/projects/current/general):
|
|
85
|
+
*
|
|
86
|
+
* ```javascript
|
|
87
|
+
* const voucherify = VoucherifyServerSide({
|
|
88
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
89
|
+
* secretKey: 'YOUR-SECRET-KEY'
|
|
90
|
+
* })
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
secretKey: string;
|
|
94
|
+
/**
|
|
95
|
+
* Optionally, you can add `apiVersion` to the client options if you want to use a [specific API version](https://docs.voucherify.io/docs/api-version-upgrades).
|
|
96
|
+
*
|
|
97
|
+
* ```javascript
|
|
98
|
+
* const voucherify = VoucherifyServerSide({
|
|
99
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
100
|
+
* secretKey: 'YOUR-SECRET-KEY',
|
|
101
|
+
* apiVersion: 'v2017-04-20'
|
|
102
|
+
* })
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
apiVersion?: string;
|
|
106
|
+
channel?: string;
|
|
107
|
+
/**
|
|
108
|
+
* Set this option to disable displaying the warning about exposing your `secretKey` if you're using VoucherifyServerSide in a browser environment.
|
|
109
|
+
* By setting this option to `true`, you acknowledge that you understand the risks of exposing your `secretKey` to a browser environment.
|
|
110
|
+
*
|
|
111
|
+
* ```javascript
|
|
112
|
+
* const voucherify = VoucherifyServerSide({
|
|
113
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
114
|
+
* secretKey: 'YOUR-SECRET-KEY',
|
|
115
|
+
* dangerouslySetSecretKeyInBrowser: true
|
|
116
|
+
* })
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
dangerouslySetSecretKeyInBrowser?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* You can pass additional headers to requests made by the API Client.
|
|
122
|
+
* It can prove to be useful when debugging various scenarios.
|
|
123
|
+
* ```javascript
|
|
124
|
+
* const voucherify = VoucherifyServerSide({
|
|
125
|
+
* applicationId: 'YOUR-APPLICATION-ID',
|
|
126
|
+
* secretKey: 'YOUR-SECRET-KEY',
|
|
127
|
+
* customHeaders: {
|
|
128
|
+
* "DEBUG-HEADER": "my_value",
|
|
129
|
+
* "TEST-HEADER": "another_value"
|
|
130
|
+
* }
|
|
131
|
+
* })
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
customHeaders?: Record<string, string>;
|
|
135
|
+
/**
|
|
136
|
+
* If you wish to include original Axios error in VoucherifyError instance set this to true
|
|
137
|
+
* It can prove to be useful when debugging various scenarios.
|
|
138
|
+
* The original Axios error will be included in cause property of VoucherifyError
|
|
139
|
+
*/
|
|
140
|
+
exposeErrorCause?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Optionally, you can set timeout in miliseconds. After this time request will be aborted. By default Voucherify's API has timeout value of 3 minutes.
|
|
143
|
+
*/
|
|
144
|
+
timeoutMs?: number;
|
|
145
|
+
}
|
|
146
|
+
declare function VoucherifyServerSide(options: VoucherifyServerSideOptions): {
|
|
147
|
+
vouchers: Vouchers;
|
|
148
|
+
campaigns: Campaigns;
|
|
149
|
+
categories: Categories;
|
|
150
|
+
distributions: Distributions;
|
|
151
|
+
validations: Validations;
|
|
152
|
+
redemptions: Redemptions;
|
|
153
|
+
promotions: Promotions;
|
|
154
|
+
customers: Customers;
|
|
155
|
+
consents: Consents;
|
|
156
|
+
orders: Orders;
|
|
157
|
+
products: Products;
|
|
158
|
+
productCollections: ProductCollections;
|
|
159
|
+
qualifications: Qualifications;
|
|
160
|
+
rewards: Rewards;
|
|
161
|
+
loyalties: Loyalties;
|
|
162
|
+
segments: Segments;
|
|
163
|
+
validationRules: ValidationRules;
|
|
164
|
+
events: Events;
|
|
165
|
+
asyncActions: AsyncActions;
|
|
166
|
+
apiLimitsHandler: ApiLimitsHandler;
|
|
167
|
+
metadataSchemas: MetadataSchemas;
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
export { VoucherifyServerSide, type VoucherifyServerSideOptions };
|
package/dist/Vouchers.d.ts
CHANGED
|
@@ -1,78 +1,84 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
1
|
+
import { VouchersQualificationExamineBody, VouchersQualificationExamineParams, VouchersQualificationExamineResponse, VouchersCreate, VouchersCreateResponse, VouchersResponse, VouchersUpdate, VouchersDeleteParams, VouchersListParams, VouchersListResponse, VouchersImport, VouchersImportResponse, VouchersBulkUpdateMetadata, VouchersBulkUpdateMetadataResponse, VouchersBulkUpdate, VouchersBulkUpdateResponse, VouchersListTransactionsRequestQuery, VouchersListTransactionsResponseBody, VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody } from './types/Vouchers.js';
|
|
2
|
+
import { AsyncActionCreateResponse } from './types/AsyncActions.js';
|
|
3
|
+
import { RequestController } from './RequestController.js';
|
|
4
|
+
import { Balance } from './Balance.js';
|
|
5
|
+
import './types/Orders.js';
|
|
6
|
+
import './types/Customers.js';
|
|
7
|
+
import './types/DiscountVoucher.js';
|
|
8
|
+
import './types/Balance.js';
|
|
9
|
+
|
|
10
|
+
declare class VouchersQualification {
|
|
11
|
+
private client;
|
|
12
|
+
constructor(client: RequestController);
|
|
13
|
+
/**
|
|
14
|
+
* The method can be used for sending a request to display all vouchers qualified to the given customer and context (e.g., order, loyalty reward). A checking logic won't run among coupons from bulk unique codes campaigns. For campaigns with multiple unique codes, you should run a dedicated function for searching for qualified campaigns.
|
|
15
|
+
* As a sample use case, you can imagine a requirement of displaying below cart the coupons eligible to a customer. The customer can take and apply the proposed voucher.
|
|
16
|
+
*
|
|
17
|
+
* @see https://docs.voucherify.io/reference/push-qualification-request
|
|
18
|
+
*/
|
|
19
|
+
examine(body: VouchersQualificationExamineBody, params?: VouchersQualificationExamineParams): Promise<VouchersQualificationExamineResponse>;
|
|
20
|
+
}
|
|
21
|
+
declare class Vouchers {
|
|
22
|
+
private client;
|
|
23
|
+
balance: Balance;
|
|
24
|
+
qualifications: VouchersQualification;
|
|
25
|
+
constructor(client: RequestController, balance: Balance);
|
|
26
|
+
/**
|
|
27
|
+
* @see https://docs.voucherify.io/reference/create-voucher
|
|
28
|
+
*/
|
|
29
|
+
create(voucher: VouchersCreate): Promise<VouchersCreateResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* @see https://docs.voucherify.io/reference/vouchers-get
|
|
32
|
+
*/
|
|
33
|
+
get(code: string): Promise<VouchersResponse>;
|
|
34
|
+
/**
|
|
35
|
+
* @see https://docs.voucherify.io/reference/update-voucher
|
|
36
|
+
*/
|
|
37
|
+
update(voucher: VouchersUpdate): Promise<VouchersResponse>;
|
|
38
|
+
/**
|
|
39
|
+
* @see https://docs.voucherify.io/reference/delete-voucher
|
|
40
|
+
*/
|
|
41
|
+
delete(code: string, params?: VouchersDeleteParams): Promise<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* @see https://docs.voucherify.io/reference/list-vouchers
|
|
44
|
+
*/
|
|
45
|
+
list(params?: VouchersListParams): Promise<VouchersListResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* @see https://docs.voucherify.io/reference/enable-voucher
|
|
48
|
+
*/
|
|
49
|
+
enable(code: string): Promise<VouchersResponse>;
|
|
50
|
+
/**
|
|
51
|
+
* @see https://docs.voucherify.io/reference/disable-voucher
|
|
52
|
+
*/
|
|
53
|
+
disable(code: string): Promise<VouchersResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* @see https://docs.voucherify.io/reference/import-vouchers-1
|
|
56
|
+
*/
|
|
57
|
+
import(vouchers: VouchersImport[]): Promise<VouchersImportResponse>;
|
|
58
|
+
/**
|
|
59
|
+
* @see https://docs.voucherify.io/reference/aaupdate-vouchers-metadata-in-bulk
|
|
60
|
+
*/
|
|
61
|
+
bulkUpdateMetadata(params: VouchersBulkUpdateMetadata): Promise<VouchersBulkUpdateMetadataResponse>;
|
|
62
|
+
/**
|
|
63
|
+
* @see https://docs.voucherify.io/reference/aa-update-vouchers-in-bulk
|
|
64
|
+
*/
|
|
65
|
+
bulkUpdate(vouchers: VouchersBulkUpdate): Promise<VouchersBulkUpdateResponse>;
|
|
66
|
+
/**
|
|
67
|
+
* @see https://docs.voucherify.io/reference/release-validation-session
|
|
68
|
+
*/
|
|
69
|
+
releaseValidationSession(code: string, sessionKey: string): Promise<unknown>;
|
|
70
|
+
/**
|
|
71
|
+
* @see https://docs.voucherify.io/reference/import-vouchers-using-csv
|
|
72
|
+
*/
|
|
73
|
+
importCSV(filePath: string): Promise<AsyncActionCreateResponse>;
|
|
74
|
+
/**
|
|
75
|
+
* @see https://docs.voucherify.io/reference/list-voucher-transactions
|
|
76
|
+
*/
|
|
77
|
+
listTransactions(code: string, params?: VouchersListTransactionsRequestQuery): Promise<VouchersListTransactionsResponseBody>;
|
|
78
|
+
/**
|
|
79
|
+
* @see https://docs.voucherify.io/reference/export-voucher-transactions
|
|
80
|
+
*/
|
|
81
|
+
exportTransactions(code: string, body: VouchersExportTransactionsRequestBody): Promise<VouchersExportTransactionsResponseBody>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export { Vouchers };
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Return an object containing all properties of `obj` excluding the ones in `keys` array
|
|
13
|
-
* e.g:
|
|
14
|
-
* ```javascript
|
|
15
|
-
* omit({ a: 1, b: 2, c: 3, d: 4 }, ['b', 'd']) // output: { a: 1, c: 3 }
|
|
16
|
-
* ```
|
|
17
|
-
*/
|
|
18
|
-
|
|
1
|
+
declare function encode(value?: string): string;
|
|
2
|
+
declare function isNumber(value: any): value is number;
|
|
3
|
+
declare function isString(value: any): value is string;
|
|
4
|
+
declare function isOptionalString(value: any): value is string | undefined;
|
|
5
|
+
declare function isObject<T extends Record<string, any> = Record<string, any>>(value: any): value is T;
|
|
6
|
+
declare function isOptionalObject<T extends Record<string, any> = Record<string, any>>(value: any): value is T | null | undefined;
|
|
7
|
+
declare function isFunction(value: any): value is Function;
|
|
8
|
+
declare function exists<T extends any>(value: T): value is NonNullable<T>;
|
|
9
|
+
declare function environment(): string;
|
|
10
|
+
declare function assert(condition: any, message?: string): asserts condition;
|
|
11
|
+
/**
|
|
12
|
+
* Return an object containing all properties of `obj` excluding the ones in `keys` array
|
|
13
|
+
* e.g:
|
|
14
|
+
* ```javascript
|
|
15
|
+
* omit({ a: 1, b: 2, c: 3, d: 4 }, ['b', 'd']) // output: { a: 1, c: 3 }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
declare function omit<T extends {}, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
|
|
19
|
+
|
|
20
|
+
export { assert, encode, environment, exists, isFunction, isNumber, isObject, isOptionalObject, isOptionalString, isString, omit };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,25 +1,63 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
25
|
-
export
|
|
1
|
+
export { Customer, CustomerActivitiesListQueryParams, CustomerActivitiesListResponse, CustomerActivityListQueryParams, CustomerActivityListResponse, CustomerId, CustomerLoyalty, CustomerObject, CustomerRedeemablesListItemContainerResponse, CustomerRedeemablesListItemContainerVoucherResponse, CustomerRedeemablesListItemResponse, CustomerRedeemablesListQueryParams, CustomerRedeemablesListResponse, CustomerReferrals, CustomerRequest, CustomerSummary, CustomerSummaryOrders, CustomerSummaryRedemptions, CustomerUnconfirmed, CustomerWithSummaryLoyaltyReferrals, CustomersCommonListRequest, CustomersCommonListResponse, CustomersCreateBody, CustomersCreateResponse, CustomersDeletePermanentlyResponseBody, CustomersGetResponse, CustomersListParams, CustomersListResponse, CustomersScrollParams, CustomersScrollResponse, CustomersScrollYield, CustomersUpdateConsentsBody, CustomersUpdateInBulkRequestBody, CustomersUpdateMetadataInBulkRequestBody, CustomersUpdateParams, CustomersUpdateResponse, Referrer, ReferrerId, ReferrerWithSummaryLoyaltyReferrals, SimpleCustomer } from './types/Customers.js';
|
|
2
|
+
export { BalanceCreateParams, BalanceCreateResponse } from './types/Balance.js';
|
|
3
|
+
export { ClientSideConsentsListResponse, ClientSideCustomersCreateParams, ClientSideCustomersCreateResponse, ClientSideCustomersUpdateConsentsBody, ClientSideListVouchersParams, ClientSideListVouchersResponse, ClientSidePublishCampaign, ClientSidePublishPayload, ClientSidePublishPreparedPayload, ClientSidePublishQueryParams, ClientSidePublishResponse, ClientSideRedeemOrder, ClientSideRedeemPayload, ClientSideRedeemResponse, ClientSideRedeemWidgetPayload, ClientSideRedemptionsRedeemStackableParams, ClientSideRedemptionsRedeemStackableResponse, ClientSideTrackCustomer, ClientSideTrackLoyalty, ClientSideTrackPayload, ClientSideTrackReferral, ClientSideTrackResponse, ClientSideValidateParams, ClientSideValidateResponse, ClientSideValidationValidateStackableResponse, ClientSideValidationsValidateStackableParams, ClientSideVoucherListing } from './types/ClientSide.js';
|
|
4
|
+
export { Redemption, RedemptionsGetForVoucherResponse, RedemptionsListParams, RedemptionsListResponse, RedemptionsRedeemBody, RedemptionsRedeemResponse, RedemptionsRedeemStackableOrderResponse, RedemptionsRedeemStackableParams, RedemptionsRedeemStackableRedemptionResult, RedemptionsRedeemStackableResponse, RedemptionsRollbackParams, RedemptionsRollbackPayload, RedemptionsRollbackQueryParams, RedemptionsRollbackResponse, RedemptionsRollbackStackableResponse, SimpleRollback } from './types/Redemptions.js';
|
|
5
|
+
export { ValidationValidateStackableResponse, ValidationsStackingRules, ValidationsValidateCode, ValidationsValidateContext, ValidationsValidateStackableParams, ValidationsValidateVoucherParams, ValidationsValidateVoucherResponse } from './types/Validations.js';
|
|
6
|
+
export { CampaignResponse, CampaignsAddCertainVoucherParams, CampaignsAddCertainVoucherResponse, CampaignsAddVoucherBody, CampaignsAddVoucherParams, CampaignsAddVoucherResponse, CampaignsCreateCampaign, CampaignsCreateCampaignResponse, CampaignsDeleteParams, CampaignsGetCampaignResponse, CampaignsImportVouchers, CampaignsListParams, CampaignsListResponse, CampaignsQualificationsBody, CampaignsQualificationsParams, CampaignsQualificationsResponse, CampaignsUpdateCampaign, CampaignsUpdateCampaignResponse, CampaignsVouchersImportResponse } from './types/Campaigns.js';
|
|
7
|
+
export { PromotionTier, PromotionTierGetResponse, PromotionTierRedeemDetails, PromotionTierRedeemDetailsSimple, PromotionTiersCreateParams, PromotionTiersCreateResponse, PromotionTiersListAllParams, PromotionTiersListAllResponse, PromotionTiersListResponse, PromotionTiersRedeemParams, PromotionTiersRedeemResponse, PromotionTiersUpdateParams, PromotionTiersUpdateResponse, SimplePromotionTier } from './types/PromotionTiers.js';
|
|
8
|
+
export { PromotionsCreate, PromotionsCreateResponse, PromotionsValidateParams, PromotionsValidateQueryParams, PromotionsValidateResponse } from './types/Promotions.js';
|
|
9
|
+
export { EarningRule, EarningRuleBase, EarningRuleEvent, EarningRuleFixed, EarningRuleProportional, EarningRuleProportionalCustomEvent, EarningRuleProportionalCustomerMetadata, EarningRuleProportionalOrder, EarningRuleProportionalOrderAmount, EarningRuleProportionalOrderItems, EarningRuleProportionalOrderItemsAmount, EarningRuleProportionalOrderItemsQuantity, EarningRuleProportionalOrderItemsSubtotalAmount, EarningRuleProportionalOrderMetadata, EarningRuleProportionalOrderTotalAmount, LoyaltiesAddOrRemoveCardBalanceRequestBody, LoyaltiesAddOrRemoveCardBalanceResponseBody, LoyaltiesAddPoints, LoyaltiesAddPointsResponse, LoyaltiesCreateCampaign, LoyaltiesCreateCampaignResponse, LoyaltiesCreateEarningRule, LoyaltiesCreateEarningRuleResponse, LoyaltiesCreateMember, LoyaltiesCreateMemberResponse, LoyaltiesCreateRewardAssignmentResponse, LoyaltiesCreateRewardAssignments, LoyaltiesCreateTiersRequestBody, LoyaltiesCreateTiersResponseBody, LoyaltiesDeleteCampaignParams, LoyaltiesDisableEarningRulesResponseBody, LoyaltiesEarningRulesResponse, LoyaltiesEnableEarningRulesResponseBody, LoyaltiesExportCardTransactionsRequestBody, LoyaltiesExportCardTransactionsResponseBody, LoyaltiesGetCampaignResponse, LoyaltiesGetEarningRuleResponseBody, LoyaltiesGetMemberActivitiesResponse, LoyaltiesGetMemberResponse, LoyaltiesGetPointsExpirationRequestQuery, LoyaltiesGetPointsExpirationResponseBody, LoyaltiesGetRewardAssignmentResponseBody, LoyaltiesGetRewardDetailsResponseBody, LoyaltiesGetTierResponseBody, LoyaltiesListCardTransactionsRequestQuery, LoyaltiesListCardTransactionsResponseBody, LoyaltiesListEarningRulesParams, LoyaltiesListEarningRulesResponse, LoyaltiesListLoyaltyTierEarningRulesRequestQuery, LoyaltiesListLoyaltyTierEarningRulesResponseBody, LoyaltiesListLoyaltyTierRewardsResponseBody, LoyaltiesListMemberActivityParams, LoyaltiesListMemberActivityResponse, LoyaltiesListMemberLoyaltyTiersResponseBody, LoyaltiesListMemberRewardsRequestQuery, LoyaltiesListMemberRewardsResponseBody, LoyaltiesListMembersParams, LoyaltiesListMembersResponse, LoyaltiesListParams, LoyaltiesListResponse, LoyaltiesListRewardAssignmentsParams, LoyaltiesListRewardAssignmentsResponse, LoyaltiesListTiersRequestQuery, LoyaltiesListTiersResponseBody, LoyaltiesRedeemRewardParams, LoyaltiesRedeemRewardResponse, LoyaltiesTransferPoints, LoyaltiesTransferPointsRequestBody, LoyaltiesTransferPointsResponseBody, LoyaltiesUpdateCampaign, LoyaltiesUpdateCampaignResponse, LoyaltiesUpdateEarningRule, LoyaltiesUpdateEarningRuleResponse, LoyaltiesUpdateRewardAssignment, LoyaltiesUpdateRewardAssignmentResponse, LoyaltiesVoucherResponse, LoyaltyCardTransaction, LoyaltyCardTransactionsFields, LoyaltyCardTransactionsType, LoyaltyFixed, LoyaltyPointsTransfer, LoyaltyProportional, LoyaltyTier, LoyaltyTierBase, LoyaltyTierRewardItemCampaignDiscountCoupons, LoyaltyTierRewardItemCampaignGiftVouchersAndLoyaltyProgram, LoyaltyTierRewardItemCampaignParameters, LoyaltyTierRewardItemCoinParameters, LoyaltyTierRewardItemMaterialParameters, LoyaltyTierRewardItemParameters, PointsExpirationTypes, SimpleLoyaltyVoucher } from './types/Loyalties.js';
|
|
10
|
+
export { GiftCardTransaction, GiftCardTransactionAdditionDetails, GiftCardTransactionBase, GiftCardTransactionDetails, GiftCardTransactionRedemptionDetails, GiftCardTransactionRefundDetails, GiftCardTransactionRemovalDetails, SimpleVoucher, VoucherTransaction, VoucherTransactionsExportFields, VoucherType, VouchersBulkUpdate, VouchersBulkUpdateMetadata, VouchersBulkUpdateMetadataResponse, VouchersBulkUpdateObject, VouchersBulkUpdateResponse, VouchersCreate, VouchersCreateParameters, VouchersCreateResponse, VouchersDeleteParams, VouchersDisableResponse, VouchersEnableResponse, VouchersExportTransactionsRequestBody, VouchersExportTransactionsResponseBody, VouchersGetResponse, VouchersImport, VouchersImportResponse, VouchersListParams, VouchersListResponse, VouchersListTransactionsRequestQuery, VouchersListTransactionsResponseBody, VouchersQualificationExamineBody, VouchersQualificationExamineParams, VouchersQualificationExamineResponse, VouchersResponse, VouchersUpdate, VouchersUpdateResponse } from './types/Vouchers.js';
|
|
11
|
+
export { ValidationRulesAssignment, ValidationRulesAssignmentsList, ValidationRulesCreate, ValidationRulesCreateAssignment, ValidationRulesCreateAssignmentResponse, ValidationRulesCreateResponse, ValidationRulesGetResponse, ValidationRulesListAssignmentsParams, ValidationRulesListAssignmentsResponse, ValidationRulesListParams, ValidationRulesListResponse, ValidationRulesListRulesAssignmentsRequestQuery, ValidationRulesListRulesAssignmentsResponseBody, ValidationRulesUpdate, ValidationRulesUpdateResponse, ValidationRulesValidateResponse } from './types/ValidationRules.js';
|
|
12
|
+
export { Reward, RewardAssignment, RewardRedemptionParams, RewardType, RewardTypeCampaign, RewardTypeCoin, RewardTypeMaterial, RewardsAssignmentCampaignOrMaterialReward, RewardsAssignmentCoinReward, RewardsAssignmentObject, RewardsCreate, RewardsCreateAssignment, RewardsCreateAssignmentCampaignOrMaterialRewardRequestBody, RewardsCreateAssignmentCoinRewardRequestBody, RewardsCreateAssignmentRequestBody, RewardsCreateAssignmentResponse, RewardsCreateAssignmentResponseBody, RewardsCreateResponse, RewardsGetAssignmentResponseBody, RewardsGetResponse, RewardsListAssignmentsParams, RewardsListAssignmentsRequestQuery, RewardsListAssignmentsResponse, RewardsListAssignmentsResponseBody, RewardsListParams, RewardsListResponse, RewardsResponse, RewardsType, RewardsTypeResponse, RewardsUpdate, RewardsUpdateAssignment, RewardsUpdateAssignmentRequestBody, RewardsUpdateAssignmentResponse, RewardsUpdateAssignmentResponseBody, RewardsUpdateResponse } from './types/Rewards.js';
|
|
13
|
+
export { ProductsBulkUpdate, ProductsBulkUpdateMetadata, ProductsBulkUpdateMetadataResponse, ProductsBulkUpdateResponse, ProductsCreate, ProductsCreateResponse, ProductsCreateSku, ProductsCreateSkuResponse, ProductsDeleteParams, ProductsDeleteSkuParams, ProductsGetResponse, ProductsGetResponseSkus, ProductsGetSkuResponse, ProductsListParams, ProductsListResponse, ProductsListSkus, ProductsUpdate, ProductsUpdateResponse, ProductsUpdateSku, ProductsUpdateSkuResponse, SimpleProduct, SimpleSku } from './types/Products.js';
|
|
14
|
+
export { DistributionsPublicationsCreateParams, DistributionsPublicationsCreateResponse, DistributionsPublicationsListParams, DistributionsPublicationsListResponse, VoucherDiscount } from './types/Distributions.js';
|
|
15
|
+
export { SegmentsCreate, SegmentsCreateResponse, SegmentsGetResponse, SegmentsListResponse } from './types/Segments.js';
|
|
16
|
+
export { Export, ExportBase, ExportCustomer, ExportCustomerFields, ExportCustomerFilters, ExportCustomerOrder, ExportOrder, ExportOrderFields, ExportOrderFilters, ExportOrderOrder, ExportPointsExpiration, ExportPointsExpirationFields, ExportPointsExpirationFilters, ExportPointsExpirationOrder, ExportPublication, ExportPublicationFields, ExportPublicationFilters, ExportPublicationOrder, ExportRedemption, ExportRedemptionFields, ExportRedemptionFilters, ExportRedemptionOrder, ExportResource, ExportVoucher, ExportVoucherFields, ExportVoucherFilters, ExportVoucherOrder, ExportVoucherTransactionsExpiration, ExportVoucherTransactionsFields, ExportVoucherTransactionsFilters, ExportVoucherTransactionsOrder, ExportsCreateResponse, ExportsGetResponse, ExportsListRequestQuery, ExportsListResponseBody, FieldConditions, FiltersCondition, Junction } from './types/Exports.js';
|
|
17
|
+
export { Order, OrderCalculated, OrderItem, OrderItemCalculated, OrderRedemptions, OrdersCreate, OrdersCreateResponse, OrdersGetResponse, OrdersItem, OrdersListParams, OrdersListResponse, OrdersUpdate, OrdersUpdateResponse } from './types/Orders.js';
|
|
18
|
+
export { Consent, ConsentsListResponse } from './types/Consents.js';
|
|
19
|
+
export { EventsParams, EventsResponse } from './types/Events.js';
|
|
20
|
+
export { StackableOptions, StackableRedeemableInapplicableResponse, StackableRedeemableObject, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableResponseStatus, StackableRedeemableResultDiscount, StackableRedeemableResultDiscountUnit, StackableRedeemableResultGift, StackableRedeemableResultLoyaltyCard, StackableRedeemableResultResponse, StackableRedeemableSkippedResponse } from './types/Stackable.js';
|
|
21
|
+
export { GiftRedemptionParams } from './types/Gift.js';
|
|
22
|
+
export { ValidationSessionParams, ValidationSessionReleaseParams, ValidationSessionResponse, ValidationSessionTTLUnit, ValidationSessionType } from './types/ValidateSession.js';
|
|
23
|
+
export { ApplicableTo, ApplicableToEffect, ApplicableToResultList, InapplicableTo, InapplicableToResultList } from './types/ApplicableTo.js';
|
|
24
|
+
export { Discount, DiscountAmount, DiscountAmountVouchersEffectTypes, DiscountAmount_, DiscountFixed, DiscountFixedVouchersEffectTypes, DiscountFixed_, DiscountPercent, DiscountPercentVouchersEffectTypes, DiscountPercent_, DiscountUnit, DiscountUnitBase_, DiscountUnitMultiple_, DiscountUnitVouchersEffectTypes, DiscountUnit_, DiscountVouchersEffectTypes, DiscountVouchersTypes, DiscountVouchersTypesEnum } from './types/DiscountVoucher.js';
|
|
25
|
+
export { QualificationsCheckEligibilityRequestBody, QualificationsCheckEligibilityResponseBody, QualificationsFieldConditions, QualificationsFiltersCondition, QualificationsFiltersFields, QualificationsRedeemable, QualificationsRedeemableBase, QualificationsRedeemableList, QualificationsStackingRules, RedeemableResult } from './types/Qualifications.js';
|
|
26
|
+
export { VoucherifyServerSide, VoucherifyServerSideOptions } from './VoucherifyServerSide.js';
|
|
27
|
+
export { VoucherifyClientSide, VoucherifyClientSideOptions } from './VoucherifyClientSide.js';
|
|
28
|
+
export { Balance } from './Balance.js';
|
|
29
|
+
export { Campaigns } from './Campaigns.js';
|
|
30
|
+
export { ClientSide } from './ClientSide.js';
|
|
31
|
+
export { Consents } from './Consents.js';
|
|
32
|
+
export { Customers } from './Customers.js';
|
|
33
|
+
export { Distributions } from './Distributions.js';
|
|
34
|
+
export { Events } from './Events.js';
|
|
35
|
+
export { Exports } from './Exports.js';
|
|
36
|
+
export { Loyalties } from './Loyalties.js';
|
|
37
|
+
export { Orders } from './Orders.js';
|
|
38
|
+
export { Products } from './Products.js';
|
|
39
|
+
export { Promotions } from './Promotions.js';
|
|
40
|
+
export { PromotionTiers } from './PromotionTiers.js';
|
|
41
|
+
export { Redemptions } from './Redemptions.js';
|
|
42
|
+
export { RequestController } from './RequestController.js';
|
|
43
|
+
export { Rewards } from './Rewards.js';
|
|
44
|
+
export { Segments } from './Segments.js';
|
|
45
|
+
export { ValidationRules } from './ValidationRules.js';
|
|
46
|
+
export { Validations } from './Validations.js';
|
|
47
|
+
export { VoucherifyError } from './VoucherifyError.js';
|
|
48
|
+
export { Vouchers } from './Vouchers.js';
|
|
49
|
+
export { Qualifications } from './Qualifications.js';
|
|
50
|
+
import './types/ValidationError.js';
|
|
51
|
+
import './types/Categories.js';
|
|
52
|
+
import './AsyncActions.js';
|
|
53
|
+
import './types/AsyncActions.js';
|
|
54
|
+
import './ApiLimitsHandler.js';
|
|
55
|
+
import './MetadataSchemas.js';
|
|
56
|
+
import './types/MetadataSchemas.js';
|
|
57
|
+
import './Categories.js';
|
|
58
|
+
import './ProductCollections.js';
|
|
59
|
+
import './types/ProductCollections.js';
|
|
60
|
+
import './types/UtilityTypes.js';
|
|
61
|
+
import './PromotionsStacks.js';
|
|
62
|
+
import './types/PromotionsStacks.js';
|
|
63
|
+
import 'axios';
|