@inkeep/agents-api 0.0.0-dev-20260203033642 → 0.0.0-dev-20260203183511
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/dist/.well-known/workflow/v1/flow.cjs +44 -44
- package/dist/.well-known/workflow/v1/flow.cjs.debug.json +2 -2
- package/dist/.well-known/workflow/v1/manifest.debug.json +11 -11
- package/dist/.well-known/workflow/v1/step.cjs +130 -130
- package/dist/.well-known/workflow/v1/step.cjs.debug.json +2 -2
- package/dist/createApp.d.ts +2 -2
- package/dist/domains/evals/routes/datasetTriggers.d.ts +2 -2
- package/dist/domains/evals/routes/index.d.ts +2 -2
- package/dist/domains/evals/workflow/routes.d.ts +2 -2
- package/dist/domains/manage/routes/conversations.d.ts +2 -2
- package/dist/domains/manage/routes/evals/evaluationResults.d.ts +2 -2
- package/dist/domains/manage/routes/index.d.ts +2 -2
- package/dist/domains/manage/routes/invitations.d.ts +4 -3
- package/dist/domains/manage/routes/invitations.js +16 -28
- package/dist/domains/manage/routes/mcp.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.d.ts +2 -2
- package/dist/domains/manage/routes/signoz.js +22 -16
- package/dist/domains/manage/routes/userOrganizations.d.ts +4 -3
- package/dist/domains/manage/routes/userOrganizations.js +16 -45
- package/dist/domains/mcp/routes/mcp.d.ts +2 -2
- package/dist/factory.d.ts +266 -266
- package/dist/index.d.ts +265 -265
- package/dist/middleware/evalsAuth.d.ts +2 -2
- package/dist/middleware/manageAuth.d.ts +2 -2
- package/dist/middleware/projectAccess.d.ts +2 -2
- package/dist/middleware/projectConfig.d.ts +3 -3
- package/dist/middleware/requirePermission.d.ts +2 -2
- package/dist/middleware/runAuth.d.ts +4 -4
- package/dist/middleware/sessionAuth.d.ts +3 -3
- package/dist/middleware/tenantAccess.d.ts +2 -2
- package/dist/middleware/tracing.d.ts +3 -3
- package/dist/openapi.d.ts +0 -2
- package/dist/openapi.js +0 -2
- package/package.json +5 -5
|
@@ -1,34 +1,22 @@
|
|
|
1
1
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
2
|
-
import {
|
|
3
|
-
import { getPendingInvitationsByEmail } from "@inkeep/agents-core";
|
|
2
|
+
import { sessionAuth } from "../../../middleware/sessionAuth.js";
|
|
3
|
+
import { createApiError, getPendingInvitationsByEmail } from "@inkeep/agents-core";
|
|
4
|
+
import { Hono } from "hono";
|
|
4
5
|
|
|
5
6
|
//#region src/domains/manage/routes/invitations.ts
|
|
6
|
-
const invitationsRoutes = new
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
email
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
invitationsRoutes.openapi(createRoute({
|
|
20
|
-
method: "get",
|
|
21
|
-
path: "/pending",
|
|
22
|
-
tags: ["Invitations"],
|
|
23
|
-
summary: "Get pending invitations",
|
|
24
|
-
description: "Get all pending (non-expired) invitations for a given email address",
|
|
25
|
-
request: { query: z.object({ email: z.email().describe("Email address to check for invitations") }) },
|
|
26
|
-
responses: { 200: {
|
|
27
|
-
description: "List of pending invitations",
|
|
28
|
-
content: { "application/json": { schema: PendingInvitationsResponseSchema } }
|
|
29
|
-
} }
|
|
30
|
-
}), async (c) => {
|
|
31
|
-
const { email } = c.req.valid("query");
|
|
7
|
+
const invitationsRoutes = new Hono();
|
|
8
|
+
invitationsRoutes.use("*", sessionAuth());
|
|
9
|
+
invitationsRoutes.get("/pending", async (c) => {
|
|
10
|
+
const email = c.req.query("email");
|
|
11
|
+
const authenticatedEmail = c.get("userEmail");
|
|
12
|
+
if (!email) throw createApiError({
|
|
13
|
+
code: "bad_request",
|
|
14
|
+
message: "Email parameter is required"
|
|
15
|
+
});
|
|
16
|
+
if (email !== authenticatedEmail) throw createApiError({
|
|
17
|
+
code: "forbidden",
|
|
18
|
+
message: "Cannot access invitations for another email"
|
|
19
|
+
});
|
|
32
20
|
const response = (await getPendingInvitationsByEmail(runDbClient_default)(email)).map((inv) => ({
|
|
33
21
|
...inv,
|
|
34
22
|
expiresAt: inv.expiresAt instanceof Date ? inv.expiresAt.getTime() : inv.expiresAt
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types2 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/manage/routes/mcp.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types2.BlankEnv, hono_types2.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
2
|
import { Hono } from "hono";
|
|
3
|
-
import * as
|
|
3
|
+
import * as hono_types9 from "hono/types";
|
|
4
4
|
|
|
5
5
|
//#region src/domains/manage/routes/signoz.d.ts
|
|
6
6
|
declare const app: Hono<{
|
|
7
7
|
Variables: ManageAppVariables;
|
|
8
|
-
},
|
|
8
|
+
}, hono_types9.BlankSchema, "/">;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { app as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getLogger as getLogger$1 } from "../../../logger.js";
|
|
2
2
|
import { env } from "../../../env.js";
|
|
3
3
|
import { enforceSecurityFilters } from "../../../utils/signozHelpers.js";
|
|
4
|
-
import {
|
|
4
|
+
import { canViewProject, createApiError } from "@inkeep/agents-core";
|
|
5
5
|
import { Hono } from "hono";
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
|
|
@@ -12,10 +12,12 @@ app.post("/query", async (c) => {
|
|
|
12
12
|
let payload = await c.req.json();
|
|
13
13
|
const requestedProjectId = payload.projectId;
|
|
14
14
|
const tenantId = c.get("tenantId");
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const userId = c.get("userId");
|
|
16
|
+
const tenantRole = c.get("tenantRole");
|
|
17
|
+
if (!userId || !tenantId) throw createApiError({
|
|
17
18
|
code: "unauthorized",
|
|
18
|
-
message: "
|
|
19
|
+
message: "User or organization context not found",
|
|
20
|
+
instance: c.req.path
|
|
19
21
|
});
|
|
20
22
|
logger.debug({
|
|
21
23
|
tenantId,
|
|
@@ -23,18 +25,22 @@ app.post("/query", async (c) => {
|
|
|
23
25
|
hasProjectId: !!requestedProjectId
|
|
24
26
|
}, "Processing SigNoz query request");
|
|
25
27
|
if (requestedProjectId) {
|
|
26
|
-
if (!
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
if (!(userId === "system" || userId?.startsWith("apikey:"))) {
|
|
29
|
+
if (!await canViewProject({
|
|
30
|
+
userId,
|
|
31
|
+
projectId: requestedProjectId,
|
|
32
|
+
orgRole: tenantRole
|
|
33
|
+
})) {
|
|
34
|
+
logger.warn({
|
|
35
|
+
tenantId,
|
|
36
|
+
projectId: requestedProjectId,
|
|
37
|
+
userId
|
|
38
|
+
}, "Project not found or access denied");
|
|
39
|
+
return c.json({
|
|
40
|
+
error: "Forbidden",
|
|
41
|
+
message: "You do not have access to this project"
|
|
42
|
+
}, 403);
|
|
43
|
+
}
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
payload = enforceSecurityFilters(payload, tenantId, requestedProjectId);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ManageAppVariables } from "../../../types/app.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Hono } from "hono";
|
|
3
|
+
import * as hono_types8 from "hono/types";
|
|
3
4
|
|
|
4
5
|
//#region src/domains/manage/routes/userOrganizations.d.ts
|
|
5
|
-
declare const userOrganizationsRoutes:
|
|
6
|
+
declare const userOrganizationsRoutes: Hono<{
|
|
6
7
|
Variables: ManageAppVariables;
|
|
7
|
-
},
|
|
8
|
+
}, hono_types8.BlankSchema, "/">;
|
|
8
9
|
//#endregion
|
|
9
10
|
export { userOrganizationsRoutes as default };
|
|
@@ -1,57 +1,28 @@
|
|
|
1
1
|
import runDbClient_default from "../../../data/db/runDbClient.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { sessionAuth } from "../../../middleware/sessionAuth.js";
|
|
3
|
+
import { createApiError, getUserOrganizationsFromDb } from "@inkeep/agents-core";
|
|
4
|
+
import { Hono } from "hono";
|
|
5
5
|
|
|
6
6
|
//#region src/domains/manage/routes/userOrganizations.ts
|
|
7
|
-
const userOrganizationsRoutes = new
|
|
8
|
-
userOrganizationsRoutes.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
20
|
-
const { userId } = c.req.valid("param");
|
|
7
|
+
const userOrganizationsRoutes = new Hono();
|
|
8
|
+
userOrganizationsRoutes.use("*", sessionAuth());
|
|
9
|
+
userOrganizationsRoutes.get("/", async (c) => {
|
|
10
|
+
const userId = c.req.param("userId");
|
|
11
|
+
const authenticatedUserId = c.get("userId");
|
|
12
|
+
if (!userId) throw createApiError({
|
|
13
|
+
code: "bad_request",
|
|
14
|
+
message: "User ID is required"
|
|
15
|
+
});
|
|
16
|
+
if (userId !== authenticatedUserId) throw createApiError({
|
|
17
|
+
code: "forbidden",
|
|
18
|
+
message: "Cannot access another user's organizations"
|
|
19
|
+
});
|
|
21
20
|
const userOrganizations = (await getUserOrganizationsFromDb(runDbClient_default)(userId)).map((org) => ({
|
|
22
21
|
...org,
|
|
23
22
|
createdAt: org.createdAt.toISOString()
|
|
24
23
|
}));
|
|
25
24
|
return c.json(userOrganizations);
|
|
26
25
|
});
|
|
27
|
-
userOrganizationsRoutes.openapi(createRoute({
|
|
28
|
-
method: "post",
|
|
29
|
-
path: "/",
|
|
30
|
-
tags: ["User Organizations"],
|
|
31
|
-
summary: "Add user to organization",
|
|
32
|
-
description: "Associate a user with an organization",
|
|
33
|
-
request: {
|
|
34
|
-
params: z.object({ userId: z.string().describe("User ID") }),
|
|
35
|
-
body: { content: { "application/json": { schema: AddUserToOrganizationRequestSchema } } }
|
|
36
|
-
},
|
|
37
|
-
responses: { 201: {
|
|
38
|
-
description: "User added to organization",
|
|
39
|
-
content: { "application/json": { schema: AddUserToOrganizationResponseSchema } }
|
|
40
|
-
} }
|
|
41
|
-
}), async (c) => {
|
|
42
|
-
const { userId } = c.req.valid("param");
|
|
43
|
-
const { organizationId, role } = c.req.valid("json");
|
|
44
|
-
await addUserToOrganization(runDbClient_default)({
|
|
45
|
-
userId,
|
|
46
|
-
organizationId,
|
|
47
|
-
role
|
|
48
|
-
});
|
|
49
|
-
return c.json({
|
|
50
|
-
organizationId,
|
|
51
|
-
role,
|
|
52
|
-
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
53
|
-
}, 201);
|
|
54
|
-
});
|
|
55
26
|
var userOrganizations_default = userOrganizationsRoutes;
|
|
56
27
|
|
|
57
28
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
-
import * as
|
|
2
|
+
import * as hono_types6 from "hono/types";
|
|
3
3
|
|
|
4
4
|
//#region src/domains/mcp/routes/mcp.d.ts
|
|
5
|
-
declare const app: Hono<
|
|
5
|
+
declare const app: Hono<hono_types6.BlankEnv, hono_types6.BlankSchema, "/">;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { app as default };
|