@doswiftly/storefront-operations 14.0.0 → 15.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.
package/AGENTS.md CHANGED
@@ -27,10 +27,10 @@ consumer's `codegen.ts` references this package's `.graphql` files as
27
27
  live in the consumer's repo.
28
28
 
29
29
  <!-- AUTOGEN:STATS:BEGIN — auto-regenerated, do not edit by hand -->
30
- - **Schema version**: 14.0.0
31
- - **Queries**: 50
30
+ - **Schema version**: 15.1.0
31
+ - **Queries**: 51
32
32
  - **Mutations**: 40
33
- - **Fragments**: 100
33
+ - **Fragments**: 101
34
34
  <!-- AUTOGEN:STATS:END -->
35
35
 
36
36
  ## Loading order
package/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 15.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 94c2603: Storefront SDK now covers the full checkout flow end-to-end through typed methods — no more dropping to raw GraphQL for shipping discovery, payment listing, guest order lookup, cart attributes, or saved-address pickers.
8
+
9
+ **New `CartClient` methods**
10
+ - `getAvailableShippingMethods(cartId, address)` — cart-aware shipping discovery. Resolves with `null` when the cart does not exist or has expired (symmetric with `get(cartId)`), otherwise with `AvailableShippingMethodsPayload`: `methods[]` (each carrying `deliveryType` — `HOME`, `PICKUP_POINT`, `LOCKER` — so the storefront picks the pickup / locker UI without inferring from the method name), `freeShippingProgress` (best progress across methods, for the picker banner), and `userErrors[]` populated for business conditions like `DIGITAL_ONLY_NO_SHIPPING` (cart with no shippable lines) or `NO_SHIPPING_METHODS` (unsupported address). Branch on `result.userErrors[0].code`; the `message` is localized per the request's `Accept-Language`.
11
+ - `getAvailablePaymentMethods()` — shop-level list of active payment methods. Returns `AvailablePaymentMethods`: `methods[]` (sorted by merchant position) and `defaultMethod` (merchant-flagged pre-selection). Prefer `result.defaultMethod ?? result.methods.find(m => m.isDefault)` — the merchant may override the default independently of per-method flags.
12
+ - `getOrderByToken(token, email?)` — guest order lookup by opaque access token (returned in `complete().order.accessToken`). Optional `email` adds defense in depth; mismatch returns the same `null` shape as an invalid token. Rate-limited server-side (5 req / min per IP + shop).
13
+ - `updateAttributes(cartId, attributes)` — replace-all of the cart's custom `{ key, value }` pairs (delivery instructions, gift-wrap flags, B2B PO numbers). Pass an empty array to clear.
14
+
15
+ **New `AuthClient` method**
16
+ - `getAddresses()` — saved address book of the authenticated customer (shipping + billing). Resolves with the address list when authenticated, with `null` when no auth context reached the server (symmetric with `getCustomer()`). Each entry carries B2B fields (`taxId`, `vatNumber`) and the `isDefault` flag, so the same list serves both shipping and billing pickers.
17
+
18
+ **Schema additions (operations package)**
19
+ - `MailingAddress` now exposes `taxId`, `vatNumber`, and `pickupPoint`. The new `PickupPoint` type (`provider`, `pointId`, `name?`, `address?`) is returned on shipping addresses delivered to a parcel locker / collection point.
20
+ - `AvailableShippingMethod` gains the declarative `deliveryType` enum.
21
+ - `CartAppliedGiftCard` now exposes `id` — the stable handle to pass to `cartRemoveGiftCard` (no need to keep the raw gift card code on the client).
22
+ - New `CustomerAddresses` query — `customer.addresses(first: 50)` connection returning the address book, normalized to a node list by the SDK wrapper.
23
+
24
+ **SDK fragment changes**
25
+
26
+ The SDK's `MailingAddress` fragment now selects `taxId`, `vatNumber`, and `pickupPoint`. Existing types that include a mailing address (`Cart.shippingAddress`, `Cart.billingAddress`, `Order.shippingAddress`, `Customer.defaultAddress`) get these fields automatically. The `AvailableShippingMethod` fragment selects `deliveryType`. The `CartAppliedGiftCard` fragment selects `id`.
27
+
28
+ **New React hook — server-driven checkout**
29
+ - `useCart(cartId, options?)` — sister of `useCartManager`, bound to an explicit `cartId` instead of the `cart-id` cookie. Use it for SSR-rendered checkout, deep-link order recovery, and admin "view this cart" UIs where the cart id is known up front and the cookie is irrelevant. Returns the loaded cart plus the same mutation surface as the cookie-based hook (`addItems`, `updateItems`, `removeItems`, `updateBuyerIdentity`, `setShippingAddress`, `updateDiscountCodes`, `updateNote`, `updateAttributes` — each resolves with `{ cart, warnings }` so low-stock and partial-availability hints flow through), reactive `isLoading` / `error` / `operation` state, and a `refetch()` callback. `autoFetch: false` + `initialCart` lets you skip the hydration round-trip when the server already resolved the cart.
30
+
31
+ **Field-level descriptions visible in your IDE**
32
+
33
+ Hovering on any cart / order / customer / payment / shipping field in your editor now shows a precise English description of what the field carries — when to use it, what its values mean, what is null vs zero, which enum values are relevant. The descriptions were rewritten across every type selected by the SDK so the storefront-developer audience does not need to look anywhere else for the contract. Codegen is configured (`preResolveTypes: false`) to propagate those descriptions through every generated fragment / query type, so the same hover works on the typed shape your codegen produces.
34
+
35
+ These additions are backward-compatible — existing calls keep their current signatures and return the same fields (plus the new ones). The mailing-address fragment expansion is purely additive.
36
+
37
+ ## 15.0.0
38
+
39
+ ### Major Changes
40
+
41
+ - a11f9e4: GraphQL types are now generated from the storefront schema instead of being hand-written. Every exported cart, order, customer, and payment type is derived directly from the schema, so they can no longer drift out of sync with the API.
42
+
43
+ **Breaking** — the previous hand-written types were inaccurate, and correcting them changes some shapes:
44
+ - `Customer.orderCount` is now `string` (was `number`).
45
+ - `CartLineEdge` and `CartLineConnection.edges` were removed — the cart query never returned edges.
46
+ - Fields previously typed as `string` are now precise string-literal union types: `Order.status`, `Order.paymentStatus`, `Order.fulfillmentStatus`, `PaymentSession.status`, `CartLine.productType`, `Money.currencyCode`, `CartWarning.code`, and the `AttributeSelection` mode fields. Reading these values still works; assigning arbitrary strings into them no longer compiles.
47
+
48
+ **Fixed** — types that were missing fields or had the wrong nullability:
49
+ - `Order` now includes `accessToken`.
50
+ - `Cart` and `CartLine` now include `requiresShipping`.
51
+ - `Customer.displayName`, `Customer.emailMarketing`, and `Customer.totalSpent` are now correctly non-nullable.
52
+ - The duplicated `MailingAddress` definition is collapsed into one.
53
+
54
+ **New** — the schema enum types used by the public types are now exported: `CurrencyCode`, `CountryCode`, `LanguageCode`, `ProductTypeEnum`, `WeightUnit`, `CartWarningCode`, `StorefrontOrderStatus`, `OrderPaymentStatus`, `OrderFulfillmentStatus`, `EmailMarketingState`, `MarketingOptInLevel`, and the attribute enums.
55
+
56
+ These are type-only changes — no runtime behaviour changed.
57
+
3
58
  ## 14.0.0
