@doswiftly/storefront-sdk 4.5.0 → 4.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,149 @@
1
+ # Changelog
2
+
3
+ ## 4.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 7846bdb: Fix `doswiftly dev` port pre-flight on Windows (and any host where another
8
+ process binds the port on IPv6 `::` only): the probe now checks IPv4 and
9
+ IPv6 in parallel and requires BOTH free before marking a port as available.
10
+ Previously an IPv6-only conflict (common on Windows, where Next.js binds
11
+ `::` by default) slipped past the IPv4-only probe — the banner advertised
12
+ `http://localhost:3000` and the framework immediately crashed with
13
+ `EADDRINUSE :::3000`. With this fix `doswiftly dev` falls back to the next
14
+ free port (3001, 3002, …) as documented.
15
+
16
+ Also ship `CHANGELOG.md` inside the npm tarball. Previous releases packed
17
+ only `dist`/`bin`/`templates` (and `schema.graphql`/operations for
18
+ `storefront-operations`, `dist` for `storefront-sdk`), so consumers who
19
+ `npm install @doswiftly/cli` got a version number with no user-visible
20
+ release notes.
21
+
22
+ Wszystkie istotne zmiany w `@doswiftly/storefront-sdk` sa dokumentowane w tym pliku.
23
+ Format oparty na [Keep a Changelog](https://keepachangelog.com/pl/1.1.0/).
24
+ Wersjonowanie zgodne z [Semantic Versioning](https://semver.org/).
25
+
26
+ ## [4.7.1] - 2026-04-17
27
+
28
+ ### Security
29
+
30
+ - Bump `next` devDependency range to `^16.2.3` (GHSA-q4gf-8mx6-v5v3 — Next.js DoS via Server Components). Brak zmian API SDK.
31
+
32
+ ## [4.7.0] - 2026-04-14
33
+
34
+ ### Added
35
+
36
+ - **`CartAttributeSelectionInput`** — nowy typ mirrorujący GraphQL `AttributeSelectionInput` dla konfiguratorów produktu (Faza 1 Unified Product Configurator).
37
+ - **`CartLineInput.attributeSelections`** — opcjonalne customer-filled atrybuty (Finiszer, nr telefonu serwisu itp.). Backend waliduje i snapshotuje pole `surcharge_amount` / `tax_rate`.
38
+ - **`CartLineUpdateInput.attributeSelections`** — update selekcji po stronie koszyka (`null` = preserve, `[]` = clear, tablica = replace).
39
+
40
+ ### Changed
41
+
42
+ - Mutacje `cartLinesAdd` / `cartLinesUpdate` przekazują teraz `attributeSelections` przez GraphQL variables (bez zmian w treści mutacji — typ po stronie schematu backendu).
43
+
44
+ ## [4.6.0] - 2026-04-11
45
+
46
+ ### Breaking Changes
47
+
48
+ - **Image fragment**: `url` field now includes `transform: { maxWidth: 300 }` argument — cart images return CDN-resized thumbnails instead of full-size originals
49
+ - **ImageData interface**: added `thumbhash?: string | null` field
50
+ - **CartLineMerchandise.image**: added `thumbhash` field to image shape
51
+
52
+ ### Added
53
+
54
+ - **Image transforms in cart operations**: CDN serves correctly-sized thumbnails (300px) instead of full originals. Reduces bandwidth ~10x for cart page.
55
+ - **ThumbHash support**: `Image` fragment now requests `thumbhash` field — base64-encoded perceptual placeholder (~40 chars). Decode with `thumbHashToDataURL()` for instant blur previews.
56
+ - **`thumbHashToDataURL(base64Hash)`**: New export from core — decodes ThumbHash to `data:image/bmp;base64,...` URL for Next.js `blurDataURL` prop. Pure math, zero deps, framework-agnostic.
57
+ - **AVIF auto-negotiation**: No `preferredContentType` hardcoded — imgproxy auto-serves AVIF/WEBP based on browser `Accept` header.
58
+
59
+ ## [4.5.0] - 2026-04-11
60
+
61
+ ### Breaking Changes
62
+
63
+ - **CartClient types**: `CartCost` and `CartLineCost` price fields changed from `Money` to `PriceMoney` (adds `baseAmount`, `baseCurrencyCode`, `exchangeRate`, `marginApplied`, `rateTimestamp`, `isConverted`)
64
+ - **Cart.lines**: changed from `{ edges: Array<{ node: CartLine }> }` to `CartLine[]` (flat array — matches backend schema)
65
+ - **CartDiscountAllocation**: field `discountedAmount` renamed to `amount`, added `discountCode` field
66
+
67
+ ### Fixed
68
+
69
+ - CartClient GraphQL operations now match SSOT (backend `storefront-graphql/operations/`)
70
+ - Cart fragment no longer uses `edges`/`nodes` connection pattern for `lines` — backend returns flat array
71
+ - `CartDiscountAllocation` uses correct field name `amount` (was `discountedAmount`) and includes `discountCode`
72
+ - `CartCost` and `CartLineCost` use `PriceMoney` fragment (was `Money`) — enables currency conversion transparency
73
+ - `CartLineCost` includes `subtotalAmount` field (was missing)
74
+ - `CartLine` includes `productType` field (was missing)
75
+ - `CartLineMerchandise` now uses full `ProductVariant` fragment (was inline subset) — includes `originalPrice`, `originalCompareAtPrice`, `available`, `quantityAvailable`, `selectedOptions`, `barcode`, `weight`, `position`
76
+
77
+ ### Added
78
+
79
+ - `PriceMoney` interface in cart types — full currency conversion metadata
80
+ - `SelectedOption` interface in cart types
81
+ - `scripts/validate-cart-operations.cjs` — validates SDK cart fragments match SSOT
82
+ - `pnpm validate:cart` script — runs validation in strict mode
83
+ - Contract test `cart-operations-drift.test.ts` — 40 tests verifying fragment fields, spreads, and structural invariants
84
+
85
+ ## [4.4.0] - 2026-03-29
86
+
87
+ ### Removed
88
+
89
+ - **Image loader usuniety**: `storefrontImageLoader`, `createImageLoader`, `ImageLoaderParams`, `ImageFormat`, `PRESET_WIDTHS` — GraphQL API zwraca gotowe CDN URL-e z `url(transform: { maxWidth: 800 })`. Client-side loader zbedny.
90
+ - Zachowany: `ImageData` type (uzywany przez template do typowania danych z GraphQL)
91
+
92
+ ## [4.3.0] - 2026-03-29
93
+
94
+ ### Changed
95
+
96
+ - **Image loader**: imgproxy path-based URLs zamiast query params
97
+ - `createImageLoader()` przyjmuje konfigurowalny `format` (webp/avif/jpeg/auto)
98
+ - `storefrontImageLoader` uzywa nowego path-based schematu
99
+
100
+ ## [4.2.0] - 2026-03-28
101
+
102
+ ### Added
103
+
104
+ - `storefrontImageLoader` jako globalny image loader dla Next.js (`next.config.ts loaderFile`)
105
+ - Kwantyzacja szerokosc do presetow [150, 320, 640, 750, 828, 1080, 1200, 1600, 1920, 2048]
106
+
107
+ ## [4.1.0] - 2026-03-27
108
+
109
+ ### Added
110
+
111
+ - `createImageLoader()` — factory do custom image loaderow z konfiguracja baseUrl/format
112
+ - Usunieto HMAC signing (Shopify pattern — imgproxy nie wymaga podpisu w path-based mode)
113
+
114
+ ## [4.0.0] - 2026-03-20
115
+
116
+ ### Breaking Changes
117
+
118
+ - **Layered architecture**: split na `core/` (framework-agnostic) + `react/` (adapter)
119
+ - Nowe export paths: `.`, `./react`, `./react/server`, `./cache`
120
+ - ESM-only (usuniete CJS)
121
+ - Usuniety re-export `@tanstack/react-query` — hooki React Query generowane lokalnie w template
122
+ - Store pattern zmieniony na Context-based (zustand/vanilla + React Context)
123
+ - Usuniety module-level singleton pattern
124
+
125
+ ### Added
126
+
127
+ - `createStorefrontClient()` — transport factory z composable middleware pipeline
128
+ - Middleware: `authMiddleware`, `currencyMiddleware`, `languageMiddleware`, `botProtectionMiddleware`, `retryMiddleware`, `timeoutMiddleware`, `errorMiddleware`
129
+ - `CartClient`, `AuthClient` — plain async clients (0 deps, framework-agnostic)
130
+ - `StorefrontError` — zunifikowana klasa bledow z ErrorCodes
131
+ - `StorefrontProvider` — root kompozycji (tworzy store instances via useRef)
132
+ - `createStoreContext()` — generyczny helper Context+Zustand
133
+ - `createCartStore()` z DI pattern (`getActions` getter)
134
+ - `useAuth()`, `useCartManager()`, `useCurrency()`, `useStorefrontClient()`
135
+ - `useHydrated()`, `useAuthHydrated()`, `useDebouncedValue()`
136
+ - `createSetTokenHandler()`, `createClearTokenHandler()` — Web API fabryki
137
+ - `createAuthTokenClient()` — client-side fetch helpers
138
+ - `matchesRoute()` — route protection utility
139
+ - `formatPrice`, `formatPriceRange`, `formatAmount`, `formatDate`, `formatDateTime`, `formatNumber`, `formatPercentage`, `getCurrencySymbol`
140
+ - `sanitizeHtml`, `normalizeConnection`, `assertNoUserErrors`
141
+ - Cache strategies: `cacheNone`, `cacheShort`, `cacheLong`, `cachePrivate`, `cacheCustom`
142
+ - Bot protection: `createBotProtectionManager`, `FallbackBotProtectionManager`, `TurnstileManager`, `EuCaptchaManager`
143
+ - Cookie configs: `AUTH_COOKIE_NAME`, `CURRENCY_COOKIE_NAME`, `LANGUAGE_COOKIE_NAME`, `CART_COOKIE_NAME`
144
+ - `getStorefrontClient()` — server-side factory (react/server)
145
+
146
+ ### Removed
147
+
148
+ - Runtime deps: `graphql-request`, `graphql`, `graphql-tag`, `@graphql-typed-document-node/core`, `@tanstack/react-query`
149
+ - Module-level store singletons (zastapione Context pattern)
@@ -58,6 +58,7 @@ export interface CartLineMerchandise {
58
58
  altText: string | null;
59
59
  width: number | null;
60
60
  height: number | null;
61
+ thumbhash: string | null;
61
62
  } | null;
62
63
  selectedOptions: SelectedOption[];
63
64
  barcode: string | null;
@@ -108,13 +109,32 @@ export interface Cart {
108
109
  value: string | null;
109
110
  }>;
110
111
  }
112
+ /**
113
+ * Customer-filled attribute selection submitted with a cart line.
114
+ *
115
+ * Mirror of the GraphQL `AttributeSelectionInput` — one entry per configurator
116
+ * field the shopper filled. Backend validates (required / pattern / option ownership),
117
+ * snapshots name/surcharge/taxRate, and stores them on `cart_items.attribute_selections`.
118
+ *
119
+ * Faza 1: SELECT/RADIO/CHECKBOX use `optionId`; TEXT/TEXTAREA/NUMBER/DATE use `textValue`.
120
+ * Faza 2 will enable `optionIds` for MULTI_SELECT.
121
+ */
122
+ export interface CartAttributeSelectionInput {
123
+ attributeDefinitionId: string;
124
+ optionId?: string | null;
125
+ optionIds?: string[] | null;
126
+ textValue?: string | null;
127
+ }
111
128
  export interface CartLineInput {
112
129
  merchandiseId: string;
113
130
  quantity?: number;
131
+ /** Shopify-style raw Line Item Properties (gift messages, engraving notes, etc.). */
114
132
  attributes?: Array<{
115
133
  key: string;
116
134
  value: string;
117
135
  }>;
136
+ /** Faza 1 — typed customer configurator selections (Finiszer, service phone, etc.). */
137
+ attributeSelections?: CartAttributeSelectionInput[];
118
138
  }
119
139
  export interface CartLineUpdateInput {
120
140
  id: string;
@@ -123,6 +143,8 @@ export interface CartLineUpdateInput {
123
143
  key: string;
124
144
  value: string;
125
145
  }>;
146
+ /** Faza 1 — pass `null` to preserve, `[]` to clear, or array to replace selections. */
147
+ attributeSelections?: CartAttributeSelectionInput[] | null;
126
148
  }
127
149
  export interface CartCreateInput {
128
150
  lines?: CartLineInput[];
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/cart/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,MAAM,WAAW,KAAK;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;CACtB;AAMD,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,cAAc,EAAE,UAAU,CAAC;IAC3B,cAAc,EAAE,UAAU,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,UAAU,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,iBAAiB,EAAE,UAAU,CAAC;IAC9B,cAAc,EAAE,UAAU,CAAC;IAC3B,WAAW,EAAE,UAAU,CAAC;IACxB,0BAA0B,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/C;AAMD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,UAAU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AAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qFAAqF;IACrF,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,2BAA2B,EAAE,CAAC;CACrD;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,uFAAuF;IACvF,mBAAmB,CAAC,EAAE,2BAA2B,EAAE,GAAG,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -1,14 +1,17 @@
1
1
  /**
2
- * Image types for DoSwiftly storefronts.
2
+ * Image types and utilities for DoSwiftly storefronts.
3
3
  *
4
4
  * GraphQL API returns ready-to-use CDN URLs with transform query params.
5
5
  * No client-side loader needed — use `url(transform: { maxWidth: 800 })` in queries.
6
+ *
7
+ * imgproxy auto-negotiates AVIF/WEBP from browser Accept header (IMGPROXY_AUTO_AVIF=true).
8
+ * Do NOT hardcode preferredContentType — let CDN serve the best format.
6
9
  */
7
10
  /**
8
11
  * Image data from GraphQL API (matches Image type in storefront schema).
9
12
  */
10
13
  export interface ImageData {
11
- /** Image URL from GraphQL (ready-to-use CDN URL, optionally with transform query params) */
14
+ /** Image URL from GraphQL (ready-to-use CDN URL with transform query params) */
12
15
  url: string;
13
16
  /** Alt text for accessibility + SEO */
14
17
  altText?: string | null;
@@ -18,5 +21,24 @@ export interface ImageData {
18
21
  height?: number | null;
19
22
  /** Image ID */
20
23
  id?: string | null;
24
+ /** ThumbHash placeholder (base64-encoded ~40 chars). Decode with thumbHashToDataURL() for blur preview. */
25
+ thumbhash?: string | null;
21
26
  }
27
+ /**
28
+ * Decode a base64-encoded ThumbHash to a data URL for use as a blur placeholder.
29
+ *
30
+ * Typical usage with Next.js Image:
31
+ * ```tsx
32
+ * <Image
33
+ * src={image.url}
34
+ * alt={image.altText}
35
+ * placeholder={blurUrl ? "blur" : undefined}
36
+ * blurDataURL={blurUrl}
37
+ * />
38
+ * ```
39
+ *
40
+ * @param base64Hash - Base64-encoded ThumbHash string from GraphQL `Image.thumbhash`
41
+ * @returns `data:image/bmp;base64,...` URL, or `undefined` if input is falsy
42
+ */
43
+ export declare function thumbHashToDataURL(base64Hash: string | null | undefined): string | undefined;
22
44
  //# sourceMappingURL=image.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/core/image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,4FAA4F;IAC5F,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB"}
1
+ {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../src/core/image.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,sCAAsC;IACtC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,eAAe;IACf,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,2GAA2G;IAC3G,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAOD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAiD5F"}
@@ -1,7 +1,150 @@
1
1
  /**
2
- * Image types for DoSwiftly storefronts.
2
+ * Image types and utilities for DoSwiftly storefronts.
3
3
  *
4
4
  * GraphQL API returns ready-to-use CDN URLs with transform query params.
5
5
  * No client-side loader needed — use `url(transform: { maxWidth: 800 })` in queries.
6
+ *
7
+ * imgproxy auto-negotiates AVIF/WEBP from browser Accept header (IMGPROXY_AUTO_AVIF=true).
8
+ * Do NOT hardcode preferredContentType — let CDN serve the best format.
9
+ */
10
+ // ---------------------------------------------------------------------------
11
+ // ThumbHash decoder (client-side) — algorithm by Evan Wallace
12
+ // Pure math, zero dependencies, framework-agnostic.
13
+ // ---------------------------------------------------------------------------
14
+ /**
15
+ * Decode a base64-encoded ThumbHash to a data URL for use as a blur placeholder.
16
+ *
17
+ * Typical usage with Next.js Image:
18
+ * ```tsx
19
+ * <Image
20
+ * src={image.url}
21
+ * alt={image.altText}
22
+ * placeholder={blurUrl ? "blur" : undefined}
23
+ * blurDataURL={blurUrl}
24
+ * />
25
+ * ```
26
+ *
27
+ * @param base64Hash - Base64-encoded ThumbHash string from GraphQL `Image.thumbhash`
28
+ * @returns `data:image/bmp;base64,...` URL, or `undefined` if input is falsy
6
29
  */
7
- export {};
30
+ export function thumbHashToDataURL(base64Hash) {
31
+ if (!base64Hash)
32
+ return undefined;
33
+ try {
34
+ const hash = Uint8Array.from(atob(base64Hash), (c) => c.charCodeAt(0));
35
+ const { w, h, rgba } = decodeThumbHash(hash);
36
+ // Encode as BMP (simpler than PNG, works in data URLs, supports alpha)
37
+ const headerSize = 122;
38
+ const rowPad = (4 - ((w * 4) % 4)) % 4;
39
+ const bmpSize = headerSize + (w * 4 + rowPad) * h;
40
+ const bmp = new Uint8Array(bmpSize);
41
+ const view = new DataView(bmp.buffer);
42
+ // BMP file header
43
+ bmp[0] = 0x42;
44
+ bmp[1] = 0x4d; // 'BM'
45
+ view.setUint32(2, bmpSize, true);
46
+ view.setUint32(10, headerSize, true);
47
+ // DIB header (BITMAPV4HEADER)
48
+ view.setUint32(14, 108, true);
49
+ view.setInt32(18, w, true);
50
+ view.setInt32(22, -h, true); // top-down
51
+ view.setUint16(26, 1, true); // planes
52
+ view.setUint16(28, 32, true); // bpp
53
+ view.setUint32(30, 3, true); // BI_BITFIELDS
54
+ view.setUint32(54, 0x00ff0000, true); // red mask
55
+ view.setUint32(58, 0x0000ff00, true); // green mask
56
+ view.setUint32(62, 0x000000ff, true); // blue mask
57
+ view.setUint32(66, 0xff000000, true); // alpha mask
58
+ // Pixel data (BGRA)
59
+ let offset = headerSize;
60
+ for (let y = 0; y < h; y++) {
61
+ for (let x = 0; x < w; x++) {
62
+ const i = (y * w + x) * 4;
63
+ bmp[offset++] = rgba[i + 2]; // B
64
+ bmp[offset++] = rgba[i + 1]; // G
65
+ bmp[offset++] = rgba[i]; // R
66
+ bmp[offset++] = rgba[i + 3]; // A
67
+ }
68
+ offset += rowPad;
69
+ }
70
+ return `data:image/bmp;base64,${btoa(String.fromCharCode(...bmp))}`;
71
+ }
72
+ catch {
73
+ return undefined;
74
+ }
75
+ }
76
+ /** Decode ThumbHash bytes to RGBA pixels. */
77
+ function decodeThumbHash(hash) {
78
+ const { PI, min, max, cos, round } = Math;
79
+ const h24 = hash[0] | (hash[1] << 8) | (hash[2] << 16);
80
+ const h16 = hash[3] | (hash[4] << 8);
81
+ const lDC = (h24 & 63) / 63;
82
+ const pDC = ((h24 >> 6) & 63) / 31.5 - 1;
83
+ const qDC = ((h24 >> 12) & 63) / 31.5 - 1;
84
+ const lScale = ((h24 >> 18) & 31) / 31;
85
+ const hasAlpha = (h24 >> 23) !== 0;
86
+ const pScale = ((h16 >> 3) & 63) / 63;
87
+ const qScale = ((h16 >> 9) & 63) / 63;
88
+ const isLandscape = (h16 >> 15) !== 0;
89
+ const lx = max(3, isLandscape ? (hasAlpha ? 5 : 7) : h16 & 7);
90
+ const ly = max(3, isLandscape ? (h16 & 7) : hasAlpha ? 5 : 7);
91
+ let aDC = 1;
92
+ let aScale = 1;
93
+ if (hasAlpha) {
94
+ aDC = (hash[5] & 15) / 15;
95
+ aScale = (hash[5] >> 4) / 15;
96
+ }
97
+ // Extract AC coefficients from nibbles
98
+ const readAC = (start, count) => {
99
+ const result = [];
100
+ for (let i = 0; i < count; i++) {
101
+ const idx = start + i;
102
+ const data = hash[idx >> 1];
103
+ result.push(((idx & 1) !== 0 ? data >> 4 : data & 15) / 7.5 - 1);
104
+ }
105
+ return result;
106
+ };
107
+ const acStart = hasAlpha ? 12 : 10;
108
+ const lCount = lx * ly - 1;
109
+ const pCount = 8; // 3*3 - 1
110
+ const qCount = 8;
111
+ const aCount = hasAlpha ? 24 : 0; // 5*5 - 1
112
+ const lAC = readAC(acStart, lCount);
113
+ const pAC = readAC(acStart + lCount, pCount);
114
+ const qAC = readAC(acStart + lCount + pCount, qCount);
115
+ const aAC = hasAlpha ? readAC(acStart + lCount + pCount + qCount, aCount) : [];
116
+ const ratio = (isLandscape ? ly : lx) / (isLandscape ? lx : ly);
117
+ const w = round(ratio > 1 ? 32 : 32 * ratio);
118
+ const h = round(ratio > 1 ? 32 / ratio : 32);
119
+ const rgba = new Uint8Array(w * h * 4);
120
+ const decode = (dc, ac, scale, nx, ny, x, y) => {
121
+ let v = dc;
122
+ let n = 0;
123
+ for (let cy = 0; cy < ny; cy++) {
124
+ for (let cx = 0; cx * ny < nx * (ny - cy); cx++) {
125
+ if (cx > 0 || cy > 0) {
126
+ v += ac[n] * scale * cos((PI / w) * x * (cx + 0.5)) * cos((PI / h) * y * (cy + 0.5));
127
+ n++;
128
+ }
129
+ }
130
+ }
131
+ return v;
132
+ };
133
+ for (let y = 0; y < h; y++) {
134
+ for (let x = 0; x < w; x++) {
135
+ const l = decode(lDC, lAC, lScale, lx, ly, x, y);
136
+ const p = decode(pDC, pAC, pScale, 3, 3, x, y);
137
+ const q = decode(qDC, qAC, qScale, 3, 3, x, y);
138
+ const a = hasAlpha ? decode(aDC, aAC, aScale, 5, 5, x, y) : 1;
139
+ const b = l - (2 / 3) * p;
140
+ const r = (3 * l - b + q) / 2;
141
+ const g = r - q;
142
+ const i = (y * w + x) * 4;
143
+ rgba[i] = max(0, 255 * min(1, r));
144
+ rgba[i + 1] = max(0, 255 * min(1, g));
145
+ rgba[i + 2] = max(0, 255 * min(1, b));
146
+ rgba[i + 3] = max(0, 255 * min(1, a));
147
+ }
148
+ }
149
+ return { w, h, rgba };
150
+ }
@@ -61,7 +61,7 @@ export { CART_COOKIE_NAME, CART_COOKIE_MAX_AGE } from './cart/cookie-config';
61
61
  export { matchesRoute, type RouteProtectionConfig } from './auth/routes';
62
62
  export { createSetTokenHandler, createClearTokenHandler } from './auth/handlers';
63
63
  export { createAuthTokenClient, type AuthTokenClient } from './auth/token-client';
64
- export { type ImageData } from './image';
64
+ export { type ImageData, thumbHashToDataURL } from './image';
65
65
  export { getOperationName } from './client/operation-name';
66
66
  export { hashQuery } from './client/hash';
67
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAGH,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAGhE,YAAY,EACV,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,YAAY,EACZ,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,0BAA0B,EAC/B,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,8BAA8B,EACnC,KAAK,YAAY,GAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAGjF,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGpF,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT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,oBAAoB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG/G,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG/G,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAE,YAAY,EAAE,KAAK,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAGjF,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,KAAK,SAAS,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAG7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC"}
@@ -74,6 +74,8 @@ export { matchesRoute } from './auth/routes';
74
74
  export { createSetTokenHandler, createClearTokenHandler } from './auth/handlers';
75
75
  // Auth token client (client-side fetch helpers)
76
76
  export { createAuthTokenClient } from './auth/token-client';
77
+ // Image types (loaders removed — GraphQL returns ready-to-use CDN URLs with transform params)
78
+ export { thumbHashToDataURL } from './image';
77
79
  // Utilities
78
80
  export { getOperationName } from './client/operation-name';
79
81
  export { hashQuery } from './client/hash';
@@ -10,12 +10,12 @@
10
10
  *
11
11
  * Cart mutations always return full Cart + userErrors.
12
12
  */
13
- export declare const CART_QUERY = "\n query Cart($id: ID!) {\n cart(id: $id) {\n ...Cart\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n";
14
- export declare const CART_CREATE = "\n mutation CartCreate($input: CartCreateInput) {\n cartCreate(input: $input) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
15
- export declare const CART_LINES_ADD = "\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
16
- export declare const CART_LINES_UPDATE = "\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
17
- export declare const CART_LINES_REMOVE = "\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
18
- export declare const CART_DISCOUNT_CODES_UPDATE = "\n mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
19
- export declare const CART_NOTE_UPDATE = "\n mutation CartNoteUpdate($cartId: ID!, $note: String!) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
20
- export declare const CART_BUYER_IDENTITY_UPDATE = "\n mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url\n altText\n width\n height\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
13
+ export declare const CART_QUERY = "\n query Cart($id: ID!) {\n cart(id: $id) {\n ...Cart\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n";
14
+ export declare const CART_CREATE = "\n mutation CartCreate($input: CartCreateInput) {\n cartCreate(input: $input) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
15
+ export declare const CART_LINES_ADD = "\n mutation CartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) {\n cartLinesAdd(cartId: $cartId, lines: $lines) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
16
+ export declare const CART_LINES_UPDATE = "\n mutation CartLinesUpdate($cartId: ID!, $lines: [CartLineUpdateInput!]!) {\n cartLinesUpdate(cartId: $cartId, lines: $lines) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
17
+ export declare const CART_LINES_REMOVE = "\n mutation CartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {\n cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
18
+ export declare const CART_DISCOUNT_CODES_UPDATE = "\n mutation CartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {\n cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
19
+ export declare const CART_NOTE_UPDATE = "\n mutation CartNoteUpdate($cartId: ID!, $note: String!) {\n cartNoteUpdate(cartId: $cartId, note: $note) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
20
+ export declare const CART_BUYER_IDENTITY_UPDATE = "\n mutation CartBuyerIdentityUpdate($cartId: ID!, $buyerIdentity: CartBuyerIdentityInput!) {\n cartBuyerIdentityUpdate(cartId: $cartId, buyerIdentity: $buyerIdentity) {\n cart { ...Cart }\n userErrors { ...UserError }\n }\n }\n \n fragment Cart on Cart {\n id\n checkoutUrl\n totalQuantity\n cost { ...CartCost }\n lines(first: 100) { ...CartLine }\n buyerIdentity { ...CartBuyerIdentity }\n discountCodes { ...CartDiscountCode }\n discountAllocations { ...CartDiscountAllocation }\n note\n attributes { key value }\n createdAt\n updatedAt\n }\n \n fragment CartCost on CartCost {\n totalAmount { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalTaxAmount { ...PriceMoney }\n totalDutyAmount { ...PriceMoney }\n }\n\n \n fragment CartLine on CartLine {\n id\n quantity\n merchandise { ...ProductVariant }\n cost { ...CartLineCost }\n attributes { key value }\n productId\n productTitle\n productHandle\n productType\n }\n \n fragment CartLineCost on CartLineCost {\n amountPerQuantity { ...PriceMoney }\n subtotalAmount { ...PriceMoney }\n totalAmount { ...PriceMoney }\n compareAtAmountPerQuantity { ...PriceMoney }\n }\n\n \n fragment ProductVariant on ProductVariant {\n id\n title\n sku\n price { ...PriceMoney }\n originalPrice { ...Money }\n compareAtPrice { ...PriceMoney }\n originalCompareAtPrice { ...Money }\n available\n quantityAvailable\n image { ...Image }\n selectedOptions { ...SelectedOption }\n barcode\n weight\n position\n }\n \n fragment PriceMoney on PriceMoney {\n ...Price\n baseAmount\n baseCurrencyCode\n exchangeRate\n marginApplied\n rateTimestamp\n isConverted\n }\n \n fragment Price on PriceMoney {\n amount\n currencyCode\n }\n\n\n \n fragment Money on Money {\n amount\n currencyCode\n }\n\n \n fragment Image on Image {\n id\n url(transform: { maxWidth: 300 })\n altText\n width\n height\n thumbhash\n }\n\n \n fragment SelectedOption on SelectedOption {\n name\n value\n }\n\n\n\n \n fragment CartBuyerIdentity on CartBuyerIdentity {\n email\n phone\n countryCode\n }\n\n \n fragment CartDiscountCode on CartDiscountCode {\n code\n applicable\n }\n\n \n fragment CartDiscountAllocation on CartDiscountAllocation {\n discountCode\n amount { ...Money }\n }\n\n\n \n fragment UserError on UserError {\n message\n code\n field\n }\n\n";
21
21
  //# sourceMappingURL=cart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../../src/core/operations/cart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuKH,eAAO,MAAM,UAAU,otEAOtB,CAAC;AAMF,eAAO,MAAM,WAAW,s3EASvB,CAAC;AAEF,eAAO,MAAM,cAAc,25EAS1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,u6EAS7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,45EAS7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,k8EAStC,CAAC;AAEF,eAAO,MAAM,gBAAgB,k5EAS5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,+8EAStC,CAAC"}
1
+ {"version":3,"file":"cart.d.ts","sourceRoot":"","sources":["../../../src/core/operations/cart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwKH,eAAO,MAAM,UAAU,iwEAOtB,CAAC;AAMF,eAAO,MAAM,WAAW,m6EASvB,CAAC;AAEF,eAAO,MAAM,cAAc,w8EAS1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,o9EAS7B,CAAC;AAEF,eAAO,MAAM,iBAAiB,y8EAS7B,CAAC;AAEF,eAAO,MAAM,0BAA0B,++EAStC,CAAC;AAEF,eAAO,MAAM,gBAAgB,+7EAS5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,4/EAStC,CAAC"}
@@ -40,10 +40,11 @@ const PRICE_MONEY_FRAGMENT = `
40
40
  const IMAGE_FRAGMENT = `
41
41
  fragment Image on Image {
42
42
  id
43
- url
43
+ url(transform: { maxWidth: 300 })
44
44
  altText
45
45
  width
46
46
  height
47
+ thumbhash
47
48
  }
48
49
  `;
49
50
  const SELECTED_OPTION_FRAGMENT = `
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-sdk",
3
- "version": "4.5.0",
3
+ "version": "4.7.2",
4
4
  "description": "Storefront runtime SDK for DoSwiftly Commerce — layered transport, middleware pipeline, React providers, Zustand stores, cache strategies. 0 runtime dependencies in core.",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
- "README.md"
8
+ "README.md",
9
+ "CHANGELOG.md"
9
10
  ],
10
11
  "types": "dist/core/index.d.ts",
11
12
  "exports": {
@@ -26,17 +27,6 @@
26
27
  "default": "./dist/core/cache.js"
27
28
  }
28
29
  },
29
- "scripts": {
30
- "build": "tsc",
31
- "build:only": "tsc",
32
- "dev": "tsc --watch",
33
- "clean": "rm -rf dist",
34
- "test": "vitest run",
35
- "test:watch": "vitest",
36
- "test:unit": "vitest run src/__tests__/unit/",
37
- "test:contract": "vitest run src/__tests__/contract/",
38
- "validate:cart": "node scripts/validate-cart-operations.cjs --strict"
39
- },
40
30
  "keywords": [
41
31
  "sdk",
42
32
  "typescript",
@@ -55,7 +45,7 @@
55
45
  "@types/node": "^22.10.2",
56
46
  "@types/react": "^18.3.0 || ^19.0.0",
57
47
  "fast-check": "^3.23.2",
58
- "next": "^16.0.0",
48
+ "next": "^16.2.3",
59
49
  "typescript": "^5.7.2",
60
50
  "vitest": "^4.1.0",
61
51
  "zustand": "^5.0.2",
@@ -72,5 +62,16 @@
72
62
  "zustand": {
73
63
  "optional": true
74
64
  }
65
+ },
66
+ "scripts": {
67
+ "build": "tsc",
68
+ "build:only": "tsc",
69
+ "dev": "tsc --watch",
70
+ "clean": "rm -rf dist",
71
+ "test": "vitest run",
72
+ "test:watch": "vitest",
73
+ "test:unit": "vitest run src/__tests__/unit/",
74
+ "test:contract": "vitest run src/__tests__/contract/",
75
+ "validate:cart": "node scripts/validate-cart-operations.cjs --strict"
75
76
  }
76
- }
77
+ }