@antelopejs/interface-dms-builder 0.4.0 → 0.5.0

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.
Files changed (52) hide show
  1. package/README.md +4 -4
  2. package/dist/addressing.d.ts +6 -0
  3. package/dist/analysis.d.ts +73 -0
  4. package/dist/analysis.js +18 -1
  5. package/dist/analysis.js.map +1 -1
  6. package/dist/catalog.d.ts +139 -1
  7. package/dist/compose.d.ts +44 -0
  8. package/dist/compose.js +7 -0
  9. package/dist/compose.js.map +1 -1
  10. package/dist/database.d.ts +230 -0
  11. package/dist/database.js +80 -0
  12. package/dist/database.js.map +1 -0
  13. package/dist/drafts.d.ts +61 -0
  14. package/dist/drafts.js +21 -0
  15. package/dist/drafts.js.map +1 -1
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +2 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/mapping.d.ts +122 -0
  20. package/dist/mapping.js +15 -0
  21. package/dist/mapping.js.map +1 -1
  22. package/dist/operation-map.d.ts +27 -1
  23. package/dist/operation-map.js +22 -0
  24. package/dist/operation-map.js.map +1 -1
  25. package/dist/operations.d.ts +57 -0
  26. package/dist/operations.js +18 -0
  27. package/dist/operations.js.map +1 -1
  28. package/dist/project.d.ts +63 -1
  29. package/dist/project.js +10 -0
  30. package/dist/project.js.map +1 -1
  31. package/dist/queries.d.ts +125 -0
  32. package/dist/resources.d.ts +132 -0
  33. package/dist/resources.js +9 -0
  34. package/dist/resources.js.map +1 -1
  35. package/dist/results.d.ts +49 -1
  36. package/dist/structure.d.ts +42 -0
  37. package/dist/table-view.d.ts +49 -0
  38. package/dist/table-view.js +7 -0
  39. package/dist/table-view.js.map +1 -1
  40. package/dist/theme.d.ts +144 -0
  41. package/dist/theme.js +46 -0
  42. package/dist/theme.js.map +1 -0
  43. package/dist/values.d.ts +64 -0
  44. package/dist/values.js +7 -0
  45. package/dist/values.js.map +1 -1
  46. package/docs/1.introduction.md +3 -0
  47. package/docs/10.a-chart-without-code.md +7 -7
  48. package/docs/11.external-databases.md +16 -11
  49. package/docs/11.theme-and-branding.md +135 -0
  50. package/docs/12.connect-a-database.md +87 -0
  51. package/docs/4.page-operations.md +1 -1
  52. package/package.json +15 -8
@@ -0,0 +1,230 @@
1
+ import type { ProjectConfigOpts, ProjectConfigResult } from "./project";
2
+ import type { OpResult } from "./results";
3
+ /**
4
+ * The engines a database can be checked on, by the name `CheckDatabaseConnection` takes, each with
5
+ * the URL schemes it accepts, colon included. `mysql` covers MariaDB too: the same client and the
6
+ * same catalog answer both.
7
+ */
8
+ export declare const DATABASE_ENGINE_SCHEMES: {
9
+ readonly postgres: readonly ["postgres:", "postgresql:"];
10
+ readonly mysql: readonly ["mysql:"];
11
+ readonly mongodb: readonly ["mongodb:", "mongodb+srv:"];
12
+ readonly rethinkdb: readonly ["rethinkdb:"];
13
+ };
14
+ /** An engine of `DATABASE_ENGINE_SCHEMES`. */
15
+ export type DatabaseEngine = keyof typeof DATABASE_ENGINE_SCHEMES;
16
+ /** The database to check: its engine, and a URL of that engine's scheme. */
17
+ export interface DatabaseCheckInput {
18
+ engine: DatabaseEngine;
19
+ url: string;
20
+ }
21
+ /** What a live check of a database found. */
22
+ export interface DatabaseAccess {
23
+ /** Whether a server answered, even to refuse the sign-in. */
24
+ reachable: boolean;
25
+ /** The round trip of the first query the signed-in account made. */
26
+ latencyMs?: number;
27
+ /** The account the server reports. */
28
+ user?: string;
29
+ canRead: boolean;
30
+ canWrite: boolean;
31
+ /** A short sentence for the person who connects, whenever the database cannot be read. Never holds the URL, the password or a query. */
32
+ reason?: string;
33
+ }
34
+ /** One of the builder's catalog connections, with what its provider's `Info()` answers about it. */
35
+ export interface CatalogConnectionEntry {
36
+ id: string;
37
+ /** The engine's name, e.g. `postgresql`. */
38
+ engine?: string;
39
+ /** The server's version. */
40
+ version?: string;
41
+ /** The database the connection is on. */
42
+ database?: string;
43
+ /** The role the connection runs as. */
44
+ role?: string;
45
+ /** Why the provider did not answer, in place of the fields above. */
46
+ error?: string;
47
+ }
48
+ /**
49
+ * The `interface-database` pin a module needs once a module that uses it pins another database:
50
+ * core passes that pin on to the modules that import it, which would then be reached with two
51
+ * bindings.
52
+ */
53
+ export interface DatabasePin {
54
+ module: string;
55
+ provider: string;
56
+ }
57
+ /** A driver module of an engine, and the range of its versions a project can install. */
58
+ export interface DriverPackage {
59
+ package: string;
60
+ version: string;
61
+ }
62
+ /** What connecting a database needs to know about the project. */
63
+ export interface DatabaseProject {
64
+ /** The modules the project's configuration lists, by id. */
65
+ modules: string[];
66
+ /** The id of the module the builder runs in, the entry its catalog connections are declared on. */
67
+ self: string;
68
+ /** The project's own `interface-database` provider, when it has one. */
69
+ ownDatabase?: string;
70
+ /** The modules to pin to the own database before another one is connected. */
71
+ databasePins: DatabasePin[];
72
+ /** The id the configuration gives dms-database, when the project has it. */
73
+ dmsDatabase?: string;
74
+ /** The version of `@antelopejs/interface-database` the project resolves, when it resolves one. */
75
+ interfaceDatabase?: string;
76
+ /**
77
+ * The driver to add for each engine, with a range of only the versions built for
78
+ * `interfaceDatabase`. An engine with no driver built for it is absent.
79
+ */
80
+ drivers: Partial<Record<DatabaseEngine, DriverPackage>>;
81
+ }
82
+ /** A local module of the project, by its id in the configuration and its folder. */
83
+ export interface ConnectionModule {
84
+ id: string;
85
+ path: string;
86
+ }
87
+ /** What a connection wired into the configuration, by module id. */
88
+ export interface ConnectionWiring {
89
+ connection: string;
90
+ driver: string;
91
+ /** The local modules holding its tables: read through the driver, their record naming the connection. */
92
+ modules: ConnectionModule[];
93
+ /**
94
+ * Local modules read through the driver whose record names no connection, as one made before
95
+ * the record was: shown as the connection's tables module when it has no other, never removed.
96
+ */
97
+ unrecorded: ConnectionModule[];
98
+ /**
99
+ * Whether the driver was added for this connection alone, and goes with it: it is not the
100
+ * project's own database, and no module or connection the removal leaves names it.
101
+ */
102
+ ownsDriver: boolean;
103
+ /** The variable supplying the driver's `url`, when one does. */
104
+ variable?: string;
105
+ /** Every variable supplying the driver's configuration, `variable` among them. */
106
+ variables: string[];
107
+ }
108
+ /** A connection's details as its URL holds them, the password left out. */
109
+ export interface ConnectionDetails {
110
+ scheme: string;
111
+ host: string;
112
+ port: string;
113
+ database: string;
114
+ user: string;
115
+ hasPassword: boolean;
116
+ /** The URL parameters, `sslmode` among them. */
117
+ options: Record<string, string>;
118
+ }
119
+ /** A connection's wiring, and its details when its URL can be read. */
120
+ export interface DatabaseConnection {
121
+ wiring: ConnectionWiring;
122
+ details?: ConnectionDetails;
123
+ }
124
+ /** One `interface-database` or `interface-database-catalog` binding a module entry declares. */
125
+ export interface EntryConnection {
126
+ interface: string;
127
+ /** The module that provides the interface. */
128
+ source: string;
129
+ /** The connection's id; absent for a plain pin. */
130
+ id?: string;
131
+ /**
132
+ * The access dms-database grants the connection: `read-write` only when its
133
+ * `config.externalConnections.<id>.access` says so, else `read`. Absent for a plain pin.
134
+ */
135
+ access?: "read" | "read-write";
136
+ }
137
+ /** The rows to sample from a relation of a catalog connection. */
138
+ export interface RowSampleRequest {
139
+ relation: string;
140
+ columns?: string[];
141
+ /** At most the catalog's sample limit. */
142
+ limit: number;
143
+ }
144
+ /** A sampled value as text, cut at the catalog's text length. */
145
+ export interface SampledText {
146
+ text: string;
147
+ truncated: boolean;
148
+ }
149
+ /** A binary value, answered by its length only. */
150
+ export interface SampledBinary {
151
+ bytes: number;
152
+ }
153
+ export type SampledValue = SampledText | SampledBinary | null;
154
+ /** Rows of a relation, each value in the order of `columns`. */
155
+ export interface RowSample {
156
+ relation: string;
157
+ columns: string[];
158
+ rows: SampledValue[][];
159
+ /** How the relation was sampled before its first rows were read, when it was. */
160
+ sample: {
161
+ percent: number;
162
+ rows: number;
163
+ } | null;
164
+ }
165
+ /**
166
+ * The builder's catalog connections, each with its provider's `Info()` or why it did not answer.
167
+ *
168
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
169
+ */
170
+ export declare const ListDatabaseConnections: () => Promise<CatalogConnectionEntry[]>;
171
+ /**
172
+ * Connects to a database the caller names and reports what its account may do, before any
173
+ * connection is written. In development only: elsewhere it fails with `unsupported`. An input that
174
+ * is not an engine and a URL of that engine's scheme fails with `invalid_config`, naming the fields
175
+ * and never their values. The engine's client package must be installed in the project.
176
+ *
177
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
178
+ */
179
+ export declare const CheckDatabaseConnection: (input: DatabaseCheckInput) => Promise<OpResult<DatabaseAccess>>;
180
+ /**
181
+ * Adds what the configuration of each connection made before the connect flow registered it with
182
+ * dms-database is missing. Succeeds with no file when nothing is.
183
+ *
184
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
185
+ */
186
+ export declare const RepairDatabaseConnections: (opts?: ProjectConfigOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
187
+ /**
188
+ * The project's modules and the database pins connecting another database needs.
189
+ *
190
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
191
+ */
192
+ export declare const GetDatabaseProject: () => Promise<OpResult<DatabaseProject>>;
193
+ /**
194
+ * One connection's wiring and details; `not_found` when no module declares it.
195
+ *
196
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
197
+ */
198
+ export declare const GetDatabaseConnection: (connection: string) => Promise<OpResult<DatabaseConnection>>;
199
+ /**
200
+ * Takes a connection out of the configuration: its catalog connections, its tables module and
201
+ * that module's folder, and its driver when it was added for this connection alone.
202
+ *
203
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
204
+ */
205
+ export declare const RemoveDatabaseConnection: (connection: string, opts?: ProjectConfigOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
206
+ /**
207
+ * Writes a connection's URL into the variable that supplies it. A URL with no password keeps the
208
+ * current one. Answers the variable's name.
209
+ *
210
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
211
+ */
212
+ export declare const SetDatabaseConnectionUrl: (connection: string, url: string) => Promise<OpResult<{
213
+ variable: string;
214
+ }>>;
215
+ /**
216
+ * The `interface-database` and `interface-database-catalog` bindings of the module entry `module`,
217
+ * read from `antelope.config.ts` as written, whether core loads the module or not: a
218
+ * `disabled: true` entry answers too. `not_found` when no entry has that id. An entry, its
219
+ * `importOverrides` or a binding written in a way the builder cannot read, such as a variable or a
220
+ * spread, fails with `invalid_config` rather than leaving a binding out. Writes nothing.
221
+ *
222
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
223
+ */
224
+ export declare const ListEntryConnections: (module: string) => Promise<OpResult<EntryConnection[]>>;
225
+ /**
226
+ * Sample rows of a relation of a catalog connection; `not_found` for an unknown connection.
227
+ *
228
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
229
+ */
230
+ export declare const SampleDatabaseRows: (connection: string, request: RowSampleRequest) => Promise<OpResult<RowSample>>;
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SampleDatabaseRows = exports.ListEntryConnections = exports.SetDatabaseConnectionUrl = exports.RemoveDatabaseConnection = exports.GetDatabaseConnection = exports.GetDatabaseProject = exports.RepairDatabaseConnections = exports.CheckDatabaseConnection = exports.ListDatabaseConnections = exports.DATABASE_ENGINE_SCHEMES = void 0;
4
+ const interface_core_1 = require("@antelopejs/interface-core");
5
+ /**
6
+ * The engines a database can be checked on, by the name `CheckDatabaseConnection` takes, each with
7
+ * the URL schemes it accepts, colon included. `mysql` covers MariaDB too: the same client and the
8
+ * same catalog answer both.
9
+ */
10
+ exports.DATABASE_ENGINE_SCHEMES = {
11
+ postgres: ["postgres:", "postgresql:"],
12
+ mysql: ["mysql:"],
13
+ mongodb: ["mongodb:", "mongodb+srv:"],
14
+ rethinkdb: ["rethinkdb:"],
15
+ };
16
+ /**
17
+ * The builder's catalog connections, each with its provider's `Info()` or why it did not answer.
18
+ *
19
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
20
+ */
21
+ exports.ListDatabaseConnections = (0, interface_core_1.InterfaceFunction)();
22
+ /**
23
+ * Connects to a database the caller names and reports what its account may do, before any
24
+ * connection is written. In development only: elsewhere it fails with `unsupported`. An input that
25
+ * is not an engine and a URL of that engine's scheme fails with `invalid_config`, naming the fields
26
+ * and never their values. The engine's client package must be installed in the project.
27
+ *
28
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
29
+ */
30
+ exports.CheckDatabaseConnection = (0, interface_core_1.InterfaceFunction)();
31
+ /**
32
+ * Adds what the configuration of each connection made before the connect flow registered it with
33
+ * dms-database is missing. Succeeds with no file when nothing is.
34
+ *
35
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
36
+ */
37
+ exports.RepairDatabaseConnections = (0, interface_core_1.InterfaceFunction)();
38
+ /**
39
+ * The project's modules and the database pins connecting another database needs.
40
+ *
41
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
42
+ */
43
+ exports.GetDatabaseProject = (0, interface_core_1.InterfaceFunction)();
44
+ /**
45
+ * One connection's wiring and details; `not_found` when no module declares it.
46
+ *
47
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
48
+ */
49
+ exports.GetDatabaseConnection = (0, interface_core_1.InterfaceFunction)();
50
+ /**
51
+ * Takes a connection out of the configuration: its catalog connections, its tables module and
52
+ * that module's folder, and its driver when it was added for this connection alone.
53
+ *
54
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
55
+ */
56
+ exports.RemoveDatabaseConnection = (0, interface_core_1.InterfaceFunction)();
57
+ /**
58
+ * Writes a connection's URL into the variable that supplies it. A URL with no password keeps the
59
+ * current one. Answers the variable's name.
60
+ *
61
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
62
+ */
63
+ exports.SetDatabaseConnectionUrl = (0, interface_core_1.InterfaceFunction)();
64
+ /**
65
+ * The `interface-database` and `interface-database-catalog` bindings of the module entry `module`,
66
+ * read from `antelope.config.ts` as written, whether core loads the module or not: a
67
+ * `disabled: true` entry answers too. `not_found` when no entry has that id. An entry, its
68
+ * `importOverrides` or a binding written in a way the builder cannot read, such as a variable or a
69
+ * spread, fails with `invalid_config` rather than leaving a binding out. Writes nothing.
70
+ *
71
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
72
+ */
73
+ exports.ListEntryConnections = (0, interface_core_1.InterfaceFunction)();
74
+ /**
75
+ * Sample rows of a relation of a catalog connection; `not_found` for an unknown connection.
76
+ *
77
+ * Owner path only: no MCP tool exposes it, so only an owner-authenticated entry calls it.
78
+ */
79
+ exports.SampleDatabaseRows = (0, interface_core_1.InterfaceFunction)();
80
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../src/database.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAI/D;;;;GAIG;AACU,QAAA,uBAAuB,GAAG;IACrC,QAAQ,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;IACtC,KAAK,EAAE,CAAC,QAAQ,CAAC;IACjB,OAAO,EAAE,CAAC,UAAU,EAAE,cAAc,CAAC;IACrC,SAAS,EAAE,CAAC,YAAY,CAAC;CACqC,CAAC;AAuKjE;;;;GAIG;AACU,QAAA,uBAAuB,GAClC,IAAA,kCAAiB,GAA2C,CAAC;AAE/D;;;;;;;GAOG;AACU,QAAA,uBAAuB,GAClC,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;;GAKG;AACU,QAAA,yBAAyB,GACpC,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;GAIG;AACU,QAAA,kBAAkB,GAC7B,IAAA,kCAAiB,GAA4C,CAAC;AAEhE;;;;GAIG;AACU,QAAA,qBAAqB,GAChC,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;;GAKG;AACU,QAAA,wBAAwB,GACnC,IAAA,kCAAiB,GAKd,CAAC;AAEN;;;;;GAKG;AACU,QAAA,wBAAwB,GACnC,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;;;;;GAQG;AACU,QAAA,oBAAoB,GAC/B,IAAA,kCAAiB,GAA4D,CAAC;AAEhF;;;;GAIG;AACU,QAAA,kBAAkB,GAC7B,IAAA,kCAAiB,GAKd,CAAC"}
package/dist/drafts.d.ts CHANGED
@@ -4,22 +4,53 @@ import type { ResourceRef } from "./resources";
4
4
  import type { MutationOpts, OpResult } from "./results";
5
5
  import type { EditablePageMeta } from "./structure";
6
6
  import type { ConfigObject } from "./values";
7
+ /**
8
+ * A block as the caller wants it written. The whole tree is declarative: what
9
+ * the draft describes is what the page file ends up holding.
10
+ */
7
11
  export interface BlockDraft {
12
+ /** Static key (top-level) or `.child()` id (nested). Must be an identifier. */
8
13
  name: string;
14
+ /** A catalog type; informational and checked against source when preserved. */
9
15
  type?: string;
16
+ /** Understood options only. Omit locked options; the server retains their source. */
10
17
  config?: ConfigObject;
18
+ /** Read-only UI hints. The server derives option locks from its own source. */
11
19
  lockedOptions?: Record<string, string>;
12
20
  slot?: string;
21
+ /** Child metadata emitted with `slot`, e.g. `{ colSpan: 2 }`. */
13
22
  meta?: ConfigObject;
23
+ /** Required for a controller-leading block type such as `TableView`. */
14
24
  controller?: ResourceRef;
25
+ /** Preserved parents may include their unchanged, recursively preserved children. */
15
26
  children?: BlockDraft[];
27
+ /**
28
+ * Write the block back exactly as it stands on disk, identified by its name
29
+ * among its siblings. This is how an opaque block — a `CustomComponent`, a
30
+ * computed expression, anything the builder can read but not rewrite —
31
+ * survives a whole-tree write. A `preserve` block whose name no longer
32
+ * matches anything fails validation. Partially editable blocks keep their
33
+ * source path, type, controller and child placement; they cannot be copied.
34
+ */
16
35
  preserve?: boolean;
17
36
  }
37
+ /** A page as the caller wants it written. */
18
38
  export interface PageDraft {
39
+ /** Metadata to patch alongside the blocks; omit to leave it alone. */
19
40
  page?: Partial<EditablePageMeta>;
20
41
  blocks: BlockDraft[];
42
+ /**
43
+ * The queries the page should serve, written in the same transaction as the
44
+ * blocks — a block and the data it reads are one edit.
45
+ *
46
+ * Omit to leave the page's queries untouched. An empty array is not the same
47
+ * thing: it says the page should serve none, and removes the generated ones.
48
+ * A query a human has taken over is never rewritten or removed; it comes back
49
+ * as a warning instead.
50
+ */
21
51
  queries?: AddQueryInput[];
22
52
  }
53
+ /** A component tree in the shape the DMS frontend consumes. */
23
54
  export type ComponentPreview = {
24
55
  componentName: string;
25
56
  options?: ConfigObject;
@@ -31,17 +62,47 @@ export type ComponentPreviewChild = {
31
62
  component: ComponentPreview;
32
63
  [key: string]: ConfigObject[string];
33
64
  };
65
+ /** The preview of a page draft, keyed by top-level block name. */
34
66
  export interface PageLayoutPreview {
35
67
  components: Record<string, ComponentPreview>;
68
+ /**
69
+ * Blocks the preview could not build faithfully — an unresolved `$ref` or
70
+ * `$expr`, a factory that threw. Render the last known-good layout for those
71
+ * rather than trusting this one.
72
+ */
36
73
  degraded: BlockPath[];
37
74
  }
75
+ /**
76
+ * Write a page's whole block tree in one transaction: one typecheck, one write,
77
+ * one `changes` list. The declarative counterpart of the per-block operations,
78
+ * meant for an editor holding a draft of the page rather than replaying edits.
79
+ *
80
+ * Blocks absent from the draft are removed; static members that are not blocks
81
+ * are left alone. Pass `expectedVersion` to make the write conditional.
82
+ */
38
83
  export declare const SetPageBlocks: (page: string, draft: PageDraft, opts?: MutationOpts | undefined) => Promise<OpResult<{
39
84
  version: string;
40
85
  }>>;
86
+ /**
87
+ * Serialize a draft the way the runtime would, without writing anything. The
88
+ * factories are the real ones, so the result is what the page would render.
89
+ * Nothing is typechecked and nothing reaches disk.
90
+ */
41
91
  export declare const PreviewLayout: (page: string, draft: PageDraft) => Promise<OpResult<PageLayoutPreview>>;
92
+ /**
93
+ * Run a query that has not been written, and answer what its route would.
94
+ *
95
+ * The other half of previewing a draft: `PreviewLayout` says what the page will
96
+ * look like, this says what its blocks will be showing. Read-only, and limited to
97
+ * a page of points — a preview that returned a million rows would be answering a
98
+ * different question.
99
+ */
42
100
  export declare const PreviewQuery: (request: QueryPreviewRequest) => Promise<OpResult<QueryPreview>>;
101
+ /** What to run, and what the route would have been handed. */
43
102
  export interface QueryPreviewRequest {
44
103
  query: AddQueryInput;
104
+ /** Values the route would receive, by the name it exposes them under. */
45
105
  args?: ConfigObject;
106
+ /** The tenant whose rows to read, for a resource in a per-tenant schema. */
46
107
  tenant?: string;
47
108
  }
package/dist/drafts.js CHANGED
@@ -2,7 +2,28 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PreviewQuery = exports.PreviewLayout = exports.SetPageBlocks = void 0;
4
4
  const interface_core_1 = require("@antelopejs/interface-core");
5
+ /**
6
+ * Write a page's whole block tree in one transaction: one typecheck, one write,
7
+ * one `changes` list. The declarative counterpart of the per-block operations,
8
+ * meant for an editor holding a draft of the page rather than replaying edits.
9
+ *
10
+ * Blocks absent from the draft are removed; static members that are not blocks
11
+ * are left alone. Pass `expectedVersion` to make the write conditional.
12
+ */
5
13
  exports.SetPageBlocks = (0, interface_core_1.InterfaceFunction)();
14
+ /**
15
+ * Serialize a draft the way the runtime would, without writing anything. The
16
+ * factories are the real ones, so the result is what the page would render.
17
+ * Nothing is typechecked and nothing reaches disk.
18
+ */
6
19
  exports.PreviewLayout = (0, interface_core_1.InterfaceFunction)();
20
+ /**
21
+ * Run a query that has not been written, and answer what its route would.
22
+ *
23
+ * The other half of previewing a draft: `PreviewLayout` says what the page will
24
+ * look like, this says what its blocks will be showing. Read-only, and limited to
25
+ * a page of points — a preview that returned a million rows would be answering a
26
+ * different question.
27
+ */
7
28
  exports.PreviewQuery = (0, interface_core_1.InterfaceFunction)();
8
29
  //# sourceMappingURL=drafts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"drafts.js","sourceRoot":"","sources":["../src/drafts.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAyFlD,QAAA,aAAa,GACxB,IAAA,kCAAiB,GAMd,CAAC;AAOO,QAAA,aAAa,GACxB,IAAA,kCAAiB,GAEd,CAAC;AAUO,QAAA,YAAY,GACvB,IAAA,kCAAiB,GAEd,CAAC"}
1
+ {"version":3,"file":"drafts.js","sourceRoot":"","sources":["../src/drafts.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAiF/D;;;;;;;GAOG;AACU,QAAA,aAAa,GACxB,IAAA,kCAAiB,GAMd,CAAC;AAEN;;;;GAIG;AACU,QAAA,aAAa,GACxB,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;;;;GAOG;AACU,QAAA,YAAY,GACvB,IAAA,kCAAiB,GAEd,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export * from "./addressing";
2
2
  export * from "./analysis";
3
3
  export * from "./catalog";
4
4
  export * from "./compose";
5
+ export * from "./database";
5
6
  export * from "./drafts";
6
7
  export * from "./mapping";
7
8
  export * from "./operation-map";
@@ -12,4 +13,5 @@ export * from "./resources";
12
13
  export * from "./results";
13
14
  export * from "./structure";
14
15
  export * from "./table-view";
16
+ export * from "./theme";
15
17
  export * from "./values";
package/dist/index.js CHANGED
@@ -18,6 +18,7 @@ __exportStar(require("./addressing"), exports);
18
18
  __exportStar(require("./analysis"), exports);
19
19
  __exportStar(require("./catalog"), exports);
20
20
  __exportStar(require("./compose"), exports);
21
+ __exportStar(require("./database"), exports);
21
22
  __exportStar(require("./drafts"), exports);
22
23
  __exportStar(require("./mapping"), exports);
23
24
  __exportStar(require("./operation-map"), exports);
@@ -28,5 +29,6 @@ __exportStar(require("./resources"), exports);
28
29
  __exportStar(require("./results"), exports);
29
30
  __exportStar(require("./structure"), exports);
30
31
  __exportStar(require("./table-view"), exports);
32
+ __exportStar(require("./theme"), exports);
31
33
  __exportStar(require("./values"), exports);
32
34
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B;AAC1B,2CAAyB;AACzB,4CAA0B;AAC1B,kDAAgC;AAChC,+CAA6B;AAC7B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,6CAA2B;AAC3B,4CAA0B;AAC1B,4CAA0B;AAC1B,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,kDAAgC;AAChC,+CAA6B;AAC7B,4CAA0B;AAC1B,4CAA0B;AAC1B,8CAA4B;AAC5B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwB;AACxB,2CAAyB"}