@azure-tools/typespec-ts 0.55.0-dev.9 → 0.55.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 (464) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +24 -19
  3. package/dist/src/context-manager.d.ts +19 -2
  4. package/dist/src/context-manager.d.ts.map +1 -1
  5. package/dist/src/context-manager.js +21 -0
  6. package/dist/src/context-manager.js.map +1 -1
  7. package/dist/src/framework/declaration.d.ts.map +1 -1
  8. package/dist/src/framework/declaration.js +6 -20
  9. package/dist/src/framework/declaration.js.map +1 -1
  10. package/dist/src/framework/hooks/sdk-types.d.ts +12 -2
  11. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  12. package/dist/src/framework/hooks/sdk-types.js +17 -3
  13. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  14. package/dist/src/framework/source-file-batch.d.ts +35 -0
  15. package/dist/src/framework/source-file-batch.d.ts.map +1 -0
  16. package/dist/src/framework/source-file-batch.js +128 -0
  17. package/dist/src/framework/source-file-batch.js.map +1 -0
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/index.js +73 -62
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/{rlc-common/interfaces.d.ts → interfaces.d.ts} +12 -14
  22. package/dist/src/interfaces.d.ts.map +1 -0
  23. package/dist/src/interfaces.js.map +1 -0
  24. package/dist/src/lib.d.ts +17 -5
  25. package/dist/src/lib.d.ts.map +1 -1
  26. package/dist/src/lib.js +24 -17
  27. package/dist/src/lib.js.map +1 -1
  28. package/dist/src/meta-tree.d.ts +4 -4
  29. package/dist/src/meta-tree.d.ts.map +1 -1
  30. package/dist/src/metadata/build-api-extractor-config.d.ts +6 -0
  31. package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -0
  32. package/dist/src/metadata/build-api-extractor-config.js.map +1 -0
  33. package/dist/src/metadata/build-changelog-file.d.ts +6 -0
  34. package/dist/src/metadata/build-changelog-file.d.ts.map +1 -0
  35. package/dist/src/metadata/build-changelog-file.js.map +1 -0
  36. package/dist/src/metadata/build-es-lint-config.d.ts +6 -0
  37. package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -0
  38. package/dist/src/metadata/build-es-lint-config.js.map +1 -0
  39. package/dist/src/metadata/build-license-file.d.ts.map +1 -0
  40. package/dist/src/metadata/build-license-file.js.map +1 -0
  41. package/dist/src/{rlc-common/metadata → metadata}/build-package-file.d.ts +3 -3
  42. package/dist/src/metadata/build-package-file.d.ts.map +1 -0
  43. package/dist/src/{rlc-common/metadata → metadata}/build-package-file.js +1 -1
  44. package/dist/src/metadata/build-package-file.js.map +1 -0
  45. package/dist/src/metadata/build-readme-file.d.ts +11 -0
  46. package/dist/src/metadata/build-readme-file.d.ts.map +1 -0
  47. package/dist/src/{rlc-common/metadata → metadata}/build-readme-file.js +16 -69
  48. package/dist/src/metadata/build-readme-file.js.map +1 -0
  49. package/dist/src/metadata/build-sample-env-file.d.ts +6 -0
  50. package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -0
  51. package/dist/src/metadata/build-sample-env-file.js.map +1 -0
  52. package/dist/src/{rlc-common/metadata → metadata}/build-test-config.d.ts +3 -3
  53. package/dist/src/metadata/build-test-config.d.ts.map +1 -0
  54. package/dist/src/metadata/build-test-config.js.map +1 -0
  55. package/dist/src/{rlc-common/metadata → metadata}/build-ts-config.d.ts +3 -3
  56. package/dist/src/metadata/build-ts-config.d.ts.map +1 -0
  57. package/dist/src/metadata/build-ts-config.js.map +1 -0
  58. package/dist/src/metadata/build-vitest-config.d.ts +6 -0
  59. package/dist/src/metadata/build-vitest-config.d.ts.map +1 -0
  60. package/dist/src/metadata/build-vitest-config.js.map +1 -0
  61. package/dist/src/{rlc-common/metadata → metadata}/build-warp-config.d.ts +2 -2
  62. package/dist/src/metadata/build-warp-config.d.ts.map +1 -0
  63. package/dist/src/metadata/build-warp-config.js.map +1 -0
  64. package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -0
  65. package/dist/src/metadata/package-json/azure-package-common.js.map +1 -0
  66. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -0
  67. package/dist/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.js +1 -1
  68. package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -0
  69. package/dist/src/metadata/package-json/package-common.d.ts.map +1 -0
  70. package/dist/src/metadata/package-json/package-common.js.map +1 -0
  71. package/dist/src/metadata/render-template.d.ts +24 -0
  72. package/dist/src/metadata/render-template.d.ts.map +1 -0
  73. package/dist/src/metadata/render-template.js +148 -0
  74. package/dist/src/metadata/render-template.js.map +1 -0
  75. package/dist/src/metadata/test/build-recorded-client.d.ts +6 -0
  76. package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -0
  77. package/dist/src/metadata/test/build-recorded-client.js +8 -0
  78. package/dist/src/metadata/test/build-recorded-client.js.map +1 -0
  79. package/dist/src/metadata/test/build-sample-test.d.ts +6 -0
  80. package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -0
  81. package/dist/src/metadata/test/build-sample-test.js +8 -0
  82. package/dist/src/metadata/test/build-sample-test.js.map +1 -0
  83. package/dist/src/metadata/test/build-snippets.d.ts +6 -0
  84. package/dist/src/metadata/test/build-snippets.d.ts.map +1 -0
  85. package/dist/src/{rlc-common → metadata}/test/build-snippets.js +3 -5
  86. package/dist/src/metadata/test/build-snippets.js.map +1 -0
  87. package/dist/src/metadata/test/template.d.ts +4 -0
  88. package/dist/src/metadata/test/template.d.ts.map +1 -0
  89. package/dist/src/metadata/test/template.js +100 -0
  90. package/dist/src/metadata/test/template.js.map +1 -0
  91. package/dist/src/metadata/utils.d.ts +3 -0
  92. package/dist/src/metadata/utils.d.ts.map +1 -0
  93. package/dist/src/metadata/utils.js.map +1 -0
  94. package/dist/src/modular/build-classical-client.d.ts.map +1 -1
  95. package/dist/src/modular/build-classical-client.js +13 -13
  96. package/dist/src/modular/build-classical-client.js.map +1 -1
  97. package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
  98. package/dist/src/modular/build-classical-operation-groups.js +3 -3
  99. package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
  100. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  101. package/dist/src/modular/build-client-context.js +7 -7
  102. package/dist/src/modular/build-client-context.js.map +1 -1
  103. package/dist/src/modular/build-modular-options.js +3 -3
  104. package/dist/src/modular/build-modular-options.js.map +1 -1
  105. package/dist/src/modular/build-operations.d.ts.map +1 -1
  106. package/dist/src/modular/build-operations.js +6 -6
  107. package/dist/src/modular/build-operations.js.map +1 -1
  108. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  109. package/dist/src/modular/build-project-files.js +4 -4
  110. package/dist/src/modular/build-project-files.js.map +1 -1
  111. package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
  112. package/dist/src/modular/build-restore-poller.js +3 -3
  113. package/dist/src/modular/build-restore-poller.js.map +1 -1
  114. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  115. package/dist/src/modular/build-root-index.js +42 -14
  116. package/dist/src/modular/build-root-index.js.map +1 -1
  117. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  118. package/dist/src/modular/build-subpath-index.js +17 -4
  119. package/dist/src/modular/build-subpath-index.js.map +1 -1
  120. package/dist/src/modular/emit-models-options.d.ts.map +1 -1
  121. package/dist/src/modular/emit-models-options.js +3 -3
  122. package/dist/src/modular/emit-models-options.js.map +1 -1
  123. package/dist/src/modular/emit-models.d.ts +1 -1
  124. package/dist/src/modular/emit-models.d.ts.map +1 -1
  125. package/dist/src/modular/emit-models.js +51 -30
  126. package/dist/src/modular/emit-models.js.map +1 -1
  127. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  128. package/dist/src/modular/emit-samples.js +97 -24
  129. package/dist/src/modular/emit-samples.js.map +1 -1
  130. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  131. package/dist/src/modular/emit-tests.js +1 -1
  132. package/dist/src/modular/emit-tests.js.map +1 -1
  133. package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
  134. package/dist/src/modular/helpers/classical-operation-helpers.js +11 -11
  135. package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
  136. package/dist/src/modular/helpers/client-helpers.d.ts +6 -1
  137. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  138. package/dist/src/modular/helpers/client-helpers.js +18 -14
  139. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  140. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  141. package/dist/src/modular/helpers/example-value-helpers.js +2 -2
  142. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  143. package/dist/src/modular/helpers/naming-helpers.d.ts +1 -1
  144. package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
  145. package/dist/src/modular/helpers/naming-helpers.js +2 -2
  146. package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
  147. package/dist/src/modular/helpers/operation-helpers.d.ts +4 -4
  148. package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
  149. package/dist/src/modular/helpers/operation-helpers.js +25 -26
  150. package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
  151. package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
  152. package/dist/src/modular/helpers/type-helpers.js +1 -1
  153. package/dist/src/modular/helpers/type-helpers.js.map +1 -1
  154. package/dist/src/modular/interfaces.d.ts +4 -4
  155. package/dist/src/modular/interfaces.d.ts.map +1 -1
  156. package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
  157. package/dist/src/modular/serialization/build-deserializer-function.js +2 -2
  158. package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
  159. package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
  160. package/dist/src/modular/serialization/build-serializer-function.js +2 -2
  161. package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
  162. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
  163. package/dist/src/modular/serialization/build-xml-serializer-function.js +1 -1
  164. package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
  165. package/dist/src/modular/serialization/serialize-utils.js +2 -2
  166. package/dist/src/modular/serialization/serialize-utils.js.map +1 -1
  167. package/dist/src/modular/type-expressions/get-enum-expression.js +1 -1
  168. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  169. package/dist/src/modular/type-expressions/get-nullable-expression.js +1 -1
  170. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  171. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  172. package/dist/src/modular/type-expressions/get-type-expression.js +3 -3
  173. package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
  174. package/dist/src/transform/transform-api-version-info.d.ts +1 -1
  175. package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
  176. package/dist/src/transform/transform-api-version-info.js +4 -3
  177. package/dist/src/transform/transform-api-version-info.js.map +1 -1
  178. package/dist/src/transform/{transfrom-rlc-options.d.ts → transform-client-options.d.ts} +3 -3
  179. package/dist/src/transform/transform-client-options.d.ts.map +1 -0
  180. package/dist/src/transform/{transfrom-rlc-options.js → transform-client-options.js} +9 -13
  181. package/dist/src/transform/transform-client-options.js.map +1 -0
  182. package/dist/src/transform/transform-helper-function-details.d.ts +1 -1
  183. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  184. package/dist/src/transform/transform-helper-function-details.js +4 -4
  185. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  186. package/dist/src/transform/transform-parameters.d.ts +1 -1
  187. package/dist/src/transform/transform-parameters.d.ts.map +1 -1
  188. package/dist/src/transform/transform-parameters.js +11 -11
  189. package/dist/src/transform/transform-parameters.js.map +1 -1
  190. package/dist/src/transform/transform-paths.d.ts +1 -1
  191. package/dist/src/transform/transform-paths.d.ts.map +1 -1
  192. package/dist/src/transform/transform-paths.js +5 -4
  193. package/dist/src/transform/transform-paths.js.map +1 -1
  194. package/dist/src/transform/transform-responses.d.ts +1 -1
  195. package/dist/src/transform/transform-responses.d.ts.map +1 -1
  196. package/dist/src/transform/transform-responses.js +19 -18
  197. package/dist/src/transform/transform-responses.js.map +1 -1
  198. package/dist/src/transform/transform-schemas.js +5 -5
  199. package/dist/src/transform/transform-schemas.js.map +1 -1
  200. package/dist/src/transform/transform-telemetry-info.d.ts +1 -1
  201. package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
  202. package/dist/src/transform/transform-telemetry-info.js +2 -2
  203. package/dist/src/transform/transform-telemetry-info.js.map +1 -1
  204. package/dist/src/transform/transform.d.ts +2 -2
  205. package/dist/src/transform/transform.d.ts.map +1 -1
  206. package/dist/src/transform/transform.js +9 -10
  207. package/dist/src/transform/transform.js.map +1 -1
  208. package/dist/src/utils/api-version-util.d.ts.map +1 -0
  209. package/dist/src/utils/api-version-util.js.map +1 -0
  210. package/dist/src/utils/client-utils.d.ts +5 -5
  211. package/dist/src/utils/client-utils.d.ts.map +1 -1
  212. package/dist/src/utils/client-utils.js +10 -10
  213. package/dist/src/utils/client-utils.js.map +1 -1
  214. package/dist/src/utils/cross-language-def.d.ts.map +1 -1
  215. package/dist/src/utils/cross-language-def.js +3 -3
  216. package/dist/src/utils/cross-language-def.js.map +1 -1
  217. package/dist/src/utils/emit-util.d.ts +2 -2
  218. package/dist/src/utils/emit-util.d.ts.map +1 -1
  219. package/dist/src/utils/emit-util.js +2 -2
  220. package/dist/src/utils/emit-util.js.map +1 -1
  221. package/dist/src/utils/imports-util.d.ts.map +1 -0
  222. package/dist/src/{rlc-common/helpers → utils}/imports-util.js +6 -6
  223. package/dist/src/utils/imports-util.js.map +1 -0
  224. package/dist/src/utils/interfaces.d.ts +3 -4
  225. package/dist/src/utils/interfaces.d.ts.map +1 -1
  226. package/dist/src/utils/model-utils.d.ts +1 -1
  227. package/dist/src/utils/model-utils.d.ts.map +1 -1
  228. package/dist/src/utils/model-utils.js +4 -2
  229. package/dist/src/utils/model-utils.js.map +1 -1
  230. package/dist/src/{rlc-common/helpers → utils}/name-constructors.d.ts +2 -2
  231. package/dist/src/utils/name-constructors.d.ts.map +1 -0
  232. package/dist/src/utils/name-constructors.js.map +1 -0
  233. package/dist/src/utils/name-utils.d.ts.map +1 -0
  234. package/dist/src/utils/name-utils.js.map +1 -0
  235. package/dist/src/utils/namespace-utils.js +4 -4
  236. package/dist/src/utils/namespace-utils.js.map +1 -1
  237. package/dist/src/utils/operation-helpers.d.ts +16 -0
  238. package/dist/src/utils/operation-helpers.d.ts.map +1 -0
  239. package/dist/src/utils/operation-helpers.js.map +1 -0
  240. package/dist/src/utils/operation-util.d.ts +2 -2
  241. package/dist/src/utils/operation-util.d.ts.map +1 -1
  242. package/dist/src/utils/operation-util.js +17 -18
  243. package/dist/src/utils/operation-util.js.map +1 -1
  244. package/dist/src/utils/parameter-utils.d.ts +1 -1
  245. package/dist/src/utils/parameter-utils.d.ts.map +1 -1
  246. package/dist/src/utils/parameter-utils.js +2 -4
  247. package/dist/src/utils/parameter-utils.js.map +1 -1
  248. package/dist/src/{rlc-common/helpers → utils}/schema-helpers.d.ts +2 -2
  249. package/dist/src/utils/schema-helpers.d.ts.map +1 -0
  250. package/dist/src/utils/schema-helpers.js.map +1 -0
  251. package/dist/src/utils/type-util.d.ts.map +1 -0
  252. package/dist/src/utils/type-util.js.map +1 -0
  253. package/dist/tsconfig.tsbuildinfo +1 -1
  254. package/package.json +41 -49
  255. package/src/context-manager.ts +25 -2
  256. package/src/framework/declaration.ts +8 -20
  257. package/src/framework/hooks/sdk-types.ts +18 -3
  258. package/src/framework/source-file-batch.ts +140 -0
  259. package/src/index.ts +92 -103
  260. package/src/{rlc-common/interfaces.ts → interfaces.ts} +14 -16
  261. package/src/lib.ts +43 -23
  262. package/src/meta-tree.ts +4 -4
  263. package/src/{rlc-common/metadata → metadata}/build-api-extractor-config.ts +2 -2
  264. package/src/{rlc-common/metadata → metadata}/build-changelog-file.ts +3 -3
  265. package/src/{rlc-common/metadata → metadata}/build-es-lint-config.ts +2 -2
  266. package/src/{rlc-common/metadata → metadata}/build-package-file.ts +6 -6
  267. package/src/{rlc-common/metadata → metadata}/build-readme-file.ts +25 -99
  268. package/src/{rlc-common/metadata → metadata}/build-sample-env-file.ts +2 -2
  269. package/src/{rlc-common/metadata → metadata}/build-test-config.ts +4 -4
  270. package/src/{rlc-common/metadata → metadata}/build-ts-config.ts +3 -3
  271. package/src/{rlc-common/metadata → metadata}/build-vitest-config.ts +2 -2
  272. package/src/{rlc-common/metadata → metadata}/build-warp-config.ts +2 -2
  273. package/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.ts +1 -1
  274. package/src/metadata/render-template.ts +202 -0
  275. package/src/metadata/test/build-recorded-client.ts +9 -0
  276. package/src/metadata/test/build-sample-test.ts +9 -0
  277. package/src/{rlc-common → metadata}/test/build-snippets.ts +5 -7
  278. package/src/metadata/test/template.ts +101 -0
  279. package/src/{rlc-common/metadata → metadata}/utils.ts +2 -2
  280. package/src/modular/build-classical-client.ts +13 -17
  281. package/src/modular/build-classical-operation-groups.ts +3 -3
  282. package/src/modular/build-client-context.ts +7 -7
  283. package/src/modular/build-modular-options.ts +3 -3
  284. package/src/modular/build-operations.ts +6 -6
  285. package/src/modular/build-project-files.ts +4 -5
  286. package/src/modular/build-restore-poller.ts +3 -3
  287. package/src/modular/build-root-index.ts +57 -19
  288. package/src/modular/build-subpath-index.ts +26 -5
  289. package/src/modular/emit-models-options.ts +3 -3
  290. package/src/modular/emit-models.ts +52 -31
  291. package/src/modular/emit-samples.ts +124 -43
  292. package/src/modular/emit-tests.ts +1 -1
  293. package/src/modular/helpers/classical-operation-helpers.ts +11 -11
  294. package/src/modular/helpers/client-helpers.ts +19 -16
  295. package/src/modular/helpers/example-value-helpers.ts +2 -2
  296. package/src/modular/helpers/naming-helpers.ts +2 -2
  297. package/src/modular/helpers/operation-helpers.ts +27 -27
  298. package/src/modular/helpers/type-helpers.ts +1 -1
  299. package/src/modular/interfaces.ts +4 -4
  300. package/src/modular/serialization/build-deserializer-function.ts +2 -2
  301. package/src/modular/serialization/build-serializer-function.ts +2 -2
  302. package/src/modular/serialization/build-xml-serializer-function.ts +1 -1
  303. package/src/modular/serialization/serialize-utils.ts +2 -2
  304. package/src/modular/type-expressions/get-enum-expression.ts +1 -1
  305. package/src/modular/type-expressions/get-nullable-expression.ts +1 -1
  306. package/src/modular/type-expressions/get-type-expression.ts +3 -3
  307. package/src/transform/transform-api-version-info.ts +4 -10
  308. package/src/transform/{transfrom-rlc-options.ts → transform-client-options.ts} +12 -22
  309. package/src/transform/transform-helper-function-details.ts +5 -5
  310. package/src/transform/transform-parameters.ts +12 -12
  311. package/src/transform/transform-paths.ts +5 -12
  312. package/src/transform/transform-responses.ts +19 -19
  313. package/src/transform/transform-schemas.ts +5 -5
  314. package/src/transform/transform-telemetry-info.ts +3 -3
  315. package/src/transform/transform.ts +13 -18
  316. package/src/utils/client-utils.ts +11 -11
  317. package/src/utils/cross-language-def.ts +3 -3
  318. package/src/utils/emit-util.ts +3 -3
  319. package/src/{rlc-common/helpers → utils}/imports-util.ts +6 -6
  320. package/src/utils/interfaces.ts +3 -4
  321. package/src/utils/model-utils.ts +7 -8
  322. package/src/{rlc-common/helpers → utils}/name-constructors.ts +2 -2
  323. package/src/utils/namespace-utils.ts +4 -4
  324. package/src/{rlc-common/helpers → utils}/operation-helpers.ts +12 -12
  325. package/src/utils/operation-util.ts +19 -33
  326. package/src/utils/parameter-utils.ts +2 -4
  327. package/src/{rlc-common/helpers → utils}/schema-helpers.ts +2 -2
  328. package/dist/src/rlc-common/helpers/api-version-util.d.ts.map +0 -1
  329. package/dist/src/rlc-common/helpers/api-version-util.js.map +0 -1
  330. package/dist/src/rlc-common/helpers/imports-util.d.ts.map +0 -1
  331. package/dist/src/rlc-common/helpers/imports-util.js.map +0 -1
  332. package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +0 -1
  333. package/dist/src/rlc-common/helpers/name-constructors.js.map +0 -1
  334. package/dist/src/rlc-common/helpers/name-utils.d.ts.map +0 -1
  335. package/dist/src/rlc-common/helpers/name-utils.js.map +0 -1
  336. package/dist/src/rlc-common/helpers/operation-helpers.d.ts +0 -16
  337. package/dist/src/rlc-common/helpers/operation-helpers.d.ts.map +0 -1
  338. package/dist/src/rlc-common/helpers/operation-helpers.js.map +0 -1
  339. package/dist/src/rlc-common/helpers/schema-helpers.d.ts.map +0 -1
  340. package/dist/src/rlc-common/helpers/schema-helpers.js.map +0 -1
  341. package/dist/src/rlc-common/helpers/type-util.d.ts.map +0 -1
  342. package/dist/src/rlc-common/helpers/type-util.js.map +0 -1
  343. package/dist/src/rlc-common/index.d.ts +0 -23
  344. package/dist/src/rlc-common/index.d.ts.map +0 -1
  345. package/dist/src/rlc-common/index.js +0 -25
  346. package/dist/src/rlc-common/index.js.map +0 -1
  347. package/dist/src/rlc-common/interfaces.d.ts.map +0 -1
  348. package/dist/src/rlc-common/interfaces.js.map +0 -1
  349. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +0 -6
  350. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +0 -1
  351. package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +0 -1
  352. package/dist/src/rlc-common/metadata/build-changelog-file.d.ts +0 -6
  353. package/dist/src/rlc-common/metadata/build-changelog-file.d.ts.map +0 -1
  354. package/dist/src/rlc-common/metadata/build-changelog-file.js.map +0 -1
  355. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +0 -6
  356. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +0 -1
  357. package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +0 -1
  358. package/dist/src/rlc-common/metadata/build-license-file.d.ts.map +0 -1
  359. package/dist/src/rlc-common/metadata/build-license-file.js.map +0 -1
  360. package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +0 -1
  361. package/dist/src/rlc-common/metadata/build-package-file.js.map +0 -1
  362. package/dist/src/rlc-common/metadata/build-readme-file.d.ts +0 -11
  363. package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +0 -1
  364. package/dist/src/rlc-common/metadata/build-readme-file.js.map +0 -1
  365. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts +0 -6
  366. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +0 -1
  367. package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +0 -1
  368. package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +0 -1
  369. package/dist/src/rlc-common/metadata/build-test-config.js.map +0 -1
  370. package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +0 -1
  371. package/dist/src/rlc-common/metadata/build-ts-config.js.map +0 -1
  372. package/dist/src/rlc-common/metadata/build-vitest-config.d.ts +0 -6
  373. package/dist/src/rlc-common/metadata/build-vitest-config.d.ts.map +0 -1
  374. package/dist/src/rlc-common/metadata/build-vitest-config.js.map +0 -1
  375. package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +0 -1
  376. package/dist/src/rlc-common/metadata/build-warp-config.js.map +0 -1
  377. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +0 -1
  378. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +0 -1
  379. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +0 -1
  380. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +0 -1
  381. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +0 -1
  382. package/dist/src/rlc-common/metadata/package-json/package-common.js.map +0 -1
  383. package/dist/src/rlc-common/metadata/utils.d.ts +0 -3
  384. package/dist/src/rlc-common/metadata/utils.d.ts.map +0 -1
  385. package/dist/src/rlc-common/metadata/utils.js.map +0 -1
  386. package/dist/src/rlc-common/static/paginate-content.d.ts +0 -2
  387. package/dist/src/rlc-common/static/paginate-content.d.ts.map +0 -1
  388. package/dist/src/rlc-common/static/paginate-content.js +0 -345
  389. package/dist/src/rlc-common/static/paginate-content.js.map +0 -1
  390. package/dist/src/rlc-common/static/polling-content.d.ts +0 -2
  391. package/dist/src/rlc-common/static/polling-content.d.ts.map +0 -1
  392. package/dist/src/rlc-common/static/polling-content.js +0 -225
  393. package/dist/src/rlc-common/static/polling-content.js.map +0 -1
  394. package/dist/src/rlc-common/static/sample-template.d.ts +0 -2
  395. package/dist/src/rlc-common/static/sample-template.d.ts.map +0 -1
  396. package/dist/src/rlc-common/static/sample-template.js +0 -56
  397. package/dist/src/rlc-common/static/sample-template.js.map +0 -1
  398. package/dist/src/rlc-common/static/serialize-helper.d.ts +0 -6
  399. package/dist/src/rlc-common/static/serialize-helper.d.ts.map +0 -1
  400. package/dist/src/rlc-common/static/serialize-helper.js +0 -31
  401. package/dist/src/rlc-common/static/serialize-helper.js.map +0 -1
  402. package/dist/src/rlc-common/test/build-karma-config.d.ts +0 -6
  403. package/dist/src/rlc-common/test/build-karma-config.d.ts.map +0 -1
  404. package/dist/src/rlc-common/test/build-karma-config.js +0 -11
  405. package/dist/src/rlc-common/test/build-karma-config.js.map +0 -1
  406. package/dist/src/rlc-common/test/build-recorded-client.d.ts +0 -6
  407. package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +0 -1
  408. package/dist/src/rlc-common/test/build-recorded-client.js +0 -14
  409. package/dist/src/rlc-common/test/build-recorded-client.js.map +0 -1
  410. package/dist/src/rlc-common/test/build-sample-test.d.ts +0 -6
  411. package/dist/src/rlc-common/test/build-sample-test.d.ts.map +0 -1
  412. package/dist/src/rlc-common/test/build-sample-test.js +0 -11
  413. package/dist/src/rlc-common/test/build-sample-test.js.map +0 -1
  414. package/dist/src/rlc-common/test/build-snippets.d.ts +0 -6
  415. package/dist/src/rlc-common/test/build-snippets.d.ts.map +0 -1
  416. package/dist/src/rlc-common/test/build-snippets.js.map +0 -1
  417. package/dist/src/rlc-common/test/template.d.ts +0 -5
  418. package/dist/src/rlc-common/test/template.d.ts.map +0 -1
  419. package/dist/src/rlc-common/test/template.js +0 -227
  420. package/dist/src/rlc-common/test/template.js.map +0 -1
  421. package/dist/src/transform/transfrom-rlc-options.d.ts.map +0 -1
  422. package/dist/src/transform/transfrom-rlc-options.js.map +0 -1
  423. package/src/rlc-common/index.ts +0 -25
  424. package/src/rlc-common/static/paginate-content.ts +0 -345
  425. package/src/rlc-common/static/polling-content.ts +0 -225
  426. package/src/rlc-common/static/sample-template.ts +0 -56
  427. package/src/rlc-common/static/serialize-helper.ts +0 -34
  428. package/src/rlc-common/test/build-karma-config.ts +0 -12
  429. package/src/rlc-common/test/build-recorded-client.ts +0 -15
  430. package/src/rlc-common/test/build-sample-test.ts +0 -12
  431. package/src/rlc-common/test/template.ts +0 -229
  432. /package/dist/src/{rlc-common/interfaces.js → interfaces.js} +0 -0
  433. /package/dist/src/{rlc-common/metadata → metadata}/build-api-extractor-config.js +0 -0
  434. /package/dist/src/{rlc-common/metadata → metadata}/build-changelog-file.js +0 -0
  435. /package/dist/src/{rlc-common/metadata → metadata}/build-es-lint-config.js +0 -0
  436. /package/dist/src/{rlc-common/metadata → metadata}/build-license-file.d.ts +0 -0
  437. /package/dist/src/{rlc-common/metadata → metadata}/build-license-file.js +0 -0
  438. /package/dist/src/{rlc-common/metadata → metadata}/build-sample-env-file.js +0 -0
  439. /package/dist/src/{rlc-common/metadata → metadata}/build-test-config.js +0 -0
  440. /package/dist/src/{rlc-common/metadata → metadata}/build-ts-config.js +0 -0
  441. /package/dist/src/{rlc-common/metadata → metadata}/build-vitest-config.js +0 -0
  442. /package/dist/src/{rlc-common/metadata → metadata}/build-warp-config.js +0 -0
  443. /package/dist/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.d.ts +0 -0
  444. /package/dist/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.js +0 -0
  445. /package/dist/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.d.ts +0 -0
  446. /package/dist/src/{rlc-common/metadata → metadata}/package-json/package-common.d.ts +0 -0
  447. /package/dist/src/{rlc-common/metadata → metadata}/package-json/package-common.js +0 -0
  448. /package/dist/src/{rlc-common/metadata → metadata}/utils.js +0 -0
  449. /package/dist/src/{rlc-common/helpers → utils}/api-version-util.d.ts +0 -0
  450. /package/dist/src/{rlc-common/helpers → utils}/api-version-util.js +0 -0
  451. /package/dist/src/{rlc-common/helpers → utils}/imports-util.d.ts +0 -0
  452. /package/dist/src/{rlc-common/helpers → utils}/name-constructors.js +0 -0
  453. /package/dist/src/{rlc-common/helpers → utils}/name-utils.d.ts +0 -0
  454. /package/dist/src/{rlc-common/helpers → utils}/name-utils.js +0 -0
  455. /package/dist/src/{rlc-common/helpers → utils}/operation-helpers.js +0 -0
  456. /package/dist/src/{rlc-common/helpers → utils}/schema-helpers.js +0 -0
  457. /package/dist/src/{rlc-common/helpers → utils}/type-util.d.ts +0 -0
  458. /package/dist/src/{rlc-common/helpers → utils}/type-util.js +0 -0
  459. /package/src/{rlc-common/metadata → metadata}/build-license-file.ts +0 -0
  460. /package/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.ts +0 -0
  461. /package/src/{rlc-common/metadata → metadata}/package-json/package-common.ts +0 -0
  462. /package/src/{rlc-common/helpers → utils}/api-version-util.ts +0 -0
  463. /package/src/{rlc-common/helpers → utils}/name-utils.ts +0 -0
  464. /package/src/{rlc-common/helpers → utils}/type-util.ts +0 -0
