@spree/sdk 0.7.0 → 0.7.1
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/index-CgJG4R8P.d.cts +989 -0
- package/dist/index-CgJG4R8P.d.ts +989 -0
- package/dist/index.cjs +179 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +161 -4
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.cts +1 -874
- package/dist/types/index.d.ts +1 -874
- package/package.json +2 -4
|
@@ -0,0 +1,989 @@
|
|
|
1
|
+
interface LocaleDefaults {
|
|
2
|
+
locale?: string;
|
|
3
|
+
currency?: string;
|
|
4
|
+
country?: string;
|
|
5
|
+
}
|
|
6
|
+
interface PaginationMeta {
|
|
7
|
+
page: number;
|
|
8
|
+
limit: number;
|
|
9
|
+
count: number;
|
|
10
|
+
pages: number;
|
|
11
|
+
from: number;
|
|
12
|
+
to: number;
|
|
13
|
+
in: number;
|
|
14
|
+
previous: number | null;
|
|
15
|
+
next: number | null;
|
|
16
|
+
}
|
|
17
|
+
interface ListResponse<T> {
|
|
18
|
+
data: T[];
|
|
19
|
+
}
|
|
20
|
+
interface PaginatedResponse<T> extends ListResponse<T> {
|
|
21
|
+
meta: PaginationMeta;
|
|
22
|
+
}
|
|
23
|
+
interface ErrorResponse {
|
|
24
|
+
error: {
|
|
25
|
+
code: string;
|
|
26
|
+
message: string;
|
|
27
|
+
details?: Record<string, string[]>;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
interface AuthTokens {
|
|
31
|
+
token: string;
|
|
32
|
+
user: {
|
|
33
|
+
id: string;
|
|
34
|
+
email: string;
|
|
35
|
+
first_name: string | null;
|
|
36
|
+
last_name: string | null;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
interface LoginCredentials {
|
|
40
|
+
email: string;
|
|
41
|
+
password: string;
|
|
42
|
+
}
|
|
43
|
+
interface RegisterParams {
|
|
44
|
+
email: string;
|
|
45
|
+
password: string;
|
|
46
|
+
password_confirmation: string;
|
|
47
|
+
first_name?: string;
|
|
48
|
+
last_name?: string;
|
|
49
|
+
}
|
|
50
|
+
interface ListParams {
|
|
51
|
+
page?: number;
|
|
52
|
+
limit?: number;
|
|
53
|
+
/** Sort order. Prefix with - for descending, e.g. '-created_at', 'name'. Comma-separated for multiple fields. */
|
|
54
|
+
sort?: string;
|
|
55
|
+
/** Associations to expand. Supports dot notation for nested expand (max 4 levels), e.g. ['variants', 'variants.images'] */
|
|
56
|
+
expand?: string[];
|
|
57
|
+
/** Fields to include in response, e.g. ['name', 'slug', 'price']. Omit to return all fields. 'id' is always included. */
|
|
58
|
+
fields?: string[];
|
|
59
|
+
}
|
|
60
|
+
interface AddressParams {
|
|
61
|
+
firstname: string;
|
|
62
|
+
lastname: string;
|
|
63
|
+
address1: string;
|
|
64
|
+
address2?: string;
|
|
65
|
+
city: string;
|
|
66
|
+
zipcode: string;
|
|
67
|
+
phone?: string;
|
|
68
|
+
company?: string;
|
|
69
|
+
/** ISO 3166-1 alpha-2 country code (e.g., "US", "DE") */
|
|
70
|
+
country_iso: string;
|
|
71
|
+
/** ISO 3166-2 subdivision code without country prefix (e.g., "CA", "NY") */
|
|
72
|
+
state_abbr?: string;
|
|
73
|
+
/** State name - used for countries without predefined states */
|
|
74
|
+
state_name?: string;
|
|
75
|
+
/** When true, relaxes validation requirements (name, phone, zipcode, street) */
|
|
76
|
+
quick_checkout?: boolean;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface RetryConfig {
|
|
80
|
+
/** Maximum number of retries (default: 2) */
|
|
81
|
+
maxRetries?: number;
|
|
82
|
+
/** HTTP status codes to retry on (default: [429, 500, 502, 503, 504]) */
|
|
83
|
+
retryOnStatus?: number[];
|
|
84
|
+
/** Base delay in ms for exponential backoff (default: 300) */
|
|
85
|
+
baseDelay?: number;
|
|
86
|
+
/** Maximum delay in ms (default: 10000) */
|
|
87
|
+
maxDelay?: number;
|
|
88
|
+
/** Whether to retry on network errors (default: true) */
|
|
89
|
+
retryOnNetworkError?: boolean;
|
|
90
|
+
}
|
|
91
|
+
interface RequestOptions {
|
|
92
|
+
/** Bearer token for authenticated requests */
|
|
93
|
+
token?: string;
|
|
94
|
+
/** Order token for guest checkout */
|
|
95
|
+
orderToken?: string;
|
|
96
|
+
/** Locale for translated content (e.g., 'en', 'fr') */
|
|
97
|
+
locale?: string;
|
|
98
|
+
/** Currency for prices (e.g., 'USD', 'EUR') */
|
|
99
|
+
currency?: string;
|
|
100
|
+
/** Country ISO code for market resolution (e.g., 'US', 'DE') */
|
|
101
|
+
country?: string;
|
|
102
|
+
/** Idempotency key for safe retries of mutating requests (max 255 characters) */
|
|
103
|
+
idempotencyKey?: string;
|
|
104
|
+
/** Custom headers */
|
|
105
|
+
headers?: Record<string, string>;
|
|
106
|
+
}
|
|
107
|
+
interface InternalRequestOptions extends RequestOptions {
|
|
108
|
+
body?: unknown;
|
|
109
|
+
params?: Record<string, string | number | boolean | (string | number)[] | undefined>;
|
|
110
|
+
}
|
|
111
|
+
declare class SpreeError extends Error {
|
|
112
|
+
readonly code: string;
|
|
113
|
+
readonly status: number;
|
|
114
|
+
readonly details?: Record<string, string[]>;
|
|
115
|
+
constructor(response: ErrorResponse, status: number);
|
|
116
|
+
}
|
|
117
|
+
type RequestFn = <T>(method: string, path: string, options?: InternalRequestOptions) => Promise<T>;
|
|
118
|
+
|
|
119
|
+
type Address = {
|
|
120
|
+
id: string;
|
|
121
|
+
firstname: string | null;
|
|
122
|
+
lastname: string | null;
|
|
123
|
+
full_name: string;
|
|
124
|
+
address1: string | null;
|
|
125
|
+
address2: string | null;
|
|
126
|
+
city: string | null;
|
|
127
|
+
zipcode: string | null;
|
|
128
|
+
phone: string | null;
|
|
129
|
+
company: string | null;
|
|
130
|
+
country_name: string;
|
|
131
|
+
country_iso: string;
|
|
132
|
+
state_text: string | null;
|
|
133
|
+
state_abbr: string | null;
|
|
134
|
+
quick_checkout: boolean;
|
|
135
|
+
state_name: string | null;
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
type Asset = {
|
|
139
|
+
id: string;
|
|
140
|
+
viewable_id: string;
|
|
141
|
+
type: string | null;
|
|
142
|
+
viewable_type: string;
|
|
143
|
+
position: number | null;
|
|
144
|
+
alt: string | null;
|
|
145
|
+
created_at: string;
|
|
146
|
+
updated_at: string;
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
type Base = {
|
|
150
|
+
id: string;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
type Country = {
|
|
154
|
+
iso: string;
|
|
155
|
+
iso3: string;
|
|
156
|
+
name: string;
|
|
157
|
+
states_required: boolean;
|
|
158
|
+
zipcode_required: boolean;
|
|
159
|
+
states?: Array<State>;
|
|
160
|
+
market?: Market | null;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
type CreditCard = {
|
|
164
|
+
id: string;
|
|
165
|
+
cc_type: string;
|
|
166
|
+
last_digits: string;
|
|
167
|
+
month: number;
|
|
168
|
+
year: number;
|
|
169
|
+
name: string | null;
|
|
170
|
+
default: boolean;
|
|
171
|
+
gateway_payment_profile_id: string | null;
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
type Currency = {
|
|
175
|
+
iso_code: string;
|
|
176
|
+
name: string;
|
|
177
|
+
symbol: string;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
type CustomerReturn = {
|
|
181
|
+
id: string;
|
|
182
|
+
number: string;
|
|
183
|
+
created_at: string;
|
|
184
|
+
updated_at: string;
|
|
185
|
+
stock_location_id: string | null;
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
type Customer = {
|
|
189
|
+
id: string;
|
|
190
|
+
email: string;
|
|
191
|
+
first_name: string | null;
|
|
192
|
+
last_name: string | null;
|
|
193
|
+
created_at: string;
|
|
194
|
+
updated_at: string;
|
|
195
|
+
addresses: Array<Address>;
|
|
196
|
+
default_billing_address: Address | null;
|
|
197
|
+
default_shipping_address: Address | null;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
type DigitalLink = {
|
|
201
|
+
id: string;
|
|
202
|
+
access_counter: number;
|
|
203
|
+
filename: string;
|
|
204
|
+
content_type: string;
|
|
205
|
+
created_at: string;
|
|
206
|
+
updated_at: string;
|
|
207
|
+
download_url: string;
|
|
208
|
+
authorizable: boolean;
|
|
209
|
+
expired: boolean;
|
|
210
|
+
access_limit_exceeded: boolean;
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
type Digital = {
|
|
214
|
+
id: string;
|
|
215
|
+
created_at: string;
|
|
216
|
+
updated_at: string;
|
|
217
|
+
variant_id: string | null;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
type Export = {
|
|
221
|
+
id: string;
|
|
222
|
+
number: string;
|
|
223
|
+
type: string | null;
|
|
224
|
+
format: string | null;
|
|
225
|
+
created_at: string;
|
|
226
|
+
updated_at: string;
|
|
227
|
+
user_id: string | null;
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
type GiftCardBatch = {
|
|
231
|
+
id: string;
|
|
232
|
+
codes_count: number;
|
|
233
|
+
currency: string | null;
|
|
234
|
+
prefix: string | null;
|
|
235
|
+
created_at: string;
|
|
236
|
+
updated_at: string;
|
|
237
|
+
amount: string | null;
|
|
238
|
+
expires_at: string | null;
|
|
239
|
+
created_by_id: string | null;
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
type GiftCard = {
|
|
243
|
+
id: string;
|
|
244
|
+
code: string;
|
|
245
|
+
state: string;
|
|
246
|
+
currency: string;
|
|
247
|
+
amount: string;
|
|
248
|
+
amount_used: string;
|
|
249
|
+
amount_authorized: string;
|
|
250
|
+
amount_remaining: string;
|
|
251
|
+
display_amount: string;
|
|
252
|
+
display_amount_used: string;
|
|
253
|
+
display_amount_remaining: string;
|
|
254
|
+
expires_at: string | null;
|
|
255
|
+
redeemed_at: string | null;
|
|
256
|
+
expired: boolean;
|
|
257
|
+
active: boolean;
|
|
258
|
+
created_at: string;
|
|
259
|
+
updated_at: string;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
type Image = {
|
|
263
|
+
id: string;
|
|
264
|
+
viewable_id: string;
|
|
265
|
+
type: string | null;
|
|
266
|
+
viewable_type: string;
|
|
267
|
+
position: number | null;
|
|
268
|
+
alt: string | null;
|
|
269
|
+
created_at: string;
|
|
270
|
+
updated_at: string;
|
|
271
|
+
original_url: string | null;
|
|
272
|
+
mini_url: string | null;
|
|
273
|
+
small_url: string | null;
|
|
274
|
+
medium_url: string | null;
|
|
275
|
+
large_url: string | null;
|
|
276
|
+
xlarge_url: string | null;
|
|
277
|
+
og_image_url: string | null;
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
type ImportRow = {
|
|
281
|
+
id: string;
|
|
282
|
+
row_number: number;
|
|
283
|
+
status: string;
|
|
284
|
+
validation_errors: unknown;
|
|
285
|
+
item_type: string | null;
|
|
286
|
+
created_at: string;
|
|
287
|
+
updated_at: string;
|
|
288
|
+
import_id: string | null;
|
|
289
|
+
item_id: string | null;
|
|
290
|
+
};
|
|
291
|
+
|
|
292
|
+
type Import = {
|
|
293
|
+
id: string;
|
|
294
|
+
number: string;
|
|
295
|
+
type: string | null;
|
|
296
|
+
rows_count: number;
|
|
297
|
+
created_at: string;
|
|
298
|
+
updated_at: string;
|
|
299
|
+
status: string;
|
|
300
|
+
owner_type: string | null;
|
|
301
|
+
owner_id: string | null;
|
|
302
|
+
user_id: string | null;
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
type Invitation = {
|
|
306
|
+
id: string;
|
|
307
|
+
email: string;
|
|
308
|
+
resource_type: string | null;
|
|
309
|
+
inviter_type: string | null;
|
|
310
|
+
invitee_type: string | null;
|
|
311
|
+
created_at: string;
|
|
312
|
+
updated_at: string;
|
|
313
|
+
status: string;
|
|
314
|
+
resource_id: string | null;
|
|
315
|
+
inviter_id: string | null;
|
|
316
|
+
invitee_id: string | null;
|
|
317
|
+
role_id: string | null;
|
|
318
|
+
expires_at: string | null;
|
|
319
|
+
accepted_at: string | null;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
type LineItem = {
|
|
323
|
+
id: string;
|
|
324
|
+
variant_id: string;
|
|
325
|
+
quantity: number;
|
|
326
|
+
currency: string;
|
|
327
|
+
name: string;
|
|
328
|
+
slug: string;
|
|
329
|
+
options_text: string;
|
|
330
|
+
price: string;
|
|
331
|
+
display_price: string;
|
|
332
|
+
total: string;
|
|
333
|
+
display_total: string;
|
|
334
|
+
adjustment_total: string;
|
|
335
|
+
display_adjustment_total: string;
|
|
336
|
+
additional_tax_total: string;
|
|
337
|
+
display_additional_tax_total: string;
|
|
338
|
+
included_tax_total: string;
|
|
339
|
+
display_included_tax_total: string;
|
|
340
|
+
promo_total: string;
|
|
341
|
+
display_promo_total: string;
|
|
342
|
+
pre_tax_amount: string;
|
|
343
|
+
display_pre_tax_amount: string;
|
|
344
|
+
discounted_amount: string;
|
|
345
|
+
display_discounted_amount: string;
|
|
346
|
+
display_compare_at_amount: string | null;
|
|
347
|
+
created_at: string;
|
|
348
|
+
updated_at: string;
|
|
349
|
+
compare_at_amount: string | null;
|
|
350
|
+
thumbnail_url: string | null;
|
|
351
|
+
option_values: Array<OptionValue>;
|
|
352
|
+
digital_links: Array<DigitalLink>;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
type Locale = {
|
|
356
|
+
code: string;
|
|
357
|
+
name: string;
|
|
358
|
+
};
|
|
359
|
+
|
|
360
|
+
type Market = {
|
|
361
|
+
id: string;
|
|
362
|
+
name: string;
|
|
363
|
+
currency: string;
|
|
364
|
+
default_locale: string;
|
|
365
|
+
tax_inclusive: boolean;
|
|
366
|
+
default: boolean;
|
|
367
|
+
supported_locales: Array<string>;
|
|
368
|
+
countries?: Array<Country>;
|
|
369
|
+
};
|
|
370
|
+
|
|
371
|
+
type Metafield = {
|
|
372
|
+
id: string;
|
|
373
|
+
name: string;
|
|
374
|
+
type: string;
|
|
375
|
+
key: string;
|
|
376
|
+
value: any;
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
type NewsletterSubscriber = {
|
|
380
|
+
id: string;
|
|
381
|
+
email: string;
|
|
382
|
+
created_at: string;
|
|
383
|
+
updated_at: string;
|
|
384
|
+
verified: boolean;
|
|
385
|
+
verified_at: string | null;
|
|
386
|
+
user_id: string | null;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
type OptionType = {
|
|
390
|
+
id: string;
|
|
391
|
+
name: string;
|
|
392
|
+
presentation: string;
|
|
393
|
+
position: number;
|
|
394
|
+
};
|
|
395
|
+
|
|
396
|
+
type OptionValue = {
|
|
397
|
+
id: string;
|
|
398
|
+
option_type_id: string;
|
|
399
|
+
name: string;
|
|
400
|
+
presentation: string;
|
|
401
|
+
position: number;
|
|
402
|
+
option_type_name: string;
|
|
403
|
+
option_type_presentation: string;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
type OrderPromotion = {
|
|
407
|
+
id: string;
|
|
408
|
+
promotion_id: string;
|
|
409
|
+
name: string;
|
|
410
|
+
description: string | null;
|
|
411
|
+
code: string | null;
|
|
412
|
+
amount: string;
|
|
413
|
+
display_amount: string;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
type Order = {
|
|
417
|
+
id: string;
|
|
418
|
+
number: string;
|
|
419
|
+
state: string;
|
|
420
|
+
checkout_steps: Array<string>;
|
|
421
|
+
token: string;
|
|
422
|
+
email: string | null;
|
|
423
|
+
special_instructions: string | null;
|
|
424
|
+
currency: string;
|
|
425
|
+
locale: string | null;
|
|
426
|
+
item_count: number;
|
|
427
|
+
state_lock_version: number;
|
|
428
|
+
shipment_state: string | null;
|
|
429
|
+
payment_state: string | null;
|
|
430
|
+
item_total: string;
|
|
431
|
+
display_item_total: string;
|
|
432
|
+
ship_total: string;
|
|
433
|
+
display_ship_total: string;
|
|
434
|
+
adjustment_total: string;
|
|
435
|
+
display_adjustment_total: string;
|
|
436
|
+
promo_total: string;
|
|
437
|
+
display_promo_total: string;
|
|
438
|
+
tax_total: string;
|
|
439
|
+
display_tax_total: string;
|
|
440
|
+
included_tax_total: string;
|
|
441
|
+
display_included_tax_total: string;
|
|
442
|
+
additional_tax_total: string;
|
|
443
|
+
display_additional_tax_total: string;
|
|
444
|
+
total: string;
|
|
445
|
+
display_total: string;
|
|
446
|
+
completed_at: string | null;
|
|
447
|
+
created_at: string;
|
|
448
|
+
updated_at: string;
|
|
449
|
+
order_promotions: Array<OrderPromotion>;
|
|
450
|
+
line_items: Array<LineItem>;
|
|
451
|
+
shipments: Array<Shipment>;
|
|
452
|
+
payments: Array<Payment>;
|
|
453
|
+
bill_address: Address | null;
|
|
454
|
+
ship_address: Address | null;
|
|
455
|
+
payment_methods: Array<PaymentMethod>;
|
|
456
|
+
};
|
|
457
|
+
|
|
458
|
+
type PaymentMethod = {
|
|
459
|
+
id: string;
|
|
460
|
+
name: string;
|
|
461
|
+
description: string | null;
|
|
462
|
+
type: string;
|
|
463
|
+
session_required: boolean;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
type Payment = {
|
|
467
|
+
id: string;
|
|
468
|
+
payment_method_id: string;
|
|
469
|
+
state: string;
|
|
470
|
+
response_code: string | null;
|
|
471
|
+
number: string;
|
|
472
|
+
amount: string;
|
|
473
|
+
display_amount: string;
|
|
474
|
+
created_at: string;
|
|
475
|
+
updated_at: string;
|
|
476
|
+
source_type: 'credit_card' | 'store_credit' | 'payment_source' | null;
|
|
477
|
+
source_id: string | null;
|
|
478
|
+
source: CreditCard | StoreCredit | PaymentSource | null;
|
|
479
|
+
payment_method: PaymentMethod;
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
type PaymentSession = {
|
|
483
|
+
id: string;
|
|
484
|
+
status: string;
|
|
485
|
+
currency: string;
|
|
486
|
+
external_id: string;
|
|
487
|
+
external_data: Record<string, unknown>;
|
|
488
|
+
customer_external_id: string | null;
|
|
489
|
+
expires_at: string | null;
|
|
490
|
+
created_at: string;
|
|
491
|
+
updated_at: string;
|
|
492
|
+
amount: string;
|
|
493
|
+
payment_method_id: string;
|
|
494
|
+
order_id: string;
|
|
495
|
+
payment_method: PaymentMethod;
|
|
496
|
+
payment?: Payment;
|
|
497
|
+
};
|
|
498
|
+
|
|
499
|
+
type PaymentSetupSession = {
|
|
500
|
+
id: string;
|
|
501
|
+
status: string;
|
|
502
|
+
external_id: string | null;
|
|
503
|
+
external_client_secret: string | null;
|
|
504
|
+
external_data: Record<string, unknown>;
|
|
505
|
+
created_at: string;
|
|
506
|
+
updated_at: string;
|
|
507
|
+
payment_method_id: string | null;
|
|
508
|
+
payment_source_id: string | null;
|
|
509
|
+
payment_source_type: string | null;
|
|
510
|
+
customer_id: string | null;
|
|
511
|
+
payment_method: PaymentMethod;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
type PaymentSource = {
|
|
515
|
+
id: string;
|
|
516
|
+
gateway_payment_profile_id: string | null;
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
type Price = {
|
|
520
|
+
id: string;
|
|
521
|
+
amount: string | null;
|
|
522
|
+
amount_in_cents: number | null;
|
|
523
|
+
compare_at_amount: string | null;
|
|
524
|
+
compare_at_amount_in_cents: number | null;
|
|
525
|
+
currency: string | null;
|
|
526
|
+
display_amount: string | null;
|
|
527
|
+
display_compare_at_amount: string | null;
|
|
528
|
+
price_list_id: string | null;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
type Product = {
|
|
532
|
+
id: string;
|
|
533
|
+
name: string;
|
|
534
|
+
description: string | null;
|
|
535
|
+
slug: string;
|
|
536
|
+
meta_description: string | null;
|
|
537
|
+
meta_keywords: string | null;
|
|
538
|
+
variant_count: number;
|
|
539
|
+
available_on: string | null;
|
|
540
|
+
created_at: string;
|
|
541
|
+
updated_at: string;
|
|
542
|
+
purchasable: boolean;
|
|
543
|
+
in_stock: boolean;
|
|
544
|
+
backorderable: boolean;
|
|
545
|
+
available: boolean;
|
|
546
|
+
default_variant_id: string;
|
|
547
|
+
thumbnail_url: string | null;
|
|
548
|
+
tags: Array<string>;
|
|
549
|
+
price: Price;
|
|
550
|
+
original_price: Price | null;
|
|
551
|
+
images?: Array<Image>;
|
|
552
|
+
variants?: Array<Variant>;
|
|
553
|
+
default_variant?: Variant;
|
|
554
|
+
master_variant?: Variant;
|
|
555
|
+
option_types?: Array<OptionType>;
|
|
556
|
+
taxons?: Array<Taxon>;
|
|
557
|
+
metafields?: Array<Metafield>;
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
type Promotion = {
|
|
561
|
+
id: string;
|
|
562
|
+
name: string;
|
|
563
|
+
description: string | null;
|
|
564
|
+
code: string | null;
|
|
565
|
+
type: string | null;
|
|
566
|
+
kind: string | null;
|
|
567
|
+
path: string | null;
|
|
568
|
+
match_policy: string | null;
|
|
569
|
+
usage_limit: number | null;
|
|
570
|
+
advertise: boolean;
|
|
571
|
+
multi_codes: boolean;
|
|
572
|
+
code_prefix: string | null;
|
|
573
|
+
number_of_codes: number | null;
|
|
574
|
+
starts_at: string | null;
|
|
575
|
+
expires_at: string | null;
|
|
576
|
+
created_at: string;
|
|
577
|
+
updated_at: string;
|
|
578
|
+
promotion_category_id: string | null;
|
|
579
|
+
};
|
|
580
|
+
|
|
581
|
+
type Refund = {
|
|
582
|
+
id: string;
|
|
583
|
+
transaction_id: string | null;
|
|
584
|
+
created_at: string;
|
|
585
|
+
updated_at: string;
|
|
586
|
+
amount: string | null;
|
|
587
|
+
payment_id: string | null;
|
|
588
|
+
refund_reason_id: string | null;
|
|
589
|
+
reimbursement_id: string | null;
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
type Reimbursement = {
|
|
593
|
+
id: string;
|
|
594
|
+
number: string;
|
|
595
|
+
reimbursement_status: string | null;
|
|
596
|
+
created_at: string;
|
|
597
|
+
updated_at: string;
|
|
598
|
+
total: string | null;
|
|
599
|
+
order_id: string | null;
|
|
600
|
+
customer_return_id: string | null;
|
|
601
|
+
};
|
|
602
|
+
|
|
603
|
+
type Report = {
|
|
604
|
+
id: string;
|
|
605
|
+
type: string | null;
|
|
606
|
+
currency: string | null;
|
|
607
|
+
created_at: string;
|
|
608
|
+
updated_at: string;
|
|
609
|
+
user_id: string | null;
|
|
610
|
+
date_from: string | null;
|
|
611
|
+
date_to: string | null;
|
|
612
|
+
};
|
|
613
|
+
|
|
614
|
+
type ReturnAuthorization = {
|
|
615
|
+
id: string;
|
|
616
|
+
number: string;
|
|
617
|
+
created_at: string;
|
|
618
|
+
updated_at: string;
|
|
619
|
+
state: string;
|
|
620
|
+
order_id: string | null;
|
|
621
|
+
stock_location_id: string | null;
|
|
622
|
+
return_authorization_reason_id: string | null;
|
|
623
|
+
};
|
|
624
|
+
|
|
625
|
+
type ReturnItem = {
|
|
626
|
+
id: string;
|
|
627
|
+
reception_status: string | null;
|
|
628
|
+
acceptance_status: string | null;
|
|
629
|
+
created_at: string;
|
|
630
|
+
updated_at: string;
|
|
631
|
+
pre_tax_amount: string | null;
|
|
632
|
+
included_tax_total: string | null;
|
|
633
|
+
additional_tax_total: string | null;
|
|
634
|
+
inventory_unit_id: string | null;
|
|
635
|
+
return_authorization_id: string | null;
|
|
636
|
+
customer_return_id: string | null;
|
|
637
|
+
reimbursement_id: string | null;
|
|
638
|
+
exchange_variant_id: string | null;
|
|
639
|
+
};
|
|
640
|
+
|
|
641
|
+
type Shipment = {
|
|
642
|
+
id: string;
|
|
643
|
+
number: string;
|
|
644
|
+
state: string;
|
|
645
|
+
tracking: string | null;
|
|
646
|
+
tracking_url: string | null;
|
|
647
|
+
cost: string;
|
|
648
|
+
display_cost: string;
|
|
649
|
+
shipped_at: string | null;
|
|
650
|
+
created_at: string;
|
|
651
|
+
updated_at: string;
|
|
652
|
+
shipping_method: ShippingMethod;
|
|
653
|
+
stock_location: StockLocation;
|
|
654
|
+
shipping_rates: Array<ShippingRate>;
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
type ShippingCategory = {
|
|
658
|
+
id: string;
|
|
659
|
+
name: string;
|
|
660
|
+
};
|
|
661
|
+
|
|
662
|
+
type ShippingMethod = {
|
|
663
|
+
id: string;
|
|
664
|
+
name: string;
|
|
665
|
+
code: string | null;
|
|
666
|
+
};
|
|
667
|
+
|
|
668
|
+
type ShippingRate = {
|
|
669
|
+
id: string;
|
|
670
|
+
shipping_method_id: string;
|
|
671
|
+
name: string;
|
|
672
|
+
selected: boolean;
|
|
673
|
+
cost: string;
|
|
674
|
+
display_cost: string;
|
|
675
|
+
shipping_method: ShippingMethod;
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
type State = {
|
|
679
|
+
abbr: string;
|
|
680
|
+
name: string;
|
|
681
|
+
};
|
|
682
|
+
|
|
683
|
+
type StockItem = {
|
|
684
|
+
id: string;
|
|
685
|
+
count_on_hand: number;
|
|
686
|
+
backorderable: boolean;
|
|
687
|
+
created_at: string;
|
|
688
|
+
updated_at: string;
|
|
689
|
+
stock_location_id: string | null;
|
|
690
|
+
variant_id: string | null;
|
|
691
|
+
};
|
|
692
|
+
|
|
693
|
+
type StockLocation = {
|
|
694
|
+
id: string;
|
|
695
|
+
state_abbr: string | null;
|
|
696
|
+
name: string;
|
|
697
|
+
address1: string | null;
|
|
698
|
+
city: string | null;
|
|
699
|
+
zipcode: string | null;
|
|
700
|
+
country_iso: string | null;
|
|
701
|
+
country_name: string | null;
|
|
702
|
+
state_text: string | null;
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
type StockMovement = {
|
|
706
|
+
id: string;
|
|
707
|
+
quantity: number;
|
|
708
|
+
action: string | null;
|
|
709
|
+
originator_type: string | null;
|
|
710
|
+
created_at: string;
|
|
711
|
+
updated_at: string;
|
|
712
|
+
originator_id: string | null;
|
|
713
|
+
stock_item_id: string | null;
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
type StockTransfer = {
|
|
717
|
+
id: string;
|
|
718
|
+
number: string | null;
|
|
719
|
+
type: string | null;
|
|
720
|
+
reference: string | null;
|
|
721
|
+
created_at: string;
|
|
722
|
+
updated_at: string;
|
|
723
|
+
source_location_id: string | null;
|
|
724
|
+
destination_location_id: string | null;
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
type StoreCredit = {
|
|
728
|
+
id: string;
|
|
729
|
+
amount: string;
|
|
730
|
+
amount_used: string;
|
|
731
|
+
amount_remaining: string;
|
|
732
|
+
display_amount: string;
|
|
733
|
+
display_amount_used: string;
|
|
734
|
+
display_amount_remaining: string;
|
|
735
|
+
currency: string;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
type TaxCategory = {
|
|
739
|
+
id: string;
|
|
740
|
+
name: string;
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
type Taxon = {
|
|
744
|
+
id: string;
|
|
745
|
+
name: string;
|
|
746
|
+
permalink: string;
|
|
747
|
+
position: number;
|
|
748
|
+
depth: number;
|
|
749
|
+
meta_title: string | null;
|
|
750
|
+
meta_description: string | null;
|
|
751
|
+
meta_keywords: string | null;
|
|
752
|
+
children_count: number;
|
|
753
|
+
created_at: string;
|
|
754
|
+
updated_at: string;
|
|
755
|
+
parent_id: string | null;
|
|
756
|
+
taxonomy_id: string;
|
|
757
|
+
description: string;
|
|
758
|
+
description_html: string;
|
|
759
|
+
image_url: string | null;
|
|
760
|
+
square_image_url: string | null;
|
|
761
|
+
is_root: boolean;
|
|
762
|
+
is_child: boolean;
|
|
763
|
+
is_leaf: boolean;
|
|
764
|
+
parent?: Taxon;
|
|
765
|
+
children?: Array<Taxon>;
|
|
766
|
+
ancestors?: Array<Taxon>;
|
|
767
|
+
metafields?: Array<Metafield>;
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
type Taxonomy = {
|
|
771
|
+
id: string;
|
|
772
|
+
name: string;
|
|
773
|
+
position: number;
|
|
774
|
+
created_at: string;
|
|
775
|
+
updated_at: string;
|
|
776
|
+
root_id: string | null;
|
|
777
|
+
root?: Taxon;
|
|
778
|
+
taxons?: Array<Taxon>;
|
|
779
|
+
metafields?: Array<Metafield>;
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
type Variant = {
|
|
783
|
+
id: string;
|
|
784
|
+
product_id: string;
|
|
785
|
+
sku: string | null;
|
|
786
|
+
is_master: boolean;
|
|
787
|
+
options_text: string;
|
|
788
|
+
track_inventory: boolean;
|
|
789
|
+
image_count: number;
|
|
790
|
+
created_at: string;
|
|
791
|
+
updated_at: string;
|
|
792
|
+
thumbnail: string | null;
|
|
793
|
+
purchasable: boolean;
|
|
794
|
+
in_stock: boolean;
|
|
795
|
+
backorderable: boolean;
|
|
796
|
+
weight: number | null;
|
|
797
|
+
height: number | null;
|
|
798
|
+
width: number | null;
|
|
799
|
+
depth: number | null;
|
|
800
|
+
price: Price;
|
|
801
|
+
original_price: Price | null;
|
|
802
|
+
images?: Array<Image>;
|
|
803
|
+
option_values: Array<OptionValue>;
|
|
804
|
+
metafields?: Array<Metafield>;
|
|
805
|
+
};
|
|
806
|
+
|
|
807
|
+
type WishedItem = {
|
|
808
|
+
id: string;
|
|
809
|
+
variant_id: string;
|
|
810
|
+
wishlist_id: string;
|
|
811
|
+
quantity: number;
|
|
812
|
+
created_at: string;
|
|
813
|
+
updated_at: string;
|
|
814
|
+
variant: Variant;
|
|
815
|
+
};
|
|
816
|
+
|
|
817
|
+
type Wishlist = {
|
|
818
|
+
id: string;
|
|
819
|
+
name: string;
|
|
820
|
+
token: string;
|
|
821
|
+
created_at: string;
|
|
822
|
+
updated_at: string;
|
|
823
|
+
is_default: boolean;
|
|
824
|
+
is_private: boolean;
|
|
825
|
+
items?: Array<WishedItem>;
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
interface ProductListParams extends ListParams {
|
|
829
|
+
/** Sort: 'price', '-price', 'best_selling', 'name', '-name', '-available_on', 'available_on' */
|
|
830
|
+
sort?: string;
|
|
831
|
+
/** Full-text search across name and SKU */
|
|
832
|
+
multi_search?: string;
|
|
833
|
+
/** Filter: name contains */
|
|
834
|
+
name_cont?: string;
|
|
835
|
+
/** Filter: price >= value */
|
|
836
|
+
price_gte?: number;
|
|
837
|
+
/** Filter: price <= value */
|
|
838
|
+
price_lte?: number;
|
|
839
|
+
/** Filter by option value prefix IDs */
|
|
840
|
+
with_option_value_ids?: string[];
|
|
841
|
+
/** Filter: only in-stock products */
|
|
842
|
+
in_stock?: boolean;
|
|
843
|
+
/** Filter: only out-of-stock products */
|
|
844
|
+
out_of_stock?: boolean;
|
|
845
|
+
/** Filter: products in taxon */
|
|
846
|
+
taxons_id_eq?: string;
|
|
847
|
+
/** Any additional Ransack predicate */
|
|
848
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
849
|
+
}
|
|
850
|
+
interface TaxonListParams extends ListParams {
|
|
851
|
+
/** Sort order, e.g. 'name', '-created_at' */
|
|
852
|
+
sort?: string;
|
|
853
|
+
/** Filter: name contains */
|
|
854
|
+
name_cont?: string;
|
|
855
|
+
taxonomy_id_eq?: string | number;
|
|
856
|
+
parent_id_eq?: string | number;
|
|
857
|
+
depth_eq?: number;
|
|
858
|
+
/** Any additional Ransack predicate */
|
|
859
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
860
|
+
}
|
|
861
|
+
interface OrderListParams extends ListParams {
|
|
862
|
+
/** Sort order, e.g. 'completed_at desc' */
|
|
863
|
+
sort?: string;
|
|
864
|
+
/** Full-text search across number, email, customer name */
|
|
865
|
+
multi_search?: string;
|
|
866
|
+
state_eq?: string;
|
|
867
|
+
completed_at_gte?: string;
|
|
868
|
+
completed_at_lte?: string;
|
|
869
|
+
/** Any additional Ransack predicate */
|
|
870
|
+
[key: string]: string | number | boolean | (string | number)[] | undefined;
|
|
871
|
+
}
|
|
872
|
+
interface LineItemInput {
|
|
873
|
+
/** Prefixed variant ID (e.g., "variant_k5nR8xLq") */
|
|
874
|
+
variant_id: string;
|
|
875
|
+
/** Quantity to set (defaults to 1 if omitted) */
|
|
876
|
+
quantity?: number;
|
|
877
|
+
/** Arbitrary key-value metadata (merged with existing on upsert) */
|
|
878
|
+
metadata?: Record<string, unknown>;
|
|
879
|
+
}
|
|
880
|
+
interface CreateCartParams {
|
|
881
|
+
/** Arbitrary key-value metadata (stored, not returned in responses) */
|
|
882
|
+
metadata?: Record<string, unknown>;
|
|
883
|
+
/** Line items to add to the cart on creation */
|
|
884
|
+
line_items?: LineItemInput[];
|
|
885
|
+
}
|
|
886
|
+
interface AddLineItemParams {
|
|
887
|
+
variant_id: string;
|
|
888
|
+
quantity: number;
|
|
889
|
+
/** Arbitrary key-value metadata (stored, not returned in responses) */
|
|
890
|
+
metadata?: Record<string, unknown>;
|
|
891
|
+
}
|
|
892
|
+
interface UpdateLineItemParams {
|
|
893
|
+
quantity?: number;
|
|
894
|
+
/** Arbitrary key-value metadata (merged with existing) */
|
|
895
|
+
metadata?: Record<string, unknown>;
|
|
896
|
+
}
|
|
897
|
+
interface UpdateOrderParams {
|
|
898
|
+
email?: string;
|
|
899
|
+
currency?: string;
|
|
900
|
+
locale?: string;
|
|
901
|
+
special_instructions?: string;
|
|
902
|
+
/** Arbitrary key-value metadata (merged with existing) */
|
|
903
|
+
metadata?: Record<string, unknown>;
|
|
904
|
+
/** Existing address ID to use */
|
|
905
|
+
bill_address_id?: string;
|
|
906
|
+
/** Existing address ID to use */
|
|
907
|
+
ship_address_id?: string;
|
|
908
|
+
/** New billing address */
|
|
909
|
+
bill_address?: AddressParams;
|
|
910
|
+
/** New shipping address */
|
|
911
|
+
ship_address?: AddressParams;
|
|
912
|
+
/** Line items to upsert (sets quantity for existing, creates new) */
|
|
913
|
+
line_items?: LineItemInput[];
|
|
914
|
+
}
|
|
915
|
+
interface CreatePaymentSessionParams {
|
|
916
|
+
payment_method_id: string;
|
|
917
|
+
amount?: string;
|
|
918
|
+
external_data?: Record<string, unknown>;
|
|
919
|
+
}
|
|
920
|
+
interface UpdatePaymentSessionParams {
|
|
921
|
+
amount?: string;
|
|
922
|
+
external_data?: Record<string, unknown>;
|
|
923
|
+
}
|
|
924
|
+
interface CompletePaymentSessionParams {
|
|
925
|
+
session_result?: string;
|
|
926
|
+
external_data?: Record<string, unknown>;
|
|
927
|
+
}
|
|
928
|
+
interface CreatePaymentSetupSessionParams {
|
|
929
|
+
payment_method_id: string;
|
|
930
|
+
external_data?: Record<string, unknown>;
|
|
931
|
+
}
|
|
932
|
+
interface CompletePaymentSetupSessionParams {
|
|
933
|
+
external_data?: Record<string, unknown>;
|
|
934
|
+
}
|
|
935
|
+
interface FilterOption {
|
|
936
|
+
id: string;
|
|
937
|
+
count: number;
|
|
938
|
+
}
|
|
939
|
+
interface OptionFilterOption extends FilterOption {
|
|
940
|
+
name: string;
|
|
941
|
+
presentation: string;
|
|
942
|
+
position: number;
|
|
943
|
+
}
|
|
944
|
+
interface TaxonFilterOption {
|
|
945
|
+
id: string;
|
|
946
|
+
name: string;
|
|
947
|
+
permalink: string;
|
|
948
|
+
count: number;
|
|
949
|
+
}
|
|
950
|
+
interface PriceRangeFilter {
|
|
951
|
+
id: 'price';
|
|
952
|
+
type: 'price_range';
|
|
953
|
+
min: number;
|
|
954
|
+
max: number;
|
|
955
|
+
currency: string;
|
|
956
|
+
}
|
|
957
|
+
interface AvailabilityFilter {
|
|
958
|
+
id: 'availability';
|
|
959
|
+
type: 'availability';
|
|
960
|
+
options: FilterOption[];
|
|
961
|
+
}
|
|
962
|
+
interface OptionFilter {
|
|
963
|
+
id: string;
|
|
964
|
+
type: 'option';
|
|
965
|
+
name: string;
|
|
966
|
+
presentation: string;
|
|
967
|
+
options: OptionFilterOption[];
|
|
968
|
+
}
|
|
969
|
+
interface TaxonFilter {
|
|
970
|
+
id: 'taxons';
|
|
971
|
+
type: 'taxon';
|
|
972
|
+
options: TaxonFilterOption[];
|
|
973
|
+
}
|
|
974
|
+
type ProductFilter = PriceRangeFilter | AvailabilityFilter | OptionFilter | TaxonFilter;
|
|
975
|
+
interface SortOption {
|
|
976
|
+
id: string;
|
|
977
|
+
}
|
|
978
|
+
interface ProductFiltersResponse {
|
|
979
|
+
filters: ProductFilter[];
|
|
980
|
+
sort_options: SortOption[];
|
|
981
|
+
default_sort: string;
|
|
982
|
+
total_count: number;
|
|
983
|
+
}
|
|
984
|
+
interface ProductFiltersParams {
|
|
985
|
+
taxon_id?: string;
|
|
986
|
+
q?: Record<string, unknown>;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
export { type Image as $, type AuthTokens as A, type CreatePaymentSetupSessionParams as B, type Country as C, type PaymentSetupSession as D, type CompletePaymentSetupSessionParams as E, type WishedItem as F, type GiftCard as G, type RetryConfig as H, type Asset as I, type AvailabilityFilter as J, type Base as K, type LoginCredentials as L, type Market as M, type CustomerReturn as N, type Order as O, type ProductListParams as P, type Digital as Q, type RequestFn as R, type Shipment as S, type Taxonomy as T, type UpdateOrderParams as U, type DigitalLink as V, type Wishlist as W, type ErrorResponse as X, type Export as Y, type FilterOption as Z, type GiftCardBatch as _, type RegisterParams as a, type Import as a0, type ImportRow as a1, type Invitation as a2, type LineItem as a3, type LineItemInput as a4, type LocaleDefaults as a5, type Metafield as a6, type NewsletterSubscriber as a7, type OptionFilter as a8, type OptionFilterOption as a9, type Variant as aA, type TaxonFilter as aB, type TaxonFilterOption as aC, type OptionType as aa, type OptionValue as ab, type OrderPromotion as ac, type PaginationMeta as ad, type PaymentSource as ae, type Price as af, type PriceRangeFilter as ag, type ProductFilter as ah, type Promotion as ai, type Refund as aj, type Reimbursement as ak, type Report as al, type ReturnAuthorization as am, type ReturnItem as an, type ShippingCategory as ao, type ShippingMethod as ap, type ShippingRate as aq, type SortOption as ar, SpreeError as as, type State as at, type StockItem as au, type StockLocation as av, type StockMovement as aw, type StockTransfer as ax, type StoreCredit as ay, type TaxCategory as az, type RequestOptions as b, type PaginatedResponse as c, type Product as d, type ProductFiltersParams as e, type ProductFiltersResponse as f, type ListParams as g, type TaxonListParams as h, type Taxon as i, type ListResponse as j, type Currency as k, type Locale as l, type CreateCartParams as m, type AddLineItemParams as n, type UpdateLineItemParams as o, type Payment as p, type PaymentMethod as q, type CreatePaymentSessionParams as r, type PaymentSession as s, type UpdatePaymentSessionParams as t, type CompletePaymentSessionParams as u, type Customer as v, type Address as w, type AddressParams as x, type CreditCard as y, type OrderListParams as z };
|