@aggrega-ai/aggrega-abi 0.0.0-stage → 0.9.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 +202 -0
- package/README.md +23 -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 +30 -4
package/dist/ir_gen.js
ADDED
|
@@ -0,0 +1,1640 @@
|
|
|
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.encodeMaintainer = encodeMaintainer;
|
|
6
|
+
exports.decodeMaintainer = decodeMaintainer;
|
|
7
|
+
exports.encodeFieldProvenance = encodeFieldProvenance;
|
|
8
|
+
exports.decodeFieldProvenance = decodeFieldProvenance;
|
|
9
|
+
exports.encodeAttachmentConnection = encodeAttachmentConnection;
|
|
10
|
+
exports.decodeAttachmentConnection = decodeAttachmentConnection;
|
|
11
|
+
exports.encodeIRFeatureEntry = encodeIRFeatureEntry;
|
|
12
|
+
exports.decodeIRFeatureEntry = decodeIRFeatureEntry;
|
|
13
|
+
exports.encodeIRBoundaryFeature = encodeIRBoundaryFeature;
|
|
14
|
+
exports.decodeIRBoundaryFeature = decodeIRBoundaryFeature;
|
|
15
|
+
exports.encodeCatalogMetadata = encodeCatalogMetadata;
|
|
16
|
+
exports.decodeCatalogMetadata = decodeCatalogMetadata;
|
|
17
|
+
exports.encodeIRNode = encodeIRNode;
|
|
18
|
+
exports.decodeIRNode = decodeIRNode;
|
|
19
|
+
exports.encodeIREdge = encodeIREdge;
|
|
20
|
+
exports.decodeIREdge = decodeIREdge;
|
|
21
|
+
exports.encodeIRMetadata = encodeIRMetadata;
|
|
22
|
+
exports.decodeIRMetadata = decodeIRMetadata;
|
|
23
|
+
exports.encodeIRProvenance = encodeIRProvenance;
|
|
24
|
+
exports.decodeIRProvenance = decodeIRProvenance;
|
|
25
|
+
exports.encodeIRSpec = encodeIRSpec;
|
|
26
|
+
exports.decodeIRSpec = decodeIRSpec;
|
|
27
|
+
exports.encodeIRGraph = encodeIRGraph;
|
|
28
|
+
exports.decodeIRGraph = decodeIRGraph;
|
|
29
|
+
exports.encodeCBORMaintainer = encodeCBORMaintainer;
|
|
30
|
+
exports.appendCBORMaintainer = appendCBORMaintainer;
|
|
31
|
+
exports.decodeCBORMaintainer = decodeCBORMaintainer;
|
|
32
|
+
exports.decodeCBORMaintainerFrom = decodeCBORMaintainerFrom;
|
|
33
|
+
exports.encodeCBORFieldProvenance = encodeCBORFieldProvenance;
|
|
34
|
+
exports.appendCBORFieldProvenance = appendCBORFieldProvenance;
|
|
35
|
+
exports.decodeCBORFieldProvenance = decodeCBORFieldProvenance;
|
|
36
|
+
exports.decodeCBORFieldProvenanceFrom = decodeCBORFieldProvenanceFrom;
|
|
37
|
+
exports.encodeCBORAttachmentConnection = encodeCBORAttachmentConnection;
|
|
38
|
+
exports.appendCBORAttachmentConnection = appendCBORAttachmentConnection;
|
|
39
|
+
exports.decodeCBORAttachmentConnection = decodeCBORAttachmentConnection;
|
|
40
|
+
exports.decodeCBORAttachmentConnectionFrom = decodeCBORAttachmentConnectionFrom;
|
|
41
|
+
exports.encodeCBORIRFeatureEntry = encodeCBORIRFeatureEntry;
|
|
42
|
+
exports.appendCBORIRFeatureEntry = appendCBORIRFeatureEntry;
|
|
43
|
+
exports.decodeCBORIRFeatureEntry = decodeCBORIRFeatureEntry;
|
|
44
|
+
exports.decodeCBORIRFeatureEntryFrom = decodeCBORIRFeatureEntryFrom;
|
|
45
|
+
exports.encodeCBORIRBoundaryFeature = encodeCBORIRBoundaryFeature;
|
|
46
|
+
exports.appendCBORIRBoundaryFeature = appendCBORIRBoundaryFeature;
|
|
47
|
+
exports.decodeCBORIRBoundaryFeature = decodeCBORIRBoundaryFeature;
|
|
48
|
+
exports.decodeCBORIRBoundaryFeatureFrom = decodeCBORIRBoundaryFeatureFrom;
|
|
49
|
+
exports.encodeCBORCatalogMetadata = encodeCBORCatalogMetadata;
|
|
50
|
+
exports.appendCBORCatalogMetadata = appendCBORCatalogMetadata;
|
|
51
|
+
exports.decodeCBORCatalogMetadata = decodeCBORCatalogMetadata;
|
|
52
|
+
exports.decodeCBORCatalogMetadataFrom = decodeCBORCatalogMetadataFrom;
|
|
53
|
+
exports.encodeCBORIRNode = encodeCBORIRNode;
|
|
54
|
+
exports.appendCBORIRNode = appendCBORIRNode;
|
|
55
|
+
exports.decodeCBORIRNode = decodeCBORIRNode;
|
|
56
|
+
exports.decodeCBORIRNodeFrom = decodeCBORIRNodeFrom;
|
|
57
|
+
exports.encodeCBORIREdge = encodeCBORIREdge;
|
|
58
|
+
exports.appendCBORIREdge = appendCBORIREdge;
|
|
59
|
+
exports.decodeCBORIREdge = decodeCBORIREdge;
|
|
60
|
+
exports.decodeCBORIREdgeFrom = decodeCBORIREdgeFrom;
|
|
61
|
+
exports.encodeCBORIRMetadata = encodeCBORIRMetadata;
|
|
62
|
+
exports.appendCBORIRMetadata = appendCBORIRMetadata;
|
|
63
|
+
exports.decodeCBORIRMetadata = decodeCBORIRMetadata;
|
|
64
|
+
exports.decodeCBORIRMetadataFrom = decodeCBORIRMetadataFrom;
|
|
65
|
+
exports.encodeCBORIRProvenance = encodeCBORIRProvenance;
|
|
66
|
+
exports.appendCBORIRProvenance = appendCBORIRProvenance;
|
|
67
|
+
exports.decodeCBORIRProvenance = decodeCBORIRProvenance;
|
|
68
|
+
exports.decodeCBORIRProvenanceFrom = decodeCBORIRProvenanceFrom;
|
|
69
|
+
exports.encodeCBORIRSpec = encodeCBORIRSpec;
|
|
70
|
+
exports.appendCBORIRSpec = appendCBORIRSpec;
|
|
71
|
+
exports.decodeCBORIRSpec = decodeCBORIRSpec;
|
|
72
|
+
exports.decodeCBORIRSpecFrom = decodeCBORIRSpecFrom;
|
|
73
|
+
exports.encodeCBORIRGraph = encodeCBORIRGraph;
|
|
74
|
+
exports.appendCBORIRGraph = appendCBORIRGraph;
|
|
75
|
+
exports.decodeCBORIRGraph = decodeCBORIRGraph;
|
|
76
|
+
exports.decodeCBORIRGraphFrom = decodeCBORIRGraphFrom;
|
|
77
|
+
// Code generated by internal/tools/typegen from
|
|
78
|
+
// aggrega-schemas/json/ir-v1beta1.schema.json. DO NOT EDIT.
|
|
79
|
+
// Regenerate with `go generate ./internal/tools/typegen` from the
|
|
80
|
+
// aggrega-cli checkout.
|
|
81
|
+
const orderedmap_gen_ts_1 = require("./orderedmap_gen.js");
|
|
82
|
+
const cbor_gen_ts_1 = require("./cbor_gen.js");
|
|
83
|
+
function jstr(s) {
|
|
84
|
+
return JSON.stringify(s);
|
|
85
|
+
}
|
|
86
|
+
// encodeOpaque carries an opaque (`any` / RawMessage) value VERBATIM: the
|
|
87
|
+
// key order from JSON.parse is preserved, matching the Go and Rust codecs'
|
|
88
|
+
// byte-carry of opaque values. Opaque values are never sorted.
|
|
89
|
+
function encodeOpaque(v) {
|
|
90
|
+
return JSON.stringify(v);
|
|
91
|
+
}
|
|
92
|
+
function encodeMaintainer(v) {
|
|
93
|
+
const parts = [];
|
|
94
|
+
parts.push(`${jstr("name")}:${jstr(v.name)}`);
|
|
95
|
+
if (v.email !== undefined && v.email !== "")
|
|
96
|
+
parts.push(`${jstr("email")}:${jstr(v.email)}`);
|
|
97
|
+
if (v.url !== undefined && v.url !== "")
|
|
98
|
+
parts.push(`${jstr("url")}:${jstr(v.url)}`);
|
|
99
|
+
return `{${parts.join(",")}}`;
|
|
100
|
+
}
|
|
101
|
+
function decodeMaintainer(data) {
|
|
102
|
+
return JSON.parse(data);
|
|
103
|
+
}
|
|
104
|
+
function encodeFieldProvenance(v) {
|
|
105
|
+
const parts = [];
|
|
106
|
+
parts.push(`${jstr("origin")}:${jstr(v.origin)}`);
|
|
107
|
+
if (v.side !== undefined && v.side !== "")
|
|
108
|
+
parts.push(`${jstr("side")}:${jstr(v.side)}`);
|
|
109
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "")
|
|
110
|
+
parts.push(`${jstr("annotation_key")}:${jstr(v.annotation_key)}`);
|
|
111
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "")
|
|
112
|
+
parts.push(`${jstr("annotation_source")}:${jstr(v.annotation_source)}`);
|
|
113
|
+
if (v.overridden_annotation !== undefined && v.overridden_annotation !== null)
|
|
114
|
+
parts.push(`${jstr("overridden_annotation")}:${encodeFieldProvenance(v.overridden_annotation)}`);
|
|
115
|
+
return `{${parts.join(",")}}`;
|
|
116
|
+
}
|
|
117
|
+
function decodeFieldProvenance(data) {
|
|
118
|
+
return JSON.parse(data);
|
|
119
|
+
}
|
|
120
|
+
function encodeAttachmentConnection(v) {
|
|
121
|
+
const parts = [];
|
|
122
|
+
parts.push(`${jstr("socket")}:${jstr(v.socket)}`);
|
|
123
|
+
parts.push(`${jstr("alias")}:${jstr(v.alias)}`);
|
|
124
|
+
return `{${parts.join(",")}}`;
|
|
125
|
+
}
|
|
126
|
+
function decodeAttachmentConnection(data) {
|
|
127
|
+
return JSON.parse(data);
|
|
128
|
+
}
|
|
129
|
+
function encodeIRFeatureEntry(v) {
|
|
130
|
+
const parts = [];
|
|
131
|
+
parts.push(`${jstr("type")}:${jstr(v.type)}`);
|
|
132
|
+
parts.push(`${jstr("resolved_version")}:${jstr(v.resolved_version)}`);
|
|
133
|
+
if (v.labels !== undefined && v.labels.size > 0)
|
|
134
|
+
parts.push(`${jstr("labels")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.labels, (v0) => jstr(v0))}`);
|
|
135
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0)
|
|
136
|
+
parts.push(`${jstr("catalog_annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.catalog_annotations, (v0) => jstr(v0))}`);
|
|
137
|
+
if (v.binding !== undefined && v.binding !== "")
|
|
138
|
+
parts.push(`${jstr("binding")}:${jstr(v.binding)}`);
|
|
139
|
+
if (v.values !== undefined && v.values !== null)
|
|
140
|
+
parts.push(`${jstr("values")}:${encodeOpaque(v.values)}`);
|
|
141
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
142
|
+
parts.push(`${jstr("infra")}:${encodeOpaque(v.infra)}`);
|
|
143
|
+
if (v.inject !== undefined && v.inject !== null)
|
|
144
|
+
parts.push(`${jstr("inject")}:${encodeOpaque(v.inject)}`);
|
|
145
|
+
if (v.origin !== undefined && v.origin !== "")
|
|
146
|
+
parts.push(`${jstr("origin")}:${jstr(v.origin)}`);
|
|
147
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "")
|
|
148
|
+
parts.push(`${jstr("annotation_key")}:${jstr(v.annotation_key)}`);
|
|
149
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "")
|
|
150
|
+
parts.push(`${jstr("annotation_source")}:${jstr(v.annotation_source)}`);
|
|
151
|
+
if (v.values_provenance !== undefined && v.values_provenance.size > 0)
|
|
152
|
+
parts.push(`${jstr("values_provenance")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.values_provenance, (v0) => encodeFieldProvenance(v0))}`);
|
|
153
|
+
if (v.infra_provenance !== undefined && v.infra_provenance.size > 0)
|
|
154
|
+
parts.push(`${jstr("infra_provenance")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.infra_provenance, (v0) => encodeFieldProvenance(v0))}`);
|
|
155
|
+
if (v.sensitive !== undefined && v.sensitive !== false)
|
|
156
|
+
parts.push(`${jstr("sensitive")}:${String(v.sensitive)}`);
|
|
157
|
+
if (v.sensitive_inject !== undefined && v.sensitive_inject !== null)
|
|
158
|
+
parts.push(`${jstr("sensitive_inject")}:${encodeOpaque(v.sensitive_inject)}`);
|
|
159
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
160
|
+
parts.push(`${jstr("sensitive_payload_leaves")}:${`[${v.sensitive_payload_leaves.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
161
|
+
if (v.connection !== undefined && v.connection !== null)
|
|
162
|
+
parts.push(`${jstr("connection")}:${encodeAttachmentConnection(v.connection)}`);
|
|
163
|
+
if (v.realization !== undefined && v.realization !== "")
|
|
164
|
+
parts.push(`${jstr("realization")}:${jstr(v.realization)}`);
|
|
165
|
+
return `{${parts.join(",")}}`;
|
|
166
|
+
}
|
|
167
|
+
function decodeIRFeatureEntry(data) {
|
|
168
|
+
const o = {};
|
|
169
|
+
(0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
|
|
170
|
+
switch (k) {
|
|
171
|
+
case "type":
|
|
172
|
+
o["type"] = JSON.parse(raw);
|
|
173
|
+
break;
|
|
174
|
+
case "resolved_version":
|
|
175
|
+
o["resolved_version"] = JSON.parse(raw);
|
|
176
|
+
break;
|
|
177
|
+
case "labels":
|
|
178
|
+
o["labels"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
179
|
+
break;
|
|
180
|
+
case "catalog_annotations":
|
|
181
|
+
o["catalog_annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
182
|
+
break;
|
|
183
|
+
case "binding":
|
|
184
|
+
o["binding"] = JSON.parse(raw);
|
|
185
|
+
break;
|
|
186
|
+
case "values":
|
|
187
|
+
o["values"] = JSON.parse(raw);
|
|
188
|
+
break;
|
|
189
|
+
case "infra":
|
|
190
|
+
o["infra"] = JSON.parse(raw);
|
|
191
|
+
break;
|
|
192
|
+
case "inject":
|
|
193
|
+
o["inject"] = JSON.parse(raw);
|
|
194
|
+
break;
|
|
195
|
+
case "origin":
|
|
196
|
+
o["origin"] = JSON.parse(raw);
|
|
197
|
+
break;
|
|
198
|
+
case "annotation_key":
|
|
199
|
+
o["annotation_key"] = JSON.parse(raw);
|
|
200
|
+
break;
|
|
201
|
+
case "annotation_source":
|
|
202
|
+
o["annotation_source"] = JSON.parse(raw);
|
|
203
|
+
break;
|
|
204
|
+
case "values_provenance":
|
|
205
|
+
o["values_provenance"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
206
|
+
break;
|
|
207
|
+
case "infra_provenance":
|
|
208
|
+
o["infra_provenance"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
209
|
+
break;
|
|
210
|
+
case "sensitive":
|
|
211
|
+
o["sensitive"] = JSON.parse(raw);
|
|
212
|
+
break;
|
|
213
|
+
case "sensitive_inject":
|
|
214
|
+
o["sensitive_inject"] = JSON.parse(raw);
|
|
215
|
+
break;
|
|
216
|
+
case "sensitive_payload_leaves":
|
|
217
|
+
o["sensitive_payload_leaves"] = JSON.parse(raw);
|
|
218
|
+
break;
|
|
219
|
+
case "connection":
|
|
220
|
+
o["connection"] = JSON.parse(raw);
|
|
221
|
+
break;
|
|
222
|
+
case "realization":
|
|
223
|
+
o["realization"] = JSON.parse(raw);
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
return o;
|
|
228
|
+
}
|
|
229
|
+
function encodeIRBoundaryFeature(v) {
|
|
230
|
+
const parts = [];
|
|
231
|
+
parts.push(`${jstr("type")}:${jstr(v.type)}`);
|
|
232
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
233
|
+
parts.push(`${jstr("infra")}:${encodeOpaque(v.infra)}`);
|
|
234
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
235
|
+
parts.push(`${jstr("sensitive_payload_leaves")}:${`[${v.sensitive_payload_leaves.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
236
|
+
if (v.realization !== undefined && v.realization !== "")
|
|
237
|
+
parts.push(`${jstr("realization")}:${jstr(v.realization)}`);
|
|
238
|
+
return `{${parts.join(",")}}`;
|
|
239
|
+
}
|
|
240
|
+
function decodeIRBoundaryFeature(data) {
|
|
241
|
+
return JSON.parse(data);
|
|
242
|
+
}
|
|
243
|
+
function encodeCatalogMetadata(v) {
|
|
244
|
+
const parts = [];
|
|
245
|
+
if (v.maintainers !== undefined && v.maintainers.length > 0)
|
|
246
|
+
parts.push(`${jstr("maintainers")}:${`[${v.maintainers.map((e0) => encodeMaintainer(e0)).join(",")}]`}`);
|
|
247
|
+
if (v.license !== undefined && v.license !== "")
|
|
248
|
+
parts.push(`${jstr("license")}:${jstr(v.license)}`);
|
|
249
|
+
if (v.repository !== undefined && v.repository !== "")
|
|
250
|
+
parts.push(`${jstr("repository")}:${jstr(v.repository)}`);
|
|
251
|
+
if (v.home !== undefined && v.home !== "")
|
|
252
|
+
parts.push(`${jstr("home")}:${jstr(v.home)}`);
|
|
253
|
+
if (v.keywords !== undefined && v.keywords.length > 0)
|
|
254
|
+
parts.push(`${jstr("keywords")}:${`[${v.keywords.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
255
|
+
return `{${parts.join(",")}}`;
|
|
256
|
+
}
|
|
257
|
+
function decodeCatalogMetadata(data) {
|
|
258
|
+
return JSON.parse(data);
|
|
259
|
+
}
|
|
260
|
+
function encodeIRNode(v) {
|
|
261
|
+
const parts = [];
|
|
262
|
+
if (v.description !== undefined && v.description !== "")
|
|
263
|
+
parts.push(`${jstr("description")}:${jstr(v.description)}`);
|
|
264
|
+
parts.push(`${jstr("labels")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.labels, (v0) => jstr(v0))}`);
|
|
265
|
+
parts.push(`${jstr("component")}:${jstr(v.component)}`);
|
|
266
|
+
parts.push(`${jstr("resolved_version")}:${jstr(v.resolved_version)}`);
|
|
267
|
+
if (v.sync_wave !== undefined && v.sync_wave !== 0)
|
|
268
|
+
parts.push(`${jstr("sync_wave")}:${String(v.sync_wave)}`);
|
|
269
|
+
if (v.boundary_path !== undefined && v.boundary_path !== "")
|
|
270
|
+
parts.push(`${jstr("boundary_path")}:${jstr(v.boundary_path)}`);
|
|
271
|
+
if (v.subsystem_path !== undefined && v.subsystem_path !== "")
|
|
272
|
+
parts.push(`${jstr("subsystem_path")}:${jstr(v.subsystem_path)}`);
|
|
273
|
+
if (v.synthesized_subsystem !== undefined && v.synthesized_subsystem !== false)
|
|
274
|
+
parts.push(`${jstr("synthesized_subsystem")}:${String(v.synthesized_subsystem)}`);
|
|
275
|
+
if (v.synthesized_boundary !== undefined && v.synthesized_boundary !== false)
|
|
276
|
+
parts.push(`${jstr("synthesized_boundary")}:${String(v.synthesized_boundary)}`);
|
|
277
|
+
if (v.catalog_metadata !== undefined && v.catalog_metadata !== null)
|
|
278
|
+
parts.push(`${jstr("catalog_metadata")}:${encodeCatalogMetadata(v.catalog_metadata)}`);
|
|
279
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0)
|
|
280
|
+
parts.push(`${jstr("catalog_annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.catalog_annotations, (v0) => jstr(v0))}`);
|
|
281
|
+
if (v.release_annotations !== undefined && v.release_annotations.size > 0)
|
|
282
|
+
parts.push(`${jstr("release_annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.release_annotations, (v0) => jstr(v0))}`);
|
|
283
|
+
if (v.aggregate_annotations !== undefined && v.aggregate_annotations.size > 0)
|
|
284
|
+
parts.push(`${jstr("aggregate_annotations")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.aggregate_annotations, (v0) => jstr(v0))}`);
|
|
285
|
+
if (v.self_inject !== undefined && v.self_inject !== null)
|
|
286
|
+
parts.push(`${jstr("self_inject")}:${encodeOpaque(v.self_inject)}`);
|
|
287
|
+
if (v.source_file !== undefined && v.source_file !== "")
|
|
288
|
+
parts.push(`${jstr("source_file")}:${jstr(v.source_file)}`);
|
|
289
|
+
if (v.uses !== undefined && v.uses !== null)
|
|
290
|
+
parts.push(`${jstr("uses")}:${encodeOpaque(v.uses)}`);
|
|
291
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
292
|
+
parts.push(`${jstr("sensitive_payload_leaves")}:${`[${v.sensitive_payload_leaves.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
293
|
+
return `{${parts.join(",")}}`;
|
|
294
|
+
}
|
|
295
|
+
function decodeIRNode(data) {
|
|
296
|
+
const o = {};
|
|
297
|
+
(0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
|
|
298
|
+
switch (k) {
|
|
299
|
+
case "description":
|
|
300
|
+
o["description"] = JSON.parse(raw);
|
|
301
|
+
break;
|
|
302
|
+
case "labels":
|
|
303
|
+
o["labels"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
304
|
+
break;
|
|
305
|
+
case "component":
|
|
306
|
+
o["component"] = JSON.parse(raw);
|
|
307
|
+
break;
|
|
308
|
+
case "resolved_version":
|
|
309
|
+
o["resolved_version"] = JSON.parse(raw);
|
|
310
|
+
break;
|
|
311
|
+
case "sync_wave":
|
|
312
|
+
o["sync_wave"] = JSON.parse(raw);
|
|
313
|
+
break;
|
|
314
|
+
case "boundary_path":
|
|
315
|
+
o["boundary_path"] = JSON.parse(raw);
|
|
316
|
+
break;
|
|
317
|
+
case "subsystem_path":
|
|
318
|
+
o["subsystem_path"] = JSON.parse(raw);
|
|
319
|
+
break;
|
|
320
|
+
case "synthesized_subsystem":
|
|
321
|
+
o["synthesized_subsystem"] = JSON.parse(raw);
|
|
322
|
+
break;
|
|
323
|
+
case "synthesized_boundary":
|
|
324
|
+
o["synthesized_boundary"] = JSON.parse(raw);
|
|
325
|
+
break;
|
|
326
|
+
case "catalog_metadata":
|
|
327
|
+
o["catalog_metadata"] = JSON.parse(raw);
|
|
328
|
+
break;
|
|
329
|
+
case "catalog_annotations":
|
|
330
|
+
o["catalog_annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
331
|
+
break;
|
|
332
|
+
case "release_annotations":
|
|
333
|
+
o["release_annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
334
|
+
break;
|
|
335
|
+
case "aggregate_annotations":
|
|
336
|
+
o["aggregate_annotations"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
337
|
+
break;
|
|
338
|
+
case "self_inject":
|
|
339
|
+
o["self_inject"] = JSON.parse(raw);
|
|
340
|
+
break;
|
|
341
|
+
case "source_file":
|
|
342
|
+
o["source_file"] = JSON.parse(raw);
|
|
343
|
+
break;
|
|
344
|
+
case "uses":
|
|
345
|
+
o["uses"] = JSON.parse(raw);
|
|
346
|
+
break;
|
|
347
|
+
case "sensitive_payload_leaves":
|
|
348
|
+
o["sensitive_payload_leaves"] = JSON.parse(raw);
|
|
349
|
+
break;
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
return o;
|
|
353
|
+
}
|
|
354
|
+
function encodeIREdge(v) {
|
|
355
|
+
const parts = [];
|
|
356
|
+
parts.push(`${jstr("source")}:${jstr(v.source)}`);
|
|
357
|
+
parts.push(`${jstr("target")}:${jstr(v.target)}`);
|
|
358
|
+
if (v.socket !== undefined && v.socket !== "")
|
|
359
|
+
parts.push(`${jstr("socket")}:${jstr(v.socket)}`);
|
|
360
|
+
if (v.alias !== undefined && v.alias !== "")
|
|
361
|
+
parts.push(`${jstr("alias")}:${jstr(v.alias)}`);
|
|
362
|
+
parts.push(`${jstr("socket_declaration")}:${jstr(v.socket_declaration)}`);
|
|
363
|
+
if (v.origin_feature !== undefined && v.origin_feature !== "")
|
|
364
|
+
parts.push(`${jstr("origin_feature")}:${jstr(v.origin_feature)}`);
|
|
365
|
+
if (v.origin_feature_instance !== undefined && v.origin_feature_instance !== "")
|
|
366
|
+
parts.push(`${jstr("origin_feature_instance")}:${jstr(v.origin_feature_instance)}`);
|
|
367
|
+
if (v.origin_release !== undefined && v.origin_release !== false)
|
|
368
|
+
parts.push(`${jstr("origin_release")}:${String(v.origin_release)}`);
|
|
369
|
+
if (v.values !== undefined && v.values !== null)
|
|
370
|
+
parts.push(`${jstr("values")}:${encodeOpaque(v.values)}`);
|
|
371
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
372
|
+
parts.push(`${jstr("infra")}:${encodeOpaque(v.infra)}`);
|
|
373
|
+
if (v.inject !== undefined && v.inject !== null)
|
|
374
|
+
parts.push(`${jstr("inject")}:${encodeOpaque(v.inject)}`);
|
|
375
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
376
|
+
parts.push(`${jstr("sensitive_payload_leaves")}:${`[${v.sensitive_payload_leaves.map((e0) => jstr(e0)).join(",")}]`}`);
|
|
377
|
+
return `{${parts.join(",")}}`;
|
|
378
|
+
}
|
|
379
|
+
function decodeIREdge(data) {
|
|
380
|
+
return JSON.parse(data);
|
|
381
|
+
}
|
|
382
|
+
function encodeIRMetadata(v) {
|
|
383
|
+
const parts = [];
|
|
384
|
+
parts.push(`${jstr("aggregate_name")}:${jstr(v.aggregate_name)}`);
|
|
385
|
+
return `{${parts.join(",")}}`;
|
|
386
|
+
}
|
|
387
|
+
function decodeIRMetadata(data) {
|
|
388
|
+
return JSON.parse(data);
|
|
389
|
+
}
|
|
390
|
+
function encodeIRProvenance(v) {
|
|
391
|
+
const parts = [];
|
|
392
|
+
parts.push(`${jstr("schema_version")}:${jstr(v.schema_version)}`);
|
|
393
|
+
parts.push(`${jstr("compiler_version")}:${jstr(v.compiler_version)}`);
|
|
394
|
+
parts.push(`${jstr("aggregate_version")}:${jstr(v.aggregate_version)}`);
|
|
395
|
+
parts.push(`${jstr("manifest_version")}:${jstr(v.manifest_version)}`);
|
|
396
|
+
parts.push(`${jstr("release_version")}:${jstr(v.release_version)}`);
|
|
397
|
+
return `{${parts.join(",")}}`;
|
|
398
|
+
}
|
|
399
|
+
function decodeIRProvenance(data) {
|
|
400
|
+
return JSON.parse(data);
|
|
401
|
+
}
|
|
402
|
+
function encodeIRSpec(v) {
|
|
403
|
+
const parts = [];
|
|
404
|
+
parts.push(`${jstr("nodes")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.nodes, (v0) => encodeIRNode(v0))}`);
|
|
405
|
+
parts.push(`${jstr("edges")}:${`[${v.edges.map((e0) => encodeIREdge(e0)).join(",")}]`}`);
|
|
406
|
+
parts.push(`${jstr("values_mapping")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.values_mapping, (v0) => encodeOpaque(v0))}`);
|
|
407
|
+
parts.push(`${jstr("infra_mapping")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.infra_mapping, (v0) => encodeOpaque(v0))}`);
|
|
408
|
+
parts.push(`${jstr("feature_values_mapping")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.feature_values_mapping, (v0) => (0, orderedmap_gen_ts_1.writeOrderedObject)(v0, (v1) => encodeIRFeatureEntry(v1)))}`);
|
|
409
|
+
if (v.boundary_features !== undefined && v.boundary_features.size > 0)
|
|
410
|
+
parts.push(`${jstr("boundary_features")}:${(0, orderedmap_gen_ts_1.writeOrderedObject)(v.boundary_features, (v0) => (0, orderedmap_gen_ts_1.writeOrderedObject)(v0, (v1) => encodeIRBoundaryFeature(v1)))}`);
|
|
411
|
+
parts.push(`${jstr("provenance")}:${encodeIRProvenance(v.provenance)}`);
|
|
412
|
+
return `{${parts.join(",")}}`;
|
|
413
|
+
}
|
|
414
|
+
function decodeIRSpec(data) {
|
|
415
|
+
const o = {};
|
|
416
|
+
(0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
|
|
417
|
+
switch (k) {
|
|
418
|
+
case "nodes":
|
|
419
|
+
o["nodes"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => decodeIRNode(r0));
|
|
420
|
+
break;
|
|
421
|
+
case "edges":
|
|
422
|
+
o["edges"] = JSON.parse(raw);
|
|
423
|
+
break;
|
|
424
|
+
case "values_mapping":
|
|
425
|
+
o["values_mapping"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
426
|
+
break;
|
|
427
|
+
case "infra_mapping":
|
|
428
|
+
o["infra_mapping"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => JSON.parse(r0));
|
|
429
|
+
break;
|
|
430
|
+
case "feature_values_mapping":
|
|
431
|
+
o["feature_values_mapping"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => (0, orderedmap_gen_ts_1.readOrderedObject)(r0, (r1) => decodeIRFeatureEntry(r1)));
|
|
432
|
+
break;
|
|
433
|
+
case "boundary_features":
|
|
434
|
+
o["boundary_features"] = (0, orderedmap_gen_ts_1.readOrderedObject)(raw, (r0) => (0, orderedmap_gen_ts_1.readOrderedObject)(r0, (r1) => JSON.parse(r1)));
|
|
435
|
+
break;
|
|
436
|
+
case "provenance":
|
|
437
|
+
o["provenance"] = JSON.parse(raw);
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
});
|
|
441
|
+
return o;
|
|
442
|
+
}
|
|
443
|
+
function encodeIRGraph(v) {
|
|
444
|
+
const parts = [];
|
|
445
|
+
parts.push(`${jstr("apiVersion")}:${jstr(v.apiVersion)}`);
|
|
446
|
+
parts.push(`${jstr("kind")}:${jstr(v.kind)}`);
|
|
447
|
+
parts.push(`${jstr("metadata")}:${encodeIRMetadata(v.metadata)}`);
|
|
448
|
+
parts.push(`${jstr("spec")}:${encodeIRSpec(v.spec)}`);
|
|
449
|
+
return `{${parts.join(",")}}`;
|
|
450
|
+
}
|
|
451
|
+
function decodeIRGraph(data) {
|
|
452
|
+
const o = {};
|
|
453
|
+
(0, orderedmap_gen_ts_1.readJSONMembers)(data, (k, raw) => {
|
|
454
|
+
switch (k) {
|
|
455
|
+
case "apiVersion":
|
|
456
|
+
o["apiVersion"] = JSON.parse(raw);
|
|
457
|
+
break;
|
|
458
|
+
case "kind":
|
|
459
|
+
o["kind"] = JSON.parse(raw);
|
|
460
|
+
break;
|
|
461
|
+
case "metadata":
|
|
462
|
+
o["metadata"] = JSON.parse(raw);
|
|
463
|
+
break;
|
|
464
|
+
case "spec":
|
|
465
|
+
o["spec"] = decodeIRSpec(raw);
|
|
466
|
+
break;
|
|
467
|
+
}
|
|
468
|
+
});
|
|
469
|
+
return o;
|
|
470
|
+
}
|
|
471
|
+
function encodeCBORMaintainer(v) {
|
|
472
|
+
const out = [];
|
|
473
|
+
appendCBORMaintainer(out, v);
|
|
474
|
+
return new Uint8Array(out);
|
|
475
|
+
}
|
|
476
|
+
function appendCBORMaintainer(out, v) {
|
|
477
|
+
let n = 1;
|
|
478
|
+
if (v.url !== undefined && v.url !== "")
|
|
479
|
+
n++;
|
|
480
|
+
if (v.email !== undefined && v.email !== "")
|
|
481
|
+
n++;
|
|
482
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
483
|
+
if (v.url !== undefined && v.url !== "") {
|
|
484
|
+
(0, cbor_gen_ts_1.writeText)(out, "url");
|
|
485
|
+
(0, cbor_gen_ts_1.writeText)(out, v.url);
|
|
486
|
+
}
|
|
487
|
+
(0, cbor_gen_ts_1.writeText)(out, "name");
|
|
488
|
+
(0, cbor_gen_ts_1.writeText)(out, v.name);
|
|
489
|
+
if (v.email !== undefined && v.email !== "") {
|
|
490
|
+
(0, cbor_gen_ts_1.writeText)(out, "email");
|
|
491
|
+
(0, cbor_gen_ts_1.writeText)(out, v.email);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
function decodeCBORMaintainer(data) {
|
|
495
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
496
|
+
return decodeCBORMaintainerFrom(dec);
|
|
497
|
+
}
|
|
498
|
+
function decodeCBORMaintainerFrom(dec) {
|
|
499
|
+
const o = {};
|
|
500
|
+
const n = dec.readMapHeader();
|
|
501
|
+
for (let i = 0; i < n; i++) {
|
|
502
|
+
const k = dec.readText();
|
|
503
|
+
switch (k) {
|
|
504
|
+
case "name":
|
|
505
|
+
o["name"] = dec.readText();
|
|
506
|
+
break;
|
|
507
|
+
case "email":
|
|
508
|
+
o["email"] = dec.readText();
|
|
509
|
+
break;
|
|
510
|
+
case "url":
|
|
511
|
+
o["url"] = dec.readText();
|
|
512
|
+
break;
|
|
513
|
+
default: dec.skip();
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
return o;
|
|
517
|
+
}
|
|
518
|
+
function encodeCBORFieldProvenance(v) {
|
|
519
|
+
const out = [];
|
|
520
|
+
appendCBORFieldProvenance(out, v);
|
|
521
|
+
return new Uint8Array(out);
|
|
522
|
+
}
|
|
523
|
+
function appendCBORFieldProvenance(out, v) {
|
|
524
|
+
let n = 1;
|
|
525
|
+
if (v.side !== undefined && v.side !== "")
|
|
526
|
+
n++;
|
|
527
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "")
|
|
528
|
+
n++;
|
|
529
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "")
|
|
530
|
+
n++;
|
|
531
|
+
if (v.overridden_annotation !== undefined && v.overridden_annotation !== null)
|
|
532
|
+
n++;
|
|
533
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
534
|
+
if (v.side !== undefined && v.side !== "") {
|
|
535
|
+
(0, cbor_gen_ts_1.writeText)(out, "side");
|
|
536
|
+
(0, cbor_gen_ts_1.writeText)(out, v.side);
|
|
537
|
+
}
|
|
538
|
+
(0, cbor_gen_ts_1.writeText)(out, "origin");
|
|
539
|
+
(0, cbor_gen_ts_1.writeText)(out, v.origin);
|
|
540
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "") {
|
|
541
|
+
(0, cbor_gen_ts_1.writeText)(out, "annotation_key");
|
|
542
|
+
(0, cbor_gen_ts_1.writeText)(out, v.annotation_key);
|
|
543
|
+
}
|
|
544
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "") {
|
|
545
|
+
(0, cbor_gen_ts_1.writeText)(out, "annotation_source");
|
|
546
|
+
(0, cbor_gen_ts_1.writeText)(out, v.annotation_source);
|
|
547
|
+
}
|
|
548
|
+
if (v.overridden_annotation !== undefined && v.overridden_annotation !== null) {
|
|
549
|
+
(0, cbor_gen_ts_1.writeText)(out, "overridden_annotation");
|
|
550
|
+
appendCBORFieldProvenance(out, v.overridden_annotation);
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
function decodeCBORFieldProvenance(data) {
|
|
554
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
555
|
+
return decodeCBORFieldProvenanceFrom(dec);
|
|
556
|
+
}
|
|
557
|
+
function decodeCBORFieldProvenanceFrom(dec) {
|
|
558
|
+
const o = {};
|
|
559
|
+
const n = dec.readMapHeader();
|
|
560
|
+
for (let i = 0; i < n; i++) {
|
|
561
|
+
const k = dec.readText();
|
|
562
|
+
switch (k) {
|
|
563
|
+
case "origin":
|
|
564
|
+
o["origin"] = dec.readText();
|
|
565
|
+
break;
|
|
566
|
+
case "side":
|
|
567
|
+
o["side"] = dec.readText();
|
|
568
|
+
break;
|
|
569
|
+
case "annotation_key":
|
|
570
|
+
o["annotation_key"] = dec.readText();
|
|
571
|
+
break;
|
|
572
|
+
case "annotation_source":
|
|
573
|
+
o["annotation_source"] = dec.readText();
|
|
574
|
+
break;
|
|
575
|
+
case "overridden_annotation":
|
|
576
|
+
o["overridden_annotation"] = decodeCBORFieldProvenanceFrom(dec);
|
|
577
|
+
break;
|
|
578
|
+
default: dec.skip();
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
return o;
|
|
582
|
+
}
|
|
583
|
+
function encodeCBORAttachmentConnection(v) {
|
|
584
|
+
const out = [];
|
|
585
|
+
appendCBORAttachmentConnection(out, v);
|
|
586
|
+
return new Uint8Array(out);
|
|
587
|
+
}
|
|
588
|
+
function appendCBORAttachmentConnection(out, v) {
|
|
589
|
+
let n = 2;
|
|
590
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
591
|
+
(0, cbor_gen_ts_1.writeText)(out, "alias");
|
|
592
|
+
(0, cbor_gen_ts_1.writeText)(out, v.alias);
|
|
593
|
+
(0, cbor_gen_ts_1.writeText)(out, "socket");
|
|
594
|
+
(0, cbor_gen_ts_1.writeText)(out, v.socket);
|
|
595
|
+
}
|
|
596
|
+
function decodeCBORAttachmentConnection(data) {
|
|
597
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
598
|
+
return decodeCBORAttachmentConnectionFrom(dec);
|
|
599
|
+
}
|
|
600
|
+
function decodeCBORAttachmentConnectionFrom(dec) {
|
|
601
|
+
const o = {};
|
|
602
|
+
const n = dec.readMapHeader();
|
|
603
|
+
for (let i = 0; i < n; i++) {
|
|
604
|
+
const k = dec.readText();
|
|
605
|
+
switch (k) {
|
|
606
|
+
case "socket":
|
|
607
|
+
o["socket"] = dec.readText();
|
|
608
|
+
break;
|
|
609
|
+
case "alias":
|
|
610
|
+
o["alias"] = dec.readText();
|
|
611
|
+
break;
|
|
612
|
+
default: dec.skip();
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
return o;
|
|
616
|
+
}
|
|
617
|
+
function encodeCBORIRFeatureEntry(v) {
|
|
618
|
+
const out = [];
|
|
619
|
+
appendCBORIRFeatureEntry(out, v);
|
|
620
|
+
return new Uint8Array(out);
|
|
621
|
+
}
|
|
622
|
+
function appendCBORIRFeatureEntry(out, v) {
|
|
623
|
+
let n = 2;
|
|
624
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
625
|
+
n++;
|
|
626
|
+
if (v.inject !== undefined && v.inject !== null)
|
|
627
|
+
n++;
|
|
628
|
+
if (v.labels !== undefined && v.labels.size > 0)
|
|
629
|
+
n++;
|
|
630
|
+
if (v.origin !== undefined && v.origin !== "")
|
|
631
|
+
n++;
|
|
632
|
+
if (v.values !== undefined && v.values !== null)
|
|
633
|
+
n++;
|
|
634
|
+
if (v.binding !== undefined && v.binding !== "")
|
|
635
|
+
n++;
|
|
636
|
+
if (v.sensitive !== undefined && v.sensitive !== false)
|
|
637
|
+
n++;
|
|
638
|
+
if (v.connection !== undefined && v.connection !== null)
|
|
639
|
+
n++;
|
|
640
|
+
if (v.realization !== undefined && v.realization !== "")
|
|
641
|
+
n++;
|
|
642
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "")
|
|
643
|
+
n++;
|
|
644
|
+
if (v.infra_provenance !== undefined && v.infra_provenance.size > 0)
|
|
645
|
+
n++;
|
|
646
|
+
if (v.sensitive_inject !== undefined && v.sensitive_inject !== null)
|
|
647
|
+
n++;
|
|
648
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "")
|
|
649
|
+
n++;
|
|
650
|
+
if (v.values_provenance !== undefined && v.values_provenance.size > 0)
|
|
651
|
+
n++;
|
|
652
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0)
|
|
653
|
+
n++;
|
|
654
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
655
|
+
n++;
|
|
656
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
657
|
+
(0, cbor_gen_ts_1.writeText)(out, "type");
|
|
658
|
+
(0, cbor_gen_ts_1.writeText)(out, v.type);
|
|
659
|
+
if (v.infra !== undefined && v.infra !== null) {
|
|
660
|
+
(0, cbor_gen_ts_1.writeText)(out, "infra");
|
|
661
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.infra)));
|
|
662
|
+
}
|
|
663
|
+
if (v.inject !== undefined && v.inject !== null) {
|
|
664
|
+
(0, cbor_gen_ts_1.writeText)(out, "inject");
|
|
665
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.inject)));
|
|
666
|
+
}
|
|
667
|
+
if (v.labels !== undefined && v.labels.size > 0) {
|
|
668
|
+
(0, cbor_gen_ts_1.writeText)(out, "labels");
|
|
669
|
+
{
|
|
670
|
+
const m0 = v.labels;
|
|
671
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
672
|
+
for (const [kk0, vv0] of m0) {
|
|
673
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
674
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
675
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
if (v.origin !== undefined && v.origin !== "") {
|
|
680
|
+
(0, cbor_gen_ts_1.writeText)(out, "origin");
|
|
681
|
+
(0, cbor_gen_ts_1.writeText)(out, v.origin);
|
|
682
|
+
}
|
|
683
|
+
if (v.values !== undefined && v.values !== null) {
|
|
684
|
+
(0, cbor_gen_ts_1.writeText)(out, "values");
|
|
685
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.values)));
|
|
686
|
+
}
|
|
687
|
+
if (v.binding !== undefined && v.binding !== "") {
|
|
688
|
+
(0, cbor_gen_ts_1.writeText)(out, "binding");
|
|
689
|
+
(0, cbor_gen_ts_1.writeText)(out, v.binding);
|
|
690
|
+
}
|
|
691
|
+
if (v.sensitive !== undefined && v.sensitive !== false) {
|
|
692
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive");
|
|
693
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.sensitive);
|
|
694
|
+
}
|
|
695
|
+
if (v.connection !== undefined && v.connection !== null) {
|
|
696
|
+
(0, cbor_gen_ts_1.writeText)(out, "connection");
|
|
697
|
+
appendCBORAttachmentConnection(out, v.connection);
|
|
698
|
+
}
|
|
699
|
+
if (v.realization !== undefined && v.realization !== "") {
|
|
700
|
+
(0, cbor_gen_ts_1.writeText)(out, "realization");
|
|
701
|
+
(0, cbor_gen_ts_1.writeText)(out, v.realization);
|
|
702
|
+
}
|
|
703
|
+
if (v.annotation_key !== undefined && v.annotation_key !== "") {
|
|
704
|
+
(0, cbor_gen_ts_1.writeText)(out, "annotation_key");
|
|
705
|
+
(0, cbor_gen_ts_1.writeText)(out, v.annotation_key);
|
|
706
|
+
}
|
|
707
|
+
if (v.infra_provenance !== undefined && v.infra_provenance.size > 0) {
|
|
708
|
+
(0, cbor_gen_ts_1.writeText)(out, "infra_provenance");
|
|
709
|
+
{
|
|
710
|
+
const m0 = v.infra_provenance;
|
|
711
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
712
|
+
for (const [kk0, vv0] of m0) {
|
|
713
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
714
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
715
|
+
appendCBORFieldProvenance(out, vv0);
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
(0, cbor_gen_ts_1.writeText)(out, "resolved_version");
|
|
720
|
+
(0, cbor_gen_ts_1.writeText)(out, v.resolved_version);
|
|
721
|
+
if (v.sensitive_inject !== undefined && v.sensitive_inject !== null) {
|
|
722
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive_inject");
|
|
723
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.sensitive_inject)));
|
|
724
|
+
}
|
|
725
|
+
if (v.annotation_source !== undefined && v.annotation_source !== "") {
|
|
726
|
+
(0, cbor_gen_ts_1.writeText)(out, "annotation_source");
|
|
727
|
+
(0, cbor_gen_ts_1.writeText)(out, v.annotation_source);
|
|
728
|
+
}
|
|
729
|
+
if (v.values_provenance !== undefined && v.values_provenance.size > 0) {
|
|
730
|
+
(0, cbor_gen_ts_1.writeText)(out, "values_provenance");
|
|
731
|
+
{
|
|
732
|
+
const m0 = v.values_provenance;
|
|
733
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
734
|
+
for (const [kk0, vv0] of m0) {
|
|
735
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
736
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
737
|
+
appendCBORFieldProvenance(out, vv0);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0) {
|
|
742
|
+
(0, cbor_gen_ts_1.writeText)(out, "catalog_annotations");
|
|
743
|
+
{
|
|
744
|
+
const m0 = v.catalog_annotations;
|
|
745
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
746
|
+
for (const [kk0, vv0] of m0) {
|
|
747
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
748
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
749
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0) {
|
|
754
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive_payload_leaves");
|
|
755
|
+
{
|
|
756
|
+
const a0 = v.sensitive_payload_leaves;
|
|
757
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
758
|
+
for (const ee0 of a0) {
|
|
759
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
function decodeCBORIRFeatureEntry(data) {
|
|
765
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
766
|
+
return decodeCBORIRFeatureEntryFrom(dec);
|
|
767
|
+
}
|
|
768
|
+
function decodeCBORIRFeatureEntryFrom(dec) {
|
|
769
|
+
const o = {};
|
|
770
|
+
const n = dec.readMapHeader();
|
|
771
|
+
for (let i = 0; i < n; i++) {
|
|
772
|
+
const k = dec.readText();
|
|
773
|
+
switch (k) {
|
|
774
|
+
case "type":
|
|
775
|
+
o["type"] = dec.readText();
|
|
776
|
+
break;
|
|
777
|
+
case "resolved_version":
|
|
778
|
+
o["resolved_version"] = dec.readText();
|
|
779
|
+
break;
|
|
780
|
+
case "labels":
|
|
781
|
+
o["labels"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
782
|
+
const mk = dec.readEntryKey();
|
|
783
|
+
if (m.has(mk))
|
|
784
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
785
|
+
m.set(mk, dec.readText());
|
|
786
|
+
} return m; })();
|
|
787
|
+
break;
|
|
788
|
+
case "catalog_annotations":
|
|
789
|
+
o["catalog_annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
790
|
+
const mk = dec.readEntryKey();
|
|
791
|
+
if (m.has(mk))
|
|
792
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
793
|
+
m.set(mk, dec.readText());
|
|
794
|
+
} return m; })();
|
|
795
|
+
break;
|
|
796
|
+
case "binding":
|
|
797
|
+
o["binding"] = dec.readText();
|
|
798
|
+
break;
|
|
799
|
+
case "values":
|
|
800
|
+
o["values"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
801
|
+
break;
|
|
802
|
+
case "infra":
|
|
803
|
+
o["infra"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
804
|
+
break;
|
|
805
|
+
case "inject":
|
|
806
|
+
o["inject"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
807
|
+
break;
|
|
808
|
+
case "origin":
|
|
809
|
+
o["origin"] = dec.readText();
|
|
810
|
+
break;
|
|
811
|
+
case "annotation_key":
|
|
812
|
+
o["annotation_key"] = dec.readText();
|
|
813
|
+
break;
|
|
814
|
+
case "annotation_source":
|
|
815
|
+
o["annotation_source"] = dec.readText();
|
|
816
|
+
break;
|
|
817
|
+
case "values_provenance":
|
|
818
|
+
o["values_provenance"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
819
|
+
const mk = dec.readEntryKey();
|
|
820
|
+
if (m.has(mk))
|
|
821
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
822
|
+
m.set(mk, decodeCBORFieldProvenanceFrom(dec));
|
|
823
|
+
} return m; })();
|
|
824
|
+
break;
|
|
825
|
+
case "infra_provenance":
|
|
826
|
+
o["infra_provenance"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
827
|
+
const mk = dec.readEntryKey();
|
|
828
|
+
if (m.has(mk))
|
|
829
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
830
|
+
m.set(mk, decodeCBORFieldProvenanceFrom(dec));
|
|
831
|
+
} return m; })();
|
|
832
|
+
break;
|
|
833
|
+
case "sensitive":
|
|
834
|
+
o["sensitive"] = dec.readBool();
|
|
835
|
+
break;
|
|
836
|
+
case "sensitive_inject":
|
|
837
|
+
o["sensitive_inject"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
838
|
+
break;
|
|
839
|
+
case "sensitive_payload_leaves":
|
|
840
|
+
o["sensitive_payload_leaves"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
841
|
+
a.push(dec.readText());
|
|
842
|
+
} return a; })();
|
|
843
|
+
break;
|
|
844
|
+
case "connection":
|
|
845
|
+
o["connection"] = decodeCBORAttachmentConnectionFrom(dec);
|
|
846
|
+
break;
|
|
847
|
+
case "realization":
|
|
848
|
+
o["realization"] = dec.readText();
|
|
849
|
+
break;
|
|
850
|
+
default: dec.skip();
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
return o;
|
|
854
|
+
}
|
|
855
|
+
function encodeCBORIRBoundaryFeature(v) {
|
|
856
|
+
const out = [];
|
|
857
|
+
appendCBORIRBoundaryFeature(out, v);
|
|
858
|
+
return new Uint8Array(out);
|
|
859
|
+
}
|
|
860
|
+
function appendCBORIRBoundaryFeature(out, v) {
|
|
861
|
+
let n = 1;
|
|
862
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
863
|
+
n++;
|
|
864
|
+
if (v.realization !== undefined && v.realization !== "")
|
|
865
|
+
n++;
|
|
866
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
867
|
+
n++;
|
|
868
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
869
|
+
(0, cbor_gen_ts_1.writeText)(out, "type");
|
|
870
|
+
(0, cbor_gen_ts_1.writeText)(out, v.type);
|
|
871
|
+
if (v.infra !== undefined && v.infra !== null) {
|
|
872
|
+
(0, cbor_gen_ts_1.writeText)(out, "infra");
|
|
873
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.infra)));
|
|
874
|
+
}
|
|
875
|
+
if (v.realization !== undefined && v.realization !== "") {
|
|
876
|
+
(0, cbor_gen_ts_1.writeText)(out, "realization");
|
|
877
|
+
(0, cbor_gen_ts_1.writeText)(out, v.realization);
|
|
878
|
+
}
|
|
879
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0) {
|
|
880
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive_payload_leaves");
|
|
881
|
+
{
|
|
882
|
+
const a0 = v.sensitive_payload_leaves;
|
|
883
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
884
|
+
for (const ee0 of a0) {
|
|
885
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
function decodeCBORIRBoundaryFeature(data) {
|
|
891
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
892
|
+
return decodeCBORIRBoundaryFeatureFrom(dec);
|
|
893
|
+
}
|
|
894
|
+
function decodeCBORIRBoundaryFeatureFrom(dec) {
|
|
895
|
+
const o = {};
|
|
896
|
+
const n = dec.readMapHeader();
|
|
897
|
+
for (let i = 0; i < n; i++) {
|
|
898
|
+
const k = dec.readText();
|
|
899
|
+
switch (k) {
|
|
900
|
+
case "type":
|
|
901
|
+
o["type"] = dec.readText();
|
|
902
|
+
break;
|
|
903
|
+
case "infra":
|
|
904
|
+
o["infra"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
905
|
+
break;
|
|
906
|
+
case "sensitive_payload_leaves":
|
|
907
|
+
o["sensitive_payload_leaves"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
908
|
+
a.push(dec.readText());
|
|
909
|
+
} return a; })();
|
|
910
|
+
break;
|
|
911
|
+
case "realization":
|
|
912
|
+
o["realization"] = dec.readText();
|
|
913
|
+
break;
|
|
914
|
+
default: dec.skip();
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
return o;
|
|
918
|
+
}
|
|
919
|
+
function encodeCBORCatalogMetadata(v) {
|
|
920
|
+
const out = [];
|
|
921
|
+
appendCBORCatalogMetadata(out, v);
|
|
922
|
+
return new Uint8Array(out);
|
|
923
|
+
}
|
|
924
|
+
function appendCBORCatalogMetadata(out, v) {
|
|
925
|
+
let n = 0;
|
|
926
|
+
if (v.home !== undefined && v.home !== "")
|
|
927
|
+
n++;
|
|
928
|
+
if (v.license !== undefined && v.license !== "")
|
|
929
|
+
n++;
|
|
930
|
+
if (v.keywords !== undefined && v.keywords.length > 0)
|
|
931
|
+
n++;
|
|
932
|
+
if (v.repository !== undefined && v.repository !== "")
|
|
933
|
+
n++;
|
|
934
|
+
if (v.maintainers !== undefined && v.maintainers.length > 0)
|
|
935
|
+
n++;
|
|
936
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
937
|
+
if (v.home !== undefined && v.home !== "") {
|
|
938
|
+
(0, cbor_gen_ts_1.writeText)(out, "home");
|
|
939
|
+
(0, cbor_gen_ts_1.writeText)(out, v.home);
|
|
940
|
+
}
|
|
941
|
+
if (v.license !== undefined && v.license !== "") {
|
|
942
|
+
(0, cbor_gen_ts_1.writeText)(out, "license");
|
|
943
|
+
(0, cbor_gen_ts_1.writeText)(out, v.license);
|
|
944
|
+
}
|
|
945
|
+
if (v.keywords !== undefined && v.keywords.length > 0) {
|
|
946
|
+
(0, cbor_gen_ts_1.writeText)(out, "keywords");
|
|
947
|
+
{
|
|
948
|
+
const a0 = v.keywords;
|
|
949
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
950
|
+
for (const ee0 of a0) {
|
|
951
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
if (v.repository !== undefined && v.repository !== "") {
|
|
956
|
+
(0, cbor_gen_ts_1.writeText)(out, "repository");
|
|
957
|
+
(0, cbor_gen_ts_1.writeText)(out, v.repository);
|
|
958
|
+
}
|
|
959
|
+
if (v.maintainers !== undefined && v.maintainers.length > 0) {
|
|
960
|
+
(0, cbor_gen_ts_1.writeText)(out, "maintainers");
|
|
961
|
+
{
|
|
962
|
+
const a0 = v.maintainers;
|
|
963
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
964
|
+
for (const ee0 of a0) {
|
|
965
|
+
appendCBORMaintainer(out, ee0);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
function decodeCBORCatalogMetadata(data) {
|
|
971
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
972
|
+
return decodeCBORCatalogMetadataFrom(dec);
|
|
973
|
+
}
|
|
974
|
+
function decodeCBORCatalogMetadataFrom(dec) {
|
|
975
|
+
const o = {};
|
|
976
|
+
const n = dec.readMapHeader();
|
|
977
|
+
for (let i = 0; i < n; i++) {
|
|
978
|
+
const k = dec.readText();
|
|
979
|
+
switch (k) {
|
|
980
|
+
case "maintainers":
|
|
981
|
+
o["maintainers"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
982
|
+
a.push(decodeCBORMaintainerFrom(dec));
|
|
983
|
+
} return a; })();
|
|
984
|
+
break;
|
|
985
|
+
case "license":
|
|
986
|
+
o["license"] = dec.readText();
|
|
987
|
+
break;
|
|
988
|
+
case "repository":
|
|
989
|
+
o["repository"] = dec.readText();
|
|
990
|
+
break;
|
|
991
|
+
case "home":
|
|
992
|
+
o["home"] = dec.readText();
|
|
993
|
+
break;
|
|
994
|
+
case "keywords":
|
|
995
|
+
o["keywords"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
996
|
+
a.push(dec.readText());
|
|
997
|
+
} return a; })();
|
|
998
|
+
break;
|
|
999
|
+
default: dec.skip();
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
return o;
|
|
1003
|
+
}
|
|
1004
|
+
function encodeCBORIRNode(v) {
|
|
1005
|
+
const out = [];
|
|
1006
|
+
appendCBORIRNode(out, v);
|
|
1007
|
+
return new Uint8Array(out);
|
|
1008
|
+
}
|
|
1009
|
+
function appendCBORIRNode(out, v) {
|
|
1010
|
+
let n = 3;
|
|
1011
|
+
if (v.uses !== undefined && v.uses !== null)
|
|
1012
|
+
n++;
|
|
1013
|
+
if (v.sync_wave !== undefined && v.sync_wave !== 0)
|
|
1014
|
+
n++;
|
|
1015
|
+
if (v.description !== undefined && v.description !== "")
|
|
1016
|
+
n++;
|
|
1017
|
+
if (v.self_inject !== undefined && v.self_inject !== null)
|
|
1018
|
+
n++;
|
|
1019
|
+
if (v.source_file !== undefined && v.source_file !== "")
|
|
1020
|
+
n++;
|
|
1021
|
+
if (v.boundary_path !== undefined && v.boundary_path !== "")
|
|
1022
|
+
n++;
|
|
1023
|
+
if (v.subsystem_path !== undefined && v.subsystem_path !== "")
|
|
1024
|
+
n++;
|
|
1025
|
+
if (v.catalog_metadata !== undefined && v.catalog_metadata !== null)
|
|
1026
|
+
n++;
|
|
1027
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0)
|
|
1028
|
+
n++;
|
|
1029
|
+
if (v.release_annotations !== undefined && v.release_annotations.size > 0)
|
|
1030
|
+
n++;
|
|
1031
|
+
if (v.synthesized_boundary !== undefined && v.synthesized_boundary !== false)
|
|
1032
|
+
n++;
|
|
1033
|
+
if (v.aggregate_annotations !== undefined && v.aggregate_annotations.size > 0)
|
|
1034
|
+
n++;
|
|
1035
|
+
if (v.synthesized_subsystem !== undefined && v.synthesized_subsystem !== false)
|
|
1036
|
+
n++;
|
|
1037
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
1038
|
+
n++;
|
|
1039
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1040
|
+
if (v.uses !== undefined && v.uses !== null) {
|
|
1041
|
+
(0, cbor_gen_ts_1.writeText)(out, "uses");
|
|
1042
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.uses)));
|
|
1043
|
+
}
|
|
1044
|
+
(0, cbor_gen_ts_1.writeText)(out, "labels");
|
|
1045
|
+
{
|
|
1046
|
+
const m0 = v.labels;
|
|
1047
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1048
|
+
for (const [kk0, vv0] of m0) {
|
|
1049
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1050
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1051
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
(0, cbor_gen_ts_1.writeText)(out, "component");
|
|
1055
|
+
(0, cbor_gen_ts_1.writeText)(out, v.component);
|
|
1056
|
+
if (v.sync_wave !== undefined && v.sync_wave !== 0) {
|
|
1057
|
+
(0, cbor_gen_ts_1.writeText)(out, "sync_wave");
|
|
1058
|
+
(0, cbor_gen_ts_1.writeInt)(out, v.sync_wave);
|
|
1059
|
+
}
|
|
1060
|
+
if (v.description !== undefined && v.description !== "") {
|
|
1061
|
+
(0, cbor_gen_ts_1.writeText)(out, "description");
|
|
1062
|
+
(0, cbor_gen_ts_1.writeText)(out, v.description);
|
|
1063
|
+
}
|
|
1064
|
+
if (v.self_inject !== undefined && v.self_inject !== null) {
|
|
1065
|
+
(0, cbor_gen_ts_1.writeText)(out, "self_inject");
|
|
1066
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.self_inject)));
|
|
1067
|
+
}
|
|
1068
|
+
if (v.source_file !== undefined && v.source_file !== "") {
|
|
1069
|
+
(0, cbor_gen_ts_1.writeText)(out, "source_file");
|
|
1070
|
+
(0, cbor_gen_ts_1.writeText)(out, v.source_file);
|
|
1071
|
+
}
|
|
1072
|
+
if (v.boundary_path !== undefined && v.boundary_path !== "") {
|
|
1073
|
+
(0, cbor_gen_ts_1.writeText)(out, "boundary_path");
|
|
1074
|
+
(0, cbor_gen_ts_1.writeText)(out, v.boundary_path);
|
|
1075
|
+
}
|
|
1076
|
+
if (v.subsystem_path !== undefined && v.subsystem_path !== "") {
|
|
1077
|
+
(0, cbor_gen_ts_1.writeText)(out, "subsystem_path");
|
|
1078
|
+
(0, cbor_gen_ts_1.writeText)(out, v.subsystem_path);
|
|
1079
|
+
}
|
|
1080
|
+
if (v.catalog_metadata !== undefined && v.catalog_metadata !== null) {
|
|
1081
|
+
(0, cbor_gen_ts_1.writeText)(out, "catalog_metadata");
|
|
1082
|
+
appendCBORCatalogMetadata(out, v.catalog_metadata);
|
|
1083
|
+
}
|
|
1084
|
+
(0, cbor_gen_ts_1.writeText)(out, "resolved_version");
|
|
1085
|
+
(0, cbor_gen_ts_1.writeText)(out, v.resolved_version);
|
|
1086
|
+
if (v.catalog_annotations !== undefined && v.catalog_annotations.size > 0) {
|
|
1087
|
+
(0, cbor_gen_ts_1.writeText)(out, "catalog_annotations");
|
|
1088
|
+
{
|
|
1089
|
+
const m0 = v.catalog_annotations;
|
|
1090
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1091
|
+
for (const [kk0, vv0] of m0) {
|
|
1092
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1093
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1094
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
if (v.release_annotations !== undefined && v.release_annotations.size > 0) {
|
|
1099
|
+
(0, cbor_gen_ts_1.writeText)(out, "release_annotations");
|
|
1100
|
+
{
|
|
1101
|
+
const m0 = v.release_annotations;
|
|
1102
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1103
|
+
for (const [kk0, vv0] of m0) {
|
|
1104
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1105
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1106
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
if (v.synthesized_boundary !== undefined && v.synthesized_boundary !== false) {
|
|
1111
|
+
(0, cbor_gen_ts_1.writeText)(out, "synthesized_boundary");
|
|
1112
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.synthesized_boundary);
|
|
1113
|
+
}
|
|
1114
|
+
if (v.aggregate_annotations !== undefined && v.aggregate_annotations.size > 0) {
|
|
1115
|
+
(0, cbor_gen_ts_1.writeText)(out, "aggregate_annotations");
|
|
1116
|
+
{
|
|
1117
|
+
const m0 = v.aggregate_annotations;
|
|
1118
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1119
|
+
for (const [kk0, vv0] of m0) {
|
|
1120
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1121
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1122
|
+
(0, cbor_gen_ts_1.writeText)(out, vv0);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
if (v.synthesized_subsystem !== undefined && v.synthesized_subsystem !== false) {
|
|
1127
|
+
(0, cbor_gen_ts_1.writeText)(out, "synthesized_subsystem");
|
|
1128
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.synthesized_subsystem);
|
|
1129
|
+
}
|
|
1130
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0) {
|
|
1131
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive_payload_leaves");
|
|
1132
|
+
{
|
|
1133
|
+
const a0 = v.sensitive_payload_leaves;
|
|
1134
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
1135
|
+
for (const ee0 of a0) {
|
|
1136
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
function decodeCBORIRNode(data) {
|
|
1142
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1143
|
+
return decodeCBORIRNodeFrom(dec);
|
|
1144
|
+
}
|
|
1145
|
+
function decodeCBORIRNodeFrom(dec) {
|
|
1146
|
+
const o = {};
|
|
1147
|
+
const n = dec.readMapHeader();
|
|
1148
|
+
for (let i = 0; i < n; i++) {
|
|
1149
|
+
const k = dec.readText();
|
|
1150
|
+
switch (k) {
|
|
1151
|
+
case "description":
|
|
1152
|
+
o["description"] = dec.readText();
|
|
1153
|
+
break;
|
|
1154
|
+
case "labels":
|
|
1155
|
+
o["labels"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1156
|
+
const mk = dec.readEntryKey();
|
|
1157
|
+
if (m.has(mk))
|
|
1158
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1159
|
+
m.set(mk, dec.readText());
|
|
1160
|
+
} return m; })();
|
|
1161
|
+
break;
|
|
1162
|
+
case "component":
|
|
1163
|
+
o["component"] = dec.readText();
|
|
1164
|
+
break;
|
|
1165
|
+
case "resolved_version":
|
|
1166
|
+
o["resolved_version"] = dec.readText();
|
|
1167
|
+
break;
|
|
1168
|
+
case "sync_wave":
|
|
1169
|
+
o["sync_wave"] = dec.readInt();
|
|
1170
|
+
break;
|
|
1171
|
+
case "boundary_path":
|
|
1172
|
+
o["boundary_path"] = dec.readText();
|
|
1173
|
+
break;
|
|
1174
|
+
case "subsystem_path":
|
|
1175
|
+
o["subsystem_path"] = dec.readText();
|
|
1176
|
+
break;
|
|
1177
|
+
case "synthesized_subsystem":
|
|
1178
|
+
o["synthesized_subsystem"] = dec.readBool();
|
|
1179
|
+
break;
|
|
1180
|
+
case "synthesized_boundary":
|
|
1181
|
+
o["synthesized_boundary"] = dec.readBool();
|
|
1182
|
+
break;
|
|
1183
|
+
case "catalog_metadata":
|
|
1184
|
+
o["catalog_metadata"] = decodeCBORCatalogMetadataFrom(dec);
|
|
1185
|
+
break;
|
|
1186
|
+
case "catalog_annotations":
|
|
1187
|
+
o["catalog_annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1188
|
+
const mk = dec.readEntryKey();
|
|
1189
|
+
if (m.has(mk))
|
|
1190
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1191
|
+
m.set(mk, dec.readText());
|
|
1192
|
+
} return m; })();
|
|
1193
|
+
break;
|
|
1194
|
+
case "release_annotations":
|
|
1195
|
+
o["release_annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1196
|
+
const mk = dec.readEntryKey();
|
|
1197
|
+
if (m.has(mk))
|
|
1198
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1199
|
+
m.set(mk, dec.readText());
|
|
1200
|
+
} return m; })();
|
|
1201
|
+
break;
|
|
1202
|
+
case "aggregate_annotations":
|
|
1203
|
+
o["aggregate_annotations"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1204
|
+
const mk = dec.readEntryKey();
|
|
1205
|
+
if (m.has(mk))
|
|
1206
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1207
|
+
m.set(mk, dec.readText());
|
|
1208
|
+
} return m; })();
|
|
1209
|
+
break;
|
|
1210
|
+
case "self_inject":
|
|
1211
|
+
o["self_inject"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
1212
|
+
break;
|
|
1213
|
+
case "source_file":
|
|
1214
|
+
o["source_file"] = dec.readText();
|
|
1215
|
+
break;
|
|
1216
|
+
case "uses":
|
|
1217
|
+
o["uses"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
1218
|
+
break;
|
|
1219
|
+
case "sensitive_payload_leaves":
|
|
1220
|
+
o["sensitive_payload_leaves"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
1221
|
+
a.push(dec.readText());
|
|
1222
|
+
} return a; })();
|
|
1223
|
+
break;
|
|
1224
|
+
default: dec.skip();
|
|
1225
|
+
}
|
|
1226
|
+
}
|
|
1227
|
+
return o;
|
|
1228
|
+
}
|
|
1229
|
+
function encodeCBORIREdge(v) {
|
|
1230
|
+
const out = [];
|
|
1231
|
+
appendCBORIREdge(out, v);
|
|
1232
|
+
return new Uint8Array(out);
|
|
1233
|
+
}
|
|
1234
|
+
function appendCBORIREdge(out, v) {
|
|
1235
|
+
let n = 3;
|
|
1236
|
+
if (v.alias !== undefined && v.alias !== "")
|
|
1237
|
+
n++;
|
|
1238
|
+
if (v.infra !== undefined && v.infra !== null)
|
|
1239
|
+
n++;
|
|
1240
|
+
if (v.inject !== undefined && v.inject !== null)
|
|
1241
|
+
n++;
|
|
1242
|
+
if (v.socket !== undefined && v.socket !== "")
|
|
1243
|
+
n++;
|
|
1244
|
+
if (v.values !== undefined && v.values !== null)
|
|
1245
|
+
n++;
|
|
1246
|
+
if (v.origin_feature !== undefined && v.origin_feature !== "")
|
|
1247
|
+
n++;
|
|
1248
|
+
if (v.origin_release !== undefined && v.origin_release !== false)
|
|
1249
|
+
n++;
|
|
1250
|
+
if (v.origin_feature_instance !== undefined && v.origin_feature_instance !== "")
|
|
1251
|
+
n++;
|
|
1252
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0)
|
|
1253
|
+
n++;
|
|
1254
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1255
|
+
if (v.alias !== undefined && v.alias !== "") {
|
|
1256
|
+
(0, cbor_gen_ts_1.writeText)(out, "alias");
|
|
1257
|
+
(0, cbor_gen_ts_1.writeText)(out, v.alias);
|
|
1258
|
+
}
|
|
1259
|
+
if (v.infra !== undefined && v.infra !== null) {
|
|
1260
|
+
(0, cbor_gen_ts_1.writeText)(out, "infra");
|
|
1261
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.infra)));
|
|
1262
|
+
}
|
|
1263
|
+
if (v.inject !== undefined && v.inject !== null) {
|
|
1264
|
+
(0, cbor_gen_ts_1.writeText)(out, "inject");
|
|
1265
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.inject)));
|
|
1266
|
+
}
|
|
1267
|
+
if (v.socket !== undefined && v.socket !== "") {
|
|
1268
|
+
(0, cbor_gen_ts_1.writeText)(out, "socket");
|
|
1269
|
+
(0, cbor_gen_ts_1.writeText)(out, v.socket);
|
|
1270
|
+
}
|
|
1271
|
+
(0, cbor_gen_ts_1.writeText)(out, "source");
|
|
1272
|
+
(0, cbor_gen_ts_1.writeText)(out, v.source);
|
|
1273
|
+
(0, cbor_gen_ts_1.writeText)(out, "target");
|
|
1274
|
+
(0, cbor_gen_ts_1.writeText)(out, v.target);
|
|
1275
|
+
if (v.values !== undefined && v.values !== null) {
|
|
1276
|
+
(0, cbor_gen_ts_1.writeText)(out, "values");
|
|
1277
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(v.values)));
|
|
1278
|
+
}
|
|
1279
|
+
if (v.origin_feature !== undefined && v.origin_feature !== "") {
|
|
1280
|
+
(0, cbor_gen_ts_1.writeText)(out, "origin_feature");
|
|
1281
|
+
(0, cbor_gen_ts_1.writeText)(out, v.origin_feature);
|
|
1282
|
+
}
|
|
1283
|
+
if (v.origin_release !== undefined && v.origin_release !== false) {
|
|
1284
|
+
(0, cbor_gen_ts_1.writeText)(out, "origin_release");
|
|
1285
|
+
(0, cbor_gen_ts_1.writeBool)(out, v.origin_release);
|
|
1286
|
+
}
|
|
1287
|
+
(0, cbor_gen_ts_1.writeText)(out, "socket_declaration");
|
|
1288
|
+
(0, cbor_gen_ts_1.writeText)(out, v.socket_declaration);
|
|
1289
|
+
if (v.origin_feature_instance !== undefined && v.origin_feature_instance !== "") {
|
|
1290
|
+
(0, cbor_gen_ts_1.writeText)(out, "origin_feature_instance");
|
|
1291
|
+
(0, cbor_gen_ts_1.writeText)(out, v.origin_feature_instance);
|
|
1292
|
+
}
|
|
1293
|
+
if (v.sensitive_payload_leaves !== undefined && v.sensitive_payload_leaves.length > 0) {
|
|
1294
|
+
(0, cbor_gen_ts_1.writeText)(out, "sensitive_payload_leaves");
|
|
1295
|
+
{
|
|
1296
|
+
const a0 = v.sensitive_payload_leaves;
|
|
1297
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
1298
|
+
for (const ee0 of a0) {
|
|
1299
|
+
(0, cbor_gen_ts_1.writeText)(out, ee0);
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
function decodeCBORIREdge(data) {
|
|
1305
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1306
|
+
return decodeCBORIREdgeFrom(dec);
|
|
1307
|
+
}
|
|
1308
|
+
function decodeCBORIREdgeFrom(dec) {
|
|
1309
|
+
const o = {};
|
|
1310
|
+
const n = dec.readMapHeader();
|
|
1311
|
+
for (let i = 0; i < n; i++) {
|
|
1312
|
+
const k = dec.readText();
|
|
1313
|
+
switch (k) {
|
|
1314
|
+
case "source":
|
|
1315
|
+
o["source"] = dec.readText();
|
|
1316
|
+
break;
|
|
1317
|
+
case "target":
|
|
1318
|
+
o["target"] = dec.readText();
|
|
1319
|
+
break;
|
|
1320
|
+
case "socket":
|
|
1321
|
+
o["socket"] = dec.readText();
|
|
1322
|
+
break;
|
|
1323
|
+
case "alias":
|
|
1324
|
+
o["alias"] = dec.readText();
|
|
1325
|
+
break;
|
|
1326
|
+
case "socket_declaration":
|
|
1327
|
+
o["socket_declaration"] = dec.readText();
|
|
1328
|
+
break;
|
|
1329
|
+
case "origin_feature":
|
|
1330
|
+
o["origin_feature"] = dec.readText();
|
|
1331
|
+
break;
|
|
1332
|
+
case "origin_feature_instance":
|
|
1333
|
+
o["origin_feature_instance"] = dec.readText();
|
|
1334
|
+
break;
|
|
1335
|
+
case "origin_release":
|
|
1336
|
+
o["origin_release"] = dec.readBool();
|
|
1337
|
+
break;
|
|
1338
|
+
case "values":
|
|
1339
|
+
o["values"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
1340
|
+
break;
|
|
1341
|
+
case "infra":
|
|
1342
|
+
o["infra"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
1343
|
+
break;
|
|
1344
|
+
case "inject":
|
|
1345
|
+
o["inject"] = JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes()));
|
|
1346
|
+
break;
|
|
1347
|
+
case "sensitive_payload_leaves":
|
|
1348
|
+
o["sensitive_payload_leaves"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
1349
|
+
a.push(dec.readText());
|
|
1350
|
+
} return a; })();
|
|
1351
|
+
break;
|
|
1352
|
+
default: dec.skip();
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
return o;
|
|
1356
|
+
}
|
|
1357
|
+
function encodeCBORIRMetadata(v) {
|
|
1358
|
+
const out = [];
|
|
1359
|
+
appendCBORIRMetadata(out, v);
|
|
1360
|
+
return new Uint8Array(out);
|
|
1361
|
+
}
|
|
1362
|
+
function appendCBORIRMetadata(out, v) {
|
|
1363
|
+
let n = 1;
|
|
1364
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1365
|
+
(0, cbor_gen_ts_1.writeText)(out, "aggregate_name");
|
|
1366
|
+
(0, cbor_gen_ts_1.writeText)(out, v.aggregate_name);
|
|
1367
|
+
}
|
|
1368
|
+
function decodeCBORIRMetadata(data) {
|
|
1369
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1370
|
+
return decodeCBORIRMetadataFrom(dec);
|
|
1371
|
+
}
|
|
1372
|
+
function decodeCBORIRMetadataFrom(dec) {
|
|
1373
|
+
const o = {};
|
|
1374
|
+
const n = dec.readMapHeader();
|
|
1375
|
+
for (let i = 0; i < n; i++) {
|
|
1376
|
+
const k = dec.readText();
|
|
1377
|
+
switch (k) {
|
|
1378
|
+
case "aggregate_name":
|
|
1379
|
+
o["aggregate_name"] = dec.readText();
|
|
1380
|
+
break;
|
|
1381
|
+
default: dec.skip();
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return o;
|
|
1385
|
+
}
|
|
1386
|
+
function encodeCBORIRProvenance(v) {
|
|
1387
|
+
const out = [];
|
|
1388
|
+
appendCBORIRProvenance(out, v);
|
|
1389
|
+
return new Uint8Array(out);
|
|
1390
|
+
}
|
|
1391
|
+
function appendCBORIRProvenance(out, v) {
|
|
1392
|
+
let n = 5;
|
|
1393
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1394
|
+
(0, cbor_gen_ts_1.writeText)(out, "schema_version");
|
|
1395
|
+
(0, cbor_gen_ts_1.writeText)(out, v.schema_version);
|
|
1396
|
+
(0, cbor_gen_ts_1.writeText)(out, "release_version");
|
|
1397
|
+
(0, cbor_gen_ts_1.writeText)(out, v.release_version);
|
|
1398
|
+
(0, cbor_gen_ts_1.writeText)(out, "compiler_version");
|
|
1399
|
+
(0, cbor_gen_ts_1.writeText)(out, v.compiler_version);
|
|
1400
|
+
(0, cbor_gen_ts_1.writeText)(out, "manifest_version");
|
|
1401
|
+
(0, cbor_gen_ts_1.writeText)(out, v.manifest_version);
|
|
1402
|
+
(0, cbor_gen_ts_1.writeText)(out, "aggregate_version");
|
|
1403
|
+
(0, cbor_gen_ts_1.writeText)(out, v.aggregate_version);
|
|
1404
|
+
}
|
|
1405
|
+
function decodeCBORIRProvenance(data) {
|
|
1406
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1407
|
+
return decodeCBORIRProvenanceFrom(dec);
|
|
1408
|
+
}
|
|
1409
|
+
function decodeCBORIRProvenanceFrom(dec) {
|
|
1410
|
+
const o = {};
|
|
1411
|
+
const n = dec.readMapHeader();
|
|
1412
|
+
for (let i = 0; i < n; i++) {
|
|
1413
|
+
const k = dec.readText();
|
|
1414
|
+
switch (k) {
|
|
1415
|
+
case "schema_version":
|
|
1416
|
+
o["schema_version"] = dec.readText();
|
|
1417
|
+
break;
|
|
1418
|
+
case "compiler_version":
|
|
1419
|
+
o["compiler_version"] = dec.readText();
|
|
1420
|
+
break;
|
|
1421
|
+
case "aggregate_version":
|
|
1422
|
+
o["aggregate_version"] = dec.readText();
|
|
1423
|
+
break;
|
|
1424
|
+
case "manifest_version":
|
|
1425
|
+
o["manifest_version"] = dec.readText();
|
|
1426
|
+
break;
|
|
1427
|
+
case "release_version":
|
|
1428
|
+
o["release_version"] = dec.readText();
|
|
1429
|
+
break;
|
|
1430
|
+
default: dec.skip();
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
return o;
|
|
1434
|
+
}
|
|
1435
|
+
function encodeCBORIRSpec(v) {
|
|
1436
|
+
const out = [];
|
|
1437
|
+
appendCBORIRSpec(out, v);
|
|
1438
|
+
return new Uint8Array(out);
|
|
1439
|
+
}
|
|
1440
|
+
function appendCBORIRSpec(out, v) {
|
|
1441
|
+
let n = 6;
|
|
1442
|
+
if (v.boundary_features !== undefined && v.boundary_features.size > 0)
|
|
1443
|
+
n++;
|
|
1444
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1445
|
+
(0, cbor_gen_ts_1.writeText)(out, "edges");
|
|
1446
|
+
{
|
|
1447
|
+
const a0 = v.edges;
|
|
1448
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, a0.length);
|
|
1449
|
+
for (const ee0 of a0) {
|
|
1450
|
+
appendCBORIREdge(out, ee0);
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
(0, cbor_gen_ts_1.writeText)(out, "nodes");
|
|
1454
|
+
{
|
|
1455
|
+
const m0 = v.nodes;
|
|
1456
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1457
|
+
for (const [kk0, vv0] of m0) {
|
|
1458
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1459
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1460
|
+
appendCBORIRNode(out, vv0);
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
(0, cbor_gen_ts_1.writeText)(out, "provenance");
|
|
1464
|
+
appendCBORIRProvenance(out, v.provenance);
|
|
1465
|
+
(0, cbor_gen_ts_1.writeText)(out, "infra_mapping");
|
|
1466
|
+
{
|
|
1467
|
+
const m0 = v.infra_mapping;
|
|
1468
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1469
|
+
for (const [kk0, vv0] of m0) {
|
|
1470
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1471
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1472
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
(0, cbor_gen_ts_1.writeText)(out, "values_mapping");
|
|
1476
|
+
{
|
|
1477
|
+
const m0 = v.values_mapping;
|
|
1478
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1479
|
+
for (const [kk0, vv0] of m0) {
|
|
1480
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1481
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1482
|
+
(0, cbor_gen_ts_1.writeBytes)(out, (0, cbor_gen_ts_1.utf8Encode)(JSON.stringify(vv0)));
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
if (v.boundary_features !== undefined && v.boundary_features.size > 0) {
|
|
1486
|
+
(0, cbor_gen_ts_1.writeText)(out, "boundary_features");
|
|
1487
|
+
{
|
|
1488
|
+
const m0 = v.boundary_features;
|
|
1489
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1490
|
+
for (const [kk0, vv0] of m0) {
|
|
1491
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1492
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1493
|
+
{
|
|
1494
|
+
const m1 = vv0;
|
|
1495
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m1.size);
|
|
1496
|
+
for (const [kk1, vv1] of m1) {
|
|
1497
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1498
|
+
(0, cbor_gen_ts_1.writeText)(out, kk1);
|
|
1499
|
+
appendCBORIRBoundaryFeature(out, vv1);
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
(0, cbor_gen_ts_1.writeText)(out, "feature_values_mapping");
|
|
1506
|
+
{
|
|
1507
|
+
const m0 = v.feature_values_mapping;
|
|
1508
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m0.size);
|
|
1509
|
+
for (const [kk0, vv0] of m0) {
|
|
1510
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1511
|
+
(0, cbor_gen_ts_1.writeText)(out, kk0);
|
|
1512
|
+
{
|
|
1513
|
+
const m1 = vv0;
|
|
1514
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, m1.size);
|
|
1515
|
+
for (const [kk1, vv1] of m1) {
|
|
1516
|
+
(0, cbor_gen_ts_1.writeHead)(out, 4, 2);
|
|
1517
|
+
(0, cbor_gen_ts_1.writeText)(out, kk1);
|
|
1518
|
+
appendCBORIRFeatureEntry(out, vv1);
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
}
|
|
1524
|
+
function decodeCBORIRSpec(data) {
|
|
1525
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1526
|
+
return decodeCBORIRSpecFrom(dec);
|
|
1527
|
+
}
|
|
1528
|
+
function decodeCBORIRSpecFrom(dec) {
|
|
1529
|
+
const o = {};
|
|
1530
|
+
const n = dec.readMapHeader();
|
|
1531
|
+
for (let i = 0; i < n; i++) {
|
|
1532
|
+
const k = dec.readText();
|
|
1533
|
+
switch (k) {
|
|
1534
|
+
case "nodes":
|
|
1535
|
+
o["nodes"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1536
|
+
const mk = dec.readEntryKey();
|
|
1537
|
+
if (m.has(mk))
|
|
1538
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1539
|
+
m.set(mk, decodeCBORIRNodeFrom(dec));
|
|
1540
|
+
} return m; })();
|
|
1541
|
+
break;
|
|
1542
|
+
case "edges":
|
|
1543
|
+
o["edges"] = (() => { const a = []; const sn = dec.readArrayHeader(); for (let j = 0; j < sn; j++) {
|
|
1544
|
+
a.push(decodeCBORIREdgeFrom(dec));
|
|
1545
|
+
} return a; })();
|
|
1546
|
+
break;
|
|
1547
|
+
case "values_mapping":
|
|
1548
|
+
o["values_mapping"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1549
|
+
const mk = dec.readEntryKey();
|
|
1550
|
+
if (m.has(mk))
|
|
1551
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1552
|
+
m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
|
|
1553
|
+
} return m; })();
|
|
1554
|
+
break;
|
|
1555
|
+
case "infra_mapping":
|
|
1556
|
+
o["infra_mapping"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1557
|
+
const mk = dec.readEntryKey();
|
|
1558
|
+
if (m.has(mk))
|
|
1559
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1560
|
+
m.set(mk, JSON.parse((0, cbor_gen_ts_1.utf8Decode)(dec.readBytes())));
|
|
1561
|
+
} return m; })();
|
|
1562
|
+
break;
|
|
1563
|
+
case "feature_values_mapping":
|
|
1564
|
+
o["feature_values_mapping"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1565
|
+
const mk = dec.readEntryKey();
|
|
1566
|
+
if (m.has(mk))
|
|
1567
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1568
|
+
m.set(mk, (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1569
|
+
const mk = dec.readEntryKey();
|
|
1570
|
+
if (m.has(mk))
|
|
1571
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1572
|
+
m.set(mk, decodeCBORIRFeatureEntryFrom(dec));
|
|
1573
|
+
} return m; })());
|
|
1574
|
+
} return m; })();
|
|
1575
|
+
break;
|
|
1576
|
+
case "boundary_features":
|
|
1577
|
+
o["boundary_features"] = (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1578
|
+
const mk = dec.readEntryKey();
|
|
1579
|
+
if (m.has(mk))
|
|
1580
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1581
|
+
m.set(mk, (() => { const m = new Map(); const mn = dec.readArrayHeader(); for (let j = 0; j < mn; j++) {
|
|
1582
|
+
const mk = dec.readEntryKey();
|
|
1583
|
+
if (m.has(mk))
|
|
1584
|
+
throw (0, cbor_gen_ts_1.duplicateKeyError)(mk);
|
|
1585
|
+
m.set(mk, decodeCBORIRBoundaryFeatureFrom(dec));
|
|
1586
|
+
} return m; })());
|
|
1587
|
+
} return m; })();
|
|
1588
|
+
break;
|
|
1589
|
+
case "provenance":
|
|
1590
|
+
o["provenance"] = decodeCBORIRProvenanceFrom(dec);
|
|
1591
|
+
break;
|
|
1592
|
+
default: dec.skip();
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
return o;
|
|
1596
|
+
}
|
|
1597
|
+
function encodeCBORIRGraph(v) {
|
|
1598
|
+
const out = [];
|
|
1599
|
+
appendCBORIRGraph(out, v);
|
|
1600
|
+
return new Uint8Array(out);
|
|
1601
|
+
}
|
|
1602
|
+
function appendCBORIRGraph(out, v) {
|
|
1603
|
+
let n = 4;
|
|
1604
|
+
(0, cbor_gen_ts_1.writeHead)(out, 5, n);
|
|
1605
|
+
(0, cbor_gen_ts_1.writeText)(out, "kind");
|
|
1606
|
+
(0, cbor_gen_ts_1.writeText)(out, v.kind);
|
|
1607
|
+
(0, cbor_gen_ts_1.writeText)(out, "spec");
|
|
1608
|
+
appendCBORIRSpec(out, v.spec);
|
|
1609
|
+
(0, cbor_gen_ts_1.writeText)(out, "metadata");
|
|
1610
|
+
appendCBORIRMetadata(out, v.metadata);
|
|
1611
|
+
(0, cbor_gen_ts_1.writeText)(out, "apiVersion");
|
|
1612
|
+
(0, cbor_gen_ts_1.writeText)(out, v.apiVersion);
|
|
1613
|
+
}
|
|
1614
|
+
function decodeCBORIRGraph(data) {
|
|
1615
|
+
const dec = new cbor_gen_ts_1.CborDec(data);
|
|
1616
|
+
return decodeCBORIRGraphFrom(dec);
|
|
1617
|
+
}
|
|
1618
|
+
function decodeCBORIRGraphFrom(dec) {
|
|
1619
|
+
const o = {};
|
|
1620
|
+
const n = dec.readMapHeader();
|
|
1621
|
+
for (let i = 0; i < n; i++) {
|
|
1622
|
+
const k = dec.readText();
|
|
1623
|
+
switch (k) {
|
|
1624
|
+
case "apiVersion":
|
|
1625
|
+
o["apiVersion"] = dec.readText();
|
|
1626
|
+
break;
|
|
1627
|
+
case "kind":
|
|
1628
|
+
o["kind"] = dec.readText();
|
|
1629
|
+
break;
|
|
1630
|
+
case "metadata":
|
|
1631
|
+
o["metadata"] = decodeCBORIRMetadataFrom(dec);
|
|
1632
|
+
break;
|
|
1633
|
+
case "spec":
|
|
1634
|
+
o["spec"] = decodeCBORIRSpecFrom(dec);
|
|
1635
|
+
break;
|
|
1636
|
+
default: dec.skip();
|
|
1637
|
+
}
|
|
1638
|
+
}
|
|
1639
|
+
return o;
|
|
1640
|
+
}
|