@brytdesigns/shopify-utils 1.2.22 → 3.1.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.
Files changed (125) hide show
  1. package/dist/effect/Actions/bridge.js +71 -0
  2. package/dist/effect/Actions/bridge.js.map +1 -0
  3. package/dist/effect/Actions/errors.js +46 -0
  4. package/dist/effect/Actions/errors.js.map +1 -0
  5. package/dist/effect/Actions/index.js +23 -0
  6. package/dist/effect/Actions/index.js.map +1 -0
  7. package/dist/effect/Actions/service.js +127 -0
  8. package/dist/effect/Actions/service.js.map +1 -0
  9. package/dist/effect/Actions/trampoline.js +26 -0
  10. package/dist/effect/Actions/trampoline.js.map +1 -0
  11. package/dist/effect/Ajax/Sections/index.js +2 -4
  12. package/dist/effect/Ajax/Sections/schema.js +28 -39
  13. package/dist/effect/Ajax/Sections/schema.js.map +1 -1
  14. package/dist/effect/Ajax/Window/data/AllowedRouteOrigins.js +75 -0
  15. package/dist/effect/Ajax/Window/data/AllowedRouteOrigins.js.map +1 -0
  16. package/dist/effect/Ajax/Window/data/ShopifyRoutes.js +86 -37
  17. package/dist/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -1
  18. package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js +14 -13
  19. package/dist/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -1
  20. package/dist/effect/Ajax/Window/data/StorefrontOrigin.js +32 -0
  21. package/dist/effect/Ajax/Window/data/StorefrontOrigin.js.map +1 -0
  22. package/dist/effect/Ajax/Window/data/index.js +15 -5
  23. package/dist/effect/Ajax/Window/data/index.js.map +1 -1
  24. package/dist/effect/Ajax/Window/index.js +2 -4
  25. package/dist/effect/Ajax/index.js +13 -3
  26. package/dist/effect/Ajax/index.js.map +1 -1
  27. package/dist/effect/Logging/index.js +13 -10
  28. package/dist/effect/Logging/index.js.map +1 -1
  29. package/dist/effect/Resource/data.js +20 -30
  30. package/dist/effect/Resource/data.js.map +1 -1
  31. package/dist/effect/Resource/index.js +14 -3
  32. package/dist/effect/Resource/index.js.map +1 -1
  33. package/dist/effect/Resource/schema.js +46 -45
  34. package/dist/effect/Resource/schema.js.map +1 -1
  35. package/dist/effect/Schemas/index.js +75 -0
  36. package/dist/effect/Schemas/index.js.map +1 -0
  37. package/dist/effect/_virtual/_rolldown/runtime.js +13 -0
  38. package/dist/effect/index.d.ts +396 -62
  39. package/dist/effect/index.js +6 -8
  40. package/dist/main/_virtual/_rolldown/runtime.js +13 -0
  41. package/dist/main/actions.js +78 -0
  42. package/dist/main/actions.js.map +1 -0
  43. package/dist/main/effect/Actions/bridge.js +65 -0
  44. package/dist/main/effect/Actions/bridge.js.map +1 -0
  45. package/dist/main/effect/Actions/errors.js +46 -0
  46. package/dist/main/effect/Actions/errors.js.map +1 -0
  47. package/dist/main/effect/Actions/index.js +4 -0
  48. package/dist/main/effect/Actions/service.js +127 -0
  49. package/dist/main/effect/Actions/service.js.map +1 -0
  50. package/dist/main/effect/Actions/trampoline.js +26 -0
  51. package/dist/main/effect/Actions/trampoline.js.map +1 -0
  52. package/dist/main/effect/Ajax/Sections/index.js +1 -4
  53. package/dist/main/effect/Ajax/Sections/schema.js +11 -41
  54. package/dist/main/effect/Ajax/Sections/schema.js.map +1 -1
  55. package/dist/main/effect/Ajax/Window/data/AllowedRouteOrigins.js +18 -0
  56. package/dist/main/effect/Ajax/Window/data/AllowedRouteOrigins.js.map +1 -0
  57. package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js +37 -37
  58. package/dist/main/effect/Ajax/Window/data/ShopifyRoutes.js.map +1 -1
  59. package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js +3 -14
  60. package/dist/main/effect/Ajax/Window/data/StorefrontClientConfig.js.map +1 -1
  61. package/dist/main/effect/Ajax/Window/data/StorefrontOrigin.js +6 -0
  62. package/dist/main/effect/Ajax/Window/data/StorefrontOrigin.js.map +1 -0
  63. package/dist/main/effect/Ajax/Window/data/index.js +4 -6
  64. package/dist/main/effect/Ajax/Window/index.js +1 -4
  65. package/dist/main/effect/Ajax/index.js +2 -4
  66. package/dist/main/effect/Logging/index.js +2 -13
  67. package/dist/main/effect/Resource/data.js +20 -30
  68. package/dist/main/effect/Resource/data.js.map +1 -1
  69. package/dist/main/effect/Resource/index.js +3 -4
  70. package/dist/main/effect/Resource/schema.js +46 -45
  71. package/dist/main/effect/Resource/schema.js.map +1 -1
  72. package/dist/main/effect/Schemas/index.js +28 -0
  73. package/dist/main/effect/Schemas/index.js.map +1 -0
  74. package/dist/main/effect/index.js +5 -8
  75. package/dist/main/index.d.ts +359 -11
  76. package/dist/main/index.js +3 -3
  77. package/dist/main/resources/index.js +8 -7
  78. package/dist/main/resources/index.js.map +1 -1
  79. package/package.json +9 -9
  80. package/dist/effect/Ajax/Sections/index.js.map +0 -1
  81. package/dist/effect/Ajax/Window/data/types.js +0 -3
  82. package/dist/effect/Ajax/Window/data/types.js.map +0 -1
  83. package/dist/effect/Ajax/Window/index.js.map +0 -1
  84. package/dist/effect/index.js.map +0 -1
  85. package/dist/index.d.ts +0 -77
  86. package/dist/jsdelivr/effect/Ajax/Sections/index.js +0 -4
  87. package/dist/jsdelivr/effect/Ajax/Sections/index.js.map +0 -1
  88. package/dist/jsdelivr/effect/Ajax/Sections/schema.js +0 -20
  89. package/dist/jsdelivr/effect/Ajax/Sections/schema.js.map +0 -1
  90. package/dist/jsdelivr/effect/Ajax/Window/data/ShopifyRoutes.js +0 -38
  91. package/dist/jsdelivr/effect/Ajax/Window/data/ShopifyRoutes.js.map +0 -1
  92. package/dist/jsdelivr/effect/Ajax/Window/data/StorefrontClientConfig.js +0 -16
  93. package/dist/jsdelivr/effect/Ajax/Window/data/StorefrontClientConfig.js.map +0 -1
  94. package/dist/jsdelivr/effect/Ajax/Window/data/index.js +0 -6
  95. package/dist/jsdelivr/effect/Ajax/Window/data/index.js.map +0 -1
  96. package/dist/jsdelivr/effect/Ajax/Window/data/types.js +0 -3
  97. package/dist/jsdelivr/effect/Ajax/Window/data/types.js.map +0 -1
  98. package/dist/jsdelivr/effect/Ajax/Window/index.js +0 -4
  99. package/dist/jsdelivr/effect/Ajax/Window/index.js.map +0 -1
  100. package/dist/jsdelivr/effect/Ajax/index.js +0 -4
  101. package/dist/jsdelivr/effect/Ajax/index.js.map +0 -1
  102. package/dist/jsdelivr/effect/Logging/index.js +0 -13
  103. package/dist/jsdelivr/effect/Logging/index.js.map +0 -1
  104. package/dist/jsdelivr/effect/Resource/data.js +0 -17
  105. package/dist/jsdelivr/effect/Resource/data.js.map +0 -1
  106. package/dist/jsdelivr/effect/Resource/index.js +0 -4
  107. package/dist/jsdelivr/effect/Resource/index.js.map +0 -1
  108. package/dist/jsdelivr/effect/Resource/schema.js +0 -47
  109. package/dist/jsdelivr/effect/Resource/schema.js.map +0 -1
  110. package/dist/jsdelivr/effect/index.js +0 -8
  111. package/dist/jsdelivr/effect/index.js.map +0 -1
  112. package/dist/jsdelivr/index.js +0 -3
  113. package/dist/jsdelivr/index.js.map +0 -1
  114. package/dist/jsdelivr/resources/index.js +0 -9
  115. package/dist/jsdelivr/resources/index.js.map +0 -1
  116. package/dist/main/effect/Ajax/Sections/index.js.map +0 -1
  117. package/dist/main/effect/Ajax/Window/data/index.js.map +0 -1
  118. package/dist/main/effect/Ajax/Window/data/types.js +0 -3
  119. package/dist/main/effect/Ajax/Window/data/types.js.map +0 -1
  120. package/dist/main/effect/Ajax/Window/index.js.map +0 -1
  121. package/dist/main/effect/Ajax/index.js.map +0 -1
  122. package/dist/main/effect/Logging/index.js.map +0 -1
  123. package/dist/main/effect/Resource/index.js.map +0 -1
  124. package/dist/main/effect/index.js.map +0 -1
  125. package/dist/main/index.js.map +0 -1
