@spree/sdk 0.6.7 → 0.6.9
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 +28 -2
- package/dist/index.cjs +46 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -34
- package/dist/index.d.ts +22 -34
- package/dist/index.js +46 -41
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +39 -34
- package/dist/types/index.d.ts +39 -34
- package/dist/zod/index.cjs +21 -39
- package/dist/zod/index.cjs.map +1 -1
- package/dist/zod/index.d.cts +20 -77
- package/dist/zod/index.d.ts +20 -77
- package/dist/zod/index.js +22 -39
- package/dist/zod/index.js.map +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ type AdminOrder = {
|
|
|
86
86
|
id: string;
|
|
87
87
|
number: string;
|
|
88
88
|
state: string;
|
|
89
|
+
checkout_steps: Array<string>;
|
|
89
90
|
token: string;
|
|
90
91
|
email: string | null;
|
|
91
92
|
special_instructions: string | null;
|
|
@@ -182,7 +183,7 @@ type AdminProduct = {
|
|
|
182
183
|
make_active_at: string | null;
|
|
183
184
|
discontinue_on: string | null;
|
|
184
185
|
deleted_at: string | null;
|
|
185
|
-
cost_price:
|
|
186
|
+
cost_price: string | null;
|
|
186
187
|
cost_currency: string | null;
|
|
187
188
|
};
|
|
188
189
|
|
|
@@ -252,9 +253,9 @@ type AdminVariant = {
|
|
|
252
253
|
metafields?: Array<AdminMetafield>;
|
|
253
254
|
position: number;
|
|
254
255
|
tax_category_id: string | null;
|
|
255
|
-
|
|
256
|
-
cost_price: number | null;
|
|
256
|
+
cost_price: string | null;
|
|
257
257
|
cost_currency: string | null;
|
|
258
|
+
deleted_at: string | null;
|
|
258
259
|
total_on_hand: number | null;
|
|
259
260
|
prices?: Array<AdminPrice>;
|
|
260
261
|
};
|
|
@@ -281,7 +282,7 @@ type StoreCountry = {
|
|
|
281
282
|
states_required: boolean;
|
|
282
283
|
zipcode_required: boolean;
|
|
283
284
|
states?: Array<StoreState>;
|
|
284
|
-
market?:
|
|
285
|
+
market?: StoreMarket | null;
|
|
285
286
|
};
|
|
286
287
|
|
|
287
288
|
type StoreCreditCard = {
|
|
@@ -368,10 +369,10 @@ type StoreGiftCard = {
|
|
|
368
369
|
code: string;
|
|
369
370
|
state: string;
|
|
370
371
|
currency: string;
|
|
371
|
-
amount:
|
|
372
|
-
amount_used:
|
|
373
|
-
amount_authorized:
|
|
374
|
-
amount_remaining:
|
|
372
|
+
amount: string;
|
|
373
|
+
amount_used: string;
|
|
374
|
+
amount_authorized: string;
|
|
375
|
+
amount_remaining: string;
|
|
375
376
|
display_amount: string;
|
|
376
377
|
display_amount_used: string;
|
|
377
378
|
display_amount_remaining: string;
|
|
@@ -541,6 +542,7 @@ type StoreOrder = {
|
|
|
541
542
|
id: string;
|
|
542
543
|
number: string;
|
|
543
544
|
state: string;
|
|
545
|
+
checkout_steps: Array<string>;
|
|
544
546
|
token: string;
|
|
545
547
|
email: string | null;
|
|
546
548
|
special_instructions: string | null;
|
|
@@ -788,7 +790,7 @@ type StoreShippingRate = {
|
|
|
788
790
|
shipping_method_id: string;
|
|
789
791
|
name: string;
|
|
790
792
|
selected: boolean;
|
|
791
|
-
cost:
|
|
793
|
+
cost: string;
|
|
792
794
|
display_cost: string;
|
|
793
795
|
shipping_method: StoreShippingMethod;
|
|
794
796
|
};
|
|
@@ -853,26 +855,6 @@ type StoreStoreCredit = {
|
|
|
853
855
|
currency: string;
|
|
854
856
|
};
|
|
855
857
|
|
|
856
|
-
type StoreStore = {
|
|
857
|
-
id: string;
|
|
858
|
-
name: string;
|
|
859
|
-
url: string;
|
|
860
|
-
meta_description: string | null;
|
|
861
|
-
meta_keywords: string | null;
|
|
862
|
-
seo_title: string | null;
|
|
863
|
-
code: string;
|
|
864
|
-
facebook: string | null;
|
|
865
|
-
twitter: string | null;
|
|
866
|
-
instagram: string | null;
|
|
867
|
-
customer_support_email: string | null;
|
|
868
|
-
created_at: string;
|
|
869
|
-
updated_at: string;
|
|
870
|
-
favicon_image_url: string | null;
|
|
871
|
-
logo_image_url: string | null;
|
|
872
|
-
social_image_url: string | null;
|
|
873
|
-
payment_methods: Array<StorePaymentMethod>;
|
|
874
|
-
};
|
|
875
|
-
|
|
876
858
|
type StoreTaxon = {
|
|
877
859
|
id: string;
|
|
878
860
|
name: string;
|
|
@@ -968,9 +950,16 @@ interface PaginationMeta {
|
|
|
968
950
|
limit: number;
|
|
969
951
|
count: number;
|
|
970
952
|
pages: number;
|
|
953
|
+
from: number;
|
|
954
|
+
to: number;
|
|
955
|
+
in: number;
|
|
956
|
+
previous: number | null;
|
|
957
|
+
next: number | null;
|
|
971
958
|
}
|
|
972
|
-
interface
|
|
959
|
+
interface ListResponse<T> {
|
|
973
960
|
data: T[];
|
|
961
|
+
}
|
|
962
|
+
interface PaginatedResponse<T> extends ListResponse<T> {
|
|
974
963
|
meta: PaginationMeta;
|
|
975
964
|
}
|
|
976
965
|
interface ErrorResponse {
|
|
@@ -1003,11 +992,15 @@ interface RegisterParams {
|
|
|
1003
992
|
interface ListParams {
|
|
1004
993
|
page?: number;
|
|
1005
994
|
limit?: number;
|
|
1006
|
-
/**
|
|
995
|
+
/** Sort order. Prefix with - for descending, e.g. '-created_at', 'name'. Comma-separated for multiple fields. */
|
|
996
|
+
sort?: string;
|
|
997
|
+
/** Associations to expand. Supports dot notation for nested expand (max 4 levels), e.g. ['variants', 'variants.images'] */
|
|
1007
998
|
expand?: string[];
|
|
999
|
+
/** Fields to include in response, e.g. ['name', 'slug', 'price']. Omit to return all fields. 'id' is always included. */
|
|
1000
|
+
fields?: string[];
|
|
1008
1001
|
}
|
|
1009
1002
|
interface ProductListParams extends ListParams {
|
|
1010
|
-
/** Sort: 'price
|
|
1003
|
+
/** Sort: 'price', '-price', 'best_selling', 'name', '-name', '-available_on', 'available_on' */
|
|
1011
1004
|
sort?: string;
|
|
1012
1005
|
/** Full-text search across name and SKU */
|
|
1013
1006
|
multi_search?: string;
|
|
@@ -1029,7 +1022,7 @@ interface ProductListParams extends ListParams {
|
|
|
1029
1022
|
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1030
1023
|
}
|
|
1031
1024
|
interface TaxonListParams extends ListParams {
|
|
1032
|
-
/** Sort order, e.g. 'name
|
|
1025
|
+
/** Sort order, e.g. 'name', '-created_at' */
|
|
1033
1026
|
sort?: string;
|
|
1034
1027
|
/** Filter: name contains */
|
|
1035
1028
|
name_cont?: string;
|
|
@@ -1050,9 +1043,19 @@ interface OrderListParams extends ListParams {
|
|
|
1050
1043
|
/** Any additional Ransack predicate */
|
|
1051
1044
|
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1052
1045
|
}
|
|
1046
|
+
interface LineItemInput {
|
|
1047
|
+
/** Prefixed variant ID (e.g., "variant_k5nR8xLq") */
|
|
1048
|
+
variant_id: string;
|
|
1049
|
+
/** Quantity to set (defaults to 1 if omitted) */
|
|
1050
|
+
quantity?: number;
|
|
1051
|
+
/** Arbitrary key-value metadata (merged with existing on upsert) */
|
|
1052
|
+
metadata?: Record<string, unknown>;
|
|
1053
|
+
}
|
|
1053
1054
|
interface CreateCartParams {
|
|
1054
1055
|
/** Arbitrary key-value metadata (stored, not returned in responses) */
|
|
1055
1056
|
metadata?: Record<string, unknown>;
|
|
1057
|
+
/** Line items to add to the cart on creation */
|
|
1058
|
+
line_items?: LineItemInput[];
|
|
1056
1059
|
}
|
|
1057
1060
|
interface AddLineItemParams {
|
|
1058
1061
|
variant_id: string;
|
|
@@ -1098,6 +1101,8 @@ interface UpdateOrderParams {
|
|
|
1098
1101
|
bill_address?: AddressParams;
|
|
1099
1102
|
/** New shipping address */
|
|
1100
1103
|
ship_address?: AddressParams;
|
|
1104
|
+
/** Line items to upsert (sets quantity for existing, creates new) */
|
|
1105
|
+
line_items?: LineItemInput[];
|
|
1101
1106
|
}
|
|
1102
1107
|
interface CreatePaymentSessionParams {
|
|
1103
1108
|
payment_method_id: string;
|
|
@@ -1173,4 +1178,4 @@ interface ProductFiltersParams {
|
|
|
1173
1178
|
q?: Record<string, unknown>;
|
|
1174
1179
|
}
|
|
1175
1180
|
|
|
1176
|
-
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, StoreMarket, 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,
|
|
1181
|
+
export type { AddLineItemParams, AddressParams, AdminCustomer, AdminLineItem, AdminMetafield, AdminOrder, AdminPrice, AdminProduct, AdminTaxon, AdminTaxonomy, AdminVariant, AuthTokens, AvailabilityFilter, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, ErrorResponse, FilterOption, LineItemInput, ListParams, ListResponse, 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, StoreMarket, 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, StoreStoreCredit, StoreTaxon, StoreTaxonomy, StoreVariant, StoreWishedItem, StoreWishlist, TaxonFilter, TaxonFilterOption, TaxonListParams, UpdateLineItemParams, UpdateOrderParams, UpdatePaymentSessionParams };
|
package/dist/zod/index.cjs
CHANGED
|
@@ -120,7 +120,7 @@ var StoreShippingRateSchema = zod.z.object({
|
|
|
120
120
|
shipping_method_id: zod.z.string(),
|
|
121
121
|
name: zod.z.string(),
|
|
122
122
|
selected: zod.z.boolean(),
|
|
123
|
-
cost: zod.z.
|
|
123
|
+
cost: zod.z.string(),
|
|
124
124
|
display_cost: zod.z.string(),
|
|
125
125
|
shipping_method: StoreShippingMethodSchema
|
|
126
126
|
});
|
|
@@ -158,6 +158,7 @@ var AdminOrderSchema = zod.z.object({
|
|
|
158
158
|
id: zod.z.string(),
|
|
159
159
|
number: zod.z.string(),
|
|
160
160
|
state: zod.z.string(),
|
|
161
|
+
checkout_steps: zod.z.array(zod.z.string()),
|
|
161
162
|
token: zod.z.string(),
|
|
162
163
|
email: zod.z.string().nullable(),
|
|
163
164
|
special_instructions: zod.z.string().nullable(),
|
|
@@ -307,9 +308,9 @@ var AdminVariantSchema = zod.z.object({
|
|
|
307
308
|
metafields: zod.z.array(AdminMetafieldSchema).optional(),
|
|
308
309
|
position: zod.z.number(),
|
|
309
310
|
tax_category_id: zod.z.string().nullable(),
|
|
310
|
-
|
|
311
|
-
cost_price: zod.z.number().nullable(),
|
|
311
|
+
cost_price: zod.z.string().nullable(),
|
|
312
312
|
cost_currency: zod.z.string().nullable(),
|
|
313
|
+
deleted_at: zod.z.string().nullable(),
|
|
313
314
|
total_on_hand: zod.z.number().nullable(),
|
|
314
315
|
prices: zod.z.array(AdminPriceSchema).optional()
|
|
315
316
|
});
|
|
@@ -387,7 +388,7 @@ var AdminProductSchema = zod.z.object({
|
|
|
387
388
|
make_active_at: zod.z.string().nullable(),
|
|
388
389
|
discontinue_on: zod.z.string().nullable(),
|
|
389
390
|
deleted_at: zod.z.string().nullable(),
|
|
390
|
-
cost_price: zod.z.
|
|
391
|
+
cost_price: zod.z.string().nullable(),
|
|
391
392
|
cost_currency: zod.z.string().nullable()
|
|
392
393
|
});
|
|
393
394
|
var AdminTaxonSchema = zod.z.object({
|
|
@@ -442,6 +443,16 @@ var StoreAssetSchema = zod.z.object({
|
|
|
442
443
|
var StoreBaseSchema = zod.z.object({
|
|
443
444
|
id: zod.z.string()
|
|
444
445
|
});
|
|
446
|
+
var StoreMarketSchema = zod.z.object({
|
|
447
|
+
id: zod.z.string(),
|
|
448
|
+
name: zod.z.string(),
|
|
449
|
+
currency: zod.z.string(),
|
|
450
|
+
default_locale: zod.z.string(),
|
|
451
|
+
tax_inclusive: zod.z.boolean(),
|
|
452
|
+
default: zod.z.boolean(),
|
|
453
|
+
supported_locales: zod.z.array(zod.z.string()),
|
|
454
|
+
countries: zod.z.array(zod.z.lazy(() => StoreCountrySchema)).optional()
|
|
455
|
+
});
|
|
445
456
|
var StoreStateSchema = zod.z.object({
|
|
446
457
|
abbr: zod.z.string(),
|
|
447
458
|
name: zod.z.string()
|
|
@@ -455,7 +466,7 @@ var StoreCountrySchema = zod.z.object({
|
|
|
455
466
|
states_required: zod.z.boolean(),
|
|
456
467
|
zipcode_required: zod.z.boolean(),
|
|
457
468
|
states: zod.z.array(StoreStateSchema).optional(),
|
|
458
|
-
market: zod.z.
|
|
469
|
+
market: zod.z.lazy(() => StoreMarketSchema).nullable().optional()
|
|
459
470
|
});
|
|
460
471
|
var StoreCreditCardSchema = zod.z.object({
|
|
461
472
|
id: zod.z.string(),
|
|
@@ -510,10 +521,10 @@ var StoreGiftCardSchema = zod.z.object({
|
|
|
510
521
|
code: zod.z.string(),
|
|
511
522
|
state: zod.z.string(),
|
|
512
523
|
currency: zod.z.string(),
|
|
513
|
-
amount: zod.z.
|
|
514
|
-
amount_used: zod.z.
|
|
515
|
-
amount_authorized: zod.z.
|
|
516
|
-
amount_remaining: zod.z.
|
|
524
|
+
amount: zod.z.string(),
|
|
525
|
+
amount_used: zod.z.string(),
|
|
526
|
+
amount_authorized: zod.z.string(),
|
|
527
|
+
amount_remaining: zod.z.string(),
|
|
517
528
|
display_amount: zod.z.string(),
|
|
518
529
|
display_amount_used: zod.z.string(),
|
|
519
530
|
display_amount_remaining: zod.z.string(),
|
|
@@ -610,16 +621,6 @@ var StoreLocaleSchema = zod.z.object({
|
|
|
610
621
|
code: zod.z.string(),
|
|
611
622
|
name: zod.z.string()
|
|
612
623
|
});
|
|
613
|
-
var StoreMarketSchema = zod.z.object({
|
|
614
|
-
id: zod.z.string(),
|
|
615
|
-
name: zod.z.string(),
|
|
616
|
-
currency: zod.z.string(),
|
|
617
|
-
default_locale: zod.z.string(),
|
|
618
|
-
tax_inclusive: zod.z.boolean(),
|
|
619
|
-
default: zod.z.boolean(),
|
|
620
|
-
supported_locales: zod.z.array(zod.z.string()),
|
|
621
|
-
countries: zod.z.array(StoreCountrySchema).optional()
|
|
622
|
-
});
|
|
623
624
|
var StoreNewsletterSubscriberSchema = zod.z.object({
|
|
624
625
|
id: zod.z.string(),
|
|
625
626
|
email: zod.z.string(),
|
|
@@ -633,6 +634,7 @@ var StoreOrderSchema = zod.z.object({
|
|
|
633
634
|
id: zod.z.string(),
|
|
634
635
|
number: zod.z.string(),
|
|
635
636
|
state: zod.z.string(),
|
|
637
|
+
checkout_steps: zod.z.array(zod.z.string()),
|
|
636
638
|
token: zod.z.string(),
|
|
637
639
|
email: zod.z.string().nullable(),
|
|
638
640
|
special_instructions: zod.z.string().nullable(),
|
|
@@ -861,25 +863,6 @@ var StoreStockTransferSchema = zod.z.object({
|
|
|
861
863
|
source_location_id: zod.z.string().nullable(),
|
|
862
864
|
destination_location_id: zod.z.string().nullable()
|
|
863
865
|
});
|
|
864
|
-
var StoreStoreSchema = zod.z.object({
|
|
865
|
-
id: zod.z.string(),
|
|
866
|
-
name: zod.z.string(),
|
|
867
|
-
url: zod.z.string(),
|
|
868
|
-
meta_description: zod.z.string().nullable(),
|
|
869
|
-
meta_keywords: zod.z.string().nullable(),
|
|
870
|
-
seo_title: zod.z.string().nullable(),
|
|
871
|
-
code: zod.z.string(),
|
|
872
|
-
facebook: zod.z.string().nullable(),
|
|
873
|
-
twitter: zod.z.string().nullable(),
|
|
874
|
-
instagram: zod.z.string().nullable(),
|
|
875
|
-
customer_support_email: zod.z.string().nullable(),
|
|
876
|
-
created_at: zod.z.string(),
|
|
877
|
-
updated_at: zod.z.string(),
|
|
878
|
-
favicon_image_url: zod.z.string().nullable(),
|
|
879
|
-
logo_image_url: zod.z.string().nullable(),
|
|
880
|
-
social_image_url: zod.z.string().nullable(),
|
|
881
|
-
payment_methods: zod.z.array(StorePaymentMethodSchema)
|
|
882
|
-
});
|
|
883
866
|
var StoreStoreCreditSchema = zod.z.object({
|
|
884
867
|
id: zod.z.string(),
|
|
885
868
|
amount: zod.z.string(),
|
|
@@ -978,7 +961,6 @@ exports.StoreStockLocationSchema = StoreStockLocationSchema;
|
|
|
978
961
|
exports.StoreStockMovementSchema = StoreStockMovementSchema;
|
|
979
962
|
exports.StoreStockTransferSchema = StoreStockTransferSchema;
|
|
980
963
|
exports.StoreStoreCreditSchema = StoreStoreCreditSchema;
|
|
981
|
-
exports.StoreStoreSchema = StoreStoreSchema;
|
|
982
964
|
exports.StoreTaxonSchema = StoreTaxonSchema;
|
|
983
965
|
exports.StoreTaxonomySchema = StoreTaxonomySchema;
|
|
984
966
|
exports.StoreVariantSchema = StoreVariantSchema;
|