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