@spree/sdk 0.6.0 → 0.6.2
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/README.md +31 -11
- package/dist/index.cjs +70 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.js +70 -11
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +57 -41
- package/dist/types/index.d.ts +57 -41
- package/dist/zod/index.cjs +4 -22
- package/dist/zod/index.cjs.map +1 -1
- package/dist/zod/index.d.cts +8 -24
- package/dist/zod/index.d.ts +8 -24
- package/dist/zod/index.js +5 -21
- package/dist/zod/index.js.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ type StoreAddress = {
|
|
|
13
13
|
country_iso: string;
|
|
14
14
|
state_text: string | null;
|
|
15
15
|
state_abbr: string | null;
|
|
16
|
+
quick_checkout: boolean;
|
|
16
17
|
state_name: string | null;
|
|
17
18
|
};
|
|
18
19
|
|
|
@@ -91,6 +92,7 @@ type AdminOrder = {
|
|
|
91
92
|
currency: string;
|
|
92
93
|
locale: string | null;
|
|
93
94
|
item_count: number;
|
|
95
|
+
state_lock_version: number;
|
|
94
96
|
shipment_state: string | null;
|
|
95
97
|
payment_state: string | null;
|
|
96
98
|
item_total: string;
|
|
@@ -536,6 +538,7 @@ type StoreOrder = {
|
|
|
536
538
|
currency: string;
|
|
537
539
|
locale: string | null;
|
|
538
540
|
item_count: number;
|
|
541
|
+
state_lock_version: number;
|
|
539
542
|
shipment_state: string | null;
|
|
540
543
|
payment_state: string | null;
|
|
541
544
|
item_total: string;
|
|
@@ -627,27 +630,6 @@ type StorePaymentSource = {
|
|
|
627
630
|
gateway_payment_profile_id: string | null;
|
|
628
631
|
};
|
|
629
632
|
|
|
630
|
-
type StorePostCategory = {
|
|
631
|
-
id: string;
|
|
632
|
-
title: string;
|
|
633
|
-
slug: string;
|
|
634
|
-
created_at: string;
|
|
635
|
-
updated_at: string;
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
type StorePost = {
|
|
639
|
-
id: string;
|
|
640
|
-
title: string;
|
|
641
|
-
slug: string;
|
|
642
|
-
meta_title: string | null;
|
|
643
|
-
meta_description: string | null;
|
|
644
|
-
published_at: string | null;
|
|
645
|
-
created_at: string;
|
|
646
|
-
updated_at: string;
|
|
647
|
-
author_id: string | null;
|
|
648
|
-
post_category_id: string | null;
|
|
649
|
-
};
|
|
650
|
-
|
|
651
633
|
type StorePrice = {
|
|
652
634
|
id: string;
|
|
653
635
|
amount: string | null;
|
|
@@ -967,6 +949,11 @@ type StoreWishlist = {
|
|
|
967
949
|
items?: Array<StoreWishedItem>;
|
|
968
950
|
};
|
|
969
951
|
|
|
952
|
+
interface LocaleDefaults {
|
|
953
|
+
locale?: string;
|
|
954
|
+
currency?: string;
|
|
955
|
+
country?: string;
|
|
956
|
+
}
|
|
970
957
|
interface PaginationMeta {
|
|
971
958
|
page: number;
|
|
972
959
|
limit: number;
|
|
@@ -1007,24 +994,52 @@ interface RegisterParams {
|
|
|
1007
994
|
interface ListParams {
|
|
1008
995
|
page?: number;
|
|
1009
996
|
per_page?: number;
|
|
1010
|
-
|
|
997
|
+
/** Associations to include. Accepts array or comma-separated string. */
|
|
998
|
+
includes?: string[] | string;
|
|
1011
999
|
}
|
|
1012
1000
|
interface ProductListParams extends ListParams {
|
|
1013
|
-
'
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1001
|
+
/** Sort: 'price asc', 'price desc', 'best_selling', 'name asc', 'name desc', 'available_on desc', 'available_on asc' */
|
|
1002
|
+
sort?: string;
|
|
1003
|
+
/** Full-text search across name and SKU */
|
|
1004
|
+
multi_search?: string;
|
|
1005
|
+
/** Filter: name contains */
|
|
1006
|
+
name_cont?: string;
|
|
1007
|
+
/** Filter: price >= value */
|
|
1008
|
+
price_gte?: number;
|
|
1009
|
+
/** Filter: price <= value */
|
|
1010
|
+
price_lte?: number;
|
|
1011
|
+
/** Filter by option value prefix IDs */
|
|
1012
|
+
with_option_value_ids?: string[];
|
|
1013
|
+
/** Filter: only in-stock products */
|
|
1014
|
+
in_stock?: boolean;
|
|
1015
|
+
/** Filter: only out-of-stock products */
|
|
1016
|
+
out_of_stock?: boolean;
|
|
1017
|
+
/** Filter: products in taxon */
|
|
1018
|
+
taxons_id_eq?: string;
|
|
1019
|
+
/** Any additional Ransack predicate */
|
|
1020
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1017
1021
|
}
|
|
1018
1022
|
interface TaxonListParams extends ListParams {
|
|
1019
|
-
'
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
+
/** Sort order, e.g. 'name asc', 'created_at desc' */
|
|
1024
|
+
sort?: string;
|
|
1025
|
+
/** Filter: name contains */
|
|
1026
|
+
name_cont?: string;
|
|
1027
|
+
taxonomy_id_eq?: string | number;
|
|
1028
|
+
parent_id_eq?: string | number;
|
|
1029
|
+
depth_eq?: number;
|
|
1030
|
+
/** Any additional Ransack predicate */
|
|
1031
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1023
1032
|
}
|
|
1024
1033
|
interface OrderListParams extends ListParams {
|
|
1025
|
-
'
|
|
1026
|
-
|
|
1027
|
-
|
|
1034
|
+
/** Sort order, e.g. 'completed_at desc' */
|
|
1035
|
+
sort?: string;
|
|
1036
|
+
/** Full-text search across number, email, customer name */
|
|
1037
|
+
multi_search?: string;
|
|
1038
|
+
state_eq?: string;
|
|
1039
|
+
completed_at_gte?: string;
|
|
1040
|
+
completed_at_lte?: string;
|
|
1041
|
+
/** Any additional Ransack predicate */
|
|
1042
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1028
1043
|
}
|
|
1029
1044
|
interface CreateCartParams {
|
|
1030
1045
|
/** Arbitrary key-value metadata (stored, not returned in responses) */
|
|
@@ -1056,6 +1071,8 @@ interface AddressParams {
|
|
|
1056
1071
|
state_abbr?: string;
|
|
1057
1072
|
/** State name - used for countries without predefined states */
|
|
1058
1073
|
state_name?: string;
|
|
1074
|
+
/** When true, relaxes validation requirements (name, phone, zipcode, street) */
|
|
1075
|
+
quick_checkout?: boolean;
|
|
1059
1076
|
}
|
|
1060
1077
|
interface UpdateOrderParams {
|
|
1061
1078
|
email?: string;
|
|
@@ -1095,20 +1112,22 @@ interface CompletePaymentSetupSessionParams {
|
|
|
1095
1112
|
}
|
|
1096
1113
|
interface FilterOption {
|
|
1097
1114
|
id: string;
|
|
1098
|
-
label: string;
|
|
1099
1115
|
count: number;
|
|
1100
1116
|
}
|
|
1101
1117
|
interface OptionFilterOption extends FilterOption {
|
|
1102
1118
|
name: string;
|
|
1119
|
+
presentation: string;
|
|
1103
1120
|
position: number;
|
|
1104
1121
|
}
|
|
1105
|
-
interface TaxonFilterOption
|
|
1122
|
+
interface TaxonFilterOption {
|
|
1123
|
+
id: string;
|
|
1124
|
+
name: string;
|
|
1106
1125
|
permalink: string;
|
|
1126
|
+
count: number;
|
|
1107
1127
|
}
|
|
1108
1128
|
interface PriceRangeFilter {
|
|
1109
1129
|
id: 'price';
|
|
1110
1130
|
type: 'price_range';
|
|
1111
|
-
label: string;
|
|
1112
1131
|
min: number;
|
|
1113
1132
|
max: number;
|
|
1114
1133
|
currency: string;
|
|
@@ -1116,26 +1135,23 @@ interface PriceRangeFilter {
|
|
|
1116
1135
|
interface AvailabilityFilter {
|
|
1117
1136
|
id: 'availability';
|
|
1118
1137
|
type: 'availability';
|
|
1119
|
-
label: string;
|
|
1120
1138
|
options: FilterOption[];
|
|
1121
1139
|
}
|
|
1122
1140
|
interface OptionFilter {
|
|
1123
1141
|
id: string;
|
|
1124
1142
|
type: 'option';
|
|
1125
|
-
label: string;
|
|
1126
1143
|
name: string;
|
|
1144
|
+
presentation: string;
|
|
1127
1145
|
options: OptionFilterOption[];
|
|
1128
1146
|
}
|
|
1129
1147
|
interface TaxonFilter {
|
|
1130
1148
|
id: 'taxons';
|
|
1131
1149
|
type: 'taxon';
|
|
1132
|
-
label: string;
|
|
1133
1150
|
options: TaxonFilterOption[];
|
|
1134
1151
|
}
|
|
1135
1152
|
type ProductFilter = PriceRangeFilter | AvailabilityFilter | OptionFilter | TaxonFilter;
|
|
1136
1153
|
interface SortOption {
|
|
1137
1154
|
id: string;
|
|
1138
|
-
label: string;
|
|
1139
1155
|
}
|
|
1140
1156
|
interface ProductFiltersResponse {
|
|
1141
1157
|
filters: ProductFilter[];
|
|
@@ -1148,4 +1164,4 @@ interface ProductFiltersParams {
|
|
|
1148
1164
|
q?: Record<string, unknown>;
|
|
1149
1165
|
}
|
|
1150
1166
|
|
|
1151
|
-
export type { AddLineItemParams, AddressParams, AdminCustomer, AdminLineItem, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, ListParams, LoginCredentials, OptionFilter, OptionFilterOption, OrderListParams, PaginatedResponse, PaginationMeta, PriceRangeFilter, ProductFilter, ProductFiltersParams, ProductFiltersResponse, ProductListParams, RegisterParams, SortOption, StoreAddress, StoreAsset, StoreBase, StoreCountry, StoreCreditCard, StoreCurrency, StoreCustomer, StoreCustomerReturn, StoreDigital, StoreDigitalLink, StoreExport, StoreGiftCard, StoreGiftCardBatch, StoreImage, StoreImport, StoreImportRow, StoreInvitation, StoreLineItem, StoreLocale, StoreMetafield, StoreNewsletterSubscriber, StoreOptionType, StoreOptionValue, StoreOrder, StoreOrderPromotion, StorePayment, StorePaymentMethod, StorePaymentSession, StorePaymentSetupSession, StorePaymentSource,
|
|
1167
|
+
export type { AddLineItemParams, AddressParams, AdminCustomer, AdminLineItem, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, ListParams, LocaleDefaults, LoginCredentials, OptionFilter, OptionFilterOption, OrderListParams, PaginatedResponse, PaginationMeta, PriceRangeFilter, ProductFilter, ProductFiltersParams, ProductFiltersResponse, ProductListParams, RegisterParams, SortOption, StoreAddress, StoreAsset, StoreBase, StoreCountry, StoreCreditCard, StoreCurrency, StoreCustomer, StoreCustomerReturn, StoreDigital, StoreDigitalLink, StoreExport, StoreGiftCard, StoreGiftCardBatch, StoreImage, StoreImport, StoreImportRow, StoreInvitation, StoreLineItem, StoreLocale, StoreMetafield, StoreNewsletterSubscriber, StoreOptionType, StoreOptionValue, StoreOrder, StoreOrderPromotion, StorePayment, StorePaymentMethod, StorePaymentSession, StorePaymentSetupSession, StorePaymentSource, StorePrice, StoreProduct, StorePromotion, StoreRefund, StoreReimbursement, StoreReport, StoreReturnAuthorization, StoreReturnItem, StoreShipment, StoreShippingMethod, StoreShippingRate, StoreState, StoreStockItem, StoreStockLocation, StoreStockMovement, StoreStockTransfer, StoreStore, StoreStoreCredit, StoreTaxon, StoreTaxonomy, StoreVariant, StoreWishedItem, StoreWishlist, TaxonFilter, TaxonFilterOption, TaxonListParams, UpdateLineItemParams, UpdateOrderParams, UpdatePaymentSessionParams };
|
package/dist/zod/index.cjs
CHANGED
|
@@ -74,7 +74,8 @@ var StoreAddressSchema = zod.z.object({
|
|
|
74
74
|
country_iso: zod.z.string(),
|
|
75
75
|
state_text: zod.z.string().nullable(),
|
|
76
76
|
state_abbr: zod.z.string().nullable(),
|
|
77
|
-
state_name: zod.z.string().nullable()
|
|
77
|
+
state_name: zod.z.string().nullable(),
|
|
78
|
+
quick_checkout: zod.z.boolean()
|
|
78
79
|
});
|
|
79
80
|
var StoreOrderPromotionSchema = zod.z.object({
|
|
80
81
|
id: zod.z.string(),
|
|
@@ -163,6 +164,7 @@ var AdminOrderSchema = zod.z.object({
|
|
|
163
164
|
currency: zod.z.string(),
|
|
164
165
|
locale: zod.z.string().nullable(),
|
|
165
166
|
item_count: zod.z.number(),
|
|
167
|
+
state_lock_version: zod.z.number(),
|
|
166
168
|
shipment_state: zod.z.string().nullable(),
|
|
167
169
|
payment_state: zod.z.string().nullable(),
|
|
168
170
|
item_total: zod.z.string(),
|
|
@@ -629,6 +631,7 @@ var StoreOrderSchema = zod.z.object({
|
|
|
629
631
|
currency: zod.z.string(),
|
|
630
632
|
locale: zod.z.string().nullable(),
|
|
631
633
|
item_count: zod.z.number(),
|
|
634
|
+
state_lock_version: zod.z.number(),
|
|
632
635
|
shipment_state: zod.z.string().nullable(),
|
|
633
636
|
payment_state: zod.z.string().nullable(),
|
|
634
637
|
item_total: zod.z.string(),
|
|
@@ -692,25 +695,6 @@ var StorePaymentSourceSchema = zod.z.object({
|
|
|
692
695
|
id: zod.z.string(),
|
|
693
696
|
gateway_payment_profile_id: zod.z.string().nullable()
|
|
694
697
|
});
|
|
695
|
-
var StorePostSchema = zod.z.object({
|
|
696
|
-
id: zod.z.string(),
|
|
697
|
-
title: zod.z.string(),
|
|
698
|
-
slug: zod.z.string(),
|
|
699
|
-
meta_title: zod.z.string().nullable(),
|
|
700
|
-
meta_description: zod.z.string().nullable(),
|
|
701
|
-
published_at: zod.z.string().nullable(),
|
|
702
|
-
created_at: zod.z.string(),
|
|
703
|
-
updated_at: zod.z.string(),
|
|
704
|
-
author_id: zod.z.string().nullable(),
|
|
705
|
-
post_category_id: zod.z.string().nullable()
|
|
706
|
-
});
|
|
707
|
-
var StorePostCategorySchema = zod.z.object({
|
|
708
|
-
id: zod.z.string(),
|
|
709
|
-
title: zod.z.string(),
|
|
710
|
-
slug: zod.z.string(),
|
|
711
|
-
created_at: zod.z.string(),
|
|
712
|
-
updated_at: zod.z.string()
|
|
713
|
-
});
|
|
714
698
|
var StoreVariantSchema = zod.z.object({
|
|
715
699
|
id: zod.z.string(),
|
|
716
700
|
product_id: zod.z.string(),
|
|
@@ -968,8 +952,6 @@ exports.StorePaymentSchema = StorePaymentSchema;
|
|
|
968
952
|
exports.StorePaymentSessionSchema = StorePaymentSessionSchema;
|
|
969
953
|
exports.StorePaymentSetupSessionSchema = StorePaymentSetupSessionSchema;
|
|
970
954
|
exports.StorePaymentSourceSchema = StorePaymentSourceSchema;
|
|
971
|
-
exports.StorePostCategorySchema = StorePostCategorySchema;
|
|
972
|
-
exports.StorePostSchema = StorePostSchema;
|
|
973
955
|
exports.StorePriceSchema = StorePriceSchema;
|
|
974
956
|
exports.StoreProductSchema = StoreProductSchema;
|
|
975
957
|
exports.StorePromotionSchema = StorePromotionSchema;
|