Hello from MCP server
import { startPocketBase } from "./apiTestStartup.js";
import { check, getApi, getPb, wait, waitMs, users } from "./common.js";
import { stricklandTests } from "./strickland.js";
import { futuramaTests } from "./futurama.js";
import { tnfrLegacy } from "./tnfrLegacy.js";
import { multipleOrgMembershipTests } from "./multipleOrgMembership.js";
import { updateActiveOrgTests } from "./updateActiveOrg.js";
import { userOrgManagementTests } from "./userOrgManagement.js";
// TODO:
// Test permissions for listing and viewing orgs
// Can 'create' actions check the org ID? or no?
// Unique constraints
// Unique on org + refId for all
// ...
// Can use menu status as a way to hide menus, since we can't delete menus
// from a parent book, i.e. there is no way to know that they're "deleted",
// but an org can un publish from their version of the book.
// ...
// make sure if I publish a book that inherits from other books, the people who
// subscribe to my book don't get backdoor access to the parent books, they must
// be subscribed to those as well
let pbServer;
let pb;
function getFlags() {
const args = process.argv.slice(2);
const flags = {};
args.forEach((arg) => {
if (arg.startsWith("--")) {
const key = arg.slice(2);
flags[key] = true;
}
});
return flags;
}
async function setup() {
const flags = getFlags();
pbServer = await startPocketBase(flags);
console.log("Admin email: admin@example.com");
console.log("Admin pass: 01233456789");
}
async function teardown() {
pbServer.process.kill();
}
async function runTests() {
const HOST = `http://127.0.0.1:${pbServer.port}`;
// const HOST = `https://pricebookplatform.com`;
pb = getPb(HOST);
const api = getApi(pb);
await stricklandTests(api);
await futuramaTests(api);
await multipleOrgMembershipTests(api);
await updateActiveOrgTests(api);
await userOrgManagementTests(api);
await tnfrLegacy(api);
}
(async () => {
await setup();
await runTests();
await teardown();
})();