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.
- package/dist/cjs/runtime/index.d.ts +17 -11
- package/dist/cjs/sync/lib.js +7 -7
- package/dist/esm/runtime/index.d.ts +17 -11
- package/dist/esm/sync/lib.js +7 -7
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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<
|
|
65
|
-
|
|
66
|
-
|
|
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(): {
|
package/dist/cjs/sync/lib.js
CHANGED
|
@@ -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[],
|
|
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) → {
|
|
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<{
|
|
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
|
-
|
|
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<
|
|
65
|
-
|
|
66
|
-
|
|
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(): {
|
package/dist/esm/sync/lib.js
CHANGED
|
@@ -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[],
|
|
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) → {
|
|
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<{
|
|
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",
|