@spree/sdk 0.6.8 → 0.7.0
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 +118 -120
- package/dist/index.cjs +51 -242
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +87 -124
- package/dist/index.d.ts +87 -124
- package/dist/index.js +39 -230
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +129 -418
- package/dist/types/index.d.ts +129 -418
- package/dist/zod/index.cjs +311 -550
- package/dist/zod/index.cjs.map +1 -1
- package/dist/zod/index.d.cts +120 -713
- package/dist/zod/index.d.ts +120 -713
- package/dist/zod/index.js +257 -489
- package/dist/zod/index.js.map +1 -1
- package/package.json +5 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { ListParams, AddressParams } from '@spree/sdk-core';
|
|
2
|
+
export { AddressParams, AuthTokens, ErrorResponse, ListParams, ListResponse, LocaleDefaults, LoginCredentials, PaginatedResponse, PaginationMeta, RegisterParams } from '@spree/sdk-core';
|
|
3
|
+
|
|
4
|
+
type Address = {
|
|
2
5
|
id: string;
|
|
3
6
|
firstname: string | null;
|
|
4
7
|
lastname: string | null;
|
|
@@ -17,249 +20,7 @@ type StoreAddress = {
|
|
|
17
20
|
state_name: string | null;
|
|
18
21
|
};
|
|
19
22
|
|
|
20
|
-
type
|
|
21
|
-
id: string;
|
|
22
|
-
email: string;
|
|
23
|
-
first_name: string | null;
|
|
24
|
-
last_name: string | null;
|
|
25
|
-
created_at: string;
|
|
26
|
-
updated_at: string;
|
|
27
|
-
addresses: Array<StoreAddress>;
|
|
28
|
-
default_billing_address: StoreAddress | null;
|
|
29
|
-
default_shipping_address: StoreAddress | null;
|
|
30
|
-
phone: string | null;
|
|
31
|
-
login: string | null;
|
|
32
|
-
accepts_email_marketing: boolean;
|
|
33
|
-
last_sign_in_at: string | null;
|
|
34
|
-
current_sign_in_at: string | null;
|
|
35
|
-
sign_in_count: number;
|
|
36
|
-
failed_attempts: number;
|
|
37
|
-
last_sign_in_ip: string | null;
|
|
38
|
-
current_sign_in_ip: string | null;
|
|
39
|
-
orders?: Array<AdminOrder>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
type AdminLineItem = {
|
|
43
|
-
id: string;
|
|
44
|
-
variant_id: string;
|
|
45
|
-
quantity: number;
|
|
46
|
-
currency: string;
|
|
47
|
-
name: string;
|
|
48
|
-
slug: string;
|
|
49
|
-
options_text: string;
|
|
50
|
-
price: string;
|
|
51
|
-
display_price: string;
|
|
52
|
-
total: string;
|
|
53
|
-
display_total: string;
|
|
54
|
-
adjustment_total: string;
|
|
55
|
-
display_adjustment_total: string;
|
|
56
|
-
additional_tax_total: string;
|
|
57
|
-
display_additional_tax_total: string;
|
|
58
|
-
included_tax_total: string;
|
|
59
|
-
display_included_tax_total: string;
|
|
60
|
-
promo_total: string;
|
|
61
|
-
display_promo_total: string;
|
|
62
|
-
pre_tax_amount: string;
|
|
63
|
-
display_pre_tax_amount: string;
|
|
64
|
-
discounted_amount: string;
|
|
65
|
-
display_discounted_amount: string;
|
|
66
|
-
display_compare_at_amount: string | null;
|
|
67
|
-
created_at: string;
|
|
68
|
-
updated_at: string;
|
|
69
|
-
compare_at_amount: string | null;
|
|
70
|
-
thumbnail_url: string | null;
|
|
71
|
-
option_values: Array<StoreOptionValue>;
|
|
72
|
-
digital_links: Array<StoreDigitalLink>;
|
|
73
|
-
metadata: Record<string, unknown> | null;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
type AdminMetafield = {
|
|
77
|
-
id: string;
|
|
78
|
-
name: string;
|
|
79
|
-
type: string;
|
|
80
|
-
key: string;
|
|
81
|
-
value: any;
|
|
82
|
-
display_on: string;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
type AdminOrder = {
|
|
86
|
-
id: string;
|
|
87
|
-
number: string;
|
|
88
|
-
state: string;
|
|
89
|
-
token: string;
|
|
90
|
-
email: string | null;
|
|
91
|
-
special_instructions: string | null;
|
|
92
|
-
currency: string;
|
|
93
|
-
locale: string | null;
|
|
94
|
-
item_count: number;
|
|
95
|
-
state_lock_version: number;
|
|
96
|
-
shipment_state: string | null;
|
|
97
|
-
payment_state: string | null;
|
|
98
|
-
item_total: string;
|
|
99
|
-
display_item_total: string;
|
|
100
|
-
ship_total: string;
|
|
101
|
-
display_ship_total: string;
|
|
102
|
-
adjustment_total: string;
|
|
103
|
-
display_adjustment_total: string;
|
|
104
|
-
promo_total: string;
|
|
105
|
-
display_promo_total: string;
|
|
106
|
-
tax_total: string;
|
|
107
|
-
display_tax_total: string;
|
|
108
|
-
included_tax_total: string;
|
|
109
|
-
display_included_tax_total: string;
|
|
110
|
-
additional_tax_total: string;
|
|
111
|
-
display_additional_tax_total: string;
|
|
112
|
-
total: string;
|
|
113
|
-
display_total: string;
|
|
114
|
-
completed_at: string | null;
|
|
115
|
-
created_at: string;
|
|
116
|
-
updated_at: string;
|
|
117
|
-
order_promotions: Array<StoreOrderPromotion>;
|
|
118
|
-
line_items: Array<AdminLineItem>;
|
|
119
|
-
shipments: Array<StoreShipment>;
|
|
120
|
-
payments: Array<StorePayment>;
|
|
121
|
-
bill_address: StoreAddress | null;
|
|
122
|
-
ship_address: StoreAddress | null;
|
|
123
|
-
payment_methods: Array<StorePaymentMethod>;
|
|
124
|
-
channel: string | null;
|
|
125
|
-
last_ip_address: string | null;
|
|
126
|
-
considered_risky: boolean;
|
|
127
|
-
confirmation_delivered: boolean;
|
|
128
|
-
store_owner_notification_delivered: boolean;
|
|
129
|
-
internal_note: string | null;
|
|
130
|
-
approver_id: string | null;
|
|
131
|
-
canceled_at: string | null;
|
|
132
|
-
approved_at: string | null;
|
|
133
|
-
metadata: Record<string, unknown> | null;
|
|
134
|
-
canceler_id: string | null;
|
|
135
|
-
created_by_id: string | null;
|
|
136
|
-
user?: AdminCustomer;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
type AdminPrice = {
|
|
140
|
-
id: string;
|
|
141
|
-
amount: string | null;
|
|
142
|
-
amount_in_cents: number | null;
|
|
143
|
-
compare_at_amount: string | null;
|
|
144
|
-
compare_at_amount_in_cents: number | null;
|
|
145
|
-
currency: string | null;
|
|
146
|
-
display_amount: string | null;
|
|
147
|
-
display_compare_at_amount: string | null;
|
|
148
|
-
price_list_id: string | null;
|
|
149
|
-
variant_id: string | null;
|
|
150
|
-
created_at: string;
|
|
151
|
-
updated_at: string;
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
type AdminProduct = {
|
|
155
|
-
id: string;
|
|
156
|
-
name: string;
|
|
157
|
-
description: string | null;
|
|
158
|
-
slug: string;
|
|
159
|
-
meta_description: string | null;
|
|
160
|
-
meta_keywords: string | null;
|
|
161
|
-
variant_count: number;
|
|
162
|
-
available_on: string | null;
|
|
163
|
-
created_at: string;
|
|
164
|
-
updated_at: string;
|
|
165
|
-
purchasable: boolean;
|
|
166
|
-
in_stock: boolean;
|
|
167
|
-
backorderable: boolean;
|
|
168
|
-
available: boolean;
|
|
169
|
-
default_variant_id: string;
|
|
170
|
-
thumbnail_url: string | null;
|
|
171
|
-
tags: Array<string>;
|
|
172
|
-
price: StorePrice;
|
|
173
|
-
original_price: StorePrice | null;
|
|
174
|
-
images?: Array<StoreImage>;
|
|
175
|
-
variants?: Array<AdminVariant>;
|
|
176
|
-
default_variant?: AdminVariant;
|
|
177
|
-
master_variant?: AdminVariant;
|
|
178
|
-
option_types?: Array<StoreOptionType>;
|
|
179
|
-
taxons?: Array<StoreTaxon>;
|
|
180
|
-
metafields?: Array<AdminMetafield>;
|
|
181
|
-
status: string;
|
|
182
|
-
make_active_at: string | null;
|
|
183
|
-
discontinue_on: string | null;
|
|
184
|
-
deleted_at: string | null;
|
|
185
|
-
cost_price: string | null;
|
|
186
|
-
cost_currency: string | null;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
type AdminTaxon = {
|
|
190
|
-
id: string;
|
|
191
|
-
name: string;
|
|
192
|
-
permalink: string;
|
|
193
|
-
position: number;
|
|
194
|
-
depth: number;
|
|
195
|
-
meta_title: string | null;
|
|
196
|
-
meta_description: string | null;
|
|
197
|
-
meta_keywords: string | null;
|
|
198
|
-
children_count: number;
|
|
199
|
-
created_at: string;
|
|
200
|
-
updated_at: string;
|
|
201
|
-
parent_id: string | null;
|
|
202
|
-
taxonomy_id: string;
|
|
203
|
-
description: string;
|
|
204
|
-
description_html: string;
|
|
205
|
-
image_url: string | null;
|
|
206
|
-
square_image_url: string | null;
|
|
207
|
-
is_root: boolean;
|
|
208
|
-
is_child: boolean;
|
|
209
|
-
is_leaf: boolean;
|
|
210
|
-
parent?: StoreTaxon;
|
|
211
|
-
children?: Array<StoreTaxon>;
|
|
212
|
-
ancestors?: Array<StoreTaxon>;
|
|
213
|
-
metafields?: Array<AdminMetafield>;
|
|
214
|
-
lft: number;
|
|
215
|
-
rgt: number;
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
type AdminTaxonomy = {
|
|
219
|
-
id: string;
|
|
220
|
-
name: string;
|
|
221
|
-
position: number;
|
|
222
|
-
created_at: string;
|
|
223
|
-
updated_at: string;
|
|
224
|
-
root_id: string | null;
|
|
225
|
-
root?: StoreTaxon;
|
|
226
|
-
taxons?: Array<StoreTaxon>;
|
|
227
|
-
metafields?: Array<AdminMetafield>;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
type AdminVariant = {
|
|
231
|
-
id: string;
|
|
232
|
-
product_id: string;
|
|
233
|
-
sku: string | null;
|
|
234
|
-
is_master: boolean;
|
|
235
|
-
options_text: string;
|
|
236
|
-
track_inventory: boolean;
|
|
237
|
-
image_count: number;
|
|
238
|
-
created_at: string;
|
|
239
|
-
updated_at: string;
|
|
240
|
-
thumbnail: string | null;
|
|
241
|
-
purchasable: boolean;
|
|
242
|
-
in_stock: boolean;
|
|
243
|
-
backorderable: boolean;
|
|
244
|
-
weight: number | null;
|
|
245
|
-
height: number | null;
|
|
246
|
-
width: number | null;
|
|
247
|
-
depth: number | null;
|
|
248
|
-
price: StorePrice;
|
|
249
|
-
original_price: StorePrice | null;
|
|
250
|
-
images?: Array<StoreImage>;
|
|
251
|
-
option_values: Array<StoreOptionValue>;
|
|
252
|
-
metafields?: Array<AdminMetafield>;
|
|
253
|
-
position: number;
|
|
254
|
-
tax_category_id: string | null;
|
|
255
|
-
cost_price: string | null;
|
|
256
|
-
cost_currency: string | null;
|
|
257
|
-
deleted_at: string | null;
|
|
258
|
-
total_on_hand: number | null;
|
|
259
|
-
prices?: Array<AdminPrice>;
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
type StoreAsset = {
|
|
23
|
+
type Asset = {
|
|
263
24
|
id: string;
|
|
264
25
|
viewable_id: string;
|
|
265
26
|
type: string | null;
|
|
@@ -270,21 +31,21 @@ type StoreAsset = {
|
|
|
270
31
|
updated_at: string;
|
|
271
32
|
};
|
|
272
33
|
|
|
273
|
-
type
|
|
34
|
+
type Base = {
|
|
274
35
|
id: string;
|
|
275
36
|
};
|
|
276
37
|
|
|
277
|
-
type
|
|
38
|
+
type Country = {
|
|
278
39
|
iso: string;
|
|
279
40
|
iso3: string;
|
|
280
41
|
name: string;
|
|
281
42
|
states_required: boolean;
|
|
282
43
|
zipcode_required: boolean;
|
|
283
|
-
states?: Array<
|
|
284
|
-
market?:
|
|
44
|
+
states?: Array<State>;
|
|
45
|
+
market?: Market | null;
|
|
285
46
|
};
|
|
286
47
|
|
|
287
|
-
type
|
|
48
|
+
type CreditCard = {
|
|
288
49
|
id: string;
|
|
289
50
|
cc_type: string;
|
|
290
51
|
last_digits: string;
|
|
@@ -295,13 +56,13 @@ type StoreCreditCard = {
|
|
|
295
56
|
gateway_payment_profile_id: string | null;
|
|
296
57
|
};
|
|
297
58
|
|
|
298
|
-
type
|
|
59
|
+
type Currency = {
|
|
299
60
|
iso_code: string;
|
|
300
61
|
name: string;
|
|
301
62
|
symbol: string;
|
|
302
63
|
};
|
|
303
64
|
|
|
304
|
-
type
|
|
65
|
+
type CustomerReturn = {
|
|
305
66
|
id: string;
|
|
306
67
|
number: string;
|
|
307
68
|
created_at: string;
|
|
@@ -309,19 +70,19 @@ type StoreCustomerReturn = {
|
|
|
309
70
|
stock_location_id: string | null;
|
|
310
71
|
};
|
|
311
72
|
|
|
312
|
-
type
|
|
73
|
+
type Customer = {
|
|
313
74
|
id: string;
|
|
314
75
|
email: string;
|
|
315
76
|
first_name: string | null;
|
|
316
77
|
last_name: string | null;
|
|
317
78
|
created_at: string;
|
|
318
79
|
updated_at: string;
|
|
319
|
-
addresses: Array<
|
|
320
|
-
default_billing_address:
|
|
321
|
-
default_shipping_address:
|
|
80
|
+
addresses: Array<Address>;
|
|
81
|
+
default_billing_address: Address | null;
|
|
82
|
+
default_shipping_address: Address | null;
|
|
322
83
|
};
|
|
323
84
|
|
|
324
|
-
type
|
|
85
|
+
type DigitalLink = {
|
|
325
86
|
id: string;
|
|
326
87
|
access_counter: number;
|
|
327
88
|
filename: string;
|
|
@@ -334,14 +95,14 @@ type StoreDigitalLink = {
|
|
|
334
95
|
access_limit_exceeded: boolean;
|
|
335
96
|
};
|
|
336
97
|
|
|
337
|
-
type
|
|
98
|
+
type Digital = {
|
|
338
99
|
id: string;
|
|
339
100
|
created_at: string;
|
|
340
101
|
updated_at: string;
|
|
341
102
|
variant_id: string | null;
|
|
342
103
|
};
|
|
343
104
|
|
|
344
|
-
type
|
|
105
|
+
type Export = {
|
|
345
106
|
id: string;
|
|
346
107
|
number: string;
|
|
347
108
|
type: string | null;
|
|
@@ -351,7 +112,7 @@ type StoreExport = {
|
|
|
351
112
|
user_id: string | null;
|
|
352
113
|
};
|
|
353
114
|
|
|
354
|
-
type
|
|
115
|
+
type GiftCardBatch = {
|
|
355
116
|
id: string;
|
|
356
117
|
codes_count: number;
|
|
357
118
|
currency: string | null;
|
|
@@ -363,7 +124,7 @@ type StoreGiftCardBatch = {
|
|
|
363
124
|
created_by_id: string | null;
|
|
364
125
|
};
|
|
365
126
|
|
|
366
|
-
type
|
|
127
|
+
type GiftCard = {
|
|
367
128
|
id: string;
|
|
368
129
|
code: string;
|
|
369
130
|
state: string;
|
|
@@ -383,7 +144,7 @@ type StoreGiftCard = {
|
|
|
383
144
|
updated_at: string;
|
|
384
145
|
};
|
|
385
146
|
|
|
386
|
-
type
|
|
147
|
+
type Image = {
|
|
387
148
|
id: string;
|
|
388
149
|
viewable_id: string;
|
|
389
150
|
type: string | null;
|
|
@@ -401,7 +162,7 @@ type StoreImage = {
|
|
|
401
162
|
og_image_url: string | null;
|
|
402
163
|
};
|
|
403
164
|
|
|
404
|
-
type
|
|
165
|
+
type ImportRow = {
|
|
405
166
|
id: string;
|
|
406
167
|
row_number: number;
|
|
407
168
|
status: string;
|
|
@@ -413,7 +174,7 @@ type StoreImportRow = {
|
|
|
413
174
|
item_id: string | null;
|
|
414
175
|
};
|
|
415
176
|
|
|
416
|
-
type
|
|
177
|
+
type Import = {
|
|
417
178
|
id: string;
|
|
418
179
|
number: string;
|
|
419
180
|
type: string | null;
|
|
@@ -426,7 +187,7 @@ type StoreImport = {
|
|
|
426
187
|
user_id: string | null;
|
|
427
188
|
};
|
|
428
189
|
|
|
429
|
-
type
|
|
190
|
+
type Invitation = {
|
|
430
191
|
id: string;
|
|
431
192
|
email: string;
|
|
432
193
|
resource_type: string | null;
|
|
@@ -443,7 +204,7 @@ type StoreInvitation = {
|
|
|
443
204
|
accepted_at: string | null;
|
|
444
205
|
};
|
|
445
206
|
|
|
446
|
-
type
|
|
207
|
+
type LineItem = {
|
|
447
208
|
id: string;
|
|
448
209
|
variant_id: string;
|
|
449
210
|
quantity: number;
|
|
@@ -472,16 +233,16 @@ type StoreLineItem = {
|
|
|
472
233
|
updated_at: string;
|
|
473
234
|
compare_at_amount: string | null;
|
|
474
235
|
thumbnail_url: string | null;
|
|
475
|
-
option_values: Array<
|
|
476
|
-
digital_links: Array<
|
|
236
|
+
option_values: Array<OptionValue>;
|
|
237
|
+
digital_links: Array<DigitalLink>;
|
|
477
238
|
};
|
|
478
239
|
|
|
479
|
-
type
|
|
240
|
+
type Locale = {
|
|
480
241
|
code: string;
|
|
481
242
|
name: string;
|
|
482
243
|
};
|
|
483
244
|
|
|
484
|
-
type
|
|
245
|
+
type Market = {
|
|
485
246
|
id: string;
|
|
486
247
|
name: string;
|
|
487
248
|
currency: string;
|
|
@@ -489,10 +250,10 @@ type StoreMarket = {
|
|
|
489
250
|
tax_inclusive: boolean;
|
|
490
251
|
default: boolean;
|
|
491
252
|
supported_locales: Array<string>;
|
|
492
|
-
countries?: Array<
|
|
253
|
+
countries?: Array<Country>;
|
|
493
254
|
};
|
|
494
255
|
|
|
495
|
-
type
|
|
256
|
+
type Metafield = {
|
|
496
257
|
id: string;
|
|
497
258
|
name: string;
|
|
498
259
|
type: string;
|
|
@@ -500,7 +261,7 @@ type StoreMetafield = {
|
|
|
500
261
|
value: any;
|
|
501
262
|
};
|
|
502
263
|
|
|
503
|
-
type
|
|
264
|
+
type NewsletterSubscriber = {
|
|
504
265
|
id: string;
|
|
505
266
|
email: string;
|
|
506
267
|
created_at: string;
|
|
@@ -510,14 +271,14 @@ type StoreNewsletterSubscriber = {
|
|
|
510
271
|
user_id: string | null;
|
|
511
272
|
};
|
|
512
273
|
|
|
513
|
-
type
|
|
274
|
+
type OptionType = {
|
|
514
275
|
id: string;
|
|
515
276
|
name: string;
|
|
516
277
|
presentation: string;
|
|
517
278
|
position: number;
|
|
518
279
|
};
|
|
519
280
|
|
|
520
|
-
type
|
|
281
|
+
type OptionValue = {
|
|
521
282
|
id: string;
|
|
522
283
|
option_type_id: string;
|
|
523
284
|
name: string;
|
|
@@ -527,7 +288,7 @@ type StoreOptionValue = {
|
|
|
527
288
|
option_type_presentation: string;
|
|
528
289
|
};
|
|
529
290
|
|
|
530
|
-
type
|
|
291
|
+
type OrderPromotion = {
|
|
531
292
|
id: string;
|
|
532
293
|
promotion_id: string;
|
|
533
294
|
name: string;
|
|
@@ -537,10 +298,11 @@ type StoreOrderPromotion = {
|
|
|
537
298
|
display_amount: string;
|
|
538
299
|
};
|
|
539
300
|
|
|
540
|
-
type
|
|
301
|
+
type Order = {
|
|
541
302
|
id: string;
|
|
542
303
|
number: string;
|
|
543
304
|
state: string;
|
|
305
|
+
checkout_steps: Array<string>;
|
|
544
306
|
token: string;
|
|
545
307
|
email: string | null;
|
|
546
308
|
special_instructions: string | null;
|
|
@@ -569,16 +331,16 @@ type StoreOrder = {
|
|
|
569
331
|
completed_at: string | null;
|
|
570
332
|
created_at: string;
|
|
571
333
|
updated_at: string;
|
|
572
|
-
order_promotions: Array<
|
|
573
|
-
line_items: Array<
|
|
574
|
-
shipments: Array<
|
|
575
|
-
payments: Array<
|
|
576
|
-
bill_address:
|
|
577
|
-
ship_address:
|
|
578
|
-
payment_methods: Array<
|
|
334
|
+
order_promotions: Array<OrderPromotion>;
|
|
335
|
+
line_items: Array<LineItem>;
|
|
336
|
+
shipments: Array<Shipment>;
|
|
337
|
+
payments: Array<Payment>;
|
|
338
|
+
bill_address: Address | null;
|
|
339
|
+
ship_address: Address | null;
|
|
340
|
+
payment_methods: Array<PaymentMethod>;
|
|
579
341
|
};
|
|
580
342
|
|
|
581
|
-
type
|
|
343
|
+
type PaymentMethod = {
|
|
582
344
|
id: string;
|
|
583
345
|
name: string;
|
|
584
346
|
description: string | null;
|
|
@@ -586,7 +348,7 @@ type StorePaymentMethod = {
|
|
|
586
348
|
session_required: boolean;
|
|
587
349
|
};
|
|
588
350
|
|
|
589
|
-
type
|
|
351
|
+
type Payment = {
|
|
590
352
|
id: string;
|
|
591
353
|
payment_method_id: string;
|
|
592
354
|
state: string;
|
|
@@ -598,11 +360,11 @@ type StorePayment = {
|
|
|
598
360
|
updated_at: string;
|
|
599
361
|
source_type: 'credit_card' | 'store_credit' | 'payment_source' | null;
|
|
600
362
|
source_id: string | null;
|
|
601
|
-
source:
|
|
602
|
-
payment_method:
|
|
363
|
+
source: CreditCard | StoreCredit | PaymentSource | null;
|
|
364
|
+
payment_method: PaymentMethod;
|
|
603
365
|
};
|
|
604
366
|
|
|
605
|
-
type
|
|
367
|
+
type PaymentSession = {
|
|
606
368
|
id: string;
|
|
607
369
|
status: string;
|
|
608
370
|
currency: string;
|
|
@@ -615,11 +377,11 @@ type StorePaymentSession = {
|
|
|
615
377
|
amount: string;
|
|
616
378
|
payment_method_id: string;
|
|
617
379
|
order_id: string;
|
|
618
|
-
payment_method:
|
|
619
|
-
payment?:
|
|
380
|
+
payment_method: PaymentMethod;
|
|
381
|
+
payment?: Payment;
|
|
620
382
|
};
|
|
621
383
|
|
|
622
|
-
type
|
|
384
|
+
type PaymentSetupSession = {
|
|
623
385
|
id: string;
|
|
624
386
|
status: string;
|
|
625
387
|
external_id: string | null;
|
|
@@ -631,15 +393,15 @@ type StorePaymentSetupSession = {
|
|
|
631
393
|
payment_source_id: string | null;
|
|
632
394
|
payment_source_type: string | null;
|
|
633
395
|
customer_id: string | null;
|
|
634
|
-
payment_method:
|
|
396
|
+
payment_method: PaymentMethod;
|
|
635
397
|
};
|
|
636
398
|
|
|
637
|
-
type
|
|
399
|
+
type PaymentSource = {
|
|
638
400
|
id: string;
|
|
639
401
|
gateway_payment_profile_id: string | null;
|
|
640
402
|
};
|
|
641
403
|
|
|
642
|
-
type
|
|
404
|
+
type Price = {
|
|
643
405
|
id: string;
|
|
644
406
|
amount: string | null;
|
|
645
407
|
amount_in_cents: number | null;
|
|
@@ -651,7 +413,7 @@ type StorePrice = {
|
|
|
651
413
|
price_list_id: string | null;
|
|
652
414
|
};
|
|
653
415
|
|
|
654
|
-
type
|
|
416
|
+
type Product = {
|
|
655
417
|
id: string;
|
|
656
418
|
name: string;
|
|
657
419
|
description: string | null;
|
|
@@ -669,18 +431,18 @@ type StoreProduct = {
|
|
|
669
431
|
default_variant_id: string;
|
|
670
432
|
thumbnail_url: string | null;
|
|
671
433
|
tags: Array<string>;
|
|
672
|
-
price:
|
|
673
|
-
original_price:
|
|
674
|
-
images?: Array<
|
|
675
|
-
variants?: Array<
|
|
676
|
-
default_variant?:
|
|
677
|
-
master_variant?:
|
|
678
|
-
option_types?: Array<
|
|
679
|
-
taxons?: Array<
|
|
680
|
-
metafields?: Array<
|
|
434
|
+
price: Price;
|
|
435
|
+
original_price: Price | null;
|
|
436
|
+
images?: Array<Image>;
|
|
437
|
+
variants?: Array<Variant>;
|
|
438
|
+
default_variant?: Variant;
|
|
439
|
+
master_variant?: Variant;
|
|
440
|
+
option_types?: Array<OptionType>;
|
|
441
|
+
taxons?: Array<Taxon>;
|
|
442
|
+
metafields?: Array<Metafield>;
|
|
681
443
|
};
|
|
682
444
|
|
|
683
|
-
type
|
|
445
|
+
type Promotion = {
|
|
684
446
|
id: string;
|
|
685
447
|
name: string;
|
|
686
448
|
description: string | null;
|
|
@@ -701,7 +463,7 @@ type StorePromotion = {
|
|
|
701
463
|
promotion_category_id: string | null;
|
|
702
464
|
};
|
|
703
465
|
|
|
704
|
-
type
|
|
466
|
+
type Refund = {
|
|
705
467
|
id: string;
|
|
706
468
|
transaction_id: string | null;
|
|
707
469
|
created_at: string;
|
|
@@ -712,7 +474,7 @@ type StoreRefund = {
|
|
|
712
474
|
reimbursement_id: string | null;
|
|
713
475
|
};
|
|
714
476
|
|
|
715
|
-
type
|
|
477
|
+
type Reimbursement = {
|
|
716
478
|
id: string;
|
|
717
479
|
number: string;
|
|
718
480
|
reimbursement_status: string | null;
|
|
@@ -723,7 +485,7 @@ type StoreReimbursement = {
|
|
|
723
485
|
customer_return_id: string | null;
|
|
724
486
|
};
|
|
725
487
|
|
|
726
|
-
type
|
|
488
|
+
type Report = {
|
|
727
489
|
id: string;
|
|
728
490
|
type: string | null;
|
|
729
491
|
currency: string | null;
|
|
@@ -734,7 +496,7 @@ type StoreReport = {
|
|
|
734
496
|
date_to: string | null;
|
|
735
497
|
};
|
|
736
498
|
|
|
737
|
-
type
|
|
499
|
+
type ReturnAuthorization = {
|
|
738
500
|
id: string;
|
|
739
501
|
number: string;
|
|
740
502
|
created_at: string;
|
|
@@ -745,7 +507,7 @@ type StoreReturnAuthorization = {
|
|
|
745
507
|
return_authorization_reason_id: string | null;
|
|
746
508
|
};
|
|
747
509
|
|
|
748
|
-
type
|
|
510
|
+
type ReturnItem = {
|
|
749
511
|
id: string;
|
|
750
512
|
reception_status: string | null;
|
|
751
513
|
acceptance_status: string | null;
|
|
@@ -761,7 +523,7 @@ type StoreReturnItem = {
|
|
|
761
523
|
exchange_variant_id: string | null;
|
|
762
524
|
};
|
|
763
525
|
|
|
764
|
-
type
|
|
526
|
+
type Shipment = {
|
|
765
527
|
id: string;
|
|
766
528
|
number: string;
|
|
767
529
|
state: string;
|
|
@@ -772,33 +534,38 @@ type StoreShipment = {
|
|
|
772
534
|
shipped_at: string | null;
|
|
773
535
|
created_at: string;
|
|
774
536
|
updated_at: string;
|
|
775
|
-
shipping_method:
|
|
776
|
-
stock_location:
|
|
777
|
-
shipping_rates: Array<
|
|
537
|
+
shipping_method: ShippingMethod;
|
|
538
|
+
stock_location: StockLocation;
|
|
539
|
+
shipping_rates: Array<ShippingRate>;
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
type ShippingCategory = {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
778
545
|
};
|
|
779
546
|
|
|
780
|
-
type
|
|
547
|
+
type ShippingMethod = {
|
|
781
548
|
id: string;
|
|
782
549
|
name: string;
|
|
783
550
|
code: string | null;
|
|
784
551
|
};
|
|
785
552
|
|
|
786
|
-
type
|
|
553
|
+
type ShippingRate = {
|
|
787
554
|
id: string;
|
|
788
555
|
shipping_method_id: string;
|
|
789
556
|
name: string;
|
|
790
557
|
selected: boolean;
|
|
791
558
|
cost: string;
|
|
792
559
|
display_cost: string;
|
|
793
|
-
shipping_method:
|
|
560
|
+
shipping_method: ShippingMethod;
|
|
794
561
|
};
|
|
795
562
|
|
|
796
|
-
type
|
|
563
|
+
type State = {
|
|
797
564
|
abbr: string;
|
|
798
565
|
name: string;
|
|
799
566
|
};
|
|
800
567
|
|
|
801
|
-
type
|
|
568
|
+
type StockItem = {
|
|
802
569
|
id: string;
|
|
803
570
|
count_on_hand: number;
|
|
804
571
|
backorderable: boolean;
|
|
@@ -808,7 +575,7 @@ type StoreStockItem = {
|
|
|
808
575
|
variant_id: string | null;
|
|
809
576
|
};
|
|
810
577
|
|
|
811
|
-
type
|
|
578
|
+
type StockLocation = {
|
|
812
579
|
id: string;
|
|
813
580
|
state_abbr: string | null;
|
|
814
581
|
name: string;
|
|
@@ -820,7 +587,7 @@ type StoreStockLocation = {
|
|
|
820
587
|
state_text: string | null;
|
|
821
588
|
};
|
|
822
589
|
|
|
823
|
-
type
|
|
590
|
+
type StockMovement = {
|
|
824
591
|
id: string;
|
|
825
592
|
quantity: number;
|
|
826
593
|
action: string | null;
|
|
@@ -831,7 +598,7 @@ type StoreStockMovement = {
|
|
|
831
598
|
stock_item_id: string | null;
|
|
832
599
|
};
|
|
833
600
|
|
|
834
|
-
type
|
|
601
|
+
type StockTransfer = {
|
|
835
602
|
id: string;
|
|
836
603
|
number: string | null;
|
|
837
604
|
type: string | null;
|
|
@@ -842,7 +609,7 @@ type StoreStockTransfer = {
|
|
|
842
609
|
destination_location_id: string | null;
|
|
843
610
|
};
|
|
844
611
|
|
|
845
|
-
type
|
|
612
|
+
type StoreCredit = {
|
|
846
613
|
id: string;
|
|
847
614
|
amount: string;
|
|
848
615
|
amount_used: string;
|
|
@@ -853,7 +620,12 @@ type StoreStoreCredit = {
|
|
|
853
620
|
currency: string;
|
|
854
621
|
};
|
|
855
622
|
|
|
856
|
-
type
|
|
623
|
+
type TaxCategory = {
|
|
624
|
+
id: string;
|
|
625
|
+
name: string;
|
|
626
|
+
};
|
|
627
|
+
|
|
628
|
+
type Taxon = {
|
|
857
629
|
id: string;
|
|
858
630
|
name: string;
|
|
859
631
|
permalink: string;
|
|
@@ -874,25 +646,25 @@ type StoreTaxon = {
|
|
|
874
646
|
is_root: boolean;
|
|
875
647
|
is_child: boolean;
|
|
876
648
|
is_leaf: boolean;
|
|
877
|
-
parent?:
|
|
878
|
-
children?: Array<
|
|
879
|
-
ancestors?: Array<
|
|
880
|
-
metafields?: Array<
|
|
649
|
+
parent?: Taxon;
|
|
650
|
+
children?: Array<Taxon>;
|
|
651
|
+
ancestors?: Array<Taxon>;
|
|
652
|
+
metafields?: Array<Metafield>;
|
|
881
653
|
};
|
|
882
654
|
|
|
883
|
-
type
|
|
655
|
+
type Taxonomy = {
|
|
884
656
|
id: string;
|
|
885
657
|
name: string;
|
|
886
658
|
position: number;
|
|
887
659
|
created_at: string;
|
|
888
660
|
updated_at: string;
|
|
889
661
|
root_id: string | null;
|
|
890
|
-
root?:
|
|
891
|
-
taxons?: Array<
|
|
892
|
-
metafields?: Array<
|
|
662
|
+
root?: Taxon;
|
|
663
|
+
taxons?: Array<Taxon>;
|
|
664
|
+
metafields?: Array<Metafield>;
|
|
893
665
|
};
|
|
894
666
|
|
|
895
|
-
type
|
|
667
|
+
type Variant = {
|
|
896
668
|
id: string;
|
|
897
669
|
product_id: string;
|
|
898
670
|
sku: string | null;
|
|
@@ -910,24 +682,24 @@ type StoreVariant = {
|
|
|
910
682
|
height: number | null;
|
|
911
683
|
width: number | null;
|
|
912
684
|
depth: number | null;
|
|
913
|
-
price:
|
|
914
|
-
original_price:
|
|
915
|
-
images?: Array<
|
|
916
|
-
option_values: Array<
|
|
917
|
-
metafields?: Array<
|
|
685
|
+
price: Price;
|
|
686
|
+
original_price: Price | null;
|
|
687
|
+
images?: Array<Image>;
|
|
688
|
+
option_values: Array<OptionValue>;
|
|
689
|
+
metafields?: Array<Metafield>;
|
|
918
690
|
};
|
|
919
691
|
|
|
920
|
-
type
|
|
692
|
+
type WishedItem = {
|
|
921
693
|
id: string;
|
|
922
694
|
variant_id: string;
|
|
923
695
|
wishlist_id: string;
|
|
924
696
|
quantity: number;
|
|
925
697
|
created_at: string;
|
|
926
698
|
updated_at: string;
|
|
927
|
-
variant:
|
|
699
|
+
variant: Variant;
|
|
928
700
|
};
|
|
929
701
|
|
|
930
|
-
type
|
|
702
|
+
type Wishlist = {
|
|
931
703
|
id: string;
|
|
932
704
|
name: string;
|
|
933
705
|
token: string;
|
|
@@ -935,66 +707,11 @@ type StoreWishlist = {
|
|
|
935
707
|
updated_at: string;
|
|
936
708
|
is_default: boolean;
|
|
937
709
|
is_private: boolean;
|
|
938
|
-
items?: Array<
|
|
710
|
+
items?: Array<WishedItem>;
|
|
939
711
|
};
|
|
940
712
|
|
|
941
|
-
interface LocaleDefaults {
|
|
942
|
-
locale?: string;
|
|
943
|
-
currency?: string;
|
|
944
|
-
country?: string;
|
|
945
|
-
}
|
|
946
|
-
interface PaginationMeta {
|
|
947
|
-
page: number;
|
|
948
|
-
limit: number;
|
|
949
|
-
count: number;
|
|
950
|
-
pages: number;
|
|
951
|
-
from: number;
|
|
952
|
-
to: number;
|
|
953
|
-
in: number;
|
|
954
|
-
previous: number | null;
|
|
955
|
-
next: number | null;
|
|
956
|
-
}
|
|
957
|
-
interface ListResponse<T> {
|
|
958
|
-
data: T[];
|
|
959
|
-
}
|
|
960
|
-
interface PaginatedResponse<T> extends ListResponse<T> {
|
|
961
|
-
meta: PaginationMeta;
|
|
962
|
-
}
|
|
963
|
-
interface ErrorResponse {
|
|
964
|
-
error: {
|
|
965
|
-
code: string;
|
|
966
|
-
message: string;
|
|
967
|
-
details?: Record<string, string[]>;
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
interface AuthTokens {
|
|
971
|
-
token: string;
|
|
972
|
-
user: {
|
|
973
|
-
id: string;
|
|
974
|
-
email: string;
|
|
975
|
-
first_name: string | null;
|
|
976
|
-
last_name: string | null;
|
|
977
|
-
};
|
|
978
|
-
}
|
|
979
|
-
interface LoginCredentials {
|
|
980
|
-
email: string;
|
|
981
|
-
password: string;
|
|
982
|
-
}
|
|
983
|
-
interface RegisterParams {
|
|
984
|
-
email: string;
|
|
985
|
-
password: string;
|
|
986
|
-
password_confirmation: string;
|
|
987
|
-
first_name?: string;
|
|
988
|
-
last_name?: string;
|
|
989
|
-
}
|
|
990
|
-
interface ListParams {
|
|
991
|
-
page?: number;
|
|
992
|
-
limit?: number;
|
|
993
|
-
/** Associations to expand, e.g. ['variants', 'images'] */
|
|
994
|
-
expand?: string[];
|
|
995
|
-
}
|
|
996
713
|
interface ProductListParams extends ListParams {
|
|
997
|
-
/** Sort: 'price
|
|
714
|
+
/** Sort: 'price', '-price', 'best_selling', 'name', '-name', '-available_on', 'available_on' */
|
|
998
715
|
sort?: string;
|
|
999
716
|
/** Full-text search across name and SKU */
|
|
1000
717
|
multi_search?: string;
|
|
@@ -1016,7 +733,7 @@ interface ProductListParams extends ListParams {
|
|
|
1016
733
|
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1017
734
|
}
|
|
1018
735
|
interface TaxonListParams extends ListParams {
|
|
1019
|
-
/** Sort order, e.g. 'name
|
|
736
|
+
/** Sort order, e.g. 'name', '-created_at' */
|
|
1020
737
|
sort?: string;
|
|
1021
738
|
/** Filter: name contains */
|
|
1022
739
|
name_cont?: string;
|
|
@@ -1037,9 +754,19 @@ interface OrderListParams extends ListParams {
|
|
|
1037
754
|
/** Any additional Ransack predicate */
|
|
1038
755
|
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
1039
756
|
}
|
|
757
|
+
interface LineItemInput {
|
|
758
|
+
/** Prefixed variant ID (e.g., "variant_k5nR8xLq") */
|
|
759
|
+
variant_id: string;
|
|
760
|
+
/** Quantity to set (defaults to 1 if omitted) */
|
|
761
|
+
quantity?: number;
|
|
762
|
+
/** Arbitrary key-value metadata (merged with existing on upsert) */
|
|
763
|
+
metadata?: Record<string, unknown>;
|
|
764
|
+
}
|
|
1040
765
|
interface CreateCartParams {
|
|
1041
766
|
/** Arbitrary key-value metadata (stored, not returned in responses) */
|
|
1042
767
|
metadata?: Record<string, unknown>;
|
|
768
|
+
/** Line items to add to the cart on creation */
|
|
769
|
+
line_items?: LineItemInput[];
|
|
1043
770
|
}
|
|
1044
771
|
interface AddLineItemParams {
|
|
1045
772
|
variant_id: string;
|
|
@@ -1052,24 +779,6 @@ interface UpdateLineItemParams {
|
|
|
1052
779
|
/** Arbitrary key-value metadata (merged with existing) */
|
|
1053
780
|
metadata?: Record<string, unknown>;
|
|
1054
781
|
}
|
|
1055
|
-
interface AddressParams {
|
|
1056
|
-
firstname: string;
|
|
1057
|
-
lastname: string;
|
|
1058
|
-
address1: string;
|
|
1059
|
-
address2?: string;
|
|
1060
|
-
city: string;
|
|
1061
|
-
zipcode: string;
|
|
1062
|
-
phone?: string;
|
|
1063
|
-
company?: string;
|
|
1064
|
-
/** ISO 3166-1 alpha-2 country code (e.g., "US", "DE") */
|
|
1065
|
-
country_iso: string;
|
|
1066
|
-
/** ISO 3166-2 subdivision code without country prefix (e.g., "CA", "NY") */
|
|
1067
|
-
state_abbr?: string;
|
|
1068
|
-
/** State name - used for countries without predefined states */
|
|
1069
|
-
state_name?: string;
|
|
1070
|
-
/** When true, relaxes validation requirements (name, phone, zipcode, street) */
|
|
1071
|
-
quick_checkout?: boolean;
|
|
1072
|
-
}
|
|
1073
782
|
interface UpdateOrderParams {
|
|
1074
783
|
email?: string;
|
|
1075
784
|
currency?: string;
|
|
@@ -1085,6 +794,8 @@ interface UpdateOrderParams {
|
|
|
1085
794
|
bill_address?: AddressParams;
|
|
1086
795
|
/** New shipping address */
|
|
1087
796
|
ship_address?: AddressParams;
|
|
797
|
+
/** Line items to upsert (sets quantity for existing, creates new) */
|
|
798
|
+
line_items?: LineItemInput[];
|
|
1088
799
|
}
|
|
1089
800
|
interface CreatePaymentSessionParams {
|
|
1090
801
|
payment_method_id: string;
|
|
@@ -1160,4 +871,4 @@ interface ProductFiltersParams {
|
|
|
1160
871
|
q?: Record<string, unknown>;
|
|
1161
872
|
}
|
|
1162
873
|
|
|
1163
|
-
export type { AddLineItemParams,
|
|
874
|
+
export type { AddLineItemParams, Address, Asset, AvailabilityFilter, Base, CompletePaymentSessionParams, CompletePaymentSetupSessionParams, Country, CreateCartParams, CreatePaymentSessionParams, CreatePaymentSetupSessionParams, CreditCard, Currency, Customer, CustomerReturn, Digital, DigitalLink, Export, FilterOption, GiftCard, GiftCardBatch, Image, Import, ImportRow, Invitation, LineItem, LineItemInput, Locale, Market, Metafield, NewsletterSubscriber, OptionFilter, OptionFilterOption, OptionType, OptionValue, Order, OrderListParams, OrderPromotion, Payment, PaymentMethod, PaymentSession, PaymentSetupSession, PaymentSource, Price, PriceRangeFilter, Product, ProductFilter, ProductFiltersParams, ProductFiltersResponse, ProductListParams, Promotion, Refund, Reimbursement, Report, ReturnAuthorization, ReturnItem, Shipment, ShippingCategory, ShippingMethod, ShippingRate, SortOption, State, StockItem, StockLocation, StockMovement, StockTransfer, Address as StoreAddress, Asset as StoreAsset, Country as StoreCountry, StoreCredit, CreditCard as StoreCreditCard, Currency as StoreCurrency, Customer as StoreCustomer, CustomerReturn as StoreCustomerReturn, Digital as StoreDigital, DigitalLink as StoreDigitalLink, GiftCard as StoreGiftCard, GiftCardBatch as StoreGiftCardBatch, Image as StoreImage, LineItem as StoreLineItem, Locale as StoreLocale, Market as StoreMarket, Metafield as StoreMetafield, OptionType as StoreOptionType, OptionValue as StoreOptionValue, Order as StoreOrder, OrderPromotion as StoreOrderPromotion, Payment as StorePayment, PaymentMethod as StorePaymentMethod, PaymentSession as StorePaymentSession, PaymentSetupSession as StorePaymentSetupSession, PaymentSource as StorePaymentSource, Price as StorePrice, Product as StoreProduct, Promotion as StorePromotion, Refund as StoreRefund, Reimbursement as StoreReimbursement, ReturnAuthorization as StoreReturnAuthorization, ReturnItem as StoreReturnItem, Shipment as StoreShipment, ShippingCategory as StoreShippingCategory, ShippingMethod as StoreShippingMethod, ShippingRate as StoreShippingRate, State as StoreState, StockItem as StoreStockItem, StockLocation as StoreStockLocation, StoreCredit as StoreStoreCredit, TaxCategory as StoreTaxCategory, Taxon as StoreTaxon, Taxonomy as StoreTaxonomy, Variant as StoreVariant, WishedItem as StoreWishedItem, Wishlist as StoreWishlist, TaxCategory, Taxon, TaxonFilter, TaxonFilterOption, TaxonListParams, Taxonomy, UpdateLineItemParams, UpdateOrderParams, UpdatePaymentSessionParams, Variant, WishedItem, Wishlist };
|