4
59
 
5
60
  ### Major Changes
package/README.md CHANGED
@@ -200,6 +200,7 @@ full executable body of each operation.
200
200
  | --- | --- |
201
201
  | `Customer` | Full customer profile — basic info plus the first 10 addresses and first 10 orders. Heaviest customer query; for narrow use cases prefer `CustomerProfile` (no orders / addresses) or `CustomerOrder` (single order). Returns null if unauthenticated. |
202
202
  | `CustomerProfile` | Lightweight customer profile (no orders, no addresses list). Use for settings / profile pages that only need basic customer info — much cheaper than `Customer`. Returns null if unauthenticated. |
203
+ | `CustomerAddresses` | Authenticated customer's saved address book — used on checkout to let the buyer pick a previously-used shipping / billing address instead of typing it. Each entry carries B2B invoicing fields (`taxId`, `vatNumber`) and the `isDefault` flag so the same list serves both as the shipping picker and as the billing/invoice picker. Returns up to 50 addresses (Relay Connection — buyers rarely keep more); for the unauthenticated case the connection is empty (no error). The default address is also surfaced as `Customer.defaultAddress`. |
203
204
  | `CustomerOrder` | Single order by `orderId`. Returns only orders that belong to the authenticated customer (cross-customer access returns null, not an error). Much cheaper than fetching the full `Customer` payload to access one order. Use on the order detail page. |
