@ecomweb/sdk 0.13.1 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/dist/index.d.ts +657 -1
- package/dist/index.js +492 -2
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -26,15 +26,62 @@ interface IHttpClient {
|
|
|
26
26
|
delete<T>(url: string, options?: RequestOptions): Promise<ApiResponse<T>>;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* This package's version, baked in at build time. `dev` when the source runs
|
|
31
|
+
* without the define (the API ignores a version that isn't semver).
|
|
32
|
+
*/
|
|
33
|
+
declare const SDK_VERSION: string;
|
|
34
|
+
/** Sent on every SDK request: space-separated `name/version` tokens. */
|
|
35
|
+
declare const CLIENT_HEADER = "X-Ecomweb-Client";
|
|
36
|
+
/** This SDK's own token, `@ecomweb/sdk/<version>`. */
|
|
37
|
+
declare const SDK_CLIENT_TOKEN: string;
|
|
38
|
+
/**
|
|
39
|
+
* The `X-Ecomweb-Client` value: `clientInfo` (a caller's own tokens, such as
|
|
40
|
+
* `@ecomweb/storefront-kit/0.14.0`) followed by this SDK's token.
|
|
41
|
+
*/
|
|
42
|
+
declare function clientHeaderValue(clientInfo?: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Wraps an HTTP client so every request carries `X-Ecomweb-Client`. A header
|
|
45
|
+
* the caller already set wins, and a client wrapped once is not wrapped again.
|
|
46
|
+
*/
|
|
47
|
+
declare function withClientHeader(http: IHttpClient, clientInfo?: string): IHttpClient;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The error thrown when the API answers with an error. Carries the HTTP status and the API's error code.
|
|
51
|
+
*/
|
|
29
52
|
declare class ApiClientError extends Error {
|
|
53
|
+
/**
|
|
54
|
+
* The HTTP status code, or `0` when there was no response.
|
|
55
|
+
*/
|
|
30
56
|
statusCode: number;
|
|
57
|
+
/**
|
|
58
|
+
* The API's machine-readable error code, when it sent one.
|
|
59
|
+
*/
|
|
31
60
|
code?: string;
|
|
32
61
|
/** The business error's structured `details`, when the backend sent any. */
|
|
33
62
|
details?: unknown;
|
|
34
63
|
constructor(message: string, statusCode?: number, code?: string, details?: unknown);
|
|
35
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns the data of a successful response and throws on an error response.
|
|
67
|
+
*
|
|
68
|
+
* @param response - the response to read
|
|
69
|
+
* @returns The response data; throws {@link ApiClientError} when the API answers with an error
|
|
70
|
+
*/
|
|
36
71
|
declare function unwrap<T>(response: ApiResponse<T>): T;
|
|
72
|
+
/**
|
|
73
|
+
* Like {@link unwrap}, but resolves `null` for the statuses that mean "not found".
|
|
74
|
+
*
|
|
75
|
+
* @param response - the response to read
|
|
76
|
+
* @param nullStatusCodes - the statuses that resolve `null`, `[404]` by default
|
|
77
|
+
* @returns The response data, or `null` when the status is in `nullStatusCodes`; throws {@link ApiClientError} on any other API error
|
|
78
|
+
*/
|
|
37
79
|
declare function unwrapOrNull<T>(response: ApiResponse<T>, nullStatusCodes?: number[]): T | null;
|
|
80
|
+
/**
|
|
81
|
+
* Throws on an error response and returns nothing on success. Use it when you do not need the data.
|
|
82
|
+
*
|
|
83
|
+
* @param response - the response to check
|
|
84
|
+
*/
|
|
38
85
|
declare function ensureSuccess(response: ApiResponse<any>): void;
|
|
39
86
|
|
|
40
87
|
/**
|
|
@@ -1076,6 +1123,12 @@ interface InventoryQuantities {
|
|
|
1076
1123
|
}
|
|
1077
1124
|
/** What is physically held: everything except incoming. */
|
|
1078
1125
|
declare function onHand(level: InventoryQuantities): number;
|
|
1126
|
+
/**
|
|
1127
|
+
* Adds up the stock that cannot be sold: damaged, quality control, safety stock and other.
|
|
1128
|
+
*
|
|
1129
|
+
* @param level - the quantities of one variant at one location
|
|
1130
|
+
* @returns The total unavailable quantity
|
|
1131
|
+
*/
|
|
1079
1132
|
declare function unavailable(level: Pick<InventoryQuantities, UnavailableState>): number;
|
|
1080
1133
|
/** One row of `GET /inventory/levels`: a variant at a location. */
|
|
1081
1134
|
interface InventoryLevelRow extends InventoryQuantities {
|
|
@@ -3144,8 +3197,27 @@ declare const themeSchemaSchema: z.ZodArray<z.ZodObject<{
|
|
|
3144
3197
|
* an Error whose message lists every problem, readable in a build log.
|
|
3145
3198
|
*/
|
|
3146
3199
|
declare function parseThemeSchema(input: unknown): ThemeSchema;
|
|
3200
|
+
/**
|
|
3201
|
+
* Lists every setting in a theme schema, across all groups, leaving out headers and other non-setting entries.
|
|
3202
|
+
*
|
|
3203
|
+
* @param schema - the theme schema
|
|
3204
|
+
* @returns The settings in schema order
|
|
3205
|
+
*/
|
|
3147
3206
|
declare function themeSettings(schema: ThemeSchema): ThemeSetting[];
|
|
3207
|
+
/**
|
|
3208
|
+
* Builds the default value of every setting in a theme schema.
|
|
3209
|
+
*
|
|
3210
|
+
* @param schema - the theme schema
|
|
3211
|
+
* @returns A map from setting id to its default, or `null` when a setting has none
|
|
3212
|
+
*/
|
|
3148
3213
|
declare function themeDefaults(schema: ThemeSchema): ThemeValues;
|
|
3214
|
+
/**
|
|
3215
|
+
* Checks a set of saved theme values against a theme schema. Settings with no value are skipped.
|
|
3216
|
+
*
|
|
3217
|
+
* @param schema - the theme schema
|
|
3218
|
+
* @param input - the values to check, as an object keyed by setting id
|
|
3219
|
+
* @returns The accepted values and a list of per-setting errors
|
|
3220
|
+
*/
|
|
3149
3221
|
declare function validateThemeValues(schema: ThemeSchema, input: unknown): {
|
|
3150
3222
|
values: Record<string, ThemeValue>;
|
|
3151
3223
|
errors: ThemeValueError[];
|
|
@@ -3229,6 +3301,12 @@ declare const themeMigrationSchema: z.ZodObject<{
|
|
|
3229
3301
|
value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
|
|
3230
3302
|
}, z.core.$strict>], "op">>;
|
|
3231
3303
|
}, z.core.$strict>;
|
|
3304
|
+
/**
|
|
3305
|
+
* Parses and validates a theme migration definition.
|
|
3306
|
+
*
|
|
3307
|
+
* @param input - the unparsed migration
|
|
3308
|
+
* @returns The validated migration; throws an `Error` listing the problems when it is invalid
|
|
3309
|
+
*/
|
|
3232
3310
|
declare function parseThemeMigration(input: unknown): ThemeMigration;
|
|
3233
3311
|
/** Runs the steps in order over a copy of `input`. */
|
|
3234
3312
|
declare function applyThemeMigration(input: Record<string, unknown>, migration: ThemeMigration): {
|
|
@@ -3643,9 +3721,37 @@ declare const DEFAULT_BUCKET = "public-cdn";
|
|
|
3643
3721
|
* dynamic `process.env[key]` read is not inlined.
|
|
3644
3722
|
*/
|
|
3645
3723
|
declare function assetBaseUrl(): string;
|
|
3724
|
+
/**
|
|
3725
|
+
* Tells whether image resizing is on. Controlled by `NEXT_PUBLIC_ENABLE_IMAGE_TRANSFORMATIONS`; when unset it is on, except for a local asset host.
|
|
3726
|
+
*
|
|
3727
|
+
* @returns `true` when image URLs should use the resizing endpoint
|
|
3728
|
+
*/
|
|
3646
3729
|
declare function transformationsEnabled(): boolean;
|
|
3730
|
+
/**
|
|
3731
|
+
* Builds the query string for an image resize request.
|
|
3732
|
+
*
|
|
3733
|
+
* @param opts - the resize options; unset or non-finite values are left out
|
|
3734
|
+
* @returns The query string including the leading `?`, or an empty string when there is nothing to add
|
|
3735
|
+
*/
|
|
3647
3736
|
declare function buildTransformQuery(opts?: ImageTransformOptions): string;
|
|
3737
|
+
/**
|
|
3738
|
+
* Builds the URL of a resized version of a stored image. Defaults to `resize=cover` and `quality=80`.
|
|
3739
|
+
*
|
|
3740
|
+
* @param baseUrl - the origin that serves storage objects
|
|
3741
|
+
* @param bucket - the storage bucket
|
|
3742
|
+
* @param path - the object path inside the bucket
|
|
3743
|
+
* @param opts - resize options that override the defaults
|
|
3744
|
+
* @returns The resized image URL
|
|
3745
|
+
*/
|
|
3648
3746
|
declare function toRenderUrl(baseUrl: string, bucket: string, path: string, opts?: ImageTransformOptions): string;
|
|
3747
|
+
/**
|
|
3748
|
+
* Builds the URL of the original, unresized stored image.
|
|
3749
|
+
*
|
|
3750
|
+
* @param baseUrl - the origin that serves storage objects
|
|
3751
|
+
* @param bucket - the storage bucket
|
|
3752
|
+
* @param path - the object path inside the bucket
|
|
3753
|
+
* @returns The original image URL
|
|
3754
|
+
*/
|
|
3649
3755
|
declare function toObjectUrl(baseUrl: string, bucket: string, path: string): string;
|
|
3650
3756
|
/**
|
|
3651
3757
|
* Pull bucket + object path out of a storage URL, whatever host it names.
|
|
@@ -3673,6 +3779,8 @@ declare function fromObjectPublicUrlToRender(publicUrl: string, opts?: ImageTran
|
|
|
3673
3779
|
*/
|
|
3674
3780
|
declare function resolveAssetUrl(imagePathOrUrl: string | null | undefined, opts?: ImageTransformOptions, bucket?: string, baseUrl?: string): string | null;
|
|
3675
3781
|
/**
|
|
3782
|
+
* Resolves a stored image URL to the asset host, resized when options are given.
|
|
3783
|
+
*
|
|
3676
3784
|
* @deprecated Renamed to {@link resolveAssetUrl}. The old name described a
|
|
3677
3785
|
* Supabase-specific rewrite; the implementation is no longer Supabase-aware.
|
|
3678
3786
|
* Kept so existing callers keep compiling.
|
|
@@ -3734,10 +3842,29 @@ type ProductDetail = Product & {
|
|
|
3734
3842
|
metafields?: StorefrontMetafields;
|
|
3735
3843
|
} & WithSeoMetadata$3;
|
|
3736
3844
|
|
|
3845
|
+
/**
|
|
3846
|
+
* Products of a store, reached through `sdk.products`.
|
|
3847
|
+
*/
|
|
3737
3848
|
declare class ProductsApi {
|
|
3738
3849
|
private http;
|
|
3739
3850
|
constructor(http: IHttpClient);
|
|
3851
|
+
/**
|
|
3852
|
+
* Gets one product by id.
|
|
3853
|
+
*
|
|
3854
|
+
* @param storeRef - the store's ref or handle
|
|
3855
|
+
* @param productId - the product id
|
|
3856
|
+
* @param query - optional fields to include
|
|
3857
|
+
* @returns The product, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
3858
|
+
*/
|
|
3740
3859
|
getById(storeRef: string, productId: number, query?: ProductQueryParams): Promise<ProductDetail | null>;
|
|
3860
|
+
/**
|
|
3861
|
+
* Gets one product by slug.
|
|
3862
|
+
*
|
|
3863
|
+
* @param storeRef - the store's ref or handle
|
|
3864
|
+
* @param slug - the product slug
|
|
3865
|
+
* @param query - optional fields to include
|
|
3866
|
+
* @returns The product, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
3867
|
+
*/
|
|
3741
3868
|
getBySlug(storeRef: string, slug: string, query?: ProductQueryParams): Promise<ProductDetail | null>;
|
|
3742
3869
|
}
|
|
3743
3870
|
|
|
@@ -3956,6 +4083,12 @@ declare const RULE_FIELDS: readonly RuleField[];
|
|
|
3956
4083
|
* before the request rather than after it is rejected. */
|
|
3957
4084
|
declare const MAX_RULES_PER_SET = 25;
|
|
3958
4085
|
declare const MAX_RULE_VALUE_ENTRIES = 100;
|
|
4086
|
+
/**
|
|
4087
|
+
* Tells whether a name is a field that smart collection rules can use.
|
|
4088
|
+
*
|
|
4089
|
+
* @param name - the name to test
|
|
4090
|
+
* @returns `true` when it is a rule field
|
|
4091
|
+
*/
|
|
3959
4092
|
declare function isRuleField(name: string): name is RuleField;
|
|
3960
4093
|
/** The operators a field accepts, in display order. Empty for unknown fields. */
|
|
3961
4094
|
declare function operatorsForField(field: string): RuleOperator[];
|
|
@@ -4020,11 +4153,36 @@ interface CollectionQueryParams extends BaseQueryParams {
|
|
|
4020
4153
|
include_product_count?: boolean;
|
|
4021
4154
|
}
|
|
4022
4155
|
|
|
4156
|
+
/**
|
|
4157
|
+
* Product collections of a store, reached through `sdk.collections`.
|
|
4158
|
+
*/
|
|
4023
4159
|
declare class CollectionsApi {
|
|
4024
4160
|
private http;
|
|
4025
4161
|
constructor(http: IHttpClient);
|
|
4162
|
+
/**
|
|
4163
|
+
* Lists collections, one page at a time.
|
|
4164
|
+
*
|
|
4165
|
+
* @param storeRef - the store's ref or handle
|
|
4166
|
+
* @param params - filters, sorting and paging
|
|
4167
|
+
* @returns A page of collections; throws {@link ApiClientError} when the API answers with an error
|
|
4168
|
+
*/
|
|
4026
4169
|
getAllPaginated(storeRef: string, params?: CollectionQueryParams): Promise<PaginatedResponse<Collection>>;
|
|
4170
|
+
/**
|
|
4171
|
+
* Lists up to 100 collections in one call.
|
|
4172
|
+
*
|
|
4173
|
+
* @param storeRef - the store's ref or handle
|
|
4174
|
+
* @param ids - limit the result to these collection ids
|
|
4175
|
+
* @returns The collections; throws {@link ApiClientError} when the API answers with an error
|
|
4176
|
+
*/
|
|
4027
4177
|
getAll(storeRef: string, ids?: number[]): Promise<Collection[]>;
|
|
4178
|
+
/**
|
|
4179
|
+
* Gets one collection by slug.
|
|
4180
|
+
*
|
|
4181
|
+
* @param storeRef - the store's ref or handle
|
|
4182
|
+
* @param slug - the collection slug
|
|
4183
|
+
* @param query - `include_seo_metadata` adds the SEO fields
|
|
4184
|
+
* @returns The collection, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4185
|
+
*/
|
|
4028
4186
|
getBySlug(storeRef: string, slug: string, query?: {
|
|
4029
4187
|
include_seo_metadata?: boolean;
|
|
4030
4188
|
}): Promise<Collection | null>;
|
|
@@ -4036,12 +4194,43 @@ interface CategoryQueryParams extends BaseQueryParams {
|
|
|
4036
4194
|
parent_id?: number | null;
|
|
4037
4195
|
}
|
|
4038
4196
|
|
|
4197
|
+
/**
|
|
4198
|
+
* Product categories of a store, reached through `sdk.categories`.
|
|
4199
|
+
*/
|
|
4039
4200
|
declare class CategoriesApi {
|
|
4040
4201
|
private http;
|
|
4041
4202
|
constructor(http: IHttpClient);
|
|
4203
|
+
/**
|
|
4204
|
+
* Lists categories, one page at a time.
|
|
4205
|
+
*
|
|
4206
|
+
* @param storeRef - the store's ref or handle
|
|
4207
|
+
* @param params - filters, sorting and paging
|
|
4208
|
+
* @returns A page of categories; throws {@link ApiClientError} when the API answers with an error
|
|
4209
|
+
*/
|
|
4042
4210
|
getAllPaginated(storeRef: string, params?: CategoryQueryParams): Promise<PaginatedResponse<Category>>;
|
|
4211
|
+
/**
|
|
4212
|
+
* Lists up to 1,000 categories in one call.
|
|
4213
|
+
*
|
|
4214
|
+
* @param storeRef - the store's ref or handle
|
|
4215
|
+
* @param activeOnly - `true` (the default) returns only active categories
|
|
4216
|
+
* @returns The categories; throws {@link ApiClientError} when the API answers with an error
|
|
4217
|
+
*/
|
|
4043
4218
|
getAll(storeRef: string, activeOnly?: boolean): Promise<Category[]>;
|
|
4219
|
+
/**
|
|
4220
|
+
* Gets one category by id.
|
|
4221
|
+
*
|
|
4222
|
+
* @param storeRef - the store's ref or handle
|
|
4223
|
+
* @param categoryId - the category id
|
|
4224
|
+
* @returns The category, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4225
|
+
*/
|
|
4044
4226
|
getById(storeRef: string, categoryId: number): Promise<Category | null>;
|
|
4227
|
+
/**
|
|
4228
|
+
* Gets one category by slug.
|
|
4229
|
+
*
|
|
4230
|
+
* @param storeRef - the store's ref or handle
|
|
4231
|
+
* @param slug - the category slug
|
|
4232
|
+
* @returns The category, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4233
|
+
*/
|
|
4045
4234
|
getBySlug(storeRef: string, slug: string): Promise<Category | null>;
|
|
4046
4235
|
}
|
|
4047
4236
|
|
|
@@ -4105,25 +4294,72 @@ interface UpdateCartItemRequest {
|
|
|
4105
4294
|
quantity: number;
|
|
4106
4295
|
}
|
|
4107
4296
|
|
|
4297
|
+
/**
|
|
4298
|
+
* A shopper's cart: a guest cart keyed by a session id, or the signed-in customer's cart, reached through `sdk.cart`.
|
|
4299
|
+
*/
|
|
4108
4300
|
declare class CartApi {
|
|
4109
4301
|
private publicHttp;
|
|
4110
4302
|
private authHttp;
|
|
4111
4303
|
constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
|
|
4112
4304
|
private client;
|
|
4113
4305
|
private basePath;
|
|
4306
|
+
/**
|
|
4307
|
+
* Gets the shopper's cart.
|
|
4308
|
+
*
|
|
4309
|
+
* @param storeRef - the store's ref or handle
|
|
4310
|
+
* @param sessionId - the guest cart session id
|
|
4311
|
+
* @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
|
|
4312
|
+
* @returns The cart, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4313
|
+
*/
|
|
4114
4314
|
getCart(storeRef: string, sessionId: string, isAuth: boolean): Promise<CartApiResponse | null>;
|
|
4315
|
+
/**
|
|
4316
|
+
* Adds a product variant to the cart.
|
|
4317
|
+
*
|
|
4318
|
+
* @param storeRef - the store's ref or handle
|
|
4319
|
+
* @param data - the variant and the quantity
|
|
4320
|
+
* @param sessionId - the guest cart session id
|
|
4321
|
+
* @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
|
|
4322
|
+
* @returns The cart id and the added item; throws {@link ApiClientError} when the API answers with an error
|
|
4323
|
+
*/
|
|
4115
4324
|
addItem(storeRef: string, data: AddToCartRequest, sessionId: string, isAuth: boolean): Promise<{
|
|
4116
4325
|
cart_id: string;
|
|
4117
4326
|
item: CartApiItem;
|
|
4118
4327
|
}>;
|
|
4328
|
+
/**
|
|
4329
|
+
* Changes the quantity of a cart line.
|
|
4330
|
+
*
|
|
4331
|
+
* @param storeRef - the store's ref or handle
|
|
4332
|
+
* @param itemId - the cart line id
|
|
4333
|
+
* @param data - the new quantity
|
|
4334
|
+
* @param sessionId - the guest cart session id
|
|
4335
|
+
* @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
|
|
4336
|
+
* @returns The cart id and the updated item (`null` when the line was removed); throws {@link ApiClientError} when the API answers with an error
|
|
4337
|
+
*/
|
|
4119
4338
|
updateItem(storeRef: string, itemId: string, data: UpdateCartItemRequest, sessionId: string, isAuth: boolean): Promise<{
|
|
4120
4339
|
cart_id: string;
|
|
4121
4340
|
item: CartApiItem | null;
|
|
4122
4341
|
}>;
|
|
4342
|
+
/**
|
|
4343
|
+
* Removes a line from the cart.
|
|
4344
|
+
*
|
|
4345
|
+
* @param storeRef - the store's ref or handle
|
|
4346
|
+
* @param itemId - the cart line id
|
|
4347
|
+
* @param sessionId - the guest cart session id
|
|
4348
|
+
* @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
|
|
4349
|
+
* @returns The cart id and the removed line's id; throws {@link ApiClientError} when the API answers with an error
|
|
4350
|
+
*/
|
|
4123
4351
|
removeItem(storeRef: string, itemId: string, sessionId: string, isAuth: boolean): Promise<{
|
|
4124
4352
|
cartId: string;
|
|
4125
4353
|
itemId: string;
|
|
4126
4354
|
}>;
|
|
4355
|
+
/**
|
|
4356
|
+
* Empties the cart.
|
|
4357
|
+
*
|
|
4358
|
+
* @param storeRef - the store's ref or handle
|
|
4359
|
+
* @param sessionId - the guest cart session id
|
|
4360
|
+
* @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
|
|
4361
|
+
* @returns The cart id; throws {@link ApiClientError} when the API answers with an error
|
|
4362
|
+
*/
|
|
4127
4363
|
clear(storeRef: string, sessionId: string, isAuth: boolean): Promise<{
|
|
4128
4364
|
cart_id: string;
|
|
4129
4365
|
}>;
|
|
@@ -4225,6 +4461,9 @@ interface GuestOrderLookupParams {
|
|
|
4225
4461
|
customer_phone?: string;
|
|
4226
4462
|
}
|
|
4227
4463
|
|
|
4464
|
+
/**
|
|
4465
|
+
* Placing orders, and reading them back as a guest or as the signed-in customer, reached through `sdk.orders`.
|
|
4466
|
+
*/
|
|
4228
4467
|
declare class OrdersApi {
|
|
4229
4468
|
private publicHttp;
|
|
4230
4469
|
private authHttp;
|
|
@@ -4235,7 +4474,22 @@ declare class OrdersApi {
|
|
|
4235
4474
|
* the same way. Returns null for "not found".
|
|
4236
4475
|
*/
|
|
4237
4476
|
lookupGuest(storeRef: string, params: GuestOrderLookupParams): Promise<OrderWithItems | null>;
|
|
4477
|
+
/**
|
|
4478
|
+
* Places an order.
|
|
4479
|
+
*
|
|
4480
|
+
* @param storeRef - the store's ref or handle
|
|
4481
|
+
* @param data - the order details
|
|
4482
|
+
* @param isAuth - `true` to place it as the signed-in customer, `false` as a guest
|
|
4483
|
+
* @returns The created order with its items; throws {@link ApiClientError} when the API answers with an error
|
|
4484
|
+
*/
|
|
4238
4485
|
create(storeRef: string, data: CreateOrderRequest, isAuth: boolean): Promise<OrderWithItems>;
|
|
4486
|
+
/**
|
|
4487
|
+
* Lists the signed-in customer's orders, newest first by default.
|
|
4488
|
+
*
|
|
4489
|
+
* @param storeRef - the store's ref or handle
|
|
4490
|
+
* @param params - search, status filter, sorting and paging (`page`, or `limit` and `offset`)
|
|
4491
|
+
* @returns A page of orders; throws {@link ApiClientError} when the API answers with an error
|
|
4492
|
+
*/
|
|
4239
4493
|
listCustomerOrders(storeRef: string, params?: Partial<CustomerOrderFilter> & {
|
|
4240
4494
|
page?: number;
|
|
4241
4495
|
}): Promise<PaginatedResponse<Order>>;
|
|
@@ -4279,20 +4533,74 @@ interface BlogTagQueryParams extends BaseQueryParams {
|
|
|
4279
4533
|
include_post_counts?: boolean;
|
|
4280
4534
|
}
|
|
4281
4535
|
|
|
4536
|
+
/**
|
|
4537
|
+
* Published blog posts, categories, tags and comments of a store, reached through `sdk.blog`.
|
|
4538
|
+
*/
|
|
4282
4539
|
declare class BlogApi {
|
|
4283
4540
|
private publicHttp;
|
|
4284
4541
|
private authHttp;
|
|
4285
4542
|
constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
|
|
4543
|
+
/**
|
|
4544
|
+
* Lists published blog posts.
|
|
4545
|
+
*
|
|
4546
|
+
* @param storeRef - the store's ref or handle
|
|
4547
|
+
* @param query - filters, sorting and paging
|
|
4548
|
+
* @returns A page of posts; throws {@link ApiClientError} when the API answers with an error
|
|
4549
|
+
*/
|
|
4286
4550
|
getPosts(storeRef: string, query?: Partial<BlogPostQueryParams>): Promise<PaginatedResponse<BlogPost>>;
|
|
4551
|
+
/**
|
|
4552
|
+
* Gets one published blog post by its slug.
|
|
4553
|
+
*
|
|
4554
|
+
* @param storeRef - the store's ref or handle
|
|
4555
|
+
* @param slug - the post slug
|
|
4556
|
+
* @param options - `incrementView` counts a view; `include_seo_metadata` and `include_products` add those fields
|
|
4557
|
+
* @returns The post, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4558
|
+
*/
|
|
4287
4559
|
getPostBySlug(storeRef: string, slug: string, options?: {
|
|
4288
4560
|
incrementView?: boolean;
|
|
4289
4561
|
include_seo_metadata?: boolean;
|
|
4290
4562
|
include_products?: boolean;
|
|
4291
4563
|
}): Promise<BlogPost | null>;
|
|
4564
|
+
/**
|
|
4565
|
+
* Lists blog categories.
|
|
4566
|
+
*
|
|
4567
|
+
* @param storeRef - the store's ref or handle
|
|
4568
|
+
* @param query - filters and paging
|
|
4569
|
+
* @returns A page of categories; throws {@link ApiClientError} when the API answers with an error
|
|
4570
|
+
*/
|
|
4292
4571
|
getCategories(storeRef: string, query?: BlogCategoryQueryParams): Promise<PaginatedResponse<BlogCategory>>;
|
|
4572
|
+
/**
|
|
4573
|
+
* Lists blog tags.
|
|
4574
|
+
*
|
|
4575
|
+
* @param storeRef - the store's ref or handle
|
|
4576
|
+
* @param query - filters and paging
|
|
4577
|
+
* @returns A page of tags; throws {@link ApiClientError} when the API answers with an error
|
|
4578
|
+
*/
|
|
4293
4579
|
getTags(storeRef: string, query?: BlogTagQueryParams): Promise<PaginatedResponse<BlogTag>>;
|
|
4580
|
+
/**
|
|
4581
|
+
* Lists the approved comments of a post, as an anonymous visitor.
|
|
4582
|
+
*
|
|
4583
|
+
* @param storeRef - the store's ref or handle
|
|
4584
|
+
* @param postId - the post id
|
|
4585
|
+
* @returns The comments; throws {@link ApiClientError} when the API answers with an error
|
|
4586
|
+
*/
|
|
4294
4587
|
getPostComments(storeRef: string, postId: number): Promise<any[]>;
|
|
4588
|
+
/**
|
|
4589
|
+
* Lists the approved comments of a post, sending the signed-in customer's credentials.
|
|
4590
|
+
*
|
|
4591
|
+
* @param storeRef - the store's ref or handle
|
|
4592
|
+
* @param postId - the post id
|
|
4593
|
+
* @returns The comments; throws {@link ApiClientError} when the API answers with an error
|
|
4594
|
+
*/
|
|
4295
4595
|
getPostCommentsAuth(storeRef: string, postId: number): Promise<any[]>;
|
|
4596
|
+
/**
|
|
4597
|
+
* Submits a comment on a post, as the signed-in customer. It may wait for moderation.
|
|
4598
|
+
*
|
|
4599
|
+
* @param storeRef - the store's ref or handle
|
|
4600
|
+
* @param postId - the post id
|
|
4601
|
+
* @param data - the author name, the text, and optionally a website and the parent comment id
|
|
4602
|
+
* @returns The created comment; throws {@link ApiClientError} when the API answers with an error
|
|
4603
|
+
*/
|
|
4296
4604
|
submitComment(storeRef: string, postId: number, data: {
|
|
4297
4605
|
author_name: string;
|
|
4298
4606
|
content: string;
|
|
@@ -4348,14 +4656,31 @@ type StoreByDomainInfo = StoreConfigurationInfo & {
|
|
|
4348
4656
|
store_preview_token?: string | null;
|
|
4349
4657
|
};
|
|
4350
4658
|
|
|
4659
|
+
/**
|
|
4660
|
+
* Looking up a store and its public configuration, reached through `sdk.stores`.
|
|
4661
|
+
*/
|
|
4351
4662
|
declare class StoresApi {
|
|
4352
4663
|
private http;
|
|
4353
4664
|
constructor(http: IHttpClient);
|
|
4665
|
+
/**
|
|
4666
|
+
* Gets a store's public information, by default with its configuration, settings and embedded scripts.
|
|
4667
|
+
*
|
|
4668
|
+
* @param storeRef - the store's ref or handle
|
|
4669
|
+
* @param options - set `includeConfig`, `includeSettings` or `includeEmbeddedScripts` to `false` to leave that part out
|
|
4670
|
+
* @param requestOptions - extra request options, passed to the HTTP client only when given
|
|
4671
|
+
* @returns The store information, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4672
|
+
*/
|
|
4354
4673
|
getById(storeRef: string, options?: {
|
|
4355
4674
|
includeConfig?: boolean;
|
|
4356
4675
|
includeSettings?: boolean;
|
|
4357
4676
|
includeEmbeddedScripts?: boolean;
|
|
4358
4677
|
}, requestOptions?: RequestOptions): Promise<StoreConfigurationInfo | null>;
|
|
4678
|
+
/**
|
|
4679
|
+
* Gets a store by its subdomain.
|
|
4680
|
+
*
|
|
4681
|
+
* @param subdomain - the store's subdomain
|
|
4682
|
+
* @returns The store, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
4683
|
+
*/
|
|
4359
4684
|
getBySubdomain(subdomain: string): Promise<Store | null>;
|
|
4360
4685
|
/**
|
|
4361
4686
|
* The store `domain` serves. `options` (e.g. an `x-store-preview` header,
|
|
@@ -4364,6 +4689,9 @@ declare class StoresApi {
|
|
|
4364
4689
|
getByDomain(domain: string, options?: RequestOptions): Promise<StoreByDomainInfo | null>;
|
|
4365
4690
|
}
|
|
4366
4691
|
|
|
4692
|
+
/**
|
|
4693
|
+
* Theme previews opened from the dashboard, reached through `sdk.themes`.
|
|
4694
|
+
*/
|
|
4367
4695
|
declare class ThemesApi {
|
|
4368
4696
|
private http;
|
|
4369
4697
|
constructor(http: IHttpClient);
|
|
@@ -4387,6 +4715,9 @@ interface MetaobjectListResult {
|
|
|
4387
4715
|
next_cursor: string | null;
|
|
4388
4716
|
}
|
|
4389
4717
|
|
|
4718
|
+
/**
|
|
4719
|
+
* Custom structured content (metaobject entries) a store publishes, reached through `sdk.metaobjects`.
|
|
4720
|
+
*/
|
|
4390
4721
|
declare class MetaobjectsApi {
|
|
4391
4722
|
private publicHttp;
|
|
4392
4723
|
private authHttp;
|
|
@@ -4630,11 +4961,35 @@ type CategorySearchResponse = z.infer<typeof categorySearchResponseSchema>;
|
|
|
4630
4961
|
type BlogSearchParams = z.infer<typeof searchBlogParamsSchema>;
|
|
4631
4962
|
type BlogSearchResponse = z.infer<typeof blogSearchResponseSchema>;
|
|
4632
4963
|
|
|
4964
|
+
/**
|
|
4965
|
+
* Search over a store's products and blog posts, reached through `sdk.search`.
|
|
4966
|
+
*/
|
|
4633
4967
|
declare class SearchApi {
|
|
4634
4968
|
private http;
|
|
4635
4969
|
constructor(http: IHttpClient);
|
|
4970
|
+
/**
|
|
4971
|
+
* Searches products.
|
|
4972
|
+
*
|
|
4973
|
+
* @param storeRef - the store's ref or handle
|
|
4974
|
+
* @param params - the query, filters and paging
|
|
4975
|
+
* @returns The matching products; throws {@link ApiClientError} when the API answers with an error
|
|
4976
|
+
*/
|
|
4636
4977
|
searchCatalog(storeRef: string, params: ProductSearchParams): Promise<ProductSearchResponse>;
|
|
4978
|
+
/**
|
|
4979
|
+
* Suggests product matches while the shopper is typing.
|
|
4980
|
+
*
|
|
4981
|
+
* @param storeRef - the store's ref or handle
|
|
4982
|
+
* @param params - the partial query and the suggestion limit
|
|
4983
|
+
* @returns The suggestions; throws {@link ApiClientError} when the API answers with an error
|
|
4984
|
+
*/
|
|
4637
4985
|
autocompleteCatalog<T>(storeRef: string, params: AutocompleteParams): Promise<T>;
|
|
4986
|
+
/**
|
|
4987
|
+
* Searches published blog posts.
|
|
4988
|
+
*
|
|
4989
|
+
* @param storeRef - the store's ref or handle
|
|
4990
|
+
* @param params - the query and paging
|
|
4991
|
+
* @returns The matching posts; throws {@link ApiClientError} when the API answers with an error
|
|
4992
|
+
*/
|
|
4638
4993
|
searchBlog(storeRef: string, params: BlogSearchParams): Promise<BlogSearchResponse>;
|
|
4639
4994
|
}
|
|
4640
4995
|
|
|
@@ -4757,6 +5112,9 @@ interface ShippingQuoteChangedDetails {
|
|
|
4757
5112
|
options: ShippingOption[];
|
|
4758
5113
|
}
|
|
4759
5114
|
|
|
5115
|
+
/**
|
|
5116
|
+
* Shipping areas and shipping rates for a store, reached through `sdk.shipping`.
|
|
5117
|
+
*/
|
|
4760
5118
|
declare class ShippingApi {
|
|
4761
5119
|
private http;
|
|
4762
5120
|
constructor(http: IHttpClient);
|
|
@@ -4766,6 +5124,13 @@ declare class ShippingApi {
|
|
|
4766
5124
|
* Vietnam is 3,355 rows and about 900 KB. Prefer a filter.
|
|
4767
5125
|
*/
|
|
4768
5126
|
listLocationAreas(storeRef: string, query?: LocationAreaQuery): Promise<LocationAreasResponse>;
|
|
5127
|
+
/**
|
|
5128
|
+
* Works out the shipping options and prices for a cart and a destination.
|
|
5129
|
+
*
|
|
5130
|
+
* @param storeRef - the store's ref or handle
|
|
5131
|
+
* @param data - the destination and the cart contents
|
|
5132
|
+
* @returns The available shipping options; throws {@link ApiClientError} when the API answers with an error
|
|
5133
|
+
*/
|
|
4769
5134
|
calculate(storeRef: string, data: ShippingCalculationRequest): Promise<ShippingOption[]>;
|
|
4770
5135
|
}
|
|
4771
5136
|
|
|
@@ -4815,10 +5180,27 @@ interface PromotionSuggestionsResponse {
|
|
|
4815
5180
|
promotions: PromotionSuggestion[];
|
|
4816
5181
|
}
|
|
4817
5182
|
|
|
5183
|
+
/**
|
|
5184
|
+
* Promotion codes and offers of a store, reached through `sdk.promotions`.
|
|
5185
|
+
*/
|
|
4818
5186
|
declare class PromotionsApi {
|
|
4819
5187
|
private http;
|
|
4820
5188
|
constructor(http: IHttpClient);
|
|
5189
|
+
/**
|
|
5190
|
+
* Checks a promotion code against a cart.
|
|
5191
|
+
*
|
|
5192
|
+
* @param storeRef - the store's ref or handle
|
|
5193
|
+
* @param data - the code and the cart details
|
|
5194
|
+
* @returns The validation result; throws {@link ApiClientError} when the API answers with an error
|
|
5195
|
+
*/
|
|
4821
5196
|
validate(storeRef: string, data: ValidatePromotionCodeRequest): Promise<ValidatePromotionCodeResponse>;
|
|
5197
|
+
/**
|
|
5198
|
+
* Lists promotions the shopper could use, optionally for a given cart subtotal.
|
|
5199
|
+
*
|
|
5200
|
+
* @param storeRef - the store's ref or handle
|
|
5201
|
+
* @param subtotal - the cart subtotal in the store's currency
|
|
5202
|
+
* @returns The suggested promotions; throws {@link ApiClientError} when the API answers with an error
|
|
5203
|
+
*/
|
|
4822
5204
|
getSuggestions(storeRef: string, subtotal?: number): Promise<PromotionSuggestionsResponse>;
|
|
4823
5205
|
}
|
|
4824
5206
|
|
|
@@ -4847,9 +5229,18 @@ interface PaymentMethod {
|
|
|
4847
5229
|
provider_code?: string | null;
|
|
4848
5230
|
}
|
|
4849
5231
|
|
|
5232
|
+
/**
|
|
5233
|
+
* The payment methods a store accepts, reached through `sdk.paymentMethods`.
|
|
5234
|
+
*/
|
|
4850
5235
|
declare class PaymentMethodsApi {
|
|
4851
5236
|
private http;
|
|
4852
5237
|
constructor(http: IHttpClient);
|
|
5238
|
+
/**
|
|
5239
|
+
* Lists the payment methods the store has turned on.
|
|
5240
|
+
*
|
|
5241
|
+
* @param storeRef - the store's ref or handle
|
|
5242
|
+
* @returns The enabled payment methods; throws {@link ApiClientError} when the API answers with an error
|
|
5243
|
+
*/
|
|
4853
5244
|
getEnabled(storeRef: string): Promise<PaymentMethod[]>;
|
|
4854
5245
|
}
|
|
4855
5246
|
|
|
@@ -4955,13 +5346,55 @@ interface BatchOrderReviewInvitationsResult {
|
|
|
4955
5346
|
[order_number: string]: OrderReviewInvitationSummary[];
|
|
4956
5347
|
}
|
|
4957
5348
|
|
|
5349
|
+
/**
|
|
5350
|
+
* Product reviews and the invitations that ask customers to write them, reached through `sdk.reviews`.
|
|
5351
|
+
*/
|
|
4958
5352
|
declare class ReviewsApi {
|
|
4959
5353
|
private http;
|
|
4960
5354
|
constructor(http: IHttpClient);
|
|
5355
|
+
/**
|
|
5356
|
+
* Lists the published reviews of a product.
|
|
5357
|
+
*
|
|
5358
|
+
* @param storeRef - the store's ref or handle
|
|
5359
|
+
* @param productId - the product id
|
|
5360
|
+
* @param query - filters and paging
|
|
5361
|
+
* @returns A page of reviews; throws {@link ApiClientError} when the API answers with an error
|
|
5362
|
+
*/
|
|
4961
5363
|
getProductReviews(storeRef: string, productId: string | number, query?: Omit<ProductReviewFilters, "product_id">): Promise<PaginatedReviewsResponse>;
|
|
5364
|
+
/**
|
|
5365
|
+
* Gets the public details behind a review invitation link.
|
|
5366
|
+
*
|
|
5367
|
+
* @param storeRef - the store's ref or handle
|
|
5368
|
+
* @param token - the token from the invitation link
|
|
5369
|
+
* @returns The invitation details; throws {@link ApiClientError} when the API answers with an error
|
|
5370
|
+
*/
|
|
4962
5371
|
getReviewInvitation(storeRef: string, token: string): Promise<ReviewInvitationPublicData>;
|
|
5372
|
+
/**
|
|
5373
|
+
* Lists the review invitations for one order.
|
|
5374
|
+
*
|
|
5375
|
+
* @param storeRef - the store's ref or handle
|
|
5376
|
+
* @param orderNumber - the order number
|
|
5377
|
+
* @param email - the email address on the order
|
|
5378
|
+
* @returns The invitation summaries; throws {@link ApiClientError} when the API answers with an error
|
|
5379
|
+
*/
|
|
4963
5380
|
getOrderReviewInvitations(storeRef: string, orderNumber: number | string, email: string): Promise<OrderReviewInvitationSummary[]>;
|
|
5381
|
+
/**
|
|
5382
|
+
* Lists the review invitations for several orders at once.
|
|
5383
|
+
*
|
|
5384
|
+
* @param storeRef - the store's ref or handle
|
|
5385
|
+
* @param orderNumbers - the order numbers
|
|
5386
|
+
* @param email - the email address on the orders
|
|
5387
|
+
* @returns The invitations grouped by order; throws {@link ApiClientError} when the API answers with an error
|
|
5388
|
+
*/
|
|
4964
5389
|
getBatchOrderReviewInvitations(storeRef: string, orderNumbers: (number | string)[], email: string): Promise<BatchOrderReviewInvitationsResult>;
|
|
5390
|
+
/**
|
|
5391
|
+
* Submits a review through an invitation link.
|
|
5392
|
+
*
|
|
5393
|
+
* @param storeRef - the store's ref or handle
|
|
5394
|
+
* @param token - the token from the invitation link
|
|
5395
|
+
* @param payload - the rating and review text
|
|
5396
|
+
* @returns The API's answer; throws {@link ApiClientError} when the API answers with an error
|
|
5397
|
+
*/
|
|
4965
5398
|
submitReviewInvitation(storeRef: string, token: string, payload: SubmitReviewInvitationPayload): Promise<any>;
|
|
4966
5399
|
}
|
|
4967
5400
|
|
|
@@ -4991,9 +5424,19 @@ interface UpsertCustomerForAuthPayload {
|
|
|
4991
5424
|
avatar_url?: string | null;
|
|
4992
5425
|
}
|
|
4993
5426
|
|
|
5427
|
+
/**
|
|
5428
|
+
* The signed-in customer's profile record, reached through `sdk.customers`.
|
|
5429
|
+
*/
|
|
4994
5430
|
declare class CustomersApi {
|
|
4995
5431
|
private http;
|
|
4996
5432
|
constructor(http: IHttpClient);
|
|
5433
|
+
/**
|
|
5434
|
+
* Creates the customer record for a newly signed-in user, or updates it when it exists.
|
|
5435
|
+
*
|
|
5436
|
+
* @param storeRef - the store's ref or handle
|
|
5437
|
+
* @param payload - the identity fields to store
|
|
5438
|
+
* @returns The customer, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5439
|
+
*/
|
|
4997
5440
|
upsertForAuth(storeRef: string, payload: UpsertCustomerForAuthPayload): Promise<ApiResponse<Customer>>;
|
|
4998
5441
|
/** The signed-in customer's metafields with customer access (spec §6.6). */
|
|
4999
5442
|
getMetafields(storeRef: string): Promise<StorefrontMetafields>;
|
|
@@ -5041,14 +5484,59 @@ interface CreateAddressDto {
|
|
|
5041
5484
|
interface UpdateAddressDto extends Partial<CreateAddressDto> {
|
|
5042
5485
|
}
|
|
5043
5486
|
|
|
5487
|
+
/**
|
|
5488
|
+
* Saved delivery addresses of the signed-in customer, reached through `sdk.addresses`.
|
|
5489
|
+
*/
|
|
5044
5490
|
declare class AddressesApi {
|
|
5045
5491
|
private http;
|
|
5046
5492
|
constructor(http: IHttpClient);
|
|
5493
|
+
/**
|
|
5494
|
+
* Lists the signed-in customer's saved addresses.
|
|
5495
|
+
*
|
|
5496
|
+
* @param storeRef - the store's ref or handle
|
|
5497
|
+
* @returns The addresses, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5498
|
+
*/
|
|
5047
5499
|
list(storeRef: string): Promise<Address[] | null>;
|
|
5500
|
+
/**
|
|
5501
|
+
* Gets one of the signed-in customer's saved addresses.
|
|
5502
|
+
*
|
|
5503
|
+
* @param storeRef - the store's ref or handle
|
|
5504
|
+
* @param addressId - the address id
|
|
5505
|
+
* @returns The address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5506
|
+
*/
|
|
5048
5507
|
getById(storeRef: string, addressId: number): Promise<Address | null>;
|
|
5508
|
+
/**
|
|
5509
|
+
* Saves a new address for the signed-in customer.
|
|
5510
|
+
*
|
|
5511
|
+
* @param storeRef - the store's ref or handle
|
|
5512
|
+
* @param data - the address fields
|
|
5513
|
+
* @returns The created address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5514
|
+
*/
|
|
5049
5515
|
create(storeRef: string, data: CreateAddressDto): Promise<Address | null>;
|
|
5516
|
+
/**
|
|
5517
|
+
* Updates one of the signed-in customer's saved addresses.
|
|
5518
|
+
*
|
|
5519
|
+
* @param storeRef - the store's ref or handle
|
|
5520
|
+
* @param addressId - the address id
|
|
5521
|
+
* @param data - the fields to change
|
|
5522
|
+
* @returns The updated address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5523
|
+
*/
|
|
5050
5524
|
update(storeRef: string, addressId: number, data: UpdateAddressDto): Promise<Address | null>;
|
|
5525
|
+
/**
|
|
5526
|
+
* Deletes one of the signed-in customer's saved addresses.
|
|
5527
|
+
*
|
|
5528
|
+
* @param storeRef - the store's ref or handle
|
|
5529
|
+
* @param addressId - the address id
|
|
5530
|
+
* @returns `true` when the API accepted the deletion, `false` otherwise; it does not throw
|
|
5531
|
+
*/
|
|
5051
5532
|
delete(storeRef: string, addressId: number): Promise<boolean>;
|
|
5533
|
+
/**
|
|
5534
|
+
* Makes a saved address the customer's default.
|
|
5535
|
+
*
|
|
5536
|
+
* @param storeRef - the store's ref or handle
|
|
5537
|
+
* @param addressId - the address id
|
|
5538
|
+
* @returns The updated address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5539
|
+
*/
|
|
5052
5540
|
setDefault(storeRef: string, addressId: number): Promise<Address | null>;
|
|
5053
5541
|
}
|
|
5054
5542
|
|
|
@@ -5061,10 +5549,27 @@ interface WithSeoMetadata {
|
|
|
5061
5549
|
}
|
|
5062
5550
|
type ContentPage = ContentPage$1 & WithSeoMetadata & WithMetafields;
|
|
5063
5551
|
|
|
5552
|
+
/**
|
|
5553
|
+
* Static content pages of a store, such as About or Shipping policy, reached through `sdk.contentPages`.
|
|
5554
|
+
*/
|
|
5064
5555
|
declare class ContentPagesApi {
|
|
5065
5556
|
private http;
|
|
5066
5557
|
constructor(http: IHttpClient);
|
|
5558
|
+
/**
|
|
5559
|
+
* Lists the published content pages.
|
|
5560
|
+
*
|
|
5561
|
+
* @param storeRef - the store's ref or handle
|
|
5562
|
+
* @returns A page of content pages; throws {@link ApiClientError} when the API answers with an error
|
|
5563
|
+
*/
|
|
5067
5564
|
getPublished(storeRef: string): Promise<PaginatedResponse<ContentPage>>;
|
|
5565
|
+
/**
|
|
5566
|
+
* Gets one published content page by slug.
|
|
5567
|
+
*
|
|
5568
|
+
* @param storeRef - the store's ref or handle
|
|
5569
|
+
* @param slug - the page slug
|
|
5570
|
+
* @param query - `include_seo_metadata` adds the SEO fields
|
|
5571
|
+
* @returns The page; throws {@link ApiClientError} when the API answers with an error
|
|
5572
|
+
*/
|
|
5068
5573
|
getBySlug(storeRef: string, slug: string, query?: {
|
|
5069
5574
|
include_seo_metadata?: boolean;
|
|
5070
5575
|
}): Promise<ContentPage>;
|
|
@@ -5095,9 +5600,20 @@ type StoreMenu = {
|
|
|
5095
5600
|
menu_items?: StoreMenuItem[];
|
|
5096
5601
|
};
|
|
5097
5602
|
|
|
5603
|
+
/**
|
|
5604
|
+
* Navigation menus of a store, reached through `sdk.menus`.
|
|
5605
|
+
*/
|
|
5098
5606
|
declare class MenusApi {
|
|
5099
5607
|
private http;
|
|
5100
5608
|
constructor(http: IHttpClient);
|
|
5609
|
+
/**
|
|
5610
|
+
* Gets a navigation menu by its ref.
|
|
5611
|
+
*
|
|
5612
|
+
* @param storeRef - the store's ref or handle
|
|
5613
|
+
* @param ref - the menu ref
|
|
5614
|
+
* @param includeItems - `true` (the default) includes the menu items
|
|
5615
|
+
* @returns The menu, or `null` when it is not found; throws {@link ApiClientError} on any other API error
|
|
5616
|
+
*/
|
|
5101
5617
|
getByRef(storeRef: string, ref: string, includeItems?: boolean): Promise<StoreMenu | null>;
|
|
5102
5618
|
}
|
|
5103
5619
|
|
|
@@ -5113,6 +5629,9 @@ interface UrlRedirect {
|
|
|
5113
5629
|
updated_at: string;
|
|
5114
5630
|
}
|
|
5115
5631
|
|
|
5632
|
+
/**
|
|
5633
|
+
* URL redirects a store has set up, reached through `sdk.redirects`.
|
|
5634
|
+
*/
|
|
5116
5635
|
declare class RedirectsApi {
|
|
5117
5636
|
private http;
|
|
5118
5637
|
constructor(http: IHttpClient);
|
|
@@ -5251,7 +5770,19 @@ declare class AuthApi {
|
|
|
5251
5770
|
private auth;
|
|
5252
5771
|
/** Never returns tokens: a new email and an existing one respond identically. */
|
|
5253
5772
|
register(payload: RegisterPayload): Promise<ApiResponse<RegisterResult>>;
|
|
5773
|
+
/**
|
|
5774
|
+
* Signs a customer in with email and password.
|
|
5775
|
+
*
|
|
5776
|
+
* @param payload - the login credentials
|
|
5777
|
+
* @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5778
|
+
*/
|
|
5254
5779
|
login(payload: LoginPayload): Promise<ApiResponse<AuthResult>>;
|
|
5780
|
+
/**
|
|
5781
|
+
* Exchanges a refresh token for a new token pair. The old refresh token stops working.
|
|
5782
|
+
*
|
|
5783
|
+
* @param refresh_token - the customer's current refresh token
|
|
5784
|
+
* @returns The new token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5785
|
+
*/
|
|
5255
5786
|
refresh(refresh_token: string): Promise<ApiResponse<AuthResult>>;
|
|
5256
5787
|
/**
|
|
5257
5788
|
* `binding` is the register response's `verification_binding`, when this
|
|
@@ -5259,22 +5790,100 @@ declare class AuthApi {
|
|
|
5259
5790
|
* set at registration is dropped.
|
|
5260
5791
|
*/
|
|
5261
5792
|
verifyEmail(token: string, binding?: string): Promise<ApiResponse<VerifiedResult>>;
|
|
5793
|
+
/**
|
|
5794
|
+
* Sends the email-verification message again.
|
|
5795
|
+
*
|
|
5796
|
+
* @param email - the address to verify
|
|
5797
|
+
* @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5798
|
+
*/
|
|
5262
5799
|
resendVerification(email: string): Promise<ApiResponse<SentResult>>;
|
|
5800
|
+
/**
|
|
5801
|
+
* Starts a password reset by emailing a reset link.
|
|
5802
|
+
*
|
|
5803
|
+
* @param email - the account's email address
|
|
5804
|
+
* @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5805
|
+
*/
|
|
5263
5806
|
forgotPassword(email: string): Promise<ApiResponse<SentResult>>;
|
|
5807
|
+
/**
|
|
5808
|
+
* Sets a new password using the token from the reset email.
|
|
5809
|
+
*
|
|
5810
|
+
* @param payload - the reset token and the new password
|
|
5811
|
+
* @returns The reset result, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5812
|
+
*/
|
|
5264
5813
|
resetPassword(payload: ResetPasswordPayload): Promise<ApiResponse<ResetResult>>;
|
|
5265
5814
|
/** `binding` is the change-email response's `confirmation_binding`. */
|
|
5266
5815
|
confirmEmailChange(token: string, binding?: string): Promise<ApiResponse<ChangedResult>>;
|
|
5816
|
+
/**
|
|
5817
|
+
* Emails a one-time sign-in code.
|
|
5818
|
+
*
|
|
5819
|
+
* @param email - the account's email address
|
|
5820
|
+
* @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5821
|
+
*/
|
|
5267
5822
|
requestOtp(email: string): Promise<ApiResponse<SentResult>>;
|
|
5823
|
+
/**
|
|
5824
|
+
* Signs a customer in with the one-time code from the email.
|
|
5825
|
+
*
|
|
5826
|
+
* @param payload - the email and the code
|
|
5827
|
+
* @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5828
|
+
*/
|
|
5268
5829
|
verifyOtp(payload: VerifyOtpPayload): Promise<ApiResponse<AuthResult>>;
|
|
5830
|
+
/**
|
|
5831
|
+
* Starts an anonymous (guest) session.
|
|
5832
|
+
*
|
|
5833
|
+
* @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5834
|
+
*/
|
|
5269
5835
|
anonymous(): Promise<ApiResponse<AuthResult>>;
|
|
5836
|
+
/**
|
|
5837
|
+
* Gets the URL that starts Google sign-in.
|
|
5838
|
+
*
|
|
5839
|
+
* @param redirect_to - where to send the customer after sign-in, `/` by default
|
|
5840
|
+
* @returns The Google sign-in URL, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5841
|
+
*/
|
|
5270
5842
|
getGoogleUrl(redirect_to?: string): Promise<ApiResponse<GoogleAuthUrl>>;
|
|
5843
|
+
/**
|
|
5844
|
+
* Completes Google sign-in by exchanging the authorization code.
|
|
5845
|
+
*
|
|
5846
|
+
* @param code - the authorization code Google returned
|
|
5847
|
+
* @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5848
|
+
*/
|
|
5271
5849
|
exchangeGoogleCode(code: string): Promise<ApiResponse<AuthResult>>;
|
|
5850
|
+
/**
|
|
5851
|
+
* Reads which sign-in methods this store has turned on.
|
|
5852
|
+
*
|
|
5853
|
+
* @returns The public auth configuration, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5854
|
+
*/
|
|
5272
5855
|
getAuthConfig(): Promise<ApiResponse<PublicAuthConfig>>;
|
|
5856
|
+
/**
|
|
5857
|
+
* Reads the signed-in customer's identity.
|
|
5858
|
+
*
|
|
5859
|
+
* @param access_token - the signed-in customer's access token
|
|
5860
|
+
* @returns The current identity, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5861
|
+
*/
|
|
5273
5862
|
me(access_token: string): Promise<ApiResponse<CurrentIdentity | null>>;
|
|
5274
5863
|
/** Revokes one session. The refresh token identifies which. */
|
|
5275
5864
|
logout(access_token: string, refresh_token: string): Promise<ApiResponse<unknown>>;
|
|
5865
|
+
/**
|
|
5866
|
+
* Signs the customer out of every session.
|
|
5867
|
+
*
|
|
5868
|
+
* @param access_token - the signed-in customer's access token
|
|
5869
|
+
* @returns The API's answer, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5870
|
+
*/
|
|
5276
5871
|
logoutAll(access_token: string): Promise<ApiResponse<unknown>>;
|
|
5872
|
+
/**
|
|
5873
|
+
* Changes the signed-in customer's password.
|
|
5874
|
+
*
|
|
5875
|
+
* @param access_token - the signed-in customer's access token
|
|
5876
|
+
* @param payload - the current and the new password
|
|
5877
|
+
* @returns The API's answer, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5878
|
+
*/
|
|
5277
5879
|
changePassword(access_token: string, payload: ChangePasswordPayload): Promise<ApiResponse<unknown>>;
|
|
5880
|
+
/**
|
|
5881
|
+
* Starts an email change; the new address must be confirmed from the message sent to it.
|
|
5882
|
+
*
|
|
5883
|
+
* @param access_token - the signed-in customer's access token
|
|
5884
|
+
* @param payload - the new email address and the current password
|
|
5885
|
+
* @returns The change-email result, as the raw {@link ApiResponse}; it does not throw, so check `success`
|
|
5886
|
+
*/
|
|
5278
5887
|
changeEmail(access_token: string, payload: ChangeEmailPayload): Promise<ApiResponse<ChangeEmailResult>>;
|
|
5279
5888
|
}
|
|
5280
5889
|
|
|
@@ -5294,8 +5903,21 @@ interface TokenStorage {
|
|
|
5294
5903
|
declare class MemoryTokenStorage implements TokenStorage {
|
|
5295
5904
|
private tokens;
|
|
5296
5905
|
constructor(initial?: AuthTokens | null);
|
|
5906
|
+
/**
|
|
5907
|
+
* Reads the stored token pair.
|
|
5908
|
+
*
|
|
5909
|
+
* @returns The stored tokens, or `null` when none are stored
|
|
5910
|
+
*/
|
|
5297
5911
|
get(): Promise<AuthTokens | null>;
|
|
5912
|
+
/**
|
|
5913
|
+
* Stores a token pair, replacing any earlier one.
|
|
5914
|
+
*
|
|
5915
|
+
* @param tokens - the access and refresh tokens
|
|
5916
|
+
*/
|
|
5298
5917
|
set(tokens: AuthTokens): Promise<void>;
|
|
5918
|
+
/**
|
|
5919
|
+
* Forgets the stored token pair.
|
|
5920
|
+
*/
|
|
5299
5921
|
clear(): Promise<void>;
|
|
5300
5922
|
}
|
|
5301
5923
|
|
|
@@ -5313,10 +5935,43 @@ interface Options {
|
|
|
5313
5935
|
*/
|
|
5314
5936
|
declare function createAuthAwareHttpClient(inner: IHttpClient, { storage, auth }: Options): IHttpClient;
|
|
5315
5937
|
|
|
5938
|
+
/**
|
|
5939
|
+
* The EcomWeb storefront SDK: a typed client for a store's public API.
|
|
5940
|
+
*
|
|
5941
|
+
* Call {@link createEcomwebSdk} with two HTTP clients and use the returned
|
|
5942
|
+
* object, for example `sdk.products.getBySlug(storeRef, slug)`. The package
|
|
5943
|
+
* also exports the schema and DTO types the API uses, the image URL helpers,
|
|
5944
|
+
* and {@link ApiClientError}, which the client methods throw when the API
|
|
5945
|
+
* answers with an error.
|
|
5946
|
+
*
|
|
5947
|
+
* @packageDocumentation
|
|
5948
|
+
*/
|
|
5949
|
+
|
|
5950
|
+
/** What {@link createEcomwebSdk} needs: the two HTTP clients, and optional client info. */
|
|
5316
5951
|
interface EcomwebSdkOptions {
|
|
5952
|
+
/** Client for the public API routes, used for anonymous shoppers. */
|
|
5317
5953
|
publicHttp: IHttpClient;
|
|
5954
|
+
/** Client for the routes that need the signed-in customer's credentials. */
|
|
5318
5955
|
authHttp: IHttpClient;
|
|
5956
|
+
/**
|
|
5957
|
+
* Tokens put before this SDK's own in the `X-Ecomweb-Client` header
|
|
5958
|
+
* (space-separated `name/version`, e.g. `@ecomweb/storefront-kit/0.14.0`).
|
|
5959
|
+
*/
|
|
5960
|
+
clientInfo?: string;
|
|
5319
5961
|
}
|
|
5962
|
+
/**
|
|
5963
|
+
* Creates the SDK client. Each property of the result is one API resource, and
|
|
5964
|
+
* each method on it makes one request to the store's API.
|
|
5965
|
+
*
|
|
5966
|
+
* @example
|
|
5967
|
+
* ```ts
|
|
5968
|
+
* const sdk = createEcomwebSdk({ publicHttp, authHttp });
|
|
5969
|
+
* const product = await sdk.products.getBySlug("my-store", "blue-shirt");
|
|
5970
|
+
* ```
|
|
5971
|
+
*
|
|
5972
|
+
* @param options - the HTTP clients, and optional client info for the `X-Ecomweb-Client` header
|
|
5973
|
+
* @returns An object with one API class per resource: `products`, `collections`, `categories`, `cart`, `orders`, `blog`, `stores`, `themes`, `metaobjects`, `search`, `shipping`, `promotions`, `paymentMethods`, `payments`, `reviews`, `customers`, `addresses`, `contentPages`, `menus` and `redirects`
|
|
5974
|
+
*/
|
|
5320
5975
|
declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
5321
5976
|
products: ProductsApi;
|
|
5322
5977
|
collections: CollectionsApi;
|
|
@@ -5339,6 +5994,7 @@ declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
|
5339
5994
|
menus: MenusApi;
|
|
5340
5995
|
redirects: RedirectsApi;
|
|
5341
5996
|
};
|
|
5997
|
+
/** The object {@link createEcomwebSdk} returns. */
|
|
5342
5998
|
type EcomwebSdk = ReturnType<typeof createEcomwebSdk>;
|
|
5343
5999
|
|
|
5344
|
-
export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, type BlogSettings, type BlogTag, type BlogTagQueryParams, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangeEmailResult, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RegisterResult, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema };
|
|
6000
|
+
export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, type BlogSettings, type BlogTag, type BlogTagQueryParams, CLIENT_HEADER, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangeEmailResult, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RegisterResult, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SDK_CLIENT_TOKEN, SDK_VERSION, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, clientHeaderValue, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema, withClientHeader };
|