@swell/apps-sdk 1.0.190 → 2.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +146 -247
- package/dist/backend.d.cts +81 -0
- package/dist/backend.d.ts +81 -0
- package/dist/backend.js +152 -0
- package/dist/browser-refusal.d.cts +1 -0
- package/dist/browser-refusal.d.ts +1 -0
- package/dist/browser-refusal.js +2 -0
- package/dist/context.d.cts +21 -0
- package/dist/context.d.ts +21 -0
- package/dist/context.js +42 -0
- package/dist/error.d.cts +23 -0
- package/dist/error.d.ts +23 -0
- package/dist/error.js +30 -0
- package/dist/guard.d.cts +1 -0
- package/dist/guard.d.ts +1 -0
- package/dist/guard.js +4 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5 -20299
- package/dist/staff.d.cts +16 -0
- package/dist/staff.d.ts +16 -0
- package/dist/staff.js +33 -0
- package/dist/storefront.d.cts +28 -0
- package/dist/storefront.d.ts +28 -0
- package/dist/storefront.js +44 -0
- package/dist/version.d.cts +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +2 -0
- package/dist/workflow.d.cts +1 -0
- package/dist/workflow.d.ts +1 -0
- package/dist/workflow.js +35 -0
- package/package.json +48 -63
- package/dist/index.cjs +0 -20547
- package/dist/index.cjs.map +0 -7
- package/dist/index.js.map +0 -7
- package/dist/index.mjs +0 -20404
- package/dist/index.mjs.map +0 -7
- package/dist/src/api.d.ts +0 -96
- package/dist/src/cache/cache.d.ts +0 -41
- package/dist/src/cache/cf-worker-kv-keyv-adapter.d.ts +0 -18
- package/dist/src/cache/constants.d.ts +0 -7
- package/dist/src/cache/content-cache.d.ts +0 -21
- package/dist/src/cache/html-cache/html-cache-backend.d.ts +0 -64
- package/dist/src/cache/html-cache/html-cache-factory.d.ts +0 -9
- package/dist/src/cache/html-cache/html-cache-kv.d.ts +0 -38
- package/dist/src/cache/html-cache/html-cache-worker.d.ts +0 -8
- package/dist/src/cache/html-cache/html-cache.d.ts +0 -120
- package/dist/src/cache/html-cache/index.d.ts +0 -4
- package/dist/src/cache/index.d.ts +0 -9
- package/dist/src/cache/kv-variety.d.ts +0 -10
- package/dist/src/cache/request-cache.d.ts +0 -4
- package/dist/src/cache/resource-cache.d.ts +0 -4
- package/dist/src/cache/theme-cache.d.ts +0 -4
- package/dist/src/cache/theme-file-cache.d.ts +0 -87
- package/dist/src/compatibility/drops/all_products.d.ts +0 -10
- package/dist/src/compatibility/drops/articles.d.ts +0 -10
- package/dist/src/compatibility/drops/blogs.d.ts +0 -10
- package/dist/src/compatibility/drops/collections.d.ts +0 -19
- package/dist/src/compatibility/drops/image-src.d.ts +0 -15
- package/dist/src/compatibility/drops/image.d.ts +0 -29
- package/dist/src/compatibility/drops/images.d.ts +0 -9
- package/dist/src/compatibility/drops/money.d.ts +0 -10
- package/dist/src/compatibility/drops/object-handles.d.ts +0 -6
- package/dist/src/compatibility/drops/pages.d.ts +0 -17
- package/dist/src/compatibility/drops/robots-rule.d.ts +0 -9
- package/dist/src/compatibility/drops/template.d.ts +0 -9
- package/dist/src/compatibility/shopify-configs.d.ts +0 -8
- package/dist/src/compatibility/shopify-fonts.d.ts +0 -1
- package/dist/src/compatibility/shopify-objects/address.d.ts +0 -7
- package/dist/src/compatibility/shopify-objects/article.d.ts +0 -7
- package/dist/src/compatibility/shopify-objects/blog.d.ts +0 -6
- package/dist/src/compatibility/shopify-objects/cart.d.ts +0 -6
- package/dist/src/compatibility/shopify-objects/collection.d.ts +0 -7
- package/dist/src/compatibility/shopify-objects/collections.d.ts +0 -6
- package/dist/src/compatibility/shopify-objects/content.d.ts +0 -12
- package/dist/src/compatibility/shopify-objects/currency.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/customer.d.ts +0 -6
- package/dist/src/compatibility/shopify-objects/filter.d.ts +0 -6
- package/dist/src/compatibility/shopify-objects/font.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/form.d.ts +0 -29
- package/dist/src/compatibility/shopify-objects/image.d.ts +0 -10
- package/dist/src/compatibility/shopify-objects/index.d.ts +0 -27
- package/dist/src/compatibility/shopify-objects/line_item.d.ts +0 -7
- package/dist/src/compatibility/shopify-objects/link.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/localization.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/media.d.ts +0 -9
- package/dist/src/compatibility/shopify-objects/money.d.ts +0 -3
- package/dist/src/compatibility/shopify-objects/order.d.ts +0 -11
- package/dist/src/compatibility/shopify-objects/page.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/paginate.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/predictive_search.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/product.d.ts +0 -9
- package/dist/src/compatibility/shopify-objects/recommendations.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/resource.d.ts +0 -27
- package/dist/src/compatibility/shopify-objects/search.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/shop.d.ts +0 -5
- package/dist/src/compatibility/shopify-objects/template.d.ts +0 -4
- package/dist/src/compatibility/shopify-objects/variant.d.ts +0 -6
- package/dist/src/compatibility/shopify.d.ts +0 -134
- package/dist/src/constants.d.ts +0 -598
- package/dist/src/content.d.ts +0 -8
- package/dist/src/easyblocks/config.d.ts +0 -152
- package/dist/src/easyblocks/index.d.ts +0 -2
- package/dist/src/easyblocks/utils.d.ts +0 -23
- package/dist/src/editor/resources.d.ts +0 -9
- package/dist/src/fonts.d.ts +0 -6
- package/dist/src/globals.d.ts +0 -7
- package/dist/src/index.d.ts +0 -16
- package/dist/src/liquid/color.d.ts +0 -33
- package/dist/src/liquid/drops/render.d.ts +0 -10
- package/dist/src/liquid/filters/asset_url.d.ts +0 -3
- package/dist/src/liquid/filters/brightness_difference.d.ts +0 -2
- package/dist/src/liquid/filters/color_brightness.d.ts +0 -2
- package/dist/src/liquid/filters/color_contrast.d.ts +0 -2
- package/dist/src/liquid/filters/color_darken.d.ts +0 -2
- package/dist/src/liquid/filters/color_desaturate.d.ts +0 -2
- package/dist/src/liquid/filters/color_difference.d.ts +0 -2
- package/dist/src/liquid/filters/color_extract.d.ts +0 -4
- package/dist/src/liquid/filters/color_lighten.d.ts +0 -2
- package/dist/src/liquid/filters/color_mix.d.ts +0 -2
- package/dist/src/liquid/filters/color_modify.d.ts +0 -3
- package/dist/src/liquid/filters/color_saturate.d.ts +0 -2
- package/dist/src/liquid/filters/color_to_hex.d.ts +0 -2
- package/dist/src/liquid/filters/color_to_hsl.d.ts +0 -2
- package/dist/src/liquid/filters/color_to_rgb.d.ts +0 -2
- package/dist/src/liquid/filters/date.d.ts +0 -7
- package/dist/src/liquid/filters/date_next_interval.d.ts +0 -3
- package/dist/src/liquid/filters/default_errors.d.ts +0 -3
- package/dist/src/liquid/filters/divided_by.d.ts +0 -2
- package/dist/src/liquid/filters/embedded_content.d.ts +0 -2
- package/dist/src/liquid/filters/escape.d.ts +0 -3
- package/dist/src/liquid/filters/font_face.d.ts +0 -2
- package/dist/src/liquid/filters/font_modify.d.ts +0 -3
- package/dist/src/liquid/filters/font_url.d.ts +0 -2
- package/dist/src/liquid/filters/format_address.d.ts +0 -6
- package/dist/src/liquid/filters/handleize.d.ts +0 -3
- package/dist/src/liquid/filters/image_tag.d.ts +0 -3
- package/dist/src/liquid/filters/image_url.d.ts +0 -8
- package/dist/src/liquid/filters/index.d.ts +0 -120
- package/dist/src/liquid/filters/inline_asset_content.d.ts +0 -2
- package/dist/src/liquid/filters/inline_editable.d.ts +0 -4
- package/dist/src/liquid/filters/json.d.ts +0 -3
- package/dist/src/liquid/filters/json_pretty.d.ts +0 -3
- package/dist/src/liquid/filters/locale_flag.d.ts +0 -2
- package/dist/src/liquid/filters/minus.d.ts +0 -2
- package/dist/src/liquid/filters/money.d.ts +0 -4
- package/dist/src/liquid/filters/money_with_currency.d.ts +0 -3
- package/dist/src/liquid/filters/money_without_currency.d.ts +0 -3
- package/dist/src/liquid/filters/money_without_trailing_zeros.d.ts +0 -3
- package/dist/src/liquid/filters/preload_tag.d.ts +0 -3
- package/dist/src/liquid/filters/script_tag.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/asset_img_url.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/default_pagination.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/hex_to_rgba.d.ts +0 -2
- package/dist/src/liquid/filters/shopify/img_url.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/item_count_for_variant.d.ts +0 -6
- package/dist/src/liquid/filters/shopify/payment_button.d.ts +0 -2
- package/dist/src/liquid/filters/shopify/payment_terms.d.ts +0 -2
- package/dist/src/liquid/filters/shopify/placeholder-svgs/index.d.ts +0 -5
- package/dist/src/liquid/filters/shopify/placeholder_svg_tag.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/shopify_asset_url.d.ts +0 -3
- package/dist/src/liquid/filters/shopify/structured_data.d.ts +0 -3
- package/dist/src/liquid/filters/stylesheet_tag.d.ts +0 -3
- package/dist/src/liquid/filters/time_tag.d.ts +0 -2
- package/dist/src/liquid/filters/translate.d.ts +0 -3
- package/dist/src/liquid/filters/where.d.ts +0 -3
- package/dist/src/liquid/font.d.ts +0 -51
- package/dist/src/liquid/form.d.ts +0 -17
- package/dist/src/liquid/hash.d.ts +0 -5
- package/dist/src/liquid/index.d.ts +0 -52
- package/dist/src/liquid/operators.d.ts +0 -10
- package/dist/src/liquid/tags/assign.d.ts +0 -3
- package/dist/src/liquid/tags/case.d.ts +0 -3
- package/dist/src/liquid/tags/comment.d.ts +0 -3
- package/dist/src/liquid/tags/content_for.d.ts +0 -3
- package/dist/src/liquid/tags/doc.d.ts +0 -2
- package/dist/src/liquid/tags/for.d.ts +0 -3
- package/dist/src/liquid/tags/form.d.ts +0 -3
- package/dist/src/liquid/tags/if.d.ts +0 -4
- package/dist/src/liquid/tags/index.d.ts +0 -42
- package/dist/src/liquid/tags/inline_editable.d.ts +0 -3
- package/dist/src/liquid/tags/javascript.d.ts +0 -3
- package/dist/src/liquid/tags/layout.d.ts +0 -3
- package/dist/src/liquid/tags/paginate.d.ts +0 -3
- package/dist/src/liquid/tags/render.d.ts +0 -6
- package/dist/src/liquid/tags/section.d.ts +0 -3
- package/dist/src/liquid/tags/sections.d.ts +0 -3
- package/dist/src/liquid/tags/shopify/include.d.ts +0 -3
- package/dist/src/liquid/tags/shopify/schema.d.ts +0 -3
- package/dist/src/liquid/tags/style.d.ts +0 -3
- package/dist/src/liquid/tags/stylesheet.d.ts +0 -3
- package/dist/src/liquid/test-helpers.d.ts +0 -8
- package/dist/src/liquid/tokens/identifier-token.d.ts +0 -9
- package/dist/src/liquid/tokens/index.d.ts +0 -2
- package/dist/src/liquid/tokienizer.d.ts +0 -5
- package/dist/src/liquid/utils.d.ts +0 -45
- package/dist/src/menus.d.ts +0 -25
- package/dist/src/resources/account.d.ts +0 -6
- package/dist/src/resources/addresses.d.ts +0 -7
- package/dist/src/resources/blog.d.ts +0 -7
- package/dist/src/resources/blog_category.d.ts +0 -7
- package/dist/src/resources/cart.d.ts +0 -6
- package/dist/src/resources/categories.d.ts +0 -7
- package/dist/src/resources/category.d.ts +0 -7
- package/dist/src/resources/index.d.ts +0 -48
- package/dist/src/resources/order.d.ts +0 -7
- package/dist/src/resources/orders.d.ts +0 -7
- package/dist/src/resources/page.d.ts +0 -7
- package/dist/src/resources/predictive_search.d.ts +0 -6
- package/dist/src/resources/product.d.ts +0 -7
- package/dist/src/resources/product_helpers.d.ts +0 -21
- package/dist/src/resources/search.d.ts +0 -6
- package/dist/src/resources/subscription.d.ts +0 -7
- package/dist/src/resources/subscriptions.d.ts +0 -7
- package/dist/src/resources/swell_types.d.ts +0 -163
- package/dist/src/resources/variant.d.ts +0 -9
- package/dist/src/resources.d.ts +0 -113
- package/dist/src/theme/theme-loader.d.ts +0 -110
- package/dist/src/theme.d.ts +0 -204
- package/dist/src/utils/escape.d.ts +0 -1
- package/dist/src/utils/index.d.ts +0 -34
- package/dist/src/utils/kv-flavor.d.ts +0 -7
- package/dist/src/utils/logger.d.ts +0 -21
- package/dist/src/utils/md5.d.ts +0 -1
- package/dist/types/cloudflare.d.ts +0 -61
- package/dist/types/shopify.d.ts +0 -1035
- package/dist/types/swell.d.ts +0 -576
- package/types/index.d.ts +0 -4
- package/types/svg.d.ts +0 -4
package/dist/types/swell.d.ts
DELETED
|
@@ -1,576 +0,0 @@
|
|
|
1
|
-
import type { FormatInput } from 'swell-js';
|
|
2
|
-
import type { SwellStorefrontRecord, SwellStorefrontResource, SwellStorefrontSingleton } from '../src/resources';
|
|
3
|
-
import type { Swell, SwellStorefrontCollection, StorefrontResource } from '../src/api';
|
|
4
|
-
import type { ShopifySettingRoleSchema, ShopifySettingsData, ShopifySettingsSchema } from './shopify';
|
|
5
|
-
import type { CFThemeEnv, CFWorkerContext } from './cloudflare';
|
|
6
|
-
import type { SdkLoggerConfig } from '../src/utils/logger';
|
|
7
|
-
export interface SwellApiParams {
|
|
8
|
-
url: URL | string;
|
|
9
|
-
config?: SwellAppConfig;
|
|
10
|
-
shopifyCompatibilityConfig?: SwellAppShopifyCompatibilityConfig;
|
|
11
|
-
headers?: Record<string, string | undefined>;
|
|
12
|
-
swellHeaders?: Record<string, string | undefined>;
|
|
13
|
-
serverHeaders?: Headers | Record<string, string | undefined>;
|
|
14
|
-
queryParams?: URLSearchParams | Record<string, string | undefined>;
|
|
15
|
-
workerEnv?: CFThemeEnv;
|
|
16
|
-
workerCtx?: CFWorkerContext;
|
|
17
|
-
isEditor?: boolean;
|
|
18
|
-
logger?: SdkLoggerConfig;
|
|
19
|
-
getCookie?: (name: string) => string | undefined;
|
|
20
|
-
setCookie?: (name: string, value: string, options: object | undefined, swell: Swell) => void;
|
|
21
|
-
resourceLoadingIndicator?: (isLoading: boolean) => void;
|
|
22
|
-
[key: string]: unknown;
|
|
23
|
-
}
|
|
24
|
-
export interface SwellAppConfig {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
type: 'storefront' | string;
|
|
28
|
-
version: string;
|
|
29
|
-
description?: string;
|
|
30
|
-
storefront?: {
|
|
31
|
-
theme: SwellAppStorefrontThemeProps;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export interface SwellThemeRecord {
|
|
35
|
-
id: string;
|
|
36
|
-
name: string;
|
|
37
|
-
description: string | null;
|
|
38
|
-
storefront: {
|
|
39
|
-
compatibility: {
|
|
40
|
-
shopify?: boolean;
|
|
41
|
-
features?: Record<string, boolean>;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
export interface SwellAppShopifyCompatibilityConfig {
|
|
46
|
-
page_types: Record<string, string>;
|
|
47
|
-
page_routes: Record<string, {
|
|
48
|
-
page_id?: string;
|
|
49
|
-
} | string | null>;
|
|
50
|
-
page_resources: Array<{
|
|
51
|
-
page: string;
|
|
52
|
-
resources: Array<{
|
|
53
|
-
from: string;
|
|
54
|
-
to: string;
|
|
55
|
-
object: string;
|
|
56
|
-
}>;
|
|
57
|
-
}>;
|
|
58
|
-
object_resources: Array<{
|
|
59
|
-
from: string;
|
|
60
|
-
object: string;
|
|
61
|
-
}>;
|
|
62
|
-
forms: Array<{
|
|
63
|
-
id: string;
|
|
64
|
-
shopify_type: string;
|
|
65
|
-
client_params: Array<{
|
|
66
|
-
name: string;
|
|
67
|
-
value: string;
|
|
68
|
-
}>;
|
|
69
|
-
}>;
|
|
70
|
-
editor_configs?: {
|
|
71
|
-
checkout_form?: string;
|
|
72
|
-
redirect_to_page_start_forms?: string[];
|
|
73
|
-
script_actions_routes?: Record<string, string>;
|
|
74
|
-
script_routes?: Record<string, string>;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
export interface SwellAppStorefrontThemePage {
|
|
78
|
-
id: string;
|
|
79
|
-
url: string;
|
|
80
|
-
label: string;
|
|
81
|
-
group?: string;
|
|
82
|
-
icon?: string;
|
|
83
|
-
record?: string;
|
|
84
|
-
templates?: boolean;
|
|
85
|
-
collection?: string;
|
|
86
|
-
json?: boolean;
|
|
87
|
-
}
|
|
88
|
-
export interface SwellAppStorefrontThemeProps {
|
|
89
|
-
provider: 'app';
|
|
90
|
-
pages: Array<SwellAppStorefrontThemePage>;
|
|
91
|
-
resources?: SwellAppStorefrontThemeResources;
|
|
92
|
-
template_collections?: Record<string, string>;
|
|
93
|
-
}
|
|
94
|
-
export interface SwellAppStorefrontThemeResources {
|
|
95
|
-
singletons: Record<string, string>;
|
|
96
|
-
records: Record<string, string>;
|
|
97
|
-
}
|
|
98
|
-
export interface SwellSettingsGeoItem {
|
|
99
|
-
id: string;
|
|
100
|
-
name: string;
|
|
101
|
-
}
|
|
102
|
-
export interface SwellSettingsGeoCountry extends SwellSettingsGeoItem {
|
|
103
|
-
state_label?: string;
|
|
104
|
-
}
|
|
105
|
-
export interface SwellSettingsGeoState extends SwellSettingsGeoItem {
|
|
106
|
-
country: string;
|
|
107
|
-
}
|
|
108
|
-
export type SwellSettingsGeoTimezone = SwellSettingsGeoItem;
|
|
109
|
-
export type SwellSettingsGeoCurrency = SwellSettingsGeoItem;
|
|
110
|
-
export type SwellSettingsGeoLocale = SwellSettingsGeoItem;
|
|
111
|
-
export interface SwellSettingsGeo {
|
|
112
|
-
id: 'geo';
|
|
113
|
-
countries: SwellSettingsGeoCountry[];
|
|
114
|
-
currencies: SwellSettingsGeoCurrency[];
|
|
115
|
-
locales: SwellSettingsGeoLocale[];
|
|
116
|
-
states: SwellSettingsGeoState[];
|
|
117
|
-
timezones: SwellSettingsGeoTimezone[];
|
|
118
|
-
}
|
|
119
|
-
export interface SwellLocale {
|
|
120
|
-
code: string;
|
|
121
|
-
name: string;
|
|
122
|
-
fallback?: string | null;
|
|
123
|
-
}
|
|
124
|
-
export interface SwellCurrency {
|
|
125
|
-
code: string;
|
|
126
|
-
decimals: number;
|
|
127
|
-
name: string;
|
|
128
|
-
priced: boolean;
|
|
129
|
-
rate: number;
|
|
130
|
-
symbol: string;
|
|
131
|
-
type: string;
|
|
132
|
-
}
|
|
133
|
-
export interface SwellPageRequest {
|
|
134
|
-
host: string;
|
|
135
|
-
origin: string;
|
|
136
|
-
path: string;
|
|
137
|
-
query: QueryParams;
|
|
138
|
-
locale: string;
|
|
139
|
-
currency: string;
|
|
140
|
-
is_editor: boolean;
|
|
141
|
-
is_preview: boolean;
|
|
142
|
-
design_mode?: boolean;
|
|
143
|
-
visual_section_preview?: boolean;
|
|
144
|
-
page_type?: string;
|
|
145
|
-
}
|
|
146
|
-
export interface SwellProductFilterOption {
|
|
147
|
-
value: unknown;
|
|
148
|
-
label?: string;
|
|
149
|
-
count?: number;
|
|
150
|
-
active?: boolean;
|
|
151
|
-
}
|
|
152
|
-
export interface SwellProductFilter {
|
|
153
|
-
id: string;
|
|
154
|
-
label: string;
|
|
155
|
-
type: string;
|
|
156
|
-
options?: SwellProductFilterOption[];
|
|
157
|
-
interval?: number;
|
|
158
|
-
range_min?: number;
|
|
159
|
-
range_max?: number;
|
|
160
|
-
param_name: string;
|
|
161
|
-
active_options?: SwellProductFilterOption[];
|
|
162
|
-
inactive_options?: SwellProductFilterOption[];
|
|
163
|
-
}
|
|
164
|
-
export interface SwellProductQuery {
|
|
165
|
-
$variants: boolean;
|
|
166
|
-
category?: string;
|
|
167
|
-
search?: string;
|
|
168
|
-
}
|
|
169
|
-
export interface SwellErrorOptions {
|
|
170
|
-
status?: number;
|
|
171
|
-
method?: string;
|
|
172
|
-
endpointUrl?: string;
|
|
173
|
-
}
|
|
174
|
-
export type SwellData = Record<string, any>;
|
|
175
|
-
export type SwellLocaleProp = Record<string, Record<string, string>>;
|
|
176
|
-
export type SwellCurrencyProp = Record<string, Record<string, number>>;
|
|
177
|
-
export interface SwellRecord {
|
|
178
|
-
id: string;
|
|
179
|
-
[key: string]: any;
|
|
180
|
-
$locale?: SwellLocaleProp;
|
|
181
|
-
$currency?: SwellCurrencyProp;
|
|
182
|
-
}
|
|
183
|
-
export interface SwellCollection<T extends SwellData = SwellRecord> {
|
|
184
|
-
page: number;
|
|
185
|
-
count: number;
|
|
186
|
-
results: T[];
|
|
187
|
-
page_count: number;
|
|
188
|
-
limit: number;
|
|
189
|
-
pages?: SwellCollectionPages;
|
|
190
|
-
filter_options?: SwellProductFilter[];
|
|
191
|
-
}
|
|
192
|
-
export type InferSwellCollection<T> = T extends SwellCollection<infer U> ? U : SwellData;
|
|
193
|
-
export interface SwellCollectionPage {
|
|
194
|
-
start: number;
|
|
195
|
-
end: number;
|
|
196
|
-
}
|
|
197
|
-
export type SwellCollectionPages = Record<string, SwellCollectionPage>;
|
|
198
|
-
export interface SwellFile {
|
|
199
|
-
id: string;
|
|
200
|
-
md5: string;
|
|
201
|
-
url: string;
|
|
202
|
-
length: number;
|
|
203
|
-
filename: string | null;
|
|
204
|
-
content_type: string;
|
|
205
|
-
date_uploaded: string;
|
|
206
|
-
}
|
|
207
|
-
export interface SwellThemeConfig {
|
|
208
|
-
id: string;
|
|
209
|
-
type: string;
|
|
210
|
-
name: string;
|
|
211
|
-
hash: string;
|
|
212
|
-
file: SwellFile;
|
|
213
|
-
file_data: string;
|
|
214
|
-
file_path: string;
|
|
215
|
-
}
|
|
216
|
-
export type SwellThemeManifest = Record<string, string>;
|
|
217
|
-
export interface SwellThemeVersion extends SwellRecord {
|
|
218
|
-
manifest: SwellThemeManifest;
|
|
219
|
-
hash: string;
|
|
220
|
-
}
|
|
221
|
-
export interface SwellThemePreload {
|
|
222
|
-
api: number;
|
|
223
|
-
version?: SwellThemeVersion;
|
|
224
|
-
configs?: SwellThemeConfig[];
|
|
225
|
-
}
|
|
226
|
-
export interface SwellMenu {
|
|
227
|
-
id: string;
|
|
228
|
-
name: string;
|
|
229
|
-
handle?: string;
|
|
230
|
-
items: SwellMenuItem[];
|
|
231
|
-
$locale?: SwellLocaleProp;
|
|
232
|
-
}
|
|
233
|
-
export declare enum SwellMenuItemType {
|
|
234
|
-
Home = "home",
|
|
235
|
-
Search = "search",
|
|
236
|
-
Product = "product",
|
|
237
|
-
ProductList = "product_list",
|
|
238
|
-
Category = "category",
|
|
239
|
-
Page = "page",
|
|
240
|
-
Blog = "blog",
|
|
241
|
-
BlogCategory = "blog_category",
|
|
242
|
-
Content = "content",
|
|
243
|
-
ContentList = "content_list",
|
|
244
|
-
Url = "url",
|
|
245
|
-
Heading = "heading"
|
|
246
|
-
}
|
|
247
|
-
export interface SwellMenuItem {
|
|
248
|
-
name: string;
|
|
249
|
-
type: SwellMenuItemType;
|
|
250
|
-
items: SwellMenuItem[];
|
|
251
|
-
model?: string;
|
|
252
|
-
value?: string | Record<string, any>;
|
|
253
|
-
url?: string;
|
|
254
|
-
$locale?: SwellLocaleProp;
|
|
255
|
-
resource?: SwellStorefrontRecord | SwellStorefrontCollection | SwellStorefrontResource;
|
|
256
|
-
levels: number;
|
|
257
|
-
current?: boolean;
|
|
258
|
-
active?: boolean;
|
|
259
|
-
child_current?: boolean;
|
|
260
|
-
child_active?: boolean;
|
|
261
|
-
}
|
|
262
|
-
export type QueryParams = import('qs').ParsedQs;
|
|
263
|
-
export type StorefrontResourceGetter<T extends SwellData = SwellData> = (this: SwellStorefrontResource<T>) => Promise<T | null> | T | null;
|
|
264
|
-
export type StorefrontRecordGetter<T extends SwellData = SwellData> = (this: SwellStorefrontRecord<T>) => Promise<T | null> | T | null;
|
|
265
|
-
export type StorefrontSingletonGetter<T extends SwellData = SwellData> = (this: SwellStorefrontSingleton<T>) => Promise<T | null> | T | null;
|
|
266
|
-
export type StorefrontCollectionGetter<T extends SwellData = SwellData> = (this: SwellStorefrontCollection<T>) => Promise<SwellCollection<T> | null> | SwellCollection<T> | null;
|
|
267
|
-
export interface ThemeSettings {
|
|
268
|
-
[key: string]: any;
|
|
269
|
-
}
|
|
270
|
-
export interface ThemeSettingsBlock {
|
|
271
|
-
id?: string;
|
|
272
|
-
type: string;
|
|
273
|
-
settings: ThemeSettings;
|
|
274
|
-
disabled?: boolean;
|
|
275
|
-
}
|
|
276
|
-
export interface ThemeSectionBase {
|
|
277
|
-
id: string;
|
|
278
|
-
type: string;
|
|
279
|
-
settings: ThemeSettings;
|
|
280
|
-
blocks?: ThemeSettingsBlock[];
|
|
281
|
-
block_order?: string[];
|
|
282
|
-
custom_css?: string | string[];
|
|
283
|
-
disabled?: boolean;
|
|
284
|
-
location: string;
|
|
285
|
-
index0?: number;
|
|
286
|
-
index?: number;
|
|
287
|
-
}
|
|
288
|
-
export interface ThemeSectionSettings extends ThemeSettings {
|
|
289
|
-
section: ThemeSectionBase;
|
|
290
|
-
}
|
|
291
|
-
export interface ThemePageSchema {
|
|
292
|
-
layout?: string;
|
|
293
|
-
page?: {
|
|
294
|
-
title?: string;
|
|
295
|
-
label?: string;
|
|
296
|
-
slug?: string;
|
|
297
|
-
description?: string;
|
|
298
|
-
$locale?: string;
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
interface ThemePageAdditionalProps {
|
|
302
|
-
current: number;
|
|
303
|
-
label: string;
|
|
304
|
-
title: string;
|
|
305
|
-
slug?: string;
|
|
306
|
-
description?: string;
|
|
307
|
-
$locale?: string;
|
|
308
|
-
}
|
|
309
|
-
export interface ThemeCustomPage extends ThemePageAdditionalProps {
|
|
310
|
-
custom: true;
|
|
311
|
-
id: string;
|
|
312
|
-
}
|
|
313
|
-
export interface ThemeSwellPage extends SwellAppStorefrontThemePage, ThemePageAdditionalProps {
|
|
314
|
-
custom: false;
|
|
315
|
-
}
|
|
316
|
-
export type ThemePage = ThemeSwellPage | ThemeCustomPage;
|
|
317
|
-
export interface ThemeInitGlobalsOptions {
|
|
318
|
-
pageRecord?: Record<string, unknown>;
|
|
319
|
-
altTemplate?: string;
|
|
320
|
-
}
|
|
321
|
-
export interface ThemeGlobals extends SwellData {
|
|
322
|
-
store: SwellData;
|
|
323
|
-
settings: ThemeSettings;
|
|
324
|
-
session: SwellData;
|
|
325
|
-
request: SwellPageRequest;
|
|
326
|
-
menus?: Record<string, SwellMenu | undefined>;
|
|
327
|
-
page: ThemePage;
|
|
328
|
-
page_title?: unknown;
|
|
329
|
-
page_description?: unknown;
|
|
330
|
-
page_image?: unknown;
|
|
331
|
-
cart: SwellStorefrontSingleton;
|
|
332
|
-
account: SwellStorefrontSingleton | null;
|
|
333
|
-
customer?: SwellStorefrontSingleton | null;
|
|
334
|
-
geo: SwellSettingsGeo;
|
|
335
|
-
configs: ThemeConfigs;
|
|
336
|
-
language: Record<string, unknown>;
|
|
337
|
-
canonical_url: string;
|
|
338
|
-
powered_by_link: string;
|
|
339
|
-
all_country_option_tags: string;
|
|
340
|
-
country_option_tags: string;
|
|
341
|
-
shopify_compatibility: boolean;
|
|
342
|
-
[key: string]: any;
|
|
343
|
-
}
|
|
344
|
-
export interface ThemeConfigs {
|
|
345
|
-
editor: ThemeEditorConfigSchema;
|
|
346
|
-
theme: ThemeSettings;
|
|
347
|
-
presets: ThemePresetConfigSchema[];
|
|
348
|
-
language: ThemeSettings;
|
|
349
|
-
[key: string]: any;
|
|
350
|
-
settings_schema?: ShopifySettingsSchema;
|
|
351
|
-
settings_data?: ShopifySettingsData;
|
|
352
|
-
}
|
|
353
|
-
export interface ThemeEditorConfigSchema {
|
|
354
|
-
settings?: ThemeSettingSectionSchema[];
|
|
355
|
-
}
|
|
356
|
-
export interface ThemePresetConfigSchema {
|
|
357
|
-
label: string;
|
|
358
|
-
settings?: ThemeSettings;
|
|
359
|
-
}
|
|
360
|
-
export interface ThemeResourceFactory {
|
|
361
|
-
new (swell: Swell): StorefrontResource;
|
|
362
|
-
}
|
|
363
|
-
export interface ThemeLookupResourceFactory {
|
|
364
|
-
new (swell: Swell, id: string): StorefrontResource<SwellRecord>;
|
|
365
|
-
}
|
|
366
|
-
export interface ThemeResources {
|
|
367
|
-
singletons?: {
|
|
368
|
-
account?: ThemeResourceFactory;
|
|
369
|
-
cart?: ThemeResourceFactory;
|
|
370
|
-
};
|
|
371
|
-
records?: Record<string, ThemeLookupResourceFactory>;
|
|
372
|
-
}
|
|
373
|
-
export interface ThemeLocaleSection {
|
|
374
|
-
[key: string]: string | ThemeLocaleSection;
|
|
375
|
-
}
|
|
376
|
-
export interface ThemeLocaleConfig {
|
|
377
|
-
[key: string]: ThemeLocaleSection;
|
|
378
|
-
}
|
|
379
|
-
export interface ThemeSection {
|
|
380
|
-
id?: string;
|
|
381
|
-
type: string;
|
|
382
|
-
disabled?: boolean;
|
|
383
|
-
settings: ThemeSettings;
|
|
384
|
-
blocks?: Record<string, ThemeSettingsBlock>;
|
|
385
|
-
block_order?: string[];
|
|
386
|
-
custom_css?: string;
|
|
387
|
-
}
|
|
388
|
-
interface ThemeSectionGroupBase {
|
|
389
|
-
id?: string;
|
|
390
|
-
type?: string;
|
|
391
|
-
label?: string;
|
|
392
|
-
order?: string[];
|
|
393
|
-
}
|
|
394
|
-
export interface ThemeSectionGroup extends ThemeSectionGroupBase {
|
|
395
|
-
sections: Record<string, ThemeSection>;
|
|
396
|
-
}
|
|
397
|
-
export interface ThemeSectionConfig {
|
|
398
|
-
id: string;
|
|
399
|
-
section: ThemeSection;
|
|
400
|
-
tag: string;
|
|
401
|
-
schema?: ThemeSectionSchema | null;
|
|
402
|
-
output?: string;
|
|
403
|
-
settings?: ThemeSectionSettings;
|
|
404
|
-
blocks?: ThemeSettingsBlock[];
|
|
405
|
-
class?: string;
|
|
406
|
-
}
|
|
407
|
-
export interface ThemeSectionSchemaData {
|
|
408
|
-
label: string;
|
|
409
|
-
fields: ThemeSettingFieldSchema[];
|
|
410
|
-
type?: string;
|
|
411
|
-
tag?: string;
|
|
412
|
-
class?: string;
|
|
413
|
-
enabled_on?: ThemeSectionEnabledDisabled;
|
|
414
|
-
disabled_on?: ThemeSectionEnabledDisabled;
|
|
415
|
-
limit?: number;
|
|
416
|
-
blocks?: ThemeBlockSchema[];
|
|
417
|
-
presets?: ThemePresetSchema[];
|
|
418
|
-
default?: ThemePresetSchema;
|
|
419
|
-
}
|
|
420
|
-
export interface ThemeSectionSchema extends ThemeSectionSchemaData {
|
|
421
|
-
id: string;
|
|
422
|
-
}
|
|
423
|
-
export type ThemeSettingBasicInputType = 'short_text' | 'long_text' | 'paragraph' | 'boolean' | 'number' | 'date' | 'select' | 'asset' | 'tags' | 'collection' | 'color' | 'color_scheme' | 'color_scheme_group' | 'font' | 'header' | 'lookup' | 'generic_lookup' | 'menu' | 'icon' | 'field_group';
|
|
424
|
-
export type ThemeSettingAliasInputType = 'text' | 'textarea' | 'rich_text' | 'asset' | 'phone' | 'email' | 'url' | 'slug' | 'basic_html' | 'rich_html' | 'markdown' | 'liquid' | 'checkbox' | 'toggle' | 'image' | 'document' | 'video' | 'radio' | 'dropdown' | 'checkboxes' | 'integer' | 'float' | 'currency' | 'percent' | 'slider' | 'time' | 'datetime' | 'child_collection' | 'product_lookup' | 'category_lookup' | 'customer_lookup';
|
|
425
|
-
export interface OptionItem {
|
|
426
|
-
label: string;
|
|
427
|
-
value: string;
|
|
428
|
-
}
|
|
429
|
-
export interface ThemeSettingFieldSchema {
|
|
430
|
-
type: ThemeSettingBasicInputType | ThemeSettingAliasInputType;
|
|
431
|
-
label: string;
|
|
432
|
-
id?: string;
|
|
433
|
-
default?: unknown;
|
|
434
|
-
hint?: string;
|
|
435
|
-
description?: string;
|
|
436
|
-
placeholder?: string;
|
|
437
|
-
value_type?: string;
|
|
438
|
-
fallback?: unknown;
|
|
439
|
-
required?: boolean;
|
|
440
|
-
fields?: Array<ThemeSettingFieldSchema>;
|
|
441
|
-
localized?: boolean;
|
|
442
|
-
titleField?: string;
|
|
443
|
-
format?: string;
|
|
444
|
-
min?: number;
|
|
445
|
-
max?: number;
|
|
446
|
-
increment?: number;
|
|
447
|
-
unit?: string;
|
|
448
|
-
digits?: number;
|
|
449
|
-
multiple?: boolean;
|
|
450
|
-
options?: Array<OptionItem>;
|
|
451
|
-
asset_types?: Array<'image' | 'video' | 'document'>;
|
|
452
|
-
collection?: string;
|
|
453
|
-
item_types?: Array<string>;
|
|
454
|
-
item_label?: string;
|
|
455
|
-
icon?: string;
|
|
456
|
-
child?: boolean;
|
|
457
|
-
link?: {
|
|
458
|
-
url: string;
|
|
459
|
-
data?: SwellData;
|
|
460
|
-
params?: SwellData;
|
|
461
|
-
};
|
|
462
|
-
collection_parent_id?: string;
|
|
463
|
-
collection_parent_field?: string;
|
|
464
|
-
model?: string;
|
|
465
|
-
key?: string;
|
|
466
|
-
key_field?: string;
|
|
467
|
-
name_pattern?: string;
|
|
468
|
-
query?: SwellData;
|
|
469
|
-
params?: SwellData;
|
|
470
|
-
limit?: number;
|
|
471
|
-
role?: ShopifySettingRoleSchema;
|
|
472
|
-
conditions?: Record<string, any>;
|
|
473
|
-
$locale?: Record<string, {
|
|
474
|
-
default?: string;
|
|
475
|
-
}>;
|
|
476
|
-
}
|
|
477
|
-
export interface ThemeSettingSectionSchema {
|
|
478
|
-
id?: string;
|
|
479
|
-
label: string;
|
|
480
|
-
fields: ThemeSettingFieldSchema[];
|
|
481
|
-
}
|
|
482
|
-
export interface ThemePageSectionSchema extends ThemeSectionSchema {
|
|
483
|
-
id: string;
|
|
484
|
-
}
|
|
485
|
-
export interface ThemeSectionGroupInfo {
|
|
486
|
-
prop: string;
|
|
487
|
-
label: string;
|
|
488
|
-
source: string;
|
|
489
|
-
group: boolean;
|
|
490
|
-
}
|
|
491
|
-
export interface ThemePageTemplateSectionConfig {
|
|
492
|
-
type: string;
|
|
493
|
-
settings: ThemeSettings;
|
|
494
|
-
blocks?: ThemeSettingsBlock[];
|
|
495
|
-
block_order?: string[];
|
|
496
|
-
}
|
|
497
|
-
export interface ThemePageTemplateConfig extends ThemeSectionGroupBase {
|
|
498
|
-
page?: {
|
|
499
|
-
title?: string;
|
|
500
|
-
description?: string;
|
|
501
|
-
published?: boolean;
|
|
502
|
-
$locale?: SwellLocaleProp;
|
|
503
|
-
};
|
|
504
|
-
sections: Record<string, ThemePageTemplateSectionConfig>;
|
|
505
|
-
order?: string[];
|
|
506
|
-
}
|
|
507
|
-
export interface ThemeLayoutSectionGroupConfig extends ThemePageTemplateConfig {
|
|
508
|
-
id: string;
|
|
509
|
-
type: string;
|
|
510
|
-
label: string;
|
|
511
|
-
sectionConfigs: ThemeSectionConfig[];
|
|
512
|
-
}
|
|
513
|
-
export interface ThemeBlockSchema {
|
|
514
|
-
type: string;
|
|
515
|
-
label: string;
|
|
516
|
-
limit?: number;
|
|
517
|
-
fields: ThemeSettingFieldSchema[];
|
|
518
|
-
}
|
|
519
|
-
export interface ThemePresetSchema {
|
|
520
|
-
label: string;
|
|
521
|
-
settings?: ThemeSettings;
|
|
522
|
-
blocks?: ThemeSettingsBlock[] | Record<string, ThemeSettingsBlock>;
|
|
523
|
-
}
|
|
524
|
-
export interface ThemeSectionEnabledDisabled {
|
|
525
|
-
templates?: string[] | '*';
|
|
526
|
-
groups?: string[];
|
|
527
|
-
}
|
|
528
|
-
export type GetThemeConfig = (fileName: string) => Promise<SwellThemeConfig | null>;
|
|
529
|
-
export type GetThemeTemplateConfigByType = (type: string, name: string) => Promise<SwellThemeConfig | null | undefined>;
|
|
530
|
-
export type GetAssetUrl = (assetPath: string) => Promise<string | null>;
|
|
531
|
-
export type RenderTemplate = (config: SwellThemeConfig | null, data?: SwellData) => Promise<string>;
|
|
532
|
-
export type RenderTemplateString = (templateString: string, data?: SwellData) => Promise<string>;
|
|
533
|
-
export type RenderPageSections = (sections: ThemeSectionGroup, data?: SwellData) => Promise<ThemeSectionConfig[]>;
|
|
534
|
-
export type RenderTranslation = (key: string, data?: unknown, locale?: string) => Promise<string>;
|
|
535
|
-
export type RenderCurrency = (amount: number, params?: FormatInput) => string;
|
|
536
|
-
export type ResolveFilePath = (fileName: string, extName?: string) => string;
|
|
537
|
-
export interface ThemeFontConfig {
|
|
538
|
-
family: string;
|
|
539
|
-
fallback?: string;
|
|
540
|
-
label?: string;
|
|
541
|
-
axes: Array<'wght' | 'wdth' | 'slnt' | 'opsz' | 'ital'>;
|
|
542
|
-
variants: ThemeFontVariant[];
|
|
543
|
-
system?: boolean;
|
|
544
|
-
}
|
|
545
|
-
export interface ThemeFontVariant {
|
|
546
|
-
wght?: number;
|
|
547
|
-
wdth?: number;
|
|
548
|
-
slnt?: number;
|
|
549
|
-
opsz?: number;
|
|
550
|
-
ital?: number;
|
|
551
|
-
}
|
|
552
|
-
export interface ThemeFontVariantSetting {
|
|
553
|
-
family: string;
|
|
554
|
-
weight?: number;
|
|
555
|
-
style?: 'normal' | 'italic' | 'oblique' | string;
|
|
556
|
-
variant?: ThemeFontVariant;
|
|
557
|
-
}
|
|
558
|
-
export interface ThemeFormConfigParam {
|
|
559
|
-
name: string;
|
|
560
|
-
value: string;
|
|
561
|
-
}
|
|
562
|
-
export interface ThemeFormConfig {
|
|
563
|
-
id: string;
|
|
564
|
-
url: string;
|
|
565
|
-
return_url?: string;
|
|
566
|
-
params?: ThemeFormConfigParam[];
|
|
567
|
-
handler?: (...args: any[]) => any;
|
|
568
|
-
}
|
|
569
|
-
export interface ThemeFormErrorMessage {
|
|
570
|
-
code?: string;
|
|
571
|
-
message: string;
|
|
572
|
-
field_name?: string;
|
|
573
|
-
field_label?: string;
|
|
574
|
-
}
|
|
575
|
-
export type ThemeFormErrorMessages = Array<ThemeFormErrorMessage>;
|
|
576
|
-
export {};
|
package/types/index.d.ts
DELETED
package/types/svg.d.ts
DELETED