@reblu/site-contracts 1.8.0 → 1.9.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 +21 -0
- package/README.md +19 -0
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @reblu/site-contracts
|
|
2
2
|
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- cc0ce0c: Add `ShopConfig.productTrustItems` (REB-858): store-wide product trust items,
|
|
8
|
+
optional `ShopProductTrustItem[] | null`, in the owner's display order. New
|
|
9
|
+
exported types `ShopProductTrustIcon` (the icons known today: `shipping |
|
|
10
|
+
returns | secure-payment | support | gift | pickup | warranty | quality`) and
|
|
11
|
+
`ShopProductTrustItem` (`{ icon: ShopProductTrustIcon | (string & {}); text:
|
|
12
|
+
string }`, open to extra keys).
|
|
13
|
+
|
|
14
|
+
The item shape is forward-compatible: a newer API may send an icon or an item
|
|
15
|
+
key this version does not know. Consumers must ignore items whose icon they
|
|
16
|
+
don't recognise (see the README).
|
|
17
|
+
|
|
18
|
+
Absent, `null` or `[]` all mean the SITE hides the block — no default items
|
|
19
|
+
are ever served. The API always emits the key (`null` when not configured);
|
|
20
|
+
it is optional in the type so the change is purely additive: existing typed
|
|
21
|
+
`ShopConfig` fixtures keep compiling, and a consumer on this version talking
|
|
22
|
+
to an older base-api (which does not emit the key) still validates.
|
|
23
|
+
|
|
3
24
|
## 1.8.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -113,6 +113,25 @@ longer offered as a choice for a new section in nexus. They will be removed
|
|
|
113
113
|
after 2027-01-31, once no tenant data uses them (REB-852) — this release does
|
|
114
114
|
not migrate existing data.
|
|
115
115
|
|
|
116
|
+
### Shop — product trust items (REB-858)
|
|
117
|
+
|
|
118
|
+
`ShopConfig.productTrustItems` is the store-wide list of short trust messages
|
|
119
|
+
(shipping, returns, secure payment…) the owner configures in nexus, in display
|
|
120
|
+
order. Absent, `null` or `[]` all mean **hide the block** — the API never
|
|
121
|
+
serves default items.
|
|
122
|
+
|
|
123
|
+
The shape is **forward-compatible** on purpose, so render it defensively:
|
|
124
|
+
|
|
125
|
+
- **Ignore any item whose `icon` you don't recognise.** `icon` is typed as
|
|
126
|
+
`ShopProductTrustIcon | (string & {})`: today's icons are `shipping`,
|
|
127
|
+
`returns`, `secure-payment`, `support`, `gift`, `pickup`, `warranty` and
|
|
128
|
+
`quality`, but a newer API may add more. Skip unknown icons; never fail on
|
|
129
|
+
them.
|
|
130
|
+
- **Ignore unknown item keys.** A newer API may add fields to an item.
|
|
131
|
+
- Don't rely on the count or length bounds in the response type: at most 6
|
|
132
|
+
items and 1–80 characters of text are nexus write rules, not wire
|
|
133
|
+
guarantees.
|
|
134
|
+
|
|
116
135
|
## How the types stay correct
|
|
117
136
|
|
|
118
137
|
The types are re-derived from the response schemas that live in the Reblu API
|
package/dist/index.d.cts
CHANGED
|
@@ -157,7 +157,7 @@ export type ShopCheckoutInput = { items: { productId: string; q
|
|
|
157
157
|
|
|
158
158
|
export type ShopCheckoutSession = { url: string; sessionId: string;}
|
|
159
159
|
|
|
160
|
-
export type ShopConfig = { shopName: string | null; defaultLowStockThreshold: number; currencyCode: string; stripePublishableKey: string | null; stripeTestPublishableKey: string | null; stripeTestMode: boolean; shippingEnabled: boolean; pickupEnabled: boolean; taxEnabled: boolean; taxIncludedInPrice: boolean;}
|
|
160
|
+
export type ShopConfig = { shopName: string | null; defaultLowStockThreshold: number; currencyCode: string; stripePublishableKey: string | null; stripeTestPublishableKey: string | null; stripeTestMode: boolean; shippingEnabled: boolean; pickupEnabled: boolean; taxEnabled: boolean; taxIncludedInPrice: boolean; productTrustItems?: { [x: string]: unknown; icon: (string & {}) | "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"; text: string; }[] | null | undefined;}
|
|
161
161
|
|
|
162
162
|
export type ShopDiscountApplication = { valid: boolean; discount: number; type: "PERCENTAGE" | "FIXED" | null; code: string | null; error?: string | undefined;}
|
|
163
163
|
|
|
@@ -185,6 +185,10 @@ export type ShopProductListItem = { id: string; slug: string; name: str
|
|
|
185
185
|
|
|
186
186
|
export type ShopProductListParams = { page?: number | undefined; limit?: number | undefined; q?: string | undefined; sort?: "price_asc" | "price_desc" | "newest" | "on_sale" | undefined; category?: string | undefined; priceMin?: number | undefined; priceMax?: number | undefined; onSale?: boolean | undefined; taxonomy?: Record<string, string> | undefined; attr?: Record<string, string | string[]> | undefined;}
|
|
187
187
|
|
|
188
|
+
export type ShopProductTrustIcon = "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"
|
|
189
|
+
|
|
190
|
+
export type ShopProductTrustItem = { [x: string]: unknown; icon: (string & {}) | "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"; text: string;}
|
|
191
|
+
|
|
188
192
|
export type ShopProductVariant = { id: string; name: string; sku: string | null; price: number | null; attributes: unknown; isActive: boolean; sortOrder: number;}
|
|
189
193
|
|
|
190
194
|
export type ShopProductVideo = { url: string; title: string | null; isExternal: boolean; thumbnailUrl: string | null; sortOrder: number;}
|
package/dist/index.d.ts
CHANGED
|
@@ -157,7 +157,7 @@ export type ShopCheckoutInput = { items: { productId: string; q
|
|
|
157
157
|
|
|
158
158
|
export type ShopCheckoutSession = { url: string; sessionId: string;}
|
|
159
159
|
|
|
160
|
-
export type ShopConfig = { shopName: string | null; defaultLowStockThreshold: number; currencyCode: string; stripePublishableKey: string | null; stripeTestPublishableKey: string | null; stripeTestMode: boolean; shippingEnabled: boolean; pickupEnabled: boolean; taxEnabled: boolean; taxIncludedInPrice: boolean;}
|
|
160
|
+
export type ShopConfig = { shopName: string | null; defaultLowStockThreshold: number; currencyCode: string; stripePublishableKey: string | null; stripeTestPublishableKey: string | null; stripeTestMode: boolean; shippingEnabled: boolean; pickupEnabled: boolean; taxEnabled: boolean; taxIncludedInPrice: boolean; productTrustItems?: { [x: string]: unknown; icon: (string & {}) | "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"; text: string; }[] | null | undefined;}
|
|
161
161
|
|
|
162
162
|
export type ShopDiscountApplication = { valid: boolean; discount: number; type: "PERCENTAGE" | "FIXED" | null; code: string | null; error?: string | undefined;}
|
|
163
163
|
|
|
@@ -185,6 +185,10 @@ export type ShopProductListItem = { id: string; slug: string; name: str
|
|
|
185
185
|
|
|
186
186
|
export type ShopProductListParams = { page?: number | undefined; limit?: number | undefined; q?: string | undefined; sort?: "price_asc" | "price_desc" | "newest" | "on_sale" | undefined; category?: string | undefined; priceMin?: number | undefined; priceMax?: number | undefined; onSale?: boolean | undefined; taxonomy?: Record<string, string> | undefined; attr?: Record<string, string | string[]> | undefined;}
|
|
187
187
|
|
|
188
|
+
export type ShopProductTrustIcon = "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"
|
|
189
|
+
|
|
190
|
+
export type ShopProductTrustItem = { [x: string]: unknown; icon: (string & {}) | "shipping" | "returns" | "secure-payment" | "support" | "gift" | "pickup" | "warranty" | "quality"; text: string;}
|
|
191
|
+
|
|
188
192
|
export type ShopProductVariant = { id: string; name: string; sku: string | null; price: number | null; attributes: unknown; isActive: boolean; sortOrder: number;}
|
|
189
193
|
|
|
190
194
|
export type ShopProductVideo = { url: string; title: string | null; isExternal: boolean; thumbnailUrl: string | null; sortOrder: number;}
|
package/package.json
CHANGED