@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.
- package/README.md +4 -4
- package/dist/addressing.d.ts +6 -0
- package/dist/analysis.d.ts +73 -0
- package/dist/analysis.js +18 -1
- package/dist/analysis.js.map +1 -1
- package/dist/catalog.d.ts +139 -1
- package/dist/compose.d.ts +44 -0
- package/dist/compose.js +7 -0
- package/dist/compose.js.map +1 -1
- package/dist/database.d.ts +230 -0
- package/dist/database.js +80 -0
- package/dist/database.js.map +1 -0
- package/dist/drafts.d.ts +61 -0
- package/dist/drafts.js +21 -0
- package/dist/drafts.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/mapping.d.ts +122 -0
- package/dist/mapping.js +15 -0
- package/dist/mapping.js.map +1 -1
- package/dist/operation-map.d.ts +27 -1
- package/dist/operation-map.js +22 -0
- package/dist/operation-map.js.map +1 -1
- package/dist/operations.d.ts +57 -0
- package/dist/operations.js +18 -0
- package/dist/operations.js.map +1 -1
- package/dist/project.d.ts +63 -1
- package/dist/project.js +10 -0
- package/dist/project.js.map +1 -1
- package/dist/queries.d.ts +125 -0
- package/dist/resources.d.ts +132 -0
- package/dist/resources.js +9 -0
- package/dist/resources.js.map +1 -1
- package/dist/results.d.ts +49 -1
- package/dist/structure.d.ts +42 -0
- package/dist/table-view.d.ts +49 -0
- package/dist/table-view.js +7 -0
- package/dist/table-view.js.map +1 -1
- package/dist/theme.d.ts +144 -0
- package/dist/theme.js +46 -0
- package/dist/theme.js.map +1 -0
- package/dist/values.d.ts +64 -0
- package/dist/values.js +7 -0
- package/dist/values.js.map +1 -1
- package/docs/1.introduction.md +3 -0
- package/docs/10.a-chart-without-code.md +7 -7
- package/docs/11.external-databases.md +16 -11
- package/docs/11.theme-and-branding.md +135 -0
- package/docs/12.connect-a-database.md +87 -0
- package/docs/4.page-operations.md +1 -1
- package/package.json +15 -8
package/dist/mapping.d.ts
CHANGED
|
@@ -2,12 +2,20 @@ import type { CategoryRef, PageRef } from "./addressing";
|
|
|
2
2
|
import type { ResourceRef } from "./resources";
|
|
3
3
|
import type { OpResult } from "./results";
|
|
4
4
|
import type { TableViewSettings } from "./table-view";
|
|
5
|
+
/** The semantic tones of the dashboard, which a status pill and a tab are drawn in. */
|
|
5
6
|
export type DisplayTone = "neutral" | "primary" | "secondary" | "success" | "warning" | "error" | "info";
|
|
7
|
+
/** One value of a badge column: the value the database holds, its label and the tone it is drawn in. */
|
|
6
8
|
export interface BadgeItem {
|
|
7
9
|
value: string;
|
|
8
10
|
label: string;
|
|
9
11
|
tone: DisplayTone;
|
|
10
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* How a column is drawn beyond its declaration. A `badge` is a string column of few values, drawn
|
|
15
|
+
* as a status pill and filtered by a list of those values; a `price` is a number column drawn as an
|
|
16
|
+
* amount, in `currency` (an ISO 4217 code such as `USD`) and in the DataType's default currency,
|
|
17
|
+
* euros, when it states none.
|
|
18
|
+
*/
|
|
11
19
|
export type ColumnDisplay = {
|
|
12
20
|
kind: "badge";
|
|
13
21
|
items: BadgeItem[];
|
|
@@ -15,63 +23,177 @@ export type ColumnDisplay = {
|
|
|
15
23
|
kind: "price";
|
|
16
24
|
currency?: string;
|
|
17
25
|
};
|
|
26
|
+
/** Tabs above a TableView: "All", then one tab per value of the column's badge. */
|
|
18
27
|
export interface TabsChoice {
|
|
28
|
+
/** A column of the relation whose `display` is a badge, and which is `filterable`. */
|
|
19
29
|
column: string;
|
|
20
30
|
}
|
|
31
|
+
/** One column of a mapped relation, as the integrator chose to show it. */
|
|
21
32
|
export interface MappedField {
|
|
22
33
|
column: string;
|
|
34
|
+
/** One of the column's `accepts`; the first when omitted. */
|
|
23
35
|
declared?: string;
|
|
36
|
+
/**
|
|
37
|
+
* The column's header. Sent, it is written as sent.
|
|
38
|
+
*
|
|
39
|
+
* Left out, a plain column takes its name, humanized. A relation column takes the label its
|
|
40
|
+
* controller holds when its relation was mapped before and held the column, and otherwise the
|
|
41
|
+
* title of the relation it points at, in singular ("Customer", not "Customer id", D3), unless
|
|
42
|
+
* the database commented the column with a short first sentence, which titles it instead (L2).
|
|
43
|
+
* The target's title is the `title` it is mapped with, else its page's title when it was mapped
|
|
44
|
+
* before, else its name humanized.
|
|
45
|
+
*/
|
|
24
46
|
label?: string;
|
|
25
47
|
listable?: boolean;
|
|
26
48
|
filterable?: boolean;
|
|
27
49
|
sortable?: boolean;
|
|
28
50
|
searchable?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* How the column is drawn: a badge needs a `string` declaration and a price a `number` one. A
|
|
53
|
+
* relation column takes none.
|
|
54
|
+
*
|
|
55
|
+
* Left out, a column of a relation mapped before keeps the display its controller holds, and a
|
|
56
|
+
* column of a relation not mapped before takes the one the analysis proposes (D1, D2), read from
|
|
57
|
+
* the column's profile at map time, else from the connection's last analysis, else from its name
|
|
58
|
+
* alone, which proposes a price but no badge; a warning `display_not_proposed` says when no
|
|
59
|
+
* profile or analysis was there. A kept or proposed display the column's declaration does not
|
|
60
|
+
* suit is dropped, not refused. Null writes the column plain, over any display it had.
|
|
61
|
+
*/
|
|
29
62
|
display?: ColumnDisplay | null;
|
|
63
|
+
/**
|
|
64
|
+
* `"schema.name"` of another mapped relation this column refers to, by that relation's
|
|
65
|
+
* single-column key: the column becomes a relation column showing the target's `label`.
|
|
66
|
+
*
|
|
67
|
+
* Left out, a column the database declares a foreign key onto a relation of this call or one
|
|
68
|
+
* mapped before, with a TableView and a single-column key that the foreign key uses, becomes a
|
|
69
|
+
* relation column onto it. Null writes the column plain, as its own value.
|
|
70
|
+
*/
|
|
30
71
|
relation?: string | null;
|
|
31
72
|
}
|
|
73
|
+
/** One relation to map, as the integrator chose to show it. */
|
|
32
74
|
export interface MappedResource {
|
|
75
|
+
/** `"schema.name"`. */
|
|
33
76
|
relation: string;
|
|
77
|
+
/** Defaults to the PascalCase singular of the relation's name. */
|
|
34
78
|
className?: string;
|
|
79
|
+
/** The column relation columns pointing here show, and the TableView's `labelKey`. */
|
|
35
80
|
label?: string;
|
|
81
|
+
/** The page's title and the TableView's caption; the relation's name, humanized, when omitted. */
|
|
36
82
|
title?: string;
|
|
83
|
+
/**
|
|
84
|
+
* The icon the menu shows beside the page, an icon name such as `i-ph-shopping-cart`. Left out,
|
|
85
|
+
* a new page has none and a page mapped before keeps its own.
|
|
86
|
+
*/
|
|
37
87
|
icon?: string;
|
|
88
|
+
/** What the page is for, in a sentence. Left out, a new page has none and a page mapped before keeps its own. */
|
|
38
89
|
description?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Where the page sorts among its category's pages, lowest first; pages with the same order sort
|
|
92
|
+
* by title. Left out, a new page takes 100 and a page mapped before keeps its own. Pages
|
|
93
|
+
* written by hand or by the assistant leave the order at 0 unless they set one, so a dashboard
|
|
94
|
+
* created in the connection's category comes before the mapped tables; give a dashboard an
|
|
95
|
+
* order below 100 to be sure of it.
|
|
96
|
+
*/
|
|
39
97
|
order?: number;
|
|
98
|
+
/**
|
|
99
|
+
* Displays, views and footer figures written to the page's TableView by the same checks as
|
|
100
|
+
* `ConfigureTableView`: a refused choice is a warning `page_not_written` and the page keeps
|
|
101
|
+
* what it had. Left out, the page keeps its own. Column names are the ones mapped here.
|
|
102
|
+
*/
|
|
40
103
|
tableOptions?: TableViewSettings;
|
|
104
|
+
/**
|
|
105
|
+
* False maps the relation for stats only: its controller serves no route, so queries can name
|
|
106
|
+
* it as a resource, and it gets no TableView or page. Forced false without a key.
|
|
107
|
+
*/
|
|
41
108
|
tableView: boolean;
|
|
109
|
+
/** False serves the TableView without new, edit and delete, every field read-only. */
|
|
42
110
|
writable: boolean;
|
|
111
|
+
/** The columns to declare; key columns are added when left out. */
|
|
43
112
|
fields: MappedField[];
|
|
113
|
+
/**
|
|
114
|
+
* Tabs on the TableView's rows by a badge column, written to the page's TableView over any
|
|
115
|
+
* `tabs` it holds. The column must be filterable and drawn as a badge, whether it was sent or
|
|
116
|
+
* taken as its `display` default.
|
|
117
|
+
*
|
|
118
|
+
* Left out, a page already mapped keeps the tabs it has, and a relation not mapped before is
|
|
119
|
+
* tabbed by the column the analysis proposes (T1) among its filterable badge columns, when one
|
|
120
|
+
* suits. Null writes none: it adds no tabs to a new relation, and removes from a page already
|
|
121
|
+
* mapped the tabs a mapping wrote from a badge, as a `display` of null removes the badge. Tabs
|
|
122
|
+
* edited by hand are kept.
|
|
123
|
+
*/
|
|
44
124
|
tabs?: TabsChoice | null;
|
|
45
125
|
}
|
|
126
|
+
/** A relation the integrator decided not to map, so an analysis does not propose it again. */
|
|
46
127
|
export interface ExcludedRelation {
|
|
128
|
+
/** `"schema.name"`. */
|
|
47
129
|
relation: string;
|
|
48
130
|
reason: string;
|
|
49
131
|
}
|
|
132
|
+
/** Which relations of a connection to map, into which module of the project. */
|
|
50
133
|
export interface MapResourcesInput {
|
|
134
|
+
/** The project module the tables are written into, bound to the connection's database. */
|
|
51
135
|
module: string;
|
|
136
|
+
/**
|
|
137
|
+
* The id of the builder's catalog connection to the database, also used in routes and as the
|
|
138
|
+
* pages' category.
|
|
139
|
+
*/
|
|
52
140
|
connection: string;
|
|
141
|
+
/** Relations to map, or to map again: a mapped relation is rewritten from the new choices. */
|
|
53
142
|
resources: MappedResource[];
|
|
143
|
+
/** Relations recorded as left out. Mapping one later removes it from the record. */
|
|
54
144
|
excluded?: ExcludedRelation[];
|
|
145
|
+
/**
|
|
146
|
+
* The pages a person approved removing, as `PreviewMapResources` answered them. When present,
|
|
147
|
+
* `MapResources` plans on the state it finds, writes nothing and refuses with `invalid_config`
|
|
148
|
+
* naming the pages when that plan removes a page not in this list; an empty list approves none.
|
|
149
|
+
* Left out, `MapResources` removes the pages the choices no longer call for, as before.
|
|
150
|
+
* `PreviewMapResources` ignores it.
|
|
151
|
+
*/
|
|
55
152
|
approvedPageRemovals?: PageRef[];
|
|
56
153
|
}
|
|
154
|
+
/** A column a TableView does not show, and why. */
|
|
57
155
|
export interface LeftOutColumn {
|
|
58
156
|
relation: string;
|
|
59
157
|
column: string;
|
|
60
158
|
reason: string;
|
|
61
159
|
}
|
|
160
|
+
/** What was written for one mapped relation. */
|
|
62
161
|
export interface MappedResult {
|
|
63
162
|
relation: string;
|
|
163
|
+
/** The resource queries name it by, TableView or not. */
|
|
64
164
|
ref: ResourceRef;
|
|
65
165
|
page?: PageRef;
|
|
66
166
|
files: string[];
|
|
67
167
|
}
|
|
168
|
+
/** What `MapResources` wrote, and what it left off the TableViews. */
|
|
68
169
|
export interface MapResourcesResult {
|
|
69
170
|
resources: MappedResult[];
|
|
70
171
|
leftOut: LeftOutColumn[];
|
|
172
|
+
/** The connection's category in the module, which the pages are in and stats pages go under. */
|
|
71
173
|
category?: CategoryRef;
|
|
72
174
|
}
|
|
175
|
+
/** What `MapResources` would remove for the same input, answered by `PreviewMapResources`. */
|
|
73
176
|
export interface MapResourcesPreview {
|
|
177
|
+
/**
|
|
178
|
+
* The pages of relations already mapped with a TableView that the input maps with `tableView`
|
|
179
|
+
* false, which `MapResources` removes. Empty when the call removes no page.
|
|
180
|
+
*/
|
|
74
181
|
pagesToRemove: PageRef[];
|
|
75
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Writes table classes, models, DataAPI controllers and TableView pages over relations of a
|
|
185
|
+
* database the project does not own, into a module bound to it. Names are the database's own,
|
|
186
|
+
* verbatim; `_id` is declared only where the relation has a key; nothing creates or alters a
|
|
187
|
+
* table. The builder reads the relations' descriptions through its catalog connection, and
|
|
188
|
+
* checks every choice in `input` against them.
|
|
189
|
+
*
|
|
190
|
+
* A relation already mapped is rewritten from the new choices: its table class and controller,
|
|
191
|
+
* and its page, which is created, kept or removed as `tableView` says.
|
|
192
|
+
*/
|
|
76
193
|
export declare const MapResources: (input: MapResourcesInput) => Promise<OpResult<MapResourcesResult>>;
|
|
194
|
+
/**
|
|
195
|
+
* Answers which pages `MapResources` would remove for `input`, and writes nothing. It plans the
|
|
196
|
+
* mapping as `MapResources` does and refuses what that refuses, so a caller can ask a person
|
|
197
|
+
* before a mapping that removes a page.
|
|
198
|
+
*/
|
|
77
199
|
export declare const PreviewMapResources: (input: MapResourcesInput) => Promise<OpResult<MapResourcesPreview>>;
|
package/dist/mapping.js
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PreviewMapResources = exports.MapResources = void 0;
|
|
4
4
|
const interface_core_1 = require("@antelopejs/interface-core");
|
|
5
|
+
/**
|
|
6
|
+
* Writes table classes, models, DataAPI controllers and TableView pages over relations of a
|
|
7
|
+
* database the project does not own, into a module bound to it. Names are the database's own,
|
|
8
|
+
* verbatim; `_id` is declared only where the relation has a key; nothing creates or alters a
|
|
9
|
+
* table. The builder reads the relations' descriptions through its catalog connection, and
|
|
10
|
+
* checks every choice in `input` against them.
|
|
11
|
+
*
|
|
12
|
+
* A relation already mapped is rewritten from the new choices: its table class and controller,
|
|
13
|
+
* and its page, which is created, kept or removed as `tableView` says.
|
|
14
|
+
*/
|
|
5
15
|
exports.MapResources = (0, interface_core_1.InterfaceFunction)();
|
|
16
|
+
/**
|
|
17
|
+
* Answers which pages `MapResources` would remove for `input`, and writes nothing. It plans the
|
|
18
|
+
* mapping as `MapResources` does and refuses what that refuses, so a caller can ask a person
|
|
19
|
+
* before a mapping that removes a page.
|
|
20
|
+
*/
|
|
6
21
|
exports.PreviewMapResources = (0, interface_core_1.InterfaceFunction)();
|
|
7
22
|
//# sourceMappingURL=mapping.js.map
|
package/dist/mapping.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;
|
|
1
|
+
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAuM/D;;;;;;;;;GASG;AACU,QAAA,YAAY,GACvB,IAAA,kCAAiB,GAEd,CAAC;AAEN;;;;GAIG;AACU,QAAA,mBAAmB,GAC9B,IAAA,kCAAiB,GAEd,CAAC"}
|
package/dist/operation-map.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every operation of the builder, by the name it is exported under.
|
|
3
|
+
*
|
|
4
|
+
* A caller that picks an operation at run time, such as a route that forwards a
|
|
5
|
+
* named request, indexes this map and keeps each operation's parameter and
|
|
6
|
+
* result types, rather than reading the namespace import as an untyped record.
|
|
7
|
+
*/
|
|
1
8
|
export declare const Operations: {
|
|
2
9
|
AddBlock: (input: import("./operations").AddBlockInput, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult<{
|
|
3
10
|
path: import("./addressing").BlockPath;
|
|
@@ -11,6 +18,7 @@ export declare const Operations: {
|
|
|
11
18
|
route: string;
|
|
12
19
|
}>>;
|
|
13
20
|
AnalyseDatabase: (input: import("./analysis").AnalyseDatabaseInput) => Promise<import("./results").OpResult<import("./analysis").AnalysisState>>;
|
|
21
|
+
CheckDatabaseConnection: (input: import("./database").DatabaseCheckInput) => Promise<import("./results").OpResult<import("./database").DatabaseAccess>>;
|
|
14
22
|
ComposePage: (input: import("./compose").ComposePageInput, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult<import("./compose").ComposePageData>>;
|
|
15
23
|
ConfigureBlock: (path: string, patch: import("./values").ConfigObject, opts?: import("./operations").ConfigureBlockOpts | undefined) => Promise<import("./results").OpResult>;
|
|
16
24
|
ConfigureCategory: (ref: string, patch: Partial<import("./structure").EditableCategoryMeta>) => Promise<import("./results").OpResult>;
|
|
@@ -18,8 +26,9 @@ export declare const Operations: {
|
|
|
18
26
|
ConfigureModule: (id: string, entry: import("./project").ModuleEntryInput, opts?: import("./project").ProjectConfigOpts | undefined) => Promise<import("./results").OpResult<import("./project").ProjectConfigResult>>;
|
|
19
27
|
ConfigurePage: (ref: string, patch: Partial<import("./structure").EditablePageMeta>, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult<{
|
|
20
28
|
ref: import("./addressing").PageRef;
|
|
29
|
+
version: string;
|
|
21
30
|
}>>;
|
|
22
|
-
ConfigureProject: (steps: import("./project").ProjectConfigStep[], opts?: import("./project").
|
|
31
|
+
ConfigureProject: (steps: import("./project").ProjectConfigStep[], opts?: import("./project").ConfigureProjectOpts | undefined) => Promise<import("./results").OpResult<import("./project").ProjectConfigResult>>;
|
|
23
32
|
ConfigureQuery: (query: string, patch: Partial<import("./queries").AddQueryInput>, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
24
33
|
ConfigureResource: (ref: string, patch: import("./resources").EditableResourceMeta, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
25
34
|
ConfigureTableView: (page: string, settings: import("./table-view").TableViewSettings, opts?: import("./table-view").ConfigureTableViewOpts | undefined) => Promise<import("./results").OpResult<{
|
|
@@ -37,16 +46,23 @@ export declare const Operations: {
|
|
|
37
46
|
ref: import("./resources").ResourceRef;
|
|
38
47
|
files: import("./resources").ResourceFiles;
|
|
39
48
|
}>>;
|
|
49
|
+
CreateThemeLayer: () => Promise<import("./results").OpResult<import("./theme").ThemeLayer>>;
|
|
40
50
|
DeleteCategory: (ref: string) => Promise<import("./results").OpResult>;
|
|
41
51
|
DeletePage: (ref: string, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
42
52
|
DeleteResource: (ref: string, opts?: import("./resources").DeleteResourceOpts | undefined) => Promise<import("./results").OpResult>;
|
|
43
53
|
GetAnalysis: (id: string) => Promise<import("./results").OpResult<import("./analysis").AnalysisState>>;
|
|
44
54
|
GetCatalog: () => Promise<import("./catalog").BlockCatalog>;
|
|
55
|
+
GetDatabaseConnection: (connection: string) => Promise<import("./results").OpResult<import("./database").DatabaseConnection>>;
|
|
56
|
+
GetDatabaseProject: () => Promise<import("./results").OpResult<import("./database").DatabaseProject>>;
|
|
57
|
+
GetLatestAnalysis: (connection: string) => Promise<import("./results").OpResult<import("./analysis").AnalysisState>>;
|
|
45
58
|
GetMapping: (connection: string, module: string) => Promise<import("./results").OpResult<import("./analysis").MappedRelation[]>>;
|
|
46
59
|
GetPageStructure: (ref: string) => Promise<import("./results").OpResult<import("./structure").PageStructure>>;
|
|
47
60
|
GetResourceStructure: (ref: string) => Promise<import("./results").OpResult<import("./resources").ResourceStructure>>;
|
|
61
|
+
GetTheme: () => Promise<import("./results").OpResult<import("./theme").ThemeStructure>>;
|
|
48
62
|
ListCategories: () => Promise<import("./structure").CategorySummary[]>;
|
|
63
|
+
ListDatabaseConnections: () => Promise<import("./database").CatalogConnectionEntry[]>;
|
|
49
64
|
ListDataSources: (response?: string | undefined) => Promise<import("./catalog").DataSourceDescriptor[]>;
|
|
65
|
+
ListEntryConnections: (module: string) => Promise<import("./results").OpResult<import("./database").EntryConnection[]>>;
|
|
50
66
|
ListPages: () => Promise<import("./structure").PageSummary[]>;
|
|
51
67
|
ListQueryTemplates: (resourceType?: string | undefined) => Promise<import("./queries").QueryTemplateDescriptor[]>;
|
|
52
68
|
ListResources: () => Promise<import("./resources").ResourceSummary[]>;
|
|
@@ -57,10 +73,20 @@ export declare const Operations: {
|
|
|
57
73
|
PreviewQuery: (request: import("./drafts").QueryPreviewRequest) => Promise<import("./results").OpResult<import("./queries").QueryPreview>>;
|
|
58
74
|
RefreshSourceIndex: (scope?: import("./operations").RefreshScope | undefined) => Promise<void>;
|
|
59
75
|
RemoveBlock: (path: string, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
76
|
+
RemoveDatabaseConnection: (connection: string, opts?: import("./project").ProjectConfigOpts | undefined) => Promise<import("./results").OpResult<import("./project").ProjectConfigResult>>;
|
|
60
77
|
RemoveField: (path: string, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
61
78
|
RemoveQuery: (query: string, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult>;
|
|
79
|
+
RepairDatabaseConnections: (opts?: import("./project").ProjectConfigOpts | undefined) => Promise<import("./results").OpResult<import("./project").ProjectConfigResult>>;
|
|
80
|
+
SampleDatabaseRows: (connection: string, request: import("./database").RowSampleRequest) => Promise<import("./results").OpResult<import("./database").RowSample>>;
|
|
81
|
+
SetDatabaseConnectionUrl: (connection: string, url: string) => Promise<import("./results").OpResult<{
|
|
82
|
+
variable: string;
|
|
83
|
+
}>>;
|
|
62
84
|
SetPageBlocks: (page: string, draft: import("./drafts").PageDraft, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult<{
|
|
63
85
|
version: string;
|
|
64
86
|
}>>;
|
|
87
|
+
SetTheme: (draft: import("./theme").ThemeDraft, opts?: import("./results").MutationOpts | undefined) => Promise<import("./results").OpResult<{
|
|
88
|
+
version: string;
|
|
89
|
+
}>>;
|
|
65
90
|
};
|
|
91
|
+
/** The name of one operation in `Operations`. */
|
|
66
92
|
export type OperationName = keyof typeof Operations;
|
package/dist/operation-map.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Operations = void 0;
|
|
4
4
|
const analysis_1 = require("./analysis");
|
|
5
5
|
const compose_1 = require("./compose");
|
|
6
|
+
const database_1 = require("./database");
|
|
6
7
|
const drafts_1 = require("./drafts");
|
|
7
8
|
const mapping_1 = require("./mapping");
|
|
8
9
|
const operations_1 = require("./operations");
|
|
@@ -10,12 +11,21 @@ const project_1 = require("./project");
|
|
|
10
11
|
const queries_1 = require("./queries");
|
|
11
12
|
const resources_1 = require("./resources");
|
|
12
13
|
const table_view_1 = require("./table-view");
|
|
14
|
+
const theme_1 = require("./theme");
|
|
15
|
+
/**
|
|
16
|
+
* Every operation of the builder, by the name it is exported under.
|
|
17
|
+
*
|
|
18
|
+
* A caller that picks an operation at run time, such as a route that forwards a
|
|
19
|
+
* named request, indexes this map and keeps each operation's parameter and
|
|
20
|
+
* result types, rather than reading the namespace import as an untyped record.
|
|
21
|
+
*/
|
|
13
22
|
exports.Operations = {
|
|
14
23
|
AddBlock: operations_1.AddBlock,
|
|
15
24
|
AddField: resources_1.AddField,
|
|
16
25
|
AddModule: project_1.AddModule,
|
|
17
26
|
AddQuery: queries_1.AddQuery,
|
|
18
27
|
AnalyseDatabase: analysis_1.AnalyseDatabase,
|
|
28
|
+
CheckDatabaseConnection: database_1.CheckDatabaseConnection,
|
|
19
29
|
ComposePage: compose_1.ComposePage,
|
|
20
30
|
ConfigureBlock: operations_1.ConfigureBlock,
|
|
21
31
|
ConfigureCategory: operations_1.ConfigureCategory,
|
|
@@ -30,16 +40,23 @@ exports.Operations = {
|
|
|
30
40
|
CreateLocalModule: project_1.CreateLocalModule,
|
|
31
41
|
CreatePage: operations_1.CreatePage,
|
|
32
42
|
CreateResource: resources_1.CreateResource,
|
|
43
|
+
CreateThemeLayer: theme_1.CreateThemeLayer,
|
|
33
44
|
DeleteCategory: operations_1.DeleteCategory,
|
|
34
45
|
DeletePage: operations_1.DeletePage,
|
|
35
46
|
DeleteResource: resources_1.DeleteResource,
|
|
36
47
|
GetAnalysis: analysis_1.GetAnalysis,
|
|
37
48
|
GetCatalog: operations_1.GetCatalog,
|
|
49
|
+
GetDatabaseConnection: database_1.GetDatabaseConnection,
|
|
50
|
+
GetDatabaseProject: database_1.GetDatabaseProject,
|
|
51
|
+
GetLatestAnalysis: analysis_1.GetLatestAnalysis,
|
|
38
52
|
GetMapping: analysis_1.GetMapping,
|
|
39
53
|
GetPageStructure: operations_1.GetPageStructure,
|
|
40
54
|
GetResourceStructure: resources_1.GetResourceStructure,
|
|
55
|
+
GetTheme: theme_1.GetTheme,
|
|
41
56
|
ListCategories: operations_1.ListCategories,
|
|
57
|
+
ListDatabaseConnections: database_1.ListDatabaseConnections,
|
|
42
58
|
ListDataSources: operations_1.ListDataSources,
|
|
59
|
+
ListEntryConnections: database_1.ListEntryConnections,
|
|
43
60
|
ListPages: operations_1.ListPages,
|
|
44
61
|
ListQueryTemplates: queries_1.ListQueryTemplates,
|
|
45
62
|
ListResources: resources_1.ListResources,
|
|
@@ -50,8 +67,13 @@ exports.Operations = {
|
|
|
50
67
|
PreviewQuery: drafts_1.PreviewQuery,
|
|
51
68
|
RefreshSourceIndex: operations_1.RefreshSourceIndex,
|
|
52
69
|
RemoveBlock: operations_1.RemoveBlock,
|
|
70
|
+
RemoveDatabaseConnection: database_1.RemoveDatabaseConnection,
|
|
53
71
|
RemoveField: resources_1.RemoveField,
|
|
54
72
|
RemoveQuery: queries_1.RemoveQuery,
|
|
73
|
+
RepairDatabaseConnections: database_1.RepairDatabaseConnections,
|
|
74
|
+
SampleDatabaseRows: database_1.SampleDatabaseRows,
|
|
75
|
+
SetDatabaseConnectionUrl: database_1.SetDatabaseConnectionUrl,
|
|
55
76
|
SetPageBlocks: drafts_1.SetPageBlocks,
|
|
77
|
+
SetTheme: theme_1.SetTheme,
|
|
56
78
|
};
|
|
57
79
|
//# sourceMappingURL=operation-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-map.js","sourceRoot":"","sources":["../src/operation-map.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"operation-map.js","sourceRoot":"","sources":["../src/operation-map.ts"],"names":[],"mappings":";;;AAAA,yCAKoB;AACpB,uCAAwC;AACxC,yCAUoB;AACpB,qCAAsE;AACtE,uCAA8D;AAC9D,6CAiBsB;AACtB,uCAKmB;AACnB,uCAKmB;AACnB,2CASqB;AACrB,6CAAkD;AAClD,mCAA+D;AAE/D;;;;;;GAMG;AACU,QAAA,UAAU,GAAG;IACxB,QAAQ,EAAR,qBAAQ;IACR,QAAQ,EAAR,oBAAQ;IACR,SAAS,EAAT,mBAAS;IACT,QAAQ,EAAR,kBAAQ;IACR,eAAe,EAAf,0BAAe;IACf,uBAAuB,EAAvB,kCAAuB;IACvB,WAAW,EAAX,qBAAW;IACX,cAAc,EAAd,2BAAc;IACd,iBAAiB,EAAjB,8BAAiB;IACjB,cAAc,EAAd,0BAAc;IACd,eAAe,EAAf,yBAAe;IACf,aAAa,EAAb,0BAAa;IACb,gBAAgB,EAAhB,0BAAgB;IAChB,cAAc,EAAd,wBAAc;IACd,iBAAiB,EAAjB,6BAAiB;IACjB,kBAAkB,EAAlB,+BAAkB;IAClB,cAAc,EAAd,2BAAc;IACd,iBAAiB,EAAjB,2BAAiB;IACjB,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,0BAAc;IACd,gBAAgB,EAAhB,wBAAgB;IAChB,cAAc,EAAd,2BAAc;IACd,UAAU,EAAV,uBAAU;IACV,cAAc,EAAd,0BAAc;IACd,WAAW,EAAX,sBAAW;IACX,UAAU,EAAV,uBAAU;IACV,qBAAqB,EAArB,gCAAqB;IACrB,kBAAkB,EAAlB,6BAAkB;IAClB,iBAAiB,EAAjB,4BAAiB;IACjB,UAAU,EAAV,qBAAU;IACV,gBAAgB,EAAhB,6BAAgB;IAChB,oBAAoB,EAApB,gCAAoB;IACpB,QAAQ,EAAR,gBAAQ;IACR,cAAc,EAAd,2BAAc;IACd,uBAAuB,EAAvB,kCAAuB;IACvB,eAAe,EAAf,4BAAe;IACf,oBAAoB,EAApB,+BAAoB;IACpB,SAAS,EAAT,sBAAS;IACT,kBAAkB,EAAlB,4BAAkB;IAClB,aAAa,EAAb,yBAAa;IACb,YAAY,EAAZ,sBAAY;IACZ,mBAAmB,EAAnB,6BAAmB;IACnB,SAAS,EAAT,sBAAS;IACT,aAAa,EAAb,sBAAa;IACb,YAAY,EAAZ,qBAAY;IACZ,kBAAkB,EAAlB,+BAAkB;IAClB,WAAW,EAAX,wBAAW;IACX,wBAAwB,EAAxB,mCAAwB;IACxB,WAAW,EAAX,uBAAW;IACX,WAAW,EAAX,qBAAW;IACX,yBAAyB,EAAzB,oCAAyB;IACzB,kBAAkB,EAAlB,6BAAkB;IAClB,wBAAwB,EAAxB,mCAAwB;IACxB,aAAa,EAAb,sBAAa;IACb,QAAQ,EAAR,gBAAQ;CACT,CAAC"}
|
package/dist/operations.d.ts
CHANGED
|
@@ -4,10 +4,13 @@ import type { ResourceRef } from "./resources";
|
|
|
4
4
|
import type { MutationOpts, OpResult } from "./results";
|
|
5
5
|
import type { CategorySummary, EditableCategoryMeta, EditablePageMeta, PagePermission, PageStructure, PageSummary } from "./structure";
|
|
6
6
|
import type { ConfigObject } from "./values";
|
|
7
|
+
/** Reconcile scope for `RefreshSourceIndex`. Omit to reconcile everything. */
|
|
7
8
|
export interface RefreshScope {
|
|
8
9
|
page?: PageRef;
|
|
9
10
|
}
|
|
11
|
+
/** Input for `CreatePage`. Attaches to an EXISTING category only in v1. */
|
|
10
12
|
export interface CreatePageInput {
|
|
13
|
+
/** Unique route id/slug — duplicate → `duplicate_name`. */
|
|
11
14
|
name: string;
|
|
12
15
|
displayName: string;
|
|
13
16
|
category: CategoryRef;
|
|
@@ -15,49 +18,103 @@ export interface CreatePageInput {
|
|
|
15
18
|
order?: number;
|
|
16
19
|
description?: string;
|
|
17
20
|
permission?: PagePermission;
|
|
21
|
+
/**
|
|
22
|
+
* Override the default category-relative placement with an explicit folder
|
|
23
|
+
* relative to the src root; the page lands at `src/<dir>/<name>/page.ts` and
|
|
24
|
+
* the nearest barrel is wired. Must stay within the src tree.
|
|
25
|
+
*/
|
|
18
26
|
dir?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The project module to write into, by its id in the project configuration. Unset, the
|
|
29
|
+
* project's own module. A module is one of the project's local modules with an `src/index.ts`;
|
|
30
|
+
* what it writes may only use declarations from that same module.
|
|
31
|
+
*/
|
|
19
32
|
module?: string;
|
|
20
33
|
}
|
|
34
|
+
/** Input for `CreateCategory`. */
|
|
21
35
|
export interface CreateCategoryInput {
|
|
22
36
|
name: string;
|
|
23
37
|
displayName: string;
|
|
24
38
|
parent?: CategoryRef;
|
|
25
39
|
icon?: string;
|
|
26
40
|
order?: number;
|
|
41
|
+
/** As `CreatePageInput.module`. */
|
|
27
42
|
module?: string;
|
|
28
43
|
}
|
|
44
|
+
/** Input for `AddBlock`. */
|
|
29
45
|
export interface AddBlockInput {
|
|
30
46
|
page: PageRef;
|
|
47
|
+
/** Omit = top-level static; else must be an editable container. */
|
|
31
48
|
parent?: BlockPath;
|
|
32
49
|
slot?: string;
|
|
50
|
+
/** Position among siblings; default = append. */
|
|
33
51
|
index?: number;
|
|
52
|
+
/** Unique among siblings — duplicate → `duplicate_name`. */
|
|
34
53
|
name: string;
|
|
54
|
+
/**
|
|
55
|
+
* Child metadata emitted alongside `slot` in the third argument of `.child()`
|
|
56
|
+
* — `{ colSpan: 2 }` for a grid child. Ignored for a top-level block.
|
|
57
|
+
*/
|
|
35
58
|
meta?: ConfigObject;
|
|
59
|
+
/** A block type from the catalog. */
|
|
36
60
|
type: string;
|
|
37
61
|
config: ConfigObject;
|
|
62
|
+
/**
|
|
63
|
+
* Required for controller-leading block types (catalog `controllerArg: true`,
|
|
64
|
+
* e.g. `TableView`): the resource whose DataAPI class is the leading argument.
|
|
65
|
+
* The engine emits it as the imported class identifier. Rejected for other
|
|
66
|
+
* block types.
|
|
67
|
+
*/
|
|
38
68
|
controller?: ResourceRef;
|
|
39
69
|
}
|
|
70
|
+
/** Destination for `MoveBlock`. */
|
|
40
71
|
export interface MoveDest {
|
|
41
72
|
parent?: BlockPath;
|
|
42
73
|
slot?: string;
|
|
43
74
|
index: number;
|
|
44
75
|
}
|
|
76
|
+
/** Options for `ConfigureBlock`. */
|
|
45
77
|
export interface ConfigureBlockOpts extends MutationOpts {
|
|
78
|
+
/** Replace the whole options object instead of merging. */
|
|
46
79
|
replace?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Patch the block's child metadata (`slot`, `colSpan`, …) as well. A key set
|
|
82
|
+
* to `undefined` is removed. Rejected on a top-level block, which has no
|
|
83
|
+
* `.child()` call to carry it.
|
|
84
|
+
*/
|
|
47
85
|
meta?: ConfigObject;
|
|
48
86
|
}
|
|
49
87
|
export declare const ListPages: () => Promise<PageSummary[]>;
|
|
50
88
|
export declare const ListCategories: () => Promise<CategorySummary[]>;
|
|
51
89
|
export declare const GetCatalog: () => Promise<BlockCatalog>;
|
|
90
|
+
/**
|
|
91
|
+
* The sources a developer declared beside their own routes, optionally narrowed
|
|
92
|
+
* to those a given block can read.
|
|
93
|
+
*
|
|
94
|
+
* Separate from the catalog because they come and go with module loads, and a
|
|
95
|
+
* caller asking for them wants what is registered now.
|
|
96
|
+
*/
|
|
52
97
|
export declare const ListDataSources: (response?: string | undefined) => Promise<DataSourceDescriptor[]>;
|
|
53
98
|
export declare const GetPageStructure: (ref: string) => Promise<OpResult<PageStructure>>;
|
|
99
|
+
/**
|
|
100
|
+
* Force reconcile against disk (e.g. after a vibe-mode excursion). Deduped:
|
|
101
|
+
* mtime-gated, scoped, and coalesced — safe to over-call.
|
|
102
|
+
*/
|
|
54
103
|
export declare const RefreshSourceIndex: (scope?: RefreshScope | undefined) => Promise<void>;
|
|
55
104
|
export declare const CreatePage: (input: CreatePageInput) => Promise<OpResult<{
|
|
56
105
|
ref: PageRef;
|
|
57
106
|
filepath: string;
|
|
58
107
|
}>>;
|
|
108
|
+
/**
|
|
109
|
+
* Patch a page's metadata. The result carries the page's ref, which the patch
|
|
110
|
+
* can change: a page's category decides its route, so moving it between
|
|
111
|
+
* categories moves its URL — reported as a `route_changed` warning, since
|
|
112
|
+
* nothing redirects the old one. It also carries the version of the page file
|
|
113
|
+
* it wrote, which a draft held across the patch saves against.
|
|
114
|
+
*/
|
|
59
115
|
export declare const ConfigurePage: (ref: string, patch: Partial<EditablePageMeta>, opts?: MutationOpts | undefined) => Promise<OpResult<{
|
|
60
116
|
ref: PageRef;
|
|
117
|
+
version: string;
|
|
61
118
|
}>>;
|
|
62
119
|
export declare const DeletePage: (ref: string, opts?: MutationOpts | undefined) => Promise<OpResult>;
|
|
63
120
|
export declare const CreateCategory: (input: CreateCategoryInput) => Promise<OpResult<{
|
package/dist/operations.js
CHANGED
|
@@ -5,10 +5,28 @@ const interface_core_1 = require("@antelopejs/interface-core");
|
|
|
5
5
|
exports.ListPages = (0, interface_core_1.InterfaceFunction)();
|
|
6
6
|
exports.ListCategories = (0, interface_core_1.InterfaceFunction)();
|
|
7
7
|
exports.GetCatalog = (0, interface_core_1.InterfaceFunction)();
|
|
8
|
+
/**
|
|
9
|
+
* The sources a developer declared beside their own routes, optionally narrowed
|
|
10
|
+
* to those a given block can read.
|
|
11
|
+
*
|
|
12
|
+
* Separate from the catalog because they come and go with module loads, and a
|
|
13
|
+
* caller asking for them wants what is registered now.
|
|
14
|
+
*/
|
|
8
15
|
exports.ListDataSources = (0, interface_core_1.InterfaceFunction)();
|
|
9
16
|
exports.GetPageStructure = (0, interface_core_1.InterfaceFunction)();
|
|
17
|
+
/**
|
|
18
|
+
* Force reconcile against disk (e.g. after a vibe-mode excursion). Deduped:
|
|
19
|
+
* mtime-gated, scoped, and coalesced — safe to over-call.
|
|
20
|
+
*/
|
|
10
21
|
exports.RefreshSourceIndex = (0, interface_core_1.InterfaceFunction)();
|
|
11
22
|
exports.CreatePage = (0, interface_core_1.InterfaceFunction)();
|
|
23
|
+
/**
|
|
24
|
+
* Patch a page's metadata. The result carries the page's ref, which the patch
|
|
25
|
+
* can change: a page's category decides its route, so moving it between
|
|
26
|
+
* categories moves its URL — reported as a `route_changed` warning, since
|
|
27
|
+
* nothing redirects the old one. It also carries the version of the page file
|
|
28
|
+
* it wrote, which a draft held across the patch saves against.
|
|
29
|
+
*/
|
|
12
30
|
exports.ConfigurePage = (0, interface_core_1.InterfaceFunction)();
|
|
13
31
|
exports.DeletePage = (0, interface_core_1.InterfaceFunction)();
|
|
14
32
|
exports.CreateCategory = (0, interface_core_1.InterfaceFunction)();
|
package/dist/operations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAqGlD,QAAA,SAAS,GAAG,IAAA,kCAAiB,GAAgC,CAAC;AAC9D,QAAA,cAAc,GACzB,IAAA,kCAAiB,GAAoC,CAAC;AAC3C,QAAA,UAAU,GAAG,IAAA,kCAAiB,GAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../src/operations.ts"],"names":[],"mappings":";;;AAAA,+DAA+D;AAqGlD,QAAA,SAAS,GAAG,IAAA,kCAAiB,GAAgC,CAAC;AAC9D,QAAA,cAAc,GACzB,IAAA,kCAAiB,GAAoC,CAAC;AAC3C,QAAA,UAAU,GAAG,IAAA,kCAAiB,GAA+B,CAAC;AAE3E;;;;;;GAMG;AACU,QAAA,eAAe,GAC1B,IAAA,kCAAiB,GAA0D,CAAC;AACjE,QAAA,gBAAgB,GAC3B,IAAA,kCAAiB,GAAsD,CAAC;AAE1E;;;GAGG;AACU,QAAA,kBAAkB,GAC7B,IAAA,kCAAiB,GAA2C,CAAC;AAElD,QAAA,UAAU,GACrB,IAAA,kCAAiB,GAId,CAAC;AACN;;;;;;GAMG;AACU,QAAA,aAAa,GACxB,IAAA,kCAAiB,GAMd,CAAC;AACO,QAAA,UAAU,GACrB,IAAA,kCAAiB,GAA4D,CAAC;AAEnE,QAAA,cAAc,GACzB,IAAA,kCAAiB,GAEd,CAAC;AACO,QAAA,iBAAiB,GAC5B,IAAA,kCAAiB,GAKd,CAAC;AACO,QAAA,cAAc,GACzB,IAAA,kCAAiB,GAA2C,CAAC;AAElD,QAAA,QAAQ,GACnB,IAAA,kCAAiB,GAKd,CAAC;AACO,QAAA,cAAc,GACzB,IAAA,kCAAiB,GAMd,CAAC;AACO,QAAA,SAAS,GACpB,IAAA,kCAAiB,GAEd,CAAC;AACO,QAAA,WAAW,GACtB,IAAA,kCAAiB,GAEd,CAAC"}
|
package/dist/project.d.ts
CHANGED
|
@@ -1,28 +1,54 @@
|
|
|
1
1
|
import type { OpResult } from "./results";
|
|
2
2
|
import type { ConfigObject } from "./values";
|
|
3
|
+
/** One `importOverrides` entry: a pin when `id` is absent, a named connection when it is set. */
|
|
3
4
|
export interface ImportOverrideInput {
|
|
4
5
|
interface: string;
|
|
6
|
+
/** The module that provides it; omitted for a connection to a standalone interface. */
|
|
5
7
|
source?: string;
|
|
6
8
|
id?: string;
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* What a project-config operation writes into one module's entry of `antelope.config.ts`.
|
|
12
|
+
*
|
|
13
|
+
* Secrets never pass through it: `env` maps a config path to the *name* of an environment
|
|
14
|
+
* variable, written into `envOverrides`, and the value stays wherever the environment keeps it.
|
|
15
|
+
*/
|
|
8
16
|
export interface ModuleEntryInput {
|
|
17
|
+
/** The module's source, as `antelope.config.ts` spells it. */
|
|
9
18
|
source?: ConfigObject;
|
|
19
|
+
/** Plain configuration values; merged key by key into an existing entry. */
|
|
10
20
|
config?: ConfigObject;
|
|
21
|
+
/** Config path under the module's `config`, e.g. `url`, to the variable that supplies it. */
|
|
11
22
|
env?: Record<string, string>;
|
|
23
|
+
/** Added to the module's own; a pin that contradicts an existing one is refused. */
|
|
12
24
|
importOverrides?: ImportOverrideInput[];
|
|
25
|
+
/** Merged into the module's own. */
|
|
13
26
|
exportPriority?: Record<string, number>;
|
|
27
|
+
/**
|
|
28
|
+
* Interfaces the module implements that core must never offer from it, such as the raw-client
|
|
29
|
+
* interface of a database module serving an external database. Added to the module's own.
|
|
30
|
+
*/
|
|
14
31
|
disabledExports?: string[];
|
|
15
32
|
}
|
|
33
|
+
/** Adds a module entry. Refused when the id exists. */
|
|
16
34
|
export interface AddModuleStep {
|
|
17
35
|
op: "AddModule";
|
|
18
36
|
id: string;
|
|
19
37
|
entry: ModuleEntryInput;
|
|
20
38
|
}
|
|
39
|
+
/** Merges into an existing module entry. */
|
|
21
40
|
export interface ConfigureModuleStep {
|
|
22
41
|
op: "ConfigureModule";
|
|
23
42
|
id: string;
|
|
24
43
|
entry: ModuleEntryInput;
|
|
25
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Scaffolds a local module at `path` (relative to the project root) and adds its entry: a
|
|
47
|
+
* `package.json` carrying the project's interface dependencies, a `tsconfig.json` with the
|
|
48
|
+
* project's compiler options, and an `src/index.ts`. The entry watches and rebuilds it as the
|
|
49
|
+
* project's own module is. With `connection`, its `dmsBuilder.database` record names that
|
|
50
|
+
* connection: the module holds that connection's tables, and goes with it when it is removed.
|
|
51
|
+
*/
|
|
26
52
|
export interface CreateLocalModuleStep {
|
|
27
53
|
op: "CreateLocalModule";
|
|
28
54
|
id: string;
|
|
@@ -30,26 +56,62 @@ export interface CreateLocalModuleStep {
|
|
|
30
56
|
entry?: ModuleEntryInput;
|
|
31
57
|
connection?: string;
|
|
32
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Removes a module entry and the `envOverrides` entries that supply its config. Its files stay.
|
|
61
|
+
* Refused while another module's `importOverrides` names it as a source.
|
|
62
|
+
*/
|
|
33
63
|
export interface RemoveModuleStep {
|
|
34
64
|
op: "RemoveModule";
|
|
35
65
|
id: string;
|
|
36
66
|
}
|
|
67
|
+
/** Removes the named connection `id` to `interface` from every module's `importOverrides`. */
|
|
37
68
|
export interface RemoveConnectionStep {
|
|
38
69
|
op: "RemoveConnection";
|
|
39
70
|
interface: string;
|
|
40
71
|
id: string;
|
|
41
72
|
}
|
|
42
73
|
export type ProjectConfigStep = AddModuleStep | ConfigureModuleStep | CreateLocalModuleStep | RemoveModuleStep | RemoveConnectionStep;
|
|
74
|
+
/** Options for a project-config operation. */
|
|
43
75
|
export interface ProjectConfigOpts {
|
|
76
|
+
/** Answer the changes the steps would make, and write nothing. */
|
|
44
77
|
dryRun?: boolean;
|
|
45
78
|
}
|
|
79
|
+
/** Options for `CreateLocalModule`. */
|
|
46
80
|
export interface CreateLocalModuleOpts extends ProjectConfigOpts {
|
|
81
|
+
/** The connection whose tables the module holds, as `CreateLocalModuleStep.connection`. */
|
|
47
82
|
connection?: string;
|
|
48
83
|
}
|
|
84
|
+
/** A variable's development value, sent with the batch that maps it. */
|
|
85
|
+
export interface ProjectVariable {
|
|
86
|
+
name: string;
|
|
87
|
+
value: string;
|
|
88
|
+
}
|
|
89
|
+
/** Options for `ConfigureProject`. */
|
|
90
|
+
export interface ConfigureProjectOpts extends ProjectConfigOpts {
|
|
91
|
+
/**
|
|
92
|
+
* Development values of variables the steps map in their `env`, written into the project's
|
|
93
|
+
* `.env` before the configuration. A variable the steps do not map is refused. Ignored on a dry run.
|
|
94
|
+
*
|
|
95
|
+
* Owner path only: the MCP tool `builder_configure_project` never passes it, so only an
|
|
96
|
+
* owner-authenticated entry writes `.env` through it.
|
|
97
|
+
*/
|
|
98
|
+
variables?: ProjectVariable[];
|
|
99
|
+
}
|
|
100
|
+
/** The files a project-config operation wrote, or would write. */
|
|
49
101
|
export interface ProjectConfigResult {
|
|
50
102
|
files: string[];
|
|
51
103
|
}
|
|
52
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Applies steps to `antelope.config.ts` in order, as one edit: every step is validated before
|
|
106
|
+
* anything is written, and none is written if one is refused. The configuration must be a
|
|
107
|
+
* `defineConfig({ … })` (or plain object) literal with a literal `modules`. With `variables`,
|
|
108
|
+
* `.env` is written first, once a dry run accepted the steps, and put back when the configuration
|
|
109
|
+
* cannot be written.
|
|
110
|
+
*/
|
|
111
|
+
export declare const ConfigureProject: (steps: ProjectConfigStep[], opts?: ConfigureProjectOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
|
|
112
|
+
/** One `AddModule` step. */
|
|
53
113
|
export declare const AddModule: (id: string, entry: ModuleEntryInput, opts?: ProjectConfigOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
|
|
114
|
+
/** One `ConfigureModule` step. */
|
|
54
115
|
export declare const ConfigureModule: (id: string, entry: ModuleEntryInput, opts?: ProjectConfigOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
|
|
116
|
+
/** One `CreateLocalModule` step; `opts.connection` is the step's `connection`. */
|
|
55
117
|
export declare const CreateLocalModule: (id: string, path: string, entry?: ModuleEntryInput | undefined, opts?: CreateLocalModuleOpts | undefined) => Promise<OpResult<ProjectConfigResult>>;
|