@greensecurity/javascript-sdk 0.14.0 → 0.15.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.
Files changed (58) hide show
  1. package/bin/mcp-server.js +33 -18
  2. package/bin/mcp-server.js.map +18 -18
  3. package/funcs/organizationsGetFacility.js +1 -1
  4. package/funcs/organizationsGetFacility.js.map +1 -1
  5. package/funcs/organizationsListOrSearchFacilities.js +1 -1
  6. package/funcs/organizationsListOrSearchFacilities.js.map +1 -1
  7. package/funcs/userGetCurrentUser.js +1 -1
  8. package/funcs/userGetCurrentUser.js.map +1 -1
  9. package/funcs/userGetUserById.js +1 -1
  10. package/funcs/userGetUserById.js.map +1 -1
  11. package/funcs/userLogsUserIntoTheSystem.js +1 -1
  12. package/funcs/userLogsUserIntoTheSystem.js.map +1 -1
  13. package/funcs/userMagiclink.js +1 -1
  14. package/funcs/userMagiclink.js.map +1 -1
  15. package/funcs/userPassword.js +1 -1
  16. package/funcs/userPassword.js.map +1 -1
  17. package/funcs/userPasswordResetRequest.js +1 -1
  18. package/funcs/userPasswordResetRequest.js.map +1 -1
  19. package/funcs/vendorsCreateVendorRegistration.js +1 -1
  20. package/funcs/vendorsCreateVendorRegistration.js.map +1 -1
  21. package/funcs/vendorsListVendorJobTitles.js +1 -1
  22. package/funcs/vendorsListVendorJobTitles.js.map +1 -1
  23. package/jsr.json +1 -1
  24. package/lib/config.d.ts +3 -3
  25. package/lib/config.js +3 -3
  26. package/mcp-server/cli/start/command.d.ts.map +1 -1
  27. package/mcp-server/cli/start/command.js +9 -0
  28. package/mcp-server/cli/start/command.js.map +1 -1
  29. package/mcp-server/cli/start/impl.d.ts +1 -0
  30. package/mcp-server/cli/start/impl.d.ts.map +1 -1
  31. package/mcp-server/cli/start/impl.js +2 -0
  32. package/mcp-server/cli/start/impl.js.map +1 -1
  33. package/mcp-server/mcp-server.js +1 -1
  34. package/mcp-server/server.d.ts +1 -0
  35. package/mcp-server/server.d.ts.map +1 -1
  36. package/mcp-server/server.js +3 -2
  37. package/mcp-server/server.js.map +1 -1
  38. package/mcp-server/tools.d.ts +1 -1
  39. package/mcp-server/tools.d.ts.map +1 -1
  40. package/mcp-server/tools.js +4 -1
  41. package/mcp-server/tools.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/funcs/organizationsGetFacility.ts +1 -1
  44. package/src/funcs/organizationsListOrSearchFacilities.ts +1 -1
  45. package/src/funcs/userGetCurrentUser.ts +1 -1
  46. package/src/funcs/userGetUserById.ts +1 -1
  47. package/src/funcs/userLogsUserIntoTheSystem.ts +1 -1
  48. package/src/funcs/userMagiclink.ts +1 -1
  49. package/src/funcs/userPassword.ts +1 -1
  50. package/src/funcs/userPasswordResetRequest.ts +1 -1
  51. package/src/funcs/vendorsCreateVendorRegistration.ts +1 -1
  52. package/src/funcs/vendorsListVendorJobTitles.ts +1 -1
  53. package/src/lib/config.ts +3 -3
  54. package/src/mcp-server/cli/start/command.ts +9 -0
  55. package/src/mcp-server/cli/start/impl.ts +3 -0
  56. package/src/mcp-server/mcp-server.ts +1 -1
  57. package/src/mcp-server/server.ts +10 -2
  58. package/src/mcp-server/tools.ts +5 -0
