@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,152 @@
|
|
|
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 ast_nodes_exports = {};
|
|
19
|
+
__export(ast_nodes_exports, {
|
|
20
|
+
accessExpressionNode: () => accessExpressionNode,
|
|
21
|
+
arrayAccessExpressionNode: () => arrayAccessExpressionNode,
|
|
22
|
+
binaryExpressionNode: () => binaryExpressionNode,
|
|
23
|
+
functionCallExpressionNode: () => functionCallExpressionNode,
|
|
24
|
+
identifierExpressionNode: () => identifierExpressionNode,
|
|
25
|
+
instanceFunctionCallExpressionNode: () => instanceFunctionCallExpressionNode,
|
|
26
|
+
interpolatedStringExpressionNode: () => interpolatedStringExpressionNode,
|
|
27
|
+
isExpressionNode: () => isExpressionNode,
|
|
28
|
+
propertyAccessExpressionNode: () => propertyAccessExpressionNode,
|
|
29
|
+
symbolicValueExpressionNode: () => symbolicValueExpressionNode,
|
|
30
|
+
ternaryExpressionNode: () => ternaryExpressionNode,
|
|
31
|
+
unaryExpressionNode: () => unaryExpressionNode
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(ast_nodes_exports);
|
|
34
|
+
const EXPRESSION_NODE_KINDS = {
|
|
35
|
+
"fn-call": true,
|
|
36
|
+
"symbolic-value": true,
|
|
37
|
+
identifier: true,
|
|
38
|
+
"property-access": true,
|
|
39
|
+
"array-access": true,
|
|
40
|
+
binary: true,
|
|
41
|
+
unary: true,
|
|
42
|
+
ternary: true,
|
|
43
|
+
"instance-function-call": true,
|
|
44
|
+
"interpolated-string": true
|
|
45
|
+
};
|
|
46
|
+
function isExpressionNode(value) {
|
|
47
|
+
if (typeof value !== "object" || value === null || !Object.prototype.hasOwnProperty.call(value, "kind") || typeof value.kind !== "string") {
|
|
48
|
+
return false;
|
|
49
|
+
}
|
|
50
|
+
const node = value;
|
|
51
|
+
if (!Object.prototype.hasOwnProperty.call(EXPRESSION_NODE_KINDS, node.kind)) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
switch (node.kind) {
|
|
55
|
+
case "fn-call":
|
|
56
|
+
return typeof node.operator === "string" && Array.isArray(node.args);
|
|
57
|
+
case "symbolic-value":
|
|
58
|
+
return typeof node.path === "string";
|
|
59
|
+
case "identifier":
|
|
60
|
+
return typeof node.id === "string" || typeof node.id === "object";
|
|
61
|
+
case "property-access":
|
|
62
|
+
return isExpressionNode(node.base) && typeof node.property === "string" && typeof node.nullish === "boolean";
|
|
63
|
+
case "array-access":
|
|
64
|
+
return isExpressionNode(node.base) && "index" in node && typeof node.nullish === "boolean" && typeof node.fromEnd === "boolean";
|
|
65
|
+
case "binary":
|
|
66
|
+
return typeof node.operator === "string" && "left" in node && "right" in node;
|
|
67
|
+
case "unary":
|
|
68
|
+
return typeof node.operator === "string" && "argument" in node;
|
|
69
|
+
case "ternary":
|
|
70
|
+
return "condition" in node && "trueValue" in node && "falseValue" in node;
|
|
71
|
+
case "instance-function-call":
|
|
72
|
+
return isExpressionNode(node.base) && typeof node.name === "string" && Array.isArray(node.args);
|
|
73
|
+
case "interpolated-string":
|
|
74
|
+
return Array.isArray(node.segments);
|
|
75
|
+
default:
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function functionCallExpressionNode(operator, args) {
|
|
80
|
+
return { kind: "fn-call", operator, args };
|
|
81
|
+
}
|
|
82
|
+
function symbolicValueExpressionNode(path) {
|
|
83
|
+
return { kind: "symbolic-value", path };
|
|
84
|
+
}
|
|
85
|
+
function identifierExpressionNode(identifier) {
|
|
86
|
+
return { kind: "identifier", id: identifier };
|
|
87
|
+
}
|
|
88
|
+
function propertyAccessExpressionNode(base, property, options = {}) {
|
|
89
|
+
return {
|
|
90
|
+
kind: "property-access",
|
|
91
|
+
base,
|
|
92
|
+
property,
|
|
93
|
+
nullish: options.nullish ?? false,
|
|
94
|
+
...options.armPath === void 0 ? {} : { armPath: options.armPath }
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function arrayAccessExpressionNode(base, index, options = {}) {
|
|
98
|
+
return {
|
|
99
|
+
kind: "array-access",
|
|
100
|
+
base,
|
|
101
|
+
index,
|
|
102
|
+
nullish: options.nullish ?? false,
|
|
103
|
+
fromEnd: options.fromEnd ?? false
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function binaryExpressionNode(operator, left, right) {
|
|
107
|
+
return { kind: "binary", operator, left, right };
|
|
108
|
+
}
|
|
109
|
+
function unaryExpressionNode(operator, argument) {
|
|
110
|
+
return { kind: "unary", operator, argument };
|
|
111
|
+
}
|
|
112
|
+
function ternaryExpressionNode(condition, trueValue, falseValue) {
|
|
113
|
+
return {
|
|
114
|
+
kind: "ternary",
|
|
115
|
+
condition,
|
|
116
|
+
trueValue,
|
|
117
|
+
falseValue
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function instanceFunctionCallExpressionNode(base, name, args) {
|
|
121
|
+
return {
|
|
122
|
+
kind: "instance-function-call",
|
|
123
|
+
base,
|
|
124
|
+
name,
|
|
125
|
+
args
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
function interpolatedStringExpressionNode(segments) {
|
|
129
|
+
return { kind: "interpolated-string", segments };
|
|
130
|
+
}
|
|
131
|
+
function isIdentifierSegment(segment) {
|
|
132
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/u.test(segment);
|
|
133
|
+
}
|
|
134
|
+
function accessExpressionNode(base, member, options = {}) {
|
|
135
|
+
return typeof member === "number" || !isIdentifierSegment(member) ? arrayAccessExpressionNode(base, member, options) : propertyAccessExpressionNode(base, member, options);
|
|
136
|
+
}
|
|
137
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
+
0 && (module.exports = {
|
|
139
|
+
accessExpressionNode,
|
|
140
|
+
arrayAccessExpressionNode,
|
|
141
|
+
binaryExpressionNode,
|
|
142
|
+
functionCallExpressionNode,
|
|
143
|
+
identifierExpressionNode,
|
|
144
|
+
instanceFunctionCallExpressionNode,
|
|
145
|
+
interpolatedStringExpressionNode,
|
|
146
|
+
isExpressionNode,
|
|
147
|
+
propertyAccessExpressionNode,
|
|
148
|
+
symbolicValueExpressionNode,
|
|
149
|
+
ternaryExpressionNode,
|
|
150
|
+
unaryExpressionNode
|
|
151
|
+
});
|
|
152
|
+
//# sourceMappingURL=ast-nodes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/expression/ast-nodes.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { Resource } from \"../constructs/resource/resource.js\";\nimport type { BinaryOperator, UnaryOperator } from \"../serialization/contract/index.js\";\nimport type { PropertySegment } from \"../types.js\";\n\nexport type { BinaryOperator, UnaryOperator };\n\n// ---------------------------------------------------------------------------\n// Expression node interfaces (the raw discriminated union members)\n// ---------------------------------------------------------------------------\n\n// Note: every interface declares a phantom `TValue` (when otherwise it wouldn't\n// need one). `TValue` is *not* used in any field of any interface \u2014 but its\n// presence in the variant *type-parameter slot* is what allows\n// `ExpressionNode<T>` to thread `T` through to each variant, which in turn is\n// what lets `ExpressionBrand<T>` carry inference-visible `T` across project-\n// reference boundaries. Removing `TValue` and making `ExpressionNode<T>` a\n// fully-phantom alias breaks `coalesce<T>(...)` inference and the\n// `as DeploymentParameter<...>` cast in cross-project consumers (e.g. `demo`).\n\nexport interface FunctionCallExpressionNode<_TValue = unknown, TOperator extends string = string> {\n readonly kind: \"fn-call\";\n readonly operator: TOperator;\n readonly args: readonly unknown[];\n}\n\nexport interface SymbolicValueExpressionNode<_TValue = unknown, TPath extends string = string> {\n readonly kind: \"symbolic-value\";\n readonly path: TPath;\n}\n\nexport interface IdentifierExpressionNode<_TValue = unknown> {\n readonly kind: \"identifier\";\n readonly id: string | Resource;\n}\n\nexport interface PropertyAccessExpressionNode<_TValue = unknown> {\n readonly kind: \"property-access\";\n readonly base: ExpressionNode;\n readonly property: string;\n readonly nullish: boolean;\n /**\n * Optional ARM wire-path segments. When present, the serialization\n * lowering pass rewrites this single access into a chain that walks\n * these segments (handling renames + `@flattenProperty` hoisting).\n * Untyped / hand-built expressions leave this `undefined` and pass\n * through unchanged.\n */\n readonly armPath?: readonly string[] | undefined;\n}\n\nexport interface ArrayAccessExpressionNode<_TValue = unknown> {\n readonly kind: \"array-access\";\n readonly base: ExpressionNode;\n /**\n * The index into the array. A literal `number`/`string` lowers to an\n * integer/string array-access (or a property-access for identifier-like\n * strings) at serialize time. Any {@link ExpressionNode} is serialized\n * recursively into the wire array-access's `index` slot \u2014 e.g. a looped\n * `.at(loop.index)` stores the unwrapped `symbolic-value` node (emitting\n * `sym[i]`), and a computed offset stores a `binary` / `fn-call` node\n * (`sym[i + 1]`). `Expression<T>` proxies are always unwrapped to their\n * raw node before landing here, per the \"state holds normalized raw\n * nodes\" invariant \u2014 so a proxy is never stored directly.\n */\n readonly index: ArrayAccessIndex;\n readonly nullish: boolean;\n readonly fromEnd: boolean;\n}\n\nexport interface BinaryExpressionNode<_TValue = unknown> {\n readonly kind: \"binary\";\n readonly operator: BinaryOperator;\n readonly left: unknown;\n readonly right: unknown;\n}\n\nexport interface UnaryExpressionNode<_TValue = unknown> {\n readonly kind: \"unary\";\n readonly operator: UnaryOperator;\n readonly argument: unknown;\n}\n\nexport interface TernaryExpressionNode<_TValue = unknown> {\n readonly kind: \"ternary\";\n readonly condition: unknown;\n readonly trueValue: unknown;\n readonly falseValue: unknown;\n}\n\nexport interface InstanceFunctionCallExpressionNode<_TValue = unknown> {\n readonly kind: \"instance-function-call\";\n readonly base: ExpressionNode;\n readonly name: string;\n readonly args: readonly unknown[];\n}\n\nexport interface InterpolatedStringExpressionNode<_TValue = unknown> {\n readonly kind: \"interpolated-string\";\n readonly segments: readonly unknown[];\n}\n\n// ---------------------------------------------------------------------------\n// ExpressionNode union\n// ---------------------------------------------------------------------------\n\n// `T` is threaded through every variant. See the long comment above the node\n// interfaces for why this matters.\nexport type ExpressionNode<T = unknown> =\n | FunctionCallExpressionNode<T>\n | SymbolicValueExpressionNode<T>\n | IdentifierExpressionNode<T>\n | PropertyAccessExpressionNode<T>\n | ArrayAccessExpressionNode<T>\n | BinaryExpressionNode<T>\n | UnaryExpressionNode<T>\n | TernaryExpressionNode<T>\n | InstanceFunctionCallExpressionNode<T>\n | InterpolatedStringExpressionNode<T>;\n\n/**\n * The index stored on an {@link ArrayAccessExpressionNode}: a literal\n * `number` or `string`, or a raw {@link ExpressionNode} evaluated at\n * serialize time (e.g. a loop's `symbolic-value` index, or a `binary` /\n * `fn-call` node for a computed offset). `Expression<T>` proxies are\n * unwrapped to their raw node before being stored, so the proxy type is\n * intentionally absent here.\n */\nexport type ArrayAccessIndex = number | string | ExpressionNode;\n\n// Typed as `Record<ExpressionNode[\"kind\"], true>` so adding a new variant to\n// `ExpressionNode` forces a compile error here until the new kind is listed.\nconst EXPRESSION_NODE_KINDS: Record<ExpressionNode[\"kind\"], true> = {\n \"fn-call\": true,\n \"symbolic-value\": true,\n identifier: true,\n \"property-access\": true,\n \"array-access\": true,\n binary: true,\n unary: true,\n ternary: true,\n \"instance-function-call\": true,\n \"interpolated-string\": true,\n};\n\n/** Tests whether a value structurally matches a raw expression AST node. */\nexport function isExpressionNode(value: unknown): value is ExpressionNode {\n if (\n typeof value !== \"object\" ||\n value === null ||\n !Object.prototype.hasOwnProperty.call(value, \"kind\") ||\n typeof (value as { kind: unknown }).kind !== \"string\"\n ) {\n return false;\n }\n const node = value as Record<string, unknown>;\n if (!Object.prototype.hasOwnProperty.call(EXPRESSION_NODE_KINDS, node.kind as string)) {\n return false;\n }\n switch (node.kind) {\n case \"fn-call\":\n return typeof node.operator === \"string\" && Array.isArray(node.args);\n case \"symbolic-value\":\n return typeof node.path === \"string\";\n case \"identifier\":\n return typeof node.id === \"string\" || typeof node.id === \"object\";\n case \"property-access\":\n return (\n isExpressionNode(node.base) &&\n typeof node.property === \"string\" &&\n typeof node.nullish === \"boolean\"\n );\n case \"array-access\":\n return (\n isExpressionNode(node.base) &&\n \"index\" in node &&\n typeof node.nullish === \"boolean\" &&\n typeof node.fromEnd === \"boolean\"\n );\n case \"binary\":\n return typeof node.operator === \"string\" && \"left\" in node && \"right\" in node;\n case \"unary\":\n return typeof node.operator === \"string\" && \"argument\" in node;\n case \"ternary\":\n return \"condition\" in node && \"trueValue\" in node && \"falseValue\" in node;\n case \"instance-function-call\":\n return (\n isExpressionNode(node.base) && typeof node.name === \"string\" && Array.isArray(node.args)\n );\n case \"interpolated-string\":\n return Array.isArray(node.segments);\n default:\n return false;\n }\n}\n\n// ---------------------------------------------------------------------------\n// Factory functions\n// ---------------------------------------------------------------------------\n\nexport function functionCallExpressionNode<TValue = unknown, TOperator extends string = string>(\n operator: TOperator,\n args: readonly unknown[],\n): FunctionCallExpressionNode<TValue, TOperator> {\n return { kind: \"fn-call\", operator, args };\n}\n\nexport function symbolicValueExpressionNode<TValue = unknown, TPath extends string = string>(\n path: TPath,\n): SymbolicValueExpressionNode<TValue, TPath> {\n return { kind: \"symbolic-value\", path };\n}\n\nexport function identifierExpressionNode<TValue = unknown>(\n identifier: string | Resource,\n): IdentifierExpressionNode<TValue> {\n return { kind: \"identifier\", id: identifier };\n}\n\nexport function propertyAccessExpressionNode<TValue = unknown>(\n base: ExpressionNode,\n property: string,\n options: Partial<Pick<PropertyAccessExpressionNode, \"armPath\" | \"nullish\">> = {},\n): PropertyAccessExpressionNode<TValue> {\n return {\n kind: \"property-access\",\n base,\n property,\n nullish: options.nullish ?? false,\n ...(options.armPath === undefined ? {} : { armPath: options.armPath }),\n };\n}\n\nexport function arrayAccessExpressionNode<TValue = unknown>(\n base: ExpressionNode,\n index: ArrayAccessIndex,\n options: Partial<Pick<ArrayAccessExpressionNode, \"nullish\" | \"fromEnd\">> = {},\n): ArrayAccessExpressionNode<TValue> {\n return {\n kind: \"array-access\",\n base,\n index,\n nullish: options.nullish ?? false,\n fromEnd: options.fromEnd ?? false,\n };\n}\n\nexport function binaryExpressionNode<TValue = unknown>(\n operator: BinaryOperator,\n left: unknown,\n right: unknown,\n): BinaryExpressionNode<TValue> {\n return { kind: \"binary\", operator, left, right };\n}\n\nexport function unaryExpressionNode<TValue = unknown>(\n operator: UnaryOperator,\n argument: unknown,\n): UnaryExpressionNode<TValue> {\n return { kind: \"unary\", operator, argument };\n}\n\nexport function ternaryExpressionNode<TValue = unknown>(\n condition: unknown,\n trueValue: unknown,\n falseValue: unknown,\n): TernaryExpressionNode<TValue> {\n return {\n kind: \"ternary\",\n condition,\n trueValue,\n falseValue,\n };\n}\n\nexport function instanceFunctionCallExpressionNode<TValue = unknown>(\n base: ExpressionNode,\n name: string,\n args: readonly unknown[],\n): InstanceFunctionCallExpressionNode<TValue> {\n return {\n kind: \"instance-function-call\",\n base,\n name,\n args,\n };\n}\n\nexport function interpolatedStringExpressionNode<TValue = unknown>(\n segments: readonly unknown[],\n): InterpolatedStringExpressionNode<TValue> {\n return { kind: \"interpolated-string\", segments };\n}\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\nfunction isIdentifierSegment(segment: string): boolean {\n return /^[A-Za-z_][A-Za-z0-9_]*$/u.test(segment);\n}\n\nexport function accessExpressionNode(\n base: ExpressionNode,\n member: PropertySegment,\n options: Partial<Pick<PropertyAccessExpressionNode, \"armPath\" | \"nullish\">> = {},\n): PropertyAccessExpressionNode | ArrayAccessExpressionNode {\n return typeof member === \"number\" || !isIdentifierSegment(member)\n ? arrayAccessExpressionNode(base, member, options)\n : propertyAccessExpressionNode(base, member, options);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsIA,MAAM,wBAA8D;AAAA,EAClE,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,YAAY;AAAA,EACZ,mBAAmB;AAAA,EACnB,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,0BAA0B;AAAA,EAC1B,uBAAuB;AACzB;AAGO,SAAS,iBAAiB,OAAyC;AACxE,MACE,OAAO,UAAU,YACjB,UAAU,QACV,CAAC,OAAO,UAAU,eAAe,KAAK,OAAO,MAAM,KACnD,OAAQ,MAA4B,SAAS,UAC7C;AACA,WAAO;AAAA,EACT;AACA,QAAM,OAAO;AACb,MAAI,CAAC,OAAO,UAAU,eAAe,KAAK,uBAAuB,KAAK,IAAc,GAAG;AACrF,WAAO;AAAA,EACT;AACA,UAAQ,KAAK,MAAM;AAAA,IACjB,KAAK;AACH,aAAO,OAAO,KAAK,aAAa,YAAY,MAAM,QAAQ,KAAK,IAAI;AAAA,IACrE,KAAK;AACH,aAAO,OAAO,KAAK,SAAS;AAAA,IAC9B,KAAK;AACH,aAAO,OAAO,KAAK,OAAO,YAAY,OAAO,KAAK,OAAO;AAAA,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AS,qBACd,UACA,MACA,OAC8B;AAC9B,SAAO,EAAE,MAAM,UAAU,UAAU,MAAM,MAAM;AACjD;AAEO,SAAS,oBACd,UACA,UAC6B;AAC7B,SAAO,EAAE,MAAM,SAAS,UAAU,SAAS;AAC7C;AAEO,SAAS,sBACd,WACA,WACA,YAC+B;AAC/B,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,mCACd,MACA,MACA,MAC4C;AAC5C,SAAO;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEO,SAAS,iCACd,UAC0C;AAC1C,SAAO,EAAE,MAAM,uBAAuB,SAAS;AACjD;AAMA,SAAS,oBAAoB,SAA0B;AACrD,SAAO,4BAA4B,KAAK,OAAO;AACjD;AAEO,SAAS,qBACd,MACA,QACA,UAA8E,CAAC,GACrB;AAC1D,SAAO,OAAO,WAAW,YAAY,CAAC,oBAAoB,MAAM,IAC5D,0BAA0B,MAAM,QAAQ,OAAO,IAC/C,6BAA6B,MAAM,QAAQ,OAAO;AACxD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { type NavShape } from "../shape/shape.js";
|
|
2
|
+
import { type BinaryOperator, type ExpressionNode, type UnaryOperator } from "./ast-nodes.js";
|
|
3
|
+
/**
|
|
4
|
+
* Runtime symbol key storing the underlying `ExpressionNode` on proxies.
|
|
5
|
+
* Internal to the package — consumers should use `isExpression()` and
|
|
6
|
+
* `unwrapExpression()` instead of accessing this directly.
|
|
7
|
+
*/
|
|
8
|
+
export declare const EXPRESSION_BRAND: unique symbol;
|
|
9
|
+
/** Declared symbol type used in the `Expression<T>` interface for branding. */
|
|
10
|
+
declare const __expressionBrand: unique symbol;
|
|
11
|
+
export interface ExpressionBrand<out T> {
|
|
12
|
+
readonly [__expressionBrand]: ExpressionNode<T>;
|
|
13
|
+
}
|
|
14
|
+
declare const __expressionTag: unique symbol;
|
|
15
|
+
export interface ExpressionTag {
|
|
16
|
+
readonly [__expressionTag]?: never;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An opaque deploy-time expression wrapping type `T`.
|
|
20
|
+
*
|
|
21
|
+
* For object types, properties of `T` are accessible as
|
|
22
|
+
* `Expression<Exclude<T[K], undefined>>`. Expression proxies always expose a
|
|
23
|
+
* symbolic property path, so TypeScript's `undefined` omission marker does not
|
|
24
|
+
* belong in the projected value type. Explicit `null` remains intact.
|
|
25
|
+
* For array types, numeric indices return `Expression<element>` and
|
|
26
|
+
* `.length` is an `Expression<number>`.
|
|
27
|
+
*
|
|
28
|
+
* Function-typed keys on `T` are intentionally NOT surfaced — an
|
|
29
|
+
* `Expression<(...)=>R>` isn't callable at the type level or meaningful
|
|
30
|
+
* at emit time. When bicep-level array/object methods are needed
|
|
31
|
+
* (concat, union, etc.), they are added explicitly via dedicated helper
|
|
32
|
+
* types (e.g. a future `ArrayExpression<T>`), not reflectively derived.
|
|
33
|
+
*
|
|
34
|
+
* `NonNullable<T>` is applied at the input boundary, so
|
|
35
|
+
* `Expression<R | undefined>` yields the same structural surface as
|
|
36
|
+
* `Expression<R>` — otherwise the `| undefined` union would distribute
|
|
37
|
+
* and collapse the object branch into `mapped | {}`, erasing the
|
|
38
|
+
* index signature / member projection.
|
|
39
|
+
*/
|
|
40
|
+
export type Expression<T = unknown> = ExpressionBrand<T> & ExpressionTag & ExpressionShape<NonNullable<T>>;
|
|
41
|
+
export type ExpressionShape<T> = T extends readonly unknown[] ? number extends T["length"] ? {
|
|
42
|
+
readonly length: Expression<number>;
|
|
43
|
+
readonly [index: number]: Expression<T[number]>;
|
|
44
|
+
} : {
|
|
45
|
+
readonly [K in Exclude<keyof T, keyof any[]>]: Expression<T[K]>;
|
|
46
|
+
} & {
|
|
47
|
+
readonly length: Expression<number>;
|
|
48
|
+
readonly [index: number]: Expression<T[number]>;
|
|
49
|
+
} : T extends object ? {
|
|
50
|
+
readonly [K in keyof T as T[K] extends (...a: any[]) => any ? never : K]-?: Expression<Exclude<T[K], undefined>>;
|
|
51
|
+
} : {};
|
|
52
|
+
/**
|
|
53
|
+
* Carries an *optional* Expression brand on an Input-shaped interface.
|
|
54
|
+
*
|
|
55
|
+
* This is the asymmetric-brand trick that makes the Input type system
|
|
56
|
+
* work without discriminated unions:
|
|
57
|
+
*
|
|
58
|
+
* - Every generated `*Input` interface extends `InputOf<Raw>` and therefore
|
|
59
|
+
* inherits the optional brand. Plain literal values (e.g. `{ foo: 1 }`)
|
|
60
|
+
* trivially satisfy it because the brand property is absent, which is
|
|
61
|
+
* permitted by an optional field.
|
|
62
|
+
* - `Expression<Raw>` carries a *required* brand of the same shape.
|
|
63
|
+
* Required-fields-satisfy-optional is part of TS structural assignability,
|
|
64
|
+
* so any `Expression<Raw>` is assignable where an `InputOf<Raw>`
|
|
65
|
+
* (and thus any `*Input` that extends it) is expected.
|
|
66
|
+
*
|
|
67
|
+
* Net effect: a single `MInput` parameter accepts both literals and
|
|
68
|
+
* whole-subtree `Expression<M>` replacements — no `MInput | Expression<M>`
|
|
69
|
+
* union is needed in the generated signatures. Callers that want to
|
|
70
|
+
* inspect whether a value is a literal or expression use `isExpression()`.
|
|
71
|
+
*/
|
|
72
|
+
export interface InputOf<out Raw> {
|
|
73
|
+
readonly [__expressionBrand]?: ExpressionNode<Raw>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Writable input form for an array container.
|
|
77
|
+
*
|
|
78
|
+
* Accepts literal `T[]`, another `InputArray<T>`, or `Expression<Raw>`.
|
|
79
|
+
* Deliberately NOT a subtype of `T[]` — passing a CDK-backed array to
|
|
80
|
+
* an API that expects a plain `Array<T>` fails at compile time, which
|
|
81
|
+
* is the correct signal (the value may actually be a Proxy wrapping an
|
|
82
|
+
* `ExpressionNode`, not a real JS array).
|
|
83
|
+
*/
|
|
84
|
+
export interface InputArray<T, Raw = readonly T[]> extends InputOf<Raw> {
|
|
85
|
+
length: number | Expression<number>;
|
|
86
|
+
[index: number]: T;
|
|
87
|
+
}
|
|
88
|
+
/** Writable input form for a `Record<string, V>` container. */
|
|
89
|
+
export interface InputRecord<V, Raw = Record<string, V>> extends InputOf<Raw> {
|
|
90
|
+
[key: string]: V;
|
|
91
|
+
}
|
|
92
|
+
/** Writable input form for a fixed-length heterogeneous tuple. */
|
|
93
|
+
export type InputTuple<T extends readonly unknown[], Raw extends readonly unknown[] = T> = InputOf<Raw> & {
|
|
94
|
+
length: T["length"] | Expression<number>;
|
|
95
|
+
[index: number]: T[number] | Expression<Raw[number]>;
|
|
96
|
+
} & {
|
|
97
|
+
[K in Exclude<keyof T, keyof any[]>]: T[K];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Accepts either a plain value `T` or an `Expression<T>` substitution.
|
|
101
|
+
*
|
|
102
|
+
* Use this on scalar/leaf Input sites (primitives, enums, literal-only
|
|
103
|
+
* unions) where a full `InputOf<...>` structural extension doesn't apply.
|
|
104
|
+
* The result is a simple discriminated union; call `isExpression()` to
|
|
105
|
+
* branch on the runtime shape.
|
|
106
|
+
*/
|
|
107
|
+
export type ExpressionOrValue<T> = T | Expression<T>;
|
|
108
|
+
/**
|
|
109
|
+
* Asserts that a deploy-time expression resolves to a specific literal,
|
|
110
|
+
* so it can be used where a discriminator is expected.
|
|
111
|
+
*
|
|
112
|
+
* Discriminator properties on a `@discriminator` model are typed as bare
|
|
113
|
+
* literals (`kind: "cache"`) rather than `ExpressionOrValue<"cache">`.
|
|
114
|
+
* That is deliberate: TypeScript only treats a property as a discriminant
|
|
115
|
+
* when its type is a *unit* type in every constituent of the union, and a
|
|
116
|
+
* single widened arm disables narrowing for the whole union — completions
|
|
117
|
+
* then offer every variant's properties and excess-property checking
|
|
118
|
+
* degrades to "allowed if the property exists in any variant".
|
|
119
|
+
*
|
|
120
|
+
* When the discriminator genuinely isn't known until deployment, wrap the
|
|
121
|
+
* expression with this to state which variant you mean:
|
|
122
|
+
*
|
|
123
|
+
* ```ts snippet:ignore
|
|
124
|
+
* widget.properties.primaryRule = {
|
|
125
|
+
* kind: asDiscriminator(kindParam),
|
|
126
|
+
* cacheKind: "long",
|
|
127
|
+
* days: 7,
|
|
128
|
+
* };
|
|
129
|
+
* ```
|
|
130
|
+
*
|
|
131
|
+
* Every other property is still fully checked — only the discriminator's
|
|
132
|
+
* type safety is waived. Note that the runtime cannot dispatch on a
|
|
133
|
+
* non-literal discriminator, so serialization falls back to structural
|
|
134
|
+
* variant inference; prefer a literal wherever possible.
|
|
135
|
+
*
|
|
136
|
+
* The literal is inferred from the expression's own type argument. If the
|
|
137
|
+
* expression is loosely typed (`Expression<string>`), name the variant
|
|
138
|
+
* explicitly: `asDiscriminator<"cache">(param)`.
|
|
139
|
+
*/
|
|
140
|
+
export declare function asDiscriminator<L extends string>(value: ExpressionOrValue<L>): L;
|
|
141
|
+
/**
|
|
142
|
+
* Extracts the underlying `ExpressionNode` from an `Expression<T>` value.
|
|
143
|
+
*
|
|
144
|
+
* `Expression<T>` is the public, typed handle for a deploy-time expression
|
|
145
|
+
* (backed by a Proxy at runtime); `ExpressionNode` is the raw AST node that
|
|
146
|
+
* the proxy wraps. Use this to walk / inspect / serialize the underlying
|
|
147
|
+
* tree without reaching for the brand symbol directly.
|
|
148
|
+
*/
|
|
149
|
+
export declare function unwrapExpression<T>(expr: Expression<T>): ExpressionNode<T>;
|
|
150
|
+
/**
|
|
151
|
+
* Tests whether a value is an `Expression<T>` — the typed, branded handle
|
|
152
|
+
* for a deploy-time expression (proxy-backed). Returns false for raw
|
|
153
|
+
* `ExpressionNode` data; use {@link isExpressionNode} from `./ast-nodes.js`
|
|
154
|
+
* for that.
|
|
155
|
+
*/
|
|
156
|
+
export declare function isExpression(value: unknown): value is Expression<unknown>;
|
|
157
|
+
export declare function wrapExpression<T = unknown>(expression: ExpressionNode, nav?: NavShape): Expression<T>;
|
|
158
|
+
export declare function wrapExpressionOver<TObject extends object, TValue = unknown>(target: TObject, expression: ExpressionNode): TObject & Expression<TValue>;
|
|
159
|
+
export declare function createBinaryExpression<T>(op: BinaryOperator, left: unknown, right: unknown): Expression<T>;
|
|
160
|
+
export declare function createUnaryExpression<T>(op: UnaryOperator, argument: unknown): Expression<T>;
|
|
161
|
+
export declare function createTernaryExpression<T>(condition: unknown, trueValue: unknown, falseValue: unknown): Expression<T>;
|
|
162
|
+
export declare function createFunctionCallExpression<T>(name: string, args: unknown[]): Expression<T>;
|
|
163
|
+
export {};
|
|
164
|
+
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../../src/expression/expressions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAEnB,MAAM,gBAAgB,CAAC;AAMxB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,OAAO,MAAmC,CAAC;AAE1E,+EAA+E;AAC/E,OAAO,CAAC,MAAM,iBAAiB,EAAE,OAAO,MAAM,CAAC;AAM/C,MAAM,WAAW,eAAe,CAAC,GAAG,CAAC,CAAC;IACpC,QAAQ,CAAC,CAAC,iBAAiB,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;CACjD;AAKD,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,MAAM,CAAC;AAC7C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;CACpC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,GAAG,OAAO,IAAI,eAAe,CAAC,CAAC,CAAC,GACtD,aAAa,GACb,eAAe,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;AAElC,MAAM,MAAM,eAAe,CA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AAC,CAAC,GAAG,OAAO,EACxC,UAAU,EAAE,cAAc,EAC1B,GAAG,CAAC,EAAE,QAAQ,GACb,UAAU,CAAC,CAAC,CAAC,CAkEf;AAED,wBAAgB,kBAAkB,CAAC,OAAO,SAAS,MAAM,EAAE,MAAM,GAAG,OAAO,EACzE,MAAM,EAAE,OAAO,EACf,UAAU,EAAE,cAAc,GACzB,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CA2D9B;AAMD,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GACb,UAAU,CAAC,CAAC,CAAC,CAEf;AAED,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EAAE,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAE5F;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,OAAO,GAClB,UAAU,CAAC,CAAC,CAAC,CAEf;AAED,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAE5F"}
|
|
@@ -0,0 +1,171 @@
|
|
|
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 expressions_exports = {};
|
|
19
|
+
__export(expressions_exports, {
|
|
20
|
+
EXPRESSION_BRAND: () => EXPRESSION_BRAND,
|
|
21
|
+
asDiscriminator: () => asDiscriminator,
|
|
22
|
+
createBinaryExpression: () => createBinaryExpression,
|
|
23
|
+
createFunctionCallExpression: () => createFunctionCallExpression,
|
|
24
|
+
createTernaryExpression: () => createTernaryExpression,
|
|
25
|
+
createUnaryExpression: () => createUnaryExpression,
|
|
26
|
+
isExpression: () => isExpression,
|
|
27
|
+
unwrapExpression: () => unwrapExpression,
|
|
28
|
+
wrapExpression: () => wrapExpression,
|
|
29
|
+
wrapExpressionOver: () => wrapExpressionOver
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(expressions_exports);
|
|
32
|
+
var import_shape = require("../shape/shape.js");
|
|
33
|
+
var import_ast_nodes = require("./ast-nodes.js");
|
|
34
|
+
const EXPRESSION_BRAND = /* @__PURE__ */ Symbol("expression-brand");
|
|
35
|
+
function asDiscriminator(value) {
|
|
36
|
+
return value;
|
|
37
|
+
}
|
|
38
|
+
function unwrapExpression(expr) {
|
|
39
|
+
return expr[EXPRESSION_BRAND];
|
|
40
|
+
}
|
|
41
|
+
function isExpression(value) {
|
|
42
|
+
return typeof value === "object" && value !== null && EXPRESSION_BRAND in value;
|
|
43
|
+
}
|
|
44
|
+
function wrapExpression(expression, nav) {
|
|
45
|
+
return new Proxy(/* @__PURE__ */ Object.create(null), {
|
|
46
|
+
get(_target, prop, _receiver) {
|
|
47
|
+
if (prop === EXPRESSION_BRAND) {
|
|
48
|
+
return expression;
|
|
49
|
+
}
|
|
50
|
+
if (prop === Symbol.toPrimitive || prop === "toString") {
|
|
51
|
+
return () => "[Expression]";
|
|
52
|
+
}
|
|
53
|
+
if (prop === "valueOf") {
|
|
54
|
+
return () => expression;
|
|
55
|
+
}
|
|
56
|
+
if (prop === "then") {
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
59
|
+
if (typeof prop === "symbol") {
|
|
60
|
+
return void 0;
|
|
61
|
+
}
|
|
62
|
+
if (/^\d+$/u.test(prop)) {
|
|
63
|
+
const index = Number(prop);
|
|
64
|
+
const step2 = (0, import_shape.navigateShape)(nav, index);
|
|
65
|
+
return wrapExpression(
|
|
66
|
+
(0, import_ast_nodes.arrayAccessExpressionNode)(expression, index),
|
|
67
|
+
step2.next
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
const step = (0, import_shape.navigateShape)(nav, prop);
|
|
71
|
+
return wrapExpression(
|
|
72
|
+
(0, import_ast_nodes.propertyAccessExpressionNode)(expression, prop, {
|
|
73
|
+
armPath: step.stamp?.armPath
|
|
74
|
+
}),
|
|
75
|
+
step.next
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
has(_target, prop) {
|
|
79
|
+
return prop === EXPRESSION_BRAND;
|
|
80
|
+
},
|
|
81
|
+
ownKeys() {
|
|
82
|
+
return [];
|
|
83
|
+
},
|
|
84
|
+
getOwnPropertyDescriptor(_target, prop) {
|
|
85
|
+
if (prop === EXPRESSION_BRAND) {
|
|
86
|
+
return {
|
|
87
|
+
configurable: true,
|
|
88
|
+
enumerable: false,
|
|
89
|
+
value: expression
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
return void 0;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function wrapExpressionOver(target, expression) {
|
|
97
|
+
return new Proxy(target, {
|
|
98
|
+
get(backing, prop, receiver) {
|
|
99
|
+
if (prop === EXPRESSION_BRAND) {
|
|
100
|
+
return expression;
|
|
101
|
+
}
|
|
102
|
+
if (prop === Symbol.toPrimitive || prop === "toString") {
|
|
103
|
+
return () => "[Expression]";
|
|
104
|
+
}
|
|
105
|
+
if (prop === "valueOf") {
|
|
106
|
+
return () => expression;
|
|
107
|
+
}
|
|
108
|
+
if (prop === "then") {
|
|
109
|
+
return void 0;
|
|
110
|
+
}
|
|
111
|
+
if (Reflect.has(backing, prop)) {
|
|
112
|
+
return Reflect.get(backing, prop, receiver);
|
|
113
|
+
}
|
|
114
|
+
if (typeof prop === "symbol") {
|
|
115
|
+
return void 0;
|
|
116
|
+
}
|
|
117
|
+
if (/^\d+$/u.test(prop)) {
|
|
118
|
+
return wrapExpression(
|
|
119
|
+
(0, import_ast_nodes.arrayAccessExpressionNode)(expression, Number(prop))
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
return wrapExpression((0, import_ast_nodes.propertyAccessExpressionNode)(expression, prop));
|
|
123
|
+
},
|
|
124
|
+
has(backing, prop) {
|
|
125
|
+
return prop === EXPRESSION_BRAND || Reflect.has(backing, prop);
|
|
126
|
+
},
|
|
127
|
+
ownKeys(backing) {
|
|
128
|
+
const keys = Reflect.ownKeys(backing);
|
|
129
|
+
if (!keys.includes(EXPRESSION_BRAND)) {
|
|
130
|
+
keys.push(EXPRESSION_BRAND);
|
|
131
|
+
}
|
|
132
|
+
return keys;
|
|
133
|
+
},
|
|
134
|
+
getOwnPropertyDescriptor(backing, prop) {
|
|
135
|
+
if (prop === EXPRESSION_BRAND) {
|
|
136
|
+
return {
|
|
137
|
+
configurable: true,
|
|
138
|
+
enumerable: false,
|
|
139
|
+
value: expression
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return Reflect.getOwnPropertyDescriptor(backing, prop);
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function createBinaryExpression(op, left, right) {
|
|
147
|
+
return wrapExpression((0, import_ast_nodes.binaryExpressionNode)(op, left, right));
|
|
148
|
+
}
|
|
149
|
+
function createUnaryExpression(op, argument) {
|
|
150
|
+
return wrapExpression((0, import_ast_nodes.unaryExpressionNode)(op, argument));
|
|
151
|
+
}
|
|
152
|
+
function createTernaryExpression(condition, trueValue, falseValue) {
|
|
153
|
+
return wrapExpression((0, import_ast_nodes.ternaryExpressionNode)(condition, trueValue, falseValue));
|
|
154
|
+
}
|
|
155
|
+
function createFunctionCallExpression(name, args) {
|
|
156
|
+
return wrapExpression((0, import_ast_nodes.functionCallExpressionNode)(name, args));
|
|
157
|
+
}
|
|
158
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
159
|
+
0 && (module.exports = {
|
|
160
|
+
EXPRESSION_BRAND,
|
|
161
|
+
asDiscriminator,
|
|
162
|
+
createBinaryExpression,
|
|
163
|
+
createFunctionCallExpression,
|
|
164
|
+
createTernaryExpression,
|
|
165
|
+
createUnaryExpression,
|
|
166
|
+
isExpression,
|
|
167
|
+
unwrapExpression,
|
|
168
|
+
wrapExpression,
|
|
169
|
+
wrapExpressionOver
|
|
170
|
+
});
|
|
171
|
+
//# sourceMappingURL=expressions.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/expression/expressions.ts"],
|
|
4
|
+
"sourcesContent": ["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { navigateShape, type NavShape } from \"../shape/shape.js\";\nimport {\n arrayAccessExpressionNode,\n binaryExpressionNode,\n functionCallExpressionNode,\n propertyAccessExpressionNode,\n ternaryExpressionNode,\n type BinaryOperator,\n type ExpressionNode,\n type UnaryOperator,\n unaryExpressionNode,\n} from \"./ast-nodes.js\";\n\n// ---------------------------------------------------------------------------\n// Brand symbol (runtime + type-only)\n// ---------------------------------------------------------------------------\n\n/**\n * Runtime symbol key storing the underlying `ExpressionNode` on proxies.\n * Internal to the package \u2014 consumers should use `isExpression()` and\n * `unwrapExpression()` instead of accessing this directly.\n */\nexport const EXPRESSION_BRAND: unique symbol = Symbol(\"expression-brand\");\n\n/** Declared symbol type used in the `Expression<T>` interface for branding. */\ndeclare const __expressionBrand: unique symbol;\n\n// ---------------------------------------------------------------------------\n// Public opaque Expression<T> type\n// ---------------------------------------------------------------------------\n\nexport interface ExpressionBrand<out T> {\n readonly [__expressionBrand]: ExpressionNode<T>;\n}\n\n// Prevents TypeScript from simplifying `Expression<primitive>` down to\n// just `ExpressionBrand<primitive>` \u2014 keeps the alias name visible in hovers.\n// Symbol-keyed so it stays hidden from IntelliSense.\ndeclare const __expressionTag: unique symbol;\nexport interface ExpressionTag {\n readonly [__expressionTag]?: never;\n}\n\n/**\n * An opaque deploy-time expression wrapping type `T`.\n *\n * For object types, properties of `T` are accessible as\n * `Expression<Exclude<T[K], undefined>>`. Expression proxies always expose a\n * symbolic property path, so TypeScript's `undefined` omission marker does not\n * belong in the projected value type. Explicit `null` remains intact.\n * For array types, numeric indices return `Expression<element>` and\n * `.length` is an `Expression<number>`.\n *\n * Function-typed keys on `T` are intentionally NOT surfaced \u2014 an\n * `Expression<(...)=>R>` isn't callable at the type level or meaningful\n * at emit time. When bicep-level array/object methods are needed\n * (concat, union, etc.), they are added explicitly via dedicated helper\n * types (e.g. a future `ArrayExpression<T>`), not reflectively derived.\n *\n * `NonNullable<T>` is applied at the input boundary, so\n * `Expression<R | undefined>` yields the same structural surface as\n * `Expression<R>` \u2014 otherwise the `| undefined` union would distribute\n * and collapse the object branch into `mapped | {}`, erasing the\n * index signature / member projection.\n */\nexport type Expression<T = unknown> = ExpressionBrand<T> &\n ExpressionTag &\n ExpressionShape<NonNullable<T>>;\n\nexport type ExpressionShape<T> = T extends readonly unknown[]\n ? number extends T[\"length\"]\n ? {\n readonly length: Expression<number>;\n readonly [index: number]: Expression<T[number]>;\n }\n : {\n readonly [K in Exclude<keyof T, keyof any[]>]: Expression<T[K]>;\n } & {\n readonly length: Expression<number>;\n readonly [index: number]: Expression<T[number]>;\n }\n : T extends object\n ? {\n readonly [K in keyof T as T[K] extends (...a: any[]) => any ? never : K]-?: Expression<\n Exclude<T[K], undefined>\n >;\n }\n : {};\n\n// ---------------------------------------------------------------------------\n// Input-side types \u2014 optional-brand trick\n// ---------------------------------------------------------------------------\n\n/**\n * Carries an *optional* Expression brand on an Input-shaped interface.\n *\n * This is the asymmetric-brand trick that makes the Input type system\n * work without discriminated unions:\n *\n * - Every generated `*Input` interface extends `InputOf<Raw>` and therefore\n * inherits the optional brand. Plain literal values (e.g. `{ foo: 1 }`)\n * trivially satisfy it because the brand property is absent, which is\n * permitted by an optional field.\n * - `Expression<Raw>` carries a *required* brand of the same shape.\n * Required-fields-satisfy-optional is part of TS structural assignability,\n * so any `Expression<Raw>` is assignable where an `InputOf<Raw>`\n * (and thus any `*Input` that extends it) is expected.\n *\n * Net effect: a single `MInput` parameter accepts both literals and\n * whole-subtree `Expression<M>` replacements \u2014 no `MInput | Expression<M>`\n * union is needed in the generated signatures. Callers that want to\n * inspect whether a value is a literal or expression use `isExpression()`.\n */\nexport interface InputOf<out Raw> {\n readonly [__expressionBrand]?: ExpressionNode<Raw>;\n}\n\n/**\n * Writable input form for an array container.\n *\n * Accepts literal `T[]`, another `InputArray<T>`, or `Expression<Raw>`.\n * Deliberately NOT a subtype of `T[]` \u2014 passing a CDK-backed array to\n * an API that expects a plain `Array<T>` fails at compile time, which\n * is the correct signal (the value may actually be a Proxy wrapping an\n * `ExpressionNode`, not a real JS array).\n */\nexport interface InputArray<T, Raw = readonly T[]> extends InputOf<Raw> {\n length: number | Expression<number>;\n [index: number]: T;\n}\n\n/** Writable input form for a `Record<string, V>` container. */\nexport interface InputRecord<V, Raw = Record<string, V>> extends InputOf<Raw> {\n [key: string]: V;\n}\n\n/** Writable input form for a fixed-length heterogeneous tuple. */\nexport type InputTuple<\n T extends readonly unknown[],\n Raw extends readonly unknown[] = T,\n> = InputOf<Raw> & {\n length: T[\"length\"] | Expression<number>;\n [index: number]: T[number] | Expression<Raw[number]>;\n} & {\n [K in Exclude<keyof T, keyof any[]>]: T[K];\n};\n\n// ---------------------------------------------------------------------------\n// ExpressionOrValue\n// ---------------------------------------------------------------------------\n\n/**\n * Accepts either a plain value `T` or an `Expression<T>` substitution.\n *\n * Use this on scalar/leaf Input sites (primitives, enums, literal-only\n * unions) where a full `InputOf<...>` structural extension doesn't apply.\n * The result is a simple discriminated union; call `isExpression()` to\n * branch on the runtime shape.\n */\nexport type ExpressionOrValue<T> = T | Expression<T>;\n\n// ---------------------------------------------------------------------------\n// Discriminator escape hatch\n// ---------------------------------------------------------------------------\n\n/**\n * Asserts that a deploy-time expression resolves to a specific literal,\n * so it can be used where a discriminator is expected.\n *\n * Discriminator properties on a `@discriminator` model are typed as bare\n * literals (`kind: \"cache\"`) rather than `ExpressionOrValue<\"cache\">`.\n * That is deliberate: TypeScript only treats a property as a discriminant\n * when its type is a *unit* type in every constituent of the union, and a\n * single widened arm disables narrowing for the whole union \u2014 completions\n * then offer every variant's properties and excess-property checking\n * degrades to \"allowed if the property exists in any variant\".\n *\n * When the discriminator genuinely isn't known until deployment, wrap the\n * expression with this to state which variant you mean:\n *\n * ```ts snippet:ignore\n * widget.properties.primaryRule = {\n * kind: asDiscriminator(kindParam),\n * cacheKind: \"long\",\n * days: 7,\n * };\n * ```\n *\n * Every other property is still fully checked \u2014 only the discriminator's\n * type safety is waived. Note that the runtime cannot dispatch on a\n * non-literal discriminator, so serialization falls back to structural\n * variant inference; prefer a literal wherever possible.\n *\n * The literal is inferred from the expression's own type argument. If the\n * expression is loosely typed (`Expression<string>`), name the variant\n * explicitly: `asDiscriminator<\"cache\">(param)`.\n */\nexport function asDiscriminator<L extends string>(value: ExpressionOrValue<L>): L {\n return value as L;\n}\n\n// ---------------------------------------------------------------------------\n// Unwrap + type guards\n// ---------------------------------------------------------------------------\n\n// Two distinct concepts, two distinct guards:\n//\n// - `isExpression(x)` \u2014 \"is `x` a typed `Expression<T>` handle\n// (the value-level, proxy-backed form)?\"\n// - `isExpressionNode(x)` \u2014 \"is `x` a raw `ExpressionNode` data object\n// (one of the AST kinds)?\"\n//\n// These are *disjoint* \u2014 a value is either a wrapped Expression handle or a\n// raw AST node, never both. To check the AST kind of either form, narrow\n// via the discriminated `kind` field:\n//\n// if (isExpression(value)) {\n// const node = unwrapExpression(value);\n// if (node.kind === \"fn-call\") { /* node: FunctionCallExpressionNode */ }\n// }\n// if (isExpressionNode(value)) {\n// if (value.kind === \"binary\") { /* value: BinaryExpressionNode */ }\n// }\n\n/**\n * Extracts the underlying `ExpressionNode` from an `Expression<T>` value.\n *\n * `Expression<T>` is the public, typed handle for a deploy-time expression\n * (backed by a Proxy at runtime); `ExpressionNode` is the raw AST node that\n * the proxy wraps. Use this to walk / inspect / serialize the underlying\n * tree without reaching for the brand symbol directly.\n */\nexport function unwrapExpression<T>(expr: Expression<T>): ExpressionNode<T> {\n return (expr as unknown as { [EXPRESSION_BRAND]: ExpressionNode<T> })[EXPRESSION_BRAND];\n}\n\n/**\n * Tests whether a value is an `Expression<T>` \u2014 the typed, branded handle\n * for a deploy-time expression (proxy-backed). Returns false for raw\n * `ExpressionNode` data; use {@link isExpressionNode} from `./ast-nodes.js`\n * for that.\n */\nexport function isExpression(value: unknown): value is Expression<unknown> {\n return typeof value === \"object\" && value !== null && EXPRESSION_BRAND in value;\n}\n\n// ---------------------------------------------------------------------------\n// Expression proxy factory\n// ---------------------------------------------------------------------------\n\nexport function wrapExpression<T = unknown>(\n expression: ExpressionNode,\n nav?: NavShape,\n): Expression<T> {\n return new Proxy(Object.create(null) as Expression<T>, {\n get(_target, prop, _receiver) {\n if (prop === EXPRESSION_BRAND) {\n return expression;\n }\n\n if (prop === Symbol.toPrimitive || prop === \"toString\") {\n return () => \"[Expression]\";\n }\n\n if (prop === \"valueOf\") {\n return () => expression;\n }\n\n // Avoid being treated as a thenable / Promise\n if (prop === \"then\") {\n return undefined;\n }\n\n if (typeof prop === \"symbol\") {\n return undefined;\n }\n\n // Numeric string \u2192 array access.\n if (/^\\d+$/u.test(prop)) {\n const index = Number(prop);\n const step = navigateShape(nav, index);\n return wrapExpression(\n arrayAccessExpressionNode(expression as ExpressionNode, index),\n step.next,\n );\n }\n\n // String property \u2192 property access. Consult the current nav\n // shape; stamp the access with the wire armPath if an entry\n // exists, otherwise pass through unchanged. Container navs\n // (record/array) yield no stamp but still peel a layer.\n const step = navigateShape(nav, prop);\n return wrapExpression(\n propertyAccessExpressionNode(expression as ExpressionNode, prop, {\n armPath: step.stamp?.armPath,\n }),\n step.next,\n );\n },\n\n has(_target, prop) {\n return prop === EXPRESSION_BRAND;\n },\n\n ownKeys() {\n return [];\n },\n\n getOwnPropertyDescriptor(_target, prop) {\n if (prop === EXPRESSION_BRAND) {\n return {\n configurable: true,\n enumerable: false,\n value: expression,\n };\n }\n return undefined;\n },\n });\n}\n\nexport function wrapExpressionOver<TObject extends object, TValue = unknown>(\n target: TObject,\n expression: ExpressionNode,\n): TObject & Expression<TValue> {\n return new Proxy(target as TObject & Expression<TValue>, {\n get(backing, prop, receiver) {\n if (prop === EXPRESSION_BRAND) {\n return expression;\n }\n\n if (prop === Symbol.toPrimitive || prop === \"toString\") {\n return () => \"[Expression]\";\n }\n\n if (prop === \"valueOf\") {\n return () => expression;\n }\n\n if (prop === \"then\") {\n return undefined;\n }\n\n if (Reflect.has(backing, prop)) {\n return Reflect.get(backing, prop, receiver);\n }\n\n if (typeof prop === \"symbol\") {\n return undefined;\n }\n\n if (/^\\d+$/u.test(prop)) {\n return wrapExpression(\n arrayAccessExpressionNode(expression as ExpressionNode, Number(prop)),\n );\n }\n\n return wrapExpression(propertyAccessExpressionNode(expression as ExpressionNode, prop));\n },\n\n has(backing, prop) {\n return prop === EXPRESSION_BRAND || Reflect.has(backing, prop);\n },\n\n ownKeys(backing) {\n const keys = Reflect.ownKeys(backing);\n if (!keys.includes(EXPRESSION_BRAND)) {\n keys.push(EXPRESSION_BRAND);\n }\n return keys;\n },\n\n getOwnPropertyDescriptor(backing, prop) {\n if (prop === EXPRESSION_BRAND) {\n return {\n configurable: true,\n enumerable: false,\n value: expression,\n };\n }\n return Reflect.getOwnPropertyDescriptor(backing, prop);\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Proxied-expression factories (return Expression<T>)\n// ---------------------------------------------------------------------------\n\nexport function createBinaryExpression<T>(\n op: BinaryOperator,\n left: unknown,\n right: unknown,\n): Expression<T> {\n return wrapExpression(binaryExpressionNode(op, left, right));\n}\n\nexport function createUnaryExpression<T>(op: UnaryOperator, argument: unknown): Expression<T> {\n return wrapExpression(unaryExpressionNode(op, argument));\n}\n\nexport function createTernaryExpression<T>(\n condition: unknown,\n trueValue: unknown,\n falseValue: unknown,\n): Expression<T> {\n return wrapExpression(ternaryExpressionNode(condition, trueValue, falseValue));\n}\n\nexport function createFunctionCallExpression<T>(name: string, args: unknown[]): Expression<T> {\n return wrapExpression(functionCallExpressionNode(name, args));\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mBAA6C;AAC7C,uBAUO;AAWA,MAAM,mBAAkC,uBAAO,kBAAkB;AA+KjE,SAAS,gBAAkC,OAAgC;AAChF,SAAO;AACT;AAiCO,SAAS,iBAAoB,MAAwC;AAC1E,SAAQ,KAA8D,gBAAgB;AACxF;AAQO,SAAS,aAAa,OAA8C;AACzE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,oBAAoB;AAC5E;AAMO,SAAS,eACd,YACA,KACe;AACf,SAAO,IAAI,MAAM,uBAAO,OAAO,IAAI,GAAoB;AAAA,IACrD,IAAI,SAAS,MAAM,WAAW;AAC5B,UAAI,SAAS,kBAAkB;AAC7B,eAAO;AAAA,MACT;AAEA,UAAI,SAAS,OAAO,eAAe,SAAS,YAAY;AACtD,eAAO,MAAM;AAAA,MACf;AAEA,UAAI,SAAS,WAAW;AACtB,eAAO,MAAM;AAAA,MACf;AAGA,UAAI,SAAS,QAAQ;AACnB,eAAO;AAAA,MACT;AAEA,UAAI,OAAO,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