@dudousxd/nestjs-catalog-react 0.16.0 → 0.18.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 +39 -13
- package/dist/ConnectionPanel.d.ts +11 -7
- package/dist/ConnectionPanel.js +65 -28
- package/dist/ObjectExplorer.js +424 -48
- package/dist/PipelineConsole.d.ts +23 -126
- package/dist/PipelineConsole.js +39 -551
- package/dist/QueryConsole.js +25 -17
- package/dist/SavedQueryPanel.js +1 -1
- package/dist/TransformEditor.js +12 -3
- package/dist/WorkflowCanvas.js +401 -29
- package/dist/bundler/index.d.ts +20 -0
- package/dist/bundler/index.js +20 -0
- package/dist/bundler/shiki-subset.d.ts +83 -0
- package/dist/bundler/shiki-subset.js +196 -0
- package/dist/context.d.ts +181 -38
- package/dist/context.js +44 -11
- package/dist/diff/RevisionDiff.d.ts +67 -4
- package/dist/diff/RevisionDiff.js +126 -91
- package/dist/index.d.ts +8 -5
- package/dist/index.js +56 -20
- package/dist/routes.d.ts +54 -13
- package/dist/routes.js +5 -4
- package/dist/schema-discovery.d.ts +216 -0
- package/dist/schema-discovery.js +225 -0
- package/dist/source-fields.d.ts +1 -12
- package/dist/source-fields.js +13 -16
- package/dist/ui/code-editor.d.ts +196 -8
- package/dist/ui/code-editor.js +184 -72
- package/dist/ui/code-languages.d.ts +80 -0
- package/dist/ui/code-languages.js +76 -0
- package/dist/ui/code-theme.d.ts +25 -0
- package/dist/ui/code-theme.js +26 -0
- package/dist/ui/dialog.d.ts +13 -1
- package/dist/ui/dialog.js +13 -2
- package/dist/workflow/graph.js +31 -9
- package/dist/workflow/index.d.ts +2 -0
- package/dist/workflow/index.js +7 -0
- package/dist/workflow/lifecycle.d.ts +164 -0
- package/dist/workflow/lifecycle.js +249 -0
- package/dist/workflow/model.d.ts +1 -1
- package/dist/workflow/nodes.js +10 -1
- package/dist/workflow/runs.d.ts +38 -0
- package/dist/workflow/runs.js +101 -0
- package/dist/workflow/shape.d.ts +169 -0
- package/dist/workflow/shape.js +249 -0
- package/dist/workflow/templates.d.ts +623 -0
- package/dist/workflow/templates.js +1092 -0
- package/dist/workflow/validate.d.ts +20 -1
- package/dist/workflow/validate.js +41 -3
- package/package.json +21 -17
- package/dist/diff/line-diff.d.ts +0 -124
- package/dist/diff/line-diff.js +0 -318
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ScalarType } from '@dudousxd/nestjs-catalog/client';
|
|
2
1
|
export interface PipelineConsoleProps {
|
|
3
2
|
/** Heading copy, so the host can call this whatever its users call it. */
|
|
4
3
|
title?: string;
|
|
@@ -9,135 +8,33 @@ export interface PipelineConsoleProps {
|
|
|
9
8
|
* regardless; this only stops the console offering buttons that always 403.
|
|
10
9
|
*/
|
|
11
10
|
canEdit?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Asking a connector what its source looks like, and creating the type from
|
|
14
|
-
* the answer.
|
|
15
|
-
*
|
|
16
|
-
* A prop rather than two more methods on `CatalogClient`, and that is not a
|
|
17
|
-
* design preference — it is the honest report of a boundary. `CatalogClient`
|
|
18
|
-
* carries no `discoverConnectorSchema` and no publish call of any kind, and
|
|
19
|
-
* both live in `context.tsx`, so a console that reached for them would be
|
|
20
|
-
* naming methods that do not exist. Wiring is one function each:
|
|
21
|
-
*
|
|
22
|
-
* discover: POST <pipelineBasePath>/connectors/:id/discover
|
|
23
|
-
* createType: PUT <publishBasePath>/publish/:name/schema
|
|
24
|
-
*
|
|
25
|
-
* Omit it and the connector editor simply does not offer discovery, which is
|
|
26
|
-
* the correct state for a host that has not mounted those routes. Supply
|
|
27
|
-
* `discover` without `createType` and the panel does everything up to the
|
|
28
|
-
* confirmation and then shows the exact request it would have sent — the
|
|
29
|
-
* publish route requires `catalog:write` and per-type ownership, and a host
|
|
30
|
-
* that has deliberately not given its console that has to be able to say so
|
|
31
|
-
* without the screen pretending the button is merely broken.
|
|
32
|
-
*/
|
|
33
|
-
schemaDiscovery?: SchemaDiscoveryBridge;
|
|
34
|
-
}
|
|
35
|
-
export interface SchemaDiscoveryBridge {
|
|
36
|
-
discover(connectorId: string): Promise<ConnectorSchemaDiscovery>;
|
|
37
|
-
/**
|
|
38
|
-
* Create the type from what a person confirmed. Absent is a supported state —
|
|
39
|
-
* see {@link PipelineConsoleProps.schemaDiscovery}.
|
|
40
|
-
*/
|
|
41
|
-
createType?(draft: DiscoveredTypeDraft): Promise<unknown>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* What `POST pipeline/connectors/:id/discover` answers, mirrored for the browser.
|
|
45
|
-
*
|
|
46
|
-
* Mirrored rather than imported, exactly as `PipelineCapabilities` is in
|
|
47
|
-
* `context.tsx`: the authority is `schema-discovery.ts` in
|
|
48
|
-
* `@dudousxd/nestjs-catalog-pipeline`, which is a NestJS package with a
|
|
49
|
-
* `node:fs` import in its dependency graph and has no business in a browser
|
|
50
|
-
* bundle. The two are kept honest by being the documented response of one route,
|
|
51
|
-
* and by this screen treating every field it renders as something the server may
|
|
52
|
-
* not have sent.
|
|
53
|
-
*/
|
|
54
|
-
export interface DiscoveredColumn {
|
|
55
|
-
/**
|
|
56
|
-
* The column as the source spells it, which is also the property name. The
|
|
57
|
-
* server explains at length why it is not tidied: the store matches records to
|
|
58
|
-
* properties by property NAME, so a renamed property is a column that loads
|
|
59
|
-
* null on every run and reports success.
|
|
60
|
-
*/
|
|
61
|
-
name: string;
|
|
62
|
-
/** `null` means discovery reached no conclusion — which is not a type. */
|
|
63
|
-
type: ScalarType | null;
|
|
64
|
-
confidence: 'reported' | 'inferred' | 'unknown';
|
|
65
|
-
sourceType: string;
|
|
66
|
-
/** `null` where the source did not say. Postgres never does. */
|
|
67
|
-
nullable: boolean | null;
|
|
68
|
-
note?: string;
|
|
69
|
-
}
|
|
70
|
-
export interface SchemaDrift {
|
|
71
|
-
added: string[];
|
|
72
|
-
removed: string[];
|
|
73
|
-
retyped: Array<{
|
|
74
|
-
property: string;
|
|
75
|
-
was: ScalarType;
|
|
76
|
-
now: ScalarType;
|
|
77
|
-
}>;
|
|
78
|
-
}
|
|
79
|
-
export interface ConnectorSchemaDiscovery {
|
|
80
|
-
connectorId: string;
|
|
81
|
-
connectorName: string;
|
|
82
|
-
targetType: string;
|
|
83
|
-
typeExists: boolean;
|
|
84
|
-
basis: 'driver' | 'sample';
|
|
85
|
-
sampled: number;
|
|
86
|
-
caveat: string;
|
|
87
|
-
columns: DiscoveredColumn[];
|
|
88
|
-
drift: SchemaDrift | null;
|
|
89
|
-
}
|
|
90
|
-
/** The subset of a published type this screen is able to state. */
|
|
91
|
-
export interface DiscoveredTypeDraft {
|
|
92
|
-
name: string;
|
|
93
|
-
properties: Array<{
|
|
94
|
-
name: string;
|
|
95
|
-
columnName: string;
|
|
96
|
-
type: ScalarType;
|
|
97
|
-
nullable: boolean;
|
|
98
|
-
}>;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Where data comes from, and the code that shapes it.
|
|
102
|
-
*
|
|
103
|
-
* Three tabs on one screen because they are only ever understood together: a
|
|
104
|
-
* connection without its connectors is an address nobody uses, a connector
|
|
105
|
-
* without its transform is a URL, and a transform without the connector it
|
|
106
|
-
* feeds is code nobody can place.
|
|
107
|
-
*/
|
|
108
|
-
export declare function PipelineConsole({ title, eyebrow, intro, canEdit, schemaDiscovery, }: PipelineConsoleProps): import("react/jsx-runtime").JSX.Element;
|
|
109
|
-
/** What a person decided about one discovered column. */
|
|
110
|
-
export interface ColumnChoice {
|
|
111
|
-
include: boolean;
|
|
112
|
-
/** Empty means nothing has been chosen yet — see {@link initialChoices}. */
|
|
113
|
-
type: ScalarType | '';
|
|
114
11
|
}
|
|
115
12
|
/**
|
|
116
|
-
*
|
|
13
|
+
* The two things a pipeline borrows, and neither of them is a pipeline.
|
|
117
14
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
15
|
+
* WHAT THIS SCREEN STOPPED BEING
|
|
16
|
+
* ------------------------------
|
|
17
|
+
* It was `#connectors`, and its middle tab was where somebody authored a load:
|
|
18
|
+
* a name, a source kind, an address, a credential, a transform, a target type, a
|
|
19
|
+
* schedule. Every one of those is a field on a node of a graph now, and the
|
|
20
|
+
* routes behind that tab are gone — a connector is not authored any more, it is
|
|
21
|
+
* what a published {@link WORKFLOW_NAME.singular} runs as. Keeping the tab would
|
|
22
|
+
* have meant a form whose Save button 404s, which is worse than no form.
|
|
123
23
|
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
24
|
+
* WHAT IS LEFT, AND WHY IT IS NOT ON THE CANVAS
|
|
25
|
+
* ---------------------------------------------
|
|
26
|
+
* A connection is the credential and address boundary: a real object somebody
|
|
27
|
+
* manages, shared by several pipelines, with a "can this host actually be
|
|
28
|
+
* reached" question of its own that has nothing to do with any graph. Moving it
|
|
29
|
+
* onto a canvas would make managing an address something you can only do while
|
|
30
|
+
* drawing something.
|
|
130
31
|
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
32
|
+
* A transform is the other shared object — code, referenced by node id from any
|
|
33
|
+
* number of graphs. The canvas creates one and edits its code inline, because
|
|
34
|
+
* that is where you want it while wiring; this is where the whole set is listed,
|
|
35
|
+
* and where deleting one is a decision made deliberately rather than mid-drag.
|
|
134
36
|
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* itself, and the store reads records by property name; sending them equal is
|
|
138
|
-
* what makes a load match. See the server's `DiscoveredColumn.name`.
|
|
37
|
+
* Authoring a pipeline is one screen and it is not this one. See
|
|
38
|
+
* `WorkflowCanvas`.
|
|
139
39
|
*/
|
|
140
|
-
export declare function
|
|
141
|
-
draft: DiscoveredTypeDraft;
|
|
142
|
-
problems: string[];
|
|
143
|
-
};
|
|
40
|
+
export declare function PipelineConsole({ title, eyebrow, intro, canEdit, }: PipelineConsoleProps): import("react/jsx-runtime").JSX.Element;
|