@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.
Files changed (75) hide show
  1. package/dist/ApiLimitsHandler.d.ts +13 -10
  2. package/dist/AsyncActions.d.ts +17 -15
  3. package/dist/Balance.d.ts +15 -12
  4. package/dist/Campaigns.d.ts +66 -58
  5. package/dist/Categories.d.ts +29 -26
  6. package/dist/ClientSide.d.ts +77 -53
  7. package/dist/Consents.d.ts +13 -10
  8. package/dist/Customers.d.ts +75 -72
  9. package/dist/Distributions.d.ts +29 -22
  10. package/dist/Events.d.ts +15 -10
  11. package/dist/Exports.d.ts +25 -22
  12. package/dist/Loyalties.d.ts +171 -159
  13. package/dist/MetadataSchemas.d.ts +17 -14
  14. package/dist/Orders.d.ts +32 -27
  15. package/dist/ProductCollections.d.ts +30 -26
  16. package/dist/Products.d.ts +66 -63
  17. package/dist/PromotionTiers.d.ts +43 -34
  18. package/dist/Promotions.d.ts +30 -18
  19. package/dist/PromotionsStacks.d.ts +34 -30
  20. package/dist/Qualifications.d.ts +24 -10
  21. package/dist/Redemptions.d.ts +53 -35
  22. package/dist/RequestController.d.ts +31 -29
  23. package/dist/Rewards.d.ts +46 -43
  24. package/dist/Segments.d.ts +25 -22
  25. package/dist/ValidationRules.d.ts +47 -43
  26. package/dist/Validations.d.ts +39 -17
  27. package/dist/VoucherifyClientSide.d.ts +112 -86
  28. package/dist/VoucherifyError.d.ts +23 -20
  29. package/dist/VoucherifyServerSide.d.ts +170 -131
  30. package/dist/Vouchers.d.ts +84 -78
  31. package/dist/helpers.d.ts +20 -18
  32. package/dist/index.d.ts +63 -25
  33. package/dist/types/ApplicableTo.d.ts +32 -30
  34. package/dist/types/AsyncActions.d.ts +23 -21
  35. package/dist/types/Balance.d.ts +18 -16
  36. package/dist/types/Campaigns.d.ts +124 -120
  37. package/dist/types/Categories.d.ts +40 -38
  38. package/dist/types/ClientSide.d.ts +145 -134
  39. package/dist/types/Consents.d.ts +34 -33
  40. package/dist/types/Customers.d.ts +363 -361
  41. package/dist/types/DiscountVoucher.d.ts +94 -93
  42. package/dist/types/Distributions.d.ts +148 -144
  43. package/dist/types/Events.d.ts +21 -17
  44. package/dist/types/Exports.d.ts +151 -149
  45. package/dist/types/Gift.d.ts +5 -3
  46. package/dist/types/Loyalties.d.ts +1061 -1057
  47. package/dist/types/MetadataSchemas.d.ts +34 -33
  48. package/dist/types/Orders.d.ts +199 -195
  49. package/dist/types/ProductCollections.d.ts +99 -96
  50. package/dist/types/Products.d.ts +108 -106
  51. package/dist/types/PromotionTiers.d.ts +131 -127
  52. package/dist/types/Promotions.d.ts +113 -108
  53. package/dist/types/PromotionsStacks.d.ts +74 -71
  54. package/dist/types/Qualifications.d.ts +92 -86
  55. package/dist/types/Redemptions.d.ts +215 -205
  56. package/dist/types/Rewards.d.ts +220 -219
  57. package/dist/types/Segments.d.ts +34 -32
  58. package/dist/types/Stackable.d.ts +106 -101
  59. package/dist/types/UtilityTypes.d.ts +5 -3
  60. package/dist/types/ValidateSession.d.ts +19 -17
  61. package/dist/types/ValidationError.d.ts +9 -7
  62. package/dist/types/ValidationRules.d.ts +96 -93
  63. package/dist/types/Validations.d.ts +109 -98
  64. package/dist/types/Vouchers.d.ts +452 -364
  65. package/dist/types/index.d.ts +27 -25
  66. package/dist/voucherifysdk.cjs +2023 -0
  67. package/dist/voucherifysdk.cjs.map +1 -0
  68. package/dist/voucherifysdk.esm.js +981 -1256
  69. package/dist/voucherifysdk.esm.js.map +1 -1
  70. package/package.json +13 -9
  71. package/CHANGELOG.md +0 -663
  72. package/dist/voucherifysdk.umd.development.js +0 -2270
  73. package/dist/voucherifysdk.umd.development.js.map +0 -1
  74. package/dist/voucherifysdk.umd.production.min.js +0 -2
  75. 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
