@zveltio/sdk 3.0.0-beta.1 → 3.0.0-beta.101
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/client.d.ts +103 -7
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +117 -27
- 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 +20 -0
- package/dist/ddl/index.d.ts.map +1 -1
- 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 +1086 -38
- package/dist/extension/index.d.ts.map +1 -1
- package/dist/extension/index.js +16 -0
- 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 +15 -0
- package/dist/extension/permission-gate.d.ts.map +1 -1
- package/dist/extension/permission-gate.js +33 -1
- 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 +3 -1
- 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 +92 -13
- package/dist/offline/index.d.ts +25 -55
- package/dist/offline/index.d.ts.map +1 -1
- package/dist/offline/index.js +173 -157
- package/dist/publish/index.d.ts.map +1 -1
- package/dist/publish/index.js +6 -1
- package/dist/realtime.d.ts +25 -1
- package/dist/realtime.d.ts.map +1 -1
- package/dist/realtime.js +47 -3
- package/dist/rpc/index.d.ts.map +1 -1
- package/dist/rpc/index.js +2 -0
- package/dist/schema-codegen.d.ts +25 -1
- package/dist/schema-codegen.d.ts.map +1 -1
- package/dist/schema-codegen.js +141 -7
- package/dist/schema-watcher.d.ts +10 -2
- package/dist/schema-watcher.d.ts.map +1 -1
- package/dist/schema-watcher.js +25 -10
- package/dist/studio/index.d.ts +1 -0
- package/dist/studio/index.d.ts.map +1 -1
- package/dist/studio/index.js +3 -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 +173 -15
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +23 -1
- package/dist/testing/with-test-db.d.ts +1 -1
- package/dist/testing/with-test-db.d.ts.map +1 -1
- package/dist/testing/with-test-db.js +22 -15
- 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/validate/index.d.ts +53 -0
- package/dist/validate/index.d.ts.map +1 -1
- package/dist/validate/index.js +693 -7
- package/dist/validate/migration-parse.d.ts +10 -5
- package/dist/validate/migration-parse.d.ts.map +1 -1
- package/dist/validate/migration-parse.js +1 -1
- 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 +8 -8
- 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 -85
- package/dist/client/RealtimeClient.d.ts +0 -22
- package/dist/client/RealtimeClient.d.ts.map +0 -1
- package/dist/client/RealtimeClient.js +0 -98
- package/dist/client/ZveltioClient.d.ts +0 -20
- package/dist/client/ZveltioClient.d.ts.map +0 -1
- package/dist/client/ZveltioClient.js +0 -78
- package/dist/generate-types.d.ts +0 -37
- package/dist/generate-types.d.ts.map +0 -1
- package/dist/generate-types.js +0 -157
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ const client = createZveltioClient<ZveltioSchema>({
|
|
|
57
57
|
|
|
58
58
|
```typescript
|
|
59
59
|
// TypeScript knows the shape of each record automatically
|
|
60
|
-
const {
|
|
60
|
+
const { records: products } = await client.collection('products').list();
|
|
61
61
|
// ^-- typed as Products[] (from your generated CollectionTypeMap)
|
|
62
62
|
|
|
63
63
|
const order = await client.collection('orders').getOne('ord-123');
|
|
@@ -186,6 +186,19 @@ await sync.stop();
|
|
|
186
186
|
The engine exposes two endpoints for batch sync:
|
|
187
187
|
|
|
188
188
|
- `POST /api/sync/push` — send offline operations to server
|
|
189
|
-
- `POST /api/sync/pull` — pull changes
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
- `POST /api/sync/pull` — pull changes after your cursors
|
|
190
|
+
|
|
191
|
+
`SyncManager.pull()` uses `/api/sync/pull` and keeps its cursors in the local store. Both endpoints take a
|
|
192
|
+
session only: a client authenticated by an API key gets 403, and `pull()` then falls back to paging the
|
|
193
|
+
collections API, which cannot report deletes.
|
|
194
|
+
|
|
195
|
+
A pull returns at most 1000 rows per collection. Send `{ collections, cursors }`, merge the
|
|
196
|
+
response's `cursors` into yours, and pull again while `hasMore` is true. Keep `cursors` for the next
|
|
197
|
+
sync; a collection without one is read from its start. Cursors are opaque: there is no timestamp
|
|
198
|
+
position, because a timestamp cannot page through rows sharing one `updated_at` (a bulk import).
|
|
199
|
+
|
|
200
|
+
A row deleted on the server comes back as `{ operation: 'delete', data: null }`; drop your copy. Deletes are
|
|
201
|
+
kept for 30 days: a cursor last caught up longer ago than that, or one the engine cannot open (an older engine's, or sealed
|
|
202
|
+
under a rotated `BETTER_AUTH_SECRET`), gets `resync[collection] === true`, and the collection restarts
|
|
203
|
+
from the first row — drop your synced copies of it before applying the page. A first pull (no cursor) gets
|
|
204
|
+
no deletes, so start it from an empty copy.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,8 +1,55 @@
|
|
|
1
1
|
export interface ZveltioClientConfig {
|
|
2
2
|
baseUrl: string;
|
|
3
3
|
apiKey?: string;
|
|
4
|
+
/**
|
|
5
|
+
* A session token for a client with no cookie jar (native app, server): sent as
|
|
6
|
+
* `Authorization: Bearer`, with cookies off. Giving this or `onSessionToken`
|
|
7
|
+
* turns that mode on; a browser leaves both unset and keeps the httpOnly cookie.
|
|
8
|
+
*/
|
|
9
|
+
sessionToken?: string;
|
|
10
|
+
/**
|
|
11
|
+
* Called with each token the engine issues (sign-in, a session it replaces) and
|
|
12
|
+
* with `null` on logout: persist it here and pass it back as `sessionToken`.
|
|
13
|
+
*/
|
|
14
|
+
onSessionToken?: (token: string | null) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Called when the engine answers 403 `step_up_required` (a configuration change,
|
|
17
|
+
* or an action that wants a fresh second factor). Confirm the user's passkey or
|
|
18
|
+
* TOTP for `action` and resolve with the step-up token; the call is then sent
|
|
19
|
+
* once more with it. Resolve `null` to give up: the 403 is thrown as before.
|
|
20
|
+
*/
|
|
21
|
+
onStepUpRequired?: (action: string) => Promise<string | null>;
|
|
4
22
|
headers?: Record<string, string>;
|
|
5
23
|
}
|
|
24
|
+
/** `GET /api/api-keys/self` — the key a client authenticates with, as the engine holds it. */
|
|
25
|
+
export interface ApiKeySelf {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
key_prefix: string;
|
|
29
|
+
scopes: Array<{
|
|
30
|
+
collection: string;
|
|
31
|
+
actions: string[];
|
|
32
|
+
}>;
|
|
33
|
+
tenant_id: string | null;
|
|
34
|
+
expires_at: string | null;
|
|
35
|
+
rls_bypass: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** A key in `GET /api/me/api-keys` — never the hash or the raw key. */
|
|
38
|
+
export interface MemberApiKey extends ApiKeySelf {
|
|
39
|
+
last_used_at: string | null;
|
|
40
|
+
created_at: string;
|
|
41
|
+
is_active: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** `POST /api/me/api-keys`: explicit scopes and an expiry at most one year out. */
|
|
44
|
+
export interface MemberApiKeyInput {
|
|
45
|
+
name: string;
|
|
46
|
+
scopes: Array<{
|
|
47
|
+
collection: string;
|
|
48
|
+
actions: string[];
|
|
49
|
+
}>;
|
|
50
|
+
expires_at: string;
|
|
51
|
+
rls_bypass?: boolean;
|
|
52
|
+
}
|
|
6
53
|
export interface ListParams {
|
|
7
54
|
page?: number;
|
|
8
55
|
limit?: number;
|
|
@@ -12,16 +59,29 @@ export interface ListParams {
|
|
|
12
59
|
filter?: Record<string, any>;
|
|
13
60
|
cursor?: string;
|
|
14
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* What `GET /api/data/:collection` answers (`listRecords` in the engine). This
|
|
64
|
+
* declared `{ data, total, page, limit }`, a shape the engine has never sent, so
|
|
65
|
+
* every typed reader of `.data` got `undefined` — the sync manager's paged pull
|
|
66
|
+
* among them, which applied no row at all.
|
|
67
|
+
*/
|
|
15
68
|
export interface ListResult<T> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
69
|
+
records: T[];
|
|
70
|
+
pagination: {
|
|
71
|
+
/** Absent when the count was skipped. */
|
|
72
|
+
total?: number;
|
|
73
|
+
page: number;
|
|
74
|
+
limit: number;
|
|
75
|
+
pages?: number;
|
|
76
|
+
};
|
|
20
77
|
next_cursor?: string;
|
|
21
78
|
}
|
|
22
79
|
declare class CollectionRef<T extends Record<string, any>> {
|
|
23
|
-
private readonly name;
|
|
24
80
|
private readonly client;
|
|
81
|
+
/** URL-encoded once, here: a record id is caller data (a slug, an email, a
|
|
82
|
+
* composite key), and an unencoded `/`, `?` or `#` in one silently routes
|
|
83
|
+
* the request somewhere else. */
|
|
84
|
+
private readonly path;
|
|
25
85
|
constructor(name: string, client: ZveltioClient<any>);
|
|
26
86
|
list(params?: ListParams): Promise<ListResult<T>>;
|
|
27
87
|
getMany(params?: ListParams): Promise<ListResult<T>>;
|
|
@@ -40,7 +100,7 @@ declare class CollectionRef<T extends Record<string, any>> {
|
|
|
40
100
|
*
|
|
41
101
|
* import type { ZveltioSchema } from './zveltio-types';
|
|
42
102
|
* const client = createZveltioClient<ZveltioSchema>({ baseUrl: '...' });
|
|
43
|
-
* const {
|
|
103
|
+
* const { records } = await client.collection('products').list();
|
|
44
104
|
* // ^-- typed as your Products interface
|
|
45
105
|
*
|
|
46
106
|
* Usage without types (untyped, same as before):
|
|
@@ -49,7 +109,19 @@ declare class CollectionRef<T extends Record<string, any>> {
|
|
|
49
109
|
export declare class ZveltioClient<Schema extends Record<string, any> = Record<string, any>> {
|
|
50
110
|
private baseUrl;
|
|
51
111
|
private headers;
|
|
112
|
+
private bearer;
|
|
113
|
+
private sessionToken;
|
|
114
|
+
private onSessionToken?;
|
|
115
|
+
private onStepUpRequired?;
|
|
52
116
|
constructor(config: ZveltioClientConfig);
|
|
117
|
+
/** Switch to bearer mode with `token` (or sign this client out of it with `null`). */
|
|
118
|
+
setSessionToken(token: string | null): void;
|
|
119
|
+
/** The token bearer mode sends; null in cookie mode or when signed out. */
|
|
120
|
+
getSessionToken(): string | null;
|
|
121
|
+
/** Every call goes through here: the bearer out, a newly issued token in. */
|
|
122
|
+
private send;
|
|
123
|
+
private checked;
|
|
124
|
+
private sendOnce;
|
|
53
125
|
private request;
|
|
54
126
|
get<T = any>(path: string): Promise<T>;
|
|
55
127
|
post<T = any>(path: string, body?: unknown): Promise<T>;
|
|
@@ -69,8 +141,32 @@ export declare class ZveltioClient<Schema extends Record<string, any> = Record<s
|
|
|
69
141
|
readonly signup: (email: string, password: string, name: string) => Promise<any>;
|
|
70
142
|
readonly logout: () => Promise<any>;
|
|
71
143
|
readonly session: () => Promise<any>;
|
|
144
|
+
/**
|
|
145
|
+
* The API key this client was made with: its scopes, tenant, expiry and RLS
|
|
146
|
+
* exemption — never the hash. 403 for a session, 401 for a key that no
|
|
147
|
+
* longer authenticates.
|
|
148
|
+
*/
|
|
149
|
+
readonly apiKey: () => Promise<ApiKeySelf>;
|
|
150
|
+
/**
|
|
151
|
+
* The signed-in member's own keys (`/api/me/api-keys`, ADR 0010), when the
|
|
152
|
+
* instance lets members issue them. A session only; creating one needs a
|
|
153
|
+
* step-up, which `onStepUpRequired` answers. The raw `key` is returned once.
|
|
154
|
+
*/
|
|
155
|
+
readonly apiKeys: {
|
|
156
|
+
readonly list: () => Promise<{
|
|
157
|
+
api_keys: MemberApiKey[];
|
|
158
|
+
}>;
|
|
159
|
+
readonly create: (input: MemberApiKeyInput) => Promise<MemberApiKey & {
|
|
160
|
+
key: string;
|
|
161
|
+
}>;
|
|
162
|
+
readonly revoke: (id: string) => Promise<any>;
|
|
163
|
+
};
|
|
72
164
|
};
|
|
73
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Storage helpers. A client made with `apiKey` needs a key holding the `$storage`
|
|
167
|
+
* scope — `{ collection: '$storage', actions: ['read', 'create', 'delete'] }`; a
|
|
168
|
+
* `*` collection does not include it, and the engine answers 403 without it.
|
|
169
|
+
*/
|
|
74
170
|
readonly storage: {
|
|
75
171
|
readonly upload: (file: File, folder?: string) => Promise<any>;
|
|
76
172
|
readonly list: (folder?: string) => Promise<any>;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClC;AAED,8FAA8F;AAC9F,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IACzD,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,uEAAuE;AACvE,MAAM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AAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1F,MAAM,EAAE,mBAAmB,GAC1B,aAAa,CAAC,MAAM,CAAC,CAEvB"}
|
package/dist/client.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import { ZveltioApiError } from './errors.js';
|
|
2
|
+
/** The header a step-up token rides in (engine lib/step-up.ts). */
|
|
3
|
+
const STEP_UP_HEADER = 'X-Zveltio-Step-Up';
|
|
4
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
1
5
|
class CollectionRef {
|
|
2
|
-
name;
|
|
3
6
|
client;
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
/** URL-encoded once, here: a record id is caller data (a slug, an email, a
|
|
8
|
+
* composite key), and an unencoded `/`, `?` or `#` in one silently routes
|
|
9
|
+
* the request somewhere else. */
|
|
10
|
+
path;
|
|
11
|
+
constructor(name,
|
|
12
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
13
|
+
client) {
|
|
6
14
|
this.client = client;
|
|
15
|
+
this.path = `/api/data/${encodeURIComponent(name)}`;
|
|
7
16
|
}
|
|
8
17
|
list(params) {
|
|
9
18
|
const qs = new URLSearchParams();
|
|
@@ -22,25 +31,25 @@ class CollectionRef {
|
|
|
22
31
|
if (params?.cursor)
|
|
23
32
|
qs.set('cursor', params.cursor);
|
|
24
33
|
const q = qs.toString();
|
|
25
|
-
return this.client['request']('GET',
|
|
34
|
+
return this.client['request']('GET', `${this.path}${q ? `?${q}` : ''}`);
|
|
26
35
|
}
|
|
27
36
|
getMany(params) {
|
|
28
37
|
return this.list(params);
|
|
29
38
|
}
|
|
30
39
|
get(id) {
|
|
31
|
-
return this.client['request']('GET',
|
|
40
|
+
return this.client['request']('GET', `${this.path}/${encodeURIComponent(id)}`);
|
|
32
41
|
}
|
|
33
42
|
getOne(id) {
|
|
34
43
|
return this.get(id);
|
|
35
44
|
}
|
|
36
45
|
create(data) {
|
|
37
|
-
return this.client['request']('POST',
|
|
46
|
+
return this.client['request']('POST', this.path, data);
|
|
38
47
|
}
|
|
39
48
|
update(id, data) {
|
|
40
|
-
return this.client['request']('PATCH',
|
|
49
|
+
return this.client['request']('PATCH', `${this.path}/${encodeURIComponent(id)}`, data);
|
|
41
50
|
}
|
|
42
51
|
delete(id) {
|
|
43
|
-
return this.client['request']('DELETE',
|
|
52
|
+
return this.client['request']('DELETE', `${this.path}/${encodeURIComponent(id)}`);
|
|
44
53
|
}
|
|
45
54
|
}
|
|
46
55
|
/**
|
|
@@ -50,15 +59,20 @@ class CollectionRef {
|
|
|
50
59
|
*
|
|
51
60
|
* import type { ZveltioSchema } from './zveltio-types';
|
|
52
61
|
* const client = createZveltioClient<ZveltioSchema>({ baseUrl: '...' });
|
|
53
|
-
* const {
|
|
62
|
+
* const { records } = await client.collection('products').list();
|
|
54
63
|
* // ^-- typed as your Products interface
|
|
55
64
|
*
|
|
56
65
|
* Usage without types (untyped, same as before):
|
|
57
66
|
* const client = createZveltioClient({ baseUrl: '...' });
|
|
58
67
|
*/
|
|
68
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
59
69
|
export class ZveltioClient {
|
|
60
70
|
baseUrl;
|
|
61
71
|
headers;
|
|
72
|
+
bearer;
|
|
73
|
+
sessionToken;
|
|
74
|
+
onSessionToken;
|
|
75
|
+
onStepUpRequired;
|
|
62
76
|
constructor(config) {
|
|
63
77
|
this.baseUrl = config.baseUrl.replace(/\/$/, '');
|
|
64
78
|
this.headers = {
|
|
@@ -66,45 +80,90 @@ export class ZveltioClient {
|
|
|
66
80
|
...(config.apiKey ? { 'X-API-Key': config.apiKey } : {}),
|
|
67
81
|
...config.headers,
|
|
68
82
|
};
|
|
83
|
+
this.bearer = config.sessionToken !== undefined || config.onSessionToken !== undefined;
|
|
84
|
+
this.sessionToken = config.sessionToken ?? null;
|
|
85
|
+
this.onSessionToken = config.onSessionToken;
|
|
86
|
+
this.onStepUpRequired = config.onStepUpRequired;
|
|
87
|
+
}
|
|
88
|
+
/** Switch to bearer mode with `token` (or sign this client out of it with `null`). */
|
|
89
|
+
setSessionToken(token) {
|
|
90
|
+
this.bearer = true;
|
|
91
|
+
this.sessionToken = token;
|
|
92
|
+
this.onSessionToken?.(token);
|
|
93
|
+
}
|
|
94
|
+
/** The token bearer mode sends; null in cookie mode or when signed out. */
|
|
95
|
+
getSessionToken() {
|
|
96
|
+
return this.sessionToken;
|
|
97
|
+
}
|
|
98
|
+
/** Every call goes through here: the bearer out, a newly issued token in. */
|
|
99
|
+
async send(path, init) {
|
|
100
|
+
const res = await this.sendOnce(path, init);
|
|
101
|
+
if (res.status !== 403 || !this.onStepUpRequired)
|
|
102
|
+
return this.checked(res);
|
|
103
|
+
const err = await ZveltioApiError.fromResponse(res);
|
|
104
|
+
if (err.code !== 'step_up_required')
|
|
105
|
+
throw err;
|
|
106
|
+
const action = err.errors?.action;
|
|
107
|
+
const token = typeof action === 'string' ? await this.onStepUpRequired(action) : null;
|
|
108
|
+
if (!token)
|
|
109
|
+
throw err;
|
|
110
|
+
return this.checked(await this.sendOnce(path, {
|
|
111
|
+
...init,
|
|
112
|
+
headers: { ...init.headers, [STEP_UP_HEADER]: token },
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
async checked(res) {
|
|
116
|
+
if (!res.ok)
|
|
117
|
+
throw await ZveltioApiError.fromResponse(res);
|
|
118
|
+
return res;
|
|
69
119
|
}
|
|
70
|
-
async
|
|
120
|
+
async sendOnce(path, init) {
|
|
71
121
|
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
122
|
+
...init,
|
|
123
|
+
headers: this.bearer && this.sessionToken
|
|
124
|
+
? { ...init.headers, Authorization: `Bearer ${this.sessionToken}` }
|
|
125
|
+
: init.headers,
|
|
126
|
+
// A cookie jar beside the bearer would carry a session the bearer then overrides.
|
|
127
|
+
credentials: this.bearer ? 'omit' : 'include',
|
|
128
|
+
});
|
|
129
|
+
const issued = this.bearer ? res.headers.get('set-auth-token') : null;
|
|
130
|
+
if (issued && issued !== this.sessionToken)
|
|
131
|
+
this.setSessionToken(issued);
|
|
132
|
+
return res;
|
|
133
|
+
}
|
|
134
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
135
|
+
async request(method, path, body) {
|
|
136
|
+
const res = await this.send(path, {
|
|
72
137
|
method,
|
|
73
138
|
headers: this.headers,
|
|
74
|
-
credentials: 'include',
|
|
75
139
|
body: body ? JSON.stringify(body) : undefined,
|
|
76
140
|
});
|
|
77
|
-
if (!res.ok) {
|
|
78
|
-
const text = await res.text().catch(() => '');
|
|
79
|
-
throw new Error(`${method} ${path} failed: ${res.status} ${text}`);
|
|
80
|
-
}
|
|
81
141
|
return res.json();
|
|
82
142
|
}
|
|
143
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
83
144
|
get(path) {
|
|
84
145
|
return this.request('GET', path);
|
|
85
146
|
}
|
|
147
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
86
148
|
post(path, body) {
|
|
87
149
|
return this.request('POST', path, body);
|
|
88
150
|
}
|
|
151
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
89
152
|
patch(path, body) {
|
|
90
153
|
return this.request('PATCH', path, body);
|
|
91
154
|
}
|
|
155
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
92
156
|
delete(path) {
|
|
93
157
|
return this.request('DELETE', path);
|
|
94
158
|
}
|
|
159
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
95
160
|
async upload(path, formData) {
|
|
96
161
|
const headers = { ...this.headers };
|
|
97
162
|
delete headers['Content-Type'];
|
|
98
|
-
const res = await
|
|
99
|
-
method: 'POST',
|
|
100
|
-
headers,
|
|
101
|
-
credentials: 'include',
|
|
102
|
-
body: formData,
|
|
103
|
-
});
|
|
104
|
-
if (!res.ok)
|
|
105
|
-
throw new Error(`Upload ${path} failed: ${res.status}`);
|
|
163
|
+
const res = await this.send(path, { method: 'POST', headers, body: formData });
|
|
106
164
|
return res.json();
|
|
107
165
|
}
|
|
166
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
108
167
|
collection(name) {
|
|
109
168
|
return new CollectionRef(name, this);
|
|
110
169
|
}
|
|
@@ -112,22 +171,53 @@ export class ZveltioClient {
|
|
|
112
171
|
auth = {
|
|
113
172
|
login: (email, password) => this.request('POST', '/api/auth/sign-in/email', { email, password }),
|
|
114
173
|
signup: (email, password, name) => this.request('POST', '/api/auth/sign-up/email', { email, password, name }),
|
|
115
|
-
logout: () =>
|
|
174
|
+
logout: async () => {
|
|
175
|
+
try {
|
|
176
|
+
return await this.request('POST', '/api/auth/sign-out');
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
if (this.bearer)
|
|
180
|
+
this.setSessionToken(null);
|
|
181
|
+
}
|
|
182
|
+
},
|
|
116
183
|
session: () => this.request('GET', '/api/auth/get-session'),
|
|
184
|
+
/**
|
|
185
|
+
* The API key this client was made with: its scopes, tenant, expiry and RLS
|
|
186
|
+
* exemption — never the hash. 403 for a session, 401 for a key that no
|
|
187
|
+
* longer authenticates.
|
|
188
|
+
*/
|
|
189
|
+
apiKey: () => this.request('GET', '/api/api-keys/self'),
|
|
190
|
+
/**
|
|
191
|
+
* The signed-in member's own keys (`/api/me/api-keys`, ADR 0010), when the
|
|
192
|
+
* instance lets members issue them. A session only; creating one needs a
|
|
193
|
+
* step-up, which `onStepUpRequired` answers. The raw `key` is returned once.
|
|
194
|
+
*/
|
|
195
|
+
apiKeys: {
|
|
196
|
+
list: () => this.request('GET', '/api/me/api-keys'),
|
|
197
|
+
create: (input) => this.request('POST', '/api/me/api-keys', input),
|
|
198
|
+
revoke: (id) => this.request('DELETE', `/api/me/api-keys/${encodeURIComponent(id)}`),
|
|
199
|
+
},
|
|
117
200
|
};
|
|
118
|
-
/**
|
|
201
|
+
/**
|
|
202
|
+
* Storage helpers. A client made with `apiKey` needs a key holding the `$storage`
|
|
203
|
+
* scope — `{ collection: '$storage', actions: ['read', 'create', 'delete'] }`; a
|
|
204
|
+
* `*` collection does not include it, and the engine answers 403 without it.
|
|
205
|
+
*/
|
|
119
206
|
storage = {
|
|
120
207
|
upload: (file, folder) => {
|
|
121
208
|
const fd = new FormData();
|
|
122
209
|
fd.append('file', file);
|
|
210
|
+
// The engine reads `folder_id`; a `folder` field is ignored and the file
|
|
211
|
+
// lands in the root.
|
|
123
212
|
if (folder)
|
|
124
|
-
fd.append('
|
|
213
|
+
fd.append('folder_id', folder);
|
|
125
214
|
return this.upload('/api/storage/upload', fd);
|
|
126
215
|
},
|
|
127
|
-
list: (folder) => this.get(`/api/storage${folder ? `?
|
|
216
|
+
list: (folder) => this.get(`/api/storage${folder ? `?folder_id=${encodeURIComponent(folder)}` : ''}`),
|
|
128
217
|
delete: (key) => this.delete(`/api/storage/${encodeURIComponent(key)}`),
|
|
129
218
|
};
|
|
130
219
|
}
|
|
220
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
131
221
|
export function createZveltioClient(config) {
|
|
132
222
|
return new ZveltioClient(config);
|
|
133
223
|
}
|
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAIrD,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,E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,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,SAAS,CAAC,CAGpB;AAID,wBAAsB,UAAU,CAC9B,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,IAAI,EACV,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC,CAItB;AAED,wBAAsB,SAAS,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAI9F;AAED,wBAAsB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF;AAID,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,eAAe,EACzB,UAAU,EAAE,MAAM,EAElB,QAAQ,EAAE,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,GAAG,CAAA;CAAE,KAAK,IAAI,GACrD,MAAM,IAAI,CAGZ"}
|
package/dist/core.js
CHANGED
|
@@ -6,20 +6,31 @@
|
|
|
6
6
|
* state primitives (useState/ref) and lifecycle hooks (useEffect/onMounted).
|
|
7
7
|
*/
|
|
8
8
|
// ── Collection ────────────────────────────────────────────────────────────────
|
|
9
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
9
10
|
export async function fetchCollection(client, collectionName, options) {
|
|
11
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
10
12
|
const result = await client.collection(collectionName).list(options);
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
11
14
|
return result?.data ?? result?.records ?? result ?? [];
|
|
12
15
|
}
|
|
16
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
13
17
|
export async function fetchRecord(client, collectionName, id) {
|
|
14
18
|
const result = await client.collection(collectionName).get(id);
|
|
19
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
15
20
|
return result?.data ?? result?.record ?? result ?? null;
|
|
16
21
|
}
|
|
22
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
17
23
|
export async function createRecord(client, collectionName, data) {
|
|
24
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
18
25
|
const result = await client.collection(collectionName).create(data);
|
|
26
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
19
27
|
return result?.data ?? result?.record ?? result;
|
|
20
28
|
}
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
21
30
|
export async function updateRecord(client, collectionName, id, data) {
|
|
31
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
22
32
|
const result = await client.collection(collectionName).update(id, data);
|
|
33
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
23
34
|
return result?.data ?? result?.record ?? result;
|
|
24
35
|
}
|
|
25
36
|
export async function deleteRecord(client, collectionName, id) {
|
|
@@ -28,8 +39,10 @@ export async function deleteRecord(client, collectionName, id) {
|
|
|
28
39
|
// ── Auth ──────────────────────────────────────────────────────────────────────
|
|
29
40
|
export async function fetchSession(client) {
|
|
30
41
|
try {
|
|
31
|
-
|
|
32
|
-
|
|
42
|
+
// `/api/auth/get-session` answers `{ session, user }` (or null): `session`
|
|
43
|
+
// is the envelope's own member, not the envelope.
|
|
44
|
+
const res = await client.auth.session();
|
|
45
|
+
return { user: res?.user ?? null, session: res?.session ?? null };
|
|
33
46
|
}
|
|
34
47
|
catch {
|
|
35
48
|
return { user: null, session: null };
|
|
@@ -50,16 +63,21 @@ export async function signupUser(client, email, password, name) {
|
|
|
50
63
|
// ── Storage ───────────────────────────────────────────────────────────────────
|
|
51
64
|
export async function uploadFile(client, file, folder) {
|
|
52
65
|
const result = await client.storage.upload(file, folder);
|
|
66
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
53
67
|
return result?.data ?? result?.file ?? result;
|
|
54
68
|
}
|
|
55
69
|
export async function listFiles(client, folder) {
|
|
56
70
|
const result = await client.storage.list(folder);
|
|
71
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
57
72
|
return result?.data ?? result?.files ?? result ?? [];
|
|
58
73
|
}
|
|
59
74
|
export async function removeFile(client, fileId) {
|
|
60
75
|
await client.storage.delete(fileId);
|
|
61
76
|
}
|
|
62
77
|
// ── Realtime ──────────────────────────────────────────────────────────────────
|
|
63
|
-
export function subscribeToCollection(realtime, collection,
|
|
78
|
+
export function subscribeToCollection(realtime, collection,
|
|
79
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
80
|
+
callback) {
|
|
81
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
64
82
|
return realtime.subscribe(collection, callback);
|
|
65
83
|
}
|
package/dist/crdt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crdt.d.ts","sourceRoot":"","sources":["../src/crdt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"crdt.d.ts","sourceRoot":"","sources":["../src/crdt.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,GAAG;IAC/B,KAAK,EAAE,CAAC,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEnD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,W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,IAAI,MAAM;IAId,uDAAuD;IACvD,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAKhC,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,EAAE,IAAI,MAAM,CAEf;CACF"}
|
package/dist/crdt.js
CHANGED
|
@@ -27,7 +27,9 @@ export function mergeLWW(local, remote) {
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
29
29
|
/** Convert a plain record to an LWW document */
|
|
30
|
-
export function toDocument(
|
|
30
|
+
export function toDocument(
|
|
31
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
32
|
+
data, lamport, clientId) {
|
|
31
33
|
const doc = {};
|
|
32
34
|
for (const [key, value] of Object.entries(data)) {
|
|
33
35
|
doc[key] = { value, lamport, clientId };
|
|
@@ -35,7 +37,9 @@ export function toDocument(data, lamport, clientId) {
|
|
|
35
37
|
return doc;
|
|
36
38
|
}
|
|
37
39
|
/** Extract plain data from an LWW document */
|
|
40
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
38
41
|
export function fromDocument(doc) {
|
|
42
|
+
// biome-ignore lint/suspicious/noExplicitAny: legacy any; tracked in hardening plan item H-01
|
|
39
43
|
const data = {};
|
|
40
44
|
for (const [key, field] of Object.entries(doc)) {
|
|
41
45
|
data[key] = field.value;
|
|
@@ -57,7 +61,12 @@ export function orSetMerge(local, remote) {
|
|
|
57
61
|
merged.set(el.uid, el);
|
|
58
62
|
}
|
|
59
63
|
}
|
|
60
|
-
|
|
64
|
+
// Tombstones stay in the set. Dropping them loses the only record that the
|
|
65
|
+
// element was ever removed, so the next merge against a replica that still
|
|
66
|
+
// holds it as present reads it as a new addition and resurrects it — the exact
|
|
67
|
+
// outcome an observed-remove set exists to prevent. `orSetValues` is what
|
|
68
|
+
// hides removed elements from callers.
|
|
69
|
+
return Array.from(merged.values());
|
|
61
70
|
}
|
|
62
71
|
export function orSetValues(set) {
|
|
63
72
|
return set.filter((el) => !el.removed).map((el) => el.value);
|
package/dist/ddl/index.d.ts
CHANGED
|
@@ -83,6 +83,21 @@ export interface CollectionDefinition {
|
|
|
83
83
|
isManaged?: boolean;
|
|
84
84
|
isSystem?: boolean;
|
|
85
85
|
schemaLocked?: boolean;
|
|
86
|
+
/** Create even though access rules already name `name`; without it the
|
|
87
|
+
* create throws (`code: 'existing_rules'`) and the rules take effect on
|
|
88
|
+
* nothing. With it they take effect on the new collection. */
|
|
89
|
+
adoptRules?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/** A row from `zvd_relations`, as `getRelations` returns it. */
|
|
92
|
+
export interface RelationRecord {
|
|
93
|
+
id: string;
|
|
94
|
+
name: string;
|
|
95
|
+
type: string;
|
|
96
|
+
source_collection: string;
|
|
97
|
+
source_field: string;
|
|
98
|
+
target_collection: string;
|
|
99
|
+
target_field: string | null;
|
|
100
|
+
junction_table: string | null;
|
|
86
101
|
}
|
|
87
102
|
/** A row from `zv_collections` / `getCollection` / `getCollections`. The
|
|
88
103
|
* exact shape is engine-internal; this interface only fixes the fields
|
|
@@ -135,6 +150,8 @@ export interface DDLManager {
|
|
|
135
150
|
removeField(db: DDLManagerDb, collectionName: string, fieldName: string): Promise<void>;
|
|
136
151
|
/** List every collection registered in `zv_collections`. */
|
|
137
152
|
getCollections(db: DDLManagerDb): Promise<CollectionRecord[]>;
|
|
153
|
+
/** Every registered relation, or only those whose source or target is `collection`. */
|
|
154
|
+
getRelations(db: DDLManagerDb, collection?: string): Promise<RelationRecord[]>;
|
|
138
155
|
/** Read a single collection by name. Returns `null` when missing. */
|
|
139
156
|
getCollection(db: DDLManagerDb, name: string): Promise<CollectionRecord | null>;
|
|
140
157
|
/** Update display-only metadata (label, description, icon, sort, etc.). */
|
|
@@ -142,6 +159,9 @@ export interface DDLManager {
|
|
|
142
159
|
/** Introspect the live PG table and return its field configs. Useful for
|
|
143
160
|
* extensions that auto-discover schema changes. */
|
|
144
161
|
introspectTable(db: DDLManagerDb, collectionName: string): Promise<FieldDefinition[]>;
|
|
162
|
+
/** Every physical column of the collection's table, system columns included,
|
|
163
|
+
* in table order; `[]` when the table does not exist. */
|
|
164
|
+
columnNames(db: DDLManagerDb, collectionName: string): Promise<string[]>;
|
|
145
165
|
/** Re-read PG and write the result back to `zv_collections.fields`. Returns
|
|
146
166
|
* the number of changes detected. */
|
|
147
167
|
syncFieldsFromDB(db: DDLManagerDb, collectionName: string): Promise<number>;
|
package/dist/ddl/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ddl/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,OAAO,EAAE,CAAC,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,iEAAiE;IACjE,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qDAAqD;IACrD,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,GA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