@@ -4,9 +4,9 @@ import { ModularEmitterOptions } from "./interfaces.js";
4
4
 
5
5
  import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
6
6
  import { useContext } from "../context-manager.js";
7
- import { NameType, normalizeName } from "../rlc-common/index.js";
8
- import { getModularClientOptions } from "../utils/client-utils.js";
7
+ import { getClientModuleInfo } from "../utils/client-utils.js";
9
8
  import { SdkContext } from "../utils/interfaces.js";
9
+ import { NameType, normalizeName } from "../utils/name-utils.js";
10
10
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
11
11
  import { buildOperationOptions } from "./build-operations.js";
12
12
 
@@ -20,7 +20,7 @@ export function buildApiOptions(
20
20
  const project = useContext("outputProject");
21
21
  const [_, client] = clientMap;
22
22
  const modelOptionsFiles = [];
23
- const { subfolder } = getModularClientOptions(clientMap);
23
+ const { subfolder } = getClientModuleInfo(clientMap);
24
24
  const methodMap = getMethodHierarchiesMap(context, client);
25
25
  for (const [prefixKey, operations] of methodMap) {
26
26
  const prefixes = prefixKey.split("/");
@@ -28,7 +28,6 @@ import {
28
28
  StructureKind,
29
29
  TypeAliasDeclarationStructure,
30
30
  } from "ts-morph";
31
- import { fixLeadingNumber, NameType, normalizeName } from "../rlc-common/index.js";
32
31
  // import { isKey } from "@typespec/compiler";
33
32
  import {
34
33
  getExternalModel,
@@ -44,13 +43,15 @@ import {
44
43
  emitQueue,
45
44
  flattenPropertyModelMap,
46
45
  getAllOperationsFromClient,
47
- pagedModelsUsedInNonPagingOps,
46
+ pagedModelsKeptPublic,
48
47
  } from "../framework/hooks/sdk-types.js";
49
48
  import { refkey } from "../framework/refkey.js";
49
+ import { beginSourceFileBatch, flushSourceFileBatch } from "../framework/source-file-batch.js";
50
50
  import { reportDiagnostic } from "../lib.js";
51
51
  import { getClientHierarchyMap } from "../utils/client-utils.js";
52
52
  import { SdkContext } from "../utils/interfaces.js";
53
53
  import { isAzureCoreErrorType } from "../utils/model-utils.js";
54
+ import { fixLeadingNumber, NameType, normalizeName } from "../utils/name-utils.js";
54
55
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
55
56
  import { getHeaderClientOptions } from "./helpers/client-option-helpers.js";
56
57
  import {
@@ -117,32 +118,37 @@ export function emitTypes(context: SdkContext, { sourceRoot }: { sourceRoot: str
117
118
 
118
119
  let sourceFile;
119
120
 
120
- for (const type of emitQueue) {
121
- if (!isGenerableType(type)) {
122
- continue;
123
- }
121
+ beginSourceFileBatch();
122
+ try {
123
+ for (const type of emitQueue) {
124
+ if (!isGenerableType(type)) {
125
+ continue;
126
+ }
124
127
 
125
- const namespaces = getModelNamespaces(context, type);
126
- const filepath = getModelsPath(sourceRoot, namespaces);
127
- sourceFile = outputProject.getSourceFile(filepath);
128
- if (!sourceFile) {
129
- sourceFile = outputProject.createSourceFile(filepath);
130
- sourceFile.addStatements(`/**
128
+ const namespaces = getModelNamespaces(context, type);
129
+ const filepath = getModelsPath(sourceRoot, namespaces);
130
+ sourceFile = outputProject.getSourceFile(filepath);
131
+ if (!sourceFile) {
132
+ sourceFile = outputProject.createSourceFile(filepath);
133
+ sourceFile.addStatements(`/*
131
134
  * This file contains only generated model types and their (de)serializers.
132
135
  * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.
133
136
  */
134
137
  /* eslint-disable @typescript-eslint/naming-convention */
135
138
  /* eslint-disable @typescript-eslint/explicit-module-boundary-types */`);
139
+ }
140
+ emitType(context, type, sourceFile);
136
141
  }
137
- emitType(context, type, sourceFile);
138
- }
139
142
 
140
- // Emit serialization/deserialization functions for flattened properties
141
- for (const [property, _] of flattenPropertyModelMap) {
142
- const namespaces = getModelNamespaces(context, property.type);
143
- const filepath = getModelsPath(sourceRoot, namespaces);
144
- sourceFile = outputProject.getSourceFile(filepath);
145
- addSerializationFunctions(context, property, sourceFile!);
143
+ // Emit serialization/deserialization functions for flattened properties
144
+ for (const [property, _] of flattenPropertyModelMap) {
145
+ const namespaces = getModelNamespaces(context, property.type);
146
+ const filepath = getModelsPath(sourceRoot, namespaces);
147
+ sourceFile = outputProject.getSourceFile(filepath);
148
+ addSerializationFunctions(context, property, sourceFile!);
149
+ }
150
+ } finally {
151
+ flushSourceFileBatch();
146
152
  }
147
153
 
148
154
  const modelFiles = outputProject.getSourceFiles(sourceRoot + "/models/**/*.ts");
@@ -245,7 +251,7 @@ function emitType(context: SdkContext, type: SdkType, sourceFile: SourceFile) {
245
251
  }
246
252
  const apiVersionEnumOnly = type.usage === UsageFlags.ApiVersionEnum;
247
253
  // Skip known api version enums for multi-service scenarios as users are not allowed to set api versions
248
- if (apiVersionEnumOnly && context.rlcOptions?.isMultiService) {
254
+ if (apiVersionEnumOnly && context.emitterOptions?.isMultiService) {
249
255
  return;
250
256
  }
251
257
  const inputUsage = (type.usage & UsageFlags.Input) === UsageFlags.Input;
@@ -290,7 +296,7 @@ function emitType(context: SdkContext, type: SdkType, sourceFile: SourceFile) {
290
296
 
291
297
  export function getApiVersionEnum(context: SdkContext) {
292
298
  // Skip api version enum for multi-service scenarios since each service may have different versions
293
- if (context.rlcOptions?.isMultiService) {
299
+ if (context.emitterOptions?.isMultiService) {
294
300
  return;
295
301
  }
296
302
  const apiVersionEnum = context.sdkPackage.enums.find(
@@ -325,7 +331,7 @@ export function getModelNamespaces(context: SdkContext, model: SdkType): string[
325
331
  }
326
332
  const segments = model.namespace.split(".");
327
333
  // Keep full namespace segments if multiple services are present because there isn't a root namespace to trim
328
- if (context.rlcOptions?.isMultiService) {
334
+ if (context.emitterOptions?.isMultiService) {
329
335
  return segments;
330
336
  }
331
337
 
@@ -603,7 +609,7 @@ function emitEnumMember(
603
609
  ): EnumMemberStructure {
604
610
  const shouldNormalizeName = !member.name.startsWith("$DO_NOT_NORMALIZE$");
605
611
  const enumTypeName = normalizeName(member.enumType.name, NameType.Interface, true);
606
- let normalizedMemberName = context.rlcOptions?.ignoreEnumMemberNameNormalize
612
+ let normalizedMemberName = context.emitterOptions?.ignoreEnumMemberNameNormalize
607
613
  ? fixLeadingNumber(member.name, NameType.EnumMemberName) // need to fix the leading number also for enum member
608
614
  : normalizeName(member.name, NameType.EnumMemberName, true);
609
615
  // If the member name starts with _ due to a leading digit (not because the original has _),
@@ -744,7 +750,7 @@ function addExtendedDictInfo(
744
750
  const additionalPropertiesType = model.additionalProperties
745
751
  ? getTypeExpression(context, model.additionalProperties)
746
752
  : undefined;
747
- if (context.rlcOptions?.compatibilityMode) {
753
+ if (context.emitterOptions?.compatibilityMode) {
748
754
  const ancestors = getAllAncestors(model);
749
755
  const properties = getAllProperties(context, model, ancestors);
750
756
  let anyType: boolean;
@@ -839,10 +845,9 @@ export function normalizeModelName(
839
845
  unionSuffix = "Union";
840
846
  }
841
847
  }
842
- const namespacePrefix = context.rlcOptions?.enableModelNamespace ? segments.join("") : "";
848
+ const namespacePrefix = context.emitterOptions?.enableModelNamespace ? segments.join("") : "";
843
849
  const internalModelPrefix =
844
- (isPagedResultModel(context, type) && !pagedModelsUsedInNonPagingOps.has(type)) ||
845
- type.isGeneratedName
850
+ (isPagedResultModel(context, type) && !pagedModelsKeptPublic.has(type)) || type.isGeneratedName
846
851
  ? "_"
847
852
  : "";
848
853
  return `${internalModelPrefix}${normalizeName(namespacePrefix + type.name, nameType, true)}${unionSuffix}`;
@@ -884,7 +889,7 @@ function buildModelProperty(
884
889
  ): PropertySignatureStructure {
885
890
  const normalizedPropName = normalizeModelPropertyName(context, property);
886
891
  if (
887
- !context.rlcOptions?.ignorePropertyNameNormalize &&
892
+ !context.emitterOptions?.ignorePropertyNameNormalize &&
888
893
  normalizedPropName !== `"${property.name}"`
889
894
  ) {
890
895
  reportDiagnostic(context.program, {
@@ -932,7 +937,7 @@ export function visitPackageTypes(context: SdkContext) {
932
937
  const { sdkPackage } = context;
933
938
  emitQueue.clear();
934
939
  flattenPropertyModelMap.clear();
935
- pagedModelsUsedInNonPagingOps.clear();
940
+ pagedModelsKeptPublic.clear();
936
941
  // Add all models in the package to the emit queue
937
942
  for (const model of sdkPackage.models) {
938
943
  visitType(context, model);
@@ -1015,7 +1020,19 @@ function trackPagedModelInNonPagingMethod(
1015
1020
  if (method.kind !== "basic" && method.kind !== "lro") return;
1016
1021
  const respType = method.response.type;
1017
1022
  if (respType && isPagedResultModel(context, respType)) {
1018
- pagedModelsUsedInNonPagingOps.add(respType);
1023
+ pagedModelsKeptPublic.add(respType);
1024
+ }
1025
+ }
1026
+
1027
+ /**
1028
+ * If a paged result model is used as a model property type, mark it so that
1029
+ * normalizeModelName keeps it public (no "_" prefix).
1030
+ */
1031
+ function trackPagedModelUsedAsProperty(context: SdkContext, type: SdkType): void {
1032
+ // Unwrap array types to check the element type
1033
+ const resolved = type.kind === "array" ? type.valueType : type;
1034
+ if (resolved && isPagedResultModel(context, resolved)) {
1035
+ pagedModelsKeptPublic.add(resolved);
1019
1036
  }
1020
1037
  }
1021
1038
 
@@ -1044,6 +1061,10 @@ function visitType(context: SdkContext, type: SdkType | undefined) {
1044
1061
  if (property.flatten && property.type.kind === "model") {
1045
1062
  flattenPropertyModelMap.set(property, type);
1046
1063
  }
1064
+ // If a paged result model is used as a model property (not as a paging
1065
+ // operation response), it must stay public (no "_" prefix) because users
1066
+ // interact with it directly through the property.
1067
+ trackPagedModelUsedAsProperty(context, property.type);
1047
1068
  }
1048
1069
  if (type.discriminatedSubtypes) {
1049
1070
  for (const subType of Object.values(type.discriminatedSubtypes)) {
@@ -14,10 +14,10 @@ import { useContext } from "../context-manager.js";
14
14
  import { resolveReference } from "../framework/reference.js";
15
15
  import { reportDiagnostic } from "../index.js";
16
16
  import { AzureIdentityDependencies } from "../modular/external-dependencies.js";
17
- import { NameType, normalizeName } from "../rlc-common/index.js";
18
- import { getSubscriptionId } from "../transform/transfrom-rlc-options.js";
17
+ import { getSubscriptionId } from "../transform/transform-client-options.js";
19
18
  import { hasKeyCredential, hasTokenCredential } from "../utils/credential-utils.js";
20
19
  import { SdkContext } from "../utils/interfaces.js";
20
+ import { NameType, normalizeName } from "../utils/name-utils.js";
21
21
  import {
22
22
  getMethodHierarchiesMap,
23
23
  isTenantLevelOperation,
@@ -115,9 +115,9 @@ function emitMethodSamples(
115
115
  });
116
116
  const exampleFunctions = [];
117
117
  // TODO: remove hard-coded for package
118
- if (dpgContext.rlcOptions?.packageDetails?.name) {
118
+ if (dpgContext.emitterOptions?.packageDetails?.name) {
119
119
  sourceFile.addImportDeclaration({
120
- moduleSpecifier: dpgContext.rlcOptions?.packageDetails?.name,
120
+ moduleSpecifier: dpgContext.emitterOptions?.packageDetails?.name,
121
121
  namedImports: [getClassicalClientName(options.topLevelClient)],
122
122
  });
123
123
  }
@@ -316,12 +316,36 @@ function prepareExampleParameters(
316
316
 
317
317
  let subscriptionIdValue = `"00000000-0000-0000-0000-000000000000"`;
318
318
  let isSubscriptionIdAdded = false;
319
- // required parameters
319
+
320
+ // Map each HTTP parameter to its method parameter via `methodParameterSegments`
321
+ // and place its example value at that path, yielding one argument per method
322
+ // parameter regardless of flat, nested, or grouped shape. Client- and
323
+ // body-carried roots are emitted by their own sections and skipped here.
324
+ const bodyParam = method.operation.bodyParam;
325
+ let bodyRootName: string | undefined;
326
+ if (
327
+ bodyParam &&
328
+ !isSpreadBodyParameter(bodyParam) &&
329
+ bodyParam.methodParameterSegments.length === 1 &&
330
+ bodyParam.methodParameterSegments[0] !== undefined &&
331
+ bodyParam.methodParameterSegments[0].length >= 1
332
+ ) {
333
+ bodyRootName = bodyParam.methodParameterSegments[0][0]!.name;
334
+ }
335
+
336
+ const methodArguments = new Map<
337
+ string,
338
+ { name: string; isOptional: boolean; value: ValueTreeNode | string }
339
+ >();
320
340
  for (const param of method.operation.parameters) {
321
- if (param.optional === true || param.type.kind === "constant" || param.clientDefaultValue) {
341
+ if (param.type.kind === "constant" || param.clientDefaultValue) {
322
342
  continue;
323
343
  }
324
-
344
+ const path = param.methodParameterSegments[0];
345
+ if (path === undefined || path.length === 0) {
346
+ continue;
347
+ }
348
+ const root = path[0]!;
325
349
  const exampleValue = parameterMap[param.serializedName];
326
350
 
327
351
  // Handle subscriptionId parameter separately for ARM clients
@@ -343,28 +367,27 @@ function prepareExampleParameters(
343
367
  continue;
344
368
  }
345
369
 
370
+ // Roots emitted by the client and body sections.
371
+ if (root.onClient || (bodyRootName !== undefined && root.name === bodyRootName)) {
372
+ continue;
373
+ }
374
+
346
375
  if (!exampleValue || !exampleValue.value) {
347
376
  // report diagnostic if required parameter is missing
348
- reportDiagnostic(dpgContext.program, {
349
- code: "required-sample-parameter",
350
- format: {
351
- exampleName: method.oriName ?? method.name,
352
- paramName: param.name,
353
- },
354
- target: NoTarget,
355
- });
377
+ if (path.length === 1 && !param.optional) {
378
+ reportDiagnostic(dpgContext.program, {
379
+ code: "required-sample-parameter",
380
+ format: {
381
+ exampleName: method.oriName ?? method.name,
382
+ paramName: param.name,
383
+ },
384
+ target: NoTarget,
385
+ });
386
+ }
356
387
  continue;
357
388
  }
358
389
 
359
- result.push(
360
- prepareExampleValue(
361
- dpgContext,
362
- exampleValue.parameter.name,
363
- exampleValue.value,
364
- param.optional,
365
- param.onClient,
366
- ),
367
- );
390
+ placeMethodArgument(methodArguments, path, getParameterValue(dpgContext, exampleValue.value));
368
391
  }
369
392
 
370
393
  // If client-level subscriptionId is needed on the client for this method, then add it
@@ -381,7 +404,6 @@ function prepareExampleParameters(
381
404
  }
382
405
 
383
406
  // required/optional body parameters
384
- const bodyParam = method.operation.bodyParam;
385
407
  const bodySerializeName = bodyParam?.serializedName;
386
408
  const bodyExample = parameterMap[bodySerializeName ?? ""];
387
409
  if (bodyParam && bodyExample && bodyExample.value) {
@@ -441,28 +463,87 @@ function prepareExampleParameters(
441
463
  }
442
464
  }
443
465
  }
444
- // optional parameters
445
- method.operation.parameters
446
- .filter(
447
- (param) =>
448
- param.optional === true && parameterMap[param.serializedName] && !param.clientDefaultValue,
449
- )
450
- .map((param) => parameterMap[param.serializedName]!)
451
- .forEach((param) => {
452
- result.push(
453
- prepareExampleValue(
454
- dpgContext,
455
- param.parameter.name,
456
- param.value,
457
- true,
458
- param.parameter.onClient,
459
- ),
460
- );
466
+ // Emit one argument per top-level method parameter. A normal parameter carries
467
+ // a scalar value; a parameter with nested leaves carries an object literal.
468
+ for (const arg of methodArguments.values()) {
469
+ result.push({
470
+ name: normalizeName(arg.name, NameType.Parameter, true),
471
+ value: serializeNestedValue(arg.value),
472
+ isOptional: arg.isOptional,
473
+ onClient: false,
461
474
  });
475
+ }
462
476
 
463
477
  return result;
464
478
  }
465
479
 
480
+ /** A nested value tree: leaves are TypeScript value expressions, interior nodes are objects. */
481
+ interface ValueTreeNode {
482
+ [key: string]: ValueTreeNode | string;
483
+ }
484
+
485
+ /**
486
+ * Records `leaf` for the method parameter addressed by `path`. `path[0]` is the
487
+ * top-level method parameter (the argument key); a single-segment path stores a
488
+ * scalar, a longer path stores the leaf inside a nested object merged with
489
+ * sibling leaves sharing the same root.
490
+ */
491
+ function placeMethodArgument(
492
+ methodArguments: Map<
493
+ string,
494
+ { name: string; isOptional: boolean; value: ValueTreeNode | string }
495
+ >,
496
+ path: readonly { name: string; optional?: boolean }[],
497
+ leaf: string,
498
+ ): void {
499
+ const root = path[0]!;
500
+ let arg = methodArguments.get(root.name);
501
+ if (!arg) {
502
+ arg = { name: root.name, isOptional: Boolean(root.optional), value: {} };
503
+ methodArguments.set(root.name, arg);
504
+ }
505
+ if (path.length === 1) {
506
+ arg.value = leaf;
507
+ return;
508
+ }
509
+ if (typeof arg.value !== "object") {
510
+ arg.value = {};
511
+ }
512
+ setNestedValue(arg.value, path.slice(1), leaf);
513
+ }
514
+
515
+ /** Places `leaf` at `path` (segments after the root), creating intermediate objects as needed. */
516
+ function setNestedValue(
517
+ root: ValueTreeNode,
518
+ path: readonly { name: string }[],
519
+ leaf: string,
520
+ ): void {
521
+ let node = root;
522
+ for (let i = 0; i < path.length; i++) {
523
+ const key = normalizeName(path[i]!.name, NameType.Property, true);
524
+ if (i === path.length - 1) {
525
+ node[key] = leaf;
526
+ } else {
527
+ const existing = node[key];
528
+ if (typeof existing !== "object" || existing === null) {
529
+ node[key] = {};
530
+ }
531
+ node = node[key] as ValueTreeNode;
532
+ }
533
+ }
534
+ }
535
+
536
+ /** Serializes a {@link ValueTreeNode} into a TypeScript object literal string. */
537
+ function serializeNestedValue(node: ValueTreeNode | string): string {
538
+ if (typeof node === "string") {
539
+ return node;
540
+ }
541
+ const entries = Object.entries(node).map(
542
+ ([key, value]) => `${key}: ${serializeNestedValue(value)}`,
543
+ );
544
+ return `{ ${entries.join(", ")} }`;
545
+ }
546
+
466
547
  function getCredentialExampleValue(
467
548
  _dpgContext: SdkContext,
468
549
  initialization: SdkClientInitializationType,
@@ -525,7 +606,7 @@ function getParameterValue(
525
606
  retValue = `${JSON.stringify(value.value)}`;
526
607
  break;
527
608
  case "null": {
528
- const ignoreNullableOnOptional = context.rlcOptions?.ignoreNullableOnOptional ?? false;
609
+ const ignoreNullableOnOptional = context.emitterOptions?.ignoreNullableOnOptional ?? false;
529
610
  if (ignoreNullableOnOptional) {
530
611
  // When ignore-nullable-on-optional is true, the TypeScript type won't include
531
612
  // | null for optional properties, so we convert null to a type-appropriate default
@@ -1,8 +1,8 @@
1
1
  import { type CompilerHost, joinPaths } from "@typespec/compiler";
2
2
  import { SourceFile } from "ts-morph";
3
3
  import { resolveReference } from "../framework/reference.js";
4
- import { NameType, normalizeName } from "../rlc-common/index.js";
5
4
  import { SdkContext } from "../utils/interfaces.js";
5
+ import { NameType, normalizeName } from "../utils/name-utils.js";
6
6
  import { ServiceOperation } from "../utils/operation-util.js";
7
7
  import { AzureTestDependencies } from "./external-dependencies.js";
8
8
  import {
@@ -10,9 +10,9 @@ import {
10
10
  import { addDeclaration } from "../../framework/declaration.js";
11
11
  import { resolveReference } from "../../framework/reference.js";
12
12
  import { refkey } from "../../framework/refkey.js";
13
- import { NameType, normalizeName } from "../../rlc-common/index.js";
14
- import { getModularClientOptions } from "../../utils/client-utils.js";
13
+ import { getClientModuleInfo } from "../../utils/client-utils.js";
15
14
  import { SdkContext } from "../../utils/interfaces.js";
15
+ import { NameType, normalizeName } from "../../utils/name-utils.js";
16
16
  import { ServiceOperation } from "../../utils/operation-util.js";
17
17
  import { AzurePollingDependencies } from "../external-dependencies.js";
18
18
  import { PagingHelpers, SimplePollerHelpers } from "../static-helpers-metadata.js";
@@ -55,18 +55,18 @@ export function getClassicalOperation(
55
55
  ) {
56
56
  const prefixes = operationGroup[0];
57
57
  const operations = operationGroup[1];
58
- const { rlcClientName } = getModularClientOptions(clientMap);
58
+ const { clientName } = getClientModuleInfo(clientMap);
59
59
  const hasClientContextImport = classicFile.getImportDeclarations().filter((i) => {
60
60
  return (
61
61
  i.getModuleSpecifierValue() ===
62
- `${"../".repeat(layer + 2)}api/${normalizeName(rlcClientName, NameType.File)}.js`
62
+ `${"../".repeat(layer + 2)}api/${normalizeName(clientName, NameType.File)}.js`
63
63
  );
64
64
  });
65
65
  if (!hasClientContextImport || hasClientContextImport.length === 0) {
66
66
  classicFile.addImportDeclaration({
67
- namedImports: [rlcClientName],
67
+ namedImports: [clientName],
68
68
  moduleSpecifier: `${"../".repeat(layer + 2)}api/${normalizeName(
69
- rlcClientName,
69
+ clientName,
70
70
  NameType.File,
71
71
  )}.js`,
72
72
  });
@@ -78,7 +78,7 @@ export function getClassicalOperation(
78
78
  >();
79
79
  const operationDeclarations: OptionalKind<FunctionDeclarationStructure>[] = operations.map(
80
80
  (operation) => {
81
- const declaration = getOperationFunction(dpgContext, [prefixes, operation], rlcClientName);
81
+ const declaration = getOperationFunction(dpgContext, [prefixes, operation], clientName);
82
82
  operationDeclarationMap.set(declaration, {
83
83
  declaration,
84
84
  oriName: operation.oriName,
@@ -141,7 +141,7 @@ export function getClassicalOperation(
141
141
  });
142
142
  // add LRO helper methods if applicable
143
143
  if (
144
- dpgContext.rlcOptions?.compatibilityLro &&
144
+ dpgContext.emitterOptions?.compatibilityLro &&
145
145
  (operationInfo?.isLro || operationInfo?.isLroPaging)
146
146
  ) {
147
147
  const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
@@ -207,7 +207,7 @@ export function getClassicalOperation(
207
207
  parameters: [
208
208
  {
209
209
  name: "context",
210
- type: rlcClientName,
210
+ type: clientName,
211
211
  },
212
212
  ],
213
213
  statements: `return {
@@ -237,7 +237,7 @@ export function getClassicalOperation(
237
237
  ];
238
238
  // add LRO helper methods if applicable
239
239
  if (
240
- dpgContext.rlcOptions?.compatibilityLro &&
240
+ dpgContext.emitterOptions?.compatibilityLro &&
241
241
  (operationInfo?.isLro || operationInfo?.isLroPaging)
242
242
  ) {
243
243
  const getSimplePollerReference = resolveReference(
@@ -336,7 +336,7 @@ export function getClassicalOperation(
336
336
  parameters: [
337
337
  {
338
338
  name: "context",
339
- type: rlcClientName,
339
+ type: clientName,
340
340
  },
341
341
  ],
342
342
  returnType: resolveReference(refkey(interfaceName, layer, "classicOperations")),
@@ -10,8 +10,8 @@ import { OptionalKind, ParameterDeclarationStructure, StatementedNode } from "ts
10
10
  import { ModularEmitterOptions } from "../interfaces.js";
11
11
 
12
12
  import { resolveReference } from "../../framework/reference.js";
13
- import { NameType, normalizeName } from "../../rlc-common/index.js";
14
13
  import { SdkContext } from "../../utils/interfaces.js";
14
+ import { NameType, normalizeName } from "../../utils/name-utils.js";
15
15
  import { CloudSettingHelpers } from "../static-helpers-metadata.js";
16
16
  import { getTypeExpression } from "../type-expressions/get-type-expression.js";
17
17
  import { getClassicalClientName } from "./naming-helpers.js";
@@ -87,10 +87,10 @@ export function getClientParameters(
87
87
  const armSpecific = (p: SdkParameter) => !(p.kind === "endpoint" && dpgContext.arm);
88
88
  // Skip apiVersion parameter when it's multi-service (each service has its own default apiVersion)
89
89
  const skipApiVersionOnMultiService = (p: SdkParameter) =>
90
- !(dpgContext.rlcOptions?.isMultiService && p.isApiVersionParam);
90
+ !(dpgContext.emitterOptions?.isMultiService && p.isApiVersionParam);
91
91
  const filters = [
92
92
  options.requiredOnly ? isRequired : undefined,
93
- dpgContext.rlcOptions?.addCredentials === false ? skipCredentials : undefined,
93
+ dpgContext.emitterOptions?.addCredentials === false ? skipCredentials : undefined,
94
94
  options.optionalOnly ? isOptional : undefined,
95
95
  options.onClientOnly ? skipMethodParam : undefined,
96
96
  options.skipArmSpecific ? undefined : armSpecific,
@@ -241,7 +241,7 @@ export function buildGetClientOptionsParam(
241
241
  endpointParam: string,
242
242
  apiVersionParamName?: string,
243
243
  ): string {
244
- const userAgentOptions = buildUserAgentOptions(context, emitterOptions, "azsdk-js-api");
244
+ const userAgentOptions = buildUserAgentOptions(context, emitterOptions);
245
245
  const loggingOptions = buildLoggingOptions();
246
246
  const credentials = buildCredentials(emitterOptions, endpointParam);
247
247
 
@@ -313,10 +313,14 @@ function buildLoggingOptions(): string | undefined {
313
313
  return `{ logger: options.loggingOptions?.logger ?? logger.info }`;
314
314
  }
315
315
 
316
+ /**
317
+ * Builds the `userAgentOptions` for the generated client, producing a telemetry
318
+ * prefix of the form `[<application_id> ]azsdk-js-<package>/<version>` per the Azure
319
+ * Core telemetry policy: https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy
320
+ */
316
321
  export function buildUserAgentOptions(
317
322
  context: StatementedNode,
318
323
  emitterOptions: ModularEmitterOptions,
319
- sdkUserAgentPrefix: string,
320
324
  ): string {
321
325
  const userAgentStatements = [];
322
326
  const prefixFromOptions = "const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;";
@@ -329,21 +333,20 @@ export function buildUserAgentOptions(
329
333
  const packageVersion = emitterOptions.options.packageDetails?.version ?? "";
330
334
 
331
335
  const userAgentInfoStatement =
332
- packageVersion && clientPackageName && sdkUserAgentPrefix.includes("api")
336
+ packageVersion && clientPackageName
333
337
  ? "const userAgentInfo = `azsdk-js-" + clientPackageName + "/" + packageVersion + "`;"
334
338
  : "";
335
339
 
336
- if (userAgentInfoStatement) {
337
- userAgentStatements.push(userAgentInfoStatement);
340
+ if (!userAgentInfoStatement) {
341
+ // Without package name/version we cannot build a meaningful telemetry token,
342
+ // so we leave the user agent untouched (the caller's userAgentOptions still flow
343
+ // through `...options`) and let core-rest-pipeline defaults apply.
344
+ return "";
338
345
  }
339
- const userAgentPrefix = `const userAgentPrefix = ${
340
- "prefixFromOptions ? `${prefixFromOptions} " +
341
- sdkUserAgentPrefix +
342
- `${userAgentInfoStatement ? " ${userAgentInfo}" : ""}` +
343
- "` : `" +
344
- `${sdkUserAgentPrefix}` +
345
- `${userAgentInfoStatement ? " ${userAgentInfo}`" : "`"}`
346
- };`;
346
+
347
+ userAgentStatements.push(userAgentInfoStatement);
348
+ const userAgentPrefix =
349
+ "const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} ${userAgentInfo}` : `${userAgentInfo}`;";
347
350
  userAgentStatements.push(userAgentPrefix);
348
351
 
349
352
  context.addStatements(userAgentStatements.join("\n"));
@@ -12,10 +12,10 @@ import { joinPaths } from "@typespec/compiler";
12
12
  import { SourceFile } from "ts-morph";
13
13
  import { useContext } from "../../context-manager.js";
14
14
  import { resolveReference } from "../../framework/reference.js";
15
- import { NameType, normalizeName } from "../../rlc-common/index.js";
16
- import { getSubscriptionId } from "../../transform/transfrom-rlc-options.js";
15
+ import { getSubscriptionId } from "../../transform/transform-client-options.js";
17
16
  import { hasKeyCredential, hasTokenCredential } from "../../utils/credential-utils.js";
18
17
  import { SdkContext } from "../../utils/interfaces.js";
18
+ import { NameType, normalizeName } from "../../utils/name-utils.js";
19
19
  import { getMethodHierarchiesMap, ServiceOperation } from "../../utils/operation-util.js";
20
20
  import { AzureIdentityDependencies, AzureTestDependencies } from "../external-dependencies.js";
21
21
  import { getClientParametersDeclaration } from "./client-helpers.js";
@@ -1,6 +1,6 @@
1
1
  import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
2
- import { NameType, normalizeName, ReservedModelNames } from "../../rlc-common/index.js";
3
2
  import { SdkContext } from "../../utils/interfaces.js";
3
+ import { NameType, normalizeName, ReservedModelNames } from "../../utils/name-utils.js";
4
4
  import { ServiceOperation } from "../../utils/operation-util.js";
5
5
 
6
6
  export function getClientName(client: SdkClientType<SdkServiceOperation>): string {
@@ -21,7 +21,7 @@ export function getOperationName(
21
21
  dpgContext?: SdkContext,
22
22
  ): GuardedName {
23
23
  const norm = normalizeName(operation.name, NameType.Method, true);
24
- const isDataplane = dpgContext !== undefined && !dpgContext.rlcOptions?.azureArm;
24
+ const isDataplane = dpgContext !== undefined && !dpgContext.emitterOptions?.azureArm;
25
25
  if (isReservedName(operation.name, NameType.Method) && isDataplane) {
26
26
  return {
27
27
  name: norm,