@azure-tools/typespec-ts 0.54.0-dev.5 → 0.54.0-dev.7

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 (506) hide show
  1. package/dist/src/contextManager.d.ts +5 -5
  2. package/dist/src/contextManager.d.ts.map +1 -1
  3. package/dist/src/contextManager.js.map +1 -1
  4. package/dist/src/framework/declaration.d.ts +1 -1
  5. package/dist/src/framework/declaration.d.ts.map +1 -1
  6. package/dist/src/framework/declaration.js +2 -4
  7. package/dist/src/framework/declaration.js.map +1 -1
  8. package/dist/src/framework/dependency.d.ts.map +1 -1
  9. package/dist/src/framework/hooks/binder.d.ts +1 -1
  10. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  11. package/dist/src/framework/hooks/binder.js +12 -20
  12. package/dist/src/framework/hooks/binder.js.map +1 -1
  13. package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
  14. package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
  15. package/dist/src/framework/hooks/sdkTypes.js +8 -11
  16. package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
  17. package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
  18. package/dist/src/framework/hooks/useDependencies.js +1 -1
  19. package/dist/src/framework/hooks/useDependencies.js.map +1 -1
  20. package/dist/src/framework/load-static-helpers.d.ts +1 -1
  21. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  22. package/dist/src/framework/load-static-helpers.js +12 -25
  23. package/dist/src/framework/load-static-helpers.js.map +1 -1
  24. package/dist/src/framework/reference.d.ts.map +1 -1
  25. package/dist/src/framework/reference.js +1 -1
  26. package/dist/src/framework/reference.js.map +1 -1
  27. package/dist/src/framework/sample.js +8 -8
  28. package/dist/src/framework/sample.js.map +1 -1
  29. package/dist/src/index.d.ts +1 -1
  30. package/dist/src/index.d.ts.map +1 -1
  31. package/dist/src/index.js +47 -48
  32. package/dist/src/index.js.map +1 -1
  33. package/dist/src/lib.d.ts +1 -1
  34. package/dist/src/lib.d.ts.map +1 -1
  35. package/dist/src/lib.js +140 -140
  36. package/dist/src/lib.js.map +1 -1
  37. package/dist/src/metaTree.d.ts +1 -1
  38. package/dist/src/metaTree.d.ts.map +1 -1
  39. package/dist/src/modular/buildClassicalClient.d.ts +1 -1
  40. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
  41. package/dist/src/modular/buildClassicalClient.js +49 -62
  42. package/dist/src/modular/buildClassicalClient.js.map +1 -1
  43. package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
  44. package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
  45. package/dist/src/modular/buildClassicalOperationGroups.js +4 -7
  46. package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
  47. package/dist/src/modular/buildClientContext.d.ts +2 -2
  48. package/dist/src/modular/buildClientContext.d.ts.map +1 -1
  49. package/dist/src/modular/buildClientContext.js +30 -36
  50. package/dist/src/modular/buildClientContext.js.map +1 -1
  51. package/dist/src/modular/buildModularOptions.d.ts +1 -1
  52. package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
  53. package/dist/src/modular/buildModularOptions.js +2 -2
  54. package/dist/src/modular/buildModularOptions.js.map +1 -1
  55. package/dist/src/modular/buildOperations.d.ts +3 -3
  56. package/dist/src/modular/buildOperations.d.ts.map +1 -1
  57. package/dist/src/modular/buildOperations.js +22 -23
  58. package/dist/src/modular/buildOperations.js.map +1 -1
  59. package/dist/src/modular/buildProjectFiles.d.ts +1 -1
  60. package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
  61. package/dist/src/modular/buildProjectFiles.js +7 -9
  62. package/dist/src/modular/buildProjectFiles.js.map +1 -1
  63. package/dist/src/modular/buildRestorePoller.d.ts +1 -1
  64. package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
  65. package/dist/src/modular/buildRestorePoller.js +11 -11
  66. package/dist/src/modular/buildRestorePoller.js.map +1 -1
  67. package/dist/src/modular/buildRootIndex.d.ts +2 -2
  68. package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
  69. package/dist/src/modular/buildRootIndex.js +30 -39
  70. package/dist/src/modular/buildRootIndex.js.map +1 -1
  71. package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
  72. package/dist/src/modular/buildSubpathIndex.js +9 -17
  73. package/dist/src/modular/buildSubpathIndex.js.map +1 -1
  74. package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
  75. package/dist/src/modular/emitLoggerFile.js +2 -2
  76. package/dist/src/modular/emitLoggerFile.js.map +1 -1
  77. package/dist/src/modular/emitModels.d.ts +1 -1
  78. package/dist/src/modular/emitModels.d.ts.map +1 -1
  79. package/dist/src/modular/emitModels.js +54 -72
  80. package/dist/src/modular/emitModels.js.map +1 -1
  81. package/dist/src/modular/emitModelsOptions.d.ts +1 -1
  82. package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
  83. package/dist/src/modular/emitModelsOptions.js +6 -7
  84. package/dist/src/modular/emitModelsOptions.js.map +1 -1
  85. package/dist/src/modular/emitSamples.d.ts.map +1 -1
  86. package/dist/src/modular/emitSamples.js +40 -52
  87. package/dist/src/modular/emitSamples.js.map +1 -1
  88. package/dist/src/modular/emitTests.d.ts.map +1 -1
  89. package/dist/src/modular/emitTests.js +9 -12
  90. package/dist/src/modular/emitTests.js.map +1 -1
  91. package/dist/src/modular/external-dependencies.js +54 -54
  92. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
  93. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
  94. package/dist/src/modular/helpers/classicalOperationHelpers.js +27 -36
  95. package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
  96. package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
  97. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
  98. package/dist/src/modular/helpers/clientHelpers.js +20 -38
  99. package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
  100. package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
  101. package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
  102. package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
  103. package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
  104. package/dist/src/modular/helpers/exampleValueHelpers.js +39 -58
  105. package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
  106. package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
  107. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
  108. package/dist/src/modular/helpers/namingHelpers.js +4 -5
  109. package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
  110. package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
  111. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
  112. package/dist/src/modular/helpers/operationHelpers.js +136 -196
  113. package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
  114. package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
  115. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
  116. package/dist/src/modular/helpers/typeHelpers.js +1 -1
  117. package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
  118. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
  119. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
  120. package/dist/src/modular/serialization/buildDeserializerFunction.js +50 -56
  121. package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
  122. package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
  123. package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
  124. package/dist/src/modular/serialization/buildSerializerFunction.js +52 -59
  125. package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
  126. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
  127. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
  128. package/dist/src/modular/serialization/buildXmlSerializerFunction.js +43 -51
  129. package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
  130. package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
  131. package/dist/src/modular/serialization/serializeUtils.js +4 -11
  132. package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
  133. package/dist/src/modular/static-helpers-metadata.js +60 -60
  134. package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
  135. package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
  136. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
  137. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  138. package/dist/src/modular/type-expressions/get-enum-expression.js +1 -1
  139. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  140. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  141. package/dist/src/modular/type-expressions/get-model-expression.js +7 -9
  142. package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
  143. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
  144. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  145. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  146. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  147. package/dist/src/modular/type-expressions/get-type-expression.js +4 -8
  148. package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
  149. package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
  150. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  151. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  152. package/dist/src/rlc-common/buildClient.d.ts +1 -1
  153. package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
  154. package/dist/src/rlc-common/buildClient.js +48 -66
  155. package/dist/src/rlc-common/buildClient.js.map +1 -1
  156. package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
  157. package/dist/src/rlc-common/buildClientDefinitions.js +24 -42
  158. package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
  159. package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
  160. package/dist/src/rlc-common/buildIndexFile.js +57 -57
  161. package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
  162. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
  163. package/dist/src/rlc-common/buildIsUnexpectedHelper.js +32 -35
  164. package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
  165. package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
  166. package/dist/src/rlc-common/buildLogger.js +3 -3
  167. package/dist/src/rlc-common/buildLogger.js.map +1 -1
  168. package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
  169. package/dist/src/rlc-common/buildMethodShortcuts.js +3 -3
  170. package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
  171. package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
  172. package/dist/src/rlc-common/buildObjectTypes.js +29 -46
  173. package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
  174. package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
  175. package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
  176. package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
  177. package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
  178. package/dist/src/rlc-common/buildParameterTypes.js +42 -50
  179. package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
  180. package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
  181. package/dist/src/rlc-common/buildPollingHelper.js +5 -5
  182. package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
  183. package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
  184. package/dist/src/rlc-common/buildResponseTypes.js +19 -22
  185. package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
  186. package/dist/src/rlc-common/buildSamples.d.ts +1 -1
  187. package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
  188. package/dist/src/rlc-common/buildSamples.js +2 -2
  189. package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
  190. package/dist/src/rlc-common/buildSchemaType.js +9 -13
  191. package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
  192. package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
  193. package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
  194. package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
  195. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
  196. package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
  197. package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
  198. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
  199. package/dist/src/rlc-common/helpers/apiVersionUtil.js +2 -3
  200. package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
  201. package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
  202. package/dist/src/rlc-common/helpers/importsUtil.js +23 -25
  203. package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
  204. package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
  205. package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
  206. package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
  207. package/dist/src/rlc-common/helpers/nameUtils.js +8 -13
  208. package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
  209. package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
  210. package/dist/src/rlc-common/helpers/operationHelpers.js +8 -12
  211. package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
  212. package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
  213. package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
  214. package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
  215. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
  216. package/dist/src/rlc-common/helpers/schemaHelpers.js +1 -1
  217. package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
  218. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
  219. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
  220. package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
  221. package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
  222. package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
  223. package/dist/src/rlc-common/helpers/typeUtil.js +1 -2
  224. package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
  225. package/dist/src/rlc-common/helpers/valueGenerationUtil.js +3 -4
  226. package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
  227. package/dist/src/rlc-common/index.d.ts +28 -28
  228. package/dist/src/rlc-common/index.d.ts.map +1 -1
  229. package/dist/src/rlc-common/index.js +28 -28
  230. package/dist/src/rlc-common/index.js.map +1 -1
  231. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  232. package/dist/src/rlc-common/interfaces.js.map +1 -1
  233. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
  234. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +13 -13
  235. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
  236. package/dist/src/rlc-common/metadata/buildChangelogFile.js +1 -1
  237. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
  238. package/dist/src/rlc-common/metadata/buildESLintConfig.js +3 -5
  239. package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
  240. package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
  241. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
  242. package/dist/src/rlc-common/metadata/buildPackageFile.js +16 -16
  243. package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
  244. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
  245. package/dist/src/rlc-common/metadata/buildReadmeFile.js +10 -18
  246. package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
  247. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
  248. package/dist/src/rlc-common/metadata/buildRollupConfig.js +3 -4
  249. package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
  250. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
  251. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +2 -3
  252. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
  253. package/dist/src/rlc-common/metadata/buildTestConfig.js +8 -8
  254. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
  255. package/dist/src/rlc-common/metadata/buildTsConfig.js +23 -21
  256. package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
  257. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
  258. package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -4
  259. package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
  260. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
  261. package/dist/src/rlc-common/metadata/buildWarpConfig.js +2 -2
  262. package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
  263. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
  264. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
  265. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +13 -13
  266. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
  267. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
  268. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +22 -26
  269. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
  270. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
  271. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
  272. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
  273. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
  274. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
  275. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
  276. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +26 -29
  277. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
  278. package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
  279. package/dist/src/rlc-common/test/buildRecordedClient.js +3 -3
  280. package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
  281. package/dist/src/rlc-common/test/buildSampleTest.js +2 -2
  282. package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
  283. package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
  284. package/dist/src/rlc-common/test/buildSnippets.js +4 -6
  285. package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
  286. package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
  287. package/dist/src/rlc-common/transformSampleGroups.js +19 -23
  288. package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
  289. package/dist/src/testing/index.d.ts.map +1 -1
  290. package/dist/src/testing/index.js +1 -1
  291. package/dist/src/testing/index.js.map +1 -1
  292. package/dist/src/transform/transform.d.ts +1 -1
  293. package/dist/src/transform/transform.d.ts.map +1 -1
  294. package/dist/src/transform/transform.js +10 -11
  295. package/dist/src/transform/transform.js.map +1 -1
  296. package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
  297. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
  298. package/dist/src/transform/transformApiVersionInfo.js +8 -10
  299. package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
  300. package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
  301. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
  302. package/dist/src/transform/transformHelperFunctionDetails.js +9 -11
  303. package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
  304. package/dist/src/transform/transformParameters.d.ts +2 -2
  305. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  306. package/dist/src/transform/transformParameters.js +22 -28
  307. package/dist/src/transform/transformParameters.js.map +1 -1
  308. package/dist/src/transform/transformPaths.d.ts +1 -1
  309. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  310. package/dist/src/transform/transformPaths.js +11 -12
  311. package/dist/src/transform/transformPaths.js.map +1 -1
  312. package/dist/src/transform/transformResponses.d.ts +1 -1
  313. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  314. package/dist/src/transform/transformResponses.js +12 -12
  315. package/dist/src/transform/transformResponses.js.map +1 -1
  316. package/dist/src/transform/transformSchemas.d.ts.map +1 -1
  317. package/dist/src/transform/transformSchemas.js +9 -15
  318. package/dist/src/transform/transformSchemas.js.map +1 -1
  319. package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
  320. package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
  321. package/dist/src/transform/transformTelemetryInfo.js +3 -3
  322. package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
  323. package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
  324. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
  325. package/dist/src/transform/transfromRLCOptions.js +14 -26
  326. package/dist/src/transform/transfromRLCOptions.js.map +1 -1
  327. package/dist/src/utils/clientUtils.d.ts +1 -1
  328. package/dist/src/utils/clientUtils.d.ts.map +1 -1
  329. package/dist/src/utils/clientUtils.js +11 -14
  330. package/dist/src/utils/clientUtils.js.map +1 -1
  331. package/dist/src/utils/credentialUtils.d.ts +1 -1
  332. package/dist/src/utils/credentialUtils.d.ts.map +1 -1
  333. package/dist/src/utils/credentialUtils.js +3 -3
  334. package/dist/src/utils/credentialUtils.js.map +1 -1
  335. package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
  336. package/dist/src/utils/crossLanguageDef.js +8 -12
  337. package/dist/src/utils/crossLanguageDef.js.map +1 -1
  338. package/dist/src/utils/emitUtil.d.ts +1 -1
  339. package/dist/src/utils/emitUtil.d.ts.map +1 -1
  340. package/dist/src/utils/emitUtil.js +4 -6
  341. package/dist/src/utils/emitUtil.js.map +1 -1
  342. package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
  343. package/dist/src/utils/fileSystemUtils.js +2 -2
  344. package/dist/src/utils/fileSystemUtils.js.map +1 -1
  345. package/dist/src/utils/importHelper.d.ts.map +1 -1
  346. package/dist/src/utils/importHelper.js +2 -4
  347. package/dist/src/utils/importHelper.js.map +1 -1
  348. package/dist/src/utils/interfaces.d.ts +1 -1
  349. package/dist/src/utils/interfaces.d.ts.map +1 -1
  350. package/dist/src/utils/mediaTypes.d.ts.map +1 -1
  351. package/dist/src/utils/mediaTypes.js +7 -19
  352. package/dist/src/utils/mediaTypes.js.map +1 -1
  353. package/dist/src/utils/modelUtils.d.ts +2 -2
  354. package/dist/src/utils/modelUtils.d.ts.map +1 -1
  355. package/dist/src/utils/modelUtils.js +107 -170
  356. package/dist/src/utils/modelUtils.js.map +1 -1
  357. package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
  358. package/dist/src/utils/namespaceUtils.js +2 -2
  359. package/dist/src/utils/namespaceUtils.js.map +1 -1
  360. package/dist/src/utils/operationUtil.d.ts +1 -1
  361. package/dist/src/utils/operationUtil.d.ts.map +1 -1
  362. package/dist/src/utils/operationUtil.js +29 -42
  363. package/dist/src/utils/operationUtil.js.map +1 -1
  364. package/dist/src/utils/parameterUtils.d.ts +1 -1
  365. package/dist/src/utils/parameterUtils.d.ts.map +1 -1
  366. package/dist/src/utils/parameterUtils.js +19 -22
  367. package/dist/src/utils/parameterUtils.js.map +1 -1
  368. package/dist/src/utils/resolve-project-root.js +2 -2
  369. package/dist/src/utils/resolve-project-root.js.map +1 -1
  370. package/dist/tsconfig.tsbuildinfo +1 -1
  371. package/package.json +1 -5
  372. package/src/contextManager.ts +6 -9
  373. package/src/framework/declaration.ts +18 -28
  374. package/src/framework/dependency.ts +1 -2
  375. package/src/framework/hooks/binder.ts +47 -120
  376. package/src/framework/hooks/sdkTypes.ts +27 -54
  377. package/src/framework/hooks/useDependencies.ts +2 -4
  378. package/src/framework/load-static-helpers.ts +28 -51
  379. package/src/framework/reference.ts +2 -5
  380. package/src/framework/sample.ts +9 -9
  381. package/src/index.ts +111 -180
  382. package/src/lib.ts +143 -158
  383. package/src/metaTree.ts +1 -1
  384. package/src/modular/buildClassicalClient.ts +83 -160
  385. package/src/modular/buildClassicalOperationGroups.ts +14 -39
  386. package/src/modular/buildClientContext.ts +54 -83
  387. package/src/modular/buildModularOptions.ts +4 -5
  388. package/src/modular/buildOperations.ts +46 -73
  389. package/src/modular/buildProjectFiles.ts +18 -47
  390. package/src/modular/buildRestorePoller.ts +27 -46
  391. package/src/modular/buildRootIndex.ts +86 -159
  392. package/src/modular/buildSubpathIndex.ts +35 -58
  393. package/src/modular/emitLoggerFile.ts +4 -9
  394. package/src/modular/emitModels.ts +136 -266
  395. package/src/modular/emitModelsOptions.ts +10 -16
  396. package/src/modular/emitSamples.ts +91 -177
  397. package/src/modular/emitTests.ts +28 -61
  398. package/src/modular/external-dependencies.ts +54 -54
  399. package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
  400. package/src/modular/helpers/clientHelpers.ts +41 -88
  401. package/src/modular/helpers/clientOptionHelpers.ts +4 -11
  402. package/src/modular/helpers/exampleValueHelpers.ts +97 -209
  403. package/src/modular/helpers/namingHelpers.ts +12 -28
  404. package/src/modular/helpers/operationHelpers.ts +430 -757
  405. package/src/modular/helpers/typeHelpers.ts +11 -22
  406. package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
  407. package/src/modular/serialization/buildSerializerFunction.ts +91 -129
  408. package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
  409. package/src/modular/serialization/serializeUtils.ts +12 -21
  410. package/src/modular/static/rollup.test.config.js +11 -14
  411. package/src/modular/static/scripts/renameOutput.mjs +2 -2
  412. package/src/modular/static-helpers-metadata.ts +60 -60
  413. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  414. package/src/modular/type-expressions/get-enum-expression.ts +5 -10
  415. package/src/modular/type-expressions/get-model-expression.ts +13 -17
  416. package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
  417. package/src/modular/type-expressions/get-type-expression.ts +8 -12
  418. package/src/modular/type-expressions/get-union-expression.ts +4 -4
  419. package/src/modular/type-expressions/utils.ts +1 -1
  420. package/src/rlc-common/buildClient.ts +70 -141
  421. package/src/rlc-common/buildClientDefinitions.ts +43 -87
  422. package/src/rlc-common/buildIndexFile.ts +78 -78
  423. package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
  424. package/src/rlc-common/buildLogger.ts +7 -7
  425. package/src/rlc-common/buildMethodShortcuts.ts +9 -21
  426. package/src/rlc-common/buildObjectTypes.ts +78 -155
  427. package/src/rlc-common/buildPaginateHelper.ts +9 -12
  428. package/src/rlc-common/buildParameterTypes.ts +92 -137
  429. package/src/rlc-common/buildPollingHelper.ts +7 -7
  430. package/src/rlc-common/buildResponseTypes.ts +34 -57
  431. package/src/rlc-common/buildSamples.ts +3 -3
  432. package/src/rlc-common/buildSchemaType.ts +12 -29
  433. package/src/rlc-common/buildSerializeHelper.ts +5 -5
  434. package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
  435. package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
  436. package/src/rlc-common/helpers/importsUtil.ts +27 -30
  437. package/src/rlc-common/helpers/nameConstructors.ts +16 -50
  438. package/src/rlc-common/helpers/nameUtils.ts +19 -42
  439. package/src/rlc-common/helpers/operationHelpers.ts +14 -31
  440. package/src/rlc-common/helpers/pathUtils.ts +2 -7
  441. package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
  442. package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
  443. package/src/rlc-common/helpers/typeUtil.ts +4 -11
  444. package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
  445. package/src/rlc-common/index.ts +28 -28
  446. package/src/rlc-common/interfaces.ts +3 -11
  447. package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
  448. package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
  449. package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
  450. package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
  451. package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
  452. package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
  453. package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
  454. package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
  455. package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
  456. package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
  457. package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
  458. package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
  459. package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
  460. package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
  461. package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
  462. package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
  463. package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
  464. package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
  465. package/src/rlc-common/test/buildRecordedClient.ts +3 -3
  466. package/src/rlc-common/test/buildSampleTest.ts +3 -3
  467. package/src/rlc-common/test/buildSnippets.ts +6 -12
  468. package/src/rlc-common/transformSampleGroups.ts +54 -105
  469. package/src/testing/index.ts +2 -5
  470. package/src/transform/transform.ts +22 -34
  471. package/src/transform/transformApiVersionInfo.ts +17 -30
  472. package/src/transform/transformHelperFunctionDetails.ts +14 -26
  473. package/src/transform/transformParameters.ts +55 -105
  474. package/src/transform/transformPaths.ts +26 -43
  475. package/src/transform/transformResponses.ts +26 -33
  476. package/src/transform/transformSchemas.ts +15 -33
  477. package/src/transform/transformTelemetryInfo.ts +8 -14
  478. package/src/transform/transfromRLCOptions.ts +53 -116
  479. package/src/utils/clientUtils.ts +22 -41
  480. package/src/utils/credentialUtils.ts +8 -19
  481. package/src/utils/crossLanguageDef.ts +15 -34
  482. package/src/utils/emitUtil.ts +11 -17
  483. package/src/utils/fileSystemUtils.ts +4 -6
  484. package/src/utils/importHelper.ts +5 -10
  485. package/src/utils/interfaces.ts +1 -1
  486. package/src/utils/mediaTypes.ts +13 -34
  487. package/src/utils/modelUtils.ts +174 -383
  488. package/src/utils/namespaceUtils.ts +8 -24
  489. package/src/utils/operationUtil.ts +98 -190
  490. package/src/utils/parameterUtils.ts +31 -54
  491. package/src/utils/resolve-project-root.ts +3 -3
  492. package/static/static-helpers/cloudSettingHelpers.ts +4 -6
  493. package/static/static-helpers/multipartHelpers.ts +3 -3
  494. package/static/static-helpers/pagingHelpers.ts +28 -63
  495. package/static/static-helpers/pollingHelpers.ts +15 -28
  496. package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
  497. package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
  498. package/static/static-helpers/serialization/get-binary-response.ts +2 -2
  499. package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
  500. package/static/static-helpers/serialization/serialize-record.ts +1 -1
  501. package/static/static-helpers/serialization/serializers.ts +4 -7
  502. package/static/static-helpers/serialization/xml-helpers.ts +41 -89
  503. package/static/static-helpers/simplePollerHelpers.ts +9 -18
  504. package/static/static-helpers/storageCompatResponse.ts +10 -27
  505. package/static/static-helpers/urlTemplate.ts +4 -7
  506. package/static/test-helpers/recordedClient.ts +5 -10
