@azure-tools/typespec-ts 0.56.0-dev.14 → 0.56.0-dev.15

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 (376) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +8 -9
  3. package/dist/src/context-manager.d.ts +6 -6
  4. package/dist/src/context-manager.d.ts.map +1 -1
  5. package/dist/src/context-manager.js +1 -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 +3 -3
  16. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  17. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  18. package/dist/src/framework/hooks/use-dependencies.d.ts +1 -1
  19. package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -1
  20. package/dist/src/framework/load-static-helpers.d.ts +2 -2
  21. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  22. package/dist/src/framework/load-static-helpers.js +1 -13
  23. package/dist/src/framework/load-static-helpers.js.map +1 -1
  24. package/dist/src/framework/reference.js.map +1 -1
  25. package/dist/src/framework/source-file-batch.d.ts +1 -1
  26. package/dist/src/framework/source-file-batch.d.ts.map +1 -1
  27. package/dist/src/framework/source-file-batch.js +1 -1
  28. package/dist/src/framework/source-file-batch.js.map +1 -1
  29. package/dist/src/index.d.ts +4 -4
  30. package/dist/src/index.d.ts.map +1 -1
  31. package/dist/src/index.js +14 -17
  32. package/dist/src/index.js.map +1 -1
  33. package/dist/src/interfaces.d.ts +0 -1
  34. package/dist/src/interfaces.d.ts.map +1 -1
  35. package/dist/src/lib.d.ts +3 -3
  36. package/dist/src/lib.d.ts.map +1 -1
  37. package/dist/src/lib.js +0 -1
  38. package/dist/src/lib.js.map +1 -1
  39. package/dist/src/meta-tree.d.ts +2 -2
  40. package/dist/src/meta-tree.d.ts.map +1 -1
  41. package/dist/src/metadata/build-api-extractor-config.d.ts +1 -1
  42. package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -1
  43. package/dist/src/metadata/build-changelog-file.d.ts +1 -1
  44. package/dist/src/metadata/build-changelog-file.d.ts.map +1 -1
  45. package/dist/src/metadata/build-es-lint-config.d.ts +1 -1
  46. package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -1
  47. package/dist/src/metadata/build-package-file.d.ts +3 -5
  48. package/dist/src/metadata/build-package-file.d.ts.map +1 -1
  49. package/dist/src/metadata/build-package-file.js +10 -45
  50. package/dist/src/metadata/build-package-file.js.map +1 -1
  51. package/dist/src/metadata/build-readme-file.d.ts +1 -1
  52. package/dist/src/metadata/build-readme-file.d.ts.map +1 -1
  53. package/dist/src/metadata/build-readme-file.js +3 -3
  54. package/dist/src/metadata/build-readme-file.js.map +1 -1
  55. package/dist/src/metadata/build-sample-env-file.d.ts +1 -1
  56. package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -1
  57. package/dist/src/metadata/build-test-config.d.ts +1 -1
  58. package/dist/src/metadata/build-test-config.d.ts.map +1 -1
  59. package/dist/src/metadata/build-ts-config.d.ts +11 -5
  60. package/dist/src/metadata/build-ts-config.d.ts.map +1 -1
  61. package/dist/src/metadata/build-ts-config.js +36 -8
  62. package/dist/src/metadata/build-ts-config.js.map +1 -1
  63. package/dist/src/metadata/build-vitest-config.d.ts +1 -1
  64. package/dist/src/metadata/build-vitest-config.d.ts.map +1 -1
  65. package/dist/src/metadata/build-warp-config.d.ts +1 -3
  66. package/dist/src/metadata/build-warp-config.d.ts.map +1 -1
  67. package/dist/src/metadata/build-warp-config.js +0 -2
  68. package/dist/src/metadata/build-warp-config.js.map +1 -1
  69. package/dist/src/metadata/package-json/azure-package-common.d.ts +1 -1
  70. package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -1
  71. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts +1 -2
  72. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  73. package/dist/src/metadata/package-json/build-azure-monorepo-package.js +2 -16
  74. package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  75. package/dist/src/metadata/package-json/package-common.d.ts.map +1 -1
  76. package/dist/src/metadata/package-json/package-common.js +0 -15
  77. package/dist/src/metadata/package-json/package-common.js.map +1 -1
  78. package/dist/src/metadata/test/build-recorded-client.d.ts +1 -1
  79. package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -1
  80. package/dist/src/metadata/test/build-sample-test.d.ts +1 -1
  81. package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -1
  82. package/dist/src/metadata/test/build-snippets.d.ts +1 -1
  83. package/dist/src/metadata/test/build-snippets.d.ts.map +1 -1
  84. package/dist/src/metadata/utils.d.ts +1 -1
  85. package/dist/src/metadata/utils.d.ts.map +1 -1
  86. package/dist/src/modular/build-classical-client.d.ts +3 -3
  87. package/dist/src/modular/build-classical-client.d.ts.map +1 -1
  88. package/dist/src/modular/build-classical-client.js +1 -1
  89. package/dist/src/modular/build-classical-client.js.map +1 -1
  90. package/dist/src/modular/build-classical-operation-groups.d.ts +3 -3
  91. package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
  92. package/dist/src/modular/build-classical-operation-groups.js +1 -0
  93. package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
  94. package/dist/src/modular/build-client-context.d.ts +3 -3
  95. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  96. package/dist/src/modular/build-client-context.js +1 -0
  97. package/dist/src/modular/build-client-context.js.map +1 -1
  98. package/dist/src/modular/build-modular-options.d.ts +2 -2
  99. package/dist/src/modular/build-modular-options.d.ts.map +1 -1
  100. package/dist/src/modular/build-operations.d.ts +5 -5
  101. package/dist/src/modular/build-operations.d.ts.map +1 -1
  102. package/dist/src/modular/build-operations.js +7 -4
  103. package/dist/src/modular/build-operations.js.map +1 -1
  104. package/dist/src/modular/build-project-files.d.ts +2 -2
  105. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  106. package/dist/src/modular/build-restore-poller.d.ts +3 -3
  107. package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
  108. package/dist/src/modular/build-restore-poller.js +1 -0
  109. package/dist/src/modular/build-restore-poller.js.map +1 -1
  110. package/dist/src/modular/build-root-index.d.ts +3 -3
  111. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  112. package/dist/src/modular/build-root-index.js +4 -3
  113. package/dist/src/modular/build-root-index.js.map +1 -1
  114. package/dist/src/modular/build-subpath-index.d.ts +2 -2
  115. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  116. package/dist/src/modular/build-subpath-index.js +1 -1
  117. package/dist/src/modular/build-subpath-index.js.map +1 -1
  118. package/dist/src/modular/emit-logger-file.d.ts +1 -1
  119. package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
  120. package/dist/src/modular/emit-models-options.d.ts +3 -3
  121. package/dist/src/modular/emit-models-options.d.ts.map +1 -1
  122. package/dist/src/modular/emit-models-options.js.map +1 -1
  123. package/dist/src/modular/emit-models.d.ts +3 -3
  124. package/dist/src/modular/emit-models.d.ts.map +1 -1
  125. package/dist/src/modular/emit-models.js +1 -1
  126. package/dist/src/modular/emit-models.js.map +1 -1
  127. package/dist/src/modular/emit-samples.d.ts +1 -1
  128. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  129. package/dist/src/modular/emit-samples.js +1 -1
  130. package/dist/src/modular/emit-samples.js.map +1 -1
  131. package/dist/src/modular/emit-tests.d.ts +1 -1
  132. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  133. package/dist/src/modular/emit-tests.js +1 -0
  134. package/dist/src/modular/emit-tests.js.map +1 -1
  135. package/dist/src/modular/external-dependencies.d.ts +1 -1
  136. package/dist/src/modular/external-dependencies.d.ts.map +1 -1
  137. package/dist/src/modular/external-dependencies.js +10 -0
  138. package/dist/src/modular/external-dependencies.js.map +1 -1
  139. package/dist/src/modular/helpers/classical-operation-helpers.d.ts +3 -3
  140. package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
  141. package/dist/src/modular/helpers/classical-operation-helpers.js +1 -1
  142. package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
  143. package/dist/src/modular/helpers/client-helpers.d.ts +6 -6
  144. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  145. package/dist/src/modular/helpers/client-helpers.js +24 -7
  146. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  147. package/dist/src/modular/helpers/client-option-helpers.d.ts +1 -1
  148. package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -1
  149. package/dist/src/modular/helpers/example-value-helpers.d.ts +3 -3
  150. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  151. package/dist/src/modular/helpers/example-value-helpers.js +1 -0
  152. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  153. package/dist/src/modular/helpers/naming-helpers.d.ts +7 -4
  154. package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
  155. package/dist/src/modular/helpers/naming-helpers.js +44 -5
  156. package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
  157. package/dist/src/modular/helpers/operation-helpers.d.ts +7 -7
  158. package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
  159. package/dist/src/modular/helpers/operation-helpers.js +24 -21
  160. package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
  161. package/dist/src/modular/helpers/type-helpers.d.ts +3 -3
  162. package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
  163. package/dist/src/modular/interfaces.d.ts +1 -1
  164. package/dist/src/modular/interfaces.d.ts.map +1 -1
  165. package/dist/src/modular/serialization/build-deserializer-function.d.ts +4 -4
  166. package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
  167. package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
  168. package/dist/src/modular/serialization/build-serializer-function.d.ts +4 -4
  169. package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
  170. package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
  171. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +4 -4
  172. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
  173. package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
  174. package/dist/src/modular/serialization/serialize-utils.d.ts +1 -1
  175. package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -1
  176. package/dist/src/modular/static-helpers-metadata.d.ts +0 -12
  177. package/dist/src/modular/static-helpers-metadata.d.ts.map +1 -1
  178. package/dist/src/modular/static-helpers-metadata.js +0 -12
  179. package/dist/src/modular/static-helpers-metadata.js.map +1 -1
  180. package/dist/src/modular/type-expressions/get-credential-expression.d.ts +1 -1
  181. package/dist/src/modular/type-expressions/get-credential-expression.d.ts.map +1 -1
  182. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +3 -3
  183. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  184. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  185. package/dist/src/modular/type-expressions/get-model-expression.d.ts +3 -3
  186. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  187. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +3 -3
  188. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  189. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  190. package/dist/src/modular/type-expressions/get-type-expression.d.ts +2 -2
  191. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  192. package/dist/src/modular/type-expressions/get-union-expression.d.ts +3 -3
  193. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  194. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  195. package/dist/src/modular/type-expressions/utils.d.ts +1 -1
  196. package/dist/src/modular/type-expressions/utils.d.ts.map +1 -1
  197. package/dist/src/transform/transform-api-version-info.d.ts +3 -3
  198. package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
  199. package/dist/src/transform/transform-api-version-info.js +1 -1
  200. package/dist/src/transform/transform-api-version-info.js.map +1 -1
  201. package/dist/src/transform/transform-client-options.d.ts +4 -4
  202. package/dist/src/transform/transform-client-options.d.ts.map +1 -1
  203. package/dist/src/transform/transform-client-options.js +1 -3
  204. package/dist/src/transform/transform-client-options.js.map +1 -1
  205. package/dist/src/transform/transform-helper-function-details.d.ts +3 -3
  206. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  207. package/dist/src/transform/transform-helper-function-details.js +1 -1
  208. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  209. package/dist/src/transform/transform-parameters.d.ts +4 -4
  210. package/dist/src/transform/transform-parameters.d.ts.map +1 -1
  211. package/dist/src/transform/transform-parameters.js.map +1 -1
  212. package/dist/src/transform/transform-paths.d.ts +3 -3
  213. package/dist/src/transform/transform-paths.d.ts.map +1 -1
  214. package/dist/src/transform/transform-paths.js +1 -1
  215. package/dist/src/transform/transform-paths.js.map +1 -1
  216. package/dist/src/transform/transform-responses.d.ts +3 -3
  217. package/dist/src/transform/transform-responses.d.ts.map +1 -1
  218. package/dist/src/transform/transform-responses.js +1 -1
  219. package/dist/src/transform/transform-responses.js.map +1 -1
  220. package/dist/src/transform/transform-schemas.d.ts +2 -2
  221. package/dist/src/transform/transform-schemas.d.ts.map +1 -1
  222. package/dist/src/transform/transform-schemas.js +2 -2
  223. package/dist/src/transform/transform-schemas.js.map +1 -1
  224. package/dist/src/transform/transform-telemetry-info.d.ts +2 -2
  225. package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
  226. package/dist/src/transform/transform.d.ts +3 -3
  227. package/dist/src/transform/transform.d.ts.map +1 -1
  228. package/dist/src/utils/api-version-util.d.ts +1 -1
  229. package/dist/src/utils/api-version-util.d.ts.map +1 -1
  230. package/dist/src/utils/client-utils.d.ts +4 -4
  231. package/dist/src/utils/client-utils.d.ts.map +1 -1
  232. package/dist/src/utils/credential-utils.d.ts +3 -3
  233. package/dist/src/utils/credential-utils.d.ts.map +1 -1
  234. package/dist/src/utils/credential-utils.js.map +1 -1
  235. package/dist/src/utils/cross-language-def.d.ts +1 -1
  236. package/dist/src/utils/cross-language-def.d.ts.map +1 -1
  237. package/dist/src/utils/emit-util.d.ts +2 -2
  238. package/dist/src/utils/emit-util.d.ts.map +1 -1
  239. package/dist/src/utils/emit-util.js +2 -2
  240. package/dist/src/utils/emit-util.js.map +1 -1
  241. package/dist/src/utils/file-system-utils.d.ts +1 -1
  242. package/dist/src/utils/file-system-utils.d.ts.map +1 -1
  243. package/dist/src/utils/file-system-utils.js.map +1 -1
  244. package/dist/src/utils/import-helper.js +1 -0
  245. package/dist/src/utils/import-helper.js.map +1 -1
  246. package/dist/src/utils/imports-util.d.ts +1 -1
  247. package/dist/src/utils/imports-util.d.ts.map +1 -1
  248. package/dist/src/utils/imports-util.js +2 -1
  249. package/dist/src/utils/imports-util.js.map +1 -1
  250. package/dist/src/utils/interfaces.d.ts +3 -3
  251. package/dist/src/utils/interfaces.d.ts.map +1 -1
  252. package/dist/src/utils/interfaces.js +2 -1
  253. package/dist/src/utils/interfaces.js.map +1 -1
  254. package/dist/src/utils/model-utils.d.ts +4 -4
  255. package/dist/src/utils/model-utils.d.ts.map +1 -1
  256. package/dist/src/utils/name-constructors.d.ts +1 -1
  257. package/dist/src/utils/name-constructors.d.ts.map +1 -1
  258. package/dist/src/utils/namespace-utils.d.ts +2 -2
  259. package/dist/src/utils/namespace-utils.d.ts.map +1 -1
  260. package/dist/src/utils/namespace-utils.js +1 -1
  261. package/dist/src/utils/namespace-utils.js.map +1 -1
  262. package/dist/src/utils/operation-helpers.d.ts +2 -2
  263. package/dist/src/utils/operation-helpers.d.ts.map +1 -1
  264. package/dist/src/utils/operation-helpers.js.map +1 -1
  265. package/dist/src/utils/operation-util.d.ts +5 -5
  266. package/dist/src/utils/operation-util.d.ts.map +1 -1
  267. package/dist/src/utils/operation-util.js +1 -1
  268. package/dist/src/utils/operation-util.js.map +1 -1
  269. package/dist/src/utils/parameter-utils.d.ts +3 -3
  270. package/dist/src/utils/parameter-utils.d.ts.map +1 -1
  271. package/dist/src/utils/parameter-utils.js.map +1 -1
  272. package/dist/src/utils/schema-helpers.d.ts +1 -1
  273. package/dist/src/utils/schema-helpers.d.ts.map +1 -1
  274. package/dist/src/utils/schema-helpers.js +1 -1
  275. package/dist/src/utils/schema-helpers.js.map +1 -1
  276. package/dist/src/utils/type-util.d.ts +1 -1
  277. package/dist/src/utils/type-util.d.ts.map +1 -1
  278. package/dist/tsconfig.tsbuildinfo +1 -1
  279. package/package.json +41 -38
  280. package/src/context-manager.ts +6 -6
  281. package/src/framework/declaration.ts +7 -6
  282. package/src/framework/hooks/binder.ts +5 -33
  283. package/src/framework/hooks/sdk-types.ts +8 -8
  284. package/src/framework/hooks/use-dependencies.ts +1 -1
  285. package/src/framework/load-static-helpers.ts +3 -18
  286. package/src/framework/reference.ts +2 -2
  287. package/src/framework/sample.ts +2 -2
  288. package/src/framework/source-file-batch.ts +2 -2
  289. package/src/index.ts +23 -27
  290. package/src/interfaces.ts +0 -1
  291. package/src/lib.ts +3 -4
  292. package/src/meta-tree.ts +2 -2
  293. package/src/metadata/build-api-extractor-config.ts +1 -1
  294. package/src/metadata/build-changelog-file.ts +1 -1
  295. package/src/metadata/build-es-lint-config.ts +1 -1
  296. package/src/metadata/build-package-file.ts +11 -49
  297. package/src/metadata/build-readme-file.ts +4 -4
  298. package/src/metadata/build-sample-env-file.ts +1 -1
  299. package/src/metadata/build-test-config.ts +1 -1
  300. package/src/metadata/build-ts-config.ts +38 -9
  301. package/src/metadata/build-vitest-config.ts +1 -1
  302. package/src/metadata/build-warp-config.ts +1 -3
  303. package/src/metadata/package-json/azure-package-common.ts +1 -1
  304. package/src/metadata/package-json/build-azure-monorepo-package.ts +3 -20
  305. package/src/metadata/package-json/package-common.ts +0 -15
  306. package/src/metadata/test/build-recorded-client.ts +1 -1
  307. package/src/metadata/test/build-sample-test.ts +1 -1
  308. package/src/metadata/test/build-snippets.ts +1 -1
  309. package/src/metadata/utils.ts +1 -1
  310. package/src/modular/build-classical-client.ts +6 -6
  311. package/src/modular/build-classical-operation-groups.ts +6 -3
  312. package/src/modular/build-client-context.ts +3 -3
  313. package/src/modular/build-modular-options.ts +2 -2
  314. package/src/modular/build-operations.ts +12 -9
  315. package/src/modular/build-project-files.ts +2 -2
  316. package/src/modular/build-restore-poller.ts +6 -3
  317. package/src/modular/build-root-index.ts +9 -10
  318. package/src/modular/build-subpath-index.ts +5 -2
  319. package/src/modular/emit-logger-file.ts +1 -1
  320. package/src/modular/emit-models-options.ts +6 -3
  321. package/src/modular/emit-models.ts +23 -33
  322. package/src/modular/emit-samples.ts +11 -11
  323. package/src/modular/emit-tests.ts +3 -3
  324. package/src/modular/external-dependencies.ts +11 -1
  325. package/src/modular/helpers/classical-operation-helpers.ts +10 -7
  326. package/src/modular/helpers/client-helpers.ts +36 -19
  327. package/src/modular/helpers/client-option-helpers.ts +1 -1
  328. package/src/modular/helpers/example-value-helpers.ts +9 -9
  329. package/src/modular/helpers/naming-helpers.ts +55 -7
  330. package/src/modular/helpers/operation-helpers.ts +46 -44
  331. package/src/modular/helpers/type-helpers.ts +3 -3
  332. package/src/modular/interfaces.ts +1 -1
  333. package/src/modular/serialization/build-deserializer-function.ts +9 -9
  334. package/src/modular/serialization/build-serializer-function.ts +9 -9
  335. package/src/modular/serialization/build-xml-serializer-function.ts +7 -7
  336. package/src/modular/serialization/serialize-utils.ts +1 -1
  337. package/src/modular/static-helpers-metadata.ts +0 -13
  338. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  339. package/src/modular/type-expressions/get-enum-expression.ts +3 -3
  340. package/src/modular/type-expressions/get-model-expression.ts +3 -3
  341. package/src/modular/type-expressions/get-nullable-expression.ts +3 -3
  342. package/src/modular/type-expressions/get-type-expression.ts +2 -2
  343. package/src/modular/type-expressions/get-union-expression.ts +3 -3
  344. package/src/modular/type-expressions/utils.ts +1 -1
  345. package/src/transform/transform-api-version-info.ts +8 -3
  346. package/src/transform/transform-client-options.ts +5 -7
  347. package/src/transform/transform-helper-function-details.ts +6 -3
  348. package/src/transform/transform-parameters.ts +15 -11
  349. package/src/transform/transform-paths.ts +10 -4
  350. package/src/transform/transform-responses.ts +11 -8
  351. package/src/transform/transform-schemas.ts +7 -4
  352. package/src/transform/transform-telemetry-info.ts +3 -3
  353. package/src/transform/transform.ts +11 -11
  354. package/src/utils/api-version-util.ts +1 -1
  355. package/src/utils/client-utils.ts +8 -8
  356. package/src/utils/credential-utils.ts +3 -3
  357. package/src/utils/cross-language-def.ts +1 -1
  358. package/src/utils/emit-util.ts +9 -3
  359. package/src/utils/file-system-utils.ts +1 -1
  360. package/src/utils/imports-util.ts +2 -2
  361. package/src/utils/interfaces.ts +3 -3
  362. package/src/utils/model-utils.ts +23 -23
  363. package/src/utils/name-constructors.ts +1 -1
  364. package/src/utils/namespace-utils.ts +8 -2
  365. package/src/utils/operation-helpers.ts +11 -7
  366. package/src/utils/operation-util.ts +23 -16
  367. package/src/utils/parameter-utils.ts +4 -4
  368. package/src/utils/schema-helpers.ts +7 -1
  369. package/src/utils/type-util.ts +1 -1
  370. package/static/static-helpers/multipartHelpers.ts +2 -6
  371. package/static/static-helpers/platform-types-browser.mts +0 -5
  372. package/static/static-helpers/platform-types-react-native.mts +0 -5
  373. package/static/static-helpers/platform-types.ts +0 -7
  374. package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +0 -22
  375. package/static/static-helpers/serialization/get-binary-stream-response-react-native.mts +0 -1
  376. package/static/static-helpers/serialization/get-binary-stream-response.ts +0 -22
