@dudousxd/nestjs-catalog-react 0.17.0 → 0.19.0-preview.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 (54) hide show
  1. package/README.md +39 -13
  2. package/dist/CatalogManager.d.ts +23 -1
  3. package/dist/CatalogManager.js +76 -13
  4. package/dist/ConnectionPanel.d.ts +11 -7
  5. package/dist/ConnectionPanel.js +78 -149
  6. package/dist/LoadedBySection.d.ts +39 -0
  7. package/dist/LoadedBySection.js +143 -0
  8. package/dist/PipelineConsole.d.ts +23 -126
  9. package/dist/PipelineConsole.js +39 -551
  10. package/dist/WorkflowCanvas.d.ts +16 -0
  11. package/dist/WorkflowCanvas.js +1064 -64
  12. package/dist/connection-form.d.ts +241 -0
  13. package/dist/connection-form.js +235 -0
  14. package/dist/context.d.ts +236 -38
  15. package/dist/context.js +46 -11
  16. package/dist/index.d.ts +10 -3
  17. package/dist/index.js +63 -14
  18. package/dist/routes.d.ts +84 -13
  19. package/dist/routes.js +7 -4
  20. package/dist/schema-discovery.d.ts +232 -0
  21. package/dist/schema-discovery.js +225 -0
  22. package/dist/source-connection.d.ts +82 -0
  23. package/dist/source-connection.js +176 -0
  24. package/dist/source-fields.d.ts +16 -14
  25. package/dist/source-fields.js +28 -18
  26. package/dist/ui/code-editor.d.ts +44 -2
  27. package/dist/ui/code-editor.js +10 -2
  28. package/dist/ui/combobox.d.ts +97 -0
  29. package/dist/ui/combobox.js +80 -0
  30. package/dist/ui/dialog.d.ts +13 -1
  31. package/dist/ui/dialog.js +13 -2
  32. package/dist/workflow/edges.d.ts +110 -0
  33. package/dist/workflow/edges.js +112 -0
  34. package/dist/workflow/graph.d.ts +39 -1
  35. package/dist/workflow/graph.js +212 -52
  36. package/dist/workflow/index.d.ts +8 -0
  37. package/dist/workflow/index.js +12 -0
  38. package/dist/workflow/lifecycle.d.ts +135 -0
  39. package/dist/workflow/lifecycle.js +216 -0
  40. package/dist/workflow/model.d.ts +17 -3
  41. package/dist/workflow/model.js +7 -2
  42. package/dist/workflow/nodes.d.ts +4 -1
  43. package/dist/workflow/nodes.js +198 -10
  44. package/dist/workflow/runs.d.ts +38 -0
  45. package/dist/workflow/runs.js +101 -0
  46. package/dist/workflow/shape.d.ts +169 -0
  47. package/dist/workflow/shape.js +249 -0
  48. package/dist/workflow/templates.d.ts +623 -0
  49. package/dist/workflow/templates.js +1102 -0
  50. package/dist/workflow/validate.d.ts +20 -1
  51. package/dist/workflow/validate.js +52 -3
  52. package/dist/workflow/wiring.d.ts +84 -0
  53. package/dist/workflow/wiring.js +254 -0
  54. package/package.json +9 -9
@@ -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
- * Where the checkboxes start, and why the untyped ones start off.
13
+ * The two things a pipeline borrows, and neither of them is a pipeline.
117
14
  *
118
- * A column discovery could type is proposed; a column it could not is present,
119
- * visible, and **excluded** until somebody says what it is. Pre-selecting it
120
- * with a plausible default is the failure that matters — a wrong type becomes a
121
- * wrong column in a lake nobody re-checks, and everything downstream reads it
122
- * as fact rather than as the guess it was.
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
- * Keyed by position rather than by name on purpose: `SELECT a.id, b.id` gives
125
- * two columns called `id`, and a map would silently merge their choices.
126
- */
127
- export declare function initialChoices(columns: DiscoveredColumn[]): ColumnChoice[];
128
- /**
129
- * The type this would create, and everything standing in the way of creating it.
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
- * Pure, and separate from the panel, because these are the rules that decide
132
- * whether a schema somebody approved is one the publish route will accept — and
133
- * rules that live inside a component are rules only a rendered DOM can check.
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
- * `columnName` is sent as well as `name`, and they are the same string. The
136
- * publish service maps `columnName` to `sourceColumn` and `name` to the property
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 proposalFrom(discovery: ConnectorSchemaDiscovery, choices: ColumnChoice[]): {
141
- draft: DiscoveredTypeDraft;
142
- problems: string[];
143
- };
40
+ export declare function PipelineConsole({ title, eyebrow, intro, canEdit, }: PipelineConsoleProps): import("react/jsx-runtime").JSX.Element;