@swell/apps-sdk 1.0.190 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/README.md +188 -254
  2. package/dist/backend.d.cts +81 -0
  3. package/dist/backend.d.ts +81 -0
  4. package/dist/backend.js +154 -0
  5. package/dist/browser-refusal.d.cts +1 -0
  6. package/dist/browser-refusal.d.ts +1 -0
  7. package/dist/browser-refusal.js +2 -0
  8. package/dist/context.d.cts +7 -0
  9. package/dist/context.d.ts +7 -0
  10. package/dist/context.js +29 -0
  11. package/dist/error.d.cts +23 -0
  12. package/dist/error.d.ts +23 -0
  13. package/dist/error.js +30 -0
  14. package/dist/guard.d.cts +1 -0
  15. package/dist/guard.d.ts +1 -0
  16. package/dist/guard.js +4 -0
  17. package/dist/index.d.cts +11 -0
  18. package/dist/index.d.ts +11 -0
  19. package/dist/index.js +6 -20299
  20. package/dist/jwks.d.cts +1 -0
  21. package/dist/jwks.d.ts +1 -0
  22. package/dist/jwks.js +70 -0
  23. package/dist/request-context.d.cts +37 -0
  24. package/dist/request-context.d.ts +37 -0
  25. package/dist/request-context.js +99 -0
  26. package/dist/staff.d.cts +7 -0
  27. package/dist/staff.d.ts +7 -0
  28. package/dist/staff.js +7 -0
  29. package/dist/storefront.d.cts +28 -0
  30. package/dist/storefront.d.ts +28 -0
  31. package/dist/storefront.js +44 -0
  32. package/dist/version.d.cts +1 -0
  33. package/dist/version.d.ts +1 -0
  34. package/dist/version.js +2 -0
  35. package/dist/workflow.d.cts +1 -0
  36. package/dist/workflow.d.ts +1 -0
  37. package/dist/workflow.js +35 -0
  38. package/package.json +48 -63
  39. package/dist/index.cjs +0 -20547
  40. package/dist/index.cjs.map +0 -7
  41. package/dist/index.js.map +0 -7
  42. package/dist/index.mjs +0 -20404
  43. package/dist/index.mjs.map +0 -7
  44. package/dist/src/api.d.ts +0 -96
  45. package/dist/src/cache/cache.d.ts +0 -41
  46. package/dist/src/cache/cf-worker-kv-keyv-adapter.d.ts +0 -18
  47. package/dist/src/cache/constants.d.ts +0 -7
  48. package/dist/src/cache/content-cache.d.ts +0 -21
  49. package/dist/src/cache/html-cache/html-cache-backend.d.ts +0 -64
  50. package/dist/src/cache/html-cache/html-cache-factory.d.ts +0 -9
  51. package/dist/src/cache/html-cache/html-cache-kv.d.ts +0 -38
  52. package/dist/src/cache/html-cache/html-cache-worker.d.ts +0 -8
  53. package/dist/src/cache/html-cache/html-cache.d.ts +0 -120
  54. package/dist/src/cache/html-cache/index.d.ts +0 -4
  55. package/dist/src/cache/index.d.ts +0 -9
  56. package/dist/src/cache/kv-variety.d.ts +0 -10
  57. package/dist/src/cache/request-cache.d.ts +0 -4
  58. package/dist/src/cache/resource-cache.d.ts +0 -4
  59. package/dist/src/cache/theme-cache.d.ts +0 -4
  60. package/dist/src/cache/theme-file-cache.d.ts +0 -87
  61. package/dist/src/compatibility/drops/all_products.d.ts +0 -10
  62. package/dist/src/compatibility/drops/articles.d.ts +0 -10
  63. package/dist/src/compatibility/drops/blogs.d.ts +0 -10
  64. package/dist/src/compatibility/drops/collections.d.ts +0 -19
  65. package/dist/src/compatibility/drops/image-src.d.ts +0 -15
  66. package/dist/src/compatibility/drops/image.d.ts +0 -29
  67. package/dist/src/compatibility/drops/images.d.ts +0 -9
  68. package/dist/src/compatibility/drops/money.d.ts +0 -10
  69. package/dist/src/compatibility/drops/object-handles.d.ts +0 -6
  70. package/dist/src/compatibility/drops/pages.d.ts +0 -17
  71. package/dist/src/compatibility/drops/robots-rule.d.ts +0 -9
  72. package/dist/src/compatibility/drops/template.d.ts +0 -9
  73. package/dist/src/compatibility/shopify-configs.d.ts +0 -8
  74. package/dist/src/compatibility/shopify-fonts.d.ts +0 -1
  75. package/dist/src/compatibility/shopify-objects/address.d.ts +0 -7
  76. package/dist/src/compatibility/shopify-objects/article.d.ts +0 -7
  77. package/dist/src/compatibility/shopify-objects/blog.d.ts +0 -6
  78. package/dist/src/compatibility/shopify-objects/cart.d.ts +0 -6
  79. package/dist/src/compatibility/shopify-objects/collection.d.ts +0 -7
  80. package/dist/src/compatibility/shopify-objects/collections.d.ts +0 -6
  81. package/dist/src/compatibility/shopify-objects/content.d.ts +0 -12
  82. package/dist/src/compatibility/shopify-objects/currency.d.ts +0 -5
  83. package/dist/src/compatibility/shopify-objects/customer.d.ts +0 -6
  84. package/dist/src/compatibility/shopify-objects/filter.d.ts +0 -6
  85. package/dist/src/compatibility/shopify-objects/font.d.ts +0 -5
  86. package/dist/src/compatibility/shopify-objects/form.d.ts +0 -29
  87. package/dist/src/compatibility/shopify-objects/image.d.ts +0 -10
  88. package/dist/src/compatibility/shopify-objects/index.d.ts +0 -27
  89. package/dist/src/compatibility/shopify-objects/line_item.d.ts +0 -7
  90. package/dist/src/compatibility/shopify-objects/link.d.ts +0 -5
  91. package/dist/src/compatibility/shopify-objects/localization.d.ts +0 -5
  92. package/dist/src/compatibility/shopify-objects/media.d.ts +0 -9
  93. package/dist/src/compatibility/shopify-objects/money.d.ts +0 -3
  94. package/dist/src/compatibility/shopify-objects/order.d.ts +0 -11
  95. package/dist/src/compatibility/shopify-objects/page.d.ts +0 -5
  96. package/dist/src/compatibility/shopify-objects/paginate.d.ts +0 -5
  97. package/dist/src/compatibility/shopify-objects/predictive_search.d.ts +0 -5
  98. package/dist/src/compatibility/shopify-objects/product.d.ts +0 -9
  99. package/dist/src/compatibility/shopify-objects/recommendations.d.ts +0 -5
  100. package/dist/src/compatibility/shopify-objects/resource.d.ts +0 -27
  101. package/dist/src/compatibility/shopify-objects/search.d.ts +0 -5
  102. package/dist/src/compatibility/shopify-objects/shop.d.ts +0 -5
  103. package/dist/src/compatibility/shopify-objects/template.d.ts +0 -4
  104. package/dist/src/compatibility/shopify-objects/variant.d.ts +0 -6
  105. package/dist/src/compatibility/shopify.d.ts +0 -134
  106. package/dist/src/constants.d.ts +0 -598
  107. package/dist/src/content.d.ts +0 -8
  108. package/dist/src/easyblocks/config.d.ts +0 -152
  109. package/dist/src/easyblocks/index.d.ts +0 -2
  110. package/dist/src/easyblocks/utils.d.ts +0 -23
  111. package/dist/src/editor/resources.d.ts +0 -9
  112. package/dist/src/fonts.d.ts +0 -6
  113. package/dist/src/globals.d.ts +0 -7
  114. package/dist/src/index.d.ts +0 -16
  115. package/dist/src/liquid/color.d.ts +0 -33
  116. package/dist/src/liquid/drops/render.d.ts +0 -10
  117. package/dist/src/liquid/filters/asset_url.d.ts +0 -3
  118. package/dist/src/liquid/filters/brightness_difference.d.ts +0 -2
  119. package/dist/src/liquid/filters/color_brightness.d.ts +0 -2
  120. package/dist/src/liquid/filters/color_contrast.d.ts +0 -2
  121. package/dist/src/liquid/filters/color_darken.d.ts +0 -2
  122. package/dist/src/liquid/filters/color_desaturate.d.ts +0 -2
  123. package/dist/src/liquid/filters/color_difference.d.ts +0 -2
  124. package/dist/src/liquid/filters/color_extract.d.ts +0 -4
  125. package/dist/src/liquid/filters/color_lighten.d.ts +0 -2
  126. package/dist/src/liquid/filters/color_mix.d.ts +0 -2
  127. package/dist/src/liquid/filters/color_modify.d.ts +0 -3
  128. package/dist/src/liquid/filters/color_saturate.d.ts +0 -2
  129. package/dist/src/liquid/filters/color_to_hex.d.ts +0 -2
  130. package/dist/src/liquid/filters/color_to_hsl.d.ts +0 -2
  131. package/dist/src/liquid/filters/color_to_rgb.d.ts +0 -2
  132. package/dist/src/liquid/filters/date.d.ts +0 -7
  133. package/dist/src/liquid/filters/date_next_interval.d.ts +0 -3
  134. package/dist/src/liquid/filters/default_errors.d.ts +0 -3
  135. package/dist/src/liquid/filters/divided_by.d.ts +0 -2
  136. package/dist/src/liquid/filters/embedded_content.d.ts +0 -2
  137. package/dist/src/liquid/filters/escape.d.ts +0 -3
  138. package/dist/src/liquid/filters/font_face.d.ts +0 -2
  139. package/dist/src/liquid/filters/font_modify.d.ts +0 -3
  140. package/dist/src/liquid/filters/font_url.d.ts +0 -2
  141. package/dist/src/liquid/filters/format_address.d.ts +0 -6
  142. package/dist/src/liquid/filters/handleize.d.ts +0 -3
  143. package/dist/src/liquid/filters/image_tag.d.ts +0 -3
  144. package/dist/src/liquid/filters/image_url.d.ts +0 -8
  145. package/dist/src/liquid/filters/index.d.ts +0 -120
  146. package/dist/src/liquid/filters/inline_asset_content.d.ts +0 -2
  147. package/dist/src/liquid/filters/inline_editable.d.ts +0 -4
  148. package/dist/src/liquid/filters/json.d.ts +0 -3
  149. package/dist/src/liquid/filters/json_pretty.d.ts +0 -3
  150. package/dist/src/liquid/filters/locale_flag.d.ts +0 -2
  151. package/dist/src/liquid/filters/minus.d.ts +0 -2
  152. package/dist/src/liquid/filters/money.d.ts +0 -4
  153. package/dist/src/liquid/filters/money_with_currency.d.ts +0 -3
  154. package/dist/src/liquid/filters/money_without_currency.d.ts +0 -3
  155. package/dist/src/liquid/filters/money_without_trailing_zeros.d.ts +0 -3
  156. package/dist/src/liquid/filters/preload_tag.d.ts +0 -3
  157. package/dist/src/liquid/filters/script_tag.d.ts +0 -3
  158. package/dist/src/liquid/filters/shopify/asset_img_url.d.ts +0 -3
  159. package/dist/src/liquid/filters/shopify/default_pagination.d.ts +0 -3
  160. package/dist/src/liquid/filters/shopify/hex_to_rgba.d.ts +0 -2
  161. package/dist/src/liquid/filters/shopify/img_url.d.ts +0 -3
  162. package/dist/src/liquid/filters/shopify/item_count_for_variant.d.ts +0 -6
  163. package/dist/src/liquid/filters/shopify/payment_button.d.ts +0 -2
  164. package/dist/src/liquid/filters/shopify/payment_terms.d.ts +0 -2
  165. package/dist/src/liquid/filters/shopify/placeholder-svgs/index.d.ts +0 -5
  166. package/dist/src/liquid/filters/shopify/placeholder_svg_tag.d.ts +0 -3
  167. package/dist/src/liquid/filters/shopify/shopify_asset_url.d.ts +0 -3
  168. package/dist/src/liquid/filters/shopify/structured_data.d.ts +0 -3
  169. package/dist/src/liquid/filters/stylesheet_tag.d.ts +0 -3
  170. package/dist/src/liquid/filters/time_tag.d.ts +0 -2
  171. package/dist/src/liquid/filters/translate.d.ts +0 -3
  172. package/dist/src/liquid/filters/where.d.ts +0 -3
  173. package/dist/src/liquid/font.d.ts +0 -51
  174. package/dist/src/liquid/form.d.ts +0 -17
  175. package/dist/src/liquid/hash.d.ts +0 -5
  176. package/dist/src/liquid/index.d.ts +0 -52
  177. package/dist/src/liquid/operators.d.ts +0 -10
  178. package/dist/src/liquid/tags/assign.d.ts +0 -3
  179. package/dist/src/liquid/tags/case.d.ts +0 -3
  180. package/dist/src/liquid/tags/comment.d.ts +0 -3
  181. package/dist/src/liquid/tags/content_for.d.ts +0 -3
  182. package/dist/src/liquid/tags/doc.d.ts +0 -2
  183. package/dist/src/liquid/tags/for.d.ts +0 -3
  184. package/dist/src/liquid/tags/form.d.ts +0 -3
  185. package/dist/src/liquid/tags/if.d.ts +0 -4
  186. package/dist/src/liquid/tags/index.d.ts +0 -42
  187. package/dist/src/liquid/tags/inline_editable.d.ts +0 -3
  188. package/dist/src/liquid/tags/javascript.d.ts +0 -3
  189. package/dist/src/liquid/tags/layout.d.ts +0 -3
  190. package/dist/src/liquid/tags/paginate.d.ts +0 -3
  191. package/dist/src/liquid/tags/render.d.ts +0 -6
  192. package/dist/src/liquid/tags/section.d.ts +0 -3
  193. package/dist/src/liquid/tags/sections.d.ts +0 -3
  194. package/dist/src/liquid/tags/shopify/include.d.ts +0 -3
  195. package/dist/src/liquid/tags/shopify/schema.d.ts +0 -3
  196. package/dist/src/liquid/tags/style.d.ts +0 -3
  197. package/dist/src/liquid/tags/stylesheet.d.ts +0 -3
  198. package/dist/src/liquid/test-helpers.d.ts +0 -8
  199. package/dist/src/liquid/tokens/identifier-token.d.ts +0 -9
  200. package/dist/src/liquid/tokens/index.d.ts +0 -2
  201. package/dist/src/liquid/tokienizer.d.ts +0 -5
  202. package/dist/src/liquid/utils.d.ts +0 -45
  203. package/dist/src/menus.d.ts +0 -25
  204. package/dist/src/resources/account.d.ts +0 -6
  205. package/dist/src/resources/addresses.d.ts +0 -7
  206. package/dist/src/resources/blog.d.ts +0 -7
  207. package/dist/src/resources/blog_category.d.ts +0 -7
  208. package/dist/src/resources/cart.d.ts +0 -6
  209. package/dist/src/resources/categories.d.ts +0 -7
  210. package/dist/src/resources/category.d.ts +0 -7
  211. package/dist/src/resources/index.d.ts +0 -48
  212. package/dist/src/resources/order.d.ts +0 -7
  213. package/dist/src/resources/orders.d.ts +0 -7
  214. package/dist/src/resources/page.d.ts +0 -7
  215. package/dist/src/resources/predictive_search.d.ts +0 -6
  216. package/dist/src/resources/product.d.ts +0 -7
  217. package/dist/src/resources/product_helpers.d.ts +0 -21
  218. package/dist/src/resources/search.d.ts +0 -6
  219. package/dist/src/resources/subscription.d.ts +0 -7
  220. package/dist/src/resources/subscriptions.d.ts +0 -7
  221. package/dist/src/resources/swell_types.d.ts +0 -163
  222. package/dist/src/resources/variant.d.ts +0 -9
  223. package/dist/src/resources.d.ts +0 -113
  224. package/dist/src/theme/theme-loader.d.ts +0 -110
  225. package/dist/src/theme.d.ts +0 -204
  226. package/dist/src/utils/escape.d.ts +0 -1
  227. package/dist/src/utils/index.d.ts +0 -34
  228. package/dist/src/utils/kv-flavor.d.ts +0 -7
  229. package/dist/src/utils/logger.d.ts +0 -21
  230. package/dist/src/utils/md5.d.ts +0 -1
  231. package/dist/types/cloudflare.d.ts +0 -61
  232. package/dist/types/shopify.d.ts +0 -1035
  233. package/dist/types/swell.d.ts +0 -576
  234. package/types/index.d.ts +0 -4
  235. package/types/svg.d.ts +0 -4
