@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,101 +1,106 @@
1
- import { RewardRedemptionParams } from './Rewards';
2
- import { GiftRedemptionParams } from './Gift';
3
- import { OrdersCreateResponse } from './Orders';
4
- import { ApplicableToResultList } from './ApplicableTo';
5
- import { DiscountVouchersTypes, DiscountVouchersEffectTypes, DiscountUnitVouchersEffectTypes } from './DiscountVoucher';
6
- import { SimpleProduct, SimpleSku } from './Products';
7
- import { LoyaltyPointsTransfer } from './Loyalties';
8
- import { ValidationError } from './ValidationError';
9
- import { Category } from './Categories';
10
- declare type ExpandOption = 'order' | 'redeemable' | 'redemption';
11
- export interface StackableOptions {
12
- expand: ExpandOption[];
13
- }
14
- export declare type StackableRedeemableObject = 'promotion_stack' | 'promotion_tier' | 'voucher';
15
- export interface StackableRedeemableParams {
16
- object: StackableRedeemableObject;
17
- id: string;
18
- reward?: RewardRedemptionParams;
19
- gift?: GiftRedemptionParams;
20
- }
21
- export declare type StackableRedeemableResponseStatus = 'APPLICABLE' | 'INAPPLICABLE' | 'SKIPPED';
22
- export interface StackableRedeemableResultDiscountUnit {
23
- effect: DiscountUnitVouchersEffectTypes;
24
- unit_off: number;
25
- unit_type: string;
26
- sku?: SimpleSku;
27
- product?: SimpleProduct;
28
- }
29
- export interface StackableRedeemableResultDiscount {
30
- type: DiscountVouchersTypes;
31
- effect: DiscountVouchersEffectTypes;
32
- amount_off?: number;
33
- amount_off_formula?: string;
34
- percent_off?: number;
35
- percent_off_formula?: string;
36
- amount_limit?: number;
37
- fixed_amount?: number;
38
- fixed_amount_formula?: string;
39
- unit_off?: number;
40
- unit_off_formula?: string;
41
- unit_type?: string;
42
- sku?: SimpleSku;
43
- product?: SimpleProduct;
44
- units?: StackableRedeemableResultDiscountUnit[];
45
- }
46
- export interface StackableRedeemableResultGift {
47
- credits?: number;
48
- }
49
- export interface StackableRedeemableResultLoyaltyCard {
50
- points?: number;
51
- transfers?: LoyaltyPointsTransfer[];
52
- }
53
- export interface StackableRedeemableResultResponse {
54
- discount?: StackableRedeemableResultDiscount;
55
- gift?: StackableRedeemableResultGift;
56
- loyalty_card?: StackableRedeemableResultLoyaltyCard;
57
- error?: ValidationError;
58
- details?: {
59
- key?: string;
60
- message?: string;
61
- };
62
- }
63
- export interface StackableRedeemableResponse {
64
- status: StackableRedeemableResponseStatus;
65
- id: string;
66
- object: StackableRedeemableObject;
67
- order?: OrdersCreateResponse;
68
- applicable_to?: ApplicableToResultList;
69
- inapplicable_to?: ApplicableToResultList;
70
- result?: StackableRedeemableResultResponse;
71
- metadata?: Record<string, any>;
72
- categories?: Category[];
73
- }
74
- export declare type StackableRedeemableInapplicableResponse = {
75
- status: 'INAPPLICABLE';
76
- id: string;
77
- object: 'voucher' | 'promotion_tier';
78
- result: {
79
- error?: ValidationError;
80
- details?: {
81
- key?: string;
82
- message?: string;
83
- };
84
- };
85
- metadata?: Record<string, unknown>;
86
- categories?: Category[];
87
- };
88
- export declare type StackableRedeemableSkippedResponse = {
89
- status: 'SKIPPED';
90
- id: string;
91
- object: 'voucher' | 'promotion_tier';
92
- result: {
93
- details?: {
94
- key?: string;
95
- message?: string;
96
- };
97
- };
98
- metadata?: Record<string, unknown>;
99
- categories?: Category[];
100
- };
101
- export {};
1
+ import { RewardRedemptionParams } from './Rewards.js';
2
+ import { GiftRedemptionParams } from './Gift.js';
3
+ import { OrdersCreateResponse } from './Orders.js';
4
+ import { ApplicableToResultList } from './ApplicableTo.js';
5
+ import { DiscountVouchersTypes, DiscountVouchersEffectTypes, DiscountUnitVouchersEffectTypes } from './DiscountVoucher.js';
6
+ import { SimpleSku, SimpleProduct } from './Products.js';
7
+ import { LoyaltyPointsTransfer } from './Loyalties.js';
8
+ import { ValidationError } from './ValidationError.js';
9
+ import { Category } from './Categories.js';
10
+ import './Customers.js';
11
+ import './ValidationRules.js';
12
+ import './Vouchers.js';
13
+
14
+ type ExpandOption = 'order' | 'redeemable' | 'redemption';
15
+ interface StackableOptions {
16
+ expand: ExpandOption[];
17
+ }
18
+ type StackableRedeemableObject = 'promotion_stack' | 'promotion_tier' | 'voucher';
19
+ interface StackableRedeemableParams {
20
+ object: StackableRedeemableObject;
21
+ id: string;
22
+ reward?: RewardRedemptionParams;
23
+ gift?: GiftRedemptionParams;
24
+ }
25
+ type StackableRedeemableResponseStatus = 'APPLICABLE' | 'INAPPLICABLE' | 'SKIPPED';
26
+ interface StackableRedeemableResultDiscountUnit {
27
+ effect: DiscountUnitVouchersEffectTypes;
28
+ unit_off: number;
29
+ unit_type: string;
30
+ sku?: SimpleSku;
31
+ product?: SimpleProduct;
32
+ }
33
+ interface StackableRedeemableResultDiscount {
34
+ type: DiscountVouchersTypes;
35
+ effect: DiscountVouchersEffectTypes;
36
+ amount_off?: number;
37
+ amount_off_formula?: string;
38
+ percent_off?: number;
39
+ percent_off_formula?: string;
40
+ amount_limit?: number;
41
+ fixed_amount?: number;
42
+ fixed_amount_formula?: string;
43
+ unit_off?: number;
44
+ unit_off_formula?: string;
45
+ unit_type?: string;
46
+ sku?: SimpleSku;
47
+ product?: SimpleProduct;
48
+ units?: StackableRedeemableResultDiscountUnit[];
49
+ }
50
+ interface StackableRedeemableResultGift {
51
+ credits?: number;
52
+ }
53
+ interface StackableRedeemableResultLoyaltyCard {
54
+ points?: number;
55
+ transfers?: LoyaltyPointsTransfer[];
56
+ }
57
+ interface StackableRedeemableResultResponse {
58
+ discount?: StackableRedeemableResultDiscount;
59
+ gift?: StackableRedeemableResultGift;
60
+ loyalty_card?: StackableRedeemableResultLoyaltyCard;
61
+ error?: ValidationError;
62
+ details?: {
63
+ key?: string;
64
+ message?: string;
65
+ };
66
+ }
67
+ interface StackableRedeemableResponse {
68
+ status: StackableRedeemableResponseStatus;
69
+ id: string;
70
+ object: StackableRedeemableObject;
71
+ order?: OrdersCreateResponse;
72
+ applicable_to?: ApplicableToResultList;
73
+ inapplicable_to?: ApplicableToResultList;
74
+ result?: StackableRedeemableResultResponse;
75
+ metadata?: Record<string, any>;
76
+ categories?: Category[];
77
+ }
78
+ type StackableRedeemableInapplicableResponse = {
79
+ status: 'INAPPLICABLE';
80
+ id: string;
81
+ object: 'voucher' | 'promotion_tier';
82
+ result: {
83
+ error?: ValidationError;
84
+ details?: {
85
+ key?: string;
86
+ message?: string;
87
+ };
88
+ };
89
+ metadata?: Record<string, unknown>;
90
+ categories?: Category[];
91
+ };
92
+ type StackableRedeemableSkippedResponse = {
93
+ status: 'SKIPPED';
94
+ id: string;
95
+ object: 'voucher' | 'promotion_tier';
96
+ result: {
97
+ details?: {
98
+ key?: string;
99
+ message?: string;
100
+ };
101
+ };
102
+ metadata?: Record<string, unknown>;
103
+ categories?: Category[];
104
+ };
105
+
106
+ export type { StackableOptions, StackableRedeemableInapplicableResponse, StackableRedeemableObject, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableResponseStatus, StackableRedeemableResultDiscount, StackableRedeemableResultDiscountUnit, StackableRedeemableResultGift, StackableRedeemableResultLoyaltyCard, StackableRedeemableResultResponse, StackableRedeemableSkippedResponse };
@@ -1,3 +1,5 @@
1
- export declare type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
2
- [Property in Key]-?: Type[Property];
3
- };
1
+ type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
2
+ [Property in Key]-?: Type[Property];
3
+ };
4
+
5
+ export type { WithRequiredProperty };
@@ -1,17 +1,19 @@
1
- export declare type ValidationSessionType = 'LOCK';
2
- export declare type ValidationSessionTTLUnit = 'DAYS' | 'HOURS' | 'MICROSECONDS' | 'MILLISECONDS' | 'MINUTES' | 'NANOSECONDS' | 'SECONDS';
3
- export interface ValidationSessionParams {
4
- key?: string;
5
- type?: ValidationSessionType;
6
- ttl?: number;
7
- ttl_unit?: ValidationSessionTTLUnit;
8
- }
9
- export interface ValidationSessionResponse {
10
- key: string;
11
- type: ValidationSessionType;
12
- ttl: number;
13
- ttl_unit: ValidationSessionTTLUnit;
14
- }
15
- export interface ValidationSessionReleaseParams {
16
- key: string;
17
- }
1
+ type ValidationSessionType = 'LOCK';
2
+ type ValidationSessionTTLUnit = 'DAYS' | 'HOURS' | 'MICROSECONDS' | 'MILLISECONDS' | 'MINUTES' | 'NANOSECONDS' | 'SECONDS';
3
+ interface ValidationSessionParams {
4
+ key?: string;
5
+ type?: ValidationSessionType;
6
+ ttl?: number;
7
+ ttl_unit?: ValidationSessionTTLUnit;
8
+ }
9
+ interface ValidationSessionResponse {
10
+ key: string;
11
+ type: ValidationSessionType;
12
+ ttl: number;
13
+ ttl_unit: ValidationSessionTTLUnit;
14
+ }
15
+ interface ValidationSessionReleaseParams {
16
+ key: string;
17
+ }
18
+
19
+ export type { ValidationSessionParams, ValidationSessionReleaseParams, ValidationSessionResponse, ValidationSessionTTLUnit, ValidationSessionType };
@@ -1,7 +1,9 @@
1
- export interface ValidationError {
2
- code?: number;
3
- key?: string;
4
- message: string;
5
- details?: string;
6
- request_id?: string;
7
- }
1
+ interface ValidationError {
2
+ code?: number;
3
+ key?: string;
4
+ message: string;
5
+ details?: string;
6
+ request_id?: string;
7
+ }
8
+
9
+ export type { ValidationError };
@@ -1,93 +1,96 @@
1
- import { ApplicableToResultList } from './ApplicableTo';
2
- export interface ValidationRulesCreate {
3
- name: string;
4
- error?: {
5
- message?: string;
6
- };
7
- rules?: {
8
- logic?: string;
9
- [rule: string]: any;
10
- };
11
- }
12
- export interface ValidationRulesCreateResponse {
13
- id: string;
14
- name: string;
15
- error?: {
16
- message?: string;
17
- };
18
- rules?: {
19
- logic?: string;
20
- [rule: string]: any;
21
- };
22
- created_at: string;
23
- updated_at?: string;
24
- object: 'validation_rules';
25
- }
26
- export interface ValidationRulesValidateResponse {
27
- valid: boolean;
28
- rule_id: string;
29
- applicable_to: ApplicableToResultList;
30
- }
31
- export declare type ValidationRulesGetResponse = ValidationRulesCreateResponse & {
32
- assignments_count?: string;
33
- };
34
- export declare type ValidationRulesUpdate = Partial<ValidationRulesCreate> & {
35
- id: string;
36
- };
37
- export declare type ValidationRulesUpdateResponse = ValidationRulesCreateResponse;
38
- export interface ValidationRulesCreateAssignment {
39
- voucher?: string;
40
- campaign?: string;
41
- promotion_tier?: string;
42
- }
43
- export interface ValidationRulesCreateAssignmentResponse {
44
- id: string;
45
- rule_id: string;
46
- related_object_id?: string;
47
- related_object_type?: string;
48
- created_at?: string;
49
- updated_at: string;
50
- object: 'validation_rules_assignment';
51
- }
52
- export interface ValidationRulesListParams {
53
- limit?: number;
54
- page?: number;
55
- }
56
- export interface ValidationRulesListResponse {
57
- object: 'list';
58
- total: number;
59
- data_ref: 'data';
60
- data: ValidationRulesGetResponse[];
61
- }
62
- export interface ValidationRulesListAssignmentsParams {
63
- limit?: number;
64
- page?: number;
65
- }
66
- export interface ValidationRulesListAssignmentsResponse {
67
- object: 'list';
68
- total: number;
69
- data_ref: 'data';
70
- data: ValidationRulesCreateAssignmentResponse[];
71
- }
72
- export declare type ValidationRulesAssignmentsList = ValidationRulesListResponse;
73
- export interface ValidationRulesAssignment {
74
- id: string;
75
- rule_id: string;
76
- related_object_id: string;
77
- related_object_type: string;
78
- created_at: string;
79
- object: 'validation_rules_assignment';
80
- }
81
- export interface ValidationRulesListRulesAssignmentsRequestQuery {
82
- related_object_id?: string;
83
- rule?: string;
84
- page?: number;
85
- limit?: number;
86
- order?: 'created_at' | '-created_at';
87
- }
88
- export interface ValidationRulesListRulesAssignmentsResponseBody {
89
- object: 'list';
90
- data_ref: 'data';
91
- total: number;
92
- data: ValidationRulesAssignment[];
93
- }
1
+ import { ApplicableToResultList } from './ApplicableTo.js';
2
+
3
+ interface ValidationRulesCreate {
4
+ name: string;
5
+ error?: {
6
+ message?: string;
7
+ };
8
+ rules?: {
9
+ logic?: string;
10
+ [rule: string]: any;
11
+ };
12
+ }
13
+ interface ValidationRulesCreateResponse {
14
+ id: string;
15
+ name: string;
16
+ error?: {
17
+ message?: string;
18
+ };
19
+ rules?: {
20
+ logic?: string;
21
+ [rule: string]: any;
22
+ };
23
+ created_at: string;
24
+ updated_at?: string;
25
+ object: 'validation_rules';
26
+ }
27
+ interface ValidationRulesValidateResponse {
28
+ valid: boolean;
29
+ rule_id: string;
30
+ applicable_to: ApplicableToResultList;
31
+ }
32
+ type ValidationRulesGetResponse = ValidationRulesCreateResponse & {
33
+ assignments_count?: string;
34
+ };
35
+ type ValidationRulesUpdate = Partial<ValidationRulesCreate> & {
36
+ id: string;
37
+ };
38
+ type ValidationRulesUpdateResponse = ValidationRulesCreateResponse;
39
+ interface ValidationRulesCreateAssignment {
40
+ voucher?: string;
41
+ campaign?: string;
42
+ promotion_tier?: string;
43
+ }
44
+ interface ValidationRulesCreateAssignmentResponse {
45
+ id: string;
46
+ rule_id: string;
47
+ related_object_id?: string;
48
+ related_object_type?: string;
49
+ created_at?: string;
50
+ updated_at: string;
51
+ object: 'validation_rules_assignment';
52
+ }
53
+ interface ValidationRulesListParams {
54
+ limit?: number;
55
+ page?: number;
56
+ }
57
+ interface ValidationRulesListResponse {
58
+ object: 'list';
59
+ total: number;
60
+ data_ref: 'data';
61
+ data: ValidationRulesGetResponse[];
62
+ }
63
+ interface ValidationRulesListAssignmentsParams {
64
+ limit?: number;
65
+ page?: number;
66
+ }
67
+ interface ValidationRulesListAssignmentsResponse {
68
+ object: 'list';
69
+ total: number;
70
+ data_ref: 'data';
71
+ data: ValidationRulesCreateAssignmentResponse[];
72
+ }
73
+ type ValidationRulesAssignmentsList = ValidationRulesListResponse;
74
+ interface ValidationRulesAssignment {
75
+ id: string;
76
+ rule_id: string;
77
+ related_object_id: string;
78
+ related_object_type: string;
79
+ created_at: string;
80
+ object: 'validation_rules_assignment';
81
+ }
82
+ interface ValidationRulesListRulesAssignmentsRequestQuery {
83
+ related_object_id?: string;
84
+ rule?: string;
85
+ page?: number;
86
+ limit?: number;
87
+ order?: 'created_at' | '-created_at';
88
+ }
89
+ interface ValidationRulesListRulesAssignmentsResponseBody {
90
+ object: 'list';
91
+ data_ref: 'data';
92
+ total: number;
93
+ data: ValidationRulesAssignment[];
94
+ }
95
+
96
+ export type { ValidationRulesAssignment, ValidationRulesAssignmentsList, ValidationRulesCreate, ValidationRulesCreateAssignment, ValidationRulesCreateAssignmentResponse, ValidationRulesCreateResponse, ValidationRulesGetResponse, ValidationRulesListAssignmentsParams, ValidationRulesListAssignmentsResponse, ValidationRulesListParams, ValidationRulesListResponse, ValidationRulesListRulesAssignmentsRequestQuery, ValidationRulesListRulesAssignmentsResponseBody, ValidationRulesUpdate, ValidationRulesUpdateResponse, ValidationRulesValidateResponse };