@ecomweb/sdk 0.10.0 → 0.11.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/dist/index.d.ts +19 -3
- package/dist/index.js +14 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -618,6 +618,10 @@ type Store = {
|
|
|
618
618
|
updated_at: string;
|
|
619
619
|
deleted_at: string | null;
|
|
620
620
|
embedded_scripts?: EmbeddedScript[];
|
|
621
|
+
/** Contract "Storefront": true until the merchant opens the store. Absent on older APIs. */
|
|
622
|
+
coming_soon?: boolean;
|
|
623
|
+
/** Contract "Storefront": when the store first opened, null if never. Absent on older APIs. */
|
|
624
|
+
first_opened_at?: string | null;
|
|
621
625
|
};
|
|
622
626
|
type StoreConfig = z.infer<typeof storeConfigSchema>;
|
|
623
627
|
type StoreSettings = z.infer<typeof storeSettingsSchema>;
|
|
@@ -4307,6 +4311,13 @@ type StoreByDomainInfo = StoreConfigurationInfo & {
|
|
|
4307
4311
|
* shown there, never the live one. Absent from older APIs.
|
|
4308
4312
|
*/
|
|
4309
4313
|
preview_slug?: string | null;
|
|
4314
|
+
/**
|
|
4315
|
+
* A short-lived (1 h) store preview token, sent back as `X-Store-Preview`
|
|
4316
|
+
* in place of the preview cookie. Set only on a theme's preview host,
|
|
4317
|
+
* p-<slug>, while the store is coming soon; null otherwise. Absent from
|
|
4318
|
+
* older APIs.
|
|
4319
|
+
*/
|
|
4320
|
+
store_preview_token?: string | null;
|
|
4310
4321
|
};
|
|
4311
4322
|
|
|
4312
4323
|
declare class StoresApi {
|
|
@@ -4316,9 +4327,13 @@ declare class StoresApi {
|
|
|
4316
4327
|
includeConfig?: boolean;
|
|
4317
4328
|
includeSettings?: boolean;
|
|
4318
4329
|
includeEmbeddedScripts?: boolean;
|
|
4319
|
-
}): Promise<StoreConfigurationInfo | null>;
|
|
4330
|
+
}, requestOptions?: RequestOptions): Promise<StoreConfigurationInfo | null>;
|
|
4320
4331
|
getBySubdomain(subdomain: string): Promise<Store | null>;
|
|
4321
|
-
|
|
4332
|
+
/**
|
|
4333
|
+
* The store `domain` serves. `options` (e.g. an `x-store-preview` header,
|
|
4334
|
+
* which opens a coming soon store) is passed to the client only when given.
|
|
4335
|
+
*/
|
|
4336
|
+
getByDomain(domain: string, options?: RequestOptions): Promise<StoreByDomainInfo | null>;
|
|
4322
4337
|
}
|
|
4323
4338
|
|
|
4324
4339
|
declare class ThemesApi {
|
|
@@ -5073,7 +5088,8 @@ interface UrlRedirect {
|
|
|
5073
5088
|
declare class RedirectsApi {
|
|
5074
5089
|
private http;
|
|
5075
5090
|
constructor(http: IHttpClient);
|
|
5076
|
-
|
|
5091
|
+
/** `options` (request options) are passed to the client only when given. */
|
|
5092
|
+
lookup(storeRef: string, path: string, options?: RequestOptions): Promise<UrlRedirect | null>;
|
|
5077
5093
|
}
|
|
5078
5094
|
|
|
5079
5095
|
/** Mirrors AuthTokensResult in customer-auth. Nullable by design: register
|
package/dist/index.js
CHANGED
|
@@ -3177,16 +3177,15 @@ var StoresApi = class {
|
|
|
3177
3177
|
constructor(http) {
|
|
3178
3178
|
this.http = http;
|
|
3179
3179
|
}
|
|
3180
|
-
async getById(storeRef, options) {
|
|
3180
|
+
async getById(storeRef, options, requestOptions) {
|
|
3181
3181
|
const params = new URLSearchParams();
|
|
3182
3182
|
if (options?.includeConfig ?? true) params.set("include_config", "1");
|
|
3183
3183
|
if (options?.includeSettings ?? true) params.set("include_settings", "1");
|
|
3184
3184
|
if (options?.includeEmbeddedScripts ?? true)
|
|
3185
3185
|
params.set("include_embedded_scripts", "1");
|
|
3186
3186
|
const qs = params.toString();
|
|
3187
|
-
const
|
|
3188
|
-
|
|
3189
|
-
);
|
|
3187
|
+
const url = `/public/stores/${storeRef}${qs ? `?${qs}` : ""}`;
|
|
3188
|
+
const res = requestOptions ? await this.http.get(url, requestOptions) : await this.http.get(url);
|
|
3190
3189
|
return unwrapOrNull(res);
|
|
3191
3190
|
}
|
|
3192
3191
|
async getBySubdomain(subdomain) {
|
|
@@ -3195,10 +3194,13 @@ var StoresApi = class {
|
|
|
3195
3194
|
);
|
|
3196
3195
|
return unwrapOrNull(res);
|
|
3197
3196
|
}
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3197
|
+
/**
|
|
3198
|
+
* The store `domain` serves. `options` (e.g. an `x-store-preview` header,
|
|
3199
|
+
* which opens a coming soon store) is passed to the client only when given.
|
|
3200
|
+
*/
|
|
3201
|
+
async getByDomain(domain, options) {
|
|
3202
|
+
const url = `/public/stores/domain/${domain}`;
|
|
3203
|
+
const res = options ? await this.http.get(url, options) : await this.http.get(url);
|
|
3202
3204
|
return unwrapOrNull(res);
|
|
3203
3205
|
}
|
|
3204
3206
|
};
|
|
@@ -3542,12 +3544,12 @@ var RedirectsApi = class {
|
|
|
3542
3544
|
constructor(http) {
|
|
3543
3545
|
this.http = http;
|
|
3544
3546
|
}
|
|
3545
|
-
|
|
3547
|
+
/** `options` (request options) are passed to the client only when given. */
|
|
3548
|
+
async lookup(storeRef, path, options) {
|
|
3546
3549
|
const params = new URLSearchParams();
|
|
3547
3550
|
params.set("path", path);
|
|
3548
|
-
const
|
|
3549
|
-
|
|
3550
|
-
);
|
|
3551
|
+
const url = `/public/stores/${storeRef}/url-redirects/lookup?${params.toString()}`;
|
|
3552
|
+
const res = options ? await this.http.get(url, options) : await this.http.get(url);
|
|
3551
3553
|
const result = unwrapOrNull(res);
|
|
3552
3554
|
return result?.data ?? null;
|
|
3553
3555
|
}
|