@@ -1,6 +1,9 @@
1
- import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
1
+ import type {
2
+ SdkClientType,
3
+ SdkServiceOperation,
4
+ } from "@azure-tools/typespec-client-generator-core";
2
5
  import { joinPaths } from "@typespec/compiler";
3
- import { ModularEmitterOptions } from "./interfaces.js";
6
+ import type { ModularEmitterOptions } from "./interfaces.js";
4
7
 
5
8
  import { Node, SourceFile, StructureKind } from "ts-morph";
6
9
  import { useContext } from "../context-manager.js";
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "../context-manager.js";
2
- import { ModularEmitterOptions } from "./interfaces.js";
2
+ import type { ModularEmitterOptions } from "./interfaces.js";
3
3
 
4
4
  export function emitLoggerFile(emitterOptions: ModularEmitterOptions, srcPath: string = "src") {
5
5
  const project = useContext("outputProject");
@@ -1,11 +1,14 @@
1
1
  import { joinPaths } from "@typespec/compiler";
2
2
 
3
- import { ModularEmitterOptions } from "./interfaces.js";
3
+ import type { ModularEmitterOptions } from "./interfaces.js";
4
4
 
5
- import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
5
+ import type {
6
+ SdkClientType,
7
+ SdkServiceOperation,
8
+ } from "@azure-tools/typespec-client-generator-core";
6
9
  import { useContext } from "../context-manager.js";
7
10
  import { getClientModuleInfo } from "../utils/client-utils.js";
8
- import { SdkContext } from "../utils/interfaces.js";
11
+ import type { SdkContext } from "../utils/interfaces.js";
9
12
  import { NameType, normalizeName } from "../utils/name-utils.js";
10
13
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
11
14
  import { buildOperationOptions } from "./build-operations.js";
@@ -2,31 +2,31 @@ import {
2
2
  isPagedResultModel,
3
3
  isReadOnly,
4
4
  listAllServiceNamespaces,
5
- SdkArrayType,
6
- SdkClientType,
7
- SdkDictionaryType,
8
- SdkEnumType,
9
- SdkEnumValueType,
10
- SdkHttpOperation,
11
- SdkMethod,
12
- SdkModelPropertyType,
13
- SdkModelType,
14
- SdkNullableType,
15
- SdkServiceMethod,
16
- SdkServiceOperation,
17
- SdkType,
18
- SdkUnionType,
5
+ type SdkArrayType,
6
+ type SdkClientType,
7
+ type SdkDictionaryType,
8
+ type SdkEnumType,
9
+ type SdkEnumValueType,
10
+ type SdkHttpOperation,
11
+ type SdkMethod,
12
+ type SdkModelPropertyType,
13
+ type SdkModelType,
14
+ type SdkNullableType,
15
+ type SdkServiceMethod,
16
+ type SdkServiceOperation,
17
+ type SdkType,
18
+ type SdkUnionType,
19
19
  UsageFlags,
20
20
  } from "@azure-tools/typespec-client-generator-core";
21
21
  import {
22
- EnumDeclarationStructure,
23
- EnumMemberStructure,
24
- InterfaceDeclarationStructure,
25
- OptionalKind,
26
- PropertySignatureStructure,
22
+ type EnumDeclarationStructure,
23
+ type EnumMemberStructure,
24
+ type InterfaceDeclarationStructure,
25
+ type OptionalKind,
26
+ type PropertySignatureStructure,
27
27
  SourceFile,
28
28
  StructureKind,
29
- TypeAliasDeclarationStructure,
29
+ type TypeAliasDeclarationStructure,
30
30
  } from "ts-morph";
31
31
  // import { isKey } from "@typespec/compiler";
32
32
  import {
@@ -49,7 +49,7 @@ import { refkey } from "../framework/refkey.js";
49
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
- import { SdkContext } from "../utils/interfaces.js";
52
+ import type { SdkContext } from "../utils/interfaces.js";
53
53
  import { isAzureCoreErrorType } from "../utils/model-utils.js";
54
54
  import { fixLeadingNumber, NameType, normalizeName } from "../utils/name-utils.js";
55
55
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
@@ -95,12 +95,7 @@ type InterfaceStructure = OptionalKind<InterfaceDeclarationStructure> & {
95
95
  function isGenerableType(
96
96
  type: SdkType,
97
97
  ): type is
98
- | SdkModelType
99
- | SdkEnumType
100
- | SdkUnionType
101
- | SdkDictionaryType
102
- | SdkArrayType
103
- | SdkNullableType {
98
+ SdkModelType | SdkEnumType | SdkUnionType | SdkDictionaryType | SdkArrayType | SdkNullableType {
104
99
  return (
105
100
  type.kind === "model" ||
106
101
  type.kind === "enum" ||
@@ -808,12 +803,7 @@ export function getAdditionalPropertiesName(context: SdkContext, model: SdkModel
808
803
  export function normalizeModelName(
809
804
  context: SdkContext,
810
805
  type:
811
- | SdkModelType
812
- | SdkEnumType
813
- | SdkUnionType
814
- | SdkArrayType
815
- | SdkDictionaryType
816
- | SdkNullableType,
806
+ SdkModelType | SdkEnumType | SdkUnionType | SdkArrayType | SdkDictionaryType | SdkNullableType,
817
807
  nameType: NameType = NameType.Interface,
818
808
  skipPolymorphicUnionSuffix = false,
819
809
  rawModelName?: boolean,
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  isReadOnly,
3
- SdkClientInitializationType,
4
- SdkClientType,
5
- SdkExampleValue,
6
- SdkHttpOperationExample,
7
- SdkHttpParameterExampleValue,
8
- SdkModelPropertyType,
9
- SdkServiceOperation,
3
+ type SdkClientInitializationType,
4
+ type SdkClientType,
5
+ type SdkExampleValue,
6
+ type SdkHttpOperationExample,
7
+ type SdkHttpParameterExampleValue,
8
+ type SdkModelPropertyType,
9
+ type SdkServiceOperation,
10
10
  } from "@azure-tools/typespec-client-generator-core";
11
11
  import { joinPaths, NoTarget } from "@typespec/compiler";
12
- import { FunctionDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
12
+ import { type FunctionDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
13
13
  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
17
  import { getSubscriptionId } from "../transform/transform-client-options.js";
18
18
  import { hasKeyCredential, hasTokenCredential } from "../utils/credential-utils.js";
19
- import { SdkContext } from "../utils/interfaces.js";
19
+ import type { SdkContext } from "../utils/interfaces.js";
20
20
  import { NameType, normalizeName } from "../utils/name-utils.js";
21
21
  import {
22
22
  getMethodHierarchiesMap,
23
23
  isTenantLevelOperation,
24
- ServiceOperation,
24
+ type ServiceOperation,
25
25
  } from "../utils/operation-util.js";
26
26
  import {
27
27
  getClientParameterName,
@@ -32,7 +32,7 @@ import {
32
32
  import { getClassicalClientName } from "./helpers/naming-helpers.js";
33
33
  import { getOperationFunction } from "./helpers/operation-helpers.js";
34
34
  import { buildPropertyNameMapper, isSpreadBodyParameter } from "./helpers/type-helpers.js";
35
- import { ModelOverrideOptions } from "./serialization/serialize-utils.js";
35
+ import type { ModelOverrideOptions } from "./serialization/serialize-utils.js";
36
36
 
37
37
  /**
38
38
  * Interfaces for samples generations
@@ -1,13 +1,13 @@
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 { SdkContext } from "../utils/interfaces.js";
4
+ import type { SdkContext } from "../utils/interfaces.js";
5
5
  import { NameType, normalizeName } from "../utils/name-utils.js";
6
- import { ServiceOperation } from "../utils/operation-util.js";
6
+ import type { ServiceOperation } from "../utils/operation-util.js";
7
7
  import { AzureTestDependencies } from "./external-dependencies.js";
8
8
  import {
9
9
  buildParameterValueMap,
10
- ClientEmitOptions,
10
+ type ClientEmitOptions,
11
11
  createSourceFile,
12
12
  generateMethodCall,
13
13
  generateResponseAssertions,
@@ -1,4 +1,4 @@
1
- import { CoreDependencies } from "../framework/dependency.js";
1
+ import type { CoreDependencies } from "../framework/dependency.js";
2
2
 
3
3
  export const DefaultCoreDependencies: CoreDependencies = {
4
4
  Client: {
@@ -207,6 +207,16 @@ export const AzureCoreDependencies: CoreDependencies = {
207
207
  name: "ErrorResponse",
208
208
  module: "@azure-rest/core-client",
209
209
  },
210
+ getBinaryStreamResponse: {
211
+ kind: "externalDependency",
212
+ module: "@azure-rest/core-client",
213
+ name: "getBinaryStreamResponse",
214
+ },
215
+ NodeReadableStream: {
216
+ kind: "externalDependency",
217
+ module: "@azure/core-rest-pipeline",
218
+ name: "NodeReadableStream",
219
+ },
210
220
  };
211
221
 
212
222
  export const AzureIdentityDependencies = {
@@ -1,9 +1,12 @@
1
- import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
1
+ import type {
2
+ SdkClientType,
3
+ SdkServiceOperation,
4
+ } from "@azure-tools/typespec-client-generator-core";
2
5
  import {
3
- FunctionDeclarationStructure,
4
- InterfaceDeclarationStructure,
5
- OptionalKind,
6
- PropertySignatureStructure,
6
+ type FunctionDeclarationStructure,
7
+ type InterfaceDeclarationStructure,
8
+ type OptionalKind,
9
+ type PropertySignatureStructure,
7
10
  SourceFile,
8
11
  StructureKind,
9
12
  } from "ts-morph";
@@ -11,9 +14,9 @@ import { addDeclaration } from "../../framework/declaration.js";
11
14
  import { resolveReference } from "../../framework/reference.js";
12
15
  import { refkey } from "../../framework/refkey.js";
13
16
  import { getClientModuleInfo } from "../../utils/client-utils.js";
14
- import { SdkContext } from "../../utils/interfaces.js";
17
+ import type { SdkContext } from "../../utils/interfaces.js";
15
18
  import { NameType, normalizeName } from "../../utils/name-utils.js";
16
- import { ServiceOperation } from "../../utils/operation-util.js";
19
+ import type { ServiceOperation } from "../../utils/operation-util.js";
17
20
  import { AzurePollingDependencies } from "../external-dependencies.js";
18
21
  import { PagingHelpers, SimplePollerHelpers } from "../static-helpers-metadata.js";
19
22
  import { getClassicalLayerPrefix } from "./naming-helpers.js";
@@ -1,4 +1,4 @@
1
- import {
1
+ import type {
2
2
  SdkClientType,
3
3
  SdkCredentialParameter,
4
4
  SdkEndpointParameter,
@@ -6,11 +6,16 @@ import {
6
6
  SdkMethodParameter,
7
7
  SdkServiceOperation,
8
8
  } from "@azure-tools/typespec-client-generator-core";
9
- import { OptionalKind, ParameterDeclarationStructure, StatementedNode } from "ts-morph";
10
- import { ModularEmitterOptions } from "../interfaces.js";
9
+ import {
10
+ Node,
11
+ type OptionalKind,
12
+ type ParameterDeclarationStructure,
13
+ StatementedNode,
14
+ } from "ts-morph";
15
+ import type { ModularEmitterOptions } from "../interfaces.js";
11
16
 
12
17
  import { resolveReference } from "../../framework/reference.js";
13
- import { SdkContext } from "../../utils/interfaces.js";
18
+ import type { SdkContext } from "../../utils/interfaces.js";
14
19
  import { NameType, normalizeName } from "../../utils/name-utils.js";
15
20
  import { CloudSettingHelpers } from "../static-helpers-metadata.js";
16
21
  import { getTypeExpression } from "../type-expressions/get-type-expression.js";
@@ -27,10 +32,7 @@ interface ClientParameterOptions {
27
32
  }
28
33
 
29
34
  type SdkParameter =
30
- | SdkMethodParameter
31
- | SdkEndpointParameter
32
- | SdkCredentialParameter
33
- | SdkHttpParameter;
35
+ SdkMethodParameter | SdkEndpointParameter | SdkCredentialParameter | SdkHttpParameter;
34
36
 
35
37
  export function hasDefaultValue(p: SdkParameter) {
36
38
  if (p.clientDefaultValue || p.__raw?.defaultValue || p.type.kind === "constant") {
@@ -236,7 +238,7 @@ export function buildGetClientEndpointParam(
236
238
  * @returns - an expression representing the options to be passed in to getClient
237
239
  */
238
240
  export function buildGetClientOptionsParam(
239
- context: StatementedNode,
241
+ context: StatementedNode & Node,
240
242
  emitterOptions: ModularEmitterOptions,
241
243
  endpointParam: string,
242
244
  apiVersionParamName?: string,
@@ -319,23 +321,38 @@ function buildLoggingOptions(): string | undefined {
319
321
  * Core telemetry policy: https://azure.github.io/azure-sdk/general_azurecore.html#telemetry-policy
320
322
  */
321
323
  export function buildUserAgentOptions(
322
- context: StatementedNode,
324
+ context: StatementedNode & Node,
323
325
  emitterOptions: ModularEmitterOptions,
324
326
  ): string {
325
327
  const userAgentStatements = [];
326
328
  const prefixFromOptions = "const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;";
327
329
  userAgentStatements.push(prefixFromOptions);
328
330
 
331
+ const packageName = emitterOptions.options.packageDetails?.name;
329
332
  const clientPackageName =
330
- emitterOptions.options.packageDetails?.nameWithoutScope ??
331
- emitterOptions.options.packageDetails?.name ??
332
- "";
333
- const packageVersion = emitterOptions.options.packageDetails?.version ?? "";
334
-
335
- const userAgentInfoStatement =
336
- packageVersion && clientPackageName
337
- ? "const userAgentInfo = `azsdk-js-" + clientPackageName + "/" + packageVersion + "`;"
338
- : "";
333
+ emitterOptions.options.packageDetails?.nameWithoutScope ?? packageName ?? "";
334
+
335
+ // The version is read from the generated package.json at runtime rather than
336
+ // hardcoded here: once the package is generated, its version is owned by
337
+ // package.json. We import it via the package's own "./package.json" export so
338
+ // the specifier is identical in `src` and the built `dist` output.
339
+ let userAgentInfoStatement = "";
340
+ if (clientPackageName && packageName) {
341
+ const packageJsonModule = `${packageName}/package.json`;
342
+ const sourceFile = context.getSourceFile();
343
+ const hasPackageJsonImport = sourceFile
344
+ .getImportDeclarations()
345
+ .some((declaration) => declaration.getModuleSpecifierValue() === packageJsonModule);
346
+ if (!hasPackageJsonImport) {
347
+ sourceFile.addImportDeclaration({
348
+ defaultImport: "pkgJson",
349
+ moduleSpecifier: packageJsonModule,
350
+ attributes: [{ name: "type", value: "json" }],
351
+ });
352
+ }
353
+ userAgentInfoStatement =
354
+ "const userAgentInfo = `azsdk-js-" + clientPackageName + "/${pkgJson.version}`;";
355
+ }
339
356
 
340
357
  if (!userAgentInfoStatement) {
341
358
  // Without package name/version we cannot build a meaningful telemetry token,
@@ -1,4 +1,4 @@
1
- import { DecoratedType, SdkModelType } from "@azure-tools/typespec-client-generator-core";
1
+ import type { DecoratedType, SdkModelType } from "@azure-tools/typespec-client-generator-core";
2
2
 
3
3
  /**
4
4
  * Represents a header-to-property mapping from @clientOption("header", ...).
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  isReadOnly,
3
- SdkClientInitializationType,
4
- SdkClientType,
5
- SdkExampleValue,
6
- SdkHttpOperationExample,
7
- SdkHttpParameterExampleValue,
8
- SdkModelPropertyType,
9
- SdkServiceOperation,
3
+ type SdkClientInitializationType,
4
+ type SdkClientType,
5
+ type SdkExampleValue,
6
+ type SdkHttpOperationExample,
7
+ type SdkHttpParameterExampleValue,
8
+ type SdkModelPropertyType,
9
+ type SdkServiceOperation,
10
10
  } from "@azure-tools/typespec-client-generator-core";
11
11
  import { joinPaths } from "@typespec/compiler";
12
12
  import { SourceFile } from "ts-morph";
@@ -14,9 +14,9 @@ import { useContext } from "../../context-manager.js";
14
14
  import { resolveReference } from "../../framework/reference.js";
15
15
  import { getSubscriptionId } from "../../transform/transform-client-options.js";
16
16
  import { hasKeyCredential, hasTokenCredential } from "../../utils/credential-utils.js";
17
- import { SdkContext } from "../../utils/interfaces.js";
17
+ import type { SdkContext } from "../../utils/interfaces.js";
18
18
  import { NameType, normalizeName } from "../../utils/name-utils.js";
19
- import { getMethodHierarchiesMap, ServiceOperation } from "../../utils/operation-util.js";
19
+ import { getMethodHierarchiesMap, type ServiceOperation } from "../../utils/operation-util.js";
20
20
  import { AzureIdentityDependencies, AzureTestDependencies } from "../external-dependencies.js";
21
21
  import { getClientParametersDeclaration } from "./client-helpers.js";
22
22
  import { getClassicalClientName } from "./naming-helpers.js";
@@ -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) =>