zitejs 0.9.64 → 0.9.65

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.
@@ -1,5 +1,13 @@
1
1
  import type { NotificationsCreateParams, NotificationsCreateResult } from "../notifications/index.js";
2
2
  import type { MetaListUsersResult } from "../meta/index.js";
3
+ export interface BulkCreateResult<T> {
4
+ success: boolean;
5
+ records: T[];
6
+ }
7
+ export interface DeleteResult {
8
+ success: boolean;
9
+ id: string;
10
+ }
3
11
  export interface TableClient<T> {
4
12
  findAll(options?: {
5
13
  limit?: number;
@@ -9,23 +17,20 @@ export interface TableClient<T> {
9
17
  filters?: unknown;
10
18
  }): Promise<{
11
19
  records: T[];
12
- total: number;
13
20
  hasMore: boolean;
14
21
  }>;
15
22
  findOne(recordId: string | {
16
23
  filters?: unknown;
17
24
  filter?: unknown;
18
- }): Promise<T>;
25
+ }): Promise<T | undefined>;
19
26
  create(data: {
20
27
  record: Partial<T>;
21
28
  }): Promise<T>;
22
29
  update(id: string, data: {
23
30
  record: Partial<T>;
24
31
  }): Promise<T>;
25
- delete(id: string): Promise<{
26
- deleted: true;
27
- }>;
28
- bulkCreate(records: Partial<T>[]): Promise<T[]>;
32
+ delete(id: string): Promise<DeleteResult>;
33
+ bulkCreate(records: Partial<T>[]): Promise<BulkCreateResult<T>>;
29
34
  }
30
35
  export declare function createTableClient<T>(className: string): TableClient<T>;
31
36
  export interface SqlResult {
@@ -57,14 +62,15 @@ export interface AirtableTableClient<T> {
57
62
  }): Promise<T | undefined>;
58
63
  create(data: {
59
64
  record: Partial<T>;
60
- }): Promise<T>;
65
+ }): Promise<T | undefined>;
61
66
  bulkCreate(records: Partial<T>[]): Promise<T[]>;
62
67
  update(id: string, data: {
63
68
  record: Partial<T>;
64
- }): Promise<T>;
65
- delete(id: string): Promise<{
66
- deleted: true;
67
- }>;
69
+ }): Promise<{
70
+ id: string;
71
+ fields: T;
72
+ } | undefined>;
73
+ delete(id: string): Promise<DeleteResult>;
68
74
  }
69
75
  export declare function createAirtableClient<T>(integrationId: string, className: string, implicitParams: Record<string, unknown>): AirtableTableClient<T>;
70
76
  export declare function createNotificationsClient(): {
@@ -302,13 +302,13 @@ function generateDbTs(schema) {
302
302
  lines.push("// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.");
303
303
  lines.push("//");
304
304
  lines.push("// Table client methods:");
305
- lines.push("// .findAll(opts?) → { records: T[], total: number, hasMore: boolean }");
305
+ lines.push("// .findAll(opts?) → { records: T[], hasMore: boolean }");
306
306
  lines.push("// opts: { limit?, offset?, sort?, filter?, filters? }");
307
- lines.push("// .findOne(id | { filters }) → T");
307
+ lines.push("// .findOne(id | { filters }) → T | undefined");
308
308
  lines.push("// .create({ record }) → T");
309
309
  lines.push("// .update(id, { record }) → T");
310
- lines.push("// .delete(id) → { deleted: true }");
311
- lines.push("// .bulkCreate(records) → T[]");
310
+ lines.push("// .delete(id) → { success: boolean, id: string }");
311
+ lines.push("// .bulkCreate(records) → { success: boolean, records: T[] }");
312
312
  lines.push("//");
313
313
  lines.push("// Raw SQL (read-only SELECTs for aggregates, joins, multi-table queries):");
314
314
  lines.push('// zite.sql({ query: "SELECT ...", params?: [...] })');
@@ -643,10 +643,10 @@ function generateAirtableTs(lock) {
643
643
  "// findAll(options?: { offset?: string; limit?: number; filters?: unknown })",
644
644
  "// => Promise<{ records: T[]; offset: string | undefined; hasMore: boolean }>",
645
645
  "// findOne(params: { id?: string; filters?: unknown }) => Promise<T | undefined>",
646
- "// create(data: { record: Partial<T> }) => Promise<T>",
646
+ "// create(data: { record: Partial<T> }) => Promise<T | undefined>",
647
647
  "// bulkCreate(records: Partial<T>[]) => Promise<T[]>",
648
- "// update(id: string, data: { record: Partial<T> }) => Promise<T>",
649
- "// delete(id: string) => Promise<{ deleted: true }>",
648
+ "// update(id: string, data: { record: Partial<T> }) => Promise<{ id: string, fields: T } | undefined>",
649
+ "// delete(id: string) => Promise<{ success: boolean, id: string }>",
650
650
  "//",
651
651
  "// Usage tips:",
652
652
  "// - Airtable has a strict rate limit of 5 requests/second per base",
@@ -1,5 +1,13 @@
1
1
  import type { NotificationsCreateParams, NotificationsCreateResult } from "../notifications/index.js";
2
2
  import type { MetaListUsersResult } from "../meta/index.js";
3
+ export interface BulkCreateResult<T> {
4
+ success: boolean;
5
+ records: T[];
6
+ }
7
+ export interface DeleteResult {
8
+ success: boolean;
9
+ id: string;
10
+ }
3
11
  export interface TableClient<T> {
4
12
  findAll(options?: {
5
13
  limit?: number;
@@ -9,23 +17,20 @@ export interface TableClient<T> {
9
17
  filters?: unknown;
10
18
  }): Promise<{
11
19
  records: T[];
12
- total: number;
13
20
  hasMore: boolean;
14
21
  }>;
15
22
  findOne(recordId: string | {
16
23
  filters?: unknown;
17
24
  filter?: unknown;
18
- }): Promise<T>;
25
+ }): Promise<T | undefined>;
19
26
  create(data: {
20
27
  record: Partial<T>;
21
28
  }): Promise<T>;
22
29
  update(id: string, data: {
23
30
  record: Partial<T>;
24
31
  }): Promise<T>;
25
- delete(id: string): Promise<{
26
- deleted: true;
27
- }>;
28
- bulkCreate(records: Partial<T>[]): Promise<T[]>;
32
+ delete(id: string): Promise<DeleteResult>;
33
+ bulkCreate(records: Partial<T>[]): Promise<BulkCreateResult<T>>;
29
34
  }
30
35
  export declare function createTableClient<T>(className: string): TableClient<T>;
31
36
  export interface SqlResult {
@@ -57,14 +62,15 @@ export interface AirtableTableClient<T> {
57
62
  }): Promise<T | undefined>;
58
63
  create(data: {
59
64
  record: Partial<T>;
60
- }): Promise<T>;
65
+ }): Promise<T | undefined>;
61
66
  bulkCreate(records: Partial<T>[]): Promise<T[]>;
62
67
  update(id: string, data: {
63
68
  record: Partial<T>;
64
- }): Promise<T>;
65
- delete(id: string): Promise<{
66
- deleted: true;
67
- }>;
69
+ }): Promise<{
70
+ id: string;
71
+ fields: T;
72
+ } | undefined>;
73
+ delete(id: string): Promise<DeleteResult>;
68
74
  }
69
75
  export declare function createAirtableClient<T>(integrationId: string, className: string, implicitParams: Record<string, unknown>): AirtableTableClient<T>;
70
76
  export declare function createNotificationsClient(): {
@@ -291,13 +291,13 @@ export function generateDbTs(schema) {
291
291
  lines.push("// The tsconfig aliases resolve zitejs/* imports to the correct .zite/ files.");
292
292
  lines.push("//");
293
293
  lines.push("// Table client methods:");
294
- lines.push("// .findAll(opts?) → { records: T[], total: number, hasMore: boolean }");
294
+ lines.push("// .findAll(opts?) → { records: T[], hasMore: boolean }");
295
295
  lines.push("// opts: { limit?, offset?, sort?, filter?, filters? }");
296
- lines.push("// .findOne(id | { filters }) → T");
296
+ lines.push("// .findOne(id | { filters }) → T | undefined");
297
297
  lines.push("// .create({ record }) → T");
298
298
  lines.push("// .update(id, { record }) → T");
299
- lines.push("// .delete(id) → { deleted: true }");
300
- lines.push("// .bulkCreate(records) → T[]");
299
+ lines.push("// .delete(id) → { success: boolean, id: string }");
300
+ lines.push("// .bulkCreate(records) → { success: boolean, records: T[] }");
301
301
  lines.push("//");
302
302
  lines.push("// Raw SQL (read-only SELECTs for aggregates, joins, multi-table queries):");
303
303
  lines.push('// zite.sql({ query: "SELECT ...", params?: [...] })');
@@ -632,10 +632,10 @@ export function generateAirtableTs(lock) {
632
632
  "// findAll(options?: { offset?: string; limit?: number; filters?: unknown })",
633
633
  "// => Promise<{ records: T[]; offset: string | undefined; hasMore: boolean }>",
634
634
  "// findOne(params: { id?: string; filters?: unknown }) => Promise<T | undefined>",
635
- "// create(data: { record: Partial<T> }) => Promise<T>",
635
+ "// create(data: { record: Partial<T> }) => Promise<T | undefined>",
636
636
  "// bulkCreate(records: Partial<T>[]) => Promise<T[]>",
637
- "// update(id: string, data: { record: Partial<T> }) => Promise<T>",
638
- "// delete(id: string) => Promise<{ deleted: true }>",
637
+ "// update(id: string, data: { record: Partial<T> }) => Promise<{ id: string, fields: T } | undefined>",
638
+ "// delete(id: string) => Promise<{ success: boolean, id: string }>",
639
639
  "//",
640
640
  "// Usage tips:",
641
641
  "// - Airtable has a strict rate limit of 5 requests/second per base",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zitejs",
3
- "version": "0.9.64",
3
+ "version": "0.9.65",
4
4
  "description": "The Zite framework — build apps on Zite Database",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/index.js",