@azure/provisioning-core 1.0.0-beta.1 → 1.0.0-beta.2
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 +6 -0
- package/README.md +49 -10
- package/dist/browser/constructs/built-in-resources/resource-group.d.ts +7 -1
- package/dist/browser/constructs/built-in-resources/resource-group.d.ts.map +1 -1
- package/dist/browser/constructs/built-in-resources/resource-group.js +26 -6
- package/dist/browser/constructs/built-in-resources/resource-group.js.map +1 -1
- package/dist/browser/constructs/output.d.ts +1 -1
- package/dist/browser/constructs/output.d.ts.map +1 -1
- package/dist/browser/constructs/output.js.map +1 -1
- package/dist/browser/constructs/parameter.d.ts +1 -1
- package/dist/browser/constructs/parameter.d.ts.map +1 -1
- package/dist/browser/constructs/parameter.js.map +1 -1
- package/dist/browser/constructs/resource/resource-query.d.ts +3 -1
- package/dist/browser/constructs/resource/resource-query.d.ts.map +1 -1
- package/dist/browser/constructs/resource/resource-query.js +10 -0
- package/dist/browser/constructs/resource/resource-query.js.map +1 -1
- package/dist/browser/constructs/resource/resource-relationships.d.ts +9 -0
- package/dist/browser/constructs/resource/resource-relationships.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-relationships.js +35 -0
- package/dist/browser/constructs/resource/resource-relationships.js.map +1 -0
- package/dist/browser/constructs/resource/resource.d.ts +11 -17
- package/dist/browser/constructs/resource/resource.d.ts.map +1 -1
- package/dist/browser/constructs/resource/resource.js +70 -28
- package/dist/browser/constructs/resource/resource.js.map +1 -1
- package/dist/browser/constructs/stack.d.ts +2 -16
- package/dist/browser/constructs/stack.d.ts.map +1 -1
- package/dist/browser/constructs/stack.js +1 -15
- package/dist/browser/constructs/stack.js.map +1 -1
- package/dist/browser/expression/ast-nodes.d.ts +1 -1
- package/dist/browser/expression/ast-nodes.d.ts.map +1 -1
- package/dist/browser/expression/ast-nodes.js.map +1 -1
- package/dist/browser/expression/expressions.d.ts +2 -9
- package/dist/browser/expression/expressions.d.ts.map +1 -1
- package/dist/browser/expression/expressions.js +2 -9
- package/dist/browser/expression/expressions.js.map +1 -1
- package/dist/browser/expression/utils.d.ts +5 -0
- package/dist/browser/expression/utils.d.ts.map +1 -0
- package/dist/browser/expression/utils.js +25 -0
- package/dist/browser/expression/utils.js.map +1 -0
- package/dist/browser/index.d.ts +4 -4
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/internal.d.ts +2 -5
- package/dist/browser/internal.d.ts.map +1 -1
- package/dist/browser/internal.js +1 -3
- package/dist/browser/internal.js.map +1 -1
- package/dist/browser/naming/name-validation.d.ts +15 -0
- package/dist/browser/naming/name-validation.d.ts.map +1 -0
- package/dist/browser/naming/name-validation.js +82 -0
- package/dist/browser/naming/name-validation.js.map +1 -0
- package/dist/browser/naming/naming-policy.d.ts +7 -7
- package/dist/browser/naming/naming-policy.d.ts.map +1 -1
- package/dist/browser/naming/naming-policy.js +166 -33
- package/dist/browser/naming/naming-policy.js.map +1 -1
- package/dist/browser/naming/naming-rules.d.ts +12 -11
- package/dist/browser/naming/naming-rules.d.ts.map +1 -1
- package/dist/browser/naming/naming-rules.js +2 -9
- package/dist/browser/naming/naming-rules.js.map +1 -1
- package/dist/browser/package.json +1 -1
- package/dist/{esm/serialization/json/lower.d.ts → browser/serialization/arm-object-conversion.d.ts} +11 -11
- package/dist/browser/serialization/arm-object-conversion.d.ts.map +1 -0
- package/dist/{esm/serialization/json/lower.js → browser/serialization/arm-object-conversion.js} +20 -20
- package/dist/browser/serialization/arm-object-conversion.js.map +1 -0
- package/dist/browser/serialization/ast/declaration-builder.d.ts +10 -0
- package/dist/browser/serialization/ast/declaration-builder.d.ts.map +1 -0
- package/dist/browser/serialization/ast/declaration-builder.js +265 -0
- package/dist/browser/serialization/ast/declaration-builder.js.map +1 -0
- package/dist/browser/serialization/ast/declaration-dependencies.d.ts +18 -0
- package/dist/browser/serialization/ast/declaration-dependencies.d.ts.map +1 -0
- package/dist/browser/serialization/ast/declaration-dependencies.js +96 -0
- package/dist/browser/serialization/ast/declaration-dependencies.js.map +1 -0
- package/dist/browser/serialization/ast/expression-builder.d.ts +14 -0
- package/dist/browser/serialization/ast/expression-builder.d.ts.map +1 -0
- package/dist/browser/serialization/ast/expression-builder.js +313 -0
- package/dist/browser/serialization/ast/expression-builder.js.map +1 -0
- package/dist/browser/serialization/ast/expression-restorer.d.ts +8 -0
- package/dist/browser/serialization/ast/expression-restorer.d.ts.map +1 -0
- package/dist/browser/serialization/ast/expression-restorer.js +162 -0
- package/dist/browser/serialization/ast/expression-restorer.js.map +1 -0
- package/dist/browser/serialization/ast/expression-rewriter.d.ts +29 -0
- package/dist/browser/serialization/ast/expression-rewriter.d.ts.map +1 -0
- package/dist/browser/serialization/ast/expression-rewriter.js +257 -0
- package/dist/browser/serialization/ast/expression-rewriter.js.map +1 -0
- package/dist/browser/serialization/ast/expression-walker.d.ts +16 -0
- package/dist/browser/serialization/ast/expression-walker.d.ts.map +1 -0
- package/dist/browser/serialization/ast/expression-walker.js +154 -0
- package/dist/browser/serialization/ast/expression-walker.js.map +1 -0
- package/dist/browser/serialization/ast/generated/ast.d.ts.map +1 -0
- package/dist/browser/serialization/ast/generated/ast.js.map +1 -0
- package/dist/browser/serialization/ast/index.d.ts +7 -0
- package/dist/browser/serialization/ast/index.d.ts.map +1 -0
- package/dist/browser/serialization/ast/index.js.map +1 -0
- package/dist/browser/serialization/ast/resource-utils.d.ts +10 -0
- package/dist/browser/serialization/ast/resource-utils.d.ts.map +1 -0
- package/dist/browser/serialization/ast/resource-utils.js +52 -0
- package/dist/browser/serialization/ast/resource-utils.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/authored-context.d.ts +12 -0
- package/dist/browser/serialization/bicep/file-layout/authored-context.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/authored-context.js +57 -0
- package/dist/browser/serialization/bicep/file-layout/authored-context.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/bicep-namer.d.ts +11 -0
- package/dist/browser/serialization/bicep/file-layout/bicep-namer.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/bicep-namer.js +100 -0
- package/dist/browser/serialization/bicep/file-layout/bicep-namer.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/build-bicep-files.d.ts +7 -0
- package/dist/browser/serialization/bicep/file-layout/build-bicep-files.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/build-bicep-files.js +46 -0
- package/dist/browser/serialization/bicep/file-layout/build-bicep-files.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-planning.d.ts +19 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-planning.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-planning.js +68 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-planning.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-resource-utils.d.ts +8 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-resource-utils.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-resource-utils.js +67 -0
- package/dist/browser/serialization/bicep/file-layout/deployment-resource-utils.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-dependencies.d.ts +4 -0
- package/dist/browser/serialization/bicep/file-layout/file-dependencies.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-dependencies.js +32 -0
- package/dist/browser/serialization/bicep/file-layout/file-dependencies.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-paths.d.ts +3 -0
- package/dist/browser/serialization/bicep/file-layout/file-paths.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-paths.js +46 -0
- package/dist/browser/serialization/bicep/file-layout/file-paths.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-preparation.d.ts +34 -0
- package/dist/browser/serialization/bicep/file-layout/file-preparation.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/file-preparation.js +140 -0
- package/dist/browser/serialization/bicep/file-layout/file-preparation.js.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/reference-wiring.d.ts +3 -0
- package/dist/browser/serialization/bicep/file-layout/reference-wiring.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/file-layout/reference-wiring.js +225 -0
- package/dist/browser/serialization/bicep/file-layout/reference-wiring.js.map +1 -0
- package/dist/browser/serialization/bicep/index.d.ts +2 -0
- package/dist/browser/serialization/bicep/index.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/index.js +4 -0
- package/dist/browser/serialization/bicep/index.js.map +1 -0
- package/dist/browser/serialization/bicep/render.d.ts +11 -0
- package/dist/browser/serialization/bicep/render.d.ts.map +1 -0
- package/dist/browser/serialization/bicep/render.js +293 -0
- package/dist/browser/serialization/bicep/render.js.map +1 -0
- package/dist/browser/serialization/{json/encoding.d.ts → encoding.d.ts} +1 -1
- package/dist/browser/serialization/encoding.d.ts.map +1 -0
- package/dist/browser/serialization/{json/encoding.js → encoding.js} +2 -12
- package/dist/browser/serialization/encoding.js.map +1 -0
- package/dist/browser/serialization/{json/util.d.ts → identifiers.d.ts} +1 -1
- package/dist/browser/serialization/identifiers.d.ts.map +1 -0
- package/dist/browser/serialization/{json/util.js → identifiers.js} +1 -1
- package/dist/browser/serialization/identifiers.js.map +1 -0
- package/dist/browser/serialization/index.d.ts +1 -1
- package/dist/browser/serialization/index.d.ts.map +1 -1
- package/dist/browser/serialization/index.js.map +1 -1
- package/dist/browser/serialization/json/deserialize.d.ts.map +1 -1
- package/dist/browser/serialization/json/deserialize.js +131 -39
- package/dist/browser/serialization/json/deserialize.js.map +1 -1
- package/dist/browser/serialization/json/serialize.d.ts +1 -1
- package/dist/browser/serialization/json/serialize.d.ts.map +1 -1
- package/dist/browser/serialization/json/serialize.js +5 -360
- package/dist/browser/serialization/json/serialize.js.map +1 -1
- package/dist/browser/serialization/pluralize-config.d.ts.map +1 -0
- package/dist/browser/serialization/pluralize-config.js.map +1 -0
- package/dist/browser/serialization/symbol-map.d.ts +10 -0
- package/dist/browser/serialization/symbol-map.d.ts.map +1 -0
- package/dist/browser/serialization/symbol-map.js +40 -0
- package/dist/browser/serialization/symbol-map.js.map +1 -0
- package/dist/browser/shape/shape.d.ts +4 -4
- package/dist/browser/shape/shape.js +2 -2
- package/dist/browser/shape/shape.js.map +1 -1
- package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts +7 -1
- package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts.map +1 -1
- package/dist/commonjs/constructs/built-in-resources/resource-group.js +27 -6
- package/dist/commonjs/constructs/built-in-resources/resource-group.js.map +2 -2
- package/dist/commonjs/constructs/output.d.ts +1 -1
- package/dist/commonjs/constructs/output.d.ts.map +1 -1
- package/dist/commonjs/constructs/output.js.map +1 -1
- package/dist/commonjs/constructs/parameter.d.ts +1 -1
- package/dist/commonjs/constructs/parameter.d.ts.map +1 -1
- package/dist/commonjs/constructs/parameter.js.map +1 -1
- package/dist/commonjs/constructs/resource/resource-query.d.ts +3 -1
- package/dist/commonjs/constructs/resource/resource-query.d.ts.map +1 -1
- package/dist/commonjs/constructs/resource/resource-query.js +11 -0
- package/dist/commonjs/constructs/resource/resource-query.js.map +2 -2
- package/dist/commonjs/constructs/resource/resource-relationships.d.ts +9 -0
- package/dist/commonjs/constructs/resource/resource-relationships.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-relationships.js +59 -0
- package/dist/commonjs/constructs/resource/resource-relationships.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource.d.ts +11 -17
- package/dist/commonjs/constructs/resource/resource.d.ts.map +1 -1
- package/dist/commonjs/constructs/resource/resource.js +57 -35
- package/dist/commonjs/constructs/resource/resource.js.map +2 -2
- package/dist/commonjs/constructs/stack.d.ts +2 -16
- package/dist/commonjs/constructs/stack.d.ts.map +1 -1
- package/dist/commonjs/constructs/stack.js.map +2 -2
- package/dist/commonjs/expression/ast-nodes.d.ts +1 -1
- package/dist/commonjs/expression/ast-nodes.d.ts.map +1 -1
- package/dist/commonjs/expression/ast-nodes.js.map +1 -1
- package/dist/commonjs/expression/expressions.d.ts +2 -9
- package/dist/commonjs/expression/expressions.d.ts.map +1 -1
- package/dist/commonjs/expression/expressions.js.map +2 -2
- package/dist/commonjs/expression/utils.d.ts +5 -0
- package/dist/commonjs/expression/utils.d.ts.map +1 -0
- package/dist/commonjs/expression/utils.js +43 -0
- package/dist/commonjs/expression/utils.js.map +7 -0
- package/dist/commonjs/index.d.ts +4 -4
- package/dist/commonjs/index.d.ts.map +1 -1
- package/dist/commonjs/index.js.map +2 -2
- package/dist/commonjs/internal.d.ts +2 -5
- package/dist/commonjs/internal.d.ts.map +1 -1
- package/dist/commonjs/internal.js +3 -9
- package/dist/commonjs/internal.js.map +2 -2
- package/dist/commonjs/naming/name-validation.d.ts +15 -0
- package/dist/commonjs/naming/name-validation.d.ts.map +1 -0
- package/dist/commonjs/naming/name-validation.js +74 -0
- package/dist/commonjs/naming/name-validation.js.map +7 -0
- package/dist/commonjs/naming/naming-policy.d.ts +7 -7
- package/dist/commonjs/naming/naming-policy.d.ts.map +1 -1
- package/dist/commonjs/naming/naming-policy.js +136 -26
- package/dist/commonjs/naming/naming-policy.js.map +2 -2
- package/dist/commonjs/naming/naming-rules.d.ts +12 -11
- package/dist/commonjs/naming/naming-rules.d.ts.map +1 -1
- package/dist/commonjs/naming/naming-rules.js +4 -11
- package/dist/commonjs/naming/naming-rules.js.map +2 -2
- package/dist/commonjs/package.json +1 -1
- package/dist/{browser/serialization/json/lower.d.ts → commonjs/serialization/arm-object-conversion.d.ts} +11 -11
- package/dist/commonjs/serialization/arm-object-conversion.d.ts.map +1 -0
- package/dist/commonjs/serialization/{json/lower.js → arm-object-conversion.js} +15 -15
- package/dist/commonjs/serialization/arm-object-conversion.js.map +7 -0
- package/dist/commonjs/serialization/ast/declaration-builder.d.ts +10 -0
- package/dist/commonjs/serialization/ast/declaration-builder.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/declaration-builder.js +274 -0
- package/dist/commonjs/serialization/ast/declaration-builder.js.map +7 -0
- package/dist/commonjs/serialization/ast/declaration-dependencies.d.ts +18 -0
- package/dist/commonjs/serialization/ast/declaration-dependencies.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/declaration-dependencies.js +109 -0
- package/dist/commonjs/serialization/ast/declaration-dependencies.js.map +7 -0
- package/dist/commonjs/serialization/ast/expression-builder.d.ts +14 -0
- package/dist/commonjs/serialization/ast/expression-builder.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/expression-builder.js +316 -0
- package/dist/commonjs/serialization/ast/expression-builder.js.map +7 -0
- package/dist/commonjs/serialization/ast/expression-restorer.d.ts +8 -0
- package/dist/commonjs/serialization/ast/expression-restorer.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/expression-restorer.js +193 -0
- package/dist/commonjs/serialization/ast/expression-restorer.js.map +7 -0
- package/dist/commonjs/serialization/ast/expression-rewriter.d.ts +29 -0
- package/dist/commonjs/serialization/ast/expression-rewriter.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/expression-rewriter.js +270 -0
- package/dist/commonjs/serialization/ast/expression-rewriter.js.map +7 -0
- package/dist/commonjs/serialization/ast/expression-walker.d.ts +16 -0
- package/dist/commonjs/serialization/ast/expression-walker.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/expression-walker.js +165 -0
- package/dist/commonjs/serialization/ast/expression-walker.js.map +7 -0
- package/dist/commonjs/serialization/ast/generated/ast.d.ts.map +1 -0
- package/dist/commonjs/serialization/{contract → ast}/generated/ast.js.map +1 -1
- package/dist/commonjs/serialization/ast/index.d.ts +7 -0
- package/dist/commonjs/serialization/ast/index.d.ts.map +1 -0
- package/dist/commonjs/serialization/{contract → ast}/index.js +3 -3
- package/dist/commonjs/serialization/ast/index.js.map +7 -0
- package/dist/commonjs/serialization/ast/resource-utils.d.ts +10 -0
- package/dist/commonjs/serialization/ast/resource-utils.d.ts.map +1 -0
- package/dist/commonjs/serialization/ast/resource-utils.js +71 -0
- package/dist/commonjs/serialization/ast/resource-utils.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/authored-context.d.ts +12 -0
- package/dist/commonjs/serialization/bicep/file-layout/authored-context.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/authored-context.js +74 -0
- package/dist/commonjs/serialization/bicep/file-layout/authored-context.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/bicep-namer.d.ts +11 -0
- package/dist/commonjs/serialization/bicep/file-layout/bicep-namer.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/bicep-namer.js +130 -0
- package/dist/commonjs/serialization/bicep/file-layout/bicep-namer.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/build-bicep-files.d.ts +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/build-bicep-files.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/build-bicep-files.js +71 -0
- package/dist/commonjs/serialization/bicep/file-layout/build-bicep-files.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-planning.d.ts +19 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-planning.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-planning.js +80 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-planning.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-resource-utils.d.ts +8 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-resource-utils.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-resource-utils.js +91 -0
- package/dist/commonjs/serialization/bicep/file-layout/deployment-resource-utils.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-dependencies.d.ts +4 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-dependencies.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-dependencies.js +57 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-dependencies.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-paths.d.ts +3 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-paths.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-paths.js +70 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-paths.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-preparation.d.ts +34 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-preparation.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-preparation.js +190 -0
- package/dist/commonjs/serialization/bicep/file-layout/file-preparation.js.map +7 -0
- package/dist/commonjs/serialization/bicep/file-layout/reference-wiring.d.ts +3 -0
- package/dist/commonjs/serialization/bicep/file-layout/reference-wiring.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/file-layout/reference-wiring.js +241 -0
- package/dist/commonjs/serialization/bicep/file-layout/reference-wiring.js.map +7 -0
- package/dist/commonjs/serialization/bicep/index.d.ts +2 -0
- package/dist/commonjs/serialization/bicep/index.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/index.js +28 -0
- package/dist/commonjs/serialization/bicep/index.js.map +7 -0
- package/dist/commonjs/serialization/bicep/render.d.ts +11 -0
- package/dist/commonjs/serialization/bicep/render.d.ts.map +1 -0
- package/dist/commonjs/serialization/bicep/render.js +312 -0
- package/dist/commonjs/serialization/bicep/render.js.map +7 -0
- package/dist/commonjs/serialization/{json/encoding.d.ts → encoding.d.ts} +1 -1
- package/dist/commonjs/serialization/encoding.d.ts.map +1 -0
- package/dist/commonjs/serialization/{json/encoding.js → encoding.js} +2 -12
- package/dist/commonjs/serialization/encoding.js.map +7 -0
- package/dist/commonjs/serialization/{json/util.d.ts → identifiers.d.ts} +1 -1
- package/dist/commonjs/serialization/identifiers.d.ts.map +1 -0
- package/dist/commonjs/serialization/{json/util.js → identifiers.js} +4 -4
- package/dist/commonjs/serialization/{json/util.js.map → identifiers.js.map} +1 -1
- package/dist/commonjs/serialization/index.d.ts +1 -1
- package/dist/commonjs/serialization/index.d.ts.map +1 -1
- package/dist/commonjs/serialization/index.js.map +1 -1
- package/dist/commonjs/serialization/json/deserialize.d.ts.map +1 -1
- package/dist/commonjs/serialization/json/deserialize.js +115 -44
- package/dist/commonjs/serialization/json/deserialize.js.map +2 -2
- package/dist/commonjs/serialization/json/serialize.d.ts +1 -1
- package/dist/commonjs/serialization/json/serialize.d.ts.map +1 -1
- package/dist/commonjs/serialization/json/serialize.js +6 -308
- package/dist/commonjs/serialization/json/serialize.js.map +3 -3
- package/dist/commonjs/serialization/pluralize-config.d.ts.map +1 -0
- package/dist/commonjs/serialization/{json/pluralize-config.js.map → pluralize-config.js.map} +1 -1
- package/dist/commonjs/serialization/symbol-map.d.ts +10 -0
- package/dist/commonjs/serialization/symbol-map.d.ts.map +1 -0
- package/dist/commonjs/serialization/symbol-map.js +72 -0
- package/dist/commonjs/serialization/symbol-map.js.map +7 -0
- package/dist/commonjs/shape/shape.d.ts +4 -4
- package/dist/commonjs/shape/shape.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +1 -1
- package/dist/esm/constructs/built-in-resources/resource-group.d.ts +7 -1
- package/dist/esm/constructs/built-in-resources/resource-group.d.ts.map +1 -1
- package/dist/esm/constructs/built-in-resources/resource-group.js +26 -6
- package/dist/esm/constructs/built-in-resources/resource-group.js.map +1 -1
- package/dist/esm/constructs/output.d.ts +1 -1
- package/dist/esm/constructs/output.d.ts.map +1 -1
- package/dist/esm/constructs/output.js.map +1 -1
- package/dist/esm/constructs/parameter.d.ts +1 -1
- package/dist/esm/constructs/parameter.d.ts.map +1 -1
- package/dist/esm/constructs/parameter.js.map +1 -1
- package/dist/esm/constructs/resource/resource-query.d.ts +3 -1
- package/dist/esm/constructs/resource/resource-query.d.ts.map +1 -1
- package/dist/esm/constructs/resource/resource-query.js +10 -0
- package/dist/esm/constructs/resource/resource-query.js.map +1 -1
- package/dist/esm/constructs/resource/resource-relationships.d.ts +9 -0
- package/dist/esm/constructs/resource/resource-relationships.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-relationships.js +35 -0
- package/dist/esm/constructs/resource/resource-relationships.js.map +1 -0
- package/dist/esm/constructs/resource/resource.d.ts +11 -17
- package/dist/esm/constructs/resource/resource.d.ts.map +1 -1
- package/dist/esm/constructs/resource/resource.js +70 -28
- package/dist/esm/constructs/resource/resource.js.map +1 -1
- package/dist/esm/constructs/stack.d.ts +2 -16
- package/dist/esm/constructs/stack.d.ts.map +1 -1
- package/dist/esm/constructs/stack.js +1 -15
- package/dist/esm/constructs/stack.js.map +1 -1
- package/dist/esm/expression/ast-nodes.d.ts +1 -1
- package/dist/esm/expression/ast-nodes.d.ts.map +1 -1
- package/dist/esm/expression/ast-nodes.js.map +1 -1
- package/dist/esm/expression/expressions.d.ts +2 -9
- package/dist/esm/expression/expressions.d.ts.map +1 -1
- package/dist/esm/expression/expressions.js +2 -9
- package/dist/esm/expression/expressions.js.map +1 -1
- package/dist/esm/expression/utils.d.ts +5 -0
- package/dist/esm/expression/utils.d.ts.map +1 -0
- package/dist/esm/expression/utils.js +25 -0
- package/dist/esm/expression/utils.js.map +1 -0
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal.d.ts +2 -5
- package/dist/esm/internal.d.ts.map +1 -1
- package/dist/esm/internal.js +1 -3
- package/dist/esm/internal.js.map +1 -1
- package/dist/esm/naming/name-validation.d.ts +15 -0
- package/dist/esm/naming/name-validation.d.ts.map +1 -0
- package/dist/esm/naming/name-validation.js +82 -0
- package/dist/esm/naming/name-validation.js.map +1 -0
- package/dist/esm/naming/naming-policy.d.ts +7 -7
- package/dist/esm/naming/naming-policy.d.ts.map +1 -1
- package/dist/esm/naming/naming-policy.js +166 -33
- package/dist/esm/naming/naming-policy.js.map +1 -1
- package/dist/esm/naming/naming-rules.d.ts +12 -11
- package/dist/esm/naming/naming-rules.d.ts.map +1 -1
- package/dist/esm/naming/naming-rules.js +2 -9
- package/dist/esm/naming/naming-rules.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/{commonjs/serialization/json/lower.d.ts → esm/serialization/arm-object-conversion.d.ts} +11 -11
- package/dist/esm/serialization/arm-object-conversion.d.ts.map +1 -0
- package/dist/{browser/serialization/json/lower.js → esm/serialization/arm-object-conversion.js} +20 -20
- package/dist/esm/serialization/arm-object-conversion.js.map +1 -0
- package/dist/esm/serialization/ast/declaration-builder.d.ts +10 -0
- package/dist/esm/serialization/ast/declaration-builder.d.ts.map +1 -0
- package/dist/esm/serialization/ast/declaration-builder.js +265 -0
- package/dist/esm/serialization/ast/declaration-builder.js.map +1 -0
- package/dist/esm/serialization/ast/declaration-dependencies.d.ts +18 -0
- package/dist/esm/serialization/ast/declaration-dependencies.d.ts.map +1 -0
- package/dist/esm/serialization/ast/declaration-dependencies.js +96 -0
- package/dist/esm/serialization/ast/declaration-dependencies.js.map +1 -0
- package/dist/esm/serialization/ast/expression-builder.d.ts +14 -0
- package/dist/esm/serialization/ast/expression-builder.d.ts.map +1 -0
- package/dist/esm/serialization/ast/expression-builder.js +313 -0
- package/dist/esm/serialization/ast/expression-builder.js.map +1 -0
- package/dist/esm/serialization/ast/expression-restorer.d.ts +8 -0
- package/dist/esm/serialization/ast/expression-restorer.d.ts.map +1 -0
- package/dist/esm/serialization/ast/expression-restorer.js +162 -0
- package/dist/esm/serialization/ast/expression-restorer.js.map +1 -0
- package/dist/esm/serialization/ast/expression-rewriter.d.ts +29 -0
- package/dist/esm/serialization/ast/expression-rewriter.d.ts.map +1 -0
- package/dist/esm/serialization/ast/expression-rewriter.js +257 -0
- package/dist/esm/serialization/ast/expression-rewriter.js.map +1 -0
- package/dist/esm/serialization/ast/expression-walker.d.ts +16 -0
- package/dist/esm/serialization/ast/expression-walker.d.ts.map +1 -0
- package/dist/esm/serialization/ast/expression-walker.js +154 -0
- package/dist/esm/serialization/ast/expression-walker.js.map +1 -0
- package/dist/esm/serialization/ast/generated/ast.d.ts.map +1 -0
- package/dist/esm/serialization/ast/generated/ast.js.map +1 -0
- package/dist/esm/serialization/ast/index.d.ts +7 -0
- package/dist/esm/serialization/ast/index.d.ts.map +1 -0
- package/dist/esm/serialization/ast/index.js.map +1 -0
- package/dist/esm/serialization/ast/resource-utils.d.ts +10 -0
- package/dist/esm/serialization/ast/resource-utils.d.ts.map +1 -0
- package/dist/esm/serialization/ast/resource-utils.js +52 -0
- package/dist/esm/serialization/ast/resource-utils.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/authored-context.d.ts +12 -0
- package/dist/esm/serialization/bicep/file-layout/authored-context.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/authored-context.js +57 -0
- package/dist/esm/serialization/bicep/file-layout/authored-context.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/bicep-namer.d.ts +11 -0
- package/dist/esm/serialization/bicep/file-layout/bicep-namer.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/bicep-namer.js +100 -0
- package/dist/esm/serialization/bicep/file-layout/bicep-namer.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/build-bicep-files.d.ts +7 -0
- package/dist/esm/serialization/bicep/file-layout/build-bicep-files.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/build-bicep-files.js +46 -0
- package/dist/esm/serialization/bicep/file-layout/build-bicep-files.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-planning.d.ts +19 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-planning.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-planning.js +68 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-planning.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-resource-utils.d.ts +8 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-resource-utils.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-resource-utils.js +67 -0
- package/dist/esm/serialization/bicep/file-layout/deployment-resource-utils.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-dependencies.d.ts +4 -0
- package/dist/esm/serialization/bicep/file-layout/file-dependencies.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-dependencies.js +32 -0
- package/dist/esm/serialization/bicep/file-layout/file-dependencies.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-paths.d.ts +3 -0
- package/dist/esm/serialization/bicep/file-layout/file-paths.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-paths.js +46 -0
- package/dist/esm/serialization/bicep/file-layout/file-paths.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-preparation.d.ts +34 -0
- package/dist/esm/serialization/bicep/file-layout/file-preparation.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/file-preparation.js +140 -0
- package/dist/esm/serialization/bicep/file-layout/file-preparation.js.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/reference-wiring.d.ts +3 -0
- package/dist/esm/serialization/bicep/file-layout/reference-wiring.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/file-layout/reference-wiring.js +225 -0
- package/dist/esm/serialization/bicep/file-layout/reference-wiring.js.map +1 -0
- package/dist/esm/serialization/bicep/index.d.ts +2 -0
- package/dist/esm/serialization/bicep/index.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/index.js +4 -0
- package/dist/esm/serialization/bicep/index.js.map +1 -0
- package/dist/esm/serialization/bicep/render.d.ts +11 -0
- package/dist/esm/serialization/bicep/render.d.ts.map +1 -0
- package/dist/esm/serialization/bicep/render.js +293 -0
- package/dist/esm/serialization/bicep/render.js.map +1 -0
- package/dist/esm/serialization/{json/encoding.d.ts → encoding.d.ts} +1 -1
- package/dist/esm/serialization/encoding.d.ts.map +1 -0
- package/dist/esm/serialization/{json/encoding.js → encoding.js} +2 -12
- package/dist/esm/serialization/encoding.js.map +1 -0
- package/dist/esm/serialization/{json/util.d.ts → identifiers.d.ts} +1 -1
- package/dist/esm/serialization/identifiers.d.ts.map +1 -0
- package/dist/esm/serialization/{json/util.js → identifiers.js} +1 -1
- package/dist/esm/serialization/identifiers.js.map +1 -0
- package/dist/esm/serialization/index.d.ts +1 -1
- package/dist/esm/serialization/index.d.ts.map +1 -1
- package/dist/esm/serialization/index.js.map +1 -1
- package/dist/esm/serialization/json/deserialize.d.ts.map +1 -1
- package/dist/esm/serialization/json/deserialize.js +131 -39
- package/dist/esm/serialization/json/deserialize.js.map +1 -1
- package/dist/esm/serialization/json/serialize.d.ts +1 -1
- package/dist/esm/serialization/json/serialize.d.ts.map +1 -1
- package/dist/esm/serialization/json/serialize.js +5 -360
- package/dist/esm/serialization/json/serialize.js.map +1 -1
- package/dist/esm/serialization/pluralize-config.d.ts.map +1 -0
- package/dist/esm/serialization/pluralize-config.js.map +1 -0
- package/dist/esm/serialization/symbol-map.d.ts +10 -0
- package/dist/esm/serialization/symbol-map.d.ts.map +1 -0
- package/dist/esm/serialization/symbol-map.js +40 -0
- package/dist/esm/serialization/symbol-map.js.map +1 -0
- package/dist/esm/shape/shape.d.ts +4 -4
- package/dist/esm/shape/shape.js +2 -2
- package/dist/esm/shape/shape.js.map +1 -1
- package/package.json +3 -2
- package/dist/browser/serialization/contract/generated/ast.d.ts.map +0 -1
- package/dist/browser/serialization/contract/generated/ast.js.map +0 -1
- package/dist/browser/serialization/contract/index.d.ts +0 -2
- package/dist/browser/serialization/contract/index.d.ts.map +0 -1
- package/dist/browser/serialization/contract/index.js.map +0 -1
- package/dist/browser/serialization/json/encoding.d.ts.map +0 -1
- package/dist/browser/serialization/json/encoding.js.map +0 -1
- package/dist/browser/serialization/json/expression.d.ts +0 -32
- package/dist/browser/serialization/json/expression.d.ts.map +0 -1
- package/dist/browser/serialization/json/expression.js +0 -494
- package/dist/browser/serialization/json/expression.js.map +0 -1
- package/dist/browser/serialization/json/lower.d.ts.map +0 -1
- package/dist/browser/serialization/json/lower.js.map +0 -1
- package/dist/browser/serialization/json/pluralize-config.d.ts.map +0 -1
- package/dist/browser/serialization/json/pluralize-config.js.map +0 -1
- package/dist/browser/serialization/json/util.d.ts.map +0 -1
- package/dist/browser/serialization/json/util.js.map +0 -1
- package/dist/browser/serialization/utils.d.ts +0 -3
- package/dist/browser/serialization/utils.d.ts.map +0 -1
- package/dist/browser/serialization/utils.js +0 -146
- package/dist/browser/serialization/utils.js.map +0 -1
- package/dist/commonjs/serialization/contract/generated/ast.d.ts.map +0 -1
- package/dist/commonjs/serialization/contract/index.d.ts +0 -2
- package/dist/commonjs/serialization/contract/index.d.ts.map +0 -1
- package/dist/commonjs/serialization/contract/index.js.map +0 -7
- package/dist/commonjs/serialization/json/encoding.d.ts.map +0 -1
- package/dist/commonjs/serialization/json/encoding.js.map +0 -7
- package/dist/commonjs/serialization/json/expression.d.ts +0 -32
- package/dist/commonjs/serialization/json/expression.d.ts.map +0 -1
- package/dist/commonjs/serialization/json/expression.js +0 -509
- package/dist/commonjs/serialization/json/expression.js.map +0 -7
- package/dist/commonjs/serialization/json/lower.d.ts.map +0 -1
- package/dist/commonjs/serialization/json/lower.js.map +0 -7
- package/dist/commonjs/serialization/json/pluralize-config.d.ts.map +0 -1
- package/dist/commonjs/serialization/json/util.d.ts.map +0 -1
- package/dist/commonjs/serialization/utils.d.ts +0 -3
- package/dist/commonjs/serialization/utils.d.ts.map +0 -1
- package/dist/commonjs/serialization/utils.js +0 -169
- package/dist/commonjs/serialization/utils.js.map +0 -7
- package/dist/esm/serialization/contract/generated/ast.d.ts.map +0 -1
- package/dist/esm/serialization/contract/generated/ast.js.map +0 -1
- package/dist/esm/serialization/contract/index.d.ts +0 -2
- package/dist/esm/serialization/contract/index.d.ts.map +0 -1
- package/dist/esm/serialization/contract/index.js.map +0 -1
- package/dist/esm/serialization/json/encoding.d.ts.map +0 -1
- package/dist/esm/serialization/json/encoding.js.map +0 -1
- package/dist/esm/serialization/json/expression.d.ts +0 -32
- package/dist/esm/serialization/json/expression.d.ts.map +0 -1
- package/dist/esm/serialization/json/expression.js +0 -494
- package/dist/esm/serialization/json/expression.js.map +0 -1
- package/dist/esm/serialization/json/lower.d.ts.map +0 -1
- package/dist/esm/serialization/json/lower.js.map +0 -1
- package/dist/esm/serialization/json/pluralize-config.d.ts.map +0 -1
- package/dist/esm/serialization/json/pluralize-config.js.map +0 -1
- package/dist/esm/serialization/json/util.d.ts.map +0 -1
- package/dist/esm/serialization/json/util.js.map +0 -1
- package/dist/esm/serialization/utils.d.ts +0 -3
- package/dist/esm/serialization/utils.d.ts.map +0 -1
- package/dist/esm/serialization/utils.js +0 -146
- package/dist/esm/serialization/utils.js.map +0 -1
- /package/dist/browser/serialization/{contract → ast}/generated/ast.d.ts +0 -0
- /package/dist/browser/serialization/{contract → ast}/generated/ast.js +0 -0
- /package/dist/browser/serialization/{contract → ast}/index.js +0 -0
- /package/dist/browser/serialization/{json/pluralize-config.d.ts → pluralize-config.d.ts} +0 -0
- /package/dist/browser/serialization/{json/pluralize-config.js → pluralize-config.js} +0 -0
- /package/dist/commonjs/serialization/{contract → ast}/generated/ast.d.ts +0 -0
- /package/dist/commonjs/serialization/{contract → ast}/generated/ast.js +0 -0
- /package/dist/commonjs/serialization/{json/pluralize-config.d.ts → pluralize-config.d.ts} +0 -0
- /package/dist/commonjs/serialization/{json/pluralize-config.js → pluralize-config.js} +0 -0
- /package/dist/esm/serialization/{contract → ast}/generated/ast.d.ts +0 -0
- /package/dist/esm/serialization/{contract → ast}/generated/ast.js +0 -0
- /package/dist/esm/serialization/{contract → ast}/index.js +0 -0
- /package/dist/esm/serialization/{json/pluralize-config.d.ts → pluralize-config.d.ts} +0 -0
- /package/dist/esm/serialization/{json/pluralize-config.js → pluralize-config.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../src/shape/shape.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqTlC,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E,0DAA0D;AAC1D,MAAM,CAAC,M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;AAC9F,CAAC;AAED;;;GAGG;AACH,SAAS,aAAa,CAAC,GAAa,EAAE,KAAa;IACjD,IAAI,CAAC,GAAG,IAAI,YAAY,CAAC,GAAG,CAAC;QAAE,OAAO,SAAS,CAAC;IAChD,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC1D,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,WAAW,CAAC,KAA6B;IAChD,IAAI,CAAC,KAAK,IAAI,oBAAoB,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACpD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Runtime types for ARM shape information.\n *\n * A `ModelShape` is generated once per emitted Model and describes how\n * to map JS-ergonomic property names + structure to the underlying ARM\n * wire shape. The shapes are consumed by the serialization `lowerState`\n * pass (and its inverse `raiseState`) which rewrites state keys and\n * re-nests `@flattenProperty` paths just before serialization /\n * after deserialization.\n *\n * These types are an internal cross-package runtime contract; generated code\n * imports them from `@azure/provisioning-core/internal`.\n *\n * Nested-shape thunks ({@link DeferredShape}) defer dereferencing the\n * inner shape constant until use, so mutually-referential or\n * self-referential models can be emitted without initialization-order\n * problems.\n *\n * A model shape comes in two flavors:\n * - `FlatModelShape` ({@link FlatModelShape}): the common case —\n * one shape per concrete model.\n * - `DiscriminatedModelShape` ({@link DiscriminatedModelShape}): a\n * name-discriminated variant group. ARM permits multiple resources\n * to share an ARM `type` + `apiVersion` pair and disambiguate via a\n * fixed field — e.g. `Microsoft.ApiManagement/service/portalsettings@2024-05-01`\n * has three variants with `name: 'signin' | 'signup' | 'delegation'`\n * and distinct `properties` shapes. The same machinery applies to\n * nested models that use a `@discriminator` field.\n */\nimport type {\n BooleanValueEncodingDescriptor,\n BytesValueEncodingDescriptor,\n DateValueEncodingDescriptor,\n NumberValueEncodingDescriptor,\n NumericStringEncodingDescriptor,\n StringValueEncodingDescriptor,\n} from \"./value-encoding.js\";\n\n/** The standard single-model shape. */\nexport interface FlatModelShape {\n /**\n * Tag for tag-dispatched discrimination on {@link NavShape} and\n * {@link ModelShape}. Always `\"flatModel\"`.\n */\n readonly kind: \"flatModel\";\n /**\n * Map, keyed by JS-side (client-facing) property name, of how that\n * property maps to the ARM wire shape. Property names not present in\n * this map are assumed to be pass-through (identity mapping).\n */\n readonly byJsName: { readonly [jsName: string]: PropertyShape };\n}\n\n/**\n * The two names a discriminator field goes by.\n *\n * Usually identical — ARM discriminators are `type`, `name`, `kind` and\n * service teams rarely rename them — but a `@clientName` on the field\n * makes them differ, and the two are looked up in different keyspaces:\n * JS-side state is keyed by {@link jsName}, wire JSON by\n * {@link armName}. Carrying both is what lets a discriminated shape\n * resolve in either direction.\n */\nexport interface DiscriminatorNames {\n /** Client-facing name, as authored in TypeScript and held in state. */\n readonly jsName: string;\n /** Wire-level name, as it appears in an ARM template or response. */\n readonly armName: string;\n}\n\n/**\n * A name-discriminated group of variants that share one parent key\n * (an ARM `(type, apiVersion)` at the registry level, or a parent\n * model's `@discriminator` field elsewhere). The `discriminator` names\n * the field whose value selects a variant.\n */\nexport interface DiscriminatedModelShape {\n readonly kind: \"discriminatedModel\";\n /** Names of the field used to select a variant. */\n readonly discriminator: DiscriminatorNames;\n /**\n * Map from discriminator value (e.g. `\"signin\"`) to the shape for\n * that variant. A value with no entry here doesn't end resolution —\n * {@link resolveModelShape} infers the variant from the payload's\n * structure instead.\n *\n * Entries may be:\n * - a {@link FlatModelShape} — the terminal, common case;\n * - a {@link DeferredShape} — breaks emit-order / cyclic-reference\n * hazards, exactly as {@link PropertyShape.value} does;\n * - a nested {@link DiscriminatedModelShape} — a variant that is\n * itself a discriminated base on a *different* field. TypeSpec\n * permits this (`@discriminator(\"kind\") model Pet`, then\n * `@discriminator(\"breed\") model Cat extends Pet`), so selecting\n * a concrete shape may take more than one hop. See\n * {@link resolveModelShape}.\n *\n * Note that a hierarchy re-using the *same* discriminator field at\n * every level (abstract intermediates) is flattened by the emitter\n * into a single level here — only a change of discriminator field\n * produces a nested entry.\n */\n readonly byValue: {\n readonly [value: string]: ModelShape | DeferredShape<ModelShape>;\n };\n}\n\n/** A single model's shape — either flat or discriminated. */\nexport type ModelShape = FlatModelShape | DiscriminatedModelShape;\n\n/**\n * What `registerShape` stores in the global registry, keyed by\n * `(armType, apiVersion)`. Same structural type as {@link ModelShape};\n * the alias documents intent at the registry boundary.\n */\nexport type ResourceShape = ModelShape;\n\n/** A single property's shape entry. */\nexport interface PropertyShape {\n /**\n * ARM wire path from the owning model's root to this property.\n * Single-segment for direct properties; multi-segment for properties\n * hoisted through one or more `@flattenProperty` wrappers.\n */\n readonly armPath: readonly string[];\n\n /**\n * Describes this property's value for navigation and wire conversion.\n * Model and container shapes recurse into nested values; a\n * {@link TerminalValueShape} explicitly terminates recursion. Scalar\n * terminal shapes carry only the encodings valid for their client-side\n * JavaScript representation.\n */\n readonly value: ValueShape;\n\n /**\n * `true` when ARM treats this property as server-set (visible in GET\n * responses but rejected on PUT). Omitted (i.e. `undefined`/`false`)\n * for writable properties.\n *\n * Currently consumed by the `Resource` constructor's deployment-context\n * inheritance to skip readonly properties (notably `location` on many\n * child resources where the field exists in the read model only).\n */\n readonly readOnly?: boolean;\n}\n\n/**\n * Deferred reference to a shape value. The thunk is called on\n * dereference so the actual shape lookup is deferred.\n *\n * **Why this exists instead of embedding the shape directly.**\n *\n * Model shapes frequently reference each other — a model's properties\n * can point to other models, and ARM types include both self-\n * referential (tree-like) and mutually-referential (cyclic) structures.\n * If we embedded a {@link ModelShape} value directly inside another\n * model shape's value field, both shapes would need to be fully\n * initialized when the parent is constructed. That's impossible\n * whenever:\n *\n * - A model references itself, e.g. `TreeNode { children: TreeNode[] }`.\n * - Two models reference each other, e.g. `A { b?: B }` and `B { a?: A }`.\n * - Two modules each define shapes that reference shapes from the other.\n *\n * In all three cases the second constant is in the Temporal Dead Zone\n * when the first one's literal evaluates, and the runtime throws\n * `ReferenceError: Cannot access ... before initialization`.\n *\n * Wrapping the reference in a thunk solves it. The closure captures\n * the *binding name*, not its current value. The lookup happens later\n * when the thunk is called — by which time the module graph has\n * finished evaluating and both shapes are fully constructed.\n *\n * Only the model variant of {@link ValueShape} carries a reference —\n * container shapes (`array`, `record`) are eager because they don't\n * reference any module-level binding directly; the inner reference\n * deeper down handles cycle-breaking.\n */\nexport interface DeferredShape<T> {\n readonly kind: \"deferred\";\n readonly value: () => T;\n}\n\n/** An array-of-T property/container shape. */\nexport interface ArrayShape {\n readonly kind: \"array\";\n readonly element: ValueShape;\n}\n\n/** A `Record<string, T>` property/container shape. */\nexport interface RecordShape {\n readonly kind: \"record\";\n readonly value: ValueShape;\n}\n\n/** A fixed-length heterogeneous tuple property/container shape. */\nexport interface TupleShape {\n readonly kind: \"tuple\";\n readonly values: readonly ValueShape[];\n}\n\n/** A TypeSpec scalar rendered as TypeScript `any`. */\nexport interface AnyShape {\n readonly kind: \"any\";\n}\n\n/** A scalar whose client-side JavaScript representation is `string`. */\nexport interface StringShape {\n readonly kind: \"string\";\n readonly encoding?: StringValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `boolean`. */\nexport interface BooleanShape {\n readonly kind: \"boolean\";\n readonly encoding?: BooleanValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `number`. */\nexport interface NumberShape {\n readonly kind: \"number\";\n readonly encoding?: NumberValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `Uint8Array`. */\nexport interface BytesShape {\n readonly kind: \"bytes\";\n readonly encoding?: BytesValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `Date`. */\nexport interface DateShape {\n readonly kind: \"date\";\n readonly encoding?: DateValueEncodingDescriptor;\n}\n\n/** A terminal TypeSpec string literal. Literals cannot carry `@encode`. */\nexport interface StringLiteralShape {\n readonly kind: \"stringLiteral\";\n}\n\n/** A terminal TypeSpec numeric literal. */\nexport interface NumberLiteralShape {\n readonly kind: \"numberLiteral\";\n /** `@encode(string)` when the numeric literal is exposed as wire text. */\n readonly encoding?: NumericStringEncodingDescriptor;\n}\n\n/** A terminal TypeSpec boolean literal. */\nexport interface BooleanLiteralShape {\n readonly kind: \"booleanLiteral\";\n /** `@encode(string)` while the client value remains a boolean literal. */\n readonly encoding?: BooleanValueEncodingDescriptor;\n}\n\n/** A terminal TypeSpec enum. Enums cannot carry `@encode`. */\nexport interface EnumShape {\n readonly kind: \"enum\";\n}\n\n/**\n * A terminal TypeSpec union for which no single structural shape can be\n * selected. Unions cannot carry `@encode` in the provisioning emitter.\n */\nexport interface UnionShape {\n readonly kind: \"union\";\n}\n\n/** The TypeSpec `null` intrinsic. */\nexport interface NullShape {\n readonly kind: \"null\";\n}\n\n/**\n * Concrete terminal values in the generated client API.\n *\n * Scalar kinds describe the JavaScript value accepted by the generated\n * TypeScript surface, not necessarily the semantic TypeSpec scalar. For\n * example, a numeric `duration` is a {@link NumberShape}, while the default\n * ISO8601 duration is a {@link StringShape}; their narrowed `encoding` fields\n * retain the TypeSpec source semantics needed for wire conversion. Numeric and\n * boolean literal shapes can carry the same narrowly applicable encodings that\n * TypeSpec permits on those values. String literals, enums, unions, and null\n * remain distinct non-encodable terminal categories.\n * Expressions are orthogonal wrappers around any value shape and are handled\n * before shape-directed conversion.\n */\nexport type TerminalValueShape =\n | AnyShape\n | StringShape\n | BooleanShape\n | NumberShape\n | BytesShape\n | DateShape\n | StringLiteralShape\n | NumberLiteralShape\n | BooleanLiteralShape\n | EnumShape\n | UnionShape\n | NullShape;\n\n/** A container through which property navigation can continue. */\nexport type ContainerShape = ArrayShape | RecordShape | TupleShape;\n\nexport type ValueShape = TerminalValueShape | DeferredShape<ModelShape> | ContainerShape;\n\n// ---------------------------------------------------------------------------\n// Constructor helpers\n// ---------------------------------------------------------------------------\n\n/** Build a {@link FlatModelShape} from a property map. */\nexport const createFlatModelShape = (byJsName: Record<string, PropertyShape>): FlatModelShape => ({\n kind: \"flatModel\",\n byJsName,\n});\n\n/**\n * Build a {@link DiscriminatedModelShape}.\n *\n * Pass a bare string when the field goes by the same name on both\n * sides, which is the overwhelmingly common case; pass a\n * {@link DiscriminatorNames} pair when a `@clientName` makes them\n * differ.\n */\nexport const createDiscriminatedModelShape = (\n discriminator: string | DiscriminatorNames,\n byValue: Record<string, ModelShape | DeferredShape<ModelShape>>,\n): DiscriminatedModelShape => ({\n kind: \"discriminatedModel\",\n discriminator:\n typeof discriminator === \"string\"\n ? { jsName: discriminator, armName: discriminator }\n : discriminator,\n byValue,\n});\n\n/**\n * Build a {@link DeferredShape}. The thunk is called on dereference; defer\n * the actual shape lookup so that mutually-referential constants can\n * be emitted in any order.\n */\nexport const createDeferredShape = <T>(value: () => T): DeferredShape<T> => ({\n kind: \"deferred\",\n value,\n});\n\n/** Build an {@link AnyShape}. */\nexport const createAnyShape = (): AnyShape => ({ kind: \"any\" });\n\n/** Build a {@link StringShape}, optionally with a compatible wire encoding. */\nexport const createStringShape = (encoding?: StringValueEncodingDescriptor): StringShape => ({\n kind: \"string\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link BooleanShape}, optionally with a compatible wire encoding. */\nexport const createBooleanShape = (encoding?: BooleanValueEncodingDescriptor): BooleanShape => ({\n kind: \"boolean\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link NumberShape}, optionally with a compatible wire encoding. */\nexport const createNumberShape = (encoding?: NumberValueEncodingDescriptor): NumberShape => ({\n kind: \"number\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link BytesShape}, optionally with a compatible wire encoding. */\nexport const createBytesShape = (encoding?: BytesValueEncodingDescriptor): BytesShape => ({\n kind: \"bytes\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link DateShape}, optionally with a compatible wire encoding. */\nexport const createDateShape = (encoding?: DateValueEncodingDescriptor): DateShape => ({\n kind: \"date\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link StringLiteralShape}. */\nexport const createStringLiteralShape = (): StringLiteralShape => ({\n kind: \"stringLiteral\",\n});\n\n/** Build a terminal {@link NumberLiteralShape}. */\nexport const createNumberLiteralShape = (\n encoding?: NumericStringEncodingDescriptor,\n): NumberLiteralShape => ({\n kind: \"numberLiteral\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link BooleanLiteralShape}. */\nexport const createBooleanLiteralShape = (\n encoding?: BooleanValueEncodingDescriptor,\n): BooleanLiteralShape => ({\n kind: \"booleanLiteral\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link EnumShape}. */\nexport const createEnumShape = (): EnumShape => ({ kind: \"enum\" });\n\n/** Build a terminal {@link UnionShape}. */\nexport const createUnionShape = (): UnionShape => ({ kind: \"union\" });\n\n/** Build a terminal {@link NullShape}. */\nexport const createNullShape = (): NullShape => ({ kind: \"null\" });\n\n/** Build an {@link ArrayShape}. */\nexport const createArrayShape = (element: ValueShape): ArrayShape => ({\n kind: \"array\",\n element,\n});\n\n/** Build a {@link RecordShape}. */\nexport const createRecordShape = (value: ValueShape): RecordShape => ({\n kind: \"record\",\n value,\n});\n\n/** Build a {@link TupleShape}. */\nexport const createTupleShape = (values: readonly ValueShape[]): TupleShape => ({\n kind: \"tuple\",\n values,\n});\n\n/** Return whether a value shape terminates property navigation. */\nexport function isTerminalValueShape(shape: ValueShape): shape is TerminalValueShape {\n switch (shape.kind) {\n case \"any\":\n case \"string\":\n case \"boolean\":\n case \"number\":\n case \"bytes\":\n case \"date\":\n case \"stringLiteral\":\n case \"numberLiteral\":\n case \"booleanLiteral\":\n case \"enum\":\n case \"union\":\n case \"null\":\n return true;\n case \"deferred\":\n case \"array\":\n case \"record\":\n case \"tuple\":\n return false;\n default:\n return assertNeverShape(shape);\n }\n}\n\nfunction assertNeverShape(shape: never): never {\n throw new Error(`Unhandled value shape: ${String(shape)}`);\n}\n\n// ---------------------------------------------------------------------------\n// Helpers used by the runtime proxy + lowering pass\n// ---------------------------------------------------------------------------\n\n/**\n * Runtime navigation position for a typed proxy. Either:\n * - a {@link ModelShape} — we're at a model's properties, whether or\n * not its variant is known,\n * - a {@link ContainerShape} — we're at a container that hasn't yet been\n * indexed,\n * - `undefined` — the current position is terminal, unknown, or the proxy\n * was created without a shape.\n *\n * Proxies carry a `NavShape` through each access so they can stamp and\n * resolve the correct shape on deeper navigation.\n *\n * Navigation never sits at a {@link DeferredShape} — refs are resolved\n * eagerly as soon as the proxy encounters them.\n */\nexport type NavShape = ModelShape | ContainerShape | undefined;\n\n/**\n * Resolve a {@link ModelShape} to the single concrete variant that\n * applies to `value`.\n *\n * Resolution is iterative, not a single step, because a variant may\n * itself be a discriminated group keyed on a *different* field (see\n * {@link DiscriminatedModelShape.byValue}). Each hop reads its own\n * discriminator out of the same `value`, so\n * `{ kind: \"cat\", breed: \"siamese\" }` resolves through `Pet` → `Cat`\n * → `Siamese`. {@link DeferredShape} entries are dereferenced in\n * place, and flat model shapes are returned as-is.\n *\n * When a hop's discriminator can't be read — it is absent, is not a\n * string (the *expression-valued* case), or names an unknown variant —\n * the variant is instead **inferred from the value's structure** by\n * {@link selectVariant}. That inference is sound rather than a guess:\n * ARM would reject a payload that doesn't match the variant its\n * discriminator selects, so a concrete payload determines the variant\n * even when the discriminator itself is only known at deploy time.\n *\n * Bicep takes the same position — a discriminator it can't evaluate at\n * compile time downgrades type checking for that object (diagnostic\n * `BCP225`) rather than failing the build.\n *\n * Returns `undefined` when `shape` is `undefined`, when there is no\n * `value` to infer from, or when the `byValue` graph is cyclic\n * (defensive; the emitter does not produce cycles here).\n *\n * @param shape - The shape to resolve. Flat shapes are returned\n * unchanged, so callers can pass either kind without checking.\n * @param value - The object this shape describes, used both to read\n * discriminators and to infer a variant when they can't be read.\n * Omit it when no value exists (an `Expression<T>` proxy, say) and\n * discriminated shapes will resolve to `undefined`.\n * @param valueKeyedBy - Which naming **`value`'s own keys** use — not\n * the shape's. A {@link FlatModelShape} is the mapping *between* the\n * two sides (one property is `secretVersion` in TypeScript and\n * `version` on the wire), so inference has to read both sides in the\n * same naming or nothing matches:\n *\n * - `\"js\"` — client-facing names, as authored in TypeScript and held\n * in a resource's state. These are\n * {@link FlatModelShape.byJsName}'s own keys. Passed by\n * `lowerState`, on state about to be serialized.\n * - `\"arm\"` — wire names, as they appear in an ARM template or a\n * service response. These are the first segment of each\n * {@link PropertyShape.armPath}. Passed by `raiseState`, on JSON\n * just parsed off the wire.\n *\n * Has no effect when the discriminator resolves normally, and no\n * effect at all for models whose properties map 1:1.\n */\nexport function resolveModelShape(\n shape: ModelShape | undefined,\n value: Record<string, unknown> | undefined,\n valueKeyedBy: \"js\" | \"arm\" = \"js\",\n): FlatModelShape | undefined {\n let current: ModelShape | DeferredShape<ModelShape> | undefined = shape;\n const seen = new Set<ModelShape | DeferredShape<ModelShape>>();\n\n while (current !== undefined) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n\n if (current.kind === \"deferred\") {\n current = current.value();\n continue;\n }\n if (current.kind === \"flatModel\") return current;\n\n const group: DiscriminatedModelShape = current;\n // Read the discriminator under the same naming as `value`'s own\n // keys: JS-side state holds it under the client name, wire JSON\n // under the ARM name. The two coincide for almost every ARM\n // discriminator, but a `@clientName` on the field makes them\n // differ, and reading the wrong one silently downgrades exact\n // dispatch to structural inference below.\n const names = group.discriminator;\n const key = value?.[valueKeyedBy === \"js\" ? names.jsName : names.armName];\n const next = typeof key === \"string\" ? group.byValue[key] : undefined;\n if (next === undefined) {\n return value ? selectVariant(group, value, valueKeyedBy) : undefined;\n }\n current = next;\n }\n\n return undefined;\n}\n\n/**\n * Infer which variant of `group` a value belongs to by structure.\n *\n * Every variant is scored by how many of the value's keys it declares,\n * descending into nested objects and containers so that variants which\n * are indistinguishable at the top level can still be told apart. CDN's\n * delivery-rule actions are exactly that case: all nine variants\n * declare `{ name, parameters }` and differ only inside `parameters`.\n *\n * The highest score wins; ties keep the earliest variant in `byValue`\n * order, which is stable emitter output. A tie means the tied variants\n * declare the same keys for the data given, and the emitter guarantees\n * that keys shared across variants map identically — so either choice\n * produces the same wire mapping for everything actually present.\n */\nfunction selectVariant(\n group: DiscriminatedModelShape,\n value: Record<string, unknown>,\n valueKeyedBy: \"js\" | \"arm\",\n): FlatModelShape | undefined {\n let best: FlatModelShape | undefined;\n let bestScore = -1;\n\n for (const variant of flattenVariants(group, new Set())) {\n const score = scoreShape(variant, value, valueKeyedBy, new WeakSet());\n if (score > bestScore) {\n bestScore = score;\n best = variant;\n }\n }\n\n return best;\n}\n\n/** How many of `value`'s keys, recursively, `shape` accounts for. */\nfunction scoreShape(\n shape: FlatModelShape,\n value: Record<string, unknown>,\n valueKeyedBy: \"js\" | \"arm\",\n visiting: WeakSet<object>,\n): number {\n if (visiting.has(value)) return 0;\n visiting.add(value);\n\n const byKey = getShapePropertiesMap(shape, valueKeyedBy);\n let score = 0;\n\n for (const [key, sub] of Object.entries(value)) {\n const prop = byKey.get(key);\n if (!prop) continue;\n score += 1;\n score += scoreNested(sub, prop.value, valueKeyedBy, visiting);\n }\n\n visiting.delete(value);\n return score;\n}\n\n/**\n * Score one level deeper, through a property's target. Containers are\n * sampled at their first entry — enough to discriminate, and bounded\n * regardless of how large the value is.\n */\nfunction scoreNested(\n value: unknown,\n target: ValueShape | undefined,\n valueKeyedBy: \"js\" | \"arm\",\n visiting: WeakSet<object>,\n): number {\n if (!target || isTerminalValueShape(target) || value === null || typeof value !== \"object\") {\n return 0;\n }\n\n if (target.kind === \"array\") {\n if (!Array.isArray(value) || value.length === 0) return 0;\n return scoreNested(value[0], target.element, valueKeyedBy, visiting);\n }\n\n if (target.kind === \"record\") {\n if (Array.isArray(value)) return 0;\n const first = Object.values(value)[0];\n if (first === undefined) return 0;\n return scoreNested(first, target.value, valueKeyedBy, visiting);\n }\n\n if (target.kind === \"tuple\") {\n if (!Array.isArray(value)) return 0;\n return target.values.reduce(\n (score, tupleValue, index) =>\n score + scoreNested(value[index], tupleValue, valueKeyedBy, visiting),\n 0,\n );\n }\n\n if (Array.isArray(value)) return 0;\n const nested = resolveModelShape(target.value(), value as Record<string, unknown>, valueKeyedBy);\n if (!nested) return 0;\n return scoreShape(nested, value as Record<string, unknown>, valueKeyedBy, visiting);\n}\n\nconst shapePropertiesCache = new WeakMap<\n FlatModelShape,\n Map<\"js\" | \"arm\", Map<string, PropertyShape>>\n>();\n\n/**\n * A shape's properties as a map, keyed by the name they go by in the\n * requested naming. Pass the same naming the value uses and the two\n * line up, which is what lets {@link scoreShape} compare them.\n *\n * Memoized per (shape, naming): scoring calls this once per candidate\n * variant per level, so rebuilding would be wasteful.\n *\n * @param shape - The shape whose properties to map.\n * @param keyedBy - Which name to key by. Note this describes the *map\n * being built*, not an incoming value — unlike the `valueKeyedBy`\n * parameter the callers thread through.\n */\nfunction getShapePropertiesMap(\n shape: FlatModelShape,\n keyedBy: \"js\" | \"arm\",\n): Map<string, PropertyShape> {\n let byNaming = shapePropertiesCache.get(shape);\n if (!byNaming) {\n byNaming = new Map();\n shapePropertiesCache.set(shape, byNaming);\n }\n let byKey = byNaming.get(keyedBy);\n if (byKey) return byKey;\n\n byKey = new Map<string, PropertyShape>();\n for (const [jsName, prop] of Object.entries(shape.byJsName)) {\n // `armPath[0]` rather than the whole path: that is the top-level\n // wire key, even for properties hoisted through `@flattenProperty`.\n const key = keyedBy === \"js\" ? jsName : prop.armPath[0];\n // First writer wins, so a hoisted property never shadows the\n // wrapper it was hoisted through.\n if (key !== undefined && !byKey.has(key)) byKey.set(key, prop);\n }\n byNaming.set(keyedBy, byKey);\n return byKey;\n}\n\n/**\n * Flatten a group to the concrete flat shapes underneath it,\n * dereferencing thunks and descending through nested groups.\n */\nfunction flattenVariants(\n group: DiscriminatedModelShape,\n seen: Set<DiscriminatedModelShape>,\n): FlatModelShape[] {\n if (seen.has(group)) return [];\n seen.add(group);\n\n const out: FlatModelShape[] = [];\n for (const key of Object.keys(group.byValue)) {\n let entry: ModelShape | DeferredShape<ModelShape> | undefined = group.byValue[key];\n if (entry?.kind === \"deferred\") entry = entry.value();\n if (entry === undefined) continue;\n if (entry.kind === \"flatModel\") out.push(entry);\n else out.push(...flattenVariants(entry, seen));\n }\n return out;\n}\n\n/**\n * Navigate `nav` one step deeper using `segment`. For string segments\n * (`.foo`) at a model position, returns the property's shape entry as\n * `stamp` and advances `next` into the property's target. For numeric\n * segments (`[i]`) or string keys at a record position, peels one\n * container layer; `stamp` is always `undefined`.\n *\n * Returns `{ stamp: undefined, next: undefined }` when the step can't\n * be resolved (unknown property, out-of-shape access, etc.) — the\n * access is treated as passthrough.\n *\n * @param nav - Where navigation currently sits.\n * @param segment - The member name or array index being accessed.\n * @param value - The value sitting at `nav`, when the caller has one.\n * Consulted only at a {@link DiscriminatedModelShape} position, to\n * select the variant via {@link resolveModelShape}. Always read with\n * `\"js\"` naming, since navigation follows client-facing property\n * names. Callers with no value — an `Expression<T>` proxy, for\n * instance — omit it and get passthrough for discriminated\n * positions, which is the honest answer when the variant is\n * unknowable.\n */\nexport function navigateShape(\n nav: NavShape,\n segment: string | number,\n value?: unknown,\n): { readonly stamp: PropertyShape | undefined; readonly next: NavShape } {\n if (typeof segment === \"number\") {\n return { stamp: undefined, next: peelContainer(nav, segment) };\n }\n if (isModelShape(nav)) {\n const flat = resolveModelShape(nav, asRecord(value));\n const stamp = flat?.byJsName[segment];\n if (!stamp) return { stamp: undefined, next: undefined };\n return { stamp, next: derefTarget(stamp.value) };\n }\n // String segment against a container — treat as a record key access.\n if (nav && nav.kind === \"record\") {\n return { stamp: undefined, next: derefTarget(nav.value) };\n }\n return { stamp: undefined, next: undefined };\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction isModelShape(nav: NavShape): nav is ModelShape {\n return nav !== undefined && (nav.kind === \"flatModel\" || nav.kind === \"discriminatedModel\");\n}\n\n/**\n * Peel one container layer off `nav`. Returns `undefined` for\n * non-containers (caller treats the step as passthrough).\n */\nfunction peelContainer(nav: NavShape, index: number): NavShape {\n if (!nav || isModelShape(nav)) return undefined;\n if (nav.kind === \"array\") return derefTarget(nav.element);\n if (nav.kind === \"record\") return derefTarget(nav.value);\n return derefTarget(nav.values[index]);\n}\n\n/**\n * Convert a {@link ValueShape} — where a property *points* — into a\n * {@link NavShape} — where navigation now *is*.\n *\n * The only real work is forcing a {@link DeferredShape} thunk; the\n * resolved model becomes the new position whether or not it is\n * discriminated, since {@link navigateShape} can look up properties on\n * either. Container shapes pass through unchanged, pending an index\n * step.\n *\n * Deliberately *not* named `resolve*` — that prefix belongs to\n * {@link resolveModelShape}, which picks a variant and is a much\n * heavier operation.\n */\nfunction derefTarget(shape: ValueShape | undefined): NavShape {\n if (!shape || isTerminalValueShape(shape)) return undefined;\n if (shape.kind === \"deferred\") return shape.value();\n return shape;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../../src/shape/shape.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAqTlC,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,QAAuC,EAAkB,EAAE,CAAC,CAAC;IAChG,IAAI,EAAE,WAAW;IACjB,QAAQ;CACT,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAC3C,aAA0C,EAC1C,OAA+D,EACtC,EAAE,CAAC,CAAC;IAC7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AAO,CAAC,CAAC;IAC1D,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzD,OAAO,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,SAAS,WAAW,CAAC,KAA6B;IAChD,IAAI,CAAC,KAAK,IAAI,oBAAoB,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACpD,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Runtime types for ARM shape information.\n *\n * A `ModelShape` is generated once per emitted Model and describes how\n * to map JS-ergonomic property names + structure to the underlying ARM\n * wire shape. The shapes are consumed by the serialization `convertToArmObject`\n * pass (and its inverse `convertFromArmObject`) which rewrites state keys and\n * re-nests `@flattenProperty` paths just before serialization /\n * after deserialization.\n *\n * These types are an internal cross-package runtime contract; generated code\n * imports them from `@azure/provisioning-core/internal`.\n *\n * Nested-shape thunks ({@link DeferredShape}) defer dereferencing the\n * inner shape constant until use, so mutually-referential or\n * self-referential models can be emitted without initialization-order\n * problems.\n *\n * A model shape comes in two flavors:\n * - `FlatModelShape` ({@link FlatModelShape}): the common case —\n * one shape per concrete model.\n * - `DiscriminatedModelShape` ({@link DiscriminatedModelShape}): a\n * name-discriminated variant group. ARM permits multiple resources\n * to share an ARM `type` + `apiVersion` pair and disambiguate via a\n * fixed field — e.g. `Microsoft.ApiManagement/service/portalsettings@2024-05-01`\n * has three variants with `name: 'signin' | 'signup' | 'delegation'`\n * and distinct `properties` shapes. The same machinery applies to\n * nested models that use a `@discriminator` field.\n */\nimport type {\n BooleanValueEncodingDescriptor,\n BytesValueEncodingDescriptor,\n DateValueEncodingDescriptor,\n NumberValueEncodingDescriptor,\n NumericStringEncodingDescriptor,\n StringValueEncodingDescriptor,\n} from \"./value-encoding.js\";\n\n/** The standard single-model shape. */\nexport interface FlatModelShape {\n /**\n * Tag for tag-dispatched discrimination on {@link NavShape} and\n * {@link ModelShape}. Always `\"flatModel\"`.\n */\n readonly kind: \"flatModel\";\n /**\n * Map, keyed by JS-side (client-facing) property name, of how that\n * property maps to the ARM wire shape. Property names not present in\n * this map are assumed to be pass-through (identity mapping).\n */\n readonly byJsName: { readonly [jsName: string]: PropertyShape };\n}\n\n/**\n * The two names a discriminator field goes by.\n *\n * Usually identical — ARM discriminators are `type`, `name`, `kind` and\n * service teams rarely rename them — but a `@clientName` on the field\n * makes them differ, and the two are looked up in different keyspaces:\n * JS-side state is keyed by {@link jsName}, wire JSON by\n * {@link armName}. Carrying both is what lets a discriminated shape\n * resolve in either direction.\n */\nexport interface DiscriminatorNames {\n /** Client-facing name, as authored in TypeScript and held in state. */\n readonly jsName: string;\n /** Wire-level name, as it appears in an ARM template or response. */\n readonly armName: string;\n}\n\n/**\n * A name-discriminated group of variants that share one parent key\n * (an ARM `(type, apiVersion)` at the registry level, or a parent\n * model's `@discriminator` field elsewhere). The `discriminator` names\n * the field whose value selects a variant.\n */\nexport interface DiscriminatedModelShape {\n readonly kind: \"discriminatedModel\";\n /** Names of the field used to select a variant. */\n readonly discriminator: DiscriminatorNames;\n /**\n * Map from discriminator value (e.g. `\"signin\"`) to the shape for\n * that variant. A value with no entry here doesn't end resolution —\n * {@link resolveModelShape} infers the variant from the payload's\n * structure instead.\n *\n * Entries may be:\n * - a {@link FlatModelShape} — the terminal, common case;\n * - a {@link DeferredShape} — breaks emit-order / cyclic-reference\n * hazards, exactly as {@link PropertyShape.value} does;\n * - a nested {@link DiscriminatedModelShape} — a variant that is\n * itself a discriminated base on a *different* field. TypeSpec\n * permits this (`@discriminator(\"kind\") model Pet`, then\n * `@discriminator(\"breed\") model Cat extends Pet`), so selecting\n * a concrete shape may take more than one hop. See\n * {@link resolveModelShape}.\n *\n * Note that a hierarchy re-using the *same* discriminator field at\n * every level (abstract intermediates) is flattened by the emitter\n * into a single level here — only a change of discriminator field\n * produces a nested entry.\n */\n readonly byValue: {\n readonly [value: string]: ModelShape | DeferredShape<ModelShape>;\n };\n}\n\n/** A single model's shape — either flat or discriminated. */\nexport type ModelShape = FlatModelShape | DiscriminatedModelShape;\n\n/**\n * What `registerShape` stores in the global registry, keyed by\n * `(armType, apiVersion)`. Same structural type as {@link ModelShape};\n * the alias documents intent at the registry boundary.\n */\nexport type ResourceShape = ModelShape;\n\n/** A single property's shape entry. */\nexport interface PropertyShape {\n /**\n * ARM wire path from the owning model's root to this property.\n * Single-segment for direct properties; multi-segment for properties\n * hoisted through one or more `@flattenProperty` wrappers.\n */\n readonly armPath: readonly string[];\n\n /**\n * Describes this property's value for navigation and wire conversion.\n * Model and container shapes recurse into nested values; a\n * {@link TerminalValueShape} explicitly terminates recursion. Scalar\n * terminal shapes carry only the encodings valid for their client-side\n * JavaScript representation.\n */\n readonly value: ValueShape;\n\n /**\n * `true` when ARM treats this property as server-set (visible in GET\n * responses but rejected on PUT). Omitted (i.e. `undefined`/`false`)\n * for writable properties.\n *\n * Currently consumed by the `Resource` constructor's deployment-context\n * inheritance to skip readonly properties (notably `location` on many\n * child resources where the field exists in the read model only).\n */\n readonly readOnly?: boolean;\n}\n\n/**\n * Deferred reference to a shape value. The thunk is called on\n * dereference so the actual shape lookup is deferred.\n *\n * **Why this exists instead of embedding the shape directly.**\n *\n * Model shapes frequently reference each other — a model's properties\n * can point to other models, and ARM types include both self-\n * referential (tree-like) and mutually-referential (cyclic) structures.\n * If we embedded a {@link ModelShape} value directly inside another\n * model shape's value field, both shapes would need to be fully\n * initialized when the parent is constructed. That's impossible\n * whenever:\n *\n * - A model references itself, e.g. `TreeNode { children: TreeNode[] }`.\n * - Two models reference each other, e.g. `A { b?: B }` and `B { a?: A }`.\n * - Two modules each define shapes that reference shapes from the other.\n *\n * In all three cases the second constant is in the Temporal Dead Zone\n * when the first one's literal evaluates, and the runtime throws\n * `ReferenceError: Cannot access ... before initialization`.\n *\n * Wrapping the reference in a thunk solves it. The closure captures\n * the *binding name*, not its current value. The lookup happens later\n * when the thunk is called — by which time the module graph has\n * finished evaluating and both shapes are fully constructed.\n *\n * Only the model variant of {@link ValueShape} carries a reference —\n * container shapes (`array`, `record`) are eager because they don't\n * reference any module-level binding directly; the inner reference\n * deeper down handles cycle-breaking.\n */\nexport interface DeferredShape<T> {\n readonly kind: \"deferred\";\n readonly value: () => T;\n}\n\n/** An array-of-T property/container shape. */\nexport interface ArrayShape {\n readonly kind: \"array\";\n readonly element: ValueShape;\n}\n\n/** A `Record<string, T>` property/container shape. */\nexport interface RecordShape {\n readonly kind: \"record\";\n readonly value: ValueShape;\n}\n\n/** A fixed-length heterogeneous tuple property/container shape. */\nexport interface TupleShape {\n readonly kind: \"tuple\";\n readonly values: readonly ValueShape[];\n}\n\n/** A TypeSpec scalar rendered as TypeScript `any`. */\nexport interface AnyShape {\n readonly kind: \"any\";\n}\n\n/** A scalar whose client-side JavaScript representation is `string`. */\nexport interface StringShape {\n readonly kind: \"string\";\n readonly encoding?: StringValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `boolean`. */\nexport interface BooleanShape {\n readonly kind: \"boolean\";\n readonly encoding?: BooleanValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `number`. */\nexport interface NumberShape {\n readonly kind: \"number\";\n readonly encoding?: NumberValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `Uint8Array`. */\nexport interface BytesShape {\n readonly kind: \"bytes\";\n readonly encoding?: BytesValueEncodingDescriptor;\n}\n\n/** A scalar whose client-side JavaScript representation is `Date`. */\nexport interface DateShape {\n readonly kind: \"date\";\n readonly encoding?: DateValueEncodingDescriptor;\n}\n\n/** A terminal TypeSpec string literal. Literals cannot carry `@encode`. */\nexport interface StringLiteralShape {\n readonly kind: \"stringLiteral\";\n}\n\n/** A terminal TypeSpec numeric literal. */\nexport interface NumberLiteralShape {\n readonly kind: \"numberLiteral\";\n /** `@encode(string)` when the numeric literal is exposed as wire text. */\n readonly encoding?: NumericStringEncodingDescriptor;\n}\n\n/** A terminal TypeSpec boolean literal. */\nexport interface BooleanLiteralShape {\n readonly kind: \"booleanLiteral\";\n /** `@encode(string)` while the client value remains a boolean literal. */\n readonly encoding?: BooleanValueEncodingDescriptor;\n}\n\n/** A terminal TypeSpec enum. Enums cannot carry `@encode`. */\nexport interface EnumShape {\n readonly kind: \"enum\";\n}\n\n/**\n * A terminal TypeSpec union for which no single structural shape can be\n * selected. Unions cannot carry `@encode` in the provisioning emitter.\n */\nexport interface UnionShape {\n readonly kind: \"union\";\n}\n\n/** The TypeSpec `null` intrinsic. */\nexport interface NullShape {\n readonly kind: \"null\";\n}\n\n/**\n * Concrete terminal values in the generated client API.\n *\n * Scalar kinds describe the JavaScript value accepted by the generated\n * TypeScript surface, not necessarily the semantic TypeSpec scalar. For\n * example, a numeric `duration` is a {@link NumberShape}, while the default\n * ISO8601 duration is a {@link StringShape}; their narrowed `encoding` fields\n * retain the TypeSpec source semantics needed for wire conversion. Numeric and\n * boolean literal shapes can carry the same narrowly applicable encodings that\n * TypeSpec permits on those values. String literals, enums, unions, and null\n * remain distinct non-encodable terminal categories.\n * Expressions are orthogonal wrappers around any value shape and are handled\n * before shape-directed conversion.\n */\nexport type TerminalValueShape =\n | AnyShape\n | StringShape\n | BooleanShape\n | NumberShape\n | BytesShape\n | DateShape\n | StringLiteralShape\n | NumberLiteralShape\n | BooleanLiteralShape\n | EnumShape\n | UnionShape\n | NullShape;\n\n/** A container through which property navigation can continue. */\nexport type ContainerShape = ArrayShape | RecordShape | TupleShape;\n\nexport type ValueShape = TerminalValueShape | DeferredShape<ModelShape> | ContainerShape;\n\n// ---------------------------------------------------------------------------\n// Constructor helpers\n// ---------------------------------------------------------------------------\n\n/** Build a {@link FlatModelShape} from a property map. */\nexport const createFlatModelShape = (byJsName: Record<string, PropertyShape>): FlatModelShape => ({\n kind: \"flatModel\",\n byJsName,\n});\n\n/**\n * Build a {@link DiscriminatedModelShape}.\n *\n * Pass a bare string when the field goes by the same name on both\n * sides, which is the overwhelmingly common case; pass a\n * {@link DiscriminatorNames} pair when a `@clientName` makes them\n * differ.\n */\nexport const createDiscriminatedModelShape = (\n discriminator: string | DiscriminatorNames,\n byValue: Record<string, ModelShape | DeferredShape<ModelShape>>,\n): DiscriminatedModelShape => ({\n kind: \"discriminatedModel\",\n discriminator:\n typeof discriminator === \"string\"\n ? { jsName: discriminator, armName: discriminator }\n : discriminator,\n byValue,\n});\n\n/**\n * Build a {@link DeferredShape}. The thunk is called on dereference; defer\n * the actual shape lookup so that mutually-referential constants can\n * be emitted in any order.\n */\nexport const createDeferredShape = <T>(value: () => T): DeferredShape<T> => ({\n kind: \"deferred\",\n value,\n});\n\n/** Build an {@link AnyShape}. */\nexport const createAnyShape = (): AnyShape => ({ kind: \"any\" });\n\n/** Build a {@link StringShape}, optionally with a compatible wire encoding. */\nexport const createStringShape = (encoding?: StringValueEncodingDescriptor): StringShape => ({\n kind: \"string\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link BooleanShape}, optionally with a compatible wire encoding. */\nexport const createBooleanShape = (encoding?: BooleanValueEncodingDescriptor): BooleanShape => ({\n kind: \"boolean\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link NumberShape}, optionally with a compatible wire encoding. */\nexport const createNumberShape = (encoding?: NumberValueEncodingDescriptor): NumberShape => ({\n kind: \"number\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link BytesShape}, optionally with a compatible wire encoding. */\nexport const createBytesShape = (encoding?: BytesValueEncodingDescriptor): BytesShape => ({\n kind: \"bytes\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a {@link DateShape}, optionally with a compatible wire encoding. */\nexport const createDateShape = (encoding?: DateValueEncodingDescriptor): DateShape => ({\n kind: \"date\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link StringLiteralShape}. */\nexport const createStringLiteralShape = (): StringLiteralShape => ({\n kind: \"stringLiteral\",\n});\n\n/** Build a terminal {@link NumberLiteralShape}. */\nexport const createNumberLiteralShape = (\n encoding?: NumericStringEncodingDescriptor,\n): NumberLiteralShape => ({\n kind: \"numberLiteral\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link BooleanLiteralShape}. */\nexport const createBooleanLiteralShape = (\n encoding?: BooleanValueEncodingDescriptor,\n): BooleanLiteralShape => ({\n kind: \"booleanLiteral\",\n ...(encoding ? { encoding } : {}),\n});\n\n/** Build a terminal {@link EnumShape}. */\nexport const createEnumShape = (): EnumShape => ({ kind: \"enum\" });\n\n/** Build a terminal {@link UnionShape}. */\nexport const createUnionShape = (): UnionShape => ({ kind: \"union\" });\n\n/** Build a terminal {@link NullShape}. */\nexport const createNullShape = (): NullShape => ({ kind: \"null\" });\n\n/** Build an {@link ArrayShape}. */\nexport const createArrayShape = (element: ValueShape): ArrayShape => ({\n kind: \"array\",\n element,\n});\n\n/** Build a {@link RecordShape}. */\nexport const createRecordShape = (value: ValueShape): RecordShape => ({\n kind: \"record\",\n value,\n});\n\n/** Build a {@link TupleShape}. */\nexport const createTupleShape = (values: readonly ValueShape[]): TupleShape => ({\n kind: \"tuple\",\n values,\n});\n\n/** Return whether a value shape terminates property navigation. */\nexport function isTerminalValueShape(shape: ValueShape): shape is TerminalValueShape {\n switch (shape.kind) {\n case \"any\":\n case \"string\":\n case \"boolean\":\n case \"number\":\n case \"bytes\":\n case \"date\":\n case \"stringLiteral\":\n case \"numberLiteral\":\n case \"booleanLiteral\":\n case \"enum\":\n case \"union\":\n case \"null\":\n return true;\n case \"deferred\":\n case \"array\":\n case \"record\":\n case \"tuple\":\n return false;\n default:\n return assertNeverShape(shape);\n }\n}\n\nfunction assertNeverShape(shape: never): never {\n throw new Error(`Unhandled value shape: ${String(shape)}`);\n}\n\n// ---------------------------------------------------------------------------\n// Helpers used by the runtime proxy + lowering pass\n// ---------------------------------------------------------------------------\n\n/**\n * Runtime navigation position for a typed proxy. Either:\n * - a {@link ModelShape} — we're at a model's properties, whether or\n * not its variant is known,\n * - a {@link ContainerShape} — we're at a container that hasn't yet been\n * indexed,\n * - `undefined` — the current position is terminal, unknown, or the proxy\n * was created without a shape.\n *\n * Proxies carry a `NavShape` through each access so they can stamp and\n * resolve the correct shape on deeper navigation.\n *\n * Navigation never sits at a {@link DeferredShape} — refs are resolved\n * eagerly as soon as the proxy encounters them.\n */\nexport type NavShape = ModelShape | ContainerShape | undefined;\n\n/**\n * Resolve a {@link ModelShape} to the single concrete variant that\n * applies to `value`.\n *\n * Resolution is iterative, not a single step, because a variant may\n * itself be a discriminated group keyed on a *different* field (see\n * {@link DiscriminatedModelShape.byValue}). Each hop reads its own\n * discriminator out of the same `value`, so\n * `{ kind: \"cat\", breed: \"siamese\" }` resolves through `Pet` → `Cat`\n * → `Siamese`. {@link DeferredShape} entries are dereferenced in\n * place, and flat model shapes are returned as-is.\n *\n * When a hop's discriminator can't be read — it is absent, is not a\n * string (the *expression-valued* case), or names an unknown variant —\n * the variant is instead **inferred from the value's structure** by\n * {@link selectVariant}. That inference is sound rather than a guess:\n * ARM would reject a payload that doesn't match the variant its\n * discriminator selects, so a concrete payload determines the variant\n * even when the discriminator itself is only known at deploy time.\n *\n * Bicep takes the same position — a discriminator it can't evaluate at\n * compile time downgrades type checking for that object (diagnostic\n * `BCP225`) rather than failing the build.\n *\n * Returns `undefined` when `shape` is `undefined`, when there is no\n * `value` to infer from, or when the `byValue` graph is cyclic\n * (defensive; the emitter does not produce cycles here).\n *\n * @param shape - The shape to resolve. Flat shapes are returned\n * unchanged, so callers can pass either kind without checking.\n * @param value - The object this shape describes, used both to read\n * discriminators and to infer a variant when they can't be read.\n * Omit it when no value exists (an `Expression<T>` proxy, say) and\n * discriminated shapes will resolve to `undefined`.\n * @param valueKeyedBy - Which naming **`value`'s own keys** use — not\n * the shape's. A {@link FlatModelShape} is the mapping *between* the\n * two sides (one property is `secretVersion` in TypeScript and\n * `version` on the wire), so inference has to read both sides in the\n * same naming or nothing matches:\n *\n * - `\"js\"` — client-facing names, as authored in TypeScript and held\n * in a resource's state. These are\n * {@link FlatModelShape.byJsName}'s own keys. Passed by\n * `convertToArmObject`, on state about to be serialized.\n * - `\"arm\"` — wire names, as they appear in an ARM template or a\n * service response. These are the first segment of each\n * {@link PropertyShape.armPath}. Passed by `convertFromArmObject`, on JSON\n * just parsed off the wire.\n *\n * Has no effect when the discriminator resolves normally, and no\n * effect at all for models whose properties map 1:1.\n */\nexport function resolveModelShape(\n shape: ModelShape | undefined,\n value: Record<string, unknown> | undefined,\n valueKeyedBy: \"js\" | \"arm\" = \"js\",\n): FlatModelShape | undefined {\n let current: ModelShape | DeferredShape<ModelShape> | undefined = shape;\n const seen = new Set<ModelShape | DeferredShape<ModelShape>>();\n\n while (current !== undefined) {\n if (seen.has(current)) return undefined;\n seen.add(current);\n\n if (current.kind === \"deferred\") {\n current = current.value();\n continue;\n }\n if (current.kind === \"flatModel\") return current;\n\n const group: DiscriminatedModelShape = current;\n // Read the discriminator under the same naming as `value`'s own\n // keys: JS-side state holds it under the client name, wire JSON\n // under the ARM name. The two coincide for almost every ARM\n // discriminator, but a `@clientName` on the field makes them\n // differ, and reading the wrong one silently downgrades exact\n // dispatch to structural inference below.\n const names = group.discriminator;\n const key = value?.[valueKeyedBy === \"js\" ? names.jsName : names.armName];\n const next = typeof key === \"string\" ? group.byValue[key] : undefined;\n if (next === undefined) {\n return value ? selectVariant(group, value, valueKeyedBy) : undefined;\n }\n current = next;\n }\n\n return undefined;\n}\n\n/**\n * Infer which variant of `group` a value belongs to by structure.\n *\n * Every variant is scored by how many of the value's keys it declares,\n * descending into nested objects and containers so that variants which\n * are indistinguishable at the top level can still be told apart. CDN's\n * delivery-rule actions are exactly that case: all nine variants\n * declare `{ name, parameters }` and differ only inside `parameters`.\n *\n * The highest score wins; ties keep the earliest variant in `byValue`\n * order, which is stable emitter output. A tie means the tied variants\n * declare the same keys for the data given, and the emitter guarantees\n * that keys shared across variants map identically — so either choice\n * produces the same wire mapping for everything actually present.\n */\nfunction selectVariant(\n group: DiscriminatedModelShape,\n value: Record<string, unknown>,\n valueKeyedBy: \"js\" | \"arm\",\n): FlatModelShape | undefined {\n let best: FlatModelShape | undefined;\n let bestScore = -1;\n\n for (const variant of flattenVariants(group, new Set())) {\n const score = scoreShape(variant, value, valueKeyedBy, new WeakSet());\n if (score > bestScore) {\n bestScore = score;\n best = variant;\n }\n }\n\n return best;\n}\n\n/** How many of `value`'s keys, recursively, `shape` accounts for. */\nfunction scoreShape(\n shape: FlatModelShape,\n value: Record<string, unknown>,\n valueKeyedBy: \"js\" | \"arm\",\n visiting: WeakSet<object>,\n): number {\n if (visiting.has(value)) return 0;\n visiting.add(value);\n\n const byKey = getShapePropertiesMap(shape, valueKeyedBy);\n let score = 0;\n\n for (const [key, sub] of Object.entries(value)) {\n const prop = byKey.get(key);\n if (!prop) continue;\n score += 1;\n score += scoreNested(sub, prop.value, valueKeyedBy, visiting);\n }\n\n visiting.delete(value);\n return score;\n}\n\n/**\n * Score one level deeper, through a property's target. Containers are\n * sampled at their first entry — enough to discriminate, and bounded\n * regardless of how large the value is.\n */\nfunction scoreNested(\n value: unknown,\n target: ValueShape | undefined,\n valueKeyedBy: \"js\" | \"arm\",\n visiting: WeakSet<object>,\n): number {\n if (!target || isTerminalValueShape(target) || value === null || typeof value !== \"object\") {\n return 0;\n }\n\n if (target.kind === \"array\") {\n if (!Array.isArray(value) || value.length === 0) return 0;\n return scoreNested(value[0], target.element, valueKeyedBy, visiting);\n }\n\n if (target.kind === \"record\") {\n if (Array.isArray(value)) return 0;\n const first = Object.values(value)[0];\n if (first === undefined) return 0;\n return scoreNested(first, target.value, valueKeyedBy, visiting);\n }\n\n if (target.kind === \"tuple\") {\n if (!Array.isArray(value)) return 0;\n return target.values.reduce(\n (score, tupleValue, index) =>\n score + scoreNested(value[index], tupleValue, valueKeyedBy, visiting),\n 0,\n );\n }\n\n if (Array.isArray(value)) return 0;\n const nested = resolveModelShape(target.value(), value as Record<string, unknown>, valueKeyedBy);\n if (!nested) return 0;\n return scoreShape(nested, value as Record<string, unknown>, valueKeyedBy, visiting);\n}\n\nconst shapePropertiesCache = new WeakMap<\n FlatModelShape,\n Map<\"js\" | \"arm\", Map<string, PropertyShape>>\n>();\n\n/**\n * A shape's properties as a map, keyed by the name they go by in the\n * requested naming. Pass the same naming the value uses and the two\n * line up, which is what lets {@link scoreShape} compare them.\n *\n * Memoized per (shape, naming): scoring calls this once per candidate\n * variant per level, so rebuilding would be wasteful.\n *\n * @param shape - The shape whose properties to map.\n * @param keyedBy - Which name to key by. Note this describes the *map\n * being built*, not an incoming value — unlike the `valueKeyedBy`\n * parameter the callers thread through.\n */\nfunction getShapePropertiesMap(\n shape: FlatModelShape,\n keyedBy: \"js\" | \"arm\",\n): Map<string, PropertyShape> {\n let byNaming = shapePropertiesCache.get(shape);\n if (!byNaming) {\n byNaming = new Map();\n shapePropertiesCache.set(shape, byNaming);\n }\n let byKey = byNaming.get(keyedBy);\n if (byKey) return byKey;\n\n byKey = new Map<string, PropertyShape>();\n for (const [jsName, prop] of Object.entries(shape.byJsName)) {\n // `armPath[0]` rather than the whole path: that is the top-level\n // wire key, even for properties hoisted through `@flattenProperty`.\n const key = keyedBy === \"js\" ? jsName : prop.armPath[0];\n // First writer wins, so a hoisted property never shadows the\n // wrapper it was hoisted through.\n if (key !== undefined && !byKey.has(key)) byKey.set(key, prop);\n }\n byNaming.set(keyedBy, byKey);\n return byKey;\n}\n\n/**\n * Flatten a group to the concrete flat shapes underneath it,\n * dereferencing thunks and descending through nested groups.\n */\nfunction flattenVariants(\n group: DiscriminatedModelShape,\n seen: Set<DiscriminatedModelShape>,\n): FlatModelShape[] {\n if (seen.has(group)) return [];\n seen.add(group);\n\n const out: FlatModelShape[] = [];\n for (const key of Object.keys(group.byValue)) {\n let entry: ModelShape | DeferredShape<ModelShape> | undefined = group.byValue[key];\n if (entry?.kind === \"deferred\") entry = entry.value();\n if (entry === undefined) continue;\n if (entry.kind === \"flatModel\") out.push(entry);\n else out.push(...flattenVariants(entry, seen));\n }\n return out;\n}\n\n/**\n * Navigate `nav` one step deeper using `segment`. For string segments\n * (`.foo`) at a model position, returns the property's shape entry as\n * `stamp` and advances `next` into the property's target. For numeric\n * segments (`[i]`) or string keys at a record position, peels one\n * container layer; `stamp` is always `undefined`.\n *\n * Returns `{ stamp: undefined, next: undefined }` when the step can't\n * be resolved (unknown property, out-of-shape access, etc.) — the\n * access is treated as passthrough.\n *\n * @param nav - Where navigation currently sits.\n * @param segment - The member name or array index being accessed.\n * @param value - The value sitting at `nav`, when the caller has one.\n * Consulted only at a {@link DiscriminatedModelShape} position, to\n * select the variant via {@link resolveModelShape}. Always read with\n * `\"js\"` naming, since navigation follows client-facing property\n * names. Callers with no value — an `Expression<T>` proxy, for\n * instance — omit it and get passthrough for discriminated\n * positions, which is the honest answer when the variant is\n * unknowable.\n */\nexport function navigateShape(\n nav: NavShape,\n segment: string | number,\n value?: unknown,\n): { readonly stamp: PropertyShape | undefined; readonly next: NavShape } {\n if (typeof segment === \"number\") {\n return { stamp: undefined, next: peelContainer(nav, segment) };\n }\n if (isModelShape(nav)) {\n const flat = resolveModelShape(nav, asRecord(value));\n const stamp = flat?.byJsName[segment];\n if (!stamp) return { stamp: undefined, next: undefined };\n return { stamp, next: derefTarget(stamp.value) };\n }\n // String segment against a container — treat as a record key access.\n if (nav && nav.kind === \"record\") {\n return { stamp: undefined, next: derefTarget(nav.value) };\n }\n return { stamp: undefined, next: undefined };\n}\n\nfunction asRecord(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\nfunction isModelShape(nav: NavShape): nav is ModelShape {\n return nav !== undefined && (nav.kind === \"flatModel\" || nav.kind === \"discriminatedModel\");\n}\n\n/**\n * Peel one container layer off `nav`. Returns `undefined` for\n * non-containers (caller treats the step as passthrough).\n */\nfunction peelContainer(nav: NavShape, index: number): NavShape {\n if (!nav || isModelShape(nav)) return undefined;\n if (nav.kind === \"array\") return derefTarget(nav.element);\n if (nav.kind === \"record\") return derefTarget(nav.value);\n return derefTarget(nav.values[index]);\n}\n\n/**\n * Convert a {@link ValueShape} — where a property *points* — into a\n * {@link NavShape} — where navigation now *is*.\n *\n * The only real work is forcing a {@link DeferredShape} thunk; the\n * resolved model becomes the new position whether or not it is\n * discriminated, since {@link navigateShape} can look up properties on\n * either. Container shapes pass through unchanged, pending an index\n * step.\n *\n * Deliberately *not* named `resolve*` — that prefix belongs to\n * {@link resolveModelShape}, which picks a variant and is a much\n * heavier operation.\n */\nfunction derefTarget(shape: ValueShape | undefined): NavShape {\n if (!shape || isTerminalValueShape(shape)) return undefined;\n if (shape.kind === \"deferred\") return shape.value();\n return shape;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure/provisioning-core",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "Core primitives for the Azure Provisioning library",
|
|
5
5
|
"sdk-type": "provisioning",
|
|
6
6
|
"autoPublish": false,
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/provisioning-core/README.md",
|
|
78
78
|
"prettier": "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
79
79
|
"dependencies": {
|
|
80
|
+
"@eslint-community/regexpp": "^4.12.2",
|
|
80
81
|
"pluralize": "^8.0.0",
|
|
81
82
|
"tslib": "^2.8.1"
|
|
82
83
|
},
|
|
@@ -110,7 +111,7 @@
|
|
|
110
111
|
"lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]",
|
|
111
112
|
"pack": "pnpm pack 2>&1",
|
|
112
113
|
"test": "tsc -b --noEmit && npm run test:node && npm run test:browser",
|
|
113
|
-
"test:browser": "
|
|
114
|
+
"test:browser": "echo skipped",
|
|
114
115
|
"test:node": "dev-tool run test:vitest --no-test-proxy",
|
|
115
116
|
"update-snippets": "dev-tool run update-snippets"
|
|
116
117
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../../../../src/serialization/contract/generated/ast.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,GAAG,QAAQ,CAAC;AAE1F;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAEvF;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,GAAG,GACH,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAET;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtC;;;GAGG;AACH,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,UAAU,GACV,WAAW,GACX,oBAAoB,GACpB,sBAAsB,GACtB,8BAA8B,GAC9B,wBAAwB,GACxB,qBAAqB,GACrB,yBAAyB,GACzB,wBAAwB,GACxB,0BAA0B,GAC1B,qBAAqB,GACrB,aAAa,GACb,4BAA4B,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,iBAAiB,GACjB,iBAAiB,GACjB,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,GACtB,mBAAmB,GACnB,aA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AAW,qBAAqB;IACpC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAC;IACnC,QAAQ,CAAC,UAAU,CAAC,EAAE,cAAc,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;CACvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../../src/serialization/contract/generated/ast.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAoGlC;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAA8C;IAC3E,GAAG,EAAE,IAAI;IACT,KAAK,EAAE,IAAI;IACX,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,IAAI;IACT,MAAM,EAAE,IAAI;IACZ,MAAM,EAAE,IAAI;CACb,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAClD,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * The deployment scope for a Bicep file.\n */\nexport type TargetScope = \"resourceGroup\" | \"subscription\" | \"managementGroup\" | \"tenant\";\n\n/**\n * The set of Bicep primitive type names.\n */\nexport type PrimitiveTypeName = \"any\" | \"array\" | \"bool\" | \"int\" | \"object\" | \"string\";\n\n/**\n * Binary operators supported in Bicep expressions.\n */\nexport type BinaryOperator =\n | \"%\"\n | \"*\"\n | \"+\"\n | \"-\"\n | \"/\"\n | \"<\"\n | \"<=\"\n | \"==\"\n | \"!=\"\n | \"=~\"\n | \"!~\"\n | \">\"\n | \">=\"\n | \"&&\"\n | \"||\"\n | \"??\";\n\n/**\n * Unary operators supported in Bicep expressions.\n */\nexport type UnaryOperator = \"!\" | \"-\";\n\n/**\n * Discriminated union of all expression node types.\n * This includes all ValueNode variants plus expression-specific variants.\n */\nexport type ExpressionNode =\n | NullValue\n | BooleanValue\n | IntegerValue\n | StringValue\n | ArrayValue\n | ObjectValue\n | IdentifierExpression\n | FunctionCallExpression\n | InstanceFunctionCallExpression\n | PropertyAccessExpression\n | ArrayAccessExpression\n | BinaryOperationExpression\n | UnaryOperationExpression\n | TernaryOperationExpression\n | IfConditionExpression\n | ForExpression\n | InterpolatedStringExpression;\n\n/**\n * Discriminated union of all type node kinds.\n */\nexport type TypeNode =\n | PrimitiveTypeNode\n | TypeReferenceNode\n | StringTypeLiteralNode\n | IntegerTypeLiteralNode\n | BooleanTypeLiteralNode\n | NullTypeLiteralNode\n | ArrayTypeNode\n | ObjectTypePropertyNode\n | ObjectTypeAdditionalPropertiesNode\n | ObjectTypeNode\n | UnionTypeMemberNode\n | UnionTypeNode\n | NullableTypeNode\n | ParameterizedTypeArgumentNode\n | ParameterizedTypeInstantiationNode;\n\n/**\n * An object body, optionally guarded by an `if` or produced by a `for`.\n */\nexport type DeclarableBodyNode = ObjectValue | IfConditionExpression | ForExpression;\n\n/**\n * Maps each Bicep primitive type name to its TypeScript authoring value type.\n *\n * Generated from TypeSpec and emitter mappings. Do not edit.\n */\nexport interface PrimitiveTypeMap {\n readonly any: unknown;\n readonly array: readonly unknown[];\n readonly bool: boolean;\n readonly int: number;\n readonly object: Record<string, unknown>;\n readonly string: string;\n}\n\n/**\n * Runtime lookup for PrimitiveTypeName values.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport const primitiveTypeNames: Readonly<Record<PrimitiveTypeName, true>> = {\n any: true,\n array: true,\n bool: true,\n int: true,\n object: true,\n string: true,\n};\n\n/**\n * Checks whether a string is a PrimitiveTypeName value. Generated from\n * TypeSpec. Do not edit.\n */\nexport function isPrimitiveTypeName(value: string): value is PrimitiveTypeName {\n return Object.hasOwn(primitiveTypeNames, value);\n}\n\n/**\n * Represents a single infrastructure unit in the serialization output.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface InfraNode {\n /**\n * The relative file path/name (e.g. \"main.bicep\", \"modules/storage.bicep\").\n */\n readonly fileName: string;\n /**\n * The deployment target scope. Defaults to \"resourceGroup\" if omitted.\n */\n readonly targetScope?: TargetScope;\n /**\n * Parameter declarations, keyed by Bicep identifier.\n */\n readonly parameters?: Record<string, ParameterDeclarationNode>;\n /**\n * Variable declarations, keyed by Bicep identifier.\n */\n readonly variables?: Record<string, VariableDeclarationNode>;\n /**\n * Output declarations, keyed by Bicep identifier.\n */\n readonly outputs?: Record<string, OutputDeclarationNode>;\n /**\n * Resource declarations, keyed by Bicep identifier.\n */\n readonly resources?: Record<string, ResourceDeclarationNode>;\n /**\n * Module declarations, keyed by Bicep identifier.\n */\n readonly modules?: Record<string, ModuleDeclarationNode>;\n}\n\n/**\n * A Bicep parameter declaration.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ParameterDeclarationNode {\n readonly bicepIdentifier: string;\n readonly valueType: TypeNode;\n readonly defaultValue?: ExpressionNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * A built-in primitive type (e.g. `string`, `int`, `bool`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface PrimitiveTypeNode {\n readonly kind: \"primitive-type\";\n readonly name: PrimitiveTypeName;\n}\n\n/**\n * A reference to a named/user-defined type.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface TypeReferenceNode {\n readonly kind: \"type-reference\";\n readonly name: string;\n}\n\n/**\n * A string literal used as a type (e.g. `'Standard_GRS'`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface StringTypeLiteralNode {\n readonly kind: \"string-type-literal\";\n readonly value: string;\n}\n\n/**\n * An integer literal used as a type.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface IntegerTypeLiteralNode {\n readonly kind: \"integer-type-literal\";\n readonly value: string;\n}\n\n/**\n * A boolean literal used as a type.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface BooleanTypeLiteralNode {\n readonly kind: \"boolean-type-literal\";\n readonly value: boolean;\n}\n\n/**\n * A null literal used as a type.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface NullTypeLiteralNode {\n readonly kind: \"null-type-literal\";\n readonly value: null;\n}\n\n/**\n * An array type (e.g. `string[]`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ArrayTypeNode {\n readonly kind: \"array-type\";\n readonly item: TypeNode;\n}\n\n/**\n * A property within an object type definition.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ObjectTypePropertyNode {\n readonly kind: \"object-type-property\";\n readonly key: string;\n readonly valueType: TypeNode;\n readonly optional?: boolean;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * Decorator metadata that can be applied to declarations and type properties.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface DecoratorsNode {\n readonly description?: string;\n readonly secure?: true;\n readonly minValue?: number;\n readonly maxValue?: number;\n readonly minLength?: number;\n readonly maxLength?: number;\n readonly metadata?: Record<string, ExpressionNode>;\n readonly allowed?: readonly ExpressionNode[];\n readonly discriminator?: string;\n readonly sealed?: true;\n readonly export?: true;\n readonly batchSize?: number;\n}\n\n/**\n * A null literal value.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface NullValue {\n readonly kind: \"null\";\n readonly value: null;\n}\n\n/**\n * A boolean literal value.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface BooleanValue {\n readonly kind: \"boolean\";\n readonly value: boolean;\n}\n\n/**\n * An integer literal value.\n * Stored as a string to preserve 64-bit integer fidelity.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface IntegerValue {\n readonly kind: \"integer\";\n readonly value: string;\n}\n\n/**\n * A string literal value.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface StringValue {\n readonly kind: \"string\";\n readonly value: string;\n}\n\n/**\n * An array of expression nodes.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ArrayValue {\n readonly kind: \"array\";\n readonly items: readonly ExpressionNode[];\n}\n\n/**\n * An object with named expression node properties.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ObjectValue {\n readonly kind: \"object\";\n readonly value: Record<string, ExpressionNode>;\n}\n\n/**\n * A reference to a named identifier (variable, parameter, resource, etc.).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface IdentifierExpression {\n readonly kind: \"identifier\";\n readonly id: string;\n}\n\n/**\n * A top-level function call (e.g. `toLower(...)`, `concat(...)`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface FunctionCallExpression {\n readonly kind: \"function-call\";\n /**\n * Function name or an expression that resolves to a callable.\n */\n readonly target: string | ExpressionNode;\n readonly args: readonly ExpressionNode[];\n}\n\n/**\n * An instance method call (e.g. `base.method(...)`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface InstanceFunctionCallExpression {\n readonly kind: \"instance-function-call\";\n readonly base: ExpressionNode;\n readonly name: string;\n readonly args: readonly ExpressionNode[];\n}\n\n/**\n * Property access on an expression (e.g. `base.property` or `base.?property`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface PropertyAccessExpression {\n readonly kind: \"property-access\";\n readonly base: ExpressionNode;\n readonly property: string;\n readonly nullish: boolean;\n}\n\n/**\n * Array/index access on an expression (e.g. `base[index]` or `base[^index]`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ArrayAccessExpression {\n readonly kind: \"array-access\";\n readonly base: ExpressionNode;\n readonly index: ExpressionNode;\n readonly nullish: boolean;\n readonly fromEnd: boolean;\n}\n\n/**\n * A binary operator expression (e.g. `a + b`, `a ?? b`, `a && b`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface BinaryOperationExpression {\n readonly kind: \"binary-operation\";\n readonly operator: BinaryOperator;\n readonly left: ExpressionNode;\n readonly right: ExpressionNode;\n}\n\n/**\n * A unary operator expression (e.g. `!enabled`, `-count`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface UnaryOperationExpression {\n readonly kind: \"unary-operation\";\n readonly operator: UnaryOperator;\n readonly argument: ExpressionNode;\n}\n\n/**\n * A ternary conditional expression (e.g. `condition ? whenTrue : whenFalse`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface TernaryOperationExpression {\n readonly kind: \"ternary-operation\";\n readonly condition: ExpressionNode;\n readonly trueValue: ExpressionNode;\n readonly falseValue: ExpressionNode;\n}\n\n/**\n * A conditional expression block (e.g. `if (enabled) { ... }`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface IfConditionExpression {\n readonly kind: \"if-condition\";\n readonly condition: ExpressionNode;\n readonly body: ExpressionNode;\n}\n\n/**\n * A `for` expression (e.g. `[for item in items: { ... }]`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ForExpression {\n readonly kind: \"for-expression\";\n readonly itemVariable: string;\n readonly indexVariable?: string;\n readonly collection: ExpressionNode;\n readonly body: ExpressionNode;\n}\n\n/**\n * An interpolated string expression (e.g. `'prefix${expr}suffix'`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface InterpolatedStringExpression {\n readonly kind: \"interpolated-string\";\n readonly segments: readonly ExpressionNode[];\n}\n\n/**\n * The additional-properties clause of an object type (`*: T`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ObjectTypeAdditionalPropertiesNode {\n readonly kind: \"object-type-additional-properties\";\n readonly valueType: TypeNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * An object type with named properties and optional additional properties.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ObjectTypeNode {\n readonly kind: \"object-type\";\n readonly properties: readonly ObjectTypePropertyNode[];\n readonly additionalProperties?: ObjectTypeAdditionalPropertiesNode;\n}\n\n/**\n * An individual member in a union type.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface UnionTypeMemberNode {\n readonly kind: \"union-type-member\";\n readonly valueType: TypeNode;\n}\n\n/**\n * A union type (e.g. `string | int`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface UnionTypeNode {\n readonly kind: \"union-type\";\n readonly members: readonly UnionTypeMemberNode[];\n}\n\n/**\n * A nullable type wrapper (e.g. `string?`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface NullableTypeNode {\n readonly kind: \"nullable-type\";\n readonly base: TypeNode;\n}\n\n/**\n * A type argument in a parameterized type instantiation.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ParameterizedTypeArgumentNode {\n readonly kind: \"parameterized-type-argument\";\n readonly valueType: TypeNode;\n}\n\n/**\n * A parameterized type instantiation (e.g. `map<string>`).\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ParameterizedTypeInstantiationNode {\n readonly kind: \"parameterized-type-instantiation\";\n readonly base: TypeNode;\n readonly args: readonly ParameterizedTypeArgumentNode[];\n}\n\n/**\n * A Bicep variable declaration.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface VariableDeclarationNode {\n readonly bicepIdentifier: string;\n readonly value: ExpressionNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * A Bicep output declaration.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface OutputDeclarationNode {\n readonly bicepIdentifier: string;\n readonly valueType: TypeNode;\n readonly value: ExpressionNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * A Bicep resource declaration.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ResourceDeclarationNode {\n readonly bicepIdentifier: string;\n /**\n * The Azure resource type (e.g. \"Microsoft.Storage/storageAccounts\").\n */\n readonly type: string;\n /**\n * The API version (e.g. \"2024-01-01\").\n */\n readonly apiVersion: string;\n /**\n * Whether this references an existing resource (`existing` keyword).\n */\n readonly existing: boolean;\n /**\n * The resource body.\n */\n readonly value: DeclarableBodyNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * A Bicep module declaration.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface ModuleDeclarationNode {\n readonly bicepIdentifier: string;\n /**\n * Relative path to the module file.\n */\n readonly path: string;\n /**\n * The module body.\n */\n readonly value: DeclarableBodyNode;\n readonly decorators?: DecoratorsNode;\n}\n\n/**\n * The root serialization document containing all infra nodes.\n *\n * Generated from TypeSpec. Do not edit.\n */\nexport interface SerializationDocument {\n /**\n * The collection of infra nodes that make up this deployment.\n */\n readonly infras: readonly InfraNode[];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/serialization/contract/index.ts"],"names":[],"mappings":"AAGA,cAAc,oBAAoB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/serialization/contract/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,cAAc,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport * from \"./generated/ast.js\";\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encoding.js","sourceRoot":"","sources":["../../../../src/serialization/json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c;IACvC,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3E,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,MAAM,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxE,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACtD,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,YAAY,IAAI;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,KAAK,YAAY,UAAU;QAAE,OAAO,YAAY,CAAC;IACrD,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;AAChD,CAAC;AAED,SAAS,IAAI,CAAC,IAAuB,EAAE,OAAe;IACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,MAAM,IAAI,SAAS,CAAC,6BAA6B,QAAQ,MAAM,OAAO,EAAE,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isExpressionNode } from \"../../expression/ast-nodes.js\";\nimport { isExpression } from \"../../expression/expressions.js\";\nimport type {\n BytesEncodingDescriptor,\n DateTimeTextEncodingDescriptor,\n IntegerScalarName,\n NumericScalarName,\n NumericStringEncodingDescriptor,\n UnixTimestampEncodingDescriptor,\n ValueEncodingDescriptor,\n} from \"../../shape/value-encoding.js\";\n\nexport function encodeWireValue(\n value: unknown,\n encoding: ValueEncodingDescriptor,\n path: readonly string[] = [],\n): unknown {\n if (value === null || value === undefined) return value;\n if (isExpression(value) || isExpressionNode(value)) return value;\n\n switch (encoding.kind) {\n case \"date-time-text\":\n return encodeDateTimeText(value, encoding, path);\n case \"unix-timestamp\":\n return encodeUnixTimestamp(value, encoding, path);\n case \"duration-iso8601\":\n return requireIsoDuration(value, path);\n case \"duration-numeric\":\n return requireInteger(value, encoding.wire.scalar, path);\n case \"bytes\":\n return encodeBytes(value, encoding, path);\n case \"plain-date\":\n return encoding.clientMode === \"wire\"\n ? requirePlainDate(value, path)\n : encodePlainDate(value, path);\n case \"numeric-string\":\n return requireNumericString(value, encoding, path);\n case \"boolean-string\":\n if (encoding.clientMode === \"wire\") {\n return requireBooleanString(value, path);\n }\n if (typeof value !== \"boolean\") {\n fail(path, `Expected a boolean, got ${describe(value)}.`);\n }\n return String(value);\n }\n}\n\nexport function decodeWireValue(\n value: unknown,\n encoding: ValueEncodingDescriptor,\n path: readonly string[] = [],\n): unknown {\n if (value === null || value === undefined) return value;\n if (isExpression(value) || isExpressionNode(value)) return value;\n\n switch (encoding.kind) {\n case \"date-time-text\":\n return decodeDateTimeText(value, encoding, path);\n case \"unix-timestamp\": {\n const seconds = requireInteger(value, encoding.wire.scalar, path);\n if (encoding.clientMode === \"wire\") return seconds;\n const date = new Date(seconds * 1000);\n if (Number.isNaN(date.getTime())) {\n fail(path, \"Unix timestamp is outside the JavaScript Date range.\");\n }\n return date;\n }\n case \"duration-iso8601\":\n return requireIsoDuration(value, path);\n case \"duration-numeric\":\n return requireInteger(value, encoding.wire.scalar, path);\n case \"bytes\":\n return decodeBytes(value, encoding, path);\n case \"plain-date\": {\n const date = requirePlainDate(value, path);\n return encoding.clientMode === \"wire\" ? date : new Date(`${date}T00:00:00.000Z`);\n }\n case \"numeric-string\":\n return requireNumericString(value, encoding, path);\n case \"boolean-string\": {\n const booleanText = requireBooleanString(value, path);\n return encoding.clientMode === \"wire\" ? booleanText : booleanText.toLowerCase() === \"true\";\n }\n }\n}\n\nfunction encodeDateTimeText(\n value: unknown,\n encoding: DateTimeTextEncodingDescriptor,\n path: readonly string[],\n): string {\n if (encoding.clientMode === \"wire\") {\n if (encoding.source === \"offsetDateTime\") {\n const clientText = requireDateString(value, \"rfc3339\", path);\n if (encoding.format === \"rfc7231\") {\n requireWholeSecondDateTime(clientText, path);\n return new Date(clientText).toUTCString();\n }\n return clientText;\n }\n return requireDateString(value, encoding.format, path);\n }\n const date = requireDate(value, path);\n if (encoding.format === \"rfc7231\") {\n if (date.getUTCMilliseconds() !== 0) {\n fail(path, \"RFC7231 conversion would lose millisecond precision.\");\n }\n return date.toUTCString();\n }\n return date.toISOString();\n}\n\nfunction decodeDateTimeText(\n value: unknown,\n encoding: DateTimeTextEncodingDescriptor,\n path: readonly string[],\n): unknown {\n const text = requireDateString(value, encoding.format, path);\n if (encoding.source === \"offsetDateTime\") {\n return encoding.format === \"rfc7231\" ? new Date(text).toISOString() : text;\n }\n if (encoding.clientMode === \"wire\") return text;\n return new Date(text);\n}\n\nfunction encodeUnixTimestamp(\n value: unknown,\n encoding: UnixTimestampEncodingDescriptor,\n path: readonly string[],\n): number {\n if (encoding.clientMode === \"wire\") {\n return requireInteger(value, encoding.wire.scalar, path);\n }\n const date = requireDate(value, path);\n if (date.getTime() % 1000 !== 0) {\n fail(path, \"Unix timestamp conversion would lose millisecond precision.\");\n }\n return requireInteger(date.getTime() / 1000, encoding.wire.scalar, path);\n}\n\nfunction encodeBytes(\n value: unknown,\n encoding: BytesEncodingDescriptor,\n path: readonly string[],\n): string {\n if (encoding.clientMode === \"wire\") {\n return requireBase64(value, encoding.format, path);\n }\n if (!(value instanceof Uint8Array)) {\n fail(path, `Expected Uint8Array, got ${describe(value)}.`);\n }\n const base64 = uint8ArrayToBase64(value);\n return encoding.format === \"base64url\" ? base64ToBase64Url(base64) : base64;\n}\n\nfunction decodeBytes(\n value: unknown,\n encoding: BytesEncodingDescriptor,\n path: readonly string[],\n): unknown {\n const text = requireBase64(value, encoding.format, path);\n if (encoding.clientMode === \"wire\") return text;\n const base64 = encoding.format === \"base64url\" ? base64UrlToBase64(text) : text;\n return base64ToUint8Array(base64);\n}\n\nfunction requireDate(value: unknown, path: readonly string[]): Date {\n if (!(value instanceof Date) || Number.isNaN(value.getTime())) {\n fail(path, `Expected a valid Date, got ${describe(value)}.`);\n }\n return value;\n}\n\nfunction encodePlainDate(value: unknown, path: readonly string[]): string {\n const date = requireDate(value, path);\n if (\n date.getUTCHours() !== 0 ||\n date.getUTCMinutes() !== 0 ||\n date.getUTCSeconds() !== 0 ||\n date.getUTCMilliseconds() !== 0\n ) {\n fail(path, \"Plain-date conversion requires UTC midnight.\");\n }\n return date.toISOString().slice(0, 10);\n}\n\nfunction requireWholeSecondDateTime(value: string, path: readonly string[]): void {\n const fraction = /\\.(\\d+)(?:Z|[+-]\\d{2}:\\d{2})$/.exec(value)?.[1];\n if (fraction !== undefined && /[1-9]/.test(fraction)) {\n fail(path, \"RFC7231 conversion would lose subsecond precision.\");\n }\n}\n\nfunction requireDateString(\n value: unknown,\n format: \"rfc3339\" | \"rfc7231\",\n path: readonly string[],\n): string {\n const isValid =\n format === \"rfc3339\"\n ? isValidRfc3339(String(value))\n : /^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT$/.test(\n String(value),\n ) &&\n !Number.isNaN(Date.parse(String(value))) &&\n new Date(String(value)).toUTCString() === value;\n if (typeof value !== \"string\" || !isValid) {\n fail(path, `Expected a valid ${format} date string, got ${describe(value)}.`);\n }\n return value;\n}\n\nconst ISO_DURATION =\n /^-?P(?=\\d|T\\d)(?:(?:\\d+(?:\\.\\d+)?Y)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?W)?(?:\\d+(?:\\.\\d+)?D)?)(?:T(?:\\d+(?:\\.\\d+)?H)?(?:\\d+(?:\\.\\d+)?M)?(?:\\d+(?:\\.\\d+)?S)?)?$/;\n\nfunction requireIsoDuration(value: unknown, path: readonly string[]): string {\n if (typeof value !== \"string\" || !ISO_DURATION.test(value)) {\n fail(path, `Expected an ISO8601 day/time duration, got ${describe(value)}.`);\n }\n\n return value;\n}\n\nfunction requirePlainDate(value: unknown, path: readonly string[]): string {\n if (\n typeof value !== \"string\" ||\n !/^\\d{4}-\\d{2}-\\d{2}$/.test(value) ||\n Number.isNaN(Date.parse(`${value}T00:00:00.000Z`)) ||\n new Date(`${value}T00:00:00.000Z`).toISOString().slice(0, 10) !== value\n ) {\n fail(path, `Expected a YYYY-MM-DD date, got ${describe(value)}.`);\n }\n return value;\n}\n\nfunction requireInteger(\n value: unknown,\n scalar: IntegerScalarName,\n path: readonly string[],\n): number {\n if (\n typeof value !== \"number\" ||\n !Number.isSafeInteger(value) ||\n !inIntegerRange(BigInt(value), scalar)\n ) {\n fail(path, `Expected a safe ${scalar} value, got ${describe(value)}.`);\n }\n return value;\n}\n\nconst CANONICAL_NUMBER = /^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$/;\n\nfunction requireNumericString(\n value: unknown,\n encoding: NumericStringEncodingDescriptor,\n path: readonly string[],\n): string {\n const pattern = encoding.source === \"integer\" ? /^-?(?:0|[1-9]\\d*)$/ : CANONICAL_NUMBER;\n if (typeof value !== \"string\" || !pattern.test(value)) {\n fail(path, `Expected a canonical numeric string, got ${describe(value)}.`);\n }\n if (\n encoding.source === \"integer\"\n ? !inIntegerRange(BigInt(value), encoding.sourceScalar)\n : !inNumericRange(value, encoding.sourceScalar)\n ) {\n fail(path, `Numeric string is outside '${encoding.sourceScalar}' range.`);\n }\n return value;\n}\n\nfunction inNumericRange(value: string, scalar: NumericScalarName): boolean {\n if (scalar === \"numeric\" || scalar === \"decimal\") return true;\n if (scalar === \"decimal128\") {\n const match = /^(-?)(\\d+)(?:\\.(\\d+))?(?:[eE]([+-]?\\d+))?$/.exec(value);\n if (!match) return false;\n const integer = match[2]!;\n const fraction = match[3] ?? \"\";\n const significant = `${integer}${fraction}`.replace(/^0+/u, \"\");\n if (significant.length === 0) return true;\n if (significant.length > 34) return false;\n const exponent = Number(match[4] ?? 0);\n const adjustedExponent = exponent + integer.length - 1;\n return adjustedExponent >= -6176 && adjustedExponent <= 6144;\n }\n\n const number = Number(value);\n if (!Number.isFinite(number)) return false;\n if (scalar === \"float32\") {\n return Math.abs(number) <= 3.4028234663852886e38;\n }\n return true;\n}\n\nconst INTEGER_RANGES: Partial<Record<NumericScalarName, readonly [bigint, bigint]>> = {\n safeint: [BigInt(Number.MIN_SAFE_INTEGER), BigInt(Number.MAX_SAFE_INTEGER)],\n int8: [-128n, 127n],\n uint8: [0n, 255n],\n int16: [-32768n, 32767n],\n uint16: [0n, 65535n],\n int32: [-2147483648n, 2147483647n],\n uint32: [0n, 4294967295n],\n int64: [-9223372036854775808n, 9223372036854775807n],\n uint64: [0n, 18446744073709551615n],\n};\n\nfunction inIntegerRange(value: bigint, scalar: NumericScalarName): boolean {\n const range = INTEGER_RANGES[scalar];\n return range ? value >= range[0] && value <= range[1] : true;\n}\n\nfunction requireBooleanString(value: unknown, path: readonly string[]): string {\n if (value !== \"true\" && value !== \"false\") {\n fail(path, `Expected 'true' or 'false', got ${describe(value)}.`);\n }\n return value;\n}\n\nfunction isValidRfc3339(value: string): boolean {\n const match =\n /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2})(?:\\.\\d+)?(?:Z|[+-](\\d{2}):(\\d{2}))$/.exec(\n value,\n );\n if (!match) return false;\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n if (\n month < 1 ||\n month > 12 ||\n day < 1 ||\n day > new Date(Date.UTC(year, month, 0)).getUTCDate() ||\n Number(match[4]) > 23 ||\n Number(match[5]) > 59 ||\n Number(match[6]) > 59 ||\n Number(match[7] ?? 0) > 23 ||\n Number(match[8] ?? 0) > 59\n ) {\n return false;\n }\n return !Number.isNaN(Date.parse(value));\n}\n\nfunction requireBase64(\n value: unknown,\n format: \"base64\" | \"base64url\",\n path: readonly string[],\n): string {\n if (typeof value !== \"string\") {\n fail(path, `Expected a ${format} string, got ${describe(value)}.`);\n }\n const pattern =\n format === \"base64\"\n ? /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/\n : /^[A-Za-z0-9_-]*$/;\n if (!pattern.test(value)) {\n fail(path, `Expected a valid ${format} string.`);\n }\n if (format === \"base64url\" && value.length % 4 === 1) {\n fail(path, \"Expected a valid base64url string length.\");\n }\n const base64 = format === \"base64url\" ? base64UrlToBase64(value) : value;\n const canonical =\n format === \"base64url\"\n ? base64ToBase64Url(uint8ArrayToBase64(base64ToUint8Array(base64)))\n : uint8ArrayToBase64(base64ToUint8Array(base64));\n if (canonical !== value) {\n fail(path, `Expected a canonical ${format} string.`);\n }\n return value;\n}\n\nfunction uint8ArrayToBase64(value: Uint8Array): string {\n const chunks: string[] = [];\n const chunkSize = 0x8000;\n for (let offset = 0; offset < value.length; offset += chunkSize) {\n chunks.push(String.fromCharCode(...value.subarray(offset, offset + chunkSize)));\n }\n return btoa(chunks.join(\"\"));\n}\n\nfunction base64ToUint8Array(value: string): Uint8Array {\n const binary = atob(value);\n return Uint8Array.from(binary, (character) => character.charCodeAt(0));\n}\n\nfunction base64ToBase64Url(base64: string): string {\n return base64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=+$/, \"\");\n}\n\nfunction base64UrlToBase64(base64url: string): string {\n const padded = base64url + \"=\".repeat((4 - (base64url.length % 4)) % 4);\n return padded.replace(/-/g, \"+\").replace(/_/g, \"/\");\n}\n\nfunction describe(value: unknown): string {\n if (value instanceof Date) return \"Date\";\n if (value instanceof Uint8Array) return \"Uint8Array\";\n return value === null ? \"null\" : typeof value;\n}\n\nfunction fail(path: readonly string[], message: string): never {\n const location = path.length > 0 ? path.join(\".\") : \"<value>\";\n throw new TypeError(`Invalid encoded value at '${location}': ${message}`);\n}\n"]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { type ExpressionNode as CoreExpressionNode } from "../../expression/ast-nodes.js";
|
|
2
|
-
import { type Expression } from "../../expression/expressions.js";
|
|
3
|
-
import { type LoopedResource, type Resource, type ResourceDeclaration } from "../../constructs/resource/resource.js";
|
|
4
|
-
import type { ExpressionNode } from "../contract/index.js";
|
|
5
|
-
import type { ParameterMetadata } from "../../constructs/parameter.js";
|
|
6
|
-
import type { VariableMetadata } from "../../constructs/variable.js";
|
|
7
|
-
export type SerializableValue = CoreExpressionNode | Expression<unknown> | string | number | boolean | null | readonly SerializableValue[] | {
|
|
8
|
-
readonly [key: string]: SerializableValue | undefined;
|
|
9
|
-
};
|
|
10
|
-
export type SerializationSymbolMap = Map<ResourceDeclaration | CoreExpressionNode | ParameterMetadata | VariableMetadata, string>;
|
|
11
|
-
type SymbolValue = Expression<unknown> | Resource | LoopedResource<Resource>;
|
|
12
|
-
export type DeserializationSymbolMap = Map<string, SymbolValue>;
|
|
13
|
-
/**
|
|
14
|
-
* Expands armPath stamps along a core property-access chain, replacing each
|
|
15
|
-
* stamped property with its ARM path relative to the lowered base. Empty
|
|
16
|
-
* paths fall back to the original property name. Generated accesses carry
|
|
17
|
-
* no stamps; unchanged nodes retain their identity.
|
|
18
|
-
*
|
|
19
|
-
* Recursion stops at non-property-access nodes and leaves their children
|
|
20
|
-
* untouched. serializeExpression traverses those children and invokes this
|
|
21
|
-
* helper as it reaches them; this is not a whole-expression lowering pass.
|
|
22
|
-
*/
|
|
23
|
-
export declare function lowerArmPropertyAccessChain(node: CoreExpressionNode): CoreExpressionNode;
|
|
24
|
-
export declare function serializeDefinedObjectEntries(value: {
|
|
25
|
-
readonly [key: string]: SerializableValue | undefined;
|
|
26
|
-
}, symbolMap: SerializationSymbolMap): Record<string, ExpressionNode>;
|
|
27
|
-
export declare function serializeExpression(value: SerializableValue, symbolMap?: SerializationSymbolMap): ExpressionNode;
|
|
28
|
-
export declare function requireResourceHandle(targetIdentifier: string, symbols: DeserializationSymbolMap, resourceIdentifier: string, field: "parent" | "scope" | "dependsOn"): Resource | LoopedResource<Resource>;
|
|
29
|
-
export declare function deserializeDependsOnExpression(node: ExpressionNode, symbols: DeserializationSymbolMap, resourceIdentifier: string): readonly ResourceDeclaration[];
|
|
30
|
-
export declare function deserializeExpression(node: ExpressionNode, symbols: DeserializationSymbolMap): unknown;
|
|
31
|
-
export {};
|
|
32
|
-
//# sourceMappingURL=expression.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../../src/serialization/json/expression.ts"],"names":[],"mappings":"AAGA,OAAO,EAWL,KAAK,cAAc,IAAI,kBAAkB,EAK1C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,UAAU,EAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACzB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAGV,cAAc,EAKf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,MAAM,iBAAiB,GACzB,kBAAkB,GAClB,UAAU,CAAC,OAAO,CAAC,GACnB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,iBAAiB,EAAE,GAC5B;IACE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;CACvD,CAAC;AAEN,MAAM,MAAM,sBAAsB,GAAG,GAAG,CACtC,mBAAmB,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