@thingd/sdk 0.33.0 → 0.33.2

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.
@@ -16,7 +16,7 @@ export declare function parseCollectionAllowlist(value: string | undefined): Set
16
16
  */
17
17
  export declare function parsePayloadSizeLimit(value: string | undefined, defaultBytes?: number): number;
18
18
  /**
19
- * Read all Phase-6 MCP hardening options from the environment.
19
+ * Read all MCP hardening options from the environment.
20
20
  */
21
21
  export declare function readMcpHardeningOptionsFromEnv(env: Record<string, string | undefined>): ThingdMcpHardeningOptions;
22
22
  //# sourceMappingURL=config.d.ts.map
@@ -39,7 +39,7 @@ function parseBooleanFlag(value, name) {
39
39
  throw new Error(`Invalid ${name}: expected true or false`);
40
40
  }
41
41
  /**
42
- * Read all Phase-6 MCP hardening options from the environment.
42
+ * Read all MCP hardening options from the environment.
43
43
  */
44
44
  export function readMcpHardeningOptionsFromEnv(env) {
45
45
  return {
@@ -1,36 +1,3 @@
1
- import type { ListEventsOptions, ListObjectsOptions, MemoryEvent, MemoryObject, MemoryQueue, MemorySearchOptions, MemorySearchResult, StoredMemoryEvent, StoredMemoryObject, ThingDConnection, ThingDeleteResult } from "../types.js";
2
- export declare class ThingD implements ThingDConnection {
3
- private readonly store;
4
- static open(): Promise<ThingD>;
5
- private constructor();
6
- put(collection: string, object: MemoryObject): Promise<StoredMemoryObject>;
7
- get<T = StoredMemoryObject>(collection: string, id: string): Promise<T | null>;
8
- delete(collection: string, id: string): Promise<ThingDeleteResult>;
9
- listObjects<T = StoredMemoryObject>(collection: string, options?: ListObjectsOptions): Promise<T[]>;
10
- search(query: string, options?: MemorySearchOptions): Promise<MemorySearchResult[]>;
11
- searchObjects<T = StoredMemoryObject>(query: string, options?: MemorySearchOptions): Promise<T[]>;
12
- putBatch(collection: string, objects: MemoryObject[]): Promise<StoredMemoryObject[]>;
13
- deleteBatch(collection: string, ids: string[]): Promise<number>;
14
- readonly events: {
15
- append: (stream: string, event: MemoryEvent) => Promise<StoredMemoryEvent>;
16
- list: <T = StoredMemoryEvent>(stream?: string, options?: ListEventsOptions) => Promise<T[]>;
17
- };
18
- queue(name: string): MemoryQueue;
19
- readonly links: {
20
- create: (fromRef: string, linkType: string, toRef: string, weight?: number, metadataJson?: string) => Promise<import("../types.js").Link>;
21
- delete: (id: string) => Promise<boolean>;
22
- get: (id: string) => Promise<import("../types.js").Link | null>;
23
- neighbors: (reference: string, direction?: import("../types.js").LinkDirection, options?: import("../types.js").LinkQueryOptions) => Promise<import("../types.js").Link[]>;
24
- };
25
- close(): Promise<void>;
26
- countObjects(): Promise<number>;
27
- countEvents(): Promise<number>;
28
- countActiveJobs(): Promise<number>;
29
- countDeadJobs(): Promise<number>;
30
- countLinks(): Promise<number>;
31
- listCollections(): Promise<string[]>;
32
- listStreams(): Promise<string[]>;
33
- listQueues(): Promise<string[]>;
34
- }
35
- export { InMemoryThingStore } from "../client/in-memory-thing-store.js";
1
+ export { InMemoryThingStore } from "../stores/in-memory-thing-store.js";
2
+ export { ThingD } from "../thingd.js";
36
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,EACX,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAKlB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAErB,qBAAa,MAAO,YAAW,gBAAgB;IAKzB,OAAO,CAAC,QAAQ,CAAC,KAAK;WAJ7B,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC;IAIpC,OAAO;IAEP,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI1E,GAAG,CAAC,CAAC,GAAG,kBAAkB,EAAE,UA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AG/B,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC;IAG9B,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAGlC,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAGhC,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IAG7B,eAAe,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAGpC,WAAW,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAGhC,UAAU,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;CAGtC;AAED,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/memory/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC"}
@@ -1,86 +1,2 @@
1
- import { InMemoryThingStore } from "../client/in-memory-thing-store.js";
2
- export class ThingD {
3
- store;
4
- static async open() {
5
- return new ThingD(new InMemoryThingStore());
6
- }
7
- constructor(store) {
8
- this.store = store;
9
- }
10
- put(collection, object) {
11
- return this.store.put(collection, object);
12
- }
13
- get(collection, id) {
14
- return this.store.get(collection, id);
15
- }
16
- delete(collection, id) {
17
- return this.store.delete(collection, id);
18
- }
19
- listObjects(collection, options) {
20
- return this.store.listObjects?.(collection, options) ?? Promise.resolve([]);
21
- }
22
- search(query, options = {}) {
23
- return this.store.search(query, options);
24
- }
25
- async searchObjects(query, options = {}) {
26
- const results = await this.search(query, options);
27
- return results
28
- .filter((r) => r.kind === "object")
29
- .map((r) => r.value);
30
- }
31
- async putBatch(collection, objects) {
32
- return this.store.putBatch?.(collection, objects) ?? Promise.reject(new Error("Not supported"));
33
- }
34
- async deleteBatch(collection, ids) {
35
- return this.store.deleteBatch?.(collection, ids) ?? Promise.reject(new Error("Not supported"));
36
- }
37
- events = {
38
- append: (stream, event) => this.store.appendEvent(stream, event),
39
- list: (stream, options) => this.store.listEvents(stream, options),
40
- };
41
- queue(name) {
42
- return {
43
- push: (payload, options) => this.store.pushJob(name, payload, options),
44
- claim: (options) => this.store.claimJob(name, options),
45
- ack: (jobId) => this.store.ackJob(name, jobId),
46
- nack: (jobId, options) => this.store.nackJob(name, jobId, options),
47
- list: () => this.store.listJobs(name),
48
- dead: () => this.store.listDeadJobs(name),
49
- };
50
- }
51
- links = {
52
- create: (fromRef, linkType, toRef, weight, metadataJson) => this.store.createLink?.(fromRef, linkType, toRef, weight, metadataJson) ??
53
- Promise.reject(new Error("Not supported")),
54
- delete: (id) => this.store.deleteLink?.(id) ?? Promise.resolve(false),
55
- get: (id) => this.store.getLink?.(id) ?? Promise.resolve(null),
56
- neighbors: (reference, direction = "Both", options = {}) => this.store.getNeighbors?.(reference, direction, options) ?? Promise.resolve([]),
57
- };
58
- async close() {
59
- await this.store.close?.();
60
- }
61
- async countObjects() {
62
- return this.store.countObjects?.() ?? 0;
63
- }
64
- async countEvents() {
65
- return this.store.countEvents?.() ?? 0;
66
- }
67
- async countActiveJobs() {
68
- return this.store.countActiveJobs?.() ?? 0;
69
- }
70
- async countDeadJobs() {
71
- return this.store.countDeadJobs?.() ?? 0;
72
- }
73
- async countLinks() {
74
- return this.store.countLinks?.() ?? 0;
75
- }
76
- async listCollections() {
77
- return this.store.listCollections?.() ?? [];
78
- }
79
- async listStreams() {
80
- return this.store.listStreams?.() ?? [];
81
- }
82
- async listQueues() {
83
- return this.store.listQueues?.() ?? [];
84
- }
85
- }
86
- export { InMemoryThingStore } from "../client/in-memory-thing-store.js";
1
+ export { InMemoryThingStore } from "../stores/in-memory-thing-store.js";
2
+ export { ThingD } from "../thingd.js";
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rest/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAwC3C,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA2Uf"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/rest/server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAyC3C,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,eAAe,EACpB,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CA2Uf"}
@@ -1,3 +1,4 @@
1
+ import { SDK_VERSION } from "../version.js";
1
2
  import { parseFilter, parseIntParam, parseSortBy, readBody, sendData, sendDataList, sendError, } from "./helpers.js";
2
3
  function matchRoute(pathname, pattern) {
3
4
  const patternParts = pattern.split("/");
@@ -35,7 +36,7 @@ export async function handleRestRequest(db, req, res, pathname) {
35
36
  ]);
36
37
  sendData(res, {
37
38
  status: "ok",
38
- version: "0.31.0",
39
+ version: SDK_VERSION,
39
40
  counts: {
40
41
  objects,
41
42
  events,
package/dist/version.d.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  * The published version of the thingd SDK.
3
3
  * Updated automatically by semantic-release during the publish process.
4
4
  */
5
- export declare const SDK_VERSION = "0.33.0";
5
+ export declare const SDK_VERSION = "0.33.2";
6
6
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * The published version of the thingd SDK.
3
3
  * Updated automatically by semantic-release during the publish process.
4
4
  */
5
- export const SDK_VERSION = "0.33.0";
5
+ export const SDK_VERSION = "0.33.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thingd/sdk",
3
- "version": "0.33.0",
3
+ "version": "0.33.2",
4
4
  "description": "A fast object-first data engine for applications and AI agents.",
5
5
  "type": "module",
6
6
  "author": "Sayan Mohsin",
@@ -63,7 +63,7 @@
63
63
  "zod": "^4.4.3"
64
64
  },
65
65
  "optionalDependencies": {
66
- "@thingd/native": "0.33.0"
66
+ "@thingd/native": "0.33.2"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=24.0.0"