@swell/apps-sdk 1.0.22 → 1.0.24

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.
Files changed (190) hide show
  1. package/package.json +1 -1
  2. package/dist/index.cjs +0 -43
  3. package/dist/index.cjs.map +0 -7
  4. package/dist/index.js +0 -43
  5. package/dist/index.js.map +0 -7
  6. package/dist/index.mjs +0 -43
  7. package/dist/index.mjs.map +0 -7
  8. package/dist/jest.config.d.ts +0 -14
  9. package/dist/src/api.d.ts +0 -99
  10. package/dist/src/cache.d.ts +0 -18
  11. package/dist/src/categories.d.ts +0 -5
  12. package/dist/src/compatibility/shopify-configs.d.ts +0 -10
  13. package/dist/src/compatibility/shopify-fonts.d.ts +0 -1
  14. package/dist/src/compatibility/shopify-objects/address.d.ts +0 -6
  15. package/dist/src/compatibility/shopify-objects/article.d.ts +0 -5
  16. package/dist/src/compatibility/shopify-objects/blog.d.ts +0 -5
  17. package/dist/src/compatibility/shopify-objects/cart.d.ts +0 -5
  18. package/dist/src/compatibility/shopify-objects/collection.d.ts +0 -5
  19. package/dist/src/compatibility/shopify-objects/collections.d.ts +0 -11
  20. package/dist/src/compatibility/shopify-objects/customer.d.ts +0 -5
  21. package/dist/src/compatibility/shopify-objects/filter.d.ts +0 -5
  22. package/dist/src/compatibility/shopify-objects/font.d.ts +0 -4
  23. package/dist/src/compatibility/shopify-objects/form.d.ts +0 -28
  24. package/dist/src/compatibility/shopify-objects/image.d.ts +0 -6
  25. package/dist/src/compatibility/shopify-objects/index.d.ts +0 -26
  26. package/dist/src/compatibility/shopify-objects/line_item.d.ts +0 -6
  27. package/dist/src/compatibility/shopify-objects/link.d.ts +0 -4
  28. package/dist/src/compatibility/shopify-objects/localization.d.ts +0 -4
  29. package/dist/src/compatibility/shopify-objects/media.d.ts +0 -4
  30. package/dist/src/compatibility/shopify-objects/order.d.ts +0 -10
  31. package/dist/src/compatibility/shopify-objects/page.d.ts +0 -4
  32. package/dist/src/compatibility/shopify-objects/paginate.d.ts +0 -4
  33. package/dist/src/compatibility/shopify-objects/predictive_search.d.ts +0 -4
  34. package/dist/src/compatibility/shopify-objects/product.d.ts +0 -6
  35. package/dist/src/compatibility/shopify-objects/resource.d.ts +0 -23
  36. package/dist/src/compatibility/shopify-objects/search.d.ts +0 -4
  37. package/dist/src/compatibility/shopify-objects/shop.d.ts +0 -4
  38. package/dist/src/compatibility/shopify-objects/variant.d.ts +0 -5
  39. package/dist/src/compatibility/shopify.d.ts +0 -73
  40. package/dist/src/constants.d.ts +0 -1
  41. package/dist/src/content.d.ts +0 -8
  42. package/dist/src/easyblocks/config.d.ts +0 -139
  43. package/dist/src/easyblocks/index.d.ts +0 -2
  44. package/dist/src/easyblocks/utils.d.ts +0 -38
  45. package/dist/src/editor/resources.d.ts +0 -9
  46. package/dist/src/fonts.d.ts +0 -6
  47. package/dist/src/index.d.ts +0 -15
  48. package/dist/src/liquid/color.d.ts +0 -33
  49. package/dist/src/liquid/filters/asset_url.d.ts +0 -2
  50. package/dist/src/liquid/filters/brightness_difference.d.ts +0 -2
  51. package/dist/src/liquid/filters/color_brightness.d.ts +0 -2
  52. package/dist/src/liquid/filters/color_contrast.d.ts +0 -2
  53. package/dist/src/liquid/filters/color_darken.d.ts +0 -2
  54. package/dist/src/liquid/filters/color_desaturate.d.ts +0 -2
  55. package/dist/src/liquid/filters/color_difference.d.ts +0 -2
  56. package/dist/src/liquid/filters/color_extract.d.ts +0 -4
  57. package/dist/src/liquid/filters/color_lighten.d.ts +0 -2
  58. package/dist/src/liquid/filters/color_mix.d.ts +0 -2
  59. package/dist/src/liquid/filters/color_modify.d.ts +0 -4
  60. package/dist/src/liquid/filters/color_saturate.d.ts +0 -2
  61. package/dist/src/liquid/filters/color_to_hex.d.ts +0 -2
  62. package/dist/src/liquid/filters/color_to_hsl.d.ts +0 -2
  63. package/dist/src/liquid/filters/color_to_rgb.d.ts +0 -2
  64. package/dist/src/liquid/filters/date.d.ts +0 -7
  65. package/dist/src/liquid/filters/default_errors.d.ts +0 -2
  66. package/dist/src/liquid/filters/divided_by.d.ts +0 -2
  67. package/dist/src/liquid/filters/font_face.d.ts +0 -2
  68. package/dist/src/liquid/filters/font_modify.d.ts +0 -3
  69. package/dist/src/liquid/filters/font_url.d.ts +0 -2
  70. package/dist/src/liquid/filters/format_address.d.ts +0 -6
  71. package/dist/src/liquid/filters/image_tag.d.ts +0 -2
  72. package/dist/src/liquid/filters/image_url.d.ts +0 -6
  73. package/dist/src/liquid/filters/index.d.ts +0 -92
  74. package/dist/src/liquid/filters/inline_editable.d.ts +0 -4
  75. package/dist/src/liquid/filters/json.d.ts +0 -2
  76. package/dist/src/liquid/filters/json_pretty.d.ts +0 -2
  77. package/dist/src/liquid/filters/money.d.ts +0 -2
  78. package/dist/src/liquid/filters/money_with_currency.d.ts +0 -2
  79. package/dist/src/liquid/filters/money_without_currency.d.ts +0 -2
  80. package/dist/src/liquid/filters/money_without_trailing_zeros.d.ts +0 -2
  81. package/dist/src/liquid/filters/shopify/default_pagination.d.ts +0 -3
  82. package/dist/src/liquid/filters/shopify/hex_to_rgba.d.ts +0 -2
  83. package/dist/src/liquid/filters/shopify/item_count_for_variant.d.ts +0 -6
  84. package/dist/src/liquid/filters/shopify/payment_button.d.ts +0 -2
  85. package/dist/src/liquid/filters/shopify/payment_terms.d.ts +0 -2
  86. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-1.d.ts +0 -2
  87. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-2.d.ts +0 -2
  88. package/dist/src/liquid/filters/shopify/placeholder-svgs/blog-apparel-3.d.ts +0 -2
  89. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-1.d.ts +0 -2
  90. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-2.d.ts +0 -2
  91. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-3.d.ts +0 -2
  92. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-4.d.ts +0 -2
  93. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-5.d.ts +0 -2
  94. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-6.d.ts +0 -2
  95. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-1.d.ts +0 -2
  96. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-2.d.ts +0 -2
  97. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-3.d.ts +0 -2
  98. package/dist/src/liquid/filters/shopify/placeholder-svgs/collection-apparel-4.d.ts +0 -2
  99. package/dist/src/liquid/filters/shopify/placeholder-svgs/detailed-apparel-1.d.ts +0 -2
  100. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-1.d.ts +0 -2
  101. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-2.d.ts +0 -2
  102. package/dist/src/liquid/filters/shopify/placeholder-svgs/hero-apparel-3.d.ts +0 -2
  103. package/dist/src/liquid/filters/shopify/placeholder-svgs/image.d.ts +0 -2
  104. package/dist/src/liquid/filters/shopify/placeholder-svgs/index.d.ts +0 -33
  105. package/dist/src/liquid/filters/shopify/placeholder-svgs/lifestyle-1.d.ts +0 -2
  106. package/dist/src/liquid/filters/shopify/placeholder-svgs/lifestyle-2.d.ts +0 -2
  107. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-1.d.ts +0 -2
  108. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-2.d.ts +0 -2
  109. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-3.d.ts +0 -2
  110. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-4.d.ts +0 -2
  111. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-5.d.ts +0 -2
  112. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-6.d.ts +0 -2
  113. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-1.d.ts +0 -2
  114. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-2.d.ts +0 -2
  115. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-3.d.ts +0 -2
  116. package/dist/src/liquid/filters/shopify/placeholder-svgs/product-apparel-4.d.ts +0 -2
  117. package/dist/src/liquid/filters/shopify/placeholder_svg_tag.d.ts +0 -2
  118. package/dist/src/liquid/filters/stylesheet_tag.d.ts +0 -2
  119. package/dist/src/liquid/filters/time_tag.d.ts +0 -2
  120. package/dist/src/liquid/filters/translate.d.ts +0 -2
  121. package/dist/src/liquid/filters/where.d.ts +0 -2
  122. package/dist/src/liquid/font.d.ts +0 -50
  123. package/dist/src/liquid/form.d.ts +0 -17
  124. package/dist/src/liquid/index.d.ts +0 -53
  125. package/dist/src/liquid/operators.d.ts +0 -4
  126. package/dist/src/liquid/tags/case.d.ts +0 -3
  127. package/dist/src/liquid/tags/for.d.ts +0 -3
  128. package/dist/src/liquid/tags/form.d.ts +0 -3
  129. package/dist/src/liquid/tags/index.d.ts +0 -30
  130. package/dist/src/liquid/tags/inline_editable.d.ts +0 -3
  131. package/dist/src/liquid/tags/javascript.d.ts +0 -3
  132. package/dist/src/liquid/tags/layout.d.ts +0 -3
  133. package/dist/src/liquid/tags/paginate.d.ts +0 -3
  134. package/dist/src/liquid/tags/render.d.ts +0 -3
  135. package/dist/src/liquid/tags/section.d.ts +0 -3
  136. package/dist/src/liquid/tags/sections.d.ts +0 -3
  137. package/dist/src/liquid/tags/shopify/include.d.ts +0 -3
  138. package/dist/src/liquid/tags/shopify/schema.d.ts +0 -3
  139. package/dist/src/liquid/tags/style.d.ts +0 -3
  140. package/dist/src/liquid/utils.d.ts +0 -50
  141. package/dist/src/menus.d.ts +0 -27
  142. package/dist/src/products.d.ts +0 -9
  143. package/dist/src/resources.d.ts +0 -98
  144. package/dist/src/theme.d.ts +0 -120
  145. package/dist/src/utils/index.d.ts +0 -19
  146. package/dist/src/utils/md5.d.ts +0 -1
  147. package/dist/test/liquid/filters/asset_url.test.d.ts +0 -1
  148. package/dist/test/liquid/filters/brightness_difference.test.d.ts +0 -1
  149. package/dist/test/liquid/filters/color_brightness.test.d.ts +0 -1
  150. package/dist/test/liquid/filters/color_contrast.test.d.ts +0 -1
  151. package/dist/test/liquid/filters/color_darken.test.d.ts +0 -1
  152. package/dist/test/liquid/filters/color_desaturate.test.d.ts +0 -1
  153. package/dist/test/liquid/filters/color_difference.test.d.ts +0 -1
  154. package/dist/test/liquid/filters/color_extract.test.d.ts +0 -1
  155. package/dist/test/liquid/filters/color_lighten.test.d.ts +0 -1
  156. package/dist/test/liquid/filters/color_mix.test.d.ts +0 -1
  157. package/dist/test/liquid/filters/color_modify.test.d.ts +0 -1
  158. package/dist/test/liquid/filters/color_saturate.test.d.ts +0 -1
  159. package/dist/test/liquid/filters/color_to_hex.test.d.ts +0 -1
  160. package/dist/test/liquid/filters/color_to_hsl.test.d.ts +0 -1
  161. package/dist/test/liquid/filters/color_to_rgb.test.d.ts +0 -1
  162. package/dist/test/liquid/filters/date.test.d.ts +0 -1
  163. package/dist/test/liquid/filters/default_errors.test.d.ts +0 -1
  164. package/dist/test/liquid/filters/divided_by.test.d.ts +0 -1
  165. package/dist/test/liquid/filters/font_face.test.d.ts +0 -1
  166. package/dist/test/liquid/filters/font_modify.test.d.ts +0 -1
  167. package/dist/test/liquid/filters/font_url.test.d.ts +0 -1
  168. package/dist/test/liquid/filters/format_address.test.d.ts +0 -1
  169. package/dist/test/liquid/filters/image_tag.test.d.ts +0 -1
  170. package/dist/test/liquid/filters/image_url.test.d.ts +0 -1
  171. package/dist/test/liquid/filters/inline_editable.test.d.ts +0 -1
  172. package/dist/test/liquid/filters/json.test.d.ts +0 -1
  173. package/dist/test/liquid/filters/json_pretty.test.d.ts +0 -1
  174. package/dist/test/liquid/filters/money.test.d.ts +0 -1
  175. package/dist/test/liquid/filters/money_with_currency.test.d.ts +0 -1
  176. package/dist/test/liquid/filters/money_without_currency.test.d.ts +0 -1
  177. package/dist/test/liquid/filters/money_without_trailing_zeros.test.d.ts +0 -1
  178. package/dist/test/liquid/filters/stylesheet_tag.test.d.ts +0 -1
  179. package/dist/test/liquid/filters/time_tag.test.d.ts +0 -1
  180. package/dist/test/liquid/filters/translate.test.d.ts +0 -1
  181. package/dist/test/liquid/filters/where.test.d.ts +0 -1
  182. package/dist/test/liquid/helpers.d.ts +0 -6
  183. package/dist/test/liquid/tags/case.test.d.ts +0 -1
  184. package/dist/test/liquid/tags/for.test.d.ts +0 -1
  185. package/dist/test/liquid/tags/form.test.d.ts +0 -1
  186. package/dist/test/liquid/tags/inline_editable.test.d.ts +0 -1
  187. package/dist/test/liquid/tags/javascript.test.d.ts +0 -1
  188. package/dist/test/liquid/tags/style.test.d.ts +0 -1
  189. package/dist/types/shopify.d.ts +0 -126
  190. package/dist/types/swell.d.ts +0 -410
@@ -1,14 +0,0 @@
1
- declare namespace _default {
2
- let roots: string[];
3
- let transform: {
4
- '^.+\\.(ts|js)$': string;
5
- };
6
- let testEnvironment: string;
7
- let moduleFileExtensions: string[];
8
- let moduleNameMapper: {
9
- '^@/(.*)$': string;
10
- };
11
- let extensionsToTreatAsEsm: string[];
12
- let transformIgnorePatterns: string[];
13
- }
14
- export default _default;
package/dist/src/api.d.ts DELETED
@@ -1,99 +0,0 @@
1
- import SwellJS from 'swell-js';
2
- import { Cache } from './cache';
3
- export * from './resources';
4
- import type { SwellAppConfig, SwellErrorOptions, SwellMenu, SwellData, CFThemeEnv, SwellAppShopifyCompatibilityConfig } from '../types/swell';
5
- export declare class Swell {
6
- url: URL;
7
- headers: SwellData;
8
- swellHeaders: SwellData;
9
- queryParams: SwellData;
10
- workerEnv?: CFThemeEnv;
11
- config?: SwellAppConfig;
12
- shopifyCompatibilityConfig?: SwellAppShopifyCompatibilityConfig;
13
- backend?: SwellBackendAPI;
14
- storefront: typeof SwellJS;
15
- instanceId: string;
16
- isPreview: boolean;
17
- isEditor: boolean;
18
- sentResponse: boolean;
19
- static cache: Map<string, Cache>;
20
- storefront_url?: string;
21
- constructor(params: {
22
- url: URL | string;
23
- config?: SwellAppConfig;
24
- shopifyCompatibilityConfig?: SwellAppShopifyCompatibilityConfig;
25
- headers?: SwellData;
26
- swellHeaders?: SwellData;
27
- serverHeaders?: Headers | SwellData;
28
- queryParams?: URLSearchParams | SwellData;
29
- workerEnv?: CFThemeEnv;
30
- getCookie?: (name: string) => string | undefined;
31
- setCookie?: (name: string, value: string, options: any) => void;
32
- [key: string]: any;
33
- });
34
- static formatHeaders(serverHeaders?: Headers | SwellData): {
35
- headers: SwellData;
36
- swellHeaders: SwellData;
37
- };
38
- static formatQueryParams(queryParams?: URLSearchParams | SwellData): SwellData;
39
- getClientProps(): {
40
- url: URL;
41
- headers: SwellData;
42
- swellHeaders: SwellData;
43
- queryParams: SwellData;
44
- instanceId: string;
45
- isPreview: boolean;
46
- isEditor: boolean;
47
- cache: unknown[][];
48
- storefrontSettingStates: {
49
- state: any;
50
- menuState: any;
51
- paymentState: any;
52
- subscriptionState: any;
53
- sessionState: any;
54
- };
55
- };
56
- getStorefrontInstance(params: SwellData): typeof SwellJS;
57
- isStorefrontRequestCacheable(method: string, url: string): boolean;
58
- getCacheableStorefrontRequestHandler<T>(storefront: typeof SwellJS): (method: string, url: string, id?: any, data?: any, opt?: any) => T | Promise<T | undefined> | undefined;
59
- getCacheInstance(): Cache;
60
- setCacheValues(values: any[]): void;
61
- getCacheKeyPrefix(): string;
62
- getCacheKey(key: string, args?: unknown[]): string;
63
- setCachedSync(key: string, args: unknown[], value: unknown, timeout?: number, isSync?: boolean): void | Promise<void>;
64
- getCachedSync<T>(key: string, args?: unknown[] | (() => Promise<T> | T), handler?: () => Promise<T> | T, timeout?: number, isSync?: boolean): Promise<T | undefined> | T | undefined;
65
- resolveCacheHandler<T>(cacheInstance: Cache, cacheKey: string, cacheHandler: () => Promise<T> | T, timeout?: number, isSync?: boolean): Promise<T> | T | undefined;
66
- setCached(key: string, args: unknown[], value: unknown, timeout?: number): Promise<any>;
67
- getCached<T>(key: string, args?: unknown[] | (() => Promise<T> | T), handler?: () => Promise<T> | T, timeout?: number): Promise<T | undefined>;
68
- getCachedVersion<T>(key: string[], version: string, handler: () => Promise<T> | T, timeout?: number): Promise<T | undefined>;
69
- getCachedResource<T>(key: string, args: unknown[] | (() => Promise<T>), handler?: () => Promise<T>, timeout?: number): Promise<T | undefined>;
70
- updateCacheModified(cacheModified: string): Promise<void>;
71
- deleteCachedVersion(key: string): Promise<void>;
72
- clearCache(prefix: string): Promise<void>;
73
- getAppSettings(): Promise<SwellData>;
74
- getStorefrontSettings(): Promise<SwellData>;
75
- getStorefrontMenus(): SwellMenu[];
76
- get(...args: Parameters<SwellBackendAPI['get']>): Promise<SwellData | undefined>;
77
- put(...args: Parameters<SwellBackendAPI['put']>): Promise<SwellData | undefined>;
78
- post(...args: Parameters<SwellBackendAPI['post']>): Promise<SwellData | undefined>;
79
- delete(...args: Parameters<SwellBackendAPI['delete']>): Promise<SwellData | undefined>;
80
- }
81
- export declare class SwellBackendAPI {
82
- apiHost: string;
83
- apiAuth: string;
84
- constructor({ storeId, accessToken, apiHost, }: {
85
- storeId: string;
86
- accessToken: string;
87
- apiHost?: string;
88
- });
89
- makeRequest(method: string, url: string, data?: object): Promise<any>;
90
- stringifyQuery(queryObject: object, prefix?: string): string;
91
- get(url: string, query?: SwellData): Promise<SwellData>;
92
- put(url: string, data: SwellData): Promise<SwellData>;
93
- post(url: string, data: SwellData): Promise<SwellData>;
94
- delete(url: string, data?: SwellData): Promise<SwellData>;
95
- }
96
- export declare class SwellError extends Error {
97
- status: number;
98
- constructor(message: string, options?: SwellErrorOptions);
99
- }
@@ -1,18 +0,0 @@
1
- import type { CFWorkerKV } from 'types/swell';
2
- export declare class Cache {
3
- private map;
4
- private kvStore?;
5
- private timeoutDefault;
6
- constructor(kvStore?: CFWorkerKV, timeoutDefault?: number);
7
- setValues(values: Array<[string, unknown]>): void;
8
- getValues(): unknown[][];
9
- get<T>(key: string): Promise<T | undefined>;
10
- getSync<T>(key: string): T | undefined;
11
- set(key: string, value: any, timeout?: number): Promise<void>;
12
- setSync(key: string, value: any, timeout?: number): void;
13
- delete(key: string): Promise<void>;
14
- deleteSync(key: string): void;
15
- has(key: string): Promise<boolean>;
16
- hasSync(key: string): boolean;
17
- clear(prefix?: string): Promise<void>;
18
- }
@@ -1,5 +0,0 @@
1
- import { Swell, SwellStorefrontCollection, SwellStorefrontRecord } from './api';
2
- import type { SwellData } from '../types/swell';
3
- export declare function getCategories(swell: Swell, query?: SwellData): SwellStorefrontCollection<import("../types/swell").SwellCollection<import("../types/swell").SwellRecord>>;
4
- export declare function getCategory(swell: Swell, id: string, query?: SwellData): SwellStorefrontRecord<import("../types/swell").SwellRecord>;
5
- export declare function getCategoryWithProducts(swell: Swell, id: string, query?: SwellData): Promise<SwellStorefrontRecord>;
@@ -1,10 +0,0 @@
1
- import type { ShopifySectionBlockSchema, ShopifySectionPresetSchema, ShopifySectionSchema, ShopifySettingSchema, ShopifySettingsData, ShopifySettingSection, ShopifySettingsSchema } from 'types/shopify';
2
- import type { ThemeBlockSchema, ThemeEditorSchema, ThemePresetSchema, ThemeSectionSchema, ThemeSettingFieldSchema, ThemeSettings, ThemeSettingSectionSchema } from 'types/swell';
3
- export declare function convertShopifySettingsSchema(settingsSchema: ShopifySettingsSchema): ThemeEditorSchema;
4
- export declare function convertShopifySettingsData(settingsData: ShopifySettingsData): ThemeSettings;
5
- export declare function convertShopifySettingsPresets(settingsData: ShopifySettingsData): ThemePresetSchema[];
6
- export declare function convertShopifySectionSchema(sectionSchema: ShopifySectionSchema): ThemeSectionSchema;
7
- export declare function shopifySchemaBlockToSwellBlockSchema(block: ShopifySectionBlockSchema): ThemeBlockSchema;
8
- export declare function shopifySchemaPresetToSwellPresetSchema(preset: ShopifySectionPresetSchema): ThemePresetSchema;
9
- export declare function shopifySchemaSectionToSwellSettingSection(section: ShopifySettingSection): ThemeSettingSectionSchema;
10
- export declare function shopifySchemaSettingToSwellSettingField(setting: ShopifySettingSchema): ThemeSettingFieldSchema;
@@ -1 +0,0 @@
1
- export declare function shopifyFontToThemeFront(shopifyFontSetting: string): string | null;
@@ -1,6 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyAddress(instance: ShopifyCompatibility, address: StorefrontResource | SwellRecord): ShopifyResource;
6
- export declare function ShopifyCountry(_instance: ShopifyCompatibility, countryCode: string): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyArticle(instance: ShopifyCompatibility, blog: StorefrontResource | SwellRecord, blogCategory?: StorefrontResource | SwellRecord): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyBlog(instance: ShopifyCompatibility, blogCategory: StorefrontResource | SwellRecord): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyCart(instance: ShopifyCompatibility, cart: StorefrontResource | SwellRecord): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyCollection(instance: ShopifyCompatibility, category: StorefrontResource | SwellRecord): ShopifyResource;
@@ -1,11 +0,0 @@
1
- import { SwellStorefrontCollection } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import type { SwellCollection, InferSwellCollection } from 'types/swell';
4
- export default function ShopifyCollections<T extends SwellCollection = SwellCollection>(instance: ShopifyCompatibility, categories: SwellStorefrontCollection<T>): SwellStorefrontCollection<{
5
- page: number;
6
- count: number;
7
- results: InferSwellCollection<T>[];
8
- page_count: number;
9
- limit: number;
10
- pages: import("types/swell").SwellCollectionPages;
11
- }>;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyCustomer(instance: ShopifyCompatibility, account: StorefrontResource | SwellRecord): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellData, SwellRecord } from 'types/swell';
4
- export default function ShopifyFilter(instance: ShopifyCompatibility, filter: SwellRecord): ShopifyResource;
5
- export declare function ShopifyFilterValue(instance: ShopifyCompatibility, filterOption: SwellData, filter: SwellRecord, paramSuffix?: string): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ThemeFont } from '../../liquid/font';
3
- import { ShopifyResource } from './resource';
4
- export default function ShopifyFont(_instance: ShopifyCompatibility, font: ThemeFont): ShopifyResource;
@@ -1,28 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ThemeForm } from '../../liquid/form';
3
- import { ShopifyResource } from './resource';
4
- export default function ShopifyForm(_instance: ShopifyCompatibility, form: ThemeForm): ShopifyResource;
5
- export declare class ShopifyFormError {
6
- code: string;
7
- message: string;
8
- field_name: string;
9
- field_label: string;
10
- type: string;
11
- constructor(error: any);
12
- getShopifyErrorType(error: any): "email" | "password" | "form";
13
- valueOf(): string;
14
- toString(): string;
15
- }
16
- export declare class ShopifyFormErrors {
17
- private errors;
18
- private pointer;
19
- messages: ShopifyFormErrorArrayByType;
20
- translated_fields: ShopifyFormErrorArrayByType;
21
- constructor(errors: any);
22
- [Symbol.iterator](): Generator<any, void, undefined>;
23
- some(callbackFn: any, thisArg?: any): boolean;
24
- }
25
- export declare class ShopifyFormErrorArrayByType {
26
- values: any[];
27
- constructor(errors: any, values: any);
28
- }
@@ -1,6 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellData, SwellRecord } from 'types/swell';
5
- export default function ShopifyImage(_instance: ShopifyCompatibility, image: SwellData, product?: StorefrontResource | SwellRecord, variant?: StorefrontResource | SwellRecord): ShopifyResource;
6
- export declare function ShopifyImageSrc(file: SwellData): ShopifyResource;
@@ -1,26 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { DeferredShopifyResource, ShopifyResource } from './resource';
3
- import ShopifyArticle from './article';
4
- import ShopifyBlog from './blog';
5
- import ShopifyCart from './cart';
6
- import ShopifyCollection from './collection';
7
- import ShopifyCollections from './collections';
8
- import ShopifyCustomer from './customer';
9
- import ShopifyFont from './font';
10
- import ShopifyForm from './form';
11
- import ShopifyOrder from './order';
12
- import ShopifyPaginate from './paginate';
13
- import ShopifyPredictiveSearch from './predictive_search';
14
- import ShopifyProduct from './product';
15
- import ShopifyPage from './page';
16
- import ShopifyLink from './link';
17
- import ShopifyLocalization from './localization';
18
- import ShopifySearch from './search';
19
- import ShopifyVariant from './variant';
20
- import type { ThemeFont } from '../../liquid/font';
21
- import type { ThemeForm } from '../../liquid/form';
22
- import type { SwellMenu, SwellData } from '../../../types/swell';
23
- export { DeferredShopifyResource, ShopifyResource, ShopifyArticle, ShopifyBlog, ShopifyCart, ShopifyCollection, ShopifyCollections, ShopifyCustomer, ShopifyFont, ShopifyForm, ShopifyOrder, ShopifyPaginate, ShopifyPredictiveSearch, ShopifyProduct, ShopifyPage, ShopifyLink, ShopifyLocalization, ShopifySearch, ShopifyVariant, };
24
- export declare function adaptShopifyMenuData(instance: ShopifyCompatibility, menu: SwellMenu): SwellData;
25
- export declare function adaptShopifyFontData(instance: ShopifyCompatibility, font: ThemeFont): SwellData;
26
- export declare function adaptShopifyFormData(instance: ShopifyCompatibility, form: ThemeForm): SwellData;
@@ -1,6 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellData, SwellRecord } from 'types/swell';
5
- export default function ShopifyLineItem(instance: ShopifyCompatibility, item: StorefrontResource | SwellRecord, cart: StorefrontResource | SwellRecord, options?: SwellData): ShopifyResource;
6
- export declare function countItemQuantity(items: any[], quantityField?: string): any;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellMenu, SwellMenuItem } from 'types/swell';
4
- export default function ShopifyLink(instance: ShopifyCompatibility, parent: SwellMenu | SwellMenuItem, menuItem: SwellMenuItem): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellData } from 'types/swell';
4
- export default function ShopifyLocalization(_instance: ShopifyCompatibility, store: SwellData, request: SwellData): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellData } from 'types/swell';
4
- export default function ShopifyMedia(_instance: ShopifyCompatibility, image: SwellData): ShopifyResource;
@@ -1,10 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyOrder(instance: ShopifyCompatibility, order: StorefrontResource | SwellRecord, account?: StorefrontResource | SwellRecord): ShopifyResource;
6
- export declare function shopifyFinancialStatus(order: any): "refund_due" | "partially_paid" | "partially_refunded" | "refunded" | "paid" | "authorized" | "unpaid" | "complete";
7
- export declare function shopifyFulfillmentStatus(order: any): "complete" | "canceled" | "on_hold" | "returned" | "rartially_returned" | "fulfilled" | "partially_fulfilled" | "unfulfilled";
8
- export declare function shopifyFinancialStatusLabel(order: any): string;
9
- export declare function shopifyFulfillmentStatusLabel(order: any): string;
10
- export declare function refundDue(order: any): any;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellData } from 'types/swell';
4
- export default function ShopifyPage(_instance: ShopifyCompatibility, page: SwellData): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { SwellStorefrontPagination } from '../../resources';
3
- import { ShopifyResource } from './resource';
4
- export default function ShopifyPaginate(instance: ShopifyCompatibility, pagination: SwellStorefrontPagination): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { StorefrontResource } from '../../resources';
3
- import { ShopifyResource } from './resource';
4
- export default function ShopifyPredictiveSearch(instance: ShopifyCompatibility, search: StorefrontResource): ShopifyResource;
@@ -1,6 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellData, SwellRecord } from 'types/swell';
5
- export default function ShopifyProduct(instance: ShopifyCompatibility, product: StorefrontResource | SwellRecord, depth?: number): ShopifyResource | null;
6
- export declare function ShopifyProductOption(values: SwellData): ShopifyResource;
@@ -1,23 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import type { SwellStorefrontCollection } from '@/resources';
3
- import type { SwellData, SwellRecord } from 'types/swell';
4
- export declare class ShopifyResource {
5
- props: Record<string, unknown>;
6
- stringProp?: string;
7
- linkProps?: string[];
8
- constructor(props: Record<string, any>, stringProp?: string, linkProps?: string[]);
9
- valueOf(): unknown;
10
- clone(): ShopifyResource;
11
- }
12
- export declare class DeferredShopifyResource<T> {
13
- private handler;
14
- private result;
15
- constructor(handler: () => Promise<T> | T);
16
- resolve(): Promise<T | (T & {}) | null>;
17
- }
18
- export declare function defer<T>(handler: () => Promise<T> | T): DeferredShopifyResource<T>;
19
- export declare function isResolvable(asyncProp: unknown): boolean;
20
- export declare function resolveAsyncProp<R extends SwellData>(asyncProp: unknown): Promise<R | R[] | null | undefined>;
21
- export declare function handleDeferredProp<T, R extends SwellData>(asyncProp: unknown, handler: (...value: R[]) => T): Promise<T | null>;
22
- export declare function deferWith<T, R extends SwellData = SwellData>(asyncProp: unknown, handler: (...value: R[]) => T): DeferredShopifyResource<T | null>;
23
- export declare function deferSwellCollectionWithShopifyResults<T extends Record<string, SwellStorefrontCollection>, R extends ShopifyResource>(instance: ShopifyCompatibility, asyncProp: unknown, key: string, ShopifyObject: (instance: ShopifyCompatibility, result: SwellRecord) => R, handler?: (shopifyResult: R, result: SwellRecord) => void): DeferredShopifyResource<SwellStorefrontCollection<import("types/swell").SwellCollection<SwellRecord>> | null>;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { StorefrontResource } from '../../resources';
3
- import { ShopifyResource } from './resource';
4
- export default function ShopifySearch(instance: ShopifyCompatibility, search: StorefrontResource): ShopifyResource;
@@ -1,4 +0,0 @@
1
- import { ShopifyCompatibility } from '../shopify';
2
- import { ShopifyResource } from './resource';
3
- import type { SwellData } from 'types/swell';
4
- export default function ShopifyShop(_instance: ShopifyCompatibility, store: SwellData): ShopifyResource;
@@ -1,5 +0,0 @@
1
- import { StorefrontResource } from '../../resources';
2
- import { ShopifyCompatibility } from '../shopify';
3
- import { ShopifyResource } from './resource';
4
- import type { SwellRecord } from 'types/swell';
5
- export default function ShopifyVariant(instance: ShopifyCompatibility, variant: StorefrontResource | SwellRecord, productIn?: StorefrontResource | SwellRecord, depth?: number): ShopifyResource;
@@ -1,73 +0,0 @@
1
- import { Swell } from '../api';
2
- import { SwellTheme } from '../theme';
3
- import { ThemeFont } from '../liquid/font';
4
- import { ThemeForm } from '../liquid/form';
5
- import { ShopifyResource } from './shopify-objects';
6
- import type { ThemeGlobals, ThemeSettings, ThemePresetSchema, ThemeEditorSchema, ThemeSectionSchema, SwellData, SwellMenu, SwellRecord, SwellAppShopifyCompatibilityConfig } from '../../types/swell';
7
- import type { ShopifySettingsData, ShopifySettingsSchema, ShopifySectionSchema, ShopifyPageResourceMap, ShopifyObjectResourceMap, ShopifyFormResourceMap, ShopifyQueryParamsMap } from '../../types/shopify';
8
- export declare class ShopifyCompatibility {
9
- theme: SwellTheme;
10
- swell: Swell;
11
- pageId?: string;
12
- pageResourceMap: ShopifyPageResourceMap;
13
- objectResourceMap: ShopifyObjectResourceMap;
14
- formResourceMap: ShopifyFormResourceMap;
15
- queryParamsMap: ShopifyQueryParamsMap;
16
- editorLocaleConfig: {
17
- [key: string]: any;
18
- } | undefined;
19
- shopifyCompatibilityConfig?: SwellAppShopifyCompatibilityConfig;
20
- constructor(theme: SwellTheme);
21
- adaptGlobals(globals: ThemeGlobals): void;
22
- adaptPageData(pageData: SwellData): void;
23
- adaptObjectData(objectData: SwellData): void;
24
- adaptQueryParams(): void;
25
- getAdaptedFormType(shopifyType: string): string | undefined;
26
- getAdaptedFormClientParams(formType: string, scope: SwellData, arg?: any): Promise<SwellData | undefined>;
27
- getAdaptedFormClientHtml(formType: string, scope: SwellData, arg?: any): Promise<string | undefined>;
28
- getAdaptedFormServerParams(formType: string, context: SwellData): Promise<SwellData | undefined>;
29
- getAdaptedFormServerResponse(formType: string, context: SwellData): Promise<SwellData | undefined>;
30
- getShopData({ store }: ThemeGlobals): {};
31
- getContentForHeader(): string;
32
- getMenuData(menu: SwellMenu): SwellData;
33
- getFontData(font: ThemeFont): SwellData;
34
- getFormData(form: ThemeForm): SwellData;
35
- getFontFromShopifySetting(fontSetting: string): string | null;
36
- getThemeConfig(settingsData: ShopifySettingsData): ThemeSettings;
37
- getPresetsConfig(settingsData: ShopifySettingsData): ThemePresetSchema[];
38
- getEditorConfig(settingsSchema: ShopifySettingsSchema): ThemeEditorSchema;
39
- getSectionConfigSchema(sectionSchema: ShopifySectionSchema): ThemeSectionSchema;
40
- getLocaleConfig(theme: SwellTheme, localeCode?: string, suffix?: string): Promise<any>;
41
- getEditorLocaleConfig(theme: SwellTheme, localeCode: string): Promise<any>;
42
- renderSchemaTranslations(theme: SwellTheme, schema: SwellData, localeCode?: string): Promise<any>;
43
- renderSchemaTranslationValue(theme: SwellTheme, schemaValue: any, localCode: string, editorLocaleConfig: any): Promise<any>;
44
- getPageType(pageId: string): string;
45
- getPageRouteUrl(pageId: string): string;
46
- getPageRoutes(): {
47
- account_addresses_url: string;
48
- account_login_url: string;
49
- account_logout_url: string;
50
- account_recover_url: string;
51
- account_register_url: string;
52
- account_url: string;
53
- all_products_collection_url: string;
54
- cart_add_url: string;
55
- cart_change_url: string;
56
- cart_clear_url: string;
57
- cart_update_url: string;
58
- cart_url: string;
59
- collections_url: string;
60
- predictive_search_url: string;
61
- product_recommendations_url: string;
62
- root_url: string;
63
- search_url: string;
64
- };
65
- getLocalizationObject(store: SwellData, request: SwellData): ShopifyResource;
66
- getAdaptedPageUrl(url: string): string | undefined;
67
- getThemeFilePath(type: string, name: string): string;
68
- getPageResourceMap(): ShopifyPageResourceMap;
69
- getObjectResourceMap(): ShopifyObjectResourceMap;
70
- getFormResourceMap(): ShopifyFormResourceMap;
71
- getQueryParamsMap(): ShopifyQueryParamsMap;
72
- getAllCountryOptionTags(geoSettings: SwellRecord): any;
73
- }
@@ -1 +0,0 @@
1
- export declare const LANG_TO_COUNTRY_CODES: Record<string, string | undefined>;
@@ -1,8 +0,0 @@
1
- import { Swell } from './api';
2
- import type { SwellData } from 'types/swell';
3
- export declare function getContentModel(swell: Swell, name: string): Promise<any>;
4
- export declare function getContentList(swell: Swell, type: string, query?: SwellData): Promise<any>;
5
- export declare function getContentEntry(swell: Swell, type: string, id: string, query?: SwellData): Promise<any>;
6
- export declare function getPage(swell: Swell, id: string, query?: object): Promise<any>;
7
- export declare function getBlogs(swell: Swell, query?: object): Promise<any>;
8
- export declare function getBlog(swell: Swell, id: string, query?: object): Promise<any>;
@@ -1,139 +0,0 @@
1
- import type { Backend } from '@swell/easyblocks-core';
2
- import { SwellTheme } from '../theme';
3
- import type { SwellThemeConfig, ThemeGlobals, ThemeLayoutSectionGroupConfig, ThemePageSectionSchema, ThemeSectionConfig } from 'types/swell';
4
- export declare function getEasyblocksPropsFromThemeConfigs(theme: SwellTheme, themeConfigs: SwellThemeConfig[], pageId: string): Promise<{
5
- pageTemplate: string | import("types/swell").ThemePageTemplateConfig;
6
- allSections: import("types/swell").ThemeSectionSchema[];
7
- pageSections: ThemeSectionConfig[];
8
- layoutSectionGroups: ThemeLayoutSectionGroupConfig[];
9
- }>;
10
- export declare function getEasyblocksPagePropsWithConfigs(themeGlobals: ThemeGlobals, allSections: ThemePageSectionSchema[], pageSections: ThemeSectionConfig[], layoutSectionGroups: ThemeLayoutSectionGroupConfig[], pageId: string): {
11
- easyblocksConfig: {
12
- components: unknown[];
13
- templates: unknown[];
14
- backend: Backend;
15
- hideCloseButton: boolean;
16
- allowSave: boolean;
17
- readOnly: boolean;
18
- locales: {
19
- code: string;
20
- isDefault: boolean;
21
- }[];
22
- types: {
23
- swell_boolean: {
24
- type: string;
25
- widget: {
26
- id: string;
27
- };
28
- };
29
- swell_color: {
30
- type: string;
31
- widget: {
32
- id: string;
33
- };
34
- };
35
- swell_color_scheme: {
36
- type: string;
37
- widget: {
38
- id: string;
39
- };
40
- };
41
- swell_color_scheme_group: {
42
- type: string;
43
- widget: {
44
- id: string;
45
- };
46
- };
47
- swell_font: {
48
- type: string;
49
- widget: {
50
- id: string;
51
- };
52
- };
53
- swell_header: {
54
- type: string;
55
- widget: {
56
- id: string;
57
- };
58
- };
59
- swell_icon: {
60
- type: string;
61
- widget: {
62
- id: string;
63
- };
64
- };
65
- swell_lookup: {
66
- type: string;
67
- widget: {
68
- id: string;
69
- };
70
- };
71
- swell_menu: {
72
- type: string;
73
- widget: {
74
- id: string;
75
- };
76
- };
77
- swell_url: {
78
- type: string;
79
- widget: {
80
- id: string;
81
- };
82
- };
83
- swell_number: {
84
- type: string;
85
- widget: {
86
- id: string;
87
- };
88
- };
89
- swell_select: {
90
- type: string;
91
- widget: {
92
- id: string;
93
- };
94
- };
95
- swell_short_text: {
96
- type: string;
97
- widget: {
98
- id: string;
99
- };
100
- };
101
- swell_long_text: {
102
- type: string;
103
- widget: {
104
- id: string;
105
- };
106
- };
107
- swell_paragraph: {
108
- type: string;
109
- widget: {
110
- id: string;
111
- };
112
- };
113
- swell_editor: {
114
- type: string;
115
- widget: {
116
- id: string;
117
- };
118
- };
119
- swell_file: {
120
- type: string;
121
- widget: {
122
- id: string;
123
- };
124
- };
125
- swell_image: {
126
- type: string;
127
- widget: {
128
- id: string;
129
- };
130
- };
131
- };
132
- tokens: {
133
- colors: never[];
134
- fonts: never[];
135
- };
136
- };
137
- };
138
- export declare function getEasyblocksComponentDefinitions(allSections: ThemePageSectionSchema[], layoutSectionGroups: ThemeLayoutSectionGroupConfig[], getComponent: (type: string, data?: any) => any): any;
139
- export declare function getEasyblocksBackend(): Backend;
@@ -1,2 +0,0 @@
1
- export * from './config';
2
- export { getThemeSettingsFromProps, getSectionSettingsFromProps, } from './utils';