@pellux/goodvibes-daemon-sdk 1.2.0 → 1.3.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-routes.d.ts","sourceRoot":"","sources":["../src/integration-routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"integration-routes.d.ts","sourceRoot":"","sources":["../src/integration-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,KAAK,EAAE,6BAA6B,EAAoD,MAAM,8BAA8B,CAAC;AAuEpI,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,6BAA6B,GACrC,8BAA8B,CAsPhC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MEMORY_RECORD_NOT_FOUND_CODE } from '@pellux/goodvibes-errors';
|
|
1
2
|
import { jsonErrorResponse } from './error-response.js';
|
|
2
3
|
import { createRouteBodySchema, createRouteBodySchemaRegistry, readBoundedPositiveInteger, readOptionalStringField, readStringArrayField, } from './route-helpers.js';
|
|
3
4
|
import { parseMemoryBundleImportBody, parseMemoryLinkBody, parseMemoryRecordAddBody, parseMemoryRecordFilterBody, parseMemoryRecordReviewBody, parseMemoryRecordSearchBody, parseMemoryRecordUpdateBody, } from './memory-record-body.js';
|
|
@@ -146,7 +147,7 @@ export function createDaemonIntegrationRouteHandlers(context) {
|
|
|
146
147
|
const record = context.memoryRegistry.get(id);
|
|
147
148
|
return record
|
|
148
149
|
? Response.json({ record })
|
|
149
|
-
: jsonErrorResponse({ error: 'Unknown memory record', code:
|
|
150
|
+
: jsonErrorResponse({ error: 'Unknown memory record', code: MEMORY_RECORD_NOT_FOUND_CODE }, { status: 404 });
|
|
150
151
|
},
|
|
151
152
|
postMemoryRecordReview: async (id, req) => {
|
|
152
153
|
const body = await context.parseJsonBody(req);
|
|
@@ -156,7 +157,7 @@ export function createDaemonIntegrationRouteHandlers(context) {
|
|
|
156
157
|
const record = context.memoryRegistry.review(id, patch);
|
|
157
158
|
return record
|
|
158
159
|
? Response.json({ record })
|
|
159
|
-
: jsonErrorResponse({ error: 'Unknown memory record', code:
|
|
160
|
+
: jsonErrorResponse({ error: 'Unknown memory record', code: MEMORY_RECORD_NOT_FOUND_CODE }, { status: 404 });
|
|
160
161
|
},
|
|
161
162
|
deleteMemoryRecord: (id) => {
|
|
162
163
|
const deleted = context.memoryRegistry.delete(id);
|
|
@@ -186,11 +187,11 @@ export function createDaemonIntegrationRouteHandlers(context) {
|
|
|
186
187
|
const record = context.memoryRegistry.update(id, patch);
|
|
187
188
|
return record
|
|
188
189
|
? Response.json({ record })
|
|
189
|
-
: jsonErrorResponse({ error: 'Unknown memory record', code:
|
|
190
|
+
: jsonErrorResponse({ error: 'Unknown memory record', code: MEMORY_RECORD_NOT_FOUND_CODE }, { status: 404 });
|
|
190
191
|
},
|
|
191
192
|
getMemoryRecordLinks: (id) => {
|
|
192
193
|
if (context.memoryRegistry.get(id) === null) {
|
|
193
|
-
return jsonErrorResponse({ error: 'Unknown memory record', code:
|
|
194
|
+
return jsonErrorResponse({ error: 'Unknown memory record', code: MEMORY_RECORD_NOT_FOUND_CODE }, { status: 404 });
|
|
194
195
|
}
|
|
195
196
|
return Response.json({ links: context.memoryRegistry.linksFor(id) });
|
|
196
197
|
},
|
|
@@ -206,7 +207,7 @@ export function createDaemonIntegrationRouteHandlers(context) {
|
|
|
206
207
|
// 200 that pretends a link was made between records that do not both exist.
|
|
207
208
|
return link
|
|
208
209
|
? Response.json({ link }, { status: 201 })
|
|
209
|
-
: jsonErrorResponse({ error: 'Unknown memory record (link source or target)', code:
|
|
210
|
+
: jsonErrorResponse({ error: 'Unknown memory record (link source or target)', code: MEMORY_RECORD_NOT_FOUND_CODE }, { status: 404 });
|
|
210
211
|
},
|
|
211
212
|
postMemoryRecordExport: async (req) => {
|
|
212
213
|
const body = await context.parseJsonBody(req);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pellux/goodvibes-daemon-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"engines": {
|
|
5
5
|
"bun": "1.3.10",
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"control-plane"
|
|
158
158
|
],
|
|
159
159
|
"dependencies": {
|
|
160
|
-
"@pellux/goodvibes-contracts": "1.
|
|
161
|
-
"@pellux/goodvibes-errors": "1.
|
|
160
|
+
"@pellux/goodvibes-contracts": "1.3.0",
|
|
161
|
+
"@pellux/goodvibes-errors": "1.3.0"
|
|
162
162
|
},
|
|
163
163
|
"publishConfig": {
|
|
164
164
|
"access": "public"
|