@inkeep/agents-work-apps 0.0.0-dev-20260204182014 → 0.0.0-dev-20260204185956

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 (72) hide show
  1. package/dist/db/index.d.ts +1 -2
  2. package/dist/db/index.js +1 -2
  3. package/dist/db/runDbClient.d.ts +2 -2
  4. package/dist/env.d.ts +0 -22
  5. package/dist/env.js +1 -12
  6. package/dist/github/index.d.ts +3 -3
  7. package/dist/github/mcp/index.d.ts +2 -2
  8. package/dist/github/mcp/schemas.d.ts +1 -1
  9. package/dist/github/routes/setup.d.ts +2 -2
  10. package/dist/github/routes/tokenExchange.d.ts +2 -2
  11. package/dist/github/routes/webhooks.d.ts +2 -2
  12. package/package.json +2 -10
  13. package/dist/db/manageDbClient.d.ts +0 -7
  14. package/dist/db/manageDbClient.js +0 -16
  15. package/dist/slack/index.d.ts +0 -19
  16. package/dist/slack/index.js +0 -29
  17. package/dist/slack/middleware/permissions.d.ts +0 -16
  18. package/dist/slack/middleware/permissions.js +0 -49
  19. package/dist/slack/routes/events.d.ts +0 -10
  20. package/dist/slack/routes/events.js +0 -319
  21. package/dist/slack/routes/index.d.ts +0 -11
  22. package/dist/slack/routes/index.js +0 -64
  23. package/dist/slack/routes/internal.d.ts +0 -10
  24. package/dist/slack/routes/internal.js +0 -107
  25. package/dist/slack/routes/oauth.d.ts +0 -12
  26. package/dist/slack/routes/oauth.js +0 -218
  27. package/dist/slack/routes/resources.d.ts +0 -10
  28. package/dist/slack/routes/resources.js +0 -163
  29. package/dist/slack/routes/users.d.ts +0 -15
  30. package/dist/slack/routes/users.js +0 -430
  31. package/dist/slack/routes/workspaces.d.ts +0 -10
  32. package/dist/slack/routes/workspaces.js +0 -828
  33. package/dist/slack/routes.d.ts +0 -7
  34. package/dist/slack/routes.js +0 -12
  35. package/dist/slack/services/agent-resolution.d.ts +0 -49
  36. package/dist/slack/services/agent-resolution.js +0 -135
  37. package/dist/slack/services/api-client.d.ts +0 -161
  38. package/dist/slack/services/api-client.js +0 -248
  39. package/dist/slack/services/auth/index.d.ts +0 -61
  40. package/dist/slack/services/auth/index.js +0 -164
  41. package/dist/slack/services/blocks/index.d.ts +0 -60
  42. package/dist/slack/services/blocks/index.js +0 -143
  43. package/dist/slack/services/client.d.ts +0 -78
  44. package/dist/slack/services/client.js +0 -152
  45. package/dist/slack/services/commands/index.d.ts +0 -15
  46. package/dist/slack/services/commands/index.js +0 -556
  47. package/dist/slack/services/events/app-mention.d.ts +0 -41
  48. package/dist/slack/services/events/app-mention.js +0 -212
  49. package/dist/slack/services/events/block-actions.d.ts +0 -47
  50. package/dist/slack/services/events/block-actions.js +0 -287
  51. package/dist/slack/services/events/index.d.ts +0 -6
  52. package/dist/slack/services/events/index.js +0 -7
  53. package/dist/slack/services/events/modal-submission.d.ts +0 -12
  54. package/dist/slack/services/events/modal-submission.js +0 -279
  55. package/dist/slack/services/events/streaming.d.ts +0 -27
  56. package/dist/slack/services/events/streaming.js +0 -285
  57. package/dist/slack/services/events/utils.d.ts +0 -129
  58. package/dist/slack/services/events/utils.js +0 -315
  59. package/dist/slack/services/index.d.ts +0 -18
  60. package/dist/slack/services/index.js +0 -18
  61. package/dist/slack/services/modals.d.ts +0 -67
  62. package/dist/slack/services/modals.js +0 -203
  63. package/dist/slack/services/nango.d.ts +0 -82
  64. package/dist/slack/services/nango.js +0 -326
  65. package/dist/slack/services/security.d.ts +0 -35
  66. package/dist/slack/services/security.js +0 -65
  67. package/dist/slack/services/types.d.ts +0 -26
  68. package/dist/slack/services/types.js +0 -1
  69. package/dist/slack/services/workspace-tokens.d.ts +0 -37
  70. package/dist/slack/services/workspace-tokens.js +0 -39
  71. package/dist/slack/types.d.ts +0 -10
  72. package/dist/slack/types.js +0 -1
