zitejs 0.9.70 → 0.9.71

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.
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createCaller = void 0;
4
+ var index_js_1 = require("../caller/index.js");
5
+ Object.defineProperty(exports, "createCaller", { enumerable: true, get: function () { return index_js_1.createCaller; } });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createTableClient = void 0;
4
+ var index_js_1 = require("../runtime/index.js");
5
+ Object.defineProperty(exports, "createTableClient", { enumerable: true, get: function () { return index_js_1.createTableClient; } });
@@ -73,7 +73,7 @@ export interface AirtableTableClient<T> {
73
73
  }): Promise<T | undefined>;
74
74
  create(params: {
75
75
  record: Partial<T>;
76
- }): Promise<T | undefined>;
76
+ }): Promise<T>;
77
77
  bulkCreate(params: {
78
78
  records: Partial<T>[];
79
79
  }): Promise<T[]>;
@@ -82,8 +82,8 @@ export interface AirtableTableClient<T> {
82
82
  record: Partial<T>;
83
83
  }): Promise<{
84
84
  id: string;
85
- fields: T;
86
- } | undefined>;
85
+ fields: Partial<T>;
86
+ }>;
87
87
  delete(params: {
88
88
  id: string;
89
89
  }): Promise<DeleteResult>;
@@ -320,7 +320,9 @@ function generateDbTs(schema) {
320
320
  lines.push("// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.");
321
321
  lines.push("//");
322
322
  lines.push("// Table client methods (all take a single params object):");
323
- lines.push("// .findAll({ filters?, offset?, limit?, fields? }) → { records: T[], hasMore: boolean }");
323
+ lines.push("// .findAll({ filters?, sort?, offset?, limit?, fields? }) → { records: T[], hasMore: boolean }");
324
+ lines.push("// filters: { fieldName: value } for equality, { fieldName: { contains|gt|lt|gte|lte: value } } for operators");
325
+ lines.push("// sort: [{ field: 'fieldName', direction: 'asc' | 'desc' }]");
324
326
  lines.push("// .findOne({ id?, filters?, fields? }) → T | undefined");
325
327
  lines.push("// .create({ record }) → T");
326
328
  lines.push("// .update({ id, record }) → { id: string, fields: Partial<T> }");
@@ -134,7 +134,8 @@ exports.ratingTemplateSchema = zod_1.z.object({
134
134
  });
135
135
  exports.durationTemplateSchema = zod_1.z.object({
136
136
  format: zod_1.z.enum(exports.durationFormatEnum),
137
- defaultValue: zod_1.z.number().int().min(0).optional(),
137
+ // Stored as seconds in a DECIMAL column; may be fractional.
138
+ defaultValue: zod_1.z.number().min(0).optional(),
138
139
  });
139
140
  exports.percentTemplateSchema = zod_1.z.object({
140
141
  decimalPlaces: zod_1.z.number().min(0),
@@ -0,0 +1,2 @@
1
+ export { createCaller } from '../caller/index.js';
2
+ export type { EndpointConfig } from '../caller/index.js';
@@ -0,0 +1 @@
1
+ export { createCaller } from '../caller/index.js';
package/dist/esm/cli.js CHANGED
File without changes
@@ -0,0 +1,2 @@
1
+ export { createTableClient } from '../runtime/index.js';
2
+ export type { TableClient } from '../runtime/index.js';
@@ -0,0 +1 @@
1
+ export { createTableClient } from '../runtime/index.js';
@@ -73,7 +73,7 @@ export interface AirtableTableClient<T> {
73
73
  }): Promise<T | undefined>;
74
74
  create(params: {
75
75
  record: Partial<T>;
76
- }): Promise<T | undefined>;
76
+ }): Promise<T>;
77
77
  bulkCreate(params: {
78
78
  records: Partial<T>[];
79
79
  }): Promise<T[]>;
@@ -82,8 +82,8 @@ export interface AirtableTableClient<T> {
82
82
  record: Partial<T>;
83
83
  }): Promise<{
84
84
  id: string;
85
- fields: T;
86
- } | undefined>;
85
+ fields: Partial<T>;
86
+ }>;
87
87
  delete(params: {
88
88
  id: string;
89
89
  }): Promise<DeleteResult>;
@@ -308,7 +308,9 @@ export function generateDbTs(schema) {
308
308
  lines.push("// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.");
309
309
  lines.push("//");
310
310
  lines.push("// Table client methods (all take a single params object):");
311
- lines.push("// .findAll({ filters?, offset?, limit?, fields? }) → { records: T[], hasMore: boolean }");
311
+ lines.push("// .findAll({ filters?, sort?, offset?, limit?, fields? }) → { records: T[], hasMore: boolean }");
312
+ lines.push("// filters: { fieldName: value } for equality, { fieldName: { contains|gt|lt|gte|lte: value } } for operators");
313
+ lines.push("// sort: [{ field: 'fieldName', direction: 'asc' | 'desc' }]");
312
314
  lines.push("// .findOne({ id?, filters?, fields? }) → T | undefined");
313
315
  lines.push("// .create({ record }) → T");
314
316
  lines.push("// .update({ id, record }) → { id: string, fields: Partial<T> }");
@@ -131,7 +131,8 @@ export const ratingTemplateSchema = z.object({
131
131
  });
132
132
  export const durationTemplateSchema = z.object({
133
133
  format: z.enum(durationFormatEnum),
134
- defaultValue: z.number().int().min(0).optional(),
134
+ // Stored as seconds in a DECIMAL column; may be fractional.
135
+ defaultValue: z.number().min(0).optional(),
135
136
  });
136
137
  export const percentTemplateSchema = z.object({
137
138
  decimalPlaces: z.number().min(0),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.70",
3
+ "version": "0.9.71",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",