@voucherify/sdk 2.9.2 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ApiLimitsHandler.d.ts +13 -10
- package/dist/AsyncActions.d.ts +17 -15
- package/dist/Balance.d.ts +15 -12
- package/dist/Campaigns.d.ts +66 -58
- package/dist/Categories.d.ts +29 -26
- package/dist/ClientSide.d.ts +77 -53
- package/dist/Consents.d.ts +13 -10
- package/dist/Customers.d.ts +75 -72
- package/dist/Distributions.d.ts +29 -22
- package/dist/Events.d.ts +15 -10
- package/dist/Exports.d.ts +25 -22
- package/dist/Loyalties.d.ts +171 -159
- package/dist/MetadataSchemas.d.ts +17 -14
- package/dist/Orders.d.ts +32 -27
- package/dist/ProductCollections.d.ts +30 -26
- package/dist/Products.d.ts +66 -63
- package/dist/PromotionTiers.d.ts +43 -34
- package/dist/Promotions.d.ts +30 -18
- package/dist/PromotionsStacks.d.ts +34 -30
- package/dist/Qualifications.d.ts +24 -10
- package/dist/Redemptions.d.ts +53 -35
- package/dist/RequestController.d.ts +31 -29
- package/dist/Rewards.d.ts +46 -43
- package/dist/Segments.d.ts +25 -22
- package/dist/ValidationRules.d.ts +47 -43
- package/dist/Validations.d.ts +39 -17
- package/dist/VoucherifyClientSide.d.ts +112 -86
- package/dist/VoucherifyError.d.ts +23 -20
- package/dist/VoucherifyServerSide.d.ts +170 -131
- package/dist/Vouchers.d.ts +84 -78
- package/dist/helpers.d.ts +20 -18
- package/dist/index.d.ts +63 -25
- package/dist/types/ApplicableTo.d.ts +32 -30
- package/dist/types/AsyncActions.d.ts +23 -21
- package/dist/types/Balance.d.ts +18 -16
- package/dist/types/Campaigns.d.ts +124 -120
- package/dist/types/Categories.d.ts +40 -38
- package/dist/types/ClientSide.d.ts +145 -134
- package/dist/types/Consents.d.ts +34 -33
- package/dist/types/Customers.d.ts +363 -361
- package/dist/types/DiscountVoucher.d.ts +94 -93
- package/dist/types/Distributions.d.ts +148 -144
- package/dist/types/Events.d.ts +21 -17
- package/dist/types/Exports.d.ts +151 -149
- package/dist/types/Gift.d.ts +5 -3
- package/dist/types/Loyalties.d.ts +1061 -1057
- package/dist/types/MetadataSchemas.d.ts +34 -33
- package/dist/types/Orders.d.ts +199 -195
- package/dist/types/ProductCollections.d.ts +99 -96
- package/dist/types/Products.d.ts +108 -106
- package/dist/types/PromotionTiers.d.ts +131 -127
- package/dist/types/Promotions.d.ts +113 -108
- package/dist/types/PromotionsStacks.d.ts +74 -71
- package/dist/types/Qualifications.d.ts +92 -86
- package/dist/types/Redemptions.d.ts +215 -205
- package/dist/types/Rewards.d.ts +220 -219
- package/dist/types/Segments.d.ts +34 -32
- package/dist/types/Stackable.d.ts +106 -101
- package/dist/types/UtilityTypes.d.ts +5 -3
- package/dist/types/ValidateSession.d.ts +19 -17
- package/dist/types/ValidationError.d.ts +9 -7
- package/dist/types/ValidationRules.d.ts +96 -93
- package/dist/types/Validations.d.ts +109 -98
- package/dist/types/Vouchers.d.ts +452 -364
- package/dist/types/index.d.ts +27 -25
- package/dist/voucherifysdk.cjs +2023 -0
- package/dist/voucherifysdk.cjs.map +1 -0
- package/dist/voucherifysdk.esm.js +981 -1256
- package/dist/voucherifysdk.esm.js.map +1 -1
- package/package.json +13 -9
- package/CHANGELOG.md +0 -663
- package/dist/voucherifysdk.umd.development.js +0 -2270
- package/dist/voucherifysdk.umd.development.js.map +0 -1
- package/dist/voucherifysdk.umd.production.min.js +0 -2
- package/dist/voucherifysdk.umd.production.min.js.map +0 -1
|
@@ -1,96 +1,99 @@
|
|
|
1
|
-
import { WithRequiredProperty } from './UtilityTypes';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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 };
|
package/dist/types/Products.d.ts
CHANGED
|
@@ -1,106 +1,108 @@
|
|
|
1
|
-
|
|
2
|
-
name?: string;
|
|
3
|
-
source_id?: string;
|
|
4
|
-
price?: number;
|
|
5
|
-
attributes?: string[];
|
|
6
|
-
metadata?: Record<string, any>;
|
|
7
|
-
image_url?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
skus?: {
|
|
11
|
-
object: 'list';
|
|
12
|
-
total: number;
|
|
13
|
-
data?: ProductsGetSkuResponse[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
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
|
-
|
|
28
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
source_ids: string[];
|
|
40
|
-
metadata: Record<string, any>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
async_action_id: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
async_action_id: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
force?: boolean;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
page?: number;
|
|
54
|
-
limit?: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
object: 'list';
|
|
58
|
-
total: number;
|
|
59
|
-
data_ref: 'products';
|
|
60
|
-
products: ProductsGetResponse[];
|
|
61
|
-
}
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
id?: string;
|
|
86
|
-
source_id?: string;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
force?: boolean;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
object: 'list';
|
|
94
|
-
total: number;
|
|
95
|
-
skus: ProductsGetSkuResponse[];
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
id: string;
|
|
99
|
-
source_id?: string;
|
|
100
|
-
name?: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
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 };
|