@zyraxon-ai/protocol 19.0.4
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/api.d.ts +17525 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/api.js +51 -0
- package/dist/api.js.map +1 -0
- package/dist/errors.d.ts +80 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +60 -0
- package/dist/errors.js.map +1 -0
- package/dist/groups/agent.d.ts +92 -0
- package/dist/groups/agent.d.ts.map +1 -0
- package/dist/groups/agent.js +16 -0
- package/dist/groups/agent.js.map +1 -0
- package/dist/groups/command.d.ts +52 -0
- package/dist/groups/command.d.ts.map +1 -0
- package/dist/groups/command.js +21 -0
- package/dist/groups/command.js.map +1 -0
- package/dist/groups/credential.d.ts +24 -0
- package/dist/groups/credential.d.ts.map +1 -0
- package/dist/groups/credential.js +29 -0
- package/dist/groups/credential.js.map +1 -0
- package/dist/groups/event.d.ts +14987 -0
- package/dist/groups/event.d.ts.map +1 -0
- package/dist/groups/event.js +43 -0
- package/dist/groups/event.js.map +1 -0
- package/dist/groups/fs.d.ts +36 -0
- package/dist/groups/fs.d.ts.map +1 -0
- package/dist/groups/fs.js +52 -0
- package/dist/groups/fs.js.map +1 -0
- package/dist/groups/health.d.ts +6 -0
- package/dist/groups/health.d.ts.map +1 -0
- package/dist/groups/health.js +10 -0
- package/dist/groups/health.js.map +1 -0
- package/dist/groups/integration.d.ts +106 -0
- package/dist/groups/integration.d.ts.map +1 -0
- package/dist/groups/integration.js +99 -0
- package/dist/groups/integration.js.map +1 -0
- package/dist/groups/location.d.ts +17 -0
- package/dist/groups/location.d.ts.map +1 -0
- package/dist/groups/location.js +33 -0
- package/dist/groups/location.js.map +1 -0
- package/dist/groups/message.d.ts +398 -0
- package/dist/groups/message.d.ts.map +1 -0
- package/dist/groups/message.js +38 -0
- package/dist/groups/message.js.map +1 -0
- package/dist/groups/model.d.ts +152 -0
- package/dist/groups/model.d.ts.map +1 -0
- package/dist/groups/model.js +23 -0
- package/dist/groups/model.js.map +1 -0
- package/dist/groups/permission.d.ts +154 -0
- package/dist/groups/permission.d.ts.map +1 -0
- package/dist/groups/permission.js +100 -0
- package/dist/groups/permission.js.map +1 -0
- package/dist/groups/project-copy.d.ts +50 -0
- package/dist/groups/project-copy.d.ts.map +1 -0
- package/dist/groups/project-copy.js +45 -0
- package/dist/groups/project-copy.js.map +1 -0
- package/dist/groups/provider.d.ts +157 -0
- package/dist/groups/provider.d.ts.map +1 -0
- package/dist/groups/provider.js +35 -0
- package/dist/groups/provider.js.map +1 -0
- package/dist/groups/pty.d.ts +146 -0
- package/dist/groups/pty.d.ts.map +1 -0
- package/dist/groups/pty.js +113 -0
- package/dist/groups/pty.js.map +1 -0
- package/dist/groups/question.d.ts +93 -0
- package/dist/groups/question.d.ts.map +1 -0
- package/dist/groups/question.js +57 -0
- package/dist/groups/question.js.map +1 -0
- package/dist/groups/reference.d.ts +14 -0
- package/dist/groups/reference.d.ts.map +1 -0
- package/dist/groups/reference.js +21 -0
- package/dist/groups/reference.js.map +1 -0
- package/dist/groups/session.d.ts +7394 -0
- package/dist/groups/session.d.ts.map +1 -0
- package/dist/groups/session.js +281 -0
- package/dist/groups/session.js.map +1 -0
- package/dist/groups/skill.d.ts +19 -0
- package/dist/groups/skill.d.ts.map +1 -0
- package/dist/groups/skill.js +21 -0
- package/dist/groups/skill.js.map +1 -0
- package/dist/middleware/authorization.d.ts +14 -0
- package/dist/middleware/authorization.d.ts.map +1 -0
- package/dist/middleware/authorization.js +7 -0
- package/dist/middleware/authorization.js.map +1 -0
- package/dist/middleware/schema-error.d.ts +14 -0
- package/dist/middleware/schema-error.d.ts.map +1 -0
- package/dist/middleware/schema-error.js +5 -0
- package/dist/middleware/schema-error.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
export declare const FileSystemGroup: HttpApiGroup.HttpApiGroup<"server.fs", HttpApiEndpoint.HttpApiEndpoint<"fs.read", "GET", "/api/fs/read/*", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
5
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
6
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
7
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Uint8Array>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.list", "GET", "/api/fs/list", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
10
|
+
readonly path: Schema.optional<Schema.brand<Schema.String, "RelativePath">>;
|
|
11
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
12
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
13
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
14
|
+
}>>;
|
|
15
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
16
|
+
readonly location: typeof Location.Info;
|
|
17
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
18
|
+
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
19
|
+
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"fs.find", "GET", "/api/fs/find", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
22
|
+
readonly query: Schema.String;
|
|
23
|
+
readonly type: Schema.decodeTo<Schema.optional<Schema.toType<Schema.Literals<readonly ["file", "directory"]>>>, Schema.optionalKey<Schema.Literals<readonly ["file", "directory"]>>, never, never>;
|
|
24
|
+
readonly limit: Schema.optional<Schema.compose<Schema.Int, Schema.NumberFromString>>;
|
|
25
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
26
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
27
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
28
|
+
}>>;
|
|
29
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
30
|
+
readonly location: typeof Location.Info;
|
|
31
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
32
|
+
readonly path: Schema.brand<Schema.String, "RelativePath">;
|
|
33
|
+
readonly type: Schema.Literals<readonly ["file", "directory"]>;
|
|
34
|
+
}>>;
|
|
35
|
+
}>>, HttpApiEndpoint.Json<never>, never, never>, false>;
|
|
36
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/groups/fs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAEtD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAA0B,MAAM,yBAAyB,CAAA;AAe/F,eAAO,MAAM,eAAe;;;;;;;;;;;;;;uBAiDo5G,OAAQ,KAAK,CAAC,OAAO,MAAM;uBAAqC,OAAQ,QAAQ;;;;;;;;;;;;;uBAAhF,OAAQ,KAAK,CAAC,OAAO,MAAM;uBAAqC,OAAQ,QAAQ;;uDAD7/G,CAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { FileSystem } from "@zyraxon-ai/schema/filesystem";
|
|
2
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
3
|
+
import { PositiveInt, RelativePath } from "@zyraxon-ai/schema/schema";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
6
|
+
import { LocationQuery, locationQueryOpenApi } from "./location";
|
|
7
|
+
const ListQuery = Schema.Struct({
|
|
8
|
+
...LocationQuery.fields,
|
|
9
|
+
path: RelativePath.pipe(Schema.optional),
|
|
10
|
+
});
|
|
11
|
+
const FindQuery = Schema.Struct({
|
|
12
|
+
...LocationQuery.fields,
|
|
13
|
+
query: FileSystem.FindInput.fields.query,
|
|
14
|
+
type: FileSystem.FindInput.fields.type,
|
|
15
|
+
limit: Schema.NumberFromString.pipe(Schema.decodeTo(PositiveInt), Schema.optional),
|
|
16
|
+
});
|
|
17
|
+
export const FileSystemGroup = HttpApiGroup.make("server.fs")
|
|
18
|
+
.add(HttpApiEndpoint.get("fs.read", "/api/fs/read/*", {
|
|
19
|
+
query: LocationQuery,
|
|
20
|
+
success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
|
|
21
|
+
})
|
|
22
|
+
.annotateMerge(locationQueryOpenApi)
|
|
23
|
+
.annotateMerge(OpenApi.annotations({
|
|
24
|
+
identifier: "v2.fs.read",
|
|
25
|
+
summary: "Read file",
|
|
26
|
+
description: "Serve one file relative to the requested location.",
|
|
27
|
+
})))
|
|
28
|
+
.add(HttpApiEndpoint.get("fs.list", "/api/fs/list", {
|
|
29
|
+
query: ListQuery,
|
|
30
|
+
success: Location.response(Schema.Array(FileSystem.Entry)),
|
|
31
|
+
})
|
|
32
|
+
.annotateMerge(locationQueryOpenApi)
|
|
33
|
+
.annotateMerge(OpenApi.annotations({
|
|
34
|
+
identifier: "v2.fs.list",
|
|
35
|
+
summary: "List directory",
|
|
36
|
+
description: "List direct children of one directory relative to the requested location.",
|
|
37
|
+
})))
|
|
38
|
+
.add(HttpApiEndpoint.get("fs.find", "/api/fs/find", {
|
|
39
|
+
query: FindQuery,
|
|
40
|
+
success: Location.response(Schema.Array(FileSystem.Entry)),
|
|
41
|
+
})
|
|
42
|
+
.annotateMerge(locationQueryOpenApi)
|
|
43
|
+
.annotateMerge(OpenApi.annotations({
|
|
44
|
+
identifier: "v2.fs.find",
|
|
45
|
+
summary: "Find files",
|
|
46
|
+
description: "Find recursively ranked filesystem entries relative to the requested location.",
|
|
47
|
+
})))
|
|
48
|
+
.annotateMerge(OpenApi.annotations({
|
|
49
|
+
title: "filesystem",
|
|
50
|
+
description: "Experimental location-scoped filesystem routes.",
|
|
51
|
+
}));
|
|
52
|
+
//# sourceMappingURL=fs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../src/groups/fs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAC/F,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEhE,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,GAAG,aAAa,CAAC,MAAM;IACvB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;CACzC,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,GAAG,aAAa,CAAC,MAAM;IACvB,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK;IACxC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;IACtC,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EAAE,YAAY;IACxB,OAAO,EAAE,YAAY;IACrB,WAAW,EAAE,gFAAgF;CAC9F,CAAC,CACH,CACJ;KACA,aAAa,CACZ,OAAO,CAAC,WAAW,CAAC;IAClB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,iDAAiD;CAC/D,CAAC,CACH,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
3
|
+
export declare const HealthGroup: HttpApiGroup.HttpApiGroup<"server.health", HttpApiEndpoint.HttpApiEndpoint<"health.get", "GET", "/api/health", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
4
|
+
readonly healthy: Schema.Literal<true>;
|
|
5
|
+
}>>, HttpApiEndpoint.Json<never>, never, never>, false>;
|
|
6
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/groups/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAW,MAAM,yBAAyB,CAAA;AAEhF,eAAO,MAAM,WAAW;;uDAUvB,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
3
|
+
export const HealthGroup = HttpApiGroup.make("server.health").add(HttpApiEndpoint.get("health.get", "/api/health", {
|
|
4
|
+
success: Schema.Struct({ healthy: Schema.Literal(true) }),
|
|
5
|
+
}).annotateMerge(OpenApi.annotations({
|
|
6
|
+
identifier: "v2.health.get",
|
|
7
|
+
summary: "Check server health",
|
|
8
|
+
description: "Check whether the API server is ready to accept requests.",
|
|
9
|
+
})));
|
|
10
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/groups/health.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEhF,MAAM,CAAC,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAC/D,eAAe,CAAC,GAAG,CAAC,YAAY,EAAE,aAAa,EAAE;IAC/C,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;CAC1D,CAAC,CAAC,aAAa,CACd,OAAO,CAAC,WAAW,CAAC;IAClB,UAAU,EAAE,eAAe;IAC3B,OAAO,EAAE,qBAAqB;IAC9B,WAAW,EAAE,2DAA2D;CACzE,CAAC,CACH,CACF,CAAA"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Integration } from "@zyraxon-ai/schema/integration";
|
|
2
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/unstable/httpapi";
|
|
5
|
+
import { InvalidRequestError } from "../errors";
|
|
6
|
+
export declare const IntegrationGroup: HttpApiGroup.HttpApiGroup<"server.integration", HttpApiEndpoint.HttpApiEndpoint<"integration.list", "GET", "/api/integration", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
7
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
8
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
9
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
10
|
+
}>>;
|
|
11
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
12
|
+
readonly location: typeof Location.Info;
|
|
13
|
+
readonly data: Schema.$Array<typeof Integration.Info>;
|
|
14
|
+
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.get", "GET", "/api/integration/:integrationID", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
15
|
+
integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
16
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
17
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
18
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
19
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
20
|
+
}>>;
|
|
21
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
22
|
+
readonly location: typeof Location.Info;
|
|
23
|
+
readonly data: Schema.UndefinedOr<typeof Integration.Info>;
|
|
24
|
+
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.connect.key", "POST", "/api/integration/:integrationID/connect/key", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
25
|
+
integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
26
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
27
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
28
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
29
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
30
|
+
}>>;
|
|
31
|
+
}>>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
32
|
+
readonly key: Schema.String;
|
|
33
|
+
readonly label: Schema.optional<Schema.String>;
|
|
34
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.connect.oauth", "POST", "/api/integration/:integrationID/connect/oauth", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
35
|
+
integrationID: Schema.brand<Schema.String, "Integration.ID">;
|
|
36
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
37
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
38
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
39
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
40
|
+
}>>;
|
|
41
|
+
}>>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
42
|
+
readonly methodID: Schema.brand<Schema.String, "Integration.MethodID">;
|
|
43
|
+
readonly inputs: Schema.$Record<Schema.String, Schema.String>;
|
|
44
|
+
readonly label: Schema.optional<Schema.String>;
|
|
45
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
46
|
+
readonly location: typeof Location.Info;
|
|
47
|
+
readonly data: typeof Integration.Attempt;
|
|
48
|
+
}>>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.status", "GET", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
49
|
+
attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
|
|
50
|
+
create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
|
|
51
|
+
};
|
|
52
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
53
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
54
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
55
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
56
|
+
}>>;
|
|
57
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
58
|
+
readonly location: typeof Location.Info;
|
|
59
|
+
readonly data: Schema.Union<readonly [Schema.Struct<{
|
|
60
|
+
readonly status: Schema.Literal<"pending">;
|
|
61
|
+
readonly time: Schema.Struct<{
|
|
62
|
+
readonly created: Schema.Number;
|
|
63
|
+
readonly expires: Schema.Number;
|
|
64
|
+
}>;
|
|
65
|
+
}>, Schema.Struct<{
|
|
66
|
+
readonly status: Schema.Literal<"complete">;
|
|
67
|
+
readonly time: Schema.Struct<{
|
|
68
|
+
readonly created: Schema.Number;
|
|
69
|
+
readonly expires: Schema.Number;
|
|
70
|
+
}>;
|
|
71
|
+
}>, Schema.Struct<{
|
|
72
|
+
readonly status: Schema.Literal<"failed">;
|
|
73
|
+
readonly message: Schema.String;
|
|
74
|
+
readonly time: Schema.Struct<{
|
|
75
|
+
readonly created: Schema.Number;
|
|
76
|
+
readonly expires: Schema.Number;
|
|
77
|
+
}>;
|
|
78
|
+
}>, Schema.Struct<{
|
|
79
|
+
readonly status: Schema.Literal<"expired">;
|
|
80
|
+
readonly time: Schema.Struct<{
|
|
81
|
+
readonly created: Schema.Number;
|
|
82
|
+
readonly expires: Schema.Number;
|
|
83
|
+
}>;
|
|
84
|
+
}>]>;
|
|
85
|
+
}>>, HttpApiEndpoint.Json<never>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.complete", "POST", "/api/integration/attempt/:attemptID/complete", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
86
|
+
attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
|
|
87
|
+
create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
|
|
88
|
+
};
|
|
89
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
90
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
91
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
92
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
93
|
+
}>>;
|
|
94
|
+
}>>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
95
|
+
readonly code: Schema.optional<Schema.String>;
|
|
96
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<typeof InvalidRequestError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"integration.attempt.cancel", "DELETE", "/api/integration/attempt/:attemptID", HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
97
|
+
attemptID: Schema.brand<Schema.String, "Integration.AttemptID"> & {
|
|
98
|
+
create: () => string & import("effect/Brand").Brand<"Integration.AttemptID">;
|
|
99
|
+
};
|
|
100
|
+
}>>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
101
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
102
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
103
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
104
|
+
}>>;
|
|
105
|
+
}>>, HttpApiEndpoint.Json<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<HttpApiSchema.NoContent>, HttpApiEndpoint.Json<never>, never, never>, false>;
|
|
106
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/groups/integration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAA;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,aAAa,EAAW,MAAM,yBAAyB,CAAA;AAC/F,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAA;AAK/C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAyH4qvB,cAAc;;;;;;;;;;yBAAyuB,OAAQ,OAAO;uBAA+B,OAAQ,MAAM;8BAA4B,OAAQ,MAAM;8BAA2B,OAAQ,MAAM;;;yBAAkD,OAAQ,OAAO;uBAAgC,OAAQ,MAAM;8BAA4B,OAAQ,MAAM;8BAA2B,OAAQ,MAAM;;;yBAAkD,OAAQ,OAAO;0BAAiC,OAAQ,MAAM;uBAAoB,OAAQ,MAAM;8BAA4B,OAAQ,MAAM;8BAA2B,OAAQ,MAAM;;;yBAAkD,OAAQ,OAAO;uBAA+B,OAAQ,MAAM;8BAA4B,OAAQ,MAAM;8BAA2B,OAAQ,MAAM;;;;;sCAA9+C,cAAc;;;;;;;;;;;sCAAd,cAAc;;;;;;;sKADptvB,CAAA"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { Integration } from "@zyraxon-ai/schema/integration";
|
|
2
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
3
|
+
import { Schema } from "effect";
|
|
4
|
+
import { HttpApiEndpoint, HttpApiGroup, HttpApiSchema, OpenApi } from "effect/unstable/httpapi";
|
|
5
|
+
import { InvalidRequestError } from "../errors";
|
|
6
|
+
import { LocationQuery, locationQueryOpenApi } from "./location";
|
|
7
|
+
const Inputs = Schema.Record(Schema.String, Schema.String);
|
|
8
|
+
export const IntegrationGroup = HttpApiGroup.make("server.integration")
|
|
9
|
+
.add(HttpApiEndpoint.get("integration.list", "/api/integration", {
|
|
10
|
+
query: LocationQuery,
|
|
11
|
+
success: Location.response(Schema.Array(Integration.Info)),
|
|
12
|
+
})
|
|
13
|
+
.annotateMerge(locationQueryOpenApi)
|
|
14
|
+
.annotateMerge(OpenApi.annotations({
|
|
15
|
+
identifier: "v2.integration.list",
|
|
16
|
+
summary: "List integrations",
|
|
17
|
+
description: "Retrieve available integrations and their authentication methods.",
|
|
18
|
+
})))
|
|
19
|
+
.add(HttpApiEndpoint.get("integration.get", "/api/integration/:integrationID", {
|
|
20
|
+
params: { integrationID: Integration.ID },
|
|
21
|
+
query: LocationQuery,
|
|
22
|
+
success: Location.response(Schema.UndefinedOr(Integration.Info)),
|
|
23
|
+
})
|
|
24
|
+
.annotateMerge(locationQueryOpenApi)
|
|
25
|
+
.annotateMerge(OpenApi.annotations({
|
|
26
|
+
identifier: "v2.integration.get",
|
|
27
|
+
summary: "Get integration",
|
|
28
|
+
description: "Retrieve one integration and its authentication methods.",
|
|
29
|
+
})))
|
|
30
|
+
.add(HttpApiEndpoint.post("integration.connect.key", "/api/integration/:integrationID/connect/key", {
|
|
31
|
+
params: { integrationID: Integration.ID },
|
|
32
|
+
query: LocationQuery,
|
|
33
|
+
payload: Schema.Struct({
|
|
34
|
+
key: Schema.String,
|
|
35
|
+
label: Schema.optional(Schema.String),
|
|
36
|
+
}),
|
|
37
|
+
success: HttpApiSchema.NoContent,
|
|
38
|
+
error: InvalidRequestError,
|
|
39
|
+
})
|
|
40
|
+
.annotateMerge(locationQueryOpenApi)
|
|
41
|
+
.annotateMerge(OpenApi.annotations({
|
|
42
|
+
identifier: "v2.integration.connect.key",
|
|
43
|
+
summary: "Connect with key",
|
|
44
|
+
description: "Run a key authentication method and store the resulting credential.",
|
|
45
|
+
})))
|
|
46
|
+
.add(HttpApiEndpoint.post("integration.connect.oauth", "/api/integration/:integrationID/connect/oauth", {
|
|
47
|
+
params: { integrationID: Integration.ID },
|
|
48
|
+
query: LocationQuery,
|
|
49
|
+
payload: Schema.Struct({
|
|
50
|
+
methodID: Integration.MethodID,
|
|
51
|
+
inputs: Inputs,
|
|
52
|
+
label: Schema.optional(Schema.String),
|
|
53
|
+
}),
|
|
54
|
+
success: Location.response(Integration.Attempt),
|
|
55
|
+
error: InvalidRequestError,
|
|
56
|
+
})
|
|
57
|
+
.annotateMerge(locationQueryOpenApi)
|
|
58
|
+
.annotateMerge(OpenApi.annotations({
|
|
59
|
+
identifier: "v2.integration.connect.oauth",
|
|
60
|
+
summary: "Begin OAuth connection",
|
|
61
|
+
description: "Start an OAuth attempt and return the authorization details.",
|
|
62
|
+
})))
|
|
63
|
+
.add(HttpApiEndpoint.get("integration.attempt.status", "/api/integration/attempt/:attemptID", {
|
|
64
|
+
params: { attemptID: Integration.AttemptID },
|
|
65
|
+
query: LocationQuery,
|
|
66
|
+
success: Location.response(Integration.AttemptStatus),
|
|
67
|
+
})
|
|
68
|
+
.annotateMerge(locationQueryOpenApi)
|
|
69
|
+
.annotateMerge(OpenApi.annotations({
|
|
70
|
+
identifier: "v2.integration.attempt.status",
|
|
71
|
+
summary: "Get OAuth attempt status",
|
|
72
|
+
description: "Poll the current status of an OAuth attempt.",
|
|
73
|
+
})))
|
|
74
|
+
.add(HttpApiEndpoint.post("integration.attempt.complete", "/api/integration/attempt/:attemptID/complete", {
|
|
75
|
+
params: { attemptID: Integration.AttemptID },
|
|
76
|
+
query: LocationQuery,
|
|
77
|
+
payload: Schema.Struct({ code: Schema.optional(Schema.String) }),
|
|
78
|
+
success: HttpApiSchema.NoContent,
|
|
79
|
+
error: InvalidRequestError,
|
|
80
|
+
})
|
|
81
|
+
.annotateMerge(locationQueryOpenApi)
|
|
82
|
+
.annotateMerge(OpenApi.annotations({
|
|
83
|
+
identifier: "v2.integration.attempt.complete",
|
|
84
|
+
summary: "Complete OAuth connection",
|
|
85
|
+
description: "Complete a code-based OAuth attempt and store the resulting credential.",
|
|
86
|
+
})))
|
|
87
|
+
.add(HttpApiEndpoint.delete("integration.attempt.cancel", "/api/integration/attempt/:attemptID", {
|
|
88
|
+
params: { attemptID: Integration.AttemptID },
|
|
89
|
+
query: LocationQuery,
|
|
90
|
+
success: HttpApiSchema.NoContent,
|
|
91
|
+
})
|
|
92
|
+
.annotateMerge(locationQueryOpenApi)
|
|
93
|
+
.annotateMerge(OpenApi.annotations({
|
|
94
|
+
identifier: "v2.integration.attempt.cancel",
|
|
95
|
+
summary: "Cancel OAuth connection",
|
|
96
|
+
description: "Cancel an OAuth attempt and release its resources.",
|
|
97
|
+
})))
|
|
98
|
+
.annotateMerge(OpenApi.annotations({ title: "integrations", description: "Integration discovery and authentication routes." }));
|
|
99
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,EAAE,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,EAAE;IAC5C,KAAK,EAAE,aAAa;IACpB,OAAO,EAAE,aAAa,CAAC,SAAS;CACjC,CAAC;KACC,aAAa,CAAC,oBAAoB,CAAC;KACnC,aAAa,CACZ,OAAO,CAAC,WAAW,CAAC;IAClB,UAAU,EAAE,+BAA+B;IAC3C,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,oDAAoD;CAClE,CAAC,CACH,CACJ;KACA,aAAa,CACZ,OAAO,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC,CAChH,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
|
|
4
|
+
export declare const LocationQuery: Schema.Struct<{
|
|
5
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
6
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
7
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const locationQueryOpenApi: import("effect/Context").Context<never>;
|
|
11
|
+
export declare const LocationGroup: HttpApiGroup.HttpApiGroup<"server.location", HttpApiEndpoint.HttpApiEndpoint<"location.get", "GET", "/api/location", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<Schema.Struct<{
|
|
12
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
13
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
14
|
+
readonly workspace: Schema.optional<Schema.String>;
|
|
15
|
+
}>>;
|
|
16
|
+
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<typeof Location.Info>, HttpApiEndpoint.Json<never>, never, never>, false>;
|
|
17
|
+
//# sourceMappingURL=location.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../src/groups/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAW,MAAM,yBAAyB,CAAA;AAEhF,eAAO,MAAM,aAAa;;;;;EAOkB,CAAA;AAE5C,eAAO,MAAM,oBAAoB,yCAa/B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;yKAazB,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Location } from "@zyraxon-ai/schema/location";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi";
|
|
4
|
+
export const LocationQuery = Schema.Struct({
|
|
5
|
+
location: Schema.optional(Schema.Struct({
|
|
6
|
+
directory: Schema.optional(Schema.String),
|
|
7
|
+
workspace: Schema.optional(Schema.String),
|
|
8
|
+
})),
|
|
9
|
+
}).annotate({ identifier: "LocationQuery" });
|
|
10
|
+
export const locationQueryOpenApi = OpenApi.annotations({
|
|
11
|
+
transform: (operation) => {
|
|
12
|
+
const parameters = operation.parameters;
|
|
13
|
+
if (!Array.isArray(parameters))
|
|
14
|
+
return operation;
|
|
15
|
+
return {
|
|
16
|
+
...operation,
|
|
17
|
+
parameters: parameters.map((parameter) => parameter?.name === "location" && parameter?.in === "query"
|
|
18
|
+
? { ...parameter, style: "deepObject", explode: true }
|
|
19
|
+
: parameter),
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
export const LocationGroup = HttpApiGroup.make("server.location").add(HttpApiEndpoint.get("location.get", "/api/location", {
|
|
24
|
+
query: LocationQuery,
|
|
25
|
+
success: Location.Info,
|
|
26
|
+
})
|
|
27
|
+
.annotateMerge(locationQueryOpenApi)
|
|
28
|
+
.annotateMerge(OpenApi.annotations({
|
|
29
|
+
identifier: "v2.location.get",
|
|
30
|
+
summary: "Get location",
|
|
31
|
+
description: "Resolve the requested location or the server default location.",
|
|
32
|
+
})));
|
|
33
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../src/groups/location.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEhF,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CACvB,MAAM,CAAC,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACzC,SAAS,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;KAC1C,CAAC,CACH;CACF,CAAC,CAAC,QAAQ,CAAC,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC,CAAA;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;IACtD,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;QACvB,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAA;QACvC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;YAAE,OAAO,SAAS,CAAA;QAChD,OAAO;YACL,GAAG,SAAS;YACZ,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CACvC,SAAS,EAAE,IAAI,KAAK,UAAU,IAAI,SAAS,EAAE,EAAE,KAAK,OAAO;gBACzD,CAAC,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