@neo4j/graph-schema-utils 1.0.0-next.2 → 1.0.0-next.20

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 (35) hide show
  1. package/README.md +52 -1
  2. package/dist/formatters/index.js +2 -0
  3. package/dist/formatters/index.js.map +1 -0
  4. package/dist/formatters/json/extensions.js +439 -0
  5. package/dist/formatters/json/extensions.js.map +1 -0
  6. package/dist/formatters/json/index.js +4 -0
  7. package/dist/formatters/json/index.js.map +1 -0
  8. package/dist/formatters/json/types.js +37 -0
  9. package/dist/formatters/json/types.js.map +1 -0
  10. package/dist/formatters/llm-prompt/index.js +102 -0
  11. package/dist/formatters/llm-prompt/index.js.map +1 -0
  12. package/dist/formatters/llm-prompt/types.js.map +1 -0
  13. package/dist/index.js +4 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/model/index.js +165 -148
  16. package/dist/model/index.js.map +1 -1
  17. package/dist/types/formatters/index.d.ts +1 -0
  18. package/dist/types/formatters/json/extensions.d.ts +9 -0
  19. package/dist/types/formatters/json/index.d.ts +3 -0
  20. package/dist/types/formatters/json/types.d.ts +150 -0
  21. package/dist/types/formatters/llm-prompt/index.d.ts +3 -0
  22. package/dist/types/formatters/llm-prompt/types.d.ts +5 -0
  23. package/dist/types/index.d.ts +6 -0
  24. package/dist/types/model/index.d.ts +131 -0
  25. package/dist/types/version.d.ts +2 -0
  26. package/dist/validation.js +3 -1
  27. package/dist/validation.js.map +1 -1
  28. package/dist/version.js +6 -0
  29. package/dist/version.js.map +1 -0
  30. package/package.json +14 -7
  31. package/dist/index.d.ts +0 -3
  32. package/dist/model/index.d.ts +0 -179
  33. package/dist/types.js.map +0 -1
  34. /package/dist/{types.js → formatters/llm-prompt/types.js} +0 -0
  35. /package/dist/{validation.d.ts → types/validation.d.ts} +0 -0