@@ -2,23 +2,20 @@ import * as path from "path";
2
2
 
3
3
  import { ModularEmitterOptions } from "./interfaces.js";
4
4
 
5
- import { buildOperationOptions } from "./buildOperations.js";
5
+ import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
6
+ import { useContext } from "../contextManager.js";
7
+ import { NameType, normalizeName } from "../rlc-common/index.js";
8
+ import { getModularClientOptions } from "../utils/clientUtils.js";
6
9
  import { SdkContext } from "../utils/interfaces.js";
7
- import {
8
- SdkClientType,
9
- SdkServiceOperation
10
- } from "@azure-tools/typespec-client-generator-core";
11
10
  import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
12
- import { getModularClientOptions } from "../utils/clientUtils.js";
13
- import { NameType, normalizeName } from "../rlc-common/index.js";
14
- import { useContext } from "../contextManager.js";
11
+ import { buildOperationOptions } from "./buildOperations.js";
15
12
 
16
13
  // ====== UTILITIES ======
17
14
 
18
15
  export function buildApiOptions(
19
16
  context: SdkContext,
20
17
  clientMap: [string[], SdkClientType<SdkServiceOperation>],
21
- emitterOptions: ModularEmitterOptions
18
+ emitterOptions: ModularEmitterOptions,
22
19
  ) {
23
20
  const project = useContext("outputProject");
24
21
  const [_, client] = clientMap;
@@ -33,12 +30,12 @@ export function buildApiOptions(
33
30
  subfolder ?? "",
34
31
  `api`,
35
32
  ...prefixes.map((p) => normalizeName(p, NameType.File)),
36
- "options.ts"
33
+ "options.ts",
37
34
  ),
38
35
  undefined,
39
36
  {
40
- overwrite: true
41
- }
37
+ overwrite: true,
38
+ },
42
39
  );
