@terreno/api 57.20.0 → 58.0.0-beta.1
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/CHANGELOG.md +93 -0
- package/README.md +1 -1
- package/biome.jsonc +3 -2
- package/dist/api.d.ts +3 -16
- package/dist/api.js +0 -9
- package/dist/auth.d.ts +3 -2
- package/dist/auth.js +95 -5
- package/dist/authRecovery.d.ts +2 -1
- package/dist/authRecovery.js +35 -17
- package/dist/collectionRegistry.d.ts +3 -4
- package/dist/collectionRegistry.js +0 -1
- package/dist/consentApp.d.ts +1 -1
- package/dist/consentApp.js +58 -2
- package/dist/frameworkModelNames.d.ts +4 -0
- package/dist/frameworkModelNames.js +4 -0
- package/dist/index.d.ts +8 -5
- package/dist/index.js +14 -20
- package/dist/mcp/adminTracking.d.ts +28 -0
- package/dist/mcp/adminTracking.js +80 -0
- package/dist/mcp/auth.d.ts +6 -0
- package/dist/mcp/auth.js +12 -2
- package/dist/mcp/server.d.ts +8 -0
- package/dist/mcp/server.js +48 -4
- package/dist/mcp/serviceTokens.d.ts +21 -1
- package/dist/mcp/serviceTokens.js +159 -183
- package/dist/migrations/builtin/mcpServiceTokenStringIds.d.ts +18 -0
- package/dist/migrations/builtin/mcpServiceTokenStringIds.js +67 -0
- package/dist/models/mcpOAuthToken.js +27 -0
- package/dist/models/mcpRequestLog.d.ts +2 -0
- package/dist/models/mcpRequestLog.js +73 -0
- package/dist/models/mcpServiceToken.js +40 -4
- package/dist/models/mcpToolSetting.d.ts +2 -0
- package/dist/models/mcpToolSetting.js +119 -0
- package/dist/models/versionConfig.d.ts +2 -0
- package/dist/openApiBuilder.d.ts +4 -0
- package/dist/openApiBuilder.js +2 -0
- package/dist/rbac/auditModel.d.ts +2 -1
- package/dist/rbac/realtimeAccess.d.ts +5 -4
- package/dist/rbac/realtimeAccess.js +17 -64
- package/dist/realtime/changeStreamWatcher.d.ts +8 -63
- package/dist/realtime/changeStreamWatcher.js +32 -391
- package/dist/realtime/realtimeApp.d.ts +14 -27
- package/dist/realtime/realtimeApp.js +14 -220
- package/dist/realtime/types.d.ts +0 -64
- package/dist/sync/executors.js +14 -2
- package/dist/sync/socketHandlers.d.ts +1 -1
- package/dist/sync/socketHandlers.js +1 -1
- package/dist/terrenoApp.d.ts +19 -5
- package/dist/terrenoApp.js +21 -14
- package/dist/tests/models.d.ts +17 -22
- package/dist/tests/models.js +7 -1
- package/dist/tests/openApiResponseSchema.d.ts +39 -0
- package/dist/tests/openApiResponseSchema.js +56 -0
- package/dist/tests/testHelper.d.ts +6 -12
- package/dist/tests.d.ts +2 -0
- package/dist/tests.js +6 -1
- package/dist/types/mcpAdmin.d.ts +58 -0
- package/dist/types/mcpAdmin.js +2 -0
- package/dist/types/mcpOAuth.d.ts +2 -0
- package/dist/types/mcpServiceToken.d.ts +9 -4
- package/dist/versionCheckPlugin.d.ts +1 -1
- package/dist/versionCheckPlugin.js +25 -2
- package/e2e/smoke.ts +193 -0
- package/package.json +14 -8
- package/src/__snapshots__/openApi.test.ts.snap +4986 -2478
- package/src/__snapshots__/openApiBuilder.test.ts.snap +836 -0
- package/src/__tests__/openApiResponseSchema.test.ts +148 -0
- package/src/__tests__/versionCheckPlugin.test.ts +72 -0
- package/src/adminModelRouter.test.ts +8 -6
- package/src/api.arrayOperations.test.ts +31 -22
- package/src/api.hooks.test.ts +12 -11
- package/src/api.query.test.ts +2 -2
- package/src/api.test.ts +17 -14
- package/src/api.ts +3 -27
- package/src/audit/auditApp.test.ts +1 -1
- package/src/audit/cloudTasksEnqueue.test.ts +19 -14
- package/src/auth.test.ts +21 -7
- package/src/auth.ts +116 -5
- package/src/authOpenApi.test.ts +316 -0
- package/src/authRecovery.test.ts +10 -10
- package/src/authRecovery.ts +47 -19
- package/src/authVerification.test.ts +7 -7
- package/src/betterAuthFeatures.test.ts +3 -2
- package/src/betterAuthLinking.test.ts +3 -1
- package/src/betterAuthOAuthHandoff.test.ts +13 -5
- package/src/betterAuthSetup.test.ts +77 -51
- package/src/collectionRegistry.test.ts +4 -4
- package/src/collectionRegistry.ts +3 -5
- package/src/consentApp.test.ts +98 -0
- package/src/consentApp.ts +67 -2
- package/src/frameworkModelNames.test.ts +8 -0
- package/src/frameworkModelNames.ts +4 -0
- package/src/githubAuth.test.ts +11 -11
- package/src/index.ts +14 -28
- package/src/isolated/migrateCliConnect.isolated.ts +3 -2
- package/src/mcp/actionTools.test.ts +13 -7
- package/src/mcp/adminTracking.test.ts +272 -0
- package/src/mcp/adminTracking.ts +104 -0
- package/src/mcp/auth.test.ts +7 -3
- package/src/mcp/auth.ts +18 -2
- package/src/mcp/oauth.test.ts +13 -13
- package/src/mcp/server.ts +67 -4
- package/src/mcp/serviceTokens.sync.test.ts +230 -0
- package/src/mcp/serviceTokens.test.ts +114 -62
- package/src/mcp/serviceTokens.ts +193 -212
- package/src/mcp/toolGenerator.test.ts +9 -5
- package/src/migrations/builtin/mcpServiceTokenStringIds.test.ts +194 -0
- package/src/migrations/builtin/mcpServiceTokenStringIds.ts +121 -0
- package/src/migrations/cli.test.ts +15 -14
- package/src/migrations/cli.ts +1 -1
- package/src/migrations/generate.test.ts +2 -2
- package/src/migrations/load.test.ts +1 -1
- package/src/migrations/lock.test.ts +8 -3
- package/src/migrations/runner.test.ts +16 -5
- package/src/migrations/schemaCatalog.test.ts +4 -1
- package/src/models/mcpOAuthToken.test.ts +42 -0
- package/src/models/mcpOAuthToken.ts +32 -0
- package/src/models/mcpRequestLog.ts +81 -0
- package/src/models/mcpServiceToken.test.ts +75 -5
- package/src/models/mcpServiceToken.ts +61 -14
- package/src/models/mcpToolSetting.test.ts +69 -0
- package/src/models/mcpToolSetting.ts +138 -0
- package/src/models/versionConfig.ts +2 -0
- package/src/notifications/notificationsApp.test.ts +5 -8
- package/src/notifiers/slackWebApi.test.ts +30 -8
- package/src/openApi.test.ts +4 -4
- package/src/openApiBuilder.test.ts +34 -1
- package/src/openApiBuilder.ts +5 -0
- package/src/openApiValidator.test.ts +3 -3
- package/src/orgs/orgPermissions.test.ts +2 -2
- package/src/orgs/orgPlugin.test.ts +4 -3
- package/src/orgs/orgSecurityDefects.test.ts +3 -1
- package/src/orgs/organizationSettings.test.ts +1 -1
- package/src/orgs/orgsApp.test.ts +5 -3
- package/src/permissions.test.ts +2 -2
- package/src/rateLimit/rateLimit.test.ts +25 -10
- package/src/rateLimit/redisStore.ioredis.test.ts +3 -2
- package/src/rbac/assertAllowed.test.ts +1 -1
- package/src/rbac/auditModel.ts +10 -2
- package/src/rbac/realtimeAccess.test.ts +20 -171
- package/src/rbac/realtimeAccess.ts +17 -82
- package/src/rbac/routes.test.ts +1 -1
- package/src/rbac/userWriteGuards.test.ts +8 -5
- package/src/realtime/changeStreamWatcher.ts +43 -506
- package/src/realtime/realtime.test.ts +211 -2547
- package/src/realtime/realtimeApp.ts +16 -295
- package/src/realtime/types.ts +0 -72
- package/src/scrubAdminFields.test.ts +1 -1
- package/src/sync/adminWindowMutation.test.ts +4 -3
- package/src/sync/executors.test.ts +29 -1
- package/src/sync/executors.ts +23 -2
- package/src/sync/scripts/compactTombstones.test.ts +4 -3
- package/src/sync/socketHandlers.ts +1 -1
- package/src/sync/sync.test.ts +1 -1
- package/src/sync/syncPhaseC.test.ts +14 -11
- package/src/sync/syncRoutes.test.ts +8 -8
- package/src/sync/syncSeqPlugin.test.ts +1 -2
- package/src/sync/syncSocket.test.ts +78 -113
- package/src/terrenoApp.mcpServiceTokens.test.ts +16 -8
- package/src/terrenoApp.migrations.test.ts +8 -7
- package/src/terrenoApp.ts +38 -18
- package/src/tests/betterAuthStubs.ts +3 -2
- package/src/tests/bunSetup.ts +1 -1
- package/src/tests/models.ts +10 -0
- package/src/tests/openApiResponseSchema.ts +104 -0
- package/src/tests/testEnv.ts +7 -0
- package/src/tests.ts +8 -0
- package/src/types/mcpAdmin.ts +80 -0
- package/src/types/mcpOAuth.ts +5 -0
- package/src/types/mcpServiceToken.ts +12 -4
- package/src/versionCheckPlugin.ts +41 -2
- package/src/webhooks/verifiers/hmac.test.ts +1 -1
- package/tsconfig.typecheck.json +14 -0
- package/dist/realtime/deprecation.d.ts +0 -13
- package/dist/realtime/deprecation.js +0 -31
- package/dist/realtime/queryStore.d.ts +0 -37
- package/dist/realtime/queryStore.js +0 -103
- package/dist/realtime/registry.d.ts +0 -15
- package/dist/realtime/registry.js +0 -52
- package/src/realtime/deprecation.test.ts +0 -60
- package/src/realtime/deprecation.ts +0 -33
- package/src/realtime/queryStore.ts +0 -122
- package/src/realtime/registry.ts +0 -84
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** The subset of an OpenAPI document needed to look up and validate a response schema. */
|
|
2
|
+
export interface OpenApiResponseSpec {
|
|
3
|
+
components?: Record<string, unknown>;
|
|
4
|
+
paths?: Record<string, Record<string, OpenApiResponseOperation | undefined> | undefined>;
|
|
5
|
+
}
|
|
6
|
+
interface OpenApiResponseOperation {
|
|
7
|
+
responses?: Record<string, {
|
|
8
|
+
content?: Record<string, {
|
|
9
|
+
schema?: unknown;
|
|
10
|
+
}>;
|
|
11
|
+
} | undefined>;
|
|
12
|
+
}
|
|
13
|
+
export interface DocumentedResponseOptions {
|
|
14
|
+
/** The `/openapi.json` document the app serves. */
|
|
15
|
+
spec: OpenApiResponseSpec;
|
|
16
|
+
/** The OpenAPI path template, e.g. `/announcements/{id}/click`. */
|
|
17
|
+
path: string;
|
|
18
|
+
/** HTTP method, any case. */
|
|
19
|
+
method: string;
|
|
20
|
+
/** The real response: its status picks the documented response, its body is validated. */
|
|
21
|
+
response: {
|
|
22
|
+
status: number;
|
|
23
|
+
body: unknown;
|
|
24
|
+
};
|
|
25
|
+
/** Response media type to validate against. Defaults to `application/json`. */
|
|
26
|
+
contentType?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface DocumentedResponseResult {
|
|
29
|
+
valid: boolean;
|
|
30
|
+
errors: string[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Validates a real response body against the response schema `/openapi.json` documents for it,
|
|
34
|
+
* resolving `#/components/...` references against the same spec.
|
|
35
|
+
*/
|
|
36
|
+
export declare const validateDocumentedResponse: ({ contentType, method, path, response, spec, }: DocumentedResponseOptions) => DocumentedResponseResult;
|
|
37
|
+
/** Throws with every schema violation when a response body does not match its documentation. */
|
|
38
|
+
export declare const expectDocumentedResponse: (options: DocumentedResponseOptions) => void;
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.expectDocumentedResponse = exports.validateDocumentedResponse = void 0;
|
|
7
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
8
|
+
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
|
9
|
+
/** Raised when a route or response is undocumented, or a body breaks its documented schema. */
|
|
10
|
+
class DocumentedResponseError extends Error {
|
|
11
|
+
name = "DocumentedResponseError";
|
|
12
|
+
}
|
|
13
|
+
const findResponseSchema = ({ contentType, method, path, spec, status, }) => {
|
|
14
|
+
const label = `${method.toUpperCase()} ${path}`;
|
|
15
|
+
const operation = spec.paths?.[path]?.[method.toLowerCase()];
|
|
16
|
+
if (!operation) {
|
|
17
|
+
throw new DocumentedResponseError(`${label} is not documented in the OpenAPI spec`);
|
|
18
|
+
}
|
|
19
|
+
const documented = operation.responses?.[String(status)];
|
|
20
|
+
if (!documented) {
|
|
21
|
+
const statuses = Object.keys(operation.responses ?? {}).join(", ") || "none";
|
|
22
|
+
throw new DocumentedResponseError(`${label} has no documented ${status} response (documented: ${statuses})`);
|
|
23
|
+
}
|
|
24
|
+
const schema = documented.content?.[contentType]?.schema;
|
|
25
|
+
if (!schema) {
|
|
26
|
+
throw new DocumentedResponseError(`${label} ${status} response has no ${contentType} schema`);
|
|
27
|
+
}
|
|
28
|
+
return schema;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Validates a real response body against the response schema `/openapi.json` documents for it,
|
|
32
|
+
* resolving `#/components/...` references against the same spec.
|
|
33
|
+
*/
|
|
34
|
+
const validateDocumentedResponse = ({ contentType = "application/json", method, path, response, spec, }) => {
|
|
35
|
+
const schema = findResponseSchema({ contentType, method, path, spec, status: response.status });
|
|
36
|
+
const ajv = new ajv_1.default({ allErrors: true, strict: false });
|
|
37
|
+
(0, ajv_formats_1.default)(ajv);
|
|
38
|
+
// Wrapping keeps `#/components/...` refs resolvable from the root of the compiled schema.
|
|
39
|
+
const validate = ajv.compile({ allOf: [schema], components: spec.components ?? {} });
|
|
40
|
+
if (validate(response.body)) {
|
|
41
|
+
return { errors: [], valid: true };
|
|
42
|
+
}
|
|
43
|
+
const errors = (validate.errors ?? []).map((error) => `${error.instancePath || "(root)"} ${error.message ?? "is invalid"}`);
|
|
44
|
+
return { errors, valid: false };
|
|
45
|
+
};
|
|
46
|
+
exports.validateDocumentedResponse = validateDocumentedResponse;
|
|
47
|
+
/** Throws with every schema violation when a response body does not match its documentation. */
|
|
48
|
+
const expectDocumentedResponse = (options) => {
|
|
49
|
+
const { errors, valid } = (0, exports.validateDocumentedResponse)(options);
|
|
50
|
+
if (valid) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const label = `${options.method.toUpperCase()} ${options.path} ${options.response.status}`;
|
|
54
|
+
throw new DocumentedResponseError(`${label} response does not match its OpenAPI schema:\n- ${errors.join("\n- ")}\nBody: ${JSON.stringify(options.response.body)}`);
|
|
55
|
+
};
|
|
56
|
+
exports.expectDocumentedResponse = expectDocumentedResponse;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import type { TestData } from "./types";
|
|
2
2
|
/** Seeds only the standard users (legacy helper). */
|
|
3
|
-
export declare const setupDb: () => Promise<readonly [import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & {
|
|
3
|
+
export declare const setupDb: () => Promise<readonly [import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & Required<{
|
|
4
4
|
_id: import("mongoose").Types.ObjectId;
|
|
5
|
-
} & {
|
|
5
|
+
}> & {
|
|
6
6
|
__v: number;
|
|
7
|
-
} & {
|
|
8
|
-
id: string;
|
|
9
|
-
}, import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & {
|
|
7
|
+
}, import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & Required<{
|
|
10
8
|
_id: import("mongoose").Types.ObjectId;
|
|
11
|
-
} & {
|
|
9
|
+
}> & {
|
|
12
10
|
__v: number;
|
|
13
|
-
} & {
|
|
14
|
-
id: string;
|
|
15
|
-
}, import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & {
|
|
11
|
+
}, import("mongoose").Document<unknown, {}, import("./models").User, {}, import("mongoose").DefaultSchemaOptions> & import("./models").User & Required<{
|
|
16
12
|
_id: import("mongoose").Types.ObjectId;
|
|
17
|
-
} & {
|
|
13
|
+
}> & {
|
|
18
14
|
__v: number;
|
|
19
|
-
} & {
|
|
20
|
-
id: string;
|
|
21
15
|
}]>;
|
|
22
16
|
/** Seeds users, foods, and required docs — the recommended API test baseline. */
|
|
23
17
|
export declare const setupTestData: () => Promise<TestData>;
|
package/dist/tests.d.ts
CHANGED
|
@@ -6,8 +6,10 @@ import { type Food, type FoodCategory, FoodModel, type RequiredField, RequiredMo
|
|
|
6
6
|
import { loadTestDataFromCache, setupTestCache } from "./tests/mongoTestSetup";
|
|
7
7
|
import { setupDb, setupTestData } from "./tests/testHelper";
|
|
8
8
|
import type { TestData } from "./tests/types";
|
|
9
|
+
export { authUserModel } from "./tests/models";
|
|
9
10
|
export type { Food, FoodCategory, RequiredField, StaffUser, SuperUser, TestData, User };
|
|
10
11
|
export { createTestData, FoodModel, loadTestDataFromCache, RequiredModel, StaffUserModel, SuperUserModel, setupDb, setupTestCache, setupTestData, UserModel, };
|
|
11
12
|
export declare const getBaseServer: () => Express;
|
|
12
13
|
export declare const authAsUser: (app: express.Application, type: "admin" | "notAdmin") => Promise<TestAgent>;
|
|
13
14
|
export { loadTestData } from "./tests/mongoTestSetup";
|
|
15
|
+
export { type DocumentedResponseOptions, type DocumentedResponseResult, expectDocumentedResponse, type OpenApiResponseSpec, validateDocumentedResponse, } from "./tests/openApiResponseSchema";
|
package/dist/tests.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadTestData = exports.authAsUser = exports.getBaseServer = exports.UserModel = exports.setupTestData = exports.setupTestCache = exports.setupDb = exports.SuperUserModel = exports.StaffUserModel = exports.RequiredModel = exports.loadTestDataFromCache = exports.FoodModel = exports.createTestData = void 0;
|
|
3
|
+
exports.validateDocumentedResponse = exports.expectDocumentedResponse = exports.loadTestData = exports.authAsUser = exports.getBaseServer = exports.UserModel = exports.setupTestData = exports.setupTestCache = exports.setupDb = exports.SuperUserModel = exports.StaffUserModel = exports.RequiredModel = exports.loadTestDataFromCache = exports.FoodModel = exports.createTestData = exports.authUserModel = void 0;
|
|
4
4
|
const test_1 = require("@terreno/test");
|
|
5
5
|
const openApiCompat_1 = require("./openApiCompat");
|
|
6
6
|
const createTestData_1 = require("./tests/createTestData");
|
|
@@ -17,6 +17,8 @@ Object.defineProperty(exports, "setupTestCache", { enumerable: true, get: functi
|
|
|
17
17
|
const testHelper_1 = require("./tests/testHelper");
|
|
18
18
|
Object.defineProperty(exports, "setupDb", { enumerable: true, get: function () { return testHelper_1.setupDb; } });
|
|
19
19
|
Object.defineProperty(exports, "setupTestData", { enumerable: true, get: function () { return testHelper_1.setupTestData; } });
|
|
20
|
+
var models_2 = require("./tests/models");
|
|
21
|
+
Object.defineProperty(exports, "authUserModel", { enumerable: true, get: function () { return models_2.authUserModel; } });
|
|
20
22
|
const getBaseServer = () => {
|
|
21
23
|
return (0, test_1.getBaseServer)({
|
|
22
24
|
patchOpenApiCompat: openApiCompat_1.patchAppUse,
|
|
@@ -31,3 +33,6 @@ const authAsUser = async (app, type) => {
|
|
|
31
33
|
exports.authAsUser = authAsUser;
|
|
32
34
|
var mongoTestSetup_2 = require("./tests/mongoTestSetup");
|
|
33
35
|
Object.defineProperty(exports, "loadTestData", { enumerable: true, get: function () { return mongoTestSetup_2.loadTestData; } });
|
|
36
|
+
var openApiResponseSchema_1 = require("./tests/openApiResponseSchema");
|
|
37
|
+
Object.defineProperty(exports, "expectDocumentedResponse", { enumerable: true, get: function () { return openApiResponseSchema_1.expectDocumentedResponse; } });
|
|
38
|
+
Object.defineProperty(exports, "validateDocumentedResponse", { enumerable: true, get: function () { return openApiResponseSchema_1.validateDocumentedResponse; } });
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type mongoose from "mongoose";
|
|
2
|
+
import type { FindExactlyOnePlugin, FindOneOrNonePlugin } from "../plugins";
|
|
3
|
+
import type { RequestCredential } from "../requestContext";
|
|
4
|
+
/** Outcome of one MCP tool call. */
|
|
5
|
+
export type McpRequestLogOutcome = "ok" | "tool_error" | "exception";
|
|
6
|
+
/**
|
|
7
|
+
* Metadata for one MCP tool call. Holds no tool arguments, results, or error text, since those
|
|
8
|
+
* can carry personal data.
|
|
9
|
+
*/
|
|
10
|
+
export interface McpRequestLogDocument extends mongoose.Document {
|
|
11
|
+
_id: mongoose.Types.ObjectId;
|
|
12
|
+
created: Date;
|
|
13
|
+
credential?: RequestCredential;
|
|
14
|
+
durationMs: number;
|
|
15
|
+
/** Error class name for an `exception` outcome, such as `ForbiddenError`. Never the message. */
|
|
16
|
+
errorName?: string;
|
|
17
|
+
expiresAt: Date;
|
|
18
|
+
oauthClientId?: string;
|
|
19
|
+
oauthFamilyId?: string;
|
|
20
|
+
outcome: McpRequestLogOutcome;
|
|
21
|
+
serviceTokenId?: string;
|
|
22
|
+
toolName: string;
|
|
23
|
+
updated: Date;
|
|
24
|
+
userId?: mongoose.Types.ObjectId;
|
|
25
|
+
}
|
|
26
|
+
export type McpRequestLogMethods = Record<string, never>;
|
|
27
|
+
export interface McpRequestLogStatics extends FindExactlyOnePlugin<McpRequestLogDocument>, FindOneOrNonePlugin<McpRequestLogDocument> {
|
|
28
|
+
}
|
|
29
|
+
export type McpRequestLogModel = mongoose.Model<McpRequestLogDocument> & McpRequestLogStatics;
|
|
30
|
+
export type McpRequestLogSchema = mongoose.Schema<McpRequestLogDocument, McpRequestLogModel, McpRequestLogMethods>;
|
|
31
|
+
/** Where an MCP tool comes from. */
|
|
32
|
+
export type McpToolSource = "model" | "custom";
|
|
33
|
+
/** Admin switch and registry entry for one MCP tool. A tool with no row is enabled. */
|
|
34
|
+
export interface McpToolSettingDocument extends mongoose.Document {
|
|
35
|
+
_id: mongoose.Types.ObjectId;
|
|
36
|
+
created: Date;
|
|
37
|
+
description?: string;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
/** False when the running server no longer registers this tool. */
|
|
40
|
+
registered: boolean;
|
|
41
|
+
lastRegisteredAt?: Date;
|
|
42
|
+
name: string;
|
|
43
|
+
source: McpToolSource;
|
|
44
|
+
updated: Date;
|
|
45
|
+
}
|
|
46
|
+
export type McpToolSettingMethods = Record<string, never>;
|
|
47
|
+
export interface McpToolSettingStatics extends FindExactlyOnePlugin<McpToolSettingDocument>, FindOneOrNonePlugin<McpToolSettingDocument> {
|
|
48
|
+
/** Names of tools an admin turned off. */
|
|
49
|
+
disabledNames: (this: McpToolSettingModel) => Promise<Set<string>>;
|
|
50
|
+
/** Upsert one row per registered tool and mark rows for tools that are gone. */
|
|
51
|
+
syncRegistered: (this: McpToolSettingModel, tools: Array<{
|
|
52
|
+
description: string;
|
|
53
|
+
name: string;
|
|
54
|
+
source: McpToolSource;
|
|
55
|
+
}>) => Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
export type McpToolSettingModel = mongoose.Model<McpToolSettingDocument> & McpToolSettingStatics;
|
|
58
|
+
export type McpToolSettingSchema = mongoose.Schema<McpToolSettingDocument, McpToolSettingModel, McpToolSettingMethods>;
|
package/dist/types/mcpOAuth.d.ts
CHANGED
|
@@ -127,6 +127,8 @@ interface McpOAuthTokenStatics extends FindExactlyOnePlugin<McpOAuthTokenDocumen
|
|
|
127
127
|
/** Revoke every family issued to this client. */
|
|
128
128
|
revokeClient: (this: McpOAuthTokenModel, clientId: string) => Promise<void>;
|
|
129
129
|
revokeFamily: (this: McpOAuthTokenModel, familyId: string) => Promise<void>;
|
|
130
|
+
/** Revoke every active token family the user holds. Returns how many families were revoked. */
|
|
131
|
+
revokeAllForUser: (this: McpOAuthTokenModel, userId: mongoose.Types.ObjectId | string) => Promise<number>;
|
|
130
132
|
verifyAccessToken: (this: McpOAuthTokenModel, token: string) => Promise<McpOAuthTokenDocument | null>;
|
|
131
133
|
}
|
|
132
134
|
export interface McpOAuthTokenModel extends mongoose.Model<McpOAuthTokenDocument>, McpOAuthTokenStatics {
|
|
@@ -8,7 +8,7 @@ interface McpServiceTokenMethods {
|
|
|
8
8
|
deleteOne: (this: McpServiceTokenDocument) => Promise<McpServiceTokenDocument>;
|
|
9
9
|
}
|
|
10
10
|
export interface McpServiceTokenStatics extends FindExactlyOnePlugin<McpServiceTokenDocument>, FindOneOrNonePlugin<McpServiceTokenDocument> {
|
|
11
|
-
countActiveForUser: (this: McpServiceTokenModel, userId: mongoose.Types.ObjectId) => Promise<number>;
|
|
11
|
+
countActiveForUser: (this: McpServiceTokenModel, userId: mongoose.Types.ObjectId | string) => Promise<number>;
|
|
12
12
|
issueFor: (this: McpServiceTokenModel, user: {
|
|
13
13
|
_id: {
|
|
14
14
|
toString(): string;
|
|
@@ -24,18 +24,23 @@ export interface McpServiceTokenStatics extends FindExactlyOnePlugin<McpServiceT
|
|
|
24
24
|
};
|
|
25
25
|
tokenEpoch?: number;
|
|
26
26
|
}) => Promise<void>;
|
|
27
|
+
/** Revoke every active service token the user holds. Returns how many were revoked. */
|
|
28
|
+
revokeAllForUser: (this: McpServiceTokenModel, userId: mongoose.Types.ObjectId | string) => Promise<number>;
|
|
27
29
|
revokeForUser: (this: McpServiceTokenModel, user: {
|
|
28
30
|
_id: {
|
|
29
31
|
toString(): string;
|
|
30
32
|
};
|
|
31
|
-
}, tokenId:
|
|
33
|
+
}, tokenId: string) => Promise<McpServiceTokenDocument | null>;
|
|
32
34
|
verify: (this: McpServiceTokenModel, token: string) => Promise<McpServiceTokenDocument | null>;
|
|
33
35
|
}
|
|
34
36
|
export interface McpServiceTokenModel extends mongoose.Model<McpServiceTokenDocument, object, McpServiceTokenMethods>, McpServiceTokenStatics {
|
|
35
37
|
}
|
|
36
|
-
export interface McpServiceTokenDocument extends mongoose.Document {
|
|
37
|
-
|
|
38
|
+
export interface McpServiceTokenDocument extends mongoose.Document<string> {
|
|
39
|
+
/** UUID for new rows; ObjectId hex for rows migrated by mcp-service-token-string-ids. */
|
|
40
|
+
_id: string;
|
|
38
41
|
created: Date;
|
|
42
|
+
/** Always false: a delete revokes the token instead of tombstoning it. */
|
|
43
|
+
deleted: boolean;
|
|
39
44
|
expiresAt?: Date;
|
|
40
45
|
lastUsedAt?: Date;
|
|
41
46
|
name: string;
|
|
@@ -15,5 +15,5 @@ export interface VersionCheckResponse {
|
|
|
15
15
|
* Compares client build number against admin-configured thresholds per platform.
|
|
16
16
|
*/
|
|
17
17
|
export declare class VersionCheckPlugin implements TerrenoPlugin {
|
|
18
|
-
register(app: express.Application): void;
|
|
18
|
+
register(app: express.Application, openApi?: unknown): void;
|
|
19
19
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VersionCheckPlugin = void 0;
|
|
4
4
|
const api_1 = require("./api");
|
|
5
5
|
const versionConfig_1 = require("./models/versionConfig");
|
|
6
|
+
const openApiBuilder_1 = require("./openApiBuilder");
|
|
6
7
|
const DEFAULT_WARNING_MESSAGE = "A new version is available. Please update for the best experience.";
|
|
7
8
|
const DEFAULT_REQUIRED_MESSAGE = "This version is no longer supported. Please update to continue.";
|
|
8
9
|
const DEFAULT_POLLING_INTERVAL_MINUTES = 1440;
|
|
@@ -11,8 +12,30 @@ const DEFAULT_POLLING_INTERVAL_MINUTES = 1440;
|
|
|
11
12
|
* Compares client build number against admin-configured thresholds per platform.
|
|
12
13
|
*/
|
|
13
14
|
class VersionCheckPlugin {
|
|
14
|
-
register(app) {
|
|
15
|
-
|
|
15
|
+
register(app, openApi) {
|
|
16
|
+
// Documentation only: request validation stays off so unparseable versions still get "ok".
|
|
17
|
+
const versionCheckOpenApi = (0, openApiBuilder_1.createOpenApiBuilder)(openApi ? { openApi: openApi } : {})
|
|
18
|
+
.withTags(["version"])
|
|
19
|
+
.withSummary("Check whether the client build must or should update")
|
|
20
|
+
.withQueryParameter("platform", { enum: ["web", "mobile"], type: "string" }, { description: "Client platform. Any other value is treated as web." })
|
|
21
|
+
.withQueryParameter("version", { type: "integer" }, { description: "Client build number. When missing or not a number, the status is ok." })
|
|
22
|
+
.withResponse(200, {
|
|
23
|
+
message: {
|
|
24
|
+
description: "Message to show when status is warning or required",
|
|
25
|
+
type: "string",
|
|
26
|
+
},
|
|
27
|
+
pollingIntervalMs: {
|
|
28
|
+
description: "How often the client should poll for updates, in milliseconds",
|
|
29
|
+
type: "number",
|
|
30
|
+
},
|
|
31
|
+
requiredVersion: { description: "Minimum supported build number", type: "number" },
|
|
32
|
+
status: { enum: ["ok", "warning", "required"], type: "string" },
|
|
33
|
+
updateUrl: { description: "Where the user can get the update", type: "string" },
|
|
34
|
+
warningVersion: { description: "Builds below this number get a warning", type: "number" },
|
|
35
|
+
}, { required: ["status"] })
|
|
36
|
+
.withValidation({ enabled: false })
|
|
37
|
+
.build();
|
|
38
|
+
app.get("/version-check", versionCheckOpenApi, (0, api_1.asyncHandler)(async (req, res) => {
|
|
16
39
|
const versionParam = req.query.version;
|
|
17
40
|
const platform = req.query.platform;
|
|
18
41
|
let version;
|
package/e2e/smoke.ts
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Real-process smoke for @terreno/api. Run `bun e2e/smoke.ts` after `bun run compile`.
|
|
3
|
+
*
|
|
4
|
+
* The smoke re-runs this file with `serve` as a child process: a minimal TerrenoApp built from
|
|
5
|
+
* the compiled package with one modelRouter model, on a free port, against `smokeMongoUri()`.
|
|
6
|
+
* The parent then checks over real HTTP that `/health` answers, a user can sign up, and that
|
|
7
|
+
* user can create and list a document. Exits non-zero on the first failed check.
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
freePort,
|
|
11
|
+
type SpawnedProcess,
|
|
12
|
+
smokeMongoUri,
|
|
13
|
+
spawnUntilReady,
|
|
14
|
+
stopSmokeMongo,
|
|
15
|
+
} from "@terreno/test";
|
|
16
|
+
import type express from "express";
|
|
17
|
+
import {DateTime} from "luxon";
|
|
18
|
+
import type {Schema} from "mongoose";
|
|
19
|
+
|
|
20
|
+
const SERVE_ARG = "serve";
|
|
21
|
+
|
|
22
|
+
interface SmokeWidget {
|
|
23
|
+
_id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
ownerId: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Child: the compiled API with auth, one owner-scoped model, and a health plugin. The API is
|
|
30
|
+
* imported here, not at the top, so the parent process never loads it.
|
|
31
|
+
*/
|
|
32
|
+
const serve = async (): Promise<void> => {
|
|
33
|
+
const {createdUpdatedPlugin, logger, modelRouter, OwnerQueryFilter, Permissions, TerrenoApp} =
|
|
34
|
+
await import("@terreno/api");
|
|
35
|
+
const {default: mongoose} = await import("mongoose");
|
|
36
|
+
const {default: passportLocalMongoose} = await import("passport-local-mongoose");
|
|
37
|
+
|
|
38
|
+
const userSchema = new mongoose.Schema({
|
|
39
|
+
admin: {default: false, description: "Whether the user is an admin", type: Boolean},
|
|
40
|
+
email: {description: "Sign-in email", type: String},
|
|
41
|
+
name: {description: "Display name", type: String},
|
|
42
|
+
});
|
|
43
|
+
userSchema.plugin(passportLocalMongoose as unknown as (schema: Schema, options: object) => void, {
|
|
44
|
+
usernameCaseInsensitive: true,
|
|
45
|
+
usernameField: "email",
|
|
46
|
+
});
|
|
47
|
+
userSchema.plugin(createdUpdatedPlugin);
|
|
48
|
+
const User = mongoose.model("User", userSchema);
|
|
49
|
+
|
|
50
|
+
const widgetSchema = new mongoose.Schema({
|
|
51
|
+
name: {description: "Widget name", required: true, type: String},
|
|
52
|
+
ownerId: {description: "User who owns the widget", ref: "User", type: String},
|
|
53
|
+
});
|
|
54
|
+
widgetSchema.plugin(createdUpdatedPlugin);
|
|
55
|
+
const Widget = mongoose.model("Widget", widgetSchema);
|
|
56
|
+
|
|
57
|
+
const widgetRouter = modelRouter("/widgets", Widget, {
|
|
58
|
+
permissions: {
|
|
59
|
+
create: [Permissions.IsAuthenticated],
|
|
60
|
+
delete: [],
|
|
61
|
+
list: [Permissions.IsAuthenticated],
|
|
62
|
+
read: [Permissions.IsOwner],
|
|
63
|
+
update: [],
|
|
64
|
+
},
|
|
65
|
+
preCreate: (body, req) => {
|
|
66
|
+
const user = req.user as unknown as {_id: string};
|
|
67
|
+
return {...(body as {name: string}), ownerId: String(user._id)};
|
|
68
|
+
},
|
|
69
|
+
queryFilter: OwnerQueryFilter,
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
const healthPlugin = {
|
|
73
|
+
register: (app: express.Application): void => {
|
|
74
|
+
app.get("/health", (_req, res) => {
|
|
75
|
+
res.json({healthy: mongoose.connection.readyState === 1});
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
await mongoose.connect(process.env.MONGO_URI as string);
|
|
81
|
+
const app = new TerrenoApp({
|
|
82
|
+
loggingOptions: {logRequests: false},
|
|
83
|
+
userModel: User as unknown as ConstructorParameters<typeof TerrenoApp>[0]["userModel"],
|
|
84
|
+
})
|
|
85
|
+
.register(widgetRouter)
|
|
86
|
+
.register(healthPlugin);
|
|
87
|
+
app.start();
|
|
88
|
+
await app.whenReady();
|
|
89
|
+
logger.info(`[apiSmoke] serving on port ${process.env.PORT}`);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const expectStatus = async (res: Response, status: number, step: string): Promise<unknown> => {
|
|
93
|
+
const body = await res.text();
|
|
94
|
+
if (res.status !== status) {
|
|
95
|
+
throw new Error(`${step}: expected ${status}, got ${res.status}: ${body}`);
|
|
96
|
+
}
|
|
97
|
+
return body ? JSON.parse(body) : undefined;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
/** Parent: boots the child and walks the happy path over HTTP. */
|
|
101
|
+
const run = async (): Promise<void> => {
|
|
102
|
+
const startedAt = DateTime.now();
|
|
103
|
+
const port = await freePort();
|
|
104
|
+
const baseUrl = `http://127.0.0.1:${port}`;
|
|
105
|
+
let server: SpawnedProcess | undefined;
|
|
106
|
+
|
|
107
|
+
try {
|
|
108
|
+
server = await spawnUntilReady({
|
|
109
|
+
cmd: [process.execPath, __filename, SERVE_ARG],
|
|
110
|
+
env: {
|
|
111
|
+
MONGO_URI: await smokeMongoUri({databaseName: "apiSmoke"}),
|
|
112
|
+
PORT: String(port),
|
|
113
|
+
REFRESH_TOKEN_SECRET: "api-smoke-refresh-secret",
|
|
114
|
+
SESSION_SECRET: "api-smoke-session-secret",
|
|
115
|
+
TOKEN_ISSUER: "api-smoke",
|
|
116
|
+
TOKEN_SECRET: "api-smoke-token-secret",
|
|
117
|
+
},
|
|
118
|
+
timeoutMs: 20000,
|
|
119
|
+
url: `${baseUrl}/health`,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const health = (await expectStatus(await fetch(`${baseUrl}/health`), 200, "GET /health")) as {
|
|
123
|
+
healthy: boolean;
|
|
124
|
+
};
|
|
125
|
+
if (!health.healthy) {
|
|
126
|
+
throw new Error("GET /health: server reports unhealthy");
|
|
127
|
+
}
|
|
128
|
+
console.info("✅ GET /health is healthy");
|
|
129
|
+
|
|
130
|
+
const email = `api-smoke-${startedAt.toMillis()}@example.com`;
|
|
131
|
+
const signup = (await expectStatus(
|
|
132
|
+
await fetch(`${baseUrl}/auth/signup`, {
|
|
133
|
+
body: JSON.stringify({email, password: "api-smoke-password-1"}),
|
|
134
|
+
headers: {"Content-Type": "application/json"},
|
|
135
|
+
method: "POST",
|
|
136
|
+
}),
|
|
137
|
+
200,
|
|
138
|
+
"POST /auth/signup"
|
|
139
|
+
)) as {data: {token: string; userId: string}};
|
|
140
|
+
const headers = {
|
|
141
|
+
Authorization: `Bearer ${signup.data.token}`,
|
|
142
|
+
"Content-Type": "application/json",
|
|
143
|
+
};
|
|
144
|
+
console.info("✅ POST /auth/signup returns a token");
|
|
145
|
+
|
|
146
|
+
const created = (await expectStatus(
|
|
147
|
+
await fetch(`${baseUrl}/widgets`, {
|
|
148
|
+
body: JSON.stringify({name: "Smoke widget"}),
|
|
149
|
+
headers,
|
|
150
|
+
method: "POST",
|
|
151
|
+
}),
|
|
152
|
+
201,
|
|
153
|
+
"POST /widgets"
|
|
154
|
+
)) as {data: SmokeWidget};
|
|
155
|
+
if (created.data.ownerId !== String(signup.data.userId)) {
|
|
156
|
+
throw new Error(`POST /widgets: ownerId ${created.data.ownerId} is not the new user`);
|
|
157
|
+
}
|
|
158
|
+
console.info("✅ POST /widgets creates an owned widget");
|
|
159
|
+
|
|
160
|
+
const listed = (await expectStatus(
|
|
161
|
+
await fetch(`${baseUrl}/widgets`, {headers}),
|
|
162
|
+
200,
|
|
163
|
+
"GET /widgets"
|
|
164
|
+
)) as {data: SmokeWidget[]};
|
|
165
|
+
if (!listed.data.some((widget) => widget._id === created.data._id)) {
|
|
166
|
+
throw new Error("GET /widgets: the created widget is missing from the list");
|
|
167
|
+
}
|
|
168
|
+
console.info("✅ GET /widgets lists it");
|
|
169
|
+
} catch (error: unknown) {
|
|
170
|
+
if (server) {
|
|
171
|
+
console.error(`--- server output ---\n${server.output()}`);
|
|
172
|
+
}
|
|
173
|
+
throw error;
|
|
174
|
+
} finally {
|
|
175
|
+
await server?.stop();
|
|
176
|
+
await stopSmokeMongo();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.info(`api smoke passed in ${DateTime.now().diff(startedAt).toMillis()} ms`);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
const main = process.argv[2] === SERVE_ARG ? serve : run;
|
|
183
|
+
main().then(
|
|
184
|
+
() => {
|
|
185
|
+
if (main === run) {
|
|
186
|
+
process.exit(0);
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
(error: unknown) => {
|
|
190
|
+
console.error(`❌ ${error instanceof Error ? error.message : String(error)}`);
|
|
191
|
+
process.exit(1);
|
|
192
|
+
}
|
|
193
|
+
);
|
package/package.json
CHANGED
|
@@ -7,13 +7,13 @@
|
|
|
7
7
|
"url": "https://github.com/TerrenoLabs/terreno/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@asteasolutions/zod-to-openapi": "^
|
|
10
|
+
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
11
11
|
"@better-auth/expo": "^1.6.25",
|
|
12
12
|
"@better-auth/passkey": "1.7.4",
|
|
13
13
|
"@modelcontextprotocol/node": "^2.0.0",
|
|
14
14
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
15
|
-
"@sentry/bun": "^
|
|
16
|
-
"@terreno/test": "
|
|
15
|
+
"@sentry/bun": "^11.0.0",
|
|
16
|
+
"@terreno/test": "58.0.0-beta.1",
|
|
17
17
|
"@thream/socketio-jwt": "^3.1.4",
|
|
18
18
|
"@types/qs": "^6.14.0",
|
|
19
19
|
"ajv": "8.20.0",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"serve-static": "^2.2.1",
|
|
44
44
|
"socket.io": "^4.8.1",
|
|
45
45
|
"swagger-parser": "^10.0.3",
|
|
46
|
-
"swagger-ui-dist": "^5.
|
|
46
|
+
"swagger-ui-dist": "^5.33.0",
|
|
47
47
|
"winston": "^3.18.3",
|
|
48
48
|
"yaml": "^2.4.0"
|
|
49
49
|
},
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@biomejs/biome": "^2.3.6",
|
|
53
53
|
"@modelcontextprotocol/client": "^2.0.0",
|
|
54
|
-
"@terreno/syncdb": "
|
|
54
|
+
"@terreno/syncdb": "58.0.0-beta.1",
|
|
55
55
|
"@types/bun": "^1.4.0",
|
|
56
56
|
"@types/cors": "^2.8.17",
|
|
57
57
|
"@types/express": "^5.0.6",
|
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"./testing": {
|
|
81
81
|
"default": "./dist/tests.js",
|
|
82
82
|
"types": "./dist/tests.d.ts"
|
|
83
|
+
},
|
|
84
|
+
"./testing/openApi": {
|
|
85
|
+
"default": "./dist/tests/openApiResponseSchema.js",
|
|
86
|
+
"types": "./dist/tests/openApiResponseSchema.d.ts"
|
|
83
87
|
}
|
|
84
88
|
},
|
|
85
89
|
"homepage": "https://github.com/TerrenoLabs/terreno#readme",
|
|
@@ -121,10 +125,11 @@
|
|
|
121
125
|
"compile:watch": "bun tsc -w",
|
|
122
126
|
"dev": "bun tsc -w",
|
|
123
127
|
"docs": "bunx typedoc@0.28.19 --out docs src/index.ts",
|
|
124
|
-
"lint": "biome check ./src",
|
|
125
|
-
"lint:fix": "biome check --write ./src",
|
|
128
|
+
"lint": "biome check ./src ./e2e",
|
|
129
|
+
"lint:fix": "biome check --write ./src ./e2e",
|
|
126
130
|
"lint:unsafefix": "biome check --fix --unsafe ./src",
|
|
127
131
|
"load": "bun src/sync/loadHarness.ts",
|
|
132
|
+
"smoke": "bun e2e/smoke.ts",
|
|
128
133
|
"test": "bun test --update-snapshots",
|
|
129
134
|
"test:agent": "AGENT=1 bun test --only-failures",
|
|
130
135
|
"test:cache:clean": "bun ./src/tests/mongoTestSetup.ts clean",
|
|
@@ -132,8 +137,9 @@
|
|
|
132
137
|
"test:cache:status": "bun ./src/tests/mongoTestSetup.ts status",
|
|
133
138
|
"test:ci": "bun test",
|
|
134
139
|
"test:coverage": "bun run ../scripts/check-coverage.ts",
|
|
140
|
+
"typecheck": "tsc -p tsconfig.typecheck.json",
|
|
135
141
|
"updateSnapshot": "bun test --update-snapshots"
|
|
136
142
|
},
|
|
137
143
|
"types": "dist/index.d.ts",
|
|
138
|
-
"version": "
|
|
144
|
+
"version": "58.0.0-beta.1"
|
|
139
145
|
}
|