@@ -0,0 +1,150 @@
1
+ import { ConstraintType, EntityType, IndexType, PrimitivePropertyTypes, VectorElementTypes } from "../../model/index.js";
2
+ export type RootSchemaJsonStruct = {
3
+ graphSchemaRepresentation: GraphSchemaRepresentationJsonStruct;
4
+ };
5
+ export type GraphSchemaRepresentationJsonStruct = {
6
+ version: string;
7
+ graphSchema: GraphSchemaJsonStruct;
8
+ };
9
+ export type GraphSchemaJsonStruct = {
10
+ nodeLabels: NodeLabelJsonStruct[];
11
+ relationshipTypes: RelationshipTypeJsonStruct[];
12
+ nodeObjectTypes: NodeObjectTypeJsonStruct[];
13
+ relationshipObjectTypes: RelationshipObjectTypeJsonStruct[];
14
+ constraints: ConstraintJsonStruct[];
15
+ indexes: IndexJsonStruct[];
16
+ };
17
+ export type NodeLabelJsonStruct = {
18
+ $id: string;
19
+ token: string;
20
+ properties: PropertyJsonStruct[];
21
+ };
22
+ export type RelationshipTypeJsonStruct = {
23
+ $id: string;
24
+ token: string;
25
+ properties: PropertyJsonStruct[];
26
+ };
27
+ export type NodeObjectTypeJsonStruct = {
28
+ $id: string;
29
+ labels: {
30
+ $ref: string;
31
+ }[];
32
+ };
33
+ export type RelationshipObjectTypeJsonStruct = {
34
+ $id: string;
35
+ type: {
36
+ $ref: string;
37
+ };
38
+ from: {
39
+ $ref: string;
40
+ };
41
+ to: {
42
+ $ref: string;
43
+ };
44
+ };
45
+ export type ConstraintJsonStruct = {
46
+ $id: string;
47
+ name: string;
48
+ constraintType: ConstraintType;
49
+ entityType: EntityType;
50
+ nodeLabel?: {
51
+ $ref: string;
52
+ };
53
+ relationshipType?: {
54
+ $ref: string;
55
+ };
56
+ properties: {
57
+ $ref: string;
58
+ }[];
59
+ };
60
+ export type NodeLabelConstraintJsonStruct = ConstraintJsonStruct & {
61
+ entityType: "node";
62
+ nodeLabel: {
63
+ $ref: string;
64
+ };
65
+ relationshipType: undefined;
66
+ };
67
+ export type RelationshipTypeConstraintJsonStruct = ConstraintJsonStruct & {
68
+ entityType: "relationship";
69
+ nodeLabel: undefined;
70
+ relationshipType: {
71
+ $ref: string;
72
+ };
73
+ };
74
+ export type IndexJsonStruct = {
75
+ $id: string;
76
+ name: string;
77
+ indexType: IndexType;
78
+ entityType: EntityType;
79
+ nodeLabel?: {
80
+ $ref: string;
81
+ };
82
+ relationshipType?: {
83
+ $ref: string;
84
+ };
85
+ properties?: {
86
+ $ref: string;
87
+ }[];
88
+ };
89
+ export type NodeLabelIndexJsonStruct = IndexJsonStruct & {
90
+ indexType: Exclude<IndexType, "lookup">;
91
+ entityType: "node";
92
+ nodeLabel: {
93
+ $ref: string;
94
+ };
95
+ relationshipType: undefined;
96
+ properties: {
97
+ $ref: string;
98
+ }[];
99
+ };
100
+ export type RelationshipTypeIndexJsonStruct = IndexJsonStruct & {
101
+ indexType: Exclude<IndexType, "lookup">;
102
+ entityType: "relationship";
103
+ nodeLabel: undefined;
104
+ relationshipType: {
105
+ $ref: string;
106
+ };
107
+ properties: {
108
+ $ref: string;
109
+ }[];
110
+ };
111
+ export type LookupIndexJsonStruct = IndexJsonStruct & {
112
+ indexType: "lookup";
113
+ nodeLabel: undefined;
114
+ relationshipType: undefined;
115
+ properties: undefined;
116
+ };
117
+ export type PropertyJsonStruct = {
118
+ $id: string;
119
+ token: string;
120
+ type: PropertyTypeJsonStruct | PropertyTypeJsonStruct[];
121
+ nullable: boolean;
122
+ };
123
+ export type PrimitivePropertyTypeJsonStruct = {
124
+ type: PrimitivePropertyTypes;
125
+ };
126
+ export type VectorElementTypeJsonStruct = {
127
+ type: VectorElementTypes;
128
+ };
129
+ export type PrimitiveArrayPropertyTypeJsonStruct = {
130
+ type: "array";
131
+ items: {
132
+ type: PrimitivePropertyTypes;
133
+ };
134
+ };
135
+ export type VectorPropertyTypeJsonStruct = {
136
+ type: "vector";
137
+ items: {
138
+ type: VectorElementTypes;
139
+ };
140
+ dimension?: number;
141
+ };
142
+ export type PropertyTypeJsonStruct = VectorPropertyTypeJsonStruct | PrimitiveArrayPropertyTypeJsonStruct | PrimitivePropertyTypeJsonStruct;
143
+ export declare const isPrimitivePropertyTypeJsonStruct: (propertyType: PropertyTypeJsonStruct) => propertyType is PrimitivePropertyTypeJsonStruct;
144
+ export declare const isPrimitiveArrayPropertyTypeJsonStruct: (propertyType: PropertyTypeJsonStruct) => propertyType is PrimitiveArrayPropertyTypeJsonStruct;
145
+ export declare const isVectorPropertyTypeJsonStruct: (propertyType: PropertyTypeJsonStruct) => propertyType is VectorPropertyTypeJsonStruct;
146
+ export declare const isNodeLabelConstraintJsonStruct: (constraint: ConstraintJsonStruct) => constraint is NodeLabelConstraintJsonStruct;
147
+ export declare const isRelationshipTypeConstraintJsonStruct: (constraint: ConstraintJsonStruct) => constraint is RelationshipTypeConstraintJsonStruct;
148
+ export declare const isNodeLabelIndexJsonStruct: (index: IndexJsonStruct) => index is NodeLabelIndexJsonStruct;
149
+ export declare const isRelationshipTypeIndexJsonStruct: (index: IndexJsonStruct) => index is RelationshipTypeIndexJsonStruct;
150
+ export declare const isLookupIndexJsonStruct: (index: IndexJsonStruct) => index is LookupIndexJsonStruct;
@@ -0,0 +1,3 @@
1
+ import { GraphSchema } from "../../model/index.js";
2
+ export declare function toTomaz(schema: GraphSchema): string;
3
+ export declare function toOskars(schema: GraphSchema): string;
@@ -0,0 +1,5 @@
1
+ export type ElementPropertyObject = {
2
+ property: string;
3
+ type: string;
4
+ nullable?: boolean;
5
+ };
@@ -0,0 +1,6 @@
1
+ export { PACKAGE_VERSION, LAST_BUILD_TIME } from "./version.js";
2
+ export { validateSchema, SchemaValidationError } from "./validation.js";
3
+ import * as model from "./model/index.js";
4
+ import * as formatters from "./formatters/index.js";
5
+ export { model, formatters };
6
+ export { VECTOR_TYPE_OPTIONS, VectorElementType } from "./model/index.js";
@@ -0,0 +1,131 @@
1
+ export declare class GraphSchema {
2
+ nodeLabels: NodeLabel[];
3
+ relationshipTypes: RelationshipType[];
4
+ nodeObjectTypes: NodeObjectType[];
5
+ relationshipObjectTypes: RelationshipObjectType[];
6
+ constraints: Constraint[];
7
+ indexes: Index[];
8
+ constructor(nodeObjectTypes: NodeObjectType[], relationshipObjectTypes: RelationshipObjectType[], constraints?: Constraint[], indexes?: Index[]);
9
+ private extractNodeLabels;
10
+ private extractRelationshipTypes;
11
+ getAllNodeLabelTokens(): string[];
12
+ getAllRelationshipTypeTokens(): string[];
13
+ getAllPropertyTokens(): string[];
14
+ }
15
+ export declare class NodeLabel {
16
+ $id: string;
17
+ token: string;
18
+ properties: Property[];
19
+ constructor(id: string, token: string, properties?: Property[]);
20
+ getPropertyTokens(): string[];
21
+ }
22
+ export declare class RelationshipType {
23
+ $id: string;
24
+ token: string;
25
+ properties: Property[];
26
+ constructor(id: string, token: string, properties?: Property[]);
27
+ getPropertyTokens(): string[];
28
+ }
29
+ export declare class NodeObjectType {
30
+ $id: string;
31
+ labels: NodeLabel[];
32
+ constructor(id: string, labels: NodeLabel[]);
33
+ getProperties(): Property[];
34
+ getPropertyTokens(): string[];
35
+ }
36
+ export declare class RelationshipObjectType {
37
+ $id: string;
38
+ type: RelationshipType;
39
+ from: NodeObjectType;
40
+ to: NodeObjectType;
41
+ constructor(id: string, type: RelationshipType, from: NodeObjectType, to: NodeObjectType);
42
+ getProperties(): Property[];
43
+ getPropertyTokens(): string[];
44
+ }
45
+ export type Constraint = NodeLabelConstraint | RelationshipTypeConstraint;
46
+ export type Index = NodeLabelIndex | RelationshipTypeIndex | LookupIndex;
47
+ export declare const isNodeLabelConstraint: (constraint: Constraint) => constraint is NodeLabelConstraint;
48
+ export declare const isRelationshipTypeConstraint: (constraint: Constraint) => constraint is RelationshipTypeConstraint;
49
+ export declare const isNodeLabelIndex: (index: Index) => index is NodeLabelIndex;
50
+ export declare const isRelationshipTypeIndex: (index: Index) => index is RelationshipTypeIndex;
51
+ export declare const isLookupIndex: (index: Index) => index is LookupIndex;
52
+ export declare class NodeLabelConstraint {
53
+ $id: string;
54
+ name: string;
55
+ constraintType: ConstraintType;
56
+ nodeLabel: NodeLabel;
57
+ properties: Property[];
58
+ entityType: EntityType;
59
+ constructor($id: string, name: string, constraintType: ConstraintType, nodeLabel: NodeLabel, properties: Property[]);
60
+ }
61
+ export declare class RelationshipTypeConstraint {
62
+ $id: string;
63
+ name: string;
64
+ constraintType: ConstraintType;
65
+ relationshipType: RelationshipType;
66
+ properties: Property[];
67
+ entityType: EntityType;
68
+ constructor($id: string, name: string, constraintType: ConstraintType, relationshipType: RelationshipType, properties: Property[]);
69
+ }
70
+ export declare class NodeLabelIndex {
71
+ $id: string;
72
+ name: string;
73
+ indexType: Exclude<IndexType, "lookup">;
74
+ entityType: EntityType;
75
+ nodeLabel: NodeLabel;
76
+ properties: Property[];
77
+ constructor($id: string, name: string, indexType: Exclude<IndexType, "lookup">, nodeLabel: NodeLabel, properties: Property[]);
78
+ }
79
+ export declare class RelationshipTypeIndex {
80
+ $id: string;
81
+ name: string;
82
+ indexType: Exclude<IndexType, "lookup">;
83
+ entityType: EntityType;
84
+ relationshipType: RelationshipType;
85
+ properties: Property[];
86
+ constructor($id: string, name: string, indexType: Exclude<IndexType, "lookup">, relationshipType: RelationshipType, properties: Property[]);
87
+ }
88
+ export declare class LookupIndex {
89
+ $id: string;
90
+ name: string;
91
+ entityType: EntityType;
92
+ indexType: IndexType;
93
+ constructor($id: string, name: string, entityType: EntityType);
94
+ }
95
+ export type ConstraintType = "uniqueness" | "propertyExistence" | "propertyType" | "key";
96
+ export type IndexType = "range" | "lookup" | "text" | "fullText" | "point" | "default";
97
+ export type EntityType = "node" | "relationship";
98
+ export type PropertyType = PrimitivePropertyType | PrimitiveArrayPropertyType | VectorPropertyType;
99
+ export declare const isPrimitiveArrayPropertyType: (property: PropertyType) => property is PrimitiveArrayPropertyType;
100
+ export declare const isPrimitivePropertyType: (property: PropertyType) => property is PrimitivePropertyType;
101
+ export declare class Property {
102
+ $id: string;
103
+ token: string;
104
+ type: PropertyType | PropertyType[];
105
+ nullable: boolean;
106
+ constructor($id: string, token: string, type: PropertyType | PropertyType[], nullable: boolean);
107
+ }
108
+ export declare class PrimitivePropertyType {
109
+ type: PrimitivePropertyTypes;
110
+ constructor(type: PrimitivePropertyTypes);
111
+ }
112
+ export declare class PrimitiveArrayPropertyType {
113
+ items: PrimitivePropertyType;
114
+ type: "array";
115
+ constructor(items: PrimitivePropertyType);
116
+ }
117
+ export declare class VectorPropertyType {
118
+ type: "vector";
119
+ items: VectorElementType;
120
+ dimension?: number;
121
+ constructor(items: VectorElementType, dimension?: number);
122
+ }
123
+ export declare const PRIMITIVE_TYPE_OPTIONS: readonly ["integer", "string", "float", "boolean", "point", "date", "datetime", "time", "localtime", "localdatetime", "duration"];
124
+ export type PrimitivePropertyTypes = (typeof PRIMITIVE_TYPE_OPTIONS)[number];
125
+ export declare const isVectorPropertyType: (property: PropertyType) => property is VectorPropertyType;
126
+ export declare class VectorElementType {
127
+ type: VectorElementTypes;
128
+ constructor(type: VectorElementTypes);
129
+ }
130
+ export declare const VECTOR_TYPE_OPTIONS: readonly ["integer", "integer8", "integer16", "integer32", "float", "float32"];
131
+ export type VectorElementTypes = (typeof VECTOR_TYPE_OPTIONS)[number];
@@ -0,0 +1,2 @@
1
+ export declare const PACKAGE_VERSION = "1.0.0-next.19";
2
+ export declare const LAST_BUILD_TIME = "2026-05-06T11:32:09.205Z";
@@ -26,7 +26,9 @@ export function validateSchema(jsonSchema, graphSchema) {
26
26
  const validate = ajv.compile(jsonSchemaObj);
27
27
  const result = validate(graphSchemaObj);
28
28
  if (result !== true) {
29
- throw new SchemaValidationError(validate.errors);
29
+ if (validate.errors) {
30
+ throw new SchemaValidationError(validate.errors);
31
+ }
30
32
  }
31
33
  return true;
32
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,KAAK,CAAC;AAE5B,0DAA0D;AAC1D,MAAM,GAAG,GAAG,SAAS,CAAC,OAAO,CAAC;AAE9B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAEx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,QAAQ,CAAC,MAAM,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAG9C,YACE,aAA4E;QAE5E,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAL1C,aAAQ,GAAkE,EAAE,CAAC;QAM3E,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ //Build variables update by packages/graph-schema-utils/set-build-info.cjs mainly useful for development
2
+ // PACKAGE_VERSION extracted from package.json to allow the dist to know and share its own version
3
+ export const PACKAGE_VERSION = "1.0.0-next.19";
4
+ // LAST_BUILD_TIME set to now at build time to allow dist to know and share when it was built.
5
+ export const LAST_BUILD_TIME = "2026-05-06T11:32:09.205Z";
6
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC;AAC/C,8FAA8F;AAC9F,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAA"}
package/package.json CHANGED
@@ -1,13 +1,22 @@
1
1
  {
2
2
  "name": "@neo4j/graph-schema-utils",
3
- "version": "1.0.0-next.2",
4
- "description": "Utilities for the Neo4j Graph Schema JSON representation",
5
- "module": "src/index.js",
3
+ "version": "1.0.0-next.20",
4
+ "description": "Utilities for Neo4j Graph Schema JSON representation",
5
+ "module": "./dist/index.js",
6
+ "types": "./dist/types/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/types/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ }
12
+ },
6
13
  "type": "module",
7
14
  "scripts": {
15
+ "prebuild": "node ./set-build-info.cjs",
8
16
  "test:watch": "vitest",
9
17
  "test": "vitest run",
10
- "build": "tsc"
18
+ "build": "tsc --project tsconfig.build.json",
19
+ "check": "tsc --project tsconfig.check.json"
11
20
  },
12
21
  "files": [
13
22
  "dist"
@@ -28,8 +37,6 @@
28
37
  "graph schema"
29
38
  ],
30
39
  "devDependencies": {
31
- "@vitest/coverage-c8": "^0.25.3",
32
- "vitest": "^0.25.3",
33
- "@neo4j/graph-json-schema": "*"
40
+ "@neo4j/graph-json-schema": "1.0.0-next.7"
34
41
  }
35
42
  }
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export { validateSchema, SchemaValidationError } from "./validation.js";
2
- import * as model from "./model/index.js";
3
- export { model };
@@ -1,179 +0,0 @@
1
- export declare class GraphSchemaRepresentation {
2
- version: string;
3
- graphSchema: GraphSchema;
4
- constructor(version: string, graphSchema: GraphSchema);
5
- toJson(): string;
6
- static parseJson(jsonString: any): GraphSchemaRepresentation;
7
- }
8
- export declare class GraphSchema {
9
- nodeLabels: NodeLabel[];
10
- relationshipTypes: RelationshipType[];
11
- nodeObjectTypes: NodeObjectType[];
12
- relationshipObjectTypes: RelationshipObjectType[];
13
- constructor(nodeLabels: NodeLabel[], relationshipTypes: RelationshipType[], nodeObjectTypes: NodeObjectType[], relationshipObjectTypes: RelationshipObjectType[]);
14
- toJsonStruct(): {
15
- nodeLabels: {
16
- $id: string;
17
- token: string;
18
- }[];
19
- relationshipTypes: {
20
- $id: string;
21
- token: string;
22
- }[];
23
- nodeObjectTypes: {
24
- $id: string;
25
- labels: {
26
- $ref: string;
27
- }[];
28
- properties: {
29
- type: any[] | {
30
- type: PropertyTypes;
31
- } | {
32
- type: "array";
33
- items: PropertyBaseType;
34
- };
35
- token: string;
36
- mandatory: boolean;
37
- }[];
38
- }[];
39
- relationshipObjectTypes: {
40
- $id: string;
41
- type: {
42
- $ref: string;
43
- };
44
- from: {
45
- $ref: string;
46
- };
47
- to: {
48
- $ref: string;
49
- };
50
- properties: {
51
- type: any[] | {
52
- type: PropertyTypes;
53
- } | {
54
- type: "array";
55
- items: PropertyBaseType;
56
- };
57
- token: string;
58
- mandatory: boolean;
59
- }[];
60
- }[];
61
- };
62
- static fromJsonStruct(json: any): GraphSchema;
63
- }
64
- export declare class NodeLabel {
65
- $id: string;
66
- token: string;
67
- constructor(id: string, token: string);
68
- toJsonStruct(): {
69
- $id: string;
70
- token: string;
71
- };
72
- toRef(): {
73
- $ref: string;
74
- };
75
- }
76
- export declare class RelationshipType {
77
- $id: string;
78
- token: string;
79
- constructor(id: string, token: string);
80
- toJsonStruct(): {
81
- $id: string;
82
- token: string;
83
- };
84
- toRef(): {
85
- $ref: string;
86
- };
87
- }
88
- export declare class NodeObjectType {
89
- $id: string;
90
- labels: NodeLabel[];
91
- properties: Property[];
92
- constructor(id: string, labels: NodeLabel[], properties: Property[]);
93
- toJsonStruct(): {
94
- $id: string;
95
- labels: {
96
- $ref: string;
97
- }[];
98
- properties: {
99
- type: any[] | {
100
- type: PropertyTypes;
101
- } | {
102
- type: "array";
103
- items: PropertyBaseType;
104
- };
105
- token: string;
106
- mandatory: boolean;
107
- }[];
108
- };
109
- toRef(): {
110
- $ref: string;
111
- };
112
- }
113
- export declare class RelationshipObjectType {
114
- $id: string;
115
- type: RelationshipType;
116
- from: NodeObjectType;
117
- to: NodeObjectType;
118
- properties: Property[];
119
- constructor(id: string, type: RelationshipType, from: NodeObjectType, to: NodeObjectType, properties: Property[]);
120
- toJsonStruct(): {
121
- $id: string;
122
- type: {
123
- $ref: string;
124
- };
125
- from: {
126
- $ref: string;
127
- };
128
- to: {
129
- $ref: string;
130
- };
131
- properties: {
132
- type: any[] | {
133
- type: PropertyTypes;
134
- } | {
135
- type: "array";
136
- items: PropertyBaseType;
137
- };
138
- token: string;
139
- mandatory: boolean;
140
- }[];
141
- };
142
- }
143
- export declare class Property {
144
- token: string;
145
- type: PropertyBaseType | PropertyArrayType;
146
- mandatory: boolean;
147
- constructor(token: string, type: PropertyBaseType | PropertyArrayType, mandatory: boolean);
148
- toJsonStruct(): {
149
- type: any[] | {
150
- type: PropertyTypes;
151
- } | {
152
- type: "array";
153
- items: PropertyBaseType;
154
- };
155
- token: string;
156
- mandatory: boolean;
157
- };
158
- }
159
- export declare class PropertyBaseType {
160
- type: PropertyTypes;
161
- constructor(type: PropertyTypes);
162
- toJsonStruct(): {
163
- type: PropertyTypes;
164
- };
165
- }
166
- export declare class PropertyArrayType {
167
- items: PropertyBaseType;
168
- type: "array";
169
- constructor(items: PropertyBaseType);
170
- toJsonStruct(): {
171
- type: "array";
172
- items: PropertyBaseType;
173
- };
174
- }
175
- export declare class PropertyType {
176
- static fromJsonStruct(json: any): any;
177
- }
178
- type PropertyTypes = "integer" | "string" | "float" | "boolean" | "point" | "date" | "datetime" | "time" | "localtime" | "localdatetime" | "duration";
179
- export {};
package/dist/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
File without changes