@azure-tools/typespec-ts 0.53.3 → 0.54.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (446) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  3. package/dist/src/framework/hooks/binder.js +102 -44
  4. package/dist/src/framework/hooks/binder.js.map +1 -1
  5. package/dist/src/framework/hooks/sdkTypes.js +1 -1
  6. package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
  7. package/dist/src/framework/load-static-helpers.js +1 -1
  8. package/dist/src/framework/load-static-helpers.js.map +1 -1
  9. package/dist/src/index.d.ts.map +1 -1
  10. package/dist/src/index.js +4 -1
  11. package/dist/src/index.js.map +1 -1
  12. package/dist/src/lib.d.ts +1 -10
  13. package/dist/src/lib.d.ts.map +1 -1
  14. package/dist/src/lib.js +0 -5
  15. package/dist/src/lib.js.map +1 -1
  16. package/dist/src/metaTree.d.ts +1 -1
  17. package/dist/src/metaTree.d.ts.map +1 -1
  18. package/dist/src/modular/buildClassicalClient.js +1 -1
  19. package/dist/src/modular/buildClassicalClient.js.map +1 -1
  20. package/dist/src/modular/buildClassicalOperationGroups.js +1 -1
  21. package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
  22. package/dist/src/modular/buildClientContext.js +1 -1
  23. package/dist/src/modular/buildClientContext.js.map +1 -1
  24. package/dist/src/modular/buildOperations.js +1 -1
  25. package/dist/src/modular/buildOperations.js.map +1 -1
  26. package/dist/src/modular/buildProjectFiles.js +1 -1
  27. package/dist/src/modular/buildProjectFiles.js.map +1 -1
  28. package/dist/src/modular/buildRestorePoller.js +1 -1
  29. package/dist/src/modular/buildRestorePoller.js.map +1 -1
  30. package/dist/src/modular/buildRootIndex.js +1 -1
  31. package/dist/src/modular/buildRootIndex.js.map +1 -1
  32. package/dist/src/modular/emitModels.d.ts +1 -1
  33. package/dist/src/modular/emitModels.d.ts.map +1 -1
  34. package/dist/src/modular/emitModels.js +1 -1
  35. package/dist/src/modular/emitModels.js.map +1 -1
  36. package/dist/src/modular/emitModelsOptions.js +1 -1
  37. package/dist/src/modular/emitModelsOptions.js.map +1 -1
  38. package/dist/src/modular/emitSamples.js +1 -1
  39. package/dist/src/modular/emitSamples.js.map +1 -1
  40. package/dist/src/modular/emitTests.js +1 -1
  41. package/dist/src/modular/emitTests.js.map +1 -1
  42. package/dist/src/modular/helpers/classicalOperationHelpers.js +1 -1
  43. package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
  44. package/dist/src/modular/helpers/clientHelpers.js +1 -1
  45. package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
  46. package/dist/src/modular/helpers/exampleValueHelpers.js +1 -1
  47. package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
  48. package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
  49. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
  50. package/dist/src/modular/helpers/namingHelpers.js +1 -1
  51. package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
  52. package/dist/src/modular/helpers/operationHelpers.d.ts +1 -1
  53. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
  54. package/dist/src/modular/helpers/operationHelpers.js +53 -34
  55. package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
  56. package/dist/src/modular/helpers/typeHelpers.js +1 -1
  57. package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
  58. package/dist/src/modular/interfaces.d.ts +1 -1
  59. package/dist/src/modular/interfaces.d.ts.map +1 -1
  60. package/dist/src/modular/serialization/buildDeserializerFunction.js +1 -1
  61. package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
  62. package/dist/src/modular/serialization/buildSerializerFunction.js +1 -1
  63. package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
  64. package/dist/src/modular/serialization/buildXmlSerializerFunction.js +1 -1
  65. package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
  66. package/dist/src/modular/type-expressions/get-type-expression.js +1 -1
  67. package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
  68. package/dist/src/rlc-common/buildClient.d.ts +9 -0
  69. package/dist/src/rlc-common/buildClient.d.ts.map +1 -0
  70. package/dist/src/rlc-common/buildClient.js +413 -0
  71. package/dist/src/rlc-common/buildClient.js.map +1 -0
  72. package/dist/src/rlc-common/buildClientDefinitions.d.ts +6 -0
  73. package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -0
  74. package/dist/src/rlc-common/buildClientDefinitions.js +174 -0
  75. package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -0
  76. package/dist/src/rlc-common/buildIndexFile.d.ts +6 -0
  77. package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -0
  78. package/dist/src/rlc-common/buildIndexFile.js +242 -0
  79. package/dist/src/rlc-common/buildIndexFile.js.map +1 -0
  80. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts +6 -0
  81. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -0
  82. package/dist/src/rlc-common/buildIsUnexpectedHelper.js +224 -0
  83. package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -0
  84. package/dist/src/rlc-common/buildLogger.d.ts +6 -0
  85. package/dist/src/rlc-common/buildLogger.d.ts.map +1 -0
  86. package/dist/src/rlc-common/buildLogger.js +32 -0
  87. package/dist/src/rlc-common/buildLogger.js.map +1 -0
  88. package/dist/src/rlc-common/buildMethodShortcuts.d.ts +5 -0
  89. package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -0
  90. package/dist/src/rlc-common/buildMethodShortcuts.js +54 -0
  91. package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -0
  92. package/dist/src/rlc-common/buildObjectTypes.d.ts +29 -0
  93. package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -0
  94. package/dist/src/rlc-common/buildObjectTypes.js +451 -0
  95. package/dist/src/rlc-common/buildObjectTypes.js.map +1 -0
  96. package/dist/src/rlc-common/buildPaginateHelper.d.ts +6 -0
  97. package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -0
  98. package/dist/src/rlc-common/buildPaginateHelper.js +27 -0
  99. package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -0
  100. package/dist/src/rlc-common/buildParameterTypes.d.ts +14 -0
  101. package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -0
  102. package/dist/src/rlc-common/buildParameterTypes.js +381 -0
  103. package/dist/src/rlc-common/buildParameterTypes.js.map +1 -0
  104. package/dist/src/rlc-common/buildPollingHelper.d.ts +6 -0
  105. package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -0
  106. package/dist/src/rlc-common/buildPollingHelper.js +62 -0
  107. package/dist/src/rlc-common/buildPollingHelper.js.map +1 -0
  108. package/dist/src/rlc-common/buildResponseTypes.d.ts +6 -0
  109. package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -0
  110. package/dist/src/rlc-common/buildResponseTypes.js +147 -0
  111. package/dist/src/rlc-common/buildResponseTypes.js.map +1 -0
  112. package/dist/src/rlc-common/buildSamples.d.ts +3 -0
  113. package/dist/src/rlc-common/buildSamples.d.ts.map +1 -0
  114. package/dist/src/rlc-common/buildSamples.js +30 -0
  115. package/dist/src/rlc-common/buildSamples.js.map +1 -0
  116. package/dist/src/rlc-common/buildSchemaType.d.ts +20 -0
  117. package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -0
  118. package/dist/src/rlc-common/buildSchemaType.js +53 -0
  119. package/dist/src/rlc-common/buildSchemaType.js.map +1 -0
  120. package/dist/src/rlc-common/buildSerializeHelper.d.ts +6 -0
  121. package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -0
  122. package/dist/src/rlc-common/buildSerializeHelper.js +36 -0
  123. package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -0
  124. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts +6 -0
  125. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -0
  126. package/dist/src/rlc-common/buildTopLevelIndexFile.js +52 -0
  127. package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -0
  128. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts +17 -0
  129. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -0
  130. package/dist/src/rlc-common/helpers/apiVersionUtil.js +45 -0
  131. package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -0
  132. package/dist/src/rlc-common/helpers/importsUtil.d.ts +18 -0
  133. package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -0
  134. package/dist/src/rlc-common/helpers/importsUtil.js +169 -0
  135. package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -0
  136. package/dist/src/rlc-common/helpers/nameConstructors.d.ts +42 -0
  137. package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -0
  138. package/dist/src/rlc-common/helpers/nameConstructors.js +63 -0
  139. package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -0
  140. package/dist/src/rlc-common/helpers/nameUtils.d.ts +37 -0
  141. package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -0
  142. package/dist/src/rlc-common/helpers/nameUtils.js +246 -0
  143. package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -0
  144. package/dist/src/rlc-common/helpers/operationHelpers.d.ts +16 -0
  145. package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -0
  146. package/dist/src/rlc-common/helpers/operationHelpers.js +119 -0
  147. package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -0
  148. package/dist/src/rlc-common/helpers/packageUtil.d.ts +7 -0
  149. package/dist/src/rlc-common/helpers/packageUtil.d.ts.map +1 -0
  150. package/dist/src/rlc-common/helpers/packageUtil.js +13 -0
  151. package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -0
  152. package/dist/src/rlc-common/helpers/pathUtils.d.ts +2 -0
  153. package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -0
  154. package/dist/src/rlc-common/helpers/pathUtils.js +12 -0
  155. package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -0
  156. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts +10 -0
  157. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -0
  158. package/dist/src/rlc-common/helpers/schemaHelpers.js +41 -0
  159. package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -0
  160. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +4 -0
  161. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -0
  162. package/dist/src/rlc-common/helpers/shortcutMethods.js +49 -0
  163. package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -0
  164. package/dist/src/rlc-common/helpers/typeUtil.d.ts +32 -0
  165. package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -0
  166. package/dist/src/rlc-common/helpers/typeUtil.js +167 -0
  167. package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -0
  168. package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts +12 -0
  169. package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts.map +1 -0
  170. package/dist/src/rlc-common/helpers/valueGenerationUtil.js +165 -0
  171. package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -0
  172. package/dist/src/rlc-common/index.d.ts +41 -0
  173. package/dist/src/rlc-common/index.d.ts.map +1 -0
  174. package/dist/src/rlc-common/index.js +43 -0
  175. package/dist/src/rlc-common/index.js.map +1 -0
  176. package/dist/src/rlc-common/interfaces.d.ts +369 -0
  177. package/dist/src/rlc-common/interfaces.d.ts.map +1 -0
  178. package/dist/src/rlc-common/interfaces.js +11 -0
  179. package/dist/src/rlc-common/interfaces.js.map +1 -0
  180. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts +6 -0
  181. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -0
  182. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +56 -0
  183. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -0
  184. package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts +6 -0
  185. package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts.map +1 -0
  186. package/dist/src/rlc-common/metadata/buildChangelogFile.js +26 -0
  187. package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -0
  188. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts +6 -0
  189. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -0
  190. package/dist/src/rlc-common/metadata/buildESLintConfig.js +82 -0
  191. package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -0
  192. package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts +5 -0
  193. package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts.map +1 -0
  194. package/dist/src/rlc-common/metadata/buildLicenseFile.js +32 -0
  195. package/dist/src/rlc-common/metadata/buildLicenseFile.js.map +1 -0
  196. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts +25 -0
  197. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -0
  198. package/dist/src/rlc-common/metadata/buildPackageFile.js +201 -0
  199. package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -0
  200. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts +11 -0
  201. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -0
  202. package/dist/src/rlc-common/metadata/buildReadmeFile.js +426 -0
  203. package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -0
  204. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts +6 -0
  205. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -0
  206. package/dist/src/rlc-common/metadata/buildRollupConfig.js +142 -0
  207. package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -0
  208. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts +6 -0
  209. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -0
  210. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +17 -0
  211. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -0
  212. package/dist/src/rlc-common/metadata/buildTestConfig.d.ts +16 -0
  213. package/dist/src/rlc-common/metadata/buildTestConfig.d.ts.map +1 -0
  214. package/dist/src/rlc-common/metadata/buildTestConfig.js +55 -0
  215. package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -0
  216. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts +61 -0
  217. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -0
  218. package/dist/src/rlc-common/metadata/buildTsConfig.js +170 -0
  219. package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -0
  220. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts +6 -0
  221. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -0
  222. package/dist/src/rlc-common/metadata/buildVitestConfig.js +28 -0
  223. package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -0
  224. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts +20 -0
  225. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -0
  226. package/dist/src/rlc-common/metadata/buildWarpConfig.js +77 -0
  227. package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -0
  228. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +51 -0
  229. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -0
  230. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +121 -0
  231. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -0
  232. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts +242 -0
  233. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -0
  234. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +176 -0
  235. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -0
  236. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts +8 -0
  237. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -0
  238. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +102 -0
  239. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -0
  240. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts +57 -0
  241. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts.map +1 -0
  242. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +53 -0
  243. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -0
  244. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts +64 -0
  245. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -0
  246. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +183 -0
  247. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -0
  248. package/dist/src/rlc-common/metadata/utils.d.ts +3 -0
  249. package/dist/src/rlc-common/metadata/utils.d.ts.map +1 -0
  250. package/dist/src/rlc-common/metadata/utils.js +7 -0
  251. package/dist/src/rlc-common/metadata/utils.js.map +1 -0
  252. package/dist/src/rlc-common/static/paginateContent.d.ts +2 -0
  253. package/dist/src/rlc-common/static/paginateContent.d.ts.map +1 -0
  254. package/dist/src/rlc-common/static/paginateContent.js +345 -0
  255. package/dist/src/rlc-common/static/paginateContent.js.map +1 -0
  256. package/dist/src/rlc-common/static/pollingContent.d.ts +2 -0
  257. package/dist/src/rlc-common/static/pollingContent.d.ts.map +1 -0
  258. package/dist/src/rlc-common/static/pollingContent.js +225 -0
  259. package/dist/src/rlc-common/static/pollingContent.js.map +1 -0
  260. package/dist/src/rlc-common/static/sampleTemplate.d.ts +2 -0
  261. package/dist/src/rlc-common/static/sampleTemplate.d.ts.map +1 -0
  262. package/dist/src/rlc-common/static/sampleTemplate.js +56 -0
  263. package/dist/src/rlc-common/static/sampleTemplate.js.map +1 -0
  264. package/dist/src/rlc-common/static/serializeHelper.d.ts +6 -0
  265. package/dist/src/rlc-common/static/serializeHelper.d.ts.map +1 -0
  266. package/dist/src/rlc-common/static/serializeHelper.js +31 -0
  267. package/dist/src/rlc-common/static/serializeHelper.js.map +1 -0
  268. package/dist/src/rlc-common/test/buildKarmaConfig.d.ts +6 -0
  269. package/dist/src/rlc-common/test/buildKarmaConfig.d.ts.map +1 -0
  270. package/dist/src/rlc-common/test/buildKarmaConfig.js +11 -0
  271. package/dist/src/rlc-common/test/buildKarmaConfig.js.map +1 -0
  272. package/dist/src/rlc-common/test/buildRecordedClient.d.ts +6 -0
  273. package/dist/src/rlc-common/test/buildRecordedClient.d.ts.map +1 -0
  274. package/dist/src/rlc-common/test/buildRecordedClient.js +18 -0
  275. package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -0
  276. package/dist/src/rlc-common/test/buildSampleTest.d.ts +6 -0
  277. package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -0
  278. package/dist/src/rlc-common/test/buildSampleTest.js +15 -0
  279. package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -0
  280. package/dist/src/rlc-common/test/buildSnippets.d.ts +6 -0
  281. package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -0
  282. package/dist/src/rlc-common/test/buildSnippets.js +29 -0
  283. package/dist/src/rlc-common/test/buildSnippets.js.map +1 -0
  284. package/dist/src/rlc-common/test/template.d.ts +5 -0
  285. package/dist/src/rlc-common/test/template.d.ts.map +1 -0
  286. package/dist/src/rlc-common/test/template.js +261 -0
  287. package/dist/src/rlc-common/test/template.js.map +1 -0
  288. package/dist/src/rlc-common/transformSampleGroups.d.ts +9 -0
  289. package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -0
  290. package/dist/src/rlc-common/transformSampleGroups.js +317 -0
  291. package/dist/src/rlc-common/transformSampleGroups.js.map +1 -0
  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 +1 -1
  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 +1 -1
  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/transformParameters.d.ts +1 -1
  303. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  304. package/dist/src/transform/transformParameters.js +1 -1
  305. package/dist/src/transform/transformParameters.js.map +1 -1
  306. package/dist/src/transform/transformPaths.d.ts +1 -1
  307. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  308. package/dist/src/transform/transformPaths.js +1 -1
  309. package/dist/src/transform/transformPaths.js.map +1 -1
  310. package/dist/src/transform/transformResponses.d.ts +1 -1
  311. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  312. package/dist/src/transform/transformResponses.js +1 -1
  313. package/dist/src/transform/transformResponses.js.map +1 -1
  314. package/dist/src/transform/transformSchemas.js +1 -1
  315. package/dist/src/transform/transformSchemas.js.map +1 -1
  316. package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
  317. package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
  318. package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
  319. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
  320. package/dist/src/transform/transfromRLCOptions.js +1 -3
  321. package/dist/src/transform/transfromRLCOptions.js.map +1 -1
  322. package/dist/src/utils/clientUtils.js +1 -1
  323. package/dist/src/utils/clientUtils.js.map +1 -1
  324. package/dist/src/utils/crossLanguageDef.js +1 -1
  325. package/dist/src/utils/crossLanguageDef.js.map +1 -1
  326. package/dist/src/utils/emitUtil.d.ts +1 -1
  327. package/dist/src/utils/emitUtil.d.ts.map +1 -1
  328. package/dist/src/utils/emitUtil.js +1 -1
  329. package/dist/src/utils/emitUtil.js.map +1 -1
  330. package/dist/src/utils/interfaces.d.ts +1 -1
  331. package/dist/src/utils/interfaces.d.ts.map +1 -1
  332. package/dist/src/utils/modelUtils.d.ts +1 -1
  333. package/dist/src/utils/modelUtils.d.ts.map +1 -1
  334. package/dist/src/utils/modelUtils.js +1 -1
  335. package/dist/src/utils/modelUtils.js.map +1 -1
  336. package/dist/src/utils/operationUtil.d.ts +1 -1
  337. package/dist/src/utils/operationUtil.d.ts.map +1 -1
  338. package/dist/src/utils/operationUtil.js +1 -1
  339. package/dist/src/utils/operationUtil.js.map +1 -1
  340. package/dist/src/utils/parameterUtils.d.ts +1 -1
  341. package/dist/src/utils/parameterUtils.d.ts.map +1 -1
  342. package/dist/src/utils/parameterUtils.js +1 -1
  343. package/dist/src/utils/parameterUtils.js.map +1 -1
  344. package/dist/tsconfig.tsbuildinfo +1 -1
  345. package/package.json +9 -9
  346. package/src/framework/hooks/binder.ts +142 -51
  347. package/src/framework/hooks/sdkTypes.ts +1 -1
  348. package/src/framework/load-static-helpers.ts +1 -1
  349. package/src/index.ts +5 -1
  350. package/src/lib.ts +1 -16
  351. package/src/metaTree.ts +1 -1
  352. package/src/modular/buildClassicalClient.ts +1 -1
  353. package/src/modular/buildClassicalOperationGroups.ts +1 -1
  354. package/src/modular/buildClientContext.ts +1 -1
  355. package/src/modular/buildOperations.ts +1 -1
  356. package/src/modular/buildProjectFiles.ts +1 -1
  357. package/src/modular/buildRestorePoller.ts +1 -1
  358. package/src/modular/buildRootIndex.ts +1 -1
  359. package/src/modular/emitModels.ts +1 -1
  360. package/src/modular/emitModelsOptions.ts +1 -1
  361. package/src/modular/emitSamples.ts +1 -1
  362. package/src/modular/emitTests.ts +1 -1
  363. package/src/modular/helpers/classicalOperationHelpers.ts +1 -1
  364. package/src/modular/helpers/clientHelpers.ts +1 -1
  365. package/src/modular/helpers/exampleValueHelpers.ts +1 -1
  366. package/src/modular/helpers/namingHelpers.ts +1 -1
  367. package/src/modular/helpers/operationHelpers.ts +65 -42
  368. package/src/modular/helpers/typeHelpers.ts +1 -1
  369. package/src/modular/interfaces.ts +1 -1
  370. package/src/modular/serialization/buildDeserializerFunction.ts +1 -1
  371. package/src/modular/serialization/buildSerializerFunction.ts +1 -1
  372. package/src/modular/serialization/buildXmlSerializerFunction.ts +1 -1
  373. package/src/modular/type-expressions/get-type-expression.ts +1 -1
  374. package/src/rlc-common/buildClient.ts +561 -0
  375. package/src/rlc-common/buildClientDefinitions.ts +278 -0
  376. package/src/rlc-common/buildIndexFile.ts +344 -0
  377. package/src/rlc-common/buildIsUnexpectedHelper.ts +255 -0
  378. package/src/rlc-common/buildLogger.ts +43 -0
  379. package/src/rlc-common/buildMethodShortcuts.ts +83 -0
  380. package/src/rlc-common/buildObjectTypes.ts +680 -0
  381. package/src/rlc-common/buildPaginateHelper.ts +34 -0
  382. package/src/rlc-common/buildParameterTypes.ts +575 -0
  383. package/src/rlc-common/buildPollingHelper.ts +83 -0
  384. package/src/rlc-common/buildResponseTypes.ts +203 -0
  385. package/src/rlc-common/buildSamples.ts +32 -0
  386. package/src/rlc-common/buildSchemaType.ts +81 -0
  387. package/src/rlc-common/buildSerializeHelper.ts +49 -0
  388. package/src/rlc-common/buildTopLevelIndexFile.ts +65 -0
  389. package/src/rlc-common/helpers/apiVersionUtil.ts +53 -0
  390. package/src/rlc-common/helpers/importsUtil.ts +187 -0
  391. package/src/rlc-common/helpers/nameConstructors.ts +144 -0
  392. package/src/rlc-common/helpers/nameUtils.ts +319 -0
  393. package/src/rlc-common/helpers/operationHelpers.ts +155 -0
  394. package/src/rlc-common/helpers/packageUtil.ts +13 -0
  395. package/src/rlc-common/helpers/pathUtils.ts +15 -0
  396. package/src/rlc-common/helpers/schemaHelpers.ts +61 -0
  397. package/src/rlc-common/helpers/shortcutMethods.ts +67 -0
  398. package/src/rlc-common/helpers/typeUtil.ts +173 -0
  399. package/src/rlc-common/helpers/valueGenerationUtil.ts +257 -0
  400. package/src/rlc-common/index.ts +43 -0
  401. package/src/rlc-common/interfaces.ts +441 -0
  402. package/src/rlc-common/metadata/buildApiExtractorConfig.ts +71 -0
  403. package/src/rlc-common/metadata/buildChangelogFile.ts +29 -0
  404. package/src/rlc-common/metadata/buildESLintConfig.ts +86 -0
  405. package/src/rlc-common/metadata/buildLicenseFile.ts +33 -0
  406. package/src/rlc-common/metadata/buildPackageFile.ts +250 -0
  407. package/src/rlc-common/metadata/buildReadmeFile.ts +528 -0
  408. package/src/rlc-common/metadata/buildRollupConfig.ts +150 -0
  409. package/src/rlc-common/metadata/buildSampleEnvFile.ts +22 -0
  410. package/src/rlc-common/metadata/buildTestConfig.ts +72 -0
  411. package/src/rlc-common/metadata/buildTsConfig.ts +222 -0
  412. package/src/rlc-common/metadata/buildVitestConfig.ts +36 -0
  413. package/src/rlc-common/metadata/buildWarpConfig.ts +94 -0
  414. package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +161 -0
  415. package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +220 -0
  416. package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +134 -0
  417. package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +70 -0
  418. package/src/rlc-common/metadata/packageJson/packageCommon.ts +255 -0
  419. package/src/rlc-common/metadata/utils.ts +8 -0
  420. package/src/rlc-common/static/paginateContent.ts +345 -0
  421. package/src/rlc-common/static/pollingContent.ts +225 -0
  422. package/src/rlc-common/static/sampleTemplate.ts +56 -0
  423. package/src/rlc-common/static/serializeHelper.ts +34 -0
  424. package/src/rlc-common/test/buildKarmaConfig.ts +12 -0
  425. package/src/rlc-common/test/buildRecordedClient.ts +18 -0
  426. package/src/rlc-common/test/buildSampleTest.ts +15 -0
  427. package/src/rlc-common/test/buildSnippets.ts +35 -0
  428. package/src/rlc-common/test/template.ts +263 -0
  429. package/src/rlc-common/transformSampleGroups.ts +458 -0
  430. package/src/transform/transform.ts +1 -1
  431. package/src/transform/transformApiVersionInfo.ts +1 -1
  432. package/src/transform/transformHelperFunctionDetails.ts +1 -1
  433. package/src/transform/transformParameters.ts +1 -1
  434. package/src/transform/transformPaths.ts +1 -1
  435. package/src/transform/transformResponses.ts +1 -1
  436. package/src/transform/transformSchemas.ts +1 -1
  437. package/src/transform/transformTelemetryInfo.ts +1 -1
  438. package/src/transform/transfromRLCOptions.ts +1 -3
  439. package/src/utils/clientUtils.ts +1 -1
  440. package/src/utils/crossLanguageDef.ts +1 -1
  441. package/src/utils/emitUtil.ts +1 -1
  442. package/src/utils/interfaces.ts +1 -1
  443. package/src/utils/modelUtils.ts +1 -1
  444. package/src/utils/operationUtil.ts +1 -1
  445. package/src/utils/parameterUtils.ts +1 -1
  446. package/LICENSE +0 -21
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSamples.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/buildSamples.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAkB,IAAI,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAQ5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,QAAQ,yBAoB3C"}
@@ -0,0 +1,30 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { sampleTemplate } from "./static/sampleTemplate.js";
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-ignore: to fix the handlebars issue
6
+ import hbs from "handlebars";
7
+ import * as path from "path";
8
+ // Build sample files for the model based on the sample groups
9
+ export function buildSamples(model) {
10
+ if (!model.options || !model.options.packageDetails) {
11
+ return;
12
+ }
13
+ const sampleGroups = model.sampleGroups;
14
+ if (!sampleGroups || sampleGroups.length === 0) {
15
+ return;
16
+ }
17
+ const sampleFiles = [];
18
+ for (const sampleGroup of sampleGroups) {
19
+ const sampleGroupFileContents = hbs.compile(sampleTemplate, {
20
+ noEscape: true
21
+ });
22
+ const filePath = path.join("samples-dev", `${sampleGroup.filename}.ts`);
23
+ sampleFiles.push({
24
+ path: filePath,
25
+ content: sampleGroupFileContents(sampleGroup)
26
+ });
27
+ }
28
+ return sampleFiles;
29
+ }
30
+ //# sourceMappingURL=buildSamples.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSamples.js","sourceRoot":"","sources":["../../../src/rlc-common/buildSamples.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,8DAA8D;AAC9D,MAAM,UAAU,YAAY,CAAC,KAAe;IAC1C,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QACpD,OAAO;IACT,CAAC;IACD,MAAM,YAAY,GAAiC,KAAK,CAAC,YAAY,CAAC;IACtE,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/C,OAAO;IACT,CAAC;IACD,MAAM,WAAW,GAAc,EAAE,CAAC;IAClC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,uBAAuB,GAAG,GAAG,CAAC,OAAO,CAAC,cAAc,EAAE;YAC1D,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,WAAW,CAAC,QAAQ,KAAK,CAAC,CAAC;QACxE,WAAW,CAAC,IAAI,CAAC;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,uBAAuB,CAAC,WAAW,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Project } from "ts-morph";
2
+ import { RLCModel, SchemaContext } from "./interfaces.js";
3
+ /**
4
+ * Generates types to represent schema definitions in the swagger
5
+ */
6
+ export declare function buildSchemaTypes(model: RLCModel): {
7
+ inputModelFile: {
8
+ path: string;
9
+ content: string;
10
+ } | undefined;
11
+ outputModelFile: {
12
+ path: string;
13
+ content: string;
14
+ } | undefined;
15
+ };
16
+ export declare function generateModelFiles(model: RLCModel, project: Project, filePath: string, schemaContext: SchemaContext[]): {
17
+ path: string;
18
+ content: string;
19
+ } | undefined;
20
+ //# sourceMappingURL=buildSchemaType.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSchemaType.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/buildSchemaType.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOnC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG1D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ;;;;;;;;;EAa/C;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,QAAQ,EACf,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,aAAa,EAAE;;;cA6C/B"}
@@ -0,0 +1,53 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { Project } from "ts-morph";
4
+ import * as path from "path";
5
+ import { buildObjectAliases, buildObjectInterfaces, buildPolymorphicAliases } from "./buildObjectTypes.js";
6
+ import { SchemaContext } from "./interfaces.js";
7
+ import { getImportSpecifier } from "./helpers/importsUtil.js";
8
+ /**
9
+ * Generates types to represent schema definitions in the swagger
10
+ */
11
+ export function buildSchemaTypes(model) {
12
+ const { srcPath } = model;
13
+ const project = new Project();
14
+ let filePath = path.join(srcPath, `models.ts`);
15
+ const inputModelFile = generateModelFiles(model, project, filePath, [
16
+ SchemaContext.Input
17
+ ]);
18
+ filePath = path.join(srcPath, `outputModels.ts`);
19
+ const outputModelFile = generateModelFiles(model, project, filePath, [
20
+ SchemaContext.Output,
21
+ SchemaContext.Exception
22
+ ]);
23
+ return { inputModelFile, outputModelFile };
24
+ }
25
+ export function generateModelFiles(model, project, filePath, schemaContext) {
26
+ // Track models that need to be imported
27
+ const importedModels = new Set();
28
+ const objectsDefinitions = buildObjectInterfaces(model, importedModels, schemaContext);
29
+ const objectTypeAliases = buildPolymorphicAliases(model, schemaContext);
30
+ const objectAliases = buildObjectAliases(model, importedModels, schemaContext);
31
+ if (objectTypeAliases.length ||
32
+ objectsDefinitions.length ||
33
+ objectAliases.length) {
34
+ const modelsFile = project.createSourceFile(filePath, undefined, {
35
+ overwrite: true
36
+ });
37
+ modelsFile.addInterfaces(objectsDefinitions);
38
+ modelsFile.addTypeAliases(objectTypeAliases);
39
+ modelsFile.addTypeAliases(objectAliases);
40
+ if (importedModels.size > 0) {
41
+ modelsFile.addImportDeclarations([
42
+ {
43
+ isTypeOnly: true,
44
+ namedImports: [...Array.from(importedModels || [])],
45
+ moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports)
46
+ }
47
+ ]);
48
+ }
49
+ return { path: filePath, content: modelsFile.getFullText() };
50
+ }
51
+ return undefined;
52
+ }
53
+ //# sourceMappingURL=buildSchemaType.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSchemaType.js","sourceRoot":"","sources":["../../../src/rlc-common/buildSchemaType.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,kBAAkB,EACl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M,EACpB,CAAC;QACD,MAAM,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,QAAQ,EAAE,SAAS,EAAE;YAC/D,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QAEH,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;QAC7C,UAAU,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;QAC7C,UAAU,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QACzC,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;YAC5B,UAAU,CAAC,qBAAqB,CAAC;gBAC/B;oBACE,UAAU,EAAE,IAAI;oBAChB,YAAY,EAAE,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;oBACnD,eAAe,EAAE,kBAAkB,CACjC,YAAY,EACZ,KAAK,CAAC,UAAU,CAAC,cAAc,CAChC;iBACF;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;IAC/D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { RLCModel } from "./interfaces.js";
2
+ export declare function buildSerializeHelper(model: RLCModel): {
3
+ path: string;
4
+ content: string;
5
+ } | undefined;
6
+ //# sourceMappingURL=buildSerializeHelper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSerializeHelper.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/buildSerializeHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAoB3C,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ;;;cA4BnD"}
@@ -0,0 +1,36 @@
1
+ import * as path from "path";
2
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3
+ // @ts-ignore: to fix the handlebars issue
4
+ import hbs from "handlebars";
5
+ import { hasCsvCollection, hasMultiCollection, hasPipeCollection, hasSsvCollection, hasTsvCollection } from "./helpers/operationHelpers.js";
6
+ import { buildCsvCollectionContent, buildMultiCollectionContent, buildPipeCollectionContent, buildSsvCollectionContent, buildTsvCollectionContent } from "./static/serializeHelper.js";
7
+ export function buildSerializeHelper(model) {
8
+ let serializeHelperContent = "";
9
+ if (hasMultiCollection(model)) {
10
+ serializeHelperContent += "\n" + buildMultiCollectionContent;
11
+ }
12
+ if (hasPipeCollection(model)) {
13
+ serializeHelperContent += "\n" + buildPipeCollectionContent;
14
+ }
15
+ if (hasSsvCollection(model)) {
16
+ serializeHelperContent += "\n" + buildSsvCollectionContent;
17
+ }
18
+ if (hasTsvCollection(model)) {
19
+ serializeHelperContent += "\n" + buildTsvCollectionContent;
20
+ }
21
+ if (hasCsvCollection(model)) {
22
+ serializeHelperContent += "\n" + buildCsvCollectionContent;
23
+ }
24
+ if (serializeHelperContent !== "") {
25
+ const readmeFileContents = hbs.compile(serializeHelperContent, {
26
+ noEscape: true
27
+ });
28
+ const { srcPath } = model;
29
+ return {
30
+ path: path.join(srcPath, "serializeHelper.ts"),
31
+ content: readmeFileContents({})
32
+ };
33
+ }
34
+ return undefined;
35
+ }
36
+ //# sourceMappingURL=buildSerializeHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildSerializeHelper.js","sourceRoot":"","sources":["../../../src/rlc-common/buildSerializeHelper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,6BAA6B,CAAC;AAErC,MAAM,UAAU,oBAAoB,CAAC,KAAe;IAClD,IAAI,sBAAsB,GAAG,EAAE,CAAC;IAChC,IAAI,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,sBAAsB,IAAI,IAAI,GAAG,2BAA2B,CAAC;IAC/D,CAAC;IACD,IAAI,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,sBAAsB,IAAI,IAAI,GAAG,0BAA0B,CAAC;IAC9D,CAAC;IACD,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,sBAAsB,IAAI,IAAI,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IACD,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,sBAAsB,IAAI,IAAI,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IACD,IAAI,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,sBAAsB,IAAI,IAAI,GAAG,yBAAyB,CAAC;IAC7D,CAAC;IACD,IAAI,sBAAsB,KAAK,EAAE,EAAE,CAAC;QAClC,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC,sBAAsB,EAAE;YAC7D,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC;YAC9C,OAAO,EAAE,kBAAkB,CAAC,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { RLCModel } from "./interfaces.js";
2
+ export declare function buildTopLevelIndex(model: RLCModel): {
3
+ path: string;
4
+ content: string;
5
+ } | undefined;
6
+ //# sourceMappingURL=buildTopLevelIndexFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTopLevelIndexFile.d.ts","sourceRoot":"","sources":["../../../src/rlc-common/buildTopLevelIndexFile.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAQ3C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ;;;cAoDjD"}
@@ -0,0 +1,52 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { NameType, normalizeName } from "./helpers/nameUtils.js";
4
+ import { Project } from "ts-morph";
5
+ import * as path from "path";
6
+ import { getRelativePartFromSrcPath } from "./helpers/pathUtils.js";
7
+ import { getImportModuleName } from "./helpers/nameConstructors.js";
8
+ const batchOutputFolder = [];
9
+ export function buildTopLevelIndex(model) {
10
+ if (!model.options) {
11
+ return undefined;
12
+ }
13
+ const project = new Project();
14
+ const { srcPath } = model;
15
+ const { multiClient } = model.options;
16
+ const batch = model.options.batch;
17
+ if (srcPath) {
18
+ const clientName = model.libraryName;
19
+ const moduleName = normalizeName(clientName, NameType.File);
20
+ const relativePath = "./" +
21
+ getRelativePartFromSrcPath(srcPath, model.options.isModularLibrary);
22
+ batchOutputFolder.push([relativePath, clientName, moduleName]);
23
+ }
24
+ if (multiClient &&
25
+ batch &&
26
+ batch.length > 1 &&
27
+ batchOutputFolder.length === batch.length) {
28
+ const indexFile = project.createSourceFile("index.ts", undefined, {
29
+ overwrite: true
30
+ });
31
+ const allModules = [];
32
+ batchOutputFolder.forEach((item) => {
33
+ indexFile.addImportDeclaration({
34
+ isTypeOnly: true,
35
+ namespaceImport: item[1],
36
+ moduleSpecifier: getImportModuleName({
37
+ cjsName: `${item[0]}`,
38
+ esModulesName: `${item[0]}/index.js`
39
+ }, model)
40
+ });
41
+ allModules.push(item[1]);
42
+ });
43
+ indexFile.addExportDeclaration({
44
+ namedExports: [...allModules]
45
+ });
46
+ const content = indexFile.getFullText();
47
+ const filePath = path.join(srcPath.substring(0, srcPath.lastIndexOf("src") + 4), model.options.isModularLibrary ? "rest" : "", `index.ts`);
48
+ return { path: filePath, content };
49
+ }
50
+ return undefined;
51
+ }
52
+ //# sourceMappingURL=buildTopLevelIndexFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildTopLevelIndexFile.js","sourceRoot":"","sources":["../../../src/rlc-common/buildTopLevelIndexFile.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,iBAAiB,GAA+B,EAAE,CAAC;AAEzD,MAAM,UAAU,kBAAkB,CAAC,KAAe;IAChD,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAC9B,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;IACtC,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAClC,IAAI,OAAO,EAAE,CAAC;QACZ,MAAM,UAAU,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,MAAM,UAAU,GAAG,aAAa,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC5D,MAAM,YAAY,GAChB,IAAI;YACJ,0BAA0B,CAAC,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACtE,iBAAiB,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,UAAU,EAAE,UAAU,CA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CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ApiVersionInfo, ApiVersionPosition, UrlInfo } from "../interfaces.js";
2
+ /**
3
+ * Extract the path api-version detail from UrlInfo, return undefined if no valid api-version parameter
4
+ * @param urlInfo UrlInfo detail
5
+ * @returns path api-version detail
6
+ */
7
+ export declare function extractPathApiVersion(urlInfo?: UrlInfo): ApiVersionInfo | undefined;
8
+ /**
9
+ * Extract the final position value from api-version in query and path defined.
10
+ * it could be in either the url or the operation level,
11
+ * and in operation level, it could be either path or query.
12
+ * @param operationApiVersion api-version detail in both query and path
13
+ * @param urlVersionDetail api-version detail in parameterized host
14
+ * @returns calculated combined position info
15
+ */
16
+ export declare function extractDefinedPosition(operationApiVersion?: ApiVersionInfo, urlVersionDetail?: ApiVersionInfo): ApiVersionPosition;
17
+ //# sourceMappingURL=apiVersionUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiVersionUtil.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/apiVersionUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,CAAC,EAAE,OAAO,GAChB,cAAc,GAAG,SAAS,CAoB5B;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,mBAAmB,CAAC,EAAE,cAAc,EACpC,gBAAgB,CAAC,EAAE,cAAc,GAChC,kBAAkB,CAUpB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Extract the path api-version detail from UrlInfo, return undefined if no valid api-version parameter
3
+ * @param urlInfo UrlInfo detail
4
+ * @returns path api-version detail
5
+ */
6
+ export function extractPathApiVersion(urlInfo) {
7
+ var _a, _b;
8
+ if (!urlInfo) {
9
+ return;
10
+ }
11
+ const param = (_a = urlInfo.urlParameters) === null || _a === void 0 ? void 0 : _a.filter((p) => p.name.toLowerCase() === "api-version" ||
12
+ p.name.toLowerCase() === "apiversion");
13
+ if (!param || (param === null || param === void 0 ? void 0 : param.length) < 1) {
14
+ return;
15
+ }
16
+ const detail = {
17
+ definedPosition: "path",
18
+ isCrossedVersion: Boolean((param === null || param === void 0 ? void 0 : param.length) > 1),
19
+ defaultValue: param.length === 1 ? (_b = param[0]) === null || _b === void 0 ? void 0 : _b.value : undefined,
20
+ required: true
21
+ };
22
+ return detail;
23
+ }
24
+ /**
25
+ * Extract the final position value from api-version in query and path defined.
26
+ * it could be in either the url or the operation level,
27
+ * and in operation level, it could be either path or query.
28
+ * @param operationApiVersion api-version detail in both query and path
29
+ * @param urlVersionDetail api-version detail in parameterized host
30
+ * @returns calculated combined position info
31
+ */
32
+ export function extractDefinedPosition(operationApiVersion, urlVersionDetail) {
33
+ let pos = "none";
34
+ if (operationApiVersion && urlVersionDetail) {
35
+ pos = "duplicate";
36
+ }
37
+ else if (operationApiVersion === null || operationApiVersion === void 0 ? void 0 : operationApiVersion.definedPosition) {
38
+ pos = operationApiVersion.definedPosition;
39
+ }
40
+ else if (urlVersionDetail) {
41
+ pos = "baseurl";
42
+ }
43
+ return pos;
44
+ }
45
+ //# sourceMappingURL=apiVersionUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apiVersionUtil.js","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/apiVersionUtil.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAiB;;IAEjB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IACD,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,aAAa,0CAAE,MAAM,CACzC,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,aAAa;QACtC,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,YAAY,CACxC,CAAC;IACF,IAAI,CAAC,KAAK,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,IAAG,CAAC,EAAE,CAAC;QAChC,OAAO;IACT,CAAC;IACD,MAAM,MAAM,GAAmB;QAC7B,eAAe,EAAE,MAAM;QACvB,gBAAgB,EAAE,OAAO,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,IAAG,CAAC,CAAC;QAC5C,YAAY,EACV,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAE,MAAA,KAAK,CAAC,CAAC,CAAC,0CAAE,KAA4B,CAAC,CAAC,CAAC,SAAS;QAC1E,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,sBAAsB,CACpC,mBAAoC,EACpC,gBAAiC;IAEjC,IAAI,GAAG,GAAuB,MAAM,CAAC;IACrC,IAAI,mBAAmB,IAAI,gBAAgB,EAAE,CAAC;QAC5C,GAAG,GAAG,WAAW,CAAC;IACpB,CAAC;SAAM,IAAI,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAE,eAAe,EAAE,CAAC;QAChD,GAAG,GAAG,mBAAmB,CAAC,eAAgB,CAAC;IAC7C,CAAC;SAAM,IAAI,gBAAgB,EAAE,CAAC;QAC5B,GAAG,GAAG,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { SourceFile } from "ts-morph";
2
+ import { ImportType, Imports, PackageFlavor } from "../interfaces.js";
3
+ /**
4
+ * Build the common imports for generated SDK
5
+ * @param flavor flavor of SDK to generate, if any. When set to "azure", Azure Core packages will be used. When unset, the generic `ts-http-runtime` package will be used.
6
+ * @returns
7
+ */
8
+ export declare function buildRuntimeImports(flavor?: PackageFlavor): Imports;
9
+ /**
10
+ * Initialize the inner imports for parameter and response, the import set would be used for referred models
11
+ * @returns
12
+ */
13
+ export declare function initInternalImports(): Imports;
14
+ export declare function getImportSpecifier(importType: ImportType, imports?: Imports, includeFallback?: boolean): string;
15
+ export declare function addImportToSpecifier(importType: ImportType, runtimeImports: Imports, importedName: string): void;
16
+ export declare function clearImportSets(runtimeImports: Imports): void;
17
+ export declare function addImportsToFiles(runtimeImports: Imports, file: SourceFile, internalSpecifierMap?: Record<string, string>): void;
18
+ //# sourceMappingURL=importsUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importsUtil.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/importsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,OAAO,CAqDnE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CA+B7C;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,UAAU,EACtB,OAAO,CAAC,EAAE,OAAO,EACjB,eAAe,UAAO,GACrB,MAAM,CAkBR;AAED,wBAAgB,oBAAoB,CAClC,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,OAAO,EACvB,YAAY,EAAE,MAAM,GACnB,IAAI,CAYN;AAED,wBAAgB,eAAe,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI,CAI7D;AAED,wBAAgB,iBAAiB,CAC/B,cAAc,EAAE,OAAO,EACvB,IAAI,EAAE,UAAU,EAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC5C,IAAI,CAkCN"}
@@ -0,0 +1,169 @@
1
+ /**
2
+ * Build the common imports for generated SDK
3
+ * @param flavor flavor of SDK to generate, if any. When set to "azure", Azure Core packages will be used. When unset, the generic `ts-http-runtime` package will be used.
4
+ * @returns
5
+ */
6
+ export function buildRuntimeImports(flavor) {
7
+ if (flavor === "azure") {
8
+ return {
9
+ restClient: {
10
+ type: "restClient",
11
+ specifier: "@azure-rest/core-client",
12
+ version: "^2.0.0"
13
+ },
14
+ coreAuth: {
15
+ type: "coreAuth",
16
+ specifier: "@azure/core-auth",
17
+ version: "^1.6.0"
18
+ },
19
+ restPipeline: {
20
+ type: "restPipeline",
21
+ specifier: "@azure/core-rest-pipeline",
22
+ version: "^1.14.0"
23
+ },
24
+ coreUtil: {
25
+ type: "coreUtil",
26
+ specifier: "@azure/core-util",
27
+ version: "^1.4.0"
28
+ },
29
+ coreLogger: {
30
+ type: "coreLogger",
31
+ specifier: "@azure/logger",
32
+ version: "^1.0.4"
33
+ },
34
+ azureEslintPlugin: {
35
+ type: "azureEslintPlugin",
36
+ specifier: "@azure/eslint-plugin-azure-sdk",
37
+ version: "^3.0.0"
38
+ },
39
+ azureTestRecorder: {
40
+ type: "azureTestRecorder",
41
+ specifier: "@azure-tools/test-recorder",
42
+ version: "^3.0.0"
43
+ },
44
+ azureCoreLro: {
45
+ type: "azureCoreLro",
46
+ specifier: "@azure/core-lro"
47
+ }
48
+ };
49
+ }
50
+ else {
51
+ // In non-azure branded scope we only have one dependency that is ts-http-runtime
52
+ return {
53
+ commonFallback: {
54
+ type: "commonFallback",
55
+ specifier: "@typespec/ts-http-runtime",
56
+ version: "0.1.0"
57
+ }
58
+ };
59
+ }
60
+ }
61
+ /**
62
+ * Initialize the inner imports for parameter and response, the import set would be used for referred models
63
+ * @returns
64
+ */
65
+ export function initInternalImports() {
66
+ return {
67
+ parameter: {
68
+ type: "parameter",
69
+ importsSet: new Set()
70
+ },
71
+ response: {
72
+ type: "response",
73
+ importsSet: new Set()
74
+ },
75
+ rlcIndex: {
76
+ type: "rlcIndex",
77
+ importsSet: new Set()
78
+ },
79
+ modularModel: {
80
+ type: "modularModel",
81
+ importsSet: new Set()
82
+ },
83
+ rlcClientFactory: {
84
+ type: "rlcClientFactory",
85
+ importsSet: new Set()
86
+ },
87
+ rlcClientDefinition: {
88
+ type: "rlcClientDefinition",
89
+ importsSet: new Set()
90
+ },
91
+ serializerHelpers: {
92
+ type: "serializerHelpers",
93
+ importsSet: new Set()
94
+ }
95
+ };
96
+ }
97
+ export function getImportSpecifier(importType, imports, includeFallback = true) {
98
+ var _a, _b, _c, _d, _e, _f;
99
+ imports = imports !== null && imports !== void 0 ? imports : {};
100
+ const defaultPackageMap = {
101
+ restClient: "@azure-rest/core-client",
102
+ coreAuth: "@azure/core-auth",
103
+ restPipeline: "@azure/core-rest-pipeline",
104
+ coreUtil: "@azure/core-util",
105
+ coreLogger: "@azure/logger",
106
+ azureCoreLro: "@azure/core-lro"
107
+ };
108
+ if (!includeFallback) {
109
+ return (_b = (_a = imports[importType]) === null || _a === void 0 ? void 0 : _a.specifier) !== null && _b !== void 0 ? _b : "";
110
+ }
111
+ return ((_f = (_e = (_d = ((_c = imports[importType]) !== null && _c !== void 0 ? _c : imports.commonFallback)) === null || _d === void 0 ? void 0 : _d.specifier) !== null && _e !== void 0 ? _e : defaultPackageMap[importType]) !== null && _f !== void 0 ? _f : "");
112
+ }
113
+ export function addImportToSpecifier(importType, runtimeImports, importedName) {
114
+ var _a;
115
+ const specifier = getImportSpecifier(importType, runtimeImports);
116
+ const importSet = (_a = runtimeImports[importType]) === null || _a === void 0 ? void 0 : _a.importsSet;
117
+ if (!importSet) {
118
+ runtimeImports[importType] = {
119
+ type: importType,
120
+ specifier,
121
+ importsSet: new Set().add(importedName)
122
+ };
123
+ }
124
+ else {
125
+ importSet.add(importedName);
126
+ }
127
+ }
128
+ export function clearImportSets(runtimeImports) {
129
+ var _a;
130
+ for (const importType of Object.values(runtimeImports)) {
131
+ (_a = importType.importsSet) === null || _a === void 0 ? void 0 : _a.clear();
132
+ }
133
+ }
134
+ export function addImportsToFiles(runtimeImports, file, internalSpecifierMap) {
135
+ Object.values(runtimeImports)
136
+ .filter((importType) => {
137
+ var _a;
138
+ return (_a = importType.importsSet) === null || _a === void 0 ? void 0 : _a.size;
139
+ })
140
+ .forEach((importType) => {
141
+ var _a;
142
+ const specifier = (_a = internalSpecifierMap === null || internalSpecifierMap === void 0 ? void 0 : internalSpecifierMap[importType.type]) !== null && _a !== void 0 ? _a : importType.specifier;
143
+ let hasModifier = false;
144
+ if (!specifier) {
145
+ return;
146
+ }
147
+ file
148
+ .getImportDeclarations()
149
+ .filter((importDeclaration) => {
150
+ return importDeclaration.getModuleSpecifierValue() === specifier;
151
+ })
152
+ .forEach((importDeclaration) => {
153
+ hasModifier = true;
154
+ importDeclaration.addNamedImports([
155
+ ...importType.importsSet.values()
156
+ ]);
157
+ });
158
+ if (!hasModifier) {
159
+ file.addImportDeclaration({
160
+ isTypeOnly: true,
161
+ moduleSpecifier: specifier,
162
+ namedImports: [...importType.importsSet.values()]
163
+ });
164
+ return;
165
+ }
166
+ });
167
+ clearImportSets(runtimeImports);
168
+ }
169
+ //# sourceMappingURL=importsUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importsUtil.js","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/importsUtil.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;QACvB,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,YAAY;gBAClB,SAAS,EAAE,yBAAyB;gBACpC,OAAO,EAAE,QAAQ;aAClB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,kBAAkB;gBAC7B,OAAO,EAAE,QAAQ;aAClB;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,cAAc;gBACpB,SAAS,EAAE,2BAA2B;gBACtC,OAAO,EAAE,SAAS;aACnB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,kBAAkB;gBAC7B,OAAO,EAAE,QAAQ;aAClB;YACD,UAAU,EAAE;gBACV,IAAI,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AAc,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { RLCModel } from "../interfaces.js";
2
+ /**
3
+ * Get the response type name by baseName or operatioName & statusCode
4
+ * @param baseResponseName
5
+ */
6
+ export declare function getResponseTypeName(baseResponseName: string): string;
7
+ export declare function getResponseTypeName(operationGroup: string, operationName: string, statusCode: string): string;
8
+ export declare function getLroLogicalResponseName(operationGroup: string, operationName: string): string;
9
+ /**
10
+ * The prefix of all response types
11
+ * @param operationGroup operation group name e.g string_PutEmpty
12
+ * @param operationName operation name D e.g string_PutEmpty
13
+ * @param statusCode 2XX, 4XX, 5XX, default etc.
14
+ * @returns normolized base name e.g StringPutEmpty200
15
+ */
16
+ export declare function getResponseBaseName(operationGroup: string, operationName: string, statusCode: string): string;
17
+ /**
18
+ * The prefix of all parameter relevant types
19
+ * @param operationName is composed with operationGroup and operationID e.g string_PutEmpty
20
+ * @returns
21
+ */
22
+ export declare function getParameterBaseName(operationGroup: string, operationName: string): string;
23
+ /**
24
+ * Get the top-layer parameter name
25
+ * @param operationGroup operation group name
26
+ * @param operationName is composed with operationGroup and operationID e.g string_PutEmpty
27
+ * @returns top-layer parameter name e.g StringPutEmptParameters
28
+ */
29
+ export declare function getParameterTypeName(baseName: string): string;
30
+ export declare function getParameterTypeName(operationGroup: string, operationName: string): string;
31
+ export interface ModuleName {
32
+ esModulesName: string;
33
+ cjsName: string;
34
+ }
35
+ /**
36
+ * This is a helper function that gets the right import module depending on the type of
37
+ * library being generated
38
+ */
39
+ export declare function getImportModuleName(name: ModuleName, codeModel: RLCModel): string;
40
+ export declare function getClientName(model: RLCModel): string;
41
+ export declare function getMultipartPartTypeName(schemaName: string, partName: string): string;
42
+ //# sourceMappingURL=nameConstructors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameConstructors.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/nameConstructors.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;AACtE,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,MAAM,CAAC;AAmBV,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,UAMtB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,UAUnB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,UAMtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;AAC/D,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,GACpB,MAAM,CAAC;AAkBV,MAAM,WAAW,UAAU;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AACD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,UAKxE;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,UAS5C;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAQ5E"}
@@ -0,0 +1,63 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { NameType, normalizeName } from "./nameUtils.js";
4
+ export function getResponseTypeName(baseNameOrOperationGroup, operationName, statusCode) {
5
+ if (operationName) {
6
+ baseNameOrOperationGroup = getResponseBaseName(baseNameOrOperationGroup, operationName, statusCode || "");
7
+ }
8
+ return normalizeName(`${baseNameOrOperationGroup}Response`, NameType.Interface);
9
+ }
10
+ export function getLroLogicalResponseName(operationGroup, operationName) {
11
+ return normalizeName(`${operationGroup}_${operationName}_Logical_Response`, NameType.Interface);
12
+ }
13
+ /**
14
+ * The prefix of all response types
15
+ * @param operationGroup operation group name e.g string_PutEmpty
16
+ * @param operationName operation name D e.g string_PutEmpty
17
+ * @param statusCode 2XX, 4XX, 5XX, default etc.
18
+ * @returns normolized base name e.g StringPutEmpty200
19
+ */
20
+ export function getResponseBaseName(operationGroup, operationName, statusCode) {
21
+ return normalizeName(`${operationGroup}_${normalizeName(operationName, NameType.Interface, true)}_${statusCode}`, NameType.Interface);
22
+ }
23
+ /**
24
+ * The prefix of all parameter relevant types
25
+ * @param operationName is composed with operationGroup and operationID e.g string_PutEmpty
26
+ * @returns
27
+ */
28
+ export function getParameterBaseName(operationGroup, operationName) {
29
+ return normalizeName(`${operationGroup}_${operationName}`, NameType.Interface);
30
+ }
31
+ export function getParameterTypeName(baseNameOrOperationGroup, operationName) {
32
+ if (operationName) {
33
+ baseNameOrOperationGroup = getParameterBaseName(baseNameOrOperationGroup, operationName);
34
+ }
35
+ return normalizeName(`${baseNameOrOperationGroup}_Parameters`, NameType.Interface);
36
+ }
37
+ /**
38
+ * This is a helper function that gets the right import module depending on the type of
39
+ * library being generated
40
+ */
41
+ export function getImportModuleName(name, codeModel) {
42
+ var _a;
43
+ if (((_a = codeModel.options) === null || _a === void 0 ? void 0 : _a.moduleKind) === "cjs") {
44
+ return name.cjsName;
45
+ }
46
+ return name.esModulesName;
47
+ }
48
+ export function getClientName(model) {
49
+ var _a;
50
+ const clientName = model.libraryName;
51
+ const clientInterfaceName = ((_a = model.options) === null || _a === void 0 ? void 0 : _a.isModularLibrary)
52
+ ? model.libraryName
53
+ : clientName.endsWith("Client")
54
+ ? `${clientName}`
55
+ : `${clientName}Client`;
56
+ return clientInterfaceName;
57
+ }
58
+ export function getMultipartPartTypeName(schemaName, partName) {
59
+ const name = normalizeName(partName, NameType.Interface);
60
+ const bodyParamName = normalizeName(schemaName, NameType.Interface);
61
+ return normalizeName(`${bodyParamName}_${name}_PartDescriptor`, NameType.Interface);
62
+ }
63
+ //# sourceMappingURL=nameConstructors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nameConstructors.js","sourceRoot":"","sources":["../../../../src/rlc-common/helpers/nameConstructors.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAYzD,MAAM,UAAU,mBAAmB,CACjC,wBAAgC,EAChC,aAAsB,EACtB,UAAmB;IAEnB,IAAI,aAAa,EAAE,CAAC;QAClB,wBAAwB,GAAG,mBAAmB,CAC5C,wBAAwB,EACxB,aAAc,EACd,UAAU,IAAI,EAAE,CACjB,CAAC;IACJ,CAAC;IACD,OAAO,aAAa,CAClB,GAAG,wBAAwB,UAAU,EACrC,QAAQ,CAAC,SAAS,CACnB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAAsB,EACtB,aAAqB;IAErB,OAAO,aAAa,CAClB,GAAG,cAAc,IAAI,aAAa,mBAAmB,EACrD,QAAQ,CAAC,SAAS,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CACjC,cAAsB,EACtB,aAAqB,EACrB,UAAkB;IAElB,OAAO,aAAa,CAClB,GAAG,cAAc,IAAI,aAAa,CAChC,aAAa,EACb,QAAQ,CAAC,SAAS,EAClB,IAAI,CACL,IAAI,UAAU,EAAE,EACjB,QAAQ,CAAC,SAAS,CACnB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,cAAsB,EACtB,aAAqB;IAErB,OAAO,aAAa,CAClB,GAAG,cAAc,IAAI,aAAa,EAAE,EACpC,QAAQ,CAAC,SAAS,CACnB,CAAC;AACJ,CAAC;AAaD,MAAM,UA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