@dbml/core 9.0.0-alpha.1 → 9.0.0-alpha.10
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 +0 -0
- package/README.md +0 -0
- package/lib/index.cjs +4 -4
- package/lib/index.mjs +19841 -19836
- package/package.json +3 -3
- package/types/export/DbmlExporter.d.ts +0 -0
- package/types/export/JsonExporter.d.ts +0 -0
- package/types/export/ModelExporter.d.ts +0 -0
- package/types/export/index.d.ts +0 -0
- package/types/import/index.d.ts +0 -0
- package/types/index.d.ts +22 -0
- package/types/model_structure/check.d.ts +0 -0
- package/types/model_structure/database.d.ts +0 -0
- package/types/model_structure/dbState.d.ts +0 -0
- package/types/model_structure/dep.d.ts +12 -7
- package/types/model_structure/dep_edge.d.ts +0 -0
- package/types/model_structure/element.d.ts +0 -0
- package/types/model_structure/endpoint.d.ts +0 -0
- package/types/model_structure/enum.d.ts +0 -0
- package/types/model_structure/enumValue.d.ts +0 -0
- package/types/model_structure/field.d.ts +0 -0
- package/types/model_structure/index.d.ts +0 -0
- package/types/model_structure/indexColumn.d.ts +0 -0
- package/types/model_structure/indexes.d.ts +0 -0
- package/types/model_structure/ref.d.ts +0 -0
- package/types/model_structure/schema.d.ts +0 -0
- package/types/model_structure/stickyNote.d.ts +0 -0
- package/types/model_structure/table.d.ts +0 -0
- package/types/model_structure/tableGroup.d.ts +0 -0
- package/types/model_structure/tablePartial.d.ts +0 -0
- package/types/parse/Parser.d.ts +0 -0
- package/types/parse/error.d.ts +0 -0
- package/types/transform/index.d.ts +23 -5
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/core",
|
|
4
|
-
"version": "9.0.0-alpha.
|
|
4
|
+
"version": "9.0.0-alpha.10",
|
|
5
5
|
"description": "> TODO: description",
|
|
6
6
|
"author": "Holistics <dev@holistics.io>",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"lint:fix": "eslint --fix ."
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@dbml/parse": "^9.0.0-alpha.
|
|
49
|
+
"@dbml/parse": "^9.0.0-alpha.10",
|
|
50
50
|
"antlr4": "^4.13.1",
|
|
51
51
|
"lodash": "^4.18.1",
|
|
52
52
|
"lodash-es": "^4.18.1",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"bluebird": "^3.5.5"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "73ddff600b762911ed681069ed73f5e1f74448c5",
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=16"
|
|
63
63
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/export/index.d.ts
CHANGED
|
File without changes
|
package/types/import/index.d.ts
CHANGED
|
File without changes
|
package/types/index.d.ts
CHANGED
|
@@ -4,13 +4,19 @@ import importer from './import';
|
|
|
4
4
|
import exporter from './export';
|
|
5
5
|
import {
|
|
6
6
|
renameTable,
|
|
7
|
+
updateElementSetting,
|
|
7
8
|
syncDiagramView,
|
|
8
9
|
findDiagramViewBlocks,
|
|
10
|
+
syncDep,
|
|
11
|
+
findDepBlocks,
|
|
9
12
|
} from './transform';
|
|
10
13
|
export {
|
|
11
14
|
renameTable,
|
|
15
|
+
updateElementSetting,
|
|
12
16
|
syncDiagramView,
|
|
13
17
|
findDiagramViewBlocks,
|
|
18
|
+
syncDep,
|
|
19
|
+
findDepBlocks,
|
|
14
20
|
importer,
|
|
15
21
|
exporter,
|
|
16
22
|
ModelExporter,
|
|
@@ -42,6 +48,8 @@ export {
|
|
|
42
48
|
formatRecordValue,
|
|
43
49
|
DEFAULT_ENTRY,
|
|
44
50
|
Filepath,
|
|
51
|
+
SymbolKind,
|
|
52
|
+
MetadataKind,
|
|
45
53
|
} from '@dbml/parse';
|
|
46
54
|
|
|
47
55
|
// Re-export types
|
|
@@ -51,5 +59,19 @@ export type {
|
|
|
51
59
|
FilterConfig,
|
|
52
60
|
DiagramViewSyncOperation,
|
|
53
61
|
DiagramViewBlock,
|
|
62
|
+
DepSyncOperation,
|
|
63
|
+
DepSyncEdge,
|
|
64
|
+
DepEndpointRef,
|
|
65
|
+
DepBlock,
|
|
54
66
|
TextEdit,
|
|
67
|
+
ElementIdentifier,
|
|
68
|
+
SchemaIdentifier,
|
|
69
|
+
TableIdentifier,
|
|
70
|
+
ColumnIdentifier,
|
|
71
|
+
EnumIdentifier,
|
|
72
|
+
EndpointRef,
|
|
73
|
+
RefIdentifier,
|
|
74
|
+
DepIdentifier,
|
|
75
|
+
NoteIdentifier,
|
|
76
|
+
TableGroupIdentifier,
|
|
55
77
|
} from '@dbml/parse';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Element, { Token } from './element';
|
|
1
|
+
import Element, { Token, Color } from './element';
|
|
2
2
|
import DepEdge from './dep_edge';
|
|
3
3
|
import Schema from './schema';
|
|
4
4
|
import DbState from './dbState';
|
|
@@ -18,8 +18,9 @@ export interface RawDepEdgeInput {
|
|
|
18
18
|
|
|
19
19
|
export interface RawDep {
|
|
20
20
|
name?: string | null;
|
|
21
|
+
color?: Color;
|
|
21
22
|
note?: { value?: string; token?: Token } | string | null;
|
|
22
|
-
|
|
23
|
+
metadata?: Record<string, string | number | boolean | null> | null;
|
|
23
24
|
edges: RawDepEdgeInput[];
|
|
24
25
|
token?: Token;
|
|
25
26
|
schema: Schema;
|
|
@@ -27,21 +28,23 @@ export interface RawDep {
|
|
|
27
28
|
|
|
28
29
|
declare class Dep extends Element {
|
|
29
30
|
name: string | null;
|
|
31
|
+
color?: Color;
|
|
30
32
|
note: string | null;
|
|
31
33
|
noteToken: Token;
|
|
32
|
-
|
|
34
|
+
metadata: Record<string, string | number | boolean | null> | null;
|
|
33
35
|
edges: DepEdge[];
|
|
34
36
|
schema: Schema;
|
|
35
37
|
dbState: DbState;
|
|
36
38
|
id: number;
|
|
37
39
|
database: Database;
|
|
38
|
-
constructor({ name, note,
|
|
40
|
+
constructor({ name, note, metadata, edges, token, schema }: RawDep);
|
|
39
41
|
generateId(): void;
|
|
40
42
|
processEdges(rawEdges: RawDepEdgeInput[]): void;
|
|
41
43
|
export(): {
|
|
42
44
|
name: string | null;
|
|
45
|
+
color?: Color;
|
|
43
46
|
note: string | null;
|
|
44
|
-
|
|
47
|
+
metadata: Record<string, string | number | boolean | null> | null;
|
|
45
48
|
edges: {
|
|
46
49
|
upstream: { schemaName: string | null; tableName: string; fieldNames: string[] };
|
|
47
50
|
downstream: { schemaName: string | null; tableName: string; fieldNames: string[] };
|
|
@@ -49,8 +52,9 @@ declare class Dep extends Element {
|
|
|
49
52
|
};
|
|
50
53
|
shallowExport(): {
|
|
51
54
|
name: string | null;
|
|
55
|
+
color?: Color;
|
|
52
56
|
note: string | null;
|
|
53
|
-
|
|
57
|
+
metadata: Record<string, string | number | boolean | null> | null;
|
|
54
58
|
};
|
|
55
59
|
exportChild(): {
|
|
56
60
|
edges: {
|
|
@@ -70,8 +74,9 @@ declare class Dep extends Element {
|
|
|
70
74
|
export interface NormalizedDep {
|
|
71
75
|
id: number;
|
|
72
76
|
name: string | null;
|
|
77
|
+
color?: Color;
|
|
73
78
|
note: string | null;
|
|
74
|
-
|
|
79
|
+
metadata: Record<string, string | number | boolean | null> | null;
|
|
75
80
|
schemaId: number;
|
|
76
81
|
edgeIds: number[];
|
|
77
82
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/types/parse/Parser.d.ts
CHANGED
|
File without changes
|
package/types/parse/error.d.ts
CHANGED
|
File without changes
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type {
|
|
2
|
+
DiagramViewSyncOperation, DiagramViewBlock, TextEdit,
|
|
3
|
+
DepSyncOperation, DepBlock, ElementIdentifier, TableIdentifier,
|
|
4
|
+
} from '@dbml/parse';
|
|
4
5
|
|
|
5
6
|
export function renameTable(
|
|
6
|
-
oldName:
|
|
7
|
-
newName:
|
|
7
|
+
oldName: string | TableIdentifier,
|
|
8
|
+
newName: string | TableIdentifier,
|
|
8
9
|
dbmlCode: string
|
|
9
10
|
): string;
|
|
10
11
|
|
|
12
|
+
export function updateElementSetting(
|
|
13
|
+
dbmlCode: string,
|
|
14
|
+
target: ElementIdentifier,
|
|
15
|
+
settingName: string,
|
|
16
|
+
value: string | null | undefined,
|
|
17
|
+
): string;
|
|
18
|
+
|
|
11
19
|
export function syncDiagramView(
|
|
12
20
|
dbmlCode: string,
|
|
13
21
|
operations: DiagramViewSyncOperation[],
|
|
@@ -17,3 +25,13 @@ export function syncDiagramView(
|
|
|
17
25
|
export function findDiagramViewBlocks(
|
|
18
26
|
dbmlCode: string,
|
|
19
27
|
): DiagramViewBlock[];
|
|
28
|
+
|
|
29
|
+
export function syncDep(
|
|
30
|
+
dbmlCode: string,
|
|
31
|
+
operations: DepSyncOperation[],
|
|
32
|
+
blocks?: DepBlock[],
|
|
33
|
+
): { newDbml: string; edits: TextEdit[] };
|
|
34
|
+
|
|
35
|
+
export function findDepBlocks(
|
|
36
|
+
dbmlCode: string,
|
|
37
|
+
): DepBlock[];
|