@@ -1,7 +0,0 @@
1
- import { SwellStorefrontCollection } from '@/resources';
2
- import type { Swell } from '@/api';
3
- import type { SwellSubscription } from './swell_types';
4
- import type { SwellData } from 'types/swell';
5
- export default class SwellSubscriptions extends SwellStorefrontCollection<SwellSubscription> {
6
- constructor(swell: Swell, query?: SwellData);
7
- }
@@ -1,163 +0,0 @@
1
- import type { SwellStorefrontCollection } from '@/resources';
2
- import type { SwellCollection, SwellFile, SwellProductFilter } from 'types/swell';
3
- import type { Cart, Order, Subscription, Account, Address } from 'swell-js';
4
- export declare enum ScheduleInterval {
5
- Daily = "daily",
6
- Weekly = "weekly",
7
- Monthly = "monthly",
8
- Yearly = "yearly"
9
- }
10
- export interface SwellProductOptionValue {
11
- id: string;
12
- name: string;
13
- price?: number;
14
- }
15
- export interface SwellProductOption {
16
- active: boolean;
17
- variant: boolean;
18
- name: string;
19
- input_type: string;
20
- values?: SwellProductOptionValue[];
21
- }
22
- export interface SwellVariant {
23
- id: string;
24
- sku?: string;
25
- name: string;
26
- option_value_ids: string[];
27
- selected_option_values: string[];
28
- stock_status?: string;
29
- price?: number;
30
- }
31
- export interface SwellBillingSchedule {
32
- interval: ScheduleInterval;
33
- interval_count: number;
34
- limit?: number;
35
- trial_days?: number;
36
- }
37
- export interface SwellOrderSchedule {
38
- interval: ScheduleInterval;
39
- interval_count: number;
40
- limit?: number;
41
- }
42
- export interface SwellSubscriptionPlan {
43
- id: string;
44
- name: string;
45
- description: string | null;
46
- price: number;
47
- billing_schedule: SwellBillingSchedule;
48
- has_order_schedule?: boolean;
49
- order_schedule?: SwellOrderSchedule;
50
- selected?: boolean;
51
- }
52
- export interface SwellProductPurchaseOptionStandard {
53
- price: number;
54
- sale: boolean;
55
- sale_price?: number;
56
- orig_price?: number;
57
- selected?: boolean;
58
- }
59
- export interface SwellProductPurchaseOptionSubscription {
60
- plans: SwellSubscriptionPlan[];
61
- selected?: boolean;
62
- }
63
- export interface SwellProductPurchaseOptions {
64
- standard?: SwellProductPurchaseOptionStandard;
65
- subscription?: SwellProductPurchaseOptionSubscription;
66
- }
67
- export interface SwellProduct {
68
- id: string;
69
- name: string;
70
- price: number;
71
- type: string;
72
- categories?: SwellCategory[];
73
- options?: SwellProductOption[];
74
- selected_option_values?: string[];
75
- purchase_options?: SwellProductPurchaseOptions;
76
- stock_purchasable?: boolean;
77
- stock_status?: string;
78
- variants: SwellCollection<SwellVariant>;
79
- }
80
- export interface SwellCategory {
81
- id: string;
82
- slug: string;
83
- name: string;
84
- products?: SwellStorefrontCollection<SwellProduct>;
85
- filter_options: SwellProductFilter[];
86
- sort?: string;
87
- sort_options: SwellSortOption[];
88
- }
89
- export interface SwellBlogAuthor {
90
- id: string;
91
- name: string;
92
- email: string;
93
- }
94
- export interface SwellBlogCategory {
95
- id: string;
96
- title: string;
97
- slug: string;
98
- blogs?: SwellCollection<SwellBlog>;
99
- meta_title?: string;
100
- meta_description?: string;
101
- meta_keywords?: string;
102
- date_created: string;
103
- date_updated?: string;
104
- }
105
- export interface SwellBlog {
106
- id: string;
107
- title: string;
108
- slug: string;
109
- published: boolean;
110
- date_published?: string;
111
- content?: string;
112
- summary?: string;
113
- image?: SwellFile;
114
- meta_title?: string;
115
- meta_description?: string;
116
- meta_keywords?: string;
117
- author_id: string;
118
- category_id: string;
119
- tags?: string[];
120
- theme_template?: string;
121
- date_created: string;
122
- date_updated?: string;
123
- category?: SwellBlogCategory;
124
- author?: SwellBlogAuthor;
125
- }
126
- export interface SwellPage {
127
- id: string;
128
- /** @deprecated */
129
- name: string;
130
- title: string;
131
- slug: string;
132
- content?: string;
133
- published: boolean;
134
- date_published?: string;
135
- meta_title?: string;
136
- meta_description?: string;
137
- meta_keywords?: string;
138
- theme_template?: string;
139
- date_created: string;
140
- date_updated?: string;
141
- }
142
- export interface SwellSortOption {
143
- value: string;
144
- name: string;
145
- query?: string;
146
- }
147
- export interface SwellSearch {
148
- query?: string;
149
- performed: boolean;
150
- filter_options: SwellProductFilter[];
151
- sort?: string;
152
- sort_options: SwellSortOption[];
153
- }
154
- export interface SwellPredictiveSearch {
155
- query?: string;
156
- performed: boolean;
157
- products?: SwellStorefrontCollection<SwellProduct>;
158
- }
159
- export type SwellAddress = Address;
160
- export type SwellAccount = Account;
161
- export type SwellCart = Cart;
162
- export type SwellOrder = Order;
163
- export type SwellSubscription = Subscription;
@@ -1,9 +0,0 @@
1
- import { SwellStorefrontRecord } from '@/resources';
2
- import type { Swell } from '@/api';
3
- import type { SwellProduct, SwellVariant as SwellVariantType } from './swell_types';
4
- import type { SwellData } from 'types/swell';
5
- export declare function transformSwellVariant(params: SwellData, product: SwellProduct, variant: SwellVariantType): SwellVariantType;
6
- export default class SwellVariant extends SwellStorefrontRecord<SwellVariantType> {
7
- product: SwellStorefrontRecord<SwellProduct>;
8
- constructor(swell: Swell, product: SwellStorefrontRecord<SwellProduct>, id: string, query?: SwellData);
9
- }
@@ -1,113 +0,0 @@
1
- import type { Swell } from './api';
2
- import type { ShopifyCompatibility } from './compatibility/shopify';
3
- import type { SwellData, SwellRecord, SwellCollection, InferSwellCollection, SwellCollectionPages, StorefrontResourceGetter, StorefrontCollectionGetter, StorefrontSingletonGetter, StorefrontRecordGetter } from '../types/swell';
4
- export declare const MAX_QUERY_PAGE_LIMIT = 100;
5
- export declare const DEFAULT_QUERY_PAGE_LIMIT = 15;
6
- export declare class StorefrontResource<T extends SwellData = SwellData> {
7
- _getter?: StorefrontResourceGetter<T>;
8
- _getterHash?: string;
9
- _result?: T | null;
10
- _compatibilityProps: SwellData;
11
- [key: string]: any;
12
- constructor(getter?: StorefrontResourceGetter<T>);
13
- _getProxy(): StorefrontResource<T>;
14
- _getCollectionResultOrProp(instance: StorefrontResource<T>, prop: string | number): unknown;
15
- _get(..._args: unknown[]): Promise<T | null | undefined>;
16
- _setGetter(getter: StorefrontResourceGetter<T>): void;
17
- _resolve(): Promise<T | null>;
18
- _isResultResolved(): boolean;
19
- resolve(resolveStorefrontResources?: boolean, resourceMetadata?: boolean): Promise<unknown>;
20
- toObject(): (T & SwellData) | null;
21
- toJSON(): (T & SwellData) | null;
22
- valueOf(): Promise<unknown>;
23
- setCompatibilityProps(props: SwellData): void;
24
- [Symbol.toPrimitive](_type: string): unknown;
25
- getCompatibilityProp<T extends keyof StorefrontResource['_compatibilityProps']>(prop: T): StorefrontResource['_compatibilityProps'][T];
26
- }
27
- /**
28
- * Clone the resource without compatibility properties.
29
- *
30
- * Compatibility properties cause a bug with hanging promises when we retrieve properties from `StorefrontResource`.
31
- * This is due to the cyclic retrieval of properties in `StorefrontResource`.
32
- *
33
- * First we request a property from `_compatibilityProps`,
34
- * and then `_compatibilityProps` requests a property from `StorefrontResource` via a deferred handler.
35
- */
36
- export declare function cloneStorefrontResource<T extends SwellData = SwellData>(input: StorefrontResource<T>): StorefrontResource<T>;
37
- interface StorefrontResourceFetcher<T extends SwellData = SwellRecord> {
38
- get: (id?: string, query?: SwellData) => Promise<InferSwellCollection<T> | null>;
39
- list: (query?: SwellData) => Promise<T extends SwellCollection ? T : SwellCollection<T>>;
40
- }
41
- export declare class SwellStorefrontResource<T extends SwellData = SwellData> extends StorefrontResource<T> {
42
- _swell: Swell;
43
- _resource?: StorefrontResourceFetcher<T>;
44
- _resourceName: string;
45
- readonly _collection: string;
46
- _query: SwellData;
47
- _compatibilityInstance: ShopifyCompatibility | null;
48
- constructor(swell: Swell, collection: string, getter?: StorefrontResourceGetter<T>);
49
- _getProxy(): SwellStorefrontResource<T>;
50
- _getResourceObject(): StorefrontResourceFetcher<T>;
51
- }
52
- export declare class SwellStorefrontCollection<T extends SwellData = SwellData> extends SwellStorefrontResource<SwellCollection<T>> {
53
- length: number;
54
- results?: T[];
55
- count?: number;
56
- page?: number;
57
- pages?: SwellCollectionPages;
58
- page_count?: number;
59
- limit: number;
60
- name?: string;
61
- constructor(swell: Swell, collection: string, query?: SwellData, getter?: StorefrontCollectionGetter<T>);
62
- _getProxy(): SwellStorefrontCollection<T>;
63
- _initQuery(query: SwellData): SwellData;
64
- _defaultGetter(): StorefrontResourceGetter<SwellCollection<T>>;
65
- _get(query?: SwellData): Promise<SwellCollection<T> | null | undefined>;
66
- get size(): Promise<number> | number;
67
- [Symbol.iterator](): Promise<ArrayIterator<T>>;
68
- iterator(): Promise<ArrayIterator<T>>;
69
- private makeIterator;
70
- _clone(newProps?: SwellData): SwellStorefrontCollection<T>;
71
- _cloneWithCompatibilityResult<R extends SwellData = SwellData>(compatibilityGetter: (result: SwellCollection<T>) => SwellCollection<R>): SwellStorefrontCollection<R>;
72
- }
73
- export declare class SwellStorefrontRecord<T extends SwellData = SwellRecord> extends SwellStorefrontResource<T> {
74
- _id: string;
75
- _params: SwellData;
76
- constructor(swell: Swell, collection: string, id: string, query?: SwellData, getter?: StorefrontRecordGetter<T>);
77
- _getProxy(): SwellStorefrontRecord<T>;
78
- _defaultGetter(): StorefrontResourceGetter<T>;
79
- _get(id: string, query?: SwellData): Promise<T | null | undefined>;
80
- }
81
- export declare class SwellStorefrontSingleton<T extends SwellData = SwellData> extends SwellStorefrontResource<T> {
82
- constructor(swell: Swell, collection: string, getter?: StorefrontSingletonGetter<T>);
83
- _getProxy(): SwellStorefrontSingleton<T>;
84
- _defaultGetter(): StorefrontResourceGetter<T>;
85
- _get(): Promise<T | null | undefined>;
86
- }
87
- export declare class SwellStorefrontPagination<T extends SwellData = SwellData> {
88
- _resource: SwellStorefrontCollection<T>;
89
- count: number;
90
- page: number;
91
- page_count: number;
92
- limit: number;
93
- pages: Record<string, {
94
- start: number;
95
- end: number;
96
- url: string;
97
- }>;
98
- next?: {
99
- start: number;
100
- end: number;
101
- url: string;
102
- };
103
- previous?: {
104
- start: number;
105
- end: number;
106
- url: string;
107
- };
108
- constructor(resource: SwellStorefrontCollection<T>);
109
- setPaginationProps(): void;
110
- getPageUrl(page: number): string;
111
- setCompatibilityProps(props: SwellData): void;
112
- }
113
- export {};
@@ -1,110 +0,0 @@
1
- import type { Swell } from '@/api';
2
- import type { PutFilesResult } from '../cache';
3
- import type { SwellThemeConfig, SwellThemePreload, SwellThemeRecord } from 'types/swell';
4
- /**
5
- * Responsible for loading and managing theme configurations.
6
- * Uses a single batch loading strategy for optimal performance.
7
- */
8
- export declare class ThemeLoader {
9
- private static cache;
10
- private swell;
11
- private themeRecord;
12
- private configs;
13
- constructor(swell: Swell);
14
- /**
15
- * Initialize the theme loader with all configurations.
16
- * Either uses provided configs (editor mode) or loads from storage.
17
- */
18
- init(themeConfigs?: Map<string, SwellThemeConfig>): Promise<void>;
19
- getThemeRecord(): SwellThemeRecord | null;
20
- /**
21
- * Get a single config by file path (synchronous).
22
- * Returns null if config not found.
23
- */
24
- getConfig(filePath: string): SwellThemeConfig | null;
25
- /**
26
- * Get all loaded configs.
27
- * Used by theme getter to expose configs to editor/tests.
28
- */
29
- getConfigs(): Map<string, SwellThemeConfig>;
30
- /**
31
- * Get multiple configs by path pattern (synchronous).
32
- * Filters configs by prefix and optional suffix.
33
- */
34
- getConfigsByPath(pathPrefix: string, pathSuffix?: string): SwellThemeConfig[];
35
- /**
36
- * Load theme configs from internal data, typically in the editor.
37
- * Used when configs are provided externally (e.g., from editor).
38
- */
39
- setConfigs(themeConfigs: Map<string, SwellThemeConfig>): void;
40
- /**
41
- * Load theme record from internal data, typically in the editor.
42
- * Used when theme record is provided externally (e.g., from editor).
43
- */
44
- setThemeRecord(themeRecord: SwellThemeRecord): void;
45
- /**
46
- * Updates KV with file_data for provided theme configs (warmup path).
47
- * Uses the new ThemeFileStorage abstraction for optimized operations.
48
- */
49
- updateThemeCache(payload: SwellThemePreload): Promise<PutFilesResult>;
50
- /**
51
- * Load theme record (/:themes/{themeId}) with caching.
52
- */
53
- private loadThemeRecord;
54
- /**
55
- * Main loading logic - loads all configs at once.
56
- * 1. Fetches lightweight metadata (cached when possible)
57
- * 2. Batch hydrates file_data from KV
58
- * 3. Fetches missing file_data from API if needed
59
- */
60
- private loadAllConfigs;
61
- /**
62
- * Fetch lightweight config metadata from API or cache.
63
- * Does NOT include file_data to minimize payload size.
64
- */
65
- private fetchConfigMetadata;
66
- /**
67
- * Helper to ensure all configs have file_data.
68
- * Fetches missing data from API and updates KV cache.
69
- */
70
- private ensureConfigsHaveData;
71
- /**
72
- * Fetches theme configs with file_data from Swell Backend API.
73
- * Used to retrieve missing file_data for configs.
74
- */
75
- private fetchThemeConfigsFromSource;
76
- /**
77
- * Get the current theme ID from headers.
78
- */
79
- private getThemeId;
80
- /**
81
- * Get the current theme version hash from headers.
82
- */
83
- private getThemeVersionHash;
84
- /**
85
- * Generate a Swell API query filter for this theme version.
86
- */
87
- private themeVersionQueryFilter;
88
- /**
89
- * Check if a config should have file_data based on FILE_DATA_INCLUDE_QUERY rules.
90
- * This mirrors the server-side logic to avoid fetching data for configs that won't have it.
91
- */
92
- private shouldIncludeFileData;
93
- /**
94
- * Filter configs to only those eligible for file_data.
95
- * Aligns with FILE_DATA_INCLUDE_QUERY server-side logic.
96
- */
97
- private filterConfigsForDataInclusion;
98
- /**
99
- * Build cache key with tenant isolation for metadata
100
- */
101
- private buildMetadataCacheKey;
102
- /**
103
- * Build cache key for theme record.
104
- */
105
- private buildThemeRecordCacheKey;
106
- /**
107
- * Get or create the theme cache instance
108
- */
109
- private getCache;
110
- }
@@ -1,204 +0,0 @@
1
- import { Swell, StorefrontResource, SwellStorefrontCollection, SwellStorefrontRecord, SwellStorefrontSingleton } from './api';
2
- import { ShopifyCompatibility } from './compatibility/shopify';
3
- import { LiquidSwell, ThemeFont, ThemeForm } from './liquid';
4
- import { ThemeLoader } from './theme/theme-loader';
5
- import type { PutFilesResult } from './cache';
6
- import type { FormatInput } from 'swell-js';
7
- import type { ThemeGlobals, ThemeConfigs, ThemeSettings, ThemeResources, ThemeFormConfig, ThemeInitGlobalsOptions, ThemeFormErrorMessages, ThemeLocaleConfig, ThemePresetSchema, ThemeSectionGroup, ThemeSectionGroupInfo, ThemeSectionSchema, ThemeSectionConfig, ThemeSectionSettings, ThemeBlockSchema, ThemeSettingFieldSchema, ThemeSettingSectionSchema, ThemePage, ThemePageSectionSchema, ThemePageTemplateConfig, ThemeLayoutSectionGroupConfig, SwellData, SwellMenu, SwellRecord, SwellAppConfig, SwellThemeConfig, SwellThemePreload, SwellAppStorefrontThemeProps, SwellAppShopifyCompatibilityConfig, SwellPageRequest, SwellSettingsGeo, SwellThemeRecord } from '../types/swell';
8
- export declare class SwellTheme {
9
- swell: Swell;
10
- props: SwellAppStorefrontThemeProps;
11
- globals: ThemeGlobals;
12
- forms?: ThemeFormConfig[];
13
- resources?: ThemeResources;
14
- dynamicAssetUrl?: string;
15
- liquidSwell: LiquidSwell;
16
- themeLoader: ThemeLoader;
17
- page?: ThemePage;
18
- pageId: string | undefined;
19
- shopifyCompatibility: ShopifyCompatibility | null;
20
- shopifyCompatibilityClass: typeof ShopifyCompatibility;
21
- shopifyCompatibilityConfig: SwellAppShopifyCompatibilityConfig | null;
22
- formData: Record<string, ThemeForm>;
23
- globalData: SwellData;
24
- themeSettingFilePath: string;
25
- private pageSectionGroups;
26
- constructor(swell: Swell, options?: {
27
- forms?: ThemeFormConfig[];
28
- resources?: ThemeResources;
29
- globals?: ThemeGlobals;
30
- dynamicAssetUrl?: string;
31
- shopifyCompatibilityClass?: typeof ShopifyCompatibility;
32
- });
33
- /**
34
- * Getter for theme configs - returns the configs from the loader.
35
- * Used by editor and tests to access loaded configs.
36
- */
37
- get themeConfigs(): Map<string, SwellThemeConfig> | null;
38
- /**
39
- * Setter for theme configs - directly sets configs in the loader.
40
- * Used by editor and tests to inject configs without API/KV loading.
41
- */
42
- set themeConfigs(configs: Map<string, SwellThemeConfig> | null);
43
- /**
44
- * Setter for theme record - directly sets theme record in the loader.
45
- */
46
- set themeRecord(themeRecord: SwellThemeRecord);
47
- getSwellAppThemeProps(swellConfig?: SwellAppConfig): SwellAppStorefrontThemeProps;
48
- initGlobals(pageId: string, options?: ThemeInitGlobalsOptions): Promise<void>;
49
- setGlobals(globals: Partial<ThemeGlobals>): void;
50
- getSettingsAndConfigs(): Promise<{
51
- store: SwellData;
52
- session: SwellData;
53
- menus: Record<string, SwellMenu | undefined>;
54
- geo: SwellSettingsGeo;
55
- configs: ThemeConfigs;
56
- storefrontSettings: SwellData;
57
- }>;
58
- resolvePageData(store: SwellData, configs: ThemeConfigs, pageId?: string, altTemplate?: string): Promise<{
59
- settings: ThemeSettings;
60
- request: SwellPageRequest;
61
- page: ThemePage;
62
- cart: SwellStorefrontSingleton;
63
- account: SwellStorefrontSingleton | null;
64
- customer?: SwellStorefrontSingleton | null;
65
- }>;
66
- fetchSingletonResourceCached<R>(key: string, handler: () => Promise<R>, defaultValue: () => R | Promise<R>, isCacheble?: boolean): Promise<R | undefined>;
67
- fetchCart(): Promise<StorefrontResource>;
68
- fetchAccount(): Promise<StorefrontResource | null>;
69
- getFormConfig(formType: string): ThemeFormConfig | undefined;
70
- setFormData(formId: string, options: {
71
- params?: any;
72
- success?: boolean;
73
- withoutErrors?: boolean;
74
- errors?: ThemeFormErrorMessages;
75
- }): void;
76
- setFormSuccessWithoutErrors(formId: string): void;
77
- clearFormData(formId?: string): void;
78
- serializeFormData(): SwellData | null;
79
- setGlobalData(data?: SwellData): void;
80
- serializeGlobalData(): SwellData | null;
81
- /**
82
- * Extracts values from the form according to the passed settings config
83
- *
84
- * @input
85
- * ```js
86
- * form = {
87
- * field1: { value: 'value1' },
88
- * field2: { value: 'value2' },
89
- * field3: { value: null },
90
- * extra: { value: 'value3' },
91
- * }
92
- * config = {
93
- * field1: 'old1',
94
- * field2: 'old2',
95
- * field3: 'old3',
96
- * field4: 'old4',
97
- * }
98
- * ```
99
- *
100
- * @output
101
- * ```js
102
- * return {
103
- * field1: 'value1',
104
- * field2: 'value2',
105
- * field3: 'old3',
106
- * field4: 'old4',
107
- * }
108
- * ```
109
- */
110
- updateSettings(form: Record<string, {
111
- value: unknown;
112
- } | undefined>, config: Record<string, unknown>): ThemeSettings;
113
- resolveTranslationLocale(languageConfig: ThemeSettings, locale?: string): ThemeSettings;
114
- setCompatibilityConfigs(configs: ThemeConfigs): Promise<void>;
115
- setCompatibilityData(pageData: SwellData): void;
116
- getLocaleConfig(localeCode?: string, suffix?: string): Promise<ThemeLocaleConfig>;
117
- resolveLookupSetting(setting: ThemeSettingFieldSchema, value: unknown): SwellData | SwellStorefrontRecord | SwellStorefrontCollection | null;
118
- resolveLookupResource(collection: string, id: string): StorefrontResource<SwellRecord>;
119
- resolveMenuSettings(): Promise<Record<string, SwellMenu | undefined>>;
120
- resolveMenuSetting(value: string): SwellMenu | null;
121
- lang(key: string, data?: any, fallback?: string): Promise<string>;
122
- resolveFontSetting(value: string): ThemeFont;
123
- resolveUrlSetting(value: string): string;
124
- resolveImageSetting(value: string): string;
125
- preloadThemeConfigs(payload: SwellThemePreload): Promise<PutFilesResult>;
126
- getPageConfigPath(pageId: string, altTemplate?: string): string | null;
127
- getThemeRecord(): SwellThemeRecord | null;
128
- getThemeConfig(filePath: string): Promise<SwellThemeConfig | null>;
129
- getThemeConfigsByPath(pathPrefix: string, pathSuffix?: string): Map<string, SwellThemeConfig>;
130
- getThemeTemplateConfig(filePath: string): Promise<SwellThemeConfig | null>;
131
- /**
132
- * Internal synchronous helper for getting template configs by type.
133
- * Used internally within theme.ts to avoid async overhead.
134
- */
135
- private _getTemplateConfigByType;
136
- /**
137
- * Internal synchronous helper for getting template configs.
138
- */
139
- private _getTemplateConfig;
140
- getThemeTemplateConfigByType(type: string, name: string, suffix?: string): Promise<SwellThemeConfig | null>;
141
- getAssetConfig(assetName: string): Promise<SwellThemeConfig | null>;
142
- getDynamicAssetUrl(filePath: string): Promise<string | null>;
143
- getAssetUrl(filePath: string): Promise<string | null>;
144
- renderTemplate(config: SwellThemeConfig | null, data?: SwellData): Promise<string>;
145
- renderTemplateString(templateString: string, data?: SwellData): Promise<string>;
146
- getSectionSchema(sectionName: string): Promise<Partial<ThemeSectionSchema> | undefined>;
147
- getSectionConfigWithSchemaTagOnly(config: SwellThemeConfig): SwellThemeConfig | null;
148
- renderThemeTemplate(filePath: `${string}.liquid`, data?: SwellData): Promise<string>;
149
- renderThemeTemplate(filePath: `${string}.json`, data?: SwellData): Promise<ThemePageTemplateConfig>;
150
- renderThemeTemplate(filePath: string, data?: SwellData): Promise<string | ThemePageTemplateConfig>;
151
- renderLayoutTemplate(name: string, data?: SwellData): Promise<string>;
152
- renderPageTemplate(name: string, data?: SwellData, altTemplateId?: string): Promise<string | ThemePageTemplateConfig>;
153
- renderPage(pageData?: SwellData, altTemplateId?: string): Promise<string | ThemePageTemplateConfig>;
154
- getShopify1HomePageSectionGroup(): ThemeSectionGroup;
155
- getShopify1HomePageSections(resolveSettings?: boolean): Promise<ThemeSectionConfig[]>;
156
- renderShopify1HomePage(pageContent: string): Promise<string>;
157
- isShopify1HomePage(pageId: string, pageContent: unknown): pageContent is string;
158
- getSectionClassName(): string;
159
- getSectionIdPrefix(): string;
160
- renderAllSections(sectionsIds: string | Array<string>, pageData?: SwellData): Promise<Record<string, string | undefined>>;
161
- renderSection(sectionId: string, pageData?: SwellData): Promise<string | ThemePageTemplateConfig>;
162
- renderLayout(layoutName?: string, data?: SwellData, contentForLayout?: string, contentForHeader?: string): Promise<string>;
163
- private renderDataFields;
164
- getContentForHeader(): string;
165
- renderFontHeaderLinks(): string;
166
- getTemplateSchema(config: SwellThemeConfig): Promise<ThemeSectionSchema | undefined>;
167
- resolveStaticSectionSettings(sectionSchema: ThemeSectionSchema, presetSchema?: ThemePresetSchema): SwellData;
168
- getAllSections(): Promise<ThemePageSectionSchema[]>;
169
- /**
170
- * Returns all theme block schemas from /blocks folder.
171
- */
172
- getAllThemeBlockSchemas(): ThemeBlockSchema[];
173
- getPageSections(sectionGroup: ThemeSectionGroup, resolveSettings?: boolean): Promise<ThemeSectionConfig[]>;
174
- addPageSection(sectionFileName: string, group: boolean): Promise<void>;
175
- /**
176
- * Get a list of sections and section groups in a page layout.
177
- */
178
- getPageSectionGroups(pageId: string, altTemplate?: string): Promise<ThemeSectionGroupInfo[]>;
179
- getLayoutSectionGroups(sectionGroups: ThemeSectionGroupInfo[], resolveSettings?: boolean): Promise<ThemeLayoutSectionGroupConfig[]>;
180
- renderPageSections(sectionGroup: ThemeSectionGroup, data?: SwellData): Promise<ThemeSectionConfig[]>;
181
- renderSectionConfigs(sectionConfigs: ThemeSectionConfig[], data?: SwellData): Promise<ThemeSectionConfig[]>;
182
- renderTranslation(key: string, data?: unknown, fallback?: string): Promise<string>;
183
- renderTranslationValue(localeCode: string, langConfig: any, key: string, data?: any, fallback?: string): Promise<string>;
184
- renderCurrency(amount: number, params?: FormatInput): string;
185
- }
186
- export declare class PageError extends Error {
187
- title: string;
188
- status: number;
189
- description?: string;
190
- constructor(title?: string | Error, status?: number, description?: string);
191
- toString(): string;
192
- }
193
- export declare class PageNotFound extends PageError {
194
- constructor(title?: string, status?: number, description?: string);
195
- }
196
- export declare function resolveSectionSettings(theme: SwellTheme, sectionConfig: ThemeSectionConfig, index?: number): ThemeSectionSettings | undefined;
197
- export declare function resolveThemeSettings(theme: SwellTheme, themeSettings: ThemeSettings, editorSchemaSettings?: ThemeSettingSectionSchema[]): ThemeSettings;
198
- export interface ThemeSettingFieldValue {
199
- setting: ThemeSettingFieldSchema;
200
- value: any;
201
- }
202
- export declare function findThemeSettingsByType(type: string, themeSettings: ThemeSettings, editorSchemaSettings: ThemeSettingSectionSchema[]): ThemeSettingFieldValue[];
203
- export declare function resolveLookupCollection(setting: ThemeSettingFieldSchema): string | null | undefined;
204
- export declare function findEditorSetting(editorSchemaSettings: ThemeSettingSectionSchema[], key: string): ThemeSettingFieldSchema | null;
@@ -1 +0,0 @@
1
- export declare function unescapeLiquidSyntax(template: string): string;
@@ -1,34 +0,0 @@
1
- import { CURRENCY_COUNTRIES } from '../constants';
2
- import type { SwellData, SwellLocale, SwellThemeConfig, ThemeLayoutSectionGroupConfig, ThemePageSectionSchema, ThemeSectionConfig, ThemeSectionGroup, ThemeSectionSchema, ThemeSettings } from 'types/swell';
3
- export * from './md5';
4
- export { configureSdkLogger, type SdkLoggerConfig } from './logger';
5
- export { getKVFlavor, resetKVFlavorCache } from './kv-flavor';
6
- export declare function getAllSections(themeConfigs: Map<string, SwellThemeConfig>, renderTemplateSchema: (config: SwellThemeConfig) => Promise<ThemeSectionSchema | undefined>): Promise<ThemePageSectionSchema[]>;
7
- export declare function getLayoutSectionGroups(allSections: Map<string, SwellThemeConfig>, renderTemplateSchema: (config: SwellThemeConfig) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemeLayoutSectionGroupConfig[]>;
8
- export declare function getPageSections(sectionGroup: ThemeSectionGroup, getSchema: (type: string) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemeSectionConfig[]>;
9
- export declare function isArray<T>(value: unknown): value is Array<T>;
10
- export declare function isObject(value: unknown): value is Record<string, unknown>;
11
- export declare function toBase64(inputString: string): string;
12
- export declare function arrayToObject<T extends {
13
- [I in keyof T | K]?: T[I];
14
- }, K extends string = 'id'>(arr: T[], key?: K): Record<string, T | undefined>;
15
- export declare function getCountryCodeFromLocale(locale: string): string;
16
- export declare function getCountryByCurrency(currencyCode: keyof typeof CURRENCY_COUNTRIES): {
17
- name: string;
18
- iso: string;
19
- } | null;
20
- export declare function getCurrencyByCountry(countryCode: string): string;
21
- export declare function isLikeSwellLocale(value: unknown): value is SwellLocale;
22
- export declare function forEachKeyDeep(obj: Record<string, unknown>, fn: (key: string, value: unknown) => boolean | void): void;
23
- export declare function findCircularReferences(value: object): unknown[];
24
- export declare function removeCircularReferences(value: object): object;
25
- export declare function dehydrateSwellRefsInStorefrontResources(obj: unknown): void;
26
- export declare function resolveAsyncResources(response: unknown, resolveStorefrontResources?: boolean, resolveWithResourceMetadata?: boolean): Promise<unknown>;
27
- export declare function stringifyQueryParams(queryParams: SwellData): string;
28
- export declare function scopeCustomCSS(custom_css: string | string[], sectionID: string): string;
29
- export declare function extractSettingsFromForm(form: Record<string, {
30
- value: unknown;
31
- } | undefined>, currentSettings: Record<string, unknown>): ThemeSettings;
32
- export declare function getSectionLocation(sectionType?: string): string;
33
- export declare const SECTION_GROUP_CONTENT = "ContentSections";
34
- export declare function getSectionGroupProp(sectionId: string): string;
@@ -1,7 +0,0 @@
1
- import type { KVFlavor } from '../cache';
2
- import type { CFThemeEnv } from '../../types/cloudflare';
3
- /**
4
- * Get KV storage flavor. Priority: KV_FLAVOR env var > auto-detection > miniflare default
5
- */
6
- export declare function getKVFlavor(workerEnv?: CFThemeEnv): KVFlavor;
7
- export declare function resetKVFlavorCache(): void;
@@ -1,21 +0,0 @@
1
- export declare const logLevels: {
2
- readonly error: 0;
3
- readonly warn: 1;
4
- readonly info: 2;
5
- readonly debug: 3;
6
- };
7
- export type LogLevel = keyof typeof logLevels;
8
- export type TimestampFormat = 'off' | 'iso' | 'unix';
9
- export interface SdkLoggerConfig {
10
- level?: LogLevel;
11
- timestamp?: TimestampFormat;
12
- structured?: boolean;
13
- }
14
- export declare function configureSdkLogger(config?: SdkLoggerConfig): void;
15
- export declare const logger: {
16
- error: (...args: any[]) => void;
17
- warn: (...args: any[]) => void;
18
- info: (...args: any[]) => void;
19
- debug: (...args: any[]) => void;
20
- };
21
- export declare function createTraceId(data?: string): string;