@azure-tools/typespec-ts 0.56.0-dev.9 → 0.56.1-dev.0

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 (377) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +31 -15
  3. package/dist/src/context-manager.d.ts +23 -6
  4. package/dist/src/context-manager.d.ts.map +1 -1
  5. package/dist/src/context-manager.js +22 -0
  6. package/dist/src/context-manager.js.map +1 -1
  7. package/dist/src/framework/declaration.d.ts +1 -1
  8. package/dist/src/framework/declaration.d.ts.map +1 -1
  9. package/dist/src/framework/declaration.js +2 -1
  10. package/dist/src/framework/declaration.js.map +1 -1
  11. package/dist/src/framework/hooks/binder.d.ts +2 -5
  12. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  13. package/dist/src/framework/hooks/binder.js +2 -29
  14. package/dist/src/framework/hooks/binder.js.map +1 -1
  15. package/dist/src/framework/hooks/sdk-types.d.ts +12 -3
  16. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  17. package/dist/src/framework/hooks/sdk-types.js +13 -0
  18. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  19. package/dist/src/framework/hooks/use-dependencies.d.ts +1 -1
  20. package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -1
  21. package/dist/src/framework/load-static-helpers.d.ts +2 -2
  22. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  23. package/dist/src/framework/load-static-helpers.js +1 -13
  24. package/dist/src/framework/load-static-helpers.js.map +1 -1
  25. package/dist/src/framework/reference.js.map +1 -1
  26. package/dist/src/framework/source-file-batch.d.ts +1 -1
  27. package/dist/src/framework/source-file-batch.d.ts.map +1 -1
  28. package/dist/src/framework/source-file-batch.js +1 -1
  29. package/dist/src/framework/source-file-batch.js.map +1 -1
  30. package/dist/src/index.d.ts +4 -4
  31. package/dist/src/index.d.ts.map +1 -1
  32. package/dist/src/index.js +24 -19
  33. package/dist/src/index.js.map +1 -1
  34. package/dist/src/interfaces.d.ts +0 -1
  35. package/dist/src/interfaces.d.ts.map +1 -1
  36. package/dist/src/lib.d.ts +18 -4
  37. package/dist/src/lib.d.ts.map +1 -1
  38. package/dist/src/lib.js +22 -6
  39. package/dist/src/lib.js.map +1 -1
  40. package/dist/src/meta-tree.d.ts +2 -2
  41. package/dist/src/meta-tree.d.ts.map +1 -1
  42. package/dist/src/metadata/build-api-extractor-config.d.ts +1 -1
  43. package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -1
  44. package/dist/src/metadata/build-changelog-file.d.ts +1 -1
  45. package/dist/src/metadata/build-changelog-file.d.ts.map +1 -1
  46. package/dist/src/metadata/build-es-lint-config.d.ts +1 -1
  47. package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -1
  48. package/dist/src/metadata/build-package-file.d.ts +3 -5
  49. package/dist/src/metadata/build-package-file.d.ts.map +1 -1
  50. package/dist/src/metadata/build-package-file.js +10 -45
  51. package/dist/src/metadata/build-package-file.js.map +1 -1
  52. package/dist/src/metadata/build-readme-file.d.ts +1 -1
  53. package/dist/src/metadata/build-readme-file.d.ts.map +1 -1
  54. package/dist/src/metadata/build-readme-file.js +3 -3
  55. package/dist/src/metadata/build-readme-file.js.map +1 -1
  56. package/dist/src/metadata/build-sample-env-file.d.ts +1 -1
  57. package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -1
  58. package/dist/src/metadata/build-test-config.d.ts +1 -1
  59. package/dist/src/metadata/build-test-config.d.ts.map +1 -1
  60. package/dist/src/metadata/build-ts-config.d.ts +11 -5
  61. package/dist/src/metadata/build-ts-config.d.ts.map +1 -1
  62. package/dist/src/metadata/build-ts-config.js +36 -8
  63. package/dist/src/metadata/build-ts-config.js.map +1 -1
  64. package/dist/src/metadata/build-vitest-config.d.ts +1 -1
  65. package/dist/src/metadata/build-vitest-config.d.ts.map +1 -1
  66. package/dist/src/metadata/build-warp-config.d.ts +1 -3
  67. package/dist/src/metadata/build-warp-config.d.ts.map +1 -1
  68. package/dist/src/metadata/build-warp-config.js +0 -2
  69. package/dist/src/metadata/build-warp-config.js.map +1 -1
  70. package/dist/src/metadata/package-json/azure-package-common.d.ts +1 -1
  71. package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -1
  72. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts +1 -2
  73. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  74. package/dist/src/metadata/package-json/build-azure-monorepo-package.js +2 -16
  75. package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  76. package/dist/src/metadata/package-json/package-common.d.ts.map +1 -1
  77. package/dist/src/metadata/package-json/package-common.js +0 -15
  78. package/dist/src/metadata/package-json/package-common.js.map +1 -1
  79. package/dist/src/metadata/test/build-recorded-client.d.ts +1 -1
  80. package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -1
  81. package/dist/src/metadata/test/build-sample-test.d.ts +1 -1
  82. package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -1
  83. package/dist/src/metadata/test/build-snippets.d.ts +1 -1
  84. package/dist/src/metadata/test/build-snippets.d.ts.map +1 -1
  85. package/dist/src/metadata/utils.d.ts +1 -1
  86. package/dist/src/metadata/utils.d.ts.map +1 -1
  87. package/dist/src/modular/build-classical-client.d.ts +3 -3
  88. package/dist/src/modular/build-classical-client.d.ts.map +1 -1
  89. package/dist/src/modular/build-classical-client.js +3 -3
  90. package/dist/src/modular/build-classical-client.js.map +1 -1
  91. package/dist/src/modular/build-classical-operation-groups.d.ts +3 -3
  92. package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
  93. package/dist/src/modular/build-classical-operation-groups.js +1 -0
  94. package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
  95. package/dist/src/modular/build-client-context.d.ts +3 -3
  96. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  97. package/dist/src/modular/build-client-context.js +1 -0
  98. package/dist/src/modular/build-client-context.js.map +1 -1
  99. package/dist/src/modular/build-modular-options.d.ts +2 -2
  100. package/dist/src/modular/build-modular-options.d.ts.map +1 -1
  101. package/dist/src/modular/build-operations.d.ts +5 -5
  102. package/dist/src/modular/build-operations.d.ts.map +1 -1
  103. package/dist/src/modular/build-operations.js +7 -4
  104. package/dist/src/modular/build-operations.js.map +1 -1
  105. package/dist/src/modular/build-project-files.d.ts +2 -2
  106. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  107. package/dist/src/modular/build-restore-poller.d.ts +3 -3
  108. package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
  109. package/dist/src/modular/build-restore-poller.js +1 -0
  110. package/dist/src/modular/build-restore-poller.js.map +1 -1
  111. package/dist/src/modular/build-root-index.d.ts +3 -3
  112. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  113. package/dist/src/modular/build-root-index.js +4 -3
  114. package/dist/src/modular/build-root-index.js.map +1 -1
  115. package/dist/src/modular/build-subpath-index.d.ts +2 -2
  116. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  117. package/dist/src/modular/build-subpath-index.js +1 -1
  118. package/dist/src/modular/build-subpath-index.js.map +1 -1
  119. package/dist/src/modular/emit-logger-file.d.ts +1 -1
  120. package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
  121. package/dist/src/modular/emit-models-options.d.ts +3 -3
  122. package/dist/src/modular/emit-models-options.d.ts.map +1 -1
  123. package/dist/src/modular/emit-models-options.js.map +1 -1
  124. package/dist/src/modular/emit-models.d.ts +3 -3
  125. package/dist/src/modular/emit-models.d.ts.map +1 -1
  126. package/dist/src/modular/emit-models.js +1 -1
  127. package/dist/src/modular/emit-models.js.map +1 -1
  128. package/dist/src/modular/emit-samples.d.ts +1 -1
  129. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  130. package/dist/src/modular/emit-samples.js +1 -1
  131. package/dist/src/modular/emit-samples.js.map +1 -1
  132. package/dist/src/modular/emit-tests.d.ts +1 -1
  133. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  134. package/dist/src/modular/emit-tests.js +1 -0
  135. package/dist/src/modular/emit-tests.js.map +1 -1
  136. package/dist/src/modular/external-dependencies.d.ts +1 -1
  137. package/dist/src/modular/external-dependencies.d.ts.map +1 -1
  138. package/dist/src/modular/external-dependencies.js +10 -0
  139. package/dist/src/modular/external-dependencies.js.map +1 -1
  140. package/dist/src/modular/helpers/classical-operation-helpers.d.ts +3 -3
  141. package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
  142. package/dist/src/modular/helpers/classical-operation-helpers.js +1 -1
  143. package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
  144. package/dist/src/modular/helpers/client-helpers.d.ts +11 -6
  145. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  146. package/dist/src/modular/helpers/client-helpers.js +38 -17
  147. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  148. package/dist/src/modular/helpers/client-option-helpers.d.ts +1 -1
  149. package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -1
  150. package/dist/src/modular/helpers/example-value-helpers.d.ts +3 -3
  151. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  152. package/dist/src/modular/helpers/example-value-helpers.js +1 -0
  153. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  154. package/dist/src/modular/helpers/naming-helpers.d.ts +7 -4
  155. package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
  156. package/dist/src/modular/helpers/naming-helpers.js +44 -5
  157. package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
  158. package/dist/src/modular/helpers/operation-helpers.d.ts +7 -7
  159. package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
  160. package/dist/src/modular/helpers/operation-helpers.js +32 -30
  161. package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
  162. package/dist/src/modular/helpers/type-helpers.d.ts +3 -3
  163. package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
  164. package/dist/src/modular/interfaces.d.ts +1 -1
  165. package/dist/src/modular/interfaces.d.ts.map +1 -1
  166. package/dist/src/modular/serialization/build-deserializer-function.d.ts +4 -4
  167. package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
  168. package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
  169. package/dist/src/modular/serialization/build-serializer-function.d.ts +4 -4
  170. package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
  171. package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
  172. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +4 -4
  173. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
  174. package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
  175. package/dist/src/modular/serialization/serialize-utils.d.ts +1 -1
  176. package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -1
  177. package/dist/src/modular/static-helpers-metadata.d.ts +0 -12
  178. package/dist/src/modular/static-helpers-metadata.d.ts.map +1 -1
  179. package/dist/src/modular/static-helpers-metadata.js +0 -12
  180. package/dist/src/modular/static-helpers-metadata.js.map +1 -1
  181. package/dist/src/modular/type-expressions/get-credential-expression.d.ts +1 -1
  182. package/dist/src/modular/type-expressions/get-credential-expression.d.ts.map +1 -1
  183. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +3 -3
  184. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  185. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  186. package/dist/src/modular/type-expressions/get-model-expression.d.ts +3 -3
  187. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  188. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +3 -3
  189. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  190. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  191. package/dist/src/modular/type-expressions/get-type-expression.d.ts +2 -2
  192. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  193. package/dist/src/modular/type-expressions/get-union-expression.d.ts +3 -3
  194. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  195. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  196. package/dist/src/modular/type-expressions/utils.d.ts +1 -1
  197. package/dist/src/modular/type-expressions/utils.d.ts.map +1 -1
  198. package/dist/src/transform/transform-api-version-info.d.ts +3 -3
  199. package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
  200. package/dist/src/transform/transform-api-version-info.js +1 -1
  201. package/dist/src/transform/transform-api-version-info.js.map +1 -1
  202. package/dist/src/transform/transform-client-options.d.ts +4 -4
  203. package/dist/src/transform/transform-client-options.d.ts.map +1 -1
  204. package/dist/src/transform/transform-client-options.js +1 -3
  205. package/dist/src/transform/transform-client-options.js.map +1 -1
  206. package/dist/src/transform/transform-helper-function-details.d.ts +3 -3
  207. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  208. package/dist/src/transform/transform-helper-function-details.js +1 -1
  209. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  210. package/dist/src/transform/transform-parameters.d.ts +4 -4
  211. package/dist/src/transform/transform-parameters.d.ts.map +1 -1
  212. package/dist/src/transform/transform-parameters.js.map +1 -1
  213. package/dist/src/transform/transform-paths.d.ts +3 -3
  214. package/dist/src/transform/transform-paths.d.ts.map +1 -1
  215. package/dist/src/transform/transform-paths.js +1 -1
  216. package/dist/src/transform/transform-paths.js.map +1 -1
  217. package/dist/src/transform/transform-responses.d.ts +3 -3
  218. package/dist/src/transform/transform-responses.d.ts.map +1 -1
  219. package/dist/src/transform/transform-responses.js +1 -1
  220. package/dist/src/transform/transform-responses.js.map +1 -1
  221. package/dist/src/transform/transform-schemas.d.ts +2 -2
  222. package/dist/src/transform/transform-schemas.d.ts.map +1 -1
  223. package/dist/src/transform/transform-schemas.js +2 -2
  224. package/dist/src/transform/transform-schemas.js.map +1 -1
  225. package/dist/src/transform/transform-telemetry-info.d.ts +2 -2
  226. package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
  227. package/dist/src/transform/transform.d.ts +3 -3
  228. package/dist/src/transform/transform.d.ts.map +1 -1
  229. package/dist/src/utils/api-version-util.d.ts +1 -1
  230. package/dist/src/utils/api-version-util.d.ts.map +1 -1
  231. package/dist/src/utils/client-utils.d.ts +4 -4
  232. package/dist/src/utils/client-utils.d.ts.map +1 -1
  233. package/dist/src/utils/credential-utils.d.ts +3 -3
  234. package/dist/src/utils/credential-utils.d.ts.map +1 -1
  235. package/dist/src/utils/credential-utils.js.map +1 -1
  236. package/dist/src/utils/cross-language-def.d.ts +1 -1
  237. package/dist/src/utils/cross-language-def.d.ts.map +1 -1
  238. package/dist/src/utils/emit-util.d.ts +2 -2
  239. package/dist/src/utils/emit-util.d.ts.map +1 -1
  240. package/dist/src/utils/emit-util.js +2 -2
  241. package/dist/src/utils/emit-util.js.map +1 -1
  242. package/dist/src/utils/file-system-utils.d.ts +1 -1
  243. package/dist/src/utils/file-system-utils.d.ts.map +1 -1
  244. package/dist/src/utils/file-system-utils.js.map +1 -1
  245. package/dist/src/utils/import-helper.js +1 -0
  246. package/dist/src/utils/import-helper.js.map +1 -1
  247. package/dist/src/utils/imports-util.d.ts +1 -1
  248. package/dist/src/utils/imports-util.d.ts.map +1 -1
  249. package/dist/src/utils/imports-util.js +2 -1
  250. package/dist/src/utils/imports-util.js.map +1 -1
  251. package/dist/src/utils/interfaces.d.ts +3 -3
  252. package/dist/src/utils/interfaces.d.ts.map +1 -1
  253. package/dist/src/utils/interfaces.js +2 -1
  254. package/dist/src/utils/interfaces.js.map +1 -1
  255. package/dist/src/utils/model-utils.d.ts +4 -4
  256. package/dist/src/utils/model-utils.d.ts.map +1 -1
  257. package/dist/src/utils/name-constructors.d.ts +1 -1
  258. package/dist/src/utils/name-constructors.d.ts.map +1 -1
  259. package/dist/src/utils/namespace-utils.d.ts +2 -2
  260. package/dist/src/utils/namespace-utils.d.ts.map +1 -1
  261. package/dist/src/utils/namespace-utils.js +1 -1
  262. package/dist/src/utils/namespace-utils.js.map +1 -1
  263. package/dist/src/utils/operation-helpers.d.ts +2 -2
  264. package/dist/src/utils/operation-helpers.d.ts.map +1 -1
  265. package/dist/src/utils/operation-helpers.js.map +1 -1
  266. package/dist/src/utils/operation-util.d.ts +5 -5
  267. package/dist/src/utils/operation-util.d.ts.map +1 -1
  268. package/dist/src/utils/operation-util.js +1 -1
  269. package/dist/src/utils/operation-util.js.map +1 -1
  270. package/dist/src/utils/parameter-utils.d.ts +3 -3
  271. package/dist/src/utils/parameter-utils.d.ts.map +1 -1
  272. package/dist/src/utils/parameter-utils.js.map +1 -1
  273. package/dist/src/utils/schema-helpers.d.ts +1 -1
  274. package/dist/src/utils/schema-helpers.d.ts.map +1 -1
  275. package/dist/src/utils/schema-helpers.js +1 -1
  276. package/dist/src/utils/schema-helpers.js.map +1 -1
  277. package/dist/src/utils/type-util.d.ts +1 -1
  278. package/dist/src/utils/type-util.d.ts.map +1 -1
  279. package/dist/tsconfig.tsbuildinfo +1 -1
  280. package/package.json +41 -38
  281. package/src/context-manager.ts +29 -6
  282. package/src/framework/declaration.ts +7 -6
  283. package/src/framework/hooks/binder.ts +5 -33
  284. package/src/framework/hooks/sdk-types.ts +22 -8
  285. package/src/framework/hooks/use-dependencies.ts +1 -1
  286. package/src/framework/load-static-helpers.ts +3 -18
  287. package/src/framework/reference.ts +2 -2
  288. package/src/framework/sample.ts +2 -2
  289. package/src/framework/source-file-batch.ts +2 -2
  290. package/src/index.ts +34 -29
  291. package/src/interfaces.ts +0 -1
  292. package/src/lib.ts +43 -11
  293. package/src/meta-tree.ts +2 -2
  294. package/src/metadata/build-api-extractor-config.ts +1 -1
  295. package/src/metadata/build-changelog-file.ts +1 -1
  296. package/src/metadata/build-es-lint-config.ts +1 -1
  297. package/src/metadata/build-package-file.ts +11 -49
  298. package/src/metadata/build-readme-file.ts +4 -4
  299. package/src/metadata/build-sample-env-file.ts +1 -1
  300. package/src/metadata/build-test-config.ts +1 -1
  301. package/src/metadata/build-ts-config.ts +38 -9
  302. package/src/metadata/build-vitest-config.ts +1 -1
  303. package/src/metadata/build-warp-config.ts +1 -3
  304. package/src/metadata/package-json/azure-package-common.ts +1 -1
  305. package/src/metadata/package-json/build-azure-monorepo-package.ts +3 -20
  306. package/src/metadata/package-json/package-common.ts +0 -15
  307. package/src/metadata/test/build-recorded-client.ts +1 -1
  308. package/src/metadata/test/build-sample-test.ts +1 -1
  309. package/src/metadata/test/build-snippets.ts +1 -1
  310. package/src/metadata/utils.ts +1 -1
  311. package/src/modular/build-classical-client.ts +8 -12
  312. package/src/modular/build-classical-operation-groups.ts +6 -3
  313. package/src/modular/build-client-context.ts +3 -3
  314. package/src/modular/build-modular-options.ts +2 -2
  315. package/src/modular/build-operations.ts +12 -9
  316. package/src/modular/build-project-files.ts +2 -2
  317. package/src/modular/build-restore-poller.ts +6 -3
  318. package/src/modular/build-root-index.ts +9 -10
  319. package/src/modular/build-subpath-index.ts +5 -2
  320. package/src/modular/emit-logger-file.ts +1 -1
  321. package/src/modular/emit-models-options.ts +6 -3
  322. package/src/modular/emit-models.ts +23 -33
  323. package/src/modular/emit-samples.ts +11 -11
  324. package/src/modular/emit-tests.ts +3 -3
  325. package/src/modular/external-dependencies.ts +11 -1
  326. package/src/modular/helpers/classical-operation-helpers.ts +10 -7
  327. package/src/modular/helpers/client-helpers.ts +52 -32
  328. package/src/modular/helpers/client-option-helpers.ts +1 -1
  329. package/src/modular/helpers/example-value-helpers.ts +9 -9
  330. package/src/modular/helpers/naming-helpers.ts +55 -7
  331. package/src/modular/helpers/operation-helpers.ts +56 -54
  332. package/src/modular/helpers/type-helpers.ts +3 -3
  333. package/src/modular/interfaces.ts +1 -1
  334. package/src/modular/serialization/build-deserializer-function.ts +9 -9
  335. package/src/modular/serialization/build-serializer-function.ts +9 -9
  336. package/src/modular/serialization/build-xml-serializer-function.ts +7 -7
  337. package/src/modular/serialization/serialize-utils.ts +1 -1
  338. package/src/modular/static-helpers-metadata.ts +0 -13
  339. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  340. package/src/modular/type-expressions/get-enum-expression.ts +3 -3
  341. package/src/modular/type-expressions/get-model-expression.ts +3 -3
  342. package/src/modular/type-expressions/get-nullable-expression.ts +3 -3
  343. package/src/modular/type-expressions/get-type-expression.ts +2 -2
  344. package/src/modular/type-expressions/get-union-expression.ts +3 -3
  345. package/src/modular/type-expressions/utils.ts +1 -1
  346. package/src/transform/transform-api-version-info.ts +8 -3
  347. package/src/transform/transform-client-options.ts +5 -7
  348. package/src/transform/transform-helper-function-details.ts +6 -3
  349. package/src/transform/transform-parameters.ts +15 -11
  350. package/src/transform/transform-paths.ts +10 -4
  351. package/src/transform/transform-responses.ts +11 -8
  352. package/src/transform/transform-schemas.ts +7 -4
  353. package/src/transform/transform-telemetry-info.ts +3 -3
  354. package/src/transform/transform.ts +11 -11
  355. package/src/utils/api-version-util.ts +1 -1
  356. package/src/utils/client-utils.ts +8 -8
  357. package/src/utils/credential-utils.ts +3 -3
  358. package/src/utils/cross-language-def.ts +1 -1
  359. package/src/utils/emit-util.ts +9 -3
  360. package/src/utils/file-system-utils.ts +1 -1
  361. package/src/utils/imports-util.ts +2 -2
  362. package/src/utils/interfaces.ts +3 -3
  363. package/src/utils/model-utils.ts +23 -23
  364. package/src/utils/name-constructors.ts +1 -1
  365. package/src/utils/namespace-utils.ts +8 -2
  366. package/src/utils/operation-helpers.ts +11 -7
  367. package/src/utils/operation-util.ts +23 -16
  368. package/src/utils/parameter-utils.ts +4 -4
  369. package/src/utils/schema-helpers.ts +7 -1
  370. package/src/utils/type-util.ts +1 -1
  371. package/static/static-helpers/multipartHelpers.ts +2 -6
  372. package/static/static-helpers/platform-types-browser.mts +0 -5
  373. package/static/static-helpers/platform-types-react-native.mts +0 -5
  374. package/static/static-helpers/platform-types.ts +0 -7
  375. package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +0 -22
  376. package/static/static-helpers/serialization/get-binary-stream-response-react-native.mts +0 -1
  377. package/static/static-helpers/serialization/get-binary-stream-response.ts +0 -22
