@sixb/server 0.0.1
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/LICENSE +21 -0
- package/README.md +123 -0
- package/dist/auth/access-token-boundary.d.ts +23 -0
- package/dist/auth/access-token-boundary.d.ts.map +1 -0
- package/dist/auth/application-access.d.ts +4 -0
- package/dist/auth/application-access.d.ts.map +1 -0
- package/dist/auth/browser-origin.d.ts +62 -0
- package/dist/auth/browser-origin.d.ts.map +1 -0
- package/dist/auth/csrf.d.ts +2 -0
- package/dist/auth/csrf.d.ts.map +1 -0
- package/dist/auth/guard.d.ts +35 -0
- package/dist/auth/guard.d.ts.map +1 -0
- package/dist/auth/public-routes.d.ts +8 -0
- package/dist/auth/public-routes.d.ts.map +1 -0
- package/dist/auth/responses.d.ts +11 -0
- package/dist/auth/responses.d.ts.map +1 -0
- package/dist/auth/return-to.d.ts +3 -0
- package/dist/auth/return-to.d.ts.map +1 -0
- package/dist/auth/scope.d.ts +43 -0
- package/dist/auth/scope.d.ts.map +1 -0
- package/dist/auth/session-activity.d.ts +4 -0
- package/dist/auth/session-activity.d.ts.map +1 -0
- package/dist/auth/session-cookies.d.ts +12 -0
- package/dist/auth/session-cookies.d.ts.map +1 -0
- package/dist/files/content.d.ts +141 -0
- package/dist/files/content.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11522 -0
- package/dist/index.js.map +78 -0
- package/dist/openapi/security.d.ts +26 -0
- package/dist/openapi/security.d.ts.map +1 -0
- package/dist/openapi/tags.d.ts +151 -0
- package/dist/openapi/tags.d.ts.map +1 -0
- package/dist/registerRoutes.d.ts +31 -0
- package/dist/registerRoutes.d.ts.map +1 -0
- package/dist/routes/action-runs.d.ts +244 -0
- package/dist/routes/action-runs.d.ts.map +1 -0
- package/dist/routes/actions.d.ts +183 -0
- package/dist/routes/actions.d.ts.map +1 -0
- package/dist/routes/agent-api-gateway.d.ts +4 -0
- package/dist/routes/agent-api-gateway.d.ts.map +1 -0
- package/dist/routes/agents.d.ts +1061 -0
- package/dist/routes/agents.d.ts.map +1 -0
- package/dist/routes/auth.d.ts +1366 -0
- package/dist/routes/auth.d.ts.map +1 -0
- package/dist/routes/connectors.d.ts +108 -0
- package/dist/routes/connectors.d.ts.map +1 -0
- package/dist/routes/datasets.d.ts +339 -0
- package/dist/routes/datasets.d.ts.map +1 -0
- package/dist/routes/events.d.ts +116 -0
- package/dist/routes/events.d.ts.map +1 -0
- package/dist/routes/files.d.ts +340 -0
- package/dist/routes/files.d.ts.map +1 -0
- package/dist/routes/links.d.ts +175 -0
- package/dist/routes/links.d.ts.map +1 -0
- package/dist/routes/logs.d.ts +88 -0
- package/dist/routes/logs.d.ts.map +1 -0
- package/dist/routes/objects.d.ts +450 -0
- package/dist/routes/objects.d.ts.map +1 -0
- package/dist/routes/ontology.d.ts +240 -0
- package/dist/routes/ontology.d.ts.map +1 -0
- package/dist/routes/pipelines.d.ts +399 -0
- package/dist/routes/pipelines.d.ts.map +1 -0
- package/dist/routes/project.d.ts +56 -0
- package/dist/routes/project.d.ts.map +1 -0
- package/dist/routes/projections.d.ts +916 -0
- package/dist/routes/projections.d.ts.map +1 -0
- package/dist/routes/rules.d.ts +165 -0
- package/dist/routes/rules.d.ts.map +1 -0
- package/dist/routes/status.d.ts +81 -0
- package/dist/routes/status.d.ts.map +1 -0
- package/dist/routes/syncs.d.ts +294 -0
- package/dist/routes/syncs.d.ts.map +1 -0
- package/dist/routes/telemetry.d.ts +241 -0
- package/dist/routes/telemetry.d.ts.map +1 -0
- package/dist/routes/webhook-runs.d.ts +89 -0
- package/dist/routes/webhook-runs.d.ts.map +1 -0
- package/dist/routes/webhooks.d.ts +60 -0
- package/dist/routes/webhooks.d.ts.map +1 -0
- package/dist/routes/workflows.d.ts +973 -0
- package/dist/routes/workflows.d.ts.map +1 -0
- package/dist/routes/ws/agents.d.ts +99 -0
- package/dist/routes/ws/agents.d.ts.map +1 -0
- package/dist/routes/ws/events.d.ts +89 -0
- package/dist/routes/ws/events.d.ts.map +1 -0
- package/dist/routes/ws/index.d.ts +31 -0
- package/dist/routes/ws/index.d.ts.map +1 -0
- package/dist/routes/ws/log-subscription-hub.d.ts +47 -0
- package/dist/routes/ws/log-subscription-hub.d.ts.map +1 -0
- package/dist/routes/ws/logs.d.ts +110 -0
- package/dist/routes/ws/logs.d.ts.map +1 -0
- package/dist/schemas/actions.d.ts +644 -0
- package/dist/schemas/actions.d.ts.map +1 -0
- package/dist/schemas/agents.d.ts +3157 -0
- package/dist/schemas/agents.d.ts.map +1 -0
- package/dist/schemas/auth.d.ts +2023 -0
- package/dist/schemas/auth.d.ts.map +1 -0
- package/dist/schemas/common.d.ts +30 -0
- package/dist/schemas/common.d.ts.map +1 -0
- package/dist/schemas/connectors.d.ts +82 -0
- package/dist/schemas/connectors.d.ts.map +1 -0
- package/dist/schemas/datasets.d.ts +744 -0
- package/dist/schemas/datasets.d.ts.map +1 -0
- package/dist/schemas/event-payloads.d.ts +477 -0
- package/dist/schemas/event-payloads.d.ts.map +1 -0
- package/dist/schemas/events.d.ts +665 -0
- package/dist/schemas/events.d.ts.map +1 -0
- package/dist/schemas/files.d.ts +241 -0
- package/dist/schemas/files.d.ts.map +1 -0
- package/dist/schemas/links.d.ts +90 -0
- package/dist/schemas/links.d.ts.map +1 -0
- package/dist/schemas/logs.d.ts +231 -0
- package/dist/schemas/logs.d.ts.map +1 -0
- package/dist/schemas/objects.d.ts +288 -0
- package/dist/schemas/objects.d.ts.map +1 -0
- package/dist/schemas/ontology.d.ts +778 -0
- package/dist/schemas/ontology.d.ts.map +1 -0
- package/dist/schemas/pipelines.d.ts +1373 -0
- package/dist/schemas/pipelines.d.ts.map +1 -0
- package/dist/schemas/project.d.ts +9 -0
- package/dist/schemas/project.d.ts.map +1 -0
- package/dist/schemas/projections.d.ts +6992 -0
- package/dist/schemas/projections.d.ts.map +1 -0
- package/dist/schemas/rules.d.ts +204 -0
- package/dist/schemas/rules.d.ts.map +1 -0
- package/dist/schemas/status.d.ts +189 -0
- package/dist/schemas/status.d.ts.map +1 -0
- package/dist/schemas/syncs.d.ts +538 -0
- package/dist/schemas/syncs.d.ts.map +1 -0
- package/dist/schemas/telemetry.d.ts +265 -0
- package/dist/schemas/telemetry.d.ts.map +1 -0
- package/dist/schemas/webhook-runs.d.ts +169 -0
- package/dist/schemas/webhook-runs.d.ts.map +1 -0
- package/dist/schemas/workflows.d.ts +1720 -0
- package/dist/schemas/workflows.d.ts.map +1 -0
- package/dist/server.d.ts +64 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/tsconfig.json +5 -0
- package/dist/utils/http.d.ts +23 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/request-body.d.ts +15 -0
- package/dist/utils/request-body.d.ts.map +1 -0
- package/dist/utils/ws.d.ts +10 -0
- package/dist/utils/ws.d.ts.map +1 -0
- package/package.json +68 -0
- package/src/auth/access-token-boundary.ts +68 -0
- package/src/auth/application-access.ts +16 -0
- package/src/auth/browser-origin.ts +367 -0
- package/src/auth/csrf.ts +1 -0
- package/src/auth/guard.ts +169 -0
- package/src/auth/public-routes.ts +87 -0
- package/src/auth/responses.ts +54 -0
- package/src/auth/return-to.ts +21 -0
- package/src/auth/scope.ts +64 -0
- package/src/auth/session-activity.ts +19 -0
- package/src/auth/session-cookies.ts +43 -0
- package/src/files/content.ts +419 -0
- package/src/index.ts +2 -0
- package/src/openapi/security.ts +37 -0
- package/src/openapi/tags.ts +151 -0
- package/src/registerRoutes.ts +49 -0
- package/src/routes/action-runs.ts +238 -0
- package/src/routes/actions.ts +126 -0
- package/src/routes/agent-api-gateway.ts +260 -0
- package/src/routes/agents.ts +943 -0
- package/src/routes/auth.ts +2233 -0
- package/src/routes/connectors.ts +69 -0
- package/src/routes/datasets.ts +402 -0
- package/src/routes/events.ts +55 -0
- package/src/routes/files.ts +675 -0
- package/src/routes/links.ts +143 -0
- package/src/routes/logs.ts +65 -0
- package/src/routes/objects.ts +838 -0
- package/src/routes/ontology.ts +138 -0
- package/src/routes/pipelines.ts +332 -0
- package/src/routes/project.ts +16 -0
- package/src/routes/projections.ts +251 -0
- package/src/routes/rules.ts +124 -0
- package/src/routes/status.ts +53 -0
- package/src/routes/syncs.ts +243 -0
- package/src/routes/telemetry.ts +207 -0
- package/src/routes/webhook-runs.ts +81 -0
- package/src/routes/webhooks.ts +508 -0
- package/src/routes/workflows.ts +1333 -0
- package/src/routes/ws/agents.ts +301 -0
- package/src/routes/ws/events.ts +278 -0
- package/src/routes/ws/index.ts +12 -0
- package/src/routes/ws/log-subscription-hub.ts +375 -0
- package/src/routes/ws/logs.ts +117 -0
- package/src/schemas/actions.ts +123 -0
- package/src/schemas/agents.ts +293 -0
- package/src/schemas/auth.ts +317 -0
- package/src/schemas/common.ts +60 -0
- package/src/schemas/connectors.ts +21 -0
- package/src/schemas/datasets.ts +107 -0
- package/src/schemas/event-payloads.ts +79 -0
- package/src/schemas/events.ts +117 -0
- package/src/schemas/files.ts +82 -0
- package/src/schemas/links.ts +38 -0
- package/src/schemas/logs.ts +76 -0
- package/src/schemas/objects.ts +759 -0
- package/src/schemas/ontology.ts +77 -0
- package/src/schemas/pipelines.ts +150 -0
- package/src/schemas/project.ts +5 -0
- package/src/schemas/projections.ts +144 -0
- package/src/schemas/rules.ts +98 -0
- package/src/schemas/status.ts +51 -0
- package/src/schemas/syncs.ts +83 -0
- package/src/schemas/telemetry.ts +59 -0
- package/src/schemas/webhook-runs.ts +40 -0
- package/src/schemas/workflows.ts +229 -0
- package/src/server.ts +383 -0
- package/src/utils/http.ts +108 -0
- package/src/utils/request-body.ts +62 -0
- package/src/utils/ws.ts +59 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.d.ts","sourceRoot":"","sources":["../../src/routes/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,IAAI,EAGV,MAAM,YAAY,CAAA;AAcnB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4xBxF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { AuthorizationContext, OntologySource, Sixb } from "@sixb/core";
|
|
2
|
+
import type { Elysia } from "elysia";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import type { SixbServer } from "../../server";
|
|
5
|
+
declare const AgentStreamMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"subscribe">;
|
|
7
|
+
runId: z.ZodString;
|
|
8
|
+
afterCursor: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
type: "subscribe";
|
|
11
|
+
runId: string;
|
|
12
|
+
afterCursor?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
type: "subscribe";
|
|
15
|
+
runId: string;
|
|
16
|
+
afterCursor?: string | undefined;
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
type: z.ZodLiteral<"replay">;
|
|
19
|
+
runId: z.ZodString;
|
|
20
|
+
afterCursor: z.ZodOptional<z.ZodString>;
|
|
21
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
type: "replay";
|
|
24
|
+
runId: string;
|
|
25
|
+
limit?: number | undefined;
|
|
26
|
+
afterCursor?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
type: "replay";
|
|
29
|
+
runId: string;
|
|
30
|
+
limit?: number | undefined;
|
|
31
|
+
afterCursor?: string | undefined;
|
|
32
|
+
}>, z.ZodObject<{
|
|
33
|
+
type: z.ZodLiteral<"unsubscribe">;
|
|
34
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
type: "unsubscribe";
|
|
37
|
+
runId?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
type: "unsubscribe";
|
|
40
|
+
runId?: string | undefined;
|
|
41
|
+
}>]>;
|
|
42
|
+
export declare function parseAgentStreamMessage(payload: unknown): {
|
|
43
|
+
ok: true;
|
|
44
|
+
data: z.infer<typeof AgentStreamMessageSchema>;
|
|
45
|
+
} | {
|
|
46
|
+
ok: false;
|
|
47
|
+
error: string;
|
|
48
|
+
};
|
|
49
|
+
export declare function canAccessAgentRunStream(sixb: Sixb<readonly OntologySource[]>, input: {
|
|
50
|
+
readonly runId: string;
|
|
51
|
+
readonly authz: AuthorizationContext | null;
|
|
52
|
+
}): Promise<{
|
|
53
|
+
ok: true;
|
|
54
|
+
} | {
|
|
55
|
+
ok: false;
|
|
56
|
+
message: string;
|
|
57
|
+
}>;
|
|
58
|
+
export declare function registerAgentStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
|
|
59
|
+
decorator: {};
|
|
60
|
+
store: {};
|
|
61
|
+
derive: {};
|
|
62
|
+
resolve: {};
|
|
63
|
+
}, {
|
|
64
|
+
typebox: {};
|
|
65
|
+
error: {};
|
|
66
|
+
}, {
|
|
67
|
+
schema: {};
|
|
68
|
+
standaloneSchema: {};
|
|
69
|
+
macro: {};
|
|
70
|
+
macroFn: {};
|
|
71
|
+
parser: {};
|
|
72
|
+
response: {};
|
|
73
|
+
}, {
|
|
74
|
+
ws: {
|
|
75
|
+
agents: {
|
|
76
|
+
subscribe: {
|
|
77
|
+
body: {};
|
|
78
|
+
params: {};
|
|
79
|
+
query: {};
|
|
80
|
+
headers: {};
|
|
81
|
+
response: {};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
derive: {};
|
|
87
|
+
resolve: {};
|
|
88
|
+
schema: {};
|
|
89
|
+
standaloneSchema: {};
|
|
90
|
+
response: {};
|
|
91
|
+
}, {
|
|
92
|
+
derive: {};
|
|
93
|
+
resolve: {};
|
|
94
|
+
schema: {};
|
|
95
|
+
standaloneSchema: {};
|
|
96
|
+
response: {};
|
|
97
|
+
}>;
|
|
98
|
+
export {};
|
|
99
|
+
//# sourceMappingURL=agents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/agents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAG5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA2B9C,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA8D,CAAA;AAM5F,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GACpD;IACE,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAC/C,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,CAcJ;AAED,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,CAAC,SAAS,cAAc,EAAE,CAAC,EACrC,KAAK,EAAE;IACL,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAA;CAC5C,GACA,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAwBxD;AAED,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCxE"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { Elysia } from "elysia";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { SixbServer } from "../../server";
|
|
4
|
+
declare const SubscriptionMessageSchema: z.ZodUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"subscribe">;
|
|
6
|
+
topic: z.ZodOptional<z.ZodEnum<["objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets", ...("objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets")[]]>>;
|
|
7
|
+
types: z.ZodOptional<z.ZodArray<z.ZodEnum<["object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed", ...("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[]]>, "many">>;
|
|
8
|
+
objectTypeId: z.ZodOptional<z.ZodString>;
|
|
9
|
+
primaryId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
actionId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
afterCursor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
type: "subscribe";
|
|
16
|
+
limit?: number | undefined;
|
|
17
|
+
objectTypeId?: string | undefined;
|
|
18
|
+
actionId?: string | undefined;
|
|
19
|
+
runId?: string | undefined;
|
|
20
|
+
primaryId?: string | undefined;
|
|
21
|
+
types?: ("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[] | undefined;
|
|
22
|
+
topic?: "objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets" | undefined;
|
|
23
|
+
afterCursor?: string | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
type: "subscribe";
|
|
26
|
+
limit?: number | undefined;
|
|
27
|
+
objectTypeId?: string | undefined;
|
|
28
|
+
actionId?: string | undefined;
|
|
29
|
+
runId?: string | undefined;
|
|
30
|
+
primaryId?: string | undefined;
|
|
31
|
+
types?: ("object.created" | "action.requested" | "object.updated" | "object.deleted" | "telemetry.appended" | "link.created" | "link.updated" | "link.deleted" | "action.completed" | "action.failed" | "schedule.triggered" | "rule.triggered" | "rule.resolved" | "sync.run.started" | "sync.run.finished" | "pipeline.run.started" | "pipeline.run.step.started" | "pipeline.run.step.finished" | "pipeline.run.finished" | "workflow.run.queued" | "workflow.run.started" | "workflow.run.node.started" | "workflow.run.waiting" | "workflow.run.node.waiting" | "workflow.run.node.finished" | "workflow.run.finished" | "workflow.intervention.requested" | "workflow.intervention.submitted" | "workflow.intervention.cancelled" | "workflow.intervention.expired" | "dataset.version.committed")[] | undefined;
|
|
32
|
+
topic?: "objects" | "telemetry" | "links" | "actions" | "schedules" | "rules" | "syncs" | "pipelines" | "workflows" | "datasets" | undefined;
|
|
33
|
+
afterCursor?: string | undefined;
|
|
34
|
+
}>, z.ZodObject<{
|
|
35
|
+
type: z.ZodLiteral<"unsubscribe">;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
type: "unsubscribe";
|
|
38
|
+
}, {
|
|
39
|
+
type: "unsubscribe";
|
|
40
|
+
}>]>;
|
|
41
|
+
export declare function parseSubscriptionMessage(payload: unknown): {
|
|
42
|
+
ok: true;
|
|
43
|
+
data: z.infer<typeof SubscriptionMessageSchema>;
|
|
44
|
+
} | {
|
|
45
|
+
ok: false;
|
|
46
|
+
error: string;
|
|
47
|
+
};
|
|
48
|
+
export declare function registerEventStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
|
|
49
|
+
decorator: {};
|
|
50
|
+
store: {};
|
|
51
|
+
derive: {};
|
|
52
|
+
resolve: {};
|
|
53
|
+
}, {
|
|
54
|
+
typebox: {};
|
|
55
|
+
error: {};
|
|
56
|
+
}, {
|
|
57
|
+
schema: {};
|
|
58
|
+
standaloneSchema: {};
|
|
59
|
+
macro: {};
|
|
60
|
+
macroFn: {};
|
|
61
|
+
parser: {};
|
|
62
|
+
response: {};
|
|
63
|
+
}, {
|
|
64
|
+
ws: {
|
|
65
|
+
events: {
|
|
66
|
+
subscribe: {
|
|
67
|
+
body: {};
|
|
68
|
+
params: {};
|
|
69
|
+
query: {};
|
|
70
|
+
headers: {};
|
|
71
|
+
response: {};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
}, {
|
|
76
|
+
derive: {};
|
|
77
|
+
resolve: {};
|
|
78
|
+
schema: {};
|
|
79
|
+
standaloneSchema: {};
|
|
80
|
+
response: {};
|
|
81
|
+
}, {
|
|
82
|
+
derive: {};
|
|
83
|
+
resolve: {};
|
|
84
|
+
schema: {};
|
|
85
|
+
standaloneSchema: {};
|
|
86
|
+
response: {};
|
|
87
|
+
}>;
|
|
88
|
+
export {};
|
|
89
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/events.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAkC9C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgD,CAAA;AAE/E,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GACrD;IACE,EAAE,EAAE,IAAI,CAAA;IACR,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAChD,GACD;IACE,EAAE,EAAE,KAAK,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;CACd,CAcJ;AAuBD,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6JxE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Elysia } from "elysia";
|
|
2
|
+
import type { SixbServer } from "../../server";
|
|
3
|
+
export declare function registerWebSocketRoutes(app: Elysia, server: SixbServer): Elysia<"", {
|
|
4
|
+
decorator: {};
|
|
5
|
+
store: {};
|
|
6
|
+
derive: {};
|
|
7
|
+
resolve: {};
|
|
8
|
+
}, {
|
|
9
|
+
typebox: {};
|
|
10
|
+
error: {};
|
|
11
|
+
}, {
|
|
12
|
+
schema: {};
|
|
13
|
+
standaloneSchema: {};
|
|
14
|
+
macro: {};
|
|
15
|
+
macroFn: {};
|
|
16
|
+
parser: {};
|
|
17
|
+
response: {};
|
|
18
|
+
}, {}, {
|
|
19
|
+
derive: {};
|
|
20
|
+
resolve: {};
|
|
21
|
+
schema: {};
|
|
22
|
+
standaloneSchema: {};
|
|
23
|
+
response: {};
|
|
24
|
+
}, {
|
|
25
|
+
derive: {};
|
|
26
|
+
resolve: {};
|
|
27
|
+
schema: {};
|
|
28
|
+
standaloneSchema: {};
|
|
29
|
+
response: {};
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAK9C,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKtE"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { LogLevel, LogRunRef, OntologySource, Sixb, SixbRunKind } from "@sixb/core";
|
|
2
|
+
interface LogSocket {
|
|
3
|
+
send(message: string): unknown;
|
|
4
|
+
close(code?: number, reason?: string): unknown;
|
|
5
|
+
readonly raw?: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface LogSubscriptionFilter {
|
|
8
|
+
readonly kinds?: readonly SixbRunKind[];
|
|
9
|
+
readonly levels?: readonly LogLevel[];
|
|
10
|
+
readonly run?: LogRunRef;
|
|
11
|
+
readonly afterCursor?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* One broker subscription per server/project, multiplexed to all connected
|
|
15
|
+
* clients. Each client has a bounded queue so a slow socket cannot retain an
|
|
16
|
+
* unbounded portion of the process heap.
|
|
17
|
+
*/
|
|
18
|
+
export declare class LogSubscriptionHub {
|
|
19
|
+
private readonly sixb;
|
|
20
|
+
private readonly clients;
|
|
21
|
+
private readonly subscriptionGenerations;
|
|
22
|
+
private startPromise;
|
|
23
|
+
private unsubscribeBroker;
|
|
24
|
+
private closed;
|
|
25
|
+
constructor(sixb: Sixb<readonly OntologySource[]>);
|
|
26
|
+
subscribe(key: object, ws: LogSocket, filter: LogSubscriptionFilter, onSubscribed: () => void): Promise<void>;
|
|
27
|
+
unsubscribe(key: object): void;
|
|
28
|
+
private removeClient;
|
|
29
|
+
private nextSubscriptionGeneration;
|
|
30
|
+
private isCurrentSubscription;
|
|
31
|
+
close(): Promise<void>;
|
|
32
|
+
private ensureStarted;
|
|
33
|
+
private deliverLive;
|
|
34
|
+
private catchUp;
|
|
35
|
+
private enqueue;
|
|
36
|
+
private enqueueReplay;
|
|
37
|
+
private pushQueuedLine;
|
|
38
|
+
private enqueuePendingLive;
|
|
39
|
+
private scheduleFlush;
|
|
40
|
+
private flush;
|
|
41
|
+
private waitForQueueProgress;
|
|
42
|
+
private notifyQueueProgress;
|
|
43
|
+
private send;
|
|
44
|
+
private fail;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=log-subscription-hub.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-subscription-hub.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/log-subscription-hub.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,SAAS,EACT,cAAc,EACd,IAAI,EACJ,WAAW,EAEZ,MAAM,YAAY,CAAA;AAUnB,UAAU,SAAS;IACjB,IA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B,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,KAAK;IAiBb,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,mBAAmB;IAM3B,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,IAAI;CAsBb"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Elysia } from "elysia";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import type { SixbServer } from "../../server";
|
|
4
|
+
declare const SubscriptionMessageSchema: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"subscribe">;
|
|
6
|
+
kinds: z.ZodOptional<z.ZodArray<z.ZodEnum<["action", "agent", "pipeline", "projection", "sync", "webhook", "workflow"]>, "many">>;
|
|
7
|
+
levels: z.ZodOptional<z.ZodArray<z.ZodEnum<["debug", "info", "warn", "error"]>, "many">>;
|
|
8
|
+
run: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
kind: z.ZodEnum<["action", "agent", "pipeline", "projection", "sync", "webhook", "workflow"]>;
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
13
|
+
id: string;
|
|
14
|
+
}, {
|
|
15
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
16
|
+
id: string;
|
|
17
|
+
}>>;
|
|
18
|
+
afterCursor: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
type: "subscribe";
|
|
21
|
+
run?: {
|
|
22
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
23
|
+
id: string;
|
|
24
|
+
} | undefined;
|
|
25
|
+
afterCursor?: string | undefined;
|
|
26
|
+
kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
|
|
27
|
+
levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
type: "subscribe";
|
|
30
|
+
run?: {
|
|
31
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
32
|
+
id: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
afterCursor?: string | undefined;
|
|
35
|
+
kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
|
|
36
|
+
levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
|
|
37
|
+
}>, {
|
|
38
|
+
type: "subscribe";
|
|
39
|
+
run?: {
|
|
40
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
41
|
+
id: string;
|
|
42
|
+
} | undefined;
|
|
43
|
+
afterCursor?: string | undefined;
|
|
44
|
+
kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
|
|
45
|
+
levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
type: "subscribe";
|
|
48
|
+
run?: {
|
|
49
|
+
kind: "action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow";
|
|
50
|
+
id: string;
|
|
51
|
+
} | undefined;
|
|
52
|
+
afterCursor?: string | undefined;
|
|
53
|
+
kinds?: ("action" | "agent" | "webhook" | "sync" | "pipeline" | "projection" | "workflow")[] | undefined;
|
|
54
|
+
levels?: ("error" | "debug" | "info" | "warn")[] | undefined;
|
|
55
|
+
}>, z.ZodObject<{
|
|
56
|
+
type: z.ZodLiteral<"unsubscribe">;
|
|
57
|
+
}, "strip", z.ZodTypeAny, {
|
|
58
|
+
type: "unsubscribe";
|
|
59
|
+
}, {
|
|
60
|
+
type: "unsubscribe";
|
|
61
|
+
}>]>;
|
|
62
|
+
export declare function parseLogSubscriptionMessage(payload: unknown): {
|
|
63
|
+
ok: true;
|
|
64
|
+
data: z.infer<typeof SubscriptionMessageSchema>;
|
|
65
|
+
} | {
|
|
66
|
+
ok: false;
|
|
67
|
+
error: string;
|
|
68
|
+
};
|
|
69
|
+
export declare function registerLogStreamRoutes(app: Elysia, server: SixbServer): Elysia<"", {
|
|
70
|
+
decorator: {};
|
|
71
|
+
store: {};
|
|
72
|
+
derive: {};
|
|
73
|
+
resolve: {};
|
|
74
|
+
}, {
|
|
75
|
+
typebox: {};
|
|
76
|
+
error: {};
|
|
77
|
+
}, {
|
|
78
|
+
schema: {};
|
|
79
|
+
standaloneSchema: {};
|
|
80
|
+
macro: {};
|
|
81
|
+
macroFn: {};
|
|
82
|
+
parser: {};
|
|
83
|
+
response: {};
|
|
84
|
+
}, {
|
|
85
|
+
ws: {
|
|
86
|
+
logs: {
|
|
87
|
+
subscribe: {
|
|
88
|
+
body: {};
|
|
89
|
+
params: {};
|
|
90
|
+
query: {};
|
|
91
|
+
headers: {};
|
|
92
|
+
response: {};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
}, {
|
|
97
|
+
derive: {};
|
|
98
|
+
resolve: {};
|
|
99
|
+
schema: {};
|
|
100
|
+
standaloneSchema: {};
|
|
101
|
+
response: {};
|
|
102
|
+
}, {
|
|
103
|
+
derive: {};
|
|
104
|
+
resolve: {};
|
|
105
|
+
schema: {};
|
|
106
|
+
standaloneSchema: {};
|
|
107
|
+
response: {};
|
|
108
|
+
}>;
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../../src/routes/ws/logs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AA4B9C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgD,CAAA;AAE/E,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,GACf;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAY9F;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEtE"}
|