@@ -1,3 +1,2 @@
1
- import _default from "./manageDbClient.js";
2
1
  import runDbClient from "./runDbClient.js";
3
- export { _default as manageDbClient, runDbClient };
2
+ export { runDbClient };
package/dist/db/index.js CHANGED
@@ -1,4 +1,3 @@
1
- import manageDbClient_default from "./manageDbClient.js";
2
1
  import runDbClient_default from "./runDbClient.js";
3
2
 
4
- export { manageDbClient_default as manageDbClient, runDbClient_default as runDbClient };
3
+ export { runDbClient_default as runDbClient };
@@ -1,6 +1,6 @@
1
- import * as _inkeep_agents_core1 from "@inkeep/agents-core";
1
+ import * as _inkeep_agents_core0 from "@inkeep/agents-core";
2
2
 
3
3
  //#region src/db/runDbClient.d.ts
4
- declare const runDbClient: _inkeep_agents_core1.AgentsRunDatabaseClient;
4
+ declare const runDbClient: _inkeep_agents_core0.AgentsRunDatabaseClient;
5
5
  //#endregion
6
6
  export { runDbClient as default };
package/dist/env.d.ts CHANGED
@@ -21,7 +21,6 @@ declare const envSchema: z.ZodObject<{
21
21
  warn: "warn";
22
22
  }>>;
23
23
  INKEEP_AGENTS_RUN_DATABASE_URL: z.ZodString;
24
- INKEEP_AGENTS_MANAGE_DATABASE_URL: z.ZodOptional<z.ZodString>;
25
24
  INKEEP_AGENTS_MANAGE_UI_URL: z.ZodOptional<z.ZodString>;
26
25
  GITHUB_APP_ID: z.ZodOptional<z.ZodString>;
27
26
  GITHUB_APP_PRIVATE_KEY: z.ZodOptional<z.ZodString>;
@@ -29,23 +28,12 @@ declare const envSchema: z.ZodObject<{
29
28
  GITHUB_STATE_SIGNING_SECRET: z.ZodOptional<z.ZodString>;
30
29
  GITHUB_APP_NAME: z.ZodOptional<z.ZodString>;
31
30
  GITHUB_MCP_API_KEY: z.ZodOptional<z.ZodString>;
32
- SLACK_CLIENT_ID: z.ZodOptional<z.ZodString>;
33
- SLACK_CLIENT_SECRET: z.ZodOptional<z.ZodString>;
34
- SLACK_SIGNING_SECRET: z.ZodOptional<z.ZodString>;
35
- SLACK_BOT_TOKEN: z.ZodOptional<z.ZodString>;
36
- SLACK_APP_URL: z.ZodOptional<z.ZodString>;
37
- NANGO_SECRET_KEY: z.ZodOptional<z.ZodString>;
38
- NANGO_SLACK_SECRET_KEY: z.ZodOptional<z.ZodString>;
39
- NANGO_SLACK_INTEGRATION_ID: z.ZodOptional<z.ZodString>;
40
- NANGO_SERVER_URL: z.ZodOptional<z.ZodString>;
41
- INKEEP_AGENTS_API_URL: z.ZodOptional<z.ZodString>;
42
31
  }, z.core.$strip>;
