@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.
Files changed (440) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +40 -0
  4. package/dist/browser/constructs/built-in-resources/resource-group.d.ts +50 -0
  5. package/dist/browser/constructs/built-in-resources/resource-group.d.ts.map +1 -0
  6. package/dist/browser/constructs/built-in-resources/resource-group.js +100 -0
  7. package/dist/browser/constructs/built-in-resources/resource-group.js.map +1 -0
  8. package/dist/browser/constructs/output.d.ts +80 -0
  9. package/dist/browser/constructs/output.d.ts.map +1 -0
  10. package/dist/browser/constructs/output.js +75 -0
  11. package/dist/browser/constructs/output.js.map +1 -0
  12. package/dist/browser/constructs/parameter.d.ts +77 -0
  13. package/dist/browser/constructs/parameter.d.ts.map +1 -0
  14. package/dist/browser/constructs/parameter.js +93 -0
  15. package/dist/browser/constructs/parameter.js.map +1 -0
  16. package/dist/browser/constructs/provisioning-component.d.ts +91 -0
  17. package/dist/browser/constructs/provisioning-component.d.ts.map +1 -0
  18. package/dist/browser/constructs/provisioning-component.js +150 -0
  19. package/dist/browser/constructs/provisioning-component.js.map +1 -0
  20. package/dist/browser/constructs/resource/resource-proxy.d.ts +134 -0
  21. package/dist/browser/constructs/resource/resource-proxy.d.ts.map +1 -0
  22. package/dist/browser/constructs/resource/resource-proxy.js +517 -0
  23. package/dist/browser/constructs/resource/resource-proxy.js.map +1 -0
  24. package/dist/browser/constructs/resource/resource-query.d.ts +23 -0
  25. package/dist/browser/constructs/resource/resource-query.d.ts.map +1 -0
  26. package/dist/browser/constructs/resource/resource-query.js +69 -0
  27. package/dist/browser/constructs/resource/resource-query.js.map +1 -0
  28. package/dist/browser/constructs/resource/resource-registry.d.ts +99 -0
  29. package/dist/browser/constructs/resource/resource-registry.d.ts.map +1 -0
  30. package/dist/browser/constructs/resource/resource-registry.js +51 -0
  31. package/dist/browser/constructs/resource/resource-registry.js.map +1 -0
  32. package/dist/browser/constructs/resource/resource-type-registry.d.ts +46 -0
  33. package/dist/browser/constructs/resource/resource-type-registry.d.ts.map +1 -0
  34. package/dist/browser/constructs/resource/resource-type-registry.js +156 -0
  35. package/dist/browser/constructs/resource/resource-type-registry.js.map +1 -0
  36. package/dist/browser/constructs/resource/resource-utils.d.ts +60 -0
  37. package/dist/browser/constructs/resource/resource-utils.d.ts.map +1 -0
  38. package/dist/browser/constructs/resource/resource-utils.js +75 -0
  39. package/dist/browser/constructs/resource/resource-utils.js.map +1 -0
  40. package/dist/browser/constructs/resource/resource.d.ts +460 -0
  41. package/dist/browser/constructs/resource/resource.d.ts.map +1 -0
  42. package/dist/browser/constructs/resource/resource.js +582 -0
  43. package/dist/browser/constructs/resource/resource.js.map +1 -0
  44. package/dist/browser/constructs/stack.d.ts +110 -0
  45. package/dist/browser/constructs/stack.d.ts.map +1 -0
  46. package/dist/browser/constructs/stack.js +110 -0
  47. package/dist/browser/constructs/stack.js.map +1 -0
  48. package/dist/browser/constructs/variable.d.ts +63 -0
  49. package/dist/browser/constructs/variable.d.ts.map +1 -0
  50. package/dist/browser/constructs/variable.js +74 -0
  51. package/dist/browser/constructs/variable.js.map +1 -0
  52. package/dist/browser/deployment-context/deployment-context.d.ts +27 -0
  53. package/dist/browser/deployment-context/deployment-context.d.ts.map +1 -0
  54. package/dist/browser/deployment-context/deployment-context.js +4 -0
  55. package/dist/browser/deployment-context/deployment-context.js.map +1 -0
  56. package/dist/browser/expression/ast-nodes.d.ts +100 -0
  57. package/dist/browser/expression/ast-nodes.d.ts.map +1 -0
  58. package/dist/browser/expression/ast-nodes.js +125 -0
  59. package/dist/browser/expression/ast-nodes.js.map +1 -0
  60. package/dist/browser/expression/expressions.d.ts +164 -0
  61. package/dist/browser/expression/expressions.d.ts.map +1 -0
  62. package/dist/browser/expression/expressions.js +211 -0
  63. package/dist/browser/expression/expressions.js.map +1 -0
  64. package/dist/browser/fn.d.ts +194 -0
  65. package/dist/browser/fn.d.ts.map +1 -0
  66. package/dist/browser/fn.js +334 -0
  67. package/dist/browser/fn.js.map +1 -0
  68. package/dist/browser/index.d.ts +25 -0
  69. package/dist/browser/index.d.ts.map +1 -0
  70. package/dist/browser/index.js +17 -0
  71. package/dist/browser/index.js.map +1 -0
  72. package/dist/browser/internal.d.ts +13 -0
  73. package/dist/browser/internal.d.ts.map +1 -0
  74. package/dist/browser/internal.js +10 -0
  75. package/dist/browser/internal.js.map +1 -0
  76. package/dist/browser/naming/naming-policy.d.ts +56 -0
  77. package/dist/browser/naming/naming-policy.d.ts.map +1 -0
  78. package/dist/browser/naming/naming-policy.js +97 -0
  79. package/dist/browser/naming/naming-policy.js.map +1 -0
  80. package/dist/browser/naming/naming-rules.d.ts +15 -0
  81. package/dist/browser/naming/naming-rules.d.ts.map +1 -0
  82. package/dist/browser/naming/naming-rules.js +15 -0
  83. package/dist/browser/naming/naming-rules.js.map +1 -0
  84. package/dist/browser/package.json +8 -0
  85. package/dist/browser/serialization/contract/generated/ast.d.ts +508 -0
  86. package/dist/browser/serialization/contract/generated/ast.d.ts.map +1 -0
  87. package/dist/browser/serialization/contract/generated/ast.js +23 -0
  88. package/dist/browser/serialization/contract/generated/ast.js.map +1 -0
  89. package/dist/browser/serialization/contract/index.d.ts +2 -0
  90. package/dist/browser/serialization/contract/index.d.ts.map +1 -0
  91. package/dist/browser/serialization/contract/index.js +4 -0
  92. package/dist/browser/serialization/contract/index.js.map +1 -0
  93. package/dist/browser/serialization/index.d.ts +4 -0
  94. package/dist/browser/serialization/index.d.ts.map +1 -0
  95. package/dist/browser/serialization/index.js +5 -0
  96. package/dist/browser/serialization/index.js.map +1 -0
  97. package/dist/browser/serialization/json/deserialize.d.ts +24 -0
  98. package/dist/browser/serialization/json/deserialize.d.ts.map +1 -0
  99. package/dist/browser/serialization/json/deserialize.js +437 -0
  100. package/dist/browser/serialization/json/deserialize.js.map +1 -0
  101. package/dist/browser/serialization/json/encoding.d.ts +4 -0
  102. package/dist/browser/serialization/json/encoding.d.ts.map +1 -0
  103. package/dist/browser/serialization/json/encoding.js +319 -0
  104. package/dist/browser/serialization/json/encoding.js.map +1 -0
  105. package/dist/browser/serialization/json/expression.d.ts +32 -0
  106. package/dist/browser/serialization/json/expression.d.ts.map +1 -0
  107. package/dist/browser/serialization/json/expression.js +494 -0
  108. package/dist/browser/serialization/json/expression.js.map +1 -0
  109. package/dist/browser/serialization/json/lower.d.ts +41 -0
  110. package/dist/browser/serialization/json/lower.d.ts.map +1 -0
  111. package/dist/browser/serialization/json/lower.js +334 -0
  112. package/dist/browser/serialization/json/lower.js.map +1 -0
  113. package/dist/browser/serialization/json/pluralize-config.d.ts +3 -0
  114. package/dist/browser/serialization/json/pluralize-config.d.ts.map +1 -0
  115. package/dist/browser/serialization/json/pluralize-config.js +7 -0
  116. package/dist/browser/serialization/json/pluralize-config.js.map +1 -0
  117. package/dist/browser/serialization/json/serialize.d.ts +12 -0
  118. package/dist/browser/serialization/json/serialize.d.ts.map +1 -0
  119. package/dist/browser/serialization/json/serialize.js +389 -0
  120. package/dist/browser/serialization/json/serialize.js.map +1 -0
  121. package/dist/browser/serialization/json/util.d.ts +2 -0
  122. package/dist/browser/serialization/json/util.d.ts.map +1 -0
  123. package/dist/browser/serialization/json/util.js +19 -0
  124. package/dist/browser/serialization/json/util.js.map +1 -0
  125. package/dist/browser/serialization/utils.d.ts +3 -0
  126. package/dist/browser/serialization/utils.d.ts.map +1 -0
  127. package/dist/browser/serialization/utils.js +146 -0
  128. package/dist/browser/serialization/utils.js.map +1 -0
  129. package/dist/browser/shape/shape-registry.d.ts +51 -0
  130. package/dist/browser/shape/shape-registry.d.ts.map +1 -0
  131. package/dist/browser/shape/shape-registry.js +41 -0
  132. package/dist/browser/shape/shape-registry.js.map +1 -0
  133. package/dist/browser/shape/shape.d.ts +407 -0
  134. package/dist/browser/shape/shape.d.ts.map +1 -0
  135. package/dist/browser/shape/shape.js +424 -0
  136. package/dist/browser/shape/shape.js.map +1 -0
  137. package/dist/browser/shape/value-encoding.d.ts +121 -0
  138. package/dist/browser/shape/value-encoding.d.ts.map +1 -0
  139. package/dist/browser/shape/value-encoding.js +32 -0
  140. package/dist/browser/shape/value-encoding.js.map +1 -0
  141. package/dist/browser/types.d.ts +9 -0
  142. package/dist/browser/types.d.ts.map +1 -0
  143. package/dist/browser/types.js +4 -0
  144. package/dist/browser/types.js.map +1 -0
  145. package/dist/browser/util.d.ts +33 -0
  146. package/dist/browser/util.d.ts.map +1 -0
  147. package/dist/browser/util.js +74 -0
  148. package/dist/browser/util.js.map +1 -0
  149. package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts +50 -0
  150. package/dist/commonjs/constructs/built-in-resources/resource-group.d.ts.map +1 -0
  151. package/dist/commonjs/constructs/built-in-resources/resource-group.js +114 -0
  152. package/dist/commonjs/constructs/built-in-resources/resource-group.js.map +7 -0
  153. package/dist/commonjs/constructs/output.d.ts +80 -0
  154. package/dist/commonjs/constructs/output.d.ts.map +1 -0
  155. package/dist/commonjs/constructs/output.js +75 -0
  156. package/dist/commonjs/constructs/output.js.map +7 -0
  157. package/dist/commonjs/constructs/parameter.d.ts +77 -0
  158. package/dist/commonjs/constructs/parameter.d.ts.map +1 -0
  159. package/dist/commonjs/constructs/parameter.js +95 -0
  160. package/dist/commonjs/constructs/parameter.js.map +7 -0
  161. package/dist/commonjs/constructs/provisioning-component.d.ts +91 -0
  162. package/dist/commonjs/constructs/provisioning-component.d.ts.map +1 -0
  163. package/dist/commonjs/constructs/provisioning-component.js +130 -0
  164. package/dist/commonjs/constructs/provisioning-component.js.map +7 -0
  165. package/dist/commonjs/constructs/resource/resource-proxy.d.ts +134 -0
  166. package/dist/commonjs/constructs/resource/resource-proxy.d.ts.map +1 -0
  167. package/dist/commonjs/constructs/resource/resource-proxy.js +456 -0
  168. package/dist/commonjs/constructs/resource/resource-proxy.js.map +7 -0
  169. package/dist/commonjs/constructs/resource/resource-query.d.ts +23 -0
  170. package/dist/commonjs/constructs/resource/resource-query.d.ts.map +1 -0
  171. package/dist/commonjs/constructs/resource/resource-query.js +68 -0
  172. package/dist/commonjs/constructs/resource/resource-query.js.map +7 -0
  173. package/dist/commonjs/constructs/resource/resource-registry.d.ts +99 -0
  174. package/dist/commonjs/constructs/resource/resource-registry.d.ts.map +1 -0
  175. package/dist/commonjs/constructs/resource/resource-registry.js +49 -0
  176. package/dist/commonjs/constructs/resource/resource-registry.js.map +7 -0
  177. package/dist/commonjs/constructs/resource/resource-type-registry.d.ts +46 -0
  178. package/dist/commonjs/constructs/resource/resource-type-registry.d.ts.map +1 -0
  179. package/dist/commonjs/constructs/resource/resource-type-registry.js +178 -0
  180. package/dist/commonjs/constructs/resource/resource-type-registry.js.map +7 -0
  181. package/dist/commonjs/constructs/resource/resource-utils.d.ts +60 -0
  182. package/dist/commonjs/constructs/resource/resource-utils.d.ts.map +1 -0
  183. package/dist/commonjs/constructs/resource/resource-utils.js +51 -0
  184. package/dist/commonjs/constructs/resource/resource-utils.js.map +7 -0
  185. package/dist/commonjs/constructs/resource/resource.d.ts +460 -0
  186. package/dist/commonjs/constructs/resource/resource.d.ts.map +1 -0
  187. package/dist/commonjs/constructs/resource/resource.js +455 -0
  188. package/dist/commonjs/constructs/resource/resource.js.map +7 -0
  189. package/dist/commonjs/constructs/stack.d.ts +110 -0
  190. package/dist/commonjs/constructs/stack.d.ts.map +1 -0
  191. package/dist/commonjs/constructs/stack.js +101 -0
  192. package/dist/commonjs/constructs/stack.js.map +7 -0
  193. package/dist/commonjs/constructs/variable.d.ts +63 -0
  194. package/dist/commonjs/constructs/variable.d.ts.map +1 -0
  195. package/dist/commonjs/constructs/variable.js +85 -0
  196. package/dist/commonjs/constructs/variable.js.map +7 -0
  197. package/dist/commonjs/deployment-context/deployment-context.d.ts +27 -0
  198. package/dist/commonjs/deployment-context/deployment-context.d.ts.map +1 -0
  199. package/dist/commonjs/deployment-context/deployment-context.js +16 -0
  200. package/dist/commonjs/deployment-context/deployment-context.js.map +7 -0
  201. package/dist/commonjs/expression/ast-nodes.d.ts +100 -0
  202. package/dist/commonjs/expression/ast-nodes.d.ts.map +1 -0
  203. package/dist/commonjs/expression/ast-nodes.js +152 -0
  204. package/dist/commonjs/expression/ast-nodes.js.map +7 -0
  205. package/dist/commonjs/expression/expressions.d.ts +164 -0
  206. package/dist/commonjs/expression/expressions.d.ts.map +1 -0
  207. package/dist/commonjs/expression/expressions.js +171 -0
  208. package/dist/commonjs/expression/expressions.js.map +7 -0
  209. package/dist/commonjs/fn.d.ts +194 -0
  210. package/dist/commonjs/fn.d.ts.map +1 -0
  211. package/dist/commonjs/fn.js +382 -0
  212. package/dist/commonjs/fn.js.map +7 -0
  213. package/dist/commonjs/index.d.ts +25 -0
  214. package/dist/commonjs/index.d.ts.map +1 -0
  215. package/dist/commonjs/index.js +93 -0
  216. package/dist/commonjs/index.js.map +7 -0
  217. package/dist/commonjs/internal.d.ts +13 -0
  218. package/dist/commonjs/internal.d.ts.map +1 -0
  219. package/dist/commonjs/internal.js +88 -0
  220. package/dist/commonjs/internal.js.map +7 -0
  221. package/dist/commonjs/naming/naming-policy.d.ts +56 -0
  222. package/dist/commonjs/naming/naming-policy.d.ts.map +1 -0
  223. package/dist/commonjs/naming/naming-policy.js +99 -0
  224. package/dist/commonjs/naming/naming-policy.js.map +7 -0
  225. package/dist/commonjs/naming/naming-rules.d.ts +15 -0
  226. package/dist/commonjs/naming/naming-rules.d.ts.map +1 -0
  227. package/dist/commonjs/naming/naming-rules.js +39 -0
  228. package/dist/commonjs/naming/naming-rules.js.map +7 -0
  229. package/dist/commonjs/package.json +8 -0
  230. package/dist/commonjs/serialization/contract/generated/ast.d.ts +508 -0
  231. package/dist/commonjs/serialization/contract/generated/ast.d.ts.map +1 -0
  232. package/dist/commonjs/serialization/contract/generated/ast.js +40 -0
  233. package/dist/commonjs/serialization/contract/generated/ast.js.map +7 -0
  234. package/dist/commonjs/serialization/contract/index.d.ts +2 -0
  235. package/dist/commonjs/serialization/contract/index.d.ts.map +1 -0
  236. package/dist/commonjs/serialization/contract/index.js +22 -0
  237. package/dist/commonjs/serialization/contract/index.js.map +7 -0
  238. package/dist/commonjs/serialization/index.d.ts +4 -0
  239. package/dist/commonjs/serialization/index.d.ts.map +1 -0
  240. package/dist/commonjs/serialization/index.js +31 -0
  241. package/dist/commonjs/serialization/index.js.map +7 -0
  242. package/dist/commonjs/serialization/json/deserialize.d.ts +24 -0
  243. package/dist/commonjs/serialization/json/deserialize.d.ts.map +1 -0
  244. package/dist/commonjs/serialization/json/deserialize.js +385 -0
  245. package/dist/commonjs/serialization/json/deserialize.js.map +7 -0
  246. package/dist/commonjs/serialization/json/encoding.d.ts +4 -0
  247. package/dist/commonjs/serialization/json/encoding.d.ts.map +1 -0
  248. package/dist/commonjs/serialization/json/encoding.js +306 -0
  249. package/dist/commonjs/serialization/json/encoding.js.map +7 -0
  250. package/dist/commonjs/serialization/json/expression.d.ts +32 -0
  251. package/dist/commonjs/serialization/json/expression.d.ts.map +1 -0
  252. package/dist/commonjs/serialization/json/expression.js +509 -0
  253. package/dist/commonjs/serialization/json/expression.js.map +7 -0
  254. package/dist/commonjs/serialization/json/lower.d.ts +41 -0
  255. package/dist/commonjs/serialization/json/lower.d.ts.map +1 -0
  256. package/dist/commonjs/serialization/json/lower.js +272 -0
  257. package/dist/commonjs/serialization/json/lower.js.map +7 -0
  258. package/dist/commonjs/serialization/json/pluralize-config.d.ts +3 -0
  259. package/dist/commonjs/serialization/json/pluralize-config.d.ts.map +1 -0
  260. package/dist/commonjs/serialization/json/pluralize-config.js +37 -0
  261. package/dist/commonjs/serialization/json/pluralize-config.js.map +7 -0
  262. package/dist/commonjs/serialization/json/serialize.d.ts +12 -0
  263. package/dist/commonjs/serialization/json/serialize.d.ts.map +1 -0
  264. package/dist/commonjs/serialization/json/serialize.js +352 -0
  265. package/dist/commonjs/serialization/json/serialize.js.map +7 -0
  266. package/dist/commonjs/serialization/json/util.d.ts +2 -0
  267. package/dist/commonjs/serialization/json/util.d.ts.map +1 -0
  268. package/dist/commonjs/serialization/json/util.js +37 -0
  269. package/dist/commonjs/serialization/json/util.js.map +7 -0
  270. package/dist/commonjs/serialization/utils.d.ts +3 -0
  271. package/dist/commonjs/serialization/utils.d.ts.map +1 -0
  272. package/dist/commonjs/serialization/utils.js +169 -0
  273. package/dist/commonjs/serialization/utils.js.map +7 -0
  274. package/dist/commonjs/shape/shape-registry.d.ts +51 -0
  275. package/dist/commonjs/shape/shape-registry.d.ts.map +1 -0
  276. package/dist/commonjs/shape/shape-registry.js +40 -0
  277. package/dist/commonjs/shape/shape-registry.js.map +7 -0
  278. package/dist/commonjs/shape/shape.d.ts +407 -0
  279. package/dist/commonjs/shape/shape.d.ts.map +1 -0
  280. package/dist/commonjs/shape/shape.js +290 -0
  281. package/dist/commonjs/shape/shape.js.map +7 -0
  282. package/dist/commonjs/shape/value-encoding.d.ts +121 -0
  283. package/dist/commonjs/shape/value-encoding.d.ts.map +1 -0
  284. package/dist/commonjs/shape/value-encoding.js +62 -0
  285. package/dist/commonjs/shape/value-encoding.js.map +7 -0
  286. package/dist/commonjs/tsdoc-metadata.json +11 -0
  287. package/dist/commonjs/types.d.ts +9 -0
  288. package/dist/commonjs/types.d.ts.map +1 -0
  289. package/dist/commonjs/types.js +16 -0
  290. package/dist/commonjs/types.js.map +7 -0
  291. package/dist/commonjs/util.d.ts +33 -0
  292. package/dist/commonjs/util.d.ts.map +1 -0
  293. package/dist/commonjs/util.js +73 -0
  294. package/dist/commonjs/util.js.map +7 -0
  295. package/dist/esm/constructs/built-in-resources/resource-group.d.ts +50 -0
  296. package/dist/esm/constructs/built-in-resources/resource-group.d.ts.map +1 -0
  297. package/dist/esm/constructs/built-in-resources/resource-group.js +100 -0
  298. package/dist/esm/constructs/built-in-resources/resource-group.js.map +1 -0
  299. package/dist/esm/constructs/output.d.ts +80 -0
  300. package/dist/esm/constructs/output.d.ts.map +1 -0
  301. package/dist/esm/constructs/output.js +75 -0
  302. package/dist/esm/constructs/output.js.map +1 -0
  303. package/dist/esm/constructs/parameter.d.ts +77 -0
  304. package/dist/esm/constructs/parameter.d.ts.map +1 -0
  305. package/dist/esm/constructs/parameter.js +93 -0
  306. package/dist/esm/constructs/parameter.js.map +1 -0
  307. package/dist/esm/constructs/provisioning-component.d.ts +91 -0
  308. package/dist/esm/constructs/provisioning-component.d.ts.map +1 -0
  309. package/dist/esm/constructs/provisioning-component.js +150 -0
  310. package/dist/esm/constructs/provisioning-component.js.map +1 -0
  311. package/dist/esm/constructs/resource/resource-proxy.d.ts +134 -0
  312. package/dist/esm/constructs/resource/resource-proxy.d.ts.map +1 -0
  313. package/dist/esm/constructs/resource/resource-proxy.js +517 -0
  314. package/dist/esm/constructs/resource/resource-proxy.js.map +1 -0
  315. package/dist/esm/constructs/resource/resource-query.d.ts +23 -0
  316. package/dist/esm/constructs/resource/resource-query.d.ts.map +1 -0
  317. package/dist/esm/constructs/resource/resource-query.js +69 -0
  318. package/dist/esm/constructs/resource/resource-query.js.map +1 -0
  319. package/dist/esm/constructs/resource/resource-registry.d.ts +99 -0
  320. package/dist/esm/constructs/resource/resource-registry.d.ts.map +1 -0
  321. package/dist/esm/constructs/resource/resource-registry.js +51 -0
  322. package/dist/esm/constructs/resource/resource-registry.js.map +1 -0
  323. package/dist/esm/constructs/resource/resource-type-registry.d.ts +46 -0
  324. package/dist/esm/constructs/resource/resource-type-registry.d.ts.map +1 -0
  325. package/dist/esm/constructs/resource/resource-type-registry.js +156 -0
  326. package/dist/esm/constructs/resource/resource-type-registry.js.map +1 -0
  327. package/dist/esm/constructs/resource/resource-utils.d.ts +60 -0
  328. package/dist/esm/constructs/resource/resource-utils.d.ts.map +1 -0
  329. package/dist/esm/constructs/resource/resource-utils.js +75 -0
  330. package/dist/esm/constructs/resource/resource-utils.js.map +1 -0
  331. package/dist/esm/constructs/resource/resource.d.ts +460 -0
  332. package/dist/esm/constructs/resource/resource.d.ts.map +1 -0
  333. package/dist/esm/constructs/resource/resource.js +582 -0
  334. package/dist/esm/constructs/resource/resource.js.map +1 -0
  335. package/dist/esm/constructs/stack.d.ts +110 -0
  336. package/dist/esm/constructs/stack.d.ts.map +1 -0
  337. package/dist/esm/constructs/stack.js +110 -0
  338. package/dist/esm/constructs/stack.js.map +1 -0
  339. package/dist/esm/constructs/variable.d.ts +63 -0
  340. package/dist/esm/constructs/variable.d.ts.map +1 -0
  341. package/dist/esm/constructs/variable.js +74 -0
  342. package/dist/esm/constructs/variable.js.map +1 -0
  343. package/dist/esm/deployment-context/deployment-context.d.ts +27 -0
  344. package/dist/esm/deployment-context/deployment-context.d.ts.map +1 -0
  345. package/dist/esm/deployment-context/deployment-context.js +4 -0
  346. package/dist/esm/deployment-context/deployment-context.js.map +1 -0
  347. package/dist/esm/expression/ast-nodes.d.ts +100 -0
  348. package/dist/esm/expression/ast-nodes.d.ts.map +1 -0
  349. package/dist/esm/expression/ast-nodes.js +125 -0
  350. package/dist/esm/expression/ast-nodes.js.map +1 -0
  351. package/dist/esm/expression/expressions.d.ts +164 -0
  352. package/dist/esm/expression/expressions.d.ts.map +1 -0
  353. package/dist/esm/expression/expressions.js +211 -0
  354. package/dist/esm/expression/expressions.js.map +1 -0
  355. package/dist/esm/fn.d.ts +194 -0
  356. package/dist/esm/fn.d.ts.map +1 -0
  357. package/dist/esm/fn.js +334 -0
  358. package/dist/esm/fn.js.map +1 -0
  359. package/dist/esm/index.d.ts +25 -0
  360. package/dist/esm/index.d.ts.map +1 -0
  361. package/dist/esm/index.js +17 -0
  362. package/dist/esm/index.js.map +1 -0
  363. package/dist/esm/internal.d.ts +13 -0
  364. package/dist/esm/internal.d.ts.map +1 -0
  365. package/dist/esm/internal.js +10 -0
  366. package/dist/esm/internal.js.map +1 -0
  367. package/dist/esm/naming/naming-policy.d.ts +56 -0
  368. package/dist/esm/naming/naming-policy.d.ts.map +1 -0
  369. package/dist/esm/naming/naming-policy.js +97 -0
  370. package/dist/esm/naming/naming-policy.js.map +1 -0
  371. package/dist/esm/naming/naming-rules.d.ts +15 -0
  372. package/dist/esm/naming/naming-rules.d.ts.map +1 -0
  373. package/dist/esm/naming/naming-rules.js +15 -0
  374. package/dist/esm/naming/naming-rules.js.map +1 -0
  375. package/dist/esm/package.json +8 -0
  376. package/dist/esm/serialization/contract/generated/ast.d.ts +508 -0
  377. package/dist/esm/serialization/contract/generated/ast.d.ts.map +1 -0
  378. package/dist/esm/serialization/contract/generated/ast.js +23 -0
  379. package/dist/esm/serialization/contract/generated/ast.js.map +1 -0
  380. package/dist/esm/serialization/contract/index.d.ts +2 -0
  381. package/dist/esm/serialization/contract/index.d.ts.map +1 -0
  382. package/dist/esm/serialization/contract/index.js +4 -0
  383. package/dist/esm/serialization/contract/index.js.map +1 -0
  384. package/dist/esm/serialization/index.d.ts +4 -0
  385. package/dist/esm/serialization/index.d.ts.map +1 -0
  386. package/dist/esm/serialization/index.js +5 -0
  387. package/dist/esm/serialization/index.js.map +1 -0
  388. package/dist/esm/serialization/json/deserialize.d.ts +24 -0
  389. package/dist/esm/serialization/json/deserialize.d.ts.map +1 -0
  390. package/dist/esm/serialization/json/deserialize.js +437 -0
  391. package/dist/esm/serialization/json/deserialize.js.map +1 -0
  392. package/dist/esm/serialization/json/encoding.d.ts +4 -0
  393. package/dist/esm/serialization/json/encoding.d.ts.map +1 -0
  394. package/dist/esm/serialization/json/encoding.js +319 -0
  395. package/dist/esm/serialization/json/encoding.js.map +1 -0
  396. package/dist/esm/serialization/json/expression.d.ts +32 -0
  397. package/dist/esm/serialization/json/expression.d.ts.map +1 -0
  398. package/dist/esm/serialization/json/expression.js +494 -0
  399. package/dist/esm/serialization/json/expression.js.map +1 -0
  400. package/dist/esm/serialization/json/lower.d.ts +41 -0
  401. package/dist/esm/serialization/json/lower.d.ts.map +1 -0
  402. package/dist/esm/serialization/json/lower.js +334 -0
  403. package/dist/esm/serialization/json/lower.js.map +1 -0
  404. package/dist/esm/serialization/json/pluralize-config.d.ts +3 -0
  405. package/dist/esm/serialization/json/pluralize-config.d.ts.map +1 -0
  406. package/dist/esm/serialization/json/pluralize-config.js +7 -0
  407. package/dist/esm/serialization/json/pluralize-config.js.map +1 -0
  408. package/dist/esm/serialization/json/serialize.d.ts +12 -0
  409. package/dist/esm/serialization/json/serialize.d.ts.map +1 -0
  410. package/dist/esm/serialization/json/serialize.js +389 -0
  411. package/dist/esm/serialization/json/serialize.js.map +1 -0
  412. package/dist/esm/serialization/json/util.d.ts +2 -0
  413. package/dist/esm/serialization/json/util.d.ts.map +1 -0
  414. package/dist/esm/serialization/json/util.js +19 -0
  415. package/dist/esm/serialization/json/util.js.map +1 -0
  416. package/dist/esm/serialization/utils.d.ts +3 -0
  417. package/dist/esm/serialization/utils.d.ts.map +1 -0
  418. package/dist/esm/serialization/utils.js +146 -0
  419. package/dist/esm/serialization/utils.js.map +1 -0
  420. package/dist/esm/shape/shape-registry.d.ts +51 -0
  421. package/dist/esm/shape/shape-registry.d.ts.map +1 -0
  422. package/dist/esm/shape/shape-registry.js +41 -0
  423. package/dist/esm/shape/shape-registry.js.map +1 -0
  424. package/dist/esm/shape/shape.d.ts +407 -0
  425. package/dist/esm/shape/shape.d.ts.map +1 -0
  426. package/dist/esm/shape/shape.js +424 -0
  427. package/dist/esm/shape/shape.js.map +1 -0
  428. package/dist/esm/shape/value-encoding.d.ts +121 -0
  429. package/dist/esm/shape/value-encoding.d.ts.map +1 -0
  430. package/dist/esm/shape/value-encoding.js +32 -0
  431. package/dist/esm/shape/value-encoding.js.map +1 -0
  432. package/dist/esm/types.d.ts +9 -0
  433. package/dist/esm/types.d.ts.map +1 -0
  434. package/dist/esm/types.js +4 -0
  435. package/dist/esm/types.js.map +1 -0
  436. package/dist/esm/util.d.ts +33 -0
  437. package/dist/esm/util.d.ts.map +1 -0
  438. package/dist/esm/util.js +74 -0
  439. package/dist/esm/util.js.map +1 -0
  440. package/package.json +117 -0