43
40
  operations.forEach((o) => {
44
41
  buildOperationOptions(context, [prefixes, o], modelOptionsFile);
@@ -46,10 +43,7 @@ export function buildApiOptions(
46
43
  modelOptionsFile
47
44
  .getImportDeclarations()
48
45
  .filter((id) => {
49
- return (
50
- id.isModuleSpecifierRelative() &&
51
- !id.getModuleSpecifierValue().endsWith(".js")
52
- );
46
+ return id.isModuleSpecifierRelative() && !id.getModuleSpecifierValue().endsWith(".js");
53
47
  })
54
48
  .map((id) => {
55
49
  id.setModuleSpecifier(id.getModuleSpecifierValue() + ".js");
@@ -1,52 +1,38 @@
1
1
  import {
2
- StructureKind,
3
- FunctionDeclarationStructure,
4
- SourceFile
5
- } from "ts-morph";
6
- import { resolveReference } from "../framework/reference.js";
7
- import { SdkContext } from "../utils/interfaces.js";
8
- import {
2
+ isReadOnly,
3
+ SdkClientInitializationType,
9
4
  SdkClientType,
5
+ SdkExampleValue,
10
6
  SdkHttpOperationExample,
11
7
  SdkHttpParameterExampleValue,
12
- SdkServiceOperation,
13
- SdkExampleValue,
14
- SdkClientInitializationType,
15
8
  SdkModelPropertyType,
16
- isReadOnly
9
+ SdkServiceOperation,
17
10
  } from "@azure-tools/typespec-client-generator-core";
18
- import {
19
- isAzurePackage,
20
- NameType,
21
- normalizeName
22
- } from "../rlc-common/index.js";
23
- import { useContext } from "../contextManager.js";
11
+ import { NoTarget } from "@typespec/compiler";
24
12
  import { join } from "path";
25
- import { AzureIdentityDependencies } from "../modular/external-dependencies.js";
13
+ import { FunctionDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
14
+ import { useContext } from "../contextManager.js";
15
+ import { resolveReference } from "../framework/reference.js";
26
16
  import { reportDiagnostic } from "../index.js";
27
- import { NoTarget } from "@typespec/compiler";
28
- import {
29
- buildPropertyNameMapper,
30
- isSpreadBodyParameter
31
- } from "./helpers/typeHelpers.js";
32
- import { getClassicalClientName } from "./helpers/namingHelpers.js";
33
- import {
34
- hasKeyCredential,
35
- hasTokenCredential
36
- } from "../utils/credentialUtils.js";
17
+ import { AzureIdentityDependencies } from "../modular/external-dependencies.js";
18
+ import { isAzurePackage, NameType, normalizeName } from "../rlc-common/index.js";
19
+ import { getSubscriptionId } from "../transform/transfromRLCOptions.js";
20
+ import { hasKeyCredential, hasTokenCredential } from "../utils/credentialUtils.js";
21
+ import { SdkContext } from "../utils/interfaces.js";
37
22
  import {
38
23
  getMethodHierarchiesMap,
39
24
  isTenantLevelOperation,
40
- ServiceOperation
25
+ ServiceOperation,
41
26
  } from "../utils/operationUtil.js";
42
- import { getSubscriptionId } from "../transform/transfromRLCOptions.js";
43
27
  import {
44
- getClientParametersDeclaration,
28
+ getClientParameterName,
45
29
  getClientParameters,
30
+ getClientParametersDeclaration,
46
31
  hasDefaultValue,
47
- getClientParameterName
48
32
  } from "./helpers/clientHelpers.js";
33
+ import { getClassicalClientName } from "./helpers/namingHelpers.js";
49
34
  import { getOperationFunction } from "./helpers/operationHelpers.js";
35
+ import { buildPropertyNameMapper, isSpreadBodyParameter } from "./helpers/typeHelpers.js";
50
36
  import { ModelOverrideOptions } from "./serialization/serializeUtils.js";
51
37
 
52
38
  /**
@@ -79,7 +65,7 @@ export function emitSamples(dpgContext: SdkContext): SourceFile[] {
79
65
  subFolder:
80
66
  clients.length > 1
81
67
  ? normalizeName(getClassicalClientName(client), NameType.File)
82
- : undefined
68
+ : undefined,
83
69
  });
84
70
  }
85
71
  return generatedFiles;
@@ -88,7 +74,7 @@ export function emitSamples(dpgContext: SdkContext): SourceFile[] {
88
74
  function emitClientSamples(
89
75
  dpgContext: SdkContext,
90
76
  client: SdkClientType<SdkServiceOperation>,
91
- options: EmitSampleOptions
77
+ options: EmitSampleOptions,
92
78
  ) {
93
79
  const methodMap = getMethodHierarchiesMap(dpgContext, client);
94
80
  for (const [prefixKey, operations] of methodMap) {
@@ -102,7 +88,7 @@ function emitClientSamples(
102
88
  emitMethodSamples(dpgContext, op, {
103
89
  ...options,
104
90
  classicalMethodPrefix: prefix,
105
- hierarchies: hierarchies
91
+ hierarchies: hierarchies,
106
92
  });
107
93
  }
108
94
  }
@@ -111,48 +97,39 @@ function emitClientSamples(
111
97
  function emitMethodSamples(
112
98
  dpgContext: SdkContext,
113
99
  method: ServiceOperation,
114
- options: EmitSampleOptions
100
+ options: EmitSampleOptions,
115
101
  ): SourceFile | undefined {
116
102
  const examples = method.operation.examples ?? [];
117
103
  if (examples.length === 0) {
118
104
  return;
119
105
  }
120
106
  const project = useContext("outputProject");
121
- const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${
122
- method.oriName ?? method.name
123
- }`;
107
+ const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${method.oriName ?? method.name}`;
124
108
  const sampleFolder = join(
125
109
  dpgContext.generationPathDetail?.rootDir ?? "",
126
110
  "samples-dev",
127
- options.subFolder ?? ""
111
+ options.subFolder ?? "",
128
112
  );
129
113
  const fileName = normalizeName(`${operationPrefix} Sample`, NameType.File);
130
- const sourceFile = project.createSourceFile(
131
- join(sampleFolder, `${fileName}.ts`),
132
- "",
133
- {
134
- overwrite: true
135
- }
136
- );
114
+ const sourceFile = project.createSourceFile(join(sampleFolder, `${fileName}.ts`), "", {
115
+ overwrite: true,
116
+ });
137
117
  const exampleFunctions = [];
138
118
  // TODO: remove hard-coded for package
139
119
  if (dpgContext.rlcOptions?.packageDetails?.name) {
140
120
  sourceFile.addImportDeclaration({
141
121
  moduleSpecifier: dpgContext.rlcOptions?.packageDetails?.name,
142
- namedImports: [getClassicalClientName(options.topLevelClient)]
122
+ namedImports: [getClassicalClientName(options.topLevelClient)],
143
123
  });
144
124
  }
145
125
 
146
126
  for (const example of examples) {
147
127
  const exampleFunctionBody: string[] = [];
148
- const exampleName = normalizeName(
149
- escapeSpecialCharToSpace(example.name),
150
- NameType.Method
151
- );
128
+ const exampleName = normalizeName(escapeSpecialCharToSpace(example.name), NameType.Method);
152
129
  const exampleFunctionType = {
153
130
  name: exampleName,
154
131
  returnType: "Promise<void>",
155
- body: exampleFunctionBody
132
+ body: exampleFunctionBody,
156
133
  };
157
134
  const parameterMap: Record<string, SdkHttpParameterExampleValue> =
158
135
  buildParameterValueMap(example);
@@ -160,7 +137,7 @@ function emitMethodSamples(
160
137
  dpgContext,
161
138
  method,
162
139
  parameterMap,
163
- options.topLevelClient
140
+ options.topLevelClient,
164
141
  );
165
142
  // prepare client-level parameters
166
143
  const clientParamValues = parameters.filter((p) => p.onClient);
@@ -174,15 +151,13 @@ function emitMethodSamples(
174
151
  .filter((p) => p.isOptional)
175
152
  .map((param) => `${param.name}: ${param.value}`);
176
153
  if (optionalClientParams.length > 0) {
177
- exampleFunctionBody.push(
178
- `const clientOptions = {${optionalClientParams.join(", ")}};`
179
- );
154
+ exampleFunctionBody.push(`const clientOptions = {${optionalClientParams.join(", ")}};`);
180
155
  clientParams.push("clientOptions");
181
156
  }
182
157
  exampleFunctionBody.push(
183
158
  `const client = new ${getClassicalClientName(
184
- options.topLevelClient
185
- )}(${clientParams.join(", ")});`
159
+ options.topLevelClient,
160
+ )}(${clientParams.join(", ")});`,
186
161
  );
187
162
 
188
163
  // prepare operation-level parameters
@@ -190,17 +165,13 @@ function emitMethodSamples(
190
165
  const operationFunction = getOperationFunction(
191
166
  dpgContext,
192
167
  [options.hierarchies ?? [], method],
193
- "Client"
168
+ "Client",
194
169
  );
195
170
 
196
171
  // Extract parameter names from the function signature (excluding context and options)
197
172
  const signatureParamNames =
198
173
  operationFunction.parameters
199
- ?.filter(
200
- (p) =>
201
- p.name !== "context" &&
202
- !p.type?.toString().includes("OptionalParams")
203
- )
174
+ ?.filter((p) => p.name !== "context" && !p.type?.toString().includes("OptionalParams"))
204
175
  .map((p) => p.name) ?? [];
205
176
 
206
177
  const methodParamValues = parameters.filter((p) => !p.onClient);
@@ -221,18 +192,14 @@ function emitMethodSamples(
221
192
  if (optionalParams.length > 0) {
222
193
  methodParams.push(`{${optionalParams.join(", ")}}`);
223
194
  }
224
- const prefix = options.classicalMethodPrefix
225
- ? `${options.classicalMethodPrefix}.`
226
- : "";
195
+ const prefix = options.classicalMethodPrefix ? `${options.classicalMethodPrefix}.` : "";
227
196
  const isPaging = method.kind === "paging";
228
197
  const methodCall = `client.${prefix}${normalizeName(method.oriName ?? method.name, NameType.Property)}(${methodParams.join(
229
- ", "
198
+ ", ",
230
199
  )})`;
231
200
  if (isPaging) {
232
201
  exampleFunctionBody.push(`const resArray = new Array();`);
233
- exampleFunctionBody.push(
234
- `for await (const item of ${methodCall}) { resArray.push(item); }`
235
- );
202
+ exampleFunctionBody.push(`for await (const item of ${methodCall}) { resArray.push(item); }`);
236
203
  exampleFunctionBody.push(`console.log(resArray);`);
237
204
  } else if (method.response.type === undefined) {
238
205
  // skip response handling for void methods
@@ -243,10 +210,8 @@ function emitMethodSamples(
243
210
  }
244
211
 
245
212
  // Create a function declaration structure
246
- const description =
247
- method.doc ?? `execute ${method.oriName ?? method.name}`;
248
- const normalizedDescription =
249
- description.charAt(0).toLowerCase() + description.slice(1);
213
+ const description = method.doc ?? `execute ${method.oriName ?? method.name}`;
214
+ const normalizedDescription = description.charAt(0).toLowerCase() + description.slice(1);
250
215
  const functionDeclaration: FunctionDeclarationStructure = {
251
216
  returnType: exampleFunctionType.returnType,
252
217
  kind: StructureKind.Function,
@@ -254,8 +219,8 @@ function emitMethodSamples(
254
219
  name: exampleFunctionType.name,
255
220
  statements: exampleFunctionType.body,
256
221
  docs: [
257
- `This sample demonstrates how to ${normalizedDescription}\n\n@summary ${normalizedDescription}\nx-ms-original-file: ${example.filePath}`
258
- ]
222
+ `This sample demonstrates how to ${normalizedDescription}\n\n@summary ${normalizedDescription}\nx-ms-original-file: ${example.filePath}`,
223
+ ],
259
224
  };
260
225
  sourceFile.addFunction(functionDeclaration);
261
226
  exampleFunctions.push(exampleFunctionType.name);
@@ -274,9 +239,7 @@ function emitMethodSamples(
274
239
 
275
240
  function buildParameterValueMap(example: SdkHttpOperationExample) {
276
241
  const parameterMap: Record<string, SdkHttpParameterExampleValue> = {};
277
- example.parameters.forEach(
278
- (param) => (parameterMap[param.parameter.serializedName] = param)
279
- );
242
+ example.parameters.forEach((param) => (parameterMap[param.parameter.serializedName] = param));
280
243
  return parameterMap;
281
244
  }
282
245
 
@@ -285,14 +248,13 @@ function prepareExampleValue(
285
248
  name: string,
286
249
  value: SdkExampleValue | string,
287
250
  isOptional?: boolean,
288
- onClient?: boolean
251
+ onClient?: boolean,
289
252
  ): ExampleValue {
290
253
  return {
291
254
  name: normalizeName(name, NameType.Parameter, true),
292
- value:
293
- typeof value === "string" ? value : getParameterValue(context, value),
255
+ value: typeof value === "string" ? value : getParameterValue(context, value),
294
256
  isOptional: Boolean(isOptional),
295
- onClient: Boolean(onClient)
257
+ onClient: Boolean(onClient),
296
258
  };
297
259
  }
298
260
 
@@ -300,7 +262,7 @@ function prepareExampleParameters(
300
262
  dpgContext: SdkContext,
301
263
  method: ServiceOperation,
302
264
  parameterMap: Record<string, SdkHttpParameterExampleValue>,
303
- topLevelClient: SdkClientType<SdkServiceOperation>
265
+ topLevelClient: SdkClientType<SdkServiceOperation>,
304
266
  ): ExampleValue[] {
305
267
  // TODO: blocked by TCGC issue: https://github.com/Azure/typespec-azure/issues/1419
306
268
  // refine this to support generic client-level parameters once resolved
@@ -308,16 +270,12 @@ function prepareExampleParameters(
308
270
 
309
271
  // Get the raw SDK parameters to check for default values
310
272
  const rawClientParams = getClientParameters(topLevelClient, dpgContext, {
311
- onClientOnly: true
273
+ onClientOnly: true,
312
274
  });
313
275
 
314
- const clientParams = getClientParametersDeclaration(
315
- topLevelClient,
316
- dpgContext,
317
- {
318
- onClientOnly: true
319
- }
320
- );
276
+ const clientParams = getClientParametersDeclaration(topLevelClient, dpgContext, {
277
+ onClientOnly: true,
278
+ });
321
279
 
322
280
  // Helper to check if a parameter has a default value
323
281
  const hasParamDefaultValue = (paramName: string) => {
@@ -342,19 +300,16 @@ function prepareExampleParameters(
342
300
 
343
301
  const exampleValue: ExampleValue = {
344
302
  name: param.name === "endpointParam" ? "endpoint" : param.name,
345
- value: getEnvironmentVariableName(
346
- param.name,
347
- getClassicalClientName(topLevelClient)
348
- ),
303
+ value: getEnvironmentVariableName(param.name, getClassicalClientName(topLevelClient)),
349
304
  isOptional: Boolean(param.hasQuestionToken),
350
- onClient: true
305
+ onClient: true,
351
306
  };
352
307
 
353
308
  result.push(exampleValue);
354
309
  }
355
310
  const credentialExampleValue = getCredentialExampleValue(
356
311
  dpgContext,
357
- topLevelClient.clientInitialization
312
+ topLevelClient.clientInitialization,
358
313
  );
359
314
  if (credentialExampleValue) {
360
315
  result.push(credentialExampleValue);
@@ -364,11 +319,7 @@ function prepareExampleParameters(
364
319
  let isSubscriptionIdAdded = false;
365
320
  // required parameters
366
321
  for (const param of method.operation.parameters) {
367
- if (
368
- param.optional === true ||
369
- param.type.kind === "constant" ||
370
- param.clientDefaultValue
371
- ) {
322
+ if (param.optional === true || param.type.kind === "constant" || param.clientDefaultValue) {
372
323
  continue;
373
324
  }
374
325
 
@@ -387,8 +338,8 @@ function prepareExampleParameters(
387
338
  param.name,
388
339
  subscriptionIdValue,
389
340
  param.optional,
390
- param.onClient
391
- )
341
+ param.onClient,
342
+ ),
392
343
  );
393
344
  continue;
394
345
  }
@@ -399,9 +350,9 @@ function prepareExampleParameters(
399
350
  code: "required-sample-parameter",
400
351
  format: {
401
352
  exampleName: method.oriName ?? method.name,
402
- paramName: param.name
353
+ paramName: param.name,
403
354
  },
404
- target: NoTarget
355
+ target: NoTarget,
405
356
  });
406
357
  continue;
407
358
  }
@@ -412,8 +363,8 @@ function prepareExampleParameters(
412
363
  exampleValue.parameter.name,
413
364
  exampleValue.value,
414
365
  param.optional,
415
- param.onClient
416
- )
366
+ param.onClient,
367
+ ),
417
368
  );
418
369
  }
419
370
 
@@ -426,13 +377,7 @@ function prepareExampleParameters(
426
377
  !isTenantLevelOperation(method, topLevelClient)
427
378
  ) {
428
379
  result.push(
429
- prepareExampleValue(
430
- dpgContext,
431
- "subscriptionId",
432
- subscriptionIdValue,
433
- false,
434
- true
435
- )
380
+ prepareExampleValue(dpgContext, "subscriptionId", subscriptionIdValue, false, true),
436
381
  );
437
382
  }
438
383
 
@@ -456,22 +401,14 @@ function prepareExampleParameters(
456
401
  continue;
457
402
  }
458
403
  result.push(
459
- prepareExampleValue(
460
- dpgContext,
461
- prop.name,
462
- propExample,
463
- prop.optional,
464
- prop.onClient
465
- )
404
+ prepareExampleValue(dpgContext, prop.name, propExample, prop.optional, prop.onClient),
466
405
  );
467
406
  }
468
407
  } else {
469
408
  // Check if the body parameter is nested inside a wrapper (e.g., @bodyRoot)
470
409
  const segments = bodyParam.methodParameterSegments;
471
410
  const isNestedBody =
472
- segments.length === 1 &&
473
- segments[0] !== undefined &&
474
- segments[0].length > 1;
411
+ segments.length === 1 && segments[0] !== undefined && segments[0].length > 1;
475
412
  if (isNestedBody) {
476
413
  const path = segments[0]!;
477
414
  // The first segment is the method-level wrapper param (e.g., "body")
@@ -480,11 +417,7 @@ function prepareExampleParameters(
480
417
  // Wrap the example value with the intermediate property names
481
418
  let wrappedValue = getParameterValue(dpgContext, bodyExample.value);
482
419
  for (let i = path.length - 1; i >= 1; i--) {
483
- const propName = normalizeName(
484
- path[i]!.name,
485
- NameType.Property,
486
- true
487
- );
420
+ const propName = normalizeName(path[i]!.name, NameType.Property, true);
488
421
  wrappedValue = `{ ${propName}: ${wrappedValue} }`;
489
422
  }
490
423
  result.push(
@@ -493,8 +426,8 @@ function prepareExampleParameters(
493
426
  methodParamName,
494
427
  wrappedValue,
495
428
  methodParamOptional,
496
- bodyParam.onClient
497
- )
429
+ bodyParam.onClient,
430
+ ),
498
431
  );
499
432
  } else {
500
433
  result.push(
@@ -503,8 +436,8 @@ function prepareExampleParameters(
503
436
  bodyParam.name,
504
437
  bodyExample.value,
505
438
  bodyParam.optional,
506
- bodyParam.onClient
507
- )
439
+ bodyParam.onClient,
440
+ ),
508
441
  );
509
442
  }
510
443
  }
@@ -513,9 +446,7 @@ function prepareExampleParameters(
513
446
  method.operation.parameters
514
447
  .filter(
515
448
  (param) =>
516
- param.optional === true &&
517
- parameterMap[param.serializedName] &&
518
- !param.clientDefaultValue
449
+ param.optional === true && parameterMap[param.serializedName] && !param.clientDefaultValue,
519
450
  )
520
451
  .map((param) => parameterMap[param.serializedName]!)
521
452
  .forEach((param) => {
@@ -525,8 +456,8 @@ function prepareExampleParameters(
525
456
  param.parameter.name,
526
457
  param.value,
527
458
  true,
528
- param.parameter.onClient
529
- )
459
+ param.parameter.onClient,
460
+ ),
530
461
  );
531
462
  });
532
463
 
@@ -535,36 +466,34 @@ function prepareExampleParameters(
535
466
 
536
467
  function getCredentialExampleValue(
537
468
  dpgContext: SdkContext,
538
- initialization: SdkClientInitializationType
469
+ initialization: SdkClientInitializationType,
539
470
  ): ExampleValue | undefined {
540
471
  const keyCredential = hasKeyCredential(initialization),
541
472
  tokenCredential = hasTokenCredential(initialization);
542
473
  const defaultSetting = {
543
474
  isOptional: false,
544
475
  onClient: true,
545
- name: "credential"
476
+ name: "credential",
546
477
  };
547
478
  if (keyCredential || tokenCredential) {
548
479
  if (isAzurePackage({ options: dpgContext.rlcOptions })) {
549
480
  // Support DefaultAzureCredential for Azure packages
550
481
  return {
551
482
  ...defaultSetting,
552
- value: `new ${resolveReference(
553
- AzureIdentityDependencies.DefaultAzureCredential
554
- )}()`
483
+ value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`,
555
484
  };
556
485
  } else if (keyCredential) {
557
486
  // Support ApiKeyCredential for non-Azure packages
558
487
  return {
559
488
  ...defaultSetting,
560
- value: `{ key: "INPUT_YOUR_KEY_HERE" }`
489
+ value: `{ key: "INPUT_YOUR_KEY_HERE" }`,
561
490
  };
562
491
  } else if (tokenCredential) {
563
492
  // Support TokenCredential for non-Azure packages
564
493
  return {
565
494
  ...defaultSetting,
566
495
  value: `{ getToken: async () => {
567
- return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: now() }; } }`
496
+ return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: now() }; } }`,
568
497
  };
569
498
  }
570
499
  }
@@ -576,7 +505,7 @@ function getParameterValue(
576
505
  value: SdkExampleValue,
577
506
  options?: {
578
507
  overrides?: ModelOverrideOptions;
579
- }
508
+ },
580
509
  ): string {
581
510
  let retValue = `{} as any`;
582
511
  switch (value.kind) {
@@ -612,8 +541,7 @@ function getParameterValue(
612
541
  retValue = `${JSON.stringify(value.value)}`;
613
542
  break;
614
543
  case "null": {
615
- const ignoreNullableOnOptional =
616
- context.rlcOptions?.ignoreNullableOnOptional ?? false;
544
+ const ignoreNullableOnOptional = context.rlcOptions?.ignoreNullableOnOptional ?? false;
617
545
  if (ignoreNullableOnOptional) {
618
546
  // When ignore-nullable-on-optional is true, the TypeScript type won't include
619
547
  // | null for optional properties, so we convert null to a type-appropriate default
@@ -633,16 +561,12 @@ function getParameterValue(
633
561
  }
634
562
  case "dict":
635
563
  case "model": {
636
- const mapper = buildPropertyNameMapper(
637
- context,
638
- value.type,
639
- options?.overrides
640
- );
564
+ const mapper = buildPropertyNameMapper(context, value.type, options?.overrides);
641
565
  const values = [];
642
566
  const additionalPropertiesValue =
643
567
  value.kind === "model" ? (value.additionalPropertiesValue ?? {}) : {};
644
568
  for (const propName in {
645
- ...value.value
569
+ ...value.value,
646
570
  }) {
647
571
  let property;
648
572
  if (value.type.kind === "model") {
@@ -667,21 +591,17 @@ function getParameterValue(
667
591
  // but disable further flattening to match the TypeScript interface structure
668
592
  const paramValue = getParameterValue(context, propValue, {
669
593
  overrides: {
670
- propertyRenames:
671
- useContext("sdkTypes").flattenProperties.get(property)
672
- ?.conflictMap,
673
- enableFlatten: false
674
- }
594
+ propertyRenames: useContext("sdkTypes").flattenProperties.get(property)?.conflictMap,
595
+ enableFlatten: false,
596
+ },
675
597
  });
676
- propRetValue =
677
- paramValue.length > 2 ? paramValue.slice(1, -1) : undefined;
598
+ propRetValue = paramValue.length > 2 ? paramValue.slice(1, -1) : undefined;
678
599
  } else {
679
600
  // Don't propagate enableFlatten:false to deeper levels — it's only
680
601
  // meant to block consecutive (transition) flatten at the direct child
681
602
  // level. Non-flatten properties should recurse with default behavior
682
603
  // so that independent inner flattens at deeper levels still work.
683
- const childOptions =
684
- options?.overrides?.enableFlatten === false ? undefined : options;
604
+ const childOptions = options?.overrides?.enableFlatten === false ? undefined : options;
685
605
  propRetValue =
686
606
  `"${mapper.get(propName) ?? propName}": ` +
687
607
  getParameterValue(context, propValue, childOptions);
@@ -690,15 +610,14 @@ function getParameterValue(
690
610
  }
691
611
  const additionalBags = [];
692
612
  for (const propName in {
693
- ...additionalPropertiesValue
613
+ ...additionalPropertiesValue,
694
614
  }) {
695
615
  const propValue = additionalPropertiesValue[propName];
696
616
  if (propValue === undefined || propValue === null) {
697
617
  continue;
698
618
  }
699
619
  const propRetValue =
700
- `"${mapper.get(propName) ?? propName}": ` +
701
- getParameterValue(context, propValue);
620
+ `"${mapper.get(propName) ?? propName}": ` + getParameterValue(context, propValue);
702
621
  additionalBags.push(propRetValue);
703
622
  }
704
623
  if (additionalBags.length > 0) {
@@ -714,9 +633,7 @@ function getParameterValue(
714
633
  break;
715
634
  }
716
635
  case "array": {
717
- const valuesArr = value.value.map((item) =>
718
- getParameterValue(context, item)
719
- );
636
+ const valuesArr = value.value.map((item) => getParameterValue(context, item));
720
637
  retValue = `[${valuesArr.join(", ")}]`;
721
638
  break;
722
639
  }
@@ -733,10 +650,7 @@ function escapeSpecialCharToSpace(str: string) {
733
650
  return str.replace(/_|,|\.|\(|\)|'s |\[|\]/g, " ").replace(/\//g, " Or ");
734
651
  }
735
652
 
736
- function getEnvironmentVariableName(
737
- paramName: string,
738
- clientName?: string
739
- ): string {
653
+ function getEnvironmentVariableName(paramName: string, clientName?: string): string {
740
654
  // Remove "Param" suffix if present
741
655
  const cleanName = paramName.replace(/Param$/, "");
742
656