cograph 0.1.25 → 0.1.27
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 +32 -0
- package/dist/chunk-PE2EOIGT.js +978 -0
- package/dist/chunk-PE2EOIGT.js.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/index.d.ts +220 -1
- package/dist/index.js +423 -2
- package/dist/index.js.map +1 -1
- package/dist/{shell-ILZ322LT.js → shell-A5UU33YS.js} +2 -2
- package/package.json +6 -3
- package/dist/chunk-O3L4FCRY.js +0 -558
- package/dist/chunk-O3L4FCRY.js.map +0 -1
- /package/dist/{shell-ILZ322LT.js.map → shell-A5UU33YS.js.map} +0 -0
package/README.md
CHANGED
|
@@ -120,9 +120,41 @@ new Client({
|
|
|
120
120
|
- `ontologyApply(proposal)` — confirm and commit a single `ResolvedChange` from `ontologyResolve`'s `proposals`. Pass the object through unchanged; returns `{ applied, operations, summary }`.
|
|
121
121
|
- `typeCounts(kg)` — `[{ name, entity_count }]` for the given KG, sorted desc. Powers `/types`.
|
|
122
122
|
- `typeUsage(kg, name, { includeSystem? })` — full breakdown for one type: attributes (with usage counts), relationships, and 3 sample entities. Powers `/type`. System predicates filtered by default.
|
|
123
|
+
- `exploreRecords(kg, type, { limit?, cursor? })` — one keyset-paginated page of entity instances (`{ columns, rows, total, next_cursor }`).
|
|
124
|
+
- `exploreTypeEdges(kg)` — undirected type→type edges for an overview graph (`[{ source, target, weight }]`).
|
|
125
|
+
- `normalizeSuggest(kg, type)`, `normalizeRules({ kg?, status? })`, `normalizeConfirmRule(id)`, `normalizeRejectRule(id)`, `normalizeApplyRule(id)` — inferred-normalization rule lifecycle.
|
|
126
|
+
- `ontologyRecommend(body?)` — recommend ontology relationships/changes for a KG.
|
|
123
127
|
|
|
124
128
|
All errors throw `CographError`.
|
|
125
129
|
|
|
130
|
+
### Raw / passthrough API (`client.raw.*`)
|
|
131
|
+
|
|
132
|
+
Every method above throws on a non-2xx status and some reshape the payload
|
|
133
|
+
(e.g. `listKgs()` unwraps `{ kgs: [] }`). When you instead want the backend
|
|
134
|
+
`Response` **verbatim** — to forward it 1:1 (e.g. from a web proxy route) or to
|
|
135
|
+
branch on `status` without a `try/catch` — use the `raw` namespace. Each raw
|
|
136
|
+
method maps to one canonical operation with the path encoded inside the SDK, so
|
|
137
|
+
callers pass **no path string**:
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
const client = new Client({ apiKey, tenant });
|
|
141
|
+
|
|
142
|
+
// Forward the backend response unchanged from a proxy:
|
|
143
|
+
const res = await client.raw.enrichJobs(); // GET …/enrich/jobs
|
|
144
|
+
return new Response(res.body, { status: res.status, headers: res.headers });
|
|
145
|
+
|
|
146
|
+
// A non-2xx is a Response, not a throw — and the body is never reshaped:
|
|
147
|
+
const r = await client.raw.enrichJob("missing");
|
|
148
|
+
if (r.status === 404) { /* … */ }
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
`client.raw` covers agent, ask, ingest (+ csv schema/rows), enrich jobs
|
|
152
|
+
(create/list/get/conflicts/apply/cancel), ontology (types/resolve/recommend/apply),
|
|
153
|
+
kgs (list/create/delete), explore (summary/records/type-edges/type-counts/search),
|
|
154
|
+
normalize (suggest/rules GET+POST/confirm/reject/apply) and tenants
|
|
155
|
+
(list/create/delete). Each returns `Promise<Response>` and only ever rejects on a
|
|
156
|
+
network error or timeout (i.e. when there is no HTTP response to return).
|
|
157
|
+
|
|
126
158
|
## One-shot CLI
|
|
127
159
|
|
|
128
160
|
For scripts and CI — every command is a single HTTP round-trip:
|