@@ -0,0 +1,517 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { EXPRESSION_BRAND, isExpression, unwrapExpression, } from "../../expression/expressions.js";
4
+ import { accessExpressionNode, arrayAccessExpressionNode, identifierExpressionNode, isExpressionNode, } from "../../expression/ast-nodes.js";
5
+ import { navigateShape } from "../../shape/shape.js";
6
+ import { getShape } from "../../shape/shape-registry.js";
7
+ export const RAW_RESOURCE_HANDLE = Symbol("raw-resource-handle");
8
+ export const RESOURCE_BRAND = Symbol.for("@azure/provisioning-core.Resource");
9
+ /**
10
+ * Brand present on every `LoopedResource` instance. Lives here (rather than
11
+ * on the `LoopedResource` class) so tree-walking utilities can brand-check
12
+ * for looped declarations without a runtime import of `resource.ts` — which
13
+ * would create an eval-time import cycle (`resource.ts` extends `ProvisioningComponent`).
14
+ * Use {@link isLoopedResource} in normal code.
15
+ */
16
+ export const LOOPED_RESOURCE_BRAND = Symbol.for("@azure/provisioning-core.LoopedResource");
17
+ /**
18
+ * Brand present on every `ResourceDeclaration` instance (both scalar
19
+ * `Resource` and looped `LoopedResource`). Use
20
+ * {@link isResourceDeclaration} instead of a direct
21
+ * brand check.
22
+ */
23
+ export const RESOURCE_DECLARATION_BRAND = Symbol.for("@azure/provisioning-core.ResourceDeclaration");
24
+ /**
25
+ * Present on indexed resource proxies (see {@link createIndexedResourceProxy}).
26
+ * Reading it off any resource-like value returns the stored index expression
27
+ * for indexed proxies, and `undefined` for plain outer proxies. The base
28
+ * `Resource` constructor probes for it on the `context` argument to detect
29
+ * `parents.at(i)` / `parents.current()` being passed as a child parent
30
+ * context; other consumers may probe it for their own purposes (the proxy
31
+ * itself doesn't imply any parent-child relationship — the index is simply
32
+ * what identifies which element of a looped declaration this proxy refers
33
+ * to).
34
+ */
35
+ export const PROXY_INDEX_REF = Symbol.for("@azure/provisioning-core.PROXY_INDEX_REF");
36
+ /**
37
+ * Present on indexed resource proxies. Reading it returns the underlying
38
+ * outer-proxy resource that the indexed proxy wraps. Used by the base
39
+ * `Resource` constructor to normalize `this.parent` back to the raw parent
40
+ * (so tree walks and symbol-map lookups continue to work) while
41
+ * `PROXY_INDEX_REF` carries the "which index" information onto `state`.
42
+ */
43
+ export const INDEXED_PROXY_TARGET = Symbol.for("@azure/provisioning-core.INDEXED_PROXY_TARGET");
44
+ /**
45
+ * State-object key under which the base `Resource` constructor records the
46
+ * index expression when the `context` argument is an indexed proxy (i.e.,
47
+ * `parent.at(i)` / `parent.current()`). The serializer reads this key
48
+ * from the child's raw state to emit `parent: parentSym[<index>]` instead
49
+ * of the bare `parent: parentSym` form. Kept as a shared const so writer
50
+ * (`resource.ts`) and reader (`serialize.ts`) never drift.
51
+ *
52
+ * Lives on the **child**, not the parent: siblings under the same parent
53
+ * can be created via different indexed proxies (e.g. `new Child(p.at(0), …)`
54
+ * and `new Child(p.at(1), …)` both resolve `.parent` to the same raw parent,
55
+ * so the index that distinguishes them must be recorded per-child).
56
+ */
57
+ export const STATE_PARENT_INDEX = "parentIndex";
58
+ function stepsToPath(steps) {
59
+ return steps.map((s) => s.segment);
60
+ }
61
+ const PROPERTY_PROXY_STATE = Symbol("property-proxy-state");
62
+ function isPropertyProxy(value) {
63
+ return (typeof value === "object" &&
64
+ value !== null &&
65
+ Reflect.get(value, PROPERTY_PROXY_STATE) !== undefined);
66
+ }
67
+ function getPropertyProxyState(value) {
68
+ return value[PROPERTY_PROXY_STATE];
69
+ }
70
+ export function deref(value) {
71
+ if (isPropertyProxy(value)) {
72
+ const state = getPropertyProxyState(value);
73
+ return getValueAtPath(state.root, stepsToPath(state.steps));
74
+ }
75
+ if (isResourceHandle(value)) {
76
+ return unwrapResourceHandle(value);
77
+ }
78
+ return value;
79
+ }
80
+ // ---------------------------------------------------------------------------
81
+ // Path helpers
82
+ // ---------------------------------------------------------------------------
83
+ function isPlainObject(value) {
84
+ if (typeof value !== "object" || value === null) {
85
+ return false;
86
+ }
87
+ const prototype = Object.getPrototypeOf(value);
88
+ return prototype === Object.prototype || prototype === null;
89
+ }
90
+ function getValueAtPath(root, path) {
91
+ let current = root;
92
+ for (const segment of path) {
93
+ if (typeof current !== "object" || current === null) {
94
+ return undefined;
95
+ }
96
+ if (!Object.prototype.hasOwnProperty.call(current, String(segment))) {
97
+ return undefined;
98
+ }
99
+ current = current[String(segment)];
100
+ }
101
+ return current;
102
+ }
103
+ function setValueAtPath(root, path, value) {
104
+ let current = root;
105
+ for (let index = 0; index < path.length - 1; index += 1) {
106
+ const segment = String(path[index]);
107
+ const nextSegment = path[index + 1];
108
+ const existing = Object.prototype.hasOwnProperty.call(current, segment)
109
+ ? current[segment]
110
+ : undefined;
111
+ if (typeof existing === "object" && existing !== null) {
112
+ current = existing;
113
+ continue;
114
+ }
115
+ const container = (typeof nextSegment === "number" ? [] : Object.create(null));
116
+ Object.defineProperty(current, segment, {
117
+ value: container,
118
+ enumerable: true,
119
+ configurable: true,
120
+ writable: true,
121
+ });
122
+ current = container;
123
+ }
124
+ Object.defineProperty(current, String(path[path.length - 1]), {
125
+ value,
126
+ enumerable: true,
127
+ configurable: true,
128
+ writable: true,
129
+ });
130
+ }
131
+ // ---------------------------------------------------------------------------
132
+ // Expression construction
133
+ // ---------------------------------------------------------------------------
134
+ function createMemberAccessPathExpression(resource, steps, index) {
135
+ let current = identifierExpressionNode(resource);
136
+ if (index !== undefined) {
137
+ current = arrayAccessExpressionNode(current, index);
138
+ }
139
+ for (const { segment, armPath } of steps) {
140
+ current = accessExpressionNode(current, segment, { armPath });
141
+ }
142
+ return current;
143
+ }
144
+ // ---------------------------------------------------------------------------
145
+ // Value normalization
146
+ // ---------------------------------------------------------------------------
147
+ export function normalizeAssignedValue(value, currentResource) {
148
+ if (isPropertyProxy(value)) {
149
+ const state = getPropertyProxyState(value);
150
+ if (currentResource && state.resource === currentResource) {
151
+ // Same-resource proxy → inline raw value (avoids self-references)
152
+ return getValueAtPath(state.root, stepsToPath(state.steps));
153
+ }
154
+ return createMemberAccessPathExpression(state.resource, state.steps, state.index);
155
+ }
156
+ if (isResourceHandle(value)) {
157
+ return identifierExpressionNode(value);
158
+ }
159
+ if (isExpression(value)) {
160
+ return unwrapExpression(value);
161
+ }
162
+ if (isExpressionNode(value)) {
163
+ return value;
164
+ }
165
+ if (Array.isArray(value)) {
166
+ return value.map((item) => normalizeAssignedValue(item, currentResource));
167
+ }
168
+ if (isPlainObject(value)) {
169
+ return normalizeObjectValue(value, currentResource);
170
+ }
171
+ return value;
172
+ }
173
+ function normalizeObjectValue(obj, currentResource) {
174
+ const entries = Object.entries(obj);
175
+ const result = Object.create(null);
176
+ for (const [key, value] of entries) {
177
+ if (isPropertyProxy(value)) {
178
+ const state = getPropertyProxyState(value);
179
+ if (currentResource && state.resource === currentResource) {
180
+ // Same-resource → inline raw value (avoids self-references)
181
+ result[key] = getValueAtPath(state.root, stepsToPath(state.steps));
182
+ continue;
183
+ }
184
+ }
185
+ result[key] = normalizeAssignedValue(value, currentResource);
186
+ }
187
+ return result;
188
+ }
189
+ // ---------------------------------------------------------------------------
190
+ // Property proxy
191
+ // ---------------------------------------------------------------------------
192
+ function toPropertySegment(property, nav, currentValue) {
193
+ const isIndexedContainer = nav?.kind === "array" || nav?.kind === "tuple" || Array.isArray(currentValue);
194
+ return isIndexedContainer && /^\d+$/u.test(property) ? Number(property) : property;
195
+ }
196
+ function getPropertyProxyTarget(state) {
197
+ const currentValue = getValueAtPath(state.root, stepsToPath(state.steps));
198
+ if (typeof currentValue === "object" && currentValue !== null) {
199
+ return currentValue;
200
+ }
201
+ return {};
202
+ }
203
+ function createPropertyProxy(state) {
204
+ // Always use a fresh empty target — avoids Proxy invariant violations
205
+ // when the stored value has non-configurable properties (e.g. EXPRESSION_BRAND).
206
+ const target = {};
207
+ return new Proxy(target, {
208
+ has(proxyTarget, property) {
209
+ if (property === PROPERTY_PROXY_STATE || property === EXPRESSION_BRAND) {
210
+ return true;
211
+ }
212
+ const backing = getPropertyProxyTarget(state);
213
+ if (Reflect.has(backing, property))
214
+ return true;
215
+ return Reflect.has(proxyTarget, property);
216
+ },
217
+ ownKeys() {
218
+ const backing = getPropertyProxyTarget(state);
219
+ return Reflect.ownKeys(backing).filter((k) => typeof k === "string");
220
+ },
221
+ getOwnPropertyDescriptor(_proxyTarget, property) {
222
+ const backing = getPropertyProxyTarget(state);
223
+ if (typeof property === "string" && Object.prototype.hasOwnProperty.call(backing, property)) {
224
+ return { enumerable: true, configurable: true, writable: true };
225
+ }
226
+ return undefined;
227
+ },
228
+ get(proxyTarget, property, receiver) {
229
+ if (property === PROPERTY_PROXY_STATE) {
230
+ return state;
231
+ }
232
+ if (property === EXPRESSION_BRAND) {
233
+ return createMemberAccessPathExpression(state.resource, state.steps, state.index);
234
+ }
235
+ if (property === Symbol.toPrimitive) {
236
+ return () => `[ResourceMember ${stepsToPath(state.steps).map(String).join(".")}]`;
237
+ }
238
+ if (typeof property !== "string") {
239
+ return Reflect.get(proxyTarget, property, receiver);
240
+ }
241
+ if (property === "toString") {
242
+ return () => `[ResourceMember ${stepsToPath(state.steps).map(String).join(".")}]`;
243
+ }
244
+ if (property === "valueOf") {
245
+ return () => createMemberAccessPathExpression(state.resource, state.steps, state.index);
246
+ }
247
+ if (property === "then") {
248
+ return undefined;
249
+ }
250
+ const currentValue = getValueAtPath(state.root, stepsToPath(state.steps));
251
+ const segment = toPropertySegment(property, state.nav, currentValue);
252
+ // Pass the value at the current position so a discriminated nav
253
+ // can select its variant (see `resolveModelShape`).
254
+ const step = navigateShape(state.nav, segment, currentValue);
255
+ const nextArmPath = step.stamp?.armPath;
256
+ const nextNav = step.next;
257
+ return createPropertyProxy({
258
+ ...state,
259
+ steps: [...state.steps, { segment, armPath: nextArmPath }],
260
+ nav: nextNav,
261
+ });
262
+ },
263
+ set(_proxyTarget, property, value) {
264
+ if (typeof property !== "string") {
265
+ return false;
266
+ }
267
+ // A looped element (`parent.at(i)`) yields member proxies stamped with
268
+ // an index. Writing through one would mutate the shared for-loop body,
269
+ // which is not valid Bicep — `sym[i].prop = ...` cannot be expressed.
270
+ if (state.index !== undefined) {
271
+ throwLoopedElementWriteError();
272
+ }
273
+ setValueAtPath(state.root, [
274
+ ...stepsToPath(state.steps),
275
+ toPropertySegment(property, state.nav, getValueAtPath(state.root, stepsToPath(state.steps))),
276
+ ], normalizeAssignedValue(value, state.resource));
277
+ return true;
278
+ },
279
+ });
280
+ }
281
+ // ---------------------------------------------------------------------------
282
+ // Resource member proxy
283
+ // ---------------------------------------------------------------------------
284
+ function isNonEnumerableOwnProperty(target, property) {
285
+ const descriptor = Reflect.getOwnPropertyDescriptor(target, property);
286
+ return descriptor?.enumerable === false;
287
+ }
288
+ function hasOwnOrPrototypeProperty(target, property) {
289
+ let current = target;
290
+ while (current !== null) {
291
+ if (Object.prototype.hasOwnProperty.call(current, property)) {
292
+ return true;
293
+ }
294
+ current = Object.getPrototypeOf(current);
295
+ }
296
+ return false;
297
+ }
298
+ export function createResourceMemberProxy(source, path) {
299
+ // Seed nav from the resource's shape (if any). Walk the existing
300
+ // path, transitioning nav at each step so every segment is stamped
301
+ // correctly. Pre-existing callers pass paths they built manually, so
302
+ // we treat unknown navigations as passthrough.
303
+ const rootShape = getResourceShape(source.resource);
304
+ let nav = rootShape;
305
+ const steps = [];
306
+ for (const segment of path) {
307
+ const step = navigateShape(nav, segment, getValueAtPath(source.root, stepsToPath(steps)));
308
+ steps.push({ segment, armPath: step.stamp?.armPath });
309
+ nav = step.next;
310
+ }
311
+ return createPropertyProxy({
312
+ ...source,
313
+ steps,
314
+ nav,
315
+ });
316
+ }
317
+ function getResourceShape(resource) {
318
+ // Look up by (armType, apiVersion), letting the registry resolve
319
+ // any discriminated variant from the instance's own state (typically
320
+ // the hardcoded `name` literal each variant class sets).
321
+ const state = resource[RAW_RESOURCE_HANDLE];
322
+ return getShape(resource.type, resource.apiVersion, state);
323
+ }
324
+ // ---------------------------------------------------------------------------
325
+ // Resource-level proxy
326
+ // ---------------------------------------------------------------------------
327
+ export function createResourceProxy(resource) {
328
+ function getBackingResourceData(target) {
329
+ return Reflect.get(target, RAW_RESOURCE_HANDLE);
330
+ }
331
+ const proxy = new Proxy(resource, {
332
+ ownKeys(target) {
333
+ return Array.from(new Set([
334
+ ...Reflect.ownKeys(target),
335
+ ...Reflect.ownKeys(getBackingResourceData(target)).filter((key) => key !== RAW_RESOURCE_HANDLE),
336
+ ]));
337
+ },
338
+ getOwnPropertyDescriptor(target, property) {
339
+ const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property);
340
+ if (targetDescriptor !== undefined) {
341
+ return targetDescriptor;
342
+ }
343
+ const backing = getBackingResourceData(target);
344
+ if (Object.prototype.hasOwnProperty.call(backing, property)) {
345
+ return { enumerable: true, configurable: true, writable: true };
346
+ }
347
+ return undefined;
348
+ },
349
+ get(target, property, receiver) {
350
+ if (typeof property !== "string") {
351
+ return Reflect.get(target, property, receiver);
352
+ }
353
+ if (property === "then") {
354
+ return Reflect.get(target, property, receiver);
355
+ }
356
+ if (hasOwnOrPrototypeProperty(target, property) ||
357
+ isNonEnumerableOwnProperty(target, property)) {
358
+ return Reflect.get(target, property, receiver);
359
+ }
360
+ const rootState = unwrapResourceHandle(proxy);
361
+ const rootShape = getResourceShape(target);
362
+ const segment = toPropertySegment(property, rootShape, rootState);
363
+ const step = navigateShape(rootShape, segment, rootState);
364
+ const armPath = step.stamp?.armPath;
365
+ const nav = step.next;
366
+ return createPropertyProxy({
367
+ resource: proxy,
368
+ root: rootState,
369
+ steps: [{ segment, armPath }],
370
+ nav,
371
+ });
372
+ },
373
+ set(target, property, value, receiver) {
374
+ if (typeof property !== "string") {
375
+ return Reflect.set(target, property, value, receiver);
376
+ }
377
+ if (hasOwnOrPrototypeProperty(target, property) ||
378
+ isNonEnumerableOwnProperty(target, property)) {
379
+ return Reflect.set(target, property, value, receiver);
380
+ }
381
+ setValueAtPath(unwrapResourceHandle(proxy), [toPropertySegment(property, getResourceShape(target), unwrapResourceHandle(proxy))], normalizeAssignedValue(value, proxy));
382
+ return true;
383
+ },
384
+ });
385
+ return proxy;
386
+ }
387
+ // ---------------------------------------------------------------------------
388
+ // Resource handle detection
389
+ // ---------------------------------------------------------------------------
390
+ function isResourceHandle(value) {
391
+ return (typeof value === "object" &&
392
+ value !== null &&
393
+ value[RESOURCE_BRAND] === true);
394
+ }
395
+ export function unwrapResourceHandle(resource) {
396
+ const maybeRaw = Reflect.get(resource, RAW_RESOURCE_HANDLE);
397
+ if (maybeRaw === undefined) {
398
+ return resource;
399
+ }
400
+ return maybeRaw;
401
+ }
402
+ function throwLoopedElementWriteError() {
403
+ throw new Error("Cannot assign to a property of a looped resource declaration. Individual loop iterations cannot be mutated. Set the property in the declaration passed to `fromLoop(loop, ...)`");
404
+ }
405
+ export function createIndexedResourceProxy(resource, index) {
406
+ const resourceIndexExpression = isExpression(index)
407
+ ? unwrapExpression(index)
408
+ : index;
409
+ const root = unwrapResourceHandle(resource);
410
+ // A looped declaration (`LoopedResource`) exposes the concrete subclass
411
+ // ctor it wraps via `wrappedCtor`; its prototype carries the subclass's
412
+ // ARM accessors (`.sku`, `.properties.*`, `.id`, `.name`). The `get` trap
413
+ // below walks this prototype to resolve those reads rooted at
414
+ // `sym[index]`. A scalar `Resource` has no `wrappedCtor` — it already
415
+ // carries those accessors on its own prototype, so `subclassProto` stays
416
+ // `undefined` and lookups resolve via the target's own chain.
417
+ const subclassProto = resource
418
+ .wrappedCtor?.prototype;
419
+ return new Proxy(resource, {
420
+ // Deliberately NO `getPrototypeOf` trap. Exposing the subclass
421
+ // prototype here would make `proxy instanceof Subclass` report `true`,
422
+ // invoking subclass getters/methods against the bare `LoopedResource`
423
+ // target (which lacks the subclass's own instance slots). Property
424
+ // reads and writes don't need it: the `get`/`set` traps below have
425
+ // their own `subclassProto` fallbacks that run accessors with
426
+ // `this = receiver` (the proxy) so `this.expr(...)` resolves against the
427
+ // indexed element.
428
+ get(target, property, receiver) {
429
+ // Reveal-only symbols consulted by the base `Resource` constructor
430
+ // and by serialization; both are marker keys with no runtime prototype
431
+ // representation on plain resources.
432
+ if (property === PROXY_INDEX_REF)
433
+ return resourceIndexExpression;
434
+ if (property === INDEXED_PROXY_TARGET)
435
+ return target;
436
+ // Intercept the single funnel for ARM reads. `this.expr(...path)` is
437
+ // the getter body used by every generated ARM property (`.name`,
438
+ // `.id`, `.properties.*`, etc.). Route it through
439
+ // `createResourceMemberProxy` with our `resourceIndexExpression` so
440
+ // the whole emitted expression roots at `sym[index]` instead of `sym`.
441
+ if (property === "expr") {
442
+ return function boundIndexedExpr(...path) {
443
+ return createResourceMemberProxy({
444
+ resource: target,
445
+ root,
446
+ index: resourceIndexExpression,
447
+ }, path);
448
+ };
449
+ }
450
+ // Block ARM property writes on a looped element. Every generated ARM
451
+ // setter (`set sku`, `set properties`, `set name`, …) funnels through
452
+ // `this.setProperty(...)`, so intercepting that single method turns
453
+ // `parent.at(i).sku = ...` into a clear error.
454
+ if (property === "setProperty") {
455
+ return throwLoopedElementWriteError;
456
+ }
457
+ // First try the target's own chain. Two subtleties:
458
+ //
459
+ // 1. Getters (`.type`, `.apiVersion`, `.children`, `.parent`, …) must
460
+ // run with `this = target` so they see the raw resource's own
461
+ // properties — including class private fields (`#…`). Passing the
462
+ // proxy as `receiver` would cause private-field access inside a
463
+ // getter to fail because the proxy has no such slot.
464
+ // 2. Subclass methods need `this = target` for the same reason — private
465
+ // fields again — so
466
+ // we return a bound wrapper. This means `ctx.method === ctx.method`
467
+ // yields `false` between reads; acceptable trade-off given no
468
+ // caller relies on function identity on an indexed proxy.
469
+ if (property in target) {
470
+ const value = Reflect.get(target, property, target);
471
+ return typeof value === "function" ? value.bind(target) : value;
472
+ }
473
+ // Fall through to `subclassProto` for subclass-specific getters
474
+ // (e.g. `.id`, `.name`, `.sku`) when wrapping a `LoopedResource`.
475
+ // Getters must run with `this = receiver` (the proxy) so their
476
+ // `this.expr(...)` calls hit our intercept above, yielding an
477
+ // expression rooted at `sym[index]`. Methods bind to `target` to
478
+ // stay consistent with the passthrough branch above.
479
+ if (subclassProto !== undefined) {
480
+ let proto = subclassProto;
481
+ while (proto !== null && proto !== Object.prototype) {
482
+ const descriptor = Object.getOwnPropertyDescriptor(proto, property);
483
+ if (descriptor !== undefined) {
484
+ if (descriptor.get !== undefined) {
485
+ return descriptor.get.call(receiver);
486
+ }
487
+ const value = descriptor.value;
488
+ return typeof value === "function" ? value.bind(target) : value;
489
+ }
490
+ proto = Object.getPrototypeOf(proto);
491
+ }
492
+ }
493
+ return undefined;
494
+ },
495
+ // Route writes to an ARM property setter with `this = receiver` (the
496
+ // proxy), allowing its `setProperty` call to hit the rejection above.
497
+ // Falls back to a plain write on the raw target.
498
+ set(target, property, value, receiver) {
499
+ if (subclassProto !== undefined) {
500
+ let proto = subclassProto;
501
+ while (proto !== null && proto !== Object.prototype) {
502
+ const descriptor = Object.getOwnPropertyDescriptor(proto, property);
503
+ if (descriptor !== undefined) {
504
+ if (descriptor.set !== undefined) {
505
+ descriptor.set.call(receiver, value);
506
+ return true;
507
+ }
508
+ break;
509
+ }
510
+ proto = Object.getPrototypeOf(proto);
511
+ }
512
+ }
513
+ return Reflect.set(target, property, value, target);
514
+ },
515
+ });
516
+ }
517
+ //# sourceMappingURL=resource-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-proxy.js","sourceRoot":"","sources":["../../../../src/constructs/resource/resource-proxy.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,GAGjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,gBAAgB,GAGjB,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EAAE,aAAa,EAAsC,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AAE9E;;;;;;GAM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I,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;oBAClE,CAAC;oBACD,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;YAED,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,qEAAqE;QACrE,sEAAsE;QACtE,iDAAiD;QACjD,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ;YACnC,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gBAChC,IAAI,KAAK,GAAkB,aAAa,CAAC;gBACzC,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM,CAAC,SAAS,EAAE,CAAC;oBACpD,MAAM,UAAU,GAAG,MAAM,CAAC,wBAAwB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;oBACpE,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;wBAC7B,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;4BACjC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;4BACrC,OAAO,IAAI,CAAC;wBACd,CAAC;wBACD,MAAM;oBACR,CAAC;oBACD,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;gBACvC,CAAC;YACH,CAAC;YACD,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;KACF,CAAsB,CAAC;AAC1B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n EXPRESSION_BRAND,\n isExpression,\n unwrapExpression,\n type Expression,\n type ExpressionOrValue,\n} from \"../../expression/expressions.js\";\nimport {\n accessExpressionNode,\n arrayAccessExpressionNode,\n identifierExpressionNode,\n isExpressionNode,\n type ArrayAccessIndex,\n type ExpressionNode,\n} from \"../../expression/ast-nodes.js\";\nimport type { PropertySegment } from \"../../types.js\";\nimport type { LoopedResource, Resource, ResourceDeclaration } from \"./resource.js\";\nimport { navigateShape, type FlatModelShape, type NavShape } from \"../../shape/shape.js\";\nimport { getShape } from \"../../shape/shape-registry.js\";\n\nexport const RAW_RESOURCE_HANDLE = Symbol(\"raw-resource-handle\");\nexport const RESOURCE_BRAND = Symbol.for(\"@azure/provisioning-core.Resource\");\n\n/**\n * Brand present on every `LoopedResource` instance. Lives here (rather than\n * on the `LoopedResource` class) so tree-walking utilities can brand-check\n * for looped declarations without a runtime import of `resource.ts` — which\n * would create an eval-time import cycle (`resource.ts` extends `ProvisioningComponent`).\n * Use {@link isLoopedResource} in normal code.\n */\nexport const LOOPED_RESOURCE_BRAND = Symbol.for(\"@azure/provisioning-core.LoopedResource\");\n\n/**\n * Brand present on every `ResourceDeclaration` instance (both scalar\n * `Resource` and looped `LoopedResource`). Use\n * {@link isResourceDeclaration} instead of a direct\n * brand check.\n */\nexport const RESOURCE_DECLARATION_BRAND = Symbol.for(\n \"@azure/provisioning-core.ResourceDeclaration\",\n);\n\n/**\n * Present on indexed resource proxies (see {@link createIndexedResourceProxy}).\n * Reading it off any resource-like value returns the stored index expression\n * for indexed proxies, and `undefined` for plain outer proxies. The base\n * `Resource` constructor probes for it on the `context` argument to detect\n * `parents.at(i)` / `parents.current()` being passed as a child parent\n * context; other consumers may probe it for their own purposes (the proxy\n * itself doesn't imply any parent-child relationship — the index is simply\n * what identifies which element of a looped declaration this proxy refers\n * to).\n */\nexport const PROXY_INDEX_REF = Symbol.for(\"@azure/provisioning-core.PROXY_INDEX_REF\");\n\n/**\n * Present on indexed resource proxies. Reading it returns the underlying\n * outer-proxy resource that the indexed proxy wraps. Used by the base\n * `Resource` constructor to normalize `this.parent` back to the raw parent\n * (so tree walks and symbol-map lookups continue to work) while\n * `PROXY_INDEX_REF` carries the \"which index\" information onto `state`.\n */\nexport const INDEXED_PROXY_TARGET = Symbol.for(\"@azure/provisioning-core.INDEXED_PROXY_TARGET\");\n\n/**\n * State-object key under which the base `Resource` constructor records the\n * index expression when the `context` argument is an indexed proxy (i.e.,\n * `parent.at(i)` / `parent.current()`). The serializer reads this key\n * from the child's raw state to emit `parent: parentSym[<index>]` instead\n * of the bare `parent: parentSym` form. Kept as a shared const so writer\n * (`resource.ts`) and reader (`serialize.ts`) never drift.\n *\n * Lives on the **child**, not the parent: siblings under the same parent\n * can be created via different indexed proxies (e.g. `new Child(p.at(0), …)`\n * and `new Child(p.at(1), …)` both resolve `.parent` to the same raw parent,\n * so the index that distinguishes them must be recorded per-child).\n */\nexport const STATE_PARENT_INDEX = \"parentIndex\" as const;\n\n// ---------------------------------------------------------------------------\n// Property proxy internal types\n// ---------------------------------------------------------------------------\n\n/**\n * A single step in a property proxy's walk from the root resource. Each step\n * carries the path segment (member name or array index) and the ARM\n * `PropertyShape` stamp's `armPath` for that step (if known). The parallel `path`/`stamps`\n * arrays this replaces could drift in length; a single array of steps makes\n * the invariant structural.\n */\ninterface PropertyStep {\n readonly segment: PropertySegment;\n readonly armPath?: readonly string[] | undefined;\n}\n\n/**\n * The identity a member-proxy needs to lower into a Bicep expression and to\n * back reads/writes. Bundles the three roles that were previously passed\n * positionally to {@link createResourceMemberProxy}:\n *\n * - `resource` — the tree-registered declaration that supplies BOTH the\n * symbol root (`identifierExpressionNode(resource)`) and the ARM shape\n * source (`getResourceShape`). For a scalar resource this is the outer\n * resource proxy; for an indexed looped element it is the raw\n * `LoopedResource` declaration (the tree citizen), NOT the ephemeral\n * `.at(i)` handle — that handle isn't in the component tree, so it can't\n * resolve to a Bicep symbol.\n * - `root` — the raw backing object that stores assigned values, used by\n * `deref(...)` and nested writes.\n * - `index` — optional array index. When set, the emitted expression roots\n * at `resource[index]` instead of `resource`, so `many.at(i).prop.blob`\n * serializes as `sym[i].prop.blob`. Populated for `.at(i)` / `.current()`\n * handles by {@link createIndexedResourceProxy}.\n */\nexport interface ResourceProxySource {\n readonly resource: Resource;\n readonly root: Record<string, unknown>;\n readonly index?: ArrayAccessIndex;\n}\n\ninterface PropertyProxyState extends ResourceProxySource {\n // The member/index path from the root resource to the current proxied value,\n // each entry paired with its wire `armPath` stamp (if known).\n readonly steps: readonly PropertyStep[];\n // Current ARM shape navigation state. `undefined` at any level means\n // \"untyped from here down\"; subsequent accesses are passthrough.\n readonly nav?: NavShape;\n}\n\nfunction stepsToPath(steps: readonly PropertyStep[]): readonly PropertySegment[] {\n return steps.map((s) => s.segment);\n}\n\nconst PROPERTY_PROXY_STATE = Symbol(\"property-proxy-state\");\n\nfunction isPropertyProxy(\n value: unknown,\n): value is { readonly [PROPERTY_PROXY_STATE]: PropertyProxyState } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n Reflect.get(value as object, PROPERTY_PROXY_STATE) !== undefined\n );\n}\n\nfunction getPropertyProxyState(value: {\n readonly [PROPERTY_PROXY_STATE]: PropertyProxyState;\n}): PropertyProxyState {\n return value[PROPERTY_PROXY_STATE];\n}\n\n// ---------------------------------------------------------------------------\n// Deref\n// ---------------------------------------------------------------------------\n\nexport type Deref<T> = T extends Expression<infer U> ? U : T;\n\nexport function deref<T>(value: T): Deref<T> {\n if (isPropertyProxy(value)) {\n const state = getPropertyProxyState(value);\n return getValueAtPath(state.root, stepsToPath(state.steps)) as Deref<T>;\n }\n\n if (isResourceHandle(value)) {\n return unwrapResourceHandle(value) as Deref<T>;\n }\n\n return value as Deref<T>;\n}\n\n// ---------------------------------------------------------------------------\n// Path helpers\n// ---------------------------------------------------------------------------\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction getValueAtPath(root: Record<string, unknown>, path: readonly PropertySegment[]): unknown {\n let current: unknown = root;\n\n for (const segment of path) {\n if (typeof current !== \"object\" || current === null) {\n return undefined;\n }\n\n if (!Object.prototype.hasOwnProperty.call(current, String(segment))) {\n return undefined;\n }\n current = (current as Record<string, unknown>)[String(segment)];\n }\n\n return current;\n}\n\nfunction setValueAtPath(\n root: Record<string, unknown>,\n path: readonly PropertySegment[],\n value: unknown,\n): void {\n let current: Record<string, unknown> = root;\n\n for (let index = 0; index < path.length - 1; index += 1) {\n const segment = String(path[index]);\n const nextSegment = path[index + 1];\n const existing = Object.prototype.hasOwnProperty.call(current, segment)\n ? current[segment]\n : undefined;\n\n if (typeof existing === \"object\" && existing !== null) {\n current = existing as Record<string, unknown>;\n continue;\n }\n\n const container = (typeof nextSegment === \"number\" ? [] : Object.create(null)) as Record<\n string,\n unknown\n >;\n Object.defineProperty(current, segment, {\n value: container,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n current = container;\n }\n\n Object.defineProperty(current, String(path[path.length - 1]), {\n value,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n}\n\n// ---------------------------------------------------------------------------\n// Expression construction\n// ---------------------------------------------------------------------------\n\nfunction createMemberAccessPathExpression(\n resource: Resource,\n steps: readonly PropertyStep[],\n index?: ArrayAccessIndex,\n): ExpressionNode {\n let current: ExpressionNode = identifierExpressionNode(resource);\n if (index !== undefined) {\n current = arrayAccessExpressionNode(current, index);\n }\n for (const { segment, armPath } of steps) {\n current = accessExpressionNode(current, segment, { armPath });\n }\n return current;\n}\n\n// ---------------------------------------------------------------------------\n// Value normalization\n// ---------------------------------------------------------------------------\n\nexport function normalizeAssignedValue(value: unknown, currentResource?: Resource): unknown {\n if (isPropertyProxy(value)) {\n const state = getPropertyProxyState(value);\n if (currentResource && state.resource === currentResource) {\n // Same-resource proxy → inline raw value (avoids self-references)\n return getValueAtPath(state.root, stepsToPath(state.steps));\n }\n return createMemberAccessPathExpression(state.resource, state.steps, state.index);\n }\n\n if (isResourceHandle(value)) {\n return identifierExpressionNode(value);\n }\n\n if (isExpression(value)) {\n return unwrapExpression(value);\n }\n\n if (isExpressionNode(value)) {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map((item) => normalizeAssignedValue(item, currentResource));\n }\n\n if (isPlainObject(value)) {\n return normalizeObjectValue(value as Record<string, unknown>, currentResource);\n }\n\n return value;\n}\n\nfunction normalizeObjectValue(\n obj: Record<string, unknown>,\n currentResource?: Resource,\n): Record<string, unknown> {\n const entries = Object.entries(obj);\n const result: Record<string, unknown> = Object.create(null);\n\n for (const [key, value] of entries) {\n if (isPropertyProxy(value)) {\n const state = getPropertyProxyState(value);\n if (currentResource && state.resource === currentResource) {\n // Same-resource → inline raw value (avoids self-references)\n result[key] = getValueAtPath(state.root, stepsToPath(state.steps));\n continue;\n }\n }\n\n result[key] = normalizeAssignedValue(value, currentResource);\n }\n\n return result;\n}\n\n// ---------------------------------------------------------------------------\n// Property proxy\n// ---------------------------------------------------------------------------\n\nfunction toPropertySegment(\n property: string,\n nav: NavShape,\n currentValue: unknown,\n): PropertySegment {\n const isIndexedContainer =\n nav?.kind === \"array\" || nav?.kind === \"tuple\" || Array.isArray(currentValue);\n return isIndexedContainer && /^\\d+$/u.test(property) ? Number(property) : property;\n}\n\nfunction getPropertyProxyTarget(state: PropertyProxyState): object {\n const currentValue = getValueAtPath(state.root, stepsToPath(state.steps));\n\n if (typeof currentValue === \"object\" && currentValue !== null) {\n return currentValue;\n }\n\n return {};\n}\n\nfunction createPropertyProxy(state: PropertyProxyState): unknown {\n // Always use a fresh empty target — avoids Proxy invariant violations\n // when the stored value has non-configurable properties (e.g. EXPRESSION_BRAND).\n const target = {};\n\n return new Proxy(target, {\n has(proxyTarget, property) {\n if (property === PROPERTY_PROXY_STATE || property === EXPRESSION_BRAND) {\n return true;\n }\n\n const backing = getPropertyProxyTarget(state);\n if (Reflect.has(backing, property)) return true;\n return Reflect.has(proxyTarget, property);\n },\n\n ownKeys() {\n const backing = getPropertyProxyTarget(state);\n return Reflect.ownKeys(backing).filter((k): k is string => typeof k === \"string\");\n },\n\n getOwnPropertyDescriptor(_proxyTarget, property) {\n const backing = getPropertyProxyTarget(state);\n if (typeof property === \"string\" && Object.prototype.hasOwnProperty.call(backing, property)) {\n return { enumerable: true, configurable: true, writable: true };\n }\n return undefined;\n },\n\n get(proxyTarget, property, receiver) {\n if (property === PROPERTY_PROXY_STATE) {\n return state;\n }\n\n if (property === EXPRESSION_BRAND) {\n return createMemberAccessPathExpression(state.resource, state.steps, state.index);\n }\n\n if (property === Symbol.toPrimitive) {\n return () => `[ResourceMember ${stepsToPath(state.steps).map(String).join(\".\")}]`;\n }\n\n if (typeof property !== \"string\") {\n return Reflect.get(proxyTarget, property, receiver);\n }\n\n if (property === \"toString\") {\n return () => `[ResourceMember ${stepsToPath(state.steps).map(String).join(\".\")}]`;\n }\n\n if (property === \"valueOf\") {\n return () => createMemberAccessPathExpression(state.resource, state.steps, state.index);\n }\n\n if (property === \"then\") {\n return undefined;\n }\n\n const currentValue = getValueAtPath(state.root, stepsToPath(state.steps));\n const segment = toPropertySegment(property, state.nav, currentValue);\n // Pass the value at the current position so a discriminated nav\n // can select its variant (see `resolveModelShape`).\n const step = navigateShape(state.nav, segment, currentValue);\n const nextArmPath = step.stamp?.armPath;\n const nextNav = step.next;\n\n return createPropertyProxy({\n ...state,\n steps: [...state.steps, { segment, armPath: nextArmPath }],\n nav: nextNav,\n });\n },\n\n set(_proxyTarget, property, value) {\n if (typeof property !== \"string\") {\n return false;\n }\n\n // A looped element (`parent.at(i)`) yields member proxies stamped with\n // an index. Writing through one would mutate the shared for-loop body,\n // which is not valid Bicep — `sym[i].prop = ...` cannot be expressed.\n if (state.index !== undefined) {\n throwLoopedElementWriteError();\n }\n\n setValueAtPath(\n state.root,\n [\n ...stepsToPath(state.steps),\n toPropertySegment(\n property,\n state.nav,\n getValueAtPath(state.root, stepsToPath(state.steps)),\n ),\n ],\n normalizeAssignedValue(value, state.resource),\n );\n\n return true;\n },\n });\n}\n\n// ---------------------------------------------------------------------------\n// Resource member proxy\n// ---------------------------------------------------------------------------\n\nfunction isNonEnumerableOwnProperty(target: object, property: string): boolean {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n return descriptor?.enumerable === false;\n}\n\nfunction hasOwnOrPrototypeProperty(target: object, property: string): boolean {\n let current: object | null = target;\n\n while (current !== null) {\n if (Object.prototype.hasOwnProperty.call(current, property)) {\n return true;\n }\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n}\n\nexport function createResourceMemberProxy<TValue>(\n source: ResourceProxySource,\n path: readonly PropertySegment[],\n): Expression<TValue> & TValue {\n // Seed nav from the resource's shape (if any). Walk the existing\n // path, transitioning nav at each step so every segment is stamped\n // correctly. Pre-existing callers pass paths they built manually, so\n // we treat unknown navigations as passthrough.\n const rootShape = getResourceShape(source.resource);\n let nav: NavShape = rootShape;\n const steps: PropertyStep[] = [];\n for (const segment of path) {\n const step = navigateShape(nav, segment, getValueAtPath(source.root, stepsToPath(steps)));\n steps.push({ segment, armPath: step.stamp?.armPath });\n nav = step.next;\n }\n\n return createPropertyProxy({\n ...source,\n steps,\n nav,\n }) as Expression<TValue> & TValue;\n}\n\nfunction getResourceShape(resource: Resource): FlatModelShape | undefined {\n // Look up by (armType, apiVersion), letting the registry resolve\n // any discriminated variant from the instance's own state (typically\n // the hardcoded `name` literal each variant class sets).\n const state = (resource as unknown as { [RAW_RESOURCE_HANDLE]: Record<string, unknown> })[\n RAW_RESOURCE_HANDLE\n ];\n return getShape(resource.type, resource.apiVersion, state);\n}\n\n// ---------------------------------------------------------------------------\n// Resource-level proxy\n// ---------------------------------------------------------------------------\n\nexport function createResourceProxy<\n TType extends string,\n TResource extends Resource<TType> & object,\n>(resource: TResource): TResource {\n function getBackingResourceData(target: TResource): Record<string, unknown> {\n return Reflect.get(target, RAW_RESOURCE_HANDLE) as Record<string, unknown>;\n }\n\n const proxy = new Proxy(resource, {\n ownKeys(target) {\n return Array.from(\n new Set([\n ...Reflect.ownKeys(target),\n ...Reflect.ownKeys(getBackingResourceData(target)).filter(\n (key) => key !== RAW_RESOURCE_HANDLE,\n ),\n ]),\n );\n },\n\n getOwnPropertyDescriptor(target, property) {\n const targetDescriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (targetDescriptor !== undefined) {\n return targetDescriptor;\n }\n\n const backing = getBackingResourceData(target);\n if (Object.prototype.hasOwnProperty.call(backing, property)) {\n return { enumerable: true, configurable: true, writable: true };\n }\n\n return undefined;\n },\n\n get(target, property, receiver) {\n if (typeof property !== \"string\") {\n return Reflect.get(target, property, receiver);\n }\n\n if (property === \"then\") {\n return Reflect.get(target, property, receiver);\n }\n\n if (\n hasOwnOrPrototypeProperty(target, property) ||\n isNonEnumerableOwnProperty(target, property)\n ) {\n return Reflect.get(target, property, receiver);\n }\n\n const rootState = unwrapResourceHandle(proxy) as Record<string, unknown>;\n const rootShape = getResourceShape(target);\n const segment = toPropertySegment(property, rootShape, rootState);\n const step = navigateShape(rootShape, segment, rootState);\n const armPath = step.stamp?.armPath;\n const nav = step.next;\n\n return createPropertyProxy({\n resource: proxy,\n root: rootState,\n steps: [{ segment, armPath }],\n nav,\n });\n },\n\n set(target, property, value, receiver) {\n if (typeof property !== \"string\") {\n return Reflect.set(target, property, value, receiver);\n }\n\n if (\n hasOwnOrPrototypeProperty(target, property) ||\n isNonEnumerableOwnProperty(target, property)\n ) {\n return Reflect.set(target, property, value, receiver);\n }\n\n setValueAtPath(\n unwrapResourceHandle(proxy) as Record<string, unknown>,\n [toPropertySegment(property, getResourceShape(target), unwrapResourceHandle(proxy))],\n normalizeAssignedValue(value, proxy),\n );\n return true;\n },\n });\n\n return proxy;\n}\n\n// ---------------------------------------------------------------------------\n// Resource handle detection\n// ---------------------------------------------------------------------------\n\nfunction isResourceHandle(value: unknown): value is Resource {\n return (\n typeof value === \"object\" &&\n value !== null &&\n (value as Record<symbol, unknown>)[RESOURCE_BRAND] === true\n );\n}\n\nexport function unwrapResourceHandle<T extends ResourceDeclaration>(resource: T): T {\n const maybeRaw = Reflect.get(resource as object, RAW_RESOURCE_HANDLE);\n\n if (maybeRaw === undefined) {\n return resource;\n }\n\n return maybeRaw as T;\n}\n\n// ---------------------------------------------------------------------------\n// Indexed resource proxy — for `LoopedResource.at(i)` / `.current()`\n// ---------------------------------------------------------------------------\n\n/**\n * Returns a passthrough proxy over `resource` that carries an \"index\"\n * expression alongside the wrapped resource. Two purposes:\n *\n * 1. **Property reads** — ARM getters on the underlying `Resource` funnel\n * through `this.expr(...)`. The indexed proxy intercepts `expr` and\n * threads `resourceIndexExpression` into the member proxy so that reads\n * render as `sym[index].<path>` on the wire. Direct data-property reads\n * like `.type` / `.apiVersion` / `.condition` / `.existing` fall through\n * unchanged (they are authoring/type metadata, not ARM reads).\n *\n * 2. **Child parent context** — passing `parents.at(0)` as the first\n * argument to a child constructor must (a) let the child register into\n * the raw parent's tree, and (b) record the index so the serializer can\n * emit `parent: parentSym[i]`.\n * This proxy passes framework members (`children`, `deploymentContext`,\n * `_localDeploymentContext`, `hasDeploymentContext`, `.parent`, `.self`,\n * ...) through unchanged so the base `Resource` constructor's\n * interaction with `context` works exactly as it would with the raw\n * parent. `PROXY_INDEX_REF` and `INDEXED_PROXY_TARGET` expose the\n * index and the raw target to the base `Resource` constructor.\n *\n * The `index` can be a literal number, a literal string, or any expression\n * (typically a loop's `.index` symbolic value). It is unwrapped from any\n * `Expression<T>` proxy at construction time so downstream code stores a\n * primitive or an `ExpressionNode`, never an `Expression` proxy.\n *\n * **The indexed proxy is an ephemeral wrapper, not a tree node.** A fresh\n * proxy is minted per `.at(i)` call and is not stored in\n * any `parent.children` array; only the raw outer resource proxy\n * participates in the ProvisioningComponent tree. When a child is created with an\n * indexed proxy as `context`, `ProvisioningComponent`'s ctor writes\n * `this.parent = indexedProxy` briefly, but the base `Resource` ctor then overwrites\n * `this.parent` back to the raw parent (via `INDEXED_PROXY_TARGET`) so the\n * tree only ever references raw resource proxies. The indexed wrapper is\n * garbage-collectable once the child ctor returns; its sole job is to\n * carry the index through construction into `state.parentIndex`.\n */\n/**\n * Static type an indexed proxy exposes, derived from the declaration it\n * wraps. A `LoopedResource<T>` narrows to `T` — the concrete resource\n * type — so `parent.at(i)` exposes the full ARM and child-accessor\n * surface, resolved element-scoped at runtime. Any scalar {@link Resource}\n * yields itself.\n */\ntype IndexedProxyOf<D extends ResourceDeclaration> = D extends LoopedResource<infer T> ? T : D;\n\nfunction throwLoopedElementWriteError(): never {\n throw new Error(\n \"Cannot assign to a property of a looped resource declaration. Individual loop iterations cannot be mutated. Set the property in the declaration passed to `fromLoop(loop, ...)`\",\n );\n}\n\nexport function createIndexedResourceProxy<D extends ResourceDeclaration>(\n resource: D,\n index: ExpressionOrValue<number>,\n): IndexedProxyOf<D> {\n const resourceIndexExpression: ArrayAccessIndex = isExpression(index)\n ? unwrapExpression(index as Expression<number>)\n : index;\n const root = unwrapResourceHandle(resource) as unknown as Record<string, unknown>;\n\n // A looped declaration (`LoopedResource`) exposes the concrete subclass\n // ctor it wraps via `wrappedCtor`; its prototype carries the subclass's\n // ARM accessors (`.sku`, `.properties.*`, `.id`, `.name`). The `get` trap\n // below walks this prototype to resolve those reads rooted at\n // `sym[index]`. A scalar `Resource` has no `wrappedCtor` — it already\n // carries those accessors on its own prototype, so `subclassProto` stays\n // `undefined` and lookups resolve via the target's own chain.\n const subclassProto = (resource as { readonly wrappedCtor?: { readonly prototype: object } })\n .wrappedCtor?.prototype;\n\n return new Proxy(resource as object, {\n // Deliberately NO `getPrototypeOf` trap. Exposing the subclass\n // prototype here would make `proxy instanceof Subclass` report `true`,\n // invoking subclass getters/methods against the bare `LoopedResource`\n // target (which lacks the subclass's own instance slots). Property\n // reads and writes don't need it: the `get`/`set` traps below have\n // their own `subclassProto` fallbacks that run accessors with\n // `this = receiver` (the proxy) so `this.expr(...)` resolves against the\n // indexed element.\n get(target, property, receiver) {\n // Reveal-only symbols consulted by the base `Resource` constructor\n // and by serialization; both are marker keys with no runtime prototype\n // representation on plain resources.\n if (property === PROXY_INDEX_REF) return resourceIndexExpression;\n if (property === INDEXED_PROXY_TARGET) return target;\n\n // Intercept the single funnel for ARM reads. `this.expr(...path)` is\n // the getter body used by every generated ARM property (`.name`,\n // `.id`, `.properties.*`, etc.). Route it through\n // `createResourceMemberProxy` with our `resourceIndexExpression` so\n // the whole emitted expression roots at `sym[index]` instead of `sym`.\n if (property === \"expr\") {\n return function boundIndexedExpr(...path: readonly PropertySegment[]): unknown {\n return createResourceMemberProxy(\n {\n resource: target as Resource,\n root,\n index: resourceIndexExpression,\n },\n path,\n );\n };\n }\n\n // Block ARM property writes on a looped element. Every generated ARM\n // setter (`set sku`, `set properties`, `set name`, …) funnels through\n // `this.setProperty(...)`, so intercepting that single method turns\n // `parent.at(i).sku = ...` into a clear error.\n if (property === \"setProperty\") {\n return throwLoopedElementWriteError;\n }\n\n // First try the target's own chain. Two subtleties:\n //\n // 1. Getters (`.type`, `.apiVersion`, `.children`, `.parent`, …) must\n // run with `this = target` so they see the raw resource's own\n // properties — including class private fields (`#…`). Passing the\n // proxy as `receiver` would cause private-field access inside a\n // getter to fail because the proxy has no such slot.\n // 2. Subclass methods need `this = target` for the same reason — private\n // fields again — so\n // we return a bound wrapper. This means `ctx.method === ctx.method`\n // yields `false` between reads; acceptable trade-off given no\n // caller relies on function identity on an indexed proxy.\n if (property in target) {\n const value = Reflect.get(target, property, target);\n return typeof value === \"function\" ? value.bind(target) : value;\n }\n\n // Fall through to `subclassProto` for subclass-specific getters\n // (e.g. `.id`, `.name`, `.sku`) when wrapping a `LoopedResource`.\n // Getters must run with `this = receiver` (the proxy) so their\n // `this.expr(...)` calls hit our intercept above, yielding an\n // expression rooted at `sym[index]`. Methods bind to `target` to\n // stay consistent with the passthrough branch above.\n if (subclassProto !== undefined) {\n let proto: object | null = subclassProto;\n while (proto !== null && proto !== Object.prototype) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, property);\n if (descriptor !== undefined) {\n if (descriptor.get !== undefined) {\n return descriptor.get.call(receiver);\n }\n const value = descriptor.value;\n return typeof value === \"function\" ? value.bind(target) : value;\n }\n proto = Object.getPrototypeOf(proto);\n }\n }\n\n return undefined;\n },\n\n // Route writes to an ARM property setter with `this = receiver` (the\n // proxy), allowing its `setProperty` call to hit the rejection above.\n // Falls back to a plain write on the raw target.\n set(target, property, value, receiver) {\n if (subclassProto !== undefined) {\n let proto: object | null = subclassProto;\n while (proto !== null && proto !== Object.prototype) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, property);\n if (descriptor !== undefined) {\n if (descriptor.set !== undefined) {\n descriptor.set.call(receiver, value);\n return true;\n }\n break;\n }\n proto = Object.getPrototypeOf(proto);\n }\n }\n return Reflect.set(target, property, value, target);\n },\n }) as IndexedProxyOf<D>;\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import type { ProvisioningComponent } from "../provisioning-component.js";
2
+ import type { LoopedResource, Resource } from "./resource.js";
3
+ import type { ResourceCtor } from "./resource-registry.js";
4
+ /** Options accepted by the `Stack` resource queries. */
5
+ export interface QueryOptions {
6
+ /**
7
+ * Whether to walk the stack's entire subtree (default `true`) or only its
8
+ * **direct children** (`false`).
9
+ */
10
+ readonly recursive?: boolean;
11
+ }
12
+ /** Scalar (un-looped) resource declarations. */
13
+ export declare function getResources(root: ProvisioningComponent, typeOrOptions?: ResourceCtor<Resource> | QueryOptions, maybeOptions?: QueryOptions): Resource[];
14
+ /** Loop-expanded resource declarations (`Ctor.fromLoop(...)`). */
15
+ export declare function getLoopedResources(root: ProvisioningComponent, typeOrOptions?: ResourceCtor<Resource> | QueryOptions, maybeOptions?: QueryOptions): LoopedResource<Resource>[];
16
+ /**
17
+ * First scalar resource of `type` whose literal name equals `name`, or
18
+ * `undefined`. `deref` resolves the name's expression proxy to its literal
19
+ * (a `Resource`'s `name` is an `Expression`, so `r.name === name` is always
20
+ * false without it).
21
+ */
22
+ export declare function getResource<T extends Resource>(root: ProvisioningComponent, type: ResourceCtor<T>, name: string, options?: QueryOptions): T | undefined;
23
+ //# sourceMappingURL=resource-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-query.d.ts","sourceRoot":"","sources":["../../../../src/constructs/resource/resource-query.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAM3D,wDAAwD;AACxD,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAsCD,gDAAgD;AAChD,wBAAgB,YAAY,CAC1B,IAAI,EAAE,qBAAqB,EAC3B,aAAa,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,EACrD,YAAY,CAAC,EAAE,YAAY,GAC1B,QAAQ,EAAE,CAOZ;AAED,kEAAkE;AAClE,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,qBAAqB,EAC3B,aAAa,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,GAAG,YAAY,EACrD,YAAY,CAAC,EAAE,YAAY,GAC1B,cAAc,CAAC,QAAQ,CAAC,EAAE,CAO5B;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,QAAQ,EAC5C,IAAI,EAAE,qBAAqB,EAC3B,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,EACrB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,YAAY,GACrB,CAAC,GAAG,SAAS,CAKf"}