@frontal-labs/ontology 0.0.1 → 1.0.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/README.md +80 -9
- package/dist/client.d.ts +36 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +8 -15
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2020 -348
- package/dist/index.mjs +2013 -350
- package/dist/schemas.d.ts +53 -5
- package/dist/schemas.d.ts.map +1 -1
- package/dist/sdk.d.ts +575 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -6
- package/src/client.ts +86 -0
- package/src/constants.ts +15 -0
- package/src/index.ts +13 -44
- package/src/schemas.ts +55 -8
- package/src/sdk.ts +883 -0
- package/dist/keys.d.ts +0 -6
- package/dist/keys.d.ts.map +0 -1
- package/dist/service.d.ts +0 -139
- package/dist/service.d.ts.map +0 -1
- package/src/keys.ts +0 -29
- package/src/service.ts +0 -269
package/dist/schemas.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Schema for field data types.
|
|
4
|
+
*/
|
|
2
5
|
export declare const FieldTypeSchema: z.ZodEnum<{
|
|
3
6
|
string: "string";
|
|
4
7
|
boolean: "boolean";
|
|
8
|
+
timestamp: "timestamp";
|
|
5
9
|
integer: "integer";
|
|
6
10
|
float: "float";
|
|
7
11
|
uuid: "uuid";
|
|
8
|
-
timestamp: "timestamp";
|
|
9
12
|
currency: "currency";
|
|
10
13
|
json: "json";
|
|
11
14
|
array: "array";
|
|
@@ -13,20 +16,26 @@ export declare const FieldTypeSchema: z.ZodEnum<{
|
|
|
13
16
|
vector: "vector";
|
|
14
17
|
text: "text";
|
|
15
18
|
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Schema for relationship cardinality types.
|
|
21
|
+
*/
|
|
16
22
|
export declare const RelationshipTypeSchema: z.ZodEnum<{
|
|
17
23
|
hasOne: "hasOne";
|
|
18
24
|
hasMany: "hasMany";
|
|
19
25
|
belongsTo: "belongsTo";
|
|
20
26
|
manyToMany: "manyToMany";
|
|
21
27
|
}>;
|
|
28
|
+
/**
|
|
29
|
+
* Schema for defining a field within a model.
|
|
30
|
+
*/
|
|
22
31
|
export declare const FieldDefinitionSchema: z.ZodObject<{
|
|
23
32
|
type: z.ZodEnum<{
|
|
24
33
|
string: "string";
|
|
25
34
|
boolean: "boolean";
|
|
35
|
+
timestamp: "timestamp";
|
|
26
36
|
integer: "integer";
|
|
27
37
|
float: "float";
|
|
28
38
|
uuid: "uuid";
|
|
29
|
-
timestamp: "timestamp";
|
|
30
39
|
currency: "currency";
|
|
31
40
|
json: "json";
|
|
32
41
|
array: "array";
|
|
@@ -50,6 +59,9 @@ export declare const FieldDefinitionSchema: z.ZodObject<{
|
|
|
50
59
|
items: z.ZodOptional<z.ZodString>;
|
|
51
60
|
description: z.ZodOptional<z.ZodString>;
|
|
52
61
|
}, z.core.$loose>;
|
|
62
|
+
/**
|
|
63
|
+
* Schema for defining a relationship between models.
|
|
64
|
+
*/
|
|
53
65
|
export declare const RelationshipDefinitionSchema: z.ZodObject<{
|
|
54
66
|
name: z.ZodOptional<z.ZodString>;
|
|
55
67
|
type: z.ZodEnum<{
|
|
@@ -76,12 +88,18 @@ export declare const RelationshipDefinitionSchema: z.ZodObject<{
|
|
|
76
88
|
computed: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
77
89
|
description: z.ZodOptional<z.ZodString>;
|
|
78
90
|
}, z.core.$loose>;
|
|
91
|
+
/**
|
|
92
|
+
* Schema for substrate routing configuration (operational/analytical/semantic/cache).
|
|
93
|
+
*/
|
|
79
94
|
export declare const SubstrateRoutingSchema: z.ZodObject<{
|
|
80
95
|
operational: z.ZodOptional<z.ZodString>;
|
|
81
96
|
analytical: z.ZodOptional<z.ZodString>;
|
|
82
97
|
semantic: z.ZodOptional<z.ZodString>;
|
|
83
98
|
cache: z.ZodOptional<z.ZodString>;
|
|
84
99
|
}, z.core.$loose>;
|
|
100
|
+
/**
|
|
101
|
+
* Schema for semantic metadata (description, lifecycle, tags).
|
|
102
|
+
*/
|
|
85
103
|
export declare const SemanticMetadataSchema: z.ZodObject<{
|
|
86
104
|
description: z.ZodOptional<z.ZodString>;
|
|
87
105
|
lifecycle: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
@@ -89,6 +107,9 @@ export declare const SemanticMetadataSchema: z.ZodObject<{
|
|
|
89
107
|
significantEvents: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
90
108
|
tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
91
109
|
}, z.core.$loose>;
|
|
110
|
+
/**
|
|
111
|
+
* Schema for defining a database index on a model.
|
|
112
|
+
*/
|
|
92
113
|
export declare const IndexDefinitionSchema: z.ZodObject<{
|
|
93
114
|
name: z.ZodOptional<z.ZodString>;
|
|
94
115
|
fields: z.ZodArray<z.ZodString>;
|
|
@@ -102,6 +123,9 @@ export declare const IndexDefinitionSchema: z.ZodObject<{
|
|
|
102
123
|
brin: "brin";
|
|
103
124
|
}>>;
|
|
104
125
|
}, z.core.$loose>;
|
|
126
|
+
/**
|
|
127
|
+
* Schema for defining a new model (fields, relationships, substrates, indexes).
|
|
128
|
+
*/
|
|
105
129
|
export declare const ModelDefinitionSchema: z.ZodObject<{
|
|
106
130
|
name: z.ZodString;
|
|
107
131
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -112,10 +136,10 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
|
|
|
112
136
|
type: z.ZodEnum<{
|
|
113
137
|
string: "string";
|
|
114
138
|
boolean: "boolean";
|
|
139
|
+
timestamp: "timestamp";
|
|
115
140
|
integer: "integer";
|
|
116
141
|
float: "float";
|
|
117
142
|
uuid: "uuid";
|
|
118
|
-
timestamp: "timestamp";
|
|
119
143
|
currency: "currency";
|
|
120
144
|
json: "json";
|
|
121
145
|
array: "array";
|
|
@@ -197,6 +221,9 @@ export declare const ModelDefinitionSchema: z.ZodObject<{
|
|
|
197
221
|
deprecated: "deprecated";
|
|
198
222
|
}>>;
|
|
199
223
|
}, z.core.$strict>;
|
|
224
|
+
/**
|
|
225
|
+
* Schema for a full model resource including runtime state.
|
|
226
|
+
*/
|
|
200
227
|
export declare const ModelSchema: z.ZodObject<{
|
|
201
228
|
name: z.ZodString;
|
|
202
229
|
displayName: z.ZodOptional<z.ZodString>;
|
|
@@ -207,10 +234,10 @@ export declare const ModelSchema: z.ZodObject<{
|
|
|
207
234
|
type: z.ZodEnum<{
|
|
208
235
|
string: "string";
|
|
209
236
|
boolean: "boolean";
|
|
237
|
+
timestamp: "timestamp";
|
|
210
238
|
integer: "integer";
|
|
211
239
|
float: "float";
|
|
212
240
|
uuid: "uuid";
|
|
213
|
-
timestamp: "timestamp";
|
|
214
241
|
currency: "currency";
|
|
215
242
|
json: "json";
|
|
216
243
|
array: "array";
|
|
@@ -297,6 +324,9 @@ export declare const ModelSchema: z.ZodObject<{
|
|
|
297
324
|
updatedAt: z.ZodPipe<z.ZodDate, z.ZodTransform<Date, Date>>;
|
|
298
325
|
entityCount: z.ZodOptional<z.ZodNumber>;
|
|
299
326
|
}, z.core.$loose>;
|
|
327
|
+
/**
|
|
328
|
+
* Schema for a migration plan between model versions.
|
|
329
|
+
*/
|
|
300
330
|
export declare const MigrationPlanSchema: z.ZodObject<{
|
|
301
331
|
id: z.ZodString;
|
|
302
332
|
modelId: z.ZodString;
|
|
@@ -332,6 +362,9 @@ export declare const MigrationPlanSchema: z.ZodObject<{
|
|
|
332
362
|
}>;
|
|
333
363
|
createdAt: z.ZodPipe<z.ZodDate, z.ZodTransform<Date, Date>>;
|
|
334
364
|
}, z.core.$loose>;
|
|
365
|
+
/**
|
|
366
|
+
* Schema for a validation or transformation rule.
|
|
367
|
+
*/
|
|
335
368
|
export declare const RuleDefinitionSchema: z.ZodObject<{
|
|
336
369
|
name: z.ZodString;
|
|
337
370
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -349,6 +382,9 @@ export declare const RuleDefinitionSchema: z.ZodObject<{
|
|
|
349
382
|
}>;
|
|
350
383
|
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
351
384
|
}, z.core.$strict>;
|
|
385
|
+
/**
|
|
386
|
+
* Schema for a reusable mixin (shared set of fields and relationships).
|
|
387
|
+
*/
|
|
352
388
|
export declare const MixinDefinitionSchema: z.ZodObject<{
|
|
353
389
|
name: z.ZodString;
|
|
354
390
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -356,10 +392,10 @@ export declare const MixinDefinitionSchema: z.ZodObject<{
|
|
|
356
392
|
type: z.ZodEnum<{
|
|
357
393
|
string: "string";
|
|
358
394
|
boolean: "boolean";
|
|
395
|
+
timestamp: "timestamp";
|
|
359
396
|
integer: "integer";
|
|
360
397
|
float: "float";
|
|
361
398
|
uuid: "uuid";
|
|
362
|
-
timestamp: "timestamp";
|
|
363
399
|
currency: "currency";
|
|
364
400
|
json: "json";
|
|
365
401
|
array: "array";
|
|
@@ -411,16 +447,28 @@ export declare const MixinDefinitionSchema: z.ZodObject<{
|
|
|
411
447
|
}, z.core.$loose>>>;
|
|
412
448
|
appliesTo: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
413
449
|
}, z.core.$strict>;
|
|
450
|
+
/** Field data type. */
|
|
414
451
|
export type FieldType = z.infer<typeof FieldTypeSchema>;
|
|
452
|
+
/** Relationship cardinality type. */
|
|
415
453
|
export type RelationshipType = z.infer<typeof RelationshipTypeSchema>;
|
|
454
|
+
/** Field definition type. */
|
|
416
455
|
export type FieldDefinition = z.infer<typeof FieldDefinitionSchema>;
|
|
456
|
+
/** Relationship definition type. */
|
|
417
457
|
export type RelationshipDefinition = z.infer<typeof RelationshipDefinitionSchema>;
|
|
458
|
+
/** Substrate routing configuration type. */
|
|
418
459
|
export type SubstrateRouting = z.infer<typeof SubstrateRoutingSchema>;
|
|
460
|
+
/** Semantic metadata type. */
|
|
419
461
|
export type SemanticMetadata = z.infer<typeof SemanticMetadataSchema>;
|
|
462
|
+
/** Index definition type. */
|
|
420
463
|
export type IndexDefinition = z.infer<typeof IndexDefinitionSchema>;
|
|
464
|
+
/** Model definition (input) type. */
|
|
421
465
|
export type ModelDefinition = z.infer<typeof ModelDefinitionSchema>;
|
|
466
|
+
/** Full model resource type. */
|
|
422
467
|
export type Model = z.infer<typeof ModelSchema>;
|
|
468
|
+
/** Migration plan type. */
|
|
423
469
|
export type MigrationPlan = z.infer<typeof MigrationPlanSchema>;
|
|
470
|
+
/** Validation/transformation rule definition type. */
|
|
424
471
|
export type RuleDefinition = z.infer<typeof RuleDefinitionSchema>;
|
|
472
|
+
/** Reusable mixin definition type. */
|
|
425
473
|
export type MixinDefinition = z.infer<typeof MixinDefinitionSchema>;
|
|
426
474
|
//# sourceMappingURL=schemas.d.ts.map
|
package/dist/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,eAAe;;;;;;;;;;;;;EAa1B,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;EAKjC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;EAa1B,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;EAKjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;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