@reblu/site-contracts 1.3.0 → 1.5.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,28 @@
1
1
  # @reblu/site-contracts
2
2
 
3
+ ## 1.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 74a94ff: Add the order-lookup contract (REB-829). `ShopOrder`/`ShopOrderItem` type the
8
+ `GET /api/site/shop/order/[sessionId]` response — the order-confirmation
9
+ flow's missing piece: every SITE previously hand-rolled a local type for it
10
+ (demo-site's own comment: "base-api /api/site/shop/order is not yet in the
11
+ SDK surface"). `@reblu/site-client`'s `shop.order(sessionId)` reads it.
12
+
13
+ ## 1.4.0
14
+
15
+ ### Minor Changes
16
+
17
+ - 87b7fa0: Add typed `Config.openingHours` (REB-826): `ConfigOpeningHours`,
18
+ `ConfigOpeningHoursRange`, `ConfigOpeningHoursDay`.
19
+
20
+ Additive: a new optional-shaped (`null` when not configured) field on the
21
+ existing `Config` type. A SITE build that has not migrated its `Config` type
22
+ yet keeps working unchanged — the extra field is simply ignored at runtime.
23
+ Replaces the previous untyped convention of stashing opening hours inside
24
+ `Config.metadata`.
25
+
3
26
  ## 1.3.0
4
27
 
5
28
  ### Minor Changes
package/dist/index.d.cts CHANGED
@@ -39,7 +39,7 @@ export type BlogSlug = { slug: string; updatedAt: string;}
39
39
 
40
40
  export type BlogTag = { id: string; name: string; slug: string; color: string;}
41
41
 
42
- export type Config = { siteName: string; siteDescription: string | null; language: string | null; contactEmail: string | null; keywords: string[]; businessType: string | null; isSetupComplete: boolean; logoLightExpandedUrl: string | null; logoDarkExpandedUrl: string | null; logoLightSmallUrl: string | null; logoDarkSmallUrl: string | null; ogImageUrl: string | null; owner: { name: string | null; email: string | null; jobTitle: string | null; }; business: { name: string | null; }; address: { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null; } | null; fiscal: { taxId: string | null; taxIdKind: "NIF" | "CIF" | null; legalName: string | null; registry: { name: string; number: string; } | null; } | null; social: { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null; } | null; metadata: unknown; contactFormMode: "NOT_CONFIGURED" | "DISABLED" | "DB_ONLY" | "WEBHOOK" | "RESEND"; features: Record<string, unknown>;}
42
+ export type Config = { siteName: string; siteDescription: string | null; language: string | null; contactEmail: string | null; keywords: string[]; businessType: string | null; isSetupComplete: boolean; logoLightExpandedUrl: string | null; logoDarkExpandedUrl: string | null; logoLightSmallUrl: string | null; logoDarkSmallUrl: string | null; ogImageUrl: string | null; owner: { name: string | null; email: string | null; jobTitle: string | null; }; business: { name: string | null; }; address: { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null; } | null; fiscal: { taxId: string | null; taxIdKind: "NIF" | "CIF" | null; legalName: string | null; registry: { name: string; number: string; } | null; } | null; social: { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null; } | null; metadata: unknown; openingHours: { ranges: { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string; }[]; note?: string | undefined; } | null; contactFormMode: "NOT_CONFIGURED" | "DISABLED" | "DB_ONLY" | "WEBHOOK" | "RESEND"; features: Record<string, unknown>;}
43
43
 
44
44
  export type ConfigAddress = { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null;}
45
45
 
@@ -47,6 +47,12 @@ export type ConfigFiscal = { taxId: string | null; taxIdKind: "NIF" | "CIF
47
47
 
48
48
  export type ConfigFiscalRegistry = { name: string; number: string;}
49
49
 
50
+ export type ConfigOpeningHours = { ranges: { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string; }[]; note?: string | undefined;}
51
+
52
+ export type ConfigOpeningHoursDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"
53
+
54
+ export type ConfigOpeningHoursRange = { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string;}
55
+
50
56
  export type ConfigSocial = { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null;}
51
57
 
52
58
  export type ConfigTaxIdKind = "NIF" | "CIF"
@@ -149,6 +155,10 @@ export type ShopFacets = { taxonomies: { key: string; label: st
149
155
 
150
156
  export type ShopInventoryRef = { stockQuantity: number; reservedQuantity: number; lowStockThreshold: number | null;}
151
157
 
158
+ export type ShopOrder = { id: string; orderNumber: string; status: "PENDING" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED" | "CANCELLED" | "REFUNDED"; paymentStatus: "PENDING" | "REFUNDED" | "PAID" | "FAILED" | "PARTIALLY_REFUNDED"; customerEmail: string; total: number; items: { product: { id: string; name: string; slug: string; }; quantity: number; unitPrice: number; total: number; variant?: { id: string; name: string; } | null | undefined; }[];}
159
+
160
+ export type ShopOrderItem = { product: { id: string; name: string; slug: string; }; quantity: number; unitPrice: number; total: number; variant?: { id: string; name: string; } | null | undefined;}
161
+
152
162
  export type ShopProductAttributes = unknown
153
163
 
154
164
  export type ShopProductCategoryRef = { id: string; name: string; slug: string;}
package/dist/index.d.ts CHANGED
@@ -39,7 +39,7 @@ export type BlogSlug = { slug: string; updatedAt: string;}
39
39
 
40
40
  export type BlogTag = { id: string; name: string; slug: string; color: string;}
41
41
 
42
- export type Config = { siteName: string; siteDescription: string | null; language: string | null; contactEmail: string | null; keywords: string[]; businessType: string | null; isSetupComplete: boolean; logoLightExpandedUrl: string | null; logoDarkExpandedUrl: string | null; logoLightSmallUrl: string | null; logoDarkSmallUrl: string | null; ogImageUrl: string | null; owner: { name: string | null; email: string | null; jobTitle: string | null; }; business: { name: string | null; }; address: { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null; } | null; fiscal: { taxId: string | null; taxIdKind: "NIF" | "CIF" | null; legalName: string | null; registry: { name: string; number: string; } | null; } | null; social: { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null; } | null; metadata: unknown; contactFormMode: "NOT_CONFIGURED" | "DISABLED" | "DB_ONLY" | "WEBHOOK" | "RESEND"; features: Record<string, unknown>;}
42
+ export type Config = { siteName: string; siteDescription: string | null; language: string | null; contactEmail: string | null; keywords: string[]; businessType: string | null; isSetupComplete: boolean; logoLightExpandedUrl: string | null; logoDarkExpandedUrl: string | null; logoLightSmallUrl: string | null; logoDarkSmallUrl: string | null; ogImageUrl: string | null; owner: { name: string | null; email: string | null; jobTitle: string | null; }; business: { name: string | null; }; address: { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null; } | null; fiscal: { taxId: string | null; taxIdKind: "NIF" | "CIF" | null; legalName: string | null; registry: { name: string; number: string; } | null; } | null; social: { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null; } | null; metadata: unknown; openingHours: { ranges: { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string; }[]; note?: string | undefined; } | null; contactFormMode: "NOT_CONFIGURED" | "DISABLED" | "DB_ONLY" | "WEBHOOK" | "RESEND"; features: Record<string, unknown>;}
43
43
 
44
44
  export type ConfigAddress = { street: string | null; city: string | null; region: string | null; postalCode: string | null; country: string | null; telephone: string | null; lat: number | null; lng: number | null;}
45
45
 
@@ -47,6 +47,12 @@ export type ConfigFiscal = { taxId: string | null; taxIdKind: "NIF" | "CIF
47
47
 
48
48
  export type ConfigFiscalRegistry = { name: string; number: string;}
49
49
 
50
+ export type ConfigOpeningHours = { ranges: { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string; }[]; note?: string | undefined;}
51
+
52
+ export type ConfigOpeningHoursDay = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"
53
+
54
+ export type ConfigOpeningHoursRange = { days: ("MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN")[]; opens: string; closes: string;}
55
+
50
56
  export type ConfigSocial = { linkedin: string | null; twitter: string | null; facebook: string | null; instagram: string | null; youtube: string | null;}
51
57
 
52
58
  export type ConfigTaxIdKind = "NIF" | "CIF"
@@ -149,6 +155,10 @@ export type ShopFacets = { taxonomies: { key: string; label: st
149
155
 
150
156
  export type ShopInventoryRef = { stockQuantity: number; reservedQuantity: number; lowStockThreshold: number | null;}
151
157
 
158
+ export type ShopOrder = { id: string; orderNumber: string; status: "PENDING" | "CONFIRMED" | "PROCESSING" | "SHIPPED" | "DELIVERED" | "CANCELLED" | "REFUNDED"; paymentStatus: "PENDING" | "REFUNDED" | "PAID" | "FAILED" | "PARTIALLY_REFUNDED"; customerEmail: string; total: number; items: { product: { id: string; name: string; slug: string; }; quantity: number; unitPrice: number; total: number; variant?: { id: string; name: string; } | null | undefined; }[];}
159
+
160
+ export type ShopOrderItem = { product: { id: string; name: string; slug: string; }; quantity: number; unitPrice: number; total: number; variant?: { id: string; name: string; } | null | undefined;}
161
+
152
162
  export type ShopProductAttributes = unknown
153
163
 
154
164
  export type ShopProductCategoryRef = { id: string; name: string; slug: string;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reblu/site-contracts",
3
- "version": "1.3.0",
3
+ "version": "1.5.0",
4
4
  "private": false,
5
5
  "description": "Public, dependency-free TypeScript types for the Reblu SITE API (types only — no Zod, no Prisma at runtime).",
6
6
  "license": "Apache-2.0",