@azure/provisioning-core 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/browser/constructs/built-in-resources/resource-group.d.ts +50 -0
- package/dist/browser/constructs/built-in-resources/resource-group.d.ts.map +1 -0
- package/dist/browser/constructs/built-in-resources/resource-group.js +100 -0
- package/dist/browser/constructs/built-in-resources/resource-group.js.map +1 -0
- package/dist/browser/constructs/output.d.ts +80 -0
- package/dist/browser/constructs/output.d.ts.map +1 -0
- package/dist/browser/constructs/output.js +75 -0
- package/dist/browser/constructs/output.js.map +1 -0
- package/dist/browser/constructs/parameter.d.ts +77 -0
- package/dist/browser/constructs/parameter.d.ts.map +1 -0
- package/dist/browser/constructs/parameter.js +93 -0
- package/dist/browser/constructs/parameter.js.map +1 -0
- package/dist/browser/constructs/provisioning-component.d.ts +91 -0
- package/dist/browser/constructs/provisioning-component.d.ts.map +1 -0
- package/dist/browser/constructs/provisioning-component.js +150 -0
- package/dist/browser/constructs/provisioning-component.js.map +1 -0
- package/dist/browser/constructs/resource/resource-proxy.d.ts +134 -0
- package/dist/browser/constructs/resource/resource-proxy.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-proxy.js +517 -0
- package/dist/browser/constructs/resource/resource-proxy.js.map +1 -0
- package/dist/browser/constructs/resource/resource-query.d.ts +23 -0
- package/dist/browser/constructs/resource/resource-query.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-query.js +69 -0
- package/dist/browser/constructs/resource/resource-query.js.map +1 -0
- package/dist/browser/constructs/resource/resource-registry.d.ts +99 -0
- package/dist/browser/constructs/resource/resource-registry.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-registry.js +51 -0
- package/dist/browser/constructs/resource/resource-registry.js.map +1 -0
- package/dist/browser/constructs/resource/resource-type-registry.d.ts +46 -0
- package/dist/browser/constructs/resource/resource-type-registry.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-type-registry.js +156 -0
- package/dist/browser/constructs/resource/resource-type-registry.js.map +1 -0
- package/dist/browser/constructs/resource/resource-utils.d.ts +60 -0
- package/dist/browser/constructs/resource/resource-utils.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource-utils.js +75 -0
- package/dist/browser/constructs/resource/resource-utils.js.map +1 -0
- package/dist/browser/constructs/resource/resource.d.ts +460 -0
- package/dist/browser/constructs/resource/resource.d.ts.map +1 -0
- package/dist/browser/constructs/resource/resource.js +582 -0
- package/dist/browser/constructs/resource/resource.js.map +1 -0
- package/dist/browser/constructs/stack.d.ts +110 -0
- package/dist/browser/constructs/stack.d.ts.map +1 -0
- package/dist/browser/constructs/stack.js +110 -0
- package/dist/browser/constructs/stack.js.map +1 -0
- package/dist/browser/constructs/variable.d.ts +63 -0
- package/dist/browser/constructs/variable.d.ts.map +1 -0
- package/dist/browser/constructs/variable.js +74 -0
- package/dist/browser/constructs/variable.js.map +1 -0
- package/dist/browser/deployment-context/deployment-context.d.ts +27 -0
- package/dist/browser/deployment-context/deployment-context.d.ts.map +1 -0
- package/dist/browser/deployment-context/deployment-context.js +4 -0
- package/dist/browser/deployment-context/deployment-context.js.map +1 -0
- package/dist/browser/expression/ast-nodes.d.ts +100 -0
- package/dist/browser/expression/ast-nodes.d.ts.map +1 -0
- package/dist/browser/expression/ast-nodes.js +125 -0
- package/dist/browser/expression/ast-nodes.js.map +1 -0
- package/dist/browser/expression/expressions.d.ts +164 -0
- package/dist/browser/expression/expressions.d.ts.map +1 -0
- package/dist/browser/expression/expressions.js +211 -0
- package/dist/browser/expression/expressions.js.map +1 -0
- package/dist/browser/fn.d.ts +194 -0
- package/dist/browser/fn.d.ts.map +1 -0
- package/dist/browser/fn.js +334 -0
- package/dist/browser/fn.js.map +1 -0
- package/dist/browser/index.d.ts +25 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +17 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/internal.d.ts +13 -0
- package/dist/browser/internal.d.ts.map +1 -0
- package/dist/browser/internal.js +10 -0
- package/dist/browser/internal.js.map +1 -0
- package/dist/browser/naming/naming-policy.d.ts +56 -0
- package/dist/browser/naming/naming-policy.d.ts.map +1 -0
- package/dist/browser/naming/naming-policy.js +97 -0
- package/dist/browser/naming/naming-policy.js.map +1 -0
- package/dist/browser/naming/naming-rules.d.ts +15 -0
- package/dist/browser/naming/naming-rules.d.ts.map +1 -0
- package/dist/browser/naming/naming-rules.js +15 -0
- package/dist/browser/naming/naming-rules.js.map +1 -0
- package/dist/browser/package.json +8 -0
- package/dist/browser/serialization/contract/generated/ast.d.ts +508 -0
- package/dist/browser/serialization/contract/generated/ast.d.ts.map +1 -0
- package/dist/browser/serialization/contract/generated/ast.js +23 -0
- package/dist/browser/serialization/contract/generated/ast.js.map +1 -0
- package/dist/browser/serialization/contract/index.d.ts +2 -0
- package/dist/browser/serialization/contract/index.d.ts.map +1 -0
- package/dist/browser/serialization/contract/index.js +4 -0
- package/dist/browser/serialization/contract/index.js.map +1 -0
- package/dist/browser/serialization/index.d.ts +4 -0
- package/dist/browser/serialization/index.d.ts.map +1 -0
- package/dist/browser/serialization/index.js +5 -0
- package/dist/browser/serialization/index.js.map +1 -0
- package/dist/browser/serialization/json/deserialize.d.ts +24 -0
- package/dist/browser/serialization/json/deserialize.d.ts.map +1 -0
- package/dist/browser/serialization/json/deserialize.js +437 -0
- package/dist/browser/serialization/json/deserialize.js.map +1 -0
- package/dist/browser/serialization/json/encoding.d.ts +4 -0
- package/dist/browser/serialization/json/encoding.d.ts.map +1 -0
- package/dist/browser/serialization/json/encoding.js +319 -0
- package/dist/browser/serialization/json/encoding.js.map +1 -0
- package/dist/browser/serialization/json/expression.d.ts +32 -0
- package/dist/browser/serialization/json/expression.d.ts.map +1 -0
- package/dist/browser/serialization/json/expression.js +494 -0
- package/dist/browser/serialization/json/expression.js.map +1 -0
- package/dist/browser/serialization/json/lower.d.ts +41 -0
- package/dist/browser/serialization/json/lower.d.ts.map +1 -0
- package/dist/browser/serialization/json/lower.js +334 -0
- package/dist/browser/serialization/json/lower.js.map +1 -0
- package/dist/browser/serialization/json/pluralize-config.d.ts +3 -0
- package/dist/browser/serialization/json/pluralize-config.d.ts.map +1 -0
- package/dist/browser/serialization/json/pluralize-config.js +7 -0
- package/dist/browser/serialization/json/pluralize-config.js.map +1 -0
- package/dist/browser/serialization/json/serialize.d.ts +12 -0
- package/dist/browser/serialization/json/serialize.d.ts.map +1 -0
- package/dist/browser/serialization/json/serialize.js +389 -0
- package/dist/browser/serialization/json/serialize.js.map +1 -0
- package/dist/browser/serialization/json/util.d.ts +2 -0
- package/dist/browser/serialization/json/util.d.ts.map +1 -0
- package/dist/browser/serialization/json/util.js +19 -0
- package/dist/browser/serialization/json/util.js.map +1 -0
- package/dist/browser/serialization/utils.d.ts +3 -0
- package/dist/browser/serialization/utils.d.ts.map +1 -0
- package/dist/browser/serialization/utils.js +146 -0
- package/dist/browser/serialization/utils.js.map +1 -0
- package/dist/browser/shape/shape-registry.d.ts +51 -0
- package/dist/browser/shape/shape-registry.d.ts.map +1 -0
- package/dist/browser/shape/shape-registry.js +41 -0
- package/dist/browser/shape/shape-registry.js.map +1 -0
- package/dist/browser/shape/shape.d.ts +407 -0
- package/dist/browser/shape/shape.d.ts.map +1 -0
- package/dist/browser/shape/shape.js +424 -0
- package/dist/browser/shape/shape.js.map +1 -0
- package/dist/browser/shape/value-encoding.d.ts +121 -0
- package/dist/browser/shape/value-encoding.d.ts.map +1 -0
- package/dist/browser/shape/value-encoding.js +32 -0
- package/dist/browser/shape/value-encoding.js.map +1 -0
- package/dist/browser/types.d.ts +9 -0
- package/dist/browser/types.d.ts.map +1 -0
- package/dist/browser/types.js +4 -0
- package/dist/browser/types.js.map +1 -0
- package/dist/browser/util.d.ts +33 -0
- package/dist/browser/util.d.ts.map +1 -0
- package/dist/browser/util.js +74 -0
- package/dist/browser/util.js.map +1 -0
- package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts +50 -0
- package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts.map +1 -0
- package/dist/commonjs/constructs/built-in-resources/resource-group.js +114 -0
- package/dist/commonjs/constructs/built-in-resources/resource-group.js.map +7 -0
- package/dist/commonjs/constructs/output.d.ts +80 -0
- package/dist/commonjs/constructs/output.d.ts.map +1 -0
- package/dist/commonjs/constructs/output.js +75 -0
- package/dist/commonjs/constructs/output.js.map +7 -0
- package/dist/commonjs/constructs/parameter.d.ts +77 -0
- package/dist/commonjs/constructs/parameter.d.ts.map +1 -0
- package/dist/commonjs/constructs/parameter.js +95 -0
- package/dist/commonjs/constructs/parameter.js.map +7 -0
- package/dist/commonjs/constructs/provisioning-component.d.ts +91 -0
- package/dist/commonjs/constructs/provisioning-component.d.ts.map +1 -0
- package/dist/commonjs/constructs/provisioning-component.js +130 -0
- package/dist/commonjs/constructs/provisioning-component.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource-proxy.d.ts +134 -0
- package/dist/commonjs/constructs/resource/resource-proxy.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-proxy.js +456 -0
- package/dist/commonjs/constructs/resource/resource-proxy.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource-query.d.ts +23 -0
- package/dist/commonjs/constructs/resource/resource-query.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-query.js +68 -0
- package/dist/commonjs/constructs/resource/resource-query.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource-registry.d.ts +99 -0
- package/dist/commonjs/constructs/resource/resource-registry.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-registry.js +49 -0
- package/dist/commonjs/constructs/resource/resource-registry.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource-type-registry.d.ts +46 -0
- package/dist/commonjs/constructs/resource/resource-type-registry.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-type-registry.js +178 -0
- package/dist/commonjs/constructs/resource/resource-type-registry.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource-utils.d.ts +60 -0
- package/dist/commonjs/constructs/resource/resource-utils.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource-utils.js +51 -0
- package/dist/commonjs/constructs/resource/resource-utils.js.map +7 -0
- package/dist/commonjs/constructs/resource/resource.d.ts +460 -0
- package/dist/commonjs/constructs/resource/resource.d.ts.map +1 -0
- package/dist/commonjs/constructs/resource/resource.js +455 -0
- package/dist/commonjs/constructs/resource/resource.js.map +7 -0
- package/dist/commonjs/constructs/stack.d.ts +110 -0
- package/dist/commonjs/constructs/stack.d.ts.map +1 -0
- package/dist/commonjs/constructs/stack.js +101 -0
- package/dist/commonjs/constructs/stack.js.map +7 -0
- package/dist/commonjs/constructs/variable.d.ts +63 -0
- package/dist/commonjs/constructs/variable.d.ts.map +1 -0
- package/dist/commonjs/constructs/variable.js +85 -0
- package/dist/commonjs/constructs/variable.js.map +7 -0
- package/dist/commonjs/deployment-context/deployment-context.d.ts +27 -0
- package/dist/commonjs/deployment-context/deployment-context.d.ts.map +1 -0
- package/dist/commonjs/deployment-context/deployment-context.js +16 -0
- package/dist/commonjs/deployment-context/deployment-context.js.map +7 -0
- package/dist/commonjs/expression/ast-nodes.d.ts +100 -0
- package/dist/commonjs/expression/ast-nodes.d.ts.map +1 -0
- package/dist/commonjs/expression/ast-nodes.js +152 -0
- package/dist/commonjs/expression/ast-nodes.js.map +7 -0
- package/dist/commonjs/expression/expressions.d.ts +164 -0
- package/dist/commonjs/expression/expressions.d.ts.map +1 -0
- package/dist/commonjs/expression/expressions.js +171 -0
- package/dist/commonjs/expression/expressions.js.map +7 -0
- package/dist/commonjs/fn.d.ts +194 -0
- package/dist/commonjs/fn.d.ts.map +1 -0
- package/dist/commonjs/fn.js +382 -0
- package/dist/commonjs/fn.js.map +7 -0
- package/dist/commonjs/index.d.ts +25 -0
- package/dist/commonjs/index.d.ts.map +1 -0
- package/dist/commonjs/index.js +93 -0
- package/dist/commonjs/index.js.map +7 -0
- package/dist/commonjs/internal.d.ts +13 -0
- package/dist/commonjs/internal.d.ts.map +1 -0
- package/dist/commonjs/internal.js +88 -0
- package/dist/commonjs/internal.js.map +7 -0
- package/dist/commonjs/naming/naming-policy.d.ts +56 -0
- package/dist/commonjs/naming/naming-policy.d.ts.map +1 -0
- package/dist/commonjs/naming/naming-policy.js +99 -0
- package/dist/commonjs/naming/naming-policy.js.map +7 -0
- package/dist/commonjs/naming/naming-rules.d.ts +15 -0
- package/dist/commonjs/naming/naming-rules.d.ts.map +1 -0
- package/dist/commonjs/naming/naming-rules.js +39 -0
- package/dist/commonjs/naming/naming-rules.js.map +7 -0
- package/dist/commonjs/package.json +8 -0
- package/dist/commonjs/serialization/contract/generated/ast.d.ts +508 -0
- package/dist/commonjs/serialization/contract/generated/ast.d.ts.map +1 -0
- package/dist/commonjs/serialization/contract/generated/ast.js +40 -0
- package/dist/commonjs/serialization/contract/generated/ast.js.map +7 -0
- package/dist/commonjs/serialization/contract/index.d.ts +2 -0
- package/dist/commonjs/serialization/contract/index.d.ts.map +1 -0
- package/dist/commonjs/serialization/contract/index.js +22 -0
- package/dist/commonjs/serialization/contract/index.js.map +7 -0
- package/dist/commonjs/serialization/index.d.ts +4 -0
- package/dist/commonjs/serialization/index.d.ts.map +1 -0
- package/dist/commonjs/serialization/index.js +31 -0
- package/dist/commonjs/serialization/index.js.map +7 -0
- package/dist/commonjs/serialization/json/deserialize.d.ts +24 -0
- package/dist/commonjs/serialization/json/deserialize.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/deserialize.js +385 -0
- package/dist/commonjs/serialization/json/deserialize.js.map +7 -0
- package/dist/commonjs/serialization/json/encoding.d.ts +4 -0
- package/dist/commonjs/serialization/json/encoding.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/encoding.js +306 -0
- package/dist/commonjs/serialization/json/encoding.js.map +7 -0
- package/dist/commonjs/serialization/json/expression.d.ts +32 -0
- package/dist/commonjs/serialization/json/expression.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/expression.js +509 -0
- package/dist/commonjs/serialization/json/expression.js.map +7 -0
- package/dist/commonjs/serialization/json/lower.d.ts +41 -0
- package/dist/commonjs/serialization/json/lower.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/lower.js +272 -0
- package/dist/commonjs/serialization/json/lower.js.map +7 -0
- package/dist/commonjs/serialization/json/pluralize-config.d.ts +3 -0
- package/dist/commonjs/serialization/json/pluralize-config.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/pluralize-config.js +37 -0
- package/dist/commonjs/serialization/json/pluralize-config.js.map +7 -0
- package/dist/commonjs/serialization/json/serialize.d.ts +12 -0
- package/dist/commonjs/serialization/json/serialize.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/serialize.js +352 -0
- package/dist/commonjs/serialization/json/serialize.js.map +7 -0
- package/dist/commonjs/serialization/json/util.d.ts +2 -0
- package/dist/commonjs/serialization/json/util.d.ts.map +1 -0
- package/dist/commonjs/serialization/json/util.js +37 -0
- package/dist/commonjs/serialization/json/util.js.map +7 -0
- package/dist/commonjs/serialization/utils.d.ts +3 -0
- package/dist/commonjs/serialization/utils.d.ts.map +1 -0
- package/dist/commonjs/serialization/utils.js +169 -0
- package/dist/commonjs/serialization/utils.js.map +7 -0
- package/dist/commonjs/shape/shape-registry.d.ts +51 -0
- package/dist/commonjs/shape/shape-registry.d.ts.map +1 -0
- package/dist/commonjs/shape/shape-registry.js +40 -0
- package/dist/commonjs/shape/shape-registry.js.map +7 -0
- package/dist/commonjs/shape/shape.d.ts +407 -0
- package/dist/commonjs/shape/shape.d.ts.map +1 -0
- package/dist/commonjs/shape/shape.js +290 -0
- package/dist/commonjs/shape/shape.js.map +7 -0
- package/dist/commonjs/shape/value-encoding.d.ts +121 -0
- package/dist/commonjs/shape/value-encoding.d.ts.map +1 -0
- package/dist/commonjs/shape/value-encoding.js +62 -0
- package/dist/commonjs/shape/value-encoding.js.map +7 -0
- package/dist/commonjs/tsdoc-metadata.json +11 -0
- package/dist/commonjs/types.d.ts +9 -0
- package/dist/commonjs/types.d.ts.map +1 -0
- package/dist/commonjs/types.js +16 -0
- package/dist/commonjs/types.js.map +7 -0
- package/dist/commonjs/util.d.ts +33 -0
- package/dist/commonjs/util.d.ts.map +1 -0
- package/dist/commonjs/util.js +73 -0
- package/dist/commonjs/util.js.map +7 -0
- package/dist/esm/constructs/built-in-resources/resource-group.d.ts +50 -0
- package/dist/esm/constructs/built-in-resources/resource-group.d.ts.map +1 -0
- package/dist/esm/constructs/built-in-resources/resource-group.js +100 -0
- package/dist/esm/constructs/built-in-resources/resource-group.js.map +1 -0
- package/dist/esm/constructs/output.d.ts +80 -0
- package/dist/esm/constructs/output.d.ts.map +1 -0
- package/dist/esm/constructs/output.js +75 -0
- package/dist/esm/constructs/output.js.map +1 -0
- package/dist/esm/constructs/parameter.d.ts +77 -0
- package/dist/esm/constructs/parameter.d.ts.map +1 -0
- package/dist/esm/constructs/parameter.js +93 -0
- package/dist/esm/constructs/parameter.js.map +1 -0
- package/dist/esm/constructs/provisioning-component.d.ts +91 -0
- package/dist/esm/constructs/provisioning-component.d.ts.map +1 -0
- package/dist/esm/constructs/provisioning-component.js +150 -0
- package/dist/esm/constructs/provisioning-component.js.map +1 -0
- package/dist/esm/constructs/resource/resource-proxy.d.ts +134 -0
- package/dist/esm/constructs/resource/resource-proxy.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-proxy.js +517 -0
- package/dist/esm/constructs/resource/resource-proxy.js.map +1 -0
- package/dist/esm/constructs/resource/resource-query.d.ts +23 -0
- package/dist/esm/constructs/resource/resource-query.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-query.js +69 -0
- package/dist/esm/constructs/resource/resource-query.js.map +1 -0
- package/dist/esm/constructs/resource/resource-registry.d.ts +99 -0
- package/dist/esm/constructs/resource/resource-registry.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-registry.js +51 -0
- package/dist/esm/constructs/resource/resource-registry.js.map +1 -0
- package/dist/esm/constructs/resource/resource-type-registry.d.ts +46 -0
- package/dist/esm/constructs/resource/resource-type-registry.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-type-registry.js +156 -0
- package/dist/esm/constructs/resource/resource-type-registry.js.map +1 -0
- package/dist/esm/constructs/resource/resource-utils.d.ts +60 -0
- package/dist/esm/constructs/resource/resource-utils.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource-utils.js +75 -0
- package/dist/esm/constructs/resource/resource-utils.js.map +1 -0
- package/dist/esm/constructs/resource/resource.d.ts +460 -0
- package/dist/esm/constructs/resource/resource.d.ts.map +1 -0
- package/dist/esm/constructs/resource/resource.js +582 -0
- package/dist/esm/constructs/resource/resource.js.map +1 -0
- package/dist/esm/constructs/stack.d.ts +110 -0
- package/dist/esm/constructs/stack.d.ts.map +1 -0
- package/dist/esm/constructs/stack.js +110 -0
- package/dist/esm/constructs/stack.js.map +1 -0
- package/dist/esm/constructs/variable.d.ts +63 -0
- package/dist/esm/constructs/variable.d.ts.map +1 -0
- package/dist/esm/constructs/variable.js +74 -0
- package/dist/esm/constructs/variable.js.map +1 -0
- package/dist/esm/deployment-context/deployment-context.d.ts +27 -0
- package/dist/esm/deployment-context/deployment-context.d.ts.map +1 -0
- package/dist/esm/deployment-context/deployment-context.js +4 -0
- package/dist/esm/deployment-context/deployment-context.js.map +1 -0
- package/dist/esm/expression/ast-nodes.d.ts +100 -0
- package/dist/esm/expression/ast-nodes.d.ts.map +1 -0
- package/dist/esm/expression/ast-nodes.js +125 -0
- package/dist/esm/expression/ast-nodes.js.map +1 -0
- package/dist/esm/expression/expressions.d.ts +164 -0
- package/dist/esm/expression/expressions.d.ts.map +1 -0
- package/dist/esm/expression/expressions.js +211 -0
- package/dist/esm/expression/expressions.js.map +1 -0
- package/dist/esm/fn.d.ts +194 -0
- package/dist/esm/fn.d.ts.map +1 -0
- package/dist/esm/fn.js +334 -0
- package/dist/esm/fn.js.map +1 -0
- package/dist/esm/index.d.ts +25 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +17 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal.d.ts +13 -0
- package/dist/esm/internal.d.ts.map +1 -0
- package/dist/esm/internal.js +10 -0
- package/dist/esm/internal.js.map +1 -0
- package/dist/esm/naming/naming-policy.d.ts +56 -0
- package/dist/esm/naming/naming-policy.d.ts.map +1 -0
- package/dist/esm/naming/naming-policy.js +97 -0
- package/dist/esm/naming/naming-policy.js.map +1 -0
- package/dist/esm/naming/naming-rules.d.ts +15 -0
- package/dist/esm/naming/naming-rules.d.ts.map +1 -0
- package/dist/esm/naming/naming-rules.js +15 -0
- package/dist/esm/naming/naming-rules.js.map +1 -0
- package/dist/esm/package.json +8 -0
- package/dist/esm/serialization/contract/generated/ast.d.ts +508 -0
- package/dist/esm/serialization/contract/generated/ast.d.ts.map +1 -0
- package/dist/esm/serialization/contract/generated/ast.js +23 -0
- package/dist/esm/serialization/contract/generated/ast.js.map +1 -0
- package/dist/esm/serialization/contract/index.d.ts +2 -0
- package/dist/esm/serialization/contract/index.d.ts.map +1 -0
- package/dist/esm/serialization/contract/index.js +4 -0
- package/dist/esm/serialization/contract/index.js.map +1 -0
- package/dist/esm/serialization/index.d.ts +4 -0
- package/dist/esm/serialization/index.d.ts.map +1 -0
- package/dist/esm/serialization/index.js +5 -0
- package/dist/esm/serialization/index.js.map +1 -0
- package/dist/esm/serialization/json/deserialize.d.ts +24 -0
- package/dist/esm/serialization/json/deserialize.d.ts.map +1 -0
- package/dist/esm/serialization/json/deserialize.js +437 -0
- package/dist/esm/serialization/json/deserialize.js.map +1 -0
- package/dist/esm/serialization/json/encoding.d.ts +4 -0
- package/dist/esm/serialization/json/encoding.d.ts.map +1 -0
- package/dist/esm/serialization/json/encoding.js +319 -0
- package/dist/esm/serialization/json/encoding.js.map +1 -0
- package/dist/esm/serialization/json/expression.d.ts +32 -0
- package/dist/esm/serialization/json/expression.d.ts.map +1 -0
- package/dist/esm/serialization/json/expression.js +494 -0
- package/dist/esm/serialization/json/expression.js.map +1 -0
- package/dist/esm/serialization/json/lower.d.ts +41 -0
- package/dist/esm/serialization/json/lower.d.ts.map +1 -0
- package/dist/esm/serialization/json/lower.js +334 -0
- package/dist/esm/serialization/json/lower.js.map +1 -0
- package/dist/esm/serialization/json/pluralize-config.d.ts +3 -0
- package/dist/esm/serialization/json/pluralize-config.d.ts.map +1 -0
- package/dist/esm/serialization/json/pluralize-config.js +7 -0
- package/dist/esm/serialization/json/pluralize-config.js.map +1 -0
- package/dist/esm/serialization/json/serialize.d.ts +12 -0
- package/dist/esm/serialization/json/serialize.d.ts.map +1 -0
- package/dist/esm/serialization/json/serialize.js +389 -0
- package/dist/esm/serialization/json/serialize.js.map +1 -0
- package/dist/esm/serialization/json/util.d.ts +2 -0
- package/dist/esm/serialization/json/util.d.ts.map +1 -0
- package/dist/esm/serialization/json/util.js +19 -0
- package/dist/esm/serialization/json/util.js.map +1 -0
- package/dist/esm/serialization/utils.d.ts +3 -0
- package/dist/esm/serialization/utils.d.ts.map +1 -0
- package/dist/esm/serialization/utils.js +146 -0
- package/dist/esm/serialization/utils.js.map +1 -0
- package/dist/esm/shape/shape-registry.d.ts +51 -0
- package/dist/esm/shape/shape-registry.d.ts.map +1 -0
- package/dist/esm/shape/shape-registry.js +41 -0
- package/dist/esm/shape/shape-registry.js.map +1 -0
- package/dist/esm/shape/shape.d.ts +407 -0
- package/dist/esm/shape/shape.d.ts.map +1 -0
- package/dist/esm/shape/shape.js +424 -0
- package/dist/esm/shape/shape.js.map +1 -0
- package/dist/esm/shape/value-encoding.d.ts +121 -0
- package/dist/esm/shape/value-encoding.d.ts.map +1 -0
- package/dist/esm/shape/value-encoding.js +32 -0
- package/dist/esm/shape/value-encoding.js.map +1 -0
- package/dist/esm/types.d.ts +9 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +4 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/util.d.ts +33 -0
- package/dist/esm/util.d.ts.map +1 -0
- package/dist/esm/util.js +74 -0
- package/dist/esm/util.js.map +1 -0
- package/package.json +117 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var shape_exports = {};
|
|
19
|
+
__export(shape_exports, {
|
|
20
|
+
createAnyShape: () => createAnyShape,
|
|
21
|
+
createArrayShape: () => createArrayShape,
|
|
22
|
+
createBooleanLiteralShape: () => createBooleanLiteralShape,
|
|
23
|
+
createBooleanShape: () => createBooleanShape,
|
|
24
|
+
createBytesShape: () => createBytesShape,
|
|
25
|
+
createDateShape: () => createDateShape,
|
|
26
|
+
createDeferredShape: () => createDeferredShape,
|
|
27
|
+
createDiscriminatedModelShape: () => createDiscriminatedModelShape,
|
|
28
|
+
createEnumShape: () => createEnumShape,
|
|
29
|
+
createFlatModelShape: () => createFlatModelShape,
|
|
30
|
+
createNullShape: () => createNullShape,
|
|
31
|
+
createNumberLiteralShape: () => createNumberLiteralShape,
|
|
32
|
+
createNumberShape: () => createNumberShape,
|
|
33
|
+
createRecordShape: () => createRecordShape,
|
|
34
|
+
createStringLiteralShape: () => createStringLiteralShape,
|
|
35
|
+
createStringShape: () => createStringShape,
|
|
36
|
+
createTupleShape: () => createTupleShape,
|
|
37
|
+
createUnionShape: () => createUnionShape,
|
|
38
|
+
isTerminalValueShape: () => isTerminalValueShape,
|
|
39
|
+
navigateShape: () => navigateShape,
|
|
40
|
+
resolveModelShape: () => resolveModelShape
|
|
41
|
+
});
|
|
42
|
+
module.exports = __toCommonJS(shape_exports);
|
|
43
|
+
const createFlatModelShape = (byJsName) => ({
|
|
44
|
+
kind: "flatModel",
|
|
45
|
+
byJsName
|
|
46
|
+
});
|
|
47
|
+
const createDiscriminatedModelShape = (discriminator, byValue) => ({
|
|
48
|
+
kind: "discriminatedModel",
|
|
49
|
+
discriminator: typeof discriminator === "string" ? { jsName: discriminator, armName: discriminator } : discriminator,
|
|
50
|
+
byValue
|
|
51
|
+
});
|
|
52
|
+
const createDeferredShape = (value) => ({
|
|
53
|
+
kind: "deferred",
|
|
54
|
+
value
|
|
55
|
+
});
|
|
56
|
+
const createAnyShape = () => ({ kind: "any" });
|
|
57
|
+
const createStringShape = (encoding) => ({
|
|
58
|
+
kind: "string",
|
|
59
|
+
...encoding ? { encoding } : {}
|
|
60
|
+
});
|
|
61
|
+
const createBooleanShape = (encoding) => ({
|
|
62
|
+
kind: "boolean",
|
|
63
|
+
...encoding ? { encoding } : {}
|
|
64
|
+
});
|
|
65
|
+
const createNumberShape = (encoding) => ({
|
|
66
|
+
kind: "number",
|
|
67
|
+
...encoding ? { encoding } : {}
|
|
68
|
+
});
|
|
69
|
+
const createBytesShape = (encoding) => ({
|
|
70
|
+
kind: "bytes",
|
|
71
|
+
...encoding ? { encoding } : {}
|
|
72
|
+
});
|
|
73
|
+
const createDateShape = (encoding) => ({
|
|
74
|
+
kind: "date",
|
|
75
|
+
...encoding ? { encoding } : {}
|
|
76
|
+
});
|
|
77
|
+
const createStringLiteralShape = () => ({
|
|
78
|
+
kind: "stringLiteral"
|
|
79
|
+
});
|
|
80
|
+
const createNumberLiteralShape = (encoding) => ({
|
|
81
|
+
kind: "numberLiteral",
|
|
82
|
+
...encoding ? { encoding } : {}
|
|
83
|
+
});
|
|
84
|
+
const createBooleanLiteralShape = (encoding) => ({
|
|
85
|
+
kind: "booleanLiteral",
|
|
86
|
+
...encoding ? { encoding } : {}
|
|
87
|
+
});
|
|
88
|
+
const createEnumShape = () => ({ kind: "enum" });
|
|
89
|
+
const createUnionShape = () => ({ kind: "union" });
|
|
90
|
+
const createNullShape = () => ({ kind: "null" });
|
|
91
|
+
const createArrayShape = (element) => ({
|
|
92
|
+
kind: "array",
|
|
93
|
+
element
|
|
94
|
+
});
|
|
95
|
+
const createRecordShape = (value) => ({
|
|
96
|
+
kind: "record",
|
|
97
|
+
value
|
|
98
|
+
});
|
|
99
|
+
const createTupleShape = (values) => ({
|
|
100
|
+
kind: "tuple",
|
|
101
|
+
values
|
|
102
|
+
});
|
|
103
|
+
function isTerminalValueShape(shape) {
|
|
104
|
+
switch (shape.kind) {
|
|
105
|
+
case "any":
|
|
106
|
+
case "string":
|
|
107
|
+
case "boolean":
|
|
108
|
+
case "number":
|
|
109
|
+
case "bytes":
|
|
110
|
+
case "date":
|
|
111
|
+
case "stringLiteral":
|
|
112
|
+
case "numberLiteral":
|
|
113
|
+
case "booleanLiteral":
|
|
114
|
+
case "enum":
|
|
115
|
+
case "union":
|
|
116
|
+
case "null":
|
|
117
|
+
return true;
|
|
118
|
+
case "deferred":
|
|
119
|
+
case "array":
|
|
120
|
+
case "record":
|
|
121
|
+
case "tuple":
|
|
122
|
+
return false;
|
|
123
|
+
default:
|
|
124
|
+
return assertNeverShape(shape);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function assertNeverShape(shape) {
|
|
128
|
+
throw new Error(`Unhandled value shape: ${String(shape)}`);
|
|
129
|
+
}
|
|
130
|
+
function resolveModelShape(shape, value, valueKeyedBy = "js") {
|
|
131
|
+
let current = shape;
|
|
132
|
+
const seen = /* @__PURE__ */ new Set();
|
|
133
|
+
while (current !== void 0) {
|
|
134
|
+
if (seen.has(current)) return void 0;
|
|
135
|
+
seen.add(current);
|
|
136
|
+
if (current.kind === "deferred") {
|
|
137
|
+
current = current.value();
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (current.kind === "flatModel") return current;
|
|
141
|
+
const group = current;
|
|
142
|
+
const names = group.discriminator;
|
|
143
|
+
const key = value?.[valueKeyedBy === "js" ? names.jsName : names.armName];
|
|
144
|
+
const next = typeof key === "string" ? group.byValue[key] : void 0;
|
|
145
|
+
if (next === void 0) {
|
|
146
|
+
return value ? selectVariant(group, value, valueKeyedBy) : void 0;
|
|
147
|
+
}
|
|
148
|
+
current = next;
|
|
149
|
+
}
|
|
150
|
+
return void 0;
|
|
151
|
+
}
|
|
152
|
+
function selectVariant(group, value, valueKeyedBy) {
|
|
153
|
+
let best;
|
|
154
|
+
let bestScore = -1;
|
|
155
|
+
for (const variant of flattenVariants(group, /* @__PURE__ */ new Set())) {
|
|
156
|
+
const score = scoreShape(variant, value, valueKeyedBy, /* @__PURE__ */ new WeakSet());
|
|
157
|
+
if (score > bestScore) {
|
|
158
|
+
bestScore = score;
|
|
159
|
+
best = variant;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return best;
|
|
163
|
+
}
|
|
164
|
+
function scoreShape(shape, value, valueKeyedBy, visiting) {
|
|
165
|
+
if (visiting.has(value)) return 0;
|
|
166
|
+
visiting.add(value);
|
|
167
|
+
const byKey = getShapePropertiesMap(shape, valueKeyedBy);
|
|
168
|
+
let score = 0;
|
|
169
|
+
for (const [key, sub] of Object.entries(value)) {
|
|
170
|
+
const prop = byKey.get(key);
|
|
171
|
+
if (!prop) continue;
|
|
172
|
+
score += 1;
|
|
173
|
+
score += scoreNested(sub, prop.value, valueKeyedBy, visiting);
|
|
174
|
+
}
|
|
175
|
+
visiting.delete(value);
|
|
176
|
+
return score;
|
|
177
|
+
}
|
|
178
|
+
function scoreNested(value, target, valueKeyedBy, visiting) {
|
|
179
|
+
if (!target || isTerminalValueShape(target) || value === null || typeof value !== "object") {
|
|
180
|
+
return 0;
|
|
181
|
+
}
|
|
182
|
+
if (target.kind === "array") {
|
|
183
|
+
if (!Array.isArray(value) || value.length === 0) return 0;
|
|
184
|
+
return scoreNested(value[0], target.element, valueKeyedBy, visiting);
|
|
185
|
+
}
|
|
186
|
+
if (target.kind === "record") {
|
|
187
|
+
if (Array.isArray(value)) return 0;
|
|
188
|
+
const first = Object.values(value)[0];
|
|
189
|
+
if (first === void 0) return 0;
|
|
190
|
+
return scoreNested(first, target.value, valueKeyedBy, visiting);
|
|
191
|
+
}
|
|
192
|
+
if (target.kind === "tuple") {
|
|
193
|
+
if (!Array.isArray(value)) return 0;
|
|
194
|
+
return target.values.reduce(
|
|
195
|
+
(score, tupleValue, index) => score + scoreNested(value[index], tupleValue, valueKeyedBy, visiting),
|
|
196
|
+
0
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
if (Array.isArray(value)) return 0;
|
|
200
|
+
const nested = resolveModelShape(target.value(), value, valueKeyedBy);
|
|
201
|
+
if (!nested) return 0;
|
|
202
|
+
return scoreShape(nested, value, valueKeyedBy, visiting);
|
|
203
|
+
}
|
|
204
|
+
const shapePropertiesCache = /* @__PURE__ */ new WeakMap();
|
|
205
|
+
function getShapePropertiesMap(shape, keyedBy) {
|
|
206
|
+
let byNaming = shapePropertiesCache.get(shape);
|
|
207
|
+
if (!byNaming) {
|
|
208
|
+
byNaming = /* @__PURE__ */ new Map();
|
|
209
|
+
shapePropertiesCache.set(shape, byNaming);
|
|
210
|
+
}
|
|
211
|
+
let byKey = byNaming.get(keyedBy);
|
|
212
|
+
if (byKey) return byKey;
|
|
213
|
+
byKey = /* @__PURE__ */ new Map();
|
|
214
|
+
for (const [jsName, prop] of Object.entries(shape.byJsName)) {
|
|
215
|
+
const key = keyedBy === "js" ? jsName : prop.armPath[0];
|
|
216
|
+
if (key !== void 0 && !byKey.has(key)) byKey.set(key, prop);
|
|
217
|
+
}
|
|
218
|
+
byNaming.set(keyedBy, byKey);
|
|
219
|
+
return byKey;
|
|
220
|
+
}
|
|
221
|
+
function flattenVariants(group, seen) {
|
|
222
|
+
if (seen.has(group)) return [];
|
|
223
|
+
seen.add(group);
|
|
224
|
+
const out = [];
|
|
225
|
+
for (const key of Object.keys(group.byValue)) {
|
|
226
|
+
let entry = group.byValue[key];
|
|
227
|
+
if (entry?.kind === "deferred") entry = entry.value();
|
|
228
|
+
if (entry === void 0) continue;
|
|
229
|
+
if (entry.kind === "flatModel") out.push(entry);
|
|
230
|
+
else out.push(...flattenVariants(entry, seen));
|
|
231
|
+
}
|
|
232
|
+
return out;
|
|
233
|
+
}
|
|
234
|
+
function navigateShape(nav, segment, value) {
|
|
235
|
+
if (typeof segment === "number") {
|
|
236
|
+
return { stamp: void 0, next: peelContainer(nav, segment) };
|
|
237
|
+
}
|
|
238
|
+
if (isModelShape(nav)) {
|
|
239
|
+
const flat = resolveModelShape(nav, asRecord(value));
|
|
240
|
+
const stamp = flat?.byJsName[segment];
|
|
241
|
+
if (!stamp) return { stamp: void 0, next: void 0 };
|
|
242
|
+
return { stamp, next: derefTarget(stamp.value) };
|
|
243
|
+
}
|
|
244
|
+
if (nav && nav.kind === "record") {
|
|
245
|
+
return { stamp: void 0, next: derefTarget(nav.value) };
|
|
246
|
+
}
|
|
247
|
+
return { stamp: void 0, next: void 0 };
|
|
248
|
+
}
|
|
249
|
+
function asRecord(value) {
|
|
250
|
+
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
251
|
+
}
|
|
252
|
+
function isModelShape(nav) {
|
|
253
|
+
return nav !== void 0 && (nav.kind === "flatModel" || nav.kind === "discriminatedModel");
|
|
254
|
+
}
|
|
255
|
+
function peelContainer(nav, index) {
|
|
256
|
+
if (!nav || isModelShape(nav)) return void 0;
|
|
257
|
+
if (nav.kind === "array") return derefTarget(nav.element);
|
|
258
|
+
if (nav.kind === "record") return derefTarget(nav.value);
|
|
259
|
+
return derefTarget(nav.values[index]);
|
|
260
|
+
}
|
|
261
|
+
function derefTarget(shape) {
|
|
262
|
+
if (!shape || isTerminalValueShape(shape)) return void 0;
|
|
263
|
+
if (shape.kind === "deferred") return shape.value();
|
|
264
|
+
return shape;
|
|
265
|
+
}
|
|
266
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
267
|
+
0 && (module.exports = {
|
|
268
|
+
createAnyShape,
|
|
269
|
+
createArrayShape,
|
|
270
|
+
createBooleanLiteralShape,
|
|
271
|
+
createBooleanShape,
|
|
272
|
+
createBytesShape,
|
|
273
|
+
createDateShape,
|
|
274
|
+
createDeferredShape,
|
|
275
|
+
createDiscriminatedModelShape,
|
|
276
|
+
createEnumShape,
|
|
277
|
+
createFlatModelShape,
|
|
278
|
+
createNullShape,
|
|
279
|
+
createNumberLiteralShape,
|
|
280
|
+
createNumberShape,
|
|
281
|
+
createRecordShape,
|
|
282
|
+
createStringLiteralShape,
|
|
283
|
+
createStringShape,
|
|
284
|
+
createTupleShape,
|
|
285
|
+
createUnionShape,
|
|
286
|
+
isTerminalValueShape,
|
|
287
|
+
navigateShape,
|
|
288
|
+
resolveModelShape
|
|
289
|
+
});
|
|
290
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/shape/shape.ts"],
|
|
4
|
+
"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 \u2014\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 \u2014 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 \u2014 ARM discriminators are `type`, `name`, `kind` and\n * service teams rarely rename them \u2014 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 \u2014\n * {@link resolveModelShape} infers the variant from the payload's\n * structure instead.\n *\n * Entries may be:\n * - a {@link FlatModelShape} \u2014 the terminal, common case;\n * - a {@link DeferredShape} \u2014 breaks emit-order / cyclic-reference\n * hazards, exactly as {@link PropertyShape.value} does;\n * - a nested {@link DiscriminatedModelShape} \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014 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 \u2014\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} \u2014 we're at a model's properties, whether or\n * not its variant is known,\n * - a {@link ContainerShape} \u2014 we're at a container that hasn't yet been\n * indexed,\n * - `undefined` \u2014 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} \u2014 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` \u2192 `Cat`\n * \u2192 `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 \u2014 it is absent, is not a\n * string (the *expression-valued* case), or names an unknown variant \u2014\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 \u2014 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 \u2014 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\"` \u2014 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\"` \u2014 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 \u2014 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 \u2014 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 \u2014 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.) \u2014 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 \u2014 an `Expression<T>` proxy, for\n * instance \u2014 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 \u2014 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} \u2014 where a property *points* \u2014 into a\n * {@link NavShape} \u2014 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*` \u2014 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"],
|
|
5
|
+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AS,QAAS,QAAO,YAAY,IAAI,OAAO;AACxD,MAAI,IAAI,SAAS,SAAU,QAAO,YAAY,IAAI,KAAK;AACvD,SAAO,YAAY,IAAI,OAAO,KAAK,CAAC;AACtC;AAgBA,SAAS,YAAY,OAAyC;AAC5D,MAAI,CAAC,SAAS,qBAAqB,KAAK,EAAG,QAAO;AAClD,MAAI,MAAM,SAAS,WAAY,QAAO,MAAM,MAAM;AAClD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export declare const INTEGER_SCALAR_NAMES: readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64"];
|
|
2
|
+
export type IntegerScalarName = (typeof INTEGER_SCALAR_NAMES)[number];
|
|
3
|
+
export declare const NUMERIC_SCALAR_NAMES: readonly ["integer", "safeint", "int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64", "numeric", "decimal", "decimal128", "float", "float32", "float64"];
|
|
4
|
+
export type NumericScalarName = (typeof NUMERIC_SCALAR_NAMES)[number];
|
|
5
|
+
export declare function isIntegerScalarName(name: string): name is IntegerScalarName;
|
|
6
|
+
export declare function isNumericScalarName(name: string): name is NumericScalarName;
|
|
7
|
+
export interface DateTimeTextEncodingDescriptor {
|
|
8
|
+
readonly kind: "date-time-text";
|
|
9
|
+
readonly source: "utcDateTime" | "offsetDateTime";
|
|
10
|
+
readonly format: "rfc3339" | "rfc7231";
|
|
11
|
+
readonly clientMode: "client" | "wire";
|
|
12
|
+
readonly wire: {
|
|
13
|
+
readonly kind: "string";
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export interface UnixTimestampEncodingDescriptor {
|
|
17
|
+
readonly kind: "unix-timestamp";
|
|
18
|
+
readonly source: "utcDateTime";
|
|
19
|
+
readonly unit: "seconds";
|
|
20
|
+
readonly clientMode: "client" | "wire";
|
|
21
|
+
readonly wire: {
|
|
22
|
+
readonly kind: "integer";
|
|
23
|
+
readonly scalar: IntegerScalarName;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface DurationIso8601EncodingDescriptor {
|
|
27
|
+
readonly kind: "duration-iso8601";
|
|
28
|
+
readonly source: "duration";
|
|
29
|
+
readonly clientMode: "wire";
|
|
30
|
+
readonly wire: {
|
|
31
|
+
readonly kind: "string";
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface DurationNumericEncodingDescriptor {
|
|
35
|
+
readonly kind: "duration-numeric";
|
|
36
|
+
readonly source: "duration";
|
|
37
|
+
readonly unit: "seconds" | "milliseconds";
|
|
38
|
+
readonly clientMode: "wire";
|
|
39
|
+
readonly wire: {
|
|
40
|
+
readonly kind: "integer";
|
|
41
|
+
readonly scalar: IntegerScalarName;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface BytesEncodingDescriptor {
|
|
45
|
+
readonly kind: "bytes";
|
|
46
|
+
readonly source: "bytes";
|
|
47
|
+
readonly format: "base64" | "base64url";
|
|
48
|
+
readonly clientMode: "client" | "wire";
|
|
49
|
+
readonly wire: {
|
|
50
|
+
readonly kind: "string";
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface PlainDateEncodingDescriptor {
|
|
54
|
+
readonly kind: "plain-date";
|
|
55
|
+
readonly source: "plainDate";
|
|
56
|
+
readonly clientMode: "client" | "wire";
|
|
57
|
+
readonly wire: {
|
|
58
|
+
readonly kind: "string";
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export interface NumericStringEncodingDescriptor {
|
|
62
|
+
readonly kind: "numeric-string";
|
|
63
|
+
readonly source: "integer" | "number";
|
|
64
|
+
readonly sourceScalar: NumericScalarName;
|
|
65
|
+
readonly clientMode: "wire";
|
|
66
|
+
readonly wire: {
|
|
67
|
+
readonly kind: "string";
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface BooleanStringEncodingDescriptor {
|
|
71
|
+
readonly kind: "boolean-string";
|
|
72
|
+
readonly source: "boolean";
|
|
73
|
+
readonly clientMode: "client" | "wire";
|
|
74
|
+
readonly wire: {
|
|
75
|
+
readonly kind: "string";
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export type ValueEncodingDescriptor = DateTimeTextEncodingDescriptor | UnixTimestampEncodingDescriptor | DurationIso8601EncodingDescriptor | DurationNumericEncodingDescriptor | BytesEncodingDescriptor | PlainDateEncodingDescriptor | NumericStringEncodingDescriptor | BooleanStringEncodingDescriptor;
|
|
79
|
+
/**
|
|
80
|
+
* Encodings whose client-side value is a JavaScript `string`.
|
|
81
|
+
*
|
|
82
|
+
* The source TypeSpec scalar can be a date/time, duration, byte sequence,
|
|
83
|
+
* numeric value, or boolean. `clientMode: "wire"` is the important invariant:
|
|
84
|
+
* it means the generated TypeScript API exposes the encoded string itself.
|
|
85
|
+
*/
|
|
86
|
+
export type StringValueEncodingDescriptor = (DateTimeTextEncodingDescriptor & {
|
|
87
|
+
readonly clientMode: "wire";
|
|
88
|
+
}) | DurationIso8601EncodingDescriptor | (BytesEncodingDescriptor & {
|
|
89
|
+
readonly clientMode: "wire";
|
|
90
|
+
}) | (PlainDateEncodingDescriptor & {
|
|
91
|
+
readonly clientMode: "wire";
|
|
92
|
+
}) | NumericStringEncodingDescriptor | (BooleanStringEncodingDescriptor & {
|
|
93
|
+
readonly clientMode: "wire";
|
|
94
|
+
});
|
|
95
|
+
/** Encoding supported by a client-side JavaScript `boolean`. */
|
|
96
|
+
export type BooleanValueEncodingDescriptor = BooleanStringEncodingDescriptor & {
|
|
97
|
+
readonly clientMode: "client";
|
|
98
|
+
};
|
|
99
|
+
/** Encodings whose client-side value is a JavaScript `number`. */
|
|
100
|
+
export type NumberValueEncodingDescriptor = (UnixTimestampEncodingDescriptor & {
|
|
101
|
+
readonly clientMode: "wire";
|
|
102
|
+
}) | DurationNumericEncodingDescriptor;
|
|
103
|
+
/** Encoding supported by a client-side JavaScript `Uint8Array`. */
|
|
104
|
+
export type BytesValueEncodingDescriptor = BytesEncodingDescriptor & {
|
|
105
|
+
readonly clientMode: "client";
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* Encodings whose client-side value is a JavaScript `Date`.
|
|
109
|
+
*
|
|
110
|
+
* `offsetDateTime` is intentionally absent: the emitter exposes it as a
|
|
111
|
+
* string so the original offset is not erased.
|
|
112
|
+
*/
|
|
113
|
+
export type DateValueEncodingDescriptor = (DateTimeTextEncodingDescriptor & {
|
|
114
|
+
readonly source: "utcDateTime";
|
|
115
|
+
readonly clientMode: "client";
|
|
116
|
+
}) | (UnixTimestampEncodingDescriptor & {
|
|
117
|
+
readonly clientMode: "client";
|
|
118
|
+
}) | (PlainDateEncodingDescriptor & {
|
|
119
|
+
readonly clientMode: "client";
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=value-encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"value-encoding.d.ts","sourceRoot":"","sources":["../../../src/shape/value-encoding.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,2GAWvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,eAAO,MAAM,oBAAoB,8KAQvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAKtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAE3E;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,iBAAiB,CAE3E;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAAC;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,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var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var value_encoding_exports = {};
|
|
19
|
+
__export(value_encoding_exports, {
|
|
20
|
+
INTEGER_SCALAR_NAMES: () => INTEGER_SCALAR_NAMES,
|
|
21
|
+
NUMERIC_SCALAR_NAMES: () => NUMERIC_SCALAR_NAMES,
|
|
22
|
+
isIntegerScalarName: () => isIntegerScalarName,
|
|
23
|
+
isNumericScalarName: () => isNumericScalarName
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(value_encoding_exports);
|
|
26
|
+
const INTEGER_SCALAR_NAMES = [
|
|
27
|
+
"integer",
|
|
28
|
+
"safeint",
|
|
29
|
+
"int8",
|
|
30
|
+
"int16",
|
|
31
|
+
"int32",
|
|
32
|
+
"int64",
|
|
33
|
+
"uint8",
|
|
34
|
+
"uint16",
|
|
35
|
+
"uint32",
|
|
36
|
+
"uint64"
|
|
37
|
+
];
|
|
38
|
+
const NUMERIC_SCALAR_NAMES = [
|
|
39
|
+
...INTEGER_SCALAR_NAMES,
|
|
40
|
+
"numeric",
|
|
41
|
+
"decimal",
|
|
42
|
+
"decimal128",
|
|
43
|
+
"float",
|
|
44
|
+
"float32",
|
|
45
|
+
"float64"
|
|
46
|
+
];
|
|
47
|
+
const integerScalarNames = new Set(INTEGER_SCALAR_NAMES);
|
|
48
|
+
const numericScalarNames = new Set(NUMERIC_SCALAR_NAMES);
|
|
49
|
+
function isIntegerScalarName(name) {
|
|
50
|
+
return integerScalarNames.has(name);
|
|
51
|
+
}
|
|
52
|
+
function isNumericScalarName(name) {
|
|
53
|
+
return numericScalarNames.has(name);
|
|
54
|
+
}
|
|
55
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
56
|
+
0 && (module.exports = {
|
|
57
|
+
INTEGER_SCALAR_NAMES,
|
|
58
|
+
NUMERIC_SCALAR_NAMES,
|
|
59
|
+
isIntegerScalarName,
|
|
60
|
+
isNumericScalarName
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=value-encoding.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/shape/value-encoding.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport const INTEGER_SCALAR_NAMES = [\n \"integer\",\n \"safeint\",\n \"int8\",\n \"int16\",\n \"int32\",\n \"int64\",\n \"uint8\",\n \"uint16\",\n \"uint32\",\n \"uint64\",\n] as const;\n\nexport type IntegerScalarName = (typeof INTEGER_SCALAR_NAMES)[number];\n\nexport const NUMERIC_SCALAR_NAMES = [\n ...INTEGER_SCALAR_NAMES,\n \"numeric\",\n \"decimal\",\n \"decimal128\",\n \"float\",\n \"float32\",\n \"float64\",\n] as const;\n\nexport type NumericScalarName = (typeof NUMERIC_SCALAR_NAMES)[number];\n\nconst integerScalarNames: ReadonlySet<string> = new Set(INTEGER_SCALAR_NAMES);\nconst numericScalarNames: ReadonlySet<string> = new Set(NUMERIC_SCALAR_NAMES);\n\nexport function isIntegerScalarName(name: string): name is IntegerScalarName {\n return integerScalarNames.has(name);\n}\n\nexport function isNumericScalarName(name: string): name is NumericScalarName {\n return numericScalarNames.has(name);\n}\n\nexport interface DateTimeTextEncodingDescriptor {\n readonly kind: \"date-time-text\";\n readonly source: \"utcDateTime\" | \"offsetDateTime\";\n readonly format: \"rfc3339\" | \"rfc7231\";\n readonly clientMode: \"client\" | \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport interface UnixTimestampEncodingDescriptor {\n readonly kind: \"unix-timestamp\";\n readonly source: \"utcDateTime\";\n readonly unit: \"seconds\";\n readonly clientMode: \"client\" | \"wire\";\n readonly wire: {\n readonly kind: \"integer\";\n readonly scalar: IntegerScalarName;\n };\n}\n\nexport interface DurationIso8601EncodingDescriptor {\n readonly kind: \"duration-iso8601\";\n readonly source: \"duration\";\n readonly clientMode: \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport interface DurationNumericEncodingDescriptor {\n readonly kind: \"duration-numeric\";\n readonly source: \"duration\";\n readonly unit: \"seconds\" | \"milliseconds\";\n readonly clientMode: \"wire\";\n readonly wire: {\n readonly kind: \"integer\";\n readonly scalar: IntegerScalarName;\n };\n}\n\nexport interface BytesEncodingDescriptor {\n readonly kind: \"bytes\";\n readonly source: \"bytes\";\n readonly format: \"base64\" | \"base64url\";\n readonly clientMode: \"client\" | \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport interface PlainDateEncodingDescriptor {\n readonly kind: \"plain-date\";\n readonly source: \"plainDate\";\n readonly clientMode: \"client\" | \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport interface NumericStringEncodingDescriptor {\n readonly kind: \"numeric-string\";\n readonly source: \"integer\" | \"number\";\n readonly sourceScalar: NumericScalarName;\n readonly clientMode: \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport interface BooleanStringEncodingDescriptor {\n readonly kind: \"boolean-string\";\n readonly source: \"boolean\";\n readonly clientMode: \"client\" | \"wire\";\n readonly wire: { readonly kind: \"string\" };\n}\n\nexport type ValueEncodingDescriptor =\n | DateTimeTextEncodingDescriptor\n | UnixTimestampEncodingDescriptor\n | DurationIso8601EncodingDescriptor\n | DurationNumericEncodingDescriptor\n | BytesEncodingDescriptor\n | PlainDateEncodingDescriptor\n | NumericStringEncodingDescriptor\n | BooleanStringEncodingDescriptor;\n\n/**\n * Encodings whose client-side value is a JavaScript `string`.\n *\n * The source TypeSpec scalar can be a date/time, duration, byte sequence,\n * numeric value, or boolean. `clientMode: \"wire\"` is the important invariant:\n * it means the generated TypeScript API exposes the encoded string itself.\n */\nexport type StringValueEncodingDescriptor =\n | (DateTimeTextEncodingDescriptor & { readonly clientMode: \"wire\" })\n | DurationIso8601EncodingDescriptor\n | (BytesEncodingDescriptor & { readonly clientMode: \"wire\" })\n | (PlainDateEncodingDescriptor & { readonly clientMode: \"wire\" })\n | NumericStringEncodingDescriptor\n | (BooleanStringEncodingDescriptor & { readonly clientMode: \"wire\" });\n\n/** Encoding supported by a client-side JavaScript `boolean`. */\nexport type BooleanValueEncodingDescriptor = BooleanStringEncodingDescriptor & {\n readonly clientMode: \"client\";\n};\n\n/** Encodings whose client-side value is a JavaScript `number`. */\nexport type NumberValueEncodingDescriptor =\n | (UnixTimestampEncodingDescriptor & { readonly clientMode: \"wire\" })\n | DurationNumericEncodingDescriptor;\n\n/** Encoding supported by a client-side JavaScript `Uint8Array`. */\nexport type BytesValueEncodingDescriptor = BytesEncodingDescriptor & {\n readonly clientMode: \"client\";\n};\n\n/**\n * Encodings whose client-side value is a JavaScript `Date`.\n *\n * `offsetDateTime` is intentionally absent: the emitter exposes it as a\n * string so the original offset is not erased.\n */\nexport type DateValueEncodingDescriptor =\n | (DateTimeTextEncodingDescriptor & {\n readonly source: \"utcDateTime\";\n readonly clientMode: \"client\";\n })\n | (UnixTimestampEncodingDescriptor & { readonly clientMode: \"client\" })\n | (PlainDateEncodingDescriptor & { readonly clientMode: \"client\" });\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,uBAAuB;AAAA,EAClC,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIA,MAAM,qBAA0C,IAAI,IAAI,oBAAoB;AAC5E,MAAM,qBAA0C,IAAI,IAAI,oBAAoB;AAErE,SAAS,oBAAoB,MAAyC;AAC3E,SAAO,mBAAmB,IAAI,IAAI;AACpC;AAEO,SAAS,oBAAoB,MAAyC;AAC3E,SAAO,mBAAmB,IAAI,IAAI;AACpC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.59.1"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General-purpose type aliases used across the core package.
|
|
3
|
+
*
|
|
4
|
+
* Keep this file dependency-free so it can be imported from any layer
|
|
5
|
+
* (AST, proxy, resource, shape) without introducing cycles.
|
|
6
|
+
*/
|
|
7
|
+
/** A single member access segment: an object property name or an array index. */
|
|
8
|
+
export type PropertySegment = string | number;
|
|
9
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,iFAAiF;AACjF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var types_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(types_exports);
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/types.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * General-purpose type aliases used across the core package.\n *\n * Keep this file dependency-free so it can be imported from any layer\n * (AST, proxy, resource, shape) without introducing cycles.\n */\n\n/** A single member access segment: an object property name or an array index. */\nexport type PropertySegment = string | number;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|