@azure-tools/typespec-ts 0.56.0-dev.9 → 0.56.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
package/src/lib.ts CHANGED
@@ -1,11 +1,26 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler";
5
- import { Options } from "prettier";
6
- import { PackageDetails } from "./interfaces.js";
4
+ import { createTypeSpecLibrary, type JSONSchemaType, paramMessage } from "@typespec/compiler";
5
+ import type { Options } from "prettier";
6
+ import type { PackageDetails } from "./interfaces.js";
7
7
 
8
8
  export interface EmitterOptions {
9
+ /**
10
+ * Use this flag if you would like to generate the sdk only for a specific version.
11
+ * Also accepts values `latest` and `all`, or a map from service namespace full name to version for multi-service packages.
12
+ */
13
+ "api-version"?: string | Record<string, string>;
14
+ /**
15
+ * Specifies the directory where the emitter will look for example files.
16
+ * Defaults to an `examples` directory located at the project root.
17
+ */
18
+ "examples-dir"?: string;
19
+ /**
20
+ * Specifies the namespace you want to override for namespaces set in the spec.
21
+ * With this config, all namespace for the spec types will default to it.
22
+ */
23
+ namespace?: string;
9
24
  /**
10
25
  * Indicates whether to include response headers in the generated response type for modular operations.
11
26
  * When set to true, modular operation responses with model or void bodies will have their headers
@@ -50,8 +65,6 @@ export interface EmitterOptions {
50
65
  "ignore-property-name-normalize"?: boolean;
51
66
  "typespec-title-map"?: Record<string, string>;
52
67
  "ignore-enum-member-name-normalize"?: boolean;
53
- //TODO should remove this after finish the release tool test
54
- "should-use-pnpm-dep"?: boolean;
55
68
  "ignore-nullable-on-optional"?: boolean;
56
69
  /**
57
70
  * When set to true (default for Azure services), non-model return types (arrays, scalars, enums,
@@ -84,6 +97,31 @@ export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
84
97
  type: "object",
85
98
  additionalProperties: true,
86
99
  properties: {
100
+ "api-version": {
101
+ oneOf: [
102
+ { type: "string", nullable: true },
103
+ {
104
+ type: "object",
105
+ additionalProperties: { type: "string" },
106
+ required: [],
107
+ nullable: true,
108
+ },
109
+ ],
110
+ description:
111
+ "Use this flag if you would like to generate the sdk only for a specific version. Default value is the latest version. Also accepts values `latest` and `all`. For multi-service packages, provide a map from each service namespace's full name to its desired version; services not listed default to their latest version.",
112
+ } as any,
113
+ "examples-dir": {
114
+ type: "string",
115
+ nullable: true,
116
+ description:
117
+ "Specifies the directory where the emitter will look for example files. If the flag isn't set, the emitter defaults to using an `examples` directory located at the project root.",
118
+ },
119
+ namespace: {
120
+ type: "string",
121
+ nullable: true,
122
+ description:
123
+ "Specifies the namespace you want to override for namespaces set in the spec. With this config, all namespace for the spec types will default to it.",
124
+ },
87
125
  "include-headers-in-response": {
88
126
  type: "boolean",
89
127
  nullable: true,
@@ -99,7 +137,6 @@ export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
99
137
  nameWithoutScope: { type: "string", nullable: true },
100
138
  description: { type: "string", nullable: true },
101
139
  version: { type: "string", nullable: true },
102
- isVersionUserProvided: { type: "boolean", nullable: true },
103
140
  },
104
141
  required: ["name"],
105
142
  nullable: true,
@@ -245,11 +282,6 @@ export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
245
282
  "```",
246
283
  ].join("\n"),
247
284
  },
248
- "should-use-pnpm-dep": {
249
- type: "boolean",
250
- nullable: true,
251
- description: "Internal option for test.",
252
- },
253
285
  "ignore-nullable-on-optional": {
254
286
  type: "boolean",
255
287
  nullable: true,
package/src/meta-tree.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Type } from "@typespec/compiler";
2
- import { Schema } from "./interfaces.js";
1
+ import type { Type } from "@typespec/compiler";
2
+ import type { Schema } from "./interfaces.js";
3
3
 
4
4
  export interface ClientTypeMetadata {
5
5
  clientType: Schema;
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
 
7
7
  export function buildApiExtractorConfig(_model: ClientModel) {
8
8
  const project = new Project({ useInMemoryFileSystem: true });
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
 
6
6
  function getPackageVersion(model: ClientModel): string {
7
7
  return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
 
7
7
  const esLintConfigEsmAzureSdk = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
8
8
 
@@ -2,21 +2,20 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project, SourceFile } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
  import { hasPollingOperations } from "../utils/operation-helpers.js";
7
7
  import { buildAzureMonorepoPackage } from "./package-json/build-azure-monorepo-package.js";
8
- import { PackageCommonInfoConfig, resolveWarpExports } from "./package-json/package-common.js";
8
+ import { type PackageCommonInfoConfig, resolveWarpExports } from "./package-json/package-common.js";
9
9
  import { getPackageName } from "./utils.js";
10
10
 
11
11
  interface PackageFileOptions {
12
12
  exports?: Record<string, any>;
13
13
  dependencies?: Record<string, string>;
14
- clientContextPaths?: string[];
15
14
  }
16
15
 
17
16
  export function buildPackageFile(
18
17
  model: ClientModel,
19
- { exports, dependencies, clientContextPaths }: PackageFileOptions = {},
18
+ { exports, dependencies }: PackageFileOptions = {},
20
19
  ) {
21
20
  const config: PackageCommonInfoConfig = {
22
21
  description: getDescription(model),
@@ -35,7 +34,6 @@ export function buildPackageFile(
35
34
  hasLro: hasPollingOperations(model),
36
35
  monorepoPackageDirectory: model.options?.azureOutputDirectory,
37
36
  dependencies,
38
- clientContextPaths,
39
37
  };
40
38
 
41
39
  const packageInfo: Record<string, any> = buildAzureMonorepoPackage(extendedConfig);
@@ -63,17 +61,15 @@ export function buildPackageFile(
63
61
  * - Adds LRO dependencies (`@azure/core-lro`, `@azure/abort-controller`) when the package has
64
62
  * polling operations (for non-monorepo Azure packages).
65
63
  * - Updates exports (tshy or warp) when `exports` is provided.
66
- * - Updates `//metadata.constantPaths` when `clientContextPaths` is provided.
67
64
  */
68
65
  export function updatePackageFile(
69
66
  model: ClientModel,
70
67
  existingFilePathOrContent: string | Record<string, any>,
71
- { exports, clientContextPaths }: PackageFileOptions = {},
68
+ { exports }: PackageFileOptions = {},
72
69
  ) {
73
70
  const hasLro = hasPollingOperations(model);
74
71
  const needsLroUpdate = hasLro;
75
72
  const needsExportsUpdate = exports;
76
- const needsConstantPathsUpdate = clientContextPaths && clientContextPaths.length > 0;
77
73
 
78
74
  let packageInfo;
79
75
  if (typeof existingFilePathOrContent === "string") {
@@ -99,30 +95,6 @@ export function updatePackageFile(
99
95
  needsCoreClientUpdate = true;
100
96
  }
101
97
 
102
- // Ensure warp packages have #platform/* imports for polyfill resolution.
103
- // The `react-native` condition is only added when explicitly opted in via
104
- // `generateReactNativeTarget`, matching the fresh-generation path in
105
- // `getEsmEntrypointInformation` (packageCommon.ts).
106
- const platformImports: Record<string, string> = {
107
- browser: "./src/*-browser.mts",
108
- default: "./src/*.ts",
109
- };
110
- if (model.options?.generateReactNativeTarget) {
111
- // Insert `react-native` before `default` so Node's conditional
112
- // resolution order matches the fresh-generation output.
113
- packageInfo.imports = {
114
- "#platform/*": {
115
- browser: platformImports["browser"],
116
- "react-native": "./src/*-react-native.mts",
117
- default: platformImports["default"],
118
- },
119
- };
120
- } else {
121
- packageInfo.imports = {
122
- "#platform/*": platformImports,
123
- };
124
- }
125
-
126
98
  // Update exports (warp: resolved exports in package.json)
127
99
  if (needsExportsUpdate) {
128
100
  packageInfo.exports = resolveWarpExports(exports, model.options?.generateReactNativeTarget);
@@ -131,9 +103,6 @@ export function updatePackageFile(
131
103
  // Update Core Client dependency
132
104
  if (needsCoreClientUpdate) {
133
105
  delete deps["@azure/core-client"];
134
- if (!("@azure-rest/core-client" in deps)) {
135
- deps["@azure-rest/core-client"] = "^2.3.1";
136
- }
137
106
  packageInfo.dependencies = deps;
138
107
  }
139
108
 
@@ -146,20 +115,13 @@ export function updatePackageFile(
146
115
  };
147
116
  }
148
117
 
149
- // Update constantPaths metadata for Azure packages
150
- if (needsConstantPathsUpdate && packageInfo["//metadata"]) {
151
- const metadata = packageInfo["//metadata"];
152
- // Filter out existing userAgentInfo entries
153
- const nonUserAgentPaths = (metadata.constantPaths || []).filter(
154
- (item: any) => item.prefix !== "userAgentInfo",
155
- );
156
- // Add new userAgentInfo entries from clientContextPaths
157
- const newUserAgentPaths = clientContextPaths!.map((path) => ({
158
- path: path,
159
- prefix: "userAgentInfo",
160
- }));
161
- metadata.constantPaths = [...nonUserAgentPaths, ...newUserAgentPaths];
162
- }
118
+ // Always update @azure/core-rest-pipeline and @azure-rest/core-client to the latest
119
+ // versions because our imports rely on APIs from those latest package versions.
120
+ packageInfo.dependencies = {
121
+ ...packageInfo.dependencies,
122
+ "@azure/core-rest-pipeline": "^1.24.0",
123
+ "@azure-rest/core-client": "^2.7.0",
124
+ };
163
125
 
164
126
  return {
165
127
  path: "package.json",
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
  import { getClientName } from "../utils/name-constructors.js";
6
6
  import { NameType, normalizeName } from "../utils/name-utils.js";
7
7
  import { renderTemplate } from "./render-template.js";
@@ -276,13 +276,13 @@ function createMetadata(model: ClientModel): Metadata | undefined {
276
276
  const clientClassName = getClientName(model);
277
277
  const serviceName = getServiceName(model);
278
278
  let apiRefUrlQueryParameter: string = "";
279
- if (!packageDetails?.isVersionUserProvided && model.apiVersionInfo?.defaultValue) {
279
+ if (!packageDetails?.version && model.apiVersionInfo?.defaultValue) {
280
280
  if (model.apiVersionInfo?.defaultValue?.toLowerCase().includes("preview")) {
281
281
  apiRefUrlQueryParameter = "?view=azure-node-preview";
282
282
  }
283
283
  } else {
284
- packageDetails.version = packageDetails.version ?? "1.0.0-beta.1";
285
- if (packageDetails?.version.includes("beta")) {
284
+ const packageVersion = packageDetails.version ?? "1.0.0-beta.1";
285
+ if (packageVersion.includes("beta")) {
286
286
  apiRefUrlQueryParameter = "?view=azure-node-preview";
287
287
  }
288
288
  }
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { ClientModel } from "../interfaces.js";
3
+ import type { ClientModel } from "../interfaces.js";
4
4
 
5
5
  const sampleEnvText = `
6
6
  # Feel free to add your own environment variables.
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
  import { getPackageName } from "./utils.js";
6
6
 
7
7
  function shouldGenerateTestConfig(model: ClientModel): boolean {
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
 
7
7
  /**
8
8
  * Builds the root tsconfig.json.
@@ -52,16 +52,36 @@ export function buildTsConfig(model: ClientModel) {
52
52
  };
53
53
  }
54
54
 
55
+ /**
56
+ * Derives the tsconfig `include` list from the warp `exports` map so every
57
+ * exported client entry point is compiled and emitted to `dist`; if they drift
58
+ * out of sync, warp fails the build with `DIST_MISSING`. Root index is the fallback.
59
+ */
60
+ export function getSrcIncludePaths(exports?: Record<string, string>): string[] {
61
+ const includes = new Set<string>(["../src/index.ts"]);
62
+ if (exports) {
63
+ for (const value of Object.values(exports)) {
64
+ if (typeof value === "string" && value.endsWith(".ts")) {
65
+ includes.add(value.replace(/^\.\//, "../"));
66
+ }
67
+ }
68
+ }
69
+ return Array.from(includes);
70
+ }
71
+
55
72
  /**
56
73
  * Builds config/tsconfig.src.esm.json — extends eng/tsconfigs/src.esm.json
57
74
  */
58
- export function buildTsSrcEsmConfig() {
75
+ export function buildTsSrcEsmConfig(exports?: Record<string, string>) {
59
76
  return {
60
77
  path: "config/tsconfig.src.esm.json",
61
78
  content: JSON.stringify(
62
79
  {
63
80
  extends: "../../../../eng/tsconfigs/src.esm.json",
64
- include: ["../src/index.ts"],
81
+ compilerOptions: {
82
+ resolveJsonModule: true,
83
+ },
84
+ include: getSrcIncludePaths(exports),
65
85
  },
66
86
  null,
67
87
  2,
@@ -72,13 +92,16 @@ export function buildTsSrcEsmConfig() {
72
92
  /**
73
93
  * Builds config/tsconfig.src.browser.json — extends eng/tsconfigs/src.browser.json
74
94
  */
75
- export function buildTsSrcBrowserConfig() {
95
+ export function buildTsSrcBrowserConfig(exports?: Record<string, string>) {
76
96
  return {
77
97
  path: "config/tsconfig.src.browser.json",
78
98
  content: JSON.stringify(
79
99
  {
80
100
  extends: "../../../../eng/tsconfigs/src.browser.json",
81
- include: ["../src/index.ts"],
101
+ compilerOptions: {
102
+ resolveJsonModule: true,
103
+ },
104
+ include: getSrcIncludePaths(exports),
82
105
  },
83
106
  null,
84
107
  2,
@@ -89,13 +112,16 @@ export function buildTsSrcBrowserConfig() {
89
112
  /**
90
113
  * Builds config/tsconfig.src.react-native.json — extends eng/tsconfigs/src.react-native.json
91
114
  */
92
- export function buildTsSrcReactNativeConfig() {
115
+ export function buildTsSrcReactNativeConfig(exports?: Record<string, string>) {
93
116
  return {
94
117
  path: "config/tsconfig.src.react-native.json",
95
118
  content: JSON.stringify(
96
119
  {
97
120
  extends: "../../../../eng/tsconfigs/src.react-native.json",
98
- include: ["../src/index.ts"],
121
+ compilerOptions: {
122
+ resolveJsonModule: true,
123
+ },
124
+ include: getSrcIncludePaths(exports),
99
125
  },
100
126
  null,
101
127
  2,
@@ -106,13 +132,16 @@ export function buildTsSrcReactNativeConfig() {
106
132
  /**
107
133
  * Builds config/tsconfig.src.cjs.json — extends eng/tsconfigs/src.cjs.json
108
134
  */
109
- export function buildTsSrcCjsConfig() {
135
+ export function buildTsSrcCjsConfig(exports?: Record<string, string>) {
110
136
  return {
111
137
  path: "config/tsconfig.src.cjs.json",
112
138
  content: JSON.stringify(
113
139
  {
114
140
  extends: "../../../../eng/tsconfigs/src.cjs.json",
115
- include: ["../src/index.ts"],
141
+ compilerOptions: {
142
+ resolveJsonModule: true,
143
+ },
144
+ include: getSrcIncludePaths(exports),
116
145
  },
117
146
  null,
118
147
  2,
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
 
6
6
  const nodeConfig = `import viteConfig from "../../../vitest.shared.config.ts";
7
7
 
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
 
6
6
  export interface WarpConfigOptions {
7
7
  /** Source-level exports, e.g. { ".": "./src/index.ts", "./models": "./src/models/index.ts" } */
@@ -61,8 +61,6 @@ targets:
61
61
  * Builds a self-contained warp.config.yml file.
62
62
  *
63
63
  * Emits a full inline config with all exports and targets.
64
- * Polyfill resolution (browser/react-native file substitution) is handled
65
- * via package.json `imports` subpath imports (#platform/*).
66
64
  *
67
65
  * By default, react-native target is NOT included. Set `generateReactNativeTarget: true`
68
66
  * in options to include it.
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { PackageCommonInfoConfig } from "./package-common.js";
4
+ import type { PackageCommonInfoConfig } from "./package-common.js";
5
5
 
6
6
  export interface AzurePackageInfoConfig extends PackageCommonInfoConfig {
7
7
  hasLro: boolean;
@@ -1,12 +1,11 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { AzurePackageInfoConfig, getAzureCommonPackageInfo } from "./azure-package-common.js";
4
+ import { type AzurePackageInfoConfig, getAzureCommonPackageInfo } from "./azure-package-common.js";
5
5
  import { getCommonPackageScripts, getPackageCommonInfo } from "./package-common.js";
6
6
 
7
7
  export interface AzureMonorepoInfoConfig extends AzurePackageInfoConfig {
8
8
  monorepoPackageDirectory?: string;
9
- clientContextPaths?: string[];
10
9
  }
11
10
 
12
11
  /**
@@ -32,7 +31,7 @@ export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
32
31
  // revert this change after sdk repo update.
33
32
  const runtimeDeps = {
34
33
  ...dependencies,
35
- "@azure-rest/core-client": "^2.3.1",
34
+ "@azure-rest/core-client": "^2.7.0",
36
35
  ...(hasLro && {
37
36
  "@azure/abort-controller": "^2.1.2",
38
37
  }),
@@ -40,7 +39,7 @@ export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
40
39
  ...(hasLro && {
41
40
  "@azure/core-lro": "^3.1.0",
42
41
  }),
43
- "@azure/core-rest-pipeline": "^1.20.0",
42
+ "@azure/core-rest-pipeline": "^1.24.0",
44
43
  "@azure/core-util": "^1.12.0",
45
44
  "@azure/logger": "^1.2.0",
46
45
  tslib: "catalog:",
@@ -101,7 +100,6 @@ export function getAzureMonorepoPackageInfo(config: AzureMonorepoInfoConfig): Re
101
100
  homepage: `https://github.com/Azure/azure-sdk-for-js/tree/main/${config.monorepoPackageDirectory}/README.md`,
102
101
  }),
103
102
  prettier: "@azure/eslint-plugin-azure-sdk/prettier.json",
104
- "//metadata": getMetadataInfo(config),
105
103
  };
106
104
  }
107
105
 
@@ -162,18 +160,3 @@ function getEsmScripts() {
162
160
  test: "tsc -b --noEmit && npm run test:node && npm run test:browser",
163
161
  };
164
162
  }
165
-
166
- function getMetadataInfo(config: AzureMonorepoInfoConfig) {
167
- const metadata: Record<string, any> = {
168
- constantPaths: [],
169
- };
170
- const paths = config.clientContextPaths;
171
- for (const path of paths ?? []) {
172
- metadata["constantPaths"].push({
173
- path: path,
174
- prefix: "userAgentInfo",
175
- });
176
- }
177
-
178
- return metadata;
179
- }
@@ -45,26 +45,11 @@ function getEntryPointInformation(config: PackageCommonInfoConfig) {
45
45
  module: "./dist/esm/index.js",
46
46
  types: "./dist/commonjs/index.d.ts",
47
47
  browser: "./dist/browser/index.js",
48
- imports: {
49
- "#platform/*": {
50
- browser: "./src/*-browser.mts",
51
- default: "./src/*.ts",
52
- } as Record<string, string>,
53
- },
54
48
  exports: resolveWarpExports(config.exports, config.generateReactNativeTarget),
55
49
  };
56
50
 
57
51
  if (config.generateReactNativeTarget) {
58
52
  result["react-native"] = "./dist/react-native/index.js";
59
- (result["imports"]["#platform/*"] as Record<string, string>)["react-native"] =
60
- "./src/*-react-native.mts";
61
- // Reorder so react-native comes before default
62
- const importsEntry = result["imports"]["#platform/*"] as Record<string, string>;
63
- result["imports"]["#platform/*"] = {
64
- browser: importsEntry["browser"],
65
- "react-native": importsEntry["react-native"],
66
- default: importsEntry["default"],
67
- };
68
53
  }
69
54
 
70
55
  return result;
@@ -1,4 +1,4 @@
1
- import { ClientModel } from "../../interfaces.js";
1
+ import type { ClientModel } from "../../interfaces.js";
2
2
  import { recordedClientContent } from "./template.js";
3
3
 
4
4
  export function buildRecordedClientFile(_model: ClientModel) {
@@ -1,4 +1,4 @@
1
- import { ClientModel } from "../../interfaces.js";
1
+ import type { ClientModel } from "../../interfaces.js";
2
2
  import { sampleTestContent } from "./template.js";
3
3
 
4
4
  export function buildSampleTest(_model: ClientModel) {
@@ -1,4 +1,4 @@
1
- import { ClientModel } from "../../interfaces.js";
1
+ import type { ClientModel } from "../../interfaces.js";
2
2
  import { getClientName } from "../../utils/name-constructors.js";
3
3
  import { renderTemplate } from "../render-template.js";
4
4
  import { snippetsContent } from "./template.js";
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
 
6
6
  export function getPackageName(model: ClientModel): string {
7
7
  return model.options?.packageDetails?.name ?? model.libraryName;
@@ -1,26 +1,26 @@
1
1
  import {
2
2
  ClassDeclaration,
3
- MethodDeclarationStructure,
3
+ type MethodDeclarationStructure,
4
4
  Scope,
5
5
  SourceFile,
6
6
  StructureKind,
7
7
  } from "ts-morph";
8
- import { buildUserAgentOptions, getClientParametersDeclaration } from "./helpers/client-helpers.js";
8
+ import { getClientParametersDeclaration } from "./helpers/client-helpers.js";
9
9
  import { getClassicalClientName, getClientName } from "./helpers/naming-helpers.js";
10
- import { ModularEmitterOptions } from "./interfaces.js";
10
+ import type { ModularEmitterOptions } from "./interfaces.js";
11
11
 
12
12
  import {
13
13
  InitializedByFlags,
14
- SdkClientType,
15
- SdkServiceMethod,
16
- SdkServiceOperation,
14
+ type SdkClientType,
15
+ type SdkServiceMethod,
16
+ type SdkServiceOperation,
17
17
  } from "@azure-tools/typespec-client-generator-core";
18
18
  import { useContext } from "../context-manager.js";
19
19
  import { useDependencies } from "../framework/hooks/use-dependencies.js";
20
20
  import { resolveReference } from "../framework/reference.js";
21
21
  import { refkey } from "../framework/refkey.js";
22
22
  import { getClientModuleInfo, isMultiEndpointClient } from "../utils/client-utils.js";
23
- import { SdkContext } from "../utils/interfaces.js";
23
+ import type { SdkContext } from "../utils/interfaces.js";
24
24
  import { NameType, normalizeName } from "../utils/name-utils.js";
25
25
  import { getMethodHierarchiesMap, isTenantLevelOperation } from "../utils/operation-util.js";
26
26
  import { AzurePollingDependencies } from "./external-dependencies.js";
@@ -127,11 +127,7 @@ export function buildClassicalClient(
127
127
  .map((p) => p.name)
128
128
  .map((x) => {
129
129
  if (x === "options") {
130
- return `{...options, userAgentOptions: ${buildUserAgentOptions(
131
- constructor,
132
- emitterOptions,
133
- "azsdk-js-client",
134
- )}}`;
130
+ return `options`;
135
131
  } else if (x.toLowerCase() === "subscriptionid" && shouldSubscriptionIdOptional) {
136
132
  return `subscriptionId ?? ""`;
137
133
  } else {
@@ -1,13 +1,16 @@
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 { SourceFile } from "ts-morph";
3
6
  import { useContext } from "../context-manager.js";
4
7
  import { getClientModuleInfo } from "../utils/client-utils.js";
5
- import { SdkContext } from "../utils/interfaces.js";
8
+ import type { SdkContext } from "../utils/interfaces.js";
6
9
  import { NameType } from "../utils/name-utils.js";
7
10
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
8
11
  import { getClassicalOperation } from "./helpers/classical-operation-helpers.js";
9
12
  import { getClassicalLayerPrefix } from "./helpers/naming-helpers.js";
10
- import { ModularEmitterOptions } from "./interfaces.js";
13
+ import type { ModularEmitterOptions } from "./interfaces.js";
11
14
 
12
15
  export function buildClassicOperationFiles(
13
16
  dpgContext: SdkContext,
@@ -6,9 +6,9 @@ import {
6
6
  getClientParameters,
7
7
  getClientParametersDeclaration,
8
8
  } from "./helpers/client-helpers.js";
9
- import { ModularEmitterOptions } from "./interfaces.js";
9
+ import type { ModularEmitterOptions } from "./interfaces.js";
10
10
 
11
- import {
11
+ import type {
12
12
  SdkClientType,
13
13
  SdkCredentialParameter,
14
14
  SdkEndpointParameter,
@@ -24,7 +24,7 @@ import { resolveReference } from "../framework/reference.js";
24
24
  import { refkey } from "../framework/refkey.js";
25
25
  import { reportDiagnostic } from "../lib.js";
26
26
  import { getClientModuleInfo } from "../utils/client-utils.js";
27
- import { SdkContext } from "../utils/interfaces.js";
27
+ import type { SdkContext } from "../utils/interfaces.js";
28
28
  import { NameType, normalizeName } from "../utils/name-utils.js";
29
29
  import { buildEnumTypes, getApiVersionEnum } from "./emit-models.js";
30
30
  import { getDocsFromDescription } from "./helpers/docs-helpers.js";
@@ -1,5 +1,5 @@
1
- import { SdkContext } from "../utils/interfaces.js";
2
- import { ModularEmitterOptions } from "./interfaces.js";
1
+ import type { SdkContext } from "../utils/interfaces.js";
2
+ import type { ModularEmitterOptions } from "./interfaces.js";
3
3
 
4
4
  let CASING: "camel" | "snake" = "snake";
5
5