@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.
- package/dist/mcp/config.d.ts +1 -1
- package/dist/mcp/config.js +1 -1
- package/dist/memory/index.d.ts +2 -35
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/memory/index.js +2 -86
- package/dist/rest/server.d.ts.map +1 -1
- package/dist/rest/server.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/mcp/config.d.ts
CHANGED
|
@@ -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
|
|
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
|
package/dist/mcp/config.js
CHANGED
|
@@ -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
|
|
42
|
+
* Read all MCP hardening options from the environment.
|
|
43
43
|
*/
|
|
44
44
|
export function readMcpHardeningOptionsFromEnv(env) {
|
|
45
45
|
return {
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,36 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
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":"
|
|
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"}
|
package/dist/memory/index.js
CHANGED
|
@@ -1,86 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
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;
|
|
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"}
|
package/dist/rest/server.js
CHANGED
|
@@ -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:
|
|
39
|
+
version: SDK_VERSION,
|
|
39
40
|
counts: {
|
|
40
41
|
objects,
|
|
41
42
|
events,
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thingd/sdk",
|
|
3
|
-
"version": "0.33.
|
|
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.
|
|
66
|
+
"@thingd/native": "0.33.2"
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=24.0.0"
|