package/bin/mcp-server.js CHANGED
@@ -34172,9 +34172,9 @@ var init_config = __esm(() => {
34172
34172
  SDK_METADATA = {
34173
34173
  language: "typescript",
34174
34174
  openapiDocVersion: "0.0.3",
34175
- sdkVersion: "0.14.0",
34176
- genVersion: "2.536.0",
34177
- userAgent: "speakeasy-sdk/typescript 0.14.0 2.536.0 0.0.3 @greensecurity/javascript-sdk"
34175
+ sdkVersion: "0.15.0",
34176
+ genVersion: "2.539.0",
34177
+ userAgent: "speakeasy-sdk/typescript 0.15.0 2.539.0 0.0.3 @greensecurity/javascript-sdk"
34178
34178
  };
34179
34179
  });
34180
34180
 
@@ -35065,8 +35065,11 @@ async function consumeSSE(value) {
35065
35065
  }
35066
35066
  return content;
35067
35067
  }
35068
- function createRegisterTool(logger, server, sdk, allowedScopes) {
35068
+ function createRegisterTool(logger, server, sdk, allowedScopes, allowedTools) {
35069
35069
  return (tool) => {
35070
+ if (allowedTools && !allowedTools.has(tool.name)) {
35071
+ return;
35072
+ }
35070
35073
  const toolScopes = tool.scopes ?? [];
35071
35074
  if (!toolScopes.every((s) => allowedScopes.has(s))) {
35072
35075
  return;
@@ -37335,7 +37338,7 @@ async function $do(client, request, options) {
37335
37338
  path,
37336
37339
  headers,
37337
37340
  body,
37338
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37341
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37339
37342
  }, options);
37340
37343
  if (!requestRes.ok) {
37341
37344
  return [requestRes, { status: "invalid" }];
@@ -37447,7 +37450,7 @@ async function $do2(client, request, options) {
37447
37450
  headers,
37448
37451
  query,
37449
37452
  body,
37450
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37453
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37451
37454
  }, options);
37452
37455
  if (!requestRes.ok) {
37453
37456
  return [requestRes, { status: "invalid" }];
@@ -37548,7 +37551,7 @@ async function $do3(client, options) {
37548
37551
  baseURL: options?.serverURL,
37549
37552
  path,
37550
37553
  headers,
37551
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37554
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37552
37555
  }, options);
37553
37556
  if (!requestRes.ok) {
37554
37557
  return [requestRes, { status: "invalid" }];
@@ -37646,7 +37649,7 @@ async function $do4(client, request, options) {
37646
37649
  path,
37647
37650
  headers,
37648
37651
  body,
37649
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37652
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37650
37653
  }, options);
37651
37654
  if (!requestRes.ok) {
37652
37655
  return [requestRes, { status: "invalid" }];
@@ -37744,7 +37747,7 @@ async function $do5(client, request, options) {
37744
37747
  path,
37745
37748
  headers,
37746
37749
  body,
37747
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37750
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37748
37751
  }, options);
37749
37752
  if (!requestRes.ok) {
37750
37753
  return [requestRes, { status: "invalid" }];
@@ -37873,7 +37876,7 @@ async function $do6(client, request, options) {
37873
37876
  path,
37874
37877
  headers,
37875
37878
  body,
37876
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37879
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37877
37880
  }, options);
37878
37881
  if (!requestRes.ok) {
37879
37882
  return [requestRes, { status: "invalid" }];
@@ -37973,7 +37976,7 @@ async function $do7(client, request, options) {
37973
37976
  path,
37974
37977
  headers,
37975
37978
  body,
37976
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
37979
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
37977
37980
  }, options);
37978
37981
  if (!requestRes.ok) {
37979
37982
  return [requestRes, { status: "invalid" }];
@@ -38074,7 +38077,7 @@ async function $do8(client, request, options) {
38074
38077
  path,
38075
38078
  headers,
38076
38079
  body,
38077
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
38080
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
38078
38081
  }, options);
38079
38082
  if (!requestRes.ok) {
38080
38083
  return [requestRes, { status: "invalid" }];
@@ -38171,7 +38174,7 @@ async function $do9(client, request, options) {
38171
38174
  path,
38172
38175
  headers,
38173
38176
  body,
38174
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
38177
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
38175
38178
  }, options);
38176
38179
  if (!requestRes.ok) {
38177
38180
  return [requestRes, { status: "invalid" }];
@@ -38274,7 +38277,7 @@ async function $do10(client, request, options) {
38274
38277
  headers,
38275
38278
  query,
38276
38279
  body,
38277
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || 30000
38280
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1
38278
38281
  }, options);
38279
38282
  if (!requestRes.ok) {
38280
38283
  return [requestRes, { status: "invalid" }];
@@ -38343,7 +38346,7 @@ List valid job titles for Vendors. This can be used during sign up or in a filte
38343
38346
  function createMCPServer(deps) {
38344
38347
  const server = new McpServer({
38345
38348
  name: "GreenSecurity",
38346
- version: "0.14.0"
38349
+ version: "0.15.0"
38347
38350
  });
38348
38351
  const client = new GreenSecurityCore({
38349
38352
  security: deps.security,
@@ -38351,7 +38354,8 @@ function createMCPServer(deps) {
38351
38354
  serverIdx: deps.serverIdx
38352
38355
  });
38353
38356
  const scopes = new Set(deps.scopes ?? mcpScopes);
38354
- const tool = createRegisterTool(deps.logger, server, client, scopes);
38357
+ const allowedTools = deps.allowedTools && new Set(deps.allowedTools);
38358
+ const tool = createRegisterTool(deps.logger, server, client, scopes, allowedTools);
38355
38359
  tool(tool$vendorsCreateVendorRegistration);
38356
38360
  tool(tool$vendorsListVendorJobTitles);
38357
38361
  tool(tool$userGetCurrentUser);
@@ -38406,6 +38410,7 @@ async function startStdio(flags) {
38406
38410
  const transport = new StdioServerTransport;
38407
38411
  const server = createMCPServer({
38408
38412
  logger,
38413
+ allowedTools: flags.tool,
38409
38414
  scopes: flags.scope,
38410
38415
  security: { token: flags["api-token"], bearerJwt: flags["bearer-jwt"] },
38411
38416
  serverURL: flags["server-url"],
@@ -38424,6 +38429,7 @@ async function startSSE(flags) {
38424
38429
  const app = import_express.default();
38425
38430
  const mcpServer = createMCPServer({
38426
38431
  logger,
38432
+ allowedTools: flags.tool,
38427
38433
  scopes: flags.scope,
38428
38434
  security: { token: flags["api-token"], bearerJwt: flags["bearer-jwt"] },
38429
38435
  serverURL: flags["server-url"],
@@ -39481,6 +39487,15 @@ var startCommand = tn({
39481
39487
  default: "2718",
39482
39488
  parse: (val) => coerce.number().int().gte(0).lt(65536).parse(val)
39483
39489
  },
39490
+ tool: {
39491
+ kind: "parsed",
39492
+ brief: "Specify tools to mount on the server",
39493
+ optional: true,
39494
+ variadic: true,
39495
+ parse: (value) => {
39496
+ return stringType().parse(value);
39497
+ }
39498
+ },
39484
39499
  ...mcpScopes.length ? {
39485
39500
  scope: {
39486
39501
  kind: "enum",
@@ -39565,7 +39580,7 @@ var routes = rn({
39565
39580
  var app = Ve(routes, {
39566
39581
  name: "mcp",
39567
39582
  versionInfo: {
39568
- currentVersion: "0.14.0"
39583
+ currentVersion: "0.15.0"
39569
39584
  }
39570
39585
  });
39571
39586
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -39573,5 +39588,5 @@ export {
39573
39588
  app
39574
39589
  };
39575
39590
 
39576
- //# debugId=1740457A9D8946D464756E2164756E21
39591
+ //# debugId=63C707221C66908E64756E2164756E21
39577
39592
  //# sourceMappingURL=mcp-server.js.map