@opencode/server 2.3.2 → 2.4.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/dist/api.d.ts +249 -1
- package/dist/api.js +5 -5
- package/dist/auth.js +1 -1
- package/dist/chunks/workerd-0rzj25w4.js +194 -0
- package/dist/chunks/{media-uri-2eaky32g.js → workerd-20wvj9q6.js} +2 -2
- package/dist/chunks/{media-uri-39nnfjx1.js → workerd-39nnfjx1.js} +1 -1
- package/dist/chunks/{media-uri-tbqv89f6.js → workerd-3rn5pzng.js} +5 -5
- package/dist/chunks/{media-uri-ny1j968n.js → workerd-4apj6a8e.js} +2 -2
- package/dist/chunks/{media-uri-09kw3a77.js → workerd-4gbck4qg.js} +2 -2
- package/dist/chunks/{media-uri-91858wp1.js → workerd-4r2ye500.js} +2 -2
- package/dist/chunks/{media-uri-sssj0qa5.js → workerd-5dgtfnrn.js} +47 -20
- package/dist/chunks/{media-uri-az0609r6.js → workerd-6t6fd9bq.js} +2 -4
- package/dist/chunks/{media-uri-wmep189j.js → workerd-73tyf2qy.js} +8 -8
- package/dist/chunks/{media-uri-cmnrxx36.js → workerd-77gnb026.js} +4 -4
- package/dist/chunks/{media-uri-z3e7v67k.js → workerd-7dtbad8d.js} +7 -7
- package/dist/chunks/{media-uri-kkdkqt8j.js → workerd-7x6cg3xs.js} +2 -4
- package/dist/chunks/{media-uri-78rcgzsr.js → workerd-7ydfwv45.js} +4 -1
- package/dist/chunks/{media-uri-yk755swr.js → workerd-86dz2n4m.js} +5 -4
- package/dist/chunks/{media-uri-1h6b4sc5.js → workerd-8mfdzabk.js} +6 -18
- package/dist/chunks/{media-uri-btahnm2b.js → workerd-8n1ypg70.js} +3 -3
- package/dist/chunks/{media-uri-8sb6qqpn.js → workerd-8sb6qqpn.js} +1 -1
- package/dist/chunks/{media-uri-qd0r787n.js → workerd-b1x3j2e8.js} +2 -2
- package/dist/chunks/{media-uri-qcg3sqtb.js → workerd-b7yt2ykh.js} +2 -2
- package/dist/chunks/{media-uri-4q6e7fh8.js → workerd-b87bs0cf.js} +2 -2
- package/dist/chunks/{media-uri-z9zyd4qg.js → workerd-bvm82fhd.js} +4 -4
- package/dist/chunks/{media-uri-rha2aq18.js → workerd-d0advawr.js} +2 -5
- package/dist/chunks/{media-uri-djr0jy89.js → workerd-djr0jy89.js} +1 -1
- package/dist/chunks/{media-uri-ssxxka7j.js → workerd-dqfyxmp4.js} +4 -4
- package/dist/chunks/{media-uri-a8jcac9a.js → workerd-edwk6ehd.js} +1 -1
- package/dist/chunks/{media-uri-qfyg9gb7.js → workerd-fvpjvjpp.js} +7 -7
- package/dist/chunks/{media-uri-cr5sd8bz.js → workerd-g23ffrnz.js} +3 -3
- package/dist/chunks/{media-uri-rs3v36hp.js → workerd-g80pvn6e.js} +2 -2
- package/dist/chunks/{media-uri-cezwbsk5.js → workerd-g97h7k0s.js} +1 -1
- package/dist/chunks/workerd-hgrkvk6s.js +48 -0
- package/dist/chunks/{media-uri-j4at0y5c.js → workerd-j4at0y5c.js} +1 -1
- package/dist/chunks/{media-uri-50bbk3b2.js → workerd-j80tzjj3.js} +4 -12
- package/dist/chunks/{media-uri-3pb3n73h.js → workerd-jpqse2v9.js} +35 -35
- package/dist/chunks/{media-uri-8mj7kvhm.js → workerd-k26h7zjg.js} +2 -2
- package/dist/chunks/{media-uri-b4rhnd07.js → workerd-kffke7z4.js} +15 -9
- package/dist/chunks/{media-uri-myqk22k5.js → workerd-myqk22k5.js} +2 -2
- package/dist/chunks/{media-uri-htyf2qs7.js → workerd-n6ypjnhz.js} +1 -1
- package/dist/chunks/{media-uri-6kawhtwy.js → workerd-nkfbbfe7.js} +4 -4
- package/dist/chunks/{media-uri-5cpb32hf.js → workerd-p4zkxzv7.js} +1 -1
- package/dist/chunks/{media-uri-enp1bp7r.js → workerd-p9wp66hf.js} +1 -1
- package/dist/chunks/{media-uri-6z9pvq7p.js → workerd-pv4dnzzq.js} +1 -1
- package/dist/chunks/{media-uri-b3bmdkga.js → workerd-qahj7606.js} +1 -1
- package/dist/chunks/{media-uri-7b9xm1qg.js → workerd-rktygpea.js} +4 -1
- package/dist/chunks/{media-uri-j87xz9bt.js → workerd-s8t5gq7c.js} +3 -3
- package/dist/chunks/{media-uri-t32e1bbt.js → workerd-t32e1bbt.js} +1 -1
- package/dist/chunks/{media-uri-p86kew8c.js → workerd-t62b1gmw.js} +2 -2
- package/dist/chunks/{media-uri-te8jwba1.js → workerd-t8azv5ge.js} +2 -2
- package/dist/chunks/{media-uri-d0edqfxx.js → workerd-v0z8pce5.js} +3 -6
- package/dist/chunks/{media-uri-n0chxnkn.js → workerd-vxy32kc1.js} +4 -4
- package/dist/chunks/{media-uri-1gwc8nvb.js → workerd-w13ad1dk.js} +3 -3
- package/dist/chunks/{media-uri-mzs0n5xz.js → workerd-w9jcwh65.js} +7 -7
- package/dist/chunks/{media-uri-zcvan105.js → workerd-wh07bcjv.js} +1 -1
- package/dist/chunks/{media-uri-f559fakr.js → workerd-zrptb2x8.js} +2 -2
- package/dist/content-headers.js +1 -1
- package/dist/cors.js +1 -1
- package/dist/event-feed.js +5 -5
- package/dist/fetch.js +60 -59
- package/dist/handlers/agent.js +6 -6
- package/dist/handlers/artifact.js +3 -3
- package/dist/handlers/automation.d.ts +2 -4
- package/dist/handlers/automation.js +2 -2
- package/dist/handlers/blob.js +3 -3
- package/dist/handlers/command.js +6 -6
- package/dist/handlers/config.js +6 -6
- package/dist/handlers/credential.d.ts +1 -1
- package/dist/handlers/credential.js +7 -7
- package/dist/handlers/debug.js +6 -6
- package/dist/handlers/event.js +7 -7
- package/dist/handlers/form.js +6 -6
- package/dist/handlers/fs.js +8 -8
- package/dist/handlers/generate.js +6 -6
- package/dist/handlers/integration.js +6 -6
- package/dist/handlers/job.d.ts +13 -1
- package/dist/handlers/job.js +2 -2
- package/dist/handlers/location.js +6 -6
- package/dist/handlers/machine.d.ts +95 -0
- package/dist/handlers/machine.js +18 -0
- package/dist/handlers/mcp.js +8 -8
- package/dist/handlers/media.js +2 -2
- package/dist/handlers/message.js +7 -7
- package/dist/handlers/migration.js +6 -6
- package/dist/handlers/model.js +6 -6
- package/dist/handlers/permission.js +6 -6
- package/dist/handlers/persistent-pty.d.ts +1 -1
- package/dist/handlers/persistent-pty.js +16 -15
- package/dist/handlers/plugin.js +6 -6
- package/dist/handlers/project.js +6 -6
- package/dist/handlers/provider.js +6 -6
- package/dist/handlers/pty-socket.js +1 -1
- package/dist/handlers/pty.js +8 -8
- package/dist/handlers/reference.js +6 -6
- package/dist/handlers/rpc.js +6 -6
- package/dist/handlers/server.js +9 -9
- package/dist/handlers/session-error.js +1 -1
- package/dist/handlers/session.js +7 -7
- package/dist/handlers/shell.js +6 -6
- package/dist/handlers/skill.js +6 -6
- package/dist/handlers/usage.js +6 -6
- package/dist/handlers/vcs.js +6 -6
- package/dist/handlers/voice.js +6 -6
- package/dist/handlers/websearch.js +6 -6
- package/dist/handlers/worktree.js +6 -6
- package/dist/handlers.d.ts +1 -1
- package/dist/handlers.js +53 -52
- package/dist/location.d.ts +1 -3
- package/dist/location.js +4 -6
- package/dist/media-uri.js +1 -1
- package/dist/middleware/authorization.js +2 -2
- package/dist/middleware/defect-response.js +1 -1
- package/dist/middleware/form-location.js +3 -3
- package/dist/middleware/schema-error.js +1 -1
- package/dist/middleware/session-location.js +3 -3
- package/dist/pairing.js +3 -3
- package/dist/process.js +72 -63
- package/dist/range.js +1 -1
- package/dist/request-site.js +2 -2
- package/dist/request-tracing.js +1 -1
- package/dist/routes.d.ts +6 -2
- package/dist/routes.js +57 -56
- package/dist/server-info.js +5 -5
- package/dist/service-status.js +1 -1
- package/dist/workerd.js +63 -60
- package/package.json +8 -8
- package/dist/chunks/media-uri-9cd3a4b8.js +0 -69
- /package/dist/chunks/{media-uri-9rqn6x4v.js → workerd-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{media-uri-bd8755ek.js → workerd-bd8755ek.js} +0 -0
- /package/dist/chunks/{media-uri-n26yr6pw.js → workerd-n26yr6pw.js} +0 -0
- /package/dist/chunks/{media-uri-q187pxxd.js → workerd-q187pxxd.js} +0 -0
- /package/dist/chunks/{media-uri-q4bn6dy8.js → workerd-q4bn6dy8.js} +0 -0
- /package/dist/chunks/{media-uri-smaf4a18.js → workerd-smaf4a18.js} +0 -0
- /package/dist/chunks/{media-uri-xthc02cw.js → workerd-xthc02cw.js} +0 -0
- /package/dist/chunks/{media-uri-yc7nft6q.js → workerd-yc7nft6q.js} +0 -0
package/dist/workerd.js
CHANGED
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import"./chunks/
|
|
2
|
-
import"./chunks/
|
|
3
|
-
import"./chunks/
|
|
4
|
-
import"./chunks/
|
|
5
|
-
import"./chunks/
|
|
6
|
-
import"./chunks/
|
|
7
|
-
import"./chunks/
|
|
8
|
-
import"./chunks/
|
|
9
|
-
import"./chunks/
|
|
10
|
-
import"./chunks/
|
|
11
|
-
import"./chunks/
|
|
12
|
-
import"./chunks/
|
|
13
|
-
import"./chunks/
|
|
14
|
-
import"./chunks/
|
|
15
|
-
import"./chunks/
|
|
16
|
-
import"./chunks/
|
|
17
|
-
import"./chunks/
|
|
18
|
-
import"./chunks/
|
|
19
|
-
import"./chunks/
|
|
20
|
-
import"./chunks/
|
|
21
|
-
import"./chunks/
|
|
22
|
-
import"./chunks/
|
|
23
|
-
import"./chunks/
|
|
24
|
-
import"./chunks/
|
|
25
|
-
import"./chunks/
|
|
26
|
-
import"./chunks/
|
|
27
|
-
import"./chunks/
|
|
28
|
-
import"./chunks/
|
|
29
|
-
import"./chunks/
|
|
30
|
-
import"./chunks/
|
|
31
|
-
import"./chunks/
|
|
32
|
-
import"./chunks/
|
|
33
|
-
import"./chunks/
|
|
34
|
-
import"./chunks/
|
|
35
|
-
import"./chunks/
|
|
36
|
-
import"./chunks/
|
|
37
|
-
import"./chunks/
|
|
38
|
-
import"./chunks/
|
|
39
|
-
import"./chunks/
|
|
40
|
-
import"./chunks/
|
|
41
|
-
import"./chunks/
|
|
42
|
-
import"./chunks/
|
|
43
|
-
import"./chunks/
|
|
44
|
-
import"./chunks/
|
|
45
|
-
import"./chunks/
|
|
46
|
-
import"./chunks/
|
|
47
|
-
import"./chunks/
|
|
48
|
-
import"./chunks/
|
|
49
|
-
import"./chunks/
|
|
50
|
-
import"./chunks/
|
|
51
|
-
import"./chunks/
|
|
52
|
-
import"./chunks/
|
|
53
|
-
import"./chunks/
|
|
54
|
-
import"./chunks/
|
|
55
|
-
import"./chunks/
|
|
56
|
-
import"./chunks/
|
|
57
|
-
import"./chunks/
|
|
58
|
-
import"./chunks/
|
|
1
|
+
import"./chunks/workerd-q4bn6dy8.js";
|
|
2
|
+
import"./chunks/workerd-myqk22k5.js";
|
|
3
|
+
import"./chunks/workerd-yc7nft6q.js";
|
|
4
|
+
import"./chunks/workerd-smaf4a18.js";
|
|
5
|
+
import"./chunks/workerd-j80tzjj3.js";
|
|
6
|
+
import"./chunks/workerd-n6ypjnhz.js";
|
|
7
|
+
import"./chunks/workerd-qahj7606.js";
|
|
8
|
+
import"./chunks/workerd-s8t5gq7c.js";
|
|
9
|
+
import"./chunks/workerd-j4at0y5c.js";
|
|
10
|
+
import"./chunks/workerd-8mfdzabk.js";
|
|
11
|
+
import"./chunks/workerd-v0z8pce5.js";
|
|
12
|
+
import"./chunks/workerd-xthc02cw.js";
|
|
13
|
+
import"./chunks/workerd-w13ad1dk.js";
|
|
14
|
+
import"./chunks/workerd-d0advawr.js";
|
|
15
|
+
import"./chunks/workerd-6t6fd9bq.js";
|
|
16
|
+
import"./chunks/workerd-dqfyxmp4.js";
|
|
17
|
+
import"./chunks/workerd-8n1ypg70.js";
|
|
18
|
+
import"./chunks/workerd-t32e1bbt.js";
|
|
19
|
+
import"./chunks/workerd-8sb6qqpn.js";
|
|
20
|
+
import"./chunks/workerd-vxy32kc1.js";
|
|
21
|
+
import"./chunks/workerd-zrptb2x8.js";
|
|
22
|
+
import"./chunks/workerd-b87bs0cf.js";
|
|
23
|
+
import"./chunks/workerd-4apj6a8e.js";
|
|
24
|
+
import"./chunks/workerd-p4zkxzv7.js";
|
|
25
|
+
import"./chunks/workerd-fvpjvjpp.js";
|
|
26
|
+
import"./chunks/workerd-77gnb026.js";
|
|
27
|
+
import"./chunks/workerd-k26h7zjg.js";
|
|
28
|
+
import"./chunks/workerd-20wvj9q6.js";
|
|
29
|
+
import"./chunks/workerd-7dtbad8d.js";
|
|
30
|
+
import"./chunks/workerd-w9jcwh65.js";
|
|
31
|
+
import"./chunks/workerd-73tyf2qy.js";
|
|
32
|
+
import"./chunks/workerd-b7yt2ykh.js";
|
|
33
|
+
import"./chunks/workerd-q187pxxd.js";
|
|
34
|
+
import"./chunks/workerd-nkfbbfe7.js";
|
|
35
|
+
import"./chunks/workerd-t62b1gmw.js";
|
|
36
|
+
import"./chunks/workerd-g23ffrnz.js";
|
|
37
|
+
import"./chunks/workerd-hgrkvk6s.js";
|
|
38
|
+
import"./chunks/workerd-7ydfwv45.js";
|
|
39
|
+
import"./chunks/workerd-0rzj25w4.js";
|
|
40
|
+
import"./chunks/workerd-djr0jy89.js";
|
|
41
|
+
import"./chunks/workerd-kffke7z4.js";
|
|
42
|
+
import"./chunks/workerd-b1x3j2e8.js";
|
|
43
|
+
import"./chunks/workerd-t8azv5ge.js";
|
|
44
|
+
import"./chunks/workerd-wh07bcjv.js";
|
|
45
|
+
import"./chunks/workerd-4r2ye500.js";
|
|
46
|
+
import"./chunks/workerd-7x6cg3xs.js";
|
|
47
|
+
import"./chunks/workerd-4gbck4qg.js";
|
|
48
|
+
import"./chunks/workerd-bvm82fhd.js";
|
|
49
|
+
import"./chunks/workerd-86dz2n4m.js";
|
|
50
|
+
import"./chunks/workerd-edwk6ehd.js";
|
|
51
|
+
import"./chunks/workerd-p9wp66hf.js";
|
|
52
|
+
import"./chunks/workerd-g80pvn6e.js";
|
|
53
|
+
import"./chunks/workerd-pv4dnzzq.js";
|
|
54
|
+
import"./chunks/workerd-g97h7k0s.js";
|
|
55
|
+
import"./chunks/workerd-jpqse2v9.js";
|
|
56
|
+
import"./chunks/workerd-rktygpea.js";
|
|
57
|
+
import"./chunks/workerd-bd8755ek.js";
|
|
58
|
+
import"./chunks/workerd-n26yr6pw.js";
|
|
59
|
+
import"./chunks/workerd-5dgtfnrn.js";
|
|
59
60
|
import {
|
|
60
61
|
make3
|
|
61
|
-
} from "./chunks/
|
|
62
|
+
} from "./chunks/workerd-3rn5pzng.js";
|
|
62
63
|
import {
|
|
63
64
|
__export
|
|
64
|
-
} from "./chunks/
|
|
65
|
+
} from "./chunks/workerd-9rqn6x4v.js";
|
|
65
66
|
|
|
66
67
|
// src/workerd.ts
|
|
67
68
|
var exports_workerd = {};
|
|
@@ -125,6 +126,8 @@ var npmLayer = Layer.succeed(Npm.Service, Npm.Service.of({
|
|
|
125
126
|
resolve: (name) => Effect.succeed({ directory: "", name }),
|
|
126
127
|
check: () => Effect.succeed(false),
|
|
127
128
|
update: (pkg) => npmUnavailable("Npm.update", pkg),
|
|
129
|
+
follows: () => Effect.succeed(false),
|
|
130
|
+
reject: () => Effect.succeed(false),
|
|
128
131
|
which: () => Effect.undefined
|
|
129
132
|
}));
|
|
130
133
|
var vcsLayer = Layer.succeed(Vcs.Service, Vcs.Service.of({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@opencode/server",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@effect/platform-node": "4.1.0",
|
|
34
34
|
"@effect/platform-node-shared": "4.1.0",
|
|
35
|
-
"@opencode/core": "2.
|
|
36
|
-
"@opencode/protocol": "2.
|
|
37
|
-
"@opencode/schema": "2.
|
|
38
|
-
"@opencode/simulation": "2.
|
|
39
|
-
"@opencode/util": "2.
|
|
35
|
+
"@opencode/core": "2.4.1",
|
|
36
|
+
"@opencode/protocol": "2.4.1",
|
|
37
|
+
"@opencode/schema": "2.4.1",
|
|
38
|
+
"@opencode/simulation": "2.4.1",
|
|
39
|
+
"@opencode/util": "2.4.1",
|
|
40
40
|
"effect": "4.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@opencode/pty": "0.6.0",
|
|
44
|
-
"@opencode/client": "2.
|
|
45
|
-
"@opencode/plugin": "2.
|
|
44
|
+
"@opencode/client": "2.4.1",
|
|
45
|
+
"@opencode/plugin": "2.4.1",
|
|
46
46
|
"@tsconfig/bun": "1.0.9",
|
|
47
47
|
"@types/bun": "1.4.3",
|
|
48
48
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
missingSession2
|
|
3
|
-
} from "./media-uri-smaf4a18.js";
|
|
4
|
-
|
|
5
|
-
// src/handlers/automation.ts
|
|
6
|
-
import { Automation } from "@opencode/core/automation";
|
|
7
|
-
import { Permission } from "@opencode/core/permission";
|
|
8
|
-
import { Project } from "@opencode/core/project";
|
|
9
|
-
import { Session } from "@opencode/core/session";
|
|
10
|
-
import { AbsolutePath } from "@opencode/core/schema";
|
|
11
|
-
import { AutomationNotFoundError, ForbiddenError, InvalidRequestError } from "@opencode/protocol/errors";
|
|
12
|
-
import { Effect } from "effect";
|
|
13
|
-
import path from "node:path";
|
|
14
|
-
import { HttpApiSchema } from "effect/http-api";
|
|
15
|
-
var makeAutomation2 = Effect.gen(function* () {
|
|
16
|
-
const automations = yield* Automation.Service;
|
|
17
|
-
const sessions = yield* Session.Service;
|
|
18
|
-
const projects = yield* Project.Service;
|
|
19
|
-
const enabled = (directory) => automations.enabled(directory).pipe(Effect.catchTag("FileSystem.DirectoryNotFoundError", () => Effect.succeed(true)));
|
|
20
|
-
const allowed = (directory) => enabled(directory).pipe(Effect.flatMap((on) => on ? Effect.void : Effect.fail(disabled())));
|
|
21
|
-
const find = (id) => Effect.gen(function* () {
|
|
22
|
-
const info = yield* automations.get(id).pipe(Effect.mapError(missingAutomation));
|
|
23
|
-
yield* allowed(info.directory);
|
|
24
|
-
return info;
|
|
25
|
-
});
|
|
26
|
-
return {
|
|
27
|
-
create: (payload) => automations.create(payload).pipe(Effect.provideService(Permission.Unattended, []), Effect.map((data) => ({ data })), Effect.catchTags({
|
|
28
|
-
"Automation.InvalidError": (error) => Effect.fail(new InvalidRequestError({ message: error.message, kind: "automation" })),
|
|
29
|
-
"Automation.DisabledError": () => Effect.fail(disabled()),
|
|
30
|
-
"Permission.BlockedError": (error) => Effect.fail(new ForbiddenError({ message: error.message })),
|
|
31
|
-
"Permission.CorrectedError": (error) => Effect.fail(new ForbiddenError({ message: error.feedback })),
|
|
32
|
-
"Session.NotFoundError": (error) => Effect.fail(missingSession2(error))
|
|
33
|
-
})),
|
|
34
|
-
list: (query) => Effect.gen(function* () {
|
|
35
|
-
const session = query.sessionID === undefined ? undefined : yield* sessions.get(query.sessionID).pipe(Effect.mapError(missingSession2));
|
|
36
|
-
if (session !== undefined)
|
|
37
|
-
yield* allowed(session.location.directory);
|
|
38
|
-
const directory = query.directory;
|
|
39
|
-
if (directory !== undefined && !path.isAbsolute(directory))
|
|
40
|
-
return yield* new InvalidRequestError({
|
|
41
|
-
message: `Directory must be an absolute path: ${directory}`,
|
|
42
|
-
kind: "automation"
|
|
43
|
-
});
|
|
44
|
-
if (directory !== undefined)
|
|
45
|
-
yield* allowed(directory);
|
|
46
|
-
const projectID = directory === undefined ? undefined : (yield* projects.resolve(AbsolutePath.make(directory), { persist: false })).id;
|
|
47
|
-
const rows = yield* automations.list({ sessionID: query.sessionID });
|
|
48
|
-
const matching = rows.filter((row) => directory === undefined || row.projectID === projectID || row.directory === directory);
|
|
49
|
-
const directories = new Set(matching.map((row) => row.directory));
|
|
50
|
-
const visible = new Set(yield* Effect.filter(directories, enabled));
|
|
51
|
-
return { data: matching.filter((row) => visible.has(row.directory)) };
|
|
52
|
-
}),
|
|
53
|
-
get: (id) => find(id).pipe(Effect.map((data) => ({ data }))),
|
|
54
|
-
pause: (id) => find(id).pipe(Effect.andThen(automations.pause(id).pipe(Effect.mapError(missingAutomation))), Effect.map((data) => ({ data }))),
|
|
55
|
-
resume: (id) => find(id).pipe(Effect.andThen(automations.resume(id).pipe(Effect.mapError(missingAutomation))), Effect.map((data) => ({ data }))),
|
|
56
|
-
remove: (id) => find(id).pipe(Effect.andThen(automations.remove(id).pipe(Effect.mapError(missingAutomation))), Effect.as(HttpApiSchema.NoContent.make()))
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
function missingAutomation(error) {
|
|
60
|
-
return new AutomationNotFoundError({
|
|
61
|
-
automationID: error.automationID,
|
|
62
|
-
message: `Automation not found: ${error.automationID}`
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function disabled() {
|
|
66
|
-
return new ForbiddenError({ message: new Automation.DisabledError().message });
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export { makeAutomation2 };
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|