@@ -1,12 +1,311 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import * as Cause from 'effect/Cause';
4
+ import * as Context from 'effect/Context';
3
5
  import * as Effect from 'effect/Effect';
6
+ import * as Layer from 'effect/Layer';
4
7
  import * as LogLevel from 'effect/LogLevel';
5
- import { ParseError } from 'effect/ParseResult';
6
8
  import * as Schema from 'effect/Schema';
9
+ import * as Scope from 'effect/Scope';
7
10
 
11
+ declare const toAsyncCallback: <Args extends ReadonlyArray<unknown>, A, E, R>(services: Context.Context<R>, f: (...args: Args) => Effect.Effect<A, E, R>) => (...args: Args) => Promise<A>;
12
+ declare const toSyncCallback: <Args extends ReadonlyArray<unknown>, A, R>(services: Context.Context<R>, f: (...args: Args) => Effect.Effect<A, never, R>, onAbnormal: (cause: Cause.Cause<never>) => A) => (...args: Args) => A;
13
+ declare const fromPromiseThunk: <A, E>(thunk: () => Promise<A>, onReject: (cause: unknown) => E) => Effect.Effect<A, E>;
14
+ /** Every action exposed on `window.Shopify.actions`. */
15
+ export type ActionName = "getCart" | "updateCart" | "openCart";
16
+ /**
17
+ * Only `updateCart` and `openCart` are `ActionFunction`s — `getCart` is a bare
18
+ * callable with no `configure()` / `isDefault()`.
19
+ */
20
+ export type ConfigurableActionName = Exclude<ActionName, "getCart">;
21
+ declare const ActionsUnavailableError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{
22
+ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P];
23
+ }>) => import("effect/Cause").YieldableError & {
24
+ readonly _tag: "@brytdesigns/shopify-utils/ActionsUnavailableError";
25
+ } & Readonly<A>;
26
+ declare class ActionsUnavailableError extends ActionsUnavailableError_base<{
27
+ readonly action: ActionName;
28
+ readonly message: string;
29
+ }> {
30
+ constructor(options: {
31
+ readonly action: ActionName;
32
+ });
33
+ }
34
+ declare const ActionConfigurationRejectedError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{
35
+ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P];
36
+ }>) => import("effect/Cause").YieldableError & {
37
+ readonly _tag: "@brytdesigns/shopify-utils/ActionConfigurationRejectedError";
38
+ } & Readonly<A>;
39
+ declare class ActionConfigurationRejectedError extends ActionConfigurationRejectedError_base<{
40
+ readonly action: ConfigurableActionName;
41
+ readonly message: string;
42
+ }> {
43
+ constructor(options: {
44
+ readonly action: ConfigurableActionName;
45
+ });
46
+ }
47
+ declare const ActionInvocationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{
48
+ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P];
49
+ }>) => import("effect/Cause").YieldableError & {
50
+ readonly _tag: "@brytdesigns/shopify-utils/ActionInvocationError";
51
+ } & Readonly<A>;
52
+ declare class ActionInvocationError extends ActionInvocationError_base<{
53
+ readonly action: ActionName;
54
+ readonly cause: unknown;
55
+ readonly message: string;
56
+ }> {
57
+ constructor(options: {
58
+ readonly action: ActionName;
59
+ readonly cause: unknown;
60
+ });
61
+ }
62
+ // -----------------------------------------------------------------------------
63
+ // VENDORED FILE — DO NOT EDIT BY HAND.
64
+ //
65
+ // Source: https://cdn.shopify.com/storefront/standard-actions.d.ts
66
+ // Vendored: 2026-08-13
67
+ // Upstream version (see `// version:` line below): 977e4f914dd2b3eca85ad01dee81c2c96eb1b2e5
68
+ // sha256 (upstream body only, i.e. everything below this header):
69
+ // 2f0fc044f35999cd09550b8b68620077601d1409817edae16745e600417788e7
70
+ //
71
+ // Everything below this header is the upstream file byte-for-byte. To diff
72
+ // against a future revision:
73
+ //
74
+ // curl -sSL https://cdn.shopify.com/storefront/standard-actions.d.ts \
75
+ // | diff - <(tail -n +25 shopify/utils/src/types/standard-actions.d.ts)
76
+ //
77
+ // There is NO npm package for this. Shopify injects the runtime on every Liquid
78
+ // storefront as `window.Shopify.actions`; a module build for import maps lives
79
+ // at https://cdn.shopify.com/storefront/standard-actions.js. Do not add a
80
+ // dependency — import types via the `@theme/standard-actions` alias
81
+ // (see tsconfig.json `paths`), which is marked `external` in tsup.config.ts.
82
+ //
83
+ // This file is excluded from Biome in the root biome.json so formatting/lint
84
+ // never rewrites upstream content and pollutes the diff.
85
+ // -----------------------------------------------------------------------------
86
+ // version: 977e4f914dd2b3eca85ad01dee81c2c96eb1b2e5
87
+ export interface Price {
88
+ amount: string;
89
+ currencyCode: string;
90
+ }
91
+ export interface CartDiscountCode {
92
+ applicable: boolean;
93
+ code: string;
94
+ }
95
+ export interface CartCost {
96
+ totalAmount: Price;
97
+ }
98
+ export interface CartLine {
99
+ id: string;
100
+ quantity: number;
101
+ cost: CartCost;
102
+ }
103
+ export interface CartMutationUserError {
104
+ code?: string;
105
+ field?: string[];
106
+ message: string;
107
+ }
108
+ export interface CartMutationWarning {
109
+ code?: string;
110
+ message: string;
111
+ target?: string;
112
+ }
113
+ declare const CART_UPDATE_CONTEXTS: readonly [
114
+ "product",
115
+ "cart",
116
+ "dialog",
117
+ "standard-action"
118
+ ];
119
+ export type CartUpdateContext = (typeof CART_UPDATE_CONTEXTS)[number];
120
+ declare const CART_UPDATE_ACTIONS: readonly [
121
+ "add",
122
+ "remove",
123
+ "update"
124
+ ];
125
+ export type CartUpdateAction = (typeof CART_UPDATE_ACTIONS)[number];
126
+ export type ActionArgs<P, O = void> = [
127
+ P
128
+ ] extends [
129
+ void
130
+ ] ? [
131
+ options?: O
132
+ ] : [
133
+ Extract<P, void>
134
+ ] extends [
135
+ never
136
+ ] ? [
137
+ payload: P,
138
+ options?: O
139
+ ] : [
140
+ payload?: Exclude<P, void>,
141
+ options?: O
142
+ ];
143
+ export type UpdateCartUserError = CartMutationUserError;
144
+ export type UpdateCartWarning = CartMutationWarning;
145
+ export interface CartAttributeInput {
146
+ key: string;
147
+ value: string;
148
+ }
149
+ export interface StorefrontCartLinesConnection {
150
+ nodes: CartLine[];
151
+ }
152
+ export interface StorefrontCartSummary {
153
+ id: string;
154
+ totalQuantity: number;
155
+ cost: CartCost;
156
+ lines: StorefrontCartLinesConnection;
157
+ discountCodes: CartDiscountCode[];
158
+ }
159
+ export type UpdateCartEventTargetMeta = {
160
+ type: "shopify:cart:lines-update";
161
+ action: CartUpdateAction;
162
+ } | {
163
+ type: "shopify:cart:note-update" | "shopify:cart:attributes-update" | "shopify:cart:discount-update" | "shopify:cart:error";
164
+ };
165
+ export interface CartLineInput {
166
+ /**
167
+ * Existing-line id from SFAPI or the AJAX cart API.
168
+ * CartLine GIDs keep or receive a `?cart=` suffix automatically when the cart id is known.
169
+ * Present = update/remove; absent = add.
170
+ */
171
+ id?: string;
172
+ /** ProductVariant GID or raw variant id. Required for add. */
173
+ merchandiseId?: string;
174
+ /** Set to 0 to remove. */
175
+ quantity: number;
176
+ /** Line item-level custom attributes */
177
+ attributes?: CartAttributeInput[];
178
+ /** Selling plan GID or raw selling plan id. */
179
+ sellingPlanId?: string;
180
+ }
181
+ export interface UpdateCartPayload {
182
+ /** Cart GID or raw cart token. If omitted, discovered from the cart cookie. */
183
+ cartId?: string;
184
+ lines?: CartLineInput[];
185
+ note?: string;
186
+ discountCodes?: string[];
187
+ /** Cart-level custom attributes */
188
+ attributes?: CartAttributeInput[];
189
+ }
190
+ export interface UpdateCartResult {
191
+ cart: StorefrontCartSummary;
192
+ userErrors?: UpdateCartUserError[];
193
+ warnings?: UpdateCartWarning[];
194
+ detail?: Record<string, any>;
195
+ }
196
+ export interface UpdateCartOptions {
197
+ signal?: AbortSignal;
198
+ event?: {
199
+ detail?: Record<string, any>;
200
+ context?: CartUpdateContext;
201
+ };
202
+ }
203
+ export interface GetCartPayload {
204
+ /** Cart GID or raw cart token. If omitted, discovered from the browser cookie. */
205
+ cartId?: string;
206
+ }
207
+ export interface GetCartResult {
208
+ cart: StorefrontCartSummary | null;
209
+ detail?: Record<string, any>;
210
+ }
211
+ export interface GetCartOptions {
212
+ signal?: AbortSignal;
213
+ }
214
+ /**
215
+ * The default handler, lifted into Effect-land.
216
+ *
217
+ * Handlers receive this rather than a pre-computed result so they keep the full
218
+ * range of the upstream contract: run the default, wrap it, retry it, race it,
219
+ * or skip it entirely and synthesise a result.
220
+ */
221
+ export type DefaultHandler<A> = Effect.Effect<A, ActionInvocationError>;
222
+ /**
223
+ * An action handler written in Effect.
224
+ *
225
+ * The returned Effect's success value is what the action resolves with, and its
226
+ * failure becomes a rejected promise for Shopify.
227
+ *
228
+ * Note that `E` is checked but never surfaces to the fiber that called
229
+ * `configure` — the handler runs long afterwards, when a shopper triggers the
230
+ * action, so its failure has nowhere to go but the promise Shopify awaits. If
231
+ * you want handler failures observed, observe them inside the handler.
232
+ */
233
+ export type Handler<P, A, O, E, R> = (defaultHandler: DefaultHandler<A>, ...args: ActionArgs<P, O>) => Effect.Effect<A, E, R>;
234
+ /**
235
+ * Resolves the element that `shopify:cart:*` events are dispatched from.
236
+ *
237
+ * The error channel is `never` on purpose. Shopify calls this synchronously and
238
+ * uses the return value immediately, so there is nowhere for a failure to go —
239
+ * handle errors inside the Effect and fall back to an element or `null`.
240
+ *
241
+ * For the same reason this Effect must complete synchronously. Anything that
242
+ * suspends (`Effect.sleep`, an HTTP call, an async service) cannot produce a
243
+ * value in time and is reported as `null` with a logged defect, which makes
244
+ * Shopify dispatch on `document`. If you need async work, resolve it ahead of
245
+ * time into a `Ref` and read the `Ref` here.
246
+ */
247
+ export type EventTargetResolver<R> = (meta: UpdateCartEventTargetMeta) => Effect.Effect<EventTarget | null, never, R>;
248
+ export interface UpdateCartConfiguration<E, R> {
249
+ readonly eventTarget: EventTargetResolver<R>;
250
+ /** Optional: routing events without changing cart behaviour is valid. */
251
+ readonly handler?: Handler<UpdateCartPayload, UpdateCartResult, UpdateCartOptions, E, R>;
252
+ }
253
+ export interface OpenCartConfiguration<E, R> {
254
+ /**
255
+ * Required, unlike `updateCart`'s. `openCart` has no event target, so a
256
+ * configuration without a handler would claim the one-shot upstream slot
257
+ * while contributing nothing — locking everyone else out for the life of
258
+ * the page in exchange for default behaviour.
259
+ */
260
+ readonly handler: Handler<void, void, void, E, R>;
261
+ }
262
+ export interface ShopifyStorefrontActionsImpl {
263
+ /**
264
+ * Read the current cart. `getCart` is a bare callable upstream — it has no
265
+ * `configure()`, so there is no `configureGetCart`.
266
+ */
267
+ readonly getCart: (payload?: GetCartPayload, options?: GetCartOptions) => Effect.Effect<GetCartResult, ActionsUnavailableError | ActionInvocationError>;
268
+ readonly updateCart: (payload: UpdateCartPayload, options?: UpdateCartOptions) => Effect.Effect<UpdateCartResult, ActionsUnavailableError | ActionInvocationError>;
269
+ readonly openCart: Effect.Effect<void, ActionsUnavailableError | ActionInvocationError>;
270
+ /**
271
+ * Install an Effect-based `updateCart` configuration for the lifetime of the
272
+ * enclosing `Scope`.
273
+ *
274
+ * The `R` of the supplied Effects flows out into the returned Effect's
275
+ * requirements, so the services your handler needs stay explicit and must be
276
+ * provided before this runs — they are captured, not smuggled.
277
+ *
278
+ * Calling this more than once rebinds rather than failing: we claim the
279
+ * upstream slot once and swap our own configuration behind it. A
280
+ * `ActionConfigurationRejectedError` therefore means one specific thing —
281
+ * something outside this library claimed the action first.
282
+ *
283
+ * For page-lifetime registration, build it into a layer with
284
+ * `Layer.effectDiscard(Actions.configureUpdateCart({ ... }))` so the
285
+ * registration lives exactly as long as the runtime does.
286
+ */
287
+ readonly configureUpdateCart: <E, R>(config: UpdateCartConfiguration<E, R>) => Effect.Effect<void, ActionsUnavailableError | ActionConfigurationRejectedError, R | Scope.Scope>;
288
+ readonly configureOpenCart: <E, R>(config: OpenCartConfiguration<E, R>) => Effect.Effect<void, ActionsUnavailableError | ActionConfigurationRejectedError, R | Scope.Scope>;
289
+ /**
290
+ * Upstream's own notion: `true` until the action's slot is claimed.
291
+ *
292
+ * Because the slot can never be released, this stays `false` once we have
293
+ * claimed it, even after every configuration has been deactivated.
294
+ */
295
+ readonly isDefault: (action: ConfigurableActionName) => Effect.Effect<boolean, ActionsUnavailableError>;
296
+ }
297
+ declare const ShopifyStorefrontActions_base: Context.ServiceClass<ShopifyStorefrontActions, "@brytdesigns/shopify-utils/ShopifyStorefrontActions", ShopifyStorefrontActionsImpl>;
298
+ declare class ShopifyStorefrontActions extends ShopifyStorefrontActions_base {
299
+ }
300
+ declare const layer: Layer.Layer<ShopifyStorefrontActions, never, never>;
301
+ declare const getCart: (payload?: GetCartPayload, options?: GetCartOptions) => Effect.Effect<GetCartResult, ActionsUnavailableError | ActionInvocationError, ShopifyStorefrontActions>;
302
+ declare const updateCart: (payload: UpdateCartPayload, options?: UpdateCartOptions) => Effect.Effect<UpdateCartResult, ActionsUnavailableError | ActionInvocationError, ShopifyStorefrontActions>;
303
+ declare const openCart: Effect.Effect<void, ActionsUnavailableError | ActionInvocationError, ShopifyStorefrontActions>;
304
+ declare const configureUpdateCart: <E, R>(config: UpdateCartConfiguration<E, R>) => Effect.Effect<void, ActionsUnavailableError | ActionConfigurationRejectedError, Scope.Scope | ShopifyStorefrontActions | R>;
305
+ declare const configureOpenCart: <E, R>(config: OpenCartConfiguration<E, R>) => Effect.Effect<void, ActionsUnavailableError | ActionConfigurationRejectedError, Scope.Scope | ShopifyStorefrontActions | R>;
306
+ declare const isDefault: (action: ConfigurableActionName) => Effect.Effect<boolean, ActionsUnavailableError, ShopifyStorefrontActions>;
8
307
  export type Type = Schema.Schema.Type<typeof Type>;
9
- declare const Type: Schema.Literal<[
308
+ declare const Type: Schema.Literals<readonly [
10
309
  "Cart",
11
310
  "Collection",
12
311
  "Customer",
@@ -41,20 +340,62 @@ declare const Type: Schema.Literal<[
41
340
  "StaffMember",
42
341
  "Theme"
43
342
  ]>;
44
- export type GID = Schema.Schema.Encoded<typeof GID>;
45
- declare const GID: Schema.filter<typeof Schema.String>;
46
- export type ID = Schema.Schema.Encoded<typeof ID>;
47
- declare const ID: Schema.Union<[
48
- typeof Schema.Number,
49
- typeof Schema.NumberFromString,
50
- typeof Schema.String
343
+ export type GID = Schema.Codec.Encoded<typeof GID>;
344
+ declare const GID: Schema.String;
345
+ /**
346
+ * A Shopify id: a number, a numeric string decoded to one, or any other
347
+ * string left as it is - a line item key, a handle, an empty string.
348
+ *
349
+ * The middle member was `Schema.NumberFromString`, which in Effect 4 never
350
+ * fails, so `String` was unreachable and every non-numeric id decoded to NaN.
351
+ * See `Schemas.FiniteFromNumericString`.
352
+ */
353
+ export type ID = Schema.Codec.Encoded<typeof ID>;
354
+ declare const ID: Schema.Union<readonly [
355
+ Schema.Number,
356
+ Schema.decodeTo<Schema.Finite, Schema.String, never, never>,
357
+ Schema.String
51
358
  ]>;
52
359
  export type FormatOptions<T extends ID, R extends Type> = {
53
360
  id: T;
54
361
  type: R;
55
362
  };
56
- declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
57
- declare const parse: (input: string) => Effect.Effect<string | number, ParseError, never>;
363
+ declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, Schema.SchemaError, never>;
364
+ declare const parse: (input: string) => Effect.Effect<string | number, Schema.SchemaError, never>;
365
+ /**
366
+ * Promise-based access to Shopify's storefront cart actions, for consumers that
367
+ * are not written in Effect.
368
+ *
369
+ * This is a facade over `./effect`'s `Actions`, not a reimplementation, so it
370
+ * inherits the behaviour that matters: the one-shot upstream `configure()` slot
371
+ * is claimed once and rebound thereafter, a missing runtime is distinguishable
372
+ * from a refused configuration, and a configuration can be torn down.
373
+ *
374
+ * Errors arrive as rejections carrying the same tagged error instances the
375
+ * Effect API fails with, so `instanceof ActionsUnavailableError` still works.
376
+ */
377
+ export type Dispose = () => Promise<void>;
378
+ export type UpdateCartHandler = (defaultHandler: () => Promise<UpdateCartResult>, payload: UpdateCartPayload, options?: UpdateCartOptions) => Promise<UpdateCartResult>;
379
+ export type OpenCartHandler = (defaultHandler: () => Promise<void>) => Promise<void>;
380
+ interface UpdateCartConfiguration$1 {
381
+ /**
382
+ * Chooses the element `shopify:cart:*` events dispatch from. Returning
383
+ * `null` — the default — leaves Shopify dispatching on `document`.
384
+ *
385
+ * Must be synchronous: Shopify uses the return value immediately.
386
+ */
387
+ readonly eventTarget?: (meta: UpdateCartEventTargetMeta) => EventTarget | null;
388
+ readonly handler?: UpdateCartHandler;
389
+ }
390
+ interface OpenCartConfiguration$1 {
391
+ readonly handler: OpenCartHandler;
392
+ }
393
+ declare const getCart$1: (payload?: GetCartPayload, options?: GetCartOptions) => Promise<GetCartResult>;
394
+ declare const updateCart$1: (payload: UpdateCartPayload, options?: UpdateCartOptions) => Promise<UpdateCartResult>;
395
+ declare const openCart$1: () => Promise<void>;
396
+ declare const isDefault$1: (action: ConfigurableActionName) => Promise<boolean>;
397
+ declare const configureUpdateCart$1: (config?: UpdateCartConfiguration$1) => Promise<Dispose>;
398
+ declare const configureOpenCart$1: (config: OpenCartConfiguration$1) => Promise<Dispose>;
58
399
  export declare const parseResource: (gid: Resource.GID) => string | number;
59
400
  export type FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {
60
401
  id: T;
@@ -65,11 +406,18 @@ type ID$1 = Resource.ID;
65
406
  type GID$1 = Resource.GID;
66
407
  type Type$1 = Resource.Type;
67
408
 
409
+ declare namespace Bridge {
410
+ export { fromPromiseThunk, toAsyncCallback, toSyncCallback };
411
+ }
68
412
  declare namespace Resource {
69
413
  export { GID, ID, Type, format, parse };
70
414
  }
415
+ declare namespace Actions {
416
+ export { ActionConfigurationRejectedError, ActionInvocationError, ActionName, ActionsUnavailableError, ConfigurableActionName, Dispose, GetCartOptions, GetCartPayload, GetCartResult, OpenCartConfiguration$1 as OpenCartConfiguration, OpenCartHandler, UpdateCartConfiguration$1 as UpdateCartConfiguration, UpdateCartEventTargetMeta, UpdateCartHandler, UpdateCartOptions, UpdateCartPayload, UpdateCartResult, configureOpenCart$1 as configureOpenCart, configureUpdateCart$1 as configureUpdateCart, getCart$1 as getCart, isDefault$1 as isDefault, openCart$1 as openCart, updateCart$1 as updateCart };
417
+ }
71
418
 
72
419
  export {
420
+ Actions,
73
421
  GID$1 as GID,
74
422
  ID$1 as ID,
75
423
  Type$1 as Type,
@@ -1,3 +1,3 @@
1
- export { formatResource, parseResource } from './resources/index.js';
2
- //# sourceMappingURL=index.js.map
3
- //# sourceMappingURL=index.js.map
1
+ import { actions_exports } from "./actions.js";
2
+ import { formatResource, parseResource } from "./resources/index.js";
3
+ export { actions_exports as Actions, formatResource, parseResource };
@@ -1,9 +1,10 @@
1
- import * as Effect from 'effect/Effect';
2
- import { Resource } from '../effect';
3
-
4
- const parseResource = (gid) => Effect.runSync(Resource.parse(gid));
5
- const formatResource = (options) => Effect.runSync(Resource.format(options));
6
-
1
+ import { format, parse } from "../effect/Resource/data.js";
2
+ import "../effect/index.js";
3
+ import * as Effect from "effect/Effect";
4
+ //#region src/resources/index.ts
5
+ var parseResource = (gid) => Effect.runSync(parse(gid));
6
+ var formatResource = (options) => Effect.runSync(format(options));
7
+ //#endregion
7
8
  export { formatResource, parseResource };
8
- //# sourceMappingURL=index.js.map
9
+
9
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/resources/index.ts"],"names":[],"mappings":";;;AAGa,MAAA,aAAA,GAAgB,CAAC,GAC5B,KAAA,MAAA,CAAO,QAAQ,QAAS,CAAA,KAAA,CAAM,GAAG,CAAC;AAOvB,MAAA,cAAA,GAAiB,CAI5B,OACG,KAAA,MAAA,CAAO,QAAQ,QAAS,CAAA,MAAA,CAAa,OAAO,CAAC","file":"index.js","sourcesContent":["import * as Effect from \"effect/Effect\";\nimport { Resource } from \"../effect\";\n\nexport const parseResource = (gid: Resource.GID) =>\n Effect.runSync(Resource.parse(gid));\n\ntype FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {\n id: T;\n type: R;\n};\n\nexport const formatResource = <\n const T extends Resource.ID,\n const R extends Resource.Type,\n>(\n options: FormatResourceOptions<T, R>,\n) => Effect.runSync(Resource.format<T, R>(options));\n\nexport type ID = Resource.ID;\nexport type GID = Resource.GID;\nexport type Type = Resource.Type;\n"]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/resources/index.ts"],"sourcesContent":["import * as Effect from \"effect/Effect\";\nimport { Resource } from \"../effect\";\n\nexport const parseResource = (gid: Resource.GID) =>\n\tEffect.runSync(Resource.parse(gid));\n\ntype FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {\n\tid: T;\n\ttype: R;\n};\n\nexport const formatResource = <\n\tconst T extends Resource.ID,\n\tconst R extends Resource.Type,\n>(\n\toptions: FormatResourceOptions<T, R>,\n) => Effect.runSync(Resource.format<T, R>(options));\n\nexport type ID = Resource.ID;\nexport type GID = Resource.GID;\nexport type Type = Resource.Type;\n"],"mappings":";;;;AAGA,IAAa,iBAAiB,QAC7B,OAAO,QAAQ,MAAe,GAAG,CAAC;AAOnC,IAAa,kBAIZ,YACI,OAAO,QAAQ,OAAsB,OAAO,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brytdesigns/shopify-utils",
3
- "version": "1.2.22",
3
+ "version": "3.1.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./dist/main/index.js",
@@ -8,11 +8,11 @@
8
8
  "exports": {
9
9
  ".": {
10
10
  "types": "./dist/main/index.d.ts",
11
- "import": "./dist/main/index.js"
11
+ "default": "./dist/main/index.js"
12
12
  },
13
13
  "./effect": {
14
14
  "types": "./dist/effect/index.d.ts",
15
- "import": "./dist/effect/index.js"
15
+ "default": "./dist/effect/index.js"
16
16
  }
17
17
  },
18
18
  "files": [
@@ -22,16 +22,16 @@
22
22
  "author": "",
23
23
  "license": "ISC",
24
24
  "dependencies": {
25
- "effect": "3.19.14"
25
+ "effect": "4.0.3"
26
26
  },
27
27
  "devDependencies": {
28
- "dts-bundle-generator": "^9.5.1",
29
- "tsup": "^8.4.0",
30
- "@repo/js-delivr-imports-plugin": "1.1.5"
28
+ "@repo/vite-config": "0.0.0",
29
+ "vite": "^8.2.2"
31
30
  },
32
31
  "scripts": {
33
- "build": "tsup --clean",
32
+ "build": "vite build && vite build --mode effect",
34
33
  "typecheck": "tsc --noEmit --emitDeclarationOnly false",
35
- "clean": "git clean -xdf .cache .turbo dist node_modules"
34
+ "clean": "git clean -xdf .cache .turbo dist node_modules",
35
+ "test": "vitest run"
36
36
  }
37
37
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -1,3 +0,0 @@
1
-
2
- //# sourceMappingURL=types.js.map
3
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
package/dist/index.d.ts DELETED
@@ -1,77 +0,0 @@
1
- // Generated by dts-bundle-generator v9.5.1
2
-
3
- import * as Effect from 'effect/Effect';
4
- import * as LogLevel from 'effect/LogLevel';
5
- import { ParseError } from 'effect/ParseResult';
6
- import * as Schema from 'effect/Schema';
7
-
8
- export type Type = Schema.Schema.Type<typeof Type>;
9
- declare const Type: Schema.Literal<[
10
- "Cart",
11
- "Collection",
12
- "Customer",
13
- "DeliveryCarrierService",
14
- "DeliveryLocationGroup",
15
- "DeliveryProfile",
16
- "DeliveryZone",
17
- "DraftOrder",
18
- "DraftOrderLineItem",
19
- "Duty",
20
- "EmailTemplate",
21
- "Fulfillment",
22
- "FulfullmentEvent",
23
- "FullfullmentService",
24
- "InventoryItem",
25
- "InventoryLevel",
26
- "LineItem",
27
- "Location",
28
- "MarketingEvent",
29
- "MediaImage",
30
- "Metafield",
31
- "OnlineStoreArticle",
32
- "OnlineStoreBlog",
33
- "OnlineStorePage",
34
- "Order",
35
- "OrderTransaction",
36
- "Product",
37
- "ProductImage",
38
- "ProductVariant",
39
- "Refund",
40
- "Shop",
41
- "StaffMember",
42
- "Theme"
43
- ]>;
44
- export type GID = Schema.Schema.Encoded<typeof GID>;
45
- declare const GID: Schema.filter<typeof Schema.String>;
46
- export type ID = Schema.Schema.Encoded<typeof ID>;
47
- declare const ID: Schema.Union<[
48
- typeof Schema.Number,
49
- typeof Schema.NumberFromString
50
- ]>;
51
- export type FormatOptions<T extends ID, R extends Type> = {
52
- id: T;
53
- type: R;
54
- };
55
- declare const format: <const T extends ID, const R extends Type>({ id, type, }: FormatOptions<T, R>) => Effect.Effect<`gid://shopify/${R}/${T}`, ParseError, never>;
56
- declare const parse: (i: string, overrideOptions?: import("effect/SchemaAST").ParseOptions) => Effect.Effect<string, ParseError, never>;
57
- export declare const parseResource: (gid: Resource.GID) => string;
58
- export type FormatResourceOptions<T extends Resource.ID, R extends Resource.Type> = {
59
- id: T;
60
- type: R;
61
- };
62
- export declare const formatResource: <const T extends Resource.ID, const R extends Resource.Type>(options: FormatResourceOptions<T, R>) => `gid://shopify/${R}/${T}`;
63
- type ID$1 = Resource.ID;
64
- type GID$1 = Resource.GID;
65
- type Type$1 = Resource.Type;
66
-
67
- declare namespace Resource {
68
- export { GID, ID, Type, format, parse };
69
- }
70
-
71
- export {
72
- GID$1 as GID,
73
- ID$1 as ID,
74
- Type$1 as Type,
75
- };
76
-
77
- export {};
@@ -1,4 +0,0 @@
1
- import * as schema_js from '/npm/@brytdesigns/shopify-utils@1.2.10/dist/jsdelivr/effect/Ajax/Sections/schema.js';
2
- export { schema_js as Sections };
3
- //# sourceMappingURL=index.js.map
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
@@ -1,20 +0,0 @@
1
- import * as Schema from '/npm/effect@3.14.1/Schema/+esm';
2
-
3
- const Input = Schema.Struct({
4
- sections: Schema.optional(Schema.String),
5
- sections_url: Schema.optional(Schema.String)
6
- });
7
- const parseKeys = (keys) => Array.from(
8
- new Set(keys.split(",").map((key) => key.trim()))
9
- );
10
- function makeResponseSchema(input) {
11
- const keys = parseKeys(input);
12
- return Schema.Record({
13
- key: Schema.Literal(...keys),
14
- value: Schema.NullOr(Schema.String)
15
- });
16
- }
17
-
18
- export { Input, makeResponseSchema };
19
- //# sourceMappingURL=schema.js.map
20
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../src/effect/Ajax/Sections/schema.ts"],"names":[],"mappings":";;AAGa,MAAA,KAAA,GAAQ,OAAO,MAAO,CAAA;AAAA,EACjC,QAAU,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM,CAAA;AAAA,EACvC,YAAc,EAAA,MAAA,CAAO,QAAS,CAAA,MAAA,CAAO,MAAM;AAC7C,CAAC;AAOD,MAAM,SAAA,GAAY,CAAyB,IAAA,KACzC,KAAM,CAAA,IAAA;AAAA,EACJ,IAAI,GAAA,CAAI,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA,CAAE,GAAI,CAAA,CAAC,GAAQ,KAAA,GAAA,CAAI,IAAK,EAAC,CAAC;AAClD,CAAA;AAEK,SAAS,mBAA2C,KAAU,EAAA;AACnE,EAAM,MAAA,IAAA,GAAO,UAAU,KAAK,CAAA;AAC5B,EAAA,OAAO,OAAO,MAAO,CAAA;AAAA,IACnB,GAAK,EAAA,MAAA,CAAO,OAAQ,CAAA,GAAG,IAAI,CAAA;AAAA,IAC3B,KAAO,EAAA,MAAA,CAAO,MAAO,CAAA,MAAA,CAAO,MAAM;AAAA,GACnC,CAAA;AACH","file":"schema.js","sourcesContent":["import * as Schema from \"/npm/effect@3.14.1/Schema/+esm\";\n\nexport type Input = typeof Input;\nexport const Input = Schema.Struct({\n sections: Schema.optional(Schema.String),\n sections_url: Schema.optional(Schema.String),\n});\n\n// Helper type to convert a string to a tuple of unique literals\ntype UniqueKeys<T extends string> = T extends `${infer K},${infer Rest}`\n ? K | UniqueKeys<Rest>\n : T;\n\nconst parseKeys = <const T extends string>(keys: T) =>\n Array.from(\n new Set(keys.split(\",\").map((key) => key.trim())),\n ) as UniqueKeys<T>[];\n\nexport function makeResponseSchema<const T extends string>(input: T) {\n const keys = parseKeys(input);\n return Schema.Record({\n key: Schema.Literal(...keys),\n value: Schema.NullOr(Schema.String),\n });\n}\n"]}
@@ -1,38 +0,0 @@
1
- import * as Data from '/npm/effect@3.14.1/Data/+esm';
2
-
3
- const Defaults = {
4
- account_addresses_url: "/account/addresses",
5
- account_login_url: "/account/login",
6
- account_logout_url: "/account/logout",
7
- account_recover_url: "/account/recover",
8
- account_register_url: "/account/register",
9
- account_url: "/account",
10
- all_products_collection_url: "/collections/all",
11
- cart_add_url: "/cart/add.js",
12
- cart_change_url: "/cart/change.js",
13
- cart_clear_url: "/cart/clear.js",
14
- cart_update_url: "/cart/update.js",
15
- cart_url: "/cart.js",
16
- collections_url: "/collections",
17
- predictive_search_url: "/search/suggest",
18
- product_recommendations_url: "/recommendations/products",
19
- root_url: "/",
20
- search_url: "/search",
21
- storefront_login_url: "/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en"
22
- };
23
- class ShopifyRoutes extends Data.Class {
24
- constructor() {
25
- super({
26
- ...Defaults,
27
- ...window?.BrytDesigns?.routes || {}
28
- });
29
- }
30
- }
31
- const make = () => Data.case()({
32
- ...Defaults,
33
- ...window?.BrytDesigns?.routes || {}
34
- });
35
-
36
- export { Defaults, ShopifyRoutes, make };
37
- //# sourceMappingURL=ShopifyRoutes.js.map
38
- //# sourceMappingURL=ShopifyRoutes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../../src/effect/Ajax/Window/data/ShopifyRoutes.ts"],"names":[],"mappings":";;AAIO,MAAM,QAA2B,GAAA;AAAA,EACtC,qBAAuB,EAAA,oBAAA;AAAA,EACvB,iBAAmB,EAAA,gBAAA;AAAA,EACnB,kBAAoB,EAAA,iBAAA;AAAA,EACpB,mBAAqB,EAAA,kBAAA;AAAA,EACrB,oBAAsB,EAAA,mBAAA;AAAA,EACtB,WAAa,EAAA,UAAA;AAAA,EACb,2BAA6B,EAAA,kBAAA;AAAA,EAC7B,YAAc,EAAA,cAAA;AAAA,EACd,eAAiB,EAAA,iBAAA;AAAA,EACjB,cAAgB,EAAA,gBAAA;AAAA,EAChB,eAAiB,EAAA,iBAAA;AAAA,EACjB,QAAU,EAAA,UAAA;AAAA,EACV,eAAiB,EAAA,cAAA;AAAA,EACjB,qBAAuB,EAAA,iBAAA;AAAA,EACvB,2BAA6B,EAAA,2BAAA;AAAA,EAC7B,QAAU,EAAA,GAAA;AAAA,EACV,UAAY,EAAA,SAAA;AAAA,EACZ,oBACE,EAAA;AACJ;AAEO,MAAM,aAAA,SAAsB,KAAK,KAAsB,CAAA;AAAA,EAC5D,WAAc,GAAA;AACZ,IAAM,KAAA,CAAA;AAAA,MACJ,GAAG,QAAA;AAAA,MACH,GAAI,MAAA,EAAQ,WAAa,EAAA,MAAA,IAAU;AAAC,KACrC,CAAA;AAAA;AAEL;AAEO,MAAM,IAAO,GAAA,MAClB,IAAK,CAAA,IAAA,EAAsB,CAAA;AAAA,EACzB,GAAG,QAAA;AAAA,EACH,GAAI,MAAA,EAAQ,WAAa,EAAA,MAAA,IAAU;AACrC,CAAC","file":"ShopifyRoutes.js","sourcesContent":["import type { IShopifyRoutes } from \"/npm/@brytdesigns/shopify-utils@1.2.10/dist/jsdelivr/effect/Ajax/Window/data/types.js\";\n\nimport * as Data from \"/npm/effect@3.14.1/Data/+esm\";\n\nexport const Defaults: IShopifyRoutes = {\n account_addresses_url: \"/account/addresses\",\n account_login_url: \"/account/login\",\n account_logout_url: \"/account/logout\",\n account_recover_url: \"/account/recover\",\n account_register_url: \"/account/register\",\n account_url: \"/account\",\n all_products_collection_url: \"/collections/all\",\n cart_add_url: \"/cart/add.js\",\n cart_change_url: \"/cart/change.js\",\n cart_clear_url: \"/cart/clear.js\",\n cart_update_url: \"/cart/update.js\",\n cart_url: \"/cart.js\",\n collections_url: \"/collections\",\n predictive_search_url: \"/search/suggest\",\n product_recommendations_url: \"/recommendations/products\",\n root_url: \"/\",\n search_url: \"/search\",\n storefront_login_url:\n \"/customer_authentication/login?return_to=%2Fservices%2Fliquid_rendering%2Fresource%3Ffast_storefront_renderer%3D1&locale=en\",\n};\n\nexport class ShopifyRoutes extends Data.Class<IShopifyRoutes> {\n constructor() {\n super({\n ...Defaults,\n ...(window?.BrytDesigns?.routes || {}),\n });\n }\n}\n\nexport const make = () =>\n Data.case<ShopifyRoutes>()({\n ...Defaults,\n ...(window?.BrytDesigns?.routes || {}),\n });\n"]}