@radheim/protocol 0.0.0-stage → 2.4.3
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 +60 -0
- package/dist/api.js +81 -0
- package/dist/client.d.ts +69 -0
- package/dist/client.js +102 -0
- package/dist/errors.d.ts +273 -0
- package/dist/errors.js +227 -0
- package/dist/groups/agent.d.ts +299 -0
- package/dist/groups/agent.js +30 -0
- package/dist/groups/artifact.d.ts +173 -0
- package/dist/groups/artifact.js +80 -0
- package/dist/groups/automation.d.ts +480 -0
- package/dist/groups/automation.js +55 -0
- package/dist/groups/blob.d.ts +415 -0
- package/dist/groups/blob.js +79 -0
- package/dist/groups/command.d.ts +15 -0
- package/dist/groups/command.js +20 -0
- package/dist/groups/config.d.ts +27 -0
- package/dist/groups/config.js +32 -0
- package/dist/groups/credential.d.ts +93 -0
- package/dist/groups/credential.js +50 -0
- package/dist/groups/debug.d.ts +22 -0
- package/dist/groups/debug.js +49 -0
- package/dist/groups/event.d.ts +16442 -0
- package/dist/groups/event.js +68 -0
- package/dist/groups/experimental/browser-tunnel.d.ts +20 -0
- package/dist/groups/experimental/browser-tunnel.js +29 -0
- package/dist/groups/experimental.d.ts +1519 -0
- package/dist/groups/experimental.js +12 -0
- package/dist/groups/flag.d.ts +12 -0
- package/dist/groups/flag.js +19 -0
- package/dist/groups/form.d.ts +138 -0
- package/dist/groups/form.js +18 -0
- package/dist/groups/fs.d.ts +60 -0
- package/dist/groups/fs.js +101 -0
- package/dist/groups/generate.d.ts +397 -0
- package/dist/groups/generate.js +77 -0
- package/dist/groups/integration.d.ts +1724 -0
- package/dist/groups/integration.js +169 -0
- package/dist/groups/job.d.ts +95 -0
- package/dist/groups/job.js +45 -0
- package/dist/groups/location.d.ts +23 -0
- package/dist/groups/location.js +47 -0
- package/dist/groups/machine.d.ts +91 -0
- package/dist/groups/machine.js +61 -0
- package/dist/groups/mcp.d.ts +104 -0
- package/dist/groups/mcp.js +125 -0
- package/dist/groups/media.d.ts +8 -0
- package/dist/groups/media.js +18 -0
- package/dist/groups/message.d.ts +3696 -0
- package/dist/groups/message.js +102 -0
- package/dist/groups/migration.d.ts +28 -0
- package/dist/groups/migration.js +21 -0
- package/dist/groups/model.d.ts +536 -0
- package/dist/groups/model.js +39 -0
- package/dist/groups/permission.d.ts +175 -0
- package/dist/groups/permission.js +115 -0
- package/dist/groups/persistent-pty.d.ts +251 -0
- package/dist/groups/persistent-pty.js +109 -0
- package/dist/groups/plugin.d.ts +102 -0
- package/dist/groups/plugin.js +59 -0
- package/dist/groups/project.d.ts +83 -0
- package/dist/groups/project.js +37 -0
- package/dist/groups/provider.d.ts +354 -0
- package/dist/groups/provider.js +34 -0
- package/dist/groups/pty.d.ts +151 -0
- package/dist/groups/pty.js +117 -0
- package/dist/groups/push.d.ts +123 -0
- package/dist/groups/push.js +60 -0
- package/dist/groups/reference.d.ts +25 -0
- package/dist/groups/reference.js +33 -0
- package/dist/groups/rpc.d.ts +21 -0
- package/dist/groups/rpc.js +24 -0
- package/dist/groups/server.d.ts +46 -0
- package/dist/groups/server.js +55 -0
- package/dist/groups/session.d.ts +11874 -0
- package/dist/groups/session.js +663 -0
- package/dist/groups/shell.d.ts +125 -0
- package/dist/groups/shell.js +65 -0
- package/dist/groups/skill.d.ts +26 -0
- package/dist/groups/skill.js +34 -0
- package/dist/groups/space.d.ts +56 -0
- package/dist/groups/space.js +59 -0
- package/dist/groups/usage.d.ts +96 -0
- package/dist/groups/usage.js +22 -0
- package/dist/groups/vcs.d.ts +89 -0
- package/dist/groups/vcs.js +94 -0
- package/dist/groups/voice.d.ts +81 -0
- package/dist/groups/voice.js +75 -0
- package/dist/groups/websearch.d.ts +29 -0
- package/dist/groups/websearch.js +34 -0
- package/dist/groups/worktree.d.ts +41 -0
- package/dist/groups/worktree.js +52 -0
- package/dist/middleware/authorization.d.ts +13 -0
- package/dist/middleware/authorization.js +6 -0
- package/dist/middleware/schema-error.d.ts +13 -0
- package/dist/middleware/schema-error.js +4 -0
- package/dist/simulation/image.d.ts +35 -0
- package/dist/simulation/image.js +21 -0
- package/dist/simulation/terminal.d.ts +81 -0
- package/dist/simulation/terminal.js +49 -0
- package/dist/simulation.d.ts +1784 -0
- package/dist/simulation.js +485 -0
- package/package.json +46 -4
- package/README.md +0 -3
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { HttpApiEndpoint, HttpApiSchema } from "effect/http-api";
|
|
3
|
+
import { ArtifactNotFoundError, FileNotFoundError, ForbiddenError, InvalidRequestError, LocationNotFoundError, ProviderNotFoundError, ServiceUnavailableError, SessionNotFoundError } from "../errors.js";
|
|
4
|
+
/** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
|
|
5
|
+
export declare const ArtifactEndpoints: readonly [HttpApiEndpoint.HttpApiEndpoint<"artifacts.providers", "GET", "/api/experimental/artifacts/providers", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
6
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
7
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
8
|
+
}>>;
|
|
9
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
10
|
+
readonly location: Schema.Struct<{
|
|
11
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
12
|
+
}>;
|
|
13
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
14
|
+
readonly id: Schema.brand<Schema.Trim, "Artifact.ProviderID">;
|
|
15
|
+
readonly name: Schema.String;
|
|
16
|
+
readonly capabilities: Schema.$Array<Schema.Literals<readonly ["static", "server-code", "sqlite", "durable-objects"]>>;
|
|
17
|
+
readonly default: Schema.Boolean;
|
|
18
|
+
}>>;
|
|
19
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ServiceUnavailableError | typeof ForbiddenError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.list", "GET", "/api/experimental/artifacts", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
20
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
21
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
22
|
+
}>>;
|
|
23
|
+
readonly sessionID: Schema.optional<Schema.brand<Schema.String, "SessionID"> & {
|
|
24
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
25
|
+
}>;
|
|
26
|
+
readonly provider: Schema.optional<Schema.brand<Schema.Trim, "Artifact.ProviderID">>;
|
|
27
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
28
|
+
readonly location: Schema.Struct<{
|
|
29
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
30
|
+
}>;
|
|
31
|
+
readonly data: Schema.$Array<Schema.Struct<{
|
|
32
|
+
readonly id: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
33
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
34
|
+
};
|
|
35
|
+
readonly provider: Schema.brand<Schema.Trim, "Artifact.ProviderID">;
|
|
36
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
37
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
38
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
39
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
40
|
+
}>, never, never>;
|
|
41
|
+
readonly title: Schema.String;
|
|
42
|
+
readonly entry: Schema.String;
|
|
43
|
+
readonly url: Schema.String;
|
|
44
|
+
readonly time: Schema.Struct<{
|
|
45
|
+
readonly created: Schema.Finite;
|
|
46
|
+
readonly updated: Schema.Finite;
|
|
47
|
+
}>;
|
|
48
|
+
}>>;
|
|
49
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ServiceUnavailableError | typeof SessionNotFoundError | typeof ForbiddenError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.create", "POST", "/api/experimental/artifacts", never, Schema.toCodecStringTree<Schema.Struct<{
|
|
50
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
51
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
52
|
+
}>>;
|
|
53
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
54
|
+
readonly title: Schema.String;
|
|
55
|
+
readonly files: Schema.$Record<Schema.String, Schema.String>;
|
|
56
|
+
readonly entry: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
57
|
+
readonly provider: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.Trim, "Artifact.ProviderID">>>, Schema.optionalKey<Schema.brand<Schema.Trim, "Artifact.ProviderID">>, never, never>;
|
|
58
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
59
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
60
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
61
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
62
|
+
}>, never, never>;
|
|
63
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
64
|
+
readonly location: Schema.Struct<{
|
|
65
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
66
|
+
}>;
|
|
67
|
+
readonly data: Schema.Struct<{
|
|
68
|
+
readonly id: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
69
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
70
|
+
};
|
|
71
|
+
readonly provider: Schema.brand<Schema.Trim, "Artifact.ProviderID">;
|
|
72
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
73
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
74
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
75
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
76
|
+
}>, never, never>;
|
|
77
|
+
readonly title: Schema.String;
|
|
78
|
+
readonly entry: Schema.String;
|
|
79
|
+
readonly url: Schema.String;
|
|
80
|
+
readonly time: Schema.Struct<{
|
|
81
|
+
readonly created: Schema.Finite;
|
|
82
|
+
readonly updated: Schema.Finite;
|
|
83
|
+
}>;
|
|
84
|
+
}>;
|
|
85
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof ProviderNotFoundError | typeof SessionNotFoundError | typeof ForbiddenError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.get", "GET", "/api/experimental/artifacts/:artifactID", Schema.toCodecStringTree<Schema.Struct<{
|
|
86
|
+
artifactID: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
87
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
88
|
+
};
|
|
89
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
90
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
91
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
92
|
+
}>>;
|
|
93
|
+
}>>, never, never, Schema.toCodecJson<Schema.Struct<{
|
|
94
|
+
readonly location: Schema.Struct<{
|
|
95
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
96
|
+
}>;
|
|
97
|
+
readonly data: Schema.Struct<{
|
|
98
|
+
readonly info: Schema.Struct<{
|
|
99
|
+
readonly id: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
100
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
101
|
+
};
|
|
102
|
+
readonly provider: Schema.brand<Schema.Trim, "Artifact.ProviderID">;
|
|
103
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
104
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
105
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
106
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
107
|
+
}>, never, never>;
|
|
108
|
+
readonly title: Schema.String;
|
|
109
|
+
readonly entry: Schema.String;
|
|
110
|
+
readonly url: Schema.String;
|
|
111
|
+
readonly time: Schema.Struct<{
|
|
112
|
+
readonly created: Schema.Finite;
|
|
113
|
+
readonly updated: Schema.Finite;
|
|
114
|
+
}>;
|
|
115
|
+
}>;
|
|
116
|
+
readonly files: Schema.$Record<Schema.String, Schema.String>;
|
|
117
|
+
}>;
|
|
118
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ServiceUnavailableError | typeof ForbiddenError | typeof ArtifactNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.update", "PATCH", "/api/experimental/artifacts/:artifactID", Schema.toCodecStringTree<Schema.Struct<{
|
|
119
|
+
artifactID: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
120
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
121
|
+
};
|
|
122
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
123
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
124
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
125
|
+
}>>;
|
|
126
|
+
}>>, Schema.toCodecJson<Schema.Struct<{
|
|
127
|
+
readonly title: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
128
|
+
readonly files: Schema.$Record<Schema.String, Schema.String>;
|
|
129
|
+
readonly entry: Schema.decodeTo<Schema.optional<Schema.toType<Schema.String>>, Schema.optionalKey<Schema.String>, never, never>;
|
|
130
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
131
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
132
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
133
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
134
|
+
}>, never, never>;
|
|
135
|
+
}>>, never, Schema.toCodecJson<Schema.Struct<{
|
|
136
|
+
readonly location: Schema.Struct<{
|
|
137
|
+
readonly directory: Schema.brand<Schema.String, "AbsolutePath">;
|
|
138
|
+
}>;
|
|
139
|
+
readonly data: Schema.Struct<{
|
|
140
|
+
readonly id: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
141
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
142
|
+
};
|
|
143
|
+
readonly provider: Schema.brand<Schema.Trim, "Artifact.ProviderID">;
|
|
144
|
+
readonly sessionID: Schema.decodeTo<Schema.optional<Schema.toType<Schema.brand<Schema.String, "SessionID"> & {
|
|
145
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
146
|
+
}>>, Schema.optionalKey<Schema.brand<Schema.String, "SessionID"> & {
|
|
147
|
+
create: () => string & import("effect/Brand").Brand<"SessionID">;
|
|
148
|
+
}>, never, never>;
|
|
149
|
+
readonly title: Schema.String;
|
|
150
|
+
readonly entry: Schema.String;
|
|
151
|
+
readonly url: Schema.String;
|
|
152
|
+
readonly time: Schema.Struct<{
|
|
153
|
+
readonly created: Schema.Finite;
|
|
154
|
+
readonly updated: Schema.Finite;
|
|
155
|
+
}>;
|
|
156
|
+
}>;
|
|
157
|
+
}>>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof SessionNotFoundError | typeof ForbiddenError | typeof ArtifactNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.delete", "DELETE", "/api/experimental/artifacts/:artifactID", Schema.toCodecStringTree<Schema.Struct<{
|
|
158
|
+
artifactID: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
159
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
160
|
+
};
|
|
161
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
162
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
163
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
164
|
+
}>>;
|
|
165
|
+
}>>, never, never, Schema.toCodecJson<HttpApiSchema.NoContent>, Schema.toCodecJson<typeof LocationNotFoundError | typeof ServiceUnavailableError | typeof ForbiddenError | typeof ArtifactNotFoundError>, never, never>, HttpApiEndpoint.HttpApiEndpoint<"artifacts.view", "GET", "/api/experimental/artifacts/:artifactID/view/*", Schema.toCodecStringTree<Schema.Struct<{
|
|
166
|
+
artifactID: Schema.brand<Schema.String, "Artifact.ID"> & {
|
|
167
|
+
create: () => string & import("effect/Brand").Brand<"Artifact.ID">;
|
|
168
|
+
};
|
|
169
|
+
}>>, Schema.toCodecStringTree<Schema.Struct<{
|
|
170
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
171
|
+
readonly directory: Schema.optional<Schema.String>;
|
|
172
|
+
}>>;
|
|
173
|
+
}>>, never, never, Schema.toCodecJson<Schema.Uint8Array>, Schema.toCodecJson<typeof LocationNotFoundError | typeof InvalidRequestError | typeof ServiceUnavailableError | typeof FileNotFoundError | typeof ForbiddenError | typeof ArtifactNotFoundError>, never, never>];
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Artifact } from "@radheim/schema/artifact";
|
|
2
|
+
import { Location } from "@radheim/schema/location";
|
|
3
|
+
import { Session } from "@radheim/schema/session";
|
|
4
|
+
import { Schema } from "effect";
|
|
5
|
+
import { HttpApiEndpoint, HttpApiSchema, OpenApi } from "effect/http-api";
|
|
6
|
+
import { ArtifactNotFoundError, FileNotFoundError, ForbiddenError, InvalidRequestError, LocationNotFoundError, ProviderNotFoundError, ServiceUnavailableError, SessionNotFoundError, } from "../errors.js";
|
|
7
|
+
import { LocationQuery, locationQueryOpenApi } from "./location.js";
|
|
8
|
+
const EXPERIMENTAL = "Experimental: needs experimental.artifacts in the Location's config and may change without notice.";
|
|
9
|
+
const params = { artifactID: Artifact.ID };
|
|
10
|
+
const ListQuery = Schema.Struct({
|
|
11
|
+
...LocationQuery.fields,
|
|
12
|
+
sessionID: Schema.optional(Session.ID),
|
|
13
|
+
provider: Schema.optional(Artifact.ProviderID),
|
|
14
|
+
});
|
|
15
|
+
const annotations = (identifier, summary, description) => OpenApi.annotations({
|
|
16
|
+
identifier: `experimental.artifacts.${identifier}`,
|
|
17
|
+
summary,
|
|
18
|
+
description: `${description} ${EXPERIMENTAL}`,
|
|
19
|
+
transform: (operation) => ({ ...operation, tags: ["experimental"] }),
|
|
20
|
+
});
|
|
21
|
+
const commonErrors = [ForbiddenError, LocationNotFoundError, ServiceUnavailableError];
|
|
22
|
+
const itemErrors = [ArtifactNotFoundError, ...commonErrors];
|
|
23
|
+
/** Lives in the `server.experimental` group (see `groups/experimental.ts`). */
|
|
24
|
+
export const ArtifactEndpoints = [
|
|
25
|
+
HttpApiEndpoint.get("artifacts.providers", "/api/experimental/artifacts/providers", {
|
|
26
|
+
query: LocationQuery,
|
|
27
|
+
success: Location.response(Schema.Array(Artifact.Provider)),
|
|
28
|
+
error: commonErrors,
|
|
29
|
+
})
|
|
30
|
+
.annotateMerge(locationQueryOpenApi)
|
|
31
|
+
.annotateMerge(annotations("providers", "List artifact providers", "Return active artifact providers and default.")),
|
|
32
|
+
HttpApiEndpoint.get("artifacts.list", "/api/experimental/artifacts", {
|
|
33
|
+
query: ListQuery,
|
|
34
|
+
success: Location.response(Schema.Array(Artifact.Info)),
|
|
35
|
+
error: [SessionNotFoundError, ...commonErrors],
|
|
36
|
+
})
|
|
37
|
+
.annotateMerge(locationQueryOpenApi)
|
|
38
|
+
.annotateMerge(annotations("list", "List artifacts", "List published artifacts, newest update first.")),
|
|
39
|
+
HttpApiEndpoint.post("artifacts.create", "/api/experimental/artifacts", {
|
|
40
|
+
query: LocationQuery,
|
|
41
|
+
payload: Artifact.CreateInput,
|
|
42
|
+
success: Location.response(Artifact.Info),
|
|
43
|
+
error: [InvalidRequestError, ProviderNotFoundError, SessionNotFoundError, ...commonErrors],
|
|
44
|
+
})
|
|
45
|
+
.annotateMerge(locationQueryOpenApi)
|
|
46
|
+
.annotateMerge(annotations("create", "Create artifact", "Publish a new artifact through the selected or default artifact provider.")),
|
|
47
|
+
HttpApiEndpoint.get("artifacts.get", "/api/experimental/artifacts/:artifactID", {
|
|
48
|
+
params,
|
|
49
|
+
query: LocationQuery,
|
|
50
|
+
success: Location.response(Artifact.Content),
|
|
51
|
+
error: itemErrors,
|
|
52
|
+
})
|
|
53
|
+
.annotateMerge(locationQueryOpenApi)
|
|
54
|
+
.annotateMerge(annotations("get", "Read artifact", "Read an artifact's metadata and file contents.")),
|
|
55
|
+
HttpApiEndpoint.patch("artifacts.update", "/api/experimental/artifacts/:artifactID", {
|
|
56
|
+
params,
|
|
57
|
+
query: LocationQuery,
|
|
58
|
+
payload: Artifact.UpdateInput,
|
|
59
|
+
success: Location.response(Artifact.Info),
|
|
60
|
+
error: [InvalidRequestError, SessionNotFoundError, ...itemErrors],
|
|
61
|
+
})
|
|
62
|
+
.annotateMerge(locationQueryOpenApi)
|
|
63
|
+
.annotateMerge(annotations("update", "Update artifact", "Replace an artifact's files at the same ID and URL.")),
|
|
64
|
+
HttpApiEndpoint.delete("artifacts.delete", "/api/experimental/artifacts/:artifactID", {
|
|
65
|
+
params,
|
|
66
|
+
query: LocationQuery,
|
|
67
|
+
success: HttpApiSchema.NoContent,
|
|
68
|
+
error: itemErrors,
|
|
69
|
+
})
|
|
70
|
+
.annotateMerge(locationQueryOpenApi)
|
|
71
|
+
.annotateMerge(annotations("delete", "Delete artifact", "Remove an artifact and its stored files.")),
|
|
72
|
+
HttpApiEndpoint.get("artifacts.view", "/api/experimental/artifacts/:artifactID/view/*", {
|
|
73
|
+
params,
|
|
74
|
+
query: LocationQuery,
|
|
75
|
+
success: Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()),
|
|
76
|
+
error: [FileNotFoundError, InvalidRequestError, ...itemErrors],
|
|
77
|
+
})
|
|
78
|
+
.annotateMerge(locationQueryOpenApi)
|
|
79
|
+
.annotateMerge(annotations("view", "View local artifact", "Serve HTML and static files from the local provider.")),
|
|
80
|
+
];
|