- export interface VoucherifyServerSideOptions {
23
- /**
24
- * Optionally, you can add `apiUrl` to the client options if you want to use Voucherify running in a specific region.
25
- *
26
- * ```javascript
27
- * const voucherify = VoucherifyServerSide({
28
- * applicationId: 'YOUR-APPLICATION-ID',
29
- * secretKey: 'YOUR-SECRET-KEY',
30
- * apiUrl: 'https://<region>.api.voucherify.io'
31
- * })
32
- * ```
33
- */
34
- apiUrl?: string;
35
- /**
36
- * [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):
37
- *
38
- * ```javascript
39
- * const voucherify = VoucherifyServerSide({
40
- * applicationId: 'YOUR-APPLICATION-ID',
41
- * secretKey: 'YOUR-SECRET-KEY'
42
- * })
43
- * ```
44
- */
45
- applicationId: string;
46
- /**
47
- * [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):
48
- *
49
- * ```javascript
50
- * const voucherify = VoucherifyServerSide({
51
- * applicationId: 'YOUR-APPLICATION-ID',
52
- * secretKey: 'YOUR-SECRET-KEY'
53
- * })
54
- * ```
55
- */
56
- secretKey: string;
57
- /**
58
- * 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).
59
- *
60
- * ```javascript
61
- * const voucherify = VoucherifyServerSide({
62
- * applicationId: 'YOUR-APPLICATION-ID',
63
- * secretKey: 'YOUR-SECRET-KEY',
64
- * apiVersion: 'v2017-04-20'
65
- * })
66
- * ```
67
- */
68
- apiVersion?: string;
69
- channel?: string;
70
- /**
71
- * Set this option to disable displaying the warning about exposing your `secretKey` if you're using VoucherifyServerSide in a browser environment.
72
- * By setting this option to `true`, you acknowledge that you understand the risks of exposing your `secretKey` to a browser environment.
73
- *
74
- * ```javascript
75
- * const voucherify = VoucherifyServerSide({
76
- * applicationId: 'YOUR-APPLICATION-ID',
77
- * secretKey: 'YOUR-SECRET-KEY',
78
- * dangerouslySetSecretKeyInBrowser: true
79
- * })
80
- * ```
81
- */
82
- dangerouslySetSecretKeyInBrowser?: boolean;
83
- /**
84
- * You can pass additional headers to requests made by the API Client.
85
- * It can prove to be useful when debugging various scenarios.
86
- * ```javascript
87
- * const voucherify = VoucherifyServerSide({
88
- * applicationId: 'YOUR-APPLICATION-ID',
89
- * secretKey: 'YOUR-SECRET-KEY',
90
- * customHeaders: {
91
- * "DEBUG-HEADER": "my_value",
92
- * "TEST-HEADER": "another_value"
93
- * }
94
- * })
95
- * ```
96
- */
97
- customHeaders?: Record<string, string>;
98
- /**
99
- * If you wish to include original Axios error in VoucherifyError instance set this to true
100
- * It can prove to be useful when debugging various scenarios.
101
- * The original Axios error will be included in cause property of VoucherifyError
102
- */
103
- exposeErrorCause?: boolean;
104
- /**
105
- * 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.
106
- */
107
- timeoutMs?: number;
108
- }
109
- export declare function VoucherifyServerSide(options: VoucherifyServerSideOptions): {
110
- vouchers: Vouchers;
111
- campaigns: Campaigns;
112
- categories: Categories;
113
- distributions: Distributions;
114
- validations: Validations;
115
- redemptions: Redemptions;
116
- promotions: Promotions;
117
- customers: Customers;
118
- consents: Consents;
119
- orders: Orders;
120
- products: Products;
121
- productCollections: ProductCollections;
122
- qualifications: Qualifications;
123
- rewards: Rewards;
124
- loyalties: Loyalties;
125
- segments: Segments;
126
- validationRules: ValidationRules;
127
- events: Events;
128
- asyncActions: AsyncActions;
129
- apiLimitsHandler: ApiLimitsHandler;
130
- metadataSchemas: MetadataSchemas;
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 };
@@ -1,78 +1,84 @@
1
- import * as T from './types/Vouchers';
2
- import * as AAT from './types/AsyncActions';
3
- import type { RequestController } from './RequestController';
4
- import type { Balance } from './Balance';
5
- declare class VouchersQualification {
6
- private client;
7
- constructor(client: RequestController);
8
- /**
9
- * 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.
10
- * 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.
11
- *
12
- * @see https://docs.voucherify.io/reference/push-qualification-request
13
- */
14
- examine(body: T.VouchersQualificationExamineBody, params?: T.VouchersQualificationExamineParams): Promise<T.VouchersQualificationExamineResponse>;
15
- }
16
- export declare class Vouchers {
17
- private client;
18
- balance: Balance;
19
- qualifications: VouchersQualification;
20
- constructor(client: RequestController, balance: Balance);
21
- /**
22
- * @see https://docs.voucherify.io/reference/create-voucher
23
- */
24
- create(voucher: T.VouchersCreate): Promise<Pick<T.VouchersResponse, "object" | "type" | "discount" | "gift" | "category" | "additional_info" | "start_date" | "expiration_date" | "metadata" | "id" | "code" | "campaign" | "loyalty_card" | "validity_timeframe" | "validity_day_of_week" | "publish" | "redemption" | "active" | "assets" | "is_referral_code" | "referrer_id" | "holder_id" | "updated_at" | "created_at">>;
25
- /**
26
- * @see https://docs.voucherify.io/reference/vouchers-get
27
- */
28
- get(code: string): Promise<T.VouchersResponse>;
29
- /**
30
- * @see https://docs.voucherify.io/reference/update-voucher
31
- */
32
- update(voucher: T.VouchersUpdate): Promise<T.VouchersResponse>;
33
- /**
34
- * @see https://docs.voucherify.io/reference/delete-voucher
35
- */
36
- delete(code: string, params?: T.VouchersDeleteParams): Promise<unknown>;
37
- /**
38
- * @see https://docs.voucherify.io/reference/list-vouchers
39
- */
40
- list(params?: T.VouchersListParams): Promise<T.VouchersListResponse>;
41
- /**
42
- * @see https://docs.voucherify.io/reference/enable-voucher
43
- */
44
- enable(code: string): Promise<T.VouchersResponse>;
45
- /**
46
- * @see https://docs.voucherify.io/reference/disable-voucher
47
- */
48
- disable(code: string): Promise<T.VouchersResponse>;
49
- /**
50
- * @see https://docs.voucherify.io/reference/import-vouchers-1
51
- */
52
- import(vouchers: T.VouchersImport[]): Promise<T.VouchersImportResponse>;
53
- /**
54
- * @see https://docs.voucherify.io/reference/aaupdate-vouchers-metadata-in-bulk
55
- */
56
- bulkUpdateMetadata(params: T.VouchersBulkUpdateMetadata): Promise<T.VouchersBulkUpdateMetadataResponse>;
57
- /**
58
- * @see https://docs.voucherify.io/reference/aa-update-vouchers-in-bulk
59
- */
60
- bulkUpdate(vouchers: T.VouchersBulkUpdate): Promise<T.VouchersBulkUpdateResponse>;
61
- /**
62
- * @see https://docs.voucherify.io/reference/release-validation-session
63
- */
64
- releaseValidationSession(code: string, sessionKey: string): Promise<unknown>;
65
- /**
66
- * @see https://docs.voucherify.io/reference/import-vouchers-using-csv
67
- */
68
- importCSV(filePath: string): Promise<AAT.AsyncActionCreateResponse>;
69
- /**
70
- * @see https://docs.voucherify.io/reference/list-voucher-transactions
71
- */
72
- listTransactions(code: string, params?: T.VouchersListTransactionsRequestQuery): Promise<T.VouchersListTransactionsResponseBody>;
73
- /**
74
- * @see https://docs.voucherify.io/reference/export-voucher-transactions
75
- */
76
- exportTransactions(code: string, body: T.VouchersExportTransactionsRequestBody): Promise<T.VouchersExportTransactionsResponseBody>;
77
- }
78
- export {};
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
- export declare function encode(value?: string): string;
2
- export declare function isNumber(value: any): value is number;
3
- export declare function isString(value: any): value is string;
4
- export declare function isOptionalString(value: any): value is string | undefined;
5
- export declare function isObject<T extends Record<string, any> = Record<string, any>>(value: any): value is T;
6
- export declare function isOptionalObject<T extends Record<string, any> = Record<string, any>>(value: any): value is T | null | undefined;
7
- export declare function isFunction(value: any): value is Function;
8
- export declare function exists<T extends any>(value: T): value is NonNullable<T>;
9
- export declare function environment(): string;
10
- export 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
- export declare function omit<T extends {}, K extends keyof T>(obj: T, keys: K[]): Omit<T, K>;
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 * from './types';
2
- export * from './VoucherifyServerSide';
3
- export * from './VoucherifyClientSide';
4
- export type { Balance } from './Balance';
5
- export type { Campaigns } from './Campaigns';
6
- export type { ClientSide } from './ClientSide';
7
- export type { Consents } from './Consents';
8
- export type { Customers } from './Customers';
9
- export type { Distributions } from './Distributions';
10
- export type { Events } from './Events';
11
- export type { Exports } from './Exports';
12
- export type { Loyalties } from './Loyalties';
13
- export type { Orders } from './Orders';
14
- export type { Products } from './Products';
15
- export type { Promotions } from './Promotions';
16
- export type { PromotionTiers } from './PromotionTiers';
17
- export type { Redemptions } from './Redemptions';
18
- export type { RequestController } from './RequestController';
19
- export type { Rewards } from './Rewards';
20
- export type { Segments } from './Segments';
21
- export type { ValidationRules } from './ValidationRules';
22
- export type { Validations } from './Validations';
23
- export type { VoucherifyError } from './VoucherifyError';
24
- export type { Vouchers } from './Vouchers';
25
- export type { Qualifications } from './Qualifications';
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';