@misiki/gocommerce-connector 0.1.0 → 0.2.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 +155 -152
- package/dist/index-CJ836ZI3.d.cts +5424 -0
- package/dist/index-CJ836ZI3.d.ts +5424 -0
- package/dist/index.cjs +2308 -2066
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -1
- package/dist/index.d.ts +85 -1
- package/dist/index.js +2273 -2037
- package/dist/index.js.map +1 -1
- package/dist/services/index.cjs +2256 -2061
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -4742
- package/dist/services/index.d.ts +1 -4742
- package/dist/services/index.js +2247 -2027
- package/dist/services/index.js.map +1 -1
- package/package.json +9 -7
|
@@ -1,4742 +1 @@
|
|
|
1
|
-
|
|
2
|
-
type Money = {
|
|
3
|
-
amount_minor: number;
|
|
4
|
-
currency: string;
|
|
5
|
-
};
|
|
6
|
-
type ListMeta = {
|
|
7
|
-
total: number;
|
|
8
|
-
limit: number;
|
|
9
|
-
offset: number;
|
|
10
|
-
page: number;
|
|
11
|
-
total_pages: number;
|
|
12
|
-
};
|
|
13
|
-
type GcVariantImage = {
|
|
14
|
-
media_id?: number;
|
|
15
|
-
url?: string;
|
|
16
|
-
alt?: string;
|
|
17
|
-
kind?: 'image' | 'video' | 'model';
|
|
18
|
-
};
|
|
19
|
-
type GcVariant = {
|
|
20
|
-
id: number;
|
|
21
|
-
product_id: number;
|
|
22
|
-
sku?: string;
|
|
23
|
-
label?: string;
|
|
24
|
-
position?: number;
|
|
25
|
-
price: Money;
|
|
26
|
-
compare_at_price?: Money;
|
|
27
|
-
/** Option VALUES, positionally aligned with the product's `options`. */
|
|
28
|
-
options?: string[];
|
|
29
|
-
image?: GcVariantImage | null;
|
|
30
|
-
taxable?: boolean;
|
|
31
|
-
active?: boolean;
|
|
32
|
-
/** On hand minus reserved. */
|
|
33
|
-
available?: number;
|
|
34
|
-
stock_on_hand?: number;
|
|
35
|
-
stock_reserved?: number;
|
|
36
|
-
track_inventory?: boolean;
|
|
37
|
-
/** Take the order when the count has run out, instead of refusing it. */
|
|
38
|
-
continue_selling?: boolean;
|
|
39
|
-
barcode?: string;
|
|
40
|
-
hs_code?: string;
|
|
41
|
-
origin_country?: string;
|
|
42
|
-
weight?: number;
|
|
43
|
-
weight_unit?: string;
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
};
|
|
46
|
-
type GcProductOption = {
|
|
47
|
-
id: number;
|
|
48
|
-
name: string;
|
|
49
|
-
position?: number;
|
|
50
|
-
values?: {
|
|
51
|
-
id: number;
|
|
52
|
-
value: string;
|
|
53
|
-
position?: number;
|
|
54
|
-
}[];
|
|
55
|
-
};
|
|
56
|
-
type GcProductCategory = {
|
|
57
|
-
id: number;
|
|
58
|
-
slug: string;
|
|
59
|
-
title: string;
|
|
60
|
-
full_name?: string;
|
|
61
|
-
};
|
|
62
|
-
type GcProductCollection = {
|
|
63
|
-
id: number;
|
|
64
|
-
slug: string;
|
|
65
|
-
title: string;
|
|
66
|
-
};
|
|
67
|
-
type GcProduct = {
|
|
68
|
-
id: number;
|
|
69
|
-
slug: string;
|
|
70
|
-
title: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
status?: 'draft' | 'active' | 'archived';
|
|
73
|
-
currency?: string;
|
|
74
|
-
product_type?: string;
|
|
75
|
-
vendor?: string;
|
|
76
|
-
tags?: string[];
|
|
77
|
-
seo_title?: string;
|
|
78
|
-
seo_description?: string;
|
|
79
|
-
/**
|
|
80
|
-
* The product's own picture, site-relative (`/media/<hash>.jpg`).
|
|
81
|
-
*
|
|
82
|
-
* Not in the OpenAPI document — `/doc` still describes `Variant.image` as the only shopper-facing
|
|
83
|
-
* media — but the server returns it on every product read, and on this catalogue it is the ONLY
|
|
84
|
-
* image present: no variant nominates one. Read defensively for that reason: a server older than
|
|
85
|
-
* the field simply omits it, and the variant images take over.
|
|
86
|
-
*/
|
|
87
|
-
image_url?: string | null;
|
|
88
|
-
category?: GcProductCategory | null;
|
|
89
|
-
collections?: GcProductCollection[];
|
|
90
|
-
options?: GcProductOption[];
|
|
91
|
-
variants?: GcVariant[];
|
|
92
|
-
metadata?: Record<string, unknown>;
|
|
93
|
-
created_at?: string;
|
|
94
|
-
updated_at?: string;
|
|
95
|
-
};
|
|
96
|
-
type GcCategory = {
|
|
97
|
-
id: number;
|
|
98
|
-
parent_id: number | null;
|
|
99
|
-
slug: string;
|
|
100
|
-
title: string;
|
|
101
|
-
position?: number;
|
|
102
|
-
depth?: number;
|
|
103
|
-
child_count?: number;
|
|
104
|
-
full_name?: string;
|
|
105
|
-
metadata?: Record<string, unknown>;
|
|
106
|
-
children?: GcCategory[];
|
|
107
|
-
created_at?: string;
|
|
108
|
-
updated_at?: string;
|
|
109
|
-
};
|
|
110
|
-
/** `GET /api/categories/{slug}` — the category plus the active products filed under it. */
|
|
111
|
-
type GcCategoryPage = GcCategory & {
|
|
112
|
-
products?: GcProduct[];
|
|
113
|
-
};
|
|
114
|
-
type GcCollection = {
|
|
115
|
-
id: number;
|
|
116
|
-
slug: string;
|
|
117
|
-
title: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
position?: number;
|
|
120
|
-
metadata?: Record<string, unknown>;
|
|
121
|
-
created_at?: string;
|
|
122
|
-
updated_at?: string;
|
|
123
|
-
};
|
|
124
|
-
type GcCollectionPage = GcCollection & {
|
|
125
|
-
products?: GcProduct[];
|
|
126
|
-
};
|
|
127
|
-
type GcCartLine = {
|
|
128
|
-
id: number;
|
|
129
|
-
product_id: number;
|
|
130
|
-
variant_id: number;
|
|
131
|
-
sku?: string;
|
|
132
|
-
title?: string;
|
|
133
|
-
variant_label?: string;
|
|
134
|
-
quantity: number;
|
|
135
|
-
unit_price: Money;
|
|
136
|
-
total: Money;
|
|
137
|
-
current_price?: Money;
|
|
138
|
-
/** -1 when the variant does not track inventory. */
|
|
139
|
-
available?: number;
|
|
140
|
-
in_stock?: boolean;
|
|
141
|
-
price_changed?: boolean;
|
|
142
|
-
};
|
|
143
|
-
type GcCart = {
|
|
144
|
-
id: string;
|
|
145
|
-
status?: 'open' | 'converted' | 'abandoned';
|
|
146
|
-
currency: string;
|
|
147
|
-
email?: string;
|
|
148
|
-
line_items?: GcCartLine[];
|
|
149
|
-
item_count?: number;
|
|
150
|
-
subtotal: Money;
|
|
151
|
-
metadata?: Record<string, unknown>;
|
|
152
|
-
created_at?: string;
|
|
153
|
-
updated_at?: string;
|
|
154
|
-
expires_at?: string;
|
|
155
|
-
};
|
|
156
|
-
type GcAddress = {
|
|
157
|
-
name?: string;
|
|
158
|
-
phone?: string;
|
|
159
|
-
line1: string;
|
|
160
|
-
line2?: string;
|
|
161
|
-
city: string;
|
|
162
|
-
state?: string;
|
|
163
|
-
postal_code: string;
|
|
164
|
-
country: string;
|
|
165
|
-
};
|
|
166
|
-
type GcOrderLine = {
|
|
167
|
-
id: number;
|
|
168
|
-
product_id: number | null;
|
|
169
|
-
variant_id: number | null;
|
|
170
|
-
sku?: string;
|
|
171
|
-
title?: string;
|
|
172
|
-
variant_label?: string;
|
|
173
|
-
quantity: number;
|
|
174
|
-
unit_price: Money;
|
|
175
|
-
total: Money;
|
|
176
|
-
metadata?: Record<string, unknown>;
|
|
177
|
-
};
|
|
178
|
-
type GcFulfillment = {
|
|
179
|
-
id: number;
|
|
180
|
-
status?: 'shipped' | 'delivered' | 'cancelled';
|
|
181
|
-
provider?: string;
|
|
182
|
-
tracking?: string;
|
|
183
|
-
label_url?: string;
|
|
184
|
-
created_at?: string;
|
|
185
|
-
};
|
|
186
|
-
type GcOrder = {
|
|
187
|
-
id: number;
|
|
188
|
-
number: string;
|
|
189
|
-
status?: 'pending' | 'confirmed' | 'shipped' | 'delivered' | 'cancelled';
|
|
190
|
-
payment_status?: 'pending' | 'paid' | 'failed' | 'refunded';
|
|
191
|
-
payment_provider?: string;
|
|
192
|
-
payment_reference?: string;
|
|
193
|
-
currency: string;
|
|
194
|
-
subtotal: Money;
|
|
195
|
-
shipping: Money;
|
|
196
|
-
discount: Money;
|
|
197
|
-
total: Money;
|
|
198
|
-
email?: string;
|
|
199
|
-
phone?: string;
|
|
200
|
-
name?: string;
|
|
201
|
-
language?: string;
|
|
202
|
-
address?: GcAddress;
|
|
203
|
-
line_items?: GcOrderLine[];
|
|
204
|
-
fulfillments?: GcFulfillment[];
|
|
205
|
-
metadata?: Record<string, unknown>;
|
|
206
|
-
/** Returned once, at checkout. It is how a guest reads their own order back. */
|
|
207
|
-
access_token?: string;
|
|
208
|
-
created_at?: string;
|
|
209
|
-
updated_at?: string;
|
|
210
|
-
};
|
|
211
|
-
type GcPaymentIntent = {
|
|
212
|
-
/** `none` means nothing further is needed — cash on delivery. */
|
|
213
|
-
kind?: 'none' | 'client_action' | 'redirect';
|
|
214
|
-
provider?: string;
|
|
215
|
-
reference?: string;
|
|
216
|
-
client_data?: Record<string, string>;
|
|
217
|
-
};
|
|
218
|
-
type GcCheckoutResult = {
|
|
219
|
-
order: GcOrder;
|
|
220
|
-
payment?: GcPaymentIntent;
|
|
221
|
-
};
|
|
222
|
-
/** `GET /api/checkout` — what this store accepts. */
|
|
223
|
-
type GcCheckoutMethods = {
|
|
224
|
-
currency: string;
|
|
225
|
-
payment_methods: string[];
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* The storefront route that forwards to the GoCommerce server, and the only path the browser is
|
|
230
|
-
* ever pointed at. It must not start with `/api/`: rest-guard.ts intercepts that prefix as a
|
|
231
|
-
* Litekart REST path and would answer these calls itself.
|
|
232
|
-
*/
|
|
233
|
-
declare const API_PROXY_PREFIX = "/proxy/gocommerce";
|
|
234
|
-
type Credentials = {
|
|
235
|
-
/** Base url of the GoCommerce server, e.g. `http://127.0.0.1:8080`. */
|
|
236
|
-
apiUrl?: string;
|
|
237
|
-
[key: string]: string | undefined;
|
|
238
|
-
};
|
|
239
|
-
/** `{ data, meta }` — the envelope every GoCommerce endpoint answers with. */
|
|
240
|
-
type Envelope<T> = {
|
|
241
|
-
data: T;
|
|
242
|
-
meta?: ListMeta;
|
|
243
|
-
};
|
|
244
|
-
/** What the storefront shows when a request fails: GoCommerce's own message, not a status code. */
|
|
245
|
-
declare class GoCommerceError extends Error {
|
|
246
|
-
code: string;
|
|
247
|
-
details: unknown;
|
|
248
|
-
status: number;
|
|
249
|
-
constructor(message: string, code?: string, status?: number, details?: unknown);
|
|
250
|
-
}
|
|
251
|
-
declare class BaseService {
|
|
252
|
-
private _fetch;
|
|
253
|
-
private static _credentials;
|
|
254
|
-
private static _languageCode?;
|
|
255
|
-
constructor(fetchFn?: typeof fetch);
|
|
256
|
-
setFetch(fetchFn: typeof fetch): this;
|
|
257
|
-
getFetch(): typeof fetch;
|
|
258
|
-
/**
|
|
259
|
-
* The fetch a GoCommerce call actually goes out on.
|
|
260
|
-
*
|
|
261
|
-
* In the browser it is whatever was handed in, against this storefront's own origin. On the
|
|
262
|
-
* server it is deliberately the platform's, not SvelteKit's: a universal `+page.ts` load is
|
|
263
|
-
* given a `fetch` that simulates a browser's CORS check, and GoCommerce sends no
|
|
264
|
-
* `Access-Control-Allow-Origin`, so the same product page that renders from a `+page.server.ts`
|
|
265
|
-
* would throw from a `+page.ts`. Nothing is lost by stepping around it — SvelteKit's fetch adds
|
|
266
|
-
* cookie forwarding and internal routing, and both are about this storefront's own origin, not
|
|
267
|
-
* a separate API host.
|
|
268
|
-
*/
|
|
269
|
-
private transport;
|
|
270
|
-
/**
|
|
271
|
-
* The hook the storefront's `src/lib/core/connectors/init.ts` calls with `PUBLIC_GOCOMMERCE_*`. Merges, so a
|
|
272
|
-
* later call with a subset never erases the base url an earlier one established.
|
|
273
|
-
*/
|
|
274
|
-
static setCredentials(creds: Credentials): void;
|
|
275
|
-
static getCredentials(): Credentials;
|
|
276
|
-
static setBaseUrl(url?: string): void;
|
|
277
|
-
/** Trailing slashes stripped so `${base}/api/products` never doubles up. */
|
|
278
|
-
static getBaseUrl(): string;
|
|
279
|
-
static setLanguageCode(code?: string): void;
|
|
280
|
-
static getLanguageCode(): string | undefined;
|
|
281
|
-
setBaseUrl(url?: string): this;
|
|
282
|
-
getBaseUrl(): string;
|
|
283
|
-
/**
|
|
284
|
-
* Where a request for `path` actually goes.
|
|
285
|
-
*
|
|
286
|
-
* GoCommerce sends no CORS headers and answers a preflight with 405, so a browser cannot reach
|
|
287
|
-
* it cross-origin at all — and neither can a universal `+page.ts` load, because SvelteKit
|
|
288
|
-
* simulates the same CORS check server-side for consistency. So anything the browser issues goes
|
|
289
|
-
* through this storefront's own origin (`src/routes/proxy/gocommerce/[...path]`), which is
|
|
290
|
-
* same-origin and needs no headers from the API.
|
|
291
|
-
*
|
|
292
|
-
* On the server there is no such rule, and the extra hop through the storefront's own handler
|
|
293
|
-
* would be a request the process makes to itself, so it calls the API directly.
|
|
294
|
-
*/
|
|
295
|
-
static apiUrl(path: string): string;
|
|
296
|
-
/**
|
|
297
|
-
* Where an `<img>` points.
|
|
298
|
-
*
|
|
299
|
-
* Media urls come back site-relative for files this store holds (`/media/42.jpg`). Unlike an API
|
|
300
|
-
* call, the consumer is always the browser — a server-rendered `<img src>` is still fetched by
|
|
301
|
-
* it — so this always resolves through the proxy, and the picture loads wherever the API happens
|
|
302
|
-
* to be reachable from. A url that is already absolute belongs to someone else's host and is
|
|
303
|
-
* left exactly as it is.
|
|
304
|
-
*/
|
|
305
|
-
static mediaUrl(path: string): string;
|
|
306
|
-
static isBrowser(): boolean;
|
|
307
|
-
/**
|
|
308
|
-
* One request against the GoCommerce API.
|
|
309
|
-
*
|
|
310
|
-
* Unwraps `{ data, meta }` and turns `{ error: { code, message } }` into a thrown
|
|
311
|
-
* GoCommerceError carrying the server's own wording — a 409 at checkout says which line went
|
|
312
|
-
* stale, and that sentence is what the shopper needs to see.
|
|
313
|
-
*/
|
|
314
|
-
protected api<T>(method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE', path: string, body?: unknown, headers?: Record<string, string>): Promise<Envelope<T>>;
|
|
315
|
-
/**
|
|
316
|
-
* Litekart-era raw-url reads. Deliberately not routed to GoCommerce: a bare `/api/...` here means
|
|
317
|
-
* a path from the storefront's own REST API, which rest-guard.ts answers from local data or
|
|
318
|
-
* reports. Absolute urls pass straight through.
|
|
319
|
-
*/
|
|
320
|
-
get<T>(url: string): Promise<T>;
|
|
321
|
-
post<T>(url: string, data: unknown): Promise<T>;
|
|
322
|
-
put<T>(url: string, data: unknown): Promise<T>;
|
|
323
|
-
patch<T>(url: string, data: unknown): Promise<T>;
|
|
324
|
-
delete<T>(url: string): Promise<T>;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
type StaticStoreProvider = () => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
328
|
-
declare const setStaticStore: (fn: StaticStoreProvider) => void;
|
|
329
|
-
declare const hasStaticStore: () => boolean;
|
|
330
|
-
/**
|
|
331
|
-
* Applied on read rather than by wrapping the registered provider, because the provider is not ours
|
|
332
|
-
* to keep: the storefront's `src/lib/core/connectors/init.ts` calls `setStaticStore(staticStoreConfig)` for whatever
|
|
333
|
-
* connector is active, at boot, which lands after this module has loaded and replaces anything
|
|
334
|
-
* registered here. Forcing at the point of use is immune to who registered last.
|
|
335
|
-
*/
|
|
336
|
-
declare const readStaticStore: () => Promise<Record<string, any> | undefined>;
|
|
337
|
-
declare const readStaticStoreDetails: () => Promise<Record<string, any> | undefined>;
|
|
338
|
-
|
|
339
|
-
declare const currencyFractionDigits: (currencyCode?: string) => number;
|
|
340
|
-
/** `{ amount_minor: 2500, currency: 'USD' }` -> `25`. */
|
|
341
|
-
declare const fromMoney: (money?: Money | null) => number;
|
|
342
|
-
|
|
343
|
-
/** The page size this storefront's grids and lists are built around. */
|
|
344
|
-
declare const PAGE_SIZE = 20;
|
|
345
|
-
/** The API's maximum `limit`. Also the ceiling on what one request can be filtered or sorted over. */
|
|
346
|
-
declare const MAX_LIMIT = 200;
|
|
347
|
-
type Paginated<T> = {
|
|
348
|
-
data: T[];
|
|
349
|
-
count: number;
|
|
350
|
-
pageSize: number;
|
|
351
|
-
noOfPage: number;
|
|
352
|
-
page: number;
|
|
353
|
-
};
|
|
354
|
-
declare const paginated: <T>(data: T[], count: number, page?: number, pageSize?: number) => Paginated<T>;
|
|
355
|
-
declare const emptyPage: <T>(page?: number, pageSize?: number) => Paginated<T>;
|
|
356
|
-
/** Media urls arrive site-relative for files the store holds; see `BaseService.mediaUrl`. */
|
|
357
|
-
declare const absoluteMedia: (url?: string | null) => string | null;
|
|
358
|
-
/**
|
|
359
|
-
* Every image the storefront can show for a product.
|
|
360
|
-
*
|
|
361
|
-
* Two sources, in the order a gallery should show them: the product's own `image_url` first, then
|
|
362
|
-
* whatever image each variant nominates — what a storefront swaps to when a shopper picks a colour.
|
|
363
|
-
* De-duplicated, because a variant may nominate the picture the product already leads with.
|
|
364
|
-
*
|
|
365
|
-
* Both are read defensively. `image_url` is undocumented in `/doc` yet is the only image this
|
|
366
|
-
* catalogue actually has, while `Variant.image` is the documented field and is empty here; a server
|
|
367
|
-
* on either side of that change has to render. A product with neither has no image, and the
|
|
368
|
-
* components fall back to their own placeholder.
|
|
369
|
-
*/
|
|
370
|
-
declare const productImages: (product?: GcProduct | null) => string[];
|
|
371
|
-
/**
|
|
372
|
-
* Product metadata, flattened for display.
|
|
373
|
-
*
|
|
374
|
-
* GoCommerce namespaces it by whichever module wrote it — `{ category: { material: ['Cork'] } }` —
|
|
375
|
-
* while the storefront's spec block prints each entry's value straight into the page, so a nested
|
|
376
|
-
* object arrives as the literal text "[object Object]". Only the leaves say anything to a shopper,
|
|
377
|
-
* so those are lifted out under their own names, and a name claimed twice keeps its namespace to
|
|
378
|
-
* stay distinguishable.
|
|
379
|
-
*/
|
|
380
|
-
declare const flattenMetadata: (metadata?: Record<string, unknown> | null) => Record<string, string> | null;
|
|
381
|
-
declare const mapProduct: (product?: GcProduct | null) => {
|
|
382
|
-
id: number;
|
|
383
|
-
title: string;
|
|
384
|
-
slug: string;
|
|
385
|
-
description: string;
|
|
386
|
-
price: number;
|
|
387
|
-
mrp: number;
|
|
388
|
-
featuredImage: string | null;
|
|
389
|
-
active: boolean;
|
|
390
|
-
status: string;
|
|
391
|
-
type: string;
|
|
392
|
-
vendorId: string;
|
|
393
|
-
categoryId: number | null;
|
|
394
|
-
currency: string | null;
|
|
395
|
-
instructions: null;
|
|
396
|
-
hsnCode: string | null;
|
|
397
|
-
images: string;
|
|
398
|
-
thumbnail: string | null;
|
|
399
|
-
keywords: string | null;
|
|
400
|
-
link: null;
|
|
401
|
-
metaTitle: string | null;
|
|
402
|
-
metaDescription: string | null;
|
|
403
|
-
subtitle: string | null;
|
|
404
|
-
popularity: number;
|
|
405
|
-
rank: number;
|
|
406
|
-
expiryDate: null;
|
|
407
|
-
weight: number | null;
|
|
408
|
-
mfgDate: null;
|
|
409
|
-
costPerItem: number;
|
|
410
|
-
sku: string | null;
|
|
411
|
-
stock: number;
|
|
412
|
-
allowBackorder: boolean;
|
|
413
|
-
manageInventory: boolean;
|
|
414
|
-
shippingWeight: null;
|
|
415
|
-
shippingHeight: null;
|
|
416
|
-
shippingLen: null;
|
|
417
|
-
shippingWidth: null;
|
|
418
|
-
height: null;
|
|
419
|
-
width: null;
|
|
420
|
-
len: null;
|
|
421
|
-
barcode: string | null;
|
|
422
|
-
shippingCost: null;
|
|
423
|
-
returnAllowed: boolean;
|
|
424
|
-
replaceAllowed: boolean;
|
|
425
|
-
originCountry: string | null;
|
|
426
|
-
weightUnit: string;
|
|
427
|
-
dimensionUnit: string;
|
|
428
|
-
metadata: Record<string, string> | null;
|
|
429
|
-
collectionId: number | null;
|
|
430
|
-
tags: string[];
|
|
431
|
-
vendor: string | null;
|
|
432
|
-
categories: {
|
|
433
|
-
category: {
|
|
434
|
-
id: number;
|
|
435
|
-
name: string;
|
|
436
|
-
slug: string;
|
|
437
|
-
};
|
|
438
|
-
}[];
|
|
439
|
-
createdAt: string | null;
|
|
440
|
-
updatedAt: string | null;
|
|
441
|
-
options: {
|
|
442
|
-
id: number;
|
|
443
|
-
title: string;
|
|
444
|
-
type: string;
|
|
445
|
-
values: {
|
|
446
|
-
id: number;
|
|
447
|
-
value: string;
|
|
448
|
-
}[];
|
|
449
|
-
}[];
|
|
450
|
-
variants: {
|
|
451
|
-
id: number;
|
|
452
|
-
title: string;
|
|
453
|
-
productId: number;
|
|
454
|
-
sku: string | null;
|
|
455
|
-
barcode: string | null;
|
|
456
|
-
batchNo: null;
|
|
457
|
-
stock: number;
|
|
458
|
-
allowBackorder: boolean;
|
|
459
|
-
manageInventory: boolean;
|
|
460
|
-
hsCode: string | null;
|
|
461
|
-
originCountry: string | null;
|
|
462
|
-
midCode: null;
|
|
463
|
-
material: null;
|
|
464
|
-
weight: number | null;
|
|
465
|
-
length: null;
|
|
466
|
-
height: null;
|
|
467
|
-
width: null;
|
|
468
|
-
price: number;
|
|
469
|
-
costPerItem: number;
|
|
470
|
-
mfgDate: null;
|
|
471
|
-
expiryDate: null;
|
|
472
|
-
returnAllowed: boolean;
|
|
473
|
-
replaceAllowed: boolean;
|
|
474
|
-
mrp: number;
|
|
475
|
-
img: string | null;
|
|
476
|
-
description: null;
|
|
477
|
-
storeId: null;
|
|
478
|
-
len: null;
|
|
479
|
-
rank: number;
|
|
480
|
-
shippingWeight: null;
|
|
481
|
-
shippingHeight: null;
|
|
482
|
-
shippingLen: null;
|
|
483
|
-
shippingWidth: null;
|
|
484
|
-
shippingCost: null;
|
|
485
|
-
metadata: Record<string, unknown> | null;
|
|
486
|
-
variantRank: number;
|
|
487
|
-
options: {
|
|
488
|
-
id: string | number;
|
|
489
|
-
optionId: number;
|
|
490
|
-
value: string;
|
|
491
|
-
variantId: number;
|
|
492
|
-
}[];
|
|
493
|
-
}[];
|
|
494
|
-
} | null;
|
|
495
|
-
declare const mapCategory: (category?: GcCategory | null) => {
|
|
496
|
-
id: number;
|
|
497
|
-
isActive: boolean;
|
|
498
|
-
isInternal: boolean;
|
|
499
|
-
isMegamenu: boolean;
|
|
500
|
-
thumbnail: null;
|
|
501
|
-
path: string | null;
|
|
502
|
-
level: number;
|
|
503
|
-
description: null;
|
|
504
|
-
isFeatured: boolean;
|
|
505
|
-
keywords: null;
|
|
506
|
-
rank: number;
|
|
507
|
-
link: null;
|
|
508
|
-
metaDescription: null;
|
|
509
|
-
metaKeywords: null;
|
|
510
|
-
metaTitle: null;
|
|
511
|
-
name: string;
|
|
512
|
-
parentCategoryId: number | null;
|
|
513
|
-
store: null;
|
|
514
|
-
slug: string;
|
|
515
|
-
userId: string;
|
|
516
|
-
activeProducts: number;
|
|
517
|
-
inactiveProducts: number;
|
|
518
|
-
createdAt: string | null;
|
|
519
|
-
updatedAt: string | null;
|
|
520
|
-
} | null;
|
|
521
|
-
/**
|
|
522
|
-
* `collectionvalues[].products` is the shape the collection components read — Litekart's, where each
|
|
523
|
-
* value points at one product.
|
|
524
|
-
*/
|
|
525
|
-
declare const mapCollection: (collection?: (GcCollection & {
|
|
526
|
-
products?: GcProduct[];
|
|
527
|
-
}) | null) => {
|
|
528
|
-
id: number;
|
|
529
|
-
name: string;
|
|
530
|
-
slug: string;
|
|
531
|
-
description: string | null;
|
|
532
|
-
isActive: boolean;
|
|
533
|
-
isFeatured: boolean;
|
|
534
|
-
userId: string;
|
|
535
|
-
thumbnail: string | null;
|
|
536
|
-
metaTitle: null;
|
|
537
|
-
metaDescription: null;
|
|
538
|
-
rank: number;
|
|
539
|
-
collectionvalues: {
|
|
540
|
-
products: {
|
|
541
|
-
id: number;
|
|
542
|
-
name: string;
|
|
543
|
-
title: string;
|
|
544
|
-
slug: string;
|
|
545
|
-
thumbnail: string | null;
|
|
546
|
-
price: number;
|
|
547
|
-
mrp: number;
|
|
548
|
-
};
|
|
549
|
-
}[];
|
|
550
|
-
productCount: number;
|
|
551
|
-
createdAt: string | null;
|
|
552
|
-
updatedAt: string | null;
|
|
553
|
-
} | null;
|
|
554
|
-
/** Whatever the storefront collected at the address step; GoCommerce has no cart field to hold it. */
|
|
555
|
-
type CheckoutDetails = {
|
|
556
|
-
email?: string;
|
|
557
|
-
phone?: string;
|
|
558
|
-
name?: string;
|
|
559
|
-
shippingAddress?: Record<string, any> | null;
|
|
560
|
-
billingAddress?: Record<string, any> | null;
|
|
561
|
-
};
|
|
562
|
-
/** A product lookup used to fill in what a cart or order line does not carry: slug and image. */
|
|
563
|
-
type ProductIndex = Map<number, GcProduct>;
|
|
564
|
-
declare const mapCart: (cart: GcCart | null | undefined, details?: CheckoutDetails, index?: ProductIndex, store?: Record<string, any>) => {
|
|
565
|
-
id?: undefined;
|
|
566
|
-
email?: undefined;
|
|
567
|
-
phone?: undefined;
|
|
568
|
-
name?: undefined;
|
|
569
|
-
billingAddressId?: undefined;
|
|
570
|
-
shippingAddressId?: undefined;
|
|
571
|
-
regionId?: undefined;
|
|
572
|
-
userId?: undefined;
|
|
573
|
-
couponCode?: undefined;
|
|
574
|
-
discountAmount?: undefined;
|
|
575
|
-
couponAppliedDate?: undefined;
|
|
576
|
-
needAddress?: undefined;
|
|
577
|
-
isCodAvailable?: undefined;
|
|
578
|
-
paymentId?: undefined;
|
|
579
|
-
type?: undefined;
|
|
580
|
-
completedAt?: undefined;
|
|
581
|
-
paymentAuthorizedAt?: undefined;
|
|
582
|
-
idempotencyKey?: undefined;
|
|
583
|
-
salesChannelId?: undefined;
|
|
584
|
-
qty?: undefined;
|
|
585
|
-
shippingCharges?: undefined;
|
|
586
|
-
paymentMethod?: undefined;
|
|
587
|
-
shippingMethod?: undefined;
|
|
588
|
-
subtotal?: undefined;
|
|
589
|
-
codCharges?: undefined;
|
|
590
|
-
tax?: undefined;
|
|
591
|
-
total?: undefined;
|
|
592
|
-
savingAmount?: undefined;
|
|
593
|
-
userAuthToken?: undefined;
|
|
594
|
-
currencyCode?: undefined;
|
|
595
|
-
currencySymbol?: undefined;
|
|
596
|
-
shippingRateId?: undefined;
|
|
597
|
-
currencyDecimalDigits?: undefined;
|
|
598
|
-
storeId?: undefined;
|
|
599
|
-
status?: undefined;
|
|
600
|
-
createdAt?: undefined;
|
|
601
|
-
updatedAt?: undefined;
|
|
602
|
-
deletedAt?: undefined;
|
|
603
|
-
lineItems?: undefined;
|
|
604
|
-
shippingAddress?: undefined;
|
|
605
|
-
billingAddress?: undefined;
|
|
606
|
-
} | {
|
|
607
|
-
id: string;
|
|
608
|
-
email: string | null;
|
|
609
|
-
phone: any;
|
|
610
|
-
name: string | null;
|
|
611
|
-
billingAddressId: string | null;
|
|
612
|
-
shippingAddressId: string | null;
|
|
613
|
-
regionId: null;
|
|
614
|
-
userId: null;
|
|
615
|
-
couponCode: null;
|
|
616
|
-
discountAmount: number;
|
|
617
|
-
couponAppliedDate: null;
|
|
618
|
-
needAddress: boolean;
|
|
619
|
-
isCodAvailable: boolean;
|
|
620
|
-
paymentId: null;
|
|
621
|
-
type: null;
|
|
622
|
-
completedAt: string | null;
|
|
623
|
-
paymentAuthorizedAt: null;
|
|
624
|
-
idempotencyKey: null;
|
|
625
|
-
salesChannelId: null;
|
|
626
|
-
qty: number;
|
|
627
|
-
shippingCharges: number;
|
|
628
|
-
paymentMethod: null;
|
|
629
|
-
shippingMethod: null;
|
|
630
|
-
subtotal: number;
|
|
631
|
-
codCharges: number;
|
|
632
|
-
tax: number;
|
|
633
|
-
total: number;
|
|
634
|
-
savingAmount: number;
|
|
635
|
-
userAuthToken: null;
|
|
636
|
-
currencyCode: any;
|
|
637
|
-
currencySymbol: any;
|
|
638
|
-
shippingRateId: null;
|
|
639
|
-
currencyDecimalDigits: number;
|
|
640
|
-
storeId: any;
|
|
641
|
-
status: "open" | "converted" | "abandoned";
|
|
642
|
-
createdAt: string | null;
|
|
643
|
-
updatedAt: string | null;
|
|
644
|
-
deletedAt: null;
|
|
645
|
-
lineItems: {
|
|
646
|
-
id: number;
|
|
647
|
-
productId: number;
|
|
648
|
-
variantId: number;
|
|
649
|
-
qty: number;
|
|
650
|
-
subtotal: number;
|
|
651
|
-
discount: number;
|
|
652
|
-
tax: number;
|
|
653
|
-
shippingCharges: number;
|
|
654
|
-
total: number;
|
|
655
|
-
price: number;
|
|
656
|
-
mrp: number;
|
|
657
|
-
title: string;
|
|
658
|
-
slug: string;
|
|
659
|
-
sku: string;
|
|
660
|
-
description: null;
|
|
661
|
-
thumbnail: string | null;
|
|
662
|
-
metadata: null;
|
|
663
|
-
vendorId: null;
|
|
664
|
-
weight: null;
|
|
665
|
-
dimensionUnit: string;
|
|
666
|
-
height: null;
|
|
667
|
-
width: null;
|
|
668
|
-
len: null;
|
|
669
|
-
shippingWeight: null;
|
|
670
|
-
shippingHeight: null;
|
|
671
|
-
shippingLen: null;
|
|
672
|
-
shippingWidth: null;
|
|
673
|
-
isSelectedForCheckout: boolean;
|
|
674
|
-
priceChanged: boolean;
|
|
675
|
-
inStock: boolean;
|
|
676
|
-
createdAt: null;
|
|
677
|
-
product: {
|
|
678
|
-
id: number;
|
|
679
|
-
title: string;
|
|
680
|
-
thumbnail: string | null;
|
|
681
|
-
slug: string;
|
|
682
|
-
sku: string;
|
|
683
|
-
categories: {
|
|
684
|
-
category: {
|
|
685
|
-
id: number;
|
|
686
|
-
name: string;
|
|
687
|
-
slug: string;
|
|
688
|
-
};
|
|
689
|
-
}[];
|
|
690
|
-
};
|
|
691
|
-
variant: {
|
|
692
|
-
id: number;
|
|
693
|
-
price: number;
|
|
694
|
-
mrp: number;
|
|
695
|
-
weight: null;
|
|
696
|
-
height: null;
|
|
697
|
-
width: null;
|
|
698
|
-
len: null;
|
|
699
|
-
shippingWeight: null;
|
|
700
|
-
shippingHeight: null;
|
|
701
|
-
shippingLen: null;
|
|
702
|
-
shippingWidth: null;
|
|
703
|
-
sku: string;
|
|
704
|
-
title: string;
|
|
705
|
-
options: {
|
|
706
|
-
id: string | number;
|
|
707
|
-
optionId: number;
|
|
708
|
-
value: string;
|
|
709
|
-
variantId: number;
|
|
710
|
-
}[];
|
|
711
|
-
};
|
|
712
|
-
}[];
|
|
713
|
-
shippingAddress: Record<string, any> | null;
|
|
714
|
-
billingAddress: Record<string, any> | null;
|
|
715
|
-
};
|
|
716
|
-
/** GoCommerce's address shape -> the one the address form and order pages read. */
|
|
717
|
-
declare const toStorefrontAddress: (address?: GcAddress | null, email?: string, phone?: string) => {
|
|
718
|
-
id: null;
|
|
719
|
-
firstName: string;
|
|
720
|
-
lastName: string;
|
|
721
|
-
email: string | null;
|
|
722
|
-
phone: string;
|
|
723
|
-
address_1: string;
|
|
724
|
-
address_2: string;
|
|
725
|
-
city: string;
|
|
726
|
-
state: string;
|
|
727
|
-
zip: string;
|
|
728
|
-
country: string;
|
|
729
|
-
countryCode: string;
|
|
730
|
-
isPrimary: boolean;
|
|
731
|
-
isResidential: boolean;
|
|
732
|
-
deliveryInstructions: null;
|
|
733
|
-
} | null;
|
|
734
|
-
/** The storefront's address form -> GoCommerce's `Address`, which checkout requires. */
|
|
735
|
-
declare const toGoCommerceAddress: (address?: Record<string, any> | null, fallbackPhone?: string) => GcAddress | null;
|
|
736
|
-
declare const mapOrder: (order?: GcOrder | null, index?: ProductIndex) => {
|
|
737
|
-
id: number;
|
|
738
|
-
orderNo: string;
|
|
739
|
-
order_no: string;
|
|
740
|
-
parentOrderNo: string;
|
|
741
|
-
status: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed";
|
|
742
|
-
paymentStatus: "pending" | "paid" | "failed" | "refunded";
|
|
743
|
-
paymentMethod: string | null;
|
|
744
|
-
createdAt: string | null;
|
|
745
|
-
updatedAt: string | null;
|
|
746
|
-
userEmail: string;
|
|
747
|
-
phone: string;
|
|
748
|
-
subtotal: number;
|
|
749
|
-
shippingCharges: number;
|
|
750
|
-
discount: number;
|
|
751
|
-
total: number;
|
|
752
|
-
currencyCode: string;
|
|
753
|
-
currencyDecimalDigits: number;
|
|
754
|
-
shippingRate: null;
|
|
755
|
-
fulfillments: {
|
|
756
|
-
id: number;
|
|
757
|
-
status: string;
|
|
758
|
-
provider: string;
|
|
759
|
-
trackingNumber: string;
|
|
760
|
-
labelUrl: string;
|
|
761
|
-
createdAt: string | null;
|
|
762
|
-
}[];
|
|
763
|
-
shippingAddress: {
|
|
764
|
-
id: null;
|
|
765
|
-
firstName: string;
|
|
766
|
-
lastName: string;
|
|
767
|
-
email: string | null;
|
|
768
|
-
phone: string;
|
|
769
|
-
address_1: string;
|
|
770
|
-
address_2: string;
|
|
771
|
-
city: string;
|
|
772
|
-
state: string;
|
|
773
|
-
zip: string;
|
|
774
|
-
country: string;
|
|
775
|
-
countryCode: string;
|
|
776
|
-
isPrimary: boolean;
|
|
777
|
-
isResidential: boolean;
|
|
778
|
-
deliveryInstructions: null;
|
|
779
|
-
} | null;
|
|
780
|
-
billingAddress: {
|
|
781
|
-
id: null;
|
|
782
|
-
firstName: string;
|
|
783
|
-
lastName: string;
|
|
784
|
-
email: string | null;
|
|
785
|
-
phone: string;
|
|
786
|
-
address_1: string;
|
|
787
|
-
address_2: string;
|
|
788
|
-
city: string;
|
|
789
|
-
state: string;
|
|
790
|
-
zip: string;
|
|
791
|
-
country: string;
|
|
792
|
-
countryCode: string;
|
|
793
|
-
isPrimary: boolean;
|
|
794
|
-
isResidential: boolean;
|
|
795
|
-
deliveryInstructions: null;
|
|
796
|
-
} | null;
|
|
797
|
-
lineItems: {
|
|
798
|
-
id: number;
|
|
799
|
-
productId: number | null;
|
|
800
|
-
variantId: number | null;
|
|
801
|
-
title: string;
|
|
802
|
-
variantTitle: string;
|
|
803
|
-
slug: string;
|
|
804
|
-
sku: string;
|
|
805
|
-
thumbnail: string | null;
|
|
806
|
-
qty: number;
|
|
807
|
-
price: number;
|
|
808
|
-
subtotal: number;
|
|
809
|
-
total: number;
|
|
810
|
-
}[];
|
|
811
|
-
} | null;
|
|
812
|
-
|
|
813
|
-
declare const readCheckoutDetails: (cartId?: string | null) => CheckoutDetails;
|
|
814
|
-
/** Merges, so setting an address later never erases the email collected before it. */
|
|
815
|
-
declare const writeCheckoutDetails: (cartId: string | null | undefined, patch: CheckoutDetails) => CheckoutDetails;
|
|
816
|
-
declare const clearCheckoutDetails: (cartId?: string | null) => void;
|
|
817
|
-
/** The credential a guest reads their own order back with. Returned once, at checkout. */
|
|
818
|
-
declare const rememberOrderToken: (orderNumber?: string, token?: string) => void;
|
|
819
|
-
declare const readOrderToken: (orderNumber?: string | null) => string | undefined;
|
|
820
|
-
/** Every order this browser has placed, newest last — the shopper's own order history. */
|
|
821
|
-
declare const readOrderNumbers: () => string[];
|
|
822
|
-
|
|
823
|
-
type StoredAddress = Record<string, unknown> & {
|
|
824
|
-
id: string;
|
|
825
|
-
};
|
|
826
|
-
declare const listAddresses: () => StoredAddress[];
|
|
827
|
-
declare const findAddress: (id: string) => StoredAddress | undefined;
|
|
828
|
-
/**
|
|
829
|
-
* Adds an address, or replaces the one it already names.
|
|
830
|
-
*
|
|
831
|
-
* The form hands back the record it was opened with, so an edit arrives carrying its own id while a
|
|
832
|
-
* new address arrives with the `'new'` placeholder.
|
|
833
|
-
*/
|
|
834
|
-
declare const putAddress: (address: Record<string, unknown>) => StoredAddress;
|
|
835
|
-
declare const patchAddress: (id: string, patch: Record<string, unknown>) => StoredAddress | undefined;
|
|
836
|
-
declare const removeAddress: (id: string) => void;
|
|
837
|
-
declare const clearPhantomSession: () => void;
|
|
838
|
-
/** True when this browser is carrying a session from some other backend. */
|
|
839
|
-
declare const hasPhantomSession: () => boolean;
|
|
840
|
-
|
|
841
|
-
declare class ProductService extends BaseService {
|
|
842
|
-
private static instance;
|
|
843
|
-
static getInstance(): ProductService;
|
|
844
|
-
/** One window of the catalogue, raw. Everything else in this file is built on it. */
|
|
845
|
-
fetchProducts({ q, page, limit }?: {
|
|
846
|
-
q?: string;
|
|
847
|
-
page?: number;
|
|
848
|
-
limit?: number;
|
|
849
|
-
}): Promise<{
|
|
850
|
-
products: GcProduct[];
|
|
851
|
-
meta: ListMeta | undefined;
|
|
852
|
-
}>;
|
|
853
|
-
/** A product by its numeric id — how a cart line names what is in it. */
|
|
854
|
-
fetchProductById(id: number): Promise<GcProduct | null>;
|
|
855
|
-
fetchProductBySlug(slug: string): Promise<GcProduct | null>;
|
|
856
|
-
list({ page, search, sort }?: {
|
|
857
|
-
page?: number;
|
|
858
|
-
search?: string;
|
|
859
|
-
sort?: string;
|
|
860
|
-
}): Promise<Paginated<{
|
|
861
|
-
id: number;
|
|
862
|
-
title: string;
|
|
863
|
-
slug: string;
|
|
864
|
-
description: string;
|
|
865
|
-
price: number;
|
|
866
|
-
mrp: number;
|
|
867
|
-
featuredImage: string | null;
|
|
868
|
-
active: boolean;
|
|
869
|
-
status: string;
|
|
870
|
-
type: string;
|
|
871
|
-
vendorId: string;
|
|
872
|
-
categoryId: number | null;
|
|
873
|
-
currency: string | null;
|
|
874
|
-
instructions: null;
|
|
875
|
-
hsnCode: string | null;
|
|
876
|
-
images: string;
|
|
877
|
-
thumbnail: string | null;
|
|
878
|
-
keywords: string | null;
|
|
879
|
-
link: null;
|
|
880
|
-
metaTitle: string | null;
|
|
881
|
-
metaDescription: string | null;
|
|
882
|
-
subtitle: string | null;
|
|
883
|
-
popularity: number;
|
|
884
|
-
rank: number;
|
|
885
|
-
expiryDate: null;
|
|
886
|
-
weight: number | null;
|
|
887
|
-
mfgDate: null;
|
|
888
|
-
costPerItem: number;
|
|
889
|
-
sku: string | null;
|
|
890
|
-
stock: number;
|
|
891
|
-
allowBackorder: boolean;
|
|
892
|
-
manageInventory: boolean;
|
|
893
|
-
shippingWeight: null;
|
|
894
|
-
shippingHeight: null;
|
|
895
|
-
shippingLen: null;
|
|
896
|
-
shippingWidth: null;
|
|
897
|
-
height: null;
|
|
898
|
-
width: null;
|
|
899
|
-
len: null;
|
|
900
|
-
barcode: string | null;
|
|
901
|
-
shippingCost: null;
|
|
902
|
-
returnAllowed: boolean;
|
|
903
|
-
replaceAllowed: boolean;
|
|
904
|
-
originCountry: string | null;
|
|
905
|
-
weightUnit: string;
|
|
906
|
-
dimensionUnit: string;
|
|
907
|
-
metadata: Record<string, string> | null;
|
|
908
|
-
collectionId: number | null;
|
|
909
|
-
tags: string[];
|
|
910
|
-
vendor: string | null;
|
|
911
|
-
categories: {
|
|
912
|
-
category: {
|
|
913
|
-
id: number;
|
|
914
|
-
name: string;
|
|
915
|
-
slug: string;
|
|
916
|
-
};
|
|
917
|
-
}[];
|
|
918
|
-
createdAt: string | null;
|
|
919
|
-
updatedAt: string | null;
|
|
920
|
-
options: {
|
|
921
|
-
id: number;
|
|
922
|
-
title: string;
|
|
923
|
-
type: string;
|
|
924
|
-
values: {
|
|
925
|
-
id: number;
|
|
926
|
-
value: string;
|
|
927
|
-
}[];
|
|
928
|
-
}[];
|
|
929
|
-
variants: {
|
|
930
|
-
id: number;
|
|
931
|
-
title: string;
|
|
932
|
-
productId: number;
|
|
933
|
-
sku: string | null;
|
|
934
|
-
barcode: string | null;
|
|
935
|
-
batchNo: null;
|
|
936
|
-
stock: number;
|
|
937
|
-
allowBackorder: boolean;
|
|
938
|
-
manageInventory: boolean;
|
|
939
|
-
hsCode: string | null;
|
|
940
|
-
originCountry: string | null;
|
|
941
|
-
midCode: null;
|
|
942
|
-
material: null;
|
|
943
|
-
weight: number | null;
|
|
944
|
-
length: null;
|
|
945
|
-
height: null;
|
|
946
|
-
width: null;
|
|
947
|
-
price: number;
|
|
948
|
-
costPerItem: number;
|
|
949
|
-
mfgDate: null;
|
|
950
|
-
expiryDate: null;
|
|
951
|
-
returnAllowed: boolean;
|
|
952
|
-
replaceAllowed: boolean;
|
|
953
|
-
mrp: number;
|
|
954
|
-
img: string | null;
|
|
955
|
-
description: null;
|
|
956
|
-
storeId: null;
|
|
957
|
-
len: null;
|
|
958
|
-
rank: number;
|
|
959
|
-
shippingWeight: null;
|
|
960
|
-
shippingHeight: null;
|
|
961
|
-
shippingLen: null;
|
|
962
|
-
shippingWidth: null;
|
|
963
|
-
shippingCost: null;
|
|
964
|
-
metadata: Record<string, unknown> | null;
|
|
965
|
-
variantRank: number;
|
|
966
|
-
options: {
|
|
967
|
-
id: string | number;
|
|
968
|
-
optionId: number;
|
|
969
|
-
value: string;
|
|
970
|
-
variantId: number;
|
|
971
|
-
}[];
|
|
972
|
-
}[];
|
|
973
|
-
} | null>>;
|
|
974
|
-
listFeaturedProducts({ page, sort }?: {
|
|
975
|
-
page?: number;
|
|
976
|
-
sort?: string;
|
|
977
|
-
}): Promise<Paginated<{
|
|
978
|
-
id: number;
|
|
979
|
-
title: string;
|
|
980
|
-
slug: string;
|
|
981
|
-
description: string;
|
|
982
|
-
price: number;
|
|
983
|
-
mrp: number;
|
|
984
|
-
featuredImage: string | null;
|
|
985
|
-
active: boolean;
|
|
986
|
-
status: string;
|
|
987
|
-
type: string;
|
|
988
|
-
vendorId: string;
|
|
989
|
-
categoryId: number | null;
|
|
990
|
-
currency: string | null;
|
|
991
|
-
instructions: null;
|
|
992
|
-
hsnCode: string | null;
|
|
993
|
-
images: string;
|
|
994
|
-
thumbnail: string | null;
|
|
995
|
-
keywords: string | null;
|
|
996
|
-
link: null;
|
|
997
|
-
metaTitle: string | null;
|
|
998
|
-
metaDescription: string | null;
|
|
999
|
-
subtitle: string | null;
|
|
1000
|
-
popularity: number;
|
|
1001
|
-
rank: number;
|
|
1002
|
-
expiryDate: null;
|
|
1003
|
-
weight: number | null;
|
|
1004
|
-
mfgDate: null;
|
|
1005
|
-
costPerItem: number;
|
|
1006
|
-
sku: string | null;
|
|
1007
|
-
stock: number;
|
|
1008
|
-
allowBackorder: boolean;
|
|
1009
|
-
manageInventory: boolean;
|
|
1010
|
-
shippingWeight: null;
|
|
1011
|
-
shippingHeight: null;
|
|
1012
|
-
shippingLen: null;
|
|
1013
|
-
shippingWidth: null;
|
|
1014
|
-
height: null;
|
|
1015
|
-
width: null;
|
|
1016
|
-
len: null;
|
|
1017
|
-
barcode: string | null;
|
|
1018
|
-
shippingCost: null;
|
|
1019
|
-
returnAllowed: boolean;
|
|
1020
|
-
replaceAllowed: boolean;
|
|
1021
|
-
originCountry: string | null;
|
|
1022
|
-
weightUnit: string;
|
|
1023
|
-
dimensionUnit: string;
|
|
1024
|
-
metadata: Record<string, string> | null;
|
|
1025
|
-
collectionId: number | null;
|
|
1026
|
-
tags: string[];
|
|
1027
|
-
vendor: string | null;
|
|
1028
|
-
categories: {
|
|
1029
|
-
category: {
|
|
1030
|
-
id: number;
|
|
1031
|
-
name: string;
|
|
1032
|
-
slug: string;
|
|
1033
|
-
};
|
|
1034
|
-
}[];
|
|
1035
|
-
createdAt: string | null;
|
|
1036
|
-
updatedAt: string | null;
|
|
1037
|
-
options: {
|
|
1038
|
-
id: number;
|
|
1039
|
-
title: string;
|
|
1040
|
-
type: string;
|
|
1041
|
-
values: {
|
|
1042
|
-
id: number;
|
|
1043
|
-
value: string;
|
|
1044
|
-
}[];
|
|
1045
|
-
}[];
|
|
1046
|
-
variants: {
|
|
1047
|
-
id: number;
|
|
1048
|
-
title: string;
|
|
1049
|
-
productId: number;
|
|
1050
|
-
sku: string | null;
|
|
1051
|
-
barcode: string | null;
|
|
1052
|
-
batchNo: null;
|
|
1053
|
-
stock: number;
|
|
1054
|
-
allowBackorder: boolean;
|
|
1055
|
-
manageInventory: boolean;
|
|
1056
|
-
hsCode: string | null;
|
|
1057
|
-
originCountry: string | null;
|
|
1058
|
-
midCode: null;
|
|
1059
|
-
material: null;
|
|
1060
|
-
weight: number | null;
|
|
1061
|
-
length: null;
|
|
1062
|
-
height: null;
|
|
1063
|
-
width: null;
|
|
1064
|
-
price: number;
|
|
1065
|
-
costPerItem: number;
|
|
1066
|
-
mfgDate: null;
|
|
1067
|
-
expiryDate: null;
|
|
1068
|
-
returnAllowed: boolean;
|
|
1069
|
-
replaceAllowed: boolean;
|
|
1070
|
-
mrp: number;
|
|
1071
|
-
img: string | null;
|
|
1072
|
-
description: null;
|
|
1073
|
-
storeId: null;
|
|
1074
|
-
len: null;
|
|
1075
|
-
rank: number;
|
|
1076
|
-
shippingWeight: null;
|
|
1077
|
-
shippingHeight: null;
|
|
1078
|
-
shippingLen: null;
|
|
1079
|
-
shippingWidth: null;
|
|
1080
|
-
shippingCost: null;
|
|
1081
|
-
metadata: Record<string, unknown> | null;
|
|
1082
|
-
variantRank: number;
|
|
1083
|
-
options: {
|
|
1084
|
-
id: string | number;
|
|
1085
|
-
optionId: number;
|
|
1086
|
-
value: string;
|
|
1087
|
-
variantId: number;
|
|
1088
|
-
}[];
|
|
1089
|
-
}[];
|
|
1090
|
-
} | null>>;
|
|
1091
|
-
listTrendingProducts({ page, search, sort }?: {
|
|
1092
|
-
page?: number;
|
|
1093
|
-
search?: string;
|
|
1094
|
-
sort?: string;
|
|
1095
|
-
}): Promise<Paginated<{
|
|
1096
|
-
id: number;
|
|
1097
|
-
title: string;
|
|
1098
|
-
slug: string;
|
|
1099
|
-
description: string;
|
|
1100
|
-
price: number;
|
|
1101
|
-
mrp: number;
|
|
1102
|
-
featuredImage: string | null;
|
|
1103
|
-
active: boolean;
|
|
1104
|
-
status: string;
|
|
1105
|
-
type: string;
|
|
1106
|
-
vendorId: string;
|
|
1107
|
-
categoryId: number | null;
|
|
1108
|
-
currency: string | null;
|
|
1109
|
-
instructions: null;
|
|
1110
|
-
hsnCode: string | null;
|
|
1111
|
-
images: string;
|
|
1112
|
-
thumbnail: string | null;
|
|
1113
|
-
keywords: string | null;
|
|
1114
|
-
link: null;
|
|
1115
|
-
metaTitle: string | null;
|
|
1116
|
-
metaDescription: string | null;
|
|
1117
|
-
subtitle: string | null;
|
|
1118
|
-
popularity: number;
|
|
1119
|
-
rank: number;
|
|
1120
|
-
expiryDate: null;
|
|
1121
|
-
weight: number | null;
|
|
1122
|
-
mfgDate: null;
|
|
1123
|
-
costPerItem: number;
|
|
1124
|
-
sku: string | null;
|
|
1125
|
-
stock: number;
|
|
1126
|
-
allowBackorder: boolean;
|
|
1127
|
-
manageInventory: boolean;
|
|
1128
|
-
shippingWeight: null;
|
|
1129
|
-
shippingHeight: null;
|
|
1130
|
-
shippingLen: null;
|
|
1131
|
-
shippingWidth: null;
|
|
1132
|
-
height: null;
|
|
1133
|
-
width: null;
|
|
1134
|
-
len: null;
|
|
1135
|
-
barcode: string | null;
|
|
1136
|
-
shippingCost: null;
|
|
1137
|
-
returnAllowed: boolean;
|
|
1138
|
-
replaceAllowed: boolean;
|
|
1139
|
-
originCountry: string | null;
|
|
1140
|
-
weightUnit: string;
|
|
1141
|
-
dimensionUnit: string;
|
|
1142
|
-
metadata: Record<string, string> | null;
|
|
1143
|
-
collectionId: number | null;
|
|
1144
|
-
tags: string[];
|
|
1145
|
-
vendor: string | null;
|
|
1146
|
-
categories: {
|
|
1147
|
-
category: {
|
|
1148
|
-
id: number;
|
|
1149
|
-
name: string;
|
|
1150
|
-
slug: string;
|
|
1151
|
-
};
|
|
1152
|
-
}[];
|
|
1153
|
-
createdAt: string | null;
|
|
1154
|
-
updatedAt: string | null;
|
|
1155
|
-
options: {
|
|
1156
|
-
id: number;
|
|
1157
|
-
title: string;
|
|
1158
|
-
type: string;
|
|
1159
|
-
values: {
|
|
1160
|
-
id: number;
|
|
1161
|
-
value: string;
|
|
1162
|
-
}[];
|
|
1163
|
-
}[];
|
|
1164
|
-
variants: {
|
|
1165
|
-
id: number;
|
|
1166
|
-
title: string;
|
|
1167
|
-
productId: number;
|
|
1168
|
-
sku: string | null;
|
|
1169
|
-
barcode: string | null;
|
|
1170
|
-
batchNo: null;
|
|
1171
|
-
stock: number;
|
|
1172
|
-
allowBackorder: boolean;
|
|
1173
|
-
manageInventory: boolean;
|
|
1174
|
-
hsCode: string | null;
|
|
1175
|
-
originCountry: string | null;
|
|
1176
|
-
midCode: null;
|
|
1177
|
-
material: null;
|
|
1178
|
-
weight: number | null;
|
|
1179
|
-
length: null;
|
|
1180
|
-
height: null;
|
|
1181
|
-
width: null;
|
|
1182
|
-
price: number;
|
|
1183
|
-
costPerItem: number;
|
|
1184
|
-
mfgDate: null;
|
|
1185
|
-
expiryDate: null;
|
|
1186
|
-
returnAllowed: boolean;
|
|
1187
|
-
replaceAllowed: boolean;
|
|
1188
|
-
mrp: number;
|
|
1189
|
-
img: string | null;
|
|
1190
|
-
description: null;
|
|
1191
|
-
storeId: null;
|
|
1192
|
-
len: null;
|
|
1193
|
-
rank: number;
|
|
1194
|
-
shippingWeight: null;
|
|
1195
|
-
shippingHeight: null;
|
|
1196
|
-
shippingLen: null;
|
|
1197
|
-
shippingWidth: null;
|
|
1198
|
-
shippingCost: null;
|
|
1199
|
-
metadata: Record<string, unknown> | null;
|
|
1200
|
-
variantRank: number;
|
|
1201
|
-
options: {
|
|
1202
|
-
id: string | number;
|
|
1203
|
-
optionId: number;
|
|
1204
|
-
value: string;
|
|
1205
|
-
variantId: number;
|
|
1206
|
-
}[];
|
|
1207
|
-
}[];
|
|
1208
|
-
} | null>>;
|
|
1209
|
-
/** The "you may also like" rail: the rest of the product's own category. */
|
|
1210
|
-
listRelatedProducts({ page, categoryId }?: {
|
|
1211
|
-
page?: number;
|
|
1212
|
-
categoryId?: string | number;
|
|
1213
|
-
sort?: string;
|
|
1214
|
-
}): Promise<Paginated<unknown>>;
|
|
1215
|
-
getOne(slug: string): Promise<{
|
|
1216
|
-
id: number;
|
|
1217
|
-
title: string;
|
|
1218
|
-
slug: string;
|
|
1219
|
-
description: string;
|
|
1220
|
-
price: number;
|
|
1221
|
-
mrp: number;
|
|
1222
|
-
featuredImage: string | null;
|
|
1223
|
-
active: boolean;
|
|
1224
|
-
status: string;
|
|
1225
|
-
type: string;
|
|
1226
|
-
vendorId: string;
|
|
1227
|
-
categoryId: number | null;
|
|
1228
|
-
currency: string | null;
|
|
1229
|
-
instructions: null;
|
|
1230
|
-
hsnCode: string | null;
|
|
1231
|
-
images: string;
|
|
1232
|
-
thumbnail: string | null;
|
|
1233
|
-
keywords: string | null;
|
|
1234
|
-
link: null;
|
|
1235
|
-
metaTitle: string | null;
|
|
1236
|
-
metaDescription: string | null;
|
|
1237
|
-
subtitle: string | null;
|
|
1238
|
-
popularity: number;
|
|
1239
|
-
rank: number;
|
|
1240
|
-
expiryDate: null;
|
|
1241
|
-
weight: number | null;
|
|
1242
|
-
mfgDate: null;
|
|
1243
|
-
costPerItem: number;
|
|
1244
|
-
sku: string | null;
|
|
1245
|
-
stock: number;
|
|
1246
|
-
allowBackorder: boolean;
|
|
1247
|
-
manageInventory: boolean;
|
|
1248
|
-
shippingWeight: null;
|
|
1249
|
-
shippingHeight: null;
|
|
1250
|
-
shippingLen: null;
|
|
1251
|
-
shippingWidth: null;
|
|
1252
|
-
height: null;
|
|
1253
|
-
width: null;
|
|
1254
|
-
len: null;
|
|
1255
|
-
barcode: string | null;
|
|
1256
|
-
shippingCost: null;
|
|
1257
|
-
returnAllowed: boolean;
|
|
1258
|
-
replaceAllowed: boolean;
|
|
1259
|
-
originCountry: string | null;
|
|
1260
|
-
weightUnit: string;
|
|
1261
|
-
dimensionUnit: string;
|
|
1262
|
-
metadata: Record<string, string> | null;
|
|
1263
|
-
collectionId: number | null;
|
|
1264
|
-
tags: string[];
|
|
1265
|
-
vendor: string | null;
|
|
1266
|
-
categories: {
|
|
1267
|
-
category: {
|
|
1268
|
-
id: number;
|
|
1269
|
-
name: string;
|
|
1270
|
-
slug: string;
|
|
1271
|
-
};
|
|
1272
|
-
}[];
|
|
1273
|
-
createdAt: string | null;
|
|
1274
|
-
updatedAt: string | null;
|
|
1275
|
-
options: {
|
|
1276
|
-
id: number;
|
|
1277
|
-
title: string;
|
|
1278
|
-
type: string;
|
|
1279
|
-
values: {
|
|
1280
|
-
id: number;
|
|
1281
|
-
value: string;
|
|
1282
|
-
}[];
|
|
1283
|
-
}[];
|
|
1284
|
-
variants: {
|
|
1285
|
-
id: number;
|
|
1286
|
-
title: string;
|
|
1287
|
-
productId: number;
|
|
1288
|
-
sku: string | null;
|
|
1289
|
-
barcode: string | null;
|
|
1290
|
-
batchNo: null;
|
|
1291
|
-
stock: number;
|
|
1292
|
-
allowBackorder: boolean;
|
|
1293
|
-
manageInventory: boolean;
|
|
1294
|
-
hsCode: string | null;
|
|
1295
|
-
originCountry: string | null;
|
|
1296
|
-
midCode: null;
|
|
1297
|
-
material: null;
|
|
1298
|
-
weight: number | null;
|
|
1299
|
-
length: null;
|
|
1300
|
-
height: null;
|
|
1301
|
-
width: null;
|
|
1302
|
-
price: number;
|
|
1303
|
-
costPerItem: number;
|
|
1304
|
-
mfgDate: null;
|
|
1305
|
-
expiryDate: null;
|
|
1306
|
-
returnAllowed: boolean;
|
|
1307
|
-
replaceAllowed: boolean;
|
|
1308
|
-
mrp: number;
|
|
1309
|
-
img: string | null;
|
|
1310
|
-
description: null;
|
|
1311
|
-
storeId: null;
|
|
1312
|
-
len: null;
|
|
1313
|
-
rank: number;
|
|
1314
|
-
shippingWeight: null;
|
|
1315
|
-
shippingHeight: null;
|
|
1316
|
-
shippingLen: null;
|
|
1317
|
-
shippingWidth: null;
|
|
1318
|
-
shippingCost: null;
|
|
1319
|
-
metadata: Record<string, unknown> | null;
|
|
1320
|
-
variantRank: number;
|
|
1321
|
-
options: {
|
|
1322
|
-
id: string | number;
|
|
1323
|
-
optionId: number;
|
|
1324
|
-
value: string;
|
|
1325
|
-
variantId: number;
|
|
1326
|
-
}[];
|
|
1327
|
-
}[];
|
|
1328
|
-
} | null>;
|
|
1329
|
-
/** A product's variants, for a PDP that wants them without re-reading the product. */
|
|
1330
|
-
listVariants(productId: number | string): Promise<Paginated<GcVariant>>;
|
|
1331
|
-
addReview(_params: unknown): Promise<never>;
|
|
1332
|
-
fetchReels(): Promise<{
|
|
1333
|
-
data: never[];
|
|
1334
|
-
count: number;
|
|
1335
|
-
}>;
|
|
1336
|
-
}
|
|
1337
|
-
declare const productService: ProductService;
|
|
1338
|
-
declare class CategoryService extends BaseService {
|
|
1339
|
-
private static instance;
|
|
1340
|
-
static getInstance(): CategoryService;
|
|
1341
|
-
/**
|
|
1342
|
-
* `use-category-filters` in @misiki/kitcommerce-core fetches the tree by raw Litekart REST path
|
|
1343
|
-
* rather than a typed method. On a GoCommerce store that url resolves against the storefront's
|
|
1344
|
-
* own origin, so route that one path to the real tree; `fetchAllCategories` already returns the
|
|
1345
|
-
* `{ data }` shape it reads.
|
|
1346
|
-
*/
|
|
1347
|
-
get<T>(url: string): Promise<T>;
|
|
1348
|
-
/**
|
|
1349
|
-
* The taxonomy, flattened.
|
|
1350
|
-
*
|
|
1351
|
-
* `GET /api/categories` answers with one fixed window and ignores `limit`/`page`, so this is
|
|
1352
|
-
* every category the storefront can see — roots plus what fits beneath them. A store that has
|
|
1353
|
-
* imported a full retail taxonomy has far more nodes than that; the ones a shopper reaches are
|
|
1354
|
-
* still reachable, because a listing page looks its category up by slug directly.
|
|
1355
|
-
*/
|
|
1356
|
-
fetchAllCategories(): Promise<Paginated<{
|
|
1357
|
-
id: number;
|
|
1358
|
-
isActive: boolean;
|
|
1359
|
-
isInternal: boolean;
|
|
1360
|
-
isMegamenu: boolean;
|
|
1361
|
-
thumbnail: null;
|
|
1362
|
-
path: string | null;
|
|
1363
|
-
level: number;
|
|
1364
|
-
description: null;
|
|
1365
|
-
isFeatured: boolean;
|
|
1366
|
-
keywords: null;
|
|
1367
|
-
rank: number;
|
|
1368
|
-
link: null;
|
|
1369
|
-
metaDescription: null;
|
|
1370
|
-
metaKeywords: null;
|
|
1371
|
-
metaTitle: null;
|
|
1372
|
-
name: string;
|
|
1373
|
-
parentCategoryId: number | null;
|
|
1374
|
-
store: null;
|
|
1375
|
-
slug: string;
|
|
1376
|
-
userId: string;
|
|
1377
|
-
activeProducts: number;
|
|
1378
|
-
inactiveProducts: number;
|
|
1379
|
-
createdAt: string | null;
|
|
1380
|
-
updatedAt: string | null;
|
|
1381
|
-
} | null>>;
|
|
1382
|
-
/** A category and the active products filed under it or anything beneath it. */
|
|
1383
|
-
fetchCategoryPage(slug: string, { limit, offset }?: {
|
|
1384
|
-
limit?: number;
|
|
1385
|
-
offset?: number;
|
|
1386
|
-
}): Promise<{
|
|
1387
|
-
category: GcCategoryPage;
|
|
1388
|
-
products: GcProduct[];
|
|
1389
|
-
meta: ListMeta | undefined;
|
|
1390
|
-
}>;
|
|
1391
|
-
fetchCategory(slugOrId: string): Promise<{
|
|
1392
|
-
id: number;
|
|
1393
|
-
isActive: boolean;
|
|
1394
|
-
isInternal: boolean;
|
|
1395
|
-
isMegamenu: boolean;
|
|
1396
|
-
thumbnail: null;
|
|
1397
|
-
path: string | null;
|
|
1398
|
-
level: number;
|
|
1399
|
-
description: null;
|
|
1400
|
-
isFeatured: boolean;
|
|
1401
|
-
keywords: null;
|
|
1402
|
-
rank: number;
|
|
1403
|
-
link: null;
|
|
1404
|
-
metaDescription: null;
|
|
1405
|
-
metaKeywords: null;
|
|
1406
|
-
metaTitle: null;
|
|
1407
|
-
name: string;
|
|
1408
|
-
parentCategoryId: number | null;
|
|
1409
|
-
store: null;
|
|
1410
|
-
slug: string;
|
|
1411
|
-
userId: string;
|
|
1412
|
-
activeProducts: number;
|
|
1413
|
-
inactiveProducts: number;
|
|
1414
|
-
createdAt: string | null;
|
|
1415
|
-
updatedAt: string | null;
|
|
1416
|
-
} | null>;
|
|
1417
|
-
fetchFooterCategories({ page, q }?: {
|
|
1418
|
-
page?: number;
|
|
1419
|
-
q?: string;
|
|
1420
|
-
sort?: string;
|
|
1421
|
-
}): Promise<Paginated<{
|
|
1422
|
-
id: number;
|
|
1423
|
-
isActive: boolean;
|
|
1424
|
-
isInternal: boolean;
|
|
1425
|
-
isMegamenu: boolean;
|
|
1426
|
-
thumbnail: null;
|
|
1427
|
-
path: string | null;
|
|
1428
|
-
level: number;
|
|
1429
|
-
description: null;
|
|
1430
|
-
isFeatured: boolean;
|
|
1431
|
-
keywords: null;
|
|
1432
|
-
rank: number;
|
|
1433
|
-
link: null;
|
|
1434
|
-
metaDescription: null;
|
|
1435
|
-
metaKeywords: null;
|
|
1436
|
-
metaTitle: null;
|
|
1437
|
-
name: string;
|
|
1438
|
-
parentCategoryId: number | null;
|
|
1439
|
-
store: null;
|
|
1440
|
-
slug: string;
|
|
1441
|
-
userId: string;
|
|
1442
|
-
activeProducts: number;
|
|
1443
|
-
inactiveProducts: number;
|
|
1444
|
-
createdAt: string | null;
|
|
1445
|
-
updatedAt: string | null;
|
|
1446
|
-
} | null>>;
|
|
1447
|
-
/** The homepage grid: the roots of the taxonomy, which is what a shopper navigates from. */
|
|
1448
|
-
fetchFeaturedCategories({ limit }?: {
|
|
1449
|
-
limit?: number;
|
|
1450
|
-
}): Promise<Paginated<{
|
|
1451
|
-
id: number;
|
|
1452
|
-
isActive: boolean;
|
|
1453
|
-
isInternal: boolean;
|
|
1454
|
-
isMegamenu: boolean;
|
|
1455
|
-
thumbnail: null;
|
|
1456
|
-
path: string | null;
|
|
1457
|
-
level: number;
|
|
1458
|
-
description: null;
|
|
1459
|
-
isFeatured: boolean;
|
|
1460
|
-
keywords: null;
|
|
1461
|
-
rank: number;
|
|
1462
|
-
link: null;
|
|
1463
|
-
metaDescription: null;
|
|
1464
|
-
metaKeywords: null;
|
|
1465
|
-
metaTitle: null;
|
|
1466
|
-
name: string;
|
|
1467
|
-
parentCategoryId: number | null;
|
|
1468
|
-
store: null;
|
|
1469
|
-
slug: string;
|
|
1470
|
-
userId: string;
|
|
1471
|
-
activeProducts: number;
|
|
1472
|
-
inactiveProducts: number;
|
|
1473
|
-
createdAt: string | null;
|
|
1474
|
-
updatedAt: string | null;
|
|
1475
|
-
} | null>>;
|
|
1476
|
-
fetchAllProductsOfCategories(slugOrId: string): Promise<Paginated<{
|
|
1477
|
-
id: number;
|
|
1478
|
-
title: string;
|
|
1479
|
-
slug: string;
|
|
1480
|
-
description: string;
|
|
1481
|
-
price: number;
|
|
1482
|
-
mrp: number;
|
|
1483
|
-
featuredImage: string | null;
|
|
1484
|
-
active: boolean;
|
|
1485
|
-
status: string;
|
|
1486
|
-
type: string;
|
|
1487
|
-
vendorId: string;
|
|
1488
|
-
categoryId: number | null;
|
|
1489
|
-
currency: string | null;
|
|
1490
|
-
instructions: null;
|
|
1491
|
-
hsnCode: string | null;
|
|
1492
|
-
images: string;
|
|
1493
|
-
thumbnail: string | null;
|
|
1494
|
-
keywords: string | null;
|
|
1495
|
-
link: null;
|
|
1496
|
-
metaTitle: string | null;
|
|
1497
|
-
metaDescription: string | null;
|
|
1498
|
-
subtitle: string | null;
|
|
1499
|
-
popularity: number;
|
|
1500
|
-
rank: number;
|
|
1501
|
-
expiryDate: null;
|
|
1502
|
-
weight: number | null;
|
|
1503
|
-
mfgDate: null;
|
|
1504
|
-
costPerItem: number;
|
|
1505
|
-
sku: string | null;
|
|
1506
|
-
stock: number;
|
|
1507
|
-
allowBackorder: boolean;
|
|
1508
|
-
manageInventory: boolean;
|
|
1509
|
-
shippingWeight: null;
|
|
1510
|
-
shippingHeight: null;
|
|
1511
|
-
shippingLen: null;
|
|
1512
|
-
shippingWidth: null;
|
|
1513
|
-
height: null;
|
|
1514
|
-
width: null;
|
|
1515
|
-
len: null;
|
|
1516
|
-
barcode: string | null;
|
|
1517
|
-
shippingCost: null;
|
|
1518
|
-
returnAllowed: boolean;
|
|
1519
|
-
replaceAllowed: boolean;
|
|
1520
|
-
originCountry: string | null;
|
|
1521
|
-
weightUnit: string;
|
|
1522
|
-
dimensionUnit: string;
|
|
1523
|
-
metadata: Record<string, string> | null;
|
|
1524
|
-
collectionId: number | null;
|
|
1525
|
-
tags: string[];
|
|
1526
|
-
vendor: string | null;
|
|
1527
|
-
categories: {
|
|
1528
|
-
category: {
|
|
1529
|
-
id: number;
|
|
1530
|
-
name: string;
|
|
1531
|
-
slug: string;
|
|
1532
|
-
};
|
|
1533
|
-
}[];
|
|
1534
|
-
createdAt: string | null;
|
|
1535
|
-
updatedAt: string | null;
|
|
1536
|
-
options: {
|
|
1537
|
-
id: number;
|
|
1538
|
-
title: string;
|
|
1539
|
-
type: string;
|
|
1540
|
-
values: {
|
|
1541
|
-
id: number;
|
|
1542
|
-
value: string;
|
|
1543
|
-
}[];
|
|
1544
|
-
}[];
|
|
1545
|
-
variants: {
|
|
1546
|
-
id: number;
|
|
1547
|
-
title: string;
|
|
1548
|
-
productId: number;
|
|
1549
|
-
sku: string | null;
|
|
1550
|
-
barcode: string | null;
|
|
1551
|
-
batchNo: null;
|
|
1552
|
-
stock: number;
|
|
1553
|
-
allowBackorder: boolean;
|
|
1554
|
-
manageInventory: boolean;
|
|
1555
|
-
hsCode: string | null;
|
|
1556
|
-
originCountry: string | null;
|
|
1557
|
-
midCode: null;
|
|
1558
|
-
material: null;
|
|
1559
|
-
weight: number | null;
|
|
1560
|
-
length: null;
|
|
1561
|
-
height: null;
|
|
1562
|
-
width: null;
|
|
1563
|
-
price: number;
|
|
1564
|
-
costPerItem: number;
|
|
1565
|
-
mfgDate: null;
|
|
1566
|
-
expiryDate: null;
|
|
1567
|
-
returnAllowed: boolean;
|
|
1568
|
-
replaceAllowed: boolean;
|
|
1569
|
-
mrp: number;
|
|
1570
|
-
img: string | null;
|
|
1571
|
-
description: null;
|
|
1572
|
-
storeId: null;
|
|
1573
|
-
len: null;
|
|
1574
|
-
rank: number;
|
|
1575
|
-
shippingWeight: null;
|
|
1576
|
-
shippingHeight: null;
|
|
1577
|
-
shippingLen: null;
|
|
1578
|
-
shippingWidth: null;
|
|
1579
|
-
shippingCost: null;
|
|
1580
|
-
metadata: Record<string, unknown> | null;
|
|
1581
|
-
variantRank: number;
|
|
1582
|
-
options: {
|
|
1583
|
-
id: string | number;
|
|
1584
|
-
optionId: number;
|
|
1585
|
-
value: string;
|
|
1586
|
-
variantId: number;
|
|
1587
|
-
}[];
|
|
1588
|
-
}[];
|
|
1589
|
-
} | null>>;
|
|
1590
|
-
getMegamenu(): Promise<Paginated<{
|
|
1591
|
-
id: number;
|
|
1592
|
-
isActive: boolean;
|
|
1593
|
-
isInternal: boolean;
|
|
1594
|
-
isMegamenu: boolean;
|
|
1595
|
-
thumbnail: null;
|
|
1596
|
-
path: string | null;
|
|
1597
|
-
level: number;
|
|
1598
|
-
description: null;
|
|
1599
|
-
isFeatured: boolean;
|
|
1600
|
-
keywords: null;
|
|
1601
|
-
rank: number;
|
|
1602
|
-
link: null;
|
|
1603
|
-
metaDescription: null;
|
|
1604
|
-
metaKeywords: null;
|
|
1605
|
-
metaTitle: null;
|
|
1606
|
-
name: string;
|
|
1607
|
-
parentCategoryId: number | null;
|
|
1608
|
-
store: null;
|
|
1609
|
-
slug: string;
|
|
1610
|
-
userId: string;
|
|
1611
|
-
activeProducts: number;
|
|
1612
|
-
inactiveProducts: number;
|
|
1613
|
-
createdAt: string | null;
|
|
1614
|
-
updatedAt: string | null;
|
|
1615
|
-
} | null>>;
|
|
1616
|
-
}
|
|
1617
|
-
declare const categoryService: CategoryService;
|
|
1618
|
-
declare class CollectionService extends BaseService {
|
|
1619
|
-
private static instance;
|
|
1620
|
-
static getInstance(): CollectionService;
|
|
1621
|
-
list({ page, q }?: {
|
|
1622
|
-
page?: number;
|
|
1623
|
-
q?: string;
|
|
1624
|
-
sort?: string;
|
|
1625
|
-
}): Promise<Paginated<{
|
|
1626
|
-
id: number;
|
|
1627
|
-
name: string;
|
|
1628
|
-
slug: string;
|
|
1629
|
-
description: string | null;
|
|
1630
|
-
isActive: boolean;
|
|
1631
|
-
isFeatured: boolean;
|
|
1632
|
-
userId: string;
|
|
1633
|
-
thumbnail: string | null;
|
|
1634
|
-
metaTitle: null;
|
|
1635
|
-
metaDescription: null;
|
|
1636
|
-
rank: number;
|
|
1637
|
-
collectionvalues: {
|
|
1638
|
-
products: {
|
|
1639
|
-
id: number;
|
|
1640
|
-
name: string;
|
|
1641
|
-
title: string;
|
|
1642
|
-
slug: string;
|
|
1643
|
-
thumbnail: string | null;
|
|
1644
|
-
price: number;
|
|
1645
|
-
mrp: number;
|
|
1646
|
-
};
|
|
1647
|
-
}[];
|
|
1648
|
-
productCount: number;
|
|
1649
|
-
createdAt: string | null;
|
|
1650
|
-
updatedAt: string | null;
|
|
1651
|
-
} | null>>;
|
|
1652
|
-
/**
|
|
1653
|
-
* A collection with its products. GoCommerce is keyed on slug; the storefront sometimes has only
|
|
1654
|
-
* an id, and there is no id lookup, so that case reads the list and matches there.
|
|
1655
|
-
*/
|
|
1656
|
-
getOne(idOrSlug: string): Promise<{
|
|
1657
|
-
id: number;
|
|
1658
|
-
name: string;
|
|
1659
|
-
slug: string;
|
|
1660
|
-
description: string | null;
|
|
1661
|
-
isActive: boolean;
|
|
1662
|
-
isFeatured: boolean;
|
|
1663
|
-
userId: string;
|
|
1664
|
-
thumbnail: string | null;
|
|
1665
|
-
metaTitle: null;
|
|
1666
|
-
metaDescription: null;
|
|
1667
|
-
rank: number;
|
|
1668
|
-
collectionvalues: {
|
|
1669
|
-
products: {
|
|
1670
|
-
id: number;
|
|
1671
|
-
name: string;
|
|
1672
|
-
title: string;
|
|
1673
|
-
slug: string;
|
|
1674
|
-
thumbnail: string | null;
|
|
1675
|
-
price: number;
|
|
1676
|
-
mrp: number;
|
|
1677
|
-
};
|
|
1678
|
-
}[];
|
|
1679
|
-
productCount: number;
|
|
1680
|
-
createdAt: string | null;
|
|
1681
|
-
updatedAt: string | null;
|
|
1682
|
-
} | null>;
|
|
1683
|
-
getAllRatings(): Promise<{
|
|
1684
|
-
id: null;
|
|
1685
|
-
name: string;
|
|
1686
|
-
slug: string;
|
|
1687
|
-
description: null;
|
|
1688
|
-
isActive: boolean;
|
|
1689
|
-
isFeatured: boolean;
|
|
1690
|
-
userId: string;
|
|
1691
|
-
productCount: number;
|
|
1692
|
-
thumbnail: null;
|
|
1693
|
-
metaTitle: null;
|
|
1694
|
-
metaDescription: null;
|
|
1695
|
-
collectionvalues: never[];
|
|
1696
|
-
createdAt: null;
|
|
1697
|
-
updatedAt: null;
|
|
1698
|
-
}>;
|
|
1699
|
-
}
|
|
1700
|
-
declare const collectionService: CollectionService;
|
|
1701
|
-
type ProductSearchResult = {
|
|
1702
|
-
data: unknown[];
|
|
1703
|
-
count: number;
|
|
1704
|
-
totalPages: number;
|
|
1705
|
-
categoryHierarchy: {
|
|
1706
|
-
name: string;
|
|
1707
|
-
slug?: string;
|
|
1708
|
-
}[];
|
|
1709
|
-
facets: {
|
|
1710
|
-
priceStat: {
|
|
1711
|
-
min?: number;
|
|
1712
|
-
max?: number;
|
|
1713
|
-
};
|
|
1714
|
-
categories: {
|
|
1715
|
-
name: string;
|
|
1716
|
-
slug?: string;
|
|
1717
|
-
count: number;
|
|
1718
|
-
}[];
|
|
1719
|
-
tags: {
|
|
1720
|
-
name: string;
|
|
1721
|
-
slug?: string;
|
|
1722
|
-
count: number;
|
|
1723
|
-
}[];
|
|
1724
|
-
allFilters: Record<string, unknown>;
|
|
1725
|
-
};
|
|
1726
|
-
};
|
|
1727
|
-
declare class SearchService extends BaseService {
|
|
1728
|
-
private static instance;
|
|
1729
|
-
static getInstance(): SearchService;
|
|
1730
|
-
emptyResult(): ProductSearchResult;
|
|
1731
|
-
/**
|
|
1732
|
-
* The listing page: `/products`, `/[slug]` for a category, and every filter the sidebar sets.
|
|
1733
|
-
*
|
|
1734
|
-
* Term and category are pushed to the API. Tags, the price range and the sort control are
|
|
1735
|
-
* applied here, because GoCommerce has no parameter for them — so when any of those is active
|
|
1736
|
-
* the request asks for the whole window rather than one page, and the result is paged locally.
|
|
1737
|
-
*/
|
|
1738
|
-
searchWithUrl(url: URL, slug?: string): Promise<ProductSearchResult>;
|
|
1739
|
-
searchWithQuery(queryString: string): Promise<ProductSearchResult>;
|
|
1740
|
-
}
|
|
1741
|
-
declare const searchService: SearchService;
|
|
1742
|
-
/**
|
|
1743
|
-
* The site-wide search box. Litekart backs this with Meilisearch; GoCommerce answers the same
|
|
1744
|
-
* question with `?q=` on the catalogue, so the shape is translated rather than the engine replaced.
|
|
1745
|
-
*/
|
|
1746
|
-
declare class MeilisearchService extends BaseService {
|
|
1747
|
-
private static instance;
|
|
1748
|
-
static getInstance(): MeilisearchService;
|
|
1749
|
-
search(params?: {
|
|
1750
|
-
q?: string;
|
|
1751
|
-
page?: number;
|
|
1752
|
-
limit?: number;
|
|
1753
|
-
}): Promise<{
|
|
1754
|
-
hits: ({
|
|
1755
|
-
id: number;
|
|
1756
|
-
title: string;
|
|
1757
|
-
slug: string;
|
|
1758
|
-
description: string;
|
|
1759
|
-
price: number;
|
|
1760
|
-
mrp: number;
|
|
1761
|
-
featuredImage: string | null;
|
|
1762
|
-
active: boolean;
|
|
1763
|
-
status: string;
|
|
1764
|
-
type: string;
|
|
1765
|
-
vendorId: string;
|
|
1766
|
-
categoryId: number | null;
|
|
1767
|
-
currency: string | null;
|
|
1768
|
-
instructions: null;
|
|
1769
|
-
hsnCode: string | null;
|
|
1770
|
-
images: string;
|
|
1771
|
-
thumbnail: string | null;
|
|
1772
|
-
keywords: string | null;
|
|
1773
|
-
link: null;
|
|
1774
|
-
metaTitle: string | null;
|
|
1775
|
-
metaDescription: string | null;
|
|
1776
|
-
subtitle: string | null;
|
|
1777
|
-
popularity: number;
|
|
1778
|
-
rank: number;
|
|
1779
|
-
expiryDate: null;
|
|
1780
|
-
weight: number | null;
|
|
1781
|
-
mfgDate: null;
|
|
1782
|
-
costPerItem: number;
|
|
1783
|
-
sku: string | null;
|
|
1784
|
-
stock: number;
|
|
1785
|
-
allowBackorder: boolean;
|
|
1786
|
-
manageInventory: boolean;
|
|
1787
|
-
shippingWeight: null;
|
|
1788
|
-
shippingHeight: null;
|
|
1789
|
-
shippingLen: null;
|
|
1790
|
-
shippingWidth: null;
|
|
1791
|
-
height: null;
|
|
1792
|
-
width: null;
|
|
1793
|
-
len: null;
|
|
1794
|
-
barcode: string | null;
|
|
1795
|
-
shippingCost: null;
|
|
1796
|
-
returnAllowed: boolean;
|
|
1797
|
-
replaceAllowed: boolean;
|
|
1798
|
-
originCountry: string | null;
|
|
1799
|
-
weightUnit: string;
|
|
1800
|
-
dimensionUnit: string;
|
|
1801
|
-
metadata: Record<string, string> | null;
|
|
1802
|
-
collectionId: number | null;
|
|
1803
|
-
tags: string[];
|
|
1804
|
-
vendor: string | null;
|
|
1805
|
-
categories: {
|
|
1806
|
-
category: {
|
|
1807
|
-
id: number;
|
|
1808
|
-
name: string;
|
|
1809
|
-
slug: string;
|
|
1810
|
-
};
|
|
1811
|
-
}[];
|
|
1812
|
-
createdAt: string | null;
|
|
1813
|
-
updatedAt: string | null;
|
|
1814
|
-
options: {
|
|
1815
|
-
id: number;
|
|
1816
|
-
title: string;
|
|
1817
|
-
type: string;
|
|
1818
|
-
values: {
|
|
1819
|
-
id: number;
|
|
1820
|
-
value: string;
|
|
1821
|
-
}[];
|
|
1822
|
-
}[];
|
|
1823
|
-
variants: {
|
|
1824
|
-
id: number;
|
|
1825
|
-
title: string;
|
|
1826
|
-
productId: number;
|
|
1827
|
-
sku: string | null;
|
|
1828
|
-
barcode: string | null;
|
|
1829
|
-
batchNo: null;
|
|
1830
|
-
stock: number;
|
|
1831
|
-
allowBackorder: boolean;
|
|
1832
|
-
manageInventory: boolean;
|
|
1833
|
-
hsCode: string | null;
|
|
1834
|
-
originCountry: string | null;
|
|
1835
|
-
midCode: null;
|
|
1836
|
-
material: null;
|
|
1837
|
-
weight: number | null;
|
|
1838
|
-
length: null;
|
|
1839
|
-
height: null;
|
|
1840
|
-
width: null;
|
|
1841
|
-
price: number;
|
|
1842
|
-
costPerItem: number;
|
|
1843
|
-
mfgDate: null;
|
|
1844
|
-
expiryDate: null;
|
|
1845
|
-
returnAllowed: boolean;
|
|
1846
|
-
replaceAllowed: boolean;
|
|
1847
|
-
mrp: number;
|
|
1848
|
-
img: string | null;
|
|
1849
|
-
description: null;
|
|
1850
|
-
storeId: null;
|
|
1851
|
-
len: null;
|
|
1852
|
-
rank: number;
|
|
1853
|
-
shippingWeight: null;
|
|
1854
|
-
shippingHeight: null;
|
|
1855
|
-
shippingLen: null;
|
|
1856
|
-
shippingWidth: null;
|
|
1857
|
-
shippingCost: null;
|
|
1858
|
-
metadata: Record<string, unknown> | null;
|
|
1859
|
-
variantRank: number;
|
|
1860
|
-
options: {
|
|
1861
|
-
id: string | number;
|
|
1862
|
-
optionId: number;
|
|
1863
|
-
value: string;
|
|
1864
|
-
variantId: number;
|
|
1865
|
-
}[];
|
|
1866
|
-
}[];
|
|
1867
|
-
} | null)[];
|
|
1868
|
-
data: ({
|
|
1869
|
-
id: number;
|
|
1870
|
-
title: string;
|
|
1871
|
-
slug: string;
|
|
1872
|
-
description: string;
|
|
1873
|
-
price: number;
|
|
1874
|
-
mrp: number;
|
|
1875
|
-
featuredImage: string | null;
|
|
1876
|
-
active: boolean;
|
|
1877
|
-
status: string;
|
|
1878
|
-
type: string;
|
|
1879
|
-
vendorId: string;
|
|
1880
|
-
categoryId: number | null;
|
|
1881
|
-
currency: string | null;
|
|
1882
|
-
instructions: null;
|
|
1883
|
-
hsnCode: string | null;
|
|
1884
|
-
images: string;
|
|
1885
|
-
thumbnail: string | null;
|
|
1886
|
-
keywords: string | null;
|
|
1887
|
-
link: null;
|
|
1888
|
-
metaTitle: string | null;
|
|
1889
|
-
metaDescription: string | null;
|
|
1890
|
-
subtitle: string | null;
|
|
1891
|
-
popularity: number;
|
|
1892
|
-
rank: number;
|
|
1893
|
-
expiryDate: null;
|
|
1894
|
-
weight: number | null;
|
|
1895
|
-
mfgDate: null;
|
|
1896
|
-
costPerItem: number;
|
|
1897
|
-
sku: string | null;
|
|
1898
|
-
stock: number;
|
|
1899
|
-
allowBackorder: boolean;
|
|
1900
|
-
manageInventory: boolean;
|
|
1901
|
-
shippingWeight: null;
|
|
1902
|
-
shippingHeight: null;
|
|
1903
|
-
shippingLen: null;
|
|
1904
|
-
shippingWidth: null;
|
|
1905
|
-
height: null;
|
|
1906
|
-
width: null;
|
|
1907
|
-
len: null;
|
|
1908
|
-
barcode: string | null;
|
|
1909
|
-
shippingCost: null;
|
|
1910
|
-
returnAllowed: boolean;
|
|
1911
|
-
replaceAllowed: boolean;
|
|
1912
|
-
originCountry: string | null;
|
|
1913
|
-
weightUnit: string;
|
|
1914
|
-
dimensionUnit: string;
|
|
1915
|
-
metadata: Record<string, string> | null;
|
|
1916
|
-
collectionId: number | null;
|
|
1917
|
-
tags: string[];
|
|
1918
|
-
vendor: string | null;
|
|
1919
|
-
categories: {
|
|
1920
|
-
category: {
|
|
1921
|
-
id: number;
|
|
1922
|
-
name: string;
|
|
1923
|
-
slug: string;
|
|
1924
|
-
};
|
|
1925
|
-
}[];
|
|
1926
|
-
createdAt: string | null;
|
|
1927
|
-
updatedAt: string | null;
|
|
1928
|
-
options: {
|
|
1929
|
-
id: number;
|
|
1930
|
-
title: string;
|
|
1931
|
-
type: string;
|
|
1932
|
-
values: {
|
|
1933
|
-
id: number;
|
|
1934
|
-
value: string;
|
|
1935
|
-
}[];
|
|
1936
|
-
}[];
|
|
1937
|
-
variants: {
|
|
1938
|
-
id: number;
|
|
1939
|
-
title: string;
|
|
1940
|
-
productId: number;
|
|
1941
|
-
sku: string | null;
|
|
1942
|
-
barcode: string | null;
|
|
1943
|
-
batchNo: null;
|
|
1944
|
-
stock: number;
|
|
1945
|
-
allowBackorder: boolean;
|
|
1946
|
-
manageInventory: boolean;
|
|
1947
|
-
hsCode: string | null;
|
|
1948
|
-
originCountry: string | null;
|
|
1949
|
-
midCode: null;
|
|
1950
|
-
material: null;
|
|
1951
|
-
weight: number | null;
|
|
1952
|
-
length: null;
|
|
1953
|
-
height: null;
|
|
1954
|
-
width: null;
|
|
1955
|
-
price: number;
|
|
1956
|
-
costPerItem: number;
|
|
1957
|
-
mfgDate: null;
|
|
1958
|
-
expiryDate: null;
|
|
1959
|
-
returnAllowed: boolean;
|
|
1960
|
-
replaceAllowed: boolean;
|
|
1961
|
-
mrp: number;
|
|
1962
|
-
img: string | null;
|
|
1963
|
-
description: null;
|
|
1964
|
-
storeId: null;
|
|
1965
|
-
len: null;
|
|
1966
|
-
rank: number;
|
|
1967
|
-
shippingWeight: null;
|
|
1968
|
-
shippingHeight: null;
|
|
1969
|
-
shippingLen: null;
|
|
1970
|
-
shippingWidth: null;
|
|
1971
|
-
shippingCost: null;
|
|
1972
|
-
metadata: Record<string, unknown> | null;
|
|
1973
|
-
variantRank: number;
|
|
1974
|
-
options: {
|
|
1975
|
-
id: string | number;
|
|
1976
|
-
optionId: number;
|
|
1977
|
-
value: string;
|
|
1978
|
-
variantId: number;
|
|
1979
|
-
}[];
|
|
1980
|
-
}[];
|
|
1981
|
-
} | null)[];
|
|
1982
|
-
estimatedTotalHits: number;
|
|
1983
|
-
count: number;
|
|
1984
|
-
page: number;
|
|
1985
|
-
totalPages: number;
|
|
1986
|
-
hitsPerPage: number;
|
|
1987
|
-
facetDistribution: {};
|
|
1988
|
-
processingTimeMs: number;
|
|
1989
|
-
query: string;
|
|
1990
|
-
}>;
|
|
1991
|
-
searchAutoComplete(params?: {
|
|
1992
|
-
q?: string;
|
|
1993
|
-
limit?: number;
|
|
1994
|
-
}): Promise<{
|
|
1995
|
-
hits: {
|
|
1996
|
-
id: number;
|
|
1997
|
-
name: string;
|
|
1998
|
-
title: string;
|
|
1999
|
-
slug: string;
|
|
2000
|
-
thumbnail: string | null;
|
|
2001
|
-
}[];
|
|
2002
|
-
data: {
|
|
2003
|
-
id: number;
|
|
2004
|
-
name: string;
|
|
2005
|
-
title: string;
|
|
2006
|
-
slug: string;
|
|
2007
|
-
thumbnail: string | null;
|
|
2008
|
-
}[];
|
|
2009
|
-
count: number;
|
|
2010
|
-
query: string;
|
|
2011
|
-
}>;
|
|
2012
|
-
}
|
|
2013
|
-
declare const meilisearchService: MeilisearchService;
|
|
2014
|
-
declare class AutocompleteService extends BaseService {
|
|
2015
|
-
private static instance;
|
|
2016
|
-
static getInstance(): AutocompleteService;
|
|
2017
|
-
list({ page, q }?: {
|
|
2018
|
-
page?: number;
|
|
2019
|
-
q?: string;
|
|
2020
|
-
sort?: string;
|
|
2021
|
-
}): Promise<Paginated<{
|
|
2022
|
-
id: number;
|
|
2023
|
-
name: string;
|
|
2024
|
-
slug: string;
|
|
2025
|
-
}>>;
|
|
2026
|
-
}
|
|
2027
|
-
declare const autocompleteService: AutocompleteService;
|
|
2028
|
-
/**
|
|
2029
|
-
* A product index for the ids a cart or order line names, so those lines can show a slug and an
|
|
2030
|
-
* image. Everything already read is served from the cache; the rest is fetched once, in parallel.
|
|
2031
|
-
*/
|
|
2032
|
-
declare const resolveProductIndex: (ids: (number | null | undefined)[], fetchFn?: typeof fetch) => Promise<ProductIndex>;
|
|
2033
|
-
|
|
2034
|
-
declare class CartService extends BaseService {
|
|
2035
|
-
private static instance;
|
|
2036
|
-
static getInstance(): CartService;
|
|
2037
|
-
/** Turns a GoCommerce cart into the shape the storefront's cart, drawer and checkout read. */
|
|
2038
|
-
private present;
|
|
2039
|
-
/** Opens a cart. The email is optional here and is the only field `POST /api/carts` accepts. */
|
|
2040
|
-
private openCart;
|
|
2041
|
-
private readCart;
|
|
2042
|
-
/**
|
|
2043
|
-
* Is the cart behind this token gone for good — expired, unknown, or already checked out?
|
|
2044
|
-
*
|
|
2045
|
-
* Asked by re-reading the cart rather than by matching the failure's wording, because the API
|
|
2046
|
-
* reports several unrelated things the same way: a dead cart and an unknown payment code are both
|
|
2047
|
-
* `404 not_found`. The status is the fact; the message is prose.
|
|
2048
|
-
*/
|
|
2049
|
-
cartIsSpent(cartId: string): Promise<boolean>;
|
|
2050
|
-
/** One line-item write against a cart that exists. Returns the cart the write left behind. */
|
|
2051
|
-
private writeLine;
|
|
2052
|
-
getCartByCartId(cartId: string): Promise<{
|
|
2053
|
-
id?: undefined;
|
|
2054
|
-
email?: undefined;
|
|
2055
|
-
phone?: undefined;
|
|
2056
|
-
name?: undefined;
|
|
2057
|
-
billingAddressId?: undefined;
|
|
2058
|
-
shippingAddressId?: undefined;
|
|
2059
|
-
regionId?: undefined;
|
|
2060
|
-
userId?: undefined;
|
|
2061
|
-
couponCode?: undefined;
|
|
2062
|
-
discountAmount?: undefined;
|
|
2063
|
-
couponAppliedDate?: undefined;
|
|
2064
|
-
needAddress?: undefined;
|
|
2065
|
-
isCodAvailable?: undefined;
|
|
2066
|
-
paymentId?: undefined;
|
|
2067
|
-
type?: undefined;
|
|
2068
|
-
completedAt?: undefined;
|
|
2069
|
-
paymentAuthorizedAt?: undefined;
|
|
2070
|
-
idempotencyKey?: undefined;
|
|
2071
|
-
salesChannelId?: undefined;
|
|
2072
|
-
qty?: undefined;
|
|
2073
|
-
shippingCharges?: undefined;
|
|
2074
|
-
paymentMethod?: undefined;
|
|
2075
|
-
shippingMethod?: undefined;
|
|
2076
|
-
subtotal?: undefined;
|
|
2077
|
-
codCharges?: undefined;
|
|
2078
|
-
tax?: undefined;
|
|
2079
|
-
total?: undefined;
|
|
2080
|
-
savingAmount?: undefined;
|
|
2081
|
-
userAuthToken?: undefined;
|
|
2082
|
-
currencyCode?: undefined;
|
|
2083
|
-
currencySymbol?: undefined;
|
|
2084
|
-
shippingRateId?: undefined;
|
|
2085
|
-
currencyDecimalDigits?: undefined;
|
|
2086
|
-
storeId?: undefined;
|
|
2087
|
-
status?: undefined;
|
|
2088
|
-
createdAt?: undefined;
|
|
2089
|
-
updatedAt?: undefined;
|
|
2090
|
-
deletedAt?: undefined;
|
|
2091
|
-
lineItems?: undefined;
|
|
2092
|
-
shippingAddress?: undefined;
|
|
2093
|
-
billingAddress?: undefined;
|
|
2094
|
-
} | {
|
|
2095
|
-
id: string;
|
|
2096
|
-
email: string | null;
|
|
2097
|
-
phone: any;
|
|
2098
|
-
name: string | null;
|
|
2099
|
-
billingAddressId: string | null;
|
|
2100
|
-
shippingAddressId: string | null;
|
|
2101
|
-
regionId: null;
|
|
2102
|
-
userId: null;
|
|
2103
|
-
couponCode: null;
|
|
2104
|
-
discountAmount: number;
|
|
2105
|
-
couponAppliedDate: null;
|
|
2106
|
-
needAddress: boolean;
|
|
2107
|
-
isCodAvailable: boolean;
|
|
2108
|
-
paymentId: null;
|
|
2109
|
-
type: null;
|
|
2110
|
-
completedAt: string | null;
|
|
2111
|
-
paymentAuthorizedAt: null;
|
|
2112
|
-
idempotencyKey: null;
|
|
2113
|
-
salesChannelId: null;
|
|
2114
|
-
qty: number;
|
|
2115
|
-
shippingCharges: number;
|
|
2116
|
-
paymentMethod: null;
|
|
2117
|
-
shippingMethod: null;
|
|
2118
|
-
subtotal: number;
|
|
2119
|
-
codCharges: number;
|
|
2120
|
-
tax: number;
|
|
2121
|
-
total: number;
|
|
2122
|
-
savingAmount: number;
|
|
2123
|
-
userAuthToken: null;
|
|
2124
|
-
currencyCode: any;
|
|
2125
|
-
currencySymbol: any;
|
|
2126
|
-
shippingRateId: null;
|
|
2127
|
-
currencyDecimalDigits: number;
|
|
2128
|
-
storeId: any;
|
|
2129
|
-
status: "open" | "converted" | "abandoned";
|
|
2130
|
-
createdAt: string | null;
|
|
2131
|
-
updatedAt: string | null;
|
|
2132
|
-
deletedAt: null;
|
|
2133
|
-
lineItems: {
|
|
2134
|
-
id: number;
|
|
2135
|
-
productId: number;
|
|
2136
|
-
variantId: number;
|
|
2137
|
-
qty: number;
|
|
2138
|
-
subtotal: number;
|
|
2139
|
-
discount: number;
|
|
2140
|
-
tax: number;
|
|
2141
|
-
shippingCharges: number;
|
|
2142
|
-
total: number;
|
|
2143
|
-
price: number;
|
|
2144
|
-
mrp: number;
|
|
2145
|
-
title: string;
|
|
2146
|
-
slug: string;
|
|
2147
|
-
sku: string;
|
|
2148
|
-
description: null;
|
|
2149
|
-
thumbnail: string | null;
|
|
2150
|
-
metadata: null;
|
|
2151
|
-
vendorId: null;
|
|
2152
|
-
weight: null;
|
|
2153
|
-
dimensionUnit: string;
|
|
2154
|
-
height: null;
|
|
2155
|
-
width: null;
|
|
2156
|
-
len: null;
|
|
2157
|
-
shippingWeight: null;
|
|
2158
|
-
shippingHeight: null;
|
|
2159
|
-
shippingLen: null;
|
|
2160
|
-
shippingWidth: null;
|
|
2161
|
-
isSelectedForCheckout: boolean;
|
|
2162
|
-
priceChanged: boolean;
|
|
2163
|
-
inStock: boolean;
|
|
2164
|
-
createdAt: null;
|
|
2165
|
-
product: {
|
|
2166
|
-
id: number;
|
|
2167
|
-
title: string;
|
|
2168
|
-
thumbnail: string | null;
|
|
2169
|
-
slug: string;
|
|
2170
|
-
sku: string;
|
|
2171
|
-
categories: {
|
|
2172
|
-
category: {
|
|
2173
|
-
id: number;
|
|
2174
|
-
name: string;
|
|
2175
|
-
slug: string;
|
|
2176
|
-
};
|
|
2177
|
-
}[];
|
|
2178
|
-
};
|
|
2179
|
-
variant: {
|
|
2180
|
-
id: number;
|
|
2181
|
-
price: number;
|
|
2182
|
-
mrp: number;
|
|
2183
|
-
weight: null;
|
|
2184
|
-
height: null;
|
|
2185
|
-
width: null;
|
|
2186
|
-
len: null;
|
|
2187
|
-
shippingWeight: null;
|
|
2188
|
-
shippingHeight: null;
|
|
2189
|
-
shippingLen: null;
|
|
2190
|
-
shippingWidth: null;
|
|
2191
|
-
sku: string;
|
|
2192
|
-
title: string;
|
|
2193
|
-
options: {
|
|
2194
|
-
id: string | number;
|
|
2195
|
-
optionId: number;
|
|
2196
|
-
value: string;
|
|
2197
|
-
variantId: number;
|
|
2198
|
-
}[];
|
|
2199
|
-
};
|
|
2200
|
-
}[];
|
|
2201
|
-
shippingAddress: Record<string, any> | null;
|
|
2202
|
-
billingAddress: Record<string, any> | null;
|
|
2203
|
-
}>;
|
|
2204
|
-
fetchCartData(): Promise<{
|
|
2205
|
-
id?: undefined;
|
|
2206
|
-
email?: undefined;
|
|
2207
|
-
phone?: undefined;
|
|
2208
|
-
name?: undefined;
|
|
2209
|
-
billingAddressId?: undefined;
|
|
2210
|
-
shippingAddressId?: undefined;
|
|
2211
|
-
regionId?: undefined;
|
|
2212
|
-
userId?: undefined;
|
|
2213
|
-
couponCode?: undefined;
|
|
2214
|
-
discountAmount?: undefined;
|
|
2215
|
-
couponAppliedDate?: undefined;
|
|
2216
|
-
needAddress?: undefined;
|
|
2217
|
-
isCodAvailable?: undefined;
|
|
2218
|
-
paymentId?: undefined;
|
|
2219
|
-
type?: undefined;
|
|
2220
|
-
completedAt?: undefined;
|
|
2221
|
-
paymentAuthorizedAt?: undefined;
|
|
2222
|
-
idempotencyKey?: undefined;
|
|
2223
|
-
salesChannelId?: undefined;
|
|
2224
|
-
qty?: undefined;
|
|
2225
|
-
shippingCharges?: undefined;
|
|
2226
|
-
paymentMethod?: undefined;
|
|
2227
|
-
shippingMethod?: undefined;
|
|
2228
|
-
subtotal?: undefined;
|
|
2229
|
-
codCharges?: undefined;
|
|
2230
|
-
tax?: undefined;
|
|
2231
|
-
total?: undefined;
|
|
2232
|
-
savingAmount?: undefined;
|
|
2233
|
-
userAuthToken?: undefined;
|
|
2234
|
-
currencyCode?: undefined;
|
|
2235
|
-
currencySymbol?: undefined;
|
|
2236
|
-
shippingRateId?: undefined;
|
|
2237
|
-
currencyDecimalDigits?: undefined;
|
|
2238
|
-
storeId?: undefined;
|
|
2239
|
-
status?: undefined;
|
|
2240
|
-
createdAt?: undefined;
|
|
2241
|
-
updatedAt?: undefined;
|
|
2242
|
-
deletedAt?: undefined;
|
|
2243
|
-
lineItems?: undefined;
|
|
2244
|
-
shippingAddress?: undefined;
|
|
2245
|
-
billingAddress?: undefined;
|
|
2246
|
-
} | {
|
|
2247
|
-
id: string;
|
|
2248
|
-
email: string | null;
|
|
2249
|
-
phone: any;
|
|
2250
|
-
name: string | null;
|
|
2251
|
-
billingAddressId: string | null;
|
|
2252
|
-
shippingAddressId: string | null;
|
|
2253
|
-
regionId: null;
|
|
2254
|
-
userId: null;
|
|
2255
|
-
couponCode: null;
|
|
2256
|
-
discountAmount: number;
|
|
2257
|
-
couponAppliedDate: null;
|
|
2258
|
-
needAddress: boolean;
|
|
2259
|
-
isCodAvailable: boolean;
|
|
2260
|
-
paymentId: null;
|
|
2261
|
-
type: null;
|
|
2262
|
-
completedAt: string | null;
|
|
2263
|
-
paymentAuthorizedAt: null;
|
|
2264
|
-
idempotencyKey: null;
|
|
2265
|
-
salesChannelId: null;
|
|
2266
|
-
qty: number;
|
|
2267
|
-
shippingCharges: number;
|
|
2268
|
-
paymentMethod: null;
|
|
2269
|
-
shippingMethod: null;
|
|
2270
|
-
subtotal: number;
|
|
2271
|
-
codCharges: number;
|
|
2272
|
-
tax: number;
|
|
2273
|
-
total: number;
|
|
2274
|
-
savingAmount: number;
|
|
2275
|
-
userAuthToken: null;
|
|
2276
|
-
currencyCode: any;
|
|
2277
|
-
currencySymbol: any;
|
|
2278
|
-
shippingRateId: null;
|
|
2279
|
-
currencyDecimalDigits: number;
|
|
2280
|
-
storeId: any;
|
|
2281
|
-
status: "open" | "converted" | "abandoned";
|
|
2282
|
-
createdAt: string | null;
|
|
2283
|
-
updatedAt: string | null;
|
|
2284
|
-
deletedAt: null;
|
|
2285
|
-
lineItems: {
|
|
2286
|
-
id: number;
|
|
2287
|
-
productId: number;
|
|
2288
|
-
variantId: number;
|
|
2289
|
-
qty: number;
|
|
2290
|
-
subtotal: number;
|
|
2291
|
-
discount: number;
|
|
2292
|
-
tax: number;
|
|
2293
|
-
shippingCharges: number;
|
|
2294
|
-
total: number;
|
|
2295
|
-
price: number;
|
|
2296
|
-
mrp: number;
|
|
2297
|
-
title: string;
|
|
2298
|
-
slug: string;
|
|
2299
|
-
sku: string;
|
|
2300
|
-
description: null;
|
|
2301
|
-
thumbnail: string | null;
|
|
2302
|
-
metadata: null;
|
|
2303
|
-
vendorId: null;
|
|
2304
|
-
weight: null;
|
|
2305
|
-
dimensionUnit: string;
|
|
2306
|
-
height: null;
|
|
2307
|
-
width: null;
|
|
2308
|
-
len: null;
|
|
2309
|
-
shippingWeight: null;
|
|
2310
|
-
shippingHeight: null;
|
|
2311
|
-
shippingLen: null;
|
|
2312
|
-
shippingWidth: null;
|
|
2313
|
-
isSelectedForCheckout: boolean;
|
|
2314
|
-
priceChanged: boolean;
|
|
2315
|
-
inStock: boolean;
|
|
2316
|
-
createdAt: null;
|
|
2317
|
-
product: {
|
|
2318
|
-
id: number;
|
|
2319
|
-
title: string;
|
|
2320
|
-
thumbnail: string | null;
|
|
2321
|
-
slug: string;
|
|
2322
|
-
sku: string;
|
|
2323
|
-
categories: {
|
|
2324
|
-
category: {
|
|
2325
|
-
id: number;
|
|
2326
|
-
name: string;
|
|
2327
|
-
slug: string;
|
|
2328
|
-
};
|
|
2329
|
-
}[];
|
|
2330
|
-
};
|
|
2331
|
-
variant: {
|
|
2332
|
-
id: number;
|
|
2333
|
-
price: number;
|
|
2334
|
-
mrp: number;
|
|
2335
|
-
weight: null;
|
|
2336
|
-
height: null;
|
|
2337
|
-
width: null;
|
|
2338
|
-
len: null;
|
|
2339
|
-
shippingWeight: null;
|
|
2340
|
-
shippingHeight: null;
|
|
2341
|
-
shippingLen: null;
|
|
2342
|
-
shippingWidth: null;
|
|
2343
|
-
sku: string;
|
|
2344
|
-
title: string;
|
|
2345
|
-
options: {
|
|
2346
|
-
id: string | number;
|
|
2347
|
-
optionId: number;
|
|
2348
|
-
value: string;
|
|
2349
|
-
variantId: number;
|
|
2350
|
-
}[];
|
|
2351
|
-
};
|
|
2352
|
-
}[];
|
|
2353
|
-
shippingAddress: Record<string, any> | null;
|
|
2354
|
-
billingAddress: Record<string, any> | null;
|
|
2355
|
-
}>;
|
|
2356
|
-
refereshCart(): Promise<{
|
|
2357
|
-
id?: undefined;
|
|
2358
|
-
email?: undefined;
|
|
2359
|
-
phone?: undefined;
|
|
2360
|
-
name?: undefined;
|
|
2361
|
-
billingAddressId?: undefined;
|
|
2362
|
-
shippingAddressId?: undefined;
|
|
2363
|
-
regionId?: undefined;
|
|
2364
|
-
userId?: undefined;
|
|
2365
|
-
couponCode?: undefined;
|
|
2366
|
-
discountAmount?: undefined;
|
|
2367
|
-
couponAppliedDate?: undefined;
|
|
2368
|
-
needAddress?: undefined;
|
|
2369
|
-
isCodAvailable?: undefined;
|
|
2370
|
-
paymentId?: undefined;
|
|
2371
|
-
type?: undefined;
|
|
2372
|
-
completedAt?: undefined;
|
|
2373
|
-
paymentAuthorizedAt?: undefined;
|
|
2374
|
-
idempotencyKey?: undefined;
|
|
2375
|
-
salesChannelId?: undefined;
|
|
2376
|
-
qty?: undefined;
|
|
2377
|
-
shippingCharges?: undefined;
|
|
2378
|
-
paymentMethod?: undefined;
|
|
2379
|
-
shippingMethod?: undefined;
|
|
2380
|
-
subtotal?: undefined;
|
|
2381
|
-
codCharges?: undefined;
|
|
2382
|
-
tax?: undefined;
|
|
2383
|
-
total?: undefined;
|
|
2384
|
-
savingAmount?: undefined;
|
|
2385
|
-
userAuthToken?: undefined;
|
|
2386
|
-
currencyCode?: undefined;
|
|
2387
|
-
currencySymbol?: undefined;
|
|
2388
|
-
shippingRateId?: undefined;
|
|
2389
|
-
currencyDecimalDigits?: undefined;
|
|
2390
|
-
storeId?: undefined;
|
|
2391
|
-
status?: undefined;
|
|
2392
|
-
createdAt?: undefined;
|
|
2393
|
-
updatedAt?: undefined;
|
|
2394
|
-
deletedAt?: undefined;
|
|
2395
|
-
lineItems?: undefined;
|
|
2396
|
-
shippingAddress?: undefined;
|
|
2397
|
-
billingAddress?: undefined;
|
|
2398
|
-
} | {
|
|
2399
|
-
id: string;
|
|
2400
|
-
email: string | null;
|
|
2401
|
-
phone: any;
|
|
2402
|
-
name: string | null;
|
|
2403
|
-
billingAddressId: string | null;
|
|
2404
|
-
shippingAddressId: string | null;
|
|
2405
|
-
regionId: null;
|
|
2406
|
-
userId: null;
|
|
2407
|
-
couponCode: null;
|
|
2408
|
-
discountAmount: number;
|
|
2409
|
-
couponAppliedDate: null;
|
|
2410
|
-
needAddress: boolean;
|
|
2411
|
-
isCodAvailable: boolean;
|
|
2412
|
-
paymentId: null;
|
|
2413
|
-
type: null;
|
|
2414
|
-
completedAt: string | null;
|
|
2415
|
-
paymentAuthorizedAt: null;
|
|
2416
|
-
idempotencyKey: null;
|
|
2417
|
-
salesChannelId: null;
|
|
2418
|
-
qty: number;
|
|
2419
|
-
shippingCharges: number;
|
|
2420
|
-
paymentMethod: null;
|
|
2421
|
-
shippingMethod: null;
|
|
2422
|
-
subtotal: number;
|
|
2423
|
-
codCharges: number;
|
|
2424
|
-
tax: number;
|
|
2425
|
-
total: number;
|
|
2426
|
-
savingAmount: number;
|
|
2427
|
-
userAuthToken: null;
|
|
2428
|
-
currencyCode: any;
|
|
2429
|
-
currencySymbol: any;
|
|
2430
|
-
shippingRateId: null;
|
|
2431
|
-
currencyDecimalDigits: number;
|
|
2432
|
-
storeId: any;
|
|
2433
|
-
status: "open" | "converted" | "abandoned";
|
|
2434
|
-
createdAt: string | null;
|
|
2435
|
-
updatedAt: string | null;
|
|
2436
|
-
deletedAt: null;
|
|
2437
|
-
lineItems: {
|
|
2438
|
-
id: number;
|
|
2439
|
-
productId: number;
|
|
2440
|
-
variantId: number;
|
|
2441
|
-
qty: number;
|
|
2442
|
-
subtotal: number;
|
|
2443
|
-
discount: number;
|
|
2444
|
-
tax: number;
|
|
2445
|
-
shippingCharges: number;
|
|
2446
|
-
total: number;
|
|
2447
|
-
price: number;
|
|
2448
|
-
mrp: number;
|
|
2449
|
-
title: string;
|
|
2450
|
-
slug: string;
|
|
2451
|
-
sku: string;
|
|
2452
|
-
description: null;
|
|
2453
|
-
thumbnail: string | null;
|
|
2454
|
-
metadata: null;
|
|
2455
|
-
vendorId: null;
|
|
2456
|
-
weight: null;
|
|
2457
|
-
dimensionUnit: string;
|
|
2458
|
-
height: null;
|
|
2459
|
-
width: null;
|
|
2460
|
-
len: null;
|
|
2461
|
-
shippingWeight: null;
|
|
2462
|
-
shippingHeight: null;
|
|
2463
|
-
shippingLen: null;
|
|
2464
|
-
shippingWidth: null;
|
|
2465
|
-
isSelectedForCheckout: boolean;
|
|
2466
|
-
priceChanged: boolean;
|
|
2467
|
-
inStock: boolean;
|
|
2468
|
-
createdAt: null;
|
|
2469
|
-
product: {
|
|
2470
|
-
id: number;
|
|
2471
|
-
title: string;
|
|
2472
|
-
thumbnail: string | null;
|
|
2473
|
-
slug: string;
|
|
2474
|
-
sku: string;
|
|
2475
|
-
categories: {
|
|
2476
|
-
category: {
|
|
2477
|
-
id: number;
|
|
2478
|
-
name: string;
|
|
2479
|
-
slug: string;
|
|
2480
|
-
};
|
|
2481
|
-
}[];
|
|
2482
|
-
};
|
|
2483
|
-
variant: {
|
|
2484
|
-
id: number;
|
|
2485
|
-
price: number;
|
|
2486
|
-
mrp: number;
|
|
2487
|
-
weight: null;
|
|
2488
|
-
height: null;
|
|
2489
|
-
width: null;
|
|
2490
|
-
len: null;
|
|
2491
|
-
shippingWeight: null;
|
|
2492
|
-
shippingHeight: null;
|
|
2493
|
-
shippingLen: null;
|
|
2494
|
-
shippingWidth: null;
|
|
2495
|
-
sku: string;
|
|
2496
|
-
title: string;
|
|
2497
|
-
options: {
|
|
2498
|
-
id: string | number;
|
|
2499
|
-
optionId: number;
|
|
2500
|
-
value: string;
|
|
2501
|
-
variantId: number;
|
|
2502
|
-
}[];
|
|
2503
|
-
};
|
|
2504
|
-
}[];
|
|
2505
|
-
shippingAddress: Record<string, any> | null;
|
|
2506
|
-
billingAddress: Record<string, any> | null;
|
|
2507
|
-
}>;
|
|
2508
|
-
/**
|
|
2509
|
-
* Add, change or remove a line.
|
|
2510
|
-
*
|
|
2511
|
-
* `qty` is the line's new quantity, not a delta — which is how the shared cart store calls it
|
|
2512
|
-
* (its stepper sends `qty ± 1`), and what `PATCH .../line-items/{lineId}` takes. A quantity of
|
|
2513
|
-
* zero removes the line, and so does the store's `REMOVE_LINE` sentinel.
|
|
2514
|
-
*
|
|
2515
|
-
* A cart token in this browser can be dead — expired, wiped server-side, or already checked out —
|
|
2516
|
-
* and the API then answers "cart not found", which is what the shopper was shown when they
|
|
2517
|
-
* clicked Add to bag. That is a token this storefront is holding, not anything they did, so a
|
|
2518
|
-
* dead one is dropped and the item is added to a fresh cart instead of reporting it.
|
|
2519
|
-
*/
|
|
2520
|
-
addToCart({ variantId, qty, cartId, lineId }: {
|
|
2521
|
-
productId?: string | number;
|
|
2522
|
-
variantId?: string | number;
|
|
2523
|
-
qty: number;
|
|
2524
|
-
cartId?: string | null;
|
|
2525
|
-
lineId?: string | number | null;
|
|
2526
|
-
}): Promise<{
|
|
2527
|
-
id?: undefined;
|
|
2528
|
-
email?: undefined;
|
|
2529
|
-
phone?: undefined;
|
|
2530
|
-
name?: undefined;
|
|
2531
|
-
billingAddressId?: undefined;
|
|
2532
|
-
shippingAddressId?: undefined;
|
|
2533
|
-
regionId?: undefined;
|
|
2534
|
-
userId?: undefined;
|
|
2535
|
-
couponCode?: undefined;
|
|
2536
|
-
discountAmount?: undefined;
|
|
2537
|
-
couponAppliedDate?: undefined;
|
|
2538
|
-
needAddress?: undefined;
|
|
2539
|
-
isCodAvailable?: undefined;
|
|
2540
|
-
paymentId?: undefined;
|
|
2541
|
-
type?: undefined;
|
|
2542
|
-
completedAt?: undefined;
|
|
2543
|
-
paymentAuthorizedAt?: undefined;
|
|
2544
|
-
idempotencyKey?: undefined;
|
|
2545
|
-
salesChannelId?: undefined;
|
|
2546
|
-
qty?: undefined;
|
|
2547
|
-
shippingCharges?: undefined;
|
|
2548
|
-
paymentMethod?: undefined;
|
|
2549
|
-
shippingMethod?: undefined;
|
|
2550
|
-
subtotal?: undefined;
|
|
2551
|
-
codCharges?: undefined;
|
|
2552
|
-
tax?: undefined;
|
|
2553
|
-
total?: undefined;
|
|
2554
|
-
savingAmount?: undefined;
|
|
2555
|
-
userAuthToken?: undefined;
|
|
2556
|
-
currencyCode?: undefined;
|
|
2557
|
-
currencySymbol?: undefined;
|
|
2558
|
-
shippingRateId?: undefined;
|
|
2559
|
-
currencyDecimalDigits?: undefined;
|
|
2560
|
-
storeId?: undefined;
|
|
2561
|
-
status?: undefined;
|
|
2562
|
-
createdAt?: undefined;
|
|
2563
|
-
updatedAt?: undefined;
|
|
2564
|
-
deletedAt?: undefined;
|
|
2565
|
-
lineItems?: undefined;
|
|
2566
|
-
shippingAddress?: undefined;
|
|
2567
|
-
billingAddress?: undefined;
|
|
2568
|
-
} | {
|
|
2569
|
-
id: string;
|
|
2570
|
-
email: string | null;
|
|
2571
|
-
phone: any;
|
|
2572
|
-
name: string | null;
|
|
2573
|
-
billingAddressId: string | null;
|
|
2574
|
-
shippingAddressId: string | null;
|
|
2575
|
-
regionId: null;
|
|
2576
|
-
userId: null;
|
|
2577
|
-
couponCode: null;
|
|
2578
|
-
discountAmount: number;
|
|
2579
|
-
couponAppliedDate: null;
|
|
2580
|
-
needAddress: boolean;
|
|
2581
|
-
isCodAvailable: boolean;
|
|
2582
|
-
paymentId: null;
|
|
2583
|
-
type: null;
|
|
2584
|
-
completedAt: string | null;
|
|
2585
|
-
paymentAuthorizedAt: null;
|
|
2586
|
-
idempotencyKey: null;
|
|
2587
|
-
salesChannelId: null;
|
|
2588
|
-
qty: number;
|
|
2589
|
-
shippingCharges: number;
|
|
2590
|
-
paymentMethod: null;
|
|
2591
|
-
shippingMethod: null;
|
|
2592
|
-
subtotal: number;
|
|
2593
|
-
codCharges: number;
|
|
2594
|
-
tax: number;
|
|
2595
|
-
total: number;
|
|
2596
|
-
savingAmount: number;
|
|
2597
|
-
userAuthToken: null;
|
|
2598
|
-
currencyCode: any;
|
|
2599
|
-
currencySymbol: any;
|
|
2600
|
-
shippingRateId: null;
|
|
2601
|
-
currencyDecimalDigits: number;
|
|
2602
|
-
storeId: any;
|
|
2603
|
-
status: "open" | "converted" | "abandoned";
|
|
2604
|
-
createdAt: string | null;
|
|
2605
|
-
updatedAt: string | null;
|
|
2606
|
-
deletedAt: null;
|
|
2607
|
-
lineItems: {
|
|
2608
|
-
id: number;
|
|
2609
|
-
productId: number;
|
|
2610
|
-
variantId: number;
|
|
2611
|
-
qty: number;
|
|
2612
|
-
subtotal: number;
|
|
2613
|
-
discount: number;
|
|
2614
|
-
tax: number;
|
|
2615
|
-
shippingCharges: number;
|
|
2616
|
-
total: number;
|
|
2617
|
-
price: number;
|
|
2618
|
-
mrp: number;
|
|
2619
|
-
title: string;
|
|
2620
|
-
slug: string;
|
|
2621
|
-
sku: string;
|
|
2622
|
-
description: null;
|
|
2623
|
-
thumbnail: string | null;
|
|
2624
|
-
metadata: null;
|
|
2625
|
-
vendorId: null;
|
|
2626
|
-
weight: null;
|
|
2627
|
-
dimensionUnit: string;
|
|
2628
|
-
height: null;
|
|
2629
|
-
width: null;
|
|
2630
|
-
len: null;
|
|
2631
|
-
shippingWeight: null;
|
|
2632
|
-
shippingHeight: null;
|
|
2633
|
-
shippingLen: null;
|
|
2634
|
-
shippingWidth: null;
|
|
2635
|
-
isSelectedForCheckout: boolean;
|
|
2636
|
-
priceChanged: boolean;
|
|
2637
|
-
inStock: boolean;
|
|
2638
|
-
createdAt: null;
|
|
2639
|
-
product: {
|
|
2640
|
-
id: number;
|
|
2641
|
-
title: string;
|
|
2642
|
-
thumbnail: string | null;
|
|
2643
|
-
slug: string;
|
|
2644
|
-
sku: string;
|
|
2645
|
-
categories: {
|
|
2646
|
-
category: {
|
|
2647
|
-
id: number;
|
|
2648
|
-
name: string;
|
|
2649
|
-
slug: string;
|
|
2650
|
-
};
|
|
2651
|
-
}[];
|
|
2652
|
-
};
|
|
2653
|
-
variant: {
|
|
2654
|
-
id: number;
|
|
2655
|
-
price: number;
|
|
2656
|
-
mrp: number;
|
|
2657
|
-
weight: null;
|
|
2658
|
-
height: null;
|
|
2659
|
-
width: null;
|
|
2660
|
-
len: null;
|
|
2661
|
-
shippingWeight: null;
|
|
2662
|
-
shippingHeight: null;
|
|
2663
|
-
shippingLen: null;
|
|
2664
|
-
shippingWidth: null;
|
|
2665
|
-
sku: string;
|
|
2666
|
-
title: string;
|
|
2667
|
-
options: {
|
|
2668
|
-
id: string | number;
|
|
2669
|
-
optionId: number;
|
|
2670
|
-
value: string;
|
|
2671
|
-
variantId: number;
|
|
2672
|
-
}[];
|
|
2673
|
-
};
|
|
2674
|
-
}[];
|
|
2675
|
-
shippingAddress: Record<string, any> | null;
|
|
2676
|
-
billingAddress: Record<string, any> | null;
|
|
2677
|
-
}>;
|
|
2678
|
-
updateCart({ qty, cartId, lineId, productId, variantId }: {
|
|
2679
|
-
qty: number;
|
|
2680
|
-
cartId?: string | null;
|
|
2681
|
-
lineId?: string | number | null;
|
|
2682
|
-
productId?: string | number;
|
|
2683
|
-
variantId?: string | number;
|
|
2684
|
-
isSelectedForCheckout?: boolean;
|
|
2685
|
-
}): Promise<{
|
|
2686
|
-
id?: undefined;
|
|
2687
|
-
email?: undefined;
|
|
2688
|
-
phone?: undefined;
|
|
2689
|
-
name?: undefined;
|
|
2690
|
-
billingAddressId?: undefined;
|
|
2691
|
-
shippingAddressId?: undefined;
|
|
2692
|
-
regionId?: undefined;
|
|
2693
|
-
userId?: undefined;
|
|
2694
|
-
couponCode?: undefined;
|
|
2695
|
-
discountAmount?: undefined;
|
|
2696
|
-
couponAppliedDate?: undefined;
|
|
2697
|
-
needAddress?: undefined;
|
|
2698
|
-
isCodAvailable?: undefined;
|
|
2699
|
-
paymentId?: undefined;
|
|
2700
|
-
type?: undefined;
|
|
2701
|
-
completedAt?: undefined;
|
|
2702
|
-
paymentAuthorizedAt?: undefined;
|
|
2703
|
-
idempotencyKey?: undefined;
|
|
2704
|
-
salesChannelId?: undefined;
|
|
2705
|
-
qty?: undefined;
|
|
2706
|
-
shippingCharges?: undefined;
|
|
2707
|
-
paymentMethod?: undefined;
|
|
2708
|
-
shippingMethod?: undefined;
|
|
2709
|
-
subtotal?: undefined;
|
|
2710
|
-
codCharges?: undefined;
|
|
2711
|
-
tax?: undefined;
|
|
2712
|
-
total?: undefined;
|
|
2713
|
-
savingAmount?: undefined;
|
|
2714
|
-
userAuthToken?: undefined;
|
|
2715
|
-
currencyCode?: undefined;
|
|
2716
|
-
currencySymbol?: undefined;
|
|
2717
|
-
shippingRateId?: undefined;
|
|
2718
|
-
currencyDecimalDigits?: undefined;
|
|
2719
|
-
storeId?: undefined;
|
|
2720
|
-
status?: undefined;
|
|
2721
|
-
createdAt?: undefined;
|
|
2722
|
-
updatedAt?: undefined;
|
|
2723
|
-
deletedAt?: undefined;
|
|
2724
|
-
lineItems?: undefined;
|
|
2725
|
-
shippingAddress?: undefined;
|
|
2726
|
-
billingAddress?: undefined;
|
|
2727
|
-
} | {
|
|
2728
|
-
id: string;
|
|
2729
|
-
email: string | null;
|
|
2730
|
-
phone: any;
|
|
2731
|
-
name: string | null;
|
|
2732
|
-
billingAddressId: string | null;
|
|
2733
|
-
shippingAddressId: string | null;
|
|
2734
|
-
regionId: null;
|
|
2735
|
-
userId: null;
|
|
2736
|
-
couponCode: null;
|
|
2737
|
-
discountAmount: number;
|
|
2738
|
-
couponAppliedDate: null;
|
|
2739
|
-
needAddress: boolean;
|
|
2740
|
-
isCodAvailable: boolean;
|
|
2741
|
-
paymentId: null;
|
|
2742
|
-
type: null;
|
|
2743
|
-
completedAt: string | null;
|
|
2744
|
-
paymentAuthorizedAt: null;
|
|
2745
|
-
idempotencyKey: null;
|
|
2746
|
-
salesChannelId: null;
|
|
2747
|
-
qty: number;
|
|
2748
|
-
shippingCharges: number;
|
|
2749
|
-
paymentMethod: null;
|
|
2750
|
-
shippingMethod: null;
|
|
2751
|
-
subtotal: number;
|
|
2752
|
-
codCharges: number;
|
|
2753
|
-
tax: number;
|
|
2754
|
-
total: number;
|
|
2755
|
-
savingAmount: number;
|
|
2756
|
-
userAuthToken: null;
|
|
2757
|
-
currencyCode: any;
|
|
2758
|
-
currencySymbol: any;
|
|
2759
|
-
shippingRateId: null;
|
|
2760
|
-
currencyDecimalDigits: number;
|
|
2761
|
-
storeId: any;
|
|
2762
|
-
status: "open" | "converted" | "abandoned";
|
|
2763
|
-
createdAt: string | null;
|
|
2764
|
-
updatedAt: string | null;
|
|
2765
|
-
deletedAt: null;
|
|
2766
|
-
lineItems: {
|
|
2767
|
-
id: number;
|
|
2768
|
-
productId: number;
|
|
2769
|
-
variantId: number;
|
|
2770
|
-
qty: number;
|
|
2771
|
-
subtotal: number;
|
|
2772
|
-
discount: number;
|
|
2773
|
-
tax: number;
|
|
2774
|
-
shippingCharges: number;
|
|
2775
|
-
total: number;
|
|
2776
|
-
price: number;
|
|
2777
|
-
mrp: number;
|
|
2778
|
-
title: string;
|
|
2779
|
-
slug: string;
|
|
2780
|
-
sku: string;
|
|
2781
|
-
description: null;
|
|
2782
|
-
thumbnail: string | null;
|
|
2783
|
-
metadata: null;
|
|
2784
|
-
vendorId: null;
|
|
2785
|
-
weight: null;
|
|
2786
|
-
dimensionUnit: string;
|
|
2787
|
-
height: null;
|
|
2788
|
-
width: null;
|
|
2789
|
-
len: null;
|
|
2790
|
-
shippingWeight: null;
|
|
2791
|
-
shippingHeight: null;
|
|
2792
|
-
shippingLen: null;
|
|
2793
|
-
shippingWidth: null;
|
|
2794
|
-
isSelectedForCheckout: boolean;
|
|
2795
|
-
priceChanged: boolean;
|
|
2796
|
-
inStock: boolean;
|
|
2797
|
-
createdAt: null;
|
|
2798
|
-
product: {
|
|
2799
|
-
id: number;
|
|
2800
|
-
title: string;
|
|
2801
|
-
thumbnail: string | null;
|
|
2802
|
-
slug: string;
|
|
2803
|
-
sku: string;
|
|
2804
|
-
categories: {
|
|
2805
|
-
category: {
|
|
2806
|
-
id: number;
|
|
2807
|
-
name: string;
|
|
2808
|
-
slug: string;
|
|
2809
|
-
};
|
|
2810
|
-
}[];
|
|
2811
|
-
};
|
|
2812
|
-
variant: {
|
|
2813
|
-
id: number;
|
|
2814
|
-
price: number;
|
|
2815
|
-
mrp: number;
|
|
2816
|
-
weight: null;
|
|
2817
|
-
height: null;
|
|
2818
|
-
width: null;
|
|
2819
|
-
len: null;
|
|
2820
|
-
shippingWeight: null;
|
|
2821
|
-
shippingHeight: null;
|
|
2822
|
-
shippingLen: null;
|
|
2823
|
-
shippingWidth: null;
|
|
2824
|
-
sku: string;
|
|
2825
|
-
title: string;
|
|
2826
|
-
options: {
|
|
2827
|
-
id: string | number;
|
|
2828
|
-
optionId: number;
|
|
2829
|
-
value: string;
|
|
2830
|
-
variantId: number;
|
|
2831
|
-
}[];
|
|
2832
|
-
};
|
|
2833
|
-
}[];
|
|
2834
|
-
shippingAddress: Record<string, any> | null;
|
|
2835
|
-
billingAddress: Record<string, any> | null;
|
|
2836
|
-
}>;
|
|
2837
|
-
removeCart({ cartId, lineId }: {
|
|
2838
|
-
cartId?: string | null;
|
|
2839
|
-
lineId?: string | number | null;
|
|
2840
|
-
}): Promise<{
|
|
2841
|
-
id?: undefined;
|
|
2842
|
-
email?: undefined;
|
|
2843
|
-
phone?: undefined;
|
|
2844
|
-
name?: undefined;
|
|
2845
|
-
billingAddressId?: undefined;
|
|
2846
|
-
shippingAddressId?: undefined;
|
|
2847
|
-
regionId?: undefined;
|
|
2848
|
-
userId?: undefined;
|
|
2849
|
-
couponCode?: undefined;
|
|
2850
|
-
discountAmount?: undefined;
|
|
2851
|
-
couponAppliedDate?: undefined;
|
|
2852
|
-
needAddress?: undefined;
|
|
2853
|
-
isCodAvailable?: undefined;
|
|
2854
|
-
paymentId?: undefined;
|
|
2855
|
-
type?: undefined;
|
|
2856
|
-
completedAt?: undefined;
|
|
2857
|
-
paymentAuthorizedAt?: undefined;
|
|
2858
|
-
idempotencyKey?: undefined;
|
|
2859
|
-
salesChannelId?: undefined;
|
|
2860
|
-
qty?: undefined;
|
|
2861
|
-
shippingCharges?: undefined;
|
|
2862
|
-
paymentMethod?: undefined;
|
|
2863
|
-
shippingMethod?: undefined;
|
|
2864
|
-
subtotal?: undefined;
|
|
2865
|
-
codCharges?: undefined;
|
|
2866
|
-
tax?: undefined;
|
|
2867
|
-
total?: undefined;
|
|
2868
|
-
savingAmount?: undefined;
|
|
2869
|
-
userAuthToken?: undefined;
|
|
2870
|
-
currencyCode?: undefined;
|
|
2871
|
-
currencySymbol?: undefined;
|
|
2872
|
-
shippingRateId?: undefined;
|
|
2873
|
-
currencyDecimalDigits?: undefined;
|
|
2874
|
-
storeId?: undefined;
|
|
2875
|
-
status?: undefined;
|
|
2876
|
-
createdAt?: undefined;
|
|
2877
|
-
updatedAt?: undefined;
|
|
2878
|
-
deletedAt?: undefined;
|
|
2879
|
-
lineItems?: undefined;
|
|
2880
|
-
shippingAddress?: undefined;
|
|
2881
|
-
billingAddress?: undefined;
|
|
2882
|
-
} | {
|
|
2883
|
-
id: string;
|
|
2884
|
-
email: string | null;
|
|
2885
|
-
phone: any;
|
|
2886
|
-
name: string | null;
|
|
2887
|
-
billingAddressId: string | null;
|
|
2888
|
-
shippingAddressId: string | null;
|
|
2889
|
-
regionId: null;
|
|
2890
|
-
userId: null;
|
|
2891
|
-
couponCode: null;
|
|
2892
|
-
discountAmount: number;
|
|
2893
|
-
couponAppliedDate: null;
|
|
2894
|
-
needAddress: boolean;
|
|
2895
|
-
isCodAvailable: boolean;
|
|
2896
|
-
paymentId: null;
|
|
2897
|
-
type: null;
|
|
2898
|
-
completedAt: string | null;
|
|
2899
|
-
paymentAuthorizedAt: null;
|
|
2900
|
-
idempotencyKey: null;
|
|
2901
|
-
salesChannelId: null;
|
|
2902
|
-
qty: number;
|
|
2903
|
-
shippingCharges: number;
|
|
2904
|
-
paymentMethod: null;
|
|
2905
|
-
shippingMethod: null;
|
|
2906
|
-
subtotal: number;
|
|
2907
|
-
codCharges: number;
|
|
2908
|
-
tax: number;
|
|
2909
|
-
total: number;
|
|
2910
|
-
savingAmount: number;
|
|
2911
|
-
userAuthToken: null;
|
|
2912
|
-
currencyCode: any;
|
|
2913
|
-
currencySymbol: any;
|
|
2914
|
-
shippingRateId: null;
|
|
2915
|
-
currencyDecimalDigits: number;
|
|
2916
|
-
storeId: any;
|
|
2917
|
-
status: "open" | "converted" | "abandoned";
|
|
2918
|
-
createdAt: string | null;
|
|
2919
|
-
updatedAt: string | null;
|
|
2920
|
-
deletedAt: null;
|
|
2921
|
-
lineItems: {
|
|
2922
|
-
id: number;
|
|
2923
|
-
productId: number;
|
|
2924
|
-
variantId: number;
|
|
2925
|
-
qty: number;
|
|
2926
|
-
subtotal: number;
|
|
2927
|
-
discount: number;
|
|
2928
|
-
tax: number;
|
|
2929
|
-
shippingCharges: number;
|
|
2930
|
-
total: number;
|
|
2931
|
-
price: number;
|
|
2932
|
-
mrp: number;
|
|
2933
|
-
title: string;
|
|
2934
|
-
slug: string;
|
|
2935
|
-
sku: string;
|
|
2936
|
-
description: null;
|
|
2937
|
-
thumbnail: string | null;
|
|
2938
|
-
metadata: null;
|
|
2939
|
-
vendorId: null;
|
|
2940
|
-
weight: null;
|
|
2941
|
-
dimensionUnit: string;
|
|
2942
|
-
height: null;
|
|
2943
|
-
width: null;
|
|
2944
|
-
len: null;
|
|
2945
|
-
shippingWeight: null;
|
|
2946
|
-
shippingHeight: null;
|
|
2947
|
-
shippingLen: null;
|
|
2948
|
-
shippingWidth: null;
|
|
2949
|
-
isSelectedForCheckout: boolean;
|
|
2950
|
-
priceChanged: boolean;
|
|
2951
|
-
inStock: boolean;
|
|
2952
|
-
createdAt: null;
|
|
2953
|
-
product: {
|
|
2954
|
-
id: number;
|
|
2955
|
-
title: string;
|
|
2956
|
-
thumbnail: string | null;
|
|
2957
|
-
slug: string;
|
|
2958
|
-
sku: string;
|
|
2959
|
-
categories: {
|
|
2960
|
-
category: {
|
|
2961
|
-
id: number;
|
|
2962
|
-
name: string;
|
|
2963
|
-
slug: string;
|
|
2964
|
-
};
|
|
2965
|
-
}[];
|
|
2966
|
-
};
|
|
2967
|
-
variant: {
|
|
2968
|
-
id: number;
|
|
2969
|
-
price: number;
|
|
2970
|
-
mrp: number;
|
|
2971
|
-
weight: null;
|
|
2972
|
-
height: null;
|
|
2973
|
-
width: null;
|
|
2974
|
-
len: null;
|
|
2975
|
-
shippingWeight: null;
|
|
2976
|
-
shippingHeight: null;
|
|
2977
|
-
shippingLen: null;
|
|
2978
|
-
shippingWidth: null;
|
|
2979
|
-
sku: string;
|
|
2980
|
-
title: string;
|
|
2981
|
-
options: {
|
|
2982
|
-
id: string | number;
|
|
2983
|
-
optionId: number;
|
|
2984
|
-
value: string;
|
|
2985
|
-
variantId: number;
|
|
2986
|
-
}[];
|
|
2987
|
-
};
|
|
2988
|
-
}[];
|
|
2989
|
-
shippingAddress: Record<string, any> | null;
|
|
2990
|
-
billingAddress: Record<string, any> | null;
|
|
2991
|
-
}>;
|
|
2992
|
-
/**
|
|
2993
|
-
* The address step's write.
|
|
2994
|
-
*
|
|
2995
|
-
* GoCommerce has no endpoint that changes a cart after it is opened, and no address on it: these
|
|
2996
|
-
* fields are arguments to checkout. They are kept against this cart id in the browser and sent
|
|
2997
|
-
* when the order is placed — see checkout-details.ts. The email additionally seeds a cart that
|
|
2998
|
-
* has not been opened yet, which is the one moment GoCommerce does accept it.
|
|
2999
|
-
*/
|
|
3000
|
-
updateCart2({ cartId, email, phone, billingAddress, shippingAddress, isBillingAddressSameAsShipping }: {
|
|
3001
|
-
storeId?: string;
|
|
3002
|
-
cartId?: string | null;
|
|
3003
|
-
email?: string;
|
|
3004
|
-
phone?: string;
|
|
3005
|
-
customer_id?: string;
|
|
3006
|
-
billingAddress?: Record<string, any> | null;
|
|
3007
|
-
shippingAddress?: Record<string, any> | null;
|
|
3008
|
-
isBillingAddressSameAsShipping?: boolean;
|
|
3009
|
-
}): Promise<{
|
|
3010
|
-
id?: undefined;
|
|
3011
|
-
email?: undefined;
|
|
3012
|
-
phone?: undefined;
|
|
3013
|
-
name?: undefined;
|
|
3014
|
-
billingAddressId?: undefined;
|
|
3015
|
-
shippingAddressId?: undefined;
|
|
3016
|
-
regionId?: undefined;
|
|
3017
|
-
userId?: undefined;
|
|
3018
|
-
couponCode?: undefined;
|
|
3019
|
-
discountAmount?: undefined;
|
|
3020
|
-
couponAppliedDate?: undefined;
|
|
3021
|
-
needAddress?: undefined;
|
|
3022
|
-
isCodAvailable?: undefined;
|
|
3023
|
-
paymentId?: undefined;
|
|
3024
|
-
type?: undefined;
|
|
3025
|
-
completedAt?: undefined;
|
|
3026
|
-
paymentAuthorizedAt?: undefined;
|
|
3027
|
-
idempotencyKey?: undefined;
|
|
3028
|
-
salesChannelId?: undefined;
|
|
3029
|
-
qty?: undefined;
|
|
3030
|
-
shippingCharges?: undefined;
|
|
3031
|
-
paymentMethod?: undefined;
|
|
3032
|
-
shippingMethod?: undefined;
|
|
3033
|
-
subtotal?: undefined;
|
|
3034
|
-
codCharges?: undefined;
|
|
3035
|
-
tax?: undefined;
|
|
3036
|
-
total?: undefined;
|
|
3037
|
-
savingAmount?: undefined;
|
|
3038
|
-
userAuthToken?: undefined;
|
|
3039
|
-
currencyCode?: undefined;
|
|
3040
|
-
currencySymbol?: undefined;
|
|
3041
|
-
shippingRateId?: undefined;
|
|
3042
|
-
currencyDecimalDigits?: undefined;
|
|
3043
|
-
storeId?: undefined;
|
|
3044
|
-
status?: undefined;
|
|
3045
|
-
createdAt?: undefined;
|
|
3046
|
-
updatedAt?: undefined;
|
|
3047
|
-
deletedAt?: undefined;
|
|
3048
|
-
lineItems?: undefined;
|
|
3049
|
-
shippingAddress?: undefined;
|
|
3050
|
-
billingAddress?: undefined;
|
|
3051
|
-
} | {
|
|
3052
|
-
id: string;
|
|
3053
|
-
email: string | null;
|
|
3054
|
-
phone: any;
|
|
3055
|
-
name: string | null;
|
|
3056
|
-
billingAddressId: string | null;
|
|
3057
|
-
shippingAddressId: string | null;
|
|
3058
|
-
regionId: null;
|
|
3059
|
-
userId: null;
|
|
3060
|
-
couponCode: null;
|
|
3061
|
-
discountAmount: number;
|
|
3062
|
-
couponAppliedDate: null;
|
|
3063
|
-
needAddress: boolean;
|
|
3064
|
-
isCodAvailable: boolean;
|
|
3065
|
-
paymentId: null;
|
|
3066
|
-
type: null;
|
|
3067
|
-
completedAt: string | null;
|
|
3068
|
-
paymentAuthorizedAt: null;
|
|
3069
|
-
idempotencyKey: null;
|
|
3070
|
-
salesChannelId: null;
|
|
3071
|
-
qty: number;
|
|
3072
|
-
shippingCharges: number;
|
|
3073
|
-
paymentMethod: null;
|
|
3074
|
-
shippingMethod: null;
|
|
3075
|
-
subtotal: number;
|
|
3076
|
-
codCharges: number;
|
|
3077
|
-
tax: number;
|
|
3078
|
-
total: number;
|
|
3079
|
-
savingAmount: number;
|
|
3080
|
-
userAuthToken: null;
|
|
3081
|
-
currencyCode: any;
|
|
3082
|
-
currencySymbol: any;
|
|
3083
|
-
shippingRateId: null;
|
|
3084
|
-
currencyDecimalDigits: number;
|
|
3085
|
-
storeId: any;
|
|
3086
|
-
status: "open" | "converted" | "abandoned";
|
|
3087
|
-
createdAt: string | null;
|
|
3088
|
-
updatedAt: string | null;
|
|
3089
|
-
deletedAt: null;
|
|
3090
|
-
lineItems: {
|
|
3091
|
-
id: number;
|
|
3092
|
-
productId: number;
|
|
3093
|
-
variantId: number;
|
|
3094
|
-
qty: number;
|
|
3095
|
-
subtotal: number;
|
|
3096
|
-
discount: number;
|
|
3097
|
-
tax: number;
|
|
3098
|
-
shippingCharges: number;
|
|
3099
|
-
total: number;
|
|
3100
|
-
price: number;
|
|
3101
|
-
mrp: number;
|
|
3102
|
-
title: string;
|
|
3103
|
-
slug: string;
|
|
3104
|
-
sku: string;
|
|
3105
|
-
description: null;
|
|
3106
|
-
thumbnail: string | null;
|
|
3107
|
-
metadata: null;
|
|
3108
|
-
vendorId: null;
|
|
3109
|
-
weight: null;
|
|
3110
|
-
dimensionUnit: string;
|
|
3111
|
-
height: null;
|
|
3112
|
-
width: null;
|
|
3113
|
-
len: null;
|
|
3114
|
-
shippingWeight: null;
|
|
3115
|
-
shippingHeight: null;
|
|
3116
|
-
shippingLen: null;
|
|
3117
|
-
shippingWidth: null;
|
|
3118
|
-
isSelectedForCheckout: boolean;
|
|
3119
|
-
priceChanged: boolean;
|
|
3120
|
-
inStock: boolean;
|
|
3121
|
-
createdAt: null;
|
|
3122
|
-
product: {
|
|
3123
|
-
id: number;
|
|
3124
|
-
title: string;
|
|
3125
|
-
thumbnail: string | null;
|
|
3126
|
-
slug: string;
|
|
3127
|
-
sku: string;
|
|
3128
|
-
categories: {
|
|
3129
|
-
category: {
|
|
3130
|
-
id: number;
|
|
3131
|
-
name: string;
|
|
3132
|
-
slug: string;
|
|
3133
|
-
};
|
|
3134
|
-
}[];
|
|
3135
|
-
};
|
|
3136
|
-
variant: {
|
|
3137
|
-
id: number;
|
|
3138
|
-
price: number;
|
|
3139
|
-
mrp: number;
|
|
3140
|
-
weight: null;
|
|
3141
|
-
height: null;
|
|
3142
|
-
width: null;
|
|
3143
|
-
len: null;
|
|
3144
|
-
shippingWeight: null;
|
|
3145
|
-
shippingHeight: null;
|
|
3146
|
-
shippingLen: null;
|
|
3147
|
-
shippingWidth: null;
|
|
3148
|
-
sku: string;
|
|
3149
|
-
title: string;
|
|
3150
|
-
options: {
|
|
3151
|
-
id: string | number;
|
|
3152
|
-
optionId: number;
|
|
3153
|
-
value: string;
|
|
3154
|
-
variantId: number;
|
|
3155
|
-
}[];
|
|
3156
|
-
};
|
|
3157
|
-
}[];
|
|
3158
|
-
shippingAddress: Record<string, any> | null;
|
|
3159
|
-
billingAddress: Record<string, any> | null;
|
|
3160
|
-
}>;
|
|
3161
|
-
/** Nothing to reserve ahead of payment: `POST /api/checkout/{code}` is one transaction. */
|
|
3162
|
-
completeCart(cartId: string): Promise<{
|
|
3163
|
-
id?: undefined;
|
|
3164
|
-
email?: undefined;
|
|
3165
|
-
phone?: undefined;
|
|
3166
|
-
name?: undefined;
|
|
3167
|
-
billingAddressId?: undefined;
|
|
3168
|
-
shippingAddressId?: undefined;
|
|
3169
|
-
regionId?: undefined;
|
|
3170
|
-
userId?: undefined;
|
|
3171
|
-
couponCode?: undefined;
|
|
3172
|
-
discountAmount?: undefined;
|
|
3173
|
-
couponAppliedDate?: undefined;
|
|
3174
|
-
needAddress?: undefined;
|
|
3175
|
-
isCodAvailable?: undefined;
|
|
3176
|
-
paymentId?: undefined;
|
|
3177
|
-
type?: undefined;
|
|
3178
|
-
completedAt?: undefined;
|
|
3179
|
-
paymentAuthorizedAt?: undefined;
|
|
3180
|
-
idempotencyKey?: undefined;
|
|
3181
|
-
salesChannelId?: undefined;
|
|
3182
|
-
qty?: undefined;
|
|
3183
|
-
shippingCharges?: undefined;
|
|
3184
|
-
paymentMethod?: undefined;
|
|
3185
|
-
shippingMethod?: undefined;
|
|
3186
|
-
subtotal?: undefined;
|
|
3187
|
-
codCharges?: undefined;
|
|
3188
|
-
tax?: undefined;
|
|
3189
|
-
total?: undefined;
|
|
3190
|
-
savingAmount?: undefined;
|
|
3191
|
-
userAuthToken?: undefined;
|
|
3192
|
-
currencyCode?: undefined;
|
|
3193
|
-
currencySymbol?: undefined;
|
|
3194
|
-
shippingRateId?: undefined;
|
|
3195
|
-
currencyDecimalDigits?: undefined;
|
|
3196
|
-
storeId?: undefined;
|
|
3197
|
-
status?: undefined;
|
|
3198
|
-
createdAt?: undefined;
|
|
3199
|
-
updatedAt?: undefined;
|
|
3200
|
-
deletedAt?: undefined;
|
|
3201
|
-
lineItems?: undefined;
|
|
3202
|
-
shippingAddress?: undefined;
|
|
3203
|
-
billingAddress?: undefined;
|
|
3204
|
-
} | {
|
|
3205
|
-
id: string;
|
|
3206
|
-
email: string | null;
|
|
3207
|
-
phone: any;
|
|
3208
|
-
name: string | null;
|
|
3209
|
-
billingAddressId: string | null;
|
|
3210
|
-
shippingAddressId: string | null;
|
|
3211
|
-
regionId: null;
|
|
3212
|
-
userId: null;
|
|
3213
|
-
couponCode: null;
|
|
3214
|
-
discountAmount: number;
|
|
3215
|
-
couponAppliedDate: null;
|
|
3216
|
-
needAddress: boolean;
|
|
3217
|
-
isCodAvailable: boolean;
|
|
3218
|
-
paymentId: null;
|
|
3219
|
-
type: null;
|
|
3220
|
-
completedAt: string | null;
|
|
3221
|
-
paymentAuthorizedAt: null;
|
|
3222
|
-
idempotencyKey: null;
|
|
3223
|
-
salesChannelId: null;
|
|
3224
|
-
qty: number;
|
|
3225
|
-
shippingCharges: number;
|
|
3226
|
-
paymentMethod: null;
|
|
3227
|
-
shippingMethod: null;
|
|
3228
|
-
subtotal: number;
|
|
3229
|
-
codCharges: number;
|
|
3230
|
-
tax: number;
|
|
3231
|
-
total: number;
|
|
3232
|
-
savingAmount: number;
|
|
3233
|
-
userAuthToken: null;
|
|
3234
|
-
currencyCode: any;
|
|
3235
|
-
currencySymbol: any;
|
|
3236
|
-
shippingRateId: null;
|
|
3237
|
-
currencyDecimalDigits: number;
|
|
3238
|
-
storeId: any;
|
|
3239
|
-
status: "open" | "converted" | "abandoned";
|
|
3240
|
-
createdAt: string | null;
|
|
3241
|
-
updatedAt: string | null;
|
|
3242
|
-
deletedAt: null;
|
|
3243
|
-
lineItems: {
|
|
3244
|
-
id: number;
|
|
3245
|
-
productId: number;
|
|
3246
|
-
variantId: number;
|
|
3247
|
-
qty: number;
|
|
3248
|
-
subtotal: number;
|
|
3249
|
-
discount: number;
|
|
3250
|
-
tax: number;
|
|
3251
|
-
shippingCharges: number;
|
|
3252
|
-
total: number;
|
|
3253
|
-
price: number;
|
|
3254
|
-
mrp: number;
|
|
3255
|
-
title: string;
|
|
3256
|
-
slug: string;
|
|
3257
|
-
sku: string;
|
|
3258
|
-
description: null;
|
|
3259
|
-
thumbnail: string | null;
|
|
3260
|
-
metadata: null;
|
|
3261
|
-
vendorId: null;
|
|
3262
|
-
weight: null;
|
|
3263
|
-
dimensionUnit: string;
|
|
3264
|
-
height: null;
|
|
3265
|
-
width: null;
|
|
3266
|
-
len: null;
|
|
3267
|
-
shippingWeight: null;
|
|
3268
|
-
shippingHeight: null;
|
|
3269
|
-
shippingLen: null;
|
|
3270
|
-
shippingWidth: null;
|
|
3271
|
-
isSelectedForCheckout: boolean;
|
|
3272
|
-
priceChanged: boolean;
|
|
3273
|
-
inStock: boolean;
|
|
3274
|
-
createdAt: null;
|
|
3275
|
-
product: {
|
|
3276
|
-
id: number;
|
|
3277
|
-
title: string;
|
|
3278
|
-
thumbnail: string | null;
|
|
3279
|
-
slug: string;
|
|
3280
|
-
sku: string;
|
|
3281
|
-
categories: {
|
|
3282
|
-
category: {
|
|
3283
|
-
id: number;
|
|
3284
|
-
name: string;
|
|
3285
|
-
slug: string;
|
|
3286
|
-
};
|
|
3287
|
-
}[];
|
|
3288
|
-
};
|
|
3289
|
-
variant: {
|
|
3290
|
-
id: number;
|
|
3291
|
-
price: number;
|
|
3292
|
-
mrp: number;
|
|
3293
|
-
weight: null;
|
|
3294
|
-
height: null;
|
|
3295
|
-
width: null;
|
|
3296
|
-
len: null;
|
|
3297
|
-
shippingWeight: null;
|
|
3298
|
-
shippingHeight: null;
|
|
3299
|
-
shippingLen: null;
|
|
3300
|
-
shippingWidth: null;
|
|
3301
|
-
sku: string;
|
|
3302
|
-
title: string;
|
|
3303
|
-
options: {
|
|
3304
|
-
id: string | number;
|
|
3305
|
-
optionId: number;
|
|
3306
|
-
value: string;
|
|
3307
|
-
variantId: number;
|
|
3308
|
-
}[];
|
|
3309
|
-
};
|
|
3310
|
-
}[];
|
|
3311
|
-
shippingAddress: Record<string, any> | null;
|
|
3312
|
-
billingAddress: Record<string, any> | null;
|
|
3313
|
-
}>;
|
|
3314
|
-
/** Remembered so the payment step can re-select it; GoCommerce takes the code at checkout. */
|
|
3315
|
-
updateCartPaymentMethod({ cartId, paymentMethod }: {
|
|
3316
|
-
cartId?: string | null;
|
|
3317
|
-
paymentMethod?: string;
|
|
3318
|
-
}): Promise<Record<string, unknown>>;
|
|
3319
|
-
applyCoupon(_params: {
|
|
3320
|
-
cartId?: string | null;
|
|
3321
|
-
couponCode?: string;
|
|
3322
|
-
}): Promise<never>;
|
|
3323
|
-
removeCoupon(): Promise<{
|
|
3324
|
-
id?: undefined;
|
|
3325
|
-
email?: undefined;
|
|
3326
|
-
phone?: undefined;
|
|
3327
|
-
name?: undefined;
|
|
3328
|
-
billingAddressId?: undefined;
|
|
3329
|
-
shippingAddressId?: undefined;
|
|
3330
|
-
regionId?: undefined;
|
|
3331
|
-
userId?: undefined;
|
|
3332
|
-
couponCode?: undefined;
|
|
3333
|
-
discountAmount?: undefined;
|
|
3334
|
-
couponAppliedDate?: undefined;
|
|
3335
|
-
needAddress?: undefined;
|
|
3336
|
-
isCodAvailable?: undefined;
|
|
3337
|
-
paymentId?: undefined;
|
|
3338
|
-
type?: undefined;
|
|
3339
|
-
completedAt?: undefined;
|
|
3340
|
-
paymentAuthorizedAt?: undefined;
|
|
3341
|
-
idempotencyKey?: undefined;
|
|
3342
|
-
salesChannelId?: undefined;
|
|
3343
|
-
qty?: undefined;
|
|
3344
|
-
shippingCharges?: undefined;
|
|
3345
|
-
paymentMethod?: undefined;
|
|
3346
|
-
shippingMethod?: undefined;
|
|
3347
|
-
subtotal?: undefined;
|
|
3348
|
-
codCharges?: undefined;
|
|
3349
|
-
tax?: undefined;
|
|
3350
|
-
total?: undefined;
|
|
3351
|
-
savingAmount?: undefined;
|
|
3352
|
-
userAuthToken?: undefined;
|
|
3353
|
-
currencyCode?: undefined;
|
|
3354
|
-
currencySymbol?: undefined;
|
|
3355
|
-
shippingRateId?: undefined;
|
|
3356
|
-
currencyDecimalDigits?: undefined;
|
|
3357
|
-
storeId?: undefined;
|
|
3358
|
-
status?: undefined;
|
|
3359
|
-
createdAt?: undefined;
|
|
3360
|
-
updatedAt?: undefined;
|
|
3361
|
-
deletedAt?: undefined;
|
|
3362
|
-
lineItems?: undefined;
|
|
3363
|
-
shippingAddress?: undefined;
|
|
3364
|
-
billingAddress?: undefined;
|
|
3365
|
-
} | {
|
|
3366
|
-
id: string;
|
|
3367
|
-
email: string | null;
|
|
3368
|
-
phone: any;
|
|
3369
|
-
name: string | null;
|
|
3370
|
-
billingAddressId: string | null;
|
|
3371
|
-
shippingAddressId: string | null;
|
|
3372
|
-
regionId: null;
|
|
3373
|
-
userId: null;
|
|
3374
|
-
couponCode: null;
|
|
3375
|
-
discountAmount: number;
|
|
3376
|
-
couponAppliedDate: null;
|
|
3377
|
-
needAddress: boolean;
|
|
3378
|
-
isCodAvailable: boolean;
|
|
3379
|
-
paymentId: null;
|
|
3380
|
-
type: null;
|
|
3381
|
-
completedAt: string | null;
|
|
3382
|
-
paymentAuthorizedAt: null;
|
|
3383
|
-
idempotencyKey: null;
|
|
3384
|
-
salesChannelId: null;
|
|
3385
|
-
qty: number;
|
|
3386
|
-
shippingCharges: number;
|
|
3387
|
-
paymentMethod: null;
|
|
3388
|
-
shippingMethod: null;
|
|
3389
|
-
subtotal: number;
|
|
3390
|
-
codCharges: number;
|
|
3391
|
-
tax: number;
|
|
3392
|
-
total: number;
|
|
3393
|
-
savingAmount: number;
|
|
3394
|
-
userAuthToken: null;
|
|
3395
|
-
currencyCode: any;
|
|
3396
|
-
currencySymbol: any;
|
|
3397
|
-
shippingRateId: null;
|
|
3398
|
-
currencyDecimalDigits: number;
|
|
3399
|
-
storeId: any;
|
|
3400
|
-
status: "open" | "converted" | "abandoned";
|
|
3401
|
-
createdAt: string | null;
|
|
3402
|
-
updatedAt: string | null;
|
|
3403
|
-
deletedAt: null;
|
|
3404
|
-
lineItems: {
|
|
3405
|
-
id: number;
|
|
3406
|
-
productId: number;
|
|
3407
|
-
variantId: number;
|
|
3408
|
-
qty: number;
|
|
3409
|
-
subtotal: number;
|
|
3410
|
-
discount: number;
|
|
3411
|
-
tax: number;
|
|
3412
|
-
shippingCharges: number;
|
|
3413
|
-
total: number;
|
|
3414
|
-
price: number;
|
|
3415
|
-
mrp: number;
|
|
3416
|
-
title: string;
|
|
3417
|
-
slug: string;
|
|
3418
|
-
sku: string;
|
|
3419
|
-
description: null;
|
|
3420
|
-
thumbnail: string | null;
|
|
3421
|
-
metadata: null;
|
|
3422
|
-
vendorId: null;
|
|
3423
|
-
weight: null;
|
|
3424
|
-
dimensionUnit: string;
|
|
3425
|
-
height: null;
|
|
3426
|
-
width: null;
|
|
3427
|
-
len: null;
|
|
3428
|
-
shippingWeight: null;
|
|
3429
|
-
shippingHeight: null;
|
|
3430
|
-
shippingLen: null;
|
|
3431
|
-
shippingWidth: null;
|
|
3432
|
-
isSelectedForCheckout: boolean;
|
|
3433
|
-
priceChanged: boolean;
|
|
3434
|
-
inStock: boolean;
|
|
3435
|
-
createdAt: null;
|
|
3436
|
-
product: {
|
|
3437
|
-
id: number;
|
|
3438
|
-
title: string;
|
|
3439
|
-
thumbnail: string | null;
|
|
3440
|
-
slug: string;
|
|
3441
|
-
sku: string;
|
|
3442
|
-
categories: {
|
|
3443
|
-
category: {
|
|
3444
|
-
id: number;
|
|
3445
|
-
name: string;
|
|
3446
|
-
slug: string;
|
|
3447
|
-
};
|
|
3448
|
-
}[];
|
|
3449
|
-
};
|
|
3450
|
-
variant: {
|
|
3451
|
-
id: number;
|
|
3452
|
-
price: number;
|
|
3453
|
-
mrp: number;
|
|
3454
|
-
weight: null;
|
|
3455
|
-
height: null;
|
|
3456
|
-
width: null;
|
|
3457
|
-
len: null;
|
|
3458
|
-
shippingWeight: null;
|
|
3459
|
-
shippingHeight: null;
|
|
3460
|
-
shippingLen: null;
|
|
3461
|
-
shippingWidth: null;
|
|
3462
|
-
sku: string;
|
|
3463
|
-
title: string;
|
|
3464
|
-
options: {
|
|
3465
|
-
id: string | number;
|
|
3466
|
-
optionId: number;
|
|
3467
|
-
value: string;
|
|
3468
|
-
variantId: number;
|
|
3469
|
-
}[];
|
|
3470
|
-
};
|
|
3471
|
-
}[];
|
|
3472
|
-
shippingAddress: Record<string, any> | null;
|
|
3473
|
-
billingAddress: Record<string, any> | null;
|
|
3474
|
-
}>;
|
|
3475
|
-
/** Shipping is priced by the store at checkout; there are no rates for a shopper to choose. */
|
|
3476
|
-
updateShippingRate({ cartId }: {
|
|
3477
|
-
cartId?: string | null;
|
|
3478
|
-
shippingRateId?: string;
|
|
3479
|
-
}): Promise<{
|
|
3480
|
-
id?: undefined;
|
|
3481
|
-
email?: undefined;
|
|
3482
|
-
phone?: undefined;
|
|
3483
|
-
name?: undefined;
|
|
3484
|
-
billingAddressId?: undefined;
|
|
3485
|
-
shippingAddressId?: undefined;
|
|
3486
|
-
regionId?: undefined;
|
|
3487
|
-
userId?: undefined;
|
|
3488
|
-
couponCode?: undefined;
|
|
3489
|
-
discountAmount?: undefined;
|
|
3490
|
-
couponAppliedDate?: undefined;
|
|
3491
|
-
needAddress?: undefined;
|
|
3492
|
-
isCodAvailable?: undefined;
|
|
3493
|
-
paymentId?: undefined;
|
|
3494
|
-
type?: undefined;
|
|
3495
|
-
completedAt?: undefined;
|
|
3496
|
-
paymentAuthorizedAt?: undefined;
|
|
3497
|
-
idempotencyKey?: undefined;
|
|
3498
|
-
salesChannelId?: undefined;
|
|
3499
|
-
qty?: undefined;
|
|
3500
|
-
shippingCharges?: undefined;
|
|
3501
|
-
paymentMethod?: undefined;
|
|
3502
|
-
shippingMethod?: undefined;
|
|
3503
|
-
subtotal?: undefined;
|
|
3504
|
-
codCharges?: undefined;
|
|
3505
|
-
tax?: undefined;
|
|
3506
|
-
total?: undefined;
|
|
3507
|
-
savingAmount?: undefined;
|
|
3508
|
-
userAuthToken?: undefined;
|
|
3509
|
-
currencyCode?: undefined;
|
|
3510
|
-
currencySymbol?: undefined;
|
|
3511
|
-
shippingRateId?: undefined;
|
|
3512
|
-
currencyDecimalDigits?: undefined;
|
|
3513
|
-
storeId?: undefined;
|
|
3514
|
-
status?: undefined;
|
|
3515
|
-
createdAt?: undefined;
|
|
3516
|
-
updatedAt?: undefined;
|
|
3517
|
-
deletedAt?: undefined;
|
|
3518
|
-
lineItems?: undefined;
|
|
3519
|
-
shippingAddress?: undefined;
|
|
3520
|
-
billingAddress?: undefined;
|
|
3521
|
-
} | {
|
|
3522
|
-
id: string;
|
|
3523
|
-
email: string | null;
|
|
3524
|
-
phone: any;
|
|
3525
|
-
name: string | null;
|
|
3526
|
-
billingAddressId: string | null;
|
|
3527
|
-
shippingAddressId: string | null;
|
|
3528
|
-
regionId: null;
|
|
3529
|
-
userId: null;
|
|
3530
|
-
couponCode: null;
|
|
3531
|
-
discountAmount: number;
|
|
3532
|
-
couponAppliedDate: null;
|
|
3533
|
-
needAddress: boolean;
|
|
3534
|
-
isCodAvailable: boolean;
|
|
3535
|
-
paymentId: null;
|
|
3536
|
-
type: null;
|
|
3537
|
-
completedAt: string | null;
|
|
3538
|
-
paymentAuthorizedAt: null;
|
|
3539
|
-
idempotencyKey: null;
|
|
3540
|
-
salesChannelId: null;
|
|
3541
|
-
qty: number;
|
|
3542
|
-
shippingCharges: number;
|
|
3543
|
-
paymentMethod: null;
|
|
3544
|
-
shippingMethod: null;
|
|
3545
|
-
subtotal: number;
|
|
3546
|
-
codCharges: number;
|
|
3547
|
-
tax: number;
|
|
3548
|
-
total: number;
|
|
3549
|
-
savingAmount: number;
|
|
3550
|
-
userAuthToken: null;
|
|
3551
|
-
currencyCode: any;
|
|
3552
|
-
currencySymbol: any;
|
|
3553
|
-
shippingRateId: null;
|
|
3554
|
-
currencyDecimalDigits: number;
|
|
3555
|
-
storeId: any;
|
|
3556
|
-
status: "open" | "converted" | "abandoned";
|
|
3557
|
-
createdAt: string | null;
|
|
3558
|
-
updatedAt: string | null;
|
|
3559
|
-
deletedAt: null;
|
|
3560
|
-
lineItems: {
|
|
3561
|
-
id: number;
|
|
3562
|
-
productId: number;
|
|
3563
|
-
variantId: number;
|
|
3564
|
-
qty: number;
|
|
3565
|
-
subtotal: number;
|
|
3566
|
-
discount: number;
|
|
3567
|
-
tax: number;
|
|
3568
|
-
shippingCharges: number;
|
|
3569
|
-
total: number;
|
|
3570
|
-
price: number;
|
|
3571
|
-
mrp: number;
|
|
3572
|
-
title: string;
|
|
3573
|
-
slug: string;
|
|
3574
|
-
sku: string;
|
|
3575
|
-
description: null;
|
|
3576
|
-
thumbnail: string | null;
|
|
3577
|
-
metadata: null;
|
|
3578
|
-
vendorId: null;
|
|
3579
|
-
weight: null;
|
|
3580
|
-
dimensionUnit: string;
|
|
3581
|
-
height: null;
|
|
3582
|
-
width: null;
|
|
3583
|
-
len: null;
|
|
3584
|
-
shippingWeight: null;
|
|
3585
|
-
shippingHeight: null;
|
|
3586
|
-
shippingLen: null;
|
|
3587
|
-
shippingWidth: null;
|
|
3588
|
-
isSelectedForCheckout: boolean;
|
|
3589
|
-
priceChanged: boolean;
|
|
3590
|
-
inStock: boolean;
|
|
3591
|
-
createdAt: null;
|
|
3592
|
-
product: {
|
|
3593
|
-
id: number;
|
|
3594
|
-
title: string;
|
|
3595
|
-
thumbnail: string | null;
|
|
3596
|
-
slug: string;
|
|
3597
|
-
sku: string;
|
|
3598
|
-
categories: {
|
|
3599
|
-
category: {
|
|
3600
|
-
id: number;
|
|
3601
|
-
name: string;
|
|
3602
|
-
slug: string;
|
|
3603
|
-
};
|
|
3604
|
-
}[];
|
|
3605
|
-
};
|
|
3606
|
-
variant: {
|
|
3607
|
-
id: number;
|
|
3608
|
-
price: number;
|
|
3609
|
-
mrp: number;
|
|
3610
|
-
weight: null;
|
|
3611
|
-
height: null;
|
|
3612
|
-
width: null;
|
|
3613
|
-
len: null;
|
|
3614
|
-
shippingWeight: null;
|
|
3615
|
-
shippingHeight: null;
|
|
3616
|
-
shippingLen: null;
|
|
3617
|
-
shippingWidth: null;
|
|
3618
|
-
sku: string;
|
|
3619
|
-
title: string;
|
|
3620
|
-
options: {
|
|
3621
|
-
id: string | number;
|
|
3622
|
-
optionId: number;
|
|
3623
|
-
value: string;
|
|
3624
|
-
variantId: number;
|
|
3625
|
-
}[];
|
|
3626
|
-
};
|
|
3627
|
-
}[];
|
|
3628
|
-
shippingAddress: Record<string, any> | null;
|
|
3629
|
-
billingAddress: Record<string, any> | null;
|
|
3630
|
-
}>;
|
|
3631
|
-
}
|
|
3632
|
-
declare const cartService: CartService;
|
|
3633
|
-
|
|
3634
|
-
declare class PaymentMethodService extends BaseService {
|
|
3635
|
-
private static instance;
|
|
3636
|
-
static getInstance(): PaymentMethodService;
|
|
3637
|
-
/**
|
|
3638
|
-
* What this store accepts, from `GET /api/checkout`.
|
|
3639
|
-
*
|
|
3640
|
-
* The storefront branches on an uppercase code (`COD`, `STRIPE`, …) while GoCommerce installs
|
|
3641
|
-
* them lowercase, so the code is uppercased for the UI and the original kept for the API call.
|
|
3642
|
-
*/
|
|
3643
|
-
list(_params?: {
|
|
3644
|
-
page?: number;
|
|
3645
|
-
q?: string;
|
|
3646
|
-
sort?: string;
|
|
3647
|
-
}): Promise<{
|
|
3648
|
-
data: {
|
|
3649
|
-
id: string;
|
|
3650
|
-
code: string;
|
|
3651
|
-
name: string;
|
|
3652
|
-
description: string;
|
|
3653
|
-
active: boolean;
|
|
3654
|
-
isTest: boolean;
|
|
3655
|
-
img: null;
|
|
3656
|
-
rank: number;
|
|
3657
|
-
currency: string | null;
|
|
3658
|
-
}[];
|
|
3659
|
-
count: number;
|
|
3660
|
-
pageSize: number;
|
|
3661
|
-
noOfPage: number;
|
|
3662
|
-
page: number;
|
|
3663
|
-
}>;
|
|
3664
|
-
}
|
|
3665
|
-
declare const paymentMethodService: PaymentMethodService;
|
|
3666
|
-
declare class CheckoutService extends BaseService {
|
|
3667
|
-
private static instance;
|
|
3668
|
-
static getInstance(): CheckoutService;
|
|
3669
|
-
/**
|
|
3670
|
-
* Places the order.
|
|
3671
|
-
*
|
|
3672
|
-
* Everything the API requires and the cart cannot hold — email, name, phone, delivery address —
|
|
3673
|
-
* comes from what the address step recorded against this cart. Missing pieces are named in the
|
|
3674
|
-
* error rather than sent as blanks, because GoCommerce's own validation message ("address.line1
|
|
3675
|
-
* is required") does not tell a shopper which screen to go back to.
|
|
3676
|
-
*/
|
|
3677
|
-
private place;
|
|
3678
|
-
checkoutCOD({ cartId, origin }: {
|
|
3679
|
-
cartId?: string | null;
|
|
3680
|
-
origin?: string;
|
|
3681
|
-
}): Promise<{
|
|
3682
|
-
order_no: string;
|
|
3683
|
-
orderNo: string;
|
|
3684
|
-
code: string;
|
|
3685
|
-
payment: GcPaymentIntent | null;
|
|
3686
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
3687
|
-
id?: number | undefined;
|
|
3688
|
-
parentOrderNo?: string | undefined;
|
|
3689
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
3690
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
3691
|
-
paymentMethod?: string | null | undefined;
|
|
3692
|
-
createdAt?: string | null | undefined;
|
|
3693
|
-
updatedAt?: string | null | undefined;
|
|
3694
|
-
userEmail?: string | undefined;
|
|
3695
|
-
phone?: string | undefined;
|
|
3696
|
-
subtotal?: number | undefined;
|
|
3697
|
-
shippingCharges?: number | undefined;
|
|
3698
|
-
discount?: number | undefined;
|
|
3699
|
-
total?: number | undefined;
|
|
3700
|
-
currencyCode?: string | undefined;
|
|
3701
|
-
currencyDecimalDigits?: number | undefined;
|
|
3702
|
-
shippingRate?: null | undefined;
|
|
3703
|
-
fulfillments?: {
|
|
3704
|
-
id: number;
|
|
3705
|
-
status: string;
|
|
3706
|
-
provider: string;
|
|
3707
|
-
trackingNumber: string;
|
|
3708
|
-
labelUrl: string;
|
|
3709
|
-
createdAt: string | null;
|
|
3710
|
-
}[] | undefined;
|
|
3711
|
-
shippingAddress?: {
|
|
3712
|
-
id: null;
|
|
3713
|
-
firstName: string;
|
|
3714
|
-
lastName: string;
|
|
3715
|
-
email: string | null;
|
|
3716
|
-
phone: string;
|
|
3717
|
-
address_1: string;
|
|
3718
|
-
address_2: string;
|
|
3719
|
-
city: string;
|
|
3720
|
-
state: string;
|
|
3721
|
-
zip: string;
|
|
3722
|
-
country: string;
|
|
3723
|
-
countryCode: string;
|
|
3724
|
-
isPrimary: boolean;
|
|
3725
|
-
isResidential: boolean;
|
|
3726
|
-
deliveryInstructions: null;
|
|
3727
|
-
} | null | undefined;
|
|
3728
|
-
billingAddress?: {
|
|
3729
|
-
id: null;
|
|
3730
|
-
firstName: string;
|
|
3731
|
-
lastName: string;
|
|
3732
|
-
email: string | null;
|
|
3733
|
-
phone: string;
|
|
3734
|
-
address_1: string;
|
|
3735
|
-
address_2: string;
|
|
3736
|
-
city: string;
|
|
3737
|
-
state: string;
|
|
3738
|
-
zip: string;
|
|
3739
|
-
country: string;
|
|
3740
|
-
countryCode: string;
|
|
3741
|
-
isPrimary: boolean;
|
|
3742
|
-
isResidential: boolean;
|
|
3743
|
-
deliveryInstructions: null;
|
|
3744
|
-
} | null | undefined;
|
|
3745
|
-
lineItems?: {
|
|
3746
|
-
id: number;
|
|
3747
|
-
productId: number | null;
|
|
3748
|
-
variantId: number | null;
|
|
3749
|
-
title: string;
|
|
3750
|
-
variantTitle: string;
|
|
3751
|
-
slug: string;
|
|
3752
|
-
sku: string;
|
|
3753
|
-
thumbnail: string | null;
|
|
3754
|
-
qty: number;
|
|
3755
|
-
price: number;
|
|
3756
|
-
subtotal: number;
|
|
3757
|
-
total: number;
|
|
3758
|
-
}[] | undefined;
|
|
3759
|
-
}>;
|
|
3760
|
-
checkoutPOS({ cartId, origin }: {
|
|
3761
|
-
cartId?: string | null;
|
|
3762
|
-
origin?: string;
|
|
3763
|
-
}): Promise<{
|
|
3764
|
-
order_no: string;
|
|
3765
|
-
orderNo: string;
|
|
3766
|
-
code: string;
|
|
3767
|
-
payment: GcPaymentIntent | null;
|
|
3768
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
3769
|
-
id?: number | undefined;
|
|
3770
|
-
parentOrderNo?: string | undefined;
|
|
3771
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
3772
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
3773
|
-
paymentMethod?: string | null | undefined;
|
|
3774
|
-
createdAt?: string | null | undefined;
|
|
3775
|
-
updatedAt?: string | null | undefined;
|
|
3776
|
-
userEmail?: string | undefined;
|
|
3777
|
-
phone?: string | undefined;
|
|
3778
|
-
subtotal?: number | undefined;
|
|
3779
|
-
shippingCharges?: number | undefined;
|
|
3780
|
-
discount?: number | undefined;
|
|
3781
|
-
total?: number | undefined;
|
|
3782
|
-
currencyCode?: string | undefined;
|
|
3783
|
-
currencyDecimalDigits?: number | undefined;
|
|
3784
|
-
shippingRate?: null | undefined;
|
|
3785
|
-
fulfillments?: {
|
|
3786
|
-
id: number;
|
|
3787
|
-
status: string;
|
|
3788
|
-
provider: string;
|
|
3789
|
-
trackingNumber: string;
|
|
3790
|
-
labelUrl: string;
|
|
3791
|
-
createdAt: string | null;
|
|
3792
|
-
}[] | undefined;
|
|
3793
|
-
shippingAddress?: {
|
|
3794
|
-
id: null;
|
|
3795
|
-
firstName: string;
|
|
3796
|
-
lastName: string;
|
|
3797
|
-
email: string | null;
|
|
3798
|
-
phone: string;
|
|
3799
|
-
address_1: string;
|
|
3800
|
-
address_2: string;
|
|
3801
|
-
city: string;
|
|
3802
|
-
state: string;
|
|
3803
|
-
zip: string;
|
|
3804
|
-
country: string;
|
|
3805
|
-
countryCode: string;
|
|
3806
|
-
isPrimary: boolean;
|
|
3807
|
-
isResidential: boolean;
|
|
3808
|
-
deliveryInstructions: null;
|
|
3809
|
-
} | null | undefined;
|
|
3810
|
-
billingAddress?: {
|
|
3811
|
-
id: null;
|
|
3812
|
-
firstName: string;
|
|
3813
|
-
lastName: string;
|
|
3814
|
-
email: string | null;
|
|
3815
|
-
phone: string;
|
|
3816
|
-
address_1: string;
|
|
3817
|
-
address_2: string;
|
|
3818
|
-
city: string;
|
|
3819
|
-
state: string;
|
|
3820
|
-
zip: string;
|
|
3821
|
-
country: string;
|
|
3822
|
-
countryCode: string;
|
|
3823
|
-
isPrimary: boolean;
|
|
3824
|
-
isResidential: boolean;
|
|
3825
|
-
deliveryInstructions: null;
|
|
3826
|
-
} | null | undefined;
|
|
3827
|
-
lineItems?: {
|
|
3828
|
-
id: number;
|
|
3829
|
-
productId: number | null;
|
|
3830
|
-
variantId: number | null;
|
|
3831
|
-
title: string;
|
|
3832
|
-
variantTitle: string;
|
|
3833
|
-
slug: string;
|
|
3834
|
-
sku: string;
|
|
3835
|
-
thumbnail: string | null;
|
|
3836
|
-
qty: number;
|
|
3837
|
-
price: number;
|
|
3838
|
-
subtotal: number;
|
|
3839
|
-
total: number;
|
|
3840
|
-
}[] | undefined;
|
|
3841
|
-
}>;
|
|
3842
|
-
checkoutRazorpay({ cartId, origin }: {
|
|
3843
|
-
cartId?: string | null;
|
|
3844
|
-
origin?: string;
|
|
3845
|
-
}): Promise<{
|
|
3846
|
-
order_no: string;
|
|
3847
|
-
orderNo: string;
|
|
3848
|
-
code: string;
|
|
3849
|
-
payment: GcPaymentIntent | null;
|
|
3850
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
3851
|
-
id?: number | undefined;
|
|
3852
|
-
parentOrderNo?: string | undefined;
|
|
3853
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
3854
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
3855
|
-
paymentMethod?: string | null | undefined;
|
|
3856
|
-
createdAt?: string | null | undefined;
|
|
3857
|
-
updatedAt?: string | null | undefined;
|
|
3858
|
-
userEmail?: string | undefined;
|
|
3859
|
-
phone?: string | undefined;
|
|
3860
|
-
subtotal?: number | undefined;
|
|
3861
|
-
shippingCharges?: number | undefined;
|
|
3862
|
-
discount?: number | undefined;
|
|
3863
|
-
total?: number | undefined;
|
|
3864
|
-
currencyCode?: string | undefined;
|
|
3865
|
-
currencyDecimalDigits?: number | undefined;
|
|
3866
|
-
shippingRate?: null | undefined;
|
|
3867
|
-
fulfillments?: {
|
|
3868
|
-
id: number;
|
|
3869
|
-
status: string;
|
|
3870
|
-
provider: string;
|
|
3871
|
-
trackingNumber: string;
|
|
3872
|
-
labelUrl: string;
|
|
3873
|
-
createdAt: string | null;
|
|
3874
|
-
}[] | undefined;
|
|
3875
|
-
shippingAddress?: {
|
|
3876
|
-
id: null;
|
|
3877
|
-
firstName: string;
|
|
3878
|
-
lastName: string;
|
|
3879
|
-
email: string | null;
|
|
3880
|
-
phone: string;
|
|
3881
|
-
address_1: string;
|
|
3882
|
-
address_2: string;
|
|
3883
|
-
city: string;
|
|
3884
|
-
state: string;
|
|
3885
|
-
zip: string;
|
|
3886
|
-
country: string;
|
|
3887
|
-
countryCode: string;
|
|
3888
|
-
isPrimary: boolean;
|
|
3889
|
-
isResidential: boolean;
|
|
3890
|
-
deliveryInstructions: null;
|
|
3891
|
-
} | null | undefined;
|
|
3892
|
-
billingAddress?: {
|
|
3893
|
-
id: null;
|
|
3894
|
-
firstName: string;
|
|
3895
|
-
lastName: string;
|
|
3896
|
-
email: string | null;
|
|
3897
|
-
phone: string;
|
|
3898
|
-
address_1: string;
|
|
3899
|
-
address_2: string;
|
|
3900
|
-
city: string;
|
|
3901
|
-
state: string;
|
|
3902
|
-
zip: string;
|
|
3903
|
-
country: string;
|
|
3904
|
-
countryCode: string;
|
|
3905
|
-
isPrimary: boolean;
|
|
3906
|
-
isResidential: boolean;
|
|
3907
|
-
deliveryInstructions: null;
|
|
3908
|
-
} | null | undefined;
|
|
3909
|
-
lineItems?: {
|
|
3910
|
-
id: number;
|
|
3911
|
-
productId: number | null;
|
|
3912
|
-
variantId: number | null;
|
|
3913
|
-
title: string;
|
|
3914
|
-
variantTitle: string;
|
|
3915
|
-
slug: string;
|
|
3916
|
-
sku: string;
|
|
3917
|
-
thumbnail: string | null;
|
|
3918
|
-
qty: number;
|
|
3919
|
-
price: number;
|
|
3920
|
-
subtotal: number;
|
|
3921
|
-
total: number;
|
|
3922
|
-
}[] | undefined;
|
|
3923
|
-
}>;
|
|
3924
|
-
checkoutStripe({ cartId, origin }: {
|
|
3925
|
-
cartId?: string | null;
|
|
3926
|
-
origin?: string;
|
|
3927
|
-
}): Promise<{
|
|
3928
|
-
order_no: string;
|
|
3929
|
-
orderNo: string;
|
|
3930
|
-
code: string;
|
|
3931
|
-
payment: GcPaymentIntent | null;
|
|
3932
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
3933
|
-
id?: number | undefined;
|
|
3934
|
-
parentOrderNo?: string | undefined;
|
|
3935
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
3936
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
3937
|
-
paymentMethod?: string | null | undefined;
|
|
3938
|
-
createdAt?: string | null | undefined;
|
|
3939
|
-
updatedAt?: string | null | undefined;
|
|
3940
|
-
userEmail?: string | undefined;
|
|
3941
|
-
phone?: string | undefined;
|
|
3942
|
-
subtotal?: number | undefined;
|
|
3943
|
-
shippingCharges?: number | undefined;
|
|
3944
|
-
discount?: number | undefined;
|
|
3945
|
-
total?: number | undefined;
|
|
3946
|
-
currencyCode?: string | undefined;
|
|
3947
|
-
currencyDecimalDigits?: number | undefined;
|
|
3948
|
-
shippingRate?: null | undefined;
|
|
3949
|
-
fulfillments?: {
|
|
3950
|
-
id: number;
|
|
3951
|
-
status: string;
|
|
3952
|
-
provider: string;
|
|
3953
|
-
trackingNumber: string;
|
|
3954
|
-
labelUrl: string;
|
|
3955
|
-
createdAt: string | null;
|
|
3956
|
-
}[] | undefined;
|
|
3957
|
-
shippingAddress?: {
|
|
3958
|
-
id: null;
|
|
3959
|
-
firstName: string;
|
|
3960
|
-
lastName: string;
|
|
3961
|
-
email: string | null;
|
|
3962
|
-
phone: string;
|
|
3963
|
-
address_1: string;
|
|
3964
|
-
address_2: string;
|
|
3965
|
-
city: string;
|
|
3966
|
-
state: string;
|
|
3967
|
-
zip: string;
|
|
3968
|
-
country: string;
|
|
3969
|
-
countryCode: string;
|
|
3970
|
-
isPrimary: boolean;
|
|
3971
|
-
isResidential: boolean;
|
|
3972
|
-
deliveryInstructions: null;
|
|
3973
|
-
} | null | undefined;
|
|
3974
|
-
billingAddress?: {
|
|
3975
|
-
id: null;
|
|
3976
|
-
firstName: string;
|
|
3977
|
-
lastName: string;
|
|
3978
|
-
email: string | null;
|
|
3979
|
-
phone: string;
|
|
3980
|
-
address_1: string;
|
|
3981
|
-
address_2: string;
|
|
3982
|
-
city: string;
|
|
3983
|
-
state: string;
|
|
3984
|
-
zip: string;
|
|
3985
|
-
country: string;
|
|
3986
|
-
countryCode: string;
|
|
3987
|
-
isPrimary: boolean;
|
|
3988
|
-
isResidential: boolean;
|
|
3989
|
-
deliveryInstructions: null;
|
|
3990
|
-
} | null | undefined;
|
|
3991
|
-
lineItems?: {
|
|
3992
|
-
id: number;
|
|
3993
|
-
productId: number | null;
|
|
3994
|
-
variantId: number | null;
|
|
3995
|
-
title: string;
|
|
3996
|
-
variantTitle: string;
|
|
3997
|
-
slug: string;
|
|
3998
|
-
sku: string;
|
|
3999
|
-
thumbnail: string | null;
|
|
4000
|
-
qty: number;
|
|
4001
|
-
price: number;
|
|
4002
|
-
subtotal: number;
|
|
4003
|
-
total: number;
|
|
4004
|
-
}[] | undefined;
|
|
4005
|
-
}>;
|
|
4006
|
-
checkoutCashfree({ cartId, origin }: {
|
|
4007
|
-
cartId?: string | null;
|
|
4008
|
-
email?: string;
|
|
4009
|
-
origin?: string;
|
|
4010
|
-
}): Promise<{
|
|
4011
|
-
order_no: string;
|
|
4012
|
-
orderNo: string;
|
|
4013
|
-
code: string;
|
|
4014
|
-
payment: GcPaymentIntent | null;
|
|
4015
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
4016
|
-
id?: number | undefined;
|
|
4017
|
-
parentOrderNo?: string | undefined;
|
|
4018
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
4019
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
4020
|
-
paymentMethod?: string | null | undefined;
|
|
4021
|
-
createdAt?: string | null | undefined;
|
|
4022
|
-
updatedAt?: string | null | undefined;
|
|
4023
|
-
userEmail?: string | undefined;
|
|
4024
|
-
phone?: string | undefined;
|
|
4025
|
-
subtotal?: number | undefined;
|
|
4026
|
-
shippingCharges?: number | undefined;
|
|
4027
|
-
discount?: number | undefined;
|
|
4028
|
-
total?: number | undefined;
|
|
4029
|
-
currencyCode?: string | undefined;
|
|
4030
|
-
currencyDecimalDigits?: number | undefined;
|
|
4031
|
-
shippingRate?: null | undefined;
|
|
4032
|
-
fulfillments?: {
|
|
4033
|
-
id: number;
|
|
4034
|
-
status: string;
|
|
4035
|
-
provider: string;
|
|
4036
|
-
trackingNumber: string;
|
|
4037
|
-
labelUrl: string;
|
|
4038
|
-
createdAt: string | null;
|
|
4039
|
-
}[] | undefined;
|
|
4040
|
-
shippingAddress?: {
|
|
4041
|
-
id: null;
|
|
4042
|
-
firstName: string;
|
|
4043
|
-
lastName: string;
|
|
4044
|
-
email: string | null;
|
|
4045
|
-
phone: string;
|
|
4046
|
-
address_1: string;
|
|
4047
|
-
address_2: string;
|
|
4048
|
-
city: string;
|
|
4049
|
-
state: string;
|
|
4050
|
-
zip: string;
|
|
4051
|
-
country: string;
|
|
4052
|
-
countryCode: string;
|
|
4053
|
-
isPrimary: boolean;
|
|
4054
|
-
isResidential: boolean;
|
|
4055
|
-
deliveryInstructions: null;
|
|
4056
|
-
} | null | undefined;
|
|
4057
|
-
billingAddress?: {
|
|
4058
|
-
id: null;
|
|
4059
|
-
firstName: string;
|
|
4060
|
-
lastName: string;
|
|
4061
|
-
email: string | null;
|
|
4062
|
-
phone: string;
|
|
4063
|
-
address_1: string;
|
|
4064
|
-
address_2: string;
|
|
4065
|
-
city: string;
|
|
4066
|
-
state: string;
|
|
4067
|
-
zip: string;
|
|
4068
|
-
country: string;
|
|
4069
|
-
countryCode: string;
|
|
4070
|
-
isPrimary: boolean;
|
|
4071
|
-
isResidential: boolean;
|
|
4072
|
-
deliveryInstructions: null;
|
|
4073
|
-
} | null | undefined;
|
|
4074
|
-
lineItems?: {
|
|
4075
|
-
id: number;
|
|
4076
|
-
productId: number | null;
|
|
4077
|
-
variantId: number | null;
|
|
4078
|
-
title: string;
|
|
4079
|
-
variantTitle: string;
|
|
4080
|
-
slug: string;
|
|
4081
|
-
sku: string;
|
|
4082
|
-
thumbnail: string | null;
|
|
4083
|
-
qty: number;
|
|
4084
|
-
price: number;
|
|
4085
|
-
subtotal: number;
|
|
4086
|
-
total: number;
|
|
4087
|
-
}[] | undefined;
|
|
4088
|
-
}>;
|
|
4089
|
-
checkoutPaypal({ cartId, origin, return_url }: {
|
|
4090
|
-
cartId?: string | null;
|
|
4091
|
-
origin?: string;
|
|
4092
|
-
return_url?: string;
|
|
4093
|
-
}): Promise<{
|
|
4094
|
-
order_no: string;
|
|
4095
|
-
orderNo: string;
|
|
4096
|
-
code: string;
|
|
4097
|
-
payment: GcPaymentIntent | null;
|
|
4098
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
4099
|
-
id?: number | undefined;
|
|
4100
|
-
parentOrderNo?: string | undefined;
|
|
4101
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
4102
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
4103
|
-
paymentMethod?: string | null | undefined;
|
|
4104
|
-
createdAt?: string | null | undefined;
|
|
4105
|
-
updatedAt?: string | null | undefined;
|
|
4106
|
-
userEmail?: string | undefined;
|
|
4107
|
-
phone?: string | undefined;
|
|
4108
|
-
subtotal?: number | undefined;
|
|
4109
|
-
shippingCharges?: number | undefined;
|
|
4110
|
-
discount?: number | undefined;
|
|
4111
|
-
total?: number | undefined;
|
|
4112
|
-
currencyCode?: string | undefined;
|
|
4113
|
-
currencyDecimalDigits?: number | undefined;
|
|
4114
|
-
shippingRate?: null | undefined;
|
|
4115
|
-
fulfillments?: {
|
|
4116
|
-
id: number;
|
|
4117
|
-
status: string;
|
|
4118
|
-
provider: string;
|
|
4119
|
-
trackingNumber: string;
|
|
4120
|
-
labelUrl: string;
|
|
4121
|
-
createdAt: string | null;
|
|
4122
|
-
}[] | undefined;
|
|
4123
|
-
shippingAddress?: {
|
|
4124
|
-
id: null;
|
|
4125
|
-
firstName: string;
|
|
4126
|
-
lastName: string;
|
|
4127
|
-
email: string | null;
|
|
4128
|
-
phone: string;
|
|
4129
|
-
address_1: string;
|
|
4130
|
-
address_2: string;
|
|
4131
|
-
city: string;
|
|
4132
|
-
state: string;
|
|
4133
|
-
zip: string;
|
|
4134
|
-
country: string;
|
|
4135
|
-
countryCode: string;
|
|
4136
|
-
isPrimary: boolean;
|
|
4137
|
-
isResidential: boolean;
|
|
4138
|
-
deliveryInstructions: null;
|
|
4139
|
-
} | null | undefined;
|
|
4140
|
-
billingAddress?: {
|
|
4141
|
-
id: null;
|
|
4142
|
-
firstName: string;
|
|
4143
|
-
lastName: string;
|
|
4144
|
-
email: string | null;
|
|
4145
|
-
phone: string;
|
|
4146
|
-
address_1: string;
|
|
4147
|
-
address_2: string;
|
|
4148
|
-
city: string;
|
|
4149
|
-
state: string;
|
|
4150
|
-
zip: string;
|
|
4151
|
-
country: string;
|
|
4152
|
-
countryCode: string;
|
|
4153
|
-
isPrimary: boolean;
|
|
4154
|
-
isResidential: boolean;
|
|
4155
|
-
deliveryInstructions: null;
|
|
4156
|
-
} | null | undefined;
|
|
4157
|
-
lineItems?: {
|
|
4158
|
-
id: number;
|
|
4159
|
-
productId: number | null;
|
|
4160
|
-
variantId: number | null;
|
|
4161
|
-
title: string;
|
|
4162
|
-
variantTitle: string;
|
|
4163
|
-
slug: string;
|
|
4164
|
-
sku: string;
|
|
4165
|
-
thumbnail: string | null;
|
|
4166
|
-
qty: number;
|
|
4167
|
-
price: number;
|
|
4168
|
-
subtotal: number;
|
|
4169
|
-
total: number;
|
|
4170
|
-
}[] | undefined;
|
|
4171
|
-
}>;
|
|
4172
|
-
checkoutPhonepe({ cartId, origin }: {
|
|
4173
|
-
cartId?: string | null;
|
|
4174
|
-
email?: string;
|
|
4175
|
-
phone?: string;
|
|
4176
|
-
origin?: string;
|
|
4177
|
-
}): Promise<{
|
|
4178
|
-
order_no: string;
|
|
4179
|
-
orderNo: string;
|
|
4180
|
-
code: string;
|
|
4181
|
-
payment: GcPaymentIntent | null;
|
|
4182
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
4183
|
-
id?: number | undefined;
|
|
4184
|
-
parentOrderNo?: string | undefined;
|
|
4185
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
4186
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
4187
|
-
paymentMethod?: string | null | undefined;
|
|
4188
|
-
createdAt?: string | null | undefined;
|
|
4189
|
-
updatedAt?: string | null | undefined;
|
|
4190
|
-
userEmail?: string | undefined;
|
|
4191
|
-
phone?: string | undefined;
|
|
4192
|
-
subtotal?: number | undefined;
|
|
4193
|
-
shippingCharges?: number | undefined;
|
|
4194
|
-
discount?: number | undefined;
|
|
4195
|
-
total?: number | undefined;
|
|
4196
|
-
currencyCode?: string | undefined;
|
|
4197
|
-
currencyDecimalDigits?: number | undefined;
|
|
4198
|
-
shippingRate?: null | undefined;
|
|
4199
|
-
fulfillments?: {
|
|
4200
|
-
id: number;
|
|
4201
|
-
status: string;
|
|
4202
|
-
provider: string;
|
|
4203
|
-
trackingNumber: string;
|
|
4204
|
-
labelUrl: string;
|
|
4205
|
-
createdAt: string | null;
|
|
4206
|
-
}[] | undefined;
|
|
4207
|
-
shippingAddress?: {
|
|
4208
|
-
id: null;
|
|
4209
|
-
firstName: string;
|
|
4210
|
-
lastName: string;
|
|
4211
|
-
email: string | null;
|
|
4212
|
-
phone: string;
|
|
4213
|
-
address_1: string;
|
|
4214
|
-
address_2: string;
|
|
4215
|
-
city: string;
|
|
4216
|
-
state: string;
|
|
4217
|
-
zip: string;
|
|
4218
|
-
country: string;
|
|
4219
|
-
countryCode: string;
|
|
4220
|
-
isPrimary: boolean;
|
|
4221
|
-
isResidential: boolean;
|
|
4222
|
-
deliveryInstructions: null;
|
|
4223
|
-
} | null | undefined;
|
|
4224
|
-
billingAddress?: {
|
|
4225
|
-
id: null;
|
|
4226
|
-
firstName: string;
|
|
4227
|
-
lastName: string;
|
|
4228
|
-
email: string | null;
|
|
4229
|
-
phone: string;
|
|
4230
|
-
address_1: string;
|
|
4231
|
-
address_2: string;
|
|
4232
|
-
city: string;
|
|
4233
|
-
state: string;
|
|
4234
|
-
zip: string;
|
|
4235
|
-
country: string;
|
|
4236
|
-
countryCode: string;
|
|
4237
|
-
isPrimary: boolean;
|
|
4238
|
-
isResidential: boolean;
|
|
4239
|
-
deliveryInstructions: null;
|
|
4240
|
-
} | null | undefined;
|
|
4241
|
-
lineItems?: {
|
|
4242
|
-
id: number;
|
|
4243
|
-
productId: number | null;
|
|
4244
|
-
variantId: number | null;
|
|
4245
|
-
title: string;
|
|
4246
|
-
variantTitle: string;
|
|
4247
|
-
slug: string;
|
|
4248
|
-
sku: string;
|
|
4249
|
-
thumbnail: string | null;
|
|
4250
|
-
qty: number;
|
|
4251
|
-
price: number;
|
|
4252
|
-
subtotal: number;
|
|
4253
|
-
total: number;
|
|
4254
|
-
}[] | undefined;
|
|
4255
|
-
}>;
|
|
4256
|
-
createAffirmPayOrder({ cartId, origin }: {
|
|
4257
|
-
cartId?: string | null;
|
|
4258
|
-
origin?: string;
|
|
4259
|
-
addressId?: string;
|
|
4260
|
-
storeId?: string;
|
|
4261
|
-
paymentMethodId?: string;
|
|
4262
|
-
}): Promise<{
|
|
4263
|
-
order_no: string;
|
|
4264
|
-
orderNo: string;
|
|
4265
|
-
code: string;
|
|
4266
|
-
payment: GcPaymentIntent | null;
|
|
4267
|
-
paymentKind: "none" | "client_action" | "redirect";
|
|
4268
|
-
id?: number | undefined;
|
|
4269
|
-
parentOrderNo?: string | undefined;
|
|
4270
|
-
status?: "shipped" | "delivered" | "cancelled" | "pending" | "confirmed" | undefined;
|
|
4271
|
-
paymentStatus?: "pending" | "paid" | "failed" | "refunded" | undefined;
|
|
4272
|
-
paymentMethod?: string | null | undefined;
|
|
4273
|
-
createdAt?: string | null | undefined;
|
|
4274
|
-
updatedAt?: string | null | undefined;
|
|
4275
|
-
userEmail?: string | undefined;
|
|
4276
|
-
phone?: string | undefined;
|
|
4277
|
-
subtotal?: number | undefined;
|
|
4278
|
-
shippingCharges?: number | undefined;
|
|
4279
|
-
discount?: number | undefined;
|
|
4280
|
-
total?: number | undefined;
|
|
4281
|
-
currencyCode?: string | undefined;
|
|
4282
|
-
currencyDecimalDigits?: number | undefined;
|
|
4283
|
-
shippingRate?: null | undefined;
|
|
4284
|
-
fulfillments?: {
|
|
4285
|
-
id: number;
|
|
4286
|
-
status: string;
|
|
4287
|
-
provider: string;
|
|
4288
|
-
trackingNumber: string;
|
|
4289
|
-
labelUrl: string;
|
|
4290
|
-
createdAt: string | null;
|
|
4291
|
-
}[] | undefined;
|
|
4292
|
-
shippingAddress?: {
|
|
4293
|
-
id: null;
|
|
4294
|
-
firstName: string;
|
|
4295
|
-
lastName: string;
|
|
4296
|
-
email: string | null;
|
|
4297
|
-
phone: string;
|
|
4298
|
-
address_1: string;
|
|
4299
|
-
address_2: string;
|
|
4300
|
-
city: string;
|
|
4301
|
-
state: string;
|
|
4302
|
-
zip: string;
|
|
4303
|
-
country: string;
|
|
4304
|
-
countryCode: string;
|
|
4305
|
-
isPrimary: boolean;
|
|
4306
|
-
isResidential: boolean;
|
|
4307
|
-
deliveryInstructions: null;
|
|
4308
|
-
} | null | undefined;
|
|
4309
|
-
billingAddress?: {
|
|
4310
|
-
id: null;
|
|
4311
|
-
firstName: string;
|
|
4312
|
-
lastName: string;
|
|
4313
|
-
email: string | null;
|
|
4314
|
-
phone: string;
|
|
4315
|
-
address_1: string;
|
|
4316
|
-
address_2: string;
|
|
4317
|
-
city: string;
|
|
4318
|
-
state: string;
|
|
4319
|
-
zip: string;
|
|
4320
|
-
country: string;
|
|
4321
|
-
countryCode: string;
|
|
4322
|
-
isPrimary: boolean;
|
|
4323
|
-
isResidential: boolean;
|
|
4324
|
-
deliveryInstructions: null;
|
|
4325
|
-
} | null | undefined;
|
|
4326
|
-
lineItems?: {
|
|
4327
|
-
id: number;
|
|
4328
|
-
productId: number | null;
|
|
4329
|
-
variantId: number | null;
|
|
4330
|
-
title: string;
|
|
4331
|
-
variantTitle: string;
|
|
4332
|
-
slug: string;
|
|
4333
|
-
sku: string;
|
|
4334
|
-
thumbnail: string | null;
|
|
4335
|
-
qty: number;
|
|
4336
|
-
price: number;
|
|
4337
|
-
subtotal: number;
|
|
4338
|
-
total: number;
|
|
4339
|
-
}[] | undefined;
|
|
4340
|
-
}>;
|
|
4341
|
-
private settled;
|
|
4342
|
-
captureRazorpayPayment({ razorpay_order_id }: {
|
|
4343
|
-
razorpay_order_id?: string;
|
|
4344
|
-
razorpay_payment_id?: string;
|
|
4345
|
-
}): Promise<{
|
|
4346
|
-
order_no: string;
|
|
4347
|
-
orderNo: string;
|
|
4348
|
-
captured: boolean;
|
|
4349
|
-
}>;
|
|
4350
|
-
capturePhonepePayment({ phonepe_order_id }: {
|
|
4351
|
-
phonepe_order_id?: string;
|
|
4352
|
-
phonepe_payment_id?: string;
|
|
4353
|
-
}): Promise<{
|
|
4354
|
-
order_no: string;
|
|
4355
|
-
orderNo: string;
|
|
4356
|
-
captured: boolean;
|
|
4357
|
-
}>;
|
|
4358
|
-
captureCashfreePayment({ order_no }: {
|
|
4359
|
-
order_no?: string;
|
|
4360
|
-
}): Promise<{
|
|
4361
|
-
order_no: string;
|
|
4362
|
-
orderNo: string;
|
|
4363
|
-
captured: boolean;
|
|
4364
|
-
}>;
|
|
4365
|
-
checkoutStripeCapture({ order_no }: {
|
|
4366
|
-
order_no?: string;
|
|
4367
|
-
pg?: string;
|
|
4368
|
-
payment_session_id?: string;
|
|
4369
|
-
storeId?: string;
|
|
4370
|
-
}): Promise<{
|
|
4371
|
-
order_no: string;
|
|
4372
|
-
orderNo: string;
|
|
4373
|
-
captured: boolean;
|
|
4374
|
-
}>;
|
|
4375
|
-
confirmAffirmOrder({ orderId }: {
|
|
4376
|
-
affirmToken?: string;
|
|
4377
|
-
orderId?: string;
|
|
4378
|
-
storeId?: string;
|
|
4379
|
-
origin?: string;
|
|
4380
|
-
}): Promise<{
|
|
4381
|
-
order_no: string;
|
|
4382
|
-
orderNo: string;
|
|
4383
|
-
captured: boolean;
|
|
4384
|
-
}>;
|
|
4385
|
-
cancelAffirmOrder({ orderId }: {
|
|
4386
|
-
orderId?: string;
|
|
4387
|
-
storeId?: string;
|
|
4388
|
-
origin?: string;
|
|
4389
|
-
}): Promise<never>;
|
|
4390
|
-
/**
|
|
4391
|
-
* GoCommerce prices shipping when it creates the order — there is no rate list for a shopper to
|
|
4392
|
-
* choose from. An empty list is the accurate answer, and the payment step renders no rate picker
|
|
4393
|
-
* for it rather than an empty one.
|
|
4394
|
-
*/
|
|
4395
|
-
getShippingRates(_params: {
|
|
4396
|
-
cartId?: string | null;
|
|
4397
|
-
}): Promise<{
|
|
4398
|
-
message: string;
|
|
4399
|
-
success: boolean;
|
|
4400
|
-
error: null;
|
|
4401
|
-
data: never[];
|
|
4402
|
-
}>;
|
|
4403
|
-
}
|
|
4404
|
-
declare const checkoutService: CheckoutService;
|
|
4405
|
-
|
|
4406
|
-
declare class OrderService extends BaseService {
|
|
4407
|
-
private static instance;
|
|
4408
|
-
static getInstance(): OrderService;
|
|
4409
|
-
private readOrder;
|
|
4410
|
-
private present;
|
|
4411
|
-
/**
|
|
4412
|
-
* The confirmation view, rebuilt from the cart that became the order.
|
|
4413
|
-
*
|
|
4414
|
-
* Everything a receipt needs is on the converted cart except the address, which was never stored
|
|
4415
|
-
* on it — so that block is simply absent rather than invented.
|
|
4416
|
-
*/
|
|
4417
|
-
private orderFromCart;
|
|
4418
|
-
/**
|
|
4419
|
-
* The shopper's orders. Without an account there is no server-side list to ask for, so this is
|
|
4420
|
-
* every order placed from this browser, newest first — which is exactly what it can know.
|
|
4421
|
-
*/
|
|
4422
|
-
list({ page }?: {
|
|
4423
|
-
page?: number;
|
|
4424
|
-
q?: string;
|
|
4425
|
-
sort?: string;
|
|
4426
|
-
}): Promise<Paginated<unknown>>;
|
|
4427
|
-
/** What the confirmation page loads with, server-side, straight after checkout. */
|
|
4428
|
-
listOrdersByParent({ orderNo, cartId }: {
|
|
4429
|
-
orderNo?: string | null;
|
|
4430
|
-
cartId?: string | null;
|
|
4431
|
-
}): Promise<Paginated<unknown>>;
|
|
4432
|
-
getOrder(orderNo: string): Promise<{}>;
|
|
4433
|
-
fetchOrder(id: string): Promise<{}>;
|
|
4434
|
-
fetchTrackOrder(id: string): Promise<Paginated<unknown>>;
|
|
4435
|
-
paySuccessPageHit(orderId: string): Promise<{}>;
|
|
4436
|
-
getOrderByEmailAndOTP(_params: {
|
|
4437
|
-
email?: string;
|
|
4438
|
-
otp?: string;
|
|
4439
|
-
}): Promise<Paginated<unknown>>;
|
|
4440
|
-
buyAgain(): Promise<Paginated<unknown>>;
|
|
4441
|
-
listPublic(): Promise<Paginated<unknown>>;
|
|
4442
|
-
submitReview(_params: unknown): Promise<never>;
|
|
4443
|
-
codCheckout(_params: unknown): Promise<never>;
|
|
4444
|
-
razorpayCheckout(_params: unknown): Promise<never>;
|
|
4445
|
-
stripeCheckout(_params: unknown): Promise<never>;
|
|
4446
|
-
cashfreeCheckout(_params: unknown): Promise<never>;
|
|
4447
|
-
razorCapture(_params: unknown): Promise<never>;
|
|
4448
|
-
}
|
|
4449
|
-
declare const orderService: OrderService;
|
|
4450
|
-
|
|
4451
|
-
declare class StoreService extends BaseService {
|
|
4452
|
-
private static instance;
|
|
4453
|
-
static getInstance(): StoreService;
|
|
4454
|
-
getStoreByIdOrDomain(_params?: {
|
|
4455
|
-
storeId?: string;
|
|
4456
|
-
domain?: string;
|
|
4457
|
-
}): Promise<Record<string, any>>;
|
|
4458
|
-
/** The settings store asks for the record by id; there is only ever the configured one. */
|
|
4459
|
-
getStore(_storeId?: string): Promise<Record<string, any>>;
|
|
4460
|
-
}
|
|
4461
|
-
declare const storeService: StoreService;
|
|
4462
|
-
declare class MenuService extends BaseService {
|
|
4463
|
-
private static instance;
|
|
4464
|
-
static getInstance(): MenuService;
|
|
4465
|
-
/** The nav reads `response.data` and filters it on `menuId`, the way the Litekart API served it. */
|
|
4466
|
-
list(): Promise<{
|
|
4467
|
-
data: unknown[];
|
|
4468
|
-
}>;
|
|
4469
|
-
}
|
|
4470
|
-
declare const menuService: MenuService;
|
|
4471
|
-
declare class StateService extends BaseService {
|
|
4472
|
-
private static instance;
|
|
4473
|
-
static getInstance(): StateService;
|
|
4474
|
-
list(): Promise<Paginated<never>>;
|
|
4475
|
-
}
|
|
4476
|
-
declare const stateService: StateService;
|
|
4477
|
-
declare class CurrencyService extends BaseService {
|
|
4478
|
-
private static instance;
|
|
4479
|
-
static getInstance(): CurrencyService;
|
|
4480
|
-
/** One currency: GoCommerce prices a store in the currency its catalogue is recorded in. */
|
|
4481
|
-
listCurrencies(): Promise<Paginated<any>>;
|
|
4482
|
-
}
|
|
4483
|
-
declare const currencyService: CurrencyService;
|
|
4484
|
-
declare class RegionService extends BaseService {
|
|
4485
|
-
private static instance;
|
|
4486
|
-
static getInstance(): RegionService;
|
|
4487
|
-
getRegionByRegionId(_id: string): Promise<{}>;
|
|
4488
|
-
}
|
|
4489
|
-
declare const regionService: RegionService;
|
|
4490
|
-
declare class PluginService extends BaseService {
|
|
4491
|
-
private static instance;
|
|
4492
|
-
static getInstance(): PluginService;
|
|
4493
|
-
list(_params?: {
|
|
4494
|
-
page?: number;
|
|
4495
|
-
q?: string;
|
|
4496
|
-
sort?: string;
|
|
4497
|
-
}): Promise<Paginated<unknown>>;
|
|
4498
|
-
}
|
|
4499
|
-
declare const pluginService: PluginService;
|
|
4500
|
-
declare const pluginsService: PluginService;
|
|
4501
|
-
declare class SettingService extends BaseService {
|
|
4502
|
-
private static instance;
|
|
4503
|
-
static getInstance(): SettingService;
|
|
4504
|
-
fetchSetting(): Promise<Record<string, any>[]>;
|
|
4505
|
-
saveSettings(_setting: unknown): Promise<never>;
|
|
4506
|
-
updateSettings(_id: string, _setting: unknown): Promise<never>;
|
|
4507
|
-
}
|
|
4508
|
-
declare const settingService: SettingService;
|
|
4509
|
-
declare const settingsService: SettingService;
|
|
4510
|
-
declare class InitService extends BaseService {
|
|
4511
|
-
private static instance;
|
|
4512
|
-
static getInstance(): InitService;
|
|
4513
|
-
fetchInit(): Promise<Record<string, any>[]>;
|
|
4514
|
-
}
|
|
4515
|
-
declare const initService: InitService;
|
|
4516
|
-
declare class HomeService extends BaseService {
|
|
4517
|
-
private static instance;
|
|
4518
|
-
static getInstance(): HomeService;
|
|
4519
|
-
getHome(): Promise<unknown[]>;
|
|
4520
|
-
}
|
|
4521
|
-
declare const homeService: HomeService;
|
|
4522
|
-
declare class PopularSearchService extends BaseService {
|
|
4523
|
-
private static instance;
|
|
4524
|
-
static getInstance(): PopularSearchService;
|
|
4525
|
-
listPopularSearch(_params?: {
|
|
4526
|
-
page?: number;
|
|
4527
|
-
q?: string;
|
|
4528
|
-
sort?: string;
|
|
4529
|
-
}): Promise<Paginated<never>>;
|
|
4530
|
-
}
|
|
4531
|
-
declare const popularSearchService: PopularSearchService;
|
|
4532
|
-
declare class PopularityService extends BaseService {
|
|
4533
|
-
private static instance;
|
|
4534
|
-
static getInstance(): PopularityService;
|
|
4535
|
-
/** Nothing to record against: a view counter is not part of this API. Accepted and dropped. */
|
|
4536
|
-
updatePopularity(_params?: {
|
|
4537
|
-
product_id?: string;
|
|
4538
|
-
sid?: string;
|
|
4539
|
-
}): Promise<{
|
|
4540
|
-
success: boolean;
|
|
4541
|
-
}>;
|
|
4542
|
-
}
|
|
4543
|
-
declare const popularityService: PopularityService;
|
|
4544
|
-
|
|
4545
|
-
declare class UserService extends BaseService {
|
|
4546
|
-
static getInstance: () => UserService;
|
|
4547
|
-
/** No session to report. `null` is what the header and guards check for. */
|
|
4548
|
-
getMe(): Promise<null>;
|
|
4549
|
-
getUser(_id: string): Promise<null>;
|
|
4550
|
-
login(_params: unknown): Promise<never>;
|
|
4551
|
-
signup(_params: unknown): Promise<never>;
|
|
4552
|
-
joinAsVendor(_params: unknown): Promise<never>;
|
|
4553
|
-
forgotPassword(_params: unknown): Promise<never>;
|
|
4554
|
-
resetPassword(_params: unknown): Promise<never>;
|
|
4555
|
-
changePassword(_params: unknown): Promise<never>;
|
|
4556
|
-
getOtp(_params: unknown): Promise<never>;
|
|
4557
|
-
verifyOtp(_params: unknown): Promise<never>;
|
|
4558
|
-
updateProfile(_params: unknown): Promise<never>;
|
|
4559
|
-
checkEmail(_email: string): Promise<{
|
|
4560
|
-
exists: boolean;
|
|
4561
|
-
}>;
|
|
4562
|
-
deleteUser(_id: string): Promise<never>;
|
|
4563
|
-
/**
|
|
4564
|
-
* Clears the session this storefront thinks it has.
|
|
4565
|
-
*
|
|
4566
|
-
* There is no session on GoCommerce to end, so it would be easy to make this a no-op — and that
|
|
4567
|
-
* is a trap. The shared user store decides who is signed in by reading the `connect.sid` and `me`
|
|
4568
|
-
* cookies straight from `document.cookie`, not by asking a service. A pair left behind by running
|
|
4569
|
-
* this storefront against a backend that does have accounts therefore makes GoCommerce look
|
|
4570
|
-
* signed-in, which sends the checkout down the saved-address path instead of the guest one. The
|
|
4571
|
-
* checkout page already knows to call `logout()` and retry when that happens — so this has to
|
|
4572
|
-
* actually clear them, or that recovery does nothing.
|
|
4573
|
-
*/
|
|
4574
|
-
logout(): Promise<{
|
|
4575
|
-
success: boolean;
|
|
4576
|
-
}>;
|
|
4577
|
-
}
|
|
4578
|
-
declare const userService: UserService;
|
|
4579
|
-
declare class AuthService extends UserService {
|
|
4580
|
-
static getInstance: () => AuthService;
|
|
4581
|
-
verifyEmail(_email: string, _token: string): Promise<never>;
|
|
4582
|
-
joinAsAdmin(_params: unknown): Promise<never>;
|
|
4583
|
-
}
|
|
4584
|
-
declare const authService: AuthService;
|
|
4585
|
-
declare class ProfileService extends BaseService {
|
|
4586
|
-
static getInstance: () => ProfileService;
|
|
4587
|
-
getOne(): Promise<null>;
|
|
4588
|
-
save(_profile: unknown): Promise<never>;
|
|
4589
|
-
}
|
|
4590
|
-
declare const profileService: ProfileService;
|
|
4591
|
-
/**
|
|
4592
|
-
* The saved-address book. GoCommerce has none, so it is kept in this browser — see
|
|
4593
|
-
* ./address-book.ts for why refusing the write is not an option.
|
|
4594
|
-
*/
|
|
4595
|
-
declare class AddressService extends BaseService {
|
|
4596
|
-
static getInstance: () => AddressService;
|
|
4597
|
-
list(params?: {
|
|
4598
|
-
page?: number;
|
|
4599
|
-
}): Promise<Paginated<StoredAddress>>;
|
|
4600
|
-
fetchAddress(id: string): Promise<StoredAddress>;
|
|
4601
|
-
saveAddress(address: Record<string, unknown>): Promise<StoredAddress>;
|
|
4602
|
-
editAddress(id: string, address: Record<string, unknown>): Promise<StoredAddress>;
|
|
4603
|
-
deleteAddress(id: string): Promise<void>;
|
|
4604
|
-
}
|
|
4605
|
-
declare const addressService: AddressService;
|
|
4606
|
-
declare class WishlistService extends BaseService {
|
|
4607
|
-
static getInstance: () => WishlistService;
|
|
4608
|
-
fetchWishlist(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4609
|
-
checkWishlist(_params?: unknown): Promise<{
|
|
4610
|
-
data: boolean;
|
|
4611
|
-
}>;
|
|
4612
|
-
/** The product grid asks about many ids at once; nothing is on a list that cannot exist. */
|
|
4613
|
-
checkWishlistInBulk(_ids: unknown): Promise<{
|
|
4614
|
-
data: never[];
|
|
4615
|
-
}>;
|
|
4616
|
-
toggleWishlist(_params: unknown): Promise<never>;
|
|
4617
|
-
}
|
|
4618
|
-
declare const wishlistService: WishlistService;
|
|
4619
|
-
declare class CouponService extends BaseService {
|
|
4620
|
-
static getInstance: () => CouponService;
|
|
4621
|
-
listCoupons(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4622
|
-
searchCoupons(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4623
|
-
getCoupon(_id: string): Promise<never>;
|
|
4624
|
-
createCoupon(_coupon: unknown): Promise<never>;
|
|
4625
|
-
patchCoupon(_id: string, _coupon: unknown): Promise<never>;
|
|
4626
|
-
deleteCoupon(_id: string): Promise<never>;
|
|
4627
|
-
}
|
|
4628
|
-
declare const couponService: CouponService;
|
|
4629
|
-
declare class DealService extends BaseService {
|
|
4630
|
-
static getInstance: () => DealService;
|
|
4631
|
-
fetchDeals(): Promise<Paginated<unknown>>;
|
|
4632
|
-
}
|
|
4633
|
-
declare const dealService: DealService;
|
|
4634
|
-
declare class ReviewService extends BaseService {
|
|
4635
|
-
static getInstance: () => ReviewService;
|
|
4636
|
-
fetchReviews(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4637
|
-
allReviews(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4638
|
-
fetchProducrReviews(_productId: string): Promise<Paginated<unknown>>;
|
|
4639
|
-
saveReview(_review: unknown): Promise<never>;
|
|
4640
|
-
}
|
|
4641
|
-
declare const reviewService: ReviewService;
|
|
4642
|
-
declare class PageService extends BaseService {
|
|
4643
|
-
static getInstance: () => PageService;
|
|
4644
|
-
list(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4645
|
-
listLatestPages(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4646
|
-
/**
|
|
4647
|
-
* Every caller asks for a fixed, optional slug — `products`, `about-us`, `privacy-policy` — to
|
|
4648
|
-
* dress a page the storefront already renders. So an absent page is the normal state, not a dead
|
|
4649
|
-
* link: answer empty and let the route show its own content, rather than log a failure on every
|
|
4650
|
-
* request for something that was never required.
|
|
4651
|
-
*/
|
|
4652
|
-
getOne(_id: string): Promise<{}>;
|
|
4653
|
-
}
|
|
4654
|
-
declare const pageService: PageService;
|
|
4655
|
-
declare class BlogService extends BaseService {
|
|
4656
|
-
static getInstance: () => BlogService;
|
|
4657
|
-
list(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4658
|
-
getOne(id: string): Promise<never>;
|
|
4659
|
-
}
|
|
4660
|
-
declare const blogService: BlogService;
|
|
4661
|
-
declare class BannerService extends BaseService {
|
|
4662
|
-
static getInstance: () => BannerService;
|
|
4663
|
-
list(): Promise<Paginated<unknown>>;
|
|
4664
|
-
fetchBannersGroup(): Promise<Paginated<unknown>>;
|
|
4665
|
-
}
|
|
4666
|
-
declare const bannerService: BannerService;
|
|
4667
|
-
declare class GalleryService extends BaseService {
|
|
4668
|
-
static getInstance: () => GalleryService;
|
|
4669
|
-
fetchGallery(): Promise<unknown[]>;
|
|
4670
|
-
}
|
|
4671
|
-
declare const galleryService: GalleryService;
|
|
4672
|
-
declare class ReelsService extends BaseService {
|
|
4673
|
-
static getInstance: () => ReelsService;
|
|
4674
|
-
list(): Promise<Paginated<unknown>>;
|
|
4675
|
-
}
|
|
4676
|
-
declare const reelsService: ReelsService;
|
|
4677
|
-
declare class FaqService extends BaseService {
|
|
4678
|
-
static getInstance: () => FaqService;
|
|
4679
|
-
listFaqs(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4680
|
-
}
|
|
4681
|
-
declare const faqService: FaqService;
|
|
4682
|
-
declare class FeedbackService extends BaseService {
|
|
4683
|
-
static getInstance: () => FeedbackService;
|
|
4684
|
-
listFeedbacks(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4685
|
-
}
|
|
4686
|
-
declare const feedbackService: FeedbackService;
|
|
4687
|
-
declare class ContactService extends BaseService {
|
|
4688
|
-
static getInstance: () => ContactService;
|
|
4689
|
-
submitContactUsForm(_params: unknown): Promise<never>;
|
|
4690
|
-
}
|
|
4691
|
-
declare const contactService: ContactService;
|
|
4692
|
-
declare class EnquiryService extends BaseService {
|
|
4693
|
-
static getInstance: () => EnquiryService;
|
|
4694
|
-
create(_params: unknown): Promise<never>;
|
|
4695
|
-
}
|
|
4696
|
-
declare const enquiryService: EnquiryService;
|
|
4697
|
-
declare class ChatService extends BaseService {
|
|
4698
|
-
static getInstance: () => ChatService;
|
|
4699
|
-
list(): Promise<Record<string, unknown>[]>;
|
|
4700
|
-
chats(): Promise<Record<string, unknown>[]>;
|
|
4701
|
-
save(_message: unknown): Promise<never>;
|
|
4702
|
-
}
|
|
4703
|
-
declare const chatService: ChatService;
|
|
4704
|
-
declare class UploadService extends BaseService {
|
|
4705
|
-
static getInstance: () => UploadService;
|
|
4706
|
-
uploadToS3(_params: unknown): Promise<never>;
|
|
4707
|
-
uploadMultipleToS3(_params: unknown): Promise<never>;
|
|
4708
|
-
deleteFromS3(_params: unknown): Promise<never>;
|
|
4709
|
-
}
|
|
4710
|
-
declare const uploadService: UploadService;
|
|
4711
|
-
declare class VendorService extends BaseService {
|
|
4712
|
-
static getInstance: () => VendorService;
|
|
4713
|
-
list(_params?: unknown): Promise<Paginated<unknown>>;
|
|
4714
|
-
getVendor(_id: string): Promise<never>;
|
|
4715
|
-
fetchMyVendorDetails(): Promise<never>;
|
|
4716
|
-
fetchDashboard(): Promise<never>;
|
|
4717
|
-
fetchProductsOfVendor(_vendorId: string): Promise<unknown[]>;
|
|
4718
|
-
getAllVendorRatings(_vendorId: string): Promise<unknown[]>;
|
|
4719
|
-
save(_data: unknown): Promise<never>;
|
|
4720
|
-
update(_data: unknown): Promise<never>;
|
|
4721
|
-
}
|
|
4722
|
-
declare const vendorService: VendorService;
|
|
4723
|
-
declare class VarniCustomDesignService extends BaseService {
|
|
4724
|
-
static getInstance: () => VarniCustomDesignService;
|
|
4725
|
-
submitForm(_formDetails: unknown): Promise<never>;
|
|
4726
|
-
}
|
|
4727
|
-
declare const varniCustomDesignService: VarniCustomDesignService;
|
|
4728
|
-
declare class VarniCustomProductService extends BaseService {
|
|
4729
|
-
static getInstance: () => VarniCustomProductService;
|
|
4730
|
-
checkForCombinationWith(_args: unknown): Promise<{
|
|
4731
|
-
data: never[];
|
|
4732
|
-
count: number;
|
|
4733
|
-
pageSize: number;
|
|
4734
|
-
noOfPage: number;
|
|
4735
|
-
page: number;
|
|
4736
|
-
}>;
|
|
4737
|
-
createCustomOrderChat(_productId: string): Promise<never>;
|
|
4738
|
-
sendMessageToCustomOrderChat(_chatId: string, _vendor: string, _message: string): Promise<never>;
|
|
4739
|
-
}
|
|
4740
|
-
declare const varniCustomProductService: VarniCustomProductService;
|
|
4741
|
-
|
|
4742
|
-
export { API_PROXY_PREFIX, AddressService, AuthService, AutocompleteService, BannerService, BaseService, BlogService, CartService, CategoryService, ChatService, type CheckoutDetails, CheckoutService, CollectionService, ContactService, CouponService, type Credentials, CurrencyService, DealService, EnquiryService, type Envelope, FaqService, FeedbackService, GalleryService, type GcAddress, type GcCart, type GcCartLine, type GcCategory, type GcCategoryPage, type GcCheckoutMethods, type GcCheckoutResult, type GcCollection, type GcCollectionPage, type GcFulfillment, type GcOrder, type GcOrderLine, type GcPaymentIntent, type GcProduct, type GcProductCategory, type GcProductCollection, type GcProductOption, type GcVariant, type GcVariantImage, GoCommerceError, HomeService, InitService, type ListMeta, MAX_LIMIT, MeilisearchService, MenuService, type Money, OrderService, PAGE_SIZE, PageService, type Paginated, PaymentMethodService, PluginService, PluginService as PluginsService, PopularSearchService, PopularityService, type ProductIndex, type ProductSearchResult, ProductService, ProfileService, ReelsService, RegionService, ReviewService, SearchService, SettingService, SettingService as SettingsService, StateService, type StaticStoreProvider, StoreService, type StoredAddress, UploadService, UserService, VarniCustomDesignService, VarniCustomProductService, VendorService, WishlistService, absoluteMedia, addressService, authService, autocompleteService, bannerService, blogService, cartService, categoryService, chatService, checkoutService, clearCheckoutDetails, clearPhantomSession, collectionService, contactService, couponService, currencyFractionDigits, currencyService, dealService, emptyPage, enquiryService, faqService, feedbackService, findAddress, flattenMetadata, fromMoney, galleryService, hasPhantomSession, hasStaticStore, homeService, initService, listAddresses, mapCart, mapCategory, mapCollection, mapOrder, mapProduct, meilisearchService, menuService, orderService, pageService, paginated, patchAddress, paymentMethodService, pluginService, pluginsService, popularSearchService, popularityService, productImages, productService, profileService, putAddress, readCheckoutDetails, readOrderNumbers, readOrderToken, readStaticStore, readStaticStoreDetails, reelsService, regionService, rememberOrderToken, removeAddress, resolveProductIndex, reviewService, searchService, setStaticStore, settingService, settingsService, stateService, storeService, toGoCommerceAddress, toStorefrontAddress, uploadService, userService, varniCustomDesignService, varniCustomProductService, vendorService, wishlistService, writeCheckoutDetails };
|
|
1
|
+
export { a as AddressService, d as AuthService, e as AutocompleteService, B as BannerService, f as BaseService, g as BlogService, i as CartService, j as CatalogService, l as CategoryService, m as ChatService, p as CheckoutService, s as CollectionService, t as ContactService, u as CountryService, v as CouponService, x as CurrencyService, D as DealService, z as DemoRequestService, E as EngineRequest, F as EnquiryService, I as FaqService, J as FeedbackService, L as GalleryService, M as HomeService, O as InitService, Q as MeilisearchService, T as MenuService, X as OrderService, Y as PageService, _ as PaymentMethodService, a0 as PluginService, a0 as PluginsService, a1 as PopularSearchService, a2 as PopularityService, a5 as ProductService, a6 as ProfileService, a7 as ReelsService, a8 as RegionService, ab as ReviewService, ae as SearchService, af as SettingService, af as SettingsService, ah as StateService, ai as StoreService, ak as StorefrontMenu, an as UploadService, ao as UserService, ar as VarniCustomDesignService, as as VarniCustomProductService, au as VendorService, av as WarrantyService, ay as WishlistService, az as addressService, aA as authService, aB as autocompleteService, aC as bannerService, aD as blogService, aE as cartService, aF as categoryService, aG as chatService, aH as checkoutService, aI as collectionService, aJ as contactService, aK as countryService, aL as couponService, aN as currencyService, aO as dealService, aP as demoRequestService, aR as emptyPage, aS as enquiryService, aT as faqService, aU as feedbackService, aY as galleryService, aZ as homeService, a_ as initService, a$ as meilisearchService, b0 as menuService, b2 as orderService, b3 as pageService, b4 as paymentMethodService, b5 as pluginService, b6 as pluginsService, b7 as popularSearchService, b8 as popularityService, bb as productService, bc as profileService, bd as qs, be as reelsService, bf as regionService, bg as reviewService, bh as searchService, bi as settingService, bj as settingsService, bk as stateService, bl as staticStore, bm as storeService, bx as toPage, bD as uploadService, bE as userService, bF as varniCustomDesignService, bG as varniCustomProductService, bH as vendorService, bI as warrantyService, bJ as wishlistService } from '../index-CJ836ZI3.cjs';
|