@adminiumjs/engine 0.1.0-rc.1
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/LICENSE +661 -0
- package/dist/adapter-registry.d.ts +62 -0
- package/dist/adapter-registry.d.ts.map +1 -0
- package/dist/adapter-registry.js +75 -0
- package/dist/adapter-registry.js.map +1 -0
- package/dist/adapter.d.ts +384 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +54 -0
- package/dist/adapter.js.map +1 -0
- package/dist/capabilities.d.ts +57 -0
- package/dist/capabilities.d.ts.map +1 -0
- package/dist/capabilities.js +131 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/classify/columns.d.ts +57 -0
- package/dist/classify/columns.d.ts.map +1 -0
- package/dist/classify/columns.js +535 -0
- package/dist/classify/columns.js.map +1 -0
- package/dist/classify/index.d.ts +29 -0
- package/dist/classify/index.d.ts.map +1 -0
- package/dist/classify/index.js +44 -0
- package/dist/classify/index.js.map +1 -0
- package/dist/classify/names.d.ts +11 -0
- package/dist/classify/names.d.ts.map +1 -0
- package/dist/classify/names.js +19 -0
- package/dist/classify/names.js.map +1 -0
- package/dist/classify/pii.d.ts +29 -0
- package/dist/classify/pii.d.ts.map +1 -0
- package/dist/classify/pii.js +55 -0
- package/dist/classify/pii.js.map +1 -0
- package/dist/classify/tables.d.ts +64 -0
- package/dist/classify/tables.d.ts.map +1 -0
- package/dist/classify/tables.js +303 -0
- package/dist/classify/tables.js.map +1 -0
- package/dist/config-schema/envelope.d.ts +83 -0
- package/dist/config-schema/envelope.d.ts.map +1 -0
- package/dist/config-schema/envelope.js +87 -0
- package/dist/config-schema/envelope.js.map +1 -0
- package/dist/config-schema/index.d.ts +14 -0
- package/dist/config-schema/index.d.ts.map +1 -0
- package/dist/config-schema/index.js +15 -0
- package/dist/config-schema/index.js.map +1 -0
- package/dist/config-schema/migrations.d.ts +44 -0
- package/dist/config-schema/migrations.d.ts.map +1 -0
- package/dist/config-schema/migrations.js +62 -0
- package/dist/config-schema/migrations.js.map +1 -0
- package/dist/generate/archetype.d.ts +76 -0
- package/dist/generate/archetype.d.ts.map +1 -0
- package/dist/generate/archetype.js +250 -0
- package/dist/generate/archetype.js.map +1 -0
- package/dist/generate/crud.d.ts +36 -0
- package/dist/generate/crud.d.ts.map +1 -0
- package/dist/generate/crud.js +45 -0
- package/dist/generate/crud.js.map +1 -0
- package/dist/generate/dashboard.d.ts +43 -0
- package/dist/generate/dashboard.d.ts.map +1 -0
- package/dist/generate/dashboard.js +61 -0
- package/dist/generate/dashboard.js.map +1 -0
- package/dist/generate/domains.d.ts +29 -0
- package/dist/generate/domains.d.ts.map +1 -0
- package/dist/generate/domains.js +145 -0
- package/dist/generate/domains.js.map +1 -0
- package/dist/generate/index.d.ts +78 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +301 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/util.d.ts +46 -0
- package/dist/generate/util.d.ts.map +1 -0
- package/dist/generate/util.js +123 -0
- package/dist/generate/util.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/schema-model.d.ts +1853 -0
- package/dist/schema-model.d.ts.map +1 -0
- package/dist/schema-model.js +463 -0
- package/dist/schema-model.js.map +1 -0
- package/dist/snapshot/diff.d.ts +258 -0
- package/dist/snapshot/diff.d.ts.map +1 -0
- package/dist/snapshot/diff.js +151 -0
- package/dist/snapshot/diff.js.map +1 -0
- package/dist/snapshot/hash.d.ts +23 -0
- package/dist/snapshot/hash.d.ts.map +1 -0
- package/dist/snapshot/hash.js +47 -0
- package/dist/snapshot/hash.js.map +1 -0
- package/dist/snapshot/index.d.ts +28 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +26 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/snapshot/sha256.d.ts +14 -0
- package/dist/snapshot/sha256.d.ts.map +1 -0
- package/dist/snapshot/sha256.js +99 -0
- package/dist/snapshot/sha256.js.map +1 -0
- package/package.json +37 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,oEAAoE;AACpE,eAAO,MAAM,cAAc,0CAA2C,CAAC;AACvE,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAkEvB,kEAAkE;AAClE,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAIxF,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,EAAE,mBAA4B,CAAC;AAEpE,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAEnF;AAMD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,qLAaxB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,EAAE,CAiBvF;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,aAAa,GAAG,MAAM,CAAC;AAErE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,gBAAgB,GAAG,kBAAkB,CAKxF"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/** Engines a live connection can use ('generic' is import-only). */
|
|
2
|
+
export const SOURCE_ENGINES = ['postgres', 'mysql', 'sqlite'];
|
|
3
|
+
/** Static dialect capabilities — 05 §4.1 (probe refines per-connection). */
|
|
4
|
+
const POSTGRES = {
|
|
5
|
+
hasEnums: true,
|
|
6
|
+
hasFKs: true,
|
|
7
|
+
hasSchemas: true,
|
|
8
|
+
hasComments: true,
|
|
9
|
+
hasChecks: true,
|
|
10
|
+
hasRLS: true,
|
|
11
|
+
hasMaterializedViews: true,
|
|
12
|
+
hasRowEstimates: true,
|
|
13
|
+
supportsStatementTimeout: true,
|
|
14
|
+
supportsReturning: true,
|
|
15
|
+
maxIdentifierLength: 63,
|
|
16
|
+
};
|
|
17
|
+
/** 05 §4.2 — MySQL 8 / MariaDB 10.5+. */
|
|
18
|
+
const MYSQL = {
|
|
19
|
+
hasEnums: true, // column enums: enum('a','b') — 05 §2.1
|
|
20
|
+
hasFKs: true, // false per-table for MyISAM (warning emitted)
|
|
21
|
+
hasSchemas: false,
|
|
22
|
+
hasComments: true,
|
|
23
|
+
hasChecks: true, // 8.0.16+/10.2+ — feature-detected, degrades with a warning
|
|
24
|
+
hasRLS: false,
|
|
25
|
+
hasMaterializedViews: false,
|
|
26
|
+
hasRowEstimates: true, // TABLE_ROWS — InnoDB estimates drift, display with ≈
|
|
27
|
+
supportsStatementTimeout: true,
|
|
28
|
+
supportsReturning: false, // MySQL mutate re-selects; MariaDB 10.5+ detected at runtime
|
|
29
|
+
maxIdentifierLength: 64,
|
|
30
|
+
};
|
|
31
|
+
/** 05 §4.3 — SQLite ≥ 3.35 (file-path connections; the Electron engine). */
|
|
32
|
+
const SQLITE = {
|
|
33
|
+
hasEnums: false, // CHECK synthesis only — 05 §4.3
|
|
34
|
+
hasFKs: true,
|
|
35
|
+
hasSchemas: false,
|
|
36
|
+
hasComments: false, // no comment syntax — Studio remap is the labeling path
|
|
37
|
+
hasChecks: true,
|
|
38
|
+
hasRLS: false,
|
|
39
|
+
hasMaterializedViews: false,
|
|
40
|
+
hasRowEstimates: true, // sqlite_stat1 / small-file exact counts
|
|
41
|
+
supportsStatementTimeout: false, // worker termination is the timeout story
|
|
42
|
+
supportsReturning: true, // SQLite ≥ 3.35 (minimum supported — 05 §4.3)
|
|
43
|
+
maxIdentifierLength: 128,
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Baseline for schema-file imports — 05 §5.2: parsers refine per-format
|
|
47
|
+
* (e.g. Prisma `///` comments), but no import ever has live row estimates,
|
|
48
|
+
* RLS, or health/drift signals.
|
|
49
|
+
*/
|
|
50
|
+
const IMPORT = {
|
|
51
|
+
hasEnums: true,
|
|
52
|
+
hasFKs: true,
|
|
53
|
+
hasSchemas: false,
|
|
54
|
+
hasComments: false,
|
|
55
|
+
hasChecks: false,
|
|
56
|
+
hasRLS: false,
|
|
57
|
+
hasMaterializedViews: false,
|
|
58
|
+
hasRowEstimates: false,
|
|
59
|
+
supportsStatementTimeout: false,
|
|
60
|
+
supportsReturning: false,
|
|
61
|
+
maxIdentifierLength: 128,
|
|
62
|
+
};
|
|
63
|
+
/** The matrix (gap-analysis §2.1): one column per live engine. */
|
|
64
|
+
export const ENGINE_CAPABILITY_MATRIX = {
|
|
65
|
+
postgres: POSTGRES,
|
|
66
|
+
mysql: MYSQL,
|
|
67
|
+
sqlite: SQLITE,
|
|
68
|
+
};
|
|
69
|
+
/** Import baseline (see above) — exported for parsers and the wizard. */
|
|
70
|
+
export const IMPORT_BASE_CAPABILITIES = IMPORT;
|
|
71
|
+
/** Static capabilities for a source (live engine column or import baseline). */
|
|
72
|
+
export function capabilitiesForSource(source) {
|
|
73
|
+
return source.kind === 'live' ? ENGINE_CAPABILITY_MATRIX[source.engine] : IMPORT_BASE_CAPABILITIES;
|
|
74
|
+
}
|
|
75
|
+
// ---------------------------------------------------------------------------
|
|
76
|
+
// Degradation notes
|
|
77
|
+
// ---------------------------------------------------------------------------
|
|
78
|
+
/**
|
|
79
|
+
* Stable degradation-note codes. The dashboard maps each to translated copy;
|
|
80
|
+
* anything not listed for a source needs no caveat there.
|
|
81
|
+
*/
|
|
82
|
+
export const CAPABILITY_NOTE_CODES = [
|
|
83
|
+
/** TABLE_ROWS drifts up to ±40% on InnoDB — always display with ≈ (05 §4.2). */
|
|
84
|
+
'mysql-approximate-row-estimates',
|
|
85
|
+
/** MyISAM tables carry no FKs; enums are column-typed; CHECKs need 8.0.16+/10.2+ (05 §4.2). */
|
|
86
|
+
'mysql-weaker-fk-enum-metadata',
|
|
87
|
+
/** No native enum type — enums are synthesized from CHECK (col IN (…)) (05 §4.3). */
|
|
88
|
+
'sqlite-check-enum-synthesis',
|
|
89
|
+
/** No comment syntax — the remap editor is the labeling path (05 §4.3). */
|
|
90
|
+
'sqlite-no-comments',
|
|
91
|
+
/** Imports carry no row counts — placeholder seeding happens downstream (05 §5.2). */
|
|
92
|
+
'import-no-row-counts',
|
|
93
|
+
/** No live connection: health checks, drift detection and probes unavailable. */
|
|
94
|
+
'import-no-live-health',
|
|
95
|
+
];
|
|
96
|
+
/**
|
|
97
|
+
* Degradation notes for a source, derived from the matrix flags where the
|
|
98
|
+
* flags express the fact, with the per-engine specials (estimate drift,
|
|
99
|
+
* MyISAM) keyed explicitly. Order = display order.
|
|
100
|
+
*/
|
|
101
|
+
export function capabilityNotesForSource(source) {
|
|
102
|
+
const caps = capabilitiesForSource(source);
|
|
103
|
+
const notes = [];
|
|
104
|
+
if (source.kind === 'import') {
|
|
105
|
+
if (!caps.hasRowEstimates)
|
|
106
|
+
notes.push('import-no-row-counts');
|
|
107
|
+
notes.push('import-no-live-health');
|
|
108
|
+
return notes;
|
|
109
|
+
}
|
|
110
|
+
if (source.engine === 'mysql') {
|
|
111
|
+
if (caps.hasRowEstimates)
|
|
112
|
+
notes.push('mysql-approximate-row-estimates');
|
|
113
|
+
notes.push('mysql-weaker-fk-enum-metadata');
|
|
114
|
+
}
|
|
115
|
+
if (source.engine === 'sqlite') {
|
|
116
|
+
if (!caps.hasEnums && caps.hasChecks)
|
|
117
|
+
notes.push('sqlite-check-enum-synthesis');
|
|
118
|
+
if (!caps.hasComments)
|
|
119
|
+
notes.push('sqlite-no-comments');
|
|
120
|
+
}
|
|
121
|
+
return notes;
|
|
122
|
+
}
|
|
123
|
+
export function rowEstimateQualityForSource(source) {
|
|
124
|
+
const caps = capabilitiesForSource(source);
|
|
125
|
+
if (!caps.hasRowEstimates)
|
|
126
|
+
return 'none';
|
|
127
|
+
if (source.kind === 'live' && source.engine === 'mysql')
|
|
128
|
+
return 'approximate';
|
|
129
|
+
return 'estimate';
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../src/capabilities.ts"],"names":[],"mappings":"AAmBA,oEAAoE;AACpE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAWvE,4EAA4E;AAC5E,MAAM,QAAQ,GAAwB;IACpC,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI;IACf,MAAM,EAAE,IAAI;IACZ,oBAAoB,EAAE,IAAI;IAC1B,eAAe,EAAE,IAAI;IACrB,wBAAwB,EAAE,IAAI;IAC9B,iBAAiB,EAAE,IAAI;IACvB,mBAAmB,EAAE,EAAE;CACxB,CAAC;AAEF,yCAAyC;AACzC,MAAM,KAAK,GAAwB;IACjC,QAAQ,EAAE,IAAI,EAAE,wCAAwC;IACxD,MAAM,EAAE,IAAI,EAAE,+CAA+C;IAC7D,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,IAAI;IACjB,SAAS,EAAE,IAAI,EAAE,4DAA4D;IAC7E,MAAM,EAAE,KAAK;IACb,oBAAoB,EAAE,KAAK;IAC3B,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B,CAAC,MAAwB;IAClE,MAAM,IAAI,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC3C,IAAI,CAAC,IAAI,CAAC,eAAe;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,MAAM,CAAC,IAAI,KAAK,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,OAAO;QAAE,OAAO,aAAa,CAAC;IAC9E,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column semantic classification — 05-introspection-engine.md §7.
|
|
3
|
+
*
|
|
4
|
+
* Deterministic ordered rule pipeline: each column receives exactly ONE
|
|
5
|
+
* primary semantic (first matching rule wins, in the §7.1 precedence order)
|
|
6
|
+
* plus independent flags (`secret`, `pii`, `maskedByDefault`) from the §7.2
|
|
7
|
+
* layer (./pii.ts). Rule ids (`r01-secret` … `r30-plain`) mirror the §7.1
|
|
8
|
+
* row numbers — later docs and the LLM prompt reference them.
|
|
9
|
+
*
|
|
10
|
+
* The pipeline is pure and heuristic-only (`source: 'heuristic'`); LLM
|
|
11
|
+
* enrichment (06-llm-assist.md) and Studio overrides land on top with
|
|
12
|
+
* `source: 'llm' | 'override'` and always win downstream.
|
|
13
|
+
*/
|
|
14
|
+
import type { ColumnModel, ColumnSemantics, DatabaseModel, EnumDef, SemanticTag, TableModel } from '../schema-model.js';
|
|
15
|
+
/** One classified column: the persisted semantics plus audit trail. */
|
|
16
|
+
export interface ClassifiedColumn {
|
|
17
|
+
tableId: string;
|
|
18
|
+
column: string;
|
|
19
|
+
/** §7.1 row id that decided `semantics.primary`, e.g. 'r04-money'. */
|
|
20
|
+
ruleId: string;
|
|
21
|
+
/** Human-readable evidence for the Studio remap editor / golden tests. */
|
|
22
|
+
reasons: string[];
|
|
23
|
+
/** Exactly the shape persisted into `ColumnModel.semantics`. */
|
|
24
|
+
semantics: ColumnSemantics;
|
|
25
|
+
}
|
|
26
|
+
export interface PairAssignment {
|
|
27
|
+
semantic: Extract<SemanticTag, 'date-range' | 'geo-point'>;
|
|
28
|
+
role: 'start' | 'end' | 'lat' | 'lng';
|
|
29
|
+
partner: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ColumnClassifyContext {
|
|
32
|
+
table: TableModel;
|
|
33
|
+
enumsById: ReadonlyMap<string, EnumDef>;
|
|
34
|
+
/** Columns resolved as FKs: declared mirror or accepted (≥ 0.8) relation. */
|
|
35
|
+
fkColumns: ReadonlySet<string>;
|
|
36
|
+
/** People-shaped table (§8 directory trigger) — gates rule 16 + PII. */
|
|
37
|
+
peopleish: boolean;
|
|
38
|
+
/** Start/end and lat/lng pair assignments (§7.1 rows 11 and 14). */
|
|
39
|
+
pairs: ReadonlyMap<string, PairAssignment>;
|
|
40
|
+
}
|
|
41
|
+
/** §7.1 row 7 — workflow value vocabulary (verbs/states → kanban trigger). */
|
|
42
|
+
export declare const WORKFLOW_VALUE_RE: RegExp;
|
|
43
|
+
/** §8 directory trigger vocabulary for "people-ish" tables (see tables.ts). */
|
|
44
|
+
export declare const PEOPLE_TABLE_RE: RegExp;
|
|
45
|
+
/** Min/max numeric literal in CHECK expressions mentioning the column. */
|
|
46
|
+
export declare function checkBounds(table: TableModel, columnName: string): {
|
|
47
|
+
min: number;
|
|
48
|
+
max: number;
|
|
49
|
+
} | null;
|
|
50
|
+
export declare function buildColumnClassifyContext(model: DatabaseModel, table: TableModel): ColumnClassifyContext;
|
|
51
|
+
/** Every §7.1 rule id, in precedence order (exported for tests/docs). */
|
|
52
|
+
export declare const COLUMN_RULE_IDS: readonly string[];
|
|
53
|
+
/** Classify one column within its table context. Pure and deterministic. */
|
|
54
|
+
export declare function classifyColumn(column: ColumnModel, ctx: ColumnClassifyContext): ClassifiedColumn;
|
|
55
|
+
/** Classify every column of a table (ordinal order preserved). */
|
|
56
|
+
export declare function classifyTableColumns(model: DatabaseModel, table: TableModel): ClassifiedColumn[];
|
|
57
|
+
//# sourceMappingURL=columns.d.ts.map
|
|
@@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