@terreno/api 57.2.0 → 57.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.
- package/README.md +17 -7
- package/dist/actions.js +19 -7
- package/dist/api.d.ts +4 -0
- package/dist/api.js +12 -24
- package/dist/auth.d.ts +23 -10
- package/dist/auth.js +97 -32
- package/dist/authRecovery.d.ts +5 -0
- package/dist/authRecovery.js +350 -0
- package/dist/authTokens.d.ts +8 -0
- package/dist/authTokens.js +162 -0
- package/dist/betterAuth.d.ts +33 -0
- package/dist/betterAuthApp.d.ts +4 -0
- package/dist/betterAuthApp.js +26 -8
- package/dist/betterAuthSetup.d.ts +44 -2
- package/dist/betterAuthSetup.js +288 -18
- package/dist/collectionRegistry.d.ts +38 -0
- package/dist/collectionRegistry.js +72 -0
- package/dist/configurationApp.d.ts +11 -2
- package/dist/configurationApp.js +2 -4
- package/dist/docLoader.js +35 -6
- package/dist/expressServer.d.ts +26 -3
- package/dist/expressServer.js +79 -11
- package/dist/index.d.ts +16 -0
- package/dist/index.js +38 -2
- package/dist/mcp/auth.d.ts +1 -0
- package/dist/mcp/auth.js +47 -25
- package/dist/mcp/handlers.d.ts +1 -1
- package/dist/mcp/handlers.js +67 -233
- package/dist/mcp/query.d.ts +2 -2
- package/dist/mcp/registry.d.ts +1 -5
- package/dist/mcp/registry.js +31 -20
- package/dist/mcp/schemaGenerator.d.ts +2 -7
- package/dist/mcp/schemaGenerator.js +41 -116
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +1 -0
- package/dist/mcp/serviceTokens.d.ts +16 -0
- package/dist/mcp/serviceTokens.js +345 -0
- package/dist/mcp/types.d.ts +2 -2
- package/dist/models/mcpServiceToken.d.ts +3 -0
- package/dist/models/mcpServiceToken.js +208 -0
- package/dist/openApiBuilder.d.ts +5 -4
- package/dist/openApiBuilder.js +61 -8
- package/dist/openApiCompat.js +1 -1
- package/dist/openApiValidator.js +0 -2
- package/dist/plugins.d.ts +14 -1
- package/dist/plugins.js +17 -6
- package/dist/populate.d.ts +2 -2
- package/dist/populate.js +47 -42
- package/dist/rateLimit/applyTrustProxy.d.ts +3 -0
- package/dist/rateLimit/applyTrustProxy.js +17 -0
- package/dist/rateLimit/createStore.d.ts +2 -0
- package/dist/rateLimit/createStore.js +28 -0
- package/dist/rateLimit/memoryStore.d.ts +2 -0
- package/dist/rateLimit/memoryStore.js +108 -0
- package/dist/rateLimit/middleware.d.ts +11 -0
- package/dist/rateLimit/middleware.js +110 -0
- package/dist/rateLimit/mongoStore.d.ts +3 -0
- package/dist/rateLimit/mongoStore.js +122 -0
- package/dist/rateLimit/policies.d.ts +14 -0
- package/dist/rateLimit/policies.js +151 -0
- package/dist/rateLimit/redisStore.d.ts +3 -0
- package/dist/rateLimit/redisStore.js +155 -0
- package/dist/rateLimit/types.d.ts +54 -0
- package/dist/rateLimit/types.js +9 -0
- package/dist/rbac/access.js +5 -1
- package/dist/rbac/assertAllowed.d.ts +9 -0
- package/dist/rbac/assertAllowed.js +182 -0
- package/dist/rbac/modelRouterAccess.d.ts +1 -0
- package/dist/rbac/modelRouterAccess.js +8 -4
- package/dist/rbac/permissionUtils.js +3 -2
- package/dist/rbac/resolve.js +5 -4
- package/dist/rbac/routes.js +15 -6
- package/dist/realtime/deprecation.d.ts +12 -0
- package/dist/realtime/deprecation.js +32 -0
- package/dist/realtime/realtimeApp.d.ts +1 -1
- package/dist/realtime/realtimeApp.js +10 -11
- package/dist/realtime/registry.d.ts +0 -31
- package/dist/realtime/registry.js +44 -31
- package/dist/realtime/socketAuth.d.ts +5 -5
- package/dist/realtime/socketAuth.js +11 -1
- package/dist/realtime/socketUser.d.ts +5 -1
- package/dist/realtime/types.d.ts +14 -4
- package/dist/schemaMetadata.d.ts +56 -0
- package/dist/schemaMetadata.js +513 -0
- package/dist/seedRunner.d.ts +88 -0
- package/dist/seedRunner.js +627 -0
- package/dist/sync/executors.d.ts +12 -2
- package/dist/sync/executors.js +8 -10
- package/dist/sync/loadHarness.js +28 -19
- package/dist/sync/models.js +26 -24
- package/dist/sync/mutationHandler.d.ts +9 -0
- package/dist/sync/mutationHandler.js +11 -6
- package/dist/sync/registrationSideEffects.d.ts +35 -0
- package/dist/sync/registrationSideEffects.js +151 -0
- package/dist/sync/registry.d.ts +2 -52
- package/dist/sync/registry.js +38 -187
- package/dist/sync/routes.js +3 -2
- package/dist/sync/scripts/compactTombstones.js +0 -2
- package/dist/sync/syncApp.d.ts +3 -3
- package/dist/sync/syncApp.js +4 -4
- package/dist/sync/syncBatch.js +3 -2
- package/dist/sync/syncSeqPlugin.d.ts +1 -1
- package/dist/sync/syncSeqPlugin.js +20 -16
- package/dist/terrenoApp.d.ts +19 -5
- package/dist/terrenoApp.js +66 -18
- package/dist/tests/models.d.ts +2 -0
- package/dist/tests/models.js +6 -0
- package/dist/types/authToken.d.ts +33 -0
- package/dist/types/authToken.js +2 -0
- package/dist/types/mcpServiceToken.d.ts +41 -0
- package/dist/types/mcpServiceToken.js +2 -0
- package/dist/webhooks/headerValue.d.ts +2 -0
- package/dist/webhooks/headerValue.js +14 -0
- package/dist/webhooks/idempotency/memoryStore.d.ts +10 -0
- package/dist/webhooks/idempotency/memoryStore.js +65 -0
- package/dist/webhooks/idempotency/mongoStore.d.ts +4 -0
- package/dist/webhooks/idempotency/mongoStore.js +150 -0
- package/dist/webhooks/idempotency/webhookReceipt.d.ts +62 -0
- package/dist/webhooks/idempotency/webhookReceipt.js +39 -0
- package/dist/webhooks/rawBody.d.ts +14 -0
- package/dist/webhooks/rawBody.js +22 -0
- package/dist/webhooks/timingSafeEqual.d.ts +4 -0
- package/dist/webhooks/timingSafeEqual.js +17 -0
- package/dist/webhooks/verifiers/hmac.d.ts +15 -0
- package/dist/webhooks/verifiers/hmac.js +49 -0
- package/dist/webhooks/verifiers/sendgrid.d.ts +10 -0
- package/dist/webhooks/verifiers/sendgrid.js +56 -0
- package/dist/webhooks/verifiers/stripe.d.ts +9 -0
- package/dist/webhooks/verifiers/stripe.js +99 -0
- package/dist/webhooks/verifiers/twilio.d.ts +9 -0
- package/dist/webhooks/verifiers/twilio.js +112 -0
- package/dist/webhooks/webhooksApp.d.ts +33 -0
- package/dist/webhooks/webhooksApp.js +195 -0
- package/package.json +4 -5
- package/src/__snapshots__/openApi.test.ts.snap +270 -0
- package/src/__snapshots__/openApiBuilder.test.ts.snap +30 -12
- package/src/__snapshots__/schemaMetadata.test.ts.snap +197 -0
- package/src/actions.ts +20 -13
- package/src/adminModelRouter.test.ts +133 -0
- package/src/api.arrayOperations.test.ts +43 -31
- package/src/api.hooks.test.ts +38 -29
- package/src/api.query.test.ts +31 -31
- package/src/api.test.ts +95 -96
- package/src/api.ts +16 -27
- package/src/auth.test.ts +107 -51
- package/src/auth.ts +98 -29
- package/src/authRecovery.test.ts +281 -0
- package/src/authRecovery.ts +279 -0
- package/src/authTokens.test.ts +94 -0
- package/src/authTokens.ts +118 -0
- package/src/authVerification.test.ts +293 -0
- package/src/betterAuth.ts +24 -0
- package/src/betterAuthApp.test.ts +1 -0
- package/src/betterAuthApp.ts +27 -9
- package/src/betterAuthSetup.test.ts +568 -38
- package/src/betterAuthSetup.ts +260 -5
- package/src/collectionRegistry.test.ts +165 -0
- package/src/collectionRegistry.ts +115 -0
- package/src/configurationApp.ts +13 -7
- package/src/docLoader.test.ts +45 -1
- package/src/docLoader.ts +37 -6
- package/src/express.d.ts +1 -0
- package/src/expressServer.test.ts +130 -66
- package/src/expressServer.ts +75 -19
- package/src/githubAuth.test.ts +60 -55
- package/src/index.ts +58 -0
- package/src/mcp/auth.test.ts +47 -0
- package/src/mcp/auth.ts +32 -11
- package/src/mcp/handlers.ts +45 -172
- package/src/mcp/integration.test.ts +59 -9
- package/src/mcp/query.ts +2 -4
- package/src/mcp/registry.ts +29 -20
- package/src/mcp/schemaGenerator.test.ts +8 -0
- package/src/mcp/schemaGenerator.ts +49 -131
- package/src/mcp/server.ts +2 -0
- package/src/mcp/serviceTokens.test.ts +330 -0
- package/src/mcp/serviceTokens.ts +307 -0
- package/src/mcp/toolGenerator.test.ts +1 -1
- package/src/mcp/types.ts +2 -6
- package/src/models/mcpServiceToken.test.ts +129 -0
- package/src/models/mcpServiceToken.ts +158 -0
- package/src/openApi.test.ts +80 -64
- package/src/openApiBuilder.test.ts +95 -7
- package/src/openApiBuilder.ts +46 -9
- package/src/openApiCompat.ts +1 -1
- package/src/openApiValidator.test.ts +49 -54
- package/src/openApiValidator.ts +1 -3
- package/src/plugins.test.ts +14 -0
- package/src/plugins.ts +34 -9
- package/src/populate.test.ts +34 -0
- package/src/populate.ts +40 -29
- package/src/rateLimit/applyTrustProxy.ts +17 -0
- package/src/rateLimit/createStore.ts +25 -0
- package/src/rateLimit/memoryStore.ts +40 -0
- package/src/rateLimit/middleware.ts +79 -0
- package/src/rateLimit/mongoStore.test.ts +80 -0
- package/src/rateLimit/mongoStore.ts +76 -0
- package/src/rateLimit/policies.ts +130 -0
- package/src/rateLimit/rateLimit.test.ts +328 -0
- package/src/rateLimit/redisStore.ioredis.test.ts +29 -0
- package/src/rateLimit/redisStore.test.ts +114 -0
- package/src/rateLimit/redisStore.ts +85 -0
- package/src/rateLimit/types.ts +64 -0
- package/src/rbac/access.ts +5 -1
- package/src/rbac/assertAllowed.test.ts +325 -0
- package/src/rbac/assertAllowed.ts +157 -0
- package/src/rbac/backfillAdmins.test.ts +124 -0
- package/src/rbac/fieldViews.test.ts +89 -0
- package/src/rbac/modelRouterAccess.test.ts +126 -0
- package/src/rbac/modelRouterAccess.ts +5 -2
- package/src/rbac/permissionUtils.ts +3 -2
- package/src/rbac/realtimeAccess.test.ts +109 -1
- package/src/rbac/resolve.ts +5 -4
- package/src/rbac/roleManager.test.ts +169 -0
- package/src/rbac/routes.test.ts +233 -0
- package/src/rbac/routes.ts +16 -6
- package/src/realtime/deprecation.test.ts +60 -0
- package/src/realtime/deprecation.ts +32 -0
- package/src/realtime/realtime.test.ts +8 -4
- package/src/realtime/realtimeApp.ts +10 -11
- package/src/realtime/realtimeAppSetup.test.ts +32 -5
- package/src/realtime/registry.ts +48 -42
- package/src/realtime/sessionRevalidation.test.ts +57 -44
- package/src/realtime/socketAuth.test.ts +75 -23
- package/src/realtime/socketAuth.ts +17 -6
- package/src/realtime/socketUser.ts +5 -3
- package/src/realtime/types.ts +14 -4
- package/src/schemaMetadata.test.ts +405 -0
- package/src/schemaMetadata.ts +593 -0
- package/src/scrubAdminFields.test.ts +105 -0
- package/src/seedRunner.test.ts +591 -0
- package/src/seedRunner.ts +464 -0
- package/src/sync/docMatchesMutationData.test.ts +16 -0
- package/src/sync/ensureSyncIndexes.test.ts +54 -15
- package/src/sync/executors.test.ts +40 -0
- package/src/sync/executors.ts +24 -12
- package/src/sync/integration.test.ts +15 -7
- package/src/sync/loadHarness.ts +28 -19
- package/src/sync/models.ts +32 -18
- package/src/sync/mutationHandler.test.ts +16 -16
- package/src/sync/mutationHandler.ts +9 -7
- package/src/sync/registrationSideEffects.test.ts +126 -0
- package/src/sync/registrationSideEffects.ts +131 -0
- package/src/sync/registry.ts +45 -171
- package/src/sync/routes.ts +3 -2
- package/src/sync/scripts/compactTombstones.ts +0 -2
- package/src/sync/sessionRevalidationIntegration.test.ts +12 -11
- package/src/sync/sync.test.ts +25 -23
- package/src/sync/syncApp.ts +4 -4
- package/src/sync/syncBatch.ts +3 -2
- package/src/sync/syncFrontier.test.ts +17 -15
- package/src/sync/syncPhaseC.test.ts +54 -43
- package/src/sync/syncRoutes.test.ts +51 -36
- package/src/sync/syncSeqPlugin.ts +66 -44
- package/src/sync/syncSocket.test.ts +112 -81
- package/src/terrenoApp.mcpServiceTokens.test.ts +173 -0
- package/src/terrenoApp.ts +87 -15
- package/src/tests/models.ts +14 -1
- package/src/types/authToken.ts +43 -0
- package/src/types/mcpServiceToken.ts +54 -0
- package/src/webhooks/headerValue.test.ts +22 -0
- package/src/webhooks/headerValue.ts +12 -0
- package/src/webhooks/idempotency/memoryStore.ts +34 -0
- package/src/webhooks/idempotency/mongoStore.test.ts +274 -0
- package/src/webhooks/idempotency/mongoStore.ts +83 -0
- package/src/webhooks/idempotency/webhookReceipt.ts +70 -0
- package/src/webhooks/rawBody.test.ts +74 -0
- package/src/webhooks/rawBody.ts +23 -0
- package/src/webhooks/timingSafeEqual.ts +16 -0
- package/src/webhooks/verifiers/hmac.test.ts +110 -0
- package/src/webhooks/verifiers/hmac.ts +54 -0
- package/src/webhooks/verifiers/providerVerifiers.test.ts +388 -0
- package/src/webhooks/verifiers/sendgrid.ts +59 -0
- package/src/webhooks/verifiers/stripe.ts +67 -0
- package/src/webhooks/verifiers/twilio.ts +69 -0
- package/src/webhooks/webhooksApp.test.ts +221 -0
- package/src/webhooks/webhooksApp.ts +144 -0
package/src/mcp/handlers.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
3
|
import {addPopulateToQuery, type JSONValue} from "../api";
|
|
4
|
-
import
|
|
4
|
+
import type {User} from "../auth";
|
|
5
5
|
import {isAPIError} from "../errors";
|
|
6
6
|
import {checkPermissions} from "../permissions";
|
|
7
7
|
import type {PopulatePath} from "../populate";
|
|
8
|
-
import {
|
|
9
|
-
import {defaultResponseHandler
|
|
8
|
+
import {executeCreate, executeDelete, executeUpdate} from "../sync/executors";
|
|
9
|
+
import {defaultResponseHandler} from "../transformers";
|
|
10
10
|
import {createMCPRequest} from "./createMCPRequest";
|
|
11
11
|
import {buildListQuery} from "./query";
|
|
12
12
|
import {restWriteExcludeFields, writeExcludeFields} from "./schemaGenerator";
|
|
@@ -210,11 +210,16 @@ const requiresAuthentication = (entry: MCPRegistryEntry, user?: User): boolean =
|
|
|
210
210
|
return !user && entry.options.allowAnonymous !== true;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
-
|
|
213
|
+
/** Map executor/APIError failures onto the MCP error envelope. */
|
|
214
|
+
const fromExecutorError = (error: unknown): MCPToolResult => {
|
|
214
215
|
if (isAPIError(error)) {
|
|
215
216
|
return errorResult(error.title, error);
|
|
216
217
|
}
|
|
217
|
-
return errorResult(
|
|
218
|
+
return errorResult(errorMessage(error), error);
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const deniedWriteFields = (entry: MCPRegistryEntry, phase: "create" | "update"): string[] => {
|
|
222
|
+
return writeExcludeFields(entry.config, restWriteExcludeFields(phase, entry.options.validation));
|
|
218
223
|
};
|
|
219
224
|
|
|
220
225
|
const serializeResponse = async (
|
|
@@ -234,7 +239,12 @@ const serializeResponse = async (
|
|
|
234
239
|
// Use the model router's responseHandler if available, otherwise default
|
|
235
240
|
const responseHandler = entry.options.responseHandler ?? defaultResponseHandler;
|
|
236
241
|
|
|
237
|
-
const result = await responseHandler(
|
|
242
|
+
const result = await responseHandler(
|
|
243
|
+
data as NonNullable<Parameters<typeof responseHandler>[0]>,
|
|
244
|
+
method,
|
|
245
|
+
createMCPRequest({user}),
|
|
246
|
+
entry.options
|
|
247
|
+
);
|
|
238
248
|
return {value: stripExcludedFields(result, excludeFields) as JSONValue};
|
|
239
249
|
} catch (error) {
|
|
240
250
|
if (isAPIError(error)) {
|
|
@@ -379,65 +389,22 @@ export const handleCreate = async (
|
|
|
379
389
|
return errorResult("Permission denied: authentication required");
|
|
380
390
|
}
|
|
381
391
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
let body: MCPToolArgs | null = omitDeniedWriteFields(
|
|
387
|
-
args,
|
|
388
|
-
writeExcludeFields(entry.config, restWriteExcludeFields("create", options.validation))
|
|
389
|
-
);
|
|
390
|
-
try {
|
|
391
|
-
body = transform(options, body, "create", user) as MCPToolArgs;
|
|
392
|
-
} catch (error) {
|
|
393
|
-
return errorResult(`Transform failed: ${errorMessage(error)}`, error);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
if (options.preCreate) {
|
|
397
|
-
try {
|
|
398
|
-
body = await options.preCreate(body, createMCPRequest({body, user}));
|
|
399
|
-
if (body === null || body === undefined) {
|
|
400
|
-
return errorResult("Create not allowed");
|
|
401
|
-
}
|
|
402
|
-
} catch (error) {
|
|
403
|
-
return hookFailureResult("preCreate hook failed", error);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
body = omitUserRolesFromWriteBody(entry.modelName, options.accessControl, body) as MCPToolArgs;
|
|
392
|
+
const body = omitDeniedWriteFields(args, deniedWriteFields(entry, "create")) as MCPToolArgs;
|
|
393
|
+
const req = createMCPRequest({body, user});
|
|
408
394
|
|
|
395
|
+
let data: MCPDocument | null;
|
|
409
396
|
try {
|
|
410
|
-
await
|
|
397
|
+
const result = await executeCreate({
|
|
411
398
|
body,
|
|
399
|
+
model,
|
|
412
400
|
options,
|
|
413
|
-
|
|
401
|
+
req,
|
|
414
402
|
user,
|
|
403
|
+
writeModelName: entry.modelName,
|
|
415
404
|
});
|
|
405
|
+
data = result.doc as MCPDocument;
|
|
416
406
|
} catch (error) {
|
|
417
|
-
|
|
418
|
-
return errorResult(error.title, error);
|
|
419
|
-
}
|
|
420
|
-
return errorResult(`Write validation failed: ${errorMessage(error)}`, error);
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
let data: MCPDocument | null;
|
|
424
|
-
try {
|
|
425
|
-
data = asDocument(await model.create(body));
|
|
426
|
-
} catch (error) {
|
|
427
|
-
return errorResult(`Create failed: ${errorMessage(error)}`, error);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
if (options.populatePaths) {
|
|
431
|
-
const populateQuery = addPopulateToQuery(model.findById(data?._id), options.populatePaths);
|
|
432
|
-
data = asDocument(await populateQuery.exec());
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
if (options.postCreate) {
|
|
436
|
-
try {
|
|
437
|
-
await options.postCreate(data, createMCPRequest({body, user}));
|
|
438
|
-
} catch (error) {
|
|
439
|
-
return hookFailureResult("postCreate hook failed", error);
|
|
440
|
-
}
|
|
407
|
+
return fromExecutorError(error);
|
|
441
408
|
}
|
|
442
409
|
|
|
443
410
|
const serialized = await serializeResponse(data, "create", entry, user);
|
|
@@ -459,85 +426,31 @@ export const handleUpdate = async (
|
|
|
459
426
|
return errorResult("Permission denied: authentication required");
|
|
460
427
|
}
|
|
461
428
|
|
|
462
|
-
if (!(await checkPermissions("update", options.permissions.update, user))) {
|
|
463
|
-
return errorResult("Permission denied: cannot update");
|
|
464
|
-
}
|
|
465
|
-
|
|
466
429
|
const documentId = asOptionalString(id);
|
|
467
430
|
if (!documentId) {
|
|
468
431
|
return missingDocumentResult(id);
|
|
469
432
|
}
|
|
470
433
|
|
|
471
|
-
|
|
472
|
-
addPopulateToQuery(model.findById(documentId), options.populatePaths)
|
|
473
|
-
);
|
|
474
|
-
|
|
475
|
-
if (!doc) {
|
|
476
|
-
return missingDocumentResult(documentId);
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
if (!(await checkPermissions("update", options.permissions.update, user, doc))) {
|
|
480
|
-
return errorResult("Permission denied: cannot update this document");
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
let body: MCPToolArgs | null = omitDeniedWriteFields(
|
|
434
|
+
const body = omitDeniedWriteFields(
|
|
484
435
|
updateFields,
|
|
485
|
-
|
|
486
|
-
);
|
|
487
|
-
|
|
488
|
-
body = transform(options, body, "update", user) as MCPToolArgs;
|
|
489
|
-
} catch (error) {
|
|
490
|
-
return errorResult(`Transform failed: ${errorMessage(error)}`, error);
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
if (options.preUpdate) {
|
|
494
|
-
try {
|
|
495
|
-
body = await options.preUpdate(body, createMCPRequest({body, user}));
|
|
496
|
-
if (body === null || body === undefined) {
|
|
497
|
-
return errorResult("Update not allowed");
|
|
498
|
-
}
|
|
499
|
-
} catch (error) {
|
|
500
|
-
return hookFailureResult("preUpdate hook failed", error);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
body = omitUserRolesFromWriteBody(entry.modelName, options.accessControl, body) as MCPToolArgs;
|
|
436
|
+
deniedWriteFields(entry, "update")
|
|
437
|
+
) as MCPToolArgs;
|
|
438
|
+
const req = createMCPRequest({body, user});
|
|
505
439
|
|
|
440
|
+
let doc: MCPDocument | null;
|
|
506
441
|
try {
|
|
507
|
-
await
|
|
442
|
+
const result = await executeUpdate({
|
|
508
443
|
body,
|
|
509
|
-
|
|
444
|
+
id: documentId,
|
|
445
|
+
model,
|
|
510
446
|
options,
|
|
511
|
-
|
|
447
|
+
req,
|
|
512
448
|
user,
|
|
449
|
+
writeModelName: entry.modelName,
|
|
513
450
|
});
|
|
451
|
+
doc = result.doc as MCPDocument;
|
|
514
452
|
} catch (error) {
|
|
515
|
-
|
|
516
|
-
return errorResult(error.title, error);
|
|
517
|
-
}
|
|
518
|
-
return errorResult(`Write validation failed: ${errorMessage(error)}`, error);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
const prevDoc = doc.toObject();
|
|
522
|
-
|
|
523
|
-
try {
|
|
524
|
-
doc.set(body);
|
|
525
|
-
await doc.save();
|
|
526
|
-
} catch (error) {
|
|
527
|
-
return errorResult(`Update failed: ${errorMessage(error)}`, error);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
if (options.populatePaths) {
|
|
531
|
-
const populateQuery = addPopulateToQuery(model.findById(doc._id), options.populatePaths);
|
|
532
|
-
doc = asDocument(await populateQuery.exec());
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
if (options.postUpdate) {
|
|
536
|
-
try {
|
|
537
|
-
await options.postUpdate(doc, body, createMCPRequest({body, user}), prevDoc);
|
|
538
|
-
} catch (error) {
|
|
539
|
-
return hookFailureResult("postUpdate hook failed", error);
|
|
540
|
-
}
|
|
453
|
+
return fromExecutorError(error);
|
|
541
454
|
}
|
|
542
455
|
|
|
543
456
|
const serialized = await serializeResponse(doc, "update", entry, user);
|
|
@@ -559,61 +472,21 @@ export const handleDelete = async (
|
|
|
559
472
|
return errorResult("Permission denied: authentication required");
|
|
560
473
|
}
|
|
561
474
|
|
|
562
|
-
if (!(await checkPermissions("delete", options.permissions.delete, user))) {
|
|
563
|
-
return errorResult("Permission denied: cannot delete");
|
|
564
|
-
}
|
|
565
|
-
|
|
566
475
|
const documentId = asOptionalString(id);
|
|
567
476
|
if (!documentId) {
|
|
568
477
|
return missingDocumentResult(id);
|
|
569
478
|
}
|
|
570
479
|
|
|
571
|
-
// Populate before the object-level permission check so custom permissions can inspect
|
|
572
|
-
// populated refs, matching handleRead/handleUpdate and REST's permissionMiddleware.
|
|
573
|
-
const doc = await execFindByIdQuery(
|
|
574
|
-
addPopulateToQuery(model.findById(documentId), options.populatePaths)
|
|
575
|
-
);
|
|
576
|
-
|
|
577
|
-
if (!doc) {
|
|
578
|
-
return missingDocumentResult(documentId);
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
if (!(await checkPermissions("delete", options.permissions.delete, user, doc))) {
|
|
582
|
-
return errorResult("Permission denied: cannot delete this document");
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
if (options.preDelete) {
|
|
586
|
-
try {
|
|
587
|
-
const result = await options.preDelete(doc, createMCPRequest({body: args, user}));
|
|
588
|
-
if (result === null || result === undefined) {
|
|
589
|
-
return errorResult("Delete not allowed");
|
|
590
|
-
}
|
|
591
|
-
} catch (error) {
|
|
592
|
-
return hookFailureResult("preDelete hook failed", error);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
// Support soft delete via isDeleted plugin
|
|
597
480
|
try {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
model
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
}
|
|
605
|
-
await doc.deleteOne();
|
|
606
|
-
}
|
|
481
|
+
await executeDelete({
|
|
482
|
+
id: documentId,
|
|
483
|
+
model,
|
|
484
|
+
options,
|
|
485
|
+
req: createMCPRequest({body: args, user}),
|
|
486
|
+
user,
|
|
487
|
+
});
|
|
607
488
|
} catch (error) {
|
|
608
|
-
return
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
if (options.postDelete) {
|
|
612
|
-
try {
|
|
613
|
-
await options.postDelete(createMCPRequest({body: args, user}), doc);
|
|
614
|
-
} catch (error) {
|
|
615
|
-
return hookFailureResult("postDelete hook failed", error);
|
|
616
|
-
}
|
|
489
|
+
return fromExecutorError(error);
|
|
617
490
|
}
|
|
618
491
|
|
|
619
492
|
return textResult(JSON.stringify({success: true}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {beforeEach, describe, expect, it} from "bun:test";
|
|
1
|
+
import {beforeEach, describe, expect, it, spyOn} from "bun:test";
|
|
2
2
|
import type express from "express";
|
|
3
3
|
import mongoose, {Schema} from "mongoose";
|
|
4
4
|
|
|
@@ -7,6 +7,7 @@ import {APIError} from "../errors";
|
|
|
7
7
|
import {OwnerQueryFilter, Permissions} from "../permissions";
|
|
8
8
|
import {createAccess} from "../rbac/access";
|
|
9
9
|
import {terrenoStatements} from "../rbac/statements";
|
|
10
|
+
import * as executors from "../sync/executors";
|
|
10
11
|
import {setupDb} from "../tests";
|
|
11
12
|
import {handleCreate, handleDelete, handleList, handleRead, handleUpdate} from "./handlers";
|
|
12
13
|
import {
|
|
@@ -155,6 +156,16 @@ describe("MCP Integration", () => {
|
|
|
155
156
|
expect(String(parsed.data.ownerId)).toBe(normalUser.id);
|
|
156
157
|
});
|
|
157
158
|
|
|
159
|
+
it("calls executeCreate instead of persisting in the handler", async () => {
|
|
160
|
+
const createSpy = spyOn(executors, "executeCreate");
|
|
161
|
+
const result = await handleCreate(entry, {title: "Via executor"}, asUser(normalUser));
|
|
162
|
+
const parsed = parseResult(result);
|
|
163
|
+
|
|
164
|
+
expect(createSpy).toHaveBeenCalledTimes(1);
|
|
165
|
+
expect(parsed.data.title).toBe("Via executor");
|
|
166
|
+
createSpy.mockRestore();
|
|
167
|
+
});
|
|
168
|
+
|
|
158
169
|
it("denies create without user", async () => {
|
|
159
170
|
const result = await handleCreate(entry, {title: "Test"});
|
|
160
171
|
const parsed = parseResult(result);
|
|
@@ -209,6 +220,7 @@ describe("MCP Integration", () => {
|
|
|
209
220
|
});
|
|
210
221
|
|
|
211
222
|
it("drops User roles on MCP create when accessControl is set", async () => {
|
|
223
|
+
let seenRoles: unknown;
|
|
212
224
|
const writeEntry: MCPRegistryEntry = {
|
|
213
225
|
config: {methods: ["create"]},
|
|
214
226
|
model: UserWriteModel,
|
|
@@ -222,6 +234,10 @@ describe("MCP Integration", () => {
|
|
|
222
234
|
read: [],
|
|
223
235
|
update: [],
|
|
224
236
|
},
|
|
237
|
+
preCreate: (body) => {
|
|
238
|
+
seenRoles = (body as {roles?: string[]}).roles;
|
|
239
|
+
return body;
|
|
240
|
+
},
|
|
225
241
|
},
|
|
226
242
|
};
|
|
227
243
|
const result = await handleCreate(
|
|
@@ -230,6 +246,7 @@ describe("MCP Integration", () => {
|
|
|
230
246
|
asUser(normalUser)
|
|
231
247
|
);
|
|
232
248
|
const parsed = parseResult(result);
|
|
249
|
+
expect(seenRoles).toEqual(["superadmin"]);
|
|
233
250
|
expect(parsed.data.email).toBe("mcp-roles@example.com");
|
|
234
251
|
expect(parsed.data.roles ?? []).toEqual([]);
|
|
235
252
|
const stored = await UserWriteModel.findOne({email: "mcp-roles@example.com"}).lean();
|
|
@@ -561,6 +578,21 @@ describe("MCP Integration", () => {
|
|
|
561
578
|
expect(parsed.data.title).toBe("Updated");
|
|
562
579
|
});
|
|
563
580
|
|
|
581
|
+
it("calls executeUpdate instead of saving in the handler", async () => {
|
|
582
|
+
const doc = await TodoModel.create({ownerId: normalUser._id, title: "Spy update"});
|
|
583
|
+
const updateSpy = spyOn(executors, "executeUpdate");
|
|
584
|
+
const result = await handleUpdate(
|
|
585
|
+
entry,
|
|
586
|
+
{id: doc._id.toString(), title: "Spy updated"},
|
|
587
|
+
asUser(normalUser)
|
|
588
|
+
);
|
|
589
|
+
const parsed = parseResult(result);
|
|
590
|
+
|
|
591
|
+
expect(updateSpy).toHaveBeenCalledTimes(1);
|
|
592
|
+
expect(parsed.data.title).toBe("Spy updated");
|
|
593
|
+
updateSpy.mockRestore();
|
|
594
|
+
});
|
|
595
|
+
|
|
564
596
|
it("denies update by non-owner", async () => {
|
|
565
597
|
const doc = await TodoModel.create({ownerId: normalUser._id, title: "Not yours"});
|
|
566
598
|
const result = await handleUpdate(
|
|
@@ -571,7 +603,8 @@ describe("MCP Integration", () => {
|
|
|
571
603
|
const parsed = parseResult(result);
|
|
572
604
|
|
|
573
605
|
expect(parsed.error).toBeDefined();
|
|
574
|
-
expect(parsed.error).toContain("
|
|
606
|
+
expect(parsed.error).toContain("Access to GET on MCPTodo");
|
|
607
|
+
expect(parsed.error).toContain("denied");
|
|
575
608
|
});
|
|
576
609
|
|
|
577
610
|
it("admin can update any document", async () => {
|
|
@@ -688,6 +721,7 @@ describe("MCP Integration", () => {
|
|
|
688
721
|
});
|
|
689
722
|
|
|
690
723
|
it("drops User roles on MCP update when accessControl is set", async () => {
|
|
724
|
+
let seenRoles: unknown;
|
|
691
725
|
const doc = await UserWriteModel.create({email: "mcp-roles-update@example.com", roles: []});
|
|
692
726
|
const writeEntry: MCPRegistryEntry = {
|
|
693
727
|
config: {methods: ["update"]},
|
|
@@ -702,6 +736,10 @@ describe("MCP Integration", () => {
|
|
|
702
736
|
read: [],
|
|
703
737
|
update: [Permissions.IsAuthenticated],
|
|
704
738
|
},
|
|
739
|
+
preUpdate: (body) => {
|
|
740
|
+
seenRoles = (body as {roles?: string[]}).roles;
|
|
741
|
+
return body;
|
|
742
|
+
},
|
|
705
743
|
},
|
|
706
744
|
};
|
|
707
745
|
const result = await handleUpdate(
|
|
@@ -710,6 +748,7 @@ describe("MCP Integration", () => {
|
|
|
710
748
|
asUser(normalUser)
|
|
711
749
|
);
|
|
712
750
|
const parsed = parseResult(result);
|
|
751
|
+
expect(seenRoles).toEqual(["superadmin"]);
|
|
713
752
|
expect(parsed.data.email).toBe("mcp-roles-update@example.com");
|
|
714
753
|
expect(parsed.data.roles ?? []).toEqual([]);
|
|
715
754
|
expect((await UserWriteModel.findById(doc._id).lean())?.roles ?? []).toEqual([]);
|
|
@@ -801,6 +840,17 @@ describe("MCP Integration", () => {
|
|
|
801
840
|
expect(found).toBeNull();
|
|
802
841
|
});
|
|
803
842
|
|
|
843
|
+
it("calls executeDelete instead of persisting in the handler", async () => {
|
|
844
|
+
const doc = await TodoModel.create({ownerId: normalUser._id, title: "Spy delete"});
|
|
845
|
+
const deleteSpy = spyOn(executors, "executeDelete");
|
|
846
|
+
const result = await handleDelete(entry, {id: doc._id.toString()}, asUser(normalUser));
|
|
847
|
+
const parsed = parseResult(result);
|
|
848
|
+
|
|
849
|
+
expect(deleteSpy).toHaveBeenCalledTimes(1);
|
|
850
|
+
expect(parsed.success).toBe(true);
|
|
851
|
+
deleteSpy.mockRestore();
|
|
852
|
+
});
|
|
853
|
+
|
|
804
854
|
it("returns not found for a non-ObjectId id without throwing", async () => {
|
|
805
855
|
const result = await handleDelete(entry, {id: "not-an-object-id"}, asUser(normalUser));
|
|
806
856
|
const parsed = parseResult(result);
|
|
@@ -910,7 +960,7 @@ describe("MCP Integration", () => {
|
|
|
910
960
|
|
|
911
961
|
const parsed = parseResult(await handleCreate(anonymousWrites, {title: "Anon"}));
|
|
912
962
|
|
|
913
|
-
expect(parsed.error).toContain("
|
|
963
|
+
expect(parsed.error).toContain("Access to CREATE on MCPTodo denied");
|
|
914
964
|
});
|
|
915
965
|
});
|
|
916
966
|
|
|
@@ -1025,7 +1075,7 @@ describe("MCP Integration", () => {
|
|
|
1025
1075
|
|
|
1026
1076
|
const parsed = parseResult(await handleCreate(failing, {title: "No"}, asUser(normalUser)));
|
|
1027
1077
|
|
|
1028
|
-
expect(parsed.error).
|
|
1078
|
+
expect(parsed.error).toBe("preCreate hook error");
|
|
1029
1079
|
});
|
|
1030
1080
|
|
|
1031
1081
|
it("preserves APIError titles thrown from preCreate", async () => {
|
|
@@ -1059,7 +1109,7 @@ describe("MCP Integration", () => {
|
|
|
1059
1109
|
|
|
1060
1110
|
const parsed = parseResult(await handleCreate(failing, {title: "Yes"}, asUser(normalUser)));
|
|
1061
1111
|
|
|
1062
|
-
expect(parsed.error).
|
|
1112
|
+
expect(parsed.error).toBe("postCreate hook error");
|
|
1063
1113
|
});
|
|
1064
1114
|
|
|
1065
1115
|
it("reports a preUpdate hook that returns null", async () => {
|
|
@@ -1092,7 +1142,7 @@ describe("MCP Integration", () => {
|
|
|
1092
1142
|
await handleUpdate(failing, {id: doc._id.toString(), title: "Changed"}, asUser(normalUser))
|
|
1093
1143
|
);
|
|
1094
1144
|
|
|
1095
|
-
expect(parsed.error).
|
|
1145
|
+
expect(parsed.error).toBe("postUpdate hook error");
|
|
1096
1146
|
});
|
|
1097
1147
|
|
|
1098
1148
|
it("reports a preDelete hook that returns null", async () => {
|
|
@@ -1125,7 +1175,7 @@ describe("MCP Integration", () => {
|
|
|
1125
1175
|
await handleDelete(failing, {id: doc._id.toString()}, asUser(normalUser))
|
|
1126
1176
|
);
|
|
1127
1177
|
|
|
1128
|
-
expect(parsed.error).
|
|
1178
|
+
expect(parsed.error).toBe("postDelete hook error");
|
|
1129
1179
|
});
|
|
1130
1180
|
|
|
1131
1181
|
it("passes the update fields as the MCP request body, without the id", async () => {
|
|
@@ -1313,7 +1363,7 @@ describe("MCP Integration", () => {
|
|
|
1313
1363
|
user: normalUser,
|
|
1314
1364
|
});
|
|
1315
1365
|
expectStubRequest({
|
|
1316
|
-
body: {
|
|
1366
|
+
body: {title: "Hooked"},
|
|
1317
1367
|
request: seen.postCreate,
|
|
1318
1368
|
user: normalUser,
|
|
1319
1369
|
});
|
|
@@ -1456,7 +1506,7 @@ describe("MCP Integration", () => {
|
|
|
1456
1506
|
const result = await handleDelete(registered, {id: doc._id.toString()}, asUser(normalUser));
|
|
1457
1507
|
const parsed = parseResult(result);
|
|
1458
1508
|
|
|
1459
|
-
expect(parsed.error).toContain("
|
|
1509
|
+
expect(parsed.error).toContain("Access to DELETE on MCPTodo denied");
|
|
1460
1510
|
expect(await TodoModel.findById(doc._id)).toBeTruthy();
|
|
1461
1511
|
});
|
|
1462
1512
|
|
package/src/mcp/query.ts
CHANGED
|
@@ -132,16 +132,14 @@ export interface BuildListQueryResult {
|
|
|
132
132
|
* Anything else is rejected rather than silently dropped so the calling LLM can correct
|
|
133
133
|
* itself instead of receiving results for a query it did not ask for.
|
|
134
134
|
*/
|
|
135
|
-
export const buildListQuery = ({
|
|
135
|
+
export const buildListQuery = <T>({
|
|
136
136
|
args,
|
|
137
137
|
config,
|
|
138
138
|
options,
|
|
139
139
|
}: {
|
|
140
140
|
args: MCPToolArgs;
|
|
141
141
|
config: MCPConfig;
|
|
142
|
-
|
|
143
|
-
// biome-ignore lint/suspicious/noExplicitAny: ModelRouterOptions is generic over the consumer's document type
|
|
144
|
-
options: ModelRouterOptions<any>;
|
|
142
|
+
options: ModelRouterOptions<T>;
|
|
145
143
|
}): BuildListQueryResult => {
|
|
146
144
|
const query: Record<string, unknown> = {...(options.defaultQueryParams ?? {})};
|
|
147
145
|
const excludeFields = config.excludeFields ?? [];
|
package/src/mcp/registry.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type {ZodType} from "zod";
|
|
|
3
3
|
|
|
4
4
|
import type {ModelRouterOptions} from "../api";
|
|
5
5
|
import type {User} from "../auth";
|
|
6
|
+
import {
|
|
7
|
+
clearCollectionRegistry,
|
|
8
|
+
listCollections,
|
|
9
|
+
registerCollection,
|
|
10
|
+
replaceCollectionOptions,
|
|
11
|
+
} from "../collectionRegistry";
|
|
6
12
|
import type {MCPConfig, MCPRegistryEntry, MCPToolArgs, MCPToolResult} from "./types";
|
|
7
13
|
|
|
8
14
|
export interface MCPCustomTool {
|
|
@@ -12,39 +18,35 @@ export interface MCPCustomTool {
|
|
|
12
18
|
zodSchema: ZodType;
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
const mcpRegistry: MCPRegistryEntry[] = [];
|
|
16
21
|
const mcpCustomTools: MCPCustomTool[] = [];
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
const findCollectionByModelName = (modelName: string) =>
|
|
24
|
+
listCollections().find((record) => record.model.modelName === modelName);
|
|
25
|
+
|
|
26
|
+
const mcpRoutePathForModel = <T>(model: Model<T>): string =>
|
|
27
|
+
findCollectionByModelName(model.modelName)?.routePath ?? `/_mcp/${model.modelName}`;
|
|
28
|
+
|
|
29
|
+
export const registerMCPModel = <T>(
|
|
30
|
+
model: Model<T>,
|
|
22
31
|
config: MCPConfig,
|
|
23
|
-
|
|
24
|
-
// biome-ignore lint/suspicious/noExplicitAny: ModelRouterOptions is generic over the consumer's document type
|
|
25
|
-
options: ModelRouterOptions<any>
|
|
32
|
+
options: ModelRouterOptions<T>
|
|
26
33
|
): void => {
|
|
27
|
-
|
|
28
|
-
config,
|
|
34
|
+
registerCollection({
|
|
29
35
|
model,
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
options: {...options, mcp: config},
|
|
37
|
+
routePath: mcpRoutePathForModel(model),
|
|
32
38
|
});
|
|
33
39
|
};
|
|
34
40
|
|
|
35
|
-
/**
|
|
36
|
-
* Replace options on an existing MCP registry entry after TerrenoApp injects
|
|
37
|
-
* accessControl (same contract as updateRealtimeRegistryOptions).
|
|
38
|
-
*/
|
|
39
41
|
export const updateMCPRegistryOptions = (
|
|
40
42
|
modelName: string,
|
|
41
43
|
options: ModelRouterOptions<unknown>
|
|
42
44
|
): void => {
|
|
43
|
-
const existing =
|
|
45
|
+
const existing = findCollectionByModelName(modelName);
|
|
44
46
|
if (!existing) {
|
|
45
47
|
return;
|
|
46
48
|
}
|
|
47
|
-
existing.
|
|
49
|
+
replaceCollectionOptions(existing.routePath, options);
|
|
48
50
|
};
|
|
49
51
|
|
|
50
52
|
export const registerMCPTool = (tool: MCPCustomTool): void => {
|
|
@@ -57,7 +59,14 @@ export const registerMCPTool = (tool: MCPCustomTool): void => {
|
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
export const getMCPRegistry = (): MCPRegistryEntry[] => {
|
|
60
|
-
return
|
|
62
|
+
return listCollections()
|
|
63
|
+
.filter((record) => record.surfaces.mcp)
|
|
64
|
+
.map((record) => ({
|
|
65
|
+
config: record.options.mcp as MCPConfig,
|
|
66
|
+
model: record.model,
|
|
67
|
+
modelName: record.model.modelName,
|
|
68
|
+
options: record.options,
|
|
69
|
+
}));
|
|
61
70
|
};
|
|
62
71
|
|
|
63
72
|
export const getMCPCustomTools = (): MCPCustomTool[] => {
|
|
@@ -65,6 +74,6 @@ export const getMCPCustomTools = (): MCPCustomTool[] => {
|
|
|
65
74
|
};
|
|
66
75
|
|
|
67
76
|
export const clearMCPRegistry = (): void => {
|
|
68
|
-
|
|
77
|
+
clearCollectionRegistry();
|
|
69
78
|
mcpCustomTools.length = 0;
|
|
70
79
|
};
|
|
@@ -14,6 +14,7 @@ const createTestModel = () => {
|
|
|
14
14
|
const schema = new Schema({
|
|
15
15
|
completed: {default: false, description: "Whether the item is complete", type: Boolean},
|
|
16
16
|
count: {description: "A count", type: Number},
|
|
17
|
+
eatenBy: [{description: "Eaters", ref: "User", type: Schema.Types.ObjectId}],
|
|
17
18
|
name: {description: "The name", required: true, type: String},
|
|
18
19
|
ownerId: {description: "Owner", ref: "User", type: Schema.Types.ObjectId},
|
|
19
20
|
secretField: {description: "A secret", type: String},
|
|
@@ -135,6 +136,13 @@ describe("generateToolDescription", () => {
|
|
|
135
136
|
expect(desc).toContain("ownerId (ref: User)");
|
|
136
137
|
});
|
|
137
138
|
|
|
139
|
+
it("labels ObjectId array refs as arrays in create description", () => {
|
|
140
|
+
const desc = generateToolDescription(model, "create", {});
|
|
141
|
+
expect(desc).toContain("eatenBy (ref:User[])");
|
|
142
|
+
expect(desc).not.toContain("eatenBy (ObjectId)");
|
|
143
|
+
expect(desc).not.toContain("eatenBy (ref: User) ");
|
|
144
|
+
});
|
|
145
|
+
|
|
138
146
|
it("generates read description with the declared populate-able refs", () => {
|
|
139
147
|
const desc = generateToolDescription(model, "read", {}, undefined, [{path: "ownerId"}]);
|
|
140
148
|
expect(desc).toContain("Read a single MCPTestItem");
|