@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,98 +1,109 @@
1
- import { DiscountAmount, DiscountPercent, DiscountUnit, DiscountFixed } from './DiscountVoucher';
2
- import { CustomersCreateBody } from './Customers';
3
- import { StackableOptions, StackableRedeemableInapplicableResponse, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableSkippedResponse } from './Stackable';
4
- import { ValidationSessionParams, ValidationSessionResponse } from './ValidateSession';
5
- import { ApplicableToResultList } from './ApplicableTo';
6
- import { ValidationError } from './ValidationError';
7
- import { OrdersItem, OrdersCreate, OrdersCreateResponse } from './Orders';
8
- import { PromotionsValidateParams } from './Promotions';
9
- export interface ValidationsValidateVoucherParams {
10
- customer?: {
11
- id?: string;
12
- source_id?: string;
13
- name?: string;
14
- email?: string;
15
- description?: string;
16
- metadata?: Record<string, any>;
17
- };
18
- order?: {
19
- id?: string;
20
- source_id?: string;
21
- amount?: number;
22
- items?: OrdersItem[];
23
- metadata?: Record<string, any>;
24
- };
25
- gift?: {
26
- credits: number;
27
- };
28
- reward?: {
29
- id: string;
30
- };
31
- session?: ValidationSessionParams;
32
- }
33
- export interface ValidationsValidateVoucherResponse {
34
- applicable_to?: ApplicableToResultList;
35
- inapplicable_to?: ApplicableToResultList;
36
- campaign?: string;
37
- campaign_id?: string;
38
- metadata?: Record<string, any>;
39
- code?: string;
40
- valid?: boolean;
41
- discount?: DiscountAmount | DiscountUnit | DiscountPercent | DiscountFixed;
42
- gift?: {
43
- amount: number;
44
- balance: number;
45
- };
46
- loyalty?: {
47
- points_cost: number;
48
- };
49
- order?: {
50
- amount: number;
51
- discount_amount: number;
52
- total_discount_amount: number;
53
- total_amount: number;
54
- applied_discount_amount?: number;
55
- total_applied_discount_amount?: number;
56
- items?: OrdersItem[];
57
- initial_amount?: number;
58
- items_discount_amount?: number;
59
- items_applied_discount_amount?: number;
60
- metadata?: Record<string, any>;
61
- };
62
- session?: ValidationSessionParams;
63
- start_date?: string;
64
- expiration_date?: string;
65
- tracking_id: string;
66
- error?: ValidationError;
67
- }
68
- export interface ValidationsValidateStackableParams {
69
- options?: StackableOptions;
70
- redeemables: StackableRedeemableParams[];
71
- session?: ValidationSessionParams;
72
- order?: OrdersCreate;
73
- customer?: CustomersCreateBody;
74
- metadata?: Record<string, any>;
75
- }
76
- export interface ValidationValidateStackableResponse {
77
- valid: boolean;
78
- tracking_id?: string;
79
- session?: ValidationSessionResponse;
80
- order?: OrdersCreateResponse;
81
- redeemables?: StackableRedeemableResponse[];
82
- skipped_redeemables?: StackableRedeemableSkippedResponse[];
83
- inapplicable_redeemables?: StackableRedeemableInapplicableResponse[];
84
- stacking_rules: ValidationsStackingRules;
85
- }
86
- export declare type ValidationsStackingRules = {
87
- redeemables_limit: number;
88
- applicable_redeemables_limit: number;
89
- applicable_redeemables_per_category_limit?: number;
90
- applicable_exclusive_redeemables_limit: number;
91
- applicable_exclusive_redeemables_per_category_limit?: number;
92
- exclusive_categories: string[];
93
- joint_categories: string[];
94
- redeemables_application_mode: 'ALL' | 'PARTIAL';
95
- redeemables_sorting_rule: 'CATEGORY_HIERARCHY' | 'REQUESTED_ORDER';
96
- };
97
- export declare type ValidationsValidateCode = PromotionsValidateParams;
98
- export declare type ValidationsValidateContext = ValidationsValidateVoucherParams;
1
+ import { DiscountAmount, DiscountUnit, DiscountPercent, DiscountFixed } from './DiscountVoucher.js';
2
+ import { CustomersCreateBody } from './Customers.js';
3
+ import { StackableOptions, StackableRedeemableParams, StackableRedeemableResponse, StackableRedeemableSkippedResponse, StackableRedeemableInapplicableResponse } from './Stackable.js';
4
+ import { ValidationSessionParams, ValidationSessionResponse } from './ValidateSession.js';
5
+ import { ApplicableToResultList } from './ApplicableTo.js';
6
+ import { ValidationError } from './ValidationError.js';
7
+ import { OrdersCreate, OrdersCreateResponse, OrdersItem } from './Orders.js';
8
+ import { PromotionsValidateParams } from './Promotions.js';
9
+ import './Rewards.js';
10
+ import './Gift.js';
11
+ import './Products.js';
12
+ import './Loyalties.js';
13
+ import './ValidationRules.js';
14
+ import './Vouchers.js';
15
+ import './Categories.js';
16
+ import './PromotionTiers.js';
17
+
18
+ interface ValidationsValidateVoucherParams {
19
+ customer?: {
20
+ id?: string;
21
+ source_id?: string;
22
+ name?: string;
23
+ email?: string;
24
+ description?: string;
25
+ metadata?: Record<string, any>;
26
+ };
27
+ order?: {
28
+ id?: string;
29
+ source_id?: string;
30
+ amount?: number;
31
+ items?: OrdersItem[];
32
+ metadata?: Record<string, any>;
33
+ };
34
+ gift?: {
35
+ credits: number;
36
+ };
37
+ reward?: {
38
+ id: string;
39
+ };
40
+ session?: ValidationSessionParams;
41
+ }
42
+ interface ValidationsValidateVoucherResponse {
43
+ applicable_to?: ApplicableToResultList;
44
+ inapplicable_to?: ApplicableToResultList;
45
+ campaign?: string;
46
+ campaign_id?: string;
47
+ metadata?: Record<string, any>;
48
+ code?: string;
49
+ valid?: boolean;
50
+ discount?: DiscountAmount | DiscountUnit | DiscountPercent | DiscountFixed;
51
+ gift?: {
52
+ amount: number;
53
+ balance: number;
54
+ };
55
+ loyalty?: {
56
+ points_cost: number;
57
+ };
58
+ order?: {
59
+ amount: number;
60
+ discount_amount: number;
61
+ total_discount_amount: number;
62
+ total_amount: number;
63
+ applied_discount_amount?: number;
64
+ total_applied_discount_amount?: number;
65
+ items?: OrdersItem[];
66
+ initial_amount?: number;
67
+ items_discount_amount?: number;
68
+ items_applied_discount_amount?: number;
69
+ metadata?: Record<string, any>;
70
+ };
71
+ session?: ValidationSessionParams;
72
+ start_date?: string;
73
+ expiration_date?: string;
74
+ tracking_id: string;
75
+ error?: ValidationError;
76
+ }
77
+ interface ValidationsValidateStackableParams {
78
+ options?: StackableOptions;
79
+ redeemables: StackableRedeemableParams[];
80
+ session?: ValidationSessionParams;
81
+ order?: OrdersCreate;
82
+ customer?: CustomersCreateBody;
83
+ metadata?: Record<string, any>;
84
+ }
85
+ interface ValidationValidateStackableResponse {
86
+ valid: boolean;
87
+ tracking_id?: string;
88
+ session?: ValidationSessionResponse;
89
+ order?: OrdersCreateResponse;
90
+ redeemables?: StackableRedeemableResponse[];
91
+ skipped_redeemables?: StackableRedeemableSkippedResponse[];
92
+ inapplicable_redeemables?: StackableRedeemableInapplicableResponse[];
93
+ stacking_rules: ValidationsStackingRules;
94
+ }
95
+ type ValidationsStackingRules = {
96
+ redeemables_limit: number;
97
+ applicable_redeemables_limit: number;
98
+ applicable_redeemables_per_category_limit?: number;
99
+ applicable_exclusive_redeemables_limit: number;
100
+ applicable_exclusive_redeemables_per_category_limit?: number;
101
+ exclusive_categories: string[];
102
+ joint_categories: string[];
103
+ redeemables_application_mode: 'ALL' | 'PARTIAL';
104
+ redeemables_sorting_rule: 'CATEGORY_HIERARCHY' | 'REQUESTED_ORDER';
105
+ };
106
+ type ValidationsValidateCode = PromotionsValidateParams;
107
+ type ValidationsValidateContext = ValidationsValidateVoucherParams;
108
+
109
+ export type { ValidationValidateStackableResponse, ValidationsStackingRules, ValidationsValidateCode, ValidationsValidateContext, ValidationsValidateStackableParams, ValidationsValidateVoucherParams, ValidationsValidateVoucherResponse };