@azure/provisioning-core 0.1.0-alpha.20261014.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 +21 -0
- package/README.md +62 -0
- package/dist/constructs/built-in-resources/resource-group.d.ts +50 -0
- package/dist/constructs/built-in-resources/resource-group.d.ts.map +1 -0
- package/dist/constructs/built-in-resources/resource-group.js +97 -0
- package/dist/constructs/built-in-resources/resource-group.js.map +1 -0
- package/dist/constructs/output.d.ts +80 -0
- package/dist/constructs/output.d.ts.map +1 -0
- package/dist/constructs/output.js +76 -0
- package/dist/constructs/output.js.map +1 -0
- package/dist/constructs/parameter.d.ts +77 -0
- package/dist/constructs/parameter.d.ts.map +1 -0
- package/dist/constructs/parameter.js +93 -0
- package/dist/constructs/parameter.js.map +1 -0
- package/dist/constructs/provisioning-component.d.ts +91 -0
- package/dist/constructs/provisioning-component.d.ts.map +1 -0
- package/dist/constructs/provisioning-component.js +150 -0
- package/dist/constructs/provisioning-component.js.map +1 -0
- package/dist/constructs/resource/resource-proxy.d.ts +134 -0
- package/dist/constructs/resource/resource-proxy.d.ts.map +1 -0
- package/dist/constructs/resource/resource-proxy.js +523 -0
- package/dist/constructs/resource/resource-proxy.js.map +1 -0
- package/dist/constructs/resource/resource-query.d.ts +23 -0
- package/dist/constructs/resource/resource-query.d.ts.map +1 -0
- package/dist/constructs/resource/resource-query.js +71 -0
- package/dist/constructs/resource/resource-query.js.map +1 -0
- package/dist/constructs/resource/resource-registry.d.ts +99 -0
- package/dist/constructs/resource/resource-registry.d.ts.map +1 -0
- package/dist/constructs/resource/resource-registry.js +51 -0
- package/dist/constructs/resource/resource-registry.js.map +1 -0
- package/dist/constructs/resource/resource-type-registry.d.ts +46 -0
- package/dist/constructs/resource/resource-type-registry.d.ts.map +1 -0
- package/dist/constructs/resource/resource-type-registry.js +156 -0
- package/dist/constructs/resource/resource-type-registry.js.map +1 -0
- package/dist/constructs/resource/resource-utils.d.ts +60 -0
- package/dist/constructs/resource/resource-utils.d.ts.map +1 -0
- package/dist/constructs/resource/resource-utils.js +77 -0
- package/dist/constructs/resource/resource-utils.js.map +1 -0
- package/dist/constructs/resource/resource.d.ts +460 -0
- package/dist/constructs/resource/resource.d.ts.map +1 -0
- package/dist/constructs/resource/resource.js +584 -0
- package/dist/constructs/resource/resource.js.map +1 -0
- package/dist/constructs/stack.d.ts +110 -0
- package/dist/constructs/stack.d.ts.map +1 -0
- package/dist/constructs/stack.js +110 -0
- package/dist/constructs/stack.js.map +1 -0
- package/dist/constructs/variable.d.ts +63 -0
- package/dist/constructs/variable.d.ts.map +1 -0
- package/dist/constructs/variable.js +74 -0
- package/dist/constructs/variable.js.map +1 -0
- package/dist/deployment-context/deployment-context.d.ts +27 -0
- package/dist/deployment-context/deployment-context.d.ts.map +1 -0
- package/dist/deployment-context/deployment-context.js +4 -0
- package/dist/deployment-context/deployment-context.js.map +1 -0
- package/dist/expression/ast-nodes.d.ts +100 -0
- package/dist/expression/ast-nodes.d.ts.map +1 -0
- package/dist/expression/ast-nodes.js +127 -0
- package/dist/expression/ast-nodes.js.map +1 -0
- package/dist/expression/expressions.d.ts +164 -0
- package/dist/expression/expressions.d.ts.map +1 -0
- package/dist/expression/expressions.js +211 -0
- package/dist/expression/expressions.js.map +1 -0
- package/dist/fn.d.ts +194 -0
- package/dist/fn.d.ts.map +1 -0
- package/dist/fn.js +353 -0
- package/dist/fn.js.map +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/internal-loop.d.ts +14 -0
- package/dist/internal-loop.d.ts.map +1 -0
- package/dist/internal-loop.js +16 -0
- package/dist/internal-loop.js.map +1 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +10 -0
- package/dist/internal.js.map +1 -0
- package/dist/naming/naming-policy.d.ts +56 -0
- package/dist/naming/naming-policy.d.ts.map +1 -0
- package/dist/naming/naming-policy.js +99 -0
- package/dist/naming/naming-policy.js.map +1 -0
- package/dist/naming/naming-rules.d.ts +15 -0
- package/dist/naming/naming-rules.d.ts.map +1 -0
- package/dist/naming/naming-rules.js +15 -0
- package/dist/naming/naming-rules.js.map +1 -0
- package/dist/serialization/contract/generated/ast.d.ts +508 -0
- package/dist/serialization/contract/generated/ast.d.ts.map +1 -0
- package/dist/serialization/contract/generated/ast.js +23 -0
- package/dist/serialization/contract/generated/ast.js.map +1 -0
- package/dist/serialization/contract/index.d.ts +2 -0
- package/dist/serialization/contract/index.d.ts.map +1 -0
- package/dist/serialization/contract/index.js +4 -0
- package/dist/serialization/contract/index.js.map +1 -0
- package/dist/serialization/index.d.ts +4 -0
- package/dist/serialization/index.d.ts.map +1 -0
- package/dist/serialization/index.js +5 -0
- package/dist/serialization/index.js.map +1 -0
- package/dist/serialization/json/deserialize.d.ts +24 -0
- package/dist/serialization/json/deserialize.d.ts.map +1 -0
- package/dist/serialization/json/deserialize.js +476 -0
- package/dist/serialization/json/deserialize.js.map +1 -0
- package/dist/serialization/json/encoding.d.ts +4 -0
- package/dist/serialization/json/encoding.d.ts.map +1 -0
- package/dist/serialization/json/encoding.js +323 -0
- package/dist/serialization/json/encoding.js.map +1 -0
- package/dist/serialization/json/expression.d.ts +32 -0
- package/dist/serialization/json/expression.d.ts.map +1 -0
- package/dist/serialization/json/expression.js +490 -0
- package/dist/serialization/json/expression.js.map +1 -0
- package/dist/serialization/json/lower.d.ts +41 -0
- package/dist/serialization/json/lower.d.ts.map +1 -0
- package/dist/serialization/json/lower.js +343 -0
- package/dist/serialization/json/lower.js.map +1 -0
- package/dist/serialization/json/pluralize-config.d.ts +3 -0
- package/dist/serialization/json/pluralize-config.d.ts.map +1 -0
- package/dist/serialization/json/pluralize-config.js +7 -0
- package/dist/serialization/json/pluralize-config.js.map +1 -0
- package/dist/serialization/json/serialize.d.ts +12 -0
- package/dist/serialization/json/serialize.d.ts.map +1 -0
- package/dist/serialization/json/serialize.js +399 -0
- package/dist/serialization/json/serialize.js.map +1 -0
- package/dist/serialization/json/util.d.ts +2 -0
- package/dist/serialization/json/util.d.ts.map +1 -0
- package/dist/serialization/json/util.js +19 -0
- package/dist/serialization/json/util.js.map +1 -0
- package/dist/serialization/utils.d.ts +3 -0
- package/dist/serialization/utils.d.ts.map +1 -0
- package/dist/serialization/utils.js +146 -0
- package/dist/serialization/utils.js.map +1 -0
- package/dist/shape/shape-registry.d.ts +51 -0
- package/dist/shape/shape-registry.d.ts.map +1 -0
- package/dist/shape/shape-registry.js +41 -0
- package/dist/shape/shape-registry.js.map +1 -0
- package/dist/shape/shape.d.ts +407 -0
- package/dist/shape/shape.d.ts.map +1 -0
- package/dist/shape/shape.js +425 -0
- package/dist/shape/shape.js.map +1 -0
- package/dist/shape/value-encoding.d.ts +121 -0
- package/dist/shape/value-encoding.d.ts.map +1 -0
- package/dist/shape/value-encoding.js +32 -0
- package/dist/shape/value-encoding.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/dist/util.d.ts +33 -0
- package/dist/util.d.ts.map +1 -0
- package/dist/util.js +78 -0
- package/dist/util.js.map +1 -0
- package/package.json +49 -0
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* Deserializes raw JSON (produced by `@azure/provisioning-core/serialization`) back into
|
|
5
|
+
* live CDK `Stack` data structures.
|
|
6
|
+
*/
|
|
7
|
+
import { createOutput } from "../../constructs/output.js";
|
|
8
|
+
import { createParameter } from "../../constructs/parameter.js";
|
|
9
|
+
import { createVariable, } from "../../constructs/variable.js";
|
|
10
|
+
import { createIndexedResourceProxy, unwrapResourceHandle, } from "../../constructs/resource/resource-proxy.js";
|
|
11
|
+
import { isLoopedResource } from "../../constructs/resource/resource-utils.js";
|
|
12
|
+
import { createLoopedResource, Loop, Resource, } from "../../constructs/resource/resource.js";
|
|
13
|
+
import { Stack } from "../../constructs/stack.js";
|
|
14
|
+
import { wrapExpression, isExpression, } from "../../expression/expressions.js";
|
|
15
|
+
import { namingRequiredPolicy } from "../../naming/naming-policy.js";
|
|
16
|
+
import { getShape } from "../../shape/shape-registry.js";
|
|
17
|
+
import { symbolicValueExpressionNode } from "../../expression/ast-nodes.js";
|
|
18
|
+
import { resolveResource } from "../../constructs/resource/resource-registry.js";
|
|
19
|
+
import {} from "../../constructs/provisioning-component.js";
|
|
20
|
+
import { isPrimitiveTypeName, } from "../contract/index.js";
|
|
21
|
+
import { deserializeDependsOnExpression, deserializeExpression, requireResourceHandle, } from "./expression.js";
|
|
22
|
+
import { raiseState } from "./lower.js";
|
|
23
|
+
import { collectDependenciesForDeclaration } from "../utils.js";
|
|
24
|
+
/**
|
|
25
|
+
* Reconstructs stacks from the JSON text of a {@link SerializationDocument},
|
|
26
|
+
* such as `JSON.stringify(serialize(stack))`. Returns one stack per `infras`
|
|
27
|
+
* entry; the input must contain at least one.
|
|
28
|
+
*
|
|
29
|
+
* Import the relevant service packages before restoring to register their
|
|
30
|
+
* resource classes; otherwise unregistered types use base resources.
|
|
31
|
+
* Unsupported module declarations are rejected. A serialize/deserialize/
|
|
32
|
+
* serialize cycle preserves supported deployment semantics and expressions,
|
|
33
|
+
* though the resulting JSON need not be byte-for-byte identical.
|
|
34
|
+
*/
|
|
35
|
+
export function deserialize(raw, options) {
|
|
36
|
+
const doc = JSON.parse(raw);
|
|
37
|
+
if (doc.infras.length === 0)
|
|
38
|
+
throw new Error("Empty SerializationDocument");
|
|
39
|
+
if (doc.infras.some((infra) => Object.keys(infra.modules ?? {}).length > 0)) {
|
|
40
|
+
throw new Error("Module deserialization is not supported.");
|
|
41
|
+
}
|
|
42
|
+
return constructStacks(doc.infras, options);
|
|
43
|
+
}
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
// Construction: InfraNode → CDK objects
|
|
46
|
+
// ---------------------------------------------------------------------------
|
|
47
|
+
function constructStacks(files, options) {
|
|
48
|
+
return files.map((file) => constructStack(file, options));
|
|
49
|
+
}
|
|
50
|
+
function constructStack(file, options) {
|
|
51
|
+
const rootStack = new Stack(stemName(file.fileName), {
|
|
52
|
+
targetScope: file.targetScope ?? "resourceGroup",
|
|
53
|
+
namingPolicy: namingRequiredPolicy,
|
|
54
|
+
});
|
|
55
|
+
// Map stack-local identifiers to expression handles and resource declarations.
|
|
56
|
+
const symbols = new Map();
|
|
57
|
+
processParams(file, rootStack, symbols);
|
|
58
|
+
processDeclarations(file, rootStack, symbols, options);
|
|
59
|
+
processOutputs(file, rootStack, symbols);
|
|
60
|
+
return rootStack;
|
|
61
|
+
}
|
|
62
|
+
// ---------------------------------------------------------------------------
|
|
63
|
+
// Declaration processing
|
|
64
|
+
// ---------------------------------------------------------------------------
|
|
65
|
+
function assertSymbolAvailable(symbols, identifier) {
|
|
66
|
+
if (symbols.has(identifier)) {
|
|
67
|
+
throw new Error(`Duplicate declaration identifier "${identifier}".`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function processParams(file, stackHandle, symbols) {
|
|
71
|
+
for (const [, p] of Object.entries(file.parameters ?? {})) {
|
|
72
|
+
assertSymbolAvailable(symbols, p.bicepIdentifier);
|
|
73
|
+
if (p.valueType.kind !== "primitive-type" ||
|
|
74
|
+
!isPrimitiveTypeName(p.valueType.name)) {
|
|
75
|
+
throw new Error(`Parameter "${p.bicepIdentifier}" has an unsupported non-primitive type.`);
|
|
76
|
+
}
|
|
77
|
+
const type = p.valueType.name;
|
|
78
|
+
const sym = createParameter(stackHandle, p.bicepIdentifier, type, {
|
|
79
|
+
...(p.decorators?.description !== undefined
|
|
80
|
+
? { description: p.decorators.description }
|
|
81
|
+
: {}),
|
|
82
|
+
...(p.decorators?.secure ? { secure: true } : {}),
|
|
83
|
+
...(p.defaultValue !== undefined
|
|
84
|
+
? {
|
|
85
|
+
defaultValue: deserializeExpression(p.defaultValue, new Map()),
|
|
86
|
+
}
|
|
87
|
+
: {}),
|
|
88
|
+
...(p.decorators?.allowed?.length
|
|
89
|
+
? {
|
|
90
|
+
allowed: p.decorators.allowed.map((a) => deserializeExpression(a, new Map())),
|
|
91
|
+
}
|
|
92
|
+
: {}),
|
|
93
|
+
...(p.decorators?.minValue !== undefined
|
|
94
|
+
? { minValue: p.decorators.minValue }
|
|
95
|
+
: {}),
|
|
96
|
+
...(p.decorators?.maxValue !== undefined
|
|
97
|
+
? { maxValue: p.decorators.maxValue }
|
|
98
|
+
: {}),
|
|
99
|
+
...(p.decorators?.minLength !== undefined
|
|
100
|
+
? { minLength: p.decorators.minLength }
|
|
101
|
+
: {}),
|
|
102
|
+
...(p.decorators?.maxLength !== undefined
|
|
103
|
+
? { maxLength: p.decorators.maxLength }
|
|
104
|
+
: {}),
|
|
105
|
+
...(p.decorators?.metadata !== undefined
|
|
106
|
+
? {
|
|
107
|
+
metadata: Object.fromEntries(Object.entries(p.decorators.metadata).map(([k, v]) => [
|
|
108
|
+
k,
|
|
109
|
+
deserializeExpression(v, new Map()),
|
|
110
|
+
])),
|
|
111
|
+
}
|
|
112
|
+
: {}),
|
|
113
|
+
...(p.decorators?.discriminator !== undefined
|
|
114
|
+
? { discriminator: p.decorators.discriminator }
|
|
115
|
+
: {}),
|
|
116
|
+
...(p.decorators?.sealed ? { sealed: true } : {}),
|
|
117
|
+
});
|
|
118
|
+
symbols.set(p.bicepIdentifier, sym);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function processDeclarations(file, stackHandle, symbols, options) {
|
|
122
|
+
const declarations = new Map();
|
|
123
|
+
function registerDeclaration(declaration) {
|
|
124
|
+
const { node } = declaration;
|
|
125
|
+
assertSymbolAvailable(symbols, node.bicepIdentifier);
|
|
126
|
+
const previous = declarations.get(node.bicepIdentifier);
|
|
127
|
+
if (previous !== undefined) {
|
|
128
|
+
const category = previous.kind === "resource" && declaration.kind === "resource"
|
|
129
|
+
? "resource"
|
|
130
|
+
: "declaration";
|
|
131
|
+
throw new Error(`Duplicate ${category} identifier "${node.bicepIdentifier}".`);
|
|
132
|
+
}
|
|
133
|
+
declarations.set(node.bicepIdentifier, declaration);
|
|
134
|
+
}
|
|
135
|
+
for (const node of Object.values(file.variables ?? {})) {
|
|
136
|
+
registerDeclaration({ kind: "variable", node });
|
|
137
|
+
}
|
|
138
|
+
for (const node of Object.values(file.resources ?? {})) {
|
|
139
|
+
registerDeclaration({ kind: "resource", node });
|
|
140
|
+
}
|
|
141
|
+
const pending = [];
|
|
142
|
+
const active = new Map();
|
|
143
|
+
function pushDeclaration(declaration) {
|
|
144
|
+
const { node } = declaration;
|
|
145
|
+
const identifiers = collectDependenciesForDeclaration(node);
|
|
146
|
+
active.set(node.bicepIdentifier, pending.length);
|
|
147
|
+
pending.push({ declaration, dependencies: identifiers.values() });
|
|
148
|
+
}
|
|
149
|
+
for (const declaration of declarations.values()) {
|
|
150
|
+
if (symbols.has(declaration.node.bicepIdentifier))
|
|
151
|
+
continue;
|
|
152
|
+
pushDeclaration(declaration);
|
|
153
|
+
while (pending.length > 0) {
|
|
154
|
+
const frame = pending[pending.length - 1];
|
|
155
|
+
const dependency = frame.dependencies.next();
|
|
156
|
+
if (!dependency.done) {
|
|
157
|
+
if (symbols.has(dependency.value))
|
|
158
|
+
continue;
|
|
159
|
+
const target = declarations.get(dependency.value);
|
|
160
|
+
if (target === undefined)
|
|
161
|
+
continue;
|
|
162
|
+
const cycleStart = active.get(dependency.value);
|
|
163
|
+
if (cycleStart !== undefined) {
|
|
164
|
+
const cycle = pending
|
|
165
|
+
.slice(cycleStart)
|
|
166
|
+
.map((entry) => entry.declaration);
|
|
167
|
+
const category = cycle.every((entry) => entry.kind === "resource")
|
|
168
|
+
? "Resource"
|
|
169
|
+
: "Declaration";
|
|
170
|
+
const path = [
|
|
171
|
+
...cycle.map((entry) => entry.node.bicepIdentifier),
|
|
172
|
+
dependency.value,
|
|
173
|
+
]
|
|
174
|
+
.map((identifier) => `"${identifier}"`)
|
|
175
|
+
.join(" -> ");
|
|
176
|
+
throw new Error(`${category} dependency cycle detected: ${path}.`);
|
|
177
|
+
}
|
|
178
|
+
pushDeclaration(target);
|
|
179
|
+
continue;
|
|
180
|
+
}
|
|
181
|
+
constructDeclaration(frame.declaration);
|
|
182
|
+
active.delete(frame.declaration.node.bicepIdentifier);
|
|
183
|
+
pending.pop();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function constructDeclaration(declaration) {
|
|
187
|
+
if (declaration.kind === "resource") {
|
|
188
|
+
symbols.set(declaration.node.bicepIdentifier, createResource(declaration.node, stackHandle, symbols, options));
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
const { node } = declaration;
|
|
192
|
+
const sym = createVariable(stackHandle, node.bicepIdentifier, deserializeExpression(node.value, symbols), {
|
|
193
|
+
...(node.decorators?.description !== undefined
|
|
194
|
+
? { description: node.decorators.description }
|
|
195
|
+
: {}),
|
|
196
|
+
...(node.decorators?.export ? { export: true } : {}),
|
|
197
|
+
});
|
|
198
|
+
symbols.set(node.bicepIdentifier, sym);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function processOutputs(file, stackHandle, symbols) {
|
|
202
|
+
for (const [, o] of Object.entries(file.outputs ?? {})) {
|
|
203
|
+
if (o.valueType.kind !== "primitive-type") {
|
|
204
|
+
throw new Error(`Cannot deserialize output "${o.bicepIdentifier}" with non-primitive type "${o.valueType.kind}".`);
|
|
205
|
+
}
|
|
206
|
+
if (!isPrimitiveTypeName(o.valueType.name)) {
|
|
207
|
+
throw new Error(`Cannot deserialize output "${o.bicepIdentifier}" with unknown primitive type "${o.valueType.name}".`);
|
|
208
|
+
}
|
|
209
|
+
const val = deserializeExpression(o.value, symbols);
|
|
210
|
+
createOutput(stackHandle, o.bicepIdentifier, o.valueType.name, val, {
|
|
211
|
+
...(o.decorators?.description !== undefined
|
|
212
|
+
? { description: o.decorators.description }
|
|
213
|
+
: {}),
|
|
214
|
+
...(o.decorators?.secure ? { secure: true } : {}),
|
|
215
|
+
...(o.decorators?.minValue !== undefined
|
|
216
|
+
? { minValue: o.decorators.minValue }
|
|
217
|
+
: {}),
|
|
218
|
+
...(o.decorators?.maxValue !== undefined
|
|
219
|
+
? { maxValue: o.decorators.maxValue }
|
|
220
|
+
: {}),
|
|
221
|
+
...(o.decorators?.minLength !== undefined
|
|
222
|
+
? { minLength: o.decorators.minLength }
|
|
223
|
+
: {}),
|
|
224
|
+
...(o.decorators?.maxLength !== undefined
|
|
225
|
+
? { maxLength: o.decorators.maxLength }
|
|
226
|
+
: {}),
|
|
227
|
+
...(o.decorators?.metadata !== undefined
|
|
228
|
+
? {
|
|
229
|
+
metadata: Object.fromEntries(Object.entries(o.decorators.metadata).map(([k, v]) => [
|
|
230
|
+
k,
|
|
231
|
+
deserializeExpression(v, symbols),
|
|
232
|
+
])),
|
|
233
|
+
}
|
|
234
|
+
: {}),
|
|
235
|
+
...(o.decorators?.discriminator !== undefined
|
|
236
|
+
? { discriminator: o.decorators.discriminator }
|
|
237
|
+
: {}),
|
|
238
|
+
...(o.decorators?.sealed ? { sealed: true } : {}),
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// ---------------------------------------------------------------------------
|
|
243
|
+
// Resource construction
|
|
244
|
+
// ---------------------------------------------------------------------------
|
|
245
|
+
function createResource(res, defaultScope, symbols, options) {
|
|
246
|
+
// `res.value` is the wire body. Valid shapes are:
|
|
247
|
+
// 1. object
|
|
248
|
+
// 2. if-condition(object)
|
|
249
|
+
// 3. for-expression(object)
|
|
250
|
+
// 4. for-expression(if-condition(object))
|
|
251
|
+
// Anything else (bare wrappers, if-outer-for-inner, multi-if, multi-for,
|
|
252
|
+
// nested for-for, if-for-if, etc.) is malformed and rejected here.
|
|
253
|
+
let wireBody = res.value;
|
|
254
|
+
let loopWrapper;
|
|
255
|
+
let conditionNode;
|
|
256
|
+
if (wireBody.kind === "for-expression") {
|
|
257
|
+
loopWrapper = {
|
|
258
|
+
itemVariable: wireBody.itemVariable,
|
|
259
|
+
...(wireBody.indexVariable !== undefined
|
|
260
|
+
? { indexVariable: wireBody.indexVariable }
|
|
261
|
+
: {}),
|
|
262
|
+
collection: wireBody.collection,
|
|
263
|
+
};
|
|
264
|
+
wireBody = wireBody.body;
|
|
265
|
+
}
|
|
266
|
+
if (wireBody.kind === "if-condition") {
|
|
267
|
+
conditionNode = wireBody.condition;
|
|
268
|
+
wireBody = wireBody.body;
|
|
269
|
+
}
|
|
270
|
+
if (wireBody.kind !== "object") {
|
|
271
|
+
throw new Error(`Invalid wire shape for resource "${res.bicepIdentifier}": ` +
|
|
272
|
+
`\`value\` must be an \`object\`, optionally wrapped in ` +
|
|
273
|
+
`\`if-condition\` and/or an outer \`for-expression\` (Bicep source ` +
|
|
274
|
+
`order: \`for\` outer, \`if\` inner). Innermost node after peeling ` +
|
|
275
|
+
`at most one \`for-expression\` and one \`if-condition\` is ` +
|
|
276
|
+
`\`${wireBody.kind}\`.`);
|
|
277
|
+
}
|
|
278
|
+
const scopedSymbols = loopWrapper === undefined ? symbols : new Map(symbols);
|
|
279
|
+
const loopAuthoring = loopWrapper !== undefined
|
|
280
|
+
? {
|
|
281
|
+
collection: deserializeExpression(loopWrapper.collection, symbols),
|
|
282
|
+
itemVariable: loopWrapper.itemVariable,
|
|
283
|
+
...(loopWrapper.indexVariable !== undefined
|
|
284
|
+
? { indexVariable: loopWrapper.indexVariable }
|
|
285
|
+
: {}),
|
|
286
|
+
...(res.decorators?.batchSize !== undefined
|
|
287
|
+
? { batchSize: res.decorators.batchSize }
|
|
288
|
+
: {}),
|
|
289
|
+
}
|
|
290
|
+
: undefined;
|
|
291
|
+
if (loopWrapper !== undefined) {
|
|
292
|
+
scopedSymbols.set(loopWrapper.itemVariable, wrapExpression(symbolicValueExpressionNode(loopWrapper.itemVariable)));
|
|
293
|
+
if (loopWrapper.indexVariable !== undefined) {
|
|
294
|
+
scopedSymbols.set(loopWrapper.indexVariable, wrapExpression(symbolicValueExpressionNode(loopWrapper.indexVariable)));
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
const authoring = {
|
|
298
|
+
...(conditionNode !== undefined
|
|
299
|
+
? {
|
|
300
|
+
condition: deserializeExpression(conditionNode, scopedSymbols),
|
|
301
|
+
}
|
|
302
|
+
: {}),
|
|
303
|
+
...(loopAuthoring !== undefined ? { loop: loopAuthoring } : {}),
|
|
304
|
+
};
|
|
305
|
+
return buildResource(res, objBody(res.value) ?? {}, defaultScope, scopedSymbols, options, authoring);
|
|
306
|
+
}
|
|
307
|
+
function buildResource(res, body, defaultScope, symbols, options, authoring) {
|
|
308
|
+
let context = defaultScope;
|
|
309
|
+
const parentNode = body["parent"];
|
|
310
|
+
const scopeNode = body["scope"];
|
|
311
|
+
if (parentNode !== undefined &&
|
|
312
|
+
parentNode.kind !== "identifier" &&
|
|
313
|
+
parentNode.kind !== "array-access") {
|
|
314
|
+
throw new Error(`Resource "${res.bicepIdentifier}" has an invalid "parent" reference.`);
|
|
315
|
+
}
|
|
316
|
+
if (!res.existing &&
|
|
317
|
+
scopeNode !== undefined &&
|
|
318
|
+
scopeNode.kind !== "identifier") {
|
|
319
|
+
throw new Error(`Resource "${res.bicepIdentifier}" has an invalid "scope" reference.`);
|
|
320
|
+
}
|
|
321
|
+
if (parentNode?.kind === "identifier") {
|
|
322
|
+
context = requireResourceHandle(parentNode.id, symbols, res.bicepIdentifier, "parent");
|
|
323
|
+
}
|
|
324
|
+
else if (parentNode?.kind === "array-access") {
|
|
325
|
+
// `parent: parentSym[<index>]` — the serializer emitted this because
|
|
326
|
+
// the authoring code created the child under `parents.at(i)` /
|
|
327
|
+
// `parents.current()`. To round-trip the shape, reconstruct the
|
|
328
|
+
// indexed proxy so the base `Resource` ctor stashes
|
|
329
|
+
// `state.parentIndex` from the same index expression. Passing the
|
|
330
|
+
// raw parent here would erase the array-access — the child would
|
|
331
|
+
// re-serialize as `parent: parentSym` and lose the index.
|
|
332
|
+
const baseNode = parentNode.base;
|
|
333
|
+
if (baseNode.kind === "identifier") {
|
|
334
|
+
const rawParent = requireResourceHandle(baseNode.id, symbols, res.bicepIdentifier, "parent");
|
|
335
|
+
const indexValue = deserializeExpression(parentNode.index, symbols);
|
|
336
|
+
context = createIndexedResourceProxy(rawParent, indexValue);
|
|
337
|
+
}
|
|
338
|
+
else {
|
|
339
|
+
throw new Error(`Resource "${res.bicepIdentifier}" has an invalid "parent" reference.`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
else if (scopeNode?.kind === "identifier") {
|
|
343
|
+
const scopeResource = requireResourceHandle(scopeNode.id, symbols, res.bicepIdentifier, "scope");
|
|
344
|
+
if (isLoopedResource(scopeResource)) {
|
|
345
|
+
throw new Error(`Resource "${res.bicepIdentifier}" references resource collection ` +
|
|
346
|
+
`"${scopeNode.id}" in "scope"; expected a single resource.`);
|
|
347
|
+
}
|
|
348
|
+
context = scopeResource;
|
|
349
|
+
}
|
|
350
|
+
let existingScope;
|
|
351
|
+
if (res.existing &&
|
|
352
|
+
scopeNode !== undefined &&
|
|
353
|
+
scopeNode.kind !== "identifier") {
|
|
354
|
+
const scope = deserializeExpression(scopeNode, symbols);
|
|
355
|
+
if (!isExpression(scope)) {
|
|
356
|
+
throw new Error(`Resource "${res.bicepIdentifier}" has an invalid "scope" value: ` +
|
|
357
|
+
`expected an expression, received "${scopeNode.kind}".`);
|
|
358
|
+
}
|
|
359
|
+
existingScope = scope;
|
|
360
|
+
}
|
|
361
|
+
// Collect non-reserved properties
|
|
362
|
+
const RESERVED = new Set(["name", "parent", "scope", "dependsOn"]);
|
|
363
|
+
const wireProps = Object.create(null);
|
|
364
|
+
for (const [key, valNode] of Object.entries(body)) {
|
|
365
|
+
if (!RESERVED.has(key)) {
|
|
366
|
+
Object.defineProperty(wireProps, key, {
|
|
367
|
+
value: deserializeExpression(valNode, symbols),
|
|
368
|
+
enumerable: true,
|
|
369
|
+
configurable: true,
|
|
370
|
+
writable: true,
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
// Raise wire-shape props into JS-shape when a descriptor is
|
|
375
|
+
// registered for this resource type + apiVersion. No-op otherwise —
|
|
376
|
+
// the resource stays in wire shape, which round-trips correctly
|
|
377
|
+
// because re-serialization also skips lowering when no descriptor
|
|
378
|
+
// is attached.
|
|
379
|
+
const nameNode = body["name"];
|
|
380
|
+
const resourceName = nameNode === undefined
|
|
381
|
+
? "unknown"
|
|
382
|
+
: deserializeExpression(nameNode, symbols);
|
|
383
|
+
const wireState = { name: resourceName, ...wireProps };
|
|
384
|
+
const descriptor = getShape(res.type, res.apiVersion, wireState, {
|
|
385
|
+
strict: options?.strict ?? false,
|
|
386
|
+
valueKeyedBy: "arm",
|
|
387
|
+
});
|
|
388
|
+
const props = descriptor ? raiseState(wireProps, descriptor) : wireProps;
|
|
389
|
+
const baseProps = {
|
|
390
|
+
type: res.type,
|
|
391
|
+
apiVersion: res.apiVersion,
|
|
392
|
+
name: resourceName,
|
|
393
|
+
...(res.existing ? { existing: true } : {}),
|
|
394
|
+
...(existingScope !== undefined ? { scope: existingScope } : {}),
|
|
395
|
+
...props,
|
|
396
|
+
};
|
|
397
|
+
const resourceOptions = {
|
|
398
|
+
...(authoring?.condition !== undefined
|
|
399
|
+
? { condition: authoring.condition }
|
|
400
|
+
: {}),
|
|
401
|
+
...(body.dependsOn !== undefined
|
|
402
|
+
? {
|
|
403
|
+
dependsOn: deserializeDependsOnExpression(body.dependsOn, symbols, res.bicepIdentifier),
|
|
404
|
+
}
|
|
405
|
+
: {}),
|
|
406
|
+
};
|
|
407
|
+
// Look up a registered class for this (type, apiVersion). If one
|
|
408
|
+
// exists, construct it directly so the resulting handle has the right
|
|
409
|
+
// prototype, instance fields, and `instanceof` identity. The class
|
|
410
|
+
// constructor sets `type` and
|
|
411
|
+
// `apiVersion` itself, so strip them before forwarding. Fall back to
|
|
412
|
+
// base `Resource` when no class is registered (unknown type or
|
|
413
|
+
// tree-shaken/missing class module). The `{ name }` lookup state lets
|
|
414
|
+
// the registry pick the right variant for ARM-discriminated types
|
|
415
|
+
// (e.g. `Microsoft.ApiManagement/service/portalsettings` keyed by
|
|
416
|
+
// singleton name). By default the registry does a best-effort match
|
|
417
|
+
// — an unknown apiVersion falls back to the highest registered
|
|
418
|
+
// version for the same `(type, channel)`. Callers can pass
|
|
419
|
+
// `{ strict: true }` on `deserialize` to require an
|
|
420
|
+
// exact `(type, apiVersion)` match instead.
|
|
421
|
+
const Ctor = resolveResource(res.type, res.apiVersion, wireState, options);
|
|
422
|
+
let handle;
|
|
423
|
+
if (authoring?.loop !== undefined) {
|
|
424
|
+
// Looped path: construct a `LoopedResource` directly. Build a fresh
|
|
425
|
+
// `Loop` from the peeled wire metadata; `Resource.fromLoop` reads
|
|
426
|
+
// `.collection`, `.itemVariable`, `.indexRequested`, `.indexVariable`,
|
|
427
|
+
// and `.batchSize` off it. Passing the itemVariable/indexVariable
|
|
428
|
+
// explicitly keeps the wire name (rather than the "item"/"i" default)
|
|
429
|
+
// and, since supplying `{ indexVariable }` counts as a request,
|
|
430
|
+
// preserves the index binding on re-serialize.
|
|
431
|
+
const loopInstance = new Loop(authoring.loop.collection, {
|
|
432
|
+
itemVariable: authoring.loop.itemVariable,
|
|
433
|
+
...(authoring.loop.indexVariable !== undefined
|
|
434
|
+
? { indexVariable: authoring.loop.indexVariable }
|
|
435
|
+
: {}),
|
|
436
|
+
...(authoring.loop.batchSize !== undefined
|
|
437
|
+
? { batchSize: authoring.loop.batchSize }
|
|
438
|
+
: {}),
|
|
439
|
+
});
|
|
440
|
+
// Base `Resource` is the fallback when no subclass is registered.
|
|
441
|
+
// `LoopedResource`'s ctor accepts type/apiVersion from `userProps`
|
|
442
|
+
// when the ctor's own statics are undefined (as they are on base
|
|
443
|
+
// `Resource`), so this path threads the wire values through
|
|
444
|
+
// `baseProps`.
|
|
445
|
+
const CtorToUse = Ctor ?? Resource;
|
|
446
|
+
handle = createLoopedResource(CtorToUse, loopInstance, context, baseProps, resourceOptions);
|
|
447
|
+
}
|
|
448
|
+
else if (Ctor === undefined) {
|
|
449
|
+
handle = new Resource(context, baseProps, resourceOptions);
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
const { type: _t, apiVersion: _v, ...classProps } = baseProps;
|
|
453
|
+
handle = new Ctor(context, classProps, resourceOptions);
|
|
454
|
+
}
|
|
455
|
+
if (authoring?.condition !== undefined) {
|
|
456
|
+
const state = unwrapResourceHandle(handle);
|
|
457
|
+
state.condition = authoring.condition;
|
|
458
|
+
}
|
|
459
|
+
return handle;
|
|
460
|
+
}
|
|
461
|
+
// ---------------------------------------------------------------------------
|
|
462
|
+
// Helpers
|
|
463
|
+
// ---------------------------------------------------------------------------
|
|
464
|
+
function objBody(node) {
|
|
465
|
+
if (node.kind === "object")
|
|
466
|
+
return node.value;
|
|
467
|
+
if (node.kind === "if-condition")
|
|
468
|
+
return objBody(node.body);
|
|
469
|
+
if (node.kind === "for-expression")
|
|
470
|
+
return objBody(node.body);
|
|
471
|
+
return undefined;
|
|
472
|
+
}
|
|
473
|
+
function stemName(fileName) {
|
|
474
|
+
return fileName.replace(/\.bicep$/, "");
|
|
475
|
+
}
|
|
476
|
+
//# sourceMappingURL=deserialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserialize.js","sourceRoot":"","sources":["../../../src/serialization/json/deserialize.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAoB,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EACL,cAAc,GAEf,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,gBAAgB,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,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,SAAS,EAAE,SAAS,KAAK,SAAS,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,CAGxC,CAAC;QACF,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC;IACxC,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,SAAS,OAAO,CACd,IAAoB;IAEpB,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC;IAC9C,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB;IAChC,OAAO,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ValueEncodingDescriptor } from "../../shape/value-encoding.js";
|
|
2
|
+
export declare function encodeWireValue(value: unknown, encoding: ValueEncodingDescriptor, path?: readonly string[]): unknown;
|
|
3
|
+
export declare function decodeWireValue(value: unknown, encoding: ValueEncodingDescriptor, path?: readonly string[]): unknown;
|
|
4
|
+
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../src/serialization/json/encoding.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAOV,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,uBAAuB,EACjC,IAAI,GAAE,SAAS,MAAM,EAAO,GAC3B,OAAO,CA8BT;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,EACd,QAAQ,EAAE,uBAAuB,EACjC,IAAI,GAAE,SAAS,MAAM,EAAO,GAC3B,OAAO,CAqCT"}
|