@aggrega-ai/aggrega-abi 0.0.0-stage → 0.9.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 +202 -0
- package/README.md +27 -2
- package/dist/abi_version_enums_gen.d.ts +1 -0
- package/dist/abi_version_enums_gen.js +33 -0
- package/dist/annotationtransform_gen.d.ts +56 -0
- package/dist/annotationtransform_gen.js +385 -0
- package/dist/cbor_gen.d.ts +28 -0
- package/dist/cbor_gen.js +413 -0
- package/dist/cli_gen.d.ts +11 -0
- package/dist/cli_gen.js +75 -0
- package/dist/describe_gen.d.ts +165 -0
- package/dist/describe_gen.js +1154 -0
- package/dist/diagnostic_enums_gen.d.ts +3 -0
- package/dist/diagnostic_enums_gen.js +27 -0
- package/dist/diagnostic_gen.d.ts +45 -0
- package/dist/diagnostic_gen.js +309 -0
- package/dist/frp_gen.d.ts +97 -0
- package/dist/frp_gen.js +731 -0
- package/dist/hostfunc_error_enums_gen.d.ts +13 -0
- package/dist/hostfunc_error_enums_gen.js +35 -0
- package/dist/import_gen.d.ts +159 -0
- package/dist/import_gen.js +1050 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +51 -0
- package/dist/ir_gen.d.ts +180 -0
- package/dist/ir_gen.js +1640 -0
- package/dist/linter_gen.d.ts +45 -0
- package/dist/linter_gen.js +374 -0
- package/dist/mutator_gen.d.ts +64 -0
- package/dist/mutator_gen.js +448 -0
- package/dist/orderedmap_gen.d.ts +5 -0
- package/dist/orderedmap_gen.js +186 -0
- package/dist/parse_gen.d.ts +60 -0
- package/dist/parse_gen.js +364 -0
- package/dist/policy_gen.d.ts +69 -0
- package/dist/policy_gen.js +461 -0
- package/dist/providerrender_gen.d.ts +495 -0
- package/dist/providerrender_gen.js +3756 -0
- package/dist/servewire_gen.d.ts +1643 -0
- package/dist/servewire_gen.js +3035 -0
- package/package.json +31 -4
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Diagnostic } from "./diagnostic_gen.ts";
|
|
2
|
+
import { CborDec } from "./cbor_gen.ts";
|
|
3
|
+
export interface LinterInput {
|
|
4
|
+
rule_id: string;
|
|
5
|
+
entity_kind: string;
|
|
6
|
+
proposed: unknown;
|
|
7
|
+
previous?: unknown;
|
|
8
|
+
implemented_component?: unknown;
|
|
9
|
+
release?: unknown;
|
|
10
|
+
components?: Map<string, unknown>;
|
|
11
|
+
source_path?: string;
|
|
12
|
+
policies?: Policies;
|
|
13
|
+
}
|
|
14
|
+
export interface LinterOutput {
|
|
15
|
+
findings: Diagnostic[];
|
|
16
|
+
error?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Policies {
|
|
19
|
+
allow_dynamic_refs?: boolean;
|
|
20
|
+
allow_id_overrides?: boolean;
|
|
21
|
+
allow_direct_x_aggrega_extensions?: boolean;
|
|
22
|
+
allow_aggrega_ai_prefix?: boolean;
|
|
23
|
+
allow_nonstandard_names?: boolean;
|
|
24
|
+
allow_category_mismatches?: boolean;
|
|
25
|
+
allow_undeclared_recipe_provides?: boolean;
|
|
26
|
+
allow_connection_credential_mismatches?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function encodeLinterInput(v: LinterInput): string;
|
|
29
|
+
export declare function decodeLinterInput(data: string): LinterInput;
|
|
30
|
+
export declare function encodeLinterOutput(v: LinterOutput): string;
|
|
31
|
+
export declare function decodeLinterOutput(data: string): LinterOutput;
|
|
32
|
+
export declare function encodePolicies(v: Policies): string;
|
|
33
|
+
export declare function decodePolicies(data: string): Policies;
|
|
34
|
+
export declare function encodeCBORLinterInput(v: LinterInput): Uint8Array;
|
|
35
|
+
export declare function appendCBORLinterInput(out: number[], v: LinterInput): void;
|
|
36
|
+
export declare function decodeCBORLinterInput(data: Uint8Array): LinterInput;
|
|
37
|
+
export declare function decodeCBORLinterInputFrom(dec: CborDec): LinterInput;
|
|
38
|
+
export declare function encodeCBORLinterOutput(v: LinterOutput): Uint8Array;
|
|
39
|
+
export declare function appendCBORLinterOutput(out: number[], v: LinterOutput): void;
|
|
40
|
+
export declare function decodeCBORLinterOutput(data: Uint8Array): LinterOutput;
|
|
41
|
+
export declare function decodeCBORLinterOutputFrom(dec: CborDec): LinterOutput;
|
|
42
|
+
export declare function encodeCBORPolicies(v: Policies): Uint8Array;
|
|
43
|
+
export declare function appendCBORPolicies(out: number[], v: Policies): void;
|
|
44
|
+
export declare function decodeCBORPolicies(data: Uint8Array): Policies;
|
|
45
|
+
export declare function decodeCBORPoliciesFrom(dec: CborDec): Policies;
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
// Copyright 2026 Cognitio s.r.l.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.encodeLinterInput = encodeLinterInput;
|
|
6
|
+
exports.decodeLinterInput = decodeLinterInput;
|
|
7
|
+
exports.encodeLinterOutput = encodeLinterOutput;
|
|
8
|
+
exports.decodeLinterOutput = decodeLinterOutput;
|
|
9
|
+
exports.encodePolicies = encodePolicies;
|
|
10
|
+
exports.decodePolicies = decodePolicies;
|
|
11
|
+
exports.encodeCBORLinterInput = encodeCBORLinterInput;
|
|
12
|
+
exports.appendCBORLinterInput = appendCBORLinterInput;
|
|
13
|
+
exports.decodeCBORLinterInput = decodeCBORLinterInput;
|
|
14
|
+
exports.decodeCBORLinterInputFrom = decodeCBORLinterInputFrom;
|
|
15
|
+
exports.encodeCBORLinterOutput = encodeCBORLinterOutput;
|
|
16
|
+
exports.appendCBORLinterOutput = appendCBORLinterOutput;
|
|
17
|
+
exports.decodeCBORLinterOutput = decodeCBORLinterOutput;
|
|
18
|
+
exports.decodeCBORLinterOutputFrom = decodeCBORLinterOutputFrom;
|
|
19
|
+
exports.encodeCBORPolicies = encodeCBORPolicies;
|
|
20
|
+
exports.appendCBORPolicies = appendCBORPolicies;
|
|
21
|
+
exports.decodeCBORPolicies = decodeCBORPolicies;
|
|
22
|
+
exports.decodeCBORPoliciesFrom = decodeCBORPoliciesFrom;
|
|
23
|
+
// Code generated by internal/tools/typegen from
|
|
24
|
+
// aggrega-schemas/json/wasm-linter-v1beta1.schema.json. DO NOT EDIT.
|
|
25
|
+
// Regenerate with `go generate ./internal/tools/typegen` from the
|
|
26
|
+
// aggrega-cli checkout.
|
|
27
|
+
const diagnostic_gen_ts_1 = require("./diagnostic_gen.js");
|
|
28
|
+
const orderedmap_gen_ts_1 = require("./orderedmap_gen.js");
|
|
29
|
+
const cbor_gen_ts_1 = require("./cbor_gen.js");
|
|
30
|
+
const diagnostic_gen_ts_2 = require("./diagnostic_gen.js");
|
|
31
|
+
function jstr(s) {
|
|
32
|
+
return JSON.stringify(s);
|
|
33
|
+
}
|
|
34
|
+
// encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
|
|
35
|
+
// key order from JSON.parse is preserved, matching the Go and Rust codecs'
|
|
36
|
+
// byte-carry of opaque values. Opaque values are never sorted.
|
|
37
|
+
function encodeOpaque(v) {
|
|
38
|
+
return JSON.stringify(v);
|
|
39
|
+
}
|
|
40
|
+
function encodeLinterInput(v) {
|
|
41
|
+
const parts = [];
|
|
42
|
+
parts.push(`${jstr("rule_id")}:${jstr(v.rule_id)}`);
|
|
43
|
+
parts.push(`${jstr("entity_kind")}:${jstr(v.entity_kind)}`);
|
|
44
|
+
parts.push(`${jstr("proposed")}:${encodeOpaque(v.proposed)}`);
|
|
45
|
+
if (v.previous !== undefined && v.previous !== null)
|
|
46
|
+
parts.push(`${jstr("previous")}:${encodeOpaque(v.previous)}`);
|
|
47
|
+
if (v.implemented_component !== undefined && v.implemented_component !== null)
|
|
48
|
+
parts.push(`${jstr("implemented_component")}:${encodeOpaque(v.implemented_component)}`);
|
|
49
|
+
if (v.release !== undefined && v.release !== null)
|
|
50
|
+
parts.push(`${jstr("release")}:${encodeOpaque(v.release)}`);
|
|
51
|
+
if (v.components !== undefined && v.components.size > 0)
|
|
52
|
+
parts.push(`${jstr("components")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.components, (v0) => encodeOpaque(v0))}`);
|
|
53
|
+
if (v.source_path !== undefined && v.source_path !== "")
|
|
54
|
+
parts.push(`${jstr("source_path")}:${jstr(v.source_path)}`);
|
|
55
|
+
if (v.policies !== undefined)
|
|
56
|
+
parts.push(`${jstr("policies")}:${encodePolicies(v.policies)}`);
|
|
57
|
+
return `{${parts.join(",")}}`;
|
|
58
|
+
}
|
|
59
|
+
function decodeLinterInput(data) {
|
|
60
|
+
const o = {};
|
|
61
|
+
(0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
|
|
62
|
+
switch (k) {
|
|
63
|
+
case "rule_id":
|
|
64
|
+
o["rule_id"] = JSON.parse(raw);
|
|
65
|
+
break;
|
|
66
|
+
case "entity_kind":
|
|
67
|
+
o["entity_kind"] = JSON.parse(raw);
|
|
68
|
+
break;
|
|
69
|
+
case "proposed":
|
|
70
|
+
o["proposed"] = JSON.parse(raw);
|
|
71
|
+
break;
|
|
72
|
+
case "previous":
|
|
73
|
+
o["previous"] = JSON.parse(raw);
|
|
74
|
+
break;
|
|
75
|
+
case "implemented_component":
|
|
76
|
+
o["implemented_component"] = JSON.parse(raw);
|
|
77
|
+
break;
|
|
78
|
+
case "release":
|
|
79
|
+
o["release"] = JSON.parse(raw);
|
|
80
|
+
break;
|
|
81
|
+
case "components":
|
|
82
|
+
o["components"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
83
|
+
break;
|
|
84
|
+
case "source_path":
|
|
85
|
+
o["source_path"] = JSON.parse(raw);
|
|
86
|
+
break;
|
|
87
|
+
case "policies":
|
|
88
|
+
o["policies"] = JSON.parse(raw);
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
return o;
|
|
93
|
+
}
|
|
94
|
+
function encodeLinterOutput(v) {
|
|
95
|
+
const parts = [];
|
|
96
|
+
parts.push(`${jstr("findings")}:${`[${v.findings.map((e0) => (0, diagnostic_gen_ts_1.encodeDiagnostic)(e0)).join(",")}]`}`);
|
|
97
|
+
if (v.error !== undefined && v.error !== "")
|
|
98
|
+
parts.push(`${jstr("error")}:${jstr(v.error)}`);
|
|
99
|
+
return `{${parts.join(",")}}`;
|
|
100
|
+
}
|
|
101
|
+
function decodeLinterOutput(data) {
|
|
102
|
+
return JSON.parse(data);
|
|
103
|
+
}
|
|
104
|
+
function encodePolicies(v) {
|
|
105
|
+
const parts = [];
|
|
106
|
+
if (v.allow_dynamic_refs !== undefined && v.allow_dynamic_refs !== false)
|
|
107
|
+
parts.push(`${jstr("allow_dynamic_refs")}:${String(v.allow_dynamic_refs)}`);
|
|
108
|
+
if (v.allow_id_overrides !== undefined && v.allow_id_overrides !== false)
|
|
109
|
+
parts.push(`${jstr("allow_id_overrides")}:${String(v.allow_id_overrides)}`);
|
|
110
|
+
if (v.allow_direct_x_aggrega_extensions !== undefined && v.allow_direct_x_aggrega_extensions !== false)
|
|
111
|
+
parts.push(`${jstr("allow_direct_x_aggrega_extensions")}:${String(v.allow_direct_x_aggrega_extensions)}`);
|
|
112
|
+
if (v.allow_aggrega_ai_prefix !== undefined && v.allow_aggrega_ai_prefix !== false)
|
|
113
|
+
parts.push(`${jstr("allow_aggrega_ai_prefix")}:${String(v.allow_aggrega_ai_prefix)}`);
|
|
114
|
+
if (v.allow_nonstandard_names !== undefined && v.allow_nonstandard_names !== false)
|
|
115
|
+
parts.push(`${jstr("allow_nonstandard_names")}:${String(v.allow_nonstandard_names)}`);
|
|
116
|
+
if (v.allow_category_mismatches !== undefined && v.allow_category_mismatches !== false)
|
|
117
|
+
parts.push(`${jstr("allow_category_mismatches")}:${String(v.allow_category_mismatches)}`);
|
|
118
|
+
if (v.allow_undeclared_recipe_provides !== undefined && v.allow_undeclared_recipe_provides !== false)
|
|
119
|
+
parts.push(`${jstr("allow_undeclared_recipe_provides")}:${String(v.allow_undeclared_recipe_provides)}`);
|
|
120
|
+
if (v.allow_connection_credential_mismatches !== undefined && v.allow_connection_credential_mismatches !== false)
|
|
121
|
+
parts.push(`${jstr("allow_connection_credential_mismatches")}:${String(v.allow_connection_credential_mismatches)}`);
|
|
122
|
+
return `{${parts.join(",")}}`;
|
|
123
|
+
}
|
|
124
|
+
function decodePolicies(data) {
|
|
125
|
+
return JSON.parse(data);
|
|
126
|
+
}
|
|
127
|
+
function encodeCBORLinterInput(v) {
|
|
128
|
+
const out = [];
|
|
129
|
+
appendCBORLinterInput(out, v);
|
|
130
|
+
return new Uint8Array(out);
|
|
131
|
+
}
|
|
132
|
+
function appendCBORLinterInput(out, v) {
|
|
133
|
+
let n = 3;
|
|
134
|
+
if (v.release !== undefined && v.release !== null)
|
|
135
|
+
n++;
|
|
136
|
+
if (v.policies !== undefined)
|
|
137
|
+
n++;
|
|
138
|
+
if (v.previous !== undefined && v.previous !== null)
|
|
139
|
+
n++;
|
|
140
|
+
if (v.components !== undefined && v.components.size > 0)
|
|
141
|
+
n++;
|
|
142
|
+
if (v.source_path !== undefined && v.source_path !== "")
|
|
143
|
+
n++;
|
|
144
|
+
if (v.implemented_component !== undefined && v.implemented_component !== null)
|
|
145
|
+
n++;
|
|
146
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
147
|
+
if (v.release !== undefined && v.release !== null) {
|
|
148
|
+
(0, cbor_gen_ts_1.writeText)(out, "release");
|
|
149
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.release)));
|
|
150
|
+
}
|
|
151
|
+
(0, cbor_gen_ts_1.writeText)(out, "rule_id");
|
|
152
|
+
(0, cbor_gen_ts_1.writeText)(out, v.rule_id);
|
|
153
|
+
if (v.policies !== undefined) {
|
|
154
|
+
(0, cbor_gen_ts_1.writeText)(out, "policies");
|
|
155
|
+
appendCBORPolicies(out, v.policies);
|
|
156
|
+
}
|
|
157
|
+
if (v.previous !== undefined && v.previous !== null) {
|
|
158
|
+
(0, cbor_gen_ts_1.writeText)(out, "previous");
|
|
159
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.previous)));
|
|
160
|
+
}
|
|
161
|
+
(0, cbor_gen_ts_1.writeText)(out, "proposed");
|
|
162
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.proposed)));
|
|
163
|
+
if (v.components !== undefined && v.components.size > 0) {
|
|
164
|
+
(0, cbor_gen_ts_1.writeText)(out, "components");
|
|
165
|
+
{
|
|
166
|
+
const m0 = v.components;
|
|
167
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
168
|
+
for (const [kk0, vv0] of m0) {
|
|
169
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
170
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
171
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
(0, cbor_gen_ts_1.writeText)(out, "entity_kind");
|
|
176
|
+
(0, cbor_gen_ts_1.writeText)(out, v.entity_kind);
|
|
177
|
+
if (v.source_path !== undefined && v.source_path !== "") {
|
|
178
|
+
(0, cbor_gen_ts_1.writeText)(out, "source_path");
|
|
179
|
+
(0, cbor_gen_ts_1.writeText)(out, v.source_path);
|
|
180
|
+
}
|
|
181
|
+
if (v.implemented_component !== undefined && v.implemented_component !== null) {
|
|
182
|
+
(0, cbor_gen_ts_1.writeText)(out, "implemented_component");
|
|
183
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.implemented_component)));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function decodeCBORLinterInput(data) {
|
|
187
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
188
|
+
return decodeCBORLinterInputFrom(dec);
|
|
189
|
+
}
|
|
190
|
+
function decodeCBORLinterInputFrom(dec) {
|
|
191
|
+
const o = {};
|
|
192
|
+
const n = dec.readMapHeader();
|
|
193
|
+
for (let i = 0; i < n; i++) {
|
|
194
|
+
const k = dec.readText();
|
|
195
|
+
switch (k) {
|
|
196
|
+
case "rule_id":
|
|
197
|
+
o["rule_id"] = dec.readText();
|
|
198
|
+
break;
|
|
199
|
+
case "entity_kind":
|
|
200
|
+
o["entity_kind"] = dec.readText();
|
|
201
|
+
break;
|
|
202
|
+
case "proposed":
|
|
203
|
+
o["proposed"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
204
|
+
break;
|
|
205
|
+
case "previous":
|
|
206
|
+
o["previous"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
207
|
+
break;
|
|
208
|
+
case "implemented_component":
|
|
209
|
+
o["implemented_component"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
210
|
+
break;
|
|
211
|
+
case "release":
|
|
212
|
+
o["release"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
213
|
+
break;
|
|
214
|
+
case "components":
|
|
215
|
+
o["components"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
216
|
+
const mk = dec.readEntryKey();
|
|
217
|
+
if (m.has(mk))
|
|
218
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
219
|
+
m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
|
|
220
|
+
} return m; })();
|
|
221
|
+
break;
|
|
222
|
+
case "source_path":
|
|
223
|
+
o["source_path"] = dec.readText();
|
|
224
|
+
break;
|
|
225
|
+
case "policies":
|
|
226
|
+
o["policies"] = decodeCBORPoliciesFrom(dec);
|
|
227
|
+
break;
|
|
228
|
+
default: dec.skip();
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return o;
|
|
232
|
+
}
|
|
233
|
+
function encodeCBORLinterOutput(v) {
|
|
234
|
+
const out = [];
|
|
235
|
+
appendCBORLinterOutput(out, v);
|
|
236
|
+
return new Uint8Array(out);
|
|
237
|
+
}
|
|
238
|
+
function appendCBORLinterOutput(out, v) {
|
|
239
|
+
let n = 1;
|
|
240
|
+
if (v.error !== undefined && v.error !== "")
|
|
241
|
+
n++;
|
|
242
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
243
|
+
if (v.error !== undefined && v.error !== "") {
|
|
244
|
+
(0, cbor_gen_ts_1.writeText)(out, "error");
|
|
245
|
+
(0, cbor_gen_ts_1.writeText)(out, v.error);
|
|
246
|
+
}
|
|
247
|
+
(0, cbor_gen_ts_1.writeText)(out, "findings");
|
|
248
|
+
{
|
|
249
|
+
const a0 = v.findings;
|
|
250
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
251
|
+
for (const ee0 of a0) {
|
|
252
|
+
(0, diagnostic_gen_ts_2.appendCBORDiagnostic)(out, ee0);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
function decodeCBORLinterOutput(data) {
|
|
257
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
258
|
+
return decodeCBORLinterOutputFrom(dec);
|
|
259
|
+
}
|
|
260
|
+
function decodeCBORLinterOutputFrom(dec) {
|
|
261
|
+
const o = {};
|
|
262
|
+
const n = dec.readMapHeader();
|
|
263
|
+
for (let i = 0; i < n; i++) {
|
|
264
|
+
const k = dec.readText();
|
|
265
|
+
switch (k) {
|
|
266
|
+
case "findings":
|
|
267
|
+
o["findings"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
268
|
+
a.push((0, diagnostic_gen_ts_2.decodeCBORDiagnosticFrom)(dec));
|
|
269
|
+
} return a; })();
|
|
270
|
+
break;
|
|
271
|
+
case "error":
|
|
272
|
+
o["error"] = dec.readText();
|
|
273
|
+
break;
|
|
274
|
+
default: dec.skip();
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return o;
|
|
278
|
+
}
|
|
279
|
+
function encodeCBORPolicies(v) {
|
|
280
|
+
const out = [];
|
|
281
|
+
appendCBORPolicies(out, v);
|
|
282
|
+
return new Uint8Array(out);
|
|
283
|
+
}
|
|
284
|
+
function appendCBORPolicies(out, v) {
|
|
285
|
+
let n = 0;
|
|
286
|
+
if (v.allow_dynamic_refs !== undefined && v.allow_dynamic_refs !== false)
|
|
287
|
+
n++;
|
|
288
|
+
if (v.allow_id_overrides !== undefined && v.allow_id_overrides !== false)
|
|
289
|
+
n++;
|
|
290
|
+
if (v.allow_aggrega_ai_prefix !== undefined && v.allow_aggrega_ai_prefix !== false)
|
|
291
|
+
n++;
|
|
292
|
+
if (v.allow_nonstandard_names !== undefined && v.allow_nonstandard_names !== false)
|
|
293
|
+
n++;
|
|
294
|
+
if (v.allow_category_mismatches !== undefined && v.allow_category_mismatches !== false)
|
|
295
|
+
n++;
|
|
296
|
+
if (v.allow_undeclared_recipe_provides !== undefined && v.allow_undeclared_recipe_provides !== false)
|
|
297
|
+
n++;
|
|
298
|
+
if (v.allow_direct_x_aggrega_extensions !== undefined && v.allow_direct_x_aggrega_extensions !== false)
|
|
299
|
+
n++;
|
|
300
|
+
if (v.allow_connection_credential_mismatches !== undefined && v.allow_connection_credential_mismatches !== false)
|
|
301
|
+
n++;
|
|
302
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
303
|
+
if (v.allow_dynamic_refs !== undefined && v.allow_dynamic_refs !== false) {
|
|
304
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_dynamic_refs");
|
|
305
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_dynamic_refs);
|
|
306
|
+
}
|
|
307
|
+
if (v.allow_id_overrides !== undefined && v.allow_id_overrides !== false) {
|
|
308
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_id_overrides");
|
|
309
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_id_overrides);
|
|
310
|
+
}
|
|
311
|
+
if (v.allow_aggrega_ai_prefix !== undefined && v.allow_aggrega_ai_prefix !== false) {
|
|
312
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_aggrega_ai_prefix");
|
|
313
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_aggrega_ai_prefix);
|
|
314
|
+
}
|
|
315
|
+
if (v.allow_nonstandard_names !== undefined && v.allow_nonstandard_names !== false) {
|
|
316
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_nonstandard_names");
|
|
317
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_nonstandard_names);
|
|
318
|
+
}
|
|
319
|
+
if (v.allow_category_mismatches !== undefined && v.allow_category_mismatches !== false) {
|
|
320
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_category_mismatches");
|
|
321
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_category_mismatches);
|
|
322
|
+
}
|
|
323
|
+
if (v.allow_undeclared_recipe_provides !== undefined && v.allow_undeclared_recipe_provides !== false) {
|
|
324
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_undeclared_recipe_provides");
|
|
325
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_undeclared_recipe_provides);
|
|
326
|
+
}
|
|
327
|
+
if (v.allow_direct_x_aggrega_extensions !== undefined && v.allow_direct_x_aggrega_extensions !== false) {
|
|
328
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_direct_x_aggrega_extensions");
|
|
329
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_direct_x_aggrega_extensions);
|
|
330
|
+
}
|
|
331
|
+
if (v.allow_connection_credential_mismatches !== undefined && v.allow_connection_credential_mismatches !== false) {
|
|
332
|
+
(0, cbor_gen_ts_1.writeText)(out, "allow_connection_credential_mismatches");
|
|
333
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.allow_connection_credential_mismatches);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function decodeCBORPolicies(data) {
|
|
337
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
338
|
+
return decodeCBORPoliciesFrom(dec);
|
|
339
|
+
}
|
|
340
|
+
function decodeCBORPoliciesFrom(dec) {
|
|
341
|
+
const o = {};
|
|
342
|
+
const n = dec.readMapHeader();
|
|
343
|
+
for (let i = 0; i < n; i++) {
|
|
344
|
+
const k = dec.readText();
|
|
345
|
+
switch (k) {
|
|
346
|
+
case "allow_dynamic_refs":
|
|
347
|
+
o["allow_dynamic_refs"] = dec.readBool();
|
|
348
|
+
break;
|
|
349
|
+
case "allow_id_overrides":
|
|
350
|
+
o["allow_id_overrides"] = dec.readBool();
|
|
351
|
+
break;
|
|
352
|
+
case "allow_direct_x_aggrega_extensions":
|
|
353
|
+
o["allow_direct_x_aggrega_extensions"] = dec.readBool();
|
|
354
|
+
break;
|
|
355
|
+
case "allow_aggrega_ai_prefix":
|
|
356
|
+
o["allow_aggrega_ai_prefix"] = dec.readBool();
|
|
357
|
+
break;
|
|
358
|
+
case "allow_nonstandard_names":
|
|
359
|
+
o["allow_nonstandard_names"] = dec.readBool();
|
|
360
|
+
break;
|
|
361
|
+
case "allow_category_mismatches":
|
|
362
|
+
o["allow_category_mismatches"] = dec.readBool();
|
|
363
|
+
break;
|
|
364
|
+
case "allow_undeclared_recipe_provides":
|
|
365
|
+
o["allow_undeclared_recipe_provides"] = dec.readBool();
|
|
366
|
+
break;
|
|
367
|
+
case "allow_connection_credential_mismatches":
|
|
368
|
+
o["allow_connection_credential_mismatches"] = dec.readBool();
|
|
369
|
+
break;
|
|
370
|
+
default: dec.skip();
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
return o;
|
|
374
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CborDec } from "./cbor_gen.ts";
|
|
2
|
+
export interface MutatorInput {
|
|
3
|
+
compilation_context: CompilationContext;
|
|
4
|
+
graph: MutatorGraph;
|
|
5
|
+
sources?: MutatorSource[];
|
|
6
|
+
settings?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface MutatorOutput {
|
|
9
|
+
patches: unknown[];
|
|
10
|
+
error?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CompilationContext {
|
|
13
|
+
release_name: string;
|
|
14
|
+
environment: string;
|
|
15
|
+
}
|
|
16
|
+
export interface MutatorGraph {
|
|
17
|
+
nodes: Map<string, MutatorNode>;
|
|
18
|
+
}
|
|
19
|
+
export interface MutatorNode {
|
|
20
|
+
component: string;
|
|
21
|
+
resolved_version: string;
|
|
22
|
+
labels: Map<string, string>;
|
|
23
|
+
values?: Map<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
export interface MutatorSource {
|
|
26
|
+
path: string;
|
|
27
|
+
content: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function encodeMutatorInput(v: MutatorInput): string;
|
|
30
|
+
export declare function decodeMutatorInput(data: string): MutatorInput;
|
|
31
|
+
export declare function encodeMutatorOutput(v: MutatorOutput): string;
|
|
32
|
+
export declare function decodeMutatorOutput(data: string): MutatorOutput;
|
|
33
|
+
export declare function encodeCompilationContext(v: CompilationContext): string;
|
|
34
|
+
export declare function decodeCompilationContext(data: string): CompilationContext;
|
|
35
|
+
export declare function encodeMutatorGraph(v: MutatorGraph): string;
|
|
36
|
+
export declare function decodeMutatorGraph(data: string): MutatorGraph;
|
|
37
|
+
export declare function encodeMutatorNode(v: MutatorNode): string;
|
|
38
|
+
export declare function decodeMutatorNode(data: string): MutatorNode;
|
|
39
|
+
export declare function encodeMutatorSource(v: MutatorSource): string;
|
|
40
|
+
export declare function decodeMutatorSource(data: string): MutatorSource;
|
|
41
|
+
export declare function encodeCBORMutatorInput(v: MutatorInput): Uint8Array;
|
|
42
|
+
export declare function appendCBORMutatorInput(out: number[], v: MutatorInput): void;
|
|
43
|
+
export declare function decodeCBORMutatorInput(data: Uint8Array): MutatorInput;
|
|
44
|
+
export declare function decodeCBORMutatorInputFrom(dec: CborDec): MutatorInput;
|
|
45
|
+
export declare function encodeCBORMutatorOutput(v: MutatorOutput): Uint8Array;
|
|
46
|
+
export declare function appendCBORMutatorOutput(out: number[], v: MutatorOutput): void;
|
|
47
|
+
export declare function decodeCBORMutatorOutput(data: Uint8Array): MutatorOutput;
|
|
48
|
+
export declare function decodeCBORMutatorOutputFrom(dec: CborDec): MutatorOutput;
|
|
49
|
+
export declare function encodeCBORCompilationContext(v: CompilationContext): Uint8Array;
|
|
50
|
+
export declare function appendCBORCompilationContext(out: number[], v: CompilationContext): void;
|
|
51
|
+
export declare function decodeCBORCompilationContext(data: Uint8Array): CompilationContext;
|
|
52
|
+
export declare function decodeCBORCompilationContextFrom(dec: CborDec): CompilationContext;
|
|
53
|
+
export declare function encodeCBORMutatorGraph(v: MutatorGraph): Uint8Array;
|
|
54
|
+
export declare function appendCBORMutatorGraph(out: number[], v: MutatorGraph): void;
|
|
55
|
+
export declare function decodeCBORMutatorGraph(data: Uint8Array): MutatorGraph;
|
|
56
|
+
export declare function decodeCBORMutatorGraphFrom(dec: CborDec): MutatorGraph;
|
|
57
|
+
export declare function encodeCBORMutatorNode(v: MutatorNode): Uint8Array;
|
|
58
|
+
export declare function appendCBORMutatorNode(out: number[], v: MutatorNode): void;
|
|
59
|
+
export declare function decodeCBORMutatorNode(data: Uint8Array): MutatorNode;
|
|
60
|
+
export declare function decodeCBORMutatorNodeFrom(dec: CborDec): MutatorNode;
|
|
61
|
+
export declare function encodeCBORMutatorSource(v: MutatorSource): Uint8Array;
|
|
62
|
+
export declare function appendCBORMutatorSource(out: number[], v: MutatorSource): void;
|
|
63
|
+
export declare function decodeCBORMutatorSource(data: Uint8Array): MutatorSource;
|
|
64
|
+
export declare function decodeCBORMutatorSourceFrom(dec: CborDec): MutatorSource;
|