43
32
  declare const env: {
44
33
  NODE_ENV: "development" | "production" | "test";
45
34
  ENVIRONMENT: "development" | "production" | "test" | "pentest";
46
35
  LOG_LEVEL: "error" | "trace" | "debug" | "info" | "warn";
47
36
  INKEEP_AGENTS_RUN_DATABASE_URL: string;
48
- INKEEP_AGENTS_MANAGE_DATABASE_URL?: string | undefined;
49
37
  INKEEP_AGENTS_MANAGE_UI_URL?: string | undefined;
50
38
  GITHUB_APP_ID?: string | undefined;
51
39
  GITHUB_APP_PRIVATE_KEY?: string | undefined;
@@ -53,16 +41,6 @@ declare const env: {
53
41
  GITHUB_STATE_SIGNING_SECRET?: string | undefined;
54
42
  GITHUB_APP_NAME?: string | undefined;
55
43
  GITHUB_MCP_API_KEY?: string | undefined;
56
- SLACK_CLIENT_ID?: string | undefined;
57
- SLACK_CLIENT_SECRET?: string | undefined;
58
- SLACK_SIGNING_SECRET?: string | undefined;
59
- SLACK_BOT_TOKEN?: string | undefined;
60
- SLACK_APP_URL?: string | undefined;
61
- NANGO_SECRET_KEY?: string | undefined;
62
- NANGO_SLACK_SECRET_KEY?: string | undefined;
63
- NANGO_SLACK_INTEGRATION_ID?: string | undefined;
64
- NANGO_SERVER_URL?: string | undefined;
65
- INKEEP_AGENTS_API_URL?: string | undefined;
66
44
  };
67
45
  type Env = z.infer<typeof envSchema>;
68
46
  //#endregion
package/dist/env.js CHANGED
@@ -23,24 +23,13 @@ const envSchema = z.object({
23
23
  "error"
24
24
  ]).default("info").describe("Logging verbosity level"),
25
25
  INKEEP_AGENTS_RUN_DATABASE_URL: z.string().describe("PostgreSQL connection URL for the runtime database (Doltgres with Git version control)"),
26
- INKEEP_AGENTS_MANAGE_DATABASE_URL: z.string().optional().describe("PostgreSQL connection URL for the management database"),
27
26
  INKEEP_AGENTS_MANAGE_UI_URL: z.string().optional().describe("URL where the management UI is hosted"),
28
27
  GITHUB_APP_ID: z.string().optional().describe("GitHub App ID for GitHub integration"),
29
28
  GITHUB_APP_PRIVATE_KEY: z.string().optional().describe("GitHub App private key for authentication"),
30
29
  GITHUB_WEBHOOK_SECRET: z.string().optional().describe("Secret for validating GitHub webhook payloads"),
31
30
  GITHUB_STATE_SIGNING_SECRET: z.string().min(32, "GITHUB_STATE_SIGNING_SECRET must be at least 32 characters").optional().describe("Secret for signing GitHub OAuth state (minimum 32 characters)"),
32
31
  GITHUB_APP_NAME: z.string().optional().describe("Name of the GitHub App"),
33
- GITHUB_MCP_API_KEY: z.string().optional().describe("API key for the GitHub MCP"),
34
- SLACK_CLIENT_ID: z.string().optional().describe("Slack App Client ID"),
35
- SLACK_CLIENT_SECRET: z.string().optional().describe("Slack App Client Secret"),
36
- SLACK_SIGNING_SECRET: z.string().optional().describe("Slack App Signing Secret"),
37
- SLACK_BOT_TOKEN: z.string().optional().describe("Slack Bot Token (for testing)"),
38
- SLACK_APP_URL: z.string().optional().describe("Slack App Install URL"),
39
- NANGO_SECRET_KEY: z.string().optional().describe("Nango Secret Key"),
40
- NANGO_SLACK_SECRET_KEY: z.string().optional().describe("Nango Slack-specific Secret Key"),
41
- NANGO_SLACK_INTEGRATION_ID: z.string().optional().describe("Nango Slack Integration ID"),
42
- NANGO_SERVER_URL: z.string().optional().describe("Nango Server URL"),
43
- INKEEP_AGENTS_API_URL: z.string().optional().describe("Inkeep Agents API URL")
32
+ GITHUB_MCP_API_KEY: z.string().optional().describe("API key for the GitHub MCP")
44
33
  });
