@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,1050 @@
|
|
|
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.encodeImportInput = encodeImportInput;
|
|
6
|
+
exports.decodeImportInput = decodeImportInput;
|
|
7
|
+
exports.encodeCatalogProjection = encodeCatalogProjection;
|
|
8
|
+
exports.decodeCatalogProjection = decodeCatalogProjection;
|
|
9
|
+
exports.encodeCatalogComponent = encodeCatalogComponent;
|
|
10
|
+
exports.decodeCatalogComponent = decodeCatalogComponent;
|
|
11
|
+
exports.encodeCatalogSocket = encodeCatalogSocket;
|
|
12
|
+
exports.decodeCatalogSocket = decodeCatalogSocket;
|
|
13
|
+
exports.encodeImportSource = encodeImportSource;
|
|
14
|
+
exports.decodeImportSource = decodeImportSource;
|
|
15
|
+
exports.encodeImportOutput = encodeImportOutput;
|
|
16
|
+
exports.decodeImportOutput = decodeImportOutput;
|
|
17
|
+
exports.encodeEmittedEntity = encodeEmittedEntity;
|
|
18
|
+
exports.decodeEmittedEntity = decodeEmittedEntity;
|
|
19
|
+
exports.encodeImportDecision = encodeImportDecision;
|
|
20
|
+
exports.decodeImportDecision = decodeImportDecision;
|
|
21
|
+
exports.encodeDecisionSourceNode = encodeDecisionSourceNode;
|
|
22
|
+
exports.decodeDecisionSourceNode = decodeDecisionSourceNode;
|
|
23
|
+
exports.encodeImportCandidate = encodeImportCandidate;
|
|
24
|
+
exports.decodeImportCandidate = decodeImportCandidate;
|
|
25
|
+
exports.encodeCandidateSignals = encodeCandidateSignals;
|
|
26
|
+
exports.decodeCandidateSignals = decodeCandidateSignals;
|
|
27
|
+
exports.encodeDecisionChoice = encodeDecisionChoice;
|
|
28
|
+
exports.decodeDecisionChoice = decodeDecisionChoice;
|
|
29
|
+
exports.encodeScaffoldFile = encodeScaffoldFile;
|
|
30
|
+
exports.decodeScaffoldFile = decodeScaffoldFile;
|
|
31
|
+
exports.encodeCBORImportInput = encodeCBORImportInput;
|
|
32
|
+
exports.appendCBORImportInput = appendCBORImportInput;
|
|
33
|
+
exports.decodeCBORImportInput = decodeCBORImportInput;
|
|
34
|
+
exports.decodeCBORImportInputFrom = decodeCBORImportInputFrom;
|
|
35
|
+
exports.encodeCBORCatalogProjection = encodeCBORCatalogProjection;
|
|
36
|
+
exports.appendCBORCatalogProjection = appendCBORCatalogProjection;
|
|
37
|
+
exports.decodeCBORCatalogProjection = decodeCBORCatalogProjection;
|
|
38
|
+
exports.decodeCBORCatalogProjectionFrom = decodeCBORCatalogProjectionFrom;
|
|
39
|
+
exports.encodeCBORCatalogComponent = encodeCBORCatalogComponent;
|
|
40
|
+
exports.appendCBORCatalogComponent = appendCBORCatalogComponent;
|
|
41
|
+
exports.decodeCBORCatalogComponent = decodeCBORCatalogComponent;
|
|
42
|
+
exports.decodeCBORCatalogComponentFrom = decodeCBORCatalogComponentFrom;
|
|
43
|
+
exports.encodeCBORCatalogSocket = encodeCBORCatalogSocket;
|
|
44
|
+
exports.appendCBORCatalogSocket = appendCBORCatalogSocket;
|
|
45
|
+
exports.decodeCBORCatalogSocket = decodeCBORCatalogSocket;
|
|
46
|
+
exports.decodeCBORCatalogSocketFrom = decodeCBORCatalogSocketFrom;
|
|
47
|
+
exports.encodeCBORImportSource = encodeCBORImportSource;
|
|
48
|
+
exports.appendCBORImportSource = appendCBORImportSource;
|
|
49
|
+
exports.decodeCBORImportSource = decodeCBORImportSource;
|
|
50
|
+
exports.decodeCBORImportSourceFrom = decodeCBORImportSourceFrom;
|
|
51
|
+
exports.encodeCBORImportOutput = encodeCBORImportOutput;
|
|
52
|
+
exports.appendCBORImportOutput = appendCBORImportOutput;
|
|
53
|
+
exports.decodeCBORImportOutput = decodeCBORImportOutput;
|
|
54
|
+
exports.decodeCBORImportOutputFrom = decodeCBORImportOutputFrom;
|
|
55
|
+
exports.encodeCBOREmittedEntity = encodeCBOREmittedEntity;
|
|
56
|
+
exports.appendCBOREmittedEntity = appendCBOREmittedEntity;
|
|
57
|
+
exports.decodeCBOREmittedEntity = decodeCBOREmittedEntity;
|
|
58
|
+
exports.decodeCBOREmittedEntityFrom = decodeCBOREmittedEntityFrom;
|
|
59
|
+
exports.encodeCBORImportDecision = encodeCBORImportDecision;
|
|
60
|
+
exports.appendCBORImportDecision = appendCBORImportDecision;
|
|
61
|
+
exports.decodeCBORImportDecision = decodeCBORImportDecision;
|
|
62
|
+
exports.decodeCBORImportDecisionFrom = decodeCBORImportDecisionFrom;
|
|
63
|
+
exports.encodeCBORDecisionSourceNode = encodeCBORDecisionSourceNode;
|
|
64
|
+
exports.appendCBORDecisionSourceNode = appendCBORDecisionSourceNode;
|
|
65
|
+
exports.decodeCBORDecisionSourceNode = decodeCBORDecisionSourceNode;
|
|
66
|
+
exports.decodeCBORDecisionSourceNodeFrom = decodeCBORDecisionSourceNodeFrom;
|
|
67
|
+
exports.encodeCBORImportCandidate = encodeCBORImportCandidate;
|
|
68
|
+
exports.appendCBORImportCandidate = appendCBORImportCandidate;
|
|
69
|
+
exports.decodeCBORImportCandidate = decodeCBORImportCandidate;
|
|
70
|
+
exports.decodeCBORImportCandidateFrom = decodeCBORImportCandidateFrom;
|
|
71
|
+
exports.encodeCBORCandidateSignals = encodeCBORCandidateSignals;
|
|
72
|
+
exports.appendCBORCandidateSignals = appendCBORCandidateSignals;
|
|
73
|
+
exports.decodeCBORCandidateSignals = decodeCBORCandidateSignals;
|
|
74
|
+
exports.decodeCBORCandidateSignalsFrom = decodeCBORCandidateSignalsFrom;
|
|
75
|
+
exports.encodeCBORDecisionChoice = encodeCBORDecisionChoice;
|
|
76
|
+
exports.appendCBORDecisionChoice = appendCBORDecisionChoice;
|
|
77
|
+
exports.decodeCBORDecisionChoice = decodeCBORDecisionChoice;
|
|
78
|
+
exports.decodeCBORDecisionChoiceFrom = decodeCBORDecisionChoiceFrom;
|
|
79
|
+
exports.encodeCBORScaffoldFile = encodeCBORScaffoldFile;
|
|
80
|
+
exports.appendCBORScaffoldFile = appendCBORScaffoldFile;
|
|
81
|
+
exports.decodeCBORScaffoldFile = decodeCBORScaffoldFile;
|
|
82
|
+
exports.decodeCBORScaffoldFileFrom = decodeCBORScaffoldFileFrom;
|
|
83
|
+
// Code generated by internal/tools/typegen from
|
|
84
|
+
// aggrega-schemas/json/wasm-import-v1beta1.schema.json. DO NOT EDIT.
|
|
85
|
+
// Regenerate with `go generate ./internal/tools/typegen` from the
|
|
86
|
+
// aggrega-cli checkout.
|
|
87
|
+
const diagnostic_gen_ts_1 = require("./diagnostic_gen.js");
|
|
88
|
+
const cbor_gen_ts_1 = require("./cbor_gen.js");
|
|
89
|
+
const diagnostic_gen_ts_2 = require("./diagnostic_gen.js");
|
|
90
|
+
function jstr(s) {
|
|
91
|
+
return JSON.stringify(s);
|
|
92
|
+
}
|
|
93
|
+
// encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
|
|
94
|
+
// key order from JSON.parse is preserved, matching the Go and Rust codecs'
|
|
95
|
+
// byte-carry of opaque values. Opaque values are never sorted.
|
|
96
|
+
function encodeOpaque(v) {
|
|
97
|
+
return JSON.stringify(v);
|
|
98
|
+
}
|
|
99
|
+
function encodeImportInput(v) {
|
|
100
|
+
const parts = [];
|
|
101
|
+
parts.push(`${jstr("format")}:${jstr(v.format)}`);
|
|
102
|
+
parts.push(`${jstr("bytes")}:${jstr(v.bytes)}`);
|
|
103
|
+
if (v.name !== undefined && v.name !== "")
|
|
104
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
105
|
+
if (v.sources !== undefined && v.sources.length > 0)
|
|
106
|
+
parts.push(`${jstr("sources")}:${`[${v.sources.map((e0) => encodeImportSource(e0)).join(",")}]`}`);
|
|
107
|
+
if (v.settings !== undefined && v.settings !== null)
|
|
108
|
+
parts.push(`${jstr("settings")}:${encodeOpaque(v.settings)}`);
|
|
109
|
+
if (v.catalog !== undefined && v.catalog !== null)
|
|
110
|
+
parts.push(`${jstr("catalog")}:${encodeCatalogProjection(v.catalog)}`);
|
|
111
|
+
if (v.target !== undefined && v.target !== "")
|
|
112
|
+
parts.push(`${jstr("target")}:${jstr(v.target)}`);
|
|
113
|
+
return `{${parts.join(",")}}`;
|
|
114
|
+
}
|
|
115
|
+
function decodeImportInput(data) {
|
|
116
|
+
return JSON.parse(data);
|
|
117
|
+
}
|
|
118
|
+
function encodeCatalogProjection(v) {
|
|
119
|
+
const parts = [];
|
|
120
|
+
parts.push(`${jstr("components")}:${`[${v.components.map((e0) => encodeCatalogComponent(e0)).join(",")}]`}`);
|
|
121
|
+
return `{${parts.join(",")}}`;
|
|
122
|
+
}
|
|
123
|
+
function decodeCatalogProjection(data) {
|
|
124
|
+
return JSON.parse(data);
|
|
125
|
+
}
|
|
126
|
+
function encodeCatalogComponent(v) {
|
|
127
|
+
const parts = [];
|
|
128
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
129
|
+
parts.push(`${jstr("version")}:${jstr(v.version)}`);
|
|
130
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0)
|
|
131
|
+
parts.push(`${jstr("labels")}:${`{${Object.keys(v.labels).sort().map((k0) => `${jstr(k0)}:${jstr(v.labels[k0])}`).join(",")}}`}`);
|
|
132
|
+
if (v.values !== undefined && v.values.length > 0)
|
|
133
|
+
parts.push(`${jstr("values")}:${`[${v.values.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
134
|
+
if (v.provides !== undefined && v.provides.length > 0)
|
|
135
|
+
parts.push(`${jstr("provides")}:${`[${v.provides.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
136
|
+
if (v.sockets !== undefined && v.sockets.length > 0)
|
|
137
|
+
parts.push(`${jstr("sockets")}:${`[${v.sockets.map((e0) => encodeCatalogSocket(e0)).join(",")}]`}`);
|
|
138
|
+
return `{${parts.join(",")}}`;
|
|
139
|
+
}
|
|
140
|
+
function decodeCatalogComponent(data) {
|
|
141
|
+
return JSON.parse(data);
|
|
142
|
+
}
|
|
143
|
+
function encodeCatalogSocket(v) {
|
|
144
|
+
const parts = [];
|
|
145
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
146
|
+
parts.push(`${jstr("selector")}:${jstr(v.selector)}`);
|
|
147
|
+
return `{${parts.join(",")}}`;
|
|
148
|
+
}
|
|
149
|
+
function decodeCatalogSocket(data) {
|
|
150
|
+
return JSON.parse(data);
|
|
151
|
+
}
|
|
152
|
+
function encodeImportSource(v) {
|
|
153
|
+
const parts = [];
|
|
154
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
155
|
+
parts.push(`${jstr("bytes")}:${jstr(v.bytes)}`);
|
|
156
|
+
return `{${parts.join(",")}}`;
|
|
157
|
+
}
|
|
158
|
+
function decodeImportSource(data) {
|
|
159
|
+
return JSON.parse(data);
|
|
160
|
+
}
|
|
161
|
+
function encodeImportOutput(v) {
|
|
162
|
+
const parts = [];
|
|
163
|
+
if (v.entities !== undefined && v.entities.length > 0)
|
|
164
|
+
parts.push(`${jstr("entities")}:${`[${v.entities.map((e0) => encodeEmittedEntity(e0)).join(",")}]`}`);
|
|
165
|
+
if (v.decisions !== undefined && v.decisions.length > 0)
|
|
166
|
+
parts.push(`${jstr("decisions")}:${`[${v.decisions.map((e0) => encodeImportDecision(e0)).join(",")}]`}`);
|
|
167
|
+
if (v.diagnostics !== undefined && v.diagnostics.length > 0)
|
|
168
|
+
parts.push(`${jstr("diagnostics")}:${`[${v.diagnostics.map((e0) => (0, diagnostic_gen_ts_1.encodeDiagnostic)(e0)).join(",")}]`}`);
|
|
169
|
+
if (v.files !== undefined && v.files.length > 0)
|
|
170
|
+
parts.push(`${jstr("files")}:${`[${v.files.map((e0) => encodeScaffoldFile(e0)).join(",")}]`}`);
|
|
171
|
+
if (v.error !== undefined && v.error !== "")
|
|
172
|
+
parts.push(`${jstr("error")}:${jstr(v.error)}`);
|
|
173
|
+
return `{${parts.join(",")}}`;
|
|
174
|
+
}
|
|
175
|
+
function decodeImportOutput(data) {
|
|
176
|
+
return JSON.parse(data);
|
|
177
|
+
}
|
|
178
|
+
function encodeEmittedEntity(v) {
|
|
179
|
+
const parts = [];
|
|
180
|
+
parts.push(`${jstr("kind")}:${jstr(v.kind)}`);
|
|
181
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
182
|
+
parts.push(`${jstr("mode")}:${jstr(v.mode)}`);
|
|
183
|
+
if (v.body !== undefined && v.body !== "")
|
|
184
|
+
parts.push(`${jstr("body")}:${jstr(v.body)}`);
|
|
185
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0)
|
|
186
|
+
parts.push(`${jstr("labels")}:${`{${Object.keys(v.labels).sort().map((k0) => `${jstr(k0)}:${jstr(v.labels[k0])}`).join(",")}}`}`);
|
|
187
|
+
if (v.annotations !== undefined && Object.keys(v.annotations).length > 0)
|
|
188
|
+
parts.push(`${jstr("annotations")}:${`{${Object.keys(v.annotations).sort().map((k0) => `${jstr(k0)}:${jstr(v.annotations[k0])}`).join(",")}}`}`);
|
|
189
|
+
if (v.sourceRef !== undefined && v.sourceRef !== "")
|
|
190
|
+
parts.push(`${jstr("sourceRef")}:${jstr(v.sourceRef)}`);
|
|
191
|
+
if (v.decisionRef !== undefined && v.decisionRef !== "")
|
|
192
|
+
parts.push(`${jstr("decisionRef")}:${jstr(v.decisionRef)}`);
|
|
193
|
+
return `{${parts.join(",")}}`;
|
|
194
|
+
}
|
|
195
|
+
function decodeEmittedEntity(data) {
|
|
196
|
+
return JSON.parse(data);
|
|
197
|
+
}
|
|
198
|
+
function encodeImportDecision(v) {
|
|
199
|
+
const parts = [];
|
|
200
|
+
parts.push(`${jstr("sourceNode")}:${encodeDecisionSourceNode(v.sourceNode)}`);
|
|
201
|
+
if (v.candidates !== undefined && v.candidates.length > 0)
|
|
202
|
+
parts.push(`${jstr("candidates")}:${`[${v.candidates.map((e0) => encodeImportCandidate(e0)).join(",")}]`}`);
|
|
203
|
+
if (v.chosen !== undefined && v.chosen !== null)
|
|
204
|
+
parts.push(`${jstr("chosen")}:${encodeDecisionChoice(v.chosen)}`);
|
|
205
|
+
if (v.rationale !== undefined && v.rationale !== "")
|
|
206
|
+
parts.push(`${jstr("rationale")}:${jstr(v.rationale)}`);
|
|
207
|
+
if (v.swapHint !== undefined && v.swapHint !== "")
|
|
208
|
+
parts.push(`${jstr("swapHint")}:${jstr(v.swapHint)}`);
|
|
209
|
+
return `{${parts.join(",")}}`;
|
|
210
|
+
}
|
|
211
|
+
function decodeImportDecision(data) {
|
|
212
|
+
return JSON.parse(data);
|
|
213
|
+
}
|
|
214
|
+
function encodeDecisionSourceNode(v) {
|
|
215
|
+
const parts = [];
|
|
216
|
+
parts.push(`${jstr("id")}:${jstr(v.id)}`);
|
|
217
|
+
parts.push(`${jstr("type")}:${jstr(v.type)}`);
|
|
218
|
+
parts.push(`${jstr("paramsSummary")}:${jstr(v.paramsSummary)}`);
|
|
219
|
+
return `{${parts.join(",")}}`;
|
|
220
|
+
}
|
|
221
|
+
function decodeDecisionSourceNode(data) {
|
|
222
|
+
return JSON.parse(data);
|
|
223
|
+
}
|
|
224
|
+
function encodeImportCandidate(v) {
|
|
225
|
+
const parts = [];
|
|
226
|
+
parts.push(`${jstr("componentName")}:${jstr(v.componentName)}`);
|
|
227
|
+
parts.push(`${jstr("score")}:${String(v.score)}`);
|
|
228
|
+
parts.push(`${jstr("tier")}:${jstr(v.tier)}`);
|
|
229
|
+
parts.push(`${jstr("signals")}:${encodeCandidateSignals(v.signals)}`);
|
|
230
|
+
return `{${parts.join(",")}}`;
|
|
231
|
+
}
|
|
232
|
+
function decodeImportCandidate(data) {
|
|
233
|
+
return JSON.parse(data);
|
|
234
|
+
}
|
|
235
|
+
function encodeCandidateSignals(v) {
|
|
236
|
+
const parts = [];
|
|
237
|
+
parts.push(`${jstr("table")}:${String(v.table)}`);
|
|
238
|
+
parts.push(`${jstr("category")}:${String(v.category)}`);
|
|
239
|
+
parts.push(`${jstr("domainLabels")}:${String(v.domainLabels)}`);
|
|
240
|
+
parts.push(`${jstr("shape")}:${String(v.shape)}`);
|
|
241
|
+
parts.push(`${jstr("name")}:${String(v.name)}`);
|
|
242
|
+
return `{${parts.join(",")}}`;
|
|
243
|
+
}
|
|
244
|
+
function decodeCandidateSignals(data) {
|
|
245
|
+
return JSON.parse(data);
|
|
246
|
+
}
|
|
247
|
+
function encodeDecisionChoice(v) {
|
|
248
|
+
const parts = [];
|
|
249
|
+
parts.push(`${jstr("target")}:${jstr(v.target)}`);
|
|
250
|
+
parts.push(`${jstr("mode")}:${jstr(v.mode)}`);
|
|
251
|
+
parts.push(`${jstr("tier")}:${jstr(v.tier)}`);
|
|
252
|
+
return `{${parts.join(",")}}`;
|
|
253
|
+
}
|
|
254
|
+
function decodeDecisionChoice(data) {
|
|
255
|
+
return JSON.parse(data);
|
|
256
|
+
}
|
|
257
|
+
function encodeScaffoldFile(v) {
|
|
258
|
+
const parts = [];
|
|
259
|
+
parts.push(`${jstr("path")}:${jstr(v.path)}`);
|
|
260
|
+
parts.push(`${jstr("content")}:${jstr(v.content)}`);
|
|
261
|
+
return `{${parts.join(",")}}`;
|
|
262
|
+
}
|
|
263
|
+
function decodeScaffoldFile(data) {
|
|
264
|
+
return JSON.parse(data);
|
|
265
|
+
}
|
|
266
|
+
function encodeCBORImportInput(v) {
|
|
267
|
+
const out = [];
|
|
268
|
+
appendCBORImportInput(out, v);
|
|
269
|
+
return new Uint8Array(out);
|
|
270
|
+
}
|
|
271
|
+
function appendCBORImportInput(out, v) {
|
|
272
|
+
let n = 2;
|
|
273
|
+
if (v.name !== undefined && v.name !== "")
|
|
274
|
+
n++;
|
|
275
|
+
if (v.target !== undefined && v.target !== "")
|
|
276
|
+
n++;
|
|
277
|
+
if (v.catalog !== undefined && v.catalog !== null)
|
|
278
|
+
n++;
|
|
279
|
+
if (v.sources !== undefined && v.sources.length > 0)
|
|
280
|
+
n++;
|
|
281
|
+
if (v.settings !== undefined && v.settings !== null)
|
|
282
|
+
n++;
|
|
283
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
284
|
+
if (v.name !== undefined && v.name !== "") {
|
|
285
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
286
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
287
|
+
}
|
|
288
|
+
(0, cbor_gen_ts_1.writeText)(out, "bytes");
|
|
289
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.bytes));
|
|
290
|
+
(0, cbor_gen_ts_1.writeText)(out, "format");
|
|
291
|
+
(0, cbor_gen_ts_1.writeText)(out, v.format);
|
|
292
|
+
if (v.target !== undefined && v.target !== "") {
|
|
293
|
+
(0, cbor_gen_ts_1.writeText)(out, "target");
|
|
294
|
+
(0, cbor_gen_ts_1.writeText)(out, v.target);
|
|
295
|
+
}
|
|
296
|
+
if (v.catalog !== undefined && v.catalog !== null) {
|
|
297
|
+
(0, cbor_gen_ts_1.writeText)(out, "catalog");
|
|
298
|
+
appendCBORCatalogProjection(out, v.catalog);
|
|
299
|
+
}
|
|
300
|
+
if (v.sources !== undefined && v.sources.length > 0) {
|
|
301
|
+
(0, cbor_gen_ts_1.writeText)(out, "sources");
|
|
302
|
+
{
|
|
303
|
+
const a0 = v.sources;
|
|
304
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
305
|
+
for (const ee0 of a0) {
|
|
306
|
+
appendCBORImportSource(out, ee0);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
if (v.settings !== undefined && v.settings !== null) {
|
|
311
|
+
(0, cbor_gen_ts_1.writeText)(out, "settings");
|
|
312
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.settings)));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
function decodeCBORImportInput(data) {
|
|
316
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
317
|
+
return decodeCBORImportInputFrom(dec);
|
|
318
|
+
}
|
|
319
|
+
function decodeCBORImportInputFrom(dec) {
|
|
320
|
+
const o = {};
|
|
321
|
+
const n = dec.readMapHeader();
|
|
322
|
+
for (let i = 0; i < n; i++) {
|
|
323
|
+
const k = dec.readText();
|
|
324
|
+
switch (k) {
|
|
325
|
+
case "format":
|
|
326
|
+
o["format"] = dec.readText();
|
|
327
|
+
break;
|
|
328
|
+
case "bytes":
|
|
329
|
+
o["bytes"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
|
|
330
|
+
break;
|
|
331
|
+
case "name":
|
|
332
|
+
o["name"] = dec.readText();
|
|
333
|
+
break;
|
|
334
|
+
case "sources":
|
|
335
|
+
o["sources"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
336
|
+
a.push(decodeCBORImportSourceFrom(dec));
|
|
337
|
+
} return a; })();
|
|
338
|
+
break;
|
|
339
|
+
case "settings":
|
|
340
|
+
o["settings"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
341
|
+
break;
|
|
342
|
+
case "catalog":
|
|
343
|
+
o["catalog"] = decodeCBORCatalogProjectionFrom(dec);
|
|
344
|
+
break;
|
|
345
|
+
case "target":
|
|
346
|
+
o["target"] = dec.readText();
|
|
347
|
+
break;
|
|
348
|
+
default: dec.skip();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
return o;
|
|
352
|
+
}
|
|
353
|
+
function encodeCBORCatalogProjection(v) {
|
|
354
|
+
const out = [];
|
|
355
|
+
appendCBORCatalogProjection(out, v);
|
|
356
|
+
return new Uint8Array(out);
|
|
357
|
+
}
|
|
358
|
+
function appendCBORCatalogProjection(out, v) {
|
|
359
|
+
let n = 1;
|
|
360
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
361
|
+
(0, cbor_gen_ts_1.writeText)(out, "components");
|
|
362
|
+
{
|
|
363
|
+
const a0 = v.components;
|
|
364
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
365
|
+
for (const ee0 of a0) {
|
|
366
|
+
appendCBORCatalogComponent(out, ee0);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
function decodeCBORCatalogProjection(data) {
|
|
371
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
372
|
+
return decodeCBORCatalogProjectionFrom(dec);
|
|
373
|
+
}
|
|
374
|
+
function decodeCBORCatalogProjectionFrom(dec) {
|
|
375
|
+
const o = {};
|
|
376
|
+
const n = dec.readMapHeader();
|
|
377
|
+
for (let i = 0; i < n; i++) {
|
|
378
|
+
const k = dec.readText();
|
|
379
|
+
switch (k) {
|
|
380
|
+
case "components":
|
|
381
|
+
o["components"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
382
|
+
a.push(decodeCBORCatalogComponentFrom(dec));
|
|
383
|
+
} return a; })();
|
|
384
|
+
break;
|
|
385
|
+
default: dec.skip();
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return o;
|
|
389
|
+
}
|
|
390
|
+
function encodeCBORCatalogComponent(v) {
|
|
391
|
+
const out = [];
|
|
392
|
+
appendCBORCatalogComponent(out, v);
|
|
393
|
+
return new Uint8Array(out);
|
|
394
|
+
}
|
|
395
|
+
function appendCBORCatalogComponent(out, v) {
|
|
396
|
+
let n = 2;
|
|
397
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0)
|
|
398
|
+
n++;
|
|
399
|
+
if (v.values !== undefined && v.values.length > 0)
|
|
400
|
+
n++;
|
|
401
|
+
if (v.sockets !== undefined && v.sockets.length > 0)
|
|
402
|
+
n++;
|
|
403
|
+
if (v.provides !== undefined && v.provides.length > 0)
|
|
404
|
+
n++;
|
|
405
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
406
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
407
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
408
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0) {
|
|
409
|
+
(0, cbor_gen_ts_1.writeText)(out, "labels");
|
|
410
|
+
{
|
|
411
|
+
const m0 = v.labels;
|
|
412
|
+
const ks0 = Object.keys(m0);
|
|
413
|
+
(0, cbor_gen_ts_1.sortKeys)(ks0);
|
|
414
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
|
|
415
|
+
for (const kk0 of ks0) {
|
|
416
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
417
|
+
(0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (v.values !== undefined && v.values.length > 0) {
|
|
422
|
+
(0, cbor_gen_ts_1.writeText)(out, "values");
|
|
423
|
+
{
|
|
424
|
+
const a0 = v.values;
|
|
425
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
426
|
+
for (const ee0 of a0) {
|
|
427
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (v.sockets !== undefined && v.sockets.length > 0) {
|
|
432
|
+
(0, cbor_gen_ts_1.writeText)(out, "sockets");
|
|
433
|
+
{
|
|
434
|
+
const a0 = v.sockets;
|
|
435
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
436
|
+
for (const ee0 of a0) {
|
|
437
|
+
appendCBORCatalogSocket(out, ee0);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
(0, cbor_gen_ts_1.writeText)(out, "version");
|
|
442
|
+
(0, cbor_gen_ts_1.writeText)(out, v.version);
|
|
443
|
+
if (v.provides !== undefined && v.provides.length > 0) {
|
|
444
|
+
(0, cbor_gen_ts_1.writeText)(out, "provides");
|
|
445
|
+
{
|
|
446
|
+
const a0 = v.provides;
|
|
447
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
448
|
+
for (const ee0 of a0) {
|
|
449
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function decodeCBORCatalogComponent(data) {
|
|
455
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
456
|
+
return decodeCBORCatalogComponentFrom(dec);
|
|
457
|
+
}
|
|
458
|
+
function decodeCBORCatalogComponentFrom(dec) {
|
|
459
|
+
const o = {};
|
|
460
|
+
const n = dec.readMapHeader();
|
|
461
|
+
for (let i = 0; i < n; i++) {
|
|
462
|
+
const k = dec.readText();
|
|
463
|
+
switch (k) {
|
|
464
|
+
case "name":
|
|
465
|
+
o["name"] = dec.readText();
|
|
466
|
+
break;
|
|
467
|
+
case "version":
|
|
468
|
+
o["version"] = dec.readText();
|
|
469
|
+
break;
|
|
470
|
+
case "labels":
|
|
471
|
+
o["labels"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
|
|
472
|
+
const mk = dec.readText();
|
|
473
|
+
m[mk] = dec.readText();
|
|
474
|
+
} return m; })();
|
|
475
|
+
break;
|
|
476
|
+
case "values":
|
|
477
|
+
o["values"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
478
|
+
a.push(dec.readText());
|
|
479
|
+
} return a; })();
|
|
480
|
+
break;
|
|
481
|
+
case "provides":
|
|
482
|
+
o["provides"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
483
|
+
a.push(dec.readText());
|
|
484
|
+
} return a; })();
|
|
485
|
+
break;
|
|
486
|
+
case "sockets":
|
|
487
|
+
o["sockets"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
488
|
+
a.push(decodeCBORCatalogSocketFrom(dec));
|
|
489
|
+
} return a; })();
|
|
490
|
+
break;
|
|
491
|
+
default: dec.skip();
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return o;
|
|
495
|
+
}
|
|
496
|
+
function encodeCBORCatalogSocket(v) {
|
|
497
|
+
const out = [];
|
|
498
|
+
appendCBORCatalogSocket(out, v);
|
|
499
|
+
return new Uint8Array(out);
|
|
500
|
+
}
|
|
501
|
+
function appendCBORCatalogSocket(out, v) {
|
|
502
|
+
let n = 2;
|
|
503
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
504
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
505
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
506
|
+
(0, cbor_gen_ts_1.writeText)(out, "selector");
|
|
507
|
+
(0, cbor_gen_ts_1.writeText)(out, v.selector);
|
|
508
|
+
}
|
|
509
|
+
function decodeCBORCatalogSocket(data) {
|
|
510
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
511
|
+
return decodeCBORCatalogSocketFrom(dec);
|
|
512
|
+
}
|
|
513
|
+
function decodeCBORCatalogSocketFrom(dec) {
|
|
514
|
+
const o = {};
|
|
515
|
+
const n = dec.readMapHeader();
|
|
516
|
+
for (let i = 0; i < n; i++) {
|
|
517
|
+
const k = dec.readText();
|
|
518
|
+
switch (k) {
|
|
519
|
+
case "name":
|
|
520
|
+
o["name"] = dec.readText();
|
|
521
|
+
break;
|
|
522
|
+
case "selector":
|
|
523
|
+
o["selector"] = dec.readText();
|
|
524
|
+
break;
|
|
525
|
+
default: dec.skip();
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
return o;
|
|
529
|
+
}
|
|
530
|
+
function encodeCBORImportSource(v) {
|
|
531
|
+
const out = [];
|
|
532
|
+
appendCBORImportSource(out, v);
|
|
533
|
+
return new Uint8Array(out);
|
|
534
|
+
}
|
|
535
|
+
function appendCBORImportSource(out, v) {
|
|
536
|
+
let n = 2;
|
|
537
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
538
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
539
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
540
|
+
(0, cbor_gen_ts_1.writeText)(out, "bytes");
|
|
541
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.b64decode)(v.bytes));
|
|
542
|
+
}
|
|
543
|
+
function decodeCBORImportSource(data) {
|
|
544
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
545
|
+
return decodeCBORImportSourceFrom(dec);
|
|
546
|
+
}
|
|
547
|
+
function decodeCBORImportSourceFrom(dec) {
|
|
548
|
+
const o = {};
|
|
549
|
+
const n = dec.readMapHeader();
|
|
550
|
+
for (let i = 0; i < n; i++) {
|
|
551
|
+
const k = dec.readText();
|
|
552
|
+
switch (k) {
|
|
553
|
+
case "name":
|
|
554
|
+
o["name"] = dec.readText();
|
|
555
|
+
break;
|
|
556
|
+
case "bytes":
|
|
557
|
+
o["bytes"] = (0, cbor_gen_ts_1.b64encode)(dec.readBytes());
|
|
558
|
+
break;
|
|
559
|
+
default: dec.skip();
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
return o;
|
|
563
|
+
}
|
|
564
|
+
function encodeCBORImportOutput(v) {
|
|
565
|
+
const out = [];
|
|
566
|
+
appendCBORImportOutput(out, v);
|
|
567
|
+
return new Uint8Array(out);
|
|
568
|
+
}
|
|
569
|
+
function appendCBORImportOutput(out, v) {
|
|
570
|
+
let n = 0;
|
|
571
|
+
if (v.error !== undefined && v.error !== "")
|
|
572
|
+
n++;
|
|
573
|
+
if (v.files !== undefined && v.files.length > 0)
|
|
574
|
+
n++;
|
|
575
|
+
if (v.entities !== undefined && v.entities.length > 0)
|
|
576
|
+
n++;
|
|
577
|
+
if (v.decisions !== undefined && v.decisions.length > 0)
|
|
578
|
+
n++;
|
|
579
|
+
if (v.diagnostics !== undefined && v.diagnostics.length > 0)
|
|
580
|
+
n++;
|
|
581
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
582
|
+
if (v.error !== undefined && v.error !== "") {
|
|
583
|
+
(0, cbor_gen_ts_1.writeText)(out, "error");
|
|
584
|
+
(0, cbor_gen_ts_1.writeText)(out, v.error);
|
|
585
|
+
}
|
|
586
|
+
if (v.files !== undefined && v.files.length > 0) {
|
|
587
|
+
(0, cbor_gen_ts_1.writeText)(out, "files");
|
|
588
|
+
{
|
|
589
|
+
const a0 = v.files;
|
|
590
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
591
|
+
for (const ee0 of a0) {
|
|
592
|
+
appendCBORScaffoldFile(out, ee0);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
if (v.entities !== undefined && v.entities.length > 0) {
|
|
597
|
+
(0, cbor_gen_ts_1.writeText)(out, "entities");
|
|
598
|
+
{
|
|
599
|
+
const a0 = v.entities;
|
|
600
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
601
|
+
for (const ee0 of a0) {
|
|
602
|
+
appendCBOREmittedEntity(out, ee0);
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (v.decisions !== undefined && v.decisions.length > 0) {
|
|
607
|
+
(0, cbor_gen_ts_1.writeText)(out, "decisions");
|
|
608
|
+
{
|
|
609
|
+
const a0 = v.decisions;
|
|
610
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
611
|
+
for (const ee0 of a0) {
|
|
612
|
+
appendCBORImportDecision(out, ee0);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (v.diagnostics !== undefined && v.diagnostics.length > 0) {
|
|
617
|
+
(0, cbor_gen_ts_1.writeText)(out, "diagnostics");
|
|
618
|
+
{
|
|
619
|
+
const a0 = v.diagnostics;
|
|
620
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
621
|
+
for (const ee0 of a0) {
|
|
622
|
+
(0, diagnostic_gen_ts_2.appendCBORDiagnostic)(out, ee0);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
function decodeCBORImportOutput(data) {
|
|
628
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
629
|
+
return decodeCBORImportOutputFrom(dec);
|
|
630
|
+
}
|
|
631
|
+
function decodeCBORImportOutputFrom(dec) {
|
|
632
|
+
const o = {};
|
|
633
|
+
const n = dec.readMapHeader();
|
|
634
|
+
for (let i = 0; i < n; i++) {
|
|
635
|
+
const k = dec.readText();
|
|
636
|
+
switch (k) {
|
|
637
|
+
case "entities":
|
|
638
|
+
o["entities"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
639
|
+
a.push(decodeCBOREmittedEntityFrom(dec));
|
|
640
|
+
} return a; })();
|
|
641
|
+
break;
|
|
642
|
+
case "decisions":
|
|
643
|
+
o["decisions"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
644
|
+
a.push(decodeCBORImportDecisionFrom(dec));
|
|
645
|
+
} return a; })();
|
|
646
|
+
break;
|
|
647
|
+
case "diagnostics":
|
|
648
|
+
o["diagnostics"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
649
|
+
a.push((0, diagnostic_gen_ts_2.decodeCBORDiagnosticFrom)(dec));
|
|
650
|
+
} return a; })();
|
|
651
|
+
break;
|
|
652
|
+
case "files":
|
|
653
|
+
o["files"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
654
|
+
a.push(decodeCBORScaffoldFileFrom(dec));
|
|
655
|
+
} return a; })();
|
|
656
|
+
break;
|
|
657
|
+
case "error":
|
|
658
|
+
o["error"] = dec.readText();
|
|
659
|
+
break;
|
|
660
|
+
default: dec.skip();
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return o;
|
|
664
|
+
}
|
|
665
|
+
function encodeCBOREmittedEntity(v) {
|
|
666
|
+
const out = [];
|
|
667
|
+
appendCBOREmittedEntity(out, v);
|
|
668
|
+
return new Uint8Array(out);
|
|
669
|
+
}
|
|
670
|
+
function appendCBOREmittedEntity(out, v) {
|
|
671
|
+
let n = 3;
|
|
672
|
+
if (v.body !== undefined && v.body !== "")
|
|
673
|
+
n++;
|
|
674
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0)
|
|
675
|
+
n++;
|
|
676
|
+
if (v.sourceRef !== undefined && v.sourceRef !== "")
|
|
677
|
+
n++;
|
|
678
|
+
if (v.annotations !== undefined && Object.keys(v.annotations).length > 0)
|
|
679
|
+
n++;
|
|
680
|
+
if (v.decisionRef !== undefined && v.decisionRef !== "")
|
|
681
|
+
n++;
|
|
682
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
683
|
+
if (v.body !== undefined && v.body !== "") {
|
|
684
|
+
(0, cbor_gen_ts_1.writeText)(out, "body");
|
|
685
|
+
(0, cbor_gen_ts_1.writeText)(out, v.body);
|
|
686
|
+
}
|
|
687
|
+
(0, cbor_gen_ts_1.writeText)(out, "kind");
|
|
688
|
+
(0, cbor_gen_ts_1.writeText)(out, v.kind);
|
|
689
|
+
(0, cbor_gen_ts_1.writeText)(out, "mode");
|
|
690
|
+
(0, cbor_gen_ts_1.writeText)(out, v.mode);
|
|
691
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
692
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
693
|
+
if (v.labels !== undefined && Object.keys(v.labels).length > 0) {
|
|
694
|
+
(0, cbor_gen_ts_1.writeText)(out, "labels");
|
|
695
|
+
{
|
|
696
|
+
const m0 = v.labels;
|
|
697
|
+
const ks0 = Object.keys(m0);
|
|
698
|
+
(0, cbor_gen_ts_1.sortKeys)(ks0);
|
|
699
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
|
|
700
|
+
for (const kk0 of ks0) {
|
|
701
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
702
|
+
(0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (v.sourceRef !== undefined && v.sourceRef !== "") {
|
|
707
|
+
(0, cbor_gen_ts_1.writeText)(out, "sourceRef");
|
|
708
|
+
(0, cbor_gen_ts_1.writeText)(out, v.sourceRef);
|
|
709
|
+
}
|
|
710
|
+
if (v.annotations !== undefined && Object.keys(v.annotations).length > 0) {
|
|
711
|
+
(0, cbor_gen_ts_1.writeText)(out, "annotations");
|
|
712
|
+
{
|
|
713
|
+
const m0 = v.annotations;
|
|
714
|
+
const ks0 = Object.keys(m0);
|
|
715
|
+
(0, cbor_gen_ts_1.sortKeys)(ks0);
|
|
716
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, ks0.length);
|
|
717
|
+
for (const kk0 of ks0) {
|
|
718
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
719
|
+
(0, cbor_gen_ts_1.writeText)(out, m0[kk0]);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (v.decisionRef !== undefined && v.decisionRef !== "") {
|
|
724
|
+
(0, cbor_gen_ts_1.writeText)(out, "decisionRef");
|
|
725
|
+
(0, cbor_gen_ts_1.writeText)(out, v.decisionRef);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
function decodeCBOREmittedEntity(data) {
|
|
729
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
730
|
+
return decodeCBOREmittedEntityFrom(dec);
|
|
731
|
+
}
|
|
732
|
+
function decodeCBOREmittedEntityFrom(dec) {
|
|
733
|
+
const o = {};
|
|
734
|
+
const n = dec.readMapHeader();
|
|
735
|
+
for (let i = 0; i < n; i++) {
|
|
736
|
+
const k = dec.readText();
|
|
737
|
+
switch (k) {
|
|
738
|
+
case "kind":
|
|
739
|
+
o["kind"] = dec.readText();
|
|
740
|
+
break;
|
|
741
|
+
case "name":
|
|
742
|
+
o["name"] = dec.readText();
|
|
743
|
+
break;
|
|
744
|
+
case "mode":
|
|
745
|
+
o["mode"] = dec.readText();
|
|
746
|
+
break;
|
|
747
|
+
case "body":
|
|
748
|
+
o["body"] = dec.readText();
|
|
749
|
+
break;
|
|
750
|
+
case "labels":
|
|
751
|
+
o["labels"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
|
|
752
|
+
const mk = dec.readText();
|
|
753
|
+
m[mk] = dec.readText();
|
|
754
|
+
} return m; })();
|
|
755
|
+
break;
|
|
756
|
+
case "annotations":
|
|
757
|
+
o["annotations"] = (() => { const m = {}; const mn = dec.readMapHeader(); for (let j = 0; j < mn; j++) {
|
|
758
|
+
const mk = dec.readText();
|
|
759
|
+
m[mk] = dec.readText();
|
|
760
|
+
} return m; })();
|
|
761
|
+
break;
|
|
762
|
+
case "sourceRef":
|
|
763
|
+
o["sourceRef"] = dec.readText();
|
|
764
|
+
break;
|
|
765
|
+
case "decisionRef":
|
|
766
|
+
o["decisionRef"] = dec.readText();
|
|
767
|
+
break;
|
|
768
|
+
default: dec.skip();
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
return o;
|
|
772
|
+
}
|
|
773
|
+
function encodeCBORImportDecision(v) {
|
|
774
|
+
const out = [];
|
|
775
|
+
appendCBORImportDecision(out, v);
|
|
776
|
+
return new Uint8Array(out);
|
|
777
|
+
}
|
|
778
|
+
function appendCBORImportDecision(out, v) {
|
|
779
|
+
let n = 1;
|
|
780
|
+
if (v.chosen !== undefined && v.chosen !== null)
|
|
781
|
+
n++;
|
|
782
|
+
if (v.swapHint !== undefined && v.swapHint !== "")
|
|
783
|
+
n++;
|
|
784
|
+
if (v.rationale !== undefined && v.rationale !== "")
|
|
785
|
+
n++;
|
|
786
|
+
if (v.candidates !== undefined && v.candidates.length > 0)
|
|
787
|
+
n++;
|
|
788
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
789
|
+
if (v.chosen !== undefined && v.chosen !== null) {
|
|
790
|
+
(0, cbor_gen_ts_1.writeText)(out, "chosen");
|
|
791
|
+
appendCBORDecisionChoice(out, v.chosen);
|
|
792
|
+
}
|
|
793
|
+
if (v.swapHint !== undefined && v.swapHint !== "") {
|
|
794
|
+
(0, cbor_gen_ts_1.writeText)(out, "swapHint");
|
|
795
|
+
(0, cbor_gen_ts_1.writeText)(out, v.swapHint);
|
|
796
|
+
}
|
|
797
|
+
if (v.rationale !== undefined && v.rationale !== "") {
|
|
798
|
+
(0, cbor_gen_ts_1.writeText)(out, "rationale");
|
|
799
|
+
(0, cbor_gen_ts_1.writeText)(out, v.rationale);
|
|
800
|
+
}
|
|
801
|
+
if (v.candidates !== undefined && v.candidates.length > 0) {
|
|
802
|
+
(0, cbor_gen_ts_1.writeText)(out, "candidates");
|
|
803
|
+
{
|
|
804
|
+
const a0 = v.candidates;
|
|
805
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
806
|
+
for (const ee0 of a0) {
|
|
807
|
+
appendCBORImportCandidate(out, ee0);
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
(0, cbor_gen_ts_1.writeText)(out, "sourceNode");
|
|
812
|
+
appendCBORDecisionSourceNode(out, v.sourceNode);
|
|
813
|
+
}
|
|
814
|
+
function decodeCBORImportDecision(data) {
|
|
815
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
816
|
+
return decodeCBORImportDecisionFrom(dec);
|
|
817
|
+
}
|
|
818
|
+
function decodeCBORImportDecisionFrom(dec) {
|
|
819
|
+
const o = {};
|
|
820
|
+
const n = dec.readMapHeader();
|
|
821
|
+
for (let i = 0; i < n; i++) {
|
|
822
|
+
const k = dec.readText();
|
|
823
|
+
switch (k) {
|
|
824
|
+
case "sourceNode":
|
|
825
|
+
o["sourceNode"] = decodeCBORDecisionSourceNodeFrom(dec);
|
|
826
|
+
break;
|
|
827
|
+
case "candidates":
|
|
828
|
+
o["candidates"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
829
|
+
a.push(decodeCBORImportCandidateFrom(dec));
|
|
830
|
+
} return a; })();
|
|
831
|
+
break;
|
|
832
|
+
case "chosen":
|
|
833
|
+
o["chosen"] = decodeCBORDecisionChoiceFrom(dec);
|
|
834
|
+
break;
|
|
835
|
+
case "rationale":
|
|
836
|
+
o["rationale"] = dec.readText();
|
|
837
|
+
break;
|
|
838
|
+
case "swapHint":
|
|
839
|
+
o["swapHint"] = dec.readText();
|
|
840
|
+
break;
|
|
841
|
+
default: dec.skip();
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
return o;
|
|
845
|
+
}
|
|
846
|
+
function encodeCBORDecisionSourceNode(v) {
|
|
847
|
+
const out = [];
|
|
848
|
+
appendCBORDecisionSourceNode(out, v);
|
|
849
|
+
return new Uint8Array(out);
|
|
850
|
+
}
|
|
851
|
+
function appendCBORDecisionSourceNode(out, v) {
|
|
852
|
+
let n = 3;
|
|
853
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
854
|
+
(0, cbor_gen_ts_1.writeText)(out, "id");
|
|
855
|
+
(0, cbor_gen_ts_1.writeText)(out, v.id);
|
|
856
|
+
(0, cbor_gen_ts_1.writeText)(out, "type");
|
|
857
|
+
(0, cbor_gen_ts_1.writeText)(out, v.type);
|
|
858
|
+
(0, cbor_gen_ts_1.writeText)(out, "paramsSummary");
|
|
859
|
+
(0, cbor_gen_ts_1.writeText)(out, v.paramsSummary);
|
|
860
|
+
}
|
|
861
|
+
function decodeCBORDecisionSourceNode(data) {
|
|
862
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
863
|
+
return decodeCBORDecisionSourceNodeFrom(dec);
|
|
864
|
+
}
|
|
865
|
+
function decodeCBORDecisionSourceNodeFrom(dec) {
|
|
866
|
+
const o = {};
|
|
867
|
+
const n = dec.readMapHeader();
|
|
868
|
+
for (let i = 0; i < n; i++) {
|
|
869
|
+
const k = dec.readText();
|
|
870
|
+
switch (k) {
|
|
871
|
+
case "id":
|
|
872
|
+
o["id"] = dec.readText();
|
|
873
|
+
break;
|
|
874
|
+
case "type":
|
|
875
|
+
o["type"] = dec.readText();
|
|
876
|
+
break;
|
|
877
|
+
case "paramsSummary":
|
|
878
|
+
o["paramsSummary"] = dec.readText();
|
|
879
|
+
break;
|
|
880
|
+
default: dec.skip();
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
return o;
|
|
884
|
+
}
|
|
885
|
+
function encodeCBORImportCandidate(v) {
|
|
886
|
+
const out = [];
|
|
887
|
+
appendCBORImportCandidate(out, v);
|
|
888
|
+
return new Uint8Array(out);
|
|
889
|
+
}
|
|
890
|
+
function appendCBORImportCandidate(out, v) {
|
|
891
|
+
let n = 4;
|
|
892
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
893
|
+
(0, cbor_gen_ts_1.writeText)(out, "tier");
|
|
894
|
+
(0, cbor_gen_ts_1.writeText)(out, v.tier);
|
|
895
|
+
(0, cbor_gen_ts_1.writeText)(out, "score");
|
|
896
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.score);
|
|
897
|
+
(0, cbor_gen_ts_1.writeText)(out, "signals");
|
|
898
|
+
appendCBORCandidateSignals(out, v.signals);
|
|
899
|
+
(0, cbor_gen_ts_1.writeText)(out, "componentName");
|
|
900
|
+
(0, cbor_gen_ts_1.writeText)(out, v.componentName);
|
|
901
|
+
}
|
|
902
|
+
function decodeCBORImportCandidate(data) {
|
|
903
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
904
|
+
return decodeCBORImportCandidateFrom(dec);
|
|
905
|
+
}
|
|
906
|
+
function decodeCBORImportCandidateFrom(dec) {
|
|
907
|
+
const o = {};
|
|
908
|
+
const n = dec.readMapHeader();
|
|
909
|
+
for (let i = 0; i < n; i++) {
|
|
910
|
+
const k = dec.readText();
|
|
911
|
+
switch (k) {
|
|
912
|
+
case "componentName":
|
|
913
|
+
o["componentName"] = dec.readText();
|
|
914
|
+
break;
|
|
915
|
+
case "score":
|
|
916
|
+
o["score"] = dec.readFloat();
|
|
917
|
+
break;
|
|
918
|
+
case "tier":
|
|
919
|
+
o["tier"] = dec.readText();
|
|
920
|
+
break;
|
|
921
|
+
case "signals":
|
|
922
|
+
o["signals"] = decodeCBORCandidateSignalsFrom(dec);
|
|
923
|
+
break;
|
|
924
|
+
default: dec.skip();
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
return o;
|
|
928
|
+
}
|
|
929
|
+
function encodeCBORCandidateSignals(v) {
|
|
930
|
+
const out = [];
|
|
931
|
+
appendCBORCandidateSignals(out, v);
|
|
932
|
+
return new Uint8Array(out);
|
|
933
|
+
}
|
|
934
|
+
function appendCBORCandidateSignals(out, v) {
|
|
935
|
+
let n = 5;
|
|
936
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
937
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
938
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.name);
|
|
939
|
+
(0, cbor_gen_ts_1.writeText)(out, "shape");
|
|
940
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.shape);
|
|
941
|
+
(0, cbor_gen_ts_1.writeText)(out, "table");
|
|
942
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.table);
|
|
943
|
+
(0, cbor_gen_ts_1.writeText)(out, "category");
|
|
944
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.category);
|
|
945
|
+
(0, cbor_gen_ts_1.writeText)(out, "domainLabels");
|
|
946
|
+
(0, cbor_gen_ts_1.writeFloat)(out, v.domainLabels);
|
|
947
|
+
}
|
|
948
|
+
function decodeCBORCandidateSignals(data) {
|
|
949
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
950
|
+
return decodeCBORCandidateSignalsFrom(dec);
|
|
951
|
+
}
|
|
952
|
+
function decodeCBORCandidateSignalsFrom(dec) {
|
|
953
|
+
const o = {};
|
|
954
|
+
const n = dec.readMapHeader();
|
|
955
|
+
for (let i = 0; i < n; i++) {
|
|
956
|
+
const k = dec.readText();
|
|
957
|
+
switch (k) {
|
|
958
|
+
case "table":
|
|
959
|
+
o["table"] = dec.readFloat();
|
|
960
|
+
break;
|
|
961
|
+
case "category":
|
|
962
|
+
o["category"] = dec.readFloat();
|
|
963
|
+
break;
|
|
964
|
+
case "domainLabels":
|
|
965
|
+
o["domainLabels"] = dec.readFloat();
|
|
966
|
+
break;
|
|
967
|
+
case "shape":
|
|
968
|
+
o["shape"] = dec.readFloat();
|
|
969
|
+
break;
|
|
970
|
+
case "name":
|
|
971
|
+
o["name"] = dec.readFloat();
|
|
972
|
+
break;
|
|
973
|
+
default: dec.skip();
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
return o;
|
|
977
|
+
}
|
|
978
|
+
function encodeCBORDecisionChoice(v) {
|
|
979
|
+
const out = [];
|
|
980
|
+
appendCBORDecisionChoice(out, v);
|
|
981
|
+
return new Uint8Array(out);
|
|
982
|
+
}
|
|
983
|
+
function appendCBORDecisionChoice(out, v) {
|
|
984
|
+
let n = 3;
|
|
985
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
986
|
+
(0, cbor_gen_ts_1.writeText)(out, "mode");
|
|
987
|
+
(0, cbor_gen_ts_1.writeText)(out, v.mode);
|
|
988
|
+
(0, cbor_gen_ts_1.writeText)(out, "tier");
|
|
989
|
+
(0, cbor_gen_ts_1.writeText)(out, v.tier);
|
|
990
|
+
(0, cbor_gen_ts_1.writeText)(out, "target");
|
|
991
|
+
(0, cbor_gen_ts_1.writeText)(out, v.target);
|
|
992
|
+
}
|
|
993
|
+
function decodeCBORDecisionChoice(data) {
|
|
994
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
995
|
+
return decodeCBORDecisionChoiceFrom(dec);
|
|
996
|
+
}
|
|
997
|
+
function decodeCBORDecisionChoiceFrom(dec) {
|
|
998
|
+
const o = {};
|
|
999
|
+
const n = dec.readMapHeader();
|
|
1000
|
+
for (let i = 0; i < n; i++) {
|
|
1001
|
+
const k = dec.readText();
|
|
1002
|
+
switch (k) {
|
|
1003
|
+
case "target":
|
|
1004
|
+
o["target"] = dec.readText();
|
|
1005
|
+
break;
|
|
1006
|
+
case "mode":
|
|
1007
|
+
o["mode"] = dec.readText();
|
|
1008
|
+
break;
|
|
1009
|
+
case "tier":
|
|
1010
|
+
o["tier"] = dec.readText();
|
|
1011
|
+
break;
|
|
1012
|
+
default: dec.skip();
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return o;
|
|
1016
|
+
}
|
|
1017
|
+
function encodeCBORScaffoldFile(v) {
|
|
1018
|
+
const out = [];
|
|
1019
|
+
appendCBORScaffoldFile(out, v);
|
|
1020
|
+
return new Uint8Array(out);
|
|
1021
|
+
}
|
|
1022
|
+
function appendCBORScaffoldFile(out, v) {
|
|
1023
|
+
let n = 2;
|
|
1024
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1025
|
+
(0, cbor_gen_ts_1.writeText)(out, "path");
|
|
1026
|
+
(0, cbor_gen_ts_1.writeText)(out, v.path);
|
|
1027
|
+
(0, cbor_gen_ts_1.writeText)(out, "content");
|
|
1028
|
+
(0, cbor_gen_ts_1.writeText)(out, v.content);
|
|
1029
|
+
}
|
|
1030
|
+
function decodeCBORScaffoldFile(data) {
|
|
1031
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1032
|
+
return decodeCBORScaffoldFileFrom(dec);
|
|
1033
|
+
}
|
|
1034
|
+
function decodeCBORScaffoldFileFrom(dec) {
|
|
1035
|
+
const o = {};
|
|
1036
|
+
const n = dec.readMapHeader();
|
|
1037
|
+
for (let i = 0; i < n; i++) {
|
|
1038
|
+
const k = dec.readText();
|
|
1039
|
+
switch (k) {
|
|
1040
|
+
case "path":
|
|
1041
|
+
o["path"] = dec.readText();
|
|
1042
|
+
break;
|
|
1043
|
+
case "content":
|
|
1044
|
+
o["content"] = dec.readText();
|
|
1045
|
+
break;
|
|
1046
|
+
default: dec.skip();
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return o;
|
|
1050
|
+
}
|