@dual-os/cli 0.0.0-stage → 0.11.0
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 +4 -0
- package/README.md +15 -2
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/auth/credentials.d.ts +17 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +57 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/destination.d.ts +22 -0
- package/dist/auth/destination.d.ts.map +1 -0
- package/dist/auth/destination.js +49 -0
- package/dist/auth/destination.js.map +1 -0
- package/dist/auth/http.d.ts +12 -0
- package/dist/auth/http.d.ts.map +1 -0
- package/dist/auth/http.js +34 -0
- package/dist/auth/http.js.map +1 -0
- package/dist/auth/login.d.ts +22 -0
- package/dist/auth/login.d.ts.map +1 -0
- package/dist/auth/login.js +98 -0
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/protocol.d.ts +26 -0
- package/dist/auth/protocol.d.ts.map +1 -0
- package/dist/auth/protocol.js +31 -0
- package/dist/auth/protocol.js.map +1 -0
- package/dist/baseline.d.ts +18 -0
- package/dist/baseline.d.ts.map +1 -0
- package/dist/baseline.js +22 -0
- package/dist/baseline.js.map +1 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +7 -0
- package/dist/bin.js.map +1 -0
- package/dist/cli.d.ts +19 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +492 -0
- package/dist/cli.js.map +1 -0
- package/dist/create/choices.d.ts +58 -0
- package/dist/create/choices.d.ts.map +1 -0
- package/dist/create/choices.js +121 -0
- package/dist/create/choices.js.map +1 -0
- package/dist/create/deployment.d.ts +48 -0
- package/dist/create/deployment.d.ts.map +1 -0
- package/dist/create/deployment.js +66 -0
- package/dist/create/deployment.js.map +1 -0
- package/dist/create/scaffold.d.ts +57 -0
- package/dist/create/scaffold.d.ts.map +1 -0
- package/dist/create/scaffold.js +198 -0
- package/dist/create/scaffold.js.map +1 -0
- package/dist/create/source-reference.d.ts +39 -0
- package/dist/create/source-reference.d.ts.map +1 -0
- package/dist/create/source-reference.js +185 -0
- package/dist/create/source-reference.js.map +1 -0
- package/dist/create/template.d.ts +116 -0
- package/dist/create/template.d.ts.map +1 -0
- package/dist/create/template.js +211 -0
- package/dist/create/template.js.map +1 -0
- package/dist/diagnostics.d.ts +6 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +18 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/help.d.ts +16 -0
- package/dist/help.d.ts.map +1 -0
- package/dist/help.js +73 -0
- package/dist/help.js.map +1 -0
- package/dist/openapi/bundle.d.ts +18 -0
- package/dist/openapi/bundle.d.ts.map +1 -0
- package/dist/openapi/bundle.js +201 -0
- package/dist/openapi/bundle.js.map +1 -0
- package/dist/openapi/discovery.d.ts +30 -0
- package/dist/openapi/discovery.d.ts.map +1 -0
- package/dist/openapi/discovery.js +325 -0
- package/dist/openapi/discovery.js.map +1 -0
- package/dist/openapi/emit.d.ts +52 -0
- package/dist/openapi/emit.d.ts.map +1 -0
- package/dist/openapi/emit.js +596 -0
- package/dist/openapi/emit.js.map +1 -0
- package/dist/openapi/graphql.d.ts +102 -0
- package/dist/openapi/graphql.d.ts.map +1 -0
- package/dist/openapi/graphql.js +294 -0
- package/dist/openapi/graphql.js.map +1 -0
- package/dist/openapi/identity.d.ts +88 -0
- package/dist/openapi/identity.d.ts.map +1 -0
- package/dist/openapi/identity.js +98 -0
- package/dist/openapi/identity.js.map +1 -0
- package/dist/openapi/mcp.d.ts +21 -0
- package/dist/openapi/mcp.d.ts.map +1 -0
- package/dist/openapi/mcp.js +133 -0
- package/dist/openapi/mcp.js.map +1 -0
- package/dist/openapi/operations.d.ts +165 -0
- package/dist/openapi/operations.d.ts.map +1 -0
- package/dist/openapi/operations.js +361 -0
- package/dist/openapi/operations.js.map +1 -0
- package/dist/openapi/overlay.d.ts +23 -0
- package/dist/openapi/overlay.d.ts.map +1 -0
- package/dist/openapi/overlay.js +115 -0
- package/dist/openapi/overlay.js.map +1 -0
- package/dist/openapi/plugin.d.ts +83 -0
- package/dist/openapi/plugin.d.ts.map +1 -0
- package/dist/openapi/plugin.js +468 -0
- package/dist/openapi/plugin.js.map +1 -0
- package/dist/openapi/polymorphism.d.ts +21 -0
- package/dist/openapi/polymorphism.d.ts.map +1 -0
- package/dist/openapi/polymorphism.js +96 -0
- package/dist/openapi/polymorphism.js.map +1 -0
- package/dist/openapi/postman.d.ts +21 -0
- package/dist/openapi/postman.d.ts.map +1 -0
- package/dist/openapi/postman.js +286 -0
- package/dist/openapi/postman.js.map +1 -0
- package/dist/openapi/schema.d.ts +178 -0
- package/dist/openapi/schema.d.ts.map +1 -0
- package/dist/openapi/schema.js +1234 -0
- package/dist/openapi/schema.js.map +1 -0
- package/dist/openapi/select.d.ts +22 -0
- package/dist/openapi/select.d.ts.map +1 -0
- package/dist/openapi/select.js +79 -0
- package/dist/openapi/select.js.map +1 -0
- package/dist/openapi/spec.d.ts +147 -0
- package/dist/openapi/spec.d.ts.map +1 -0
- package/dist/openapi/spec.js +263 -0
- package/dist/openapi/spec.js.map +1 -0
- package/dist/openapi/swagger.d.ts +166 -0
- package/dist/openapi/swagger.d.ts.map +1 -0
- package/dist/openapi/swagger.js +298 -0
- package/dist/openapi/swagger.js.map +1 -0
- package/dist/openapi/versions.d.ts +52 -0
- package/dist/openapi/versions.d.ts.map +1 -0
- package/dist/openapi/versions.js +120 -0
- package/dist/openapi/versions.js.map +1 -0
- package/dist/plugin/archive.d.ts +27 -0
- package/dist/plugin/archive.d.ts.map +1 -0
- package/dist/plugin/archive.js +170 -0
- package/dist/plugin/archive.js.map +1 -0
- package/dist/plugin/bundle.d.ts +27 -0
- package/dist/plugin/bundle.d.ts.map +1 -0
- package/dist/plugin/bundle.js +328 -0
- package/dist/plugin/bundle.js.map +1 -0
- package/dist/plugin/init.d.ts +18 -0
- package/dist/plugin/init.d.ts.map +1 -0
- package/dist/plugin/init.js +121 -0
- package/dist/plugin/init.js.map +1 -0
- package/dist/plugin/inspection.d.ts +24 -0
- package/dist/plugin/inspection.d.ts.map +1 -0
- package/dist/plugin/inspection.js +24 -0
- package/dist/plugin/inspection.js.map +1 -0
- package/dist/plugin/package.d.ts +26 -0
- package/dist/plugin/package.d.ts.map +1 -0
- package/dist/plugin/package.js +73 -0
- package/dist/plugin/package.js.map +1 -0
- package/dist/plugin/publication.d.ts +29 -0
- package/dist/plugin/publication.d.ts.map +1 -0
- package/dist/plugin/publication.js +65 -0
- package/dist/plugin/publication.js.map +1 -0
- package/dist/plugin/validation.d.ts +15 -0
- package/dist/plugin/validation.d.ts.map +1 -0
- package/dist/plugin/validation.js +119 -0
- package/dist/plugin/validation.js.map +1 -0
- package/dist/release/archives.d.ts +33 -0
- package/dist/release/archives.d.ts.map +1 -0
- package/dist/release/archives.js +81 -0
- package/dist/release/archives.js.map +1 -0
- package/dist/release/release-manifest.d.ts +182 -0
- package/dist/release/release-manifest.d.ts.map +1 -0
- package/dist/release/release-manifest.js +79 -0
- package/dist/release/release-manifest.js.map +1 -0
- package/dist/release/releases.d.ts +36 -0
- package/dist/release/releases.d.ts.map +1 -0
- package/dist/release/releases.js +122 -0
- package/dist/release/releases.js.map +1 -0
- package/dist/skills.d.ts +35 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +257 -0
- package/dist/skills.js.map +1 -0
- package/package.json +73 -4
- package/skills/dual-fde/SKILL.md +38 -0
- package/skills/dual-fde/references/access.md +62 -0
- package/skills/dual-fde/references/author-plugins.md +54 -0
- package/skills/dual-fde/references/cli.md +97 -0
- package/skills/dual-fde/references/manage-plugins.md +78 -0
- package/skills/dual-fde/references/migrations-deployment.md +84 -0
- package/skills/dual-fde/references/openapi-plugins.md +47 -0
- package/skills/dual-fde/references/sdk-docs.md +56 -0
- package/skills/dual-fde/references/upgrades.md +115 -0
- package/skills/dual-fde/references/working-context.md +69 -0
- package/src/auth/credentials.ts +84 -0
- package/src/auth/destination.ts +83 -0
- package/src/auth/http.ts +39 -0
- package/src/auth/login.ts +177 -0
- package/src/auth/protocol.ts +37 -0
- package/src/baseline.ts +15 -0
- package/src/bin.ts +4 -0
- package/src/cli.ts +969 -0
- package/src/create/choices.ts +177 -0
- package/src/create/deployment.ts +96 -0
- package/src/create/scaffold.ts +334 -0
- package/src/create/source-reference.ts +212 -0
- package/src/create/template.ts +300 -0
- package/src/diagnostics.ts +8 -0
- package/src/help.ts +142 -0
- package/src/openapi/bundle.ts +290 -0
- package/src/openapi/discovery.ts +438 -0
- package/src/openapi/emit.ts +1031 -0
- package/src/openapi/graphql.ts +375 -0
- package/src/openapi/identity.ts +153 -0
- package/src/openapi/mcp.ts +165 -0
- package/src/openapi/operations.ts +781 -0
- package/src/openapi/overlay.ts +195 -0
- package/src/openapi/plugin.ts +856 -0
- package/src/openapi/polymorphism.ts +207 -0
- package/src/openapi/postman.ts +403 -0
- package/src/openapi/schema.ts +2138 -0
- package/src/openapi/select.ts +113 -0
- package/src/openapi/spec.ts +401 -0
- package/src/openapi/swagger.ts +422 -0
- package/src/openapi/versions.ts +174 -0
- package/src/plugin/archive.ts +244 -0
- package/src/plugin/bundle.ts +572 -0
- package/src/plugin/init.ts +178 -0
- package/src/plugin/inspection.ts +19 -0
- package/src/plugin/package.ts +140 -0
- package/src/plugin/publication.ts +128 -0
- package/src/plugin/validation.ts +213 -0
- package/src/release/archives.ts +133 -0
- package/src/release/release-manifest.ts +79 -0
- package/src/release/releases.ts +210 -0
- package/src/skills.ts +434 -0
- package/templates/compose/.env.compose.example.hbs +3 -0
- package/templates/compose/.env.host.example.hbs +4 -0
- package/templates/compose/Dockerfile.hbs +12 -0
- package/templates/compose/OPERATIONS.md.hbs +159 -0
- package/templates/compose/_dockerignore +14 -0
- package/templates/compose/compose.external.yaml +7 -0
- package/templates/compose/compose.host-linux.yaml +5 -0
- package/templates/compose/compose.host.yaml.hbs +15 -0
- package/templates/compose/compose.yaml.hbs +85 -0
- package/templates/compose/release.env.hbs +2 -0
- package/templates/default/.env.example.hbs +79 -0
- package/templates/default/README.md.hbs +150 -0
- package/templates/default/_gitignore +11 -0
- package/templates/default/packages/customer-plugin/src/Customer.ts.hbs +17 -0
- package/templates/default/packages/customer-plugin/tsconfig.json +15 -0
- package/templates/default/packages/execution-layer/src/App.ts.hbs +7 -0
- package/templates/default/packages/execution-layer/src/Host.ts.hbs +31 -0
- package/templates/default/packages/execution-layer/src/Telemetry.ts.hbs +23 -0
- package/templates/default/packages/execution-layer/src/api.ts.hbs +21 -0
- package/templates/default/packages/execution-layer/src/bootstrap.ts +22 -0
- package/templates/default/packages/execution-layer/src/migrate.ts +11 -0
- package/templates/default/packages/execution-layer/src/registry-check.ts +29 -0
- package/templates/default/packages/execution-layer/src/registry-sync.ts +14 -0
- package/templates/default/packages/execution-layer/src/worker.ts.hbs +16 -0
- package/templates/default/packages/execution-layer/test/app.host-test.ts.hbs +58 -0
- package/templates/default/packages/execution-layer/test/app.test.ts.hbs +16 -0
- package/templates/default/tsconfig.json +5 -0
- package/templates/default/vitest.config.ts +5 -0
- package/templates/default/vitest.host.config.ts +6 -0
- package/templates/opensandbox/OPEN-SANDBOX.md +25 -0
- package/templates/opensandbox/docker/agent-sandbox.Dockerfile +41 -0
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Array,
|
|
3
|
+
MutableRef,
|
|
4
|
+
Number,
|
|
5
|
+
Option,
|
|
6
|
+
Predicate,
|
|
7
|
+
Record,
|
|
8
|
+
Result,
|
|
9
|
+
Schema,
|
|
10
|
+
String,
|
|
11
|
+
pipe,
|
|
12
|
+
} from "effect";
|
|
13
|
+
|
|
14
|
+
import type { OpenApiSpec } from "./spec.ts";
|
|
15
|
+
|
|
16
|
+
export type Overlay = typeof Overlay.Type;
|
|
17
|
+
export const Overlay = Schema.Struct({
|
|
18
|
+
actions: Schema.Array(
|
|
19
|
+
Schema.Struct({
|
|
20
|
+
description: Schema.optionalKey(Schema.String),
|
|
21
|
+
remove: Schema.optionalKey(Schema.Boolean),
|
|
22
|
+
target: Schema.String,
|
|
23
|
+
update: Schema.optionalKey(Schema.Unknown),
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
overlay: Schema.String.check(Schema.isPattern(/^1\.\d+\.\d+$/u)),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
type Step =
|
|
30
|
+
| { readonly _tag: "Key"; readonly key: string }
|
|
31
|
+
| { readonly _tag: "All" }
|
|
32
|
+
| { readonly _tag: "Descendants" }
|
|
33
|
+
| { _tag: "Filter"; conditions: Condition[] };
|
|
34
|
+
|
|
35
|
+
type Condition = { key: string; value?: string | number | boolean };
|
|
36
|
+
|
|
37
|
+
const stepPattern =
|
|
38
|
+
/^(?:\.([A-Za-z0-9_$@-]+)|\.\*|\[\*\]|\['((?:[^'\\]|\\.)*)'\]|\["((?:[^"\\]|\\.)*)"\])/u;
|
|
39
|
+
|
|
40
|
+
const filterPattern =
|
|
41
|
+
/^\[\?((?:[^[\]'"]|\[(?:'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")\]|'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*")*)\]/u;
|
|
42
|
+
|
|
43
|
+
const conditionPattern =
|
|
44
|
+
/^\(?@(?:\.([A-Za-z0-9_$-]+)|\['((?:[^'\\]|\\.)*)'\])\)?(?:\s*==\s*('(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?|true|false))?$/u;
|
|
45
|
+
|
|
46
|
+
function literal(text: string) {
|
|
47
|
+
if (text === "true" || text === "false") return text === "true";
|
|
48
|
+
if (pipe(text, String.startsWith("'")) || pipe(text, String.startsWith('"'))) {
|
|
49
|
+
return pipe(text, String.slice(1, -1), String.replaceAll(/\\(.)/gu, "$1"));
|
|
50
|
+
}
|
|
51
|
+
return pipe(
|
|
52
|
+
Number.parse(text),
|
|
53
|
+
Option.getOrElse(() => 0),
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function steps(target: string): Result.Result<readonly Step[], string> {
|
|
58
|
+
if (!pipe(target, String.startsWith("$"))) {
|
|
59
|
+
return Result.fail(`overlay target ${target} must start with $`);
|
|
60
|
+
}
|
|
61
|
+
function parse(rest: string, parsed: readonly Step[]): Result.Result<readonly Step[], string> {
|
|
62
|
+
if (String.isEmpty(rest)) return Result.succeed(parsed);
|
|
63
|
+
if (pipe(rest, String.startsWith(".."))) {
|
|
64
|
+
const tail = pipe(rest, String.slice(2));
|
|
65
|
+
return parse(pipe(tail, String.startsWith("[")) ? tail : `.${tail}`, [
|
|
66
|
+
...parsed,
|
|
67
|
+
{ _tag: "Descendants" },
|
|
68
|
+
]);
|
|
69
|
+
}
|
|
70
|
+
const filter = filterPattern.exec(rest);
|
|
71
|
+
if (Predicate.isNotNull(filter)) {
|
|
72
|
+
const parsedConditions = Result.all(
|
|
73
|
+
Array.map(pipe(filter[1] ?? "", String.split("&&")), term => {
|
|
74
|
+
const match = conditionPattern.exec(String.trim(term));
|
|
75
|
+
if (Predicate.isNull(match)) return Result.failVoid;
|
|
76
|
+
const key = pipe(match[1] ?? match[2] ?? "", String.replaceAll(/\\(.)/gu, "$1"));
|
|
77
|
+
return Result.succeed(
|
|
78
|
+
match[3] === undefined ? { key } : { key, value: literal(match[3]) },
|
|
79
|
+
);
|
|
80
|
+
}),
|
|
81
|
+
);
|
|
82
|
+
if (Result.isFailure(parsedConditions)) {
|
|
83
|
+
return Result.fail(`overlay target ${target} has a filter beyond @.key and @.key == value`);
|
|
84
|
+
}
|
|
85
|
+
return parse(pipe(rest, String.slice(filter[0].length)), [
|
|
86
|
+
...parsed,
|
|
87
|
+
{ _tag: "Filter", conditions: parsedConditions.success },
|
|
88
|
+
]);
|
|
89
|
+
}
|
|
90
|
+
const match = stepPattern.exec(rest);
|
|
91
|
+
if (match === null) {
|
|
92
|
+
return Result.fail(
|
|
93
|
+
`overlay target ${target} uses JSONPath beyond names and wildcards at ${rest}`,
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
const name = match[1] ?? match[2] ?? match[3];
|
|
97
|
+
return parse(pipe(rest, String.slice(match[0].length)), [
|
|
98
|
+
...parsed,
|
|
99
|
+
name === undefined
|
|
100
|
+
? { _tag: "All" }
|
|
101
|
+
: { _tag: "Key", key: pipe(name, String.replaceAll(/\\(.)/gu, "$1")) },
|
|
102
|
+
]);
|
|
103
|
+
}
|
|
104
|
+
return parse(pipe(target, String.slice(1)), []);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function merge(target: unknown, update: unknown): unknown {
|
|
108
|
+
if (Array.isArray(target)) {
|
|
109
|
+
return Array.isArray(update) ? [...target, ...update] : [...target, update];
|
|
110
|
+
}
|
|
111
|
+
if (!Predicate.isObject(target) || !Predicate.isObject(update) || Array.isArray(update)) {
|
|
112
|
+
return update;
|
|
113
|
+
}
|
|
114
|
+
return Record.reduce(update, { ...target }, (merged, value, key) => ({
|
|
115
|
+
...merged,
|
|
116
|
+
[key]: Record.has(merged, key) ? merge(merged[key], value) : value,
|
|
117
|
+
}));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function apply(
|
|
121
|
+
node: unknown,
|
|
122
|
+
path: readonly Step[],
|
|
123
|
+
change: (value: unknown) => Result.Result<unknown, void>,
|
|
124
|
+
): unknown {
|
|
125
|
+
return Array.matchLeft(path, {
|
|
126
|
+
onEmpty: () => node,
|
|
127
|
+
onNonEmpty: (selected, rest) => {
|
|
128
|
+
function visit(value: unknown) {
|
|
129
|
+
return Array.isReadonlyArrayEmpty(rest)
|
|
130
|
+
? change(value)
|
|
131
|
+
: Result.succeed(apply(value, rest, change));
|
|
132
|
+
}
|
|
133
|
+
if (selected._tag === "Descendants") {
|
|
134
|
+
const here = apply(node, rest, change);
|
|
135
|
+
if (Array.isArray(here)) return Array.map(here, value => apply(value, path, change));
|
|
136
|
+
return Predicate.isObject(here)
|
|
137
|
+
? Record.map(here, value => apply(value, path, change))
|
|
138
|
+
: here;
|
|
139
|
+
}
|
|
140
|
+
function selects(value: unknown, key: string) {
|
|
141
|
+
if (selected._tag === "Key") return selected.key === key;
|
|
142
|
+
if (selected._tag === "Filter") {
|
|
143
|
+
return (
|
|
144
|
+
Predicate.isObject(value) &&
|
|
145
|
+
!Array.isArray(value) &&
|
|
146
|
+
Array.every(
|
|
147
|
+
selected.conditions,
|
|
148
|
+
condition =>
|
|
149
|
+
Record.has(value, condition.key) &&
|
|
150
|
+
(condition.value === undefined || value[condition.key] === condition.value),
|
|
151
|
+
)
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
return true;
|
|
155
|
+
}
|
|
156
|
+
if (Array.isArray(node)) {
|
|
157
|
+
return Array.flatMap(node, (value, index) =>
|
|
158
|
+
selects(value, `${index}`)
|
|
159
|
+
? Result.match(visit(value), { onFailure: () => [], onSuccess: kept => [kept] })
|
|
160
|
+
: [value],
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
if (!Predicate.isObject(node)) return node;
|
|
164
|
+
return Record.filterMap(node, (value, key) =>
|
|
165
|
+
selects(value, key) ? visit(value) : Result.succeed(value),
|
|
166
|
+
);
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Applies an OpenAPI Overlay 1.x document: each action updates or removes the nodes its target
|
|
173
|
+
* selects. A target that selects nothing fails, so an overlay cannot silently stop applying.
|
|
174
|
+
*/
|
|
175
|
+
export function applyOverlay(document: OpenApiSpec.JsonObject, overlay: Overlay) {
|
|
176
|
+
const initial: Result.Result<unknown, string> = Result.succeed(document);
|
|
177
|
+
return Array.reduce(overlay.actions, initial, (current, action) =>
|
|
178
|
+
Result.flatMap(current, value =>
|
|
179
|
+
Result.flatMap(steps(action.target), path => {
|
|
180
|
+
if (Array.isReadonlyArrayEmpty(path)) return Result.succeed(merge(value, action.update));
|
|
181
|
+
const matched = MutableRef.make(0);
|
|
182
|
+
const changed = apply(value, path, found => {
|
|
183
|
+
MutableRef.update(matched, Number.increment);
|
|
184
|
+
if (action.remove === true) return Result.failVoid;
|
|
185
|
+
return Result.succeed(action.update === undefined ? found : merge(found, action.update));
|
|
186
|
+
});
|
|
187
|
+
return MutableRef.get(matched) === 0
|
|
188
|
+
? Result.fail(`overlay target ${action.target} selects nothing`)
|
|
189
|
+
: Result.succeed(changed);
|
|
190
|
+
}),
|
|
191
|
+
),
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export * as OpenApiOverlay from "./overlay.ts";
|