@reblu/site-contracts 1.13.0 → 1.14.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 +7 -0
- package/README.md +7 -0
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @reblu/site-contracts
|
|
2
2
|
|
|
3
|
+
## 1.14.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 92e0f6f: Add the `header` slot to `Cta['slot']` (`'header' | 'hero' | 'blog-end' | 'services' | 'contact' | 'sticky-mobile' | 'footer'`), so a SITE can drive its persistent header CTA from nexus via `GET /api/site/ctas?slot=header`.
|
|
8
|
+
- b75f066: Deprecate `ShopCheckEmailInput` and `ShopEmailCheck` (REB-834). `POST /api/site/shop/check-email` was an account-enumeration oracle on the tenant's customer list; it now always answers `{ exists: false }`. Never branch UI on `exists`. Both types are removed in the next major.
|
|
9
|
+
|
|
3
10
|
## 1.13.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -30,6 +30,13 @@ async function getPosts(): Promise<{ data: BlogPostListItem[] }> {
|
|
|
30
30
|
Pair it with `@reblu/site-client` for a typed client that already knows these
|
|
31
31
|
shapes.
|
|
32
32
|
|
|
33
|
+
### Editable CTAs — slots
|
|
34
|
+
|
|
35
|
+
`Cta['slot']` is the union of placements a CTA can be configured for in nexus:
|
|
36
|
+
`'header' | 'hero' | 'blog-end' | 'services' | 'contact' | 'sticky-mobile' |
|
|
37
|
+
'footer'`. `GET /api/site/ctas?slot=header` returns the active CTAs of the
|
|
38
|
+
persistent header; `@reblu/site-next`'s `EditableCta` renders them drop-in.
|
|
39
|
+
|
|
33
40
|
### Page blocks — canonical shape (REB-849 / REB-851 / REB-852 / REB-854)
|
|
34
41
|
|
|
35
42
|
`GET /api/site/pages/[slug]` (`PageDetail`) returns BOTH `sections[]` (legacy,
|
package/dist/index.d.cts
CHANGED
|
@@ -71,7 +71,7 @@ export type ContactFormSubmission = { id: string; createdAt: string;}
|
|
|
71
71
|
|
|
72
72
|
export type CookieBanner = { enabled: boolean; title: string | null; body: string | null; acceptLabel: string | null; rejectLabel: string | null; manageLabel: string | null; policyUrl: string | null;}
|
|
73
73
|
|
|
74
|
-
export type Cta = { id: string; slot: "hero" | "blog-end" | "services" | "contact" | "sticky-mobile" | "footer"; label: string; href: string; sortOrder: number; abVariant: string | null; analyticsId: string;}
|
|
74
|
+
export type Cta = { id: string; slot: "header" | "hero" | "blog-end" | "services" | "contact" | "sticky-mobile" | "footer"; label: string; href: string; sortOrder: number; abVariant: string | null; analyticsId: string;}
|
|
75
75
|
|
|
76
76
|
export type CustomFieldDefinition = { id: string; entityType: "page" | "product"; key: string; label: string; valueType: "boolean" | "text" | "select" | "multiselect"; options: { value: string; label: string; }[]; isFilterable: boolean; showInDetail: boolean; unit: string | null; sortOrder: number;}
|
|
77
77
|
|
|
@@ -159,6 +159,10 @@ export type ShopCartValidationItem = { productId: string; name: string;
|
|
|
159
159
|
|
|
160
160
|
export type ShopCategory = { id: string; name: string; slug: string; description: string | null; imageUrl: string | null; parentId: string | null; sortOrder: number;}
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated REB-834 — `POST /api/site/shop/check-email` no longer reveals
|
|
164
|
+
* whether an account exists. Do not call it; removed in the next major.
|
|
165
|
+
*/
|
|
162
166
|
export type ShopCheckEmailInput = { email: string;}
|
|
163
167
|
|
|
164
168
|
export type ShopCheckoutInput = { items: { productId: string; quantity: number; variantId?: string | null | undefined; }[]; customerEmail: string; customerName: string; successUrl: string; cancelUrl: string; customerPhone?: string | null | undefined; discountCode?: string | undefined; shippingAddress?: { firstName: string; lastName: string; street: string; city: string; postalCode: string; region?: string | undefined; country?: string | undefined; phone?: string | null | undefined; } | undefined; billing?: { billingName: string; billingNif?: string | undefined; billingEmail?: string | undefined; billingAddress?: { firstName: string; lastName: string; street: string; city: string; postalCode: string; region?: string | undefined; country?: string | undefined; phone?: string | null | undefined; } | undefined; } | undefined;}
|
|
@@ -169,6 +173,12 @@ export type ShopConfig = { shopName: string | null; defaultLowStockThresho
|
|
|
169
173
|
|
|
170
174
|
export type ShopDiscountApplication = { valid: boolean; discount: number; type: "PERCENTAGE" | "FIXED" | null; code: string | null; error?: string | undefined;}
|
|
171
175
|
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated REB-834 — `exists` is always `false`. Never branch UI on it:
|
|
178
|
+
* the checkout always offers «Iniciar sesión o continuar como invitado» and
|
|
179
|
+
* the server links the order to an existing account after payment. Removed
|
|
180
|
+
* in the next major.
|
|
181
|
+
*/
|
|
172
182
|
export type ShopEmailCheck = { exists: boolean;}
|
|
173
183
|
|
|
174
184
|
export type ShopErrorCode = "STOCK_CHANGED" | "PRICE_CHANGED" | "PRODUCT_UNAVAILABLE" | "DISCOUNT_INVALID" | "SHIPPING_UNAVAILABLE" | "INVALID_INPUT" | "STORE_DISABLED" | "PAYMENT_PROVIDER_ERROR" | "INTERNAL_ERROR"
|
package/dist/index.d.ts
CHANGED
|
@@ -71,7 +71,7 @@ export type ContactFormSubmission = { id: string; createdAt: string;}
|
|
|
71
71
|
|
|
72
72
|
export type CookieBanner = { enabled: boolean; title: string | null; body: string | null; acceptLabel: string | null; rejectLabel: string | null; manageLabel: string | null; policyUrl: string | null;}
|
|
73
73
|
|
|
74
|
-
export type Cta = { id: string; slot: "hero" | "blog-end" | "services" | "contact" | "sticky-mobile" | "footer"; label: string; href: string; sortOrder: number; abVariant: string | null; analyticsId: string;}
|
|
74
|
+
export type Cta = { id: string; slot: "header" | "hero" | "blog-end" | "services" | "contact" | "sticky-mobile" | "footer"; label: string; href: string; sortOrder: number; abVariant: string | null; analyticsId: string;}
|
|
75
75
|
|
|
76
76
|
export type CustomFieldDefinition = { id: string; entityType: "page" | "product"; key: string; label: string; valueType: "boolean" | "text" | "select" | "multiselect"; options: { value: string; label: string; }[]; isFilterable: boolean; showInDetail: boolean; unit: string | null; sortOrder: number;}
|
|
77
77
|
|
|
@@ -159,6 +159,10 @@ export type ShopCartValidationItem = { productId: string; name: string;
|
|
|
159
159
|
|
|
160
160
|
export type ShopCategory = { id: string; name: string; slug: string; description: string | null; imageUrl: string | null; parentId: string | null; sortOrder: number;}
|
|
161
161
|
|
|
162
|
+
/**
|
|
163
|
+
* @deprecated REB-834 — `POST /api/site/shop/check-email` no longer reveals
|
|
164
|
+
* whether an account exists. Do not call it; removed in the next major.
|
|
165
|
+
*/
|
|
162
166
|
export type ShopCheckEmailInput = { email: string;}
|
|
163
167
|
|
|
164
168
|
export type ShopCheckoutInput = { items: { productId: string; quantity: number; variantId?: string | null | undefined; }[]; customerEmail: string; customerName: string; successUrl: string; cancelUrl: string; customerPhone?: string | null | undefined; discountCode?: string | undefined; shippingAddress?: { firstName: string; lastName: string; street: string; city: string; postalCode: string; region?: string | undefined; country?: string | undefined; phone?: string | null | undefined; } | undefined; billing?: { billingName: string; billingNif?: string | undefined; billingEmail?: string | undefined; billingAddress?: { firstName: string; lastName: string; street: string; city: string; postalCode: string; region?: string | undefined; country?: string | undefined; phone?: string | null | undefined; } | undefined; } | undefined;}
|
|
@@ -169,6 +173,12 @@ export type ShopConfig = { shopName: string | null; defaultLowStockThresho
|
|
|
169
173
|
|
|
170
174
|
export type ShopDiscountApplication = { valid: boolean; discount: number; type: "PERCENTAGE" | "FIXED" | null; code: string | null; error?: string | undefined;}
|
|
171
175
|
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated REB-834 — `exists` is always `false`. Never branch UI on it:
|
|
178
|
+
* the checkout always offers «Iniciar sesión o continuar como invitado» and
|
|
179
|
+
* the server links the order to an existing account after payment. Removed
|
|
180
|
+
* in the next major.
|
|
181
|
+
*/
|
|
172
182
|
export type ShopEmailCheck = { exists: boolean;}
|
|
173
183
|
|
|
174
184
|
export type ShopErrorCode = "STOCK_CHANGED" | "PRICE_CHANGED" | "PRODUCT_UNAVAILABLE" | "DISCOUNT_INVALID" | "SHIPPING_UNAVAILABLE" | "INVALID_INPUT" | "STORE_DISABLED" | "PAYMENT_PROVIDER_ERROR" | "INTERNAL_ERROR"
|
package/package.json
CHANGED