@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,455 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var resource_exports = {};
|
|
19
|
+
__export(resource_exports, {
|
|
20
|
+
Loop: () => Loop,
|
|
21
|
+
LoopedResource: () => LoopedResource,
|
|
22
|
+
Resource: () => Resource,
|
|
23
|
+
ResourceDeclaration: () => ResourceDeclaration,
|
|
24
|
+
createLoopedResource: () => createLoopedResource
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(resource_exports);
|
|
27
|
+
var import_provisioning_component = require("../provisioning-component.js");
|
|
28
|
+
var import_expressions = require("../../expression/expressions.js");
|
|
29
|
+
var import_ast_nodes = require("../../expression/ast-nodes.js");
|
|
30
|
+
var import_naming_policy = require("../../naming/naming-policy.js");
|
|
31
|
+
var import_resource_proxy = require("./resource-proxy.js");
|
|
32
|
+
var import_resource_utils = require("./resource-utils.js");
|
|
33
|
+
var import_shape_registry = require("../../shape/shape-registry.js");
|
|
34
|
+
var import_resource_registry = require("./resource-registry.js");
|
|
35
|
+
class ResourceDeclaration extends import_provisioning_component.ProvisioningComponent {
|
|
36
|
+
/**
|
|
37
|
+
* Brand marker for cross-realm `isResourceDeclaration()` checks. Uses
|
|
38
|
+
* `Symbol.for` so it survives multiple copies of `@azure/provisioning-core`.
|
|
39
|
+
* Inherited by every resource declaration implementation.
|
|
40
|
+
*/
|
|
41
|
+
[import_resource_proxy.RESOURCE_DECLARATION_BRAND] = true;
|
|
42
|
+
// Not `readonly`: the ctor writes `this.state = data` once. TypeScript
|
|
43
|
+
// forbids subclass writes to a `readonly` parent field, so the
|
|
44
|
+
// immutability is a runtime contract (never reassigned after ctor)
|
|
45
|
+
// rather than a static one.
|
|
46
|
+
state;
|
|
47
|
+
/**
|
|
48
|
+
* Base constructor for every Bicep resource declaration.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
*
|
|
52
|
+
* Responsibilities:
|
|
53
|
+
* 1. Register in the component tree (`super(context)`).
|
|
54
|
+
* 2. Enforce a deployment context ancestor.
|
|
55
|
+
* 3. Unwrap `context` if it's an indexed proxy from `.at(i)` /
|
|
56
|
+
* `parent.at(loop.index)`, and stash `parentIndex` on `state` so the
|
|
57
|
+
* serializer can emit `parent: parentSym[index]` on the child.
|
|
58
|
+
* 4. Inherit `condition` from the immediate parent resource
|
|
59
|
+
* declaration when the caller doesn't supply one (Bicep requires
|
|
60
|
+
* children of a conditional resource to share the same guard).
|
|
61
|
+
* 5. Populate `state` — existing arm records only identity fields;
|
|
62
|
+
* deployable arm runs the naming policy and applies
|
|
63
|
+
* `DeploymentContext` defaults for `location` / `tags` per the
|
|
64
|
+
* shape descriptor.
|
|
65
|
+
*
|
|
66
|
+
* Subclasses supply the last mile, including their public handle behavior.
|
|
67
|
+
*
|
|
68
|
+
* @param namingRules - per-resource-type constraints for the naming
|
|
69
|
+
* policy. `Resource` reads this reflectively off the concrete subclass
|
|
70
|
+
* constructor; internal declaration implementations receive it from
|
|
71
|
+
* the concrete resource constructor they represent.
|
|
72
|
+
*/
|
|
73
|
+
constructor(context, props, options, namingRules) {
|
|
74
|
+
super(context);
|
|
75
|
+
if (!this.hasDeploymentContext()) {
|
|
76
|
+
throw new Error("Resource declaration must have a parent deployment context.");
|
|
77
|
+
}
|
|
78
|
+
const indexRef = context[import_resource_proxy.PROXY_INDEX_REF];
|
|
79
|
+
let parentIndex = void 0;
|
|
80
|
+
if (indexRef !== void 0) {
|
|
81
|
+
const rawParent = context[import_resource_proxy.INDEXED_PROXY_TARGET];
|
|
82
|
+
if (rawParent !== void 0) {
|
|
83
|
+
this.parent = rawParent;
|
|
84
|
+
}
|
|
85
|
+
parentIndex = indexRef;
|
|
86
|
+
}
|
|
87
|
+
const isExisting = props.existing === true;
|
|
88
|
+
const parent = this.parent;
|
|
89
|
+
const inheritedCondition = (0, import_resource_utils.isResourceDeclaration)(parent) ? parent.self.state["condition"] : void 0;
|
|
90
|
+
const explicitCondition = options?.condition;
|
|
91
|
+
const condition = explicitCondition !== void 0 && inheritedCondition !== void 0 ? (0, import_expressions.createBinaryExpression)("&&", inheritedCondition, explicitCondition) : explicitCondition ?? inheritedCondition;
|
|
92
|
+
const dependsOn = options?.dependsOn;
|
|
93
|
+
let data;
|
|
94
|
+
if (isExisting) {
|
|
95
|
+
if (props.name === void 0) {
|
|
96
|
+
throw new Error(`Resource ${props.type} marked as 'existing' but no 'name' was provided.`);
|
|
97
|
+
}
|
|
98
|
+
data = {
|
|
99
|
+
name: props.name,
|
|
100
|
+
type: props.type,
|
|
101
|
+
apiVersion: props.apiVersion,
|
|
102
|
+
existing: true,
|
|
103
|
+
scope: props.scope === void 0 ? void 0 : (0, import_expressions.unwrapExpression)(props.scope),
|
|
104
|
+
condition,
|
|
105
|
+
dependsOn
|
|
106
|
+
};
|
|
107
|
+
if (parentIndex !== void 0) {
|
|
108
|
+
data[import_resource_proxy.STATE_PARENT_INDEX] = parentIndex;
|
|
109
|
+
}
|
|
110
|
+
} else {
|
|
111
|
+
const {
|
|
112
|
+
name: _name,
|
|
113
|
+
type: _type,
|
|
114
|
+
apiVersion: _apiVersion,
|
|
115
|
+
existing: _existing,
|
|
116
|
+
scope: _scope,
|
|
117
|
+
...userProps
|
|
118
|
+
} = props;
|
|
119
|
+
const ctx = this.deploymentContext;
|
|
120
|
+
data = {
|
|
121
|
+
name: (0, import_naming_policy.resolveResourceName)(
|
|
122
|
+
ctx.namingPolicy ?? import_naming_policy.namingRequiredPolicy,
|
|
123
|
+
props.name,
|
|
124
|
+
props.type,
|
|
125
|
+
namingRules
|
|
126
|
+
),
|
|
127
|
+
type: props.type,
|
|
128
|
+
apiVersion: props.apiVersion,
|
|
129
|
+
condition,
|
|
130
|
+
dependsOn,
|
|
131
|
+
...userProps
|
|
132
|
+
};
|
|
133
|
+
if (parentIndex !== void 0) {
|
|
134
|
+
data[import_resource_proxy.STATE_PARENT_INDEX] = parentIndex;
|
|
135
|
+
}
|
|
136
|
+
const shape = (0, import_shape_registry.getShape)(props.type, props.apiVersion, data);
|
|
137
|
+
if (shape !== void 0) {
|
|
138
|
+
const locationShape = shape.byJsName["location"];
|
|
139
|
+
if (locationShape !== void 0 && locationShape.readOnly !== true && data["location"] === void 0 && ctx.location !== void 0) {
|
|
140
|
+
data["location"] = ctx.location;
|
|
141
|
+
}
|
|
142
|
+
const tagsShape = shape.byJsName["tags"];
|
|
143
|
+
if (tagsShape !== void 0 && tagsShape.readOnly !== true && data["tags"] === void 0 && ctx.tags !== void 0 && Object.keys(ctx.tags).length > 0) {
|
|
144
|
+
data["tags"] = { ...ctx.tags };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
this.state = data;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Core-internal escape hatch: exposes the raw `state` backing object to
|
|
152
|
+
* the proxy layer (`resource-proxy.ts`) so it can read/unwrap the
|
|
153
|
+
* declaration's data across module boundaries. Keyed by the
|
|
154
|
+
* module-scoped {@link RAW_RESOURCE_HANDLE} symbol, which is **not**
|
|
155
|
+
* exported from `@azure/provisioning-core`, so package consumers can't name it.
|
|
156
|
+
*
|
|
157
|
+
* `protected` (not `private`) because the accessors that read it use
|
|
158
|
+
* `Reflect.get` / structural casts that bypass TS visibility anyway;
|
|
159
|
+
* the modifier just keeps it off the public type surface. It can't be a
|
|
160
|
+
* `#private` field because the proxy layer lives in a different class.
|
|
161
|
+
*
|
|
162
|
+
* @internal
|
|
163
|
+
*/
|
|
164
|
+
get [import_resource_proxy.RAW_RESOURCE_HANDLE]() {
|
|
165
|
+
return this.state;
|
|
166
|
+
}
|
|
167
|
+
get type() {
|
|
168
|
+
return this.state.type;
|
|
169
|
+
}
|
|
170
|
+
get apiVersion() {
|
|
171
|
+
return this.state.apiVersion;
|
|
172
|
+
}
|
|
173
|
+
get existing() {
|
|
174
|
+
return this.state.existing;
|
|
175
|
+
}
|
|
176
|
+
get condition() {
|
|
177
|
+
return this.state.condition;
|
|
178
|
+
}
|
|
179
|
+
get dependsOn() {
|
|
180
|
+
return this.state.dependsOn;
|
|
181
|
+
}
|
|
182
|
+
expr(...path) {
|
|
183
|
+
return (0, import_resource_proxy.createResourceMemberProxy)(
|
|
184
|
+
{
|
|
185
|
+
resource: this,
|
|
186
|
+
root: (0, import_resource_proxy.unwrapResourceHandle)(this)
|
|
187
|
+
},
|
|
188
|
+
path
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
setProperty(key, value) {
|
|
192
|
+
this.state[key] = (0, import_resource_proxy.normalizeAssignedValue)(value, this);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
class Resource extends ResourceDeclaration {
|
|
196
|
+
/**
|
|
197
|
+
* Brand marker for cross-realm `isResource()` checks.
|
|
198
|
+
* Uses `Symbol.for` so it survives multiple copies of `@azure/provisioning-core`.
|
|
199
|
+
*/
|
|
200
|
+
[import_resource_proxy.RESOURCE_BRAND] = true;
|
|
201
|
+
/**
|
|
202
|
+
* Register a {@link FlatModelShape} for this resource class's
|
|
203
|
+
* `(resourceType, apiVersion)` pair. Intended to be invoked from a
|
|
204
|
+
* `static {}` initializer in generated subclasses so the registration
|
|
205
|
+
* happens at module load.
|
|
206
|
+
*
|
|
207
|
+
* The static method reads `resourceType` and `apiVersion` off `this`
|
|
208
|
+
* (the subclass that called it), so callers don't repeat the literals.
|
|
209
|
+
*/
|
|
210
|
+
static registerShape(shape, variantSelector) {
|
|
211
|
+
(0, import_shape_registry.registerShape)(this.resourceType, this.apiVersion, shape, variantSelector);
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Register this class with the global resource registry so the
|
|
215
|
+
* deserializer can reconstruct instances of it (instead of falling
|
|
216
|
+
* back to base `Resource`) for matching `(resourceType, apiVersion)`
|
|
217
|
+
* pairs. Intended to be invoked from a `static {}` initializer in
|
|
218
|
+
* generated classes alongside {@link Resource.registerShape}.
|
|
219
|
+
*
|
|
220
|
+
* Pass an ordered discriminator path for concrete resource variants. A
|
|
221
|
+
* singleton is one segment (`name=signin`); model-discriminated resources
|
|
222
|
+
* may use `kind` or several nested segments. Omit for ordinary resources.
|
|
223
|
+
*/
|
|
224
|
+
static register(variantSelector) {
|
|
225
|
+
(0, import_resource_registry.registerResource)(this, variantSelector);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Assemble the base-`Resource` constructor payload (the second `super(...)`
|
|
229
|
+
* argument) from the user-facing props. This is a **static "virtual"**:
|
|
230
|
+
* it runs before an instance exists (to compute the `super` argument), so
|
|
231
|
+
* it can't be an instance method — but it still dispatches through the
|
|
232
|
+
* calling constructor, so a subclass's override wins.
|
|
233
|
+
*
|
|
234
|
+
* Every emitter-generated resource overrides this to inject its fixed
|
|
235
|
+
* identity (`type` / `apiVersion`), the singleton `name`, and its explicit
|
|
236
|
+
* writable-field copy. Both ordinary construction and internal resource
|
|
237
|
+
* reconstruction funnel through this method so prop shaping remains
|
|
238
|
+
* consistent.
|
|
239
|
+
*
|
|
240
|
+
* This base default is the fallback used when the wrapped constructor is
|
|
241
|
+
* base `Resource` itself — the deserialize path for an unregistered
|
|
242
|
+
* `(type, apiVersion)` pair, where `type` / `apiVersion` are threaded in
|
|
243
|
+
* through `props` rather than read off statics. Keeping the default here
|
|
244
|
+
* guarantees the method is always present for internal reconstruction.
|
|
245
|
+
*/
|
|
246
|
+
static buildResourceProps(props) {
|
|
247
|
+
const p = props ?? {};
|
|
248
|
+
return {
|
|
249
|
+
...p,
|
|
250
|
+
type: p["type"] ?? this.resourceType,
|
|
251
|
+
apiVersion: p["apiVersion"] ?? this.apiVersion
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Per-resource-type naming constraints, consumed by the active
|
|
256
|
+
* {@link NamingPolicy} when a resource is created without an explicit
|
|
257
|
+
* `name`. Generated CDK subclasses override this with a concrete value;
|
|
258
|
+
* the base default of `undefined` yields `MOST_RESTRICTIVE` behavior.
|
|
259
|
+
*
|
|
260
|
+
* This is type metadata, not user input, so it is kept off the public
|
|
261
|
+
* props surface and read reflectively in the constructor via
|
|
262
|
+
* `this.constructor` rather than being threaded through `ResourceProps`.
|
|
263
|
+
*/
|
|
264
|
+
static namingRules;
|
|
265
|
+
_selfProxy;
|
|
266
|
+
constructor(context, props, options) {
|
|
267
|
+
super(
|
|
268
|
+
context,
|
|
269
|
+
props,
|
|
270
|
+
options,
|
|
271
|
+
// Naming rules live as a `protected static namingRules` field on
|
|
272
|
+
// each concrete resource subclass, not on the public props bag.
|
|
273
|
+
// Read reflectively off `new.target` (the most-derived class being
|
|
274
|
+
// instantiated) — `this.constructor` would work too but TS forbids
|
|
275
|
+
// touching `this` before `super()`. Static inheritance falls back
|
|
276
|
+
// to `Resource`'s `undefined` default when a subclass omits the
|
|
277
|
+
// field (e.g. singleton children). `resolveResourceName` (called
|
|
278
|
+
// inside `ResourceDeclaration`) treats `undefined` as
|
|
279
|
+
// `MOST_RESTRICTIVE`.
|
|
280
|
+
new.target.namingRules
|
|
281
|
+
);
|
|
282
|
+
const proxy = (0, import_resource_proxy.createResourceProxy)(this);
|
|
283
|
+
this._selfProxy = proxy;
|
|
284
|
+
const idx = context.children.indexOf(this);
|
|
285
|
+
if (idx >= 0) context.children[idx] = proxy;
|
|
286
|
+
return proxy;
|
|
287
|
+
}
|
|
288
|
+
get self() {
|
|
289
|
+
return this._selfProxy ?? this;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* The Azure resource name as a Bicep symbolic-reference expression.
|
|
293
|
+
*
|
|
294
|
+
* The value is established at construction time (either user-supplied
|
|
295
|
+
* via `props.name` or filled in by the naming policy) and stored on
|
|
296
|
+
* `state.name`. The setter routes through `setProperty` so post-
|
|
297
|
+
* construction edits flow through the same proxy/expression machinery
|
|
298
|
+
* as any other property — useful when working with a base `Resource`
|
|
299
|
+
* reference and re-binding the name dynamically. Singleton subclasses
|
|
300
|
+
* override this getter to narrow the return type to the literal
|
|
301
|
+
* `Expression<"<singletonName>">`; non-singleton subclasses inherit
|
|
302
|
+
* this accessor pair as-is.
|
|
303
|
+
*/
|
|
304
|
+
get name() {
|
|
305
|
+
return this.expr("name");
|
|
306
|
+
}
|
|
307
|
+
set name(value) {
|
|
308
|
+
this.setProperty("name", value);
|
|
309
|
+
}
|
|
310
|
+
get id() {
|
|
311
|
+
return this.expr("id");
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
class Loop {
|
|
315
|
+
collection;
|
|
316
|
+
itemVariable;
|
|
317
|
+
item;
|
|
318
|
+
batchSize;
|
|
319
|
+
// The default name assigned to `indexVariable` on first materialization,
|
|
320
|
+
// if the caller neither passed `{ indexVariable }` nor accessed `.index`.
|
|
321
|
+
#defaultIndexVariable;
|
|
322
|
+
#indexVariable;
|
|
323
|
+
#indexExpr;
|
|
324
|
+
#indexRequested = false;
|
|
325
|
+
constructor(collection, options) {
|
|
326
|
+
this.collection = collection;
|
|
327
|
+
this.itemVariable = options?.itemVariable ?? "item";
|
|
328
|
+
this.#defaultIndexVariable = "i";
|
|
329
|
+
if (options?.indexVariable !== void 0) {
|
|
330
|
+
this.#indexVariable = options.indexVariable;
|
|
331
|
+
this.#indexRequested = true;
|
|
332
|
+
}
|
|
333
|
+
if (options?.batchSize !== void 0) {
|
|
334
|
+
this.batchSize = options.batchSize;
|
|
335
|
+
}
|
|
336
|
+
this.item = (0, import_expressions.wrapExpression)((0, import_ast_nodes.symbolicValueExpressionNode)(this.itemVariable));
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Name of the loop's index variable. Always defined — reading it
|
|
340
|
+
* materializes the default (`i`) if the caller neither passed
|
|
341
|
+
* `{ indexVariable }` nor accessed `.index` yet.
|
|
342
|
+
*
|
|
343
|
+
* Reading `.indexVariable` also marks the index as requested (same as
|
|
344
|
+
* reading `.index`), because a caller who wants the variable name is
|
|
345
|
+
* almost certainly going to use it. If the wire-omit optimization
|
|
346
|
+
* (bare `[for item in …]` with no index binding) matters, callers
|
|
347
|
+
* should gate on `.indexRequested` first before touching this getter.
|
|
348
|
+
*/
|
|
349
|
+
get indexVariable() {
|
|
350
|
+
this.#indexRequested = true;
|
|
351
|
+
if (this.#indexVariable === void 0) {
|
|
352
|
+
this.#indexVariable = this.#defaultIndexVariable;
|
|
353
|
+
}
|
|
354
|
+
return this.#indexVariable;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Expression referencing the current iteration's index. Reading this the
|
|
358
|
+
* first time marks the index as requested, which causes the wire to
|
|
359
|
+
* include `indexVariable` on the `for-expression` node and the renderer
|
|
360
|
+
* to emit `[for (item, i) in …]`. Callers who never touch `.index` get
|
|
361
|
+
* the cleaner index-less form.
|
|
362
|
+
*/
|
|
363
|
+
get index() {
|
|
364
|
+
this.#indexRequested = true;
|
|
365
|
+
if (this.#indexExpr === void 0) {
|
|
366
|
+
const name = this.indexVariable;
|
|
367
|
+
this.#indexExpr = (0, import_expressions.wrapExpression)((0, import_ast_nodes.symbolicValueExpressionNode)(name));
|
|
368
|
+
}
|
|
369
|
+
return this.#indexExpr;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Framework-internal signal used by `Resource.fromLoop` to decide
|
|
373
|
+
* whether the wire should include the index binding. `true` when the
|
|
374
|
+
* caller either supplied `{ indexVariable }` explicitly or has accessed
|
|
375
|
+
* `.index` / `.indexVariable` at least once. Not exported from
|
|
376
|
+
* `@azure/provisioning-core`.
|
|
377
|
+
*
|
|
378
|
+
* @internal
|
|
379
|
+
*/
|
|
380
|
+
get indexRequested() {
|
|
381
|
+
return this.#indexRequested;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
class LoopedResource extends ResourceDeclaration {
|
|
385
|
+
/**
|
|
386
|
+
* Cross-realm brand — same technique as the scalar `RESOURCE_BRAND`.
|
|
387
|
+
* Use {@link isLoopedResource} instead of `instanceof`
|
|
388
|
+
* when multiple copies of `@azure/provisioning-core` may be loaded.
|
|
389
|
+
*/
|
|
390
|
+
[import_resource_proxy.LOOPED_RESOURCE_BRAND] = true;
|
|
391
|
+
/** Metadata describing the loop that produced this declaration. */
|
|
392
|
+
loop;
|
|
393
|
+
#wrappedCtor;
|
|
394
|
+
constructor(context, wrappedCtor, userProps, loop, options) {
|
|
395
|
+
const props = wrappedCtor.buildResourceProps.call(wrappedCtor, userProps);
|
|
396
|
+
super(
|
|
397
|
+
context,
|
|
398
|
+
props,
|
|
399
|
+
options,
|
|
400
|
+
wrappedCtor.namingRules
|
|
401
|
+
);
|
|
402
|
+
this.#wrappedCtor = wrappedCtor;
|
|
403
|
+
this.loop = {
|
|
404
|
+
collection: loop.collection,
|
|
405
|
+
itemVariable: loop.itemVariable,
|
|
406
|
+
...loop.indexRequested ? { indexVariable: loop.indexVariable } : {},
|
|
407
|
+
...loop.batchSize !== void 0 ? { batchSize: loop.batchSize } : {}
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* The concrete `Resource` subclass this looped declaration wraps.
|
|
412
|
+
* Used by query machinery to answer "which subclass is this looped
|
|
413
|
+
* resource" — the analogue of `instanceof T` for `LoopedResource<T>`.
|
|
414
|
+
*
|
|
415
|
+
* This is always the full subclass the user constructed via
|
|
416
|
+
* `Xxx.fromLoop(...)` — query identity matches on that class, and it is
|
|
417
|
+
* the prototype the `.at(i)` proxy uses to resolve ARM accessors.
|
|
418
|
+
*/
|
|
419
|
+
get wrappedCtor() {
|
|
420
|
+
return this.#wrappedCtor;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Reference the element at `index`. Emits `sym[index].<...>` for
|
|
424
|
+
* subsequent property access.
|
|
425
|
+
*
|
|
426
|
+
* Returns the concrete resource type `T`. At runtime an indexed proxy is
|
|
427
|
+
* spliced over the full class prototype (`#wrappedCtor.prototype`):
|
|
428
|
+
* prototype getters that funnel through `this.expr(...)` (`.id`, `.name`,
|
|
429
|
+
* `.properties.*`, …) resolve rooted at `sym[index]`. A child created with
|
|
430
|
+
* `parent.at(i)` is stamped with that index for serialization.
|
|
431
|
+
*/
|
|
432
|
+
at(index) {
|
|
433
|
+
return (0, import_resource_proxy.createIndexedResourceProxy)(this, index);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
function createLoopedResource(wrappedCtor, loop, context, ...rest) {
|
|
437
|
+
const [userProps, options] = rest;
|
|
438
|
+
const LoopedCtor = LoopedResource;
|
|
439
|
+
return new LoopedCtor(
|
|
440
|
+
context,
|
|
441
|
+
wrappedCtor,
|
|
442
|
+
userProps,
|
|
443
|
+
loop,
|
|
444
|
+
options
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
448
|
+
0 && (module.exports = {
|
|
449
|
+
Loop,
|
|
450
|
+
LoopedResource,
|
|
451
|
+
Resource,
|
|
452
|
+
ResourceDeclaration,
|
|
453
|
+
createLoopedResource
|
|
454
|
+
});
|
|
455
|
+
//# sourceMappingURL=resource.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/constructs/resource/resource.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ProvisioningComponent } from \"../provisioning-component.js\";\nimport {\n createBinaryExpression,\n unwrapExpression,\n wrapExpression,\n type Expression,\n type ExpressionOrValue,\n} from \"../../expression/expressions.js\";\nimport type { ExpressionNode } from \"../../expression/ast-nodes.js\";\nimport { symbolicValueExpressionNode } from \"../../expression/ast-nodes.js\";\nimport type { PropertySegment } from \"../../types.js\";\nimport type { ResourceNamingRules } from \"../../naming/naming-rules.js\";\nimport { namingRequiredPolicy, resolveResourceName } from \"../../naming/naming-policy.js\";\nimport {\n RAW_RESOURCE_HANDLE,\n RESOURCE_BRAND,\n RESOURCE_DECLARATION_BRAND,\n LOOPED_RESOURCE_BRAND,\n PROXY_INDEX_REF,\n INDEXED_PROXY_TARGET,\n STATE_PARENT_INDEX,\n createIndexedResourceProxy,\n createResourceMemberProxy,\n createResourceProxy,\n normalizeAssignedValue,\n unwrapResourceHandle,\n} from \"./resource-proxy.js\";\nimport { isResourceDeclaration } from \"./resource-utils.js\";\nimport type { FlatModelShape } from \"../../shape/shape.js\";\nimport { getShape, registerShape as registerShapeInRegistry } from \"../../shape/shape-registry.js\";\nimport {\n registerResource as registerResourceInRegistry,\n type ResourceCtor,\n} from \"./resource-registry.js\";\nimport type { FlatVariantSelector } from \"./resource-type-registry.js\";\n\n// ---------------------------------------------------------------------------\n// Resource types\n// ---------------------------------------------------------------------------\n\n/**\n * A Bicep `scope:` expression. Used on `existing` resource references for\n * cross-RG / cross-subscription / cross-MG / cross-tenant lookups, and on\n * modules to set the nested deployment scope.\n *\n * Typed as `Expression<unknown>` because the natural producers are the\n * scope-function helpers in `fn` (`fn.resourceGroup(...)`,\n * `fn.subscription(...)`, `fn.managementGroup(...)`, `fn.tenant()`), all\n * of which return `Expression<TScope>` proxies. Narrowing further isn't\n * worthwhile today since the set of acceptable scope-producing\n * expressions isn't closed and Bicep validates the actual call shape\n * downstream.\n */\n// TODO: further narrow to allowed expression if possible?\nexport type ScopeExpression = Expression<unknown>;\n\n/**\n * Internal representation used to construct resource handle objects.\n * The proxy converts these into the public Resource shape.\n */\nexport interface ResourceState<TType extends string = string> {\n name: ExpressionOrValue<string>;\n readonly type: TType;\n readonly apiVersion: string;\n readonly existing?: boolean | undefined;\n /**\n * Optional Bicep `scope:` expression. Currently emitted only on `existing`\n * resource references (e.g. `scope: resourceGroup('shared')` for a\n * cross-RG lookup). Future scope-hoisted resource types may emit it on\n * deployable resources too \u2014 for example, deploying a\n * `Microsoft.Management/managementGroups` from a subscription-targeted\n * file requires `scope: tenant()`. See `contributing/bicep/bicep-scope.md` section 2.2.\n *\n * For ordinary deployable resources this field is `undefined` \u2014 their\n * deployment scope is determined by the file's `targetScope` (or by the\n * containing `ResourceGroup` / module the resource lives in).\n *\n * Stored as a raw `ExpressionNode` (the user-facing `ScopeExpression`\n * proxy is unwrapped at the constructor boundary, matching the\n * \"`state` holds normalized raw nodes\" invariant that\n * `normalizeAssignedValue` maintains for every other field).\n */\n readonly scope?: ExpressionNode | undefined;\n readonly condition?: ExpressionOrValue<boolean> | undefined;\n}\n\n/**\n * Public-facing props for a reference to an existing (pre-deployed) Azure\n * resource. This is strictly narrower than the deployable resource props \u2014\n * Bicep `existing` declarations only accept `name` and optional `scope:`.\n *\n * Read-side access on the returned resource handle is unrestricted \u2014\n * `kv.properties.vaultUri`, `sa.id`, etc. all work and compile to symbolic\n * references that ARM resolves at deployment time.\n *\n * Symbolic parent/extension scopes are expressed by passing the parent\n * resource as the ProvisioningComponent `context` argument to the resource constructor\n * (with `{ existing: true }`), not via this `scope` field.\n */\nexport interface ExistingResourceProps {\n /** Required. The actual Azure name of the existing resource. */\n readonly name: ExpressionOrValue<string>;\n\n /**\n * Optional. The scope at which to look up the resource. Used when the\n * resource lives outside the current deployment's scope (different RG,\n * subscription, management group, or tenant).\n *\n * Pass a scope-function call expression (e.g. `resourceGroup(\"name\")`,\n * `subscription()`, `managementGroup(\"mg\")`, `tenant()`).\n */\n readonly scope?: ScopeExpression;\n}\n\n/**\n * `ExistingResourceProps` for singleton child resources \u2014 `name` is omitted\n * because singleton children have a fixed name (e.g. `\"default\"`).\n */\nexport type SingletonExistingResourceProps = Omit<ExistingResourceProps, \"name\">;\n\n/**\n * Internal props accepted by the base `Resource` constructor. A loose\n * superset of both the deployable and existing public shapes \u2014 the runtime\n * constructor branches on `props.existing` to decide which fields are\n * honored. Generated CDK resource classes expose a discriminated union\n * `(Deployable & { existing?: false }) | (Existing & { existing: true })`;\n * passing `{ ...existingProps, existing: true }` selects the existing arm and\n * emits a Bicep `existing` reference instead of a new declaration.\n */\nexport interface ResourceProps<TType extends string> {\n readonly name?: ExpressionOrValue<string> | undefined;\n readonly apiVersion: string;\n readonly type: TType;\n\n readonly existing?: boolean;\n\n /**\n * Optional Bicep `scope:` value for an existing resource reference.\n * Only honored when `existing === true`. Ignored on deployable resources\n * (non-existing resources have no per-resource scope in Bicep).\n */\n readonly scope?: ScopeExpression;\n}\n\n/**\n * Optional third-argument bag passed to every resource constructor. Holds\n * authoring flags that affect how the resource declaration is emitted but are\n * not ARM-modeled properties of the resource body.\n *\n * Fields:\n * - `condition` \u2014 an `if(...)` guard on the declaration. A boolean\n * expression (typically produced by `fn.eq`, `fn.and`, etc.) or a\n * plain `boolean`. Bind it to a `const` to reuse the same predicate\n * across multiple resources.\n *\n * `existing` is deliberately **not** an option \u2014 it is the discriminant of\n * the generated props union (`{ existing?: false } | { existing: true }`)\n * and lives on `props`. Routing it through options too would allow\n * contradictory settings between the two channels.\n *\n * `namingRules` is deliberately **not** an option either \u2014 it is\n * per-resource-type metadata declared as a `protected static namingRules`\n * field on each concrete `Resource` subclass and consumed by the base\n * constructor reflectively, so it stays off the user-facing surface.\n *\n */\nexport interface ResourceOptions {\n readonly condition?: ExpressionOrValue<boolean>;\n readonly dependsOn?: readonly ResourceDeclaration[];\n}\n\n/**\n * Shared base for resource declaration implementations.\n *\n * @remarks\n *\n * Both represent one Bicep resource declaration in the component tree and\n * share the same declaration-level state layout: identity fields\n * (`type`, `apiVersion`, `existing`), the `if(...)` guard (`condition`),\n * the optional cross-scope reference (`scope`), and the raw prop bag that\n * becomes the resource body.\n *\n * This class owns the common declaration state layout, raw-handle escape\n * hatch, and identity accessors. Subclasses supply their construction and\n * access behavior.\n */\nexport abstract class ResourceDeclaration<\n TType extends string = string,\n> extends ProvisioningComponent {\n /**\n * Brand marker for cross-realm `isResourceDeclaration()` checks. Uses\n * `Symbol.for` so it survives multiple copies of `@azure/provisioning-core`.\n * Inherited by every resource declaration implementation.\n */\n readonly [RESOURCE_DECLARATION_BRAND] = true as const;\n\n // Not `readonly`: the ctor writes `this.state = data` once. TypeScript\n // forbids subclass writes to a `readonly` parent field, so the\n // immutability is a runtime contract (never reassigned after ctor)\n // rather than a static one.\n protected state!: ResourceState<TType> & Record<string, unknown>;\n\n /**\n * Base constructor for every Bicep resource declaration.\n *\n * @remarks\n *\n * Responsibilities:\n * 1. Register in the component tree (`super(context)`).\n * 2. Enforce a deployment context ancestor.\n * 3. Unwrap `context` if it's an indexed proxy from `.at(i)` /\n * `parent.at(loop.index)`, and stash `parentIndex` on `state` so the\n * serializer can emit `parent: parentSym[index]` on the child.\n * 4. Inherit `condition` from the immediate parent resource\n * declaration when the caller doesn't supply one (Bicep requires\n * children of a conditional resource to share the same guard).\n * 5. Populate `state` \u2014 existing arm records only identity fields;\n * deployable arm runs the naming policy and applies\n * `DeploymentContext` defaults for `location` / `tags` per the\n * shape descriptor.\n *\n * Subclasses supply the last mile, including their public handle behavior.\n *\n * @param namingRules - per-resource-type constraints for the naming\n * policy. `Resource` reads this reflectively off the concrete subclass\n * constructor; internal declaration implementations receive it from\n * the concrete resource constructor they represent.\n */\n constructor(\n context: ProvisioningComponent,\n props: ResourceProps<TType> & Record<string, unknown>,\n options?: ResourceOptions,\n namingRules?: ResourceNamingRules,\n ) {\n super(context);\n\n if (!this.hasDeploymentContext()) {\n throw new Error(\"Resource declaration must have a parent deployment context.\");\n }\n\n // If `context` is an indexed proxy returned by\n // `LoopedResource.at(i)`, unwrap `this.parent`\n // back to the raw parent so tree walks and symbol-map lookups continue\n // to work, and capture the index so the serializer can emit\n // `parent: parentSym[index]` on this child. The `ProvisioningComponent` constructor\n // already pushed `this` into the correct children array (indexed proxy\n // passes `.children` through to the raw parent's array), so nothing to\n // fix up there.\n //\n // The index is recorded on the child's state (not the parent's) because\n // siblings can have different indices \u2014 `new Child(p.at(0), \u2026)` and\n // `new Child(p.at(1), \u2026)` both resolve `.parent` to the same raw parent,\n // so the index that distinguishes them must be per-child.\n const indexRef = (context as unknown as Record<symbol, unknown>)[PROXY_INDEX_REF];\n let parentIndex: unknown = undefined;\n if (indexRef !== undefined) {\n const rawParent = (context as unknown as Record<symbol, unknown>)[INDEXED_PROXY_TARGET] as\n ProvisioningComponent | undefined;\n if (rawParent !== undefined) {\n (this as unknown as { parent: ProvisioningComponent | undefined }).parent = rawParent;\n }\n parentIndex = indexRef;\n }\n\n // `existing` lives on `props` (it's the discriminant of the generated\n // `{ existing?: false } | { existing: true }` union). `condition` is\n // routed through `options`.\n //\n // Bicep requires a child of a conditional resource to itself be\n // conditional on the same expression. When no explicit `condition` is\n // supplied, inherit the immediate parent resource declaration's\n // condition so the emitted template stays valid \u2014 child authoring\n // shouldn't have to redundantly restate the parent's guard.\n const isExisting = props.existing === true;\n const parent = this.parent;\n const inheritedCondition = isResourceDeclaration(parent)\n ? (parent.self as unknown as { state: Record<string, unknown> }).state[\"condition\"]\n : undefined;\n const explicitCondition = options?.condition;\n const condition =\n explicitCondition !== undefined && inheritedCondition !== undefined\n ? createBinaryExpression<boolean>(\"&&\", inheritedCondition, explicitCondition)\n : (explicitCondition ?? (inheritedCondition as ExpressionOrValue<boolean> | undefined));\n const dependsOn = options?.dependsOn;\n\n let data: ResourceState<TType> & Record<string, unknown>;\n if (isExisting) {\n // Existing arm: only name + optional scope land in state. Any other\n // keys on the props object are ignored \u2014 the deserialize path may pass\n // them through, but they're never emitted on an `existing` resource.\n if (props.name === undefined) {\n throw new Error(`Resource ${props.type} marked as 'existing' but no 'name' was provided.`);\n }\n data = {\n name: props.name,\n type: props.type,\n apiVersion: props.apiVersion,\n existing: true,\n scope: props.scope === undefined ? undefined : unwrapExpression(props.scope),\n condition,\n dependsOn,\n };\n if (parentIndex !== undefined) {\n data[STATE_PARENT_INDEX] = parentIndex;\n }\n } else {\n // Deployable arm: name flows through the naming policy; the keys\n // handled explicitly here are stripped from the props bag, and\n // every remaining key is copied verbatim into state as a user-\n // authored property.\n const {\n name: _name,\n type: _type,\n apiVersion: _apiVersion,\n existing: _existing,\n scope: _scope,\n ...userProps\n } = props as ResourceProps<TType> & Record<string, unknown>;\n const ctx = this.deploymentContext;\n data = {\n name: resolveResourceName(\n ctx.namingPolicy ?? namingRequiredPolicy,\n props.name,\n props.type,\n namingRules,\n ),\n type: props.type,\n apiVersion: props.apiVersion,\n condition,\n dependsOn,\n ...userProps,\n };\n\n if (parentIndex !== undefined) {\n data[STATE_PARENT_INDEX] = parentIndex;\n }\n\n // Apply DeploymentContext defaults for `location` and `tags`, gated\n // on the shape descriptor declaring those properties as writable.\n // The TypeSpec model is the source of truth: a field marked\n // readonly in the ARM contract (e.g. `location` on most child\n // resources) is server-set, so propagating an inherited value\n // would produce an invalid PUT body. Both fields are user-wins:\n // if the user supplied a value, the inherited value is ignored\n // entirely (no merge for tags either \u2014 explicit user tags fully\n // replace inherited tags).\n const shape = getShape(props.type, props.apiVersion, data);\n if (shape !== undefined) {\n const locationShape = shape.byJsName[\"location\"];\n if (\n locationShape !== undefined &&\n locationShape.readOnly !== true &&\n data[\"location\"] === undefined &&\n ctx.location !== undefined\n ) {\n data[\"location\"] = ctx.location;\n }\n const tagsShape = shape.byJsName[\"tags\"];\n if (\n tagsShape !== undefined &&\n tagsShape.readOnly !== true &&\n data[\"tags\"] === undefined &&\n ctx.tags !== undefined &&\n Object.keys(ctx.tags).length > 0\n ) {\n data[\"tags\"] = { ...ctx.tags };\n }\n }\n }\n\n this.state = data;\n }\n\n /**\n * Core-internal escape hatch: exposes the raw `state` backing object to\n * the proxy layer (`resource-proxy.ts`) so it can read/unwrap the\n * declaration's data across module boundaries. Keyed by the\n * module-scoped {@link RAW_RESOURCE_HANDLE} symbol, which is **not**\n * exported from `@azure/provisioning-core`, so package consumers can't name it.\n *\n * `protected` (not `private`) because the accessors that read it use\n * `Reflect.get` / structural casts that bypass TS visibility anyway;\n * the modifier just keeps it off the public type surface. It can't be a\n * `#private` field because the proxy layer lives in a different class.\n *\n * @internal\n */\n protected get [RAW_RESOURCE_HANDLE](): ResourceState<TType> & Record<string, unknown> {\n return this.state;\n }\n\n get type(): TType {\n return this.state.type;\n }\n\n get apiVersion(): string {\n return this.state.apiVersion;\n }\n\n get existing(): boolean | undefined {\n return this.state.existing;\n }\n\n get condition(): ExpressionOrValue<boolean> | undefined {\n return this.state.condition;\n }\n\n get dependsOn(): readonly ResourceDeclaration[] | undefined {\n return this.state.dependsOn as readonly ResourceDeclaration[] | undefined;\n }\n\n protected expr<TValue>(...path: readonly PropertySegment[]): Expression<TValue> & TValue {\n return createResourceMemberProxy(\n {\n resource: this as unknown as Resource,\n root: unwrapResourceHandle(this as unknown as Resource) as unknown as Record<\n string,\n unknown\n >,\n },\n path,\n );\n }\n\n protected setProperty(key: string, value: unknown): void {\n this.state[key] = normalizeAssignedValue(value, this as unknown as Resource);\n }\n}\n\n/**\n * Base class for all Azure resources.\n *\n * @remarks\n * Resources are fully initialized at construction time. Pass a parent\n * `ProvisioningComponent` (typically a `Stack` or `ResourceGroup`) as the first\n * argument \u2014 the resource registers itself in the tree automatically.\n *\n * Properties use expression-backed proxies: reading `resource.name`\n * returns an `Expression` that compiles to a Bicep symbolic reference,\n * not a plain string. Use `this.expr()` in subclasses to create\n * property getters and `this.setProperty()` for setters.\n *\n * @example\n * ```typescript snippet:ignore\n * import { ResourceGroup, Stack } from \"@azure/provisioning-core\";\n * import { KeyVault } from \"@azure/provisioning-keyvault\";\n *\n * const stack = new Stack(\"my-app\", { targetScope: \"subscription\" });\n * const rg = new ResourceGroup(stack, { name: \"rg-my-app\", location: \"eastus\" });\n * const vault = new KeyVault(rg, {\n * name: \"kv-my-app\",\n * properties: {\n * tenantId: \"11111111-1111-1111-1111-111111111111\",\n * sku: { family: \"A\", name: \"standard\" },\n * },\n * });\n *\n * // vault.name is an Expression, not a string\n * // vault.id compiles to resourceId(...)\n * ```\n */\nexport class Resource<TType extends string = string> extends ResourceDeclaration<TType> {\n /**\n * Brand marker for cross-realm `isResource()` checks.\n * Uses `Symbol.for` so it survives multiple copies of `@azure/provisioning-core`.\n */\n readonly [RESOURCE_BRAND] = true as const;\n\n /**\n * Register a {@link FlatModelShape} for this resource class's\n * `(resourceType, apiVersion)` pair. Intended to be invoked from a\n * `static {}` initializer in generated subclasses so the registration\n * happens at module load.\n *\n * The static method reads `resourceType` and `apiVersion` off `this`\n * (the subclass that called it), so callers don't repeat the literals.\n */\n static registerShape(\n this: { readonly resourceType: string; readonly apiVersion: string },\n shape: FlatModelShape,\n variantSelector?: FlatVariantSelector,\n ): void {\n registerShapeInRegistry(this.resourceType, this.apiVersion, shape, variantSelector);\n }\n\n /**\n * Register this class with the global resource registry so the\n * deserializer can reconstruct instances of it (instead of falling\n * back to base `Resource`) for matching `(resourceType, apiVersion)`\n * pairs. Intended to be invoked from a `static {}` initializer in\n * generated classes alongside {@link Resource.registerShape}.\n *\n * Pass an ordered discriminator path for concrete resource variants. A\n * singleton is one segment (`name=signin`); model-discriminated resources\n * may use `kind` or several nested segments. Omit for ordinary resources.\n */\n protected static register(this: ResourceCtor, variantSelector?: FlatVariantSelector): void {\n registerResourceInRegistry(this, variantSelector);\n }\n\n /**\n * Assemble the base-`Resource` constructor payload (the second `super(...)`\n * argument) from the user-facing props. This is a **static \"virtual\"**:\n * it runs before an instance exists (to compute the `super` argument), so\n * it can't be an instance method \u2014 but it still dispatches through the\n * calling constructor, so a subclass's override wins.\n *\n * Every emitter-generated resource overrides this to inject its fixed\n * identity (`type` / `apiVersion`), the singleton `name`, and its explicit\n * writable-field copy. Both ordinary construction and internal resource\n * reconstruction funnel through this method so prop shaping remains\n * consistent.\n *\n * This base default is the fallback used when the wrapped constructor is\n * base `Resource` itself \u2014 the deserialize path for an unregistered\n * `(type, apiVersion)` pair, where `type` / `apiVersion` are threaded in\n * through `props` rather than read off statics. Keeping the default here\n * guarantees the method is always present for internal reconstruction.\n */\n protected static buildResourceProps(\n props?: unknown,\n ): ResourceProps<string> & Record<string, unknown> {\n const p = (props as Record<string, unknown> | undefined) ?? {};\n return {\n ...p,\n type:\n (p[\"type\"] as string | undefined) ??\n (this as unknown as { resourceType?: string }).resourceType,\n apiVersion:\n (p[\"apiVersion\"] as string | undefined) ??\n (this as unknown as { apiVersion?: string }).apiVersion,\n } as ResourceProps<string> & Record<string, unknown>;\n }\n\n /**\n * Per-resource-type naming constraints, consumed by the active\n * {@link NamingPolicy} when a resource is created without an explicit\n * `name`. Generated CDK subclasses override this with a concrete value;\n * the base default of `undefined` yields `MOST_RESTRICTIVE` behavior.\n *\n * This is type metadata, not user input, so it is kept off the public\n * props surface and read reflectively in the constructor via\n * `this.constructor` rather than being threaded through `ResourceProps`.\n */\n protected static namingRules?: ResourceNamingRules;\n\n protected _selfProxy: this | undefined;\n\n constructor(\n context: ProvisioningComponent,\n props: ResourceProps<TType> & Record<string, unknown>,\n options?: ResourceOptions,\n ) {\n super(\n context,\n props,\n options,\n // Naming rules live as a `protected static namingRules` field on\n // each concrete resource subclass, not on the public props bag.\n // Read reflectively off `new.target` (the most-derived class being\n // instantiated) \u2014 `this.constructor` would work too but TS forbids\n // touching `this` before `super()`. Static inheritance falls back\n // to `Resource`'s `undefined` default when a subclass omits the\n // field (e.g. singleton children). `resolveResourceName` (called\n // inside `ResourceDeclaration`) treats `undefined` as\n // `MOST_RESTRICTIVE`.\n (new.target as typeof Resource).namingRules,\n );\n\n const proxy = createResourceProxy(this as this & Resource<TType>);\n this._selfProxy = proxy;\n\n // Tricky part for the proxy implementation:\n // ProvisioningComponent constructor pushed `this` (bare instance) into parent.children\n // before the proxy existed. Swap it for the proxy so external consumers\n // see proxy-backed handles (with property access, etc.) when iterating.\n const idx = context.children.indexOf(this);\n if (idx >= 0) context.children[idx] = proxy;\n\n return proxy;\n }\n\n override get self(): this {\n return this._selfProxy ?? this;\n }\n\n /**\n * The Azure resource name as a Bicep symbolic-reference expression.\n *\n * The value is established at construction time (either user-supplied\n * via `props.name` or filled in by the naming policy) and stored on\n * `state.name`. The setter routes through `setProperty` so post-\n * construction edits flow through the same proxy/expression machinery\n * as any other property \u2014 useful when working with a base `Resource`\n * reference and re-binding the name dynamically. Singleton subclasses\n * override this getter to narrow the return type to the literal\n * `Expression<\"<singletonName>\">`; non-singleton subclasses inherit\n * this accessor pair as-is.\n */\n get name(): Expression<string> {\n return this.expr(\"name\");\n }\n set name(value: ExpressionOrValue<string>) {\n this.setProperty(\"name\", value);\n }\n\n get id(): Expression<string> {\n return this.expr(\"id\");\n }\n}\n\n// ---------------------------------------------------------------------------\n// Loop\n// ---------------------------------------------------------------------------\n\n/**\n * Metadata describing a Bicep `[for \u2026 in \u2026]` loop and the concrete\n * variable names used inside it. Stored publicly on {@link LoopedResource.loop}\n * once a looped resource declaration has been created.\n */\nexport interface LoopContext {\n readonly collection: unknown;\n readonly itemVariable: string;\n readonly indexVariable?: string;\n readonly batchSize?: number;\n}\n\n/**\n * Options accepted by `new Loop(collection, options?)`. All fields are\n * optional overrides; the constructor supplies defaults. Derived from\n * {@link LoopContext} so there is exactly one source of truth for the\n * shape of loop metadata.\n */\nexport type LoopOptions = Partial<Omit<LoopContext, \"collection\">>;\n\n/**\n * Describes a Bicep `[for item in collection: ...]` loop as a plain data\n * object. Construct one and pass it to\n * `Ctor.fromLoop(loop, context, props, options?)` (e.g.\n * `StorageAccount.fromLoop(...)`) to expand a resource declaration into a\n * resource-copy loop.\n *\n * The item and index variable names default to `item` / `i`. Bicep\n * for-expressions bind their loop variables only within their own body,\n * so two sibling `[for item in xs: \u2026]` / `[for item in ys: \u2026]` in the\n * same file do **not** collide \u2014 each `item` is scoped to its own\n * expression. If you nest a `Loop` inside another loop's body (rare),\n * pass `{ itemVariable, indexVariable }` explicitly on the inner one to\n * disambiguate. `batchSize` on the loop renders as `@batchSize(n)` on\n * the resource that consumes it.\n *\n * The `indexVariable` name is always materialized on read (never\n * `undefined`), but whether the wire actually **records** it \u2014 and\n * therefore whether the renderer emits the `[for (item, i) in \u2026]` tuple\n * binding \u2014 is decided by whether anyone accessed `loop.index` (or the\n * caller supplied `{ indexVariable }` explicitly). A loop whose body\n * never mentions an index emits a bare `[for item in xs: \u2026]`.\n *\n * `Loop` instances are pure data \u2014 creating one has no side effect.\n */\nexport class Loop<T> {\n readonly collection: ExpressionOrValue<T[]>;\n readonly itemVariable: string;\n readonly item: Expression<T>;\n readonly batchSize?: number;\n\n // The default name assigned to `indexVariable` on first materialization,\n // if the caller neither passed `{ indexVariable }` nor accessed `.index`.\n readonly #defaultIndexVariable: string;\n #indexVariable: string | undefined;\n #indexExpr: Expression<number> | undefined;\n #indexRequested = false;\n\n constructor(collection: ExpressionOrValue<T[]>, options?: LoopOptions) {\n this.collection = collection;\n\n this.itemVariable = options?.itemVariable ?? \"item\";\n this.#defaultIndexVariable = \"i\";\n\n if (options?.indexVariable !== undefined) {\n // Explicit option counts as a request \u2014 the wire and renderer must\n // honor the caller's chosen name whether or not they read `.index`.\n this.#indexVariable = options.indexVariable;\n this.#indexRequested = true;\n }\n if (options?.batchSize !== undefined) {\n this.batchSize = options.batchSize;\n }\n\n this.item = wrapExpression(symbolicValueExpressionNode(this.itemVariable)) as Expression<T>;\n }\n\n /**\n * Name of the loop's index variable. Always defined \u2014 reading it\n * materializes the default (`i`) if the caller neither passed\n * `{ indexVariable }` nor accessed `.index` yet.\n *\n * Reading `.indexVariable` also marks the index as requested (same as\n * reading `.index`), because a caller who wants the variable name is\n * almost certainly going to use it. If the wire-omit optimization\n * (bare `[for item in \u2026]` with no index binding) matters, callers\n * should gate on `.indexRequested` first before touching this getter.\n */\n get indexVariable(): string {\n this.#indexRequested = true;\n if (this.#indexVariable === undefined) {\n this.#indexVariable = this.#defaultIndexVariable;\n }\n return this.#indexVariable;\n }\n\n /**\n * Expression referencing the current iteration's index. Reading this the\n * first time marks the index as requested, which causes the wire to\n * include `indexVariable` on the `for-expression` node and the renderer\n * to emit `[for (item, i) in \u2026]`. Callers who never touch `.index` get\n * the cleaner index-less form.\n */\n get index(): Expression<number> {\n this.#indexRequested = true;\n if (this.#indexExpr === undefined) {\n const name = this.indexVariable;\n this.#indexExpr = wrapExpression(symbolicValueExpressionNode(name)) as Expression<number>;\n }\n return this.#indexExpr;\n }\n\n /**\n * Framework-internal signal used by `Resource.fromLoop` to decide\n * whether the wire should include the index binding. `true` when the\n * caller either supplied `{ indexVariable }` explicitly or has accessed\n * `.index` / `.indexVariable` at least once. Not exported from\n * `@azure/provisioning-core`.\n *\n * @internal\n */\n get indexRequested(): boolean {\n return this.#indexRequested;\n }\n}\n\n// ---------------------------------------------------------------------------\n// LoopedResource<T> \u2014 a Bicep for-expanded resource declaration as a real\n// ProvisioningComponent in the tree, sitting alongside scalar `Resource` under the same\n// `ResourceDeclaration` base.\n// ---------------------------------------------------------------------------\n\n/**\n * A `LoopedResource<T>` represents a single Bicep resource declaration\n * expanded across a loop (`[for x in xs: {...}]`). It is a real\n * `ProvisioningComponent` in the tree \u2014 one node per emitted declaration \u2014 and\n * exposes indexed access into individual iterations via\n * {@link LoopedResource.at}.\n *\n * @remarks\n *\n * Property access on a `LoopedResource` is deliberately not exposed at\n * the type level: pick an index (`at`) to obtain a proxy that emits\n * `sym[i].prop`. This mirrors Bicep's requirement that individual\n * iterations be accessed by index.\n *\n * `.at(i)` returns the concrete resource type `T`. The returned proxy\n * exposes the essential ARM surface \u2014 the property getters/setters that\n * funnel through `this.expr(...)` (`.id`, `.name`, `.sku`,\n * `.properties.*`, \u2026) rooted at `sym[i]` \u2014 as well as the child\n * accessors (`keyVault.secrets`, singleton getter/setters), which are\n * derived from the parent's `children` scoped to element `i`. To attach\n * per-iteration children, parent them to `parent.at(loop.index)` \u2014 e.g.\n * `Child.fromLoop(loop, parent.at(loop.index), ...)`.\n *\n * Projection over the loop (Bicep `map(sym, x => body)`) is tracked as\n * a follow-up effort \u2014 see the \"lambda + fn.map\" issue.\n */\nexport class LoopedResource<T extends Resource = Resource> extends ResourceDeclaration<T[\"type\"]> {\n /**\n * Cross-realm brand \u2014 same technique as the scalar `RESOURCE_BRAND`.\n * Use {@link isLoopedResource} instead of `instanceof`\n * when multiple copies of `@azure/provisioning-core` may be loaded.\n */\n readonly [LOOPED_RESOURCE_BRAND] = true as const;\n\n /** Metadata describing the loop that produced this declaration. */\n readonly loop: LoopContext;\n\n readonly #wrappedCtor: new (\n context: ProvisioningComponent,\n props: unknown,\n options?: ResourceOptions,\n ) => T;\n\n private constructor(\n context: ProvisioningComponent,\n wrappedCtor: new (\n context: ProvisioningComponent,\n props: unknown,\n options?: ResourceOptions,\n ) => T,\n userProps: unknown,\n loop: Loop<unknown>,\n options?: ResourceOptions,\n ) {\n // The subclass constructor never runs for a looped row \u2014 only this\n // shared `ResourceDeclaration` ctor does. To keep the scalar and\n // looped construction paths from drifting, shape the props bag through\n // the SAME static the scalar ctor uses: every `Resource` (sub)class\n // inherits or overrides `buildResourceProps`, which returns the exact\n // `super()` payload the scalar ctor passes \u2014 including the fixed `name`\n // for singletons and any other prop shaping. (This is what fixes looped\n // singletons losing their fixed `name`.)\n //\n // It is always present: base `Resource` \u2014 the deserialize fallback ctor\n // for an unregistered `(type, apiVersion)` pair \u2014 supplies a default\n // that threads `type` / `apiVersion` in from `userProps`. So there's no\n // existence branch here.\n const props = (\n wrappedCtor as unknown as {\n buildResourceProps: (props: unknown) => ResourceProps<T[\"type\"]> & Record<string, unknown>;\n }\n ).buildResourceProps.call(wrappedCtor, userProps);\n super(\n context,\n props,\n options,\n (wrappedCtor as unknown as { namingRules?: ResourceNamingRules }).namingRules,\n );\n this.#wrappedCtor = wrappedCtor;\n // Snapshot the loop metadata at declaration time. `indexVariable` is\n // recorded only if the index was requested by now \u2014 either the caller\n // supplied `{ indexVariable }` or read `loop.index` / `loop.indexVariable`\n // before this declaration. Reading `loop.index` (e.g. via\n // `parent.at(loop.index)`) marks the live loop so descendant\n // declarations (which snapshot the same loop afterwards) pick up the\n // binding, while this declaration's own for-expression stays index-less.\n this.loop = {\n collection: loop.collection,\n itemVariable: loop.itemVariable,\n ...(loop.indexRequested ? { indexVariable: loop.indexVariable } : {}),\n ...(loop.batchSize !== undefined ? { batchSize: loop.batchSize } : {}),\n };\n }\n\n /**\n * The concrete `Resource` subclass this looped declaration wraps.\n * Used by query machinery to answer \"which subclass is this looped\n * resource\" \u2014 the analogue of `instanceof T` for `LoopedResource<T>`.\n *\n * This is always the full subclass the user constructed via\n * `Xxx.fromLoop(...)` \u2014 query identity matches on that class, and it is\n * the prototype the `.at(i)` proxy uses to resolve ARM accessors.\n */\n get wrappedCtor(): new (\n context: ProvisioningComponent,\n props: unknown,\n options?: ResourceOptions,\n ) => T {\n return this.#wrappedCtor;\n }\n\n /**\n * Reference the element at `index`. Emits `sym[index].<...>` for\n * subsequent property access.\n *\n * Returns the concrete resource type `T`. At runtime an indexed proxy is\n * spliced over the full class prototype (`#wrappedCtor.prototype`):\n * prototype getters that funnel through `this.expr(...)` (`.id`, `.name`,\n * `.properties.*`, \u2026) resolve rooted at `sym[index]`. A child created with\n * `parent.at(i)` is stamped with that index for serialization.\n */\n at(index: ExpressionOrValue<number>): T {\n // `this` is a `ResourceDeclaration`; the handle derives the subclass\n // prototype from `this.wrappedCtor`. The explicit type argument pins\n // the return type, which TypeScript can't otherwise resolve from the\n // deferred polymorphic `this`.\n return createIndexedResourceProxy<LoopedResource<T>>(this, index);\n }\n}\n\n/** @internal */\nexport function createLoopedResource<T extends Resource, C extends ProvisioningComponent, P, Item>(\n wrappedCtor: new (context: C, props: P, options?: ResourceOptions) => T,\n loop: Loop<Item>,\n context: C,\n ...rest: undefined extends P\n ? [props?: P, options?: ResourceOptions]\n : [props: P, options?: ResourceOptions]\n): LoopedResource<T> {\n const [userProps, options] = rest as [P?, ResourceOptions?];\n // `LoopedResource`'s ctor is private; access via cast because this module\n // owns both the declaration and its internal construction boundary.\n const LoopedCtor = LoopedResource as unknown as new <U extends Resource>(\n context: ProvisioningComponent,\n wrappedCtor: new (\n context: ProvisioningComponent,\n props: unknown,\n options?: ResourceOptions,\n ) => U,\n userProps: unknown,\n loop: Loop<unknown>,\n options?: ResourceOptions,\n ) => LoopedResource<U>;\n return new LoopedCtor(\n context,\n wrappedCtor as new (\n context: ProvisioningComponent,\n props: unknown,\n options?: ResourceOptions,\n ) => T,\n userProps,\n loop,\n options,\n );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,oCAAsC;AACtC,yBAMO;AAEP,uBAA4C;AAG5C,2BAA0D;AAC1D,4BAaO;AACP,4BAAsC;AAEtC,4BAAmE;AACnE,+BAGO;AAyJA,MAAe,4BAEZ,oDAAsB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,CAAU,gDAA0B,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4BV,YACE,SACA,OACA,SACA,aACA;AACA,UAAM,OAAO;AAEb,QAAI,CAAC,KAAK,qBAAqB,GAAG;AAChC,YAAM,IAAI,MAAM,6DAA6D;AAAA,IAC/E;AAeA,UAAM,WAAY,QAA+C,qCAAe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