@ecomweb/sdk 0.2.0 → 0.3.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 +272 -1
- package/dist/index.js +247 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -3765,6 +3765,260 @@ declare const safeParseBaseQueryParams: (data: unknown) => z.ZodSafeParseResult<
|
|
|
3765
3765
|
} | undefined;
|
|
3766
3766
|
}>;
|
|
3767
3767
|
|
|
3768
|
+
/**
|
|
3769
|
+
* Theme settings: a theme declares its own settings (spec: schema-driven
|
|
3770
|
+
* themes §5.2), merchants fill in values, and the storefront reads them.
|
|
3771
|
+
* The types below are the authoring shape; `themeSchemaSchema` checks the same
|
|
3772
|
+
* shape at runtime (schemas uploaded by deploys, published by CI).
|
|
3773
|
+
*/
|
|
3774
|
+
/** Hex only: theme colors are interpolated into a <style> tag. */
|
|
3775
|
+
declare const THEME_HEX_COLOR: RegExp;
|
|
3776
|
+
type Primitive = string | number | boolean;
|
|
3777
|
+
interface ThemeVisibleIf {
|
|
3778
|
+
readonly setting: string;
|
|
3779
|
+
readonly equals?: Primitive;
|
|
3780
|
+
readonly not_equals?: Primitive;
|
|
3781
|
+
readonly is_set?: boolean;
|
|
3782
|
+
}
|
|
3783
|
+
interface SettingBase<T extends string> {
|
|
3784
|
+
readonly type: T;
|
|
3785
|
+
readonly id: string;
|
|
3786
|
+
readonly label: string;
|
|
3787
|
+
readonly info?: string;
|
|
3788
|
+
readonly visible_if?: ThemeVisibleIf;
|
|
3789
|
+
}
|
|
3790
|
+
type ThemeSetting = (SettingBase<"text" | "textarea"> & {
|
|
3791
|
+
readonly default?: string;
|
|
3792
|
+
readonly placeholder?: string;
|
|
3793
|
+
}) | (SettingBase<"richtext" | "url" | "color" | "menu"> & {
|
|
3794
|
+
readonly default?: string;
|
|
3795
|
+
}) | SettingBase<"image_picker" | "collection"> | (SettingBase<"checkbox"> & {
|
|
3796
|
+
readonly default?: boolean;
|
|
3797
|
+
}) | (SettingBase<"number"> & {
|
|
3798
|
+
readonly default?: number;
|
|
3799
|
+
readonly min?: number;
|
|
3800
|
+
readonly max?: number;
|
|
3801
|
+
}) | (SettingBase<"range"> & {
|
|
3802
|
+
readonly min: number;
|
|
3803
|
+
readonly max: number;
|
|
3804
|
+
readonly step: number;
|
|
3805
|
+
readonly unit?: string;
|
|
3806
|
+
readonly default: number;
|
|
3807
|
+
}) | (SettingBase<"select"> & {
|
|
3808
|
+
readonly options: readonly {
|
|
3809
|
+
readonly value: string;
|
|
3810
|
+
readonly label: string;
|
|
3811
|
+
}[];
|
|
3812
|
+
readonly default?: string;
|
|
3813
|
+
});
|
|
3814
|
+
type ThemeSettingType = ThemeSetting["type"];
|
|
3815
|
+
interface ThemeDisplayItem {
|
|
3816
|
+
readonly type: "header" | "paragraph";
|
|
3817
|
+
readonly content: string;
|
|
3818
|
+
}
|
|
3819
|
+
type ThemeSchemaItem = ThemeSetting | ThemeDisplayItem;
|
|
3820
|
+
interface ThemeSchemaGroup {
|
|
3821
|
+
readonly name: string;
|
|
3822
|
+
readonly settings: readonly ThemeSchemaItem[];
|
|
3823
|
+
}
|
|
3824
|
+
type ThemeSchema = readonly ThemeSchemaGroup[];
|
|
3825
|
+
type ThemeValue = string | number | boolean;
|
|
3826
|
+
type ThemeValues = Record<string, ThemeValue | null>;
|
|
3827
|
+
interface ThemeValueError {
|
|
3828
|
+
key: string;
|
|
3829
|
+
message: string;
|
|
3830
|
+
}
|
|
3831
|
+
type ValueOf<T extends ThemeSettingType> = T extends "checkbox" ? boolean : T extends "number" | "range" ? number : string;
|
|
3832
|
+
type SettingsIn<S extends ThemeSchema> = Extract<S[number]["settings"][number], ThemeSetting>;
|
|
3833
|
+
/** The values a schema produces: settings with a default are never null. */
|
|
3834
|
+
type ThemeSettingsOf<S extends ThemeSchema> = {
|
|
3835
|
+
[K in SettingsIn<S> as K["id"]]: K extends {
|
|
3836
|
+
readonly default: unknown;
|
|
3837
|
+
} ? ValueOf<K["type"]> : ValueOf<K["type"]> | null;
|
|
3838
|
+
};
|
|
3839
|
+
declare const themeSchemaSchema: z.ZodArray<z.ZodObject<{
|
|
3840
|
+
name: z.ZodString;
|
|
3841
|
+
settings: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3842
|
+
type: z.ZodLiteral<"text">;
|
|
3843
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3844
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
3845
|
+
id: z.ZodString;
|
|
3846
|
+
label: z.ZodString;
|
|
3847
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3848
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3849
|
+
setting: z.ZodString;
|
|
3850
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3851
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3852
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3853
|
+
}, z.core.$strip>>;
|
|
3854
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3855
|
+
type: z.ZodLiteral<"textarea">;
|
|
3856
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3857
|
+
placeholder: z.ZodOptional<z.ZodString>;
|
|
3858
|
+
id: z.ZodString;
|
|
3859
|
+
label: z.ZodString;
|
|
3860
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3861
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3862
|
+
setting: z.ZodString;
|
|
3863
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3864
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3865
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3866
|
+
}, z.core.$strip>>;
|
|
3867
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3868
|
+
type: z.ZodLiteral<"richtext">;
|
|
3869
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3870
|
+
id: z.ZodString;
|
|
3871
|
+
label: z.ZodString;
|
|
3872
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3873
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3874
|
+
setting: z.ZodString;
|
|
3875
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3876
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3877
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3878
|
+
}, z.core.$strip>>;
|
|
3879
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3880
|
+
type: z.ZodLiteral<"url">;
|
|
3881
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3882
|
+
id: z.ZodString;
|
|
3883
|
+
label: z.ZodString;
|
|
3884
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3885
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3886
|
+
setting: z.ZodString;
|
|
3887
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3888
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3889
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3890
|
+
}, z.core.$strip>>;
|
|
3891
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3892
|
+
type: z.ZodLiteral<"color">;
|
|
3893
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3894
|
+
id: z.ZodString;
|
|
3895
|
+
label: z.ZodString;
|
|
3896
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3897
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3898
|
+
setting: z.ZodString;
|
|
3899
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3900
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3901
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3902
|
+
}, z.core.$strip>>;
|
|
3903
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3904
|
+
type: z.ZodLiteral<"menu">;
|
|
3905
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3906
|
+
id: z.ZodString;
|
|
3907
|
+
label: z.ZodString;
|
|
3908
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3909
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3910
|
+
setting: z.ZodString;
|
|
3911
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3912
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3913
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3914
|
+
}, z.core.$strip>>;
|
|
3915
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3916
|
+
type: z.ZodLiteral<"image_picker">;
|
|
3917
|
+
id: z.ZodString;
|
|
3918
|
+
label: z.ZodString;
|
|
3919
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3920
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3921
|
+
setting: z.ZodString;
|
|
3922
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3923
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3924
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3925
|
+
}, z.core.$strip>>;
|
|
3926
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3927
|
+
type: z.ZodLiteral<"collection">;
|
|
3928
|
+
id: z.ZodString;
|
|
3929
|
+
label: z.ZodString;
|
|
3930
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3931
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3932
|
+
setting: z.ZodString;
|
|
3933
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3934
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3935
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3936
|
+
}, z.core.$strip>>;
|
|
3937
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3938
|
+
type: z.ZodLiteral<"checkbox">;
|
|
3939
|
+
default: z.ZodOptional<z.ZodBoolean>;
|
|
3940
|
+
id: z.ZodString;
|
|
3941
|
+
label: z.ZodString;
|
|
3942
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3943
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3944
|
+
setting: z.ZodString;
|
|
3945
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3946
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3947
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3948
|
+
}, z.core.$strip>>;
|
|
3949
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3950
|
+
type: z.ZodLiteral<"number">;
|
|
3951
|
+
default: z.ZodOptional<z.ZodNumber>;
|
|
3952
|
+
min: z.ZodOptional<z.ZodNumber>;
|
|
3953
|
+
max: z.ZodOptional<z.ZodNumber>;
|
|
3954
|
+
id: z.ZodString;
|
|
3955
|
+
label: z.ZodString;
|
|
3956
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3957
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3958
|
+
setting: z.ZodString;
|
|
3959
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3960
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3961
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3962
|
+
}, z.core.$strip>>;
|
|
3963
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3964
|
+
type: z.ZodLiteral<"range">;
|
|
3965
|
+
min: z.ZodNumber;
|
|
3966
|
+
max: z.ZodNumber;
|
|
3967
|
+
step: z.ZodNumber;
|
|
3968
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
3969
|
+
default: z.ZodNumber;
|
|
3970
|
+
id: z.ZodString;
|
|
3971
|
+
label: z.ZodString;
|
|
3972
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3973
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3974
|
+
setting: z.ZodString;
|
|
3975
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3976
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3977
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3978
|
+
}, z.core.$strip>>;
|
|
3979
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3980
|
+
type: z.ZodLiteral<"select">;
|
|
3981
|
+
options: z.ZodArray<z.ZodObject<{
|
|
3982
|
+
value: z.ZodString;
|
|
3983
|
+
label: z.ZodString;
|
|
3984
|
+
}, z.core.$strip>>;
|
|
3985
|
+
default: z.ZodOptional<z.ZodString>;
|
|
3986
|
+
id: z.ZodString;
|
|
3987
|
+
label: z.ZodString;
|
|
3988
|
+
info: z.ZodOptional<z.ZodString>;
|
|
3989
|
+
visible_if: z.ZodOptional<z.ZodObject<{
|
|
3990
|
+
setting: z.ZodString;
|
|
3991
|
+
equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3992
|
+
not_equals: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
3993
|
+
is_set: z.ZodOptional<z.ZodBoolean>;
|
|
3994
|
+
}, z.core.$strip>>;
|
|
3995
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3996
|
+
type: z.ZodLiteral<"header">;
|
|
3997
|
+
content: z.ZodString;
|
|
3998
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
3999
|
+
type: z.ZodLiteral<"paragraph">;
|
|
4000
|
+
content: z.ZodString;
|
|
4001
|
+
}, z.core.$strip>], "type">>;
|
|
4002
|
+
}, z.core.$strip>>;
|
|
4003
|
+
/**
|
|
4004
|
+
* Validates a schema from outside the code (CI upload, deploy upload). Throws
|
|
4005
|
+
* an Error whose message lists every problem, readable in a build log.
|
|
4006
|
+
*/
|
|
4007
|
+
declare function parseThemeSchema(input: unknown): ThemeSchema;
|
|
4008
|
+
declare function themeSettings(schema: ThemeSchema): ThemeSetting[];
|
|
4009
|
+
declare function themeDefaults(schema: ThemeSchema): ThemeValues;
|
|
4010
|
+
declare function validateThemeValues(schema: ThemeSchema, input: unknown): {
|
|
4011
|
+
values: Record<string, ThemeValue>;
|
|
4012
|
+
errors: ThemeValueError[];
|
|
4013
|
+
};
|
|
4014
|
+
/** Defaults under the valid values; invalid values fall back to defaults. */
|
|
4015
|
+
declare function resolveThemeSettings(schema: ThemeSchema, input: unknown): {
|
|
4016
|
+
settings: ThemeValues;
|
|
4017
|
+
errors: ThemeValueError[];
|
|
4018
|
+
};
|
|
4019
|
+
/** "Set" means not null, not "" and not false. */
|
|
4020
|
+
declare function isSettingVisible(setting: ThemeSetting, values: ThemeValues): boolean;
|
|
4021
|
+
|
|
3768
4022
|
type ResizeMode = "cover" | "contain" | "inside" | "outside";
|
|
3769
4023
|
type ImageFormat = "origin" | "avif" | "webp" | "png" | "jpeg";
|
|
3770
4024
|
interface ImageTransformOptions {
|
|
@@ -4430,10 +4684,19 @@ declare class BlogApi {
|
|
|
4430
4684
|
}): Promise<any>;
|
|
4431
4685
|
}
|
|
4432
4686
|
|
|
4687
|
+
/** The theme the storefront renders (themes spec §5.3); values are unvalidated. */
|
|
4688
|
+
interface PublishedStoreTheme {
|
|
4689
|
+
id: string | null;
|
|
4690
|
+
name: string;
|
|
4691
|
+
kind: "hosted" | "custom";
|
|
4692
|
+
source_theme_id: string;
|
|
4693
|
+
values: Record<string, unknown>;
|
|
4694
|
+
}
|
|
4433
4695
|
type StoreConfigurationInfo = Store & {
|
|
4434
4696
|
config: StoreConfig;
|
|
4435
4697
|
settings: StoreSettings;
|
|
4436
4698
|
theme_config?: ThemeConfig;
|
|
4699
|
+
theme?: PublishedStoreTheme;
|
|
4437
4700
|
};
|
|
4438
4701
|
|
|
4439
4702
|
declare class StoresApi {
|
|
@@ -4448,6 +4711,13 @@ declare class StoresApi {
|
|
|
4448
4711
|
getByDomain(domain: string): Promise<StoreConfigurationInfo | null>;
|
|
4449
4712
|
}
|
|
4450
4713
|
|
|
4714
|
+
declare class ThemesApi {
|
|
4715
|
+
private http;
|
|
4716
|
+
constructor(http: IHttpClient);
|
|
4717
|
+
/** The store theme a dashboard preview link points to; null if refused. */
|
|
4718
|
+
getPreview(storeRef: string, token: string): Promise<PublishedStoreTheme | null>;
|
|
4719
|
+
}
|
|
4720
|
+
|
|
4451
4721
|
declare const searchCatalogParamsSchema: z.ZodObject<{
|
|
4452
4722
|
q: z.ZodOptional<z.ZodString>;
|
|
4453
4723
|
collection: z.ZodString;
|
|
@@ -5324,6 +5594,7 @@ declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
|
5324
5594
|
orders: OrdersApi;
|
|
5325
5595
|
blog: BlogApi;
|
|
5326
5596
|
stores: StoresApi;
|
|
5597
|
+
themes: ThemesApi;
|
|
5327
5598
|
search: SearchApi;
|
|
5328
5599
|
banners: BannersApi;
|
|
5329
5600
|
shipping: ShippingApi;
|
|
@@ -5339,4 +5610,4 @@ declare function createEcomwebSdk(options: EcomwebSdkOptions): {
|
|
|
5339
5610
|
};
|
|
5340
5611
|
type EcomwebSdk = ReturnType<typeof createEcomwebSdk>;
|
|
5341
5612
|
|
|
5342
|
-
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 Banner, type BannerQueryParams, BannersApi, 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, type BuilderSection, type BuilderThemeConfig, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryGridConfig, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionGridConfig, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBanner, 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 CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type FeaturedProductsConfig, type FooterConfig, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type GuestOrderLookupResult, type HeaderConfig, type HeroBannerConfig, type HeroBannerItem, 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 LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MERCHANT_ADJUSTMENT_REASONS, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MoveQuantitiesRequest, type MutationApiFunction, type NewsletterSignupConfig, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, 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 QuantitiesResponse, RENDER_PREFIX, RULE_FIELDS, RedirectsApi, type RegisterPayload, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextConfig, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SECTION_CONFIG_SCHEMAS, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SectionConfigMap, type SectionStyle, type SectionType, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, StoresApi, type SubmitReviewInvitationPayload, type TextWithImageConfig, type ThemeConfig, type ThemeVersion, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBanner, type UpdateBannerPosition, 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, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, WIDGET_REGISTRY, type WidgetCategory, type WidgetDefinition, type WithSeoMetadata$3 as WithSeoMetadata, allowedValuesFor, appliedPromotionSchema, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, bannerSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, builderSectionSchema, builderThemeConfigSchema, categoryGridConfigSchema, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, collectionGridConfigSchema, colorSchema, contentPageSchema, createAuthAwareHttpClient, createBannerSchema, 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, featuredProductsConfigSchema, footerConfigSchema, fromObjectPublicUrlToRender, fulfillmentStatusSchema, headerConfigSchema, heroBannerConfigSchema, heroBannerItemSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isEditableStatus, isPublishableStatus, isRuleField, isUnpublishedStatus, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, messageOutboxStatusSchema, moneySchema, newsletterSignupConfigSchema, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseSectionContent, parseStorageUrl, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, reviewStatusSchema, rewriteSupabaseUrl, richTextConfigSchema, safeParseBaseQueryParams, safeParsePaginationMeta, sectionConfigSchema, sectionStyleSchema, sectionTypeSchema, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, strictUrlSchema, textWithImageConfigSchema, themeConfigSchema, themeVersionSchema, timestampSchema, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBannerPositionSchema, updateBannerSchema, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validatePaginationMeta, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema };
|
|
5613
|
+
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 Banner, type BannerQueryParams, BannersApi, 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, type BuilderSection, type BuilderThemeConfig, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryGridConfig, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionGridConfig, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBanner, 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 CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type FeaturedProductsConfig, type FooterConfig, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type GuestOrderLookupResult, type HeaderConfig, type HeroBannerConfig, type HeroBannerItem, 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 LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MERCHANT_ADJUSTMENT_REASONS, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MoveQuantitiesRequest, type MutationApiFunction, type NewsletterSignupConfig, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, 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, RULE_FIELDS, RedirectsApi, type RegisterPayload, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextConfig, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SECTION_CONFIG_SCHEMAS, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SectionConfigMap, type SectionStyle, type SectionType, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type TextWithImageConfig, type ThemeConfig, type ThemeDisplayItem, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVersion, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBanner, type UpdateBannerPosition, 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, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, WIDGET_REGISTRY, type WidgetCategory, type WidgetDefinition, type WithSeoMetadata$3 as WithSeoMetadata, allowedValuesFor, appliedPromotionSchema, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, bannerSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, builderSectionSchema, builderThemeConfigSchema, categoryGridConfigSchema, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, collectionGridConfigSchema, colorSchema, contentPageSchema, createAuthAwareHttpClient, createBannerSchema, 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, featuredProductsConfigSchema, footerConfigSchema, fromObjectPublicUrlToRender, fulfillmentStatusSchema, headerConfigSchema, heroBannerConfigSchema, heroBannerItemSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isEditableStatus, isPublishableStatus, isRuleField, isSettingVisible, isUnpublishedStatus, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, messageOutboxStatusSchema, moneySchema, newsletterSignupConfigSchema, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseSectionContent, parseStorageUrl, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextConfigSchema, safeParseBaseQueryParams, safeParsePaginationMeta, sectionConfigSchema, sectionStyleSchema, sectionTypeSchema, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, strictUrlSchema, textWithImageConfigSchema, themeConfigSchema, themeDefaults, themeSchemaSchema, themeSettings, themeVersionSchema, timestampSchema, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBannerPositionSchema, updateBannerSchema, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validatePaginationMeta, validateThemeValues, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema };
|
package/dist/index.js
CHANGED
|
@@ -581,8 +581,8 @@ var paginationMetaSchema = z7.object({
|
|
|
581
581
|
hasNext: z7.boolean(),
|
|
582
582
|
hasPrev: z7.boolean()
|
|
583
583
|
});
|
|
584
|
-
var paginatedResponseSchema = (
|
|
585
|
-
data: z7.array(
|
|
584
|
+
var paginatedResponseSchema = (itemSchema2) => z7.object({
|
|
585
|
+
data: z7.array(itemSchema2),
|
|
586
586
|
meta: paginationMetaSchema
|
|
587
587
|
});
|
|
588
588
|
var baseQueryParamsSchema = z7.object({
|
|
@@ -1466,6 +1466,226 @@ var updateContentPageSchema = contentPageSchema.omit({
|
|
|
1466
1466
|
updated_at: true
|
|
1467
1467
|
}).partial();
|
|
1468
1468
|
|
|
1469
|
+
// src/types/theme-schema.ts
|
|
1470
|
+
import { z as z16 } from "zod";
|
|
1471
|
+
var THEME_HEX_COLOR = /^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;
|
|
1472
|
+
var SETTING_ID = /^[a-z][a-z0-9_]*$/;
|
|
1473
|
+
var primitive = z16.union([z16.string(), z16.number(), z16.boolean()]);
|
|
1474
|
+
var visibleIfSchema = z16.object({
|
|
1475
|
+
setting: z16.string().regex(SETTING_ID),
|
|
1476
|
+
equals: primitive.optional(),
|
|
1477
|
+
not_equals: primitive.optional(),
|
|
1478
|
+
is_set: z16.boolean().optional()
|
|
1479
|
+
}).refine(
|
|
1480
|
+
(v) => [v.equals, v.not_equals, v.is_set].filter((x) => x !== void 0).length === 1,
|
|
1481
|
+
{ message: "visible_if needs exactly one of equals, not_equals, is_set" }
|
|
1482
|
+
);
|
|
1483
|
+
var base = {
|
|
1484
|
+
id: z16.string().regex(SETTING_ID, "setting ids are snake_case"),
|
|
1485
|
+
label: z16.string().min(1),
|
|
1486
|
+
info: z16.string().optional(),
|
|
1487
|
+
visible_if: visibleIfSchema.optional()
|
|
1488
|
+
};
|
|
1489
|
+
var itemSchema = z16.discriminatedUnion("type", [
|
|
1490
|
+
z16.object({
|
|
1491
|
+
...base,
|
|
1492
|
+
type: z16.literal("text"),
|
|
1493
|
+
default: z16.string().optional(),
|
|
1494
|
+
placeholder: z16.string().optional()
|
|
1495
|
+
}),
|
|
1496
|
+
z16.object({
|
|
1497
|
+
...base,
|
|
1498
|
+
type: z16.literal("textarea"),
|
|
1499
|
+
default: z16.string().optional(),
|
|
1500
|
+
placeholder: z16.string().optional()
|
|
1501
|
+
}),
|
|
1502
|
+
z16.object({
|
|
1503
|
+
...base,
|
|
1504
|
+
type: z16.literal("richtext"),
|
|
1505
|
+
default: z16.string().optional()
|
|
1506
|
+
}),
|
|
1507
|
+
z16.object({ ...base, type: z16.literal("url"), default: z16.string().optional() }),
|
|
1508
|
+
z16.object({
|
|
1509
|
+
...base,
|
|
1510
|
+
type: z16.literal("color"),
|
|
1511
|
+
default: z16.string().regex(THEME_HEX_COLOR).optional()
|
|
1512
|
+
}),
|
|
1513
|
+
z16.object({
|
|
1514
|
+
...base,
|
|
1515
|
+
type: z16.literal("menu"),
|
|
1516
|
+
default: z16.string().optional()
|
|
1517
|
+
}),
|
|
1518
|
+
z16.object({ ...base, type: z16.literal("image_picker") }),
|
|
1519
|
+
z16.object({ ...base, type: z16.literal("collection") }),
|
|
1520
|
+
z16.object({
|
|
1521
|
+
...base,
|
|
1522
|
+
type: z16.literal("checkbox"),
|
|
1523
|
+
default: z16.boolean().optional()
|
|
1524
|
+
}),
|
|
1525
|
+
z16.object({
|
|
1526
|
+
...base,
|
|
1527
|
+
type: z16.literal("number"),
|
|
1528
|
+
default: z16.number().optional(),
|
|
1529
|
+
min: z16.number().optional(),
|
|
1530
|
+
max: z16.number().optional()
|
|
1531
|
+
}),
|
|
1532
|
+
z16.object({
|
|
1533
|
+
...base,
|
|
1534
|
+
type: z16.literal("range"),
|
|
1535
|
+
min: z16.number(),
|
|
1536
|
+
max: z16.number(),
|
|
1537
|
+
step: z16.number().positive(),
|
|
1538
|
+
unit: z16.string().optional(),
|
|
1539
|
+
default: z16.number()
|
|
1540
|
+
}),
|
|
1541
|
+
z16.object({
|
|
1542
|
+
...base,
|
|
1543
|
+
type: z16.literal("select"),
|
|
1544
|
+
options: z16.array(z16.object({ value: z16.string(), label: z16.string().min(1) })).min(1),
|
|
1545
|
+
default: z16.string().optional()
|
|
1546
|
+
}),
|
|
1547
|
+
z16.object({ type: z16.literal("header"), content: z16.string().min(1) }),
|
|
1548
|
+
z16.object({ type: z16.literal("paragraph"), content: z16.string().min(1) })
|
|
1549
|
+
]);
|
|
1550
|
+
var themeSchemaSchema = z16.array(z16.object({ name: z16.string().min(1), settings: z16.array(itemSchema) })).superRefine((groups, ctx) => {
|
|
1551
|
+
const settings = groups.flatMap((g) => g.settings).filter(isSetting);
|
|
1552
|
+
const ids = /* @__PURE__ */ new Set();
|
|
1553
|
+
for (const s of settings) {
|
|
1554
|
+
if (ids.has(s.id)) {
|
|
1555
|
+
ctx.addIssue({
|
|
1556
|
+
code: "custom",
|
|
1557
|
+
message: `duplicate setting id "${s.id}"`
|
|
1558
|
+
});
|
|
1559
|
+
}
|
|
1560
|
+
ids.add(s.id);
|
|
1561
|
+
}
|
|
1562
|
+
for (const s of settings) {
|
|
1563
|
+
if ("default" in s && s.default !== void 0 && s.default !== "") {
|
|
1564
|
+
const problem = checkValue(s, s.default);
|
|
1565
|
+
if (problem) {
|
|
1566
|
+
ctx.addIssue({
|
|
1567
|
+
code: "custom",
|
|
1568
|
+
message: `${s.id}: default ${JSON.stringify(s.default)} ${problem}`
|
|
1569
|
+
});
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
if (s.visible_if && !ids.has(s.visible_if.setting)) {
|
|
1573
|
+
ctx.addIssue({
|
|
1574
|
+
code: "custom",
|
|
1575
|
+
message: `${s.id}: visible_if names unknown setting "${s.visible_if.setting}"`
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
if (s.type === "select" && s.default !== void 0 && !s.options.some((o) => o.value === s.default)) {
|
|
1579
|
+
ctx.addIssue({
|
|
1580
|
+
code: "custom",
|
|
1581
|
+
message: `${s.id}: default "${s.default}" is not one of its options`
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
if (s.type === "range") {
|
|
1585
|
+
if (s.min >= s.max) {
|
|
1586
|
+
ctx.addIssue({
|
|
1587
|
+
code: "custom",
|
|
1588
|
+
message: `${s.id}: min must be below max`
|
|
1589
|
+
});
|
|
1590
|
+
} else if (s.default < s.min || s.default > s.max) {
|
|
1591
|
+
ctx.addIssue({
|
|
1592
|
+
code: "custom",
|
|
1593
|
+
message: `${s.id}: default ${s.default} is outside ${s.min}\u2013${s.max}`
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
if (s.type === "number" && s.default !== void 0 && (s.min !== void 0 && s.default < s.min || s.max !== void 0 && s.default > s.max)) {
|
|
1598
|
+
ctx.addIssue({
|
|
1599
|
+
code: "custom",
|
|
1600
|
+
message: `${s.id}: default ${s.default} is outside its bounds`
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
});
|
|
1605
|
+
function isSetting(item) {
|
|
1606
|
+
return item.type !== "header" && item.type !== "paragraph";
|
|
1607
|
+
}
|
|
1608
|
+
function parseThemeSchema(input) {
|
|
1609
|
+
const result = themeSchemaSchema.safeParse(input);
|
|
1610
|
+
if (!result.success) {
|
|
1611
|
+
throw new Error(`Invalid theme schema:
|
|
1612
|
+
${z16.prettifyError(result.error)}`);
|
|
1613
|
+
}
|
|
1614
|
+
return result.data;
|
|
1615
|
+
}
|
|
1616
|
+
function themeSettings(schema) {
|
|
1617
|
+
return schema.flatMap((g) => g.settings.filter(isSetting));
|
|
1618
|
+
}
|
|
1619
|
+
function themeDefaults(schema) {
|
|
1620
|
+
const out = {};
|
|
1621
|
+
for (const s of themeSettings(schema)) {
|
|
1622
|
+
out[s.id] = "default" in s && s.default !== void 0 ? s.default : null;
|
|
1623
|
+
}
|
|
1624
|
+
return out;
|
|
1625
|
+
}
|
|
1626
|
+
var TEXT_TYPES = /* @__PURE__ */ new Set(["text", "textarea", "richtext"]);
|
|
1627
|
+
var SAFE_URL = /^(?:https?:\/\/[^\s\\]+|\/(?![\/\\])[^\s\\]*)$/i;
|
|
1628
|
+
function checkValue(setting, value) {
|
|
1629
|
+
switch (setting.type) {
|
|
1630
|
+
case "checkbox":
|
|
1631
|
+
return typeof value === "boolean" ? null : "must be true or false";
|
|
1632
|
+
case "number":
|
|
1633
|
+
case "range": {
|
|
1634
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
1635
|
+
return "must be a number";
|
|
1636
|
+
}
|
|
1637
|
+
if (setting.min !== void 0 && value < setting.min) {
|
|
1638
|
+
return `must be at least ${setting.min}`;
|
|
1639
|
+
}
|
|
1640
|
+
if (setting.max !== void 0 && value > setting.max) {
|
|
1641
|
+
return `must be at most ${setting.max}`;
|
|
1642
|
+
}
|
|
1643
|
+
return null;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
if (typeof value !== "string") return "must be text";
|
|
1647
|
+
switch (setting.type) {
|
|
1648
|
+
case "color":
|
|
1649
|
+
return THEME_HEX_COLOR.test(value) ? null : "must be a hex color such as #1a2b3c";
|
|
1650
|
+
case "url":
|
|
1651
|
+
case "image_picker":
|
|
1652
|
+
return SAFE_URL.test(value) ? null : "must be an http(s) URL or a path starting with /";
|
|
1653
|
+
case "select":
|
|
1654
|
+
return setting.options.some((o) => o.value === value) ? null : `must be one of ${setting.options.map((o) => o.value).join(", ")}`;
|
|
1655
|
+
default:
|
|
1656
|
+
return null;
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
function validateThemeValues(schema, input) {
|
|
1660
|
+
const raw = input && typeof input === "object" && !Array.isArray(input) ? input : {};
|
|
1661
|
+
const values = {};
|
|
1662
|
+
const errors = [];
|
|
1663
|
+
for (const s of themeSettings(schema)) {
|
|
1664
|
+
const value = raw[s.id];
|
|
1665
|
+
if (value === void 0 || value === null) continue;
|
|
1666
|
+
if (value === "" && !TEXT_TYPES.has(s.type)) continue;
|
|
1667
|
+
const problem = checkValue(s, value);
|
|
1668
|
+
if (problem) errors.push({ key: s.id, message: `${s.label} ${problem}` });
|
|
1669
|
+
else values[s.id] = value;
|
|
1670
|
+
}
|
|
1671
|
+
return { values, errors };
|
|
1672
|
+
}
|
|
1673
|
+
function resolveThemeSettings(schema, input) {
|
|
1674
|
+
const { values, errors } = validateThemeValues(schema, input);
|
|
1675
|
+
return { settings: { ...themeDefaults(schema), ...values }, errors };
|
|
1676
|
+
}
|
|
1677
|
+
function isSettingVisible(setting, values) {
|
|
1678
|
+
const rule = setting.visible_if;
|
|
1679
|
+
if (!rule) return true;
|
|
1680
|
+
const value = values[rule.setting] ?? null;
|
|
1681
|
+
if (rule.is_set !== void 0) {
|
|
1682
|
+
const isSet = value !== null && value !== "" && value !== false;
|
|
1683
|
+
return rule.is_set === isSet;
|
|
1684
|
+
}
|
|
1685
|
+
if (rule.equals !== void 0) return value === rule.equals;
|
|
1686
|
+
return value !== rule.not_equals;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1469
1689
|
// src/modules/storage/image-transform.ts
|
|
1470
1690
|
var OBJECT_PREFIX = "/storage/v1/object/public/";
|
|
1471
1691
|
var RENDER_PREFIX = "/storage/v1/render/image/public/";
|
|
@@ -1860,6 +2080,21 @@ var StoresApi = class {
|
|
|
1860
2080
|
}
|
|
1861
2081
|
};
|
|
1862
2082
|
|
|
2083
|
+
// src/modules/themes/api.ts
|
|
2084
|
+
var NO_PREVIEW = [400, 401, 403, 404, 503];
|
|
2085
|
+
var ThemesApi = class {
|
|
2086
|
+
constructor(http) {
|
|
2087
|
+
this.http = http;
|
|
2088
|
+
}
|
|
2089
|
+
/** The store theme a dashboard preview link points to; null if refused. */
|
|
2090
|
+
async getPreview(storeRef, token) {
|
|
2091
|
+
const res = await this.http.get(
|
|
2092
|
+
`/public/stores/${storeRef}/theme-preview?token=${encodeURIComponent(token)}`
|
|
2093
|
+
);
|
|
2094
|
+
return unwrapOrNull(res, NO_PREVIEW);
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
|
|
1863
2098
|
// src/modules/search/api.ts
|
|
1864
2099
|
var SearchApi = class {
|
|
1865
2100
|
constructor(http) {
|
|
@@ -2505,6 +2740,7 @@ function createEcomwebSdk(options) {
|
|
|
2505
2740
|
orders: new OrdersApi(publicHttp, authHttp),
|
|
2506
2741
|
blog: new BlogApi(publicHttp, authHttp),
|
|
2507
2742
|
stores: new StoresApi(publicHttp),
|
|
2743
|
+
themes: new ThemesApi(publicHttp),
|
|
2508
2744
|
search: new SearchApi(publicHttp),
|
|
2509
2745
|
banners: new BannersApi(publicHttp),
|
|
2510
2746
|
shipping: new ShippingApi(publicHttp),
|
|
@@ -2598,6 +2834,8 @@ export {
|
|
|
2598
2834
|
SearchApi,
|
|
2599
2835
|
ShippingApi,
|
|
2600
2836
|
StoresApi,
|
|
2837
|
+
THEME_HEX_COLOR,
|
|
2838
|
+
ThemesApi,
|
|
2601
2839
|
UNAVAILABLE_STATES,
|
|
2602
2840
|
UpdatePromotionSchema,
|
|
2603
2841
|
WIDGET_REGISTRY,
|
|
@@ -2675,6 +2913,7 @@ export {
|
|
|
2675
2913
|
isEditableStatus,
|
|
2676
2914
|
isPublishableStatus,
|
|
2677
2915
|
isRuleField,
|
|
2916
|
+
isSettingVisible,
|
|
2678
2917
|
isUnpublishedStatus,
|
|
2679
2918
|
jsonSchema,
|
|
2680
2919
|
legacyOrderStatusSchema,
|
|
@@ -2695,6 +2934,7 @@ export {
|
|
|
2695
2934
|
paginationSchema,
|
|
2696
2935
|
parseSectionContent,
|
|
2697
2936
|
parseStorageUrl,
|
|
2937
|
+
parseThemeSchema,
|
|
2698
2938
|
paymentMethodSchema,
|
|
2699
2939
|
paymentStatusSchema,
|
|
2700
2940
|
phoneSchema,
|
|
@@ -2715,6 +2955,7 @@ export {
|
|
|
2715
2955
|
productWithVariantsAndReviewStatsSchema,
|
|
2716
2956
|
productWithVariantsSchema,
|
|
2717
2957
|
resolveAssetUrl,
|
|
2958
|
+
resolveThemeSettings,
|
|
2718
2959
|
reviewStatusSchema,
|
|
2719
2960
|
rewriteSupabaseUrl,
|
|
2720
2961
|
richTextConfigSchema,
|
|
@@ -2735,6 +2976,9 @@ export {
|
|
|
2735
2976
|
strictUrlSchema,
|
|
2736
2977
|
textWithImageConfigSchema,
|
|
2737
2978
|
themeConfigSchema,
|
|
2979
|
+
themeDefaults,
|
|
2980
|
+
themeSchemaSchema,
|
|
2981
|
+
themeSettings,
|
|
2738
2982
|
themeVersionSchema,
|
|
2739
2983
|
timestampSchema,
|
|
2740
2984
|
toObjectUrl,
|
|
@@ -2768,6 +3012,7 @@ export {
|
|
|
2768
3012
|
urlSchema,
|
|
2769
3013
|
uuidSchema,
|
|
2770
3014
|
validatePaginationMeta,
|
|
3015
|
+
validateThemeValues,
|
|
2771
3016
|
valueKindFor,
|
|
2772
3017
|
variantOptionSchema,
|
|
2773
3018
|
variantOptionValueSchema,
|