204
205
  | `OrderByToken` | Fetch a single order using its opaque access token (`Order.accessToken`) — designed for guest order summary pages where the buyer has not signed in. The token is returned in `cartComplete.order.accessToken` immediately after checkout completes; persist it in an HTTP-only cookie (preferred) or `sessionStorage` for the post-checkout page (NEVER `localStorage`). Optional `email` parameter adds defense-in-depth: when provided, it is matched case-insensitively against the order's buyer email; on mismatch the query returns `null` exactly like an invalid token (the response shape is identical, so an attacker cannot distinguish "token valid, wrong email" from "token invalid"). Rate-limited to 5 requests per minute per IP+shop combination to deter token enumeration; clients exceeding the limit receive a GraphQL error with `extensions.code: THROTTLED`. The response is marked `Cache-Control: no-store` so per-customer order data is never served from CDN or browser cache between users. Safe to retry; the token is permanent until the order is deleted. |
205
206
 
@@ -465,7 +466,8 @@ full executable body of each operation.
465
466
 
466
467
  | Fragment | On Type | Description |
467
468
  | --- | --- | --- |
468
- | `MailingAddress` | `MailingAddress` | Customer mailing address full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries. |
469
+ | `PickupPoint` | `PickupPoint` | Selected pickup point (parcel locker or collection point) attached to a delivery address. Returned on `MailingAddress.pickupPoint` when the buyer chose a non-home delivery method (`deliveryType` other than `HOME`). Null for home delivery. |
470
+ | `MailingAddress` | `MailingAddress` | Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Carries B2B invoicing fields (`taxId`, `vatNumber`) and the selected `pickupPoint` for parcel locker / collection point deliveries. Spread on the address book UI, checkout shipping/billing forms, and order summaries. |
469
471
  | `CustomerAccessToken` | `CustomerAccessToken` | Customer access token returned by `customerLogin` / `customerSignup` / `customerActivate` / `customerResetPassword` / `customerRefreshToken`. The token's JWT TTL is 24h; cookie max-age is 30d. |
470
472
  | `Customer` | `Customer` | Customer profile — basic info plus B2B fields (`taxId`, `vatNumber`, `regon`, `companyName`), default address, lifetime stats (`orderCount`, `totalSpent`), marketing preferences. Use on profile / settings pages. |
471
473
  | `Order` | `Order` | Order summary — number, totals (cost / tax / shipping), payment + fulfillment status, shipping address, item count, lifecycle timestamps, plus payment capability signal (`canCreatePayment` + `paymentMethodType`) the storefront uses to decide post-completion payment flow without hard-coded provider checks. Spread on the order list, order detail, and the `cartComplete` mutation result. Line items are not included here. |
@@ -483,7 +485,7 @@ full executable body of each operation.
483
485
  | `CartDiscountAllocation` | `CartDiscountAllocation` | Allocation of a discount code to the cart total — pairs the code with the actual money discounted. Use to show "saved X with code Y" in cart UI. |
484
486
  | `Cart` | `Cart` | Full cart shape — totals, line items (paginated up to 100), buyer identity, applied discount codes + allocations, note, custom attributes, plus fulfillment fields (email/phone/addresses/shipping method/payment method/applied gift cards). Spread on the cart drawer / cart page; refetch after every cart mutation including completion lifecycle. |
485
487
  | `CartShippingMethod` | `CartShippingMethod` | Shipping method selected on a cart (D8 term unification — wcześniej ShippingRate). Returned przez `cart.selectedShippingMethod` po `cartSelectShippingMethod` mutation. |
486
- | `CartAppliedGiftCard` | `CartAppliedGiftCard` | Gift card applied to a cart — masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`. |
488
+ | `CartAppliedGiftCard` | `CartAppliedGiftCard` | Gift card applied to a cart — `id` is the stable handle the storefront passes to `cartRemoveGiftCard` (no need to keep the raw code around). Plus masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`. |
487
489
  | `CartSelectedPaymentMethod` | `PaymentMethod` | Payment method (integration provider) selected on a cart — id, name, provider code, type category (CARD/BLIK/BANK_TRANSFER/etc.), icon, description, isDefault, supportedCurrencies. Storefront UI używa do iconography + selection display. |
488
490
 
489
491
  #### Shop
@@ -543,7 +545,7 @@ full executable body of each operation.
543
545
  | `ShippingCarrier` | `ShippingCarrier` | Carrier offering the shipping method — id, display name, logo URL, internal service code. |
544
546
  | `DeliveryEstimate` | `DeliveryEstimate` | Estimated delivery window — `minDays` to `maxDays` plus a human-readable description (e.g. "2-4 business days"). |
545
547
  | `FreeShippingProgress` | `FreeShippingProgress` | Free-shipping progress info — `qualifies` flag, current cart amount, threshold, remaining to qualify, percent progress, and a localized message ("Add 20 PLN more for free shipping"). Use to render a free-shipping progress bar in the cart drawer. |
546
- | `AvailableShippingMethod` | `AvailableShippingMethod` | One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. Spread on the checkout shipping step. |
548
+ | `AvailableShippingMethod` | `AvailableShippingMethod` | One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. `deliveryType` signals whether to render a pickup-point / locker picker (`HOME` vs `PICKUP_POINT` / `LOCKER`) so the storefront does not have to infer it from the method name. Spread on the checkout shipping step. |
547
549
 
548
550
  #### Attribute Filters
549
551
 
package/fragments.graphql CHANGED
@@ -244,7 +244,15 @@ fragment Category on Category {
244
244
  # Customer
245
245
  # ============================================
246
246
 
247
- # Customer mailing address full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries.
247
+ # Selected pickup point (parcel locker or collection point) attached to a delivery address. Returned on `MailingAddress.pickupPoint` when the buyer chose a non-home delivery method (`deliveryType` other than `HOME`). Null for home delivery.
248
+ fragment PickupPoint on PickupPoint {
249
+ provider
250
+ pointId
251
+ name
252
+ address
253
+ }
254
+
255
+ # Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Carries B2B invoicing fields (`taxId`, `vatNumber`) and the selected `pickupPoint` for parcel locker / collection point deliveries. Spread on the address book UI, checkout shipping/billing forms, and order summaries.
248
256
  fragment MailingAddress on MailingAddress {
249
257
  id
250
258
  streetLine1
@@ -261,6 +269,11 @@ fragment MailingAddress on MailingAddress {
261
269
  stateCode
262
270
  postalCode
263
271
  isDefault
272
+ taxId
273
+ vatNumber
274
+ pickupPoint {
275
+ ...PickupPoint
276
+ }
264
277
  }
265
278
 
266
279
  # Customer access token returned by `customerLogin` / `customerSignup` / `customerActivate` / `customerResetPassword` / `customerRefreshToken`. The token's JWT TTL is 24h; cookie max-age is 30d.
@@ -503,8 +516,9 @@ fragment CartShippingMethod on CartShippingMethod {
503
516
  }
504
517
  }
505
518
 
506
- # Gift card applied to a cart — masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.
519
+ # Gift card applied to a cart — `id` is the stable handle the storefront passes to `cartRemoveGiftCard` (no need to keep the raw code around). Plus masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.
507
520
  fragment CartAppliedGiftCard on CartAppliedGiftCard {
521
+ id
508
522
  maskedCode
509
523
  lastCharacters
510
524
  appliedAmount {
@@ -924,11 +938,12 @@ fragment FreeShippingProgress on FreeShippingProgress {
924
938
  message
925
939
  }
926
940
 
927
- # One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. Spread on the checkout shipping step.
941
+ # One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. `deliveryType` signals whether to render a pickup-point / locker picker (`HOME` vs `PICKUP_POINT` / `LOCKER`) so the storefront does not have to infer it from the method name. Spread on the checkout shipping step.
928
942
  fragment AvailableShippingMethod on AvailableShippingMethod {
929
943
  id
930
944
  name
931
945
  description
946
+ deliveryType
932
947
  carrier {
933
948
  ...ShippingCarrier
934
949
  }
package/llms-full.txt CHANGED
@@ -1,7 +1,7 @@
1
1
  # DoSwiftly Storefront Operations — Full Reference
2
2
 
3
- > Schema version: **14.0.0**
4
- > 50 queries · 40 mutations · 100 fragments
3
+ > Schema version: **15.1.0**
4
+ > 51 queries · 40 mutations · 101 fragments
5
5
 
6
6
  Auto-generated from `.graphql` source files. Do not edit by hand — this file is
7
7
  regenerated on every release to match the published schema.
@@ -410,6 +410,33 @@ query CustomerProfile {
410
410
  }
411
411
  ```
412
412
 
413
+ ### Query: `CustomerAddresses`
414
+
415
+ **Section**: Customer (requires auth)
416
+
417
+ **Description**: Authenticated customer's saved address book — used on checkout to let the buyer pick a previously-used shipping / billing address instead of typing it. Each entry carries B2B invoicing fields (`taxId`, `vatNumber`) and the `isDefault` flag so the same list serves both as the shipping picker and as the billing/invoice picker. Returns up to 50 addresses (Relay Connection — buyers rarely keep more); for the unauthenticated case the connection is empty (no error). The default address is also surfaced as `Customer.defaultAddress`.
418
+
419
+ **Variables**: none
420
+
421
+ **Fragments used**: `MailingAddress`, `PageInfo`
422
+
423
+ **GraphQL**:
424
+ ```graphql
425
+ query CustomerAddresses {
426
+ customer {
427
+ addresses(first: 50) {
428
+ nodes {
429
+ ...MailingAddress
430
+ }
431
+ pageInfo {
432
+ ...PageInfo
433
+ }
434
+ totalCount
435
+ }
436
+ }
437
+ }
438
+ ```
439
+
413
440
  ### Query: `CustomerOrder`
414
441
 
415
442
  **Section**: Customer (requires auth)
@@ -2744,11 +2771,29 @@ fragment Category on Category {
2744
2771
  }
2745
2772
  ```
2746
2773
 
2774
+ ### Fragment: `PickupPoint` on `PickupPoint`
2775
+
2776
+ **Section**: Customer
2777
+
2778
+ **Description**: Selected pickup point (parcel locker or collection point) attached to a delivery address. Returned on `MailingAddress.pickupPoint` when the buyer chose a non-home delivery method (`deliveryType` other than `HOME`). Null for home delivery.
2779
+
2780
+ **GraphQL**:
2781
+ ```graphql
2782
+ fragment PickupPoint on PickupPoint {
2783
+ provider
2784
+ pointId
2785
+ name
2786
+ address
2787
+ }
2788
+ ```
2789
+
2747
2790
  ### Fragment: `MailingAddress` on `MailingAddress`
2748
2791
 
2749
2792
  **Section**: Customer
2750
2793
 
2751
- **Description**: Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries.
2794
+ **Description**: Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Carries B2B invoicing fields (`taxId`, `vatNumber`) and the selected `pickupPoint` for parcel locker / collection point deliveries. Spread on the address book UI, checkout shipping/billing forms, and order summaries.
2795
+
2796
+ **Uses fragments**: `PickupPoint`
2752
2797
 
2753
2798
  **GraphQL**:
2754
2799
  ```graphql
@@ -2768,6 +2813,11 @@ fragment MailingAddress on MailingAddress {
2768
2813
  stateCode
2769
2814
  postalCode
2770
2815
  isDefault
2816
+ taxId
2817
+ vatNumber
2818
+ pickupPoint {
2819
+ ...PickupPoint
2820
+ }
2771
2821
  }
2772
2822
  ```
2773
2823
 
@@ -3123,13 +3173,14 @@ fragment CartShippingMethod on CartShippingMethod {
3123
3173
 
3124
3174
  **Section**: Cart
3125
3175
 
3126
- **Description**: Gift card applied to a cart — masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.
3176
+ **Description**: Gift card applied to a cart — `id` is the stable handle the storefront passes to `cartRemoveGiftCard` (no need to keep the raw code around). Plus masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.
3127
3177
 
3128
3178
  **Uses fragments**: `Money`
3129
3179
 
3130
3180
  **GraphQL**:
3131
3181
  ```graphql
3132
3182
  fragment CartAppliedGiftCard on CartAppliedGiftCard {
3183
+ id
3133
3184
  maskedCode
3134
3185
  lastCharacters
3135
3186
  appliedAmount {
@@ -3772,7 +3823,7 @@ fragment FreeShippingProgress on FreeShippingProgress {
3772
3823
 
3773
3824
  **Section**: Shipping Methods
3774
3825
 
3775
- **Description**: One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. Spread on the checkout shipping step.
3826
+ **Description**: One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. `deliveryType` signals whether to render a pickup-point / locker picker (`HOME` vs `PICKUP_POINT` / `LOCKER`) so the storefront does not have to infer it from the method name. Spread on the checkout shipping step.
3776
3827
 
3777
3828
  **Uses fragments**: `DeliveryEstimate`, `FreeShippingProgress`, `Money`, `ShippingCarrier`
3778
3829
 
@@ -3782,6 +3833,7 @@ fragment AvailableShippingMethod on AvailableShippingMethod {
3782
3833
  id
3783
3834
  name
3784
3835
  description
3836
+ deliveryType
3785
3837
  carrier {
3786
3838
  ...ShippingCarrier
3787
3839
  }
package/operations.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "schemaVersion": "14.0.0",
2
+ "schemaVersion": "15.1.0",
3
3
  "queries": [
4
4
  {
5
5
  "name": "Shop",
@@ -307,6 +307,18 @@
307
307
  ],
308
308
  "body": "query CustomerProfile {\n customer {\n ...Customer\n }\n}"
309
309
  },
310
+ {
311
+ "name": "CustomerAddresses",
312
+ "kind": "query",
313
+ "section": "Customer (requires auth)",
314
+ "description": "Authenticated customer's saved address book — used on checkout to let the buyer pick a previously-used shipping / billing address instead of typing it. Each entry carries B2B invoicing fields (`taxId`, `vatNumber`) and the `isDefault` flag so the same list serves both as the shipping picker and as the billing/invoice picker. Returns up to 50 addresses (Relay Connection — buyers rarely keep more); for the unauthenticated case the connection is empty (no error). The default address is also surfaced as `Customer.defaultAddress`.",
315
+ "variables": [],
316
+ "fragmentRefs": [
317
+ "MailingAddress",
318
+ "PageInfo"
319
+ ],
320
+ "body": "query CustomerAddresses {\n customer {\n addresses(first: 50) {\n nodes {\n ...MailingAddress\n }\n pageInfo {\n ...PageInfo\n }\n totalCount\n }\n }\n}"
321
+ },
310
322
  {
311
323
  "name": "CustomerOrder",
312
324
  "kind": "query",
@@ -1999,13 +2011,25 @@
1999
2011
  "onType": "Category"
2000
2012
  },
2001
2013
  {
2002
- "name": "MailingAddress",
2014
+ "name": "PickupPoint",
2003
2015
  "kind": "fragment",
2004
2016
  "section": "Customer",
2005
- "description": "Customer mailing address full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Spread on the address book UI and order summaries.",
2017
+ "description": "Selected pickup point (parcel locker or collection point) attached to a delivery address. Returned on `MailingAddress.pickupPoint` when the buyer chose a non-home delivery method (`deliveryType` other than `HOME`). Null for home delivery.",
2006
2018
  "variables": [],
2007
2019
  "fragmentRefs": [],
2008
- "body": "fragment MailingAddress on MailingAddress {\n id\n streetLine1\n streetLine2\n city\n company\n country\n countryCode\n firstName\n lastName\n name\n phone\n state\n stateCode\n postalCode\n isDefault\n}",
2020
+ "body": "fragment PickupPoint on PickupPoint {\n provider\n pointId\n name\n address\n}",
2021
+ "onType": "PickupPoint"
2022
+ },
2023
+ {
2024
+ "name": "MailingAddress",
2025
+ "kind": "fragment",
2026
+ "section": "Customer",
2027
+ "description": "Customer mailing address — full street/city/state/country/postal code with names and phone. `isDefault` flips when this address is the default for shipping. Carries B2B invoicing fields (`taxId`, `vatNumber`) and the selected `pickupPoint` for parcel locker / collection point deliveries. Spread on the address book UI, checkout shipping/billing forms, and order summaries.",
2028
+ "variables": [],
2029
+ "fragmentRefs": [
2030
+ "PickupPoint"
2031
+ ],
2032
+ "body": "fragment MailingAddress on MailingAddress {\n id\n streetLine1\n streetLine2\n city\n company\n country\n countryCode\n firstName\n lastName\n name\n phone\n state\n stateCode\n postalCode\n isDefault\n taxId\n vatNumber\n pickupPoint {\n ...PickupPoint\n }\n}",
2009
2033
  "onType": "MailingAddress"
2010
2034
  },
2011
2035
  {
@@ -2161,12 +2185,12 @@
2161
2185
  "name": "CartAppliedGiftCard",
2162
2186
  "kind": "fragment",
2163
2187
  "section": "Cart",
2164
- "description": "Gift card applied to a cart — masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.",
2188
+ "description": "Gift card applied to a cart — `id` is the stable handle the storefront passes to `cartRemoveGiftCard` (no need to keep the raw code around). Plus masked code for display, last 4 chars for matching, applied amount + remaining balance. Balance NIE debited yet — actual deduction atomically at `cartComplete`.",
2165
2189
  "variables": [],
2166
2190
  "fragmentRefs": [
2167
2191
  "Money"
2168
2192
  ],
2169
- "body": "fragment CartAppliedGiftCard on CartAppliedGiftCard {\n maskedCode\n lastCharacters\n appliedAmount {\n ...Money\n }\n remainingBalance {\n ...Money\n }\n}",
2193
+ "body": "fragment CartAppliedGiftCard on CartAppliedGiftCard {\n id\n maskedCode\n lastCharacters\n appliedAmount {\n ...Money\n }\n remainingBalance {\n ...Money\n }\n}",
2170
2194
  "onType": "CartAppliedGiftCard"
2171
2195
  },
2172
2196
  {
@@ -2498,7 +2522,7 @@
2498
2522
  "name": "AvailableShippingMethod",
2499
2523
  "kind": "fragment",
2500
2524
  "section": "Shipping Methods",
2501
- "description": "One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. Spread on the checkout shipping step.",
2525
+ "description": "One shipping method offered for the destination + cart — id, name, carrier, price, free-shipping progress, estimated delivery, sort order. `deliveryType` signals whether to render a pickup-point / locker picker (`HOME` vs `PICKUP_POINT` / `LOCKER`) so the storefront does not have to infer it from the method name. Spread on the checkout shipping step.",
2502
2526
  "variables": [],
2503
2527
  "fragmentRefs": [
2504
2528
  "DeliveryEstimate",
@@ -2506,7 +2530,7 @@
2506
2530
  "Money",
2507
2531
  "ShippingCarrier"
2508
2532
  ],
2509
- "body": "fragment AvailableShippingMethod on AvailableShippingMethod {\n id\n name\n description\n carrier {\n ...ShippingCarrier\n }\n price {\n ...Money\n }\n isFree\n estimatedDelivery {\n ...DeliveryEstimate\n }\n freeShippingProgress {\n ...FreeShippingProgress\n }\n sortOrder\n}",
2533
+ "body": "fragment AvailableShippingMethod on AvailableShippingMethod {\n id\n name\n description\n deliveryType\n carrier {\n ...ShippingCarrier\n }\n price {\n ...Money\n }\n isFree\n estimatedDelivery {\n ...DeliveryEstimate\n }\n freeShippingProgress {\n ...FreeShippingProgress\n }\n sortOrder\n}",
2510
2534
  "onType": "AvailableShippingMethod"
2511
2535
  },
2512
2536
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doswiftly/storefront-operations",
3
- "version": "14.0.0",
3
+ "version": "15.1.0",
4
4
  "description": "GraphQL operations for DoSwiftly Storefront - SSOT from backend",
5
5
  "homepage": "https://doswiftly.pl",
6
6
  "publishConfig": {
package/queries.graphql CHANGED
@@ -224,6 +224,21 @@ query CustomerProfile {
224
224
  }
225
225
  }
226
226
 
227
+ # Authenticated customer's saved address book — used on checkout to let the buyer pick a previously-used shipping / billing address instead of typing it. Each entry carries B2B invoicing fields (`taxId`, `vatNumber`) and the `isDefault` flag so the same list serves both as the shipping picker and as the billing/invoice picker. Returns up to 50 addresses (Relay Connection — buyers rarely keep more); for the unauthenticated case the connection is empty (no error). The default address is also surfaced as `Customer.defaultAddress`.
228
+ query CustomerAddresses {
229
+ customer {
230
+ addresses(first: 50) {
231
+ nodes {
232
+ ...MailingAddress
233
+ }
234
+ pageInfo {
235
+ ...PageInfo
236
+ }
237
+ totalCount
238
+ }
239
+ }
240
+ }
241
+
227
242
  # Single order by `orderId`. Returns only orders that belong to the authenticated customer (cross-customer access returns null, not an error). Much cheaper than fetching the full `Customer` payload to access one order. Use on the order detail page.
228
243
  query CustomerOrder($orderId: ID!) {
229
244
  customerOrder(orderId: $orderId) {