@littlebigbrain/client 0.8.0 → 0.9.0

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.
@@ -17,10 +17,12 @@ export interface CallOptions {
17
17
  export interface RequestOptions extends CallOptions {
18
18
  query?: Query;
19
19
  body?: unknown;
20
- /** Pre-serialized request body (e.g. NDJSON). Takes precedence over `body`. */
21
- rawBody?: string;
20
+ /** Pre-serialized or streaming request body (e.g. NDJSON). Takes precedence over `body`. */
21
+ rawBody?: unknown;
22
22
  /** Overrides the default `application/json` content type (used with `rawBody`). */
23
23
  contentType?: string;
24
+ /** Set for streaming request bodies so Node's fetch accepts them. */
25
+ duplex?: "half";
24
26
  }
25
27
  /** Thrown when the server responds with a non-2xx status. */
26
28
  export declare class LbbError extends Error {
@@ -38,6 +40,11 @@ export declare class LbbError extends Error {
38
40
  readonly endpointHint?: string;
39
41
  constructor(status: number, body: string, error?: LbbErrorPayload | undefined);
40
42
  }
43
+ /** Thrown before upload when a server does not advertise a required additive capability. */
44
+ export declare class LbbCapabilityError extends Error {
45
+ readonly capability: string;
46
+ constructor(capability: string);
47
+ }
41
48
  export type QueryValue = string | number | boolean | undefined;
42
49
  export type Query = Record<string, QueryValue>;
43
50
  export declare function sleep(ms: number): Promise<void>;
package/dist/transport.js CHANGED
@@ -28,6 +28,15 @@ export class LbbError extends Error {
28
28
  this.endpointHint = endpointMigrationHint(this.code);
29
29
  }
30
30
  }
31
+ /** Thrown before upload when a server does not advertise a required additive capability. */
32
+ export class LbbCapabilityError extends Error {
33
+ capability;
34
+ constructor(capability) {
35
+ super(`Little Big Brain server does not advertise ${capability}; upgrade the server before using this SDK method`);
36
+ this.capability = capability;
37
+ this.name = "LbbCapabilityError";
38
+ }
39
+ }
31
40
  function endpointMigrationHint(code) {
32
41
  if (code === "stack_endpoint_required") {
33
42
  return "Copy endpoint_url from the stack's Connect page and use it as baseUrl.";
package/dist/types.d.ts CHANGED
@@ -11,14 +11,9 @@ export type GraphMetadata = Schemas["GraphMetadataResponse"];
11
11
  export type Snapshot = Schemas["SnapshotView"];
12
12
  export type CommitRequest = Schemas["TripletCommitFile"];
13
13
  export type CommitResponse = Schemas["GraphCommitResponse"];
14
- export type AskRequest = Schemas["AskRequest"];
15
- export type AskResponse = Schemas["AskResponse"];
16
14
  export type SchemaView = Schemas["SchemaBundleView"];
17
15
  /**
18
- * The unified list-response envelope returned by every collection read
19
- * (`/v1/graph/entities`, `/v1/graph/edges`, `/v1/graph/observations`): the rows
20
- * in `data`, plus `next_cursor` (echo back as `cursor` for the next page) and
21
- * the pre-page `total_count`. Walk pages with {@link LbbClient.listAll}.
16
+ * Cursor-based list envelope used by bounded collection reads.
22
17
  */
23
18
  export interface ListResponse<T> {
24
19
  object: "list";
@@ -45,11 +40,15 @@ export type EntityPropertiesLine = {
45
40
  };
46
41
  /** One bulk-import line: a triplet, or an entity-properties record. */
47
42
  export type ImportLine = Schemas["TripletInput"] | EntityPropertiesLine;
43
+ /** One streamed durable-import item. Strings are treated as complete NDJSON lines. */
44
+ export type DurableImportLine = ImportLine | string | Uint8Array;
45
+ /** Sync or async source consumed one record/chunk at a time by `submitImport`. */
46
+ export type DurableImportSource = string | Iterable<DurableImportLine> | AsyncIterable<DurableImportLine>;
48
47
  export interface RdfImportOptions {
49
48
  format?: "ntriples" | "turtle" | "nquads" | "trig";
50
49
  baseIri?: string;
51
50
  graphUri?: string;
52
- /** Stable document scope for blank labels across chunks; omit for legacy stable labels. */
51
+ /** Stable document scope for blank labels across chunks. */
53
52
  blankNodeScope?: string;
54
53
  batch?: number;
55
54
  strict?: boolean;
@@ -58,14 +57,6 @@ export interface RdfImportOptions {
58
57
  edgeIdempotency?: "append" | "skip_unchanged";
59
58
  idempotencyKey?: string;
60
59
  }
61
- export interface RdfExportOptions {
62
- format?: "turtle" | "ntriples" | "trig" | "nquads";
63
- maxTriples?: number;
64
- asOfValidTime?: string;
65
- asOfCommitSeq?: number;
66
- entailment?: "subclass" | "none";
67
- reason?: boolean;
68
- }
69
60
  export type AttributeFilterOp = "eq" | "ne" | "lt" | "le" | "gt" | "ge";
70
61
  export type AttributeFilterValue = string | number | boolean | {
71
62
  dateTime: string;
@@ -91,8 +82,6 @@ export interface EntityAttributeFilterOptions {
91
82
  select?: string[];
92
83
  limit?: number;
93
84
  offset?: number;
94
- asOfValidTime?: string;
95
- asOfCommitSeq?: number;
96
85
  orderBy?: Schemas["SparqlOrderBy"][];
97
86
  reason?: boolean;
98
87
  maxSolutions?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@littlebigbrain/client",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "TypeScript client for the little big brain graph + hybrid search HTTP API",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {