@neo4j/graph-schema-utils 1.0.0-next.5 → 1.0.0-next.7
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/dist/model/index.d.ts +122 -13
- package/dist/model/index.js +38 -11
- package/dist/model/index.js.map +1 -1
- package/package.json +4 -3
package/dist/model/index.d.ts
CHANGED
|
@@ -3,6 +3,77 @@ export declare class GraphSchemaRepresentation {
|
|
|
3
3
|
graphSchema: GraphSchema;
|
|
4
4
|
constructor(version: string, graphSchema: GraphSchema);
|
|
5
5
|
toJson(): string;
|
|
6
|
+
toJsonStruct(): {
|
|
7
|
+
graphSchemaRepresentation: {
|
|
8
|
+
version: string;
|
|
9
|
+
graphSchema: {
|
|
10
|
+
nodeLabels: {
|
|
11
|
+
$id: string;
|
|
12
|
+
token: string;
|
|
13
|
+
}[];
|
|
14
|
+
relationshipTypes: {
|
|
15
|
+
$id: string;
|
|
16
|
+
token: string;
|
|
17
|
+
}[];
|
|
18
|
+
nodeObjectTypes: {
|
|
19
|
+
$id: string;
|
|
20
|
+
labels: {
|
|
21
|
+
$ref: string;
|
|
22
|
+
}[];
|
|
23
|
+
properties: {
|
|
24
|
+
type: {
|
|
25
|
+
type: PrimitivePropertyTypes;
|
|
26
|
+
} | {
|
|
27
|
+
type: "array";
|
|
28
|
+
items: {
|
|
29
|
+
type: PrimitivePropertyTypes;
|
|
30
|
+
};
|
|
31
|
+
} | ({
|
|
32
|
+
type: PrimitivePropertyTypes;
|
|
33
|
+
} | {
|
|
34
|
+
type: "array";
|
|
35
|
+
items: {
|
|
36
|
+
type: PrimitivePropertyTypes;
|
|
37
|
+
};
|
|
38
|
+
})[];
|
|
39
|
+
token: string;
|
|
40
|
+
nullable: boolean;
|
|
41
|
+
}[];
|
|
42
|
+
}[];
|
|
43
|
+
relationshipObjectTypes: {
|
|
44
|
+
$id: string;
|
|
45
|
+
type: {
|
|
46
|
+
$ref: string;
|
|
47
|
+
};
|
|
48
|
+
from: {
|
|
49
|
+
$ref: string;
|
|
50
|
+
};
|
|
51
|
+
to: {
|
|
52
|
+
$ref: string;
|
|
53
|
+
};
|
|
54
|
+
properties: {
|
|
55
|
+
type: {
|
|
56
|
+
type: PrimitivePropertyTypes;
|
|
57
|
+
} | {
|
|
58
|
+
type: "array";
|
|
59
|
+
items: {
|
|
60
|
+
type: PrimitivePropertyTypes;
|
|
61
|
+
};
|
|
62
|
+
} | ({
|
|
63
|
+
type: PrimitivePropertyTypes;
|
|
64
|
+
} | {
|
|
65
|
+
type: "array";
|
|
66
|
+
items: {
|
|
67
|
+
type: PrimitivePropertyTypes;
|
|
68
|
+
};
|
|
69
|
+
})[];
|
|
70
|
+
token: string;
|
|
71
|
+
nullable: boolean;
|
|
72
|
+
}[];
|
|
73
|
+
}[];
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
6
77
|
static parseJson(jsonString: any): GraphSchemaRepresentation;
|
|
7
78
|
}
|
|
8
79
|
export declare class GraphSchema {
|
|
@@ -30,14 +101,19 @@ export declare class GraphSchema {
|
|
|
30
101
|
type: PrimitivePropertyTypes;
|
|
31
102
|
} | {
|
|
32
103
|
type: "array";
|
|
33
|
-
items:
|
|
104
|
+
items: {
|
|
105
|
+
type: PrimitivePropertyTypes;
|
|
106
|
+
};
|
|
34
107
|
} | ({
|
|
35
108
|
type: PrimitivePropertyTypes;
|
|
36
109
|
} | {
|
|
37
110
|
type: "array";
|
|
38
|
-
items:
|
|
111
|
+
items: {
|
|
112
|
+
type: PrimitivePropertyTypes;
|
|
113
|
+
};
|
|
39
114
|
})[];
|
|
40
115
|
token: string;
|
|
116
|
+
nullable: boolean;
|
|
41
117
|
}[];
|
|
42
118
|
}[];
|
|
43
119
|
relationshipObjectTypes: {
|
|
@@ -56,17 +132,25 @@ export declare class GraphSchema {
|
|
|
56
132
|
type: PrimitivePropertyTypes;
|
|
57
133
|
} | {
|
|
58
134
|
type: "array";
|
|
59
|
-
items:
|
|
135
|
+
items: {
|
|
136
|
+
type: PrimitivePropertyTypes;
|
|
137
|
+
};
|
|
60
138
|
} | ({
|
|
61
139
|
type: PrimitivePropertyTypes;
|
|
62
140
|
} | {
|
|
63
141
|
type: "array";
|
|
64
|
-
items:
|
|
142
|
+
items: {
|
|
143
|
+
type: PrimitivePropertyTypes;
|
|
144
|
+
};
|
|
65
145
|
})[];
|
|
66
146
|
token: string;
|
|
147
|
+
nullable: boolean;
|
|
67
148
|
}[];
|
|
68
149
|
}[];
|
|
69
150
|
};
|
|
151
|
+
getAllNodeLabelTokens(): string[];
|
|
152
|
+
getAllRelationshipTypeTokens(): string[];
|
|
153
|
+
getAllPropertyTokens(): string[];
|
|
70
154
|
static fromJsonStruct(json: any): GraphSchema;
|
|
71
155
|
}
|
|
72
156
|
export declare class NodeLabel {
|
|
@@ -108,19 +192,25 @@ export declare class NodeObjectType {
|
|
|
108
192
|
type: PrimitivePropertyTypes;
|
|
109
193
|
} | {
|
|
110
194
|
type: "array";
|
|
111
|
-
items:
|
|
195
|
+
items: {
|
|
196
|
+
type: PrimitivePropertyTypes;
|
|
197
|
+
};
|
|
112
198
|
} | ({
|
|
113
199
|
type: PrimitivePropertyTypes;
|
|
114
200
|
} | {
|
|
115
201
|
type: "array";
|
|
116
|
-
items:
|
|
202
|
+
items: {
|
|
203
|
+
type: PrimitivePropertyTypes;
|
|
204
|
+
};
|
|
117
205
|
})[];
|
|
118
206
|
token: string;
|
|
207
|
+
nullable: boolean;
|
|
119
208
|
}[];
|
|
120
209
|
};
|
|
121
210
|
toRef(): {
|
|
122
211
|
$ref: string;
|
|
123
212
|
};
|
|
213
|
+
getPropertyTokens(): string[];
|
|
124
214
|
}
|
|
125
215
|
export declare class RelationshipObjectType {
|
|
126
216
|
$id: string;
|
|
@@ -145,37 +235,54 @@ export declare class RelationshipObjectType {
|
|
|
145
235
|
type: PrimitivePropertyTypes;
|
|
146
236
|
} | {
|
|
147
237
|
type: "array";
|
|
148
|
-
items:
|
|
238
|
+
items: {
|
|
239
|
+
type: PrimitivePropertyTypes;
|
|
240
|
+
};
|
|
149
241
|
} | ({
|
|
150
242
|
type: PrimitivePropertyTypes;
|
|
151
243
|
} | {
|
|
152
244
|
type: "array";
|
|
153
|
-
items:
|
|
245
|
+
items: {
|
|
246
|
+
type: PrimitivePropertyTypes;
|
|
247
|
+
};
|
|
154
248
|
})[];
|
|
155
249
|
token: string;
|
|
250
|
+
nullable: boolean;
|
|
156
251
|
}[];
|
|
157
252
|
};
|
|
253
|
+
toRef(): {
|
|
254
|
+
$ref: string;
|
|
255
|
+
};
|
|
256
|
+
getPropertyTokens(): string[];
|
|
158
257
|
}
|
|
159
258
|
export type PropertyTypes = PropertyBaseType | PropertyArrayType;
|
|
160
259
|
export declare class Property {
|
|
161
260
|
token: string;
|
|
162
261
|
type: PropertyTypes | PropertyTypes[];
|
|
163
|
-
|
|
262
|
+
nullable: boolean;
|
|
164
263
|
$id: string | undefined;
|
|
165
|
-
constructor(token: string, type:
|
|
264
|
+
constructor(token: string, type: PropertyTypes | PropertyTypes[], nullable: boolean, $id?: string);
|
|
166
265
|
toJsonStruct(): {
|
|
167
266
|
type: {
|
|
168
267
|
type: PrimitivePropertyTypes;
|
|
169
268
|
} | {
|
|
170
269
|
type: "array";
|
|
171
|
-
items:
|
|
270
|
+
items: {
|
|
271
|
+
type: PrimitivePropertyTypes;
|
|
272
|
+
};
|
|
172
273
|
} | ({
|
|
173
274
|
type: PrimitivePropertyTypes;
|
|
174
275
|
} | {
|
|
175
276
|
type: "array";
|
|
176
|
-
items:
|
|
277
|
+
items: {
|
|
278
|
+
type: PrimitivePropertyTypes;
|
|
279
|
+
};
|
|
177
280
|
})[];
|
|
178
281
|
token: string;
|
|
282
|
+
nullable: boolean;
|
|
283
|
+
};
|
|
284
|
+
toRef(): {
|
|
285
|
+
$ref: string;
|
|
179
286
|
};
|
|
180
287
|
}
|
|
181
288
|
export declare class PropertyBaseType {
|
|
@@ -191,7 +298,9 @@ export declare class PropertyArrayType {
|
|
|
191
298
|
constructor(items: PropertyBaseType);
|
|
192
299
|
toJsonStruct(): {
|
|
193
300
|
type: "array";
|
|
194
|
-
items:
|
|
301
|
+
items: {
|
|
302
|
+
type: PrimitivePropertyTypes;
|
|
303
|
+
};
|
|
195
304
|
};
|
|
196
305
|
}
|
|
197
306
|
export declare class PropertyType {
|
package/dist/model/index.js
CHANGED
|
@@ -4,12 +4,15 @@ export class GraphSchemaRepresentation {
|
|
|
4
4
|
this.graphSchema = graphSchema;
|
|
5
5
|
}
|
|
6
6
|
toJson() {
|
|
7
|
-
return JSON.stringify(
|
|
7
|
+
return JSON.stringify(this.toJsonStruct());
|
|
8
|
+
}
|
|
9
|
+
toJsonStruct() {
|
|
10
|
+
return {
|
|
8
11
|
graphSchemaRepresentation: {
|
|
9
12
|
version: this.version,
|
|
10
13
|
graphSchema: this.graphSchema.toJsonStruct(),
|
|
11
14
|
},
|
|
12
|
-
}
|
|
15
|
+
};
|
|
13
16
|
}
|
|
14
17
|
static parseJson(jsonString) {
|
|
15
18
|
const json = JSON.parse(jsonString);
|
|
@@ -33,6 +36,18 @@ export class GraphSchema {
|
|
|
33
36
|
relationshipObjectTypes: this.relationshipObjectTypes.map((relationshipObjectType) => relationshipObjectType.toJsonStruct()),
|
|
34
37
|
};
|
|
35
38
|
}
|
|
39
|
+
getAllNodeLabelTokens() {
|
|
40
|
+
return this.nodeLabels.map((nodeLabel) => nodeLabel.token);
|
|
41
|
+
}
|
|
42
|
+
getAllRelationshipTypeTokens() {
|
|
43
|
+
return this.relationshipTypes.map((relationshipType) => relationshipType.token);
|
|
44
|
+
}
|
|
45
|
+
getAllPropertyTokens() {
|
|
46
|
+
const nodeProperties = this.nodeObjectTypes.flatMap((nodeObjectType) => nodeObjectType.getPropertyTokens());
|
|
47
|
+
const relationshipProperties = this.relationshipObjectTypes.flatMap((relationshipObjectType) => relationshipObjectType.getPropertyTokens());
|
|
48
|
+
// return all tokens without duplicates
|
|
49
|
+
return [...new Set([...nodeProperties, ...relationshipProperties])];
|
|
50
|
+
}
|
|
36
51
|
static fromJsonStruct(json) {
|
|
37
52
|
const nodeLabels = json.nodeLabels.map((nodeLabel) => new NodeLabel(nodeLabel.$id, nodeLabel.token));
|
|
38
53
|
const relationshipTypes = json.relationshipTypes.map((relationshipType) => new RelationshipType(relationshipType.$id, relationshipType.token));
|
|
@@ -43,7 +58,7 @@ export class GraphSchema {
|
|
|
43
58
|
if (labels.length !== nodeObjectType.labels.length) {
|
|
44
59
|
throw new Error("Not all label references are defined");
|
|
45
60
|
}
|
|
46
|
-
return new NodeObjectType(nodeObjectType.$id, labels, nodeObjectType.properties.map((property) => new Property(property.token, PropertyType.fromJsonStruct(property.type), property.
|
|
61
|
+
return new NodeObjectType(nodeObjectType.$id, labels, nodeObjectType.properties.map((property) => new Property(property.token, PropertyType.fromJsonStruct(property.type), property.nullable, property.$id)));
|
|
47
62
|
});
|
|
48
63
|
const relationshipObjectTypes = json.relationshipObjectTypes.map((relationshipObjectType) => {
|
|
49
64
|
const type = relationshipTypes.find((relationshipType) => relationshipType.$id === relationshipObjectType.type.$ref.slice(1));
|
|
@@ -58,7 +73,7 @@ export class GraphSchema {
|
|
|
58
73
|
if (!to) {
|
|
59
74
|
throw new Error("Not all node object type references in to are defined");
|
|
60
75
|
}
|
|
61
|
-
return new RelationshipObjectType(relationshipObjectType.$id, type, from, to, relationshipObjectType.properties.map((property) => new Property(property.token, PropertyType.fromJsonStruct(property.type), property.
|
|
76
|
+
return new RelationshipObjectType(relationshipObjectType.$id, type, from, to, relationshipObjectType.properties.map((property) => new Property(property.token, PropertyType.fromJsonStruct(property.type), property.nullable, property.$id)));
|
|
62
77
|
});
|
|
63
78
|
return new GraphSchema(nodeLabels, relationshipTypes, nodeObjectTypes, relationshipObjectTypes);
|
|
64
79
|
}
|
|
@@ -119,6 +134,9 @@ export class NodeObjectType {
|
|
|
119
134
|
$ref: `#${this.$id}`,
|
|
120
135
|
};
|
|
121
136
|
}
|
|
137
|
+
getPropertyTokens() {
|
|
138
|
+
return this.properties.map((property) => property.token);
|
|
139
|
+
}
|
|
122
140
|
}
|
|
123
141
|
export class RelationshipObjectType {
|
|
124
142
|
constructor(id, type, from, to, properties = []) {
|
|
@@ -146,12 +164,20 @@ export class RelationshipObjectType {
|
|
|
146
164
|
properties: this.properties.map((property) => property.toJsonStruct()),
|
|
147
165
|
};
|
|
148
166
|
}
|
|
167
|
+
toRef() {
|
|
168
|
+
return {
|
|
169
|
+
$ref: `#${this.$id}`,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
getPropertyTokens() {
|
|
173
|
+
return this.properties.map((property) => property.token);
|
|
174
|
+
}
|
|
149
175
|
}
|
|
150
176
|
export class Property {
|
|
151
|
-
constructor(token, type,
|
|
177
|
+
constructor(token, type, nullable, $id) {
|
|
152
178
|
this.token = token;
|
|
153
179
|
this.type = type;
|
|
154
|
-
this.
|
|
180
|
+
this.nullable = nullable;
|
|
155
181
|
this.$id = $id;
|
|
156
182
|
}
|
|
157
183
|
toJsonStruct() {
|
|
@@ -161,15 +187,16 @@ export class Property {
|
|
|
161
187
|
const out = {
|
|
162
188
|
type: typeVal,
|
|
163
189
|
token: this.token,
|
|
190
|
+
nullable: this.nullable,
|
|
164
191
|
};
|
|
165
|
-
if (this.mandatory !== undefined) {
|
|
166
|
-
out["mandatory"] = this.mandatory;
|
|
167
|
-
}
|
|
168
192
|
if (this.$id !== undefined) {
|
|
169
193
|
out["$id"] = this.$id;
|
|
170
194
|
}
|
|
171
195
|
return out;
|
|
172
196
|
}
|
|
197
|
+
toRef() {
|
|
198
|
+
return this.$id !== undefined ? { $ref: `#${this.$id}` } : null;
|
|
199
|
+
}
|
|
173
200
|
}
|
|
174
201
|
export class PropertyBaseType {
|
|
175
202
|
constructor(type) {
|
|
@@ -189,7 +216,7 @@ export class PropertyArrayType {
|
|
|
189
216
|
toJsonStruct() {
|
|
190
217
|
return {
|
|
191
218
|
type: this.type,
|
|
192
|
-
items: this.items,
|
|
219
|
+
items: this.items.toJsonStruct(),
|
|
193
220
|
};
|
|
194
221
|
}
|
|
195
222
|
}
|
|
@@ -199,7 +226,7 @@ export class PropertyType {
|
|
|
199
226
|
return json.map((item) => PropertyType.fromJsonStruct(item));
|
|
200
227
|
}
|
|
201
228
|
if (json.type === "array") {
|
|
202
|
-
return new PropertyArrayType(json.items);
|
|
229
|
+
return new PropertyArrayType(new PropertyBaseType(json.items.type));
|
|
203
230
|
}
|
|
204
231
|
return new PropertyBaseType(json.type);
|
|
205
232
|
}
|
package/dist/model/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,yBAAyB;IAIpC,YAAY,OAAe,EAAE,WAAwB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,yBAAyB;IAIpC,YAAY,OAAe,EAAE,WAAwB;QACnD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,YAAY;QACV,OAAO;YACL,yBAAyB,EAAE;gBACzB,OAAO,EAAE,IAAI,CAAC,OAAO;gBACrB,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;aAC7C;SACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,UAAU;QACzB,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,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AED,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,cAAc,CAAC,IAAI;QACxB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC;SAC9D;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE;YACzB,OAAO,IAAI,iBAAiB,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;SACrE;QACD,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neo4j/graph-schema-utils",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.7",
|
|
4
4
|
"description": "Utilities for Neo4j Graph Schema JSON representation",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test:watch": "vitest",
|
|
16
16
|
"test": "vitest run",
|
|
17
|
-
"build": "tsc"
|
|
17
|
+
"build": "tsc --project tsconfig.build.json",
|
|
18
|
+
"check": "tsc --project tsconfig.check.json"
|
|
18
19
|
},
|
|
19
20
|
"files": [
|
|
20
21
|
"dist"
|
|
@@ -37,6 +38,6 @@
|
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@vitest/coverage-c8": "^0.25.3",
|
|
39
40
|
"vitest": "^0.25.3",
|
|
40
|
-
"@neo4j/graph-json-schema": "1.0.0-next.
|
|
41
|
+
"@neo4j/graph-json-schema": "1.0.0-next.3"
|
|
41
42
|
}
|
|
42
43
|
}
|