@frontal-labs/ontology 1.0.1 → 1.0.4
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 +8 -7
- package/dist/client.d.ts +3 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +126 -1241
- package/dist/index.mjs +102 -1209
- package/dist/sdk.d.ts +0 -2
- package/dist/sdk.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
- package/src/client.ts +7 -3
- package/src/constants.ts +1 -1
- package/src/index.ts +1 -1
- package/src/sdk.ts +0 -2
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ Client for the Frontal Ontology platform (`/v1/ontology/*`). The API is composed
|
|
|
4
4
|
of independent subdomain services, each exposed as a namespace:
|
|
5
5
|
`engine`, `objects`, `relationships`, `schemas`, `versions`, `validation`,
|
|
6
6
|
`transformations`, `reasoning`, `rollouts`, `rollups`, `extract`, and `events`.
|
|
7
|
-
(The `graph` subdomain is served by `@frontal-labs/graph`.)
|
|
8
7
|
|
|
9
8
|
## Installation
|
|
10
9
|
|
|
@@ -16,8 +15,11 @@ npm install @frontal-labs/ontology
|
|
|
16
15
|
|
|
17
16
|
## Quick Start
|
|
18
17
|
|
|
19
|
-
```ts
|
|
20
|
-
import {
|
|
18
|
+
```ts prelude
|
|
19
|
+
import { Frontal } from "@frontal-labs/sdk";
|
|
20
|
+
|
|
21
|
+
const f = new Frontal({ apiKey: process.env.FRONTAL_API_KEY! });
|
|
22
|
+
const ontology = f.ontology;
|
|
21
23
|
|
|
22
24
|
// Generate an ontology with the engine, then browse object types.
|
|
23
25
|
const proposal = await ontology.engine.generate({
|
|
@@ -26,8 +28,6 @@ const proposal = await ontology.engine.generate({
|
|
|
26
28
|
const objectTypes = await ontology.objects.listObjectTypes({ limit: 10 });
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
The `ontology` singleton reads `FRONTAL_API_KEY` and
|
|
30
|
-
`FRONTAL_ONTOLOGY_API_URL` from the environment.
|
|
31
31
|
|
|
32
32
|
## Usage
|
|
33
33
|
|
|
@@ -89,8 +89,9 @@ const inferred = await ontology.engine.inferClasses({ samples: [] });
|
|
|
89
89
|
```ts
|
|
90
90
|
const bundle = await ontology.versions.createReleaseBundle({ version: "2.0.0" });
|
|
91
91
|
const rollout = await ontology.rollouts.create({ bundleId: bundle.id });
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
const rolloutId = rollout.id as string;
|
|
93
|
+
await ontology.rollouts.start(rolloutId);
|
|
94
|
+
const status = await ontology.rollouts.status(rolloutId);
|
|
94
95
|
```
|
|
95
96
|
|
|
96
97
|
## Environment Variables
|
package/dist/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FrontalClient } from "@frontal-labs/core";
|
|
1
|
+
import { FrontalClient, type Interceptor } from "@frontal-labs/core";
|
|
2
2
|
import { OntologySdk } from "./sdk";
|
|
3
3
|
/**
|
|
4
4
|
* Configuration for creating an {@link OntologySdk} client standalone.
|
|
@@ -13,6 +13,8 @@ export interface OntologyClientConfig {
|
|
|
13
13
|
baseUrl?: string;
|
|
14
14
|
timeout?: number;
|
|
15
15
|
maxRetries?: number;
|
|
16
|
+
/** Optional interceptor(s) applied to the HTTP client (e.g. governance policy enforcement). */
|
|
17
|
+
interceptors?: Interceptor[];
|
|
16
18
|
}
|
|
17
19
|
/**
|
|
18
20
|
* Creates an {@link OntologySdk} from either an existing {@link FrontalClient}
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EAGb,KAAK,WAAW,EACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,oBAAoB,GAAG,aAAa,GAC3C,WAAW,CAAC;AA2Bf;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,aAWnB,CAAC"}
|
package/dist/constants.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Define and manage Frontal ontology schemas and objects.
|
|
5
5
|
*/
|
|
6
|
-
export { createOntologyClient,
|
|
6
|
+
export { createOntologyClient, type OntologyClientConfig, ontology, } from "./client";
|
|
7
7
|
export { DEFAULT_ONTOLOGY_BASE_URL, VERSION } from "./constants";
|
|
8
8
|
export * from "./schemas";
|
|
9
9
|
export { OntologySdk } from "./sdk";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,QAAQ,GACT,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,yBAAyB,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACjE,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC"}
|