@@ -1,7 +1,12 @@
1
- import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
2
- import { SdkContext } from "../../utils/interfaces.js";
1
+ import {
2
+ getClientNameOverride,
3
+ type SdkClientType,
4
+ type SdkServiceOperation,
5
+ } from "@azure-tools/typespec-client-generator-core";
6
+ import pluralize from "pluralize";
7
+ import type { SdkContext } from "../../utils/interfaces.js";
3
8
  import { NameType, normalizeName, ReservedModelNames } from "../../utils/name-utils.js";
4
- import { ServiceOperation } from "../../utils/operation-util.js";
9
+ import type { ServiceOperation } from "../../utils/operation-util.js";
5
10
 
6
11
  export function getClientName(client: SdkClientType<SdkServiceOperation>): string {
7
12
  return client.name.replace(/Client$/, "");
@@ -12,19 +17,47 @@ export function getClassicalClientName(client: SdkClientType<SdkServiceOperation
12
17
  }
13
18
 
14
19
  export interface GuardedName {
20
+ /** The name used for the generated API-layer function (e.g. `deleteConversation`). */
15
21
  name: string;
22
+ /** The name used for the public method exposed on clients and operation groups. */
23
+ propertyName: string;
16
24
  fixme?: string[];
17
25
  }
18
26
 
19
27
  export function getOperationName(
20
28
  operation: ServiceOperation,
21
29
  dpgContext?: SdkContext,
30
+ prefixes: string[] = [],
22
31
  ): GuardedName {
23
- const norm = normalizeName(operation.name, NameType.Method, true);
32
+ const name = normalizeName(operation.name, NameType.Method, true);
33
+ const propertyName = normalizeName(operation.name, NameType.Property);
24
34
  const isDataplane = dpgContext !== undefined && !dpgContext.emitterOptions?.azureArm;
25
- if (isReservedName(operation.name, NameType.Method) && isDataplane) {
35
+ // An explicit `@clientName` override is an intentional naming choice by the user, so we
36
+ // honor it verbatim and skip the reserved-word disambiguation (and its `@fixme`). The
37
+ // public method keeps the reserved word (e.g. `delete`), while the generated API-layer
38
+ // function stays guarded (e.g. `$delete`) because a reserved word is not a valid function
39
+ // binding in JavaScript.
40
+ const hasClientNameOverride =
41
+ dpgContext !== undefined &&
42
+ operation.__raw !== undefined &&
43
+ getClientNameOverride(dpgContext, operation.__raw) !== undefined;
44
+ if (isReservedName(operation.name, NameType.Method) && isDataplane && !hasClientNameOverride) {
45
+ const suffix = getReservedNameGroupSuffix(prefixes);
46
+ if (suffix) {
47
+ // Disambiguate the reserved word by suffixing the singularized operation group
48
+ // name, e.g. `delete` in the `Conversations` group becomes `deleteConversation`.
49
+ const disambiguated = normalizeName(`${operation.name}_${suffix}`, NameType.Method);
50
+ return {
51
+ name: disambiguated,
52
+ propertyName: disambiguated,
53
+ };
54
+ }
55
+ // There is no operation group to disambiguate the reserved word with (e.g. a top-level
56
+ // operation), so keep the guarded name (e.g. `$delete`) and surface a fixme asking the
57
+ // user to override the generated name.
26
58
  return {
27
- name: norm,
59
+ name,
60
+ propertyName,
28
61
  fixme: [
29
62
  `${operation.name} is a reserved word that cannot be used as an operation name.
30
63
  Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
@@ -33,10 +66,25 @@ export function getOperationName(
33
66
  };
34
67
  }
35
68
  return {
36
- name: norm,
69
+ name,
70
+ propertyName,
37
71
  };
38
72
  }
39
73
 
74
+ /**
75
+ * Builds the suffix used to disambiguate a reserved-word operation name from the
76
+ * operation group it belongs to. The innermost operation group name is singularized
77
+ * so that, for example, the `Conversations` group yields `Conversation`.
78
+ */
79
+ function getReservedNameGroupSuffix(prefixes: string[]): string | undefined {
80
+ const groups = prefixes.filter((prefix) => prefix && prefix.length > 0);
81
+ const innermostGroup = groups[groups.length - 1];
82
+ if (!innermostGroup) {
83
+ return undefined;
84
+ }
85
+ return pluralize.singular(normalizeName(innermostGroup, NameType.Interface));
86
+ }
87
+
40
88
  export function isReservedName(name: string, nameType: NameType): boolean {
41
89
  return ReservedModelNames.some(
42
90
  (reservedName) =>
@@ -2,30 +2,30 @@ import {
2
2
  getClientOptions,
3
3
  isHttpMetadata,
4
4
  isReadOnly,
5
- SdkBodyParameter,
6
- SdkClientType,
7
- SdkConstantType,
8
- SdkEnumType,
9
- SdkHttpOperation,
10
- SdkHttpParameter,
11
- SdkLroPagingServiceMethod,
12
- SdkLroServiceMethod,
13
- SdkMethod,
14
- SdkMethodParameter,
15
- SdkModelPropertyType,
16
- SdkModelType,
17
- SdkPagingServiceMethod,
18
- SdkServiceResponseHeader,
19
- SdkType,
5
+ type SdkBodyParameter,
6
+ type SdkClientType,
7
+ type SdkConstantType,
8
+ type SdkEnumType,
9
+ type SdkHttpOperation,
10
+ type SdkHttpParameter,
11
+ type SdkLroPagingServiceMethod,
12
+ type SdkLroServiceMethod,
13
+ type SdkMethod,
14
+ type SdkMethodParameter,
15
+ type SdkModelPropertyType,
16
+ type SdkModelType,
17
+ type SdkPagingServiceMethod,
18
+ type SdkServiceResponseHeader,
19
+ type SdkType,
20
20
  } from "@azure-tools/typespec-client-generator-core";
21
- import { NoTarget, Program } from "@typespec/compiler";
21
+ import { NoTarget, type Program } from "@typespec/compiler";
22
22
  import { isHeader, isMetadata } from "@typespec/http";
23
23
  import {
24
- FunctionDeclarationStructure,
25
- OptionalKind,
26
- ParameterDeclarationStructure,
24
+ type FunctionDeclarationStructure,
25
+ type OptionalKind,
26
+ type ParameterDeclarationStructure,
27
27
  StructureKind,
28
- TypeAliasDeclarationStructure,
28
+ type TypeAliasDeclarationStructure,
29
29
  } from "ts-morph";
30
30
  import { useContext } from "../../context-manager.js";
31
31
  import { useSdkTypes } from "../../framework/hooks/sdk-types.js";
@@ -33,7 +33,7 @@ import { useDependencies } from "../../framework/hooks/use-dependencies.js";
33
33
  import { resolveReference } from "../../framework/reference.js";
34
34
  import { refkey } from "../../framework/refkey.js";
35
35
  import { reportDiagnostic } from "../../lib.js";
36
- import { SdkContext } from "../../utils/interfaces.js";
36
+ import type { SdkContext } from "../../utils/interfaces.js";
37
37
  import { isAzureCoreErrorType } from "../../utils/model-utils.js";
38
38
  import { NameType, normalizeName } from "../../utils/name-utils.js";
39
39
  import {
@@ -46,9 +46,9 @@ import {
46
46
  isMultipartPayload,
47
47
  isXmlPayload,
48
48
  KnownCollectionFormat,
49
- ServiceOperation,
49
+ type ServiceOperation,
50
50
  } from "../../utils/operation-util.js";
51
- import { AzurePollingDependencies } from "../external-dependencies.js";
51
+ import { AzureCoreDependencies, AzurePollingDependencies } from "../external-dependencies.js";
52
52
  import {
53
53
  buildModelDeserializer,
54
54
  buildPropertyDeserializer,
@@ -66,11 +66,10 @@ import {
66
66
  getPropertyWithOverrides,
67
67
  isNormalUnion,
68
68
  isSpecialHandledUnion,
69
- ModelOverrideOptions,
69
+ type ModelOverrideOptions,
70
70
  } from "../serialization/serialize-utils.js";
71
71
  import {
72
72
  PagingHelpers,
73
- PlatformTypeHelpers,
74
73
  PollingHelpers,
75
74
  SerializationHelpers,
76
75
  StorageCompatHelpers,
@@ -112,7 +111,7 @@ export function getSendPrivateFunction(
112
111
  ): OptionalKind<FunctionDeclarationStructure> {
113
112
  const operation = method[1];
114
113
  const parameters = getOperationSignatureParameters(dpgContext, method, clientType);
115
- const { name } = getOperationName(operation);
114
+ const { name } = getOperationName(operation, dpgContext, method[0]);
116
115
  const dependencies = useDependencies();
117
116
 
118
117
  const functionStatement: OptionalKind<FunctionDeclarationStructure> = {
@@ -169,7 +168,7 @@ export function getDeserializePrivateFunction(
169
168
  method: [string[], ServiceOperation],
170
169
  ): OptionalKind<FunctionDeclarationStructure> {
171
170
  const operation = method[1];
172
- const { name } = getOperationName(operation);
171
+ const { name } = getOperationName(operation, context, method[0]);
173
172
  const dependencies = useDependencies();
174
173
  const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
175
174
 
@@ -213,11 +212,11 @@ export function getDeserializePrivateFunction(
213
212
  };
214
213
  } else if (response.type) {
215
214
  // When response.optional is true, some HTTP responses have no body (e.g. 204), so
216
- // the return type must include undefined to reflect that possibility.
215
+ // the return type must include void to reflect that possibility.
217
216
  const baseType = getTypeExpression(context, response.type);
218
217
  returnType = {
219
218
  name: (response as any).name ?? "",
220
- type: response.optional ? `${baseType} | undefined` : baseType,
219
+ type: response.optional ? `${baseType} | void` : baseType,
221
220
  };
222
221
  } else if (isHeadAsBooleanOperation(operation)) {
223
222
  returnType = { name: "", type: "boolean" };
@@ -247,7 +246,7 @@ export function getDeserializePrivateFunction(
247
246
  statements.push(`const expectedStatuses = ${getExpectedStatuses(operation)};`);
248
247
  statements.push(
249
248
  `if(!expectedStatuses.includes(result.status)){`,
250
- `${getExceptionThrowStatement(context, operation)}`,
249
+ `${getExceptionThrowStatement(context, method)}`,
251
250
  "}",
252
251
  );
253
252
  const deserializedType =
@@ -405,15 +404,15 @@ export function getDeserializePrivateFunction(
405
404
  }
406
405
  if (deserializeFunctionName) {
407
406
  if (needsBodyGuard) {
408
- // Use ternary form: return result.body ? deserializer(result.body) : undefined
409
407
  statements.push(
410
- `return ${deserializedRoot} ? ${deserializeFunctionName}(${deserializedRoot})${multipartCastSuffix} : undefined`,
411
- );
412
- } else {
413
- statements.push(
414
- `return ${deserializeFunctionName}(${deserializedRoot})${multipartCastSuffix}`,
408
+ `if (!${deserializedRoot}) {
409
+ return;
410
+ }`,
415
411
  );
416
412
  }
413
+ statements.push(
414
+ `return ${deserializeFunctionName}(${deserializedRoot})${multipartCastSuffix}`,
415
+ );
417
416
  } else if (isAzureCoreErrorType(context.program, deserializedType.__raw)) {
418
417
  statements.push(`return ${deserializedRoot}${multipartCastSuffix}`);
419
418
  } else if (isHeadAsBooleanOperation(operation)) {
@@ -461,8 +460,9 @@ export function getDeserializePrivateFunction(
461
460
  */
462
461
  export function getDeserializeHeadersPrivateFunction(
463
462
  context: SdkContext,
464
- operation: ServiceOperation,
463
+ method: [string[], ServiceOperation],
465
464
  ): OptionalKind<FunctionDeclarationStructure> | undefined {
465
+ const operation = method[1];
466
466
  const responseHeaders = getResponseHeaders(operation.operation.responses);
467
467
  const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
468
468
  const isStorageCompatEnabled = context.emitterOptions?.enableStorageCompat === true;
@@ -472,7 +472,7 @@ export function getDeserializeHeadersPrivateFunction(
472
472
  return undefined;
473
473
  }
474
474
 
475
- const { name } = getOperationName(operation);
475
+ const { name } = getOperationName(operation, context, method[0]);
476
476
  const dependencies = useDependencies();
477
477
  const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
478
478
 
@@ -615,8 +615,9 @@ function getExceptionResponseHeaders(
615
615
  */
616
616
  export function getDeserializeExceptionHeadersPrivateFunction(
617
617
  context: SdkContext,
618
- operation: ServiceOperation,
618
+ method: [string[], ServiceOperation],
619
619
  ): OptionalKind<FunctionDeclarationStructure> | undefined {
620
+ const operation = method[1];
620
621
  const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
621
622
  if (!isResponseHeadersEnabled) {
622
623
  return undefined;
@@ -627,7 +628,7 @@ export function getDeserializeExceptionHeadersPrivateFunction(
627
628
  return undefined;
628
629
  }
629
630
 
630
- const { name } = getOperationName(operation);
631
+ const { name } = getOperationName(operation, context, method[0]);
631
632
  const dependencies = useDependencies();
632
633
  const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
633
634
 
@@ -667,7 +668,8 @@ function getExceptionDeserializeExpr(exception: ExceptionThrowDetail): string {
667
668
  return `isXml ? ${exception.xmlDeserializer}(result.body) : ${exception.deserializer}(result.body)`;
668
669
  }
669
670
 
670
- function getExceptionThrowStatement(context: SdkContext, operation: ServiceOperation) {
671
+ function getExceptionThrowStatement(context: SdkContext, method: [string[], ServiceOperation]) {
672
+ const operation = method[1];
671
673
  const statements = [];
672
674
  const createRestErrorReference = resolveReference(useDependencies().createRestError);
673
675
  const { customized, defaultDeserializer, defaultXmlDeserializer, defaultIsXmlOnly } =
@@ -678,7 +680,7 @@ function getExceptionThrowStatement(context: SdkContext, operation: ServiceOpera
678
680
  // Check if exception headers function exists and build the call
679
681
  const exceptionHeaders = getExceptionResponseHeaders(operation.operation.exceptions);
680
682
  const hasExceptionHeaders = isResponseHeadersEnabled && exceptionHeaders.length > 0;
681
- const { name: opName } = getOperationName(operation);
683
+ const { name: opName } = getOperationName(operation, context, method[0]);
682
684
  const exceptionHeadersCall = hasExceptionHeaders
683
685
  ? `error.details = {...(error.details as any), ..._${opName}DeserializeExceptionHeaders(result)};`
684
686
  : undefined;
@@ -949,13 +951,13 @@ export function getOperationFunction(
949
951
  const baseCompositeType = buildCompositeResponseType(context, type, responseHeaders);
950
952
  returnType = {
951
953
  name: (type as any).name ?? "",
952
- type: response.optional ? `${baseCompositeType} | undefined` : baseCompositeType,
954
+ type: response.optional ? `${baseCompositeType} | void` : baseCompositeType,
953
955
  };
954
956
  } else {
955
957
  const baseType = getTypeExpression(context, type!);
956
958
  returnType = {
957
959
  name: (type as any).name ?? "",
958
- type: response.optional ? `${baseType} | undefined` : baseType,
960
+ type: response.optional ? `${baseType} | void` : baseType,
959
961
  };
960
962
  }
961
963
  } else if (hasHeaderOnlyResponse && isResponseHeadersEnabled) {
@@ -996,14 +998,14 @@ export function getOperationFunction(
996
998
  }
997
999
  }
998
1000
 
999
- const { name, fixme = [] } = getOperationName(operation, context);
1001
+ const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
1000
1002
  const functionStatement = {
1001
1003
  kind: StructureKind.Function,
1002
1004
  docs: [...getDocsFromDescription(operation.doc), ...getFixmeForMultilineDocs(fixme)],
1003
1005
  isAsync: true,
1004
1006
  isExported: true,
1005
1007
  name,
1006
- propertyName: normalizeName(operation.name, NameType.Property),
1008
+ propertyName,
1007
1009
  parameters,
1008
1010
  returnType: `Promise<${finalReturnType}>`,
1009
1011
  };
@@ -1043,7 +1045,7 @@ export function getOperationFunction(
1043
1045
  statements.push(`const ${streamableMethodVarName} = _${name}Send(${sendParameterList});`);
1044
1046
  const binaryHelper =
1045
1047
  wrapReturn && wrapReturnIsBinary
1046
- ? SerializationHelpers.getBinaryStreamResponse
1048
+ ? AzureCoreDependencies["getBinaryStreamResponse"]
1047
1049
  : SerializationHelpers.getBinaryResponse;
1048
1050
  statements.push(
1049
1051
  `const ${resultVarName} = await ${resolveReference(binaryHelper)}(${streamableMethodVarName});`,
@@ -1120,7 +1122,7 @@ function getLroOnlyOperationFunction(
1120
1122
  clientType,
1121
1123
  );
1122
1124
  const returnType = buildLroReturnType(context, operation);
1123
- const { name, fixme = [] } = getOperationName(operation, context);
1125
+ const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
1124
1126
  const pollerLikeReference = resolveReference(AzurePollingDependencies.PollerLike);
1125
1127
  const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
1126
1128
 
@@ -1140,7 +1142,7 @@ function getLroOnlyOperationFunction(
1140
1142
  isAsync: false,
1141
1143
  isExported: true,
1142
1144
  name,
1143
- propertyName: normalizeName(operation.name, NameType.Property),
1145
+ propertyName,
1144
1146
  isLro: true,
1145
1147
  lroFinalReturnType: effectiveReturnTypeName,
1146
1148
  parameters,
@@ -1194,7 +1196,7 @@ function getLroAndPagingOperationFunction(
1194
1196
  } {
1195
1197
  const operation = method[1];
1196
1198
  const parameters = getOperationSignatureParameters(context, method, clientType);
1197
- const { name, fixme = [] } = getOperationName(operation, context);
1199
+ const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
1198
1200
 
1199
1201
  const returnType = buildLroPagingReturnType(context, operation);
1200
1202
 
@@ -1247,7 +1249,7 @@ function getLroAndPagingOperationFunction(
1247
1249
  isLroPaging: true,
1248
1250
  lropagingFinalReturnType: returnType.type,
1249
1251
  name,
1250
- propertyName: normalizeName(operation.name, NameType.Property),
1252
+ propertyName,
1251
1253
  parameters,
1252
1254
  returnType: `${refs.pagedIterator}<${returnType.type}>`,
1253
1255
  statements: [
@@ -1324,7 +1326,7 @@ function getPagingOnlyOperationFunction(
1324
1326
  type: getTypeExpression(context, type.valueType),
1325
1327
  };
1326
1328
  }
1327
- const { name, fixme = [] } = getOperationName(operation, context);
1329
+ const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
1328
1330
  const pagedAsyncIterableIteratorReference = resolveReference(
1329
1331
  PagingHelpers.PagedAsyncIterableIterator,
1330
1332
  );
@@ -1335,7 +1337,7 @@ function getPagingOnlyOperationFunction(
1335
1337
  isAsync: false,
1336
1338
  isExported: true,
1337
1339
  name,
1338
- propertyName: normalizeName(operation.name, NameType.Property),
1340
+ propertyName,
1339
1341
  parameters,
1340
1342
  returnType: `${pagedAsyncIterableIteratorReference}<${returnType.type}>`,
1341
1343
  };
@@ -3003,7 +3005,7 @@ export function buildNonModelResponseTypeDeclaration(
3003
3005
  let typeBody: string;
3004
3006
 
3005
3007
  if (isBinary) {
3006
- const nodeReadableStreamRef = resolveReference(PlatformTypeHelpers.NodeReadableStream);
3008
+ const nodeReadableStreamRef = resolveReference(AzureCoreDependencies["NodeReadableStream"]);
3007
3009
  typeBody = `{
3008
3010
  /**
3009
3011
  * BROWSER ONLY
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  SdkBodyParameter,
3
3
  SdkCredentialParameter,
4
4
  SdkEndpointParameter,
@@ -6,11 +6,11 @@ import {
6
6
  SdkModelType,
7
7
  SdkType,
8
8
  } from "@azure-tools/typespec-client-generator-core";
9
- import { SdkContext } from "../../utils/interfaces.js";
9
+ import type { SdkContext } from "../../utils/interfaces.js";
10
10
  import { NameType, normalizeName } from "../../utils/name-utils.js";
11
11
  import {
12
12
  getPropertyWithOverrides,
13
- ModelOverrideOptions,
13
+ type ModelOverrideOptions,
14
14
  } from "../serialization/serialize-utils.js";
15
15
  import { getAllAncestors, getAllProperties } from "./operation-helpers.js";
16
16
 
@@ -1,4 +1,4 @@
1
- import { ClientOptions } from "../interfaces.js";
1
+ import type { ClientOptions } from "../interfaces.js";
2
2
 
3
3
  export interface ModularOptions {
4
4
  sourceRoot: string;
@@ -1,19 +1,19 @@
1
1
  import {
2
- SdkArrayType,
3
- SdkDictionaryType,
4
- SdkModelPropertyType,
5
- SdkModelType,
6
- SdkType,
7
- SdkUnionType,
2
+ type SdkArrayType,
3
+ type SdkDictionaryType,
4
+ type SdkModelPropertyType,
5
+ type SdkModelType,
6
+ type SdkType,
7
+ type SdkUnionType,
8
8
  UsageFlags,
9
9
  } from "@azure-tools/typespec-client-generator-core";
10
10
  import { NoTarget } from "@typespec/compiler";
11
- import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
11
+ import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
12
12
  import { useContext } from "../../context-manager.js";
13
13
  import { resolveReference } from "../../framework/reference.js";
14
14
  import { refkey } from "../../framework/refkey.js";
15
15
  import { reportDiagnostic } from "../../lib.js";
16
- import { SdkContext } from "../../utils/interfaces.js";
16
+ import type { SdkContext } from "../../utils/interfaces.js";
17
17
  import { isAzureCoreErrorType } from "../../utils/model-utils.js";
18
18
  import { NameType, normalizeName } from "../../utils/name-utils.js";
19
19
  import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
@@ -29,7 +29,7 @@ import {
29
29
  getAllDiscriminatedValues,
30
30
  isDiscriminatedUnion,
31
31
  isSupportedSerializeType,
32
- ModelSerializeOptions,
32
+ type ModelSerializeOptions,
33
33
  } from "./serialize-utils.js";
34
34
 
35
35
  export function buildPropertyDeserializer(
@@ -1,20 +1,20 @@
1
1
  import {
2
- SdkArrayType,
3
- SdkDictionaryType,
4
- SdkModelPropertyType,
5
- SdkModelType,
6
- SdkType,
7
- SdkUnionType,
2
+ type SdkArrayType,
3
+ type SdkDictionaryType,
4
+ type SdkModelPropertyType,
5
+ type SdkModelType,
6
+ type SdkType,
7
+ type SdkUnionType,
8
8
  UsageFlags,
9
9
  } from "@azure-tools/typespec-client-generator-core";
10
10
  import { NoTarget } from "@typespec/compiler";
11
11
  import { isOrExtendsHttpFile } from "@typespec/http";
12
- import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
12
+ import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
13
13
  import { useContext } from "../../context-manager.js";
14
14
  import { resolveReference } from "../../framework/reference.js";
15
15
  import { refkey } from "../../framework/refkey.js";
16
16
  import { reportDiagnostic } from "../../lib.js";
17
- import { SdkContext } from "../../utils/interfaces.js";
17
+ import type { SdkContext } from "../../utils/interfaces.js";
18
18
  import { isAzureCoreErrorType } from "../../utils/model-utils.js";
19
19
  import { NameType, normalizeName } from "../../utils/name-utils.js";
20
20
  import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
@@ -31,7 +31,7 @@ import {
31
31
  getAllDiscriminatedValues,
32
32
  isDiscriminatedUnion,
33
33
  isSupportedSerializeType,
34
- ModelSerializeOptions,
34
+ type ModelSerializeOptions,
35
35
  } from "./serialize-utils.js";
36
36
 
37
37
  export function buildPropertySerializer(
@@ -3,20 +3,20 @@
3
3
 
4
4
  import {
5
5
  isReadOnly,
6
- SdkModelPropertyType,
7
- SdkModelType,
8
- SdkPackage,
9
- SdkType,
6
+ type SdkModelPropertyType,
7
+ type SdkModelType,
8
+ type SdkPackage,
9
+ type SdkType,
10
10
  UsageFlags,
11
11
  } from "@azure-tools/typespec-client-generator-core";
12
12
  import { NoTarget } from "@typespec/compiler";
13
13
  import { isMetadata } from "@typespec/http";
14
- import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
14
+ import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
15
15
  import { useDependencies } from "../../framework/hooks/use-dependencies.js";
16
16
  import { resolveReference } from "../../framework/reference.js";
17
17
  import { refkey } from "../../framework/refkey.js";
18
18
  import { reportDiagnostic } from "../../lib.js";
19
- import { SdkContext } from "../../utils/interfaces.js";
19
+ import type { SdkContext } from "../../utils/interfaces.js";
20
20
  import { isAzureCoreErrorType } from "../../utils/model-utils.js";
21
21
  import { NameType } from "../../utils/name-utils.js";
22
22
  import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
@@ -24,7 +24,7 @@ import { getAllAncestors, getAllProperties } from "../helpers/operation-helpers.
24
24
  import { getAdditionalPropertiesType } from "../helpers/type-helpers.js";
25
25
  import { XmlHelpers } from "../static-helpers-metadata.js";
26
26
  import { normalizeModelPropertyName } from "../type-expressions/get-type-expression.js";
27
- import { isSupportedSerializeType, ModelSerializeOptions } from "./serialize-utils.js";
27
+ import { isSupportedSerializeType, type ModelSerializeOptions } from "./serialize-utils.js";
28
28
 
29
29
  /**
30
30
  * Checks if a model type has XML serialization options defined
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  SdkModelPropertyType,
3
3
  SdkModelType,
4
4
  SdkType,
@@ -59,11 +59,6 @@ export const SerializationHelpers = {
59
59
  name: "getBinaryResponse",
60
60
  location: "serialization/get-binary-response.ts",
61
61
  },
62
- getBinaryStreamResponse: {
63
- kind: "function",
64
- name: "getBinaryStreamResponse",
65
- location: "serialization/get-binary-stream-response.ts",
66
- },
67
62
  areAllPropsUndefined: {
68
63
  kind: "function",
69
64
  name: "areAllPropsUndefined",
@@ -150,14 +145,6 @@ export const MultipartHelpers = {
150
145
  },
151
146
  } as const;
152
147
 
153
- export const PlatformTypeHelpers = {
154
- NodeReadableStream: {
155
- kind: "typeAlias",
156
- name: "NodeReadableStream",
157
- location: "platform-types.ts",
158
- },
159
- } as const;
160
-
161
148
  export const CloudSettingHelpers = {
162
149
  AzureClouds: {
163
150
  kind: "enum",
@@ -1,4 +1,4 @@
1
- import { SdkCredentialType } from "@azure-tools/typespec-client-generator-core";
1
+ import type { SdkCredentialType } from "@azure-tools/typespec-client-generator-core";
2
2
  import { useDependencies } from "../../framework/hooks/use-dependencies.js";
3
3
  import { resolveReference } from "../../framework/reference.js";
4
4
 
@@ -1,7 +1,7 @@
1
- import { SdkEnumType } from "@azure-tools/typespec-client-generator-core";
1
+ import type { SdkEnumType } from "@azure-tools/typespec-client-generator-core";
2
2
  import { resolveReference } from "../../framework/reference.js";
3
- import { SdkContext } from "../../utils/interfaces.js";
4
- import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
3
+ import type { SdkContext } from "../../utils/interfaces.js";
4
+ import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
5
5
  import { shouldEmitInline } from "./utils.js";
6
6
 
7
7
  export function getEnumExpression(
@@ -1,10 +1,10 @@
1
1
  import {
2
- EmitTypeOptions,
2
+ type EmitTypeOptions,
3
3
  getTypeExpression,
4
4
  normalizeModelPropertyName,
5
5
  } from "./get-type-expression.js";
6
6
 
7
- import {
7
+ import type {
8
8
  SdkModelPropertyType,
9
9
  SdkModelType,
10
10
  SdkServiceResponseHeader,
@@ -12,7 +12,7 @@ import {
12
12
  import { useContext } from "../../context-manager.js";
13
13
  import { resolveReference } from "../../framework/reference.js";
14
14
  import { refkey } from "../../framework/refkey.js";
15
- import { SdkContext } from "../../utils/interfaces.js";
15
+ import type { SdkContext } from "../../utils/interfaces.js";
16
16
  import { MultipartHelpers } from "../static-helpers-metadata.js";
17
17
  import { shouldEmitInline } from "./utils.js";
18
18
 
@@ -1,7 +1,7 @@
1
- import { SdkNullableType } from "@azure-tools/typespec-client-generator-core";
1
+ import type { SdkNullableType } from "@azure-tools/typespec-client-generator-core";
2
2
  import { resolveReference } from "../../framework/reference.js";
3
- import { SdkContext } from "../../utils/interfaces.js";
4
- import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
3
+ import type { SdkContext } from "../../utils/interfaces.js";
4
+ import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
5
5
  import { shouldEmitInline } from "./utils.js";
6
6
 
7
7
  export function getNullableExpression(
@@ -1,10 +1,10 @@
1
- import {
1
+ import type {
2
2
  SdkHttpParameter,
3
3
  SdkModelPropertyType,
4
4
  SdkServiceResponseHeader,
5
5
  SdkType,
6
6
  } from "@azure-tools/typespec-client-generator-core";
7
- import { SdkContext } from "../../utils/interfaces.js";
7
+ import type { SdkContext } from "../../utils/interfaces.js";
8
8
  import { NameType, normalizeName } from "../../utils/name-utils.js";
9
9
  import { getCredentialExpression } from "./get-credential-expression.js";
10
10
  import { getEnumExpression } from "./get-enum-expression.js";
@@ -1,7 +1,7 @@
1
- import { SdkUnionType } from "@azure-tools/typespec-client-generator-core";
1
+ import type { SdkUnionType } from "@azure-tools/typespec-client-generator-core";
2
2
  import { resolveReference } from "../../framework/reference.js";
3
- import { SdkContext } from "../../utils/interfaces.js";
4
- import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
3
+ import type { SdkContext } from "../../utils/interfaces.js";
4
+ import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
5
5
  import { shouldEmitInline } from "./utils.js";
6
6
 
7
7
  export function getUnionExpression(
@@ -1,4 +1,4 @@
1
- import { EmitTypeOptions } from "./get-type-expression.js";
1
+ import type { EmitTypeOptions } from "./get-type-expression.js";
2
2
 
3
3
  export function shouldEmitInline(
4
4
  type: { isGeneratedName?: boolean },