45
34
  const parseEnv = () => {
46
35
  try {
@@ -4,10 +4,10 @@ import "./routes/setup.js";
4
4
  import "./routes/tokenExchange.js";
5
5
  import { WebhookVerificationResult, verifyWebhookSignature } from "./routes/webhooks.js";
6
6
  import { Hono } from "hono";
7
- import * as hono_types0 from "hono/types";
7
+ import * as hono_types1 from "hono/types";
8
8
 
9
9
  //#region src/github/index.d.ts
10
- declare function createGithubRoutes(): Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
11
- declare const githubRoutes: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
10
+ declare function createGithubRoutes(): Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
11
+ declare const githubRoutes: Hono<hono_types1.BlankEnv, hono_types1.BlankSchema, "/">;
12
12
  //#endregion
13
13
  export { GenerateInstallationAccessTokenResult, GenerateTokenError, GenerateTokenResult, GitHubAppConfig, InstallationAccessToken, InstallationInfo, LookupInstallationError, LookupInstallationForRepoResult, LookupInstallationResult, WebhookVerificationResult, clearConfigCache, createAppJwt, createGithubRoutes, determineStatus, fetchInstallationDetails, fetchInstallationRepositories, generateInstallationAccessToken, getGitHubAppConfig, getGitHubAppName, getStateSigningSecret, getWebhookSecret, githubRoutes, isGitHubAppConfigured, isGitHubAppNameConfigured, isStateSigningConfigured, isWebhookConfigured, lookupInstallationForRepo, validateGitHubAppConfigOnStartup, validateGitHubInstallFlowConfigOnStartup, validateGitHubWebhookConfigOnStartup, verifyWebhookSignature };
@@ -1,11 +1,11 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types3 from "hono/types";
2
+ import * as hono_types5 from "hono/types";
3
3
 
4
4
  //#region src/github/mcp/index.d.ts
5
5
  declare const app: Hono<{
6
6
  Variables: {
7
7
  toolId: string;
8
8
  };
9
- }, hono_types3.BlankSchema, "/">;
9
+ }, hono_types5.BlankSchema, "/">;
10
10
  //#endregion
11
11
  export { app as default };
@@ -42,8 +42,8 @@ declare const ChangedFileSchema: z.ZodObject<{
42
42
  path: z.ZodString;
43
43
  status: z.ZodEnum<{
44
44
  added: "added";
45
- removed: "removed";
46
45
  modified: "modified";
46
+ removed: "removed";
47
47
  renamed: "renamed";
48
48
  copied: "copied";
49
49
  changed: "changed";
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types4 from "hono/types";
2
+ import * as hono_types8 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/setup.d.ts
5
- declare const app: Hono<hono_types4.BlankEnv, hono_types4.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,7 +1,7 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types6 from "hono/types";
2
+ import * as hono_types0 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/tokenExchange.d.ts
5
- declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
5
+ declare const app: Hono<hono_types0.BlankEnv, hono_types0.BlankSchema, "/">;
6
6
  //#endregion
7
7
  export { app as default };
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import * as hono_types8 from "hono/types";
2
+ import * as hono_types6 from "hono/types";
3
3
 
4
4
  //#region src/github/routes/webhooks.d.ts
5
5
  interface WebhookVerificationResult {
@@ -7,6 +7,6 @@ interface WebhookVerificationResult {
7
7
  error?: string;
8
8
  }
9
9
  declare function verifyWebhookSignature(payload: string, signature: string | undefined, secret: string): WebhookVerificationResult;
10
- declare const app: Hono<hono_types8.BlankEnv, hono_types8.BlankSchema, "/">;
10
+ declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
11
11
  //#endregion
12
12
  export { WebhookVerificationResult, app as default, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-work-apps",
3
- "version": "0.0.0-dev-20260204182014",
3
+ "version": "0.0.0-dev-20260204185956",
4
4
  "description": "First party integrations for Inkeep Agents",
5
5
  "type": "module",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -13,26 +13,18 @@
13
13
  "./github": {
14
14
  "types": "./dist/github/index.d.ts",
15
15
  "import": "./dist/github/index.js"
16
- },
17
- "./slack": {
18
- "types": "./dist/slack/index.d.ts",
19
- "import": "./dist/slack/index.js"
20
16
  }
21
17
  },
22
18
  "dependencies": {
23
19
  "@modelcontextprotocol/sdk": "^1.25.3",
24
- "@nangohq/node": "^0.48.1",
25
20
  "@octokit/auth-app": "^8.1.2",
26
21
  "@octokit/rest": "^22.0.1",
27
- "@slack/types": "^2.18.0",
28
- "@slack/web-api": "^7.9.1",
29
- "slack-block-builder": "^2.8.0",
30
22
  "drizzle-orm": "^0.44.7",
31
23
  "fetch-to-node": "^2.1.0",
32
24
  "hono": "^4.10.4",
33
25
  "jose": "^6.1.0",
34
26
  "minimatch": "^10.1.1",
35
- "@inkeep/agents-core": "0.0.0-dev-20260204182014"
27
+ "@inkeep/agents-core": "0.0.0-dev-20260204185956"
36
28
  },
37
29
  "peerDependencies": {
38
30
  "@hono/zod-openapi": "^1.1.5",
@@ -1,7 +0,0 @@
1
- import * as _inkeep_agents_core0 from "@inkeep/agents-core";
2
-
3
- //#region src/db/manageDbClient.d.ts
4
- declare function getManageDbClient(): _inkeep_agents_core0.AgentsManageDatabaseClient;
5
- declare const _default: _inkeep_agents_core0.AgentsManageDatabaseClient;
6
- //#endregion
7
- export { _default as default, getManageDbClient };
@@ -1,16 +0,0 @@
1
- import { createAgentsManageDatabaseClient } from "@inkeep/agents-core";
2
-
3
- //#region src/db/manageDbClient.ts
4
- let manageDbClient = null;
5
- function getManageDbClient() {
6
- if (!manageDbClient) {
7
- const connectionString = process.env.INKEEP_AGENTS_MANAGE_DATABASE_URL;
8
- if (!connectionString) throw new Error("INKEEP_AGENTS_MANAGE_DATABASE_URL environment variable is required");
9
- manageDbClient = createAgentsManageDatabaseClient({ connectionString });
10
- }
11
- return manageDbClient;
12
- }
13
- var manageDbClient_default = getManageDbClient();
14
-
15
- //#endregion
16
- export { manageDbClient_default as default, getManageDbClient };
@@ -1,19 +0,0 @@
1
- import { ManageAppVariables, WorkAppsVariables } from "./types.js";
2
- import { DefaultAgentConfig, SlackWorkspaceConnection, WorkspaceInstallData, computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./services/nango.js";
3
- import { getChannelAgentConfig, getWorkspaceDefaultAgent } from "./services/events/utils.js";
4
- import "./services/events/index.js";
5
- import { getBotTokenForTeam, setBotTokenForTeam } from "./services/workspace-tokens.js";
6
- import "./routes/oauth.js";
7
- import { pendingSessionTokens } from "./routes/users.js";
8
- import { OpenAPIHono } from "@hono/zod-openapi";
9
-
10
- //#region src/slack/index.d.ts
11
-
12
- declare function createSlackRoutes(): OpenAPIHono<{
13
- Variables: WorkAppsVariables;
14
- }, {}, "/">;
15
- declare const slackRoutes: OpenAPIHono<{
16
- Variables: WorkAppsVariables;
17
- }, {}, "/">;
18
- //#endregion
19
- export { DefaultAgentConfig, ManageAppVariables, SlackWorkspaceConnection, WorkAppsVariables, WorkspaceInstallData, computeWorkspaceConnectionId, createConnectSession, createSlackRoutes, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, pendingSessionTokens, setBotTokenForTeam, setWorkspaceDefaultAgent, slackRoutes, storeWorkspaceInstallation, updateConnectionMetadata };
@@ -1,29 +0,0 @@
1
- import { computeWorkspaceConnectionId, createConnectSession, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, setWorkspaceDefaultAgent, storeWorkspaceInstallation, updateConnectionMetadata } from "./services/nango.js";
2
- import { getBotTokenForTeam, setBotTokenForTeam } from "./services/workspace-tokens.js";
3
- import { getChannelAgentConfig, getWorkspaceDefaultAgent } from "./services/events/utils.js";
4
- import "./services/events/index.js";
5
- import "./routes/oauth.js";
6
- import { pendingSessionTokens } from "./routes/users.js";
7
- import routes_default from "./routes.js";
8
- import { OpenAPIHono } from "@hono/zod-openapi";
9
-
10
- //#region src/slack/index.ts
11
- /**
12
- * Slack Work App
13
- *
14
- * Provides Slack integration for Inkeep Agents including:
15
- * - OAuth-based workspace installation
16
- * - User account linking via JWT tokens
17
- * - Slash commands for agent interaction
18
- * - @mention support for workspace-wide agent access
19
- * - Channel-specific agent configuration
20
- */
21
- function createSlackRoutes() {
22
- const app = new OpenAPIHono();
23
- app.route("/", routes_default);
24
- return app;
25
- }
26
- const slackRoutes = createSlackRoutes();
27
-
28
- //#endregion
29
- export { computeWorkspaceConnectionId, createConnectSession, createSlackRoutes, deleteWorkspaceInstallation, findWorkspaceConnectionByTeamId, getBotTokenForTeam, getChannelAgentConfig, getConnectionAccessToken, getSlackIntegrationId, getSlackNango, getWorkspaceDefaultAgent, getWorkspaceDefaultAgentFromNango, listWorkspaceInstallations, pendingSessionTokens, setBotTokenForTeam, setWorkspaceDefaultAgent, slackRoutes, storeWorkspaceInstallation, updateConnectionMetadata };
@@ -1,16 +0,0 @@
1
- import { ManageAppVariables } from "../types.js";
2
- import * as hono0 from "hono";
3
-
4
- //#region src/slack/middleware/permissions.d.ts
5
- declare const requireWorkspaceAdmin: <Env extends {
6
- Variables: ManageAppVariables;
7
- } = {
8
- Variables: ManageAppVariables;
9
- }>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
10
- declare const requireAuthenticatedUser: <Env extends {
11
- Variables: ManageAppVariables;
12
- } = {
13
- Variables: ManageAppVariables;
14
- }>() => hono0.MiddlewareHandler<Env, string, {}, Response>;
15
- //#endregion
16
- export { requireAuthenticatedUser, requireWorkspaceAdmin };
@@ -1,49 +0,0 @@
1
- import { OrgRoles, createApiError } from "@inkeep/agents-core";
2
- import { createMiddleware } from "hono/factory";
3
-
4
- //#region src/slack/middleware/permissions.ts
5
- const requireWorkspaceAdmin = () => createMiddleware(async (c, next) => {
6
- if (process.env.ENVIRONMENT === "test") {
7
- await next();
8
- return;
9
- }
10
- const userId = c.get("userId");
11
- const tenantId = c.get("tenantId");
12
- const tenantRole = c.get("tenantRole");
13
- if (!userId || !tenantId) throw createApiError({
14
- code: "unauthorized",
15
- message: "User or organization context not found",
16
- instance: c.req.path
17
- });
18
- if (userId === "system" || userId.startsWith("apikey:")) {
19
- await next();
20
- return;
21
- }
22
- if (!(tenantRole === OrgRoles.OWNER || tenantRole === OrgRoles.ADMIN)) throw createApiError({
23
- code: "forbidden",
24
- message: "Only workspace administrators can modify workspace and channel configurations",
25
- instance: c.req.path,
26
- extensions: {
27
- requiredRole: "admin or owner",
28
- currentRole: tenantRole
29
- }
30
- });
31
- await next();
32
- });
33
- const requireAuthenticatedUser = () => createMiddleware(async (c, next) => {
34
- if (process.env.ENVIRONMENT === "test") {
35
- await next();
36
- return;
37
- }
38
- const userId = c.get("userId");
39
- const tenantId = c.get("tenantId");
40
- if (!userId || !tenantId) throw createApiError({
41
- code: "unauthorized",
42
- message: "Authentication required",
43
- instance: c.req.path
44
- });
45
- await next();
46
- });
47
-
48
- //#endregion
49
- export { requireAuthenticatedUser, requireWorkspaceAdmin };
@@ -1,10 +0,0 @@
1
- import { WorkAppsVariables } from "../types.js";
2
- import { OpenAPIHono } from "@hono/zod-openapi";
3
-
4
- //#region src/slack/routes/events.d.ts
5
-
6
- declare const app: OpenAPIHono<{
7
- Variables: WorkAppsVariables;
8
- }, {}, "/">;
9
- //#endregion
10
- export { app as default };