zitejs 0.9.43 → 0.9.45
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/auth/config.d.ts +4 -0
- package/dist/cjs/auth/constants.d.ts +5 -0
- package/dist/cjs/auth/index.d.ts +18 -0
- package/dist/cjs/backend/index.d.ts +36 -0
- package/dist/cjs/bundle/index.d.ts +1 -0
- package/dist/cjs/caller/index.d.ts +7 -0
- package/dist/cjs/check/index.d.ts +1 -0
- package/dist/cjs/cli.d.ts +2 -0
- package/dist/cjs/client/index.d.ts +1273 -0
- package/dist/cjs/dev/index.d.ts +2 -0
- package/dist/cjs/index.d.ts +3 -0
- package/dist/cjs/internal/env.d.ts +1 -0
- package/dist/cjs/pdf/index.d.ts +9 -0
- package/dist/cjs/runtime/index.d.ts +69 -0
- package/dist/cjs/schedules/index.d.ts +16 -0
- package/dist/cjs/sync/index.d.ts +4 -0
- package/dist/cjs/sync/index.js +15 -0
- package/dist/cjs/sync/lib.d.ts +55 -0
- package/dist/cjs/types/fields.d.ts +552 -0
- package/dist/cjs/types/index.d.ts +2 -0
- package/dist/cjs/types/tables.d.ts +1158 -0
- package/dist/cjs/upload/index.d.ts +6 -0
- package/dist/esm/sync/index.d.ts +1 -0
- package/dist/esm/sync/index.js +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { Zite } from "./client/index.js";
|
|
2
|
+
export type { Record, RecordListOutput, RecordListOptions, FieldCreateInput, FieldUpdateInput, TableCreateInput, TableUpdateInput, DatabaseCreateInput, DatabaseListOutput, } from "./client/index.js";
|
|
3
|
+
export * from "./types/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getEnv(key: string, viteKey?: string): string | undefined;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export interface TableClient<T> {
|
|
2
|
+
findAll(options?: {
|
|
3
|
+
limit?: number;
|
|
4
|
+
offset?: number;
|
|
5
|
+
sort?: unknown[];
|
|
6
|
+
filter?: unknown;
|
|
7
|
+
filters?: unknown;
|
|
8
|
+
}): Promise<{
|
|
9
|
+
records: T[];
|
|
10
|
+
total: number;
|
|
11
|
+
hasMore: boolean;
|
|
12
|
+
}>;
|
|
13
|
+
findOne(recordId: string | {
|
|
14
|
+
filters?: unknown;
|
|
15
|
+
filter?: unknown;
|
|
16
|
+
}): Promise<T>;
|
|
17
|
+
create(data: {
|
|
18
|
+
record: Partial<T>;
|
|
19
|
+
}): Promise<T>;
|
|
20
|
+
update(id: string, data: {
|
|
21
|
+
record: Partial<T>;
|
|
22
|
+
}): Promise<T>;
|
|
23
|
+
delete(id: string): Promise<{
|
|
24
|
+
deleted: true;
|
|
25
|
+
}>;
|
|
26
|
+
bulkCreate(records: Partial<T>[]): Promise<T[]>;
|
|
27
|
+
}
|
|
28
|
+
export declare function createTableClient<T>(className: string): TableClient<T>;
|
|
29
|
+
export interface SqlResult {
|
|
30
|
+
rows: Record<string, unknown>[];
|
|
31
|
+
columns: Array<{
|
|
32
|
+
name: string;
|
|
33
|
+
originalName: string;
|
|
34
|
+
}>;
|
|
35
|
+
rowCount: number;
|
|
36
|
+
truncated: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare function createSqlClient(): (params: {
|
|
39
|
+
query: string;
|
|
40
|
+
params?: unknown[];
|
|
41
|
+
}) => Promise<SqlResult>;
|
|
42
|
+
export interface AirtableTableClient<T> {
|
|
43
|
+
findAll(options?: {
|
|
44
|
+
offset?: string;
|
|
45
|
+
limit?: number;
|
|
46
|
+
filters?: unknown;
|
|
47
|
+
}): Promise<{
|
|
48
|
+
records: T[];
|
|
49
|
+
offset: string | undefined;
|
|
50
|
+
hasMore: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
findOne(params: {
|
|
53
|
+
id?: string;
|
|
54
|
+
filters?: unknown;
|
|
55
|
+
}): Promise<T | undefined>;
|
|
56
|
+
create(data: {
|
|
57
|
+
record: Partial<T>;
|
|
58
|
+
}): Promise<T>;
|
|
59
|
+
bulkCreate(records: Partial<T>[]): Promise<T[]>;
|
|
60
|
+
update(id: string, data: {
|
|
61
|
+
record: Partial<T>;
|
|
62
|
+
}): Promise<T>;
|
|
63
|
+
delete(id: string): Promise<{
|
|
64
|
+
deleted: true;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
export declare function createAirtableClient<T>(integrationId: string, className: string, implicitParams: Record<string, unknown>): AirtableTableClient<T>;
|
|
68
|
+
export { createCaller } from "../caller/index.js";
|
|
69
|
+
export type { EndpointConfig } from "../caller/index.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class ZiteSchedule {
|
|
2
|
+
static create(config: {
|
|
3
|
+
name: string;
|
|
4
|
+
cron: string;
|
|
5
|
+
endpoint: string;
|
|
6
|
+
input?: Record<string, unknown>;
|
|
7
|
+
}): Promise<{
|
|
8
|
+
id: string;
|
|
9
|
+
}>;
|
|
10
|
+
static delete(id: string): Promise<void>;
|
|
11
|
+
static list(): Promise<Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
cron: string;
|
|
15
|
+
}>>;
|
|
16
|
+
}
|
package/dist/cjs/sync/index.js
CHANGED
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
3
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
18
|
exports.runSync = runSync;
|
|
5
19
|
exports.regenerateApiTs = regenerateApiTs;
|
|
20
|
+
__exportStar(require("./lib.js"), exports);
|
|
6
21
|
const fs_1 = require("fs");
|
|
7
22
|
const path_1 = require("path");
|
|
8
23
|
const lib_js_1 = require("./lib.js");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { PublicFieldDefinition } from "../types/fields.js";
|
|
2
|
+
import type { Database } from "../types/tables.js";
|
|
3
|
+
export type ZiteSchemaField = {
|
|
4
|
+
id: string;
|
|
5
|
+
sdkName: string;
|
|
6
|
+
definition: PublicFieldDefinition;
|
|
7
|
+
};
|
|
8
|
+
export type ZiteSchemaTable = {
|
|
9
|
+
id: string;
|
|
10
|
+
sdkName: string;
|
|
11
|
+
primaryFieldId?: string;
|
|
12
|
+
fields: ZiteSchemaField[];
|
|
13
|
+
};
|
|
14
|
+
export type ZiteSchema = {
|
|
15
|
+
tables: ZiteSchemaTable[];
|
|
16
|
+
};
|
|
17
|
+
export declare function toPascalCase(name: string): string;
|
|
18
|
+
export declare function toCamelCase(name: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Build a ZiteSchema from a Database API response.
|
|
21
|
+
*
|
|
22
|
+
* If `existingSchema` is provided, locked SDK names are preserved for
|
|
23
|
+
* tables/fields that already exist (matched by ID). New tables/fields
|
|
24
|
+
* get fresh camelCase SDK names. This is how `zitejs sync` preserves
|
|
25
|
+
* name stability across schema changes.
|
|
26
|
+
*/
|
|
27
|
+
export declare function generateSchema(database: Database, existingSchema?: ZiteSchema): ZiteSchema;
|
|
28
|
+
/**
|
|
29
|
+
* Generate .zite/db.ts purely from ZiteSchema.
|
|
30
|
+
* Pure function — no external data needed beyond what's in the schema file.
|
|
31
|
+
*/
|
|
32
|
+
export declare function generateDbTs(schema: ZiteSchema): string;
|
|
33
|
+
export declare function generateApiTs(endpointFiles: string[]): string | null;
|
|
34
|
+
export declare function generateUserTs(usersTableFields?: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
}>): string;
|
|
38
|
+
export declare function generateAuthWrapperTs(): string;
|
|
39
|
+
export type AirtableLockField = {
|
|
40
|
+
id: string;
|
|
41
|
+
sdkName: string;
|
|
42
|
+
type: string;
|
|
43
|
+
options?: string[];
|
|
44
|
+
};
|
|
45
|
+
export type AirtableLockTable = {
|
|
46
|
+
id: string;
|
|
47
|
+
sdkName: string;
|
|
48
|
+
fields: AirtableLockField[];
|
|
49
|
+
};
|
|
50
|
+
export type AirtableLock = {
|
|
51
|
+
integrationId: string;
|
|
52
|
+
tables: AirtableLockTable[];
|
|
53
|
+
};
|
|
54
|
+
export declare function generateAirtableTs(lock: AirtableLock): string | null;
|
|
55
|
+
export declare function generateBackendWrapperTs(): string;
|