@tiledev/sdk-shopify 0.2.5
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/LICENSE +21 -0
- package/README.md +269 -0
- package/dist/blogs.d.ts +3 -0
- package/dist/blogs.d.ts.map +1 -0
- package/dist/blogs.js +72 -0
- package/dist/blogs.js.map +1 -0
- package/dist/cart.d.ts +3 -0
- package/dist/cart.d.ts.map +1 -0
- package/dist/cart.js +96 -0
- package/dist/cart.js.map +1 -0
- package/dist/cartPolicy.d.ts +15 -0
- package/dist/cartPolicy.d.ts.map +1 -0
- package/dist/cartPolicy.js +74 -0
- package/dist/cartPolicy.js.map +1 -0
- package/dist/client.d.ts +15 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +130 -0
- package/dist/client.js.map +1 -0
- package/dist/collections.d.ts +3 -0
- package/dist/collections.d.ts.map +1 -0
- package/dist/collections.js +44 -0
- package/dist/collections.js.map +1 -0
- package/dist/customer.d.ts +3 -0
- package/dist/customer.d.ts.map +1 -0
- package/dist/customer.js +124 -0
- package/dist/customer.js.map +1 -0
- package/dist/errors.d.ts +19 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +63 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +56 -0
- package/dist/index.js.map +1 -0
- package/dist/messages.d.ts +24 -0
- package/dist/messages.d.ts.map +1 -0
- package/dist/messages.js +81 -0
- package/dist/messages.js.map +1 -0
- package/dist/money.d.ts +18 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +93 -0
- package/dist/money.js.map +1 -0
- package/dist/products.d.ts +6 -0
- package/dist/products.d.ts.map +1 -0
- package/dist/products.js +193 -0
- package/dist/products.js.map +1 -0
- package/dist/queries.d.ts +55 -0
- package/dist/queries.d.ts.map +1 -0
- package/dist/queries.js +582 -0
- package/dist/queries.js.map +1 -0
- package/dist/react/ShopifyProvider.d.ts +181 -0
- package/dist/react/ShopifyProvider.d.ts.map +1 -0
- package/dist/react/ShopifyProvider.js +785 -0
- package/dist/react/ShopifyProvider.js.map +1 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +14 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/useTileCredit.d.ts +34 -0
- package/dist/react/useTileCredit.d.ts.map +1 -0
- package/dist/react/useTileCredit.js +96 -0
- package/dist/react/useTileCredit.js.map +1 -0
- package/dist/shopify.d.ts +3 -0
- package/dist/shopify.d.ts.map +1 -0
- package/dist/shopify.js +54 -0
- package/dist/shopify.js.map +1 -0
- package/dist/tileCredit.d.ts +64 -0
- package/dist/tileCredit.d.ts.map +1 -0
- package/dist/tileCredit.js +274 -0
- package/dist/tileCredit.js.map +1 -0
- package/dist/types.d.ts +785 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +25 -0
- package/dist/types.js.map +1 -0
- package/dist/variants.d.ts +3 -0
- package/dist/variants.d.ts.map +1 -0
- package/dist/variants.js +67 -0
- package/dist/variants.js.map +1 -0
- package/dist/wishlist.d.ts +4 -0
- package/dist/wishlist.d.ts.map +1 -0
- package/dist/wishlist.js +232 -0
- package/dist/wishlist.js.map +1 -0
- package/package.json +63 -0
- package/react/package.json +6 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
export interface ShopifyConfig {
|
|
2
|
+
/** e.g. `mystore.myshopify.com`, without protocol. */
|
|
3
|
+
storeDomain: string;
|
|
4
|
+
/** Public Storefront API token — safe to ship in client code. */
|
|
5
|
+
storefrontAccessToken: string;
|
|
6
|
+
/** e.g. `2024-10`. */
|
|
7
|
+
apiVersion?: string;
|
|
8
|
+
/** For IP-localized prices. Default `US`. */
|
|
9
|
+
country?: string;
|
|
10
|
+
/** BCP-47. Default `EN`. */
|
|
11
|
+
language?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Copy for the alerts the editor's Settings panel configures. Unset keys fall
|
|
14
|
+
* back to `translate`, then to the SDK defaults — see `messages.ts`.
|
|
15
|
+
*/
|
|
16
|
+
messages?: AlertMessages;
|
|
17
|
+
/**
|
|
18
|
+
* Resolves an i18n key, e.g. the Translations workspace's
|
|
19
|
+
* `toast.added_to_cart`. Consulted only for keys `messages` does not set.
|
|
20
|
+
*/
|
|
21
|
+
translate?: MessageResolver;
|
|
22
|
+
/** Cart rules the SDK enforces before it writes. */
|
|
23
|
+
cart?: CartPolicy;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One key per configurable alert. These are the contract with the editor: the
|
|
27
|
+
* Settings panel writes this shape, so the field order here mirrors the panel's
|
|
28
|
+
* Cart / Wishlist / Login / Checkout groups.
|
|
29
|
+
*/
|
|
30
|
+
export type AlertMessageKey = 'cart.added' | 'cart.removed' | 'cart.limitExceeded' | 'cart.outOfStock' | 'wishlist.added' | 'wishlist.removed' | 'wishlist.empty' | 'auth.loginSuccess' | 'auth.loginFailed' | 'auth.loggedOut' | 'auth.resetLinkSent' | 'checkout.orderPlaced' | 'checkout.paymentFailed';
|
|
31
|
+
export type AlertMessages = Partial<Record<AlertMessageKey, string>>;
|
|
32
|
+
/** `(key, fallback) => string`. Returning `''` or throwing keeps the fallback. */
|
|
33
|
+
export type MessageResolver = (key: string, fallback: string) => string;
|
|
34
|
+
export interface CartPolicy {
|
|
35
|
+
/**
|
|
36
|
+
* Most DISTINCT lines a cart may hold — the panel's "Cart Line Item Maximum
|
|
37
|
+
* Limit". Counts lines, not units, so quantity 30 of one variant is one line.
|
|
38
|
+
* Omit for no limit.
|
|
39
|
+
*/
|
|
40
|
+
maxLineItems?: number;
|
|
41
|
+
}
|
|
42
|
+
export interface Money {
|
|
43
|
+
/** Decimal string, e.g. `"19.99"`. */
|
|
44
|
+
amount: string;
|
|
45
|
+
/** ISO 4217 code, e.g. `USD`. */
|
|
46
|
+
currencyCode: string;
|
|
47
|
+
}
|
|
48
|
+
export interface Image {
|
|
49
|
+
url: string;
|
|
50
|
+
altText: string | null;
|
|
51
|
+
width: number | null;
|
|
52
|
+
height: number | null;
|
|
53
|
+
}
|
|
54
|
+
export type ProductMediaKind = 'image' | 'video' | 'external-video' | 'model-3d';
|
|
55
|
+
/**
|
|
56
|
+
* One media item with its URLs resolved, so a gallery does not have to know Shopify's
|
|
57
|
+
* `MediaImage | Video | ExternalVideo | Model3d` union.
|
|
58
|
+
*/
|
|
59
|
+
export interface ProductMedia {
|
|
60
|
+
id: string;
|
|
61
|
+
kind: ProductMediaKind;
|
|
62
|
+
alt: string | null;
|
|
63
|
+
/** Still frame — Shopify provides one for videos too, so it doubles as a poster. */
|
|
64
|
+
posterUrl: string | null;
|
|
65
|
+
/** Playable file for `Video`; null for images and external video. */
|
|
66
|
+
videoUrl: string | null;
|
|
67
|
+
/** YouTube/Vimeo embed for `ExternalVideo`; null otherwise. */
|
|
68
|
+
embeddedUrl: string | null;
|
|
69
|
+
}
|
|
70
|
+
export interface ProductOption {
|
|
71
|
+
id: string;
|
|
72
|
+
name: string;
|
|
73
|
+
values: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface ProductSelectedOption {
|
|
76
|
+
name: string;
|
|
77
|
+
value: string;
|
|
78
|
+
}
|
|
79
|
+
export interface ProductVariant {
|
|
80
|
+
id: string;
|
|
81
|
+
title: string;
|
|
82
|
+
sku: string | null;
|
|
83
|
+
availableForSale: boolean;
|
|
84
|
+
quantityAvailable: number | null;
|
|
85
|
+
price: Money;
|
|
86
|
+
compareAtPrice: Money | null;
|
|
87
|
+
selectedOptions: ProductSelectedOption[];
|
|
88
|
+
image: Image | null;
|
|
89
|
+
}
|
|
90
|
+
/** A pre-order/deferred-payment plan the store has enrolled a variant in. */
|
|
91
|
+
export interface SellingPlan {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
/** What is still owed after the deposit, when the plan defers part of the payment. */
|
|
95
|
+
remainingBalance: string | null;
|
|
96
|
+
currencyCode: string | null;
|
|
97
|
+
}
|
|
98
|
+
/** A variant resolved on its own, carrying enough of its parent product to render a card. */
|
|
99
|
+
export interface StandaloneVariant extends ProductVariant {
|
|
100
|
+
product: {
|
|
101
|
+
id: string;
|
|
102
|
+
title: string;
|
|
103
|
+
handle: string;
|
|
104
|
+
featuredImage: Image | null;
|
|
105
|
+
hasVideo: boolean;
|
|
106
|
+
};
|
|
107
|
+
/** Present only when the store has enrolled this variant for pre-order. */
|
|
108
|
+
sellingPlan: SellingPlan | null;
|
|
109
|
+
}
|
|
110
|
+
export interface ShopifyVariantsAPI {
|
|
111
|
+
/** Anything unreadable — deleted, or invisible to the token — is dropped, not returned as a hole. */
|
|
112
|
+
byIds(ids: string[], opts?: {
|
|
113
|
+
batchSize?: number;
|
|
114
|
+
}): Promise<StandaloneVariant[]>;
|
|
115
|
+
}
|
|
116
|
+
export interface Product {
|
|
117
|
+
id: string;
|
|
118
|
+
handle: string;
|
|
119
|
+
title: string;
|
|
120
|
+
description: string;
|
|
121
|
+
descriptionHtml: string;
|
|
122
|
+
vendor: string;
|
|
123
|
+
productType: string;
|
|
124
|
+
tags: string[];
|
|
125
|
+
totalInventory: number | null;
|
|
126
|
+
availableForSale: boolean;
|
|
127
|
+
priceRange: {
|
|
128
|
+
min: Money;
|
|
129
|
+
max: Money;
|
|
130
|
+
};
|
|
131
|
+
compareAtPriceRange: {
|
|
132
|
+
min: Money;
|
|
133
|
+
max: Money;
|
|
134
|
+
} | null;
|
|
135
|
+
options: ProductOption[];
|
|
136
|
+
variants: ProductVariant[];
|
|
137
|
+
images: Image[];
|
|
138
|
+
featuredImage: Image | null;
|
|
139
|
+
/** Null unless the product is published to the Online Store channel, so needs a fallback. */
|
|
140
|
+
onlineStoreUrl: string | null;
|
|
141
|
+
/** Every media item's `mediaContentType`, in Shopify's order. The media itself is not fetched. */
|
|
142
|
+
mediaContentTypes: string[];
|
|
143
|
+
hasVideo: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Media with URLs resolved, in gallery order (videos → images → 3D models) rather than Shopify's.
|
|
146
|
+
* **Populated only by `products.list`, `byHandle` and `byId`** — the card paths fetch content
|
|
147
|
+
* types without the URLs, so this is `[]` there while `hasVideo` still holds.
|
|
148
|
+
*/
|
|
149
|
+
media: ProductMedia[];
|
|
150
|
+
/** ISO 8601. */
|
|
151
|
+
updatedAt: string;
|
|
152
|
+
createdAt: string;
|
|
153
|
+
}
|
|
154
|
+
export interface Collection {
|
|
155
|
+
id: string;
|
|
156
|
+
handle: string;
|
|
157
|
+
title: string;
|
|
158
|
+
description: string;
|
|
159
|
+
descriptionHtml: string;
|
|
160
|
+
image: Image | null;
|
|
161
|
+
/** Number of products. Populated when listing collections. */
|
|
162
|
+
productsCount?: number;
|
|
163
|
+
}
|
|
164
|
+
export interface CartCost {
|
|
165
|
+
subtotalAmount: Money;
|
|
166
|
+
totalAmount: Money;
|
|
167
|
+
totalTaxAmount: Money | null;
|
|
168
|
+
}
|
|
169
|
+
export interface CartLine {
|
|
170
|
+
id: string;
|
|
171
|
+
quantity: number;
|
|
172
|
+
merchandise: ProductVariant;
|
|
173
|
+
attributes: CartLineAttribute[];
|
|
174
|
+
/** Needed to render a name and link back to the PDP — `merchandise.title` is only the option value. */
|
|
175
|
+
product: {
|
|
176
|
+
id: string;
|
|
177
|
+
title: string;
|
|
178
|
+
handle: string;
|
|
179
|
+
} | null;
|
|
180
|
+
cost: {
|
|
181
|
+
totalAmount: Money;
|
|
182
|
+
amountPerQuantity: Money;
|
|
183
|
+
compareAtAmountPerQuantity: Money | null;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
export interface CartDiscountCode {
|
|
187
|
+
code: string;
|
|
188
|
+
applicable: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** One gift card applied to a cart. Pass `.id` to `cartGiftCardCodesRemove`
|
|
191
|
+
* when removing (NOT the raw code). See docs section 5.5. */
|
|
192
|
+
export interface AppliedGiftCard {
|
|
193
|
+
id: string;
|
|
194
|
+
lastCharacters: string;
|
|
195
|
+
/** Amount deducted from THIS cart's total by this card. */
|
|
196
|
+
presentmentAmountUsed: Money;
|
|
197
|
+
/** Card's remaining balance after this apply. */
|
|
198
|
+
balance: Money;
|
|
199
|
+
/** Historical total consumed across all applies. */
|
|
200
|
+
amountUsed: Money;
|
|
201
|
+
}
|
|
202
|
+
export interface Cart {
|
|
203
|
+
id: string;
|
|
204
|
+
/** Shopify-hosted checkout URL — open in a webview to complete purchase. */
|
|
205
|
+
checkoutUrl: string;
|
|
206
|
+
totalQuantity: number;
|
|
207
|
+
lines: CartLine[];
|
|
208
|
+
cost: CartCost;
|
|
209
|
+
discountCodes: CartDiscountCode[];
|
|
210
|
+
/** Gift cards applied to this cart. Empty when none. Populated by
|
|
211
|
+
* cartGiftCardCodesUpdate/Remove; also included on plain `cart.get`. */
|
|
212
|
+
appliedGiftCards: AppliedGiftCard[];
|
|
213
|
+
createdAt: string;
|
|
214
|
+
updatedAt: string;
|
|
215
|
+
}
|
|
216
|
+
export interface CartLineAttribute {
|
|
217
|
+
key: string;
|
|
218
|
+
value: string;
|
|
219
|
+
}
|
|
220
|
+
export interface CartLineInput {
|
|
221
|
+
merchandiseId: string;
|
|
222
|
+
quantity: number;
|
|
223
|
+
attributes?: CartLineAttribute[];
|
|
224
|
+
/** SellingPlan GID. Passing it is what makes checkout authorise rather than capture. */
|
|
225
|
+
sellingPlanId?: string;
|
|
226
|
+
}
|
|
227
|
+
export interface CartLineUpdateInput {
|
|
228
|
+
/** Existing CartLine.id */
|
|
229
|
+
id: string;
|
|
230
|
+
quantity: number;
|
|
231
|
+
attributes?: CartLineAttribute[];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A policy layer over cart writes — vetoes or decorates a line before it is sent, and hears what
|
|
235
|
+
* landed and what left. Written for stock reservation, but a gift-with-purchase or bundling rule
|
|
236
|
+
* fits the same shape. Advisory only: a `before*` hook that throws counts as approval.
|
|
237
|
+
*/
|
|
238
|
+
export interface CartLineGuard {
|
|
239
|
+
/**
|
|
240
|
+
* Return the input, optionally decorated, to proceed; `null` to cancel. A decorated add is not
|
|
241
|
+
* merged into an existing line for the same variant, so it yields a line per add.
|
|
242
|
+
*/
|
|
243
|
+
beforeAdd?(input: CartLineInput): MaybePromise<CartLineInput | null>;
|
|
244
|
+
/** Only increases are offered — a decrease is reported through `onReleased` instead. */
|
|
245
|
+
beforeIncrease?(line: CartLine, nextQuantity: number): MaybePromise<CartLineUpdateInput | null>;
|
|
246
|
+
/** Reporting only; cannot affect the cart. */
|
|
247
|
+
onLanded?(event: CartLineLandedEvent): void;
|
|
248
|
+
/** Units the cart no longer holds — one place for a guard to give reserved stock back. */
|
|
249
|
+
onReleased?(event: CartLineReleasedEvent): void;
|
|
250
|
+
}
|
|
251
|
+
export interface CartLineLandedEvent {
|
|
252
|
+
variantId: string;
|
|
253
|
+
quantity: number;
|
|
254
|
+
/** Null when the line could not be identified in the returned cart. */
|
|
255
|
+
line: CartLine | null;
|
|
256
|
+
cart: Cart;
|
|
257
|
+
}
|
|
258
|
+
export interface CartLineReleasedEvent {
|
|
259
|
+
variantId: string;
|
|
260
|
+
/** How many units left the cart. For a removal, the whole line. */
|
|
261
|
+
quantity: number;
|
|
262
|
+
/** `rejected` means the guard approved the write and Shopify refused it, so nothing was held. */
|
|
263
|
+
reason: 'decreased' | 'removed' | 'rejected';
|
|
264
|
+
/** The line as it was before the write. Null for a rejected add, which never became one. */
|
|
265
|
+
line: CartLine | null;
|
|
266
|
+
cart: Cart | null;
|
|
267
|
+
}
|
|
268
|
+
export type MaybePromise<T> = T | Promise<T>;
|
|
269
|
+
/**
|
|
270
|
+
* Why a cart write did not land. `guard` is a `cartGuard` veto, `limit` the
|
|
271
|
+
* `maxLineItems` policy, `outOfStock` Shopify refusing an unsellable line.
|
|
272
|
+
* `no-cart` means there was nothing to write to.
|
|
273
|
+
*/
|
|
274
|
+
export type CartRejectionReason = 'guard' | 'limit' | 'outOfStock' | 'no-cart';
|
|
275
|
+
/**
|
|
276
|
+
* The outcome of a cart write. Returned instead of a bare boolean so a caller
|
|
277
|
+
* can tell a guard veto from a limit refusal — both used to read as `false` —
|
|
278
|
+
* and can show `message` without owning a copy table.
|
|
279
|
+
*
|
|
280
|
+
* BREAKING from 0.1.x: `addLine` returned `boolean`. An object is always truthy,
|
|
281
|
+
* so `if (await addLine(...))` no longer detects a refusal — check `.ok`.
|
|
282
|
+
*/
|
|
283
|
+
export interface CartWriteResult {
|
|
284
|
+
ok: boolean;
|
|
285
|
+
/** Absent when `ok`. */
|
|
286
|
+
reason?: CartRejectionReason;
|
|
287
|
+
/** Resolved alert copy for the outcome. Absent for a silent guard veto. */
|
|
288
|
+
message?: string;
|
|
289
|
+
/** The cart as it stands after the write — unchanged on a refusal. */
|
|
290
|
+
cart: Cart | null;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Why a customer mutation failed, mapped from `customerUserErrors[].code`.
|
|
294
|
+
* `unknown` covers transport failures and codes with no alert of their own.
|
|
295
|
+
*/
|
|
296
|
+
export type AuthFailureReason = 'invalid-credentials' | 'email-taken' | 'invalid-input' | 'account-disabled' | 'unknown';
|
|
297
|
+
export interface Address {
|
|
298
|
+
id?: string;
|
|
299
|
+
firstName?: string;
|
|
300
|
+
lastName?: string;
|
|
301
|
+
address1: string;
|
|
302
|
+
address2?: string;
|
|
303
|
+
city: string;
|
|
304
|
+
province?: string;
|
|
305
|
+
country: string;
|
|
306
|
+
zip: string;
|
|
307
|
+
phone?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface Customer {
|
|
310
|
+
id: string;
|
|
311
|
+
email: string;
|
|
312
|
+
firstName: string | null;
|
|
313
|
+
lastName: string | null;
|
|
314
|
+
phone: string | null;
|
|
315
|
+
defaultAddress: Address | null;
|
|
316
|
+
acceptsMarketing: boolean;
|
|
317
|
+
}
|
|
318
|
+
export interface CustomerAccessToken {
|
|
319
|
+
accessToken: string;
|
|
320
|
+
/** ISO 8601 expiry timestamp. */
|
|
321
|
+
expiresAt: string;
|
|
322
|
+
}
|
|
323
|
+
export interface OrderLineItem {
|
|
324
|
+
title: string;
|
|
325
|
+
quantity: number;
|
|
326
|
+
variant: ProductVariant | null;
|
|
327
|
+
originalTotalPrice: Money;
|
|
328
|
+
discountedTotalPrice: Money;
|
|
329
|
+
}
|
|
330
|
+
export interface Order {
|
|
331
|
+
id: string;
|
|
332
|
+
orderNumber: number;
|
|
333
|
+
name: string;
|
|
334
|
+
processedAt: string;
|
|
335
|
+
fulfillmentStatus: string | null;
|
|
336
|
+
financialStatus: string | null;
|
|
337
|
+
statusUrl: string;
|
|
338
|
+
totalPrice: Money;
|
|
339
|
+
subtotalPrice: Money | null;
|
|
340
|
+
totalShippingPrice: Money;
|
|
341
|
+
totalTax: Money | null;
|
|
342
|
+
totalRefunded: Money;
|
|
343
|
+
currencyCode: string;
|
|
344
|
+
email: string | null;
|
|
345
|
+
phone: string | null;
|
|
346
|
+
shippingAddress: Address | null;
|
|
347
|
+
lineItems: OrderLineItem[];
|
|
348
|
+
}
|
|
349
|
+
export interface Blog {
|
|
350
|
+
id: string;
|
|
351
|
+
handle: string;
|
|
352
|
+
title: string;
|
|
353
|
+
}
|
|
354
|
+
export interface ArticleAuthor {
|
|
355
|
+
name: string;
|
|
356
|
+
email: string | null;
|
|
357
|
+
bio: string | null;
|
|
358
|
+
}
|
|
359
|
+
export interface Article {
|
|
360
|
+
id: string;
|
|
361
|
+
handle: string;
|
|
362
|
+
title: string;
|
|
363
|
+
content: string;
|
|
364
|
+
contentHtml: string;
|
|
365
|
+
excerpt: string | null;
|
|
366
|
+
excerptHtml: string | null;
|
|
367
|
+
publishedAt: string;
|
|
368
|
+
tags: string[];
|
|
369
|
+
image: Image | null;
|
|
370
|
+
author: ArticleAuthor | null;
|
|
371
|
+
blog: Blog;
|
|
372
|
+
}
|
|
373
|
+
export interface PageInfo {
|
|
374
|
+
hasNextPage: boolean;
|
|
375
|
+
hasPreviousPage: boolean;
|
|
376
|
+
startCursor: string | null;
|
|
377
|
+
endCursor: string | null;
|
|
378
|
+
}
|
|
379
|
+
export interface Connection<T> {
|
|
380
|
+
nodes: T[];
|
|
381
|
+
pageInfo: PageInfo;
|
|
382
|
+
/** Facets valid for the current query. Populated ONLY by `collections.products`. */
|
|
383
|
+
filters?: Filter[];
|
|
384
|
+
/** Populated ONLY by `collections.products`, so a screen can title itself from the same request. */
|
|
385
|
+
collection?: {
|
|
386
|
+
handle: string;
|
|
387
|
+
title: string;
|
|
388
|
+
};
|
|
389
|
+
/** Every match, not just the loaded window. Populated ONLY by `products.search`. */
|
|
390
|
+
totalCount?: number;
|
|
391
|
+
}
|
|
392
|
+
/** Never built by hand: `JSON.parse` a `FilterValue.input` string and pass the object here. */
|
|
393
|
+
export type ProductFilter = Record<string, unknown>;
|
|
394
|
+
/** One value inside a facet, e.g. "In stock", "$0–$50", "Color: Blue". */
|
|
395
|
+
export interface FilterValue {
|
|
396
|
+
id: string;
|
|
397
|
+
label: string;
|
|
398
|
+
count: number;
|
|
399
|
+
/** JSON string — `JSON.parse` it into a ProductFilter and pass it back. */
|
|
400
|
+
input: string;
|
|
401
|
+
}
|
|
402
|
+
/** A facet returned by Storefront: Availability, Price, Product type, … */
|
|
403
|
+
export interface Filter {
|
|
404
|
+
id: string;
|
|
405
|
+
label: string;
|
|
406
|
+
/** e.g. "LIST" (checkbox values) or "PRICE_RANGE". */
|
|
407
|
+
type: string;
|
|
408
|
+
values: FilterValue[];
|
|
409
|
+
}
|
|
410
|
+
export interface ListOptions {
|
|
411
|
+
first?: number;
|
|
412
|
+
after?: string;
|
|
413
|
+
query?: string;
|
|
414
|
+
sortKey?: string;
|
|
415
|
+
reverse?: boolean;
|
|
416
|
+
/** Honoured by `collections.products` and `products.search`; ignored by `products.list`. */
|
|
417
|
+
filters?: ProductFilter[];
|
|
418
|
+
}
|
|
419
|
+
/** Summary of a customer's wallet. `expiringCents` is the amount that will
|
|
420
|
+
* expire within the tile-credit service's configured horizon. */
|
|
421
|
+
export interface TileCreditWallet {
|
|
422
|
+
appId: string;
|
|
423
|
+
customer: {
|
|
424
|
+
shopifyCustomerGid: string;
|
|
425
|
+
email: string | null;
|
|
426
|
+
firstName: string | null;
|
|
427
|
+
lastName: string | null;
|
|
428
|
+
};
|
|
429
|
+
balanceCents: number;
|
|
430
|
+
lifetimeEarnedCents: number;
|
|
431
|
+
lifetimeRedeemedCents: number;
|
|
432
|
+
expiringCents: number;
|
|
433
|
+
}
|
|
434
|
+
export type TileCreditLedgerType = 'earn' | 'redeem' | 'adjust' | 'expire';
|
|
435
|
+
export type TileCreditLedgerSource = 'signup' | 'live-join' | 'order-fulfilled' | 'manual-grant' | 'manual-deduct' | 'redemption' | 'expiry-sweep';
|
|
436
|
+
export interface TileCreditLedgerEntry {
|
|
437
|
+
id: string;
|
|
438
|
+
type: TileCreditLedgerType;
|
|
439
|
+
amountCents: number;
|
|
440
|
+
currencyCode: string;
|
|
441
|
+
reason: string | null;
|
|
442
|
+
source: TileCreditLedgerSource;
|
|
443
|
+
sourceRef: string | null;
|
|
444
|
+
createdAt: string;
|
|
445
|
+
expiresAt: string | null;
|
|
446
|
+
giftCardGid: string | null;
|
|
447
|
+
idempotencyKey: string | null;
|
|
448
|
+
}
|
|
449
|
+
export interface TileCreditLedgerPage {
|
|
450
|
+
entries: TileCreditLedgerEntry[];
|
|
451
|
+
/** Pass as `before` on the next call. `null` means end of history. */
|
|
452
|
+
nextCursor: string | null;
|
|
453
|
+
}
|
|
454
|
+
export type TileCreditGiftCardStatus = 'active' | 'depleted' | 'expired' | 'disabled';
|
|
455
|
+
export interface TileCreditIssuedGiftCard {
|
|
456
|
+
id: string;
|
|
457
|
+
shopifyGiftCardGid: string;
|
|
458
|
+
/** Last four of the card code — the full code is never stored server-side. */
|
|
459
|
+
last4: string;
|
|
460
|
+
initialAmountCents: number;
|
|
461
|
+
currencyCode: string;
|
|
462
|
+
createdAt: string;
|
|
463
|
+
expiresAt: string | null;
|
|
464
|
+
status: TileCreditGiftCardStatus;
|
|
465
|
+
ledgerEntryId: string;
|
|
466
|
+
redemptionAmountCents: number;
|
|
467
|
+
}
|
|
468
|
+
export interface TileCreditPublicConfig {
|
|
469
|
+
currency: string;
|
|
470
|
+
redemptionMinCents: number;
|
|
471
|
+
/** `null` → no cap besides the wallet balance. */
|
|
472
|
+
redemptionMaxCents: number | null;
|
|
473
|
+
}
|
|
474
|
+
export interface TileCreditRedeemInput {
|
|
475
|
+
amountCents: number;
|
|
476
|
+
/** Persist BEFORE the call so a retry after a network error returns the
|
|
477
|
+
* same code with `duplicate: true`. Auto-generated if omitted, but then
|
|
478
|
+
* you lose crash-safety. */
|
|
479
|
+
idempotencyKey?: string;
|
|
480
|
+
reason?: string;
|
|
481
|
+
}
|
|
482
|
+
export interface TileCreditRedeemResult {
|
|
483
|
+
giftCardGid: string;
|
|
484
|
+
/** Full code — returned exactly once per idempotencyKey. Show + copy
|
|
485
|
+
* immediately, or persist briefly if you need to retry a cart-apply. */
|
|
486
|
+
code: string;
|
|
487
|
+
last4: string;
|
|
488
|
+
amountCents: number;
|
|
489
|
+
currencyCode: string;
|
|
490
|
+
expiresOn: string | null;
|
|
491
|
+
ledgerEntryId: string;
|
|
492
|
+
duplicate: boolean;
|
|
493
|
+
balanceCents: number;
|
|
494
|
+
}
|
|
495
|
+
export type TileCreditErrorCode = 'unauthorized' | 'forbidden' | 'not_found' | 'validation' | 'conflict' | 'insufficient_balance' | 'shopify_upstream' | 'rate_limited' | 'internal' | 'network';
|
|
496
|
+
/** Normalized error class. Branch on `.code`, not `.message`.
|
|
497
|
+
* See docs section 7.1 for the taxonomy and UX guidance. */
|
|
498
|
+
export declare class TileCreditError extends Error {
|
|
499
|
+
readonly code: TileCreditErrorCode;
|
|
500
|
+
readonly status?: number;
|
|
501
|
+
readonly details?: Record<string, unknown>;
|
|
502
|
+
constructor(code: TileCreditErrorCode, message: string, status?: number, details?: Record<string, unknown>);
|
|
503
|
+
}
|
|
504
|
+
export interface TileCreditConfig {
|
|
505
|
+
/** Cloud Run URL, no trailing slash. */
|
|
506
|
+
baseUrl?: string;
|
|
507
|
+
/** `shcat_…` (Customer Accounts API) OR classic Storefront customer token. */
|
|
508
|
+
customerAccessToken: string;
|
|
509
|
+
/** `{shop}.myshopify.com` — case-insensitive; lower-cased internally. */
|
|
510
|
+
shopDomain: string;
|
|
511
|
+
/** Cancels every in-flight request when aborted. */
|
|
512
|
+
signal?: AbortSignal;
|
|
513
|
+
/** Per-request timeout. Default 20_000ms. */
|
|
514
|
+
timeoutMs?: number;
|
|
515
|
+
}
|
|
516
|
+
/** Ledger entry enriched with the masked gift-card info it links to (redeem
|
|
517
|
+
* rows only). Everything else — earn / adjust / expire — passes through
|
|
518
|
+
* with `card: null`. Produced by `TileCreditClient.getHistory()`, which
|
|
519
|
+
* fans-out ledger + list-gift-cards and joins by `giftCardGid`. */
|
|
520
|
+
export interface TileCreditHistoryEntry extends TileCreditLedgerEntry {
|
|
521
|
+
card: {
|
|
522
|
+
last4: string;
|
|
523
|
+
status: TileCreditGiftCardStatus;
|
|
524
|
+
expiresAt: string | null;
|
|
525
|
+
initialAmountCents: number;
|
|
526
|
+
} | null;
|
|
527
|
+
}
|
|
528
|
+
export interface TileCreditHistoryPage {
|
|
529
|
+
entries: TileCreditHistoryEntry[];
|
|
530
|
+
nextCursor: string | null;
|
|
531
|
+
}
|
|
532
|
+
export interface TileCreditAPI {
|
|
533
|
+
getWallet(): Promise<TileCreditWallet>;
|
|
534
|
+
getLedger(opts?: {
|
|
535
|
+
limit?: number;
|
|
536
|
+
before?: string;
|
|
537
|
+
}): Promise<TileCreditLedgerPage>;
|
|
538
|
+
listGiftCards(): Promise<{
|
|
539
|
+
giftCards: TileCreditIssuedGiftCard[];
|
|
540
|
+
}>;
|
|
541
|
+
getConfig(): Promise<TileCreditPublicConfig>;
|
|
542
|
+
redeem(input: TileCreditRedeemInput): Promise<TileCreditRedeemResult>;
|
|
543
|
+
/** Ledger + gift-cards joined into one history feed. See docs §4.6.
|
|
544
|
+
* Note: this issues TWO requests (ledger + list-gift-cards) in parallel;
|
|
545
|
+
* use `getLedger` on its own if you don't need the card metadata. */
|
|
546
|
+
getHistory(opts?: {
|
|
547
|
+
limit?: number;
|
|
548
|
+
before?: string;
|
|
549
|
+
}): Promise<TileCreditHistoryPage>;
|
|
550
|
+
}
|
|
551
|
+
export interface UserError {
|
|
552
|
+
field: string[] | null;
|
|
553
|
+
message: string;
|
|
554
|
+
code?: string;
|
|
555
|
+
}
|
|
556
|
+
export declare class ShopifyError extends Error {
|
|
557
|
+
readonly errors: UserError[];
|
|
558
|
+
constructor(message: string, errors?: UserError[]);
|
|
559
|
+
}
|
|
560
|
+
export interface ShopifyProductsAPI {
|
|
561
|
+
list(opts?: ListOptions): Promise<Connection<Product>>;
|
|
562
|
+
byHandle(handle: string): Promise<Product | null>;
|
|
563
|
+
byId(id: string): Promise<Product | null>;
|
|
564
|
+
/**
|
|
565
|
+
* Resolves product GIDs in the order given, batched to stay under Shopify's query cost cap.
|
|
566
|
+
* Anything that does not resolve is dropped rather than returned as a hole.
|
|
567
|
+
*/
|
|
568
|
+
byIds(ids: string[], opts?: {
|
|
569
|
+
batchSize?: number;
|
|
570
|
+
keepMissing?: false;
|
|
571
|
+
}): Promise<Product[]>;
|
|
572
|
+
/** As above, but keeps a positional `null` so the result lines up index-for-index with `ids`. */
|
|
573
|
+
byIds(ids: string[], opts: {
|
|
574
|
+
batchSize?: number;
|
|
575
|
+
keepMissing: true;
|
|
576
|
+
}): Promise<(Product | null)[]>;
|
|
577
|
+
/**
|
|
578
|
+
* Uses the `search` root rather than `products(query:)`, so the result also carries `totalCount`
|
|
579
|
+
* and `filters`. `sortKey` is `SearchSortKeys` — only `RELEVANCE` or `PRICE`, anything else
|
|
580
|
+
* throws; use `list({ query })` for the full `ProductSortKeys` set.
|
|
581
|
+
*/
|
|
582
|
+
search(query: string, opts?: Omit<ListOptions, 'query'>): Promise<Connection<Product>>;
|
|
583
|
+
recommended(productId: string): Promise<Product[]>;
|
|
584
|
+
}
|
|
585
|
+
export interface ShopifyCollectionsAPI {
|
|
586
|
+
list(opts?: ListOptions): Promise<Connection<Collection>>;
|
|
587
|
+
byHandle(handle: string): Promise<Collection | null>;
|
|
588
|
+
products(handle: string, opts?: ListOptions): Promise<Connection<Product>>;
|
|
589
|
+
}
|
|
590
|
+
export interface ShopifyCartAPI {
|
|
591
|
+
create(input?: {
|
|
592
|
+
lines?: CartLineInput[];
|
|
593
|
+
discountCodes?: string[];
|
|
594
|
+
}): Promise<Cart>;
|
|
595
|
+
/** Null if the cart expired. */
|
|
596
|
+
get(cartId: string): Promise<Cart | null>;
|
|
597
|
+
addLines(cartId: string, lines: CartLineInput[]): Promise<Cart>;
|
|
598
|
+
updateLines(cartId: string, lines: CartLineUpdateInput[]): Promise<Cart>;
|
|
599
|
+
removeLines(cartId: string, lineIds: string[]): Promise<Cart>;
|
|
600
|
+
applyDiscountCodes(cartId: string, codes: string[]): Promise<Cart>;
|
|
601
|
+
setBuyerIdentity(cartId: string, identity: {
|
|
602
|
+
email?: string;
|
|
603
|
+
countryCode?: string;
|
|
604
|
+
customerAccessToken?: string;
|
|
605
|
+
}): Promise<Cart>;
|
|
606
|
+
/** Apply one or more gift-card codes to a cart. Idempotent per code.
|
|
607
|
+
* Requires `buyerIdentity.countryCode` on the cart — Shopify rejects
|
|
608
|
+
* gift cards with `INVALID_PAYMENT` otherwise. Callers should set the
|
|
609
|
+
* country first (see `setBuyerIdentity` / shop default via `shop.load`). */
|
|
610
|
+
applyGiftCardCodes(cartId: string, codes: string[]): Promise<Cart>;
|
|
611
|
+
/** Remove gift cards by their AppliedGiftCard.id (NOT the raw code). */
|
|
612
|
+
removeGiftCardCodes(cartId: string, appliedGiftCardIds: string[]): Promise<Cart>;
|
|
613
|
+
}
|
|
614
|
+
export interface ShopifyCustomerAPI {
|
|
615
|
+
signup(input: {
|
|
616
|
+
email: string;
|
|
617
|
+
password: string;
|
|
618
|
+
firstName?: string;
|
|
619
|
+
lastName?: string;
|
|
620
|
+
acceptsMarketing?: boolean;
|
|
621
|
+
}): Promise<{
|
|
622
|
+
customer: Customer;
|
|
623
|
+
accessToken: CustomerAccessToken;
|
|
624
|
+
}>;
|
|
625
|
+
login(input: {
|
|
626
|
+
email: string;
|
|
627
|
+
password: string;
|
|
628
|
+
}): Promise<CustomerAccessToken>;
|
|
629
|
+
logout(accessToken: string): Promise<void>;
|
|
630
|
+
profile(accessToken: string): Promise<Customer | null>;
|
|
631
|
+
recoverPassword(email: string): Promise<void>;
|
|
632
|
+
updateProfile(accessToken: string, patch: Partial<Pick<Customer, 'firstName' | 'lastName' | 'phone' | 'acceptsMarketing'>>): Promise<Customer>;
|
|
633
|
+
orders(accessToken: string, opts?: ListOptions): Promise<Connection<Order>>;
|
|
634
|
+
orderById(accessToken: string, orderId: string): Promise<Order | null>;
|
|
635
|
+
}
|
|
636
|
+
export interface ShopifyBlogsAPI {
|
|
637
|
+
list(opts?: ListOptions): Promise<Connection<Blog>>;
|
|
638
|
+
byHandle(handle: string): Promise<Blog | null>;
|
|
639
|
+
articles(blogHandle: string, opts?: ListOptions): Promise<Connection<Article>>;
|
|
640
|
+
articleByHandle(blogHandle: string, articleHandle: string): Promise<Article | null>;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Matches `window.localStorage` so web works out of the box; RN passes AsyncStorage. Async
|
|
644
|
+
* implementations are fine — every call site awaits.
|
|
645
|
+
*/
|
|
646
|
+
export interface WishlistStorageAdapter {
|
|
647
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
648
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
649
|
+
removeItem(key: string): void | Promise<void>;
|
|
650
|
+
}
|
|
651
|
+
export interface WishlistItem {
|
|
652
|
+
productId: string;
|
|
653
|
+
/** Snapshot stored so the UI can render before the network round-trip. */
|
|
654
|
+
basic: {
|
|
655
|
+
handle?: string;
|
|
656
|
+
title?: string;
|
|
657
|
+
image?: string;
|
|
658
|
+
price?: Money;
|
|
659
|
+
};
|
|
660
|
+
/** ms epoch. */
|
|
661
|
+
addedAt: number;
|
|
662
|
+
/**
|
|
663
|
+
* Hydrated by `init()` / `refresh()`. `undefined` = not fetched yet, `null` = no longer resolves
|
|
664
|
+
* upstream (the entry is purged unless `keepDeleted` is set).
|
|
665
|
+
*/
|
|
666
|
+
product?: Product | null;
|
|
667
|
+
}
|
|
668
|
+
export interface WishlistInitOptions {
|
|
669
|
+
/** Defaults to `window.localStorage` on web, no-op elsewhere. */
|
|
670
|
+
storage?: WishlistStorageAdapter;
|
|
671
|
+
/** Defaults to `tile:shopify:wishlist:v1`. */
|
|
672
|
+
storageKey?: string;
|
|
673
|
+
/** Product IDs per hydration request. Default 100, near Shopify's query cost ceiling. */
|
|
674
|
+
batchSize?: number;
|
|
675
|
+
/** Default `true`. False for lazy hydration — call `refresh()` on your own schedule. */
|
|
676
|
+
hydrateOnInit?: boolean;
|
|
677
|
+
/**
|
|
678
|
+
* Forwarded to the hydration `refresh()`. Worth setting for a shopper-facing wishlist: `null`
|
|
679
|
+
* covers a merely *temporarily* unpublished product, which the default loses forever.
|
|
680
|
+
*/
|
|
681
|
+
keepDeleted?: boolean;
|
|
682
|
+
}
|
|
683
|
+
export interface WishlistRefreshOptions {
|
|
684
|
+
/**
|
|
685
|
+
* Keeps entries whose product no longer resolves, as `product: null`, so the UI can show a "no
|
|
686
|
+
* longer available" state. Default `false`: they are dropped from storage.
|
|
687
|
+
*/
|
|
688
|
+
keepDeleted?: boolean;
|
|
689
|
+
}
|
|
690
|
+
export type WishlistChangeListener = (items: WishlistItem[]) => void;
|
|
691
|
+
export interface ShopifyWishlistAPI {
|
|
692
|
+
init(opts?: WishlistInitOptions): Promise<WishlistItem[]>;
|
|
693
|
+
isReady(): boolean;
|
|
694
|
+
/** A `Product` has its snapshot extracted automatically; a raw id can carry one. */
|
|
695
|
+
add(product: Product): Promise<WishlistItem>;
|
|
696
|
+
add(productId: string, basic?: WishlistItem['basic']): Promise<WishlistItem>;
|
|
697
|
+
/** True if the item was present. */
|
|
698
|
+
remove(productId: string): Promise<boolean>;
|
|
699
|
+
/** Returns the resulting membership. */
|
|
700
|
+
toggle(product: Product): Promise<boolean>;
|
|
701
|
+
toggle(productId: string, basic?: WishlistItem['basic']): Promise<boolean>;
|
|
702
|
+
has(productId: string): boolean;
|
|
703
|
+
/** Newest first. */
|
|
704
|
+
list(): WishlistItem[];
|
|
705
|
+
count(): number;
|
|
706
|
+
clear(): Promise<void>;
|
|
707
|
+
/** Re-fetches every product in `batchSize` chunks, so any count is fine. */
|
|
708
|
+
refresh(opts?: WishlistRefreshOptions): Promise<WishlistItem[]>;
|
|
709
|
+
/** Returns an unsubscribe function. */
|
|
710
|
+
onChange(listener: WishlistChangeListener): () => void;
|
|
711
|
+
}
|
|
712
|
+
export interface ShopifyIntegration {
|
|
713
|
+
/** Must be called before any other method. */
|
|
714
|
+
init(config: ShopifyConfig): Promise<void>;
|
|
715
|
+
isReady(): boolean;
|
|
716
|
+
/** True for the mock build, false for the real Storefront-API one. */
|
|
717
|
+
readonly isMock: boolean;
|
|
718
|
+
products: ShopifyProductsAPI;
|
|
719
|
+
variants: ShopifyVariantsAPI;
|
|
720
|
+
collections: ShopifyCollectionsAPI;
|
|
721
|
+
cart: ShopifyCartAPI;
|
|
722
|
+
customer: ShopifyCustomerAPI;
|
|
723
|
+
blogs: ShopifyBlogsAPI;
|
|
724
|
+
wishlist: ShopifyWishlistAPI;
|
|
725
|
+
/** Money format and currency, loaded at init. */
|
|
726
|
+
shop: {
|
|
727
|
+
load(): Promise<{
|
|
728
|
+
moneyFormat: string | null;
|
|
729
|
+
currencyCode: string | null;
|
|
730
|
+
}>;
|
|
731
|
+
moneyFormat(): string | null;
|
|
732
|
+
/** ISO country code from Storefront `localization.country.isoCode`
|
|
733
|
+
* (e.g. `"US"`). Cached after first call. Used as the country
|
|
734
|
+
* fallback when applying gift cards. */
|
|
735
|
+
countryCode(): Promise<string | null>;
|
|
736
|
+
};
|
|
737
|
+
formatMoney(money: Money | null | undefined): string;
|
|
738
|
+
/**
|
|
739
|
+
* Alert copy + cart rules from the editor's Settings panel. `message()` is
|
|
740
|
+
* what the SDK itself resolves with, exposed so a screen can label its own
|
|
741
|
+
* UI (an empty-wishlist placeholder, say) from the same source.
|
|
742
|
+
*/
|
|
743
|
+
alerts: {
|
|
744
|
+
message(key: AlertMessageKey): string;
|
|
745
|
+
/** Full swap — a cleared panel field falls back to the default. */
|
|
746
|
+
setMessages(messages?: AlertMessages | null): void;
|
|
747
|
+
/** Merge, for a Live Layer publish of a single field. */
|
|
748
|
+
patchMessages(messages: AlertMessages): void;
|
|
749
|
+
setPolicy(policy?: CartPolicy | null): void;
|
|
750
|
+
};
|
|
751
|
+
/**
|
|
752
|
+
* Tile Credit — customer wallet + gift-card mint + cart apply.
|
|
753
|
+
* Configure once per customer session; see `TileCreditClient` docs
|
|
754
|
+
* for the full flow. `null` until `shopify.tileCredit.configure(...)`.
|
|
755
|
+
*/
|
|
756
|
+
tileCredit: {
|
|
757
|
+
/** Bind a customer session to Tile Credit. Rebuild the client on
|
|
758
|
+
* logout / new customer. Safe to call multiple times — it replaces
|
|
759
|
+
* the underlying client instance. */
|
|
760
|
+
configure(config: TileCreditConfig): TileCreditAPI;
|
|
761
|
+
/** The active client, or `null` when `configure` hasn't been called. */
|
|
762
|
+
client(): TileCreditAPI | null;
|
|
763
|
+
/**
|
|
764
|
+
* Redeem then apply to a Shopify cart in one call — mints a gift card,
|
|
765
|
+
* ensures the cart has a `buyerIdentity.countryCode` (belt + suspenders
|
|
766
|
+
* even if already set), and applies the code. Returns the mint result
|
|
767
|
+
* AND the updated cart. Docs section 5.7.
|
|
768
|
+
*/
|
|
769
|
+
redeemAndApplyToCart(opts: {
|
|
770
|
+
cartId: string;
|
|
771
|
+
amountCents: number;
|
|
772
|
+
/** Persist BEFORE the call for crash-safe retries. Auto-generated
|
|
773
|
+
* if omitted (loses that guarantee — see docs section 8). */
|
|
774
|
+
idempotencyKey?: string;
|
|
775
|
+
reason?: string;
|
|
776
|
+
/** ISO country to set on the cart if missing. Defaults to the
|
|
777
|
+
* shop's `localization.country.isoCode`. */
|
|
778
|
+
countryFallback?: string;
|
|
779
|
+
}): Promise<{
|
|
780
|
+
redeemed: TileCreditRedeemResult;
|
|
781
|
+
cart: Cart;
|
|
782
|
+
}>;
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
//# sourceMappingURL=types.d.ts.map
|