zitejs 0.5.3 → 0.6.1
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/db/index.js +3 -6
- package/dist/cjs/runtime/index.js +40 -0
- package/dist/cjs/sync/lib.js +9 -55
- package/dist/esm/db/index.d.ts +2 -16
- package/dist/esm/db/index.d.ts.map +1 -1
- package/dist/esm/db/index.js +1 -5
- package/dist/esm/db/index.js.map +1 -1
- package/dist/esm/runtime/index.d.ts +22 -0
- package/dist/esm/runtime/index.d.ts.map +1 -0
- package/dist/esm/runtime/index.js +37 -0
- package/dist/esm/runtime/index.js.map +1 -0
- package/dist/esm/sync/lib.d.ts +1 -1
- package/dist/esm/sync/lib.d.ts.map +1 -1
- package/dist/esm/sync/lib.js +9 -55
- package/dist/esm/sync/lib.js.map +1 -1
- package/package.json +6 -1
package/dist/cjs/db/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
throw new Error('zite.* is a stub — run `npx zitejs sync` to generate the real client.');
|
|
7
|
-
},
|
|
8
|
-
});
|
|
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; } });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.wrapSdkCall = wrapSdkCall;
|
|
4
|
+
exports.createTableClient = createTableClient;
|
|
5
|
+
const RUNNER_URL = process.env.ZITE_RUNNER_URL ?? '';
|
|
6
|
+
const TOKEN = process.env.ZITE_DB_TOKEN ?? '';
|
|
7
|
+
async function wrapSdkCall(integrationId, className, methodName, params) {
|
|
8
|
+
const res = await fetch(`${RUNNER_URL}/sdk/execute`, {
|
|
9
|
+
method: 'POST',
|
|
10
|
+
headers: {
|
|
11
|
+
Authorization: `Bearer ${TOKEN}`,
|
|
12
|
+
'Content-Type': 'application/json',
|
|
13
|
+
},
|
|
14
|
+
body: JSON.stringify({ integrationId, className, methodName, params }),
|
|
15
|
+
});
|
|
16
|
+
if (!res.ok) {
|
|
17
|
+
const text = await res.text().catch(() => '');
|
|
18
|
+
throw new Error(`SDK call failed (${res.status}): ${text}`);
|
|
19
|
+
}
|
|
20
|
+
return res.json();
|
|
21
|
+
}
|
|
22
|
+
function createTableClient(integrationId, className) {
|
|
23
|
+
return {
|
|
24
|
+
findAll: (options) => wrapSdkCall(integrationId, className, 'findAll', options),
|
|
25
|
+
findOne: (recordId) => wrapSdkCall(integrationId, className, 'findOne', {
|
|
26
|
+
id: recordId,
|
|
27
|
+
}),
|
|
28
|
+
create: (data) => wrapSdkCall(integrationId, className, 'create', data),
|
|
29
|
+
update: (recordId, data) => wrapSdkCall(integrationId, className, 'update', {
|
|
30
|
+
id: recordId,
|
|
31
|
+
...data,
|
|
32
|
+
}),
|
|
33
|
+
delete: (recordId) => wrapSdkCall(integrationId, className, 'delete', {
|
|
34
|
+
id: recordId,
|
|
35
|
+
}),
|
|
36
|
+
bulkCreate: (records) => wrapSdkCall(integrationId, className, 'bulkCreate', {
|
|
37
|
+
records,
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
}
|
package/dist/cjs/sync/lib.js
CHANGED
|
@@ -52,28 +52,10 @@ function generateSchema(base) {
|
|
|
52
52
|
}
|
|
53
53
|
return schema;
|
|
54
54
|
}
|
|
55
|
-
function generateDbTs(base, schema,
|
|
55
|
+
function generateDbTs(base, schema, integrationId = 'databases') {
|
|
56
56
|
const lines = [];
|
|
57
57
|
lines.push('// Auto-generated by zitejs sync. Do not edit manually.');
|
|
58
|
-
lines.push('');
|
|
59
|
-
lines.push("const BASE_URL = process.env.ZITE_DB_URL ?? 'https://tables.fillout.com/api/v1';");
|
|
60
|
-
lines.push("const TOKEN = process.env.ZITE_DB_TOKEN ?? '';");
|
|
61
|
-
lines.push('');
|
|
62
|
-
lines.push('async function dbFetch(method: string, path: string, body?: unknown) {');
|
|
63
|
-
lines.push(' const res = await fetch(BASE_URL + path, {');
|
|
64
|
-
lines.push(' method,');
|
|
65
|
-
lines.push(' headers: {');
|
|
66
|
-
lines.push(' Authorization: `Bearer ${TOKEN}`,');
|
|
67
|
-
lines.push(" ...(body ? { 'Content-Type': 'application/json' } : {}),");
|
|
68
|
-
lines.push(' },');
|
|
69
|
-
lines.push(' body: body ? JSON.stringify(body) : undefined,');
|
|
70
|
-
lines.push(' });');
|
|
71
|
-
lines.push(' if (!res.ok) {');
|
|
72
|
-
lines.push(" const text = await res.text().catch(() => '');");
|
|
73
|
-
lines.push(' throw new Error(`Zite DB request failed (${res.status}): ${text}`);');
|
|
74
|
-
lines.push(' }');
|
|
75
|
-
lines.push(' return res.json();');
|
|
76
|
-
lines.push('}');
|
|
58
|
+
lines.push("import { createTableClient } from 'zitejs/runtime';");
|
|
77
59
|
lines.push('');
|
|
78
60
|
for (const table of base.tables ?? []) {
|
|
79
61
|
const className = toPascalCase(table.name);
|
|
@@ -82,40 +64,19 @@ function generateDbTs(base, schema, baseId) {
|
|
|
82
64
|
lines.push(' id: string;');
|
|
83
65
|
for (const field of table.fields ?? []) {
|
|
84
66
|
const fieldName = toCamelCase(field.name);
|
|
67
|
+
if (fieldName === 'id')
|
|
68
|
+
continue;
|
|
85
69
|
const tsType = tsTypeForField(field);
|
|
86
70
|
lines.push(` ${fieldName}: ${tsType};`);
|
|
87
71
|
}
|
|
88
|
-
lines.push(' createdAt: string;');
|
|
89
|
-
lines.push(' updatedAt: string;');
|
|
90
72
|
lines.push('};');
|
|
91
73
|
lines.push('');
|
|
92
74
|
}
|
|
93
|
-
lines.push('function createTableClient<T>(baseId: string, tableId: string) {');
|
|
94
|
-
lines.push(' const base = `/bases/${encodeURIComponent(baseId)}/tables/${encodeURIComponent(tableId)}`;');
|
|
95
|
-
lines.push(' return {');
|
|
96
|
-
lines.push(' findAll: (options?: { limit?: number; offset?: number; sort?: unknown[]; filter?: unknown }): Promise<{ records: T[]; total: number; hasMore: boolean }> =>');
|
|
97
|
-
lines.push(' dbFetch("POST", `${base}/records/list`, options),');
|
|
98
|
-
lines.push(' findOne: (recordId: string): Promise<T> =>');
|
|
99
|
-
lines.push(' dbFetch("GET", `${base}/records/${encodeURIComponent(recordId)}`),');
|
|
100
|
-
lines.push(' create: (data: Partial<T>): Promise<T> =>');
|
|
101
|
-
lines.push(' dbFetch("POST", `${base}/records`, { record: data }),');
|
|
102
|
-
lines.push(' update: (recordId: string, data: Partial<T>): Promise<T> =>');
|
|
103
|
-
lines.push(' dbFetch("PATCH", `${base}/records/${encodeURIComponent(recordId)}`, { record: data }),');
|
|
104
|
-
lines.push(' delete: (recordId: string): Promise<{ deleted: true }> =>');
|
|
105
|
-
lines.push(' dbFetch("DELETE", `${base}/records/${encodeURIComponent(recordId)}`),');
|
|
106
|
-
lines.push(' bulkCreate: (records: Partial<T>[]): Promise<T[]> =>');
|
|
107
|
-
lines.push(' dbFetch("POST", `${base}/records/bulk`, { records }),');
|
|
108
|
-
lines.push(' };');
|
|
109
|
-
lines.push('}');
|
|
110
|
-
lines.push('');
|
|
111
|
-
lines.push(`const BASE_ID = '${baseId}';`);
|
|
112
|
-
lines.push('');
|
|
113
75
|
lines.push('export const zite = {');
|
|
114
76
|
for (const table of base.tables ?? []) {
|
|
115
77
|
const className = toPascalCase(table.name);
|
|
116
78
|
const propName = toCamelCase(table.name);
|
|
117
|
-
|
|
118
|
-
lines.push(` ${propName}: createTableClient<${className}RecordType>(BASE_ID, '${tableId}'),`);
|
|
79
|
+
lines.push(` ${propName}: createTableClient<${className}RecordType>('${integrationId}', '${className}'),`);
|
|
119
80
|
}
|
|
120
81
|
lines.push('};');
|
|
121
82
|
lines.push('');
|
|
@@ -125,16 +86,9 @@ function generateDbDts(base, schema) {
|
|
|
125
86
|
const lines = [
|
|
126
87
|
'// Auto-generated by zitejs sync. Do not edit manually.',
|
|
127
88
|
'// This file contains only type declarations for LLM context.',
|
|
128
|
-
'// See db.ts for the full runtime
|
|
89
|
+
'// See db.ts for the full runtime.',
|
|
129
90
|
'',
|
|
130
|
-
|
|
131
|
-
' findAll(options?: { limit?: number; offset?: number; sort?: unknown[]; filter?: unknown }): Promise<{ records: T[]; total: number; hasMore: boolean }>;',
|
|
132
|
-
' findOne(recordId: string): Promise<T>;',
|
|
133
|
-
' create(data: Partial<T>): Promise<T>;',
|
|
134
|
-
' update(recordId: string, data: Partial<T>): Promise<T>;',
|
|
135
|
-
' delete(recordId: string): Promise<{ deleted: true }>;',
|
|
136
|
-
' bulkCreate(records: Partial<T>[]): Promise<T[]>;',
|
|
137
|
-
'}',
|
|
91
|
+
"import type { TableClient } from 'zitejs/runtime';",
|
|
138
92
|
'',
|
|
139
93
|
];
|
|
140
94
|
for (const table of base.tables ?? []) {
|
|
@@ -144,11 +98,11 @@ function generateDbDts(base, schema) {
|
|
|
144
98
|
lines.push(' id: string;');
|
|
145
99
|
for (const field of table.fields ?? []) {
|
|
146
100
|
const fieldName = toCamelCase(field.name);
|
|
101
|
+
if (fieldName === 'id')
|
|
102
|
+
continue;
|
|
147
103
|
const tsType = tsTypeForField(field);
|
|
148
104
|
lines.push(` ${fieldName}: ${tsType};`);
|
|
149
105
|
}
|
|
150
|
-
lines.push(' createdAt: string;');
|
|
151
|
-
lines.push(' updatedAt: string;');
|
|
152
106
|
lines.push('};');
|
|
153
107
|
lines.push('');
|
|
154
108
|
}
|
package/dist/esm/db/index.d.ts
CHANGED
|
@@ -1,17 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
limit?: number;
|
|
4
|
-
offset?: number;
|
|
5
|
-
sort?: unknown[];
|
|
6
|
-
filter?: unknown;
|
|
7
|
-
}): Promise<{
|
|
8
|
-
records: Record<string, unknown>[];
|
|
9
|
-
hasMore: boolean;
|
|
10
|
-
}>;
|
|
11
|
-
findOne(id: string): Promise<Record<string, unknown>>;
|
|
12
|
-
create(data: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
13
|
-
update(id: string, data: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
14
|
-
delete(id: string): Promise<void>;
|
|
15
|
-
bulkCreate(items: Record<string, unknown>[]): Promise<Record<string, unknown>[]>;
|
|
16
|
-
}>;
|
|
1
|
+
export { createTableClient } from '../runtime/index.js';
|
|
2
|
+
export type { TableClient } from '../runtime/index.js';
|
|
17
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/esm/db/index.js
CHANGED
package/dist/esm/db/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function wrapSdkCall(integrationId: string, className: string, methodName: string, params?: unknown): Promise<unknown>;
|
|
2
|
+
export interface TableClient<T> {
|
|
3
|
+
findAll(options?: {
|
|
4
|
+
limit?: number;
|
|
5
|
+
offset?: number;
|
|
6
|
+
sort?: unknown[];
|
|
7
|
+
filter?: unknown;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
records: T[];
|
|
10
|
+
total: number;
|
|
11
|
+
hasMore: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
findOne(recordId: string): Promise<T>;
|
|
14
|
+
create(data: Partial<T>): Promise<T>;
|
|
15
|
+
update(recordId: string, data: Partial<T>): Promise<T>;
|
|
16
|
+
delete(recordId: string): Promise<{
|
|
17
|
+
deleted: true;
|
|
18
|
+
}>;
|
|
19
|
+
bulkCreate(records: Partial<T>[]): Promise<T[]>;
|
|
20
|
+
}
|
|
21
|
+
export declare function createTableClient<T>(integrationId: string, className: string): TableClient<T>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAC/B,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,CAclB;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,OAAO,CAAC,OAAO,CAAC,EAAE;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC;QACjB,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;IAC/D,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACrC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACrD,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACjD;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GAChB,WAAW,CAAC,CAAC,CAAC,CA4BhB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const RUNNER_URL = process.env.ZITE_RUNNER_URL ?? '';
|
|
2
|
+
const TOKEN = process.env.ZITE_DB_TOKEN ?? '';
|
|
3
|
+
export async function wrapSdkCall(integrationId, className, methodName, params) {
|
|
4
|
+
const res = await fetch(`${RUNNER_URL}/sdk/execute`, {
|
|
5
|
+
method: 'POST',
|
|
6
|
+
headers: {
|
|
7
|
+
Authorization: `Bearer ${TOKEN}`,
|
|
8
|
+
'Content-Type': 'application/json',
|
|
9
|
+
},
|
|
10
|
+
body: JSON.stringify({ integrationId, className, methodName, params }),
|
|
11
|
+
});
|
|
12
|
+
if (!res.ok) {
|
|
13
|
+
const text = await res.text().catch(() => '');
|
|
14
|
+
throw new Error(`SDK call failed (${res.status}): ${text}`);
|
|
15
|
+
}
|
|
16
|
+
return res.json();
|
|
17
|
+
}
|
|
18
|
+
export function createTableClient(integrationId, className) {
|
|
19
|
+
return {
|
|
20
|
+
findAll: (options) => wrapSdkCall(integrationId, className, 'findAll', options),
|
|
21
|
+
findOne: (recordId) => wrapSdkCall(integrationId, className, 'findOne', {
|
|
22
|
+
id: recordId,
|
|
23
|
+
}),
|
|
24
|
+
create: (data) => wrapSdkCall(integrationId, className, 'create', data),
|
|
25
|
+
update: (recordId, data) => wrapSdkCall(integrationId, className, 'update', {
|
|
26
|
+
id: recordId,
|
|
27
|
+
...data,
|
|
28
|
+
}),
|
|
29
|
+
delete: (recordId) => wrapSdkCall(integrationId, className, 'delete', {
|
|
30
|
+
id: recordId,
|
|
31
|
+
}),
|
|
32
|
+
bulkCreate: (records) => wrapSdkCall(integrationId, className, 'bulkCreate', {
|
|
33
|
+
records,
|
|
34
|
+
}),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE,CAAC;AACrD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;AAE9C,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,aAAqB,EACrB,SAAiB,EACjB,UAAkB,EAClB,MAAgB;IAEhB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,UAAU,cAAc,EAAE;QACnD,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACP,aAAa,EAAE,UAAU,KAAK,EAAE;YAChC,cAAc,EAAE,kBAAkB;SACnC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;KACvE,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;QACZ,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,oBAAoB,GAAG,CAAC,MAAM,MAAM,IAAI,EAAE,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACpB,CAAC;AAgBD,MAAM,UAAU,iBAAiB,CAC/B,aAAqB,EACrB,SAAiB;IAEjB,OAAO;QACL,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CACnB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAItD;QACJ,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,CACpB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,SAAS,EAAE;YAC/C,EAAE,EAAE,QAAQ;SACb,CAAe;QAClB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CACf,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAe;QACrE,MAAM,EAAE,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,CACzB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE;YAC9C,EAAE,EAAE,QAAQ;YACZ,GAAG,IAAI;SACR,CAAe;QAClB,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CACnB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE;YAC9C,EAAE,EAAE,QAAQ;SACb,CAA+B;QAClC,UAAU,EAAE,CAAC,OAAO,EAAE,EAAE,CACtB,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE;YAClD,OAAO;SACR,CAAiB;KACrB,CAAC;AACJ,CAAC"}
|
package/dist/esm/sync/lib.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type ZiteSchema = {
|
|
|
20
20
|
export declare function toPascalCase(name: string): string;
|
|
21
21
|
export declare function toCamelCase(name: string): string;
|
|
22
22
|
export declare function generateSchema(base: BaseMetadata): ZiteSchema;
|
|
23
|
-
export declare function generateDbTs(base: BaseMetadata, schema: ZiteSchema,
|
|
23
|
+
export declare function generateDbTs(base: BaseMetadata, schema: ZiteSchema, integrationId?: string): string;
|
|
24
24
|
export declare function generateDbDts(base: BaseMetadata, schema: ZiteSchema): string;
|
|
25
25
|
export declare function generateApiTs(endpointFiles: string[]): string | null;
|
|
26
26
|
//# sourceMappingURL=lib.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/sync/lib.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACd,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CACvD,CAAC;CACH,CAAC;AAyBF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAW7D;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,EAClB,
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../src/sync/lib.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,KAAK,CAAC;YACb,EAAE,EAAE,MAAM,CAAC;YACX,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACd,CAAC,CAAC;KACJ,CAAC,CAAC;CACJ,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CACvD,CAAC;CACH,CAAC;AAyBF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAIjD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhD;AAMD,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,UAAU,CAW7D;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,EAClB,aAAa,GAAE,MAAoB,GAClC,MAAM,CAmCR;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,GACjB,MAAM,CAoCR;AAED,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CA2BpE"}
|
package/dist/esm/sync/lib.js
CHANGED
|
@@ -44,28 +44,10 @@ export function generateSchema(base) {
|
|
|
44
44
|
}
|
|
45
45
|
return schema;
|
|
46
46
|
}
|
|
47
|
-
export function generateDbTs(base, schema,
|
|
47
|
+
export function generateDbTs(base, schema, integrationId = 'databases') {
|
|
48
48
|
const lines = [];
|
|
49
49
|
lines.push('// Auto-generated by zitejs sync. Do not edit manually.');
|
|
50
|
-
lines.push('');
|
|
51
|
-
lines.push("const BASE_URL = process.env.ZITE_DB_URL ?? 'https://tables.fillout.com/api/v1';");
|
|
52
|
-
lines.push("const TOKEN = process.env.ZITE_DB_TOKEN ?? '';");
|
|
53
|
-
lines.push('');
|
|
54
|
-
lines.push('async function dbFetch(method: string, path: string, body?: unknown) {');
|
|
55
|
-
lines.push(' const res = await fetch(BASE_URL + path, {');
|
|
56
|
-
lines.push(' method,');
|
|
57
|
-
lines.push(' headers: {');
|
|
58
|
-
lines.push(' Authorization: `Bearer ${TOKEN}`,');
|
|
59
|
-
lines.push(" ...(body ? { 'Content-Type': 'application/json' } : {}),");
|
|
60
|
-
lines.push(' },');
|
|
61
|
-
lines.push(' body: body ? JSON.stringify(body) : undefined,');
|
|
62
|
-
lines.push(' });');
|
|
63
|
-
lines.push(' if (!res.ok) {');
|
|
64
|
-
lines.push(" const text = await res.text().catch(() => '');");
|
|
65
|
-
lines.push(' throw new Error(`Zite DB request failed (${res.status}): ${text}`);');
|
|
66
|
-
lines.push(' }');
|
|
67
|
-
lines.push(' return res.json();');
|
|
68
|
-
lines.push('}');
|
|
50
|
+
lines.push("import { createTableClient } from 'zitejs/runtime';");
|
|
69
51
|
lines.push('');
|
|
70
52
|
for (const table of base.tables ?? []) {
|
|
71
53
|
const className = toPascalCase(table.name);
|
|
@@ -74,40 +56,19 @@ export function generateDbTs(base, schema, baseId) {
|
|
|
74
56
|
lines.push(' id: string;');
|
|
75
57
|
for (const field of table.fields ?? []) {
|
|
76
58
|
const fieldName = toCamelCase(field.name);
|
|
59
|
+
if (fieldName === 'id')
|
|
60
|
+
continue;
|
|
77
61
|
const tsType = tsTypeForField(field);
|
|
78
62
|
lines.push(` ${fieldName}: ${tsType};`);
|
|
79
63
|
}
|
|
80
|
-
lines.push(' createdAt: string;');
|
|
81
|
-
lines.push(' updatedAt: string;');
|
|
82
64
|
lines.push('};');
|
|
83
65
|
lines.push('');
|
|
84
66
|
}
|
|
85
|
-
lines.push('function createTableClient<T>(baseId: string, tableId: string) {');
|
|
86
|
-
lines.push(' const base = `/bases/${encodeURIComponent(baseId)}/tables/${encodeURIComponent(tableId)}`;');
|
|
87
|
-
lines.push(' return {');
|
|
88
|
-
lines.push(' findAll: (options?: { limit?: number; offset?: number; sort?: unknown[]; filter?: unknown }): Promise<{ records: T[]; total: number; hasMore: boolean }> =>');
|
|
89
|
-
lines.push(' dbFetch("POST", `${base}/records/list`, options),');
|
|
90
|
-
lines.push(' findOne: (recordId: string): Promise<T> =>');
|
|
91
|
-
lines.push(' dbFetch("GET", `${base}/records/${encodeURIComponent(recordId)}`),');
|
|
92
|
-
lines.push(' create: (data: Partial<T>): Promise<T> =>');
|
|
93
|
-
lines.push(' dbFetch("POST", `${base}/records`, { record: data }),');
|
|
94
|
-
lines.push(' update: (recordId: string, data: Partial<T>): Promise<T> =>');
|
|
95
|
-
lines.push(' dbFetch("PATCH", `${base}/records/${encodeURIComponent(recordId)}`, { record: data }),');
|
|
96
|
-
lines.push(' delete: (recordId: string): Promise<{ deleted: true }> =>');
|
|
97
|
-
lines.push(' dbFetch("DELETE", `${base}/records/${encodeURIComponent(recordId)}`),');
|
|
98
|
-
lines.push(' bulkCreate: (records: Partial<T>[]): Promise<T[]> =>');
|
|
99
|
-
lines.push(' dbFetch("POST", `${base}/records/bulk`, { records }),');
|
|
100
|
-
lines.push(' };');
|
|
101
|
-
lines.push('}');
|
|
102
|
-
lines.push('');
|
|
103
|
-
lines.push(`const BASE_ID = '${baseId}';`);
|
|
104
|
-
lines.push('');
|
|
105
67
|
lines.push('export const zite = {');
|
|
106
68
|
for (const table of base.tables ?? []) {
|
|
107
69
|
const className = toPascalCase(table.name);
|
|
108
70
|
const propName = toCamelCase(table.name);
|
|
109
|
-
|
|
110
|
-
lines.push(` ${propName}: createTableClient<${className}RecordType>(BASE_ID, '${tableId}'),`);
|
|
71
|
+
lines.push(` ${propName}: createTableClient<${className}RecordType>('${integrationId}', '${className}'),`);
|
|
111
72
|
}
|
|
112
73
|
lines.push('};');
|
|
113
74
|
lines.push('');
|
|
@@ -117,16 +78,9 @@ export function generateDbDts(base, schema) {
|
|
|
117
78
|
const lines = [
|
|
118
79
|
'// Auto-generated by zitejs sync. Do not edit manually.',
|
|
119
80
|
'// This file contains only type declarations for LLM context.',
|
|
120
|
-
'// See db.ts for the full runtime
|
|
81
|
+
'// See db.ts for the full runtime.',
|
|
121
82
|
'',
|
|
122
|
-
|
|
123
|
-
' findAll(options?: { limit?: number; offset?: number; sort?: unknown[]; filter?: unknown }): Promise<{ records: T[]; total: number; hasMore: boolean }>;',
|
|
124
|
-
' findOne(recordId: string): Promise<T>;',
|
|
125
|
-
' create(data: Partial<T>): Promise<T>;',
|
|
126
|
-
' update(recordId: string, data: Partial<T>): Promise<T>;',
|
|
127
|
-
' delete(recordId: string): Promise<{ deleted: true }>;',
|
|
128
|
-
' bulkCreate(records: Partial<T>[]): Promise<T[]>;',
|
|
129
|
-
'}',
|
|
83
|
+
"import type { TableClient } from 'zitejs/runtime';",
|
|
130
84
|
'',
|
|
131
85
|
];
|
|
132
86
|
for (const table of base.tables ?? []) {
|
|
@@ -136,11 +90,11 @@ export function generateDbDts(base, schema) {
|
|
|
136
90
|
lines.push(' id: string;');
|
|
137
91
|
for (const field of table.fields ?? []) {
|
|
138
92
|
const fieldName = toCamelCase(field.name);
|
|
93
|
+
if (fieldName === 'id')
|
|
94
|
+
continue;
|
|
139
95
|
const tsType = tsTypeForField(field);
|
|
140
96
|
lines.push(` ${fieldName}: ${tsType};`);
|
|
141
97
|
}
|
|
142
|
-
lines.push(' createdAt: string;');
|
|
143
|
-
lines.push(' updatedAt: string;');
|
|
144
98
|
lines.push('};');
|
|
145
99
|
lines.push('');
|
|
146
100
|
}
|
package/dist/esm/sync/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../../../src/sync/lib.ts"],"names":[],"mappings":"AAmBA,MAAM,cAAc,GAA2B;IAC7C,gBAAgB,EAAE,QAAQ;IAC1B,SAAS,EAAE,QAAQ;IACnB,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,QAAQ;IACb,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,QAAQ;IAClB,OAAO,EAAE,QAA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
|
1
1
|
{
|
|
2
2
|
"name": "zitejs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "The Zite framework — build apps on Zite Database",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"import": "./dist/esm/db/index.js",
|
|
13
13
|
"require": "./dist/cjs/db/index.js"
|
|
14
14
|
},
|
|
15
|
+
"./runtime": {
|
|
16
|
+
"types": "./dist/esm/runtime/index.d.ts",
|
|
17
|
+
"import": "./dist/esm/runtime/index.js",
|
|
18
|
+
"require": "./dist/cjs/runtime/index.js"
|
|
19
|
+
},
|
|
15
20
|
"./api": {
|
|
16
21
|
"types": "./dist/esm/api/index.d.ts",
|
|
17
22
|
"import": "./dist/esm/api/index.js",
|