@doswiftly/storefront-sdk 20.1.0 → 21.0.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,60 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 21.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- a539021: Product attribute fields renamed and split by purpose (breaking)
|
|
8
|
+
|
|
9
|
+
`Product.attributes` now returns the product's **stored custom-field values** — merchant-managed metadata such as manufacturer, licence or material — as `[EntityAttributeField!]!`. Only values marked visible are returned; pass the optional `namespace` argument to fetch a single group.
|
|
10
|
+
|
|
11
|
+
The configurator field **definitions** that previously lived under `Product.attributes` have moved to **`Product.configuratorFields(filter: { filledBy: ... })`**, returning `[ConfiguratorField!]!`.
|
|
12
|
+
|
|
13
|
+
Renames:
|
|
14
|
+
- Type `ProductAttributeDefinition` → `ConfiguratorField`, with field renames `fillingMode` → `filledBy`, `billingMode` → `pricingMode`, `isRequired` → `required`, `displayOrder` → `sortOrder`.
|
|
15
|
+
- Type `ProductAttributeOption` → `ConfiguratorOption`.
|
|
16
|
+
- Input `ProductAttributeFilterInput` → `ConfiguratorFieldFilterInput` (its `fillingMode` argument → `filledBy`).
|
|
17
|
+
|
|
18
|
+
Removed from the public contract: `Product.attributeSetId`; the internal `scopeProductId` and `taxClassId` on configurator fields; and the raw `linkedVariantId` on a configurator option (read `linkedVariant.id` instead).
|
|
19
|
+
|
|
20
|
+
Migration: rename `attributes(filter: { fillingMode })` selections to `configuratorFields(filter: { filledBy })` and spread `...ConfiguratorField`; use the new `attributes` field (optional `namespace`) to read product metadata values.
|
|
21
|
+
|
|
22
|
+
## 20.2.0
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- 17fedcf: Addresses now carry a structured building / flat number alongside the free-form street line.
|
|
27
|
+
|
|
28
|
+
**Why**: Polish addresses — and carriers like InPost as well as VAT invoicing — need the building number as a discrete field rather than mixed into a single street line (e.g. `"ul. Piękna 5/3"` must split into building `5`, flat `3`). The `MailingAddress` type and the cart / mailing address inputs now expose `buildingNumber` and `flatNumber` so storefronts can collect and display them precisely.
|
|
29
|
+
|
|
30
|
+
**Additive (backward-compatible)**:
|
|
31
|
+
1. `MailingAddress` (read) gains `buildingNumber` and `flatNumber` — populated on cart, order and saved customer addresses; `null` when only the free-form line was provided.
|
|
32
|
+
2. The address inputs (`CartAddressInput`, `MailingAddressInput`) accept optional `buildingNumber` and `flatNumber`. For a Polish street delivery without a pickup point the building number is now required server-side — omitting it returns a `BUILDING_NUMBER_REQUIRED` user error instead of silently guessing it from the street text.
|
|
33
|
+
|
|
34
|
+
**Usage example**:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
await cartSetShippingAddress({
|
|
38
|
+
cartId,
|
|
39
|
+
address: {
|
|
40
|
+
streetLine1: "ul. Piękna 5/3",
|
|
41
|
+
buildingNumber: "5",
|
|
42
|
+
flatNumber: "3",
|
|
43
|
+
city: "Warszawa",
|
|
44
|
+
postalCode: "00-001",
|
|
45
|
+
country: "PL",
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
// reading it back
|
|
50
|
+
const { buildingNumber, flatNumber } = order.shippingAddress;
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Migration checklist for existing storefronts**:
|
|
54
|
+
- [ ] Add a `buildingNumber` (and optional `flatNumber`) field to your address forms.
|
|
55
|
+
- [ ] For Polish street addresses, send `buildingNumber`, or handle the `BUILDING_NUMBER_REQUIRED` user error returned by the cart address mutations.
|
|
56
|
+
- [ ] Optionally render `buildingNumber` / `flatNumber` when displaying saved or order addresses.
|
|
57
|
+
|
|
3
58
|
## 20.1.0
|
|
4
59
|
|
|
5
60
|
### Minor Changes
|
|
@@ -569,6 +569,8 @@ export type CartAddLinesPayload = {
|
|
|
569
569
|
warnings: Array<CartWarning>;
|
|
570
570
|
};
|
|
571
571
|
export type CartAddressInput = {
|
|
572
|
+
/** Building / house number as a discrete field, overlaid on `streetLine1`. Required for delivery and billing addresses in Poland (`country: PL`) without a `pickupPoint` — carriers (e.g. InPost) and invoicing need the building number split out from the street name. */
|
|
573
|
+
buildingNumber?: InputMaybe<Scalars['String']['input']>;
|
|
572
574
|
/** City */
|
|
573
575
|
city: Scalars['String']['input'];
|
|
574
576
|
/** Company name */
|
|
@@ -577,6 +579,8 @@ export type CartAddressInput = {
|
|
|
577
579
|
country: CountryCode;
|
|
578
580
|
/** First name */
|
|
579
581
|
firstName?: InputMaybe<Scalars['String']['input']>;
|
|
582
|
+
/** Flat / apartment number as a discrete field — optional companion to `buildingNumber`. */
|
|
583
|
+
flatNumber?: InputMaybe<Scalars['String']['input']>;
|
|
580
584
|
/** Last name */
|
|
581
585
|
lastName?: InputMaybe<Scalars['String']['input']>;
|
|
582
586
|
/** Phone number */
|
|
@@ -1134,6 +1138,54 @@ export declare const CompensationType: {
|
|
|
1134
1138
|
readonly StoreCredit: "STORE_CREDIT";
|
|
1135
1139
|
};
|
|
1136
1140
|
export type CompensationType = typeof CompensationType[keyof typeof CompensationType];
|
|
1141
|
+
export type ConfiguratorField = {
|
|
1142
|
+
/** Optional help text shown beneath the field. */
|
|
1143
|
+
description?: Maybe<Scalars['String']['output']>;
|
|
1144
|
+
/** Who provides the value — CUSTOMER (the shopper fills it in) or BOTH (seller sets a default the shopper can change). Seller-only metadata fields are not returned here. */
|
|
1145
|
+
filledBy: AttributeFillingMode;
|
|
1146
|
+
/** URL-friendly key for the field. */
|
|
1147
|
+
handle: Scalars['String']['output'];
|
|
1148
|
+
/** Stable identifier of this field. */
|
|
1149
|
+
id: Scalars['ID']['output'];
|
|
1150
|
+
/** Whether this field should be shown on the storefront. */
|
|
1151
|
+
isVisible: Scalars['Boolean']['output'];
|
|
1152
|
+
/** Upper bound — maximum value (NUMBER) or maximum length (TEXT). */
|
|
1153
|
+
maxValue?: Maybe<Scalars['Float']['output']>;
|
|
1154
|
+
/** Lower bound — minimum value (NUMBER) or minimum length (TEXT). */
|
|
1155
|
+
minValue?: Maybe<Scalars['Float']['output']>;
|
|
1156
|
+
/** Field label shown to the shopper (e.g. "Finish"). */
|
|
1157
|
+
name: Scalars['String']['output'];
|
|
1158
|
+
/** Selectable choices for SELECT / RADIO / CHECKBOX fields; empty for free-input types (TEXT, NUMBER, …). */
|
|
1159
|
+
options: Array<ConfiguratorOption>;
|
|
1160
|
+
/** If a choice adds cost, how it is billed — BUNDLED (folded into the product price) or SEPARATE_LINE (its own order line). Null when the field has no price impact. */
|
|
1161
|
+
pricingMode?: Maybe<AttributeBillingMode>;
|
|
1162
|
+
/** Whether the shopper must provide a value before adding the product to the cart. */
|
|
1163
|
+
required: Scalars['Boolean']['output'];
|
|
1164
|
+
/** Order in which to render this field. */
|
|
1165
|
+
sortOrder: Scalars['Int']['output'];
|
|
1166
|
+
/** Input type — controls how to render the field (TEXT, TEXTAREA, SELECT, RADIO, CHECKBOX, NUMBER, COLOR, …). */
|
|
1167
|
+
type: AttributeType;
|
|
1168
|
+
};
|
|
1169
|
+
export type ConfiguratorOption = {
|
|
1170
|
+
/** Hex colour for swatch rendering (COLOR fields). */
|
|
1171
|
+
colorHex?: Maybe<Scalars['String']['output']>;
|
|
1172
|
+
/** Stable identifier of this choice. */
|
|
1173
|
+
id: Scalars['ID']['output'];
|
|
1174
|
+
/** Whether this choice is pre-selected by default. */
|
|
1175
|
+
isDefault: Scalars['Boolean']['output'];
|
|
1176
|
+
/** Human-readable label shown to the shopper. */
|
|
1177
|
+
label: Scalars['String']['output'];
|
|
1178
|
+
/** The stocked variant this choice maps to (used for inventory-backed components). Null when the choice maps to no variant or the variant no longer exists. */
|
|
1179
|
+
linkedVariant?: Maybe<LinkedVariantSummary>;
|
|
1180
|
+
/** Order in which to render this choice. */
|
|
1181
|
+
sortOrder: Scalars['Int']['output'];
|
|
1182
|
+
/** Extra charge applied when this choice is selected. With surchargeType FIXED it is an amount in minor currency units (e.g. 500 = 5.00). With PERCENT it is thousandths of a percent (e.g. 1500 = 1.5%). */
|
|
1183
|
+
surchargeAmount?: Maybe<Scalars['Int']['output']>;
|
|
1184
|
+
/** How to interpret surchargeAmount — FIXED (a money amount) or PERCENT. */
|
|
1185
|
+
surchargeType?: Maybe<AttributeOptionSurchargeType>;
|
|
1186
|
+
/** Machine value (slug-style) — use it for form state and when submitting the choice to the cart. */
|
|
1187
|
+
value: Scalars['String']['output'];
|
|
1188
|
+
};
|
|
1137
1189
|
export declare const ContentFormat: {
|
|
1138
1190
|
readonly Html: "HTML";
|
|
1139
1191
|
readonly Markdown: "MARKDOWN";
|
|
@@ -2161,6 +2213,8 @@ export declare const LoyaltyTransactionType: {
|
|
|
2161
2213
|
};
|
|
2162
2214
|
export type LoyaltyTransactionType = typeof LoyaltyTransactionType[keyof typeof LoyaltyTransactionType];
|
|
2163
2215
|
export type MailingAddress = Node & {
|
|
2216
|
+
/** Building / house number as a discrete field, overlaid on `streetLine1`. Populated for structured addresses (required for PL delivery / billing without a pickup point); null when only the free-form `streetLine1` was provided. */
|
|
2217
|
+
buildingNumber?: Maybe<Scalars['String']['output']>;
|
|
2164
2218
|
/** City / town. */
|
|
2165
2219
|
city?: Maybe<Scalars['String']['output']>;
|
|
2166
2220
|
/** Company name (relevant for B2B addresses). */
|
|
@@ -2171,6 +2225,8 @@ export type MailingAddress = Node & {
|
|
|
2171
2225
|
countryCode?: Maybe<CountryCode>;
|
|
2172
2226
|
/** Buyer first name. */
|
|
2173
2227
|
firstName?: Maybe<Scalars['String']['output']>;
|
|
2228
|
+
/** Flat / apartment number as a discrete field — optional companion to `buildingNumber`. */
|
|
2229
|
+
flatNumber?: Maybe<Scalars['String']['output']>;
|
|
2174
2230
|
/** Country-aware ordered address lines, ready to render line by line in UI without manual formatting. The exact line layout depends on country (e.g. PL puts postal code before city, US after state). */
|
|
2175
2231
|
formatted: Array<Scalars['String']['output']>;
|
|
2176
2232
|
/** Single-line summary of the area, e.g. "Warszawa, MZ, Poland". Useful for compact display in lists. */
|
|
@@ -2743,10 +2799,8 @@ export type PricingTier = {
|
|
|
2743
2799
|
unitPrice: Money;
|
|
2744
2800
|
};
|
|
2745
2801
|
export type Product = Node & {
|
|
2746
|
-
/**
|
|
2747
|
-
|
|
2748
|
-
/** Customer-facing product attributes (configurator) — set definitions + per-product scoped */
|
|
2749
|
-
attributes: Array<ProductAttributeDefinition>;
|
|
2802
|
+
/** This product's stored custom-field values — merchant-managed metadata such as manufacturer, licence, material or EAN. Only fields the merchant marked visible are returned. Pass `namespace` to fetch a single group. */
|
|
2803
|
+
attributes: Array<EntityAttributeField>;
|
|
2750
2804
|
/** Average rating (1-5) */
|
|
2751
2805
|
averageRating?: Maybe<Scalars['Float']['output']>;
|
|
2752
2806
|
/** Canonical brand entity. Resolved via DataLoader (N+1 safe for list queries). Null when the product has no assigned brand. */
|
|
@@ -2757,6 +2811,8 @@ export type Product = Node & {
|
|
|
2757
2811
|
compareAtPriceRange?: Maybe<ProductPriceRange>;
|
|
2758
2812
|
/** Opt-in: compare-at price range with conversion transparency. */
|
|
2759
2813
|
compareAtPriceRangeWithConversion?: Maybe<ConvertedPriceRange>;
|
|
2814
|
+
/** Configurable fields shown on the product page for the shopper to fill in or choose (combines shared template fields and product-specific ones). Pass `{ filledBy: CUSTOMER }` to return only the fields a shopper can edit. */
|
|
2815
|
+
configuratorFields: Array<ConfiguratorField>;
|
|
2760
2816
|
/** Creation timestamp */
|
|
2761
2817
|
createdAt: Scalars['DateTime']['output'];
|
|
2762
2818
|
/** Plain text description */
|
|
@@ -2806,60 +2862,6 @@ export type Product = Node & {
|
|
|
2806
2862
|
/** Catalog visibility — PUBLIC | HIDDEN | BUNDLE_ONLY */
|
|
2807
2863
|
visibility: ProductVisibility;
|
|
2808
2864
|
};
|
|
2809
|
-
export type ProductAttributeDefinition = {
|
|
2810
|
-
/** Billing mode — BUNDLED | SEPARATE_LINE; null = informational only */
|
|
2811
|
-
billingMode?: Maybe<AttributeBillingMode>;
|
|
2812
|
-
/** Customer-facing description */
|
|
2813
|
-
description?: Maybe<Scalars['String']['output']>;
|
|
2814
|
-
/** Display order */
|
|
2815
|
-
displayOrder: Scalars['Int']['output'];
|
|
2816
|
-
/** Filling mode — MERCHANT | CUSTOMER | BOTH */
|
|
2817
|
-
fillingMode: AttributeFillingMode;
|
|
2818
|
-
/** URL-friendly handle */
|
|
2819
|
-
handle: Scalars['String']['output'];
|
|
2820
|
-
/** Definition ID */
|
|
2821
|
-
id: Scalars['ID']['output'];
|
|
2822
|
-
/** Required validation flag */
|
|
2823
|
-
isRequired: Scalars['Boolean']['output'];
|
|
2824
|
-
/** Visibility flag */
|
|
2825
|
-
isVisible: Scalars['Boolean']['output'];
|
|
2826
|
-
/** Max value (NUMBER) / max length (TEXT) */
|
|
2827
|
-
maxValue?: Maybe<Scalars['Float']['output']>;
|
|
2828
|
-
/** Min value (NUMBER) / min length (TEXT) */
|
|
2829
|
-
minValue?: Maybe<Scalars['Float']['output']>;
|
|
2830
|
-
/** Field name (e.g. "Finiszer") */
|
|
2831
|
-
name: Scalars['String']['output'];
|
|
2832
|
-
/** Options for SELECT/RADIO/CHECKBOX types */
|
|
2833
|
-
options: Array<ProductAttributeOption>;
|
|
2834
|
-
/** Per-product scope — set to product ID for unique configurator fields, null for shared (in AttributeSet) */
|
|
2835
|
-
scopeProductId?: Maybe<Scalars['ID']['output']>;
|
|
2836
|
-
/** Tax class ID; null = inherit from variant */
|
|
2837
|
-
taxClassId?: Maybe<Scalars['ID']['output']>;
|
|
2838
|
-
/** Field type — TEXT/SELECT/RADIO/CHECKBOX/etc. */
|
|
2839
|
-
type: AttributeType;
|
|
2840
|
-
};
|
|
2841
|
-
export type ProductAttributeOption = {
|
|
2842
|
-
/** Hex color (for COLOR/SWATCH types) */
|
|
2843
|
-
colorHex?: Maybe<Scalars['String']['output']>;
|
|
2844
|
-
/** Option ID */
|
|
2845
|
-
id: Scalars['ID']['output'];
|
|
2846
|
-
/** Default option marker */
|
|
2847
|
-
isDefault: Scalars['Boolean']['output'];
|
|
2848
|
-
/** Display label shown to customer */
|
|
2849
|
-
label: Scalars['String']['output'];
|
|
2850
|
-
/** Summary of the linked ProductVariant. Null when the option has no linkedVariantId or the variant was deleted. */
|
|
2851
|
-
linkedVariant?: Maybe<LinkedVariantSummary>;
|
|
2852
|
-
/** Linked ProductVariant ID for component stock decrement (hidden-products pattern). */
|
|
2853
|
-
linkedVariantId?: Maybe<Scalars['ID']['output']>;
|
|
2854
|
-
/** Sort order */
|
|
2855
|
-
sortOrder: Scalars['Int']['output'];
|
|
2856
|
-
/** Surcharge amount when selected (FIXED = minor currency units; PERCENT = thousandths of percent). */
|
|
2857
|
-
surchargeAmount?: Maybe<Scalars['Int']['output']>;
|
|
2858
|
-
/** Surcharge type — FIXED | PERCENT. */
|
|
2859
|
-
surchargeType?: Maybe<AttributeOptionSurchargeType>;
|
|
2860
|
-
/** Internal value (slug-style) */
|
|
2861
|
-
value: Scalars['String']['output'];
|
|
2862
|
-
};
|
|
2863
2865
|
export type ProductConnection = {
|
|
2864
2866
|
/** Product edges with cursors */
|
|
2865
2867
|
edges: Array<ProductEdge>;
|