@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (522) hide show
  1. package/CHANGELOG.md +25 -10
  2. package/README.md +0 -4
  3. package/dist/src/contextManager.d.ts +5 -5
  4. package/dist/src/contextManager.d.ts.map +1 -1
  5. package/dist/src/contextManager.js +3 -3
  6. package/dist/src/contextManager.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 -4
  10. package/dist/src/framework/declaration.js.map +1 -1
  11. package/dist/src/framework/dependency.d.ts.map +1 -1
  12. package/dist/src/framework/hooks/binder.d.ts +1 -1
  13. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  14. package/dist/src/framework/hooks/binder.js +31 -40
  15. package/dist/src/framework/hooks/binder.js.map +1 -1
  16. package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
  17. package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
  18. package/dist/src/framework/hooks/sdkTypes.js +8 -12
  19. package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
  20. package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
  21. package/dist/src/framework/hooks/useDependencies.js +1 -1
  22. package/dist/src/framework/hooks/useDependencies.js.map +1 -1
  23. package/dist/src/framework/load-static-helpers.d.ts +1 -1
  24. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  25. package/dist/src/framework/load-static-helpers.js +17 -31
  26. package/dist/src/framework/load-static-helpers.js.map +1 -1
  27. package/dist/src/framework/reference.d.ts.map +1 -1
  28. package/dist/src/framework/reference.js +2 -2
  29. package/dist/src/framework/reference.js.map +1 -1
  30. package/dist/src/framework/sample.js +8 -8
  31. package/dist/src/framework/sample.js.map +1 -1
  32. package/dist/src/index.d.ts +1 -1
  33. package/dist/src/index.d.ts.map +1 -1
  34. package/dist/src/index.js +103 -92
  35. package/dist/src/index.js.map +1 -1
  36. package/dist/src/lib.d.ts +1 -1
  37. package/dist/src/lib.d.ts.map +1 -1
  38. package/dist/src/lib.js +140 -140
  39. package/dist/src/lib.js.map +1 -1
  40. package/dist/src/metaTree.d.ts +1 -1
  41. package/dist/src/metaTree.d.ts.map +1 -1
  42. package/dist/src/modular/buildClassicalClient.d.ts +1 -1
  43. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
  44. package/dist/src/modular/buildClassicalClient.js +60 -74
  45. package/dist/src/modular/buildClassicalClient.js.map +1 -1
  46. package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
  47. package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
  48. package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
  49. package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
  50. package/dist/src/modular/buildClientContext.d.ts +2 -2
  51. package/dist/src/modular/buildClientContext.d.ts.map +1 -1
  52. package/dist/src/modular/buildClientContext.js +31 -38
  53. package/dist/src/modular/buildClientContext.js.map +1 -1
  54. package/dist/src/modular/buildModularOptions.d.ts +1 -1
  55. package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
  56. package/dist/src/modular/buildModularOptions.js +5 -6
  57. package/dist/src/modular/buildModularOptions.js.map +1 -1
  58. package/dist/src/modular/buildOperations.d.ts +3 -3
  59. package/dist/src/modular/buildOperations.d.ts.map +1 -1
  60. package/dist/src/modular/buildOperations.js +23 -25
  61. package/dist/src/modular/buildOperations.js.map +1 -1
  62. package/dist/src/modular/buildProjectFiles.d.ts +1 -1
  63. package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
  64. package/dist/src/modular/buildProjectFiles.js +8 -11
  65. package/dist/src/modular/buildProjectFiles.js.map +1 -1
  66. package/dist/src/modular/buildRestorePoller.d.ts +1 -1
  67. package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
  68. package/dist/src/modular/buildRestorePoller.js +12 -13
  69. package/dist/src/modular/buildRestorePoller.js.map +1 -1
  70. package/dist/src/modular/buildRootIndex.d.ts +2 -2
  71. package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
  72. package/dist/src/modular/buildRootIndex.js +36 -50
  73. package/dist/src/modular/buildRootIndex.js.map +1 -1
  74. package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
  75. package/dist/src/modular/buildSubpathIndex.js +9 -18
  76. package/dist/src/modular/buildSubpathIndex.js.map +1 -1
  77. package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
  78. package/dist/src/modular/emitLoggerFile.js +4 -4
  79. package/dist/src/modular/emitLoggerFile.js.map +1 -1
  80. package/dist/src/modular/emitModels.d.ts +1 -1
  81. package/dist/src/modular/emitModels.d.ts.map +1 -1
  82. package/dist/src/modular/emitModels.js +81 -113
  83. package/dist/src/modular/emitModels.js.map +1 -1
  84. package/dist/src/modular/emitModelsOptions.d.ts +1 -1
  85. package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
  86. package/dist/src/modular/emitModelsOptions.js +7 -8
  87. package/dist/src/modular/emitModelsOptions.js.map +1 -1
  88. package/dist/src/modular/emitSamples.d.ts.map +1 -1
  89. package/dist/src/modular/emitSamples.js +69 -77
  90. package/dist/src/modular/emitSamples.js.map +1 -1
  91. package/dist/src/modular/emitTests.d.ts.map +1 -1
  92. package/dist/src/modular/emitTests.js +13 -18
  93. package/dist/src/modular/emitTests.js.map +1 -1
  94. package/dist/src/modular/external-dependencies.js +54 -54
  95. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
  96. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
  97. package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
  98. package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
  99. package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
  100. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
  101. package/dist/src/modular/helpers/clientHelpers.js +31 -54
  102. package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
  103. package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
  104. package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
  105. package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
  106. package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
  107. package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
  108. package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
  109. package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
  110. package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
  111. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
  112. package/dist/src/modular/helpers/namingHelpers.js +7 -10
  113. package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
  114. package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
  115. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
  116. package/dist/src/modular/helpers/operationHelpers.js +204 -288
  117. package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
  118. package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
  119. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
  120. package/dist/src/modular/helpers/typeHelpers.js +4 -6
  121. package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
  122. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
  123. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
  124. package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
  125. package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
  126. package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
  127. package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
  128. package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
  129. package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
  130. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
  131. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
  132. package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
  133. package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
  134. package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
  135. package/dist/src/modular/serialization/serializeUtils.js +25 -33
  136. package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
  137. package/dist/src/modular/static-helpers-metadata.js +60 -60
  138. package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
  139. package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
  140. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
  141. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  142. package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
  143. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  144. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  145. package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
  146. package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
  147. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
  148. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  149. package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
  150. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  151. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  152. package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
  153. package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
  154. package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
  155. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  156. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  157. package/dist/src/rlc-common/buildClient.d.ts +1 -1
  158. package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
  159. package/dist/src/rlc-common/buildClient.js +67 -89
  160. package/dist/src/rlc-common/buildClient.js.map +1 -1
  161. package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
  162. package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
  163. package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
  164. package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
  165. package/dist/src/rlc-common/buildIndexFile.js +59 -60
  166. package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
  167. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
  168. package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
  169. package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
  170. package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
  171. package/dist/src/rlc-common/buildLogger.js +4 -5
  172. package/dist/src/rlc-common/buildLogger.js.map +1 -1
  173. package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
  174. package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
  175. package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
  176. package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
  177. package/dist/src/rlc-common/buildObjectTypes.js +57 -96
  178. package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
  179. package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
  180. package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
  181. package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
  182. package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
  183. package/dist/src/rlc-common/buildParameterTypes.js +71 -61
  184. package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
  185. package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
  186. package/dist/src/rlc-common/buildPollingHelper.js +9 -10
  187. package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
  188. package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
  189. package/dist/src/rlc-common/buildResponseTypes.js +23 -27
  190. package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
  191. package/dist/src/rlc-common/buildSamples.d.ts +1 -1
  192. package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
  193. package/dist/src/rlc-common/buildSamples.js +2 -2
  194. package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
  195. package/dist/src/rlc-common/buildSchemaType.js +31 -13
  196. package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
  197. package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
  198. package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
  199. package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
  200. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
  201. package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
  202. package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
  203. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
  204. package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
  205. package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
  206. package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
  207. package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
  208. package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
  209. package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
  210. package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
  211. package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
  212. package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
  213. package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
  214. package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
  215. package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
  216. package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
  217. package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
  218. package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
  219. package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
  220. package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
  221. package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
  222. package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
  223. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
  224. package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
  225. package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
  226. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
  227. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
  228. package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
  229. package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
  230. package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
  231. package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
  232. package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
  233. package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
  234. package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
  235. package/dist/src/rlc-common/index.d.ts +28 -28
  236. package/dist/src/rlc-common/index.d.ts.map +1 -1
  237. package/dist/src/rlc-common/index.js +28 -28
  238. package/dist/src/rlc-common/index.js.map +1 -1
  239. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  240. package/dist/src/rlc-common/interfaces.js.map +1 -1
  241. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
  242. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
  243. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
  244. package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
  245. package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
  246. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
  247. package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
  248. package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
  249. package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
  250. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
  251. package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
  252. package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
  253. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
  254. package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
  255. package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
  256. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
  257. package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
  258. package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
  259. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
  260. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
  261. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
  262. package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
  263. package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
  264. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
  265. package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
  266. package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
  267. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
  268. package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
  269. package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
  270. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
  271. package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
  272. package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
  273. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
  274. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
  275. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
  276. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
  277. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
  278. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
  279. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
  280. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
  281. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
  282. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
  283. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
  284. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
  285. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
  286. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
  287. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
  288. package/dist/src/rlc-common/metadata/utils.js +1 -2
  289. package/dist/src/rlc-common/metadata/utils.js.map +1 -1
  290. package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
  291. package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
  292. package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
  293. package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
  294. package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
  295. package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
  296. package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
  297. package/dist/src/rlc-common/test/buildSnippets.js +7 -10
  298. package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
  299. package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
  300. package/dist/src/rlc-common/transformSampleGroups.js +41 -45
  301. package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
  302. package/dist/src/testing/index.d.ts.map +1 -1
  303. package/dist/src/testing/index.js +1 -1
  304. package/dist/src/testing/index.js.map +1 -1
  305. package/dist/src/transform/transform.d.ts +1 -1
  306. package/dist/src/transform/transform.d.ts.map +1 -1
  307. package/dist/src/transform/transform.js +28 -27
  308. package/dist/src/transform/transform.js.map +1 -1
  309. package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
  310. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
  311. package/dist/src/transform/transformApiVersionInfo.js +12 -14
  312. package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
  313. package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
  314. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
  315. package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
  316. package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
  317. package/dist/src/transform/transformParameters.d.ts +2 -2
  318. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  319. package/dist/src/transform/transformParameters.js +32 -45
  320. package/dist/src/transform/transformParameters.js.map +1 -1
  321. package/dist/src/transform/transformPaths.d.ts +1 -1
  322. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  323. package/dist/src/transform/transformPaths.js +19 -23
  324. package/dist/src/transform/transformPaths.js.map +1 -1
  325. package/dist/src/transform/transformResponses.d.ts +1 -1
  326. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  327. package/dist/src/transform/transformResponses.js +21 -25
  328. package/dist/src/transform/transformResponses.js.map +1 -1
  329. package/dist/src/transform/transformSchemas.d.ts.map +1 -1
  330. package/dist/src/transform/transformSchemas.js +21 -32
  331. package/dist/src/transform/transformSchemas.js.map +1 -1
  332. package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
  333. package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
  334. package/dist/src/transform/transformTelemetryInfo.js +3 -3
  335. package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
  336. package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
  337. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
  338. package/dist/src/transform/transfromRLCOptions.js +28 -39
  339. package/dist/src/transform/transfromRLCOptions.js.map +1 -1
  340. package/dist/src/utils/clientUtils.d.ts +1 -1
  341. package/dist/src/utils/clientUtils.d.ts.map +1 -1
  342. package/dist/src/utils/clientUtils.js +15 -23
  343. package/dist/src/utils/clientUtils.js.map +1 -1
  344. package/dist/src/utils/credentialUtils.d.ts +1 -1
  345. package/dist/src/utils/credentialUtils.d.ts.map +1 -1
  346. package/dist/src/utils/credentialUtils.js +4 -5
  347. package/dist/src/utils/credentialUtils.js.map +1 -1
  348. package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
  349. package/dist/src/utils/crossLanguageDef.js +11 -15
  350. package/dist/src/utils/crossLanguageDef.js.map +1 -1
  351. package/dist/src/utils/emitUtil.d.ts +1 -1
  352. package/dist/src/utils/emitUtil.d.ts.map +1 -1
  353. package/dist/src/utils/emitUtil.js +5 -7
  354. package/dist/src/utils/emitUtil.js.map +1 -1
  355. package/dist/src/utils/fileSystemUtils.d.ts +2 -0
  356. package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
  357. package/dist/src/utils/fileSystemUtils.js +26 -7
  358. package/dist/src/utils/fileSystemUtils.js.map +1 -1
  359. package/dist/src/utils/importHelper.d.ts.map +1 -1
  360. package/dist/src/utils/importHelper.js +3 -6
  361. package/dist/src/utils/importHelper.js.map +1 -1
  362. package/dist/src/utils/interfaces.d.ts +1 -1
  363. package/dist/src/utils/interfaces.d.ts.map +1 -1
  364. package/dist/src/utils/mediaTypes.d.ts.map +1 -1
  365. package/dist/src/utils/mediaTypes.js +7 -19
  366. package/dist/src/utils/mediaTypes.js.map +1 -1
  367. package/dist/src/utils/modelUtils.d.ts +5 -5
  368. package/dist/src/utils/modelUtils.d.ts.map +1 -1
  369. package/dist/src/utils/modelUtils.js +168 -257
  370. package/dist/src/utils/modelUtils.js.map +1 -1
  371. package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
  372. package/dist/src/utils/namespaceUtils.js +6 -7
  373. package/dist/src/utils/namespaceUtils.js.map +1 -1
  374. package/dist/src/utils/operationUtil.d.ts +1 -1
  375. package/dist/src/utils/operationUtil.d.ts.map +1 -1
  376. package/dist/src/utils/operationUtil.js +60 -81
  377. package/dist/src/utils/operationUtil.js.map +1 -1
  378. package/dist/src/utils/parameterUtils.d.ts +1 -1
  379. package/dist/src/utils/parameterUtils.d.ts.map +1 -1
  380. package/dist/src/utils/parameterUtils.js +26 -33
  381. package/dist/src/utils/parameterUtils.js.map +1 -1
  382. package/dist/src/utils/resolve-project-root.js +2 -2
  383. package/dist/src/utils/resolve-project-root.js.map +1 -1
  384. package/dist/tsconfig.tsbuildinfo +1 -1
  385. package/package.json +38 -45
  386. package/src/contextManager.ts +6 -9
  387. package/src/framework/declaration.ts +18 -28
  388. package/src/framework/dependency.ts +1 -2
  389. package/src/framework/hooks/binder.ts +47 -120
  390. package/src/framework/hooks/sdkTypes.ts +27 -54
  391. package/src/framework/hooks/useDependencies.ts +2 -4
  392. package/src/framework/load-static-helpers.ts +28 -51
  393. package/src/framework/reference.ts +2 -5
  394. package/src/framework/sample.ts +9 -9
  395. package/src/index.ts +145 -185
  396. package/src/lib.ts +143 -158
  397. package/src/metaTree.ts +1 -1
  398. package/src/modular/buildClassicalClient.ts +83 -160
  399. package/src/modular/buildClassicalOperationGroups.ts +14 -39
  400. package/src/modular/buildClientContext.ts +54 -83
  401. package/src/modular/buildModularOptions.ts +4 -5
  402. package/src/modular/buildOperations.ts +46 -73
  403. package/src/modular/buildProjectFiles.ts +18 -47
  404. package/src/modular/buildRestorePoller.ts +27 -46
  405. package/src/modular/buildRootIndex.ts +86 -160
  406. package/src/modular/buildSubpathIndex.ts +35 -58
  407. package/src/modular/emitLoggerFile.ts +4 -9
  408. package/src/modular/emitModels.ts +136 -266
  409. package/src/modular/emitModelsOptions.ts +10 -16
  410. package/src/modular/emitSamples.ts +92 -180
  411. package/src/modular/emitTests.ts +28 -61
  412. package/src/modular/external-dependencies.ts +54 -54
  413. package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
  414. package/src/modular/helpers/clientHelpers.ts +41 -88
  415. package/src/modular/helpers/clientOptionHelpers.ts +4 -11
  416. package/src/modular/helpers/exampleValueHelpers.ts +99 -215
  417. package/src/modular/helpers/namingHelpers.ts +12 -28
  418. package/src/modular/helpers/operationHelpers.ts +430 -757
  419. package/src/modular/helpers/typeHelpers.ts +11 -22
  420. package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
  421. package/src/modular/serialization/buildSerializerFunction.ts +91 -129
  422. package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
  423. package/src/modular/serialization/serializeUtils.ts +12 -22
  424. package/src/modular/static/rollup.test.config.js +11 -14
  425. package/src/modular/static/scripts/renameOutput.mjs +2 -2
  426. package/src/modular/static-helpers-metadata.ts +60 -60
  427. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  428. package/src/modular/type-expressions/get-enum-expression.ts +5 -10
  429. package/src/modular/type-expressions/get-model-expression.ts +13 -17
  430. package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
  431. package/src/modular/type-expressions/get-type-expression.ts +8 -12
  432. package/src/modular/type-expressions/get-union-expression.ts +4 -4
  433. package/src/modular/type-expressions/utils.ts +1 -1
  434. package/src/rlc-common/buildClient.ts +70 -141
  435. package/src/rlc-common/buildClientDefinitions.ts +44 -87
  436. package/src/rlc-common/buildIndexFile.ts +78 -78
  437. package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
  438. package/src/rlc-common/buildLogger.ts +7 -7
  439. package/src/rlc-common/buildMethodShortcuts.ts +9 -21
  440. package/src/rlc-common/buildObjectTypes.ts +79 -156
  441. package/src/rlc-common/buildPaginateHelper.ts +9 -12
  442. package/src/rlc-common/buildParameterTypes.ts +116 -137
  443. package/src/rlc-common/buildPollingHelper.ts +7 -7
  444. package/src/rlc-common/buildResponseTypes.ts +34 -57
  445. package/src/rlc-common/buildSamples.ts +3 -3
  446. package/src/rlc-common/buildSchemaType.ts +37 -29
  447. package/src/rlc-common/buildSerializeHelper.ts +5 -5
  448. package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
  449. package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
  450. package/src/rlc-common/helpers/importsUtil.ts +27 -30
  451. package/src/rlc-common/helpers/nameConstructors.ts +16 -50
  452. package/src/rlc-common/helpers/nameUtils.ts +19 -42
  453. package/src/rlc-common/helpers/operationHelpers.ts +14 -31
  454. package/src/rlc-common/helpers/pathUtils.ts +2 -7
  455. package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
  456. package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
  457. package/src/rlc-common/helpers/typeUtil.ts +4 -11
  458. package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
  459. package/src/rlc-common/index.ts +28 -28
  460. package/src/rlc-common/interfaces.ts +3 -11
  461. package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
  462. package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
  463. package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
  464. package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
  465. package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
  466. package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
  467. package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
  468. package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
  469. package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
  470. package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
  471. package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
  472. package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
  473. package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
  474. package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
  475. package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
  476. package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
  477. package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
  478. package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
  479. package/src/rlc-common/test/buildRecordedClient.ts +3 -3
  480. package/src/rlc-common/test/buildSampleTest.ts +3 -3
  481. package/src/rlc-common/test/buildSnippets.ts +6 -12
  482. package/src/rlc-common/transformSampleGroups.ts +54 -105
  483. package/src/testing/index.ts +2 -5
  484. package/src/transform/transform.ts +22 -34
  485. package/src/transform/transformApiVersionInfo.ts +17 -30
  486. package/src/transform/transformHelperFunctionDetails.ts +14 -26
  487. package/src/transform/transformParameters.ts +55 -105
  488. package/src/transform/transformPaths.ts +26 -43
  489. package/src/transform/transformResponses.ts +26 -33
  490. package/src/transform/transformSchemas.ts +15 -33
  491. package/src/transform/transformTelemetryInfo.ts +8 -14
  492. package/src/transform/transfromRLCOptions.ts +53 -116
  493. package/src/utils/clientUtils.ts +22 -41
  494. package/src/utils/credentialUtils.ts +8 -19
  495. package/src/utils/crossLanguageDef.ts +15 -34
  496. package/src/utils/emitUtil.ts +11 -17
  497. package/src/utils/fileSystemUtils.ts +30 -8
  498. package/src/utils/importHelper.ts +5 -10
  499. package/src/utils/interfaces.ts +1 -1
  500. package/src/utils/mediaTypes.ts +13 -34
  501. package/src/utils/modelUtils.ts +175 -384
  502. package/src/utils/namespaceUtils.ts +8 -24
  503. package/src/utils/operationUtil.ts +98 -190
  504. package/src/utils/parameterUtils.ts +31 -54
  505. package/src/utils/resolve-project-root.ts +3 -3
  506. package/static/static-helpers/cloudSettingHelpers.ts +4 -6
  507. package/static/static-helpers/multipartHelpers.ts +3 -3
  508. package/static/static-helpers/pagingHelpers.ts +28 -63
  509. package/static/static-helpers/pollingHelpers.ts +16 -29
  510. package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
  511. package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
  512. package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
  513. package/static/static-helpers/serialization/get-binary-response.ts +2 -2
  514. package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
  515. package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
  516. package/static/static-helpers/serialization/serialize-record.ts +1 -1
  517. package/static/static-helpers/serialization/serializers.ts +4 -7
  518. package/static/static-helpers/serialization/xml-helpers.ts +42 -90
  519. package/static/static-helpers/simplePollerHelpers.ts +10 -19
  520. package/static/static-helpers/storageCompatResponse.ts +10 -27
  521. package/static/static-helpers/urlTemplate.ts +4 -7
  522. package/static/test-helpers/recordedClient.ts +5 -10
@@ -1,40 +1,27 @@
1
1
  import {
2
- SdkHttpOperationExample,
3
- SdkHttpParameterExampleValue,
4
- SdkExampleValue,
2
+ isReadOnly,
5
3
  SdkClientInitializationType,
6
4
  SdkClientType,
7
- SdkServiceOperation,
5
+ SdkExampleValue,
6
+ SdkHttpOperationExample,
7
+ SdkHttpParameterExampleValue,
8
8
  SdkModelPropertyType,
9
- isReadOnly
9
+ SdkServiceOperation,
10
10
  } from "@azure-tools/typespec-client-generator-core";
11
- import {
12
- isAzurePackage,
13
- NameType,
14
- normalizeName
15
- } from "../../rlc-common/index.js";
11
+ import { join } from "path";
12
+ import { SourceFile } from "ts-morph";
13
+ import { useContext } from "../../contextManager.js";
16
14
  import { resolveReference } from "../../framework/reference.js";
15
+ import { isAzurePackage, NameType, normalizeName } from "../../rlc-common/index.js";
16
+ import { getSubscriptionId } from "../../transform/transfromRLCOptions.js";
17
+ import { hasKeyCredential, hasTokenCredential } from "../../utils/credentialUtils.js";
17
18
  import { SdkContext } from "../../utils/interfaces.js";
18
- import {
19
- AzureIdentityDependencies,
20
- AzureTestDependencies
21
- } from "../external-dependencies.js";
22
- import {
23
- hasKeyCredential,
24
- hasTokenCredential
25
- } from "../../utils/credentialUtils.js";
26
- import { isSpreadBodyParameter } from "./typeHelpers.js";
19
+ import { getMethodHierarchiesMap, ServiceOperation } from "../../utils/operationUtil.js";
20
+ import { AzureIdentityDependencies, AzureTestDependencies } from "../external-dependencies.js";
21
+ import { getClientParametersDeclaration } from "./clientHelpers.js";
27
22
  import { getClassicalClientName } from "./namingHelpers.js";
28
- import {
29
- getMethodHierarchiesMap,
30
- ServiceOperation
31
- } from "../../utils/operationUtil.js";
32
- import { getSubscriptionId } from "../../transform/transfromRLCOptions.js";
33
- import { SourceFile } from "ts-morph";
34
- import { useContext } from "../../contextManager.js";
35
- import { join } from "path";
36
23
  import { getOperationFunction } from "./operationHelpers.js";
37
- import { getClientParametersDeclaration } from "./clientHelpers.js";
24
+ import { isSpreadBodyParameter } from "./typeHelpers.js";
38
25
 
39
26
  /**
40
27
  * Common interfaces for both samples and tests
@@ -58,12 +45,10 @@ export interface ClientEmitOptions {
58
45
  * Build parameter value map from example
59
46
  */
60
47
  export function buildParameterValueMap(
61
- example: SdkHttpOperationExample
48
+ example: SdkHttpOperationExample,
62
49
  ): Record<string, SdkHttpParameterExampleValue> {
63
50
  const parameterMap: Record<string, SdkHttpParameterExampleValue> = {};
64
- example.parameters.forEach(
65
- (param) => (parameterMap[param.parameter.serializedName] = param)
66
- );
51
+ example.parameters.forEach((param) => (parameterMap[param.parameter.serializedName] = param));
67
52
  return parameterMap;
68
53
  }
69
54
 
@@ -74,13 +59,13 @@ export function prepareCommonValue(
74
59
  name: string,
75
60
  value: SdkExampleValue | string,
76
61
  isOptional?: boolean,
77
- onClient?: boolean
62
+ onClient?: boolean,
78
63
  ): CommonValue {
79
64
  return {
80
65
  name: normalizeName(name, NameType.Parameter),
81
66
  value: typeof value === "string" ? value : serializeExampleValue(value),
82
67
  isOptional: Boolean(isOptional),
83
- onClient: Boolean(onClient)
68
+ onClient: Boolean(onClient),
84
69
  };
85
70
  }
86
71
 
@@ -89,36 +74,34 @@ export function prepareCommonValue(
89
74
  */
90
75
  export function getCredentialSampleValue(
91
76
  dpgContext: SdkContext,
92
- initialization: SdkClientInitializationType
77
+ initialization: SdkClientInitializationType,
93
78
  ): CommonValue | undefined {
94
79
  const keyCredential = hasKeyCredential(initialization),
95
80
  tokenCredential = hasTokenCredential(initialization);
96
81
  const defaultSetting = {
97
82
  isOptional: false,
98
83
  onClient: true,
99
- name: "credential"
84
+ name: "credential",
100
85
  };
101
86
  if (keyCredential || tokenCredential) {
102
87
  if (isAzurePackage({ options: dpgContext.rlcOptions })) {
103
88
  // Support DefaultAzureCredential for Azure packages
104
89
  return {
105
90
  ...defaultSetting,
106
- value: `new ${resolveReference(
107
- AzureIdentityDependencies.DefaultAzureCredential
108
- )}()`
91
+ value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`,
109
92
  };
110
93
  } else if (keyCredential) {
111
94
  // Support ApiKeyCredential for non-Azure packages
112
95
  return {
113
96
  ...defaultSetting,
114
- value: `{ key: "INPUT_YOUR_KEY_HERE" }`
97
+ value: `{ key: "INPUT_YOUR_KEY_HERE" }`,
115
98
  };
116
99
  } else if (tokenCredential) {
117
100
  // Support TokenCredential for non-Azure packages
118
101
  return {
119
102
  ...defaultSetting,
120
103
  value: `{ getToken: async () => {
121
- return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() }; } }`
104
+ return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() }; } }`,
122
105
  };
123
106
  }
124
107
  }
@@ -130,17 +113,15 @@ export function getCredentialSampleValue(
130
113
  */
131
114
  export function getCredentialTestValue(
132
115
  dpgContext: SdkContext,
133
- initialization: SdkClientInitializationType
116
+ initialization: SdkClientInitializationType,
134
117
  ): CommonValue | undefined {
135
- const createTestCredentialType = resolveReference(
136
- AzureTestDependencies.createTestCredential
137
- );
118
+ const createTestCredentialType = resolveReference(AzureTestDependencies.createTestCredential);
138
119
  const keyCredential = hasKeyCredential(initialization),
139
120
  tokenCredential = hasTokenCredential(initialization);
140
121
  const defaultSetting = {
141
122
  isOptional: false,
142
123
  onClient: true,
143
- name: "credential"
124
+ name: "credential",
144
125
  };
145
126
 
146
127
  if (keyCredential || tokenCredential) {
@@ -148,13 +129,13 @@ export function getCredentialTestValue(
148
129
  // Support createTestCredential for ARM/Azure packages
149
130
  return {
150
131
  ...defaultSetting,
151
- value: `${createTestCredentialType}()`
132
+ value: `${createTestCredentialType}()`,
152
133
  };
153
134
  } else if (keyCredential) {
154
135
  // Support ApiKeyCredential for non-Azure packages
155
136
  return {
156
137
  ...defaultSetting,
157
- value: `{ key: "INPUT_YOUR_KEY_HERE" } `
138
+ value: `{ key: "INPUT_YOUR_KEY_HERE" } `,
158
139
  };
159
140
  } else if (tokenCredential) {
160
141
  // Support TokenCredential for non-Azure packages
@@ -164,7 +145,7 @@ export function getCredentialTestValue(
164
145
  getToken: async () => {
165
146
  return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() };
166
147
  }
167
- } `
148
+ } `,
168
149
  };
169
150
  }
170
151
  }
@@ -198,9 +179,7 @@ export function serializeExampleValue(value: SdkExampleValue): string {
198
179
  .replace(/\n/g, "\\n")
199
180
  .replace(/\r/g, "\\r")
200
181
  .replace(/\t/g, "\\t")
201
- .replace(/\f/g, "\\f")
202
- .replace(/>/g, ">")
203
- .replace(/</g, "<")}"`;
182
+ .replace(/\f/g, "\\f")}"`;
204
183
  break;
205
184
  }
206
185
  break;
@@ -219,7 +198,7 @@ export function serializeExampleValue(value: SdkExampleValue): string {
219
198
  const additionalPropertiesValue =
220
199
  value.kind === "model" ? (value.additionalPropertiesValue ?? {}) : {};
221
200
  for (const propName in {
222
- ...value.value
201
+ ...value.value,
223
202
  }) {
224
203
  let property;
225
204
  if (value.type.kind === "model") {
@@ -234,49 +213,38 @@ export function serializeExampleValue(value: SdkExampleValue): string {
234
213
  continue;
235
214
  }
236
215
  // Handle flattened properties: inline inner model properties at current level
237
- if (
238
- property?.flatten &&
239
- property.type.kind === "model" &&
240
- propValue.kind === "model"
241
- ) {
216
+ if (property?.flatten && property.type.kind === "model" && propValue.kind === "model") {
242
217
  const innerMapper = buildTestPropertyNameMapper(property.type);
243
218
  for (const innerPropName in propValue.value ?? {}) {
244
219
  const innerPropValue = propValue.value[innerPropName];
245
220
  if (innerPropValue === undefined || innerPropValue === null) {
246
221
  continue;
247
222
  }
248
- const innerProperty = property.type.properties.find(
249
- (p) => p.name === innerPropName
250
- );
251
- if (
252
- innerProperty &&
253
- isReadOnly(innerProperty as SdkModelPropertyType)
254
- ) {
223
+ const innerProperty = property.type.properties.find((p) => p.name === innerPropName);
224
+ if (innerProperty && isReadOnly(innerProperty as SdkModelPropertyType)) {
255
225
  continue;
256
226
  }
257
227
  values.push(
258
228
  `"${innerMapper.get(innerPropName) ?? innerPropName}": ` +
259
- serializeExampleValue(innerPropValue)
229
+ serializeExampleValue(innerPropValue),
260
230
  );
261
231
  }
262
232
  continue;
263
233
  }
264
234
  const propRetValue =
265
- `"${mapper.get(propName) ?? propName}": ` +
266
- serializeExampleValue(propValue);
235
+ `"${mapper.get(propName) ?? propName}": ` + serializeExampleValue(propValue);
267
236
  values.push(propRetValue);
268
237
  }
269
238
  const additionalBags = [];
270
239
  for (const propName in {
271
- ...additionalPropertiesValue
240
+ ...additionalPropertiesValue,
272
241
  }) {
273
242
  const propValue = additionalPropertiesValue[propName];
274
243
  if (propValue === undefined || propValue === null) {
275
244
  continue;
276
245
  }
277
246
  const propRetValue =
278
- `"${mapper.get(propName) ?? propName}": ` +
279
- serializeExampleValue(propValue);
247
+ `"${mapper.get(propName) ?? propName}": ` + serializeExampleValue(propValue);
280
248
  additionalBags.push(propRetValue);
281
249
  }
282
250
  if (additionalBags.length > 0) {
@@ -317,7 +285,7 @@ function buildTestPropertyNameMapper(type: SdkExampleValue["type"]) {
317
285
  }
318
286
  mapper.set(
319
287
  prop.serializationOptions.json?.name || prop.name,
320
- normalizeName(prop.name, NameType.Property)
288
+ normalizeName(prop.name, NameType.Property),
321
289
  );
322
290
  }
323
291
  return mapper;
@@ -339,11 +307,10 @@ export function escapeSpecialCharToSpace(str: string): string {
339
307
  export function getDescriptiveName(
340
308
  method: { doc?: string; oriName?: string; name: string },
341
309
  exampleName: string,
342
- type: "sample" | "test"
310
+ type: "sample" | "test",
343
311
  ): string {
344
312
  const description = method.doc ?? `execute ${method.oriName ?? method.name}`;
345
- let descriptiveName =
346
- description.charAt(0).toLowerCase() + description.slice(1);
313
+ let descriptiveName = description.charAt(0).toLowerCase() + description.slice(1);
347
314
 
348
315
  // Only remove trailing dots for test names to avoid redundancy
349
316
  if (type === "test") {
@@ -364,18 +331,14 @@ export function prepareCommonParameters(
364
331
  dpgContext: SdkContext,
365
332
  method: ServiceOperation,
366
333
  parameterMap: Record<string, SdkHttpParameterExampleValue>,
367
- topLevelClient: SdkClientType<SdkServiceOperation>
334
+ topLevelClient: SdkClientType<SdkServiceOperation>,
368
335
  ): CommonValue[] {
369
336
  const envType = resolveReference(AzureTestDependencies.env);
370
337
  const result: CommonValue[] = [];
371
338
 
372
- const clientParams = getClientParametersDeclaration(
373
- topLevelClient,
374
- dpgContext,
375
- {
376
- onClientOnly: true
377
- }
378
- );
339
+ const clientParams = getClientParametersDeclaration(topLevelClient, dpgContext, {
340
+ onClientOnly: true,
341
+ });
379
342
 
380
343
  for (const param of clientParams) {
381
344
  if (param.name === "options" || param.name === "credential") {
@@ -384,22 +347,16 @@ export function prepareCommonParameters(
384
347
 
385
348
  const exampleValue: CommonValue = {
386
349
  name: param.name === "endpointParam" ? "endpoint" : param.name,
387
- value: getEnvironmentVariableName(
388
- param.name,
389
- getClassicalClientName(topLevelClient)
390
- ),
350
+ value: getEnvironmentVariableName(param.name, getClassicalClientName(topLevelClient)),
391
351
  isOptional: Boolean(param.hasQuestionToken),
392
- onClient: true
352
+ onClient: true,
393
353
  };
394
354
 
395
355
  result.push(exampleValue);
396
356
  }
397
357
 
398
358
  // Handle credentials for tests
399
- const credentialValue = getCredentialTestValue(
400
- dpgContext,
401
- topLevelClient.clientInitialization
402
- );
359
+ const credentialValue = getCredentialTestValue(dpgContext, topLevelClient.clientInitialization);
403
360
  if (credentialValue) {
404
361
  result.push(credentialValue);
405
362
  }
@@ -409,11 +366,7 @@ export function prepareCommonParameters(
409
366
 
410
367
  // Process required parameters
411
368
  for (const param of method.operation.parameters) {
412
- if (
413
- param.optional === true ||
414
- param.type.kind === "constant" ||
415
- param.clientDefaultValue
416
- ) {
369
+ if (param.optional === true || param.type.kind === "constant" || param.clientDefaultValue) {
417
370
  continue;
418
371
  }
419
372
 
@@ -423,9 +376,7 @@ export function prepareCommonParameters(
423
376
  if (param.name.toLowerCase() === "subscriptionid" && dpgContext.arm) {
424
377
  isSubscriptionIdAdded = true;
425
378
  // For tests, always use env variable
426
- result.push(
427
- prepareCommonValue("subscriptionId", subscriptionIdValue, false, true)
428
- );
379
+ result.push(prepareCommonValue("subscriptionId", subscriptionIdValue, false, true));
429
380
  continue;
430
381
  }
431
382
 
@@ -433,12 +384,7 @@ export function prepareCommonParameters(
433
384
  if (!param.optional) {
434
385
  // Generate default values for required parameters without examples in tests
435
386
  result.push(
436
- prepareCommonValue(
437
- param.name,
438
- `"{Your ${param.name}}"`,
439
- false,
440
- param.onClient
441
- )
387
+ prepareCommonValue(param.name, `"{Your ${param.name}}"`, false, param.onClient),
442
388
  );
443
389
  }
444
390
  continue;
@@ -449,20 +395,14 @@ export function prepareCommonParameters(
449
395
  exampleValue.parameter.name,
450
396
  exampleValue.value,
451
397
  param.optional,
452
- param.onClient
453
- )
398
+ param.onClient,
399
+ ),
454
400
  );
455
401
  }
456
402
 
457
403
  // Add subscriptionId for ARM clients if needed
458
- if (
459
- dpgContext.arm &&
460
- getSubscriptionId(dpgContext) &&
461
- !isSubscriptionIdAdded
462
- ) {
463
- result.push(
464
- prepareCommonValue("subscriptionId", subscriptionIdValue, false, true)
465
- );
404
+ if (dpgContext.arm && getSubscriptionId(dpgContext) && !isSubscriptionIdAdded) {
405
+ result.push(prepareCommonValue("subscriptionId", subscriptionIdValue, false, true));
466
406
  }
467
407
 
468
408
  // Handle body parameters
@@ -484,22 +424,13 @@ export function prepareCommonParameters(
484
424
  if (isReadOnly(prop as SdkModelPropertyType)) {
485
425
  continue;
486
426
  }
487
- result.push(
488
- prepareCommonValue(
489
- prop.name,
490
- propExample,
491
- prop.optional,
492
- prop.onClient
493
- )
494
- );
427
+ result.push(prepareCommonValue(prop.name, propExample, prop.optional, prop.onClient));
495
428
  }
496
429
  } else {
497
430
  // Check if the body parameter is nested inside a wrapper (e.g., @bodyRoot)
498
431
  const segments = bodyParam.methodParameterSegments;
499
432
  const isNestedBody =
500
- segments.length === 1 &&
501
- segments[0] !== undefined &&
502
- segments[0].length > 1;
433
+ segments.length === 1 && segments[0] !== undefined && segments[0].length > 1;
503
434
  if (isNestedBody) {
504
435
  const path = segments[0]!;
505
436
  // The first segment is the method-level wrapper param (e.g., "body")
@@ -516,8 +447,8 @@ export function prepareCommonParameters(
516
447
  methodParamName,
517
448
  wrappedValue,
518
449
  methodParamOptional,
519
- bodyParam.onClient
520
- )
450
+ bodyParam.onClient,
451
+ ),
521
452
  );
522
453
  } else {
523
454
  result.push(
@@ -525,8 +456,8 @@ export function prepareCommonParameters(
525
456
  bodyParam.name,
526
457
  bodyExample.value,
527
458
  bodyParam.optional,
528
- bodyParam.onClient
529
- )
459
+ bodyParam.onClient,
460
+ ),
530
461
  );
531
462
  }
532
463
  }
@@ -536,21 +467,12 @@ export function prepareCommonParameters(
536
467
  method.operation.parameters
537
468
  .filter(
538
469
  (param) =>
539
- param.optional === true &&
540
- parameterMap[param.serializedName] &&
541
- !param.clientDefaultValue
470
+ param.optional === true && parameterMap[param.serializedName] && !param.clientDefaultValue,
542
471
  )
543
472
  .forEach((param) => {
544
473
  const exampleValue = parameterMap[param.serializedName];
545
474
  if (exampleValue && exampleValue.value) {
546
- result.push(
547
- prepareCommonValue(
548
- param.name,
549
- exampleValue.value,
550
- true,
551
- param.onClient
552
- )
553
- );
475
+ result.push(prepareCommonValue(param.name, exampleValue.value, true, param.onClient));
554
476
  }
555
477
  });
556
478
 
@@ -565,8 +487,8 @@ export function iterateClientsAndMethods(
565
487
  callback: (
566
488
  dpgContext: SdkContext,
567
489
  method: ServiceOperation,
568
- options: ClientEmitOptions
569
- ) => SourceFile | undefined
490
+ options: ClientEmitOptions,
491
+ ) => SourceFile | undefined,
570
492
  ): SourceFile[] {
571
493
  const generatedFiles: SourceFile[] = [];
572
494
  const clients = dpgContext.sdkPackage.clients;
@@ -589,7 +511,7 @@ export function iterateClientsAndMethods(
589
511
  clients.length > 1
590
512
  ? normalizeName(getClassicalClientName(client), NameType.File)
591
513
  : undefined,
592
- hierarchies: hierarchies
514
+ hierarchies: hierarchies,
593
515
  });
594
516
  }
595
517
  }
@@ -604,7 +526,7 @@ export function generateMethodCall(
604
526
  method: ServiceOperation,
605
527
  parameters: CommonValue[],
606
528
  options: ClientEmitOptions,
607
- dpgContext?: SdkContext
529
+ dpgContext?: SdkContext,
608
530
  ): { methodCall: string; clientParams: string[]; clientParamDefs: string[] } {
609
531
  // Prepare client-level parameters
610
532
  const clientParamValues = parameters.filter((p) => p.onClient);
@@ -626,17 +548,13 @@ export function generateMethodCall(
626
548
  const operationFunction = getOperationFunction(
627
549
  dpgContext,
628
550
  [options.hierarchies ?? [], method],
629
- "Client"
551
+ "Client",
630
552
  );
631
553
 
632
554
  // Extract parameter names from the function signature (excluding context and options)
633
555
  const signatureParamNames =
634
556
  operationFunction.parameters
635
- ?.filter(
636
- (p) =>
637
- p.name !== "context" &&
638
- !p.type?.toString().includes("OptionalParams")
639
- )
557
+ ?.filter((p) => p.name !== "context" && !p.type?.toString().includes("OptionalParams"))
640
558
  .map((p) => p.name) ?? [];
641
559
 
642
560
  // Create a map for quick lookup of parameter values by name
@@ -650,9 +568,7 @@ export function generateMethodCall(
650
568
  methodParams = orderedRequiredParams.map((p) => `${p.value}`);
651
569
  } else {
652
570
  // Original logic when dpgContext is not provided
653
- methodParams = methodParamValues
654
- .filter((p) => !p.isOptional)
655
- .map((p) => `${p.value}`);
571
+ methodParams = methodParamValues.filter((p) => !p.isOptional).map((p) => `${p.value}`);
656
572
  }
657
573
 
658
574
  const optionalParams = methodParamValues
@@ -662,9 +578,7 @@ export function generateMethodCall(
662
578
  methodParams.push(`{${optionalParams.join(", ")}}`);
663
579
  }
664
580
 
665
- const prefix = options.classicalMethodPrefix
666
- ? `${options.classicalMethodPrefix}.`
667
- : "";
581
+ const prefix = options.classicalMethodPrefix ? `${options.classicalMethodPrefix}.` : "";
668
582
  const methodCall = `client.${prefix}${normalizeName(method.oriName ?? method.name, NameType.Property)}(${methodParams.join(", ")})`;
669
583
 
670
584
  return { methodCall, clientParams, clientParamDefs };
@@ -678,30 +592,22 @@ export function createSourceFile(
678
592
  method: ServiceOperation,
679
593
  options: ClientEmitOptions,
680
594
  type: "sample" | "test",
681
- fileName: string
595
+ fileName: string,
682
596
  ): SourceFile {
683
597
  const project = useContext("outputProject");
684
- const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${
685
- method.oriName ?? method.name
686
- }`;
687
- const baseFolder =
688
- type === "sample" ? "samples-dev" : join("test", "generated");
598
+ const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${method.oriName ?? method.name}`;
599
+ const baseFolder = type === "sample" ? "samples-dev" : join("test", "generated");
689
600
  const folder = join(
690
601
  dpgContext.generationPathDetail?.rootDir ?? "",
691
602
  baseFolder,
692
- options.subFolder ?? ""
603
+ options.subFolder ?? "",
693
604
  );
694
605
  const fileExtension = type === "sample" ? ".ts" : ".spec.ts";
695
- const normalizedFileName = normalizeName(
696
- fileName || `${operationPrefix} ${type}`,
697
- NameType.File
698
- );
606
+ const normalizedFileName = normalizeName(fileName || `${operationPrefix} ${type}`, NameType.File);
699
607
 
700
- return project.createSourceFile(
701
- join(folder, `${normalizedFileName}${fileExtension}`),
702
- "",
703
- { overwrite: true }
704
- );
608
+ return project.createSourceFile(join(folder, `${normalizedFileName}${fileExtension}`), "", {
609
+ overwrite: true,
610
+ });
705
611
  }
706
612
 
707
613
  /**
@@ -711,7 +617,7 @@ export function generateAssertionsForValue(
711
617
  value: SdkExampleValue,
712
618
  path: string,
713
619
  maxDepth: number = 3,
714
- currentDepth: number = 0
620
+ currentDepth: number = 0,
715
621
  ): string[] {
716
622
  const assertions: string[] = [];
717
623
 
@@ -725,13 +631,13 @@ export function generateAssertionsForValue(
725
631
  switch (value.type.kind) {
726
632
  case "utcDateTime":
727
633
  assertions.push(
728
- `assert.strictEqual(${path}.getTime(), new Date("${value.value}").getTime());`
634
+ `assert.strictEqual(${path}.getTime(), new Date("${value.value}").getTime());`,
729
635
  );
730
636
  break;
731
637
  case "bytes": {
732
638
  const encode = value.type.encode ?? "base64";
733
639
  assertions.push(
734
- `assert.deepEqual(${path}, Buffer.from("${value.value}", "${encode}"));`
640
+ `assert.deepEqual(${path}, Buffer.from("${value.value}", "${encode}"));`,
735
641
  );
736
642
  break;
737
643
  }
@@ -743,9 +649,7 @@ export function generateAssertionsForValue(
743
649
  .replace(/\n/g, "\\n")
744
650
  .replace(/\r/g, "\\r")
745
651
  .replace(/\t/g, "\\t")
746
- .replace(/\f/g, "\\f")
747
- .replace(/>/g, ">")
748
- .replace(/</g, "<")}"`;
652
+ .replace(/\f/g, "\\f")}"`;
749
653
  assertions.push(`assert.strictEqual(${path}, ${retValue});`);
750
654
  break;
751
655
  }
@@ -754,9 +658,7 @@ export function generateAssertionsForValue(
754
658
  }
755
659
  case "boolean":
756
660
  case "number":
757
- assertions.push(
758
- `assert.strictEqual(${path}, ${JSON.stringify(value.value)});`
759
- );
661
+ assertions.push(`assert.strictEqual(${path}, ${JSON.stringify(value.value)});`);
760
662
  break;
761
663
  case "unknown":
762
664
  // for unknown type we fall back to assert.isDefined to avoid false positives in tests, so we can't assert on the exact value. But we can still check that the payload is defined.
@@ -765,9 +667,7 @@ export function generateAssertionsForValue(
765
667
  case "array":
766
668
  if (value.value && value.value.length > 0) {
767
669
  assertions.push(`assert.ok(Array.isArray(${path}));`);
768
- assertions.push(
769
- `assert.strictEqual(${path}.length, ${value.value.length});`
770
- );
670
+ assertions.push(`assert.strictEqual(${path}.length, ${value.value.length});`);
771
671
 
772
672
  // Assert on first few items to avoid overly verbose tests
773
673
  const itemsToCheck = Math.min(value.value.length, 2);
@@ -778,7 +678,7 @@ export function generateAssertionsForValue(
778
678
  item,
779
679
  `${path}[${i}]`,
780
680
  maxDepth,
781
- currentDepth + 1
681
+ currentDepth + 1,
782
682
  );
783
683
  assertions.push(...itemAssertions);
784
684
  }
@@ -796,21 +696,16 @@ export function generateAssertionsForValue(
796
696
  // Check if this property is flattened in the model type
797
697
  let property;
798
698
  if (value.kind === "model" && value.type.kind === "model") {
799
- property = value.type.properties.find(
800
- (p) => p.kind === "property" && p.name === key
801
- );
699
+ property = value.type.properties.find((p) => p.kind === "property" && p.name === key);
802
700
  }
803
- if (
804
- property?.flatten &&
805
- (val as SdkExampleValue).kind === "model"
806
- ) {
701
+ if (property?.flatten && (val as SdkExampleValue).kind === "model") {
807
702
  // For flattened properties, recurse using the parent path so
808
703
  // assertions reference result.xxx instead of result.properties.xxx
809
704
  const innerAssertions = generateAssertionsForValue(
810
705
  val as SdkExampleValue,
811
706
  path,
812
707
  maxDepth,
813
- currentDepth + 1
708
+ currentDepth + 1,
814
709
  );
815
710
  assertions.push(...innerAssertions);
816
711
  } else {
@@ -819,14 +714,12 @@ export function generateAssertionsForValue(
819
714
  // For nested model/dict values, append "?" to the path so child
820
715
  // property accesses use optional chaining (e.g. result.systemData?.createdBy)
821
716
  const recursePath =
822
- nestedVal.kind === "model" || nestedVal.kind === "dict"
823
- ? `${propPath}?`
824
- : propPath;
717
+ nestedVal.kind === "model" || nestedVal.kind === "dict" ? `${propPath}?` : propPath;
825
718
  const propAssertions = generateAssertionsForValue(
826
719
  nestedVal,
827
720
  recursePath,
828
721
  maxDepth,
829
- currentDepth + 1
722
+ currentDepth + 1,
830
723
  );
831
724
  assertions.push(...propAssertions);
832
725
  }
@@ -846,7 +739,7 @@ export function generateAssertionsForValue(
846
739
  value.value as SdkExampleValue,
847
740
  path,
848
741
  maxDepth,
849
- currentDepth
742
+ currentDepth,
850
743
  );
851
744
  assertions.push(...unionAssertions);
852
745
  }
@@ -862,7 +755,7 @@ export function generateAssertionsForValue(
862
755
  export function generateResponseAssertions(
863
756
  example: SdkHttpOperationExample,
864
757
  resultVariableName: string,
865
- isPaging: boolean = false
758
+ isPaging: boolean = false,
866
759
  ): string[] {
867
760
  const assertions: string[] = [];
868
761
 
@@ -893,16 +786,13 @@ export function generateResponseAssertions(
893
786
  if (isPaging) {
894
787
  // For paging operations, the response body should have a 'value' array
895
788
  if (responseBody.kind === "model" || responseBody.kind === "dict") {
896
- const responseValue = responseBody.value as Record<
897
- string,
898
- SdkExampleValue
899
- >;
789
+ const responseValue = responseBody.value as Record<string, SdkExampleValue>;
900
790
  const valueArray = responseValue?.["value"];
901
791
 
902
792
  if (valueArray && valueArray.kind === "array" && valueArray.value) {
903
793
  // Assert on the length of the collected results
904
794
  assertions.push(
905
- `assert.strictEqual(${resultVariableName}.length, ${valueArray.value.length});`
795
+ `assert.strictEqual(${resultVariableName}.length, ${valueArray.value.length});`,
906
796
  );
907
797
 
908
798
  // Assert on the first item if available
@@ -913,7 +803,7 @@ export function generateResponseAssertions(
913
803
  firstItem,
914
804
  `${resultVariableName}[0]`,
915
805
  2, // Limit depth for paging items
916
- 0
806
+ 0,
917
807
  );
918
808
  assertions.push(...itemAssertions);
919
809
  }
@@ -922,10 +812,7 @@ export function generateResponseAssertions(
922
812
  }
923
813
  } else {
924
814
  // Generate assertions based on response body structure
925
- const responseAssertions = generateAssertionsForValue(
926
- responseBody,
927
- resultVariableName
928
- );
815
+ const responseAssertions = generateAssertionsForValue(responseBody, resultVariableName);
929
816
  assertions.push(...responseAssertions);
930
817
  }
931
818
 
@@ -939,10 +826,7 @@ export function generateResponseAssertions(
939
826
  * @param clientName - Optional client name to use as prefix
940
827
  * @returns The environment variable expression string
941
828
  */
942
- function getEnvironmentVariableName(
943
- paramName: string,
944
- clientName?: string
945
- ): string {
829
+ function getEnvironmentVariableName(paramName: string, clientName?: string): string {
946
830
  // Remove "Param" suffix if present
947
831
  const cleanName = paramName.replace(/Param$/, "");
948
832