@zveltio/sdk 2.0.8 → 3.0.0-beta.100
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/README.md +17 -4
- package/dist/build/index.d.ts +77 -0
- package/dist/build/index.d.ts.map +1 -0
- package/dist/build/index.js +157 -0
- package/dist/client.d.ts +103 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +129 -28
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +21 -3
- package/dist/crdt.d.ts.map +1 -1
- package/dist/crdt.js +11 -2
- package/dist/ddl/index.d.ts +173 -0
- package/dist/ddl/index.d.ts.map +1 -0
- package/dist/ddl/index.js +33 -0
- package/dist/errors.d.ts +58 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +124 -0
- package/dist/extension/action-refusal.d.ts +27 -0
- package/dist/extension/action-refusal.d.ts.map +1 -0
- package/dist/extension/action-refusal.js +29 -0
- package/dist/extension/capabilities.d.ts +71 -0
- package/dist/extension/capabilities.d.ts.map +1 -0
- package/dist/extension/capabilities.js +79 -0
- package/dist/extension/dates.d.ts +7 -0
- package/dist/extension/dates.d.ts.map +1 -0
- package/dist/extension/dates.js +14 -0
- package/dist/extension/index.d.ts +1570 -10
- package/dist/extension/index.d.ts.map +1 -1
- package/dist/extension/index.js +17 -1
- package/dist/extension/jsonb.d.ts +62 -0
- package/dist/extension/jsonb.d.ts.map +1 -0
- package/dist/extension/jsonb.js +64 -0
- package/dist/extension/multipart.d.ts +58 -0
- package/dist/extension/multipart.d.ts.map +1 -0
- package/dist/extension/multipart.js +61 -0
- package/dist/extension/numeric.d.ts +94 -0
- package/dist/extension/numeric.d.ts.map +1 -0
- package/dist/extension/numeric.js +162 -0
- package/dist/extension/permission-gate.d.ts +52 -0
- package/dist/extension/permission-gate.d.ts.map +1 -0
- package/dist/extension/permission-gate.js +125 -0
- package/dist/extension/reserved-paths.d.ts +10 -0
- package/dist/extension/reserved-paths.d.ts.map +1 -0
- package/dist/extension/reserved-paths.js +23 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/local-store.d.ts +14 -1
- package/dist/local-store.d.ts.map +1 -1
- package/dist/local-store.js +93 -16
- package/dist/offline/index.d.ts +75 -0
- package/dist/offline/index.d.ts.map +1 -0
- package/dist/offline/index.js +251 -0
- package/dist/publish/index.d.ts +94 -0
- package/dist/publish/index.d.ts.map +1 -0
- package/dist/publish/index.js +153 -0
- package/dist/realtime.d.ts +25 -1
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +53 -5
- package/dist/rpc/index.d.ts +68 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/rpc/index.js +63 -0
- package/dist/schema-codegen.d.ts +84 -0
- package/dist/schema-codegen.d.ts.map +1 -0
- package/dist/schema-codegen.js +503 -0
- package/dist/schema-watcher.d.ts +10 -2
- package/dist/schema-watcher.d.ts.map +1 -1
- package/dist/schema-watcher.js +26 -13
- package/dist/studio/index.d.ts +85 -0
- package/dist/studio/index.d.ts.map +1 -0
- package/dist/studio/index.js +183 -0
- package/dist/studio/slot-owner-registry.d.ts +13 -0
- package/dist/studio/slot-owner-registry.d.ts.map +1 -0
- package/dist/studio/slot-owner-registry.js +21 -0
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.d.ts.map +1 -1
- package/dist/svelte.js +4 -2
- package/dist/sync-manager.d.ts +49 -4
- package/dist/sync-manager.d.ts.map +1 -1
- package/dist/sync-manager.js +175 -24
- package/dist/testing/index.d.ts +121 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +305 -0
- package/dist/testing/with-test-db.d.ts +119 -0
- package/dist/testing/with-test-db.d.ts.map +1 -0
- package/dist/testing/with-test-db.js +320 -0
- package/dist/tests/action-refusal.test.d.ts +2 -0
- package/dist/tests/action-refusal.test.d.ts.map +1 -0
- package/dist/tests/action-refusal.test.js +13 -0
- package/dist/tests/client.test.d.ts +2 -0
- package/dist/tests/client.test.d.ts.map +1 -0
- package/dist/tests/client.test.js +164 -0
- package/dist/tests/crdt-orset.test.d.ts +2 -0
- package/dist/tests/crdt-orset.test.d.ts.map +1 -0
- package/dist/tests/crdt-orset.test.js +23 -0
- package/dist/tests/local-store.test.js +44 -0
- package/dist/tests/migration-parse.test.d.ts +2 -0
- package/dist/tests/migration-parse.test.d.ts.map +1 -0
- package/dist/tests/migration-parse.test.js +17 -0
- package/dist/tests/multipart.test.d.ts +2 -0
- package/dist/tests/multipart.test.d.ts.map +1 -0
- package/dist/tests/multipart.test.js +37 -0
- package/dist/tests/offline-provider-crdt.test.d.ts +2 -0
- package/dist/tests/offline-provider-crdt.test.d.ts.map +1 -0
- package/dist/tests/offline-provider-crdt.test.js +206 -0
- package/dist/tests/realtime.test.d.ts +2 -0
- package/dist/tests/realtime.test.d.ts.map +1 -0
- package/dist/tests/realtime.test.js +220 -0
- package/dist/tests/reserved-paths.test.d.ts +2 -0
- package/dist/tests/reserved-paths.test.d.ts.map +1 -0
- package/dist/tests/reserved-paths.test.js +21 -0
- package/dist/tests/sync-manager.test.d.ts +2 -0
- package/dist/tests/sync-manager.test.d.ts.map +1 -0
- package/dist/tests/sync-manager.test.js +123 -0
- package/dist/tests/today-in.test.d.ts +2 -0
- package/dist/tests/today-in.test.d.ts.map +1 -0
- package/dist/tests/today-in.test.js +14 -0
- package/dist/tests/validate-manifest-actions.test.d.ts +2 -0
- package/dist/tests/validate-manifest-actions.test.d.ts.map +1 -0
- package/dist/tests/validate-manifest-actions.test.js +82 -0
- package/dist/tests/validate-manifest-dependencies.test.d.ts +2 -0
- package/dist/tests/validate-manifest-dependencies.test.d.ts.map +1 -0
- package/dist/tests/validate-manifest-dependencies.test.js +27 -0
- package/dist/tests/validate-manifest-forward-credentials.test.d.ts +2 -0
- package/dist/tests/validate-manifest-forward-credentials.test.d.ts.map +1 -0
- package/dist/tests/validate-manifest-forward-credentials.test.js +35 -0
- package/dist/tests/validate-sdui-data-endpoints.test.d.ts +2 -0
- package/dist/tests/validate-sdui-data-endpoints.test.d.ts.map +1 -0
- package/dist/tests/validate-sdui-data-endpoints.test.js +41 -0
- package/dist/tests/with-test-db.test.d.ts +2 -0
- package/dist/tests/with-test-db.test.d.ts.map +1 -0
- package/dist/tests/with-test-db.test.js +57 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +3 -1
- package/dist/validate/index.d.ts +148 -0
- package/dist/validate/index.d.ts.map +1 -0
- package/dist/validate/index.js +887 -0
- package/dist/validate/migration-parse.d.ts +22 -0
- package/dist/validate/migration-parse.d.ts.map +1 -0
- package/dist/validate/migration-parse.js +11 -0
- package/dist/validate/shared-message-keys.d.ts +16 -0
- package/dist/validate/shared-message-keys.d.ts.map +1 -0
- package/dist/validate/shared-message-keys.js +227 -0
- package/package.json +56 -4
- package/dist/client/Auth.d.ts +0 -19
- package/dist/client/Auth.d.ts.map +0 -1
- package/dist/client/Auth.js +0 -45
- package/dist/client/QueryBuilder.d.ts +0 -17
- package/dist/client/QueryBuilder.d.ts.map +0 -1
- package/dist/client/QueryBuilder.js +0 -76
- package/dist/client/RealtimeClient.d.ts +0 -22
- package/dist/client/RealtimeClient.d.ts.map +0 -1
- package/dist/client/RealtimeClient.js +0 -96
- package/dist/client/ZveltioClient.d.ts +0 -20
- package/dist/client/ZveltioClient.d.ts.map +0 -1
- package/dist/client/ZveltioClient.js +0 -78
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Hono RPC client factory.
|
|
3
|
+
*
|
|
4
|
+
* Returns a Hono-typed client (via `hono/client#hc`) parameterized by the
|
|
5
|
+
* engine's `AppType`. Callers get autocomplete + tsc-checked URLs + typed
|
|
6
|
+
* request/response shapes for every route they hit.
|
|
7
|
+
*
|
|
8
|
+
* import { createRpcClient } from '@zveltio/sdk/rpc';
|
|
9
|
+
* import type { ZveltioApi } from '@zveltio/engine/api-types';
|
|
10
|
+
*
|
|
11
|
+
* const client = createRpcClient<ZveltioApi>({ baseUrl: 'http://localhost:3000' });
|
|
12
|
+
*
|
|
13
|
+
* // Typed call — autocomplete on `.api.data[':collection'].$post()` and
|
|
14
|
+
* // input/output payloads match the engine's route definition.
|
|
15
|
+
* const res = await client.api.data[':collection'].$post({
|
|
16
|
+
* param: { collection: 'contacts' },
|
|
17
|
+
* json: { email: 'a@b.com', name: 'Alice' },
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* Why this lives in the SDK and not the engine:
|
|
21
|
+
* - The runtime is tiny — `hc()` is a thin wrapper around `fetch`. No
|
|
22
|
+
* reason to duplicate it in every extension. SDK is the natural home.
|
|
23
|
+
* - The TYPE comes from the engine (whichever AppType the consumer
|
|
24
|
+
* wants to bind against). Extensions can also bind their OWN typed
|
|
25
|
+
* Hono routes — the factory is type-generic.
|
|
26
|
+
*
|
|
27
|
+
* Wraps `hc()` with two ergonomic additions:
|
|
28
|
+
* - `credentials: 'include'` by default so cookie-auth works without
|
|
29
|
+
* boilerplate at every call site.
|
|
30
|
+
* - Optional `headers` factory called per-request so auth tokens that
|
|
31
|
+
* change (e.g. CSRF) can flow without rebuilding the client.
|
|
32
|
+
*/
|
|
33
|
+
import { hc } from 'hono/client';
|
|
34
|
+
import type { Hono } from 'hono';
|
|
35
|
+
export interface RpcClientOptions {
|
|
36
|
+
/** Base URL of the engine. Required; no default so misconfiguration fails loud. */
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
/**
|
|
39
|
+
* Static headers attached to every request. For dynamic per-request
|
|
40
|
+
* headers (auth tokens, CSRF), pass `getHeaders` instead.
|
|
41
|
+
*/
|
|
42
|
+
headers?: Record<string, string>;
|
|
43
|
+
/** Async/sync function called before each request; result merged into headers. */
|
|
44
|
+
getHeaders?: () => Record<string, string> | Promise<Record<string, string>>;
|
|
45
|
+
/**
|
|
46
|
+
* Forward cookies on every request. Defaults to `true` so session-based
|
|
47
|
+
* auth (the common case for Studio + extensions on the same origin)
|
|
48
|
+
* works out of the box. Set `false` for cross-origin SPAs that prefer
|
|
49
|
+
* bearer tokens.
|
|
50
|
+
*/
|
|
51
|
+
includeCredentials?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Override the global `fetch`. Mostly useful in tests (mock fetch) or
|
|
54
|
+
* server-side rendering where you want to attach the user's cookie to
|
|
55
|
+
* a server-issued request.
|
|
56
|
+
*/
|
|
57
|
+
fetch?: typeof fetch;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Build a Hono RPC client for the given app type.
|
|
61
|
+
*
|
|
62
|
+
* @typeParam T The Hono app type. For the Zveltio engine, import
|
|
63
|
+
* `ZveltioApi` from `@zveltio/engine/api-types`. For an
|
|
64
|
+
* extension's own routes, pass `typeof yourApp`.
|
|
65
|
+
*/
|
|
66
|
+
export declare function createRpcClient<T extends Hono<any, any, any>>(opts: RpcClientOptions): ReturnType<typeof hc<T>>;
|
|
67
|
+
export type { InferRequestType, InferResponseType } from 'hono/client';
|
|
68
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rpc/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,WAAW,gBAAgB;IAC/B,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,kFAAkF;IAClF,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC5E;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED;;;;;;GAMG;AAGH,wBAAgB,eAAe,CAAC,CAAC,SAAS,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3D,IAAI,EAAE,gBAAgB,GACrB,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAqB1B;AAID,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed Hono RPC client factory.
|
|
3
|
+
*
|
|
4
|
+
* Returns a Hono-typed client (via `hono/client#hc`) parameterized by the
|
|
5
|
+
* engine's `AppType`. Callers get autocomplete + tsc-checked URLs + typed
|
|
6
|
+
* request/response shapes for every route they hit.
|
|
7
|
+
*
|
|
8
|
+
* import { createRpcClient } from '@zveltio/sdk/rpc';
|
|
9
|
+
* import type { ZveltioApi } from '@zveltio/engine/api-types';
|
|
10
|
+
*
|
|
11
|
+
* const client = createRpcClient<ZveltioApi>({ baseUrl: 'http://localhost:3000' });
|
|
12
|
+
*
|
|
13
|
+
* // Typed call — autocomplete on `.api.data[':collection'].$post()` and
|
|
14
|
+
* // input/output payloads match the engine's route definition.
|
|
15
|
+
* const res = await client.api.data[':collection'].$post({
|
|
16
|
+
* param: { collection: 'contacts' },
|
|
17
|
+
* json: { email: 'a@b.com', name: 'Alice' },
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* Why this lives in the SDK and not the engine:
|
|
21
|
+
* - The runtime is tiny — `hc()` is a thin wrapper around `fetch`. No
|
|
22
|
+
* reason to duplicate it in every extension. SDK is the natural home.
|
|
23
|
+
* - The TYPE comes from the engine (whichever AppType the consumer
|
|
24
|
+
* wants to bind against). Extensions can also bind their OWN typed
|
|
25
|
+
* Hono routes — the factory is type-generic.
|
|
26
|
+
*
|
|
27
|
+
* Wraps `hc()` with two ergonomic additions:
|
|
28
|
+
* - `credentials: 'include'` by default so cookie-auth works without
|
|
29
|
+
* boilerplate at every call site.
|
|
30
|
+
* - Optional `headers` factory called per-request so auth tokens that
|
|
31
|
+
* change (e.g. CSRF) can flow without rebuilding the client.
|
|
32
|
+
*/
|
|
33
|
+
import { hc } from 'hono/client';
|
|
34
|
+
/**
|
|
35
|
+
* Build a Hono RPC client for the given app type.
|
|
36
|
+
*
|
|
37
|
+
* @typeParam T The Hono app type. For the Zveltio engine, import
|
|
38
|
+
* `ZveltioApi` from `@zveltio/engine/api-types`. For an
|
|
39
|
+
* extension's own routes, pass `typeof yourApp`.
|
|
40
|
+
*/
|
|
41
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
42
|
+
export function createRpcClient(opts) {
|
|
43
|
+
const baseUrl = opts.baseUrl.replace(/\/$/, '');
|
|
44
|
+
const includeCredentials = opts.includeCredentials !== false;
|
|
45
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
46
|
+
const customFetch = (async (input, init) => {
|
|
47
|
+
const dynHeaders = opts.getHeaders ? await opts.getHeaders() : {};
|
|
48
|
+
const merged = new Headers(init?.headers ?? {});
|
|
49
|
+
for (const [k, v] of Object.entries(opts.headers ?? {}))
|
|
50
|
+
merged.set(k, v);
|
|
51
|
+
for (const [k, v] of Object.entries(dynHeaders))
|
|
52
|
+
merged.set(k, v);
|
|
53
|
+
return (opts.fetch ?? fetch)(input, {
|
|
54
|
+
...init,
|
|
55
|
+
headers: merged,
|
|
56
|
+
credentials: includeCredentials ? 'include' : init?.credentials,
|
|
57
|
+
});
|
|
58
|
+
// Bun's `typeof fetch` includes a `preconnect` static which our wrapper
|
|
59
|
+
// doesn't reasonably proxy. Cast to silence — at call time hc() only
|
|
60
|
+
// invokes the function form.
|
|
61
|
+
});
|
|
62
|
+
return hc(baseUrl, { fetch: customFetch });
|
|
63
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQL → TypeScript codegen for extension-owned tables (S4-01).
|
|
3
|
+
*
|
|
4
|
+
* The aim: extensions' `ctx.db` is currently typed `any`, so a column rename
|
|
5
|
+
* is a silent runtime failure. This module parses an extension's migration
|
|
6
|
+
* SQL files and emits a `.d.ts` describing every table the extension owns,
|
|
7
|
+
* keyed for Kysely. Result: `ctx.db.selectFrom('zv_forms')` autocompletes
|
|
8
|
+
* column names in editors and `tsc` catches typos.
|
|
9
|
+
*
|
|
10
|
+
* Scope intentionally narrow:
|
|
11
|
+
* - Reads only the UP half of each file (everything before `-- DOWN`).
|
|
12
|
+
* - Handles `CREATE TABLE [IF NOT EXISTS]`, `ALTER TABLE … ADD COLUMN`
|
|
13
|
+
* and `ALTER TABLE … DROP COLUMN`.
|
|
14
|
+
* - Maps the common Postgres types we see in extension migrations to TS.
|
|
15
|
+
* - Ignores constraint-only ALTER TABLE statements (PRIMARY KEY, FK).
|
|
16
|
+
* - Ignores CREATE INDEX, CREATE TYPE, CREATE FUNCTION, etc.
|
|
17
|
+
*
|
|
18
|
+
* Anything more exotic falls back to `unknown` so downstream code still
|
|
19
|
+
* compiles. The migration author is free to widen this module's regex when
|
|
20
|
+
* a real case arises.
|
|
21
|
+
*/
|
|
22
|
+
export interface Column {
|
|
23
|
+
name: string;
|
|
24
|
+
/** TypeScript type (e.g. 'string', 'number | null', 'Record<string, unknown>'). */
|
|
25
|
+
tsType: string;
|
|
26
|
+
/** The raw Postgres type as parsed — useful for codegen comments. */
|
|
27
|
+
pgType: string;
|
|
28
|
+
nullable: boolean;
|
|
29
|
+
}
|
|
30
|
+
export interface Table {
|
|
31
|
+
name: string;
|
|
32
|
+
columns: Column[];
|
|
33
|
+
}
|
|
34
|
+
export interface ParsedSchema {
|
|
35
|
+
tables: Table[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse a single CREATE TABLE body — the text between the outer parens —
|
|
39
|
+
* into a list of columns. Constraint-only clauses (PRIMARY KEY (…), FOREIGN
|
|
40
|
+
* KEY (…), CHECK (…), UNIQUE (…), CONSTRAINT …) are skipped.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseColumnList(body: string): Column[];
|
|
43
|
+
/**
|
|
44
|
+
* Parse one or more migration SQL strings into a normalized schema. Tables
|
|
45
|
+
* are merged across files: `CREATE TABLE foo (...)` followed by
|
|
46
|
+
* `ALTER TABLE foo ADD COLUMN bar text` produces a single `foo` table with
|
|
47
|
+
* `bar` appended. Last write wins for column re-declarations.
|
|
48
|
+
*/
|
|
49
|
+
export declare function parseSchema(sqlChunks: string[]): ParsedSchema;
|
|
50
|
+
export interface CodegenOptions {
|
|
51
|
+
/** Top-level interface name (default: `ExtensionSchema`). */
|
|
52
|
+
interfaceName?: string;
|
|
53
|
+
/** Optional banner line above the file body (e.g. provenance comment). */
|
|
54
|
+
banner?: string;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Emit a Kysely-friendly `.d.ts`-style module body for a parsed schema.
|
|
58
|
+
* The result is plain TypeScript; callers write it wherever (typically
|
|
59
|
+
* `<extension>/.zveltio/db.d.ts`).
|
|
60
|
+
*/
|
|
61
|
+
export declare function emitTypeScript(schema: ParsedSchema, opts?: CodegenOptions): string;
|
|
62
|
+
/**
|
|
63
|
+
* TypeScript input type of each core field type. The engine registers the same
|
|
64
|
+
* types in `field-types/index.ts`; a unit test there keeps the two equal.
|
|
65
|
+
*/
|
|
66
|
+
export declare const CORE_FIELD_TS_TYPES: Readonly<Record<string, string>>;
|
|
67
|
+
export interface CollectionShape {
|
|
68
|
+
name: string;
|
|
69
|
+
fields: {
|
|
70
|
+
name: string;
|
|
71
|
+
type: string;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
}[];
|
|
74
|
+
}
|
|
75
|
+
/** A type `tsTypeOf` does not know is `any`. */
|
|
76
|
+
export declare function emitCollectionTypes(collection: CollectionShape, tsTypeOf?: (type: string) => string | undefined): string;
|
|
77
|
+
/** The whole `zveltio.d.ts`. */
|
|
78
|
+
export declare function emitCollectionTypesFile(collections: CollectionShape[], tsTypeOf?: (type: string) => string | undefined): string;
|
|
79
|
+
/**
|
|
80
|
+
* The collections of a schema directory, as `{ path: content }` (the shape
|
|
81
|
+
* `zveltio schema pull` writes), in name order.
|
|
82
|
+
*/
|
|
83
|
+
export declare function collectionsFromSchemaFiles(files: Record<string, string>): CollectionShape[];
|
|
84
|
+
//# sourceMappingURL=schema-codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-codegen.d.ts","sourceRoot":"","sources":["../src/schema-codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAoND;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA+BtD;AA6BD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,YAAY,CAoE7D;AAID,MAAM,WAAW,cAAc;IAC7B,6DAA6D;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,GAAE,cAAmB,GAAG,MAAM,CA0BtF;AAaD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAuDhE,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;CAC9D;AAED,gDAAgD;AAChD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,eAAe,EAC3B,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAyC,GAC7E,MAAM,CAeR;AAED,gCAAgC;AAChC,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,eAAe,EAAE,EAC9B,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,GAC9C,MAAM,CAGR;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,eAAe,EAAE,CAQ3F"}
|