@greensecurity/javascript-sdk 0.9.1 → 0.11.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 +81 -16
- package/bin/mcp-server.js +39384 -0
- package/bin/mcp-server.js.map +301 -0
- package/funcs/organizationsGetFacility.d.ts +2 -1
- package/funcs/organizationsGetFacility.d.ts.map +1 -1
- package/funcs/organizationsGetFacility.js +11 -7
- package/funcs/organizationsGetFacility.js.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts +2 -1
- package/funcs/organizationsListOrSearchFacilities.d.ts.map +1 -1
- package/funcs/organizationsListOrSearchFacilities.js +11 -7
- package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
- package/funcs/userGetCurrentUser.d.ts +2 -1
- package/funcs/userGetCurrentUser.d.ts.map +1 -1
- package/funcs/userGetCurrentUser.js +10 -6
- package/funcs/userGetCurrentUser.js.map +1 -1
- package/funcs/userGetUserById.d.ts +2 -1
- package/funcs/userGetUserById.d.ts.map +1 -1
- package/funcs/userGetUserById.js +11 -7
- package/funcs/userGetUserById.js.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts +2 -1
- package/funcs/userLogsUserIntoTheSystem.d.ts.map +1 -1
- package/funcs/userLogsUserIntoTheSystem.js +11 -7
- package/funcs/userLogsUserIntoTheSystem.js.map +1 -1
- package/funcs/userMagiclink.d.ts +17 -0
- package/funcs/userMagiclink.d.ts.map +1 -0
- package/funcs/userMagiclink.js +115 -0
- package/funcs/userMagiclink.js.map +1 -0
- package/funcs/userPassword.d.ts +18 -0
- package/funcs/userPassword.d.ts.map +1 -0
- package/funcs/userPassword.js +116 -0
- package/funcs/userPassword.js.map +1 -0
- package/funcs/userPasswordResetRequest.d.ts +17 -0
- package/funcs/userPasswordResetRequest.d.ts.map +1 -0
- package/funcs/userPasswordResetRequest.js +115 -0
- package/funcs/userPasswordResetRequest.js.map +1 -0
- package/funcs/vendorsCreateVendorRegistration.d.ts +2 -1
- package/funcs/vendorsCreateVendorRegistration.d.ts.map +1 -1
- package/funcs/vendorsCreateVendorRegistration.js +11 -7
- package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
- package/funcs/vendorsListVendorJobTitles.d.ts +2 -1
- package/funcs/vendorsListVendorJobTitles.d.ts.map +1 -1
- package/funcs/vendorsListVendorJobTitles.js +11 -7
- package/funcs/vendorsListVendorJobTitles.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +5 -5
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/files.js.map +1 -1
- package/lib/sdks.d.ts +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/mcp-server/build.d.mts.map +1 -0
- package/mcp-server/build.mjs +14 -0
- package/mcp-server/build.mjs.map +1 -0
- package/mcp-server/cli/start/command.d.ts +2 -0
- package/mcp-server/cli/start/command.d.ts.map +1 -0
- package/mcp-server/cli/start/command.js +99 -0
- package/mcp-server/cli/start/command.js.map +1 -0
- package/mcp-server/cli/start/impl.d.ts +15 -0
- package/mcp-server/cli/start/impl.d.ts.map +1 -0
- package/mcp-server/cli/start/impl.js +97 -0
- package/mcp-server/cli/start/impl.js.map +1 -0
- package/mcp-server/cli.d.ts +6 -0
- package/mcp-server/cli.d.ts.map +1 -0
- package/mcp-server/cli.js +10 -0
- package/mcp-server/cli.js.map +1 -0
- package/mcp-server/console-logger.d.ts +7 -0
- package/mcp-server/console-logger.d.ts.map +1 -0
- package/mcp-server/console-logger.js +59 -0
- package/mcp-server/console-logger.js.map +1 -0
- package/mcp-server/mcp-server.d.ts +2 -0
- package/mcp-server/mcp-server.d.ts.map +1 -0
- package/mcp-server/mcp-server.js +29 -0
- package/mcp-server/mcp-server.js.map +1 -0
- package/mcp-server/resources.d.ts +27 -0
- package/mcp-server/resources.d.ts.map +1 -0
- package/mcp-server/resources.js +51 -0
- package/mcp-server/resources.js.map +1 -0
- package/mcp-server/scopes.d.ts +3 -0
- package/mcp-server/scopes.d.ts.map +1 -0
- package/mcp-server/scopes.js +8 -0
- package/mcp-server/scopes.js.map +1 -0
- package/mcp-server/server.d.ts +11 -0
- package/mcp-server/server.d.ts.map +1 -0
- package/mcp-server/server.js +44 -0
- package/mcp-server/server.js.map +1 -0
- package/mcp-server/shared.d.ts +7 -0
- package/mcp-server/shared.d.ts.map +1 -0
- package/mcp-server/shared.js +98 -0
- package/mcp-server/shared.js.map +1 -0
- package/mcp-server/tools/organizationsGetFacility.d.ts +8 -0
- package/mcp-server/tools/organizationsGetFacility.d.ts.map +1 -0
- package/mcp-server/tools/organizationsGetFacility.js +64 -0
- package/mcp-server/tools/organizationsGetFacility.js.map +1 -0
- package/mcp-server/tools/organizationsListOrSearchFacilities.d.ts +8 -0
- package/mcp-server/tools/organizationsListOrSearchFacilities.d.ts.map +1 -0
- package/mcp-server/tools/organizationsListOrSearchFacilities.js +77 -0
- package/mcp-server/tools/organizationsListOrSearchFacilities.js.map +1 -0
- package/mcp-server/tools/userGetCurrentUser.d.ts +3 -0
- package/mcp-server/tools/userGetCurrentUser.d.ts.map +1 -0
- package/mcp-server/tools/userGetCurrentUser.js +26 -0
- package/mcp-server/tools/userGetCurrentUser.js.map +1 -0
- package/mcp-server/tools/userGetUserById.d.ts +8 -0
- package/mcp-server/tools/userGetUserById.d.ts.map +1 -0
- package/mcp-server/tools/userGetUserById.js +64 -0
- package/mcp-server/tools/userGetUserById.js.map +1 -0
- package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts +8 -0
- package/mcp-server/tools/userLogsUserIntoTheSystem.d.ts.map +1 -0
- package/mcp-server/tools/userLogsUserIntoTheSystem.js +94 -0
- package/mcp-server/tools/userLogsUserIntoTheSystem.js.map +1 -0
- package/mcp-server/tools/userMagiclink.d.ts +8 -0
- package/mcp-server/tools/userMagiclink.d.ts.map +1 -0
- package/mcp-server/tools/userMagiclink.js +64 -0
- package/mcp-server/tools/userMagiclink.js.map +1 -0
- package/mcp-server/tools/userPassword.d.ts +8 -0
- package/mcp-server/tools/userPassword.d.ts.map +1 -0
- package/mcp-server/tools/userPassword.js +65 -0
- package/mcp-server/tools/userPassword.js.map +1 -0
- package/mcp-server/tools/userPasswordResetRequest.d.ts +8 -0
- package/mcp-server/tools/userPasswordResetRequest.d.ts.map +1 -0
- package/mcp-server/tools/userPasswordResetRequest.js +64 -0
- package/mcp-server/tools/userPasswordResetRequest.js.map +1 -0
- package/mcp-server/tools/vendorsCreateVendorRegistration.d.ts +8 -0
- package/mcp-server/tools/vendorsCreateVendorRegistration.d.ts.map +1 -0
- package/mcp-server/tools/vendorsCreateVendorRegistration.js +64 -0
- package/mcp-server/tools/vendorsCreateVendorRegistration.js.map +1 -0
- package/mcp-server/tools/vendorsListVendorJobTitles.d.ts +8 -0
- package/mcp-server/tools/vendorsListVendorJobTitles.d.ts.map +1 -0
- package/mcp-server/tools/vendorsListVendorJobTitles.js +64 -0
- package/mcp-server/tools/vendorsListVendorJobTitles.js.map +1 -0
- package/mcp-server/tools.d.ts +25 -0
- package/mcp-server/tools.d.ts.map +1 -0
- package/mcp-server/tools.js +74 -0
- package/mcp-server/tools.js.map +1 -0
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/magiclink.d.ts +57 -0
- package/models/operations/magiclink.d.ts.map +1 -0
- package/models/operations/magiclink.js +96 -0
- package/models/operations/magiclink.js.map +1 -0
- package/models/operations/password.d.ts +59 -0
- package/models/operations/password.d.ts.map +1 -0
- package/models/operations/password.js +107 -0
- package/models/operations/password.js.map +1 -0
- package/models/operations/passwordresetrequest.d.ts +57 -0
- package/models/operations/passwordresetrequest.d.ts.map +1 -0
- package/models/operations/passwordresetrequest.js +96 -0
- package/models/operations/passwordresetrequest.js.map +1 -0
- package/package.json +14 -2
- package/react-query/index.d.ts +3 -0
- package/react-query/index.d.ts.map +1 -1
- package/react-query/index.js +3 -0
- package/react-query/index.js.map +1 -1
- package/react-query/userMagiclink.d.ts +23 -0
- package/react-query/userMagiclink.d.ts.map +1 -0
- package/react-query/userMagiclink.js +47 -0
- package/react-query/userMagiclink.js.map +1 -0
- package/react-query/userPassword.d.ts +24 -0
- package/react-query/userPassword.d.ts.map +1 -0
- package/react-query/userPassword.js +48 -0
- package/react-query/userPassword.js.map +1 -0
- package/react-query/userPasswordResetRequest.d.ts +23 -0
- package/react-query/userPasswordResetRequest.d.ts.map +1 -0
- package/react-query/userPasswordResetRequest.js +47 -0
- package/react-query/userPasswordResetRequest.js.map +1 -0
- package/sdk/user.d.ts +22 -0
- package/sdk/user.d.ts.map +1 -1
- package/sdk/user.js +31 -0
- package/sdk/user.js.map +1 -1
- package/src/funcs/organizationsGetFacility.ts +37 -8
- package/src/funcs/organizationsListOrSearchFacilities.ts +35 -8
- package/src/funcs/userGetCurrentUser.ts +33 -7
- package/src/funcs/userGetUserById.ts +36 -8
- package/src/funcs/userLogsUserIntoTheSystem.ts +36 -8
- package/src/funcs/userMagiclink.ts +162 -0
- package/src/funcs/userPassword.ts +163 -0
- package/src/funcs/userPasswordResetRequest.ts +163 -0
- package/src/funcs/vendorsCreateVendorRegistration.ts +36 -8
- package/src/funcs/vendorsListVendorJobTitles.ts +37 -8
- package/src/lib/config.ts +5 -5
- package/src/lib/files.ts +1 -1
- package/src/lib/sdks.ts +1 -1
- package/src/mcp-server/cli/start/command.ts +67 -0
- package/src/mcp-server/cli/start/impl.ts +123 -0
- package/src/mcp-server/cli.ts +13 -0
- package/src/mcp-server/console-logger.ts +71 -0
- package/src/mcp-server/mcp-server.ts +26 -0
- package/src/mcp-server/resources.ts +96 -0
- package/src/mcp-server/scopes.ts +7 -0
- package/src/mcp-server/server.ts +52 -0
- package/src/mcp-server/shared.ts +75 -0
- package/src/mcp-server/tools/organizationsGetFacility.ts +37 -0
- package/src/mcp-server/tools/organizationsListOrSearchFacilities.ts +52 -0
- package/src/mcp-server/tools/userGetCurrentUser.ts +30 -0
- package/src/mcp-server/tools/userGetUserById.ts +37 -0
- package/src/mcp-server/tools/userLogsUserIntoTheSystem.ts +67 -0
- package/src/mcp-server/tools/userMagiclink.ts +37 -0
- package/src/mcp-server/tools/userPassword.ts +38 -0
- package/src/mcp-server/tools/userPasswordResetRequest.ts +37 -0
- package/src/mcp-server/tools/vendorsCreateVendorRegistration.ts +38 -0
- package/src/mcp-server/tools/vendorsListVendorJobTitles.ts +37 -0
- package/src/mcp-server/tools.ts +116 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/magiclink.ts +127 -0
- package/src/models/operations/password.ts +140 -0
- package/src/models/operations/passwordresetrequest.ts +131 -0
- package/src/react-query/index.ts +3 -0
- package/src/react-query/userMagiclink.ts +88 -0
- package/src/react-query/userPassword.ts +89 -0
- package/src/react-query/userPasswordResetRequest.ts +89 -0
- package/src/sdk/user.ts +55 -0
- package/src/types/async.ts +68 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
- package/.devcontainer/README.md +0 -35
- package/docs/sdks/greensecurity/README.md +0 -14
- package/docs/sdks/organizations/README.md +0 -252
- package/docs/sdks/user/README.md +0 -348
- package/docs/sdks/vendors/README.md +0 -219
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.createMCPServer = createMCPServer;
|
|
7
|
+
const mcp_js_1 = require("@modelcontextprotocol/sdk/server/mcp.js");
|
|
8
|
+
const core_js_1 = require("../core.js");
|
|
9
|
+
const scopes_js_1 = require("./scopes.js");
|
|
10
|
+
const tools_js_1 = require("./tools.js");
|
|
11
|
+
const organizationsGetFacility_js_1 = require("./tools/organizationsGetFacility.js");
|
|
12
|
+
const organizationsListOrSearchFacilities_js_1 = require("./tools/organizationsListOrSearchFacilities.js");
|
|
13
|
+
const userGetCurrentUser_js_1 = require("./tools/userGetCurrentUser.js");
|
|
14
|
+
const userGetUserById_js_1 = require("./tools/userGetUserById.js");
|
|
15
|
+
const userLogsUserIntoTheSystem_js_1 = require("./tools/userLogsUserIntoTheSystem.js");
|
|
16
|
+
const userMagiclink_js_1 = require("./tools/userMagiclink.js");
|
|
17
|
+
const userPassword_js_1 = require("./tools/userPassword.js");
|
|
18
|
+
const userPasswordResetRequest_js_1 = require("./tools/userPasswordResetRequest.js");
|
|
19
|
+
const vendorsCreateVendorRegistration_js_1 = require("./tools/vendorsCreateVendorRegistration.js");
|
|
20
|
+
const vendorsListVendorJobTitles_js_1 = require("./tools/vendorsListVendorJobTitles.js");
|
|
21
|
+
function createMCPServer(deps) {
|
|
22
|
+
const server = new mcp_js_1.McpServer({
|
|
23
|
+
name: "GreenSecurity",
|
|
24
|
+
version: "0.11.0",
|
|
25
|
+
});
|
|
26
|
+
const client = new core_js_1.GreenSecurityCore({
|
|
27
|
+
serverURL: deps.serverURL,
|
|
28
|
+
serverIdx: deps.serverIdx,
|
|
29
|
+
});
|
|
30
|
+
const scopes = new Set(deps.scopes ?? scopes_js_1.mcpScopes);
|
|
31
|
+
const tool = (0, tools_js_1.createRegisterTool)(deps.logger, server, client, scopes);
|
|
32
|
+
tool(vendorsCreateVendorRegistration_js_1.tool$vendorsCreateVendorRegistration);
|
|
33
|
+
tool(vendorsListVendorJobTitles_js_1.tool$vendorsListVendorJobTitles);
|
|
34
|
+
tool(userGetCurrentUser_js_1.tool$userGetCurrentUser);
|
|
35
|
+
tool(userGetUserById_js_1.tool$userGetUserById);
|
|
36
|
+
tool(userLogsUserIntoTheSystem_js_1.tool$userLogsUserIntoTheSystem);
|
|
37
|
+
tool(userMagiclink_js_1.tool$userMagiclink);
|
|
38
|
+
tool(userPasswordResetRequest_js_1.tool$userPasswordResetRequest);
|
|
39
|
+
tool(userPassword_js_1.tool$userPassword);
|
|
40
|
+
tool(organizationsListOrSearchFacilities_js_1.tool$organizationsListOrSearchFacilities);
|
|
41
|
+
tool(organizationsGetFacility_js_1.tool$organizationsGetFacility);
|
|
42
|
+
return server;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/mcp-server/server.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAmBH,0CA8BC;AA/CD,oEAAoE;AACpE,wCAA+C;AAG/C,2CAAkD;AAClD,yCAAgD;AAChD,qFAAoF;AACpF,2GAA0G;AAC1G,yEAAwE;AACxE,mEAAkE;AAClE,uFAAsF;AACtF,+DAA8D;AAC9D,6DAA4D;AAC5D,qFAAoF;AACpF,mGAAkG;AAClG,yFAAwF;AAExF,SAAgB,eAAe,CAAC,IAK/B;IACC,MAAM,MAAM,GAAG,IAAI,kBAAS,CAAC;QAC3B,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,QAAQ;KAClB,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,IAAI,2BAAiB,CAAC;QACnC,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,qBAAS,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,IAAA,6BAAkB,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAErE,IAAI,CAAC,yEAAoC,CAAC,CAAC;IAC3C,IAAI,CAAC,+DAA+B,CAAC,CAAC;IACtC,IAAI,CAAC,+CAAuB,CAAC,CAAC;IAC9B,IAAI,CAAC,yCAAoB,CAAC,CAAC;IAC3B,IAAI,CAAC,6DAA8B,CAAC,CAAC;IACrC,IAAI,CAAC,qCAAkB,CAAC,CAAC;IACzB,IAAI,CAAC,2DAA6B,CAAC,CAAC;IACpC,IAAI,CAAC,mCAAiB,CAAC,CAAC;IACxB,IAAI,CAAC,iFAAwC,CAAC,CAAC;IAC/C,IAAI,CAAC,2DAA6B,CAAC,CAAC;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type BinaryData = Uint8Array | ArrayBuffer | Blob | ReadableStream | Response | string;
|
|
2
|
+
export declare function consumeStream(stream: ReadableStream<Uint8Array>): Promise<Uint8Array>;
|
|
3
|
+
export declare function isAsyncIterable(value: unknown): value is AsyncIterable<string>;
|
|
4
|
+
export declare function isBinaryData(value: unknown): value is BinaryData;
|
|
5
|
+
export declare function valueToBase64(value: BinaryData | null | undefined): Promise<string | null>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/mcp-server/shared.ts"],"names":[],"mappings":"AAOA,KAAK,UAAU,GACX,UAAU,GACV,WAAW,GACX,IAAI,GACJ,cAAc,GACd,QAAQ,GACR,MAAM,CAAC;AAEX,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,OAAO,CAAC,UAAU,CAAC,CAerB;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,aAAa,CAAC,MAAM,CAAC,CAIhC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAShE;AAID,wBAAsB,aAAa,CACjC,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GACnC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiBxB"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.consumeStream = consumeStream;
|
|
40
|
+
exports.isAsyncIterable = isAsyncIterable;
|
|
41
|
+
exports.isBinaryData = isBinaryData;
|
|
42
|
+
exports.valueToBase64 = valueToBase64;
|
|
43
|
+
const z = __importStar(require("zod"));
|
|
44
|
+
const base64_js_1 = require("../lib/base64.js");
|
|
45
|
+
async function consumeStream(stream) {
|
|
46
|
+
const reader = stream.getReader();
|
|
47
|
+
const chunks = [];
|
|
48
|
+
try {
|
|
49
|
+
while (true) {
|
|
50
|
+
const { done, value } = await reader.read();
|
|
51
|
+
if (value != null)
|
|
52
|
+
chunks.push(value);
|
|
53
|
+
if (done)
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
reader.releaseLock();
|
|
59
|
+
}
|
|
60
|
+
return new Uint8Array(await new Blob(chunks).arrayBuffer());
|
|
61
|
+
}
|
|
62
|
+
function isAsyncIterable(value) {
|
|
63
|
+
return (typeof value === "object" && value != null && Symbol.asyncIterator in value);
|
|
64
|
+
}
|
|
65
|
+
function isBinaryData(value) {
|
|
66
|
+
return (value instanceof Uint8Array
|
|
67
|
+
|| value instanceof ArrayBuffer
|
|
68
|
+
|| value instanceof Blob
|
|
69
|
+
|| value instanceof ReadableStream
|
|
70
|
+
|| value instanceof Response
|
|
71
|
+
|| typeof value === "string");
|
|
72
|
+
}
|
|
73
|
+
const base64Schema = z.string().base64();
|
|
74
|
+
async function valueToBase64(value) {
|
|
75
|
+
if (value == null) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
else if (value instanceof Uint8Array) {
|
|
79
|
+
return (0, base64_js_1.bytesToBase64)(value);
|
|
80
|
+
}
|
|
81
|
+
else if (value instanceof ArrayBuffer) {
|
|
82
|
+
return (0, base64_js_1.bytesToBase64)(new Uint8Array(value));
|
|
83
|
+
}
|
|
84
|
+
else if (value instanceof Response || value instanceof Blob) {
|
|
85
|
+
return (0, base64_js_1.bytesToBase64)(new Uint8Array(await value.arrayBuffer()));
|
|
86
|
+
}
|
|
87
|
+
else if (value instanceof ReadableStream) {
|
|
88
|
+
return (0, base64_js_1.bytesToBase64)(await consumeStream(value));
|
|
89
|
+
}
|
|
90
|
+
else if (typeof value === "string") {
|
|
91
|
+
return base64Schema.parse(value);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
value;
|
|
95
|
+
throw new Error(`Unsupported image value type: ${typeof value}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/mcp-server/shared.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaH,sCAiBC;AAED,0CAMC;AAED,oCASC;AAID,sCAmBC;AAtED,uCAAyB;AACzB,gDAAiD;AAU1C,KAAK,UAAU,aAAa,CACjC,MAAkC;IAElC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;IAClC,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,IAAI,CAAC;QACH,OAAO,IAAI,EAAE,CAAC;YACZ,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YAC5C,IAAI,KAAK,IAAI,IAAI;gBAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,IAAI,IAAI;gBAAE,MAAM;QAClB,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,OAAO,IAAI,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,SAAgB,eAAe,CAC7B,KAAc;IAEd,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,MAAM,CAAC,aAAa,IAAI,KAAK,CAC5E,CAAC;AACJ,CAAC;AAED,SAAgB,YAAY,CAAC,KAAc;IACzC,OAAO,CACL,KAAK,YAAY,UAAU;WACxB,KAAK,YAAY,WAAW;WAC5B,KAAK,YAAY,IAAI;WACrB,KAAK,YAAY,cAAc;WAC/B,KAAK,YAAY,QAAQ;WACzB,OAAO,KAAK,KAAK,QAAQ,CAC7B,CAAC;AACJ,CAAC;AAED,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC;AAElC,KAAK,UAAU,aAAa,CACjC,KAAoC;IAEpC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,IAAI,KAAK,YAAY,UAAU,EAAE,CAAC;QACvC,OAAO,IAAA,yBAAa,EAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;SAAM,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACxC,OAAO,IAAA,yBAAa,EAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IAC9C,CAAC;SAAM,IAAI,KAAK,YAAY,QAAQ,IAAI,KAAK,YAAY,IAAI,EAAE,CAAC;QAC9D,OAAO,IAAA,yBAAa,EAAC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAClE,CAAC;SAAM,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QAC3C,OAAO,IAAA,yBAAa,EAAC,MAAM,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IACnD,CAAC;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;SAAM,CAAC;QACN,KAAqB,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,iCAAiC,OAAO,KAAK,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as operations from "../../models/operations/index.js";
|
|
2
|
+
import { ToolDefinition } from "../tools.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
request: import("zod").ZodType<operations.GetFacilityRequest, import("zod").ZodTypeDef, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const tool$organizationsGetFacility: ToolDefinition<typeof args>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=organizationsGetFacility.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationsGetFacility.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/organizationsGetFacility.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,cAAc,CAAC,OAAO,IAAI,CAwBrE,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.tool$organizationsGetFacility = void 0;
|
|
40
|
+
const organizationsGetFacility_js_1 = require("../../funcs/organizationsGetFacility.js");
|
|
41
|
+
const operations = __importStar(require("../../models/operations/index.js"));
|
|
42
|
+
const tools_js_1 = require("../tools.js");
|
|
43
|
+
const args = {
|
|
44
|
+
request: operations.GetFacilityRequest$inboundSchema,
|
|
45
|
+
};
|
|
46
|
+
exports.tool$organizationsGetFacility = {
|
|
47
|
+
name: "organizations_get-facility",
|
|
48
|
+
description: `Get facility
|
|
49
|
+
|
|
50
|
+
Retrieve an individual facility.`,
|
|
51
|
+
args,
|
|
52
|
+
tool: async (client, args, ctx) => {
|
|
53
|
+
const [result, apiCall] = await (0, organizationsGetFacility_js_1.organizationsGetFacility)(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
54
|
+
if (!result.ok) {
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text: result.error.message }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const value = result.value;
|
|
61
|
+
return (0, tools_js_1.formatResult)(value, apiCall);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=organizationsGetFacility.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationsGetFacility.js","sourceRoot":"","sources":["../../src/mcp-server/tools/organizationsGetFacility.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,yFAAmF;AACnF,6EAA+D;AAC/D,0CAA2D;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,gCAAgC;CACrD,CAAC;AAEW,QAAA,6BAA6B,GAAgC;IACxE,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE;;iCAEkB;IAC/B,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,sDAAwB,EACtD,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as operations from "../../models/operations/index.js";
|
|
2
|
+
import { ToolDefinition } from "../tools.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
request: import("zod").ZodType<operations.ListOrSearchFacilitiesRequest, import("zod").ZodTypeDef, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const tool$organizationsListOrSearchFacilities: ToolDefinition<typeof args>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=organizationsListOrSearchFacilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationsListOrSearchFacilities.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/organizationsListOrSearchFacilities.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,wCAAwC,EAAE,cAAc,CACnE,OAAO,IAAI,CAsCZ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.tool$organizationsListOrSearchFacilities = void 0;
|
|
40
|
+
const organizationsListOrSearchFacilities_js_1 = require("../../funcs/organizationsListOrSearchFacilities.js");
|
|
41
|
+
const operations = __importStar(require("../../models/operations/index.js"));
|
|
42
|
+
const tools_js_1 = require("../tools.js");
|
|
43
|
+
const args = {
|
|
44
|
+
request: operations.ListOrSearchFacilitiesRequest$inboundSchema,
|
|
45
|
+
};
|
|
46
|
+
exports.tool$organizationsListOrSearchFacilities = {
|
|
47
|
+
name: "organizations_list-or-search-facilities",
|
|
48
|
+
description: `List or search facilities
|
|
49
|
+
|
|
50
|
+
List or search facilities.
|
|
51
|
+
|
|
52
|
+
Available \`expand\` scopes are:
|
|
53
|
+
|
|
54
|
+
- facility.appointment_policy
|
|
55
|
+
- facility.contacts
|
|
56
|
+
- facility.vendor_counts
|
|
57
|
+
- facility.flu_credential
|
|
58
|
+
- facility.scrubs_policy
|
|
59
|
+
- facility.system
|
|
60
|
+
- facility.vendor_guest_policy
|
|
61
|
+
- facility.vendor_policy
|
|
62
|
+
- facility.visitor_policy
|
|
63
|
+
- facility.workflow`,
|
|
64
|
+
args,
|
|
65
|
+
tool: async (client, args, ctx) => {
|
|
66
|
+
const [result, apiCall] = await (0, organizationsListOrSearchFacilities_js_1.organizationsListOrSearchFacilities)(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
67
|
+
if (!result.ok) {
|
|
68
|
+
return {
|
|
69
|
+
content: [{ type: "text", text: result.error.message }],
|
|
70
|
+
isError: true,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
const value = result.value;
|
|
74
|
+
return (0, tools_js_1.formatResult)(value, apiCall);
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=organizationsListOrSearchFacilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizationsListOrSearchFacilities.js","sourceRoot":"","sources":["../../src/mcp-server/tools/organizationsListOrSearchFacilities.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+GAAyG;AACzG,6EAA+D;AAC/D,0CAA2D;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,2CAA2C;CAChE,CAAC;AAEW,QAAA,wCAAwC,GAEjD;IACF,IAAI,EAAE,yCAAyC;IAC/C,WAAW,EAAE;;;;;;;;;;;;;;;oBAeK;IAClB,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,4EAAmC,EACjE,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetCurrentUser.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/userGetCurrentUser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,eAAO,MAAM,uBAAuB,EAAE,cAsBrC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.tool$userGetCurrentUser = void 0;
|
|
7
|
+
const userGetCurrentUser_js_1 = require("../../funcs/userGetCurrentUser.js");
|
|
8
|
+
const tools_js_1 = require("../tools.js");
|
|
9
|
+
exports.tool$userGetCurrentUser = {
|
|
10
|
+
name: "user_get-current-user",
|
|
11
|
+
description: `Get current user
|
|
12
|
+
|
|
13
|
+
Returns a user object for the user represented by the authorization token`,
|
|
14
|
+
tool: async (client, ctx) => {
|
|
15
|
+
const [result, apiCall] = await (0, userGetCurrentUser_js_1.userGetCurrentUser)(client, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
16
|
+
if (!result.ok) {
|
|
17
|
+
return {
|
|
18
|
+
content: [{ type: "text", text: result.error.message }],
|
|
19
|
+
isError: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const value = result.value;
|
|
23
|
+
return (0, tools_js_1.formatResult)(value, apiCall);
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=userGetCurrentUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetCurrentUser.js","sourceRoot":"","sources":["../../src/mcp-server/tools/userGetCurrentUser.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,6EAAuE;AACvE,0CAA2D;AAE9C,QAAA,uBAAuB,GAAmB;IACrD,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE;;0EAE2D;IACxE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE;QAC1B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,0CAAkB,EAChD,MAAM,EACN,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as operations from "../../models/operations/index.js";
|
|
2
|
+
import { ToolDefinition } from "../tools.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
request: import("zod").ZodType<operations.GetUserByIdRequest, import("zod").ZodTypeDef, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const tool$userGetUserById: ToolDefinition<typeof args>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=userGetUserById.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetUserById.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/userGetUserById.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,OAAO,IAAI,CAwB5D,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.tool$userGetUserById = void 0;
|
|
40
|
+
const userGetUserById_js_1 = require("../../funcs/userGetUserById.js");
|
|
41
|
+
const operations = __importStar(require("../../models/operations/index.js"));
|
|
42
|
+
const tools_js_1 = require("../tools.js");
|
|
43
|
+
const args = {
|
|
44
|
+
request: operations.GetUserByIdRequest$inboundSchema,
|
|
45
|
+
};
|
|
46
|
+
exports.tool$userGetUserById = {
|
|
47
|
+
name: "user_get-user-by-id",
|
|
48
|
+
description: `Get user by id
|
|
49
|
+
|
|
50
|
+
Returns a user object for the user represented by the identifier in the path.`,
|
|
51
|
+
args,
|
|
52
|
+
tool: async (client, args, ctx) => {
|
|
53
|
+
const [result, apiCall] = await (0, userGetUserById_js_1.userGetUserById)(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
54
|
+
if (!result.ok) {
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text: result.error.message }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const value = result.value;
|
|
61
|
+
return (0, tools_js_1.formatResult)(value, apiCall);
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=userGetUserById.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userGetUserById.js","sourceRoot":"","sources":["../../src/mcp-server/tools/userGetUserById.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uEAAiE;AACjE,6EAA+D;AAC/D,0CAA2D;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,gCAAgC;CACrD,CAAC;AAEW,QAAA,oBAAoB,GAAgC;IAC/D,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE;;8EAE+D;IAC5E,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,oCAAe,EAC7C,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as operations from "../../models/operations/index.js";
|
|
2
|
+
import { ToolDefinition } from "../tools.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
request: import("zod").ZodType<operations.LogsUserIntoTheSystemRequestBody, import("zod").ZodTypeDef, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const tool$userLogsUserIntoTheSystem: ToolDefinition<typeof args>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=userLogsUserIntoTheSystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userLogsUserIntoTheSystem.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/userLogsUserIntoTheSystem.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAAC,OAAO,IAAI,CAsDtE,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.tool$userLogsUserIntoTheSystem = void 0;
|
|
40
|
+
const userLogsUserIntoTheSystem_js_1 = require("../../funcs/userLogsUserIntoTheSystem.js");
|
|
41
|
+
const operations = __importStar(require("../../models/operations/index.js"));
|
|
42
|
+
const tools_js_1 = require("../tools.js");
|
|
43
|
+
const args = {
|
|
44
|
+
request: operations.LogsUserIntoTheSystemRequestBody$inboundSchema,
|
|
45
|
+
};
|
|
46
|
+
exports.tool$userLogsUserIntoTheSystem = {
|
|
47
|
+
name: "user_logs-user-into-the-system",
|
|
48
|
+
description: `Logs user into the system
|
|
49
|
+
|
|
50
|
+
This endpoint allows a user to authenticate themselves and retrieve a permanent token for access.
|
|
51
|
+
|
|
52
|
+
Permanent tokens should only ever be stored in an encrypted storage because they represent a fully logged in user.
|
|
53
|
+
|
|
54
|
+
Users may log in with \`email/password\`, \`SAML\`, \`magic link\` or \`mfa\`. The application should handle all of the above as equally valid login methods.
|
|
55
|
+
|
|
56
|
+
The most common way to authenticate a user is to log in with an email and password. If the user provides valid credentials, the server will either respond with a full user object including the token.
|
|
57
|
+
|
|
58
|
+
When the user's account is protected via MFA, the server will send a 6 digit code to the user via their default MFA provider. You should collect that code and resend the email, password and mfa_code together to get a successful authentication.
|
|
59
|
+
|
|
60
|
+
The ideal flow for a login sequence is the following:
|
|
61
|
+
|
|
62
|
+
1. Present an email address field only and allow the user to submit
|
|
63
|
+
2. Send \`email\` and \`return_url\` payload to this endpoint
|
|
64
|
+
3. Follow the flow based on the response \`requires\` field
|
|
65
|
+
|
|
66
|
+
Requires: \`password\`
|
|
67
|
+
|
|
68
|
+
1. Show a password field for the user to fill out
|
|
69
|
+
2. Submit the \`email\` and \`password\` to this endpoint
|
|
70
|
+
3. If the response is \`200\`, the login is done. If the response is \`201\`, then check if \`requires: mfa_code\` is returned and show MFA flow
|
|
71
|
+
4. Submit \`email\`, \`password\`, \`mfa_code\` to this endpoint
|
|
72
|
+
5. If the response is \`200\`, the login is done. Otherwise, show the appropriate error to the user and go back to step 1 or 3 depending on the error.
|
|
73
|
+
|
|
74
|
+
Requires: \`saml_login\`
|
|
75
|
+
|
|
76
|
+
1. [Open a browser](https://docs.expo.dev/versions/latest/sdk/webbrowser/#webbrowseropenauthsessionasyncurl-redirecturl-options) to the url returned in \`sso_url\`
|
|
77
|
+
2. User completes sign-in using their configured SAML IdP
|
|
78
|
+
3. Site redirects to your selected \`return_url\`
|
|
79
|
+
4. The \`user_token\` will be appended as a query string parameter to your \`return_url\` - you must parse this token and store it
|
|
80
|
+
5. Fetch the user object from \`/users/me\` using the token`,
|
|
81
|
+
args,
|
|
82
|
+
tool: async (client, args, ctx) => {
|
|
83
|
+
const [result, apiCall] = await (0, userLogsUserIntoTheSystem_js_1.userLogsUserIntoTheSystem)(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
84
|
+
if (!result.ok) {
|
|
85
|
+
return {
|
|
86
|
+
content: [{ type: "text", text: result.error.message }],
|
|
87
|
+
isError: true,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const value = result.value;
|
|
91
|
+
return (0, tools_js_1.formatResult)(value, apiCall);
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=userLogsUserIntoTheSystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userLogsUserIntoTheSystem.js","sourceRoot":"","sources":["../../src/mcp-server/tools/userLogsUserIntoTheSystem.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2FAAqF;AACrF,6EAA+D;AAC/D,0CAA2D;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,8CAA8C;CACnE,CAAC;AAEW,QAAA,8BAA8B,GAAgC;IACzE,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4DAgC6C;IAC1D,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,IAAA,wDAAyB,EACvD,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEb,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,IAAA,uBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as operations from "../../models/operations/index.js";
|
|
2
|
+
import { ToolDefinition } from "../tools.js";
|
|
3
|
+
declare const args: {
|
|
4
|
+
request: import("zod").ZodType<operations.MagiclinkRequestBody, import("zod").ZodTypeDef, unknown>;
|
|
5
|
+
};
|
|
6
|
+
export declare const tool$userMagiclink: ToolDefinition<typeof args>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=userMagiclink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"userMagiclink.d.ts","sourceRoot":"","sources":["../../src/mcp-server/tools/userMagiclink.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAgB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE3D,QAAA,MAAM,IAAI;;CAET,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,cAAc,CAAC,OAAO,IAAI,CAwB1D,CAAC"}
|