@vitrine-kit/contracts 1.2.2 → 1.3.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/dist/index.cjs CHANGED
@@ -240,6 +240,11 @@ var themeSchema = import_zod3.z.object({
240
240
  var siteConfigSchema = import_zod3.z.object({
241
241
  backend: backendSchema,
242
242
  tier: tierSchema,
243
+ /**
244
+ * Storefront display name (header, metadata, footer). Set by `vitrine init`
245
+ * from the project name; optional for older clients.
246
+ */
247
+ name: import_zod3.z.string().min(1).optional(),
243
248
  /** Feature flags: { 'reviews': true }. Set by the install primitive. */
244
249
  features: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.boolean()).default({}),
245
250
  layout: import_zod3.z.object({ sections: import_zod3.z.array(layoutSectionSchema).default([]) }).default({ sections: [] }),
package/dist/index.d.cts CHANGED
@@ -109,6 +109,15 @@ interface ProductQuery {
109
109
  perPage?: number;
110
110
  /** Filter facets: { color: ['red','blue'], size: ['M'] }. */
111
111
  filters?: Record<string, string[]>;
112
+ /** Inclusive lower bound on variant/list price (minor units, e.g. cents). */
113
+ priceMin?: number;
114
+ /** Inclusive upper bound on variant/list price (minor units, e.g. cents). */
115
+ priceMax?: number;
116
+ /**
117
+ * CMS / storefront locale (path cookie or explicit). Adapters that support
118
+ * localized fields pass this through to the backend; others ignore it.
119
+ */
120
+ locale?: string;
112
121
  }
113
122
  interface CartLine {
114
123
  id: string;
@@ -156,9 +165,10 @@ interface Order {
156
165
  */
157
166
  interface CatalogSource {
158
167
  listProducts(query: ProductQuery): Promise<Product[]>;
159
- getProduct(slug: string): Promise<Product | null>;
160
- listCategories(): Promise<Category[]>;
161
- search(term: string): Promise<Product[]>;
168
+ /** Optional locale selects localized CMS fields when the backend supports them. */
169
+ getProduct(slug: string, locale?: string): Promise<Product | null>;
170
+ listCategories(locale?: string): Promise<Category[]>;
171
+ search(term: string, locale?: string): Promise<Product[]>;
162
172
  }
163
173
  /**
164
174
  * Commerce backend. Only simple-store / full-store.
@@ -278,6 +288,11 @@ declare const themeSchema: z.ZodDefault<z.ZodObject<{
278
288
  declare const siteConfigSchema: z.ZodObject<{
279
289
  backend: z.ZodEnum<["payload", "vendure"]>;
280
290
  tier: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
291
+ /**
292
+ * Storefront display name (header, metadata, footer). Set by `vitrine init`
293
+ * from the project name; optional for older clients.
294
+ */
295
+ name: z.ZodOptional<z.ZodString>;
281
296
  /** Feature flags: { 'reviews': true }. Set by the install primitive. */
282
297
  features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
283
298
  layout: z.ZodDefault<z.ZodObject<{
@@ -382,9 +397,11 @@ declare const siteConfigSchema: z.ZodObject<{
382
397
  currency: string;
383
398
  priceFormat?: string | undefined;
384
399
  };
400
+ name?: string | undefined;
385
401
  }, {
386
402
  backend: "payload" | "vendure";
387
403
  tier: "catalog" | "simple-store" | "full-store";
404
+ name?: string | undefined;
388
405
  features?: Record<string, boolean> | undefined;
389
406
  layout?: {
390
407
  sections?: {
package/dist/index.d.ts CHANGED
@@ -109,6 +109,15 @@ interface ProductQuery {
109
109
  perPage?: number;
110
110
  /** Filter facets: { color: ['red','blue'], size: ['M'] }. */
111
111
  filters?: Record<string, string[]>;
112
+ /** Inclusive lower bound on variant/list price (minor units, e.g. cents). */
113
+ priceMin?: number;
114
+ /** Inclusive upper bound on variant/list price (minor units, e.g. cents). */
115
+ priceMax?: number;
116
+ /**
117
+ * CMS / storefront locale (path cookie or explicit). Adapters that support
118
+ * localized fields pass this through to the backend; others ignore it.
119
+ */
120
+ locale?: string;
112
121
  }
113
122
  interface CartLine {
114
123
  id: string;
@@ -156,9 +165,10 @@ interface Order {
156
165
  */
157
166
  interface CatalogSource {
158
167
  listProducts(query: ProductQuery): Promise<Product[]>;
159
- getProduct(slug: string): Promise<Product | null>;
160
- listCategories(): Promise<Category[]>;
161
- search(term: string): Promise<Product[]>;
168
+ /** Optional locale selects localized CMS fields when the backend supports them. */
169
+ getProduct(slug: string, locale?: string): Promise<Product | null>;
170
+ listCategories(locale?: string): Promise<Category[]>;
171
+ search(term: string, locale?: string): Promise<Product[]>;
162
172
  }
163
173
  /**
164
174
  * Commerce backend. Only simple-store / full-store.
@@ -278,6 +288,11 @@ declare const themeSchema: z.ZodDefault<z.ZodObject<{
278
288
  declare const siteConfigSchema: z.ZodObject<{
279
289
  backend: z.ZodEnum<["payload", "vendure"]>;
280
290
  tier: z.ZodEnum<["catalog", "simple-store", "full-store"]>;
291
+ /**
292
+ * Storefront display name (header, metadata, footer). Set by `vitrine init`
293
+ * from the project name; optional for older clients.
294
+ */
295
+ name: z.ZodOptional<z.ZodString>;
281
296
  /** Feature flags: { 'reviews': true }. Set by the install primitive. */
282
297
  features: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
283
298
  layout: z.ZodDefault<z.ZodObject<{
@@ -382,9 +397,11 @@ declare const siteConfigSchema: z.ZodObject<{
382
397
  currency: string;
383
398
  priceFormat?: string | undefined;
384
399
  };
400
+ name?: string | undefined;
385
401
  }, {
386
402
  backend: "payload" | "vendure";
387
403
  tier: "catalog" | "simple-store" | "full-store";
404
+ name?: string | undefined;
388
405
  features?: Record<string, boolean> | undefined;
389
406
  layout?: {
390
407
  sections?: {
package/dist/index.js CHANGED
@@ -179,6 +179,11 @@ var themeSchema = z3.object({
179
179
  var siteConfigSchema = z3.object({
180
180
  backend: backendSchema,
181
181
  tier: tierSchema,
182
+ /**
183
+ * Storefront display name (header, metadata, footer). Set by `vitrine init`
184
+ * from the project name; optional for older clients.
185
+ */
186
+ name: z3.string().min(1).optional(),
182
187
  /** Feature flags: { 'reviews': true }. Set by the install primitive. */
183
188
  features: z3.record(z3.string(), z3.boolean()).default({}),
184
189
  layout: z3.object({ sections: z3.array(layoutSectionSchema).default([]) }).default({ sections: [] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitrine-kit/contracts",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "Vitrine — the five stable contracts: Tokens, Data, Slots, Config, Blueprint.",
5
5
  "license": "MIT",
6
6
  "type": "module",