@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,96 +1,99 @@
1
- import { WithRequiredProperty } from './UtilityTypes';
2
- export interface ProductIdentity {
3
- id?: string;
4
- object?: 'product';
5
- }
6
- export interface SkuIdentity {
7
- id?: string;
8
- product_id?: string;
9
- object?: 'sku';
10
- }
11
- export interface ProductBase {
12
- name?: string | null;
13
- price?: number | null;
14
- attributes?: string[];
15
- metadata?: Record<string, unknown>;
16
- }
17
- export interface SkuBase {
18
- sku?: string | null;
19
- price?: number | null;
20
- attributes?: Record<string, unknown>;
21
- metadata?: Record<string, unknown>;
22
- product?: Required<ProductIdentity> & Required<ProductBase> & {
23
- source_id: string | null;
24
- object: 'product';
25
- };
26
- image_url?: string | null;
27
- }
28
- export interface ProductSaved {
29
- created_at?: string;
30
- updated_at?: string | null;
31
- image_url?: string | null;
32
- object?: 'product';
33
- }
34
- export interface SkuSaved {
35
- created_at?: string;
36
- updated_at?: string | null;
37
- image_url?: string | null;
38
- object?: 'sku';
39
- }
40
- export declare type ProductOrSkuIdentity = Required<SkuIdentity> | Required<ProductIdentity>;
41
- export interface ProductCollectionIdentity {
42
- id?: string;
43
- }
44
- export interface ProductCollectionSaved {
45
- created_at?: string;
46
- object?: 'products_collection';
47
- }
48
- export declare type ProductCollectionBase = StaticProductCollectionBase | DynamicProductCollectionBase;
49
- export interface StaticProductCollectionBase {
50
- name?: string;
51
- type?: 'STATIC';
52
- products?: ProductOrSkuIdentity[];
53
- }
54
- export interface DynamicProductCollectionBase {
55
- name?: string;
56
- type?: 'AUTO_UPDATE';
57
- filter?: Filter;
58
- }
59
- export declare type ProductCollection = ProductCollectionBase & ProductCollectionIdentity & ProductCollectionSaved;
60
- export declare type Filter = Partial<Record<string, Junction | {
61
- conditions: Partial<Record<FiltersCondition, unknown>>;
62
- }>>;
63
- export declare type Junction = 'and' | 'AND' | 'or' | 'OR';
64
- /**
65
- * @deprecated
66
- */
67
- export declare type AllowedFiltersKeys = 'id' | 'name' | 'attributes' | 'source_id' | 'price' | 'image_url' | 'product_id' | 'skus' | 'created_at' | 'updated_at' | 'object' | `metadata.${string}`;
68
- export declare type FiltersCondition = '$in' | '$not_in' | '$is' | '$is_days_ago' | '$is_days_in_future' | '$is_not' | '$has_value' | '$is_unknown' | '$contains' | '$not_contain' | '$starts_with' | '$ends_with' | '$more_than' | '$less_than' | '$more_than_ago' | '$less_than_ago' | '$more_than_future' | '$less_than_future' | '$more_than_equal' | '$less_than_equal' | '$after' | '$before' | '$count' | '$count_less' | '$count_more';
69
- export declare type ProductCollectionsCreateRequestBody = WithRequiredProperty<StaticProductCollectionBase, 'name' | 'type'> | Required<DynamicProductCollectionBase>;
70
- export declare type ProductCollectionsCreateResponseBody = Required<ProductCollectionBase> & Required<ProductCollectionIdentity> & Required<ProductCollectionSaved>;
71
- export interface ProductCollectionsListRequestQuery {
72
- limit?: number;
73
- page?: number;
74
- order?: 'created_at' | '-created_at';
75
- }
76
- export interface ProductCollectionsListResponseBody {
77
- object: 'list';
78
- data_ref: 'data';
79
- data: Required<ProductCollection>[];
80
- total: number;
81
- }
82
- export declare type ProductCollectionsGetResponseBody = Required<ProductCollection>;
83
- export interface ProductCollectionsListProductsRequestQuery {
84
- limit?: number;
85
- page?: number;
86
- }
87
- export interface ProductCollectionsListProductsResponseBody {
88
- object: 'list';
89
- data_ref: 'data';
90
- data: ((Required<SkuIdentity> & Required<SkuSaved> & Required<SkuBase> & {
91
- source_id: string | null;
92
- }) | (Required<ProductIdentity> & Required<ProductSaved> & Required<ProductBase> & {
93
- source_id: string | null;
94
- }))[];
95
- total: number;
96
- }
1
+ import { WithRequiredProperty } from './UtilityTypes.js';
2
+
3
+ interface ProductIdentity {
4
+ id?: string;
5
+ object?: 'product';
6
+ }
7
+ interface SkuIdentity {
8
+ id?: string;
9
+ product_id?: string;
10
+ object?: 'sku';
11
+ }
12
+ interface ProductBase {
13
+ name?: string | null;
14
+ price?: number | null;
15
+ attributes?: string[];
16
+ metadata?: Record<string, unknown>;
17
+ }
18
+ interface SkuBase {
19
+ sku?: string | null;
20
+ price?: number | null;
21
+ attributes?: Record<string, unknown>;
22
+ metadata?: Record<string, unknown>;
23
+ product?: Required<ProductIdentity> & Required<ProductBase> & {
24
+ source_id: string | null;
25
+ object: 'product';
26
+ };
27
+ image_url?: string | null;
28
+ }
29
+ interface ProductSaved {
30
+ created_at?: string;
31
+ updated_at?: string | null;
32
+ image_url?: string | null;
33
+ object?: 'product';
34
+ }
35
+ interface SkuSaved {
36
+ created_at?: string;
37
+ updated_at?: string | null;
38
+ image_url?: string | null;
39
+ object?: 'sku';
40
+ }
41
+ type ProductOrSkuIdentity = Required<SkuIdentity> | Required<ProductIdentity>;
42
+ interface ProductCollectionIdentity {
43
+ id?: string;
44
+ }
45
+ interface ProductCollectionSaved {
46
+ created_at?: string;
47
+ object?: 'products_collection';
48
+ }
49
+ type ProductCollectionBase = StaticProductCollectionBase | DynamicProductCollectionBase;
50
+ interface StaticProductCollectionBase {
51
+ name?: string;
52
+ type?: 'STATIC';
53
+ products?: ProductOrSkuIdentity[];
54
+ }
55
+ interface DynamicProductCollectionBase {
56
+ name?: string;
57
+ type?: 'AUTO_UPDATE';
58
+ filter?: Filter;
59
+ }
60
+ type ProductCollection = ProductCollectionBase & ProductCollectionIdentity & ProductCollectionSaved;
61
+ type Filter = Partial<Record<string, Junction | {
62
+ conditions: Partial<Record<FiltersCondition, unknown>>;
63
+ }>>;
64
+ declare type Junction = 'and' | 'AND' | 'or' | 'OR';
65
+ /**
66
+ * @deprecated
67
+ */
68
+ type AllowedFiltersKeys = 'id' | 'name' | 'attributes' | 'source_id' | 'price' | 'image_url' | 'product_id' | 'skus' | 'created_at' | 'updated_at' | 'object' | `metadata.${string}`;
69
+ declare type FiltersCondition = '$in' | '$not_in' | '$is' | '$is_days_ago' | '$is_days_in_future' | '$is_not' | '$has_value' | '$is_unknown' | '$contains' | '$not_contain' | '$starts_with' | '$ends_with' | '$more_than' | '$less_than' | '$more_than_ago' | '$less_than_ago' | '$more_than_future' | '$less_than_future' | '$more_than_equal' | '$less_than_equal' | '$after' | '$before' | '$count' | '$count_less' | '$count_more';
70
+ type ProductCollectionsCreateRequestBody = WithRequiredProperty<StaticProductCollectionBase, 'name' | 'type'> | Required<DynamicProductCollectionBase>;
71
+ type ProductCollectionsCreateResponseBody = Required<ProductCollectionBase> & Required<ProductCollectionIdentity> & Required<ProductCollectionSaved>;
72
+ interface ProductCollectionsListRequestQuery {
73
+ limit?: number;
74
+ page?: number;
75
+ order?: 'created_at' | '-created_at';
76
+ }
77
+ interface ProductCollectionsListResponseBody {
78
+ object: 'list';
79
+ data_ref: 'data';
80
+ data: Required<ProductCollection>[];
81
+ total: number;
82
+ }
83
+ type ProductCollectionsGetResponseBody = Required<ProductCollection>;
84
+ interface ProductCollectionsListProductsRequestQuery {
85
+ limit?: number;
86
+ page?: number;
87
+ }
88
+ interface ProductCollectionsListProductsResponseBody {
89
+ object: 'list';
90
+ data_ref: 'data';
91
+ data: ((Required<SkuIdentity> & Required<SkuSaved> & Required<SkuBase> & {
92
+ source_id: string | null;
93
+ }) | (Required<ProductIdentity> & Required<ProductSaved> & Required<ProductBase> & {
94
+ source_id: string | null;
95
+ }))[];
96
+ total: number;
97
+ }
98
+
99
+ export type { AllowedFiltersKeys, DynamicProductCollectionBase, Filter, FiltersCondition, Junction, ProductBase, ProductCollection, ProductCollectionBase, ProductCollectionIdentity, ProductCollectionSaved, ProductCollectionsCreateRequestBody, ProductCollectionsCreateResponseBody, ProductCollectionsGetResponseBody, ProductCollectionsListProductsRequestQuery, ProductCollectionsListProductsResponseBody, ProductCollectionsListRequestQuery, ProductCollectionsListResponseBody, ProductIdentity, ProductOrSkuIdentity, ProductSaved, SkuBase, SkuIdentity, SkuSaved, StaticProductCollectionBase };
@@ -1,106 +1,108 @@
1
- export interface ProductsCreate {
2
- name?: string;
3
- source_id?: string;
4
- price?: number;
5
- attributes?: string[];
6
- metadata?: Record<string, any>;
7
- image_url?: string;
8
- }
9
- export interface ProductsGetResponseSkus {
10
- skus?: {
11
- object: 'list';
12
- total: number;
13
- data?: ProductsGetSkuResponse[];
14
- };
15
- }
16
- export interface ProductsCreateResponse {
17
- id: string;
18
- source_id?: string;
19
- object: 'product';
20
- name?: string;
21
- price?: number;
22
- attributes?: string[];
23
- created_at: string;
24
- image_url?: string;
25
- metadata?: Record<string, any>;
26
- }
27
- export declare type ProductsGetResponse = ProductsCreateResponse & ProductsGetResponseSkus;
28
- export declare type ProductsUpdate = {
29
- name?: string;
30
- id?: string;
31
- source_id?: string;
32
- attributes?: string[];
33
- price?: number;
34
- image_url?: string;
35
- metadata?: Record<string, any>;
36
- };
37
- export declare type ProductsUpdateResponse = ProductsCreateResponse;
38
- export interface ProductsBulkUpdateMetadata {
39
- source_ids: string[];
40
- metadata: Record<string, any>;
41
- }
42
- export declare type ProductsBulkUpdate = ProductsCreate[];
43
- export declare type ProductsBulkUpdateResponse = {
44
- async_action_id: string;
45
- };
46
- export declare type ProductsBulkUpdateMetadataResponse = {
47
- async_action_id: string;
48
- };
49
- export interface ProductsDeleteParams {
50
- force?: boolean;
51
- }
52
- export interface ProductsListParams {
53
- page?: number;
54
- limit?: number;
55
- }
56
- export interface ProductsListResponse {
57
- object: 'list';
58
- total: number;
59
- data_ref: 'products';
60
- products: ProductsGetResponse[];
61
- }
62
- export interface ProductsCreateSku {
63
- sku: string;
64
- source_id?: string;
65
- attributes?: Record<string, string>;
66
- metadata?: Record<string, any>;
67
- price?: number;
68
- image_url?: string;
69
- currency?: string;
70
- }
71
- export interface ProductsCreateSkuResponse {
72
- id: string;
73
- source_id?: string;
74
- sku?: string;
75
- price?: number;
76
- attributes?: Record<string, string>;
77
- metadata?: Record<string, any>;
78
- updated_at?: string;
79
- currency?: string;
80
- created_at: string;
81
- object: 'sku';
82
- }
83
- export declare type ProductsGetSkuResponse = ProductsCreateSkuResponse;
84
- export declare type ProductsUpdateSku = ProductsCreateSku & {
85
- id?: string;
86
- source_id?: string;
87
- };
88
- export declare type ProductsUpdateSkuResponse = ProductsGetSkuResponse;
89
- export interface ProductsDeleteSkuParams {
90
- force?: boolean;
91
- }
92
- export interface ProductsListSkus {
93
- object: 'list';
94
- total: number;
95
- skus: ProductsGetSkuResponse[];
96
- }
97
- export interface SimpleProduct {
98
- id: string;
99
- source_id?: string;
100
- name?: string;
101
- }
102
- export interface SimpleSku {
103
- id: string;
104
- source_id?: string;
105
- sku?: string;
106
- }
1
+ interface ProductsCreate {
2
+ name?: string;
3
+ source_id?: string;
4
+ price?: number;
5
+ attributes?: string[];
6
+ metadata?: Record<string, any>;
7
+ image_url?: string;
8
+ }
9
+ interface ProductsGetResponseSkus {
10
+ skus?: {
11
+ object: 'list';
12
+ total: number;
13
+ data?: ProductsGetSkuResponse[];
14
+ };
15
+ }
16
+ interface ProductsCreateResponse {
17
+ id: string;
18
+ source_id?: string;
19
+ object: 'product';
20
+ name?: string;
21
+ price?: number;
22
+ attributes?: string[];
23
+ created_at: string;
24
+ image_url?: string;
25
+ metadata?: Record<string, any>;
26
+ }
27
+ type ProductsGetResponse = ProductsCreateResponse & ProductsGetResponseSkus;
28
+ type ProductsUpdate = {
29
+ name?: string;
30
+ id?: string;
31
+ source_id?: string;
32
+ attributes?: string[];
33
+ price?: number;
34
+ image_url?: string;
35
+ metadata?: Record<string, any>;
36
+ };
37
+ type ProductsUpdateResponse = ProductsCreateResponse;
38
+ interface ProductsBulkUpdateMetadata {
39
+ source_ids: string[];
40
+ metadata: Record<string, any>;
41
+ }
42
+ type ProductsBulkUpdate = ProductsCreate[];
43
+ type ProductsBulkUpdateResponse = {
44
+ async_action_id: string;
45
+ };
46
+ type ProductsBulkUpdateMetadataResponse = {
47
+ async_action_id: string;
48
+ };
49
+ interface ProductsDeleteParams {
50
+ force?: boolean;
51
+ }
52
+ interface ProductsListParams {
53
+ page?: number;
54
+ limit?: number;
55
+ }
56
+ interface ProductsListResponse {
57
+ object: 'list';
58
+ total: number;
59
+ data_ref: 'products';
60
+ products: ProductsGetResponse[];
61
+ }
62
+ interface ProductsCreateSku {
63
+ sku: string;
64
+ source_id?: string;
65
+ attributes?: Record<string, string>;
66
+ metadata?: Record<string, any>;
67
+ price?: number;
68
+ image_url?: string;
69
+ currency?: string;
70
+ }
71
+ interface ProductsCreateSkuResponse {
72
+ id: string;
73
+ source_id?: string;
74
+ sku?: string;
75
+ price?: number;
76
+ attributes?: Record<string, string>;
77
+ metadata?: Record<string, any>;
78
+ updated_at?: string;
79
+ currency?: string;
80
+ created_at: string;
81
+ object: 'sku';
82
+ }
83
+ type ProductsGetSkuResponse = ProductsCreateSkuResponse;
84
+ type ProductsUpdateSku = ProductsCreateSku & {
85
+ id?: string;
86
+ source_id?: string;
87
+ };
88
+ type ProductsUpdateSkuResponse = ProductsGetSkuResponse;
89
+ interface ProductsDeleteSkuParams {
90
+ force?: boolean;
91
+ }
92
+ interface ProductsListSkus {
93
+ object: 'list';
94
+ total: number;
95
+ skus: ProductsGetSkuResponse[];
96
+ }
97
+ interface SimpleProduct {
98
+ id: string;
99
+ source_id?: string;
100
+ name?: string;
101
+ }
102
+ interface SimpleSku {
103
+ id: string;
104
+ source_id?: string;
105
+ sku?: string;
106
+ }
107
+
108
+ export type { ProductsBulkUpdate, ProductsBulkUpdateMetadata, ProductsBulkUpdateMetadataResponse, ProductsBulkUpdateResponse, ProductsCreate, ProductsCreateResponse, ProductsCreateSku, ProductsCreateSkuResponse, ProductsDeleteParams, ProductsDeleteSkuParams, ProductsGetResponse, ProductsGetResponseSkus, ProductsGetSkuResponse, ProductsListParams, ProductsListResponse, ProductsListSkus, ProductsUpdate, ProductsUpdateResponse, ProductsUpdateSku, ProductsUpdateSkuResponse, SimpleProduct, SimpleSku };