@azure-tools/typespec-ts 0.11.0-alpha.20230413.3

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 (514) hide show
  1. package/.eslintrc.json +23 -0
  2. package/.prettierignore +1 -0
  3. package/.prettierrc +7 -0
  4. package/.rush/temp/package-deps_build.json +392 -0
  5. package/.rush/temp/shrinkwrap-deps.json +472 -0
  6. package/CHANGELOG.md +65 -0
  7. package/CONTRIBUTING.md +137 -0
  8. package/README.md +150 -0
  9. package/dist/src/casingUtils.d.ts +4 -0
  10. package/dist/src/casingUtils.d.ts.map +1 -0
  11. package/dist/src/casingUtils.js +39 -0
  12. package/dist/src/casingUtils.js.map +1 -0
  13. package/dist/src/emitUtil.d.ts +6 -0
  14. package/dist/src/emitUtil.d.ts.map +1 -0
  15. package/dist/src/emitUtil.js +45 -0
  16. package/dist/src/emitUtil.js.map +1 -0
  17. package/dist/src/index.d.ts +3 -0
  18. package/dist/src/index.d.ts.map +1 -0
  19. package/dist/src/index.js +90 -0
  20. package/dist/src/index.js.map +1 -0
  21. package/dist/src/lib.d.ts +159 -0
  22. package/dist/src/lib.d.ts.map +1 -0
  23. package/dist/src/lib.js +190 -0
  24. package/dist/src/lib.js.map +1 -0
  25. package/dist/src/modelUtils.d.ts +33 -0
  26. package/dist/src/modelUtils.d.ts.map +1 -0
  27. package/dist/src/modelUtils.js +900 -0
  28. package/dist/src/modelUtils.js.map +1 -0
  29. package/dist/src/modular/buildApiIndex.d.ts +3 -0
  30. package/dist/src/modular/buildApiIndex.d.ts.map +1 -0
  31. package/dist/src/modular/buildApiIndex.js +12 -0
  32. package/dist/src/modular/buildApiIndex.js.map +1 -0
  33. package/dist/src/modular/buildClassicalClient.d.ts +4 -0
  34. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -0
  35. package/dist/src/modular/buildClassicalClient.js +116 -0
  36. package/dist/src/modular/buildClassicalClient.js.map +1 -0
  37. package/dist/src/modular/buildClientContext.d.ts +7 -0
  38. package/dist/src/modular/buildClientContext.d.ts.map +1 -0
  39. package/dist/src/modular/buildClientContext.js +65 -0
  40. package/dist/src/modular/buildClientContext.js.map +1 -0
  41. package/dist/src/modular/buildCodeModel.d.ts +14 -0
  42. package/dist/src/modular/buildCodeModel.d.ts.map +1 -0
  43. package/dist/src/modular/buildCodeModel.js +1106 -0
  44. package/dist/src/modular/buildCodeModel.js.map +1 -0
  45. package/dist/src/modular/buildOperations.d.ts +13 -0
  46. package/dist/src/modular/buildOperations.d.ts.map +1 -0
  47. package/dist/src/modular/buildOperations.js +68 -0
  48. package/dist/src/modular/buildOperations.js.map +1 -0
  49. package/dist/src/modular/buildProjectFiles.d.ts +5 -0
  50. package/dist/src/modular/buildProjectFiles.d.ts.map +1 -0
  51. package/dist/src/modular/buildProjectFiles.js +188 -0
  52. package/dist/src/modular/buildProjectFiles.js.map +1 -0
  53. package/dist/src/modular/buildRootIndex.d.ts +4 -0
  54. package/dist/src/modular/buildRootIndex.d.ts.map +1 -0
  55. package/dist/src/modular/buildRootIndex.js +49 -0
  56. package/dist/src/modular/buildRootIndex.js.map +1 -0
  57. package/dist/src/modular/buildSharedTypes.d.ts +6 -0
  58. package/dist/src/modular/buildSharedTypes.d.ts.map +1 -0
  59. package/dist/src/modular/buildSharedTypes.js +33 -0
  60. package/dist/src/modular/buildSharedTypes.js.map +1 -0
  61. package/dist/src/modular/emitModels.d.ts +7 -0
  62. package/dist/src/modular/emitModels.d.ts.map +1 -0
  63. package/dist/src/modular/emitModels.js +63 -0
  64. package/dist/src/modular/emitModels.js.map +1 -0
  65. package/dist/src/modular/helpers/clientHelpers.d.ts +4 -0
  66. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -0
  67. package/dist/src/modular/helpers/clientHelpers.js +31 -0
  68. package/dist/src/modular/helpers/clientHelpers.js.map +1 -0
  69. package/dist/src/modular/helpers/credentialHelpers.d.ts +7 -0
  70. package/dist/src/modular/helpers/credentialHelpers.d.ts.map +1 -0
  71. package/dist/src/modular/helpers/credentialHelpers.js +22 -0
  72. package/dist/src/modular/helpers/credentialHelpers.js.map +1 -0
  73. package/dist/src/modular/helpers/namingHelpers.d.ts +3 -0
  74. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -0
  75. package/dist/src/modular/helpers/namingHelpers.js +4 -0
  76. package/dist/src/modular/helpers/namingHelpers.js.map +1 -0
  77. package/dist/src/modular/helpers/operationHelpers.d.ts +8 -0
  78. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -0
  79. package/dist/src/modular/helpers/operationHelpers.js +191 -0
  80. package/dist/src/modular/helpers/operationHelpers.js.map +1 -0
  81. package/dist/src/modular/helpers/parameterHelpers.d.ts +3 -0
  82. package/dist/src/modular/helpers/parameterHelpers.d.ts.map +1 -0
  83. package/dist/src/modular/helpers/parameterHelpers.js +11 -0
  84. package/dist/src/modular/helpers/parameterHelpers.js.map +1 -0
  85. package/dist/src/modular/helpers/typeHelpers.d.ts +16 -0
  86. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -0
  87. package/dist/src/modular/helpers/typeHelpers.js +71 -0
  88. package/dist/src/modular/helpers/typeHelpers.js.map +1 -0
  89. package/dist/src/modular/interfaces.d.ts +10 -0
  90. package/dist/src/modular/interfaces.d.ts.map +1 -0
  91. package/dist/src/modular/interfaces.js +2 -0
  92. package/dist/src/modular/interfaces.js.map +1 -0
  93. package/dist/src/modular/modularCodeModel.d.ts +120 -0
  94. package/dist/src/modular/modularCodeModel.d.ts.map +1 -0
  95. package/dist/src/modular/modularCodeModel.js +2 -0
  96. package/dist/src/modular/modularCodeModel.js.map +1 -0
  97. package/dist/src/operationUtil.d.ts +16 -0
  98. package/dist/src/operationUtil.d.ts.map +1 -0
  99. package/dist/src/operationUtil.js +142 -0
  100. package/dist/src/operationUtil.js.map +1 -0
  101. package/dist/src/transform/transform.d.ts +6 -0
  102. package/dist/src/transform/transform.d.ts.map +1 -0
  103. package/dist/src/transform/transform.js +87 -0
  104. package/dist/src/transform/transform.js.map +1 -0
  105. package/dist/src/transform/transformAnnotationDetails.d.ts +6 -0
  106. package/dist/src/transform/transformAnnotationDetails.d.ts.map +1 -0
  107. package/dist/src/transform/transformAnnotationDetails.js +188 -0
  108. package/dist/src/transform/transformAnnotationDetails.js.map +1 -0
  109. package/dist/src/transform/transformApiVersionInfo.d.ts +5 -0
  110. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -0
  111. package/dist/src/transform/transformApiVersionInfo.js +64 -0
  112. package/dist/src/transform/transformApiVersionInfo.js.map +1 -0
  113. package/dist/src/transform/transformParameters.d.ts +14 -0
  114. package/dist/src/transform/transformParameters.d.ts.map +1 -0
  115. package/dist/src/transform/transformParameters.js +314 -0
  116. package/dist/src/transform/transformParameters.js.map +1 -0
  117. package/dist/src/transform/transformPaths.d.ts +10 -0
  118. package/dist/src/transform/transformPaths.d.ts.map +1 -0
  119. package/dist/src/transform/transformPaths.js +124 -0
  120. package/dist/src/transform/transformPaths.js.map +1 -0
  121. package/dist/src/transform/transformResponses.d.ts +5 -0
  122. package/dist/src/transform/transformResponses.d.ts.map +1 -0
  123. package/dist/src/transform/transformResponses.js +136 -0
  124. package/dist/src/transform/transformResponses.js.map +1 -0
  125. package/dist/src/transform/transformSchemas.d.ts +4 -0
  126. package/dist/src/transform/transformSchemas.d.ts.map +1 -0
  127. package/dist/src/transform/transformSchemas.js +161 -0
  128. package/dist/src/transform/transformSchemas.js.map +1 -0
  129. package/dist/src/transform/transfromRLCOptions.d.ts +10 -0
  130. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -0
  131. package/dist/src/transform/transfromRLCOptions.js +156 -0
  132. package/dist/src/transform/transfromRLCOptions.js.map +1 -0
  133. package/dist/tsconfig.tsbuildinfo +1 -0
  134. package/package.json +80 -0
  135. package/src/casingUtils.ts +48 -0
  136. package/src/emitUtil.ts +63 -0
  137. package/src/index.ts +148 -0
  138. package/src/lib.ts +208 -0
  139. package/src/modelUtils.ts +1080 -0
  140. package/src/modular/buildApiIndex.ts +13 -0
  141. package/src/modular/buildClassicalClient.ts +154 -0
  142. package/src/modular/buildClientContext.ts +96 -0
  143. package/src/modular/buildCodeModel.ts +1444 -0
  144. package/src/modular/buildOperations.ts +93 -0
  145. package/src/modular/buildProjectFiles.ts +217 -0
  146. package/src/modular/buildRootIndex.ts +75 -0
  147. package/src/modular/buildSharedTypes.ts +40 -0
  148. package/src/modular/emitModels.ts +72 -0
  149. package/src/modular/helpers/clientHelpers.ts +38 -0
  150. package/src/modular/helpers/credentialHelpers.ts +29 -0
  151. package/src/modular/helpers/namingHelpers.ts +5 -0
  152. package/src/modular/helpers/operationHelpers.ts +289 -0
  153. package/src/modular/helpers/parameterHelpers.ts +12 -0
  154. package/src/modular/helpers/typeHelpers.ts +84 -0
  155. package/src/modular/interfaces.ts +10 -0
  156. package/src/modular/modularCodeModel.ts +148 -0
  157. package/src/operationUtil.ts +203 -0
  158. package/src/transform/transform.ts +154 -0
  159. package/src/transform/transformAnnotationDetails.ts +231 -0
  160. package/src/transform/transformApiVersionInfo.ts +108 -0
  161. package/src/transform/transformParameters.ts +480 -0
  162. package/src/transform/transformPaths.ts +187 -0
  163. package/src/transform/transformResponses.ts +190 -0
  164. package/src/transform/transformSchemas.ts +197 -0
  165. package/src/transform/transfromRLCOptions.ts +202 -0
  166. package/test/commands/cadl-ranch-list.ts +111 -0
  167. package/test/commands/check-clean-tree.ts +55 -0
  168. package/test/commands/childProcessOnExit.ts +16 -0
  169. package/test/commands/gen-cadl-ranch.ts +21 -0
  170. package/test/commands/run.ts +31 -0
  171. package/test/integration/arrayItemTypes.spec.ts +96 -0
  172. package/test/integration/authApiKey.spec.ts +38 -0
  173. package/test/integration/authOauth2.spec.ts +65 -0
  174. package/test/integration/authUnion.spec.ts +72 -0
  175. package/test/integration/collectionFormat.spec.ts +74 -0
  176. package/test/integration/dictionary.spec.ts +106 -0
  177. package/test/integration/extensibleEnums.spec.ts +61 -0
  178. package/test/integration/fixedEnums.spec.ts +52 -0
  179. package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +31 -0
  180. package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +165 -0
  181. package/test/integration/generated/arrays/itemTypes/src/index.ts +13 -0
  182. package/test/integration/generated/arrays/itemTypes/src/models.ts +9 -0
  183. package/test/integration/generated/arrays/itemTypes/src/outputModels.ts +9 -0
  184. package/test/integration/generated/arrays/itemTypes/src/parameters.ts +86 -0
  185. package/test/integration/generated/arrays/itemTypes/src/responses.ts +115 -0
  186. package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +15 -0
  187. package/test/integration/generated/authentication/apiKey/.eslintrc.json +11 -0
  188. package/test/integration/generated/authentication/apiKey/README.md +56 -0
  189. package/test/integration/generated/authentication/apiKey/api-extractor.json +18 -0
  190. package/test/integration/generated/authentication/apiKey/karma.conf.js +133 -0
  191. package/test/integration/generated/authentication/apiKey/package.json +103 -0
  192. package/test/integration/generated/authentication/apiKey/rollup.config.js +118 -0
  193. package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +41 -0
  194. package/test/integration/generated/authentication/apiKey/src/clientDefinitions.ts +33 -0
  195. package/test/integration/generated/authentication/apiKey/src/index.ts +12 -0
  196. package/test/integration/generated/authentication/apiKey/src/outputModels.ts +6 -0
  197. package/test/integration/generated/authentication/apiKey/src/parameters.ts +7 -0
  198. package/test/integration/generated/authentication/apiKey/src/responses.ts +21 -0
  199. package/test/integration/generated/authentication/apiKey/test/public/sampleTest.spec.ts +23 -0
  200. package/test/integration/generated/authentication/apiKey/test/public/utils/env.browser.ts +2 -0
  201. package/test/integration/generated/authentication/apiKey/test/public/utils/env.ts +6 -0
  202. package/test/integration/generated/authentication/apiKey/test/public/utils/recordedClient.ts +29 -0
  203. package/test/integration/generated/authentication/apiKey/tsconfig.json +25 -0
  204. package/test/integration/generated/authentication/apiKey/tspconfig.yaml +13 -0
  205. package/test/integration/generated/authentication/oauth2/karma.conf.js +133 -0
  206. package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +41 -0
  207. package/test/integration/generated/authentication/oauth2/src/clientDefinitions.ts +33 -0
  208. package/test/integration/generated/authentication/oauth2/src/index.ts +12 -0
  209. package/test/integration/generated/authentication/oauth2/src/outputModels.ts +6 -0
  210. package/test/integration/generated/authentication/oauth2/src/parameters.ts +7 -0
  211. package/test/integration/generated/authentication/oauth2/src/responses.ts +21 -0
  212. package/test/integration/generated/authentication/oauth2/test/public/sampleTest.spec.ts +23 -0
  213. package/test/integration/generated/authentication/oauth2/test/public/utils/env.browser.ts +2 -0
  214. package/test/integration/generated/authentication/oauth2/test/public/utils/env.ts +6 -0
  215. package/test/integration/generated/authentication/oauth2/test/public/utils/recordedClient.ts +29 -0
  216. package/test/integration/generated/authentication/oauth2/tspconfig.yaml +15 -0
  217. package/test/integration/generated/authentication/union/karma.conf.js +133 -0
  218. package/test/integration/generated/authentication/union/src/authUnionClient.ts +42 -0
  219. package/test/integration/generated/authentication/union/src/clientDefinitions.ts +27 -0
  220. package/test/integration/generated/authentication/union/src/index.ts +11 -0
  221. package/test/integration/generated/authentication/union/src/parameters.ts +7 -0
  222. package/test/integration/generated/authentication/union/src/responses.ts +14 -0
  223. package/test/integration/generated/authentication/union/test/public/sampleTest.spec.ts +23 -0
  224. package/test/integration/generated/authentication/union/test/public/utils/env.browser.ts +2 -0
  225. package/test/integration/generated/authentication/union/test/public/utils/env.ts +6 -0
  226. package/test/integration/generated/authentication/union/test/public/utils/recordedClient.ts +29 -0
  227. package/test/integration/generated/authentication/union/tspconfig.yaml +15 -0
  228. package/test/integration/generated/dictionary/.eslintrc.json +11 -0
  229. package/test/integration/generated/dictionary/README.md +56 -0
  230. package/test/integration/generated/dictionary/api-extractor.json +18 -0
  231. package/test/integration/generated/dictionary/package.json +80 -0
  232. package/test/integration/generated/dictionary/rollup.config.js +118 -0
  233. package/test/integration/generated/dictionary/src/clientDefinitions.ts +180 -0
  234. package/test/integration/generated/dictionary/src/dictClient.ts +29 -0
  235. package/test/integration/generated/dictionary/src/index.ts +13 -0
  236. package/test/integration/generated/dictionary/src/models.ts +9 -0
  237. package/test/integration/generated/dictionary/src/outputModels.ts +9 -0
  238. package/test/integration/generated/dictionary/src/parameters.ts +94 -0
  239. package/test/integration/generated/dictionary/src/responses.ts +126 -0
  240. package/test/integration/generated/dictionary/tsconfig.json +25 -0
  241. package/test/integration/generated/dictionary/tspconfig.yaml +15 -0
  242. package/test/integration/generated/enums/extensible/.eslintrc.json +11 -0
  243. package/test/integration/generated/enums/extensible/README.md +56 -0
  244. package/test/integration/generated/enums/extensible/api-extractor.json +18 -0
  245. package/test/integration/generated/enums/extensible/package.json +80 -0
  246. package/test/integration/generated/enums/extensible/rollup.config.js +118 -0
  247. package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +45 -0
  248. package/test/integration/generated/enums/extensible/src/enumsExtensible.ts +31 -0
  249. package/test/integration/generated/enums/extensible/src/index.ts +11 -0
  250. package/test/integration/generated/enums/extensible/src/parameters.ts +23 -0
  251. package/test/integration/generated/enums/extensible/src/responses.ts +26 -0
  252. package/test/integration/generated/enums/extensible/tsconfig.json +25 -0
  253. package/test/integration/generated/enums/extensible/tspconfig.yaml +14 -0
  254. package/test/integration/generated/enums/fixed/.eslintrc.json +11 -0
  255. package/test/integration/generated/enums/fixed/README.md +56 -0
  256. package/test/integration/generated/enums/fixed/api-extractor.json +18 -0
  257. package/test/integration/generated/enums/fixed/package.json +80 -0
  258. package/test/integration/generated/enums/fixed/rollup.config.js +118 -0
  259. package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +43 -0
  260. package/test/integration/generated/enums/fixed/src/enumsFixed.ts +31 -0
  261. package/test/integration/generated/enums/fixed/src/index.ts +11 -0
  262. package/test/integration/generated/enums/fixed/src/parameters.ts +36 -0
  263. package/test/integration/generated/enums/fixed/src/responses.ts +27 -0
  264. package/test/integration/generated/enums/fixed/tsconfig.json +25 -0
  265. package/test/integration/generated/enums/fixed/tspconfig.yaml +14 -0
  266. package/test/integration/generated/hello/.eslintrc.json +11 -0
  267. package/test/integration/generated/hello/README.md +56 -0
  268. package/test/integration/generated/hello/api-extractor.json +18 -0
  269. package/test/integration/generated/hello/package.json +80 -0
  270. package/test/integration/generated/hello/rollup.config.js +118 -0
  271. package/test/integration/generated/hello/src/clientDefinitions.ts +19 -0
  272. package/test/integration/generated/hello/src/hello.ts +29 -0
  273. package/test/integration/generated/hello/src/index.ts +11 -0
  274. package/test/integration/generated/hello/src/parameters.ts +6 -0
  275. package/test/integration/generated/hello/src/responses.ts +10 -0
  276. package/test/integration/generated/hello/tsconfig.json +25 -0
  277. package/test/integration/generated/hello/tspconfig.yaml +14 -0
  278. package/test/integration/generated/internal/src/clientDefinitions.ts +27 -0
  279. package/test/integration/generated/internal/src/index.ts +13 -0
  280. package/test/integration/generated/internal/src/internalClient.ts +31 -0
  281. package/test/integration/generated/internal/src/models.ts +8 -0
  282. package/test/integration/generated/internal/src/outputModels.ts +13 -0
  283. package/test/integration/generated/internal/src/parameters.ts +21 -0
  284. package/test/integration/generated/internal/src/responses.ts +20 -0
  285. package/test/integration/generated/internal/tspconfig.yaml +14 -0
  286. package/test/integration/generated/lro/lroBasic/.eslintrc.json +11 -0
  287. package/test/integration/generated/lro/lroBasic/README.md +56 -0
  288. package/test/integration/generated/lro/lroBasic/api-extractor.json +18 -0
  289. package/test/integration/generated/lro/lroBasic/package.json +82 -0
  290. package/test/integration/generated/lro/lroBasic/rollup.config.js +118 -0
  291. package/test/integration/generated/lro/lroBasic/src/azureLro.ts +31 -0
  292. package/test/integration/generated/lro/lroBasic/src/clientDefinitions.ts +37 -0
  293. package/test/integration/generated/lro/lroBasic/src/index.ts +13 -0
  294. package/test/integration/generated/lro/lroBasic/src/outputModels.ts +8 -0
  295. package/test/integration/generated/lro/lroBasic/src/parameters.ts +8 -0
  296. package/test/integration/generated/lro/lroBasic/src/pollingHelper.ts +75 -0
  297. package/test/integration/generated/lro/lroBasic/src/responses.ts +23 -0
  298. package/test/integration/generated/lro/lroBasic/tsconfig.json +25 -0
  299. package/test/integration/generated/lro/lroBasic/tspconfig.yaml +14 -0
  300. package/test/integration/generated/lro/lroCore/.eslintrc.json +11 -0
  301. package/test/integration/generated/lro/lroCore/README.md +56 -0
  302. package/test/integration/generated/lro/lroCore/api-extractor.json +18 -0
  303. package/test/integration/generated/lro/lroCore/package.json +82 -0
  304. package/test/integration/generated/lro/lroCore/rollup.config.js +118 -0
  305. package/test/integration/generated/lro/lroCore/src/azureLroCore.ts +31 -0
  306. package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +51 -0
  307. package/test/integration/generated/lro/lroCore/src/index.ts +15 -0
  308. package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +128 -0
  309. package/test/integration/generated/lro/lroCore/src/models.ts +8 -0
  310. package/test/integration/generated/lro/lroCore/src/outputModels.ts +53 -0
  311. package/test/integration/generated/lro/lroCore/src/parameters.ts +25 -0
  312. package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +75 -0
  313. package/test/integration/generated/lro/lroCore/src/responses.ts +91 -0
  314. package/test/integration/generated/lro/lroCore/tsconfig.json +25 -0
  315. package/test/integration/generated/lro/lroCore/tspconfig.yaml +14 -0
  316. package/test/integration/generated/models/inheritance/.eslintrc.json +11 -0
  317. package/test/integration/generated/models/inheritance/README.md +56 -0
  318. package/test/integration/generated/models/inheritance/api-extractor.json +18 -0
  319. package/test/integration/generated/models/inheritance/package.json +80 -0
  320. package/test/integration/generated/models/inheritance/rollup.config.js +118 -0
  321. package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +79 -0
  322. package/test/integration/generated/models/inheritance/src/index.ts +13 -0
  323. package/test/integration/generated/models/inheritance/src/models.ts +52 -0
  324. package/test/integration/generated/models/inheritance/src/modelsInheritance.ts +31 -0
  325. package/test/integration/generated/models/inheritance/src/outputModels.ts +52 -0
  326. package/test/integration/generated/models/inheritance/src/parameters.ts +35 -0
  327. package/test/integration/generated/models/inheritance/src/responses.ts +56 -0
  328. package/test/integration/generated/models/inheritance/tsconfig.json +25 -0
  329. package/test/integration/generated/models/inheritance/tspconfig.yaml +14 -0
  330. package/test/integration/generated/models/propertyNullable/.eslintrc.json +11 -0
  331. package/test/integration/generated/models/propertyNullable/README.md +56 -0
  332. package/test/integration/generated/models/propertyNullable/api-extractor.json +18 -0
  333. package/test/integration/generated/models/propertyNullable/package.json +80 -0
  334. package/test/integration/generated/models/propertyNullable/rollup.config.js +118 -0
  335. package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +227 -0
  336. package/test/integration/generated/models/propertyNullable/src/index.ts +13 -0
  337. package/test/integration/generated/models/propertyNullable/src/models.ts +56 -0
  338. package/test/integration/generated/models/propertyNullable/src/modelsPropertyNullable.ts +31 -0
  339. package/test/integration/generated/models/propertyNullable/src/outputModels.ts +56 -0
  340. package/test/integration/generated/models/propertyNullable/src/parameters.ts +195 -0
  341. package/test/integration/generated/models/propertyNullable/src/responses.ts +144 -0
  342. package/test/integration/generated/models/propertyNullable/tsconfig.json +25 -0
  343. package/test/integration/generated/models/propertyNullable/tspconfig.yaml +14 -0
  344. package/test/integration/generated/models/propertyOptional/.eslintrc.json +11 -0
  345. package/test/integration/generated/models/propertyOptional/README.md +56 -0
  346. package/test/integration/generated/models/propertyOptional/api-extractor.json +18 -0
  347. package/test/integration/generated/models/propertyOptional/package.json +80 -0
  348. package/test/integration/generated/models/propertyOptional/rollup.config.js +118 -0
  349. package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +263 -0
  350. package/test/integration/generated/models/propertyOptional/src/index.ts +13 -0
  351. package/test/integration/generated/models/propertyOptional/src/models.ts +46 -0
  352. package/test/integration/generated/models/propertyOptional/src/modelsPropertyOptional.ts +31 -0
  353. package/test/integration/generated/models/propertyOptional/src/outputModels.ts +46 -0
  354. package/test/integration/generated/models/propertyOptional/src/parameters.ts +124 -0
  355. package/test/integration/generated/models/propertyOptional/src/responses.ts +169 -0
  356. package/test/integration/generated/models/propertyOptional/tsconfig.json +25 -0
  357. package/test/integration/generated/models/propertyOptional/tspconfig.yaml +14 -0
  358. package/test/integration/generated/models/propertyTypes/.eslintrc.json +11 -0
  359. package/test/integration/generated/models/propertyTypes/README.md +56 -0
  360. package/test/integration/generated/models/propertyTypes/api-extractor.json +18 -0
  361. package/test/integration/generated/models/propertyTypes/package.json +80 -0
  362. package/test/integration/generated/models/propertyTypes/rollup.config.js +118 -0
  363. package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +234 -0
  364. package/test/integration/generated/models/propertyTypes/src/index.ts +13 -0
  365. package/test/integration/generated/models/propertyTypes/src/models.ts +99 -0
  366. package/test/integration/generated/models/propertyTypes/src/modelsPropertyTypes.ts +31 -0
  367. package/test/integration/generated/models/propertyTypes/src/outputModels.ts +99 -0
  368. package/test/integration/generated/models/propertyTypes/src/parameters.ts +147 -0
  369. package/test/integration/generated/models/propertyTypes/src/responses.ts +186 -0
  370. package/test/integration/generated/models/propertyTypes/tsconfig.json +25 -0
  371. package/test/integration/generated/models/propertyTypes/tspconfig.yaml +14 -0
  372. package/test/integration/generated/models/usage/.eslintrc.json +11 -0
  373. package/test/integration/generated/models/usage/README.md +56 -0
  374. package/test/integration/generated/models/usage/api-extractor.json +18 -0
  375. package/test/integration/generated/models/usage/package.json +80 -0
  376. package/test/integration/generated/models/usage/rollup.config.js +118 -0
  377. package/test/integration/generated/models/usage/src/clientDefinitions.ts +41 -0
  378. package/test/integration/generated/models/usage/src/index.ts +13 -0
  379. package/test/integration/generated/models/usage/src/models.ts +12 -0
  380. package/test/integration/generated/models/usage/src/modelsUsage.ts +31 -0
  381. package/test/integration/generated/models/usage/src/outputModels.ts +12 -0
  382. package/test/integration/generated/models/usage/src/parameters.ts +19 -0
  383. package/test/integration/generated/models/usage/src/responses.ts +22 -0
  384. package/test/integration/generated/models/usage/tsconfig.json +25 -0
  385. package/test/integration/generated/models/usage/tspconfig.yaml +14 -0
  386. package/test/integration/generated/models/visibility/.eslintrc.json +11 -0
  387. package/test/integration/generated/models/visibility/README.md +56 -0
  388. package/test/integration/generated/models/visibility/api-extractor.json +18 -0
  389. package/test/integration/generated/models/visibility/package.json +80 -0
  390. package/test/integration/generated/models/visibility/rollup.config.js +118 -0
  391. package/test/integration/generated/models/visibility/src/clientDefinitions.ts +40 -0
  392. package/test/integration/generated/models/visibility/src/index.ts +13 -0
  393. package/test/integration/generated/models/visibility/src/models.ts +14 -0
  394. package/test/integration/generated/models/visibility/src/modelsVisibilityAutomatic.ts +31 -0
  395. package/test/integration/generated/models/visibility/src/outputModels.ts +16 -0
  396. package/test/integration/generated/models/visibility/src/parameters.ts +41 -0
  397. package/test/integration/generated/models/visibility/src/responses.ts +36 -0
  398. package/test/integration/generated/models/visibility/tsconfig.json +25 -0
  399. package/test/integration/generated/models/visibility/tspconfig.yaml +14 -0
  400. package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +39 -0
  401. package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +31 -0
  402. package/test/integration/generated/parameters/collection-format/src/index.ts +12 -0
  403. package/test/integration/generated/parameters/collection-format/src/parameters.ts +38 -0
  404. package/test/integration/generated/parameters/collection-format/src/responses.ts +19 -0
  405. package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +16 -0
  406. package/test/integration/generated/parameters/collection-format/tspconfig.yaml +14 -0
  407. package/test/integration/generated/projection/src/clientDefinitions.ts +45 -0
  408. package/test/integration/generated/projection/src/index.ts +12 -0
  409. package/test/integration/generated/projection/src/models.ts +11 -0
  410. package/test/integration/generated/projection/src/parameters.ts +26 -0
  411. package/test/integration/generated/projection/src/projectionClient.ts +31 -0
  412. package/test/integration/generated/projection/src/responses.ts +19 -0
  413. package/test/integration/generated/projection/tspconfig.yaml +14 -0
  414. package/test/integration/generated/resiliency/devDriven/.eslintrc.json +11 -0
  415. package/test/integration/generated/resiliency/devDriven/README.md +56 -0
  416. package/test/integration/generated/resiliency/devDriven/api-extractor.json +18 -0
  417. package/test/integration/generated/resiliency/devDriven/package.json +81 -0
  418. package/test/integration/generated/resiliency/devDriven/rollup.config.js +118 -0
  419. package/test/integration/generated/resiliency/devDriven/src/clientDefinitions.ts +75 -0
  420. package/test/integration/generated/resiliency/devDriven/src/index.ts +15 -0
  421. package/test/integration/generated/resiliency/devDriven/src/isUnexpected.ts +117 -0
  422. package/test/integration/generated/resiliency/devDriven/src/models.ts +8 -0
  423. package/test/integration/generated/resiliency/devDriven/src/outputModels.ts +25 -0
  424. package/test/integration/generated/resiliency/devDriven/src/paginateHelper.ts +154 -0
  425. package/test/integration/generated/resiliency/devDriven/src/parameters.ts +17 -0
  426. package/test/integration/generated/resiliency/devDriven/src/resiliencyDevDriven.ts +31 -0
  427. package/test/integration/generated/resiliency/devDriven/src/responses.ts +62 -0
  428. package/test/integration/generated/resiliency/devDriven/tsconfig.json +25 -0
  429. package/test/integration/generated/resiliency/devDriven/tspconfig.yaml +14 -0
  430. package/test/integration/generated/resiliency/srvDriven1/.eslintrc.json +11 -0
  431. package/test/integration/generated/resiliency/srvDriven1/README.md +56 -0
  432. package/test/integration/generated/resiliency/srvDriven1/api-extractor.json +18 -0
  433. package/test/integration/generated/resiliency/srvDriven1/package.json +80 -0
  434. package/test/integration/generated/resiliency/srvDriven1/rollup.config.js +118 -0
  435. package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +70 -0
  436. package/test/integration/generated/resiliency/srvDriven1/src/index.ts +13 -0
  437. package/test/integration/generated/resiliency/srvDriven1/src/models.ts +6 -0
  438. package/test/integration/generated/resiliency/srvDriven1/src/outputModels.ts +6 -0
  439. package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +51 -0
  440. package/test/integration/generated/resiliency/srvDriven1/src/resiliencyServiceDriven1.ts +31 -0
  441. package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +34 -0
  442. package/test/integration/generated/resiliency/srvDriven1/tsconfig.json +25 -0
  443. package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +14 -0
  444. package/test/integration/generated/resiliency/srvDriven2/.eslintrc.json +11 -0
  445. package/test/integration/generated/resiliency/srvDriven2/README.md +56 -0
  446. package/test/integration/generated/resiliency/srvDriven2/api-extractor.json +18 -0
  447. package/test/integration/generated/resiliency/srvDriven2/package.json +80 -0
  448. package/test/integration/generated/resiliency/srvDriven2/rollup.config.js +118 -0
  449. package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +93 -0
  450. package/test/integration/generated/resiliency/srvDriven2/src/index.ts +13 -0
  451. package/test/integration/generated/resiliency/srvDriven2/src/models.ts +6 -0
  452. package/test/integration/generated/resiliency/srvDriven2/src/outputModels.ts +6 -0
  453. package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +68 -0
  454. package/test/integration/generated/resiliency/srvDriven2/src/resiliencyServiceDriven2.ts +31 -0
  455. package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +45 -0
  456. package/test/integration/generated/resiliency/srvDriven2/tsconfig.json +25 -0
  457. package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +14 -0
  458. package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +35 -0
  459. package/test/integration/generated/server/path/multiple/src/index.ts +11 -0
  460. package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +39 -0
  461. package/test/integration/generated/server/path/multiple/src/parameters.ts +7 -0
  462. package/test/integration/generated/server/path/multiple/src/responses.ts +14 -0
  463. package/test/integration/generated/server/path/multiple/tspconfig.yaml +14 -0
  464. package/test/integration/generated/server/path/single/src/clientDefinitions.ts +19 -0
  465. package/test/integration/generated/server/path/single/src/index.ts +11 -0
  466. package/test/integration/generated/server/path/single/src/parameters.ts +6 -0
  467. package/test/integration/generated/server/path/single/src/responses.ts +9 -0
  468. package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +34 -0
  469. package/test/integration/generated/server/path/single/tspconfig.yaml +14 -0
  470. package/test/integration/generated/specialWords/src/clientDefinitions.ts +61 -0
  471. package/test/integration/generated/specialWords/src/index.ts +13 -0
  472. package/test/integration/generated/specialWords/src/models.ts +17 -0
  473. package/test/integration/generated/specialWords/src/outputModels.ts +17 -0
  474. package/test/integration/generated/specialWords/src/parameters.ts +37 -0
  475. package/test/integration/generated/specialWords/src/responses.ts +31 -0
  476. package/test/integration/generated/specialWords/src/specialWordsClient.ts +31 -0
  477. package/test/integration/generated/specialWords/tspconfig.yaml +14 -0
  478. package/test/integration/generated/unions/src/clientDefinitions.ts +53 -0
  479. package/test/integration/generated/unions/src/index.ts +12 -0
  480. package/test/integration/generated/unions/src/models.ts +27 -0
  481. package/test/integration/generated/unions/src/parameters.ts +34 -0
  482. package/test/integration/generated/unions/src/responses.ts +24 -0
  483. package/test/integration/generated/unions/src/unionsClient.ts +31 -0
  484. package/test/integration/generated/unions/tspconfig.yaml +14 -0
  485. package/test/integration/helloWorld.spec.ts +20 -0
  486. package/test/integration/internal.spec.ts +43 -0
  487. package/test/integration/lroBasic.spec.ts +25 -0
  488. package/test/integration/modelInheritance.spec.ts +192 -0
  489. package/test/integration/modelPropertyNullable.spec.ts +115 -0
  490. package/test/integration/modelPropertyOptional.spec.ts +362 -0
  491. package/test/integration/modelPropertyType.spec.ts +119 -0
  492. package/test/integration/modelUsage.spec.ts +47 -0
  493. package/test/integration/projection.spec.ts +55 -0
  494. package/test/integration/resiliencyDpgCustomization.spec.ts +52 -0
  495. package/test/integration/server.spec.ts +59 -0
  496. package/test/integration/specialWords.spec.ts +73 -0
  497. package/test/integration/unions.spec.ts +69 -0
  498. package/test/tsconfig.json +4 -0
  499. package/test/unit/apiVersion.spec.ts +388 -0
  500. package/test/unit/azureCoreOperationsGenerator.spec.ts +71 -0
  501. package/test/unit/clientDefinitionGenerator.spec.ts +73 -0
  502. package/test/unit/clientFactoryGenerator.spec.ts +376 -0
  503. package/test/unit/docsGenerator.spec.ts +201 -0
  504. package/test/unit/modelsGenerator.spec.ts +1319 -0
  505. package/test/unit/parametersGenerator.spec.ts +561 -0
  506. package/test/unit/responsesGenerator.spec.ts +462 -0
  507. package/test/unit/spreadAndAlias.spec.ts +200 -0
  508. package/test/unit/util/emitUtil.ts +157 -0
  509. package/test/unit/util/testUtil.ts +83 -0
  510. package/test/util/customBearerTokenTestingPolicy.ts +78 -0
  511. package/test/util/matrix.ts +48 -0
  512. package/tsconfig.json +36 -0
  513. package/tsconfig.test.json +7 -0
  514. package/typespec-ts.build.log +2 -0
@@ -0,0 +1,137 @@
1
+ # How to Contribute
2
+
3
+ ## Prerequisite
4
+
5
+ Please follow the **[Prerequisite](../../CONTRIBUTING.md#prerequisites)** part to install the dependencies.
6
+
7
+ ## Steps to clone, build & test
8
+
9
+ 1. Use the following command to clone the Typescript/Javascript SDK generator repository:
10
+
11
+ ```
12
+ git clone https://github.com/Azure/autorest.typescript.git
13
+ ```
14
+
15
+ 2. Use the following commands to build the SDK generator:
16
+
17
+ ```
18
+ rush update
19
+ rush rebuild
20
+ ```
21
+
22
+ 3. There are also 3 test-suites in the RLC generator:
23
+
24
+ 1. Unit tests (which could be found at `test/unit/*`)
25
+ 2. Integration tests (which could be found at `test/integration/*`)
26
+ 3. Smoke tests (which could be found at `../../packages/typespec-test`)
27
+
28
+ 1. You can run the Unit tests & Integration tests using the following command:
29
+
30
+ ```
31
+ npm run test
32
+ ```
33
+
34
+ Running the command above will do the following things:
35
+
36
+ - Start TestServer
37
+ - Build Cadl Typescript
38
+ - Generate all scenarios in parallel (i.e. Dictionary, Extensible Enums, Models, Resiliency)
39
+ - Run all the tests under test/integration
40
+ - Stop TestServer
41
+
42
+ **_Note_**: If your development environment is Windows, then run the command `npm run start-test-server`(in a seperate window) before running `npm run test` and run the command `npm run stop-test-server` after. (In non windows machines, we could run the test-server in the background automatically. But, in Windows machines, it has to be done manually.)
43
+
44
+ 5. You can run the Smoke tests using the following command:
45
+
46
+ ```shell
47
+ cd ../../packages/typespec-test
48
+ npm run smoke-test
49
+ ```
50
+
51
+ ## How to add an integration test case
52
+
53
+ Whenever you work on adding a feature/fixing a bug, this would probably be your first step. You create a test case and then run it through the generator, see the result, modify the generator, run it again and so on, until you get the desired output.
54
+
55
+ 1. Pick up a cadl as your test input in cadl-ranch. Below are some examples
56
+
57
+ Let us say your test input is `authentication/api-key/main.cadl` in @azure-tools/cadl-ranch-specs.
58
+
59
+ 1. Now add an entry to the CadlRanchConfig to the file [`cadl-ranch-list.ts`](./test/commands/cadl-ranch-list.ts). In the file, add the following to the array.
60
+
61
+ ```typescript
62
+ {
63
+ outputPath: "authentication/apiKey",
64
+ inputPath: "authentication/api-key"
65
+ },
66
+ ```
67
+
68
+ 1. Create a tspconfig.yaml in `./test/integration/generated/authentication/apiKey` folder and put the following content in it.
69
+
70
+ ```yaml
71
+ emit:
72
+ - "@azure-tools/typespec-ts"
73
+ options:
74
+ "@azure-tools/typespec-ts":
75
+ "emitter-output-dir": "{project-root}"
76
+ generateMetadata: true
77
+ generateTest: true
78
+ includeShortcuts: true
79
+ azureSdkForJs: false
80
+ addCredentials: false
81
+ isCadlTest: true
82
+ title: AuthApiKeyClient
83
+ packageDetails:
84
+ name: "@msinternal/auth-apikey"
85
+ description: "Auth api key Test Service"
86
+ version: "1.0.0"
87
+ ```
88
+
89
+ 1. Now, You can generate the RLC for your test case with the following command: (Initially, during your development, you do not want to run all the cases during every step of your development, you can comment out other test cases. But, once your code changes are complete for your case, then you need to run the entire suite to ensure that your changes did not cause any unwanted changes.)
90
+
91
+ ```shell
92
+ npm run generate-cadl-only
93
+ ```
94
+
95
+ 1. Once you are satisfied with the generated code, you can add a spec file such as `testUserCaseRest.spec.ts` file [here](./test/integration). You can find several examples in the same place.
96
+
97
+ ## How to debug
98
+
99
+ ### `generate-cadl-only` step
100
+
101
+ If you would like to debug the `generate-cadl-only` step for our test input, Open the repository in VS Code -> Select `Generate code for CadlEmitter` section -> Click `Attach`.
102
+
103
+ ### Spec file
104
+
105
+ If you would like to debug the `testUserCase.spec.ts` file (after the SDK is generated), Open the repository in VS Code -> Open the `testUserCase.spec.ts` file -> Select `Run and Debug` section -> Click `IntegrationTests - Current File`.
106
+
107
+ ### How to debug an unit test case
108
+
109
+ - In VS Code, We have created a Debugging profile for UnitTests to start debugging:
110
+
111
+ 1. Go to the debugger tab
112
+ 2. Select the "[CADL] - Unit Test" Profile
113
+ 3. Click the "Play" button
114
+
115
+ - Your breakpoints will start hitting, you can set breakpoints in either Test or Generator code
116
+
117
+ ### Integration Tests
118
+
119
+ - In order to debug integration tests you need to start the test server, by running:
120
+
121
+ npm run start-test-server:v1
122
+
123
+ - Once the Test Server is running
124
+
125
+ 1. In VSCode go to the debugger tab
126
+ 2. Select the "[CADL] - Integration Test" profile from the drop down
127
+ 3. Click the "Play" button
128
+
129
+ - **\*\***IMPORTANT**\*\***: Running Integration Tests for debugging, does not re-generate the test clients so make sure that after each change you do:
130
+
131
+ - Re-generate all the test swaggers
132
+
133
+ npm run generate-cadl-only -- --build
134
+
135
+ - Re-generate a specific swagger
136
+
137
+ npm run generate-cadl-only -- -i bodyComplexRest -b
package/README.md ADDED
@@ -0,0 +1,150 @@
1
+ # Introduction
2
+
3
+ This library is the TypeSpec typescript emitter for Rest Level Client. It take [TypeSpec](https://github.com/microsoft/typespec) as input, transform it into RLCModel, then call rlc-common library to generate the RLC code.
4
+
5
+ On a high level, the entire Rest Level Client generation process would be:
6
+
7
+ TypeSpec Input -> TypeSpec Compiler -> TypeSpec Program -> Transform RLCModel -> TypeSpec RLC Common library to Generate Code
8
+
9
+ Within the Transform RLCModel, it has the following stages:
10
+
11
+ TypeSpec Program + User Options -> Transform RLCModel Paths -> Transform RLCModel Options -> Transform RLCModel Schemas -> Transform RLCModel Response and Parameter Types -> TypeSpec RLCCommon libraries to generate the code.
12
+
13
+ # How to use
14
+
15
+ ## Prerequisite
16
+
17
+ Install [Node.js](https://nodejs.org/en/download/) 16 or above. (Verify by `node --version`)
18
+
19
+ Install [TypeSpec](https://github.com/microsoft/typespec) latest.
20
+
21
+ ## Initialize TypeSpec Project
22
+
23
+ Follow [TypeSpec Getting Started](https://github.com/microsoft/typespec#getting-started) to initialize your TypeSpec project.
24
+
25
+ Make sure `npx tsp compile .` runs correctly.
26
+
27
+ ## Add typespec-ts
28
+
29
+ Make sure the version of [typespec-ts release](https://www.npmjs.com/package/@azure-tools/typespec-ts) depends on the same version of "@typespec/compiler" as in your TypeSpec project.
30
+
31
+ Modify `package.json`, add one line under `dependencies`:
32
+
33
+ ```diff
34
+ "dependencies": {
35
+ "@typespec/compiler": "latest",
36
+ "@typespec/rest": "latest",
37
+ "@azure-tools/typespec-azure-core": "latest",
38
+ + "@azure-tools/typespec-ts": "latest"
39
+ },
40
+ ```
41
+
42
+ Run `npm install` again to install `@azure-tools/typespec-ts`.
43
+
44
+ Modify (or create) `tspconfig.yaml`, add one line under `emit`:
45
+
46
+ ```diff
47
+ emit:
48
+ + - "@azure-tools/typespec-ts"
49
+ ```
50
+
51
+ ## Modify tspconfig.yaml
52
+
53
+ One can further configure the SDK generated, using the emitter options on `@azure-tools/typespec-ts`.
54
+
55
+ ```yaml
56
+ options:
57
+ "@azure-tools/typespec-ts":
58
+ packageDetails:
59
+ name: "@azure-rest/confidential-ledger"
60
+ description: "Confidential Ledger Service"
61
+ ```
62
+
63
+ ## Generate Typescript
64
+
65
+ Same `npx tsp compile .` or `npx tsp compile . --output-path=<target-folder>`.
66
+
67
+ If `output-path` option is not provided, generated code will be under `tsp-output` folder.
68
+
69
+ ## Emitter Options
70
+
71
+ ### packageDetails
72
+
73
+ Provide the metadata for `package.json`, `README.md` and user-agent information. And it's highly recommanded to set up this detail for your package.
74
+
75
+ | Property | Description |
76
+ | ----------- | ------------------------------------------------------------------------------------------------ |
77
+ | name | the name of package.json file, usually start with `@azure-rest` if this is data-plane RLC client |
78
+ | description | description used in package.json file |
79
+ | version | detailed version for your released package, the default vaule is `1.0.0-beta.1` |
80
+
81
+ ### title
82
+
83
+ Generally the codegen will leverage the title defined in `@service` decorator in TypeSpec to name our client. But if you'd like to override it you could config the `title` info.
84
+
85
+ ```yaml
86
+ title: AnomalyDetectorRest
87
+ ```
88
+
89
+ ### generateMetadata
90
+
91
+ To indicate if the codegen needs to generate metadata files which includes `package.json`, `README.md` and `tsconfig.json` etc.
92
+
93
+ By default we'll enable the option but if you'd like to disable this feature you could set it as `false`.
94
+
95
+ ```yaml
96
+ generateMetadata: false
97
+ ```
98
+
99
+ ### generateTest
100
+
101
+ To allow the codegen generating test sample files and updating testing configuration. And the default value is `true` and you could also turn it off as `false`.
102
+
103
+ ### includeShortcuts
104
+
105
+ To allow the codegen generating shortcut methods in client definition. This is an experimental feature so we disable it by default. If you want to try it just turn it on.
106
+
107
+ ```yaml
108
+ includeShortcuts: true
109
+ ```
110
+
111
+ ### azureSdkForJs
112
+
113
+ This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool.
114
+
115
+ Usually the released JS sdk will be put into azure-sdk-for-js so we enable this option by default.
116
+
117
+ ### addCredentials
118
+
119
+ We support two types of authentication: Azure Key Credential(AzureKey) and Token credential(AADToken), any other will need to be handled manually.
120
+
121
+ There are two ways to set up our credential details
122
+
123
+ - To use `@useAuth` decorator in TypeSpec
124
+ - To config in yaml file
125
+
126
+ Please notice defining in TypeSpec is recommanded and also has higher priority than second one.
127
+
128
+ To enable credential in `tspconfig.yaml` and we need to provide more details to let codegen know types.
129
+
130
+ ### credentialScopes
131
+
132
+ If we enable the option `addCredentials` and specify `credentialScopes` the details we would enable the AADToken authentication.
133
+
134
+ ```yaml
135
+ addCredentials: true
136
+ credentialScopes: https://yourendpoint.azure.com/.default
137
+ ```
138
+
139
+ ### credentialKeyHeaderName
140
+
141
+ If we enable the option `addCredentials` and specify `credentialKeyHeaderName` the details we would enable the AzureKey authentication.
142
+
143
+ ```yaml
144
+ addCredentials: true
145
+ credentialKeyHeaderName: Your-Subscription-Key
146
+ ```
147
+
148
+ # Contributing
149
+
150
+ If you want to contribute on this project read the [contrubuting document](./CONTRIBUTING.md) for more details.
@@ -0,0 +1,4 @@
1
+ export declare function toCamelCase(name: string): string;
2
+ export declare function camelToSnakeCase(name: string): string;
3
+ export declare function toPascalCase(name: string): string;
4
+ //# sourceMappingURL=casingUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"casingUtils.d.ts","sourceRoot":"","sources":["../../src/casingUtils.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBhD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASrD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAiBjD"}
@@ -0,0 +1,39 @@
1
+ export function toCamelCase(name) {
2
+ let str = name;
3
+ // Handle snake case or dash-separated words
4
+ str = str.replace(/[-_]+/g, " ");
5
+ // Handle pascal case or camel case
6
+ str = str.replace(/([a-z])([A-Z])/g, (_match, p1, p2) => {
7
+ return p1 + " " + p2.toLowerCase();
8
+ });
9
+ // Convert to camel case
10
+ str = str.replace(/\s(.)/g, (_match, p1) => {
11
+ return p1.toUpperCase();
12
+ });
13
+ // Lowercase the first character
14
+ return str.charAt(0).toLowerCase() + str.slice(1);
15
+ }
16
+ export function camelToSnakeCase(name) {
17
+ const camelToSnakeCaseRe = (str) => str
18
+ .replace(/\s+/g, "_")
19
+ .replace(/\$/g, "")
20
+ .replace(/-/g, "_")
21
+ .replace(/[A-Z]/g, (letter) => `_${letter.toLowerCase()}`);
22
+ return camelToSnakeCaseRe(name[0].toLowerCase() + name.slice(1));
23
+ }
24
+ export function toPascalCase(name) {
25
+ let str = name;
26
+ // Handle snake case or dash-separated words
27
+ str = str.replace(/[-_]+/g, " ");
28
+ // Handle pascal case or camel case
29
+ str = str.replace(/([a-z])([A-Z])/g, (_match, p1, p2) => {
30
+ return p1 + " " + p2.toLowerCase();
31
+ });
32
+ // Convert to camel case
33
+ str = str.replace(/\s(.)/g, (_match, p1) => {
34
+ return p1.toUpperCase();
35
+ });
36
+ // Lowercase the first character
37
+ return str.charAt(0).toUpperCase() + str.slice(1);
38
+ }
39
+ //# sourceMappingURL=casingUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"casingUtils.js","sourceRoot":"","sources":["../../src/casingUtils.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,4CAA4C;IAC5C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEjC,mCAAmC;IACnC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;QACtD,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,wBAAwB;IACxB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;QACzC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,gCAAgC;IAChC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAE,EAAE,CACzC,GAAG;SACA,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;IAE/D,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,GAAG,GAAG,IAAI,CAAC;IACf,4CAA4C;IAC5C,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;IAEjC,mCAAmC;IACnC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;QACtD,OAAO,EAAE,GAAG,GAAG,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,wBAAwB;IACxB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE;QACzC,OAAO,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1B,CAAC,CAAC,CAAC;IAEH,gCAAgC;IAChC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { ContentBuilder } from "@azure-tools/rlc-common";
2
+ import { RLCModel } from "@azure-tools/rlc-common";
3
+ import { Program } from "@typespec/compiler";
4
+ export declare function emitModels(rlcModels: RLCModel, program: Program): Promise<void>;
5
+ export declare function emitContentByBuilder(program: Program, builderFnOrList: ContentBuilder | ContentBuilder[], rlcModels: RLCModel, emitterOutputDir?: string): Promise<void>;
6
+ //# sourceMappingURL=emitUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitUtil.d.ts","sourceRoot":"","sources":["../../src/emitUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,OAAO,EAAQ,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAgB,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAK3D,wBAAsB,UAAU,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,iBAWrE;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,cAAc,GAAG,cAAc,EAAE,EAClD,SAAS,EAAE,QAAQ,EACnB,gBAAgB,CAAC,EAAE,MAAM,iBAW1B"}
@@ -0,0 +1,45 @@
1
+ import { buildSchemaTypes } from "@azure-tools/rlc-common";
2
+ import { dirname, join } from "path";
3
+ import { format } from "prettier";
4
+ import { prettierJSONOptions, prettierTypeScriptOptions } from "./lib.js";
5
+ export async function emitModels(rlcModels, program) {
6
+ const schemaOutput = buildSchemaTypes(rlcModels);
7
+ if (schemaOutput) {
8
+ const { inputModelFile, outputModelFile } = schemaOutput;
9
+ if (inputModelFile) {
10
+ await emitFile(inputModelFile, program);
11
+ }
12
+ if (outputModelFile) {
13
+ await emitFile(outputModelFile, program);
14
+ }
15
+ }
16
+ }
17
+ export async function emitContentByBuilder(program, builderFnOrList, rlcModels, emitterOutputDir) {
18
+ if (!Array.isArray(builderFnOrList)) {
19
+ builderFnOrList = [builderFnOrList];
20
+ }
21
+ for (const builderFn of builderFnOrList) {
22
+ const contentFile = builderFn(rlcModels);
23
+ if (contentFile) {
24
+ await emitFile(contentFile, program, emitterOutputDir);
25
+ }
26
+ }
27
+ }
28
+ async function emitFile(file, program, emitterOutputDir) {
29
+ const host = program.host;
30
+ const filePath = join(emitterOutputDir !== null && emitterOutputDir !== void 0 ? emitterOutputDir : "", file.path);
31
+ const isJson = /\.json$/gi.test(filePath);
32
+ const isSourceCode = /\.(ts|js)$/gi.test(filePath);
33
+ const licenseHeader = `// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n`;
34
+ let prettierFileContent = file.content;
35
+ if (isSourceCode) {
36
+ prettierFileContent = `${licenseHeader.trimStart()}\n${prettierFileContent}`;
37
+ }
38
+ // Format the contents if necessary
39
+ if (isJson || isSourceCode) {
40
+ prettierFileContent = format(prettierFileContent, isJson ? prettierJSONOptions : prettierTypeScriptOptions);
41
+ }
42
+ await host.mkdirp(dirname(filePath));
43
+ await host.writeFile(filePath, prettierFileContent);
44
+ }
45
+ //# sourceMappingURL=emitUtil.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emitUtil.js","sourceRoot":"","sources":["../../src/emitUtil.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAE1E,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,SAAmB,EAAE,OAAgB;IACpE,MAAM,YAAY,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,YAAY,EAAE;QAChB,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,GAAG,YAAY,CAAC;QACzD,IAAI,cAAc,EAAE;YAClB,MAAM,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;SACzC;QACD,IAAI,eAAe,EAAE;YACnB,MAAM,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;SAC1C;KACF;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAgB,EAChB,eAAkD,EAClD,SAAmB,EACnB,gBAAyB;IAEzB,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE;QACnC,eAAe,GAAG,CAAC,eAAe,CAAC,CAAC;KACrC;IACD,KAAK,MAAM,SAAS,IAAI,eAAe,EAAE;QACvC,MAAM,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;QACzC,IAAI,WAAW,EAAE;YACf,MAAM,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC;SACxD;KACF;AACH,CAAC;AAED,KAAK,UAAU,QAAQ,CACrB,IAAU,EACV,OAAgB,EAChB,gBAAyB;IAEzB,MAAM,IAAI,GAAiB,OAAO,CAAC,IAAI,CAAC;IACxC,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,aAAhB,gBAAgB,cAAhB,gBAAgB,GAAI,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACzD,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,+EAA+E,CAAC;IACtG,IAAI,mBAAmB,GAAG,IAAI,CAAC,OAAO,CAAC;IAEvC,IAAI,YAAY,EAAE;QAChB,mBAAmB,GAAG,GAAG,aAAa,CAAC,SAAS,EAAE,KAAK,mBAAmB,EAAE,CAAC;KAC9E;IACD,mCAAmC;IACnC,IAAI,MAAM,IAAI,YAAY,EAAE;QAC1B,mBAAmB,GAAG,MAAM,CAC1B,mBAAmB,EACnB,MAAM,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,yBAAyB,CACzD,CAAC;KACH;IACD,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACrC,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;AACtD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { EmitContext } from "@typespec/compiler";
2
+ export declare function $onEmit(context: EmitContext): Promise<void>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAW,WAAW,EAAE,MAAM,oBAAoB,CAAC;AA4C1D,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,iBAsFjD"}
@@ -0,0 +1,90 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import * as fsextra from "fs-extra";
4
+ import { buildClientDefinitions, buildResponseTypes, buildParameterTypes, buildIsUnexpectedHelper, buildClient, buildIndexFile, buildTopLevelIndex, buildRollupConfig, buildTsConfig, buildApiExtractorConfig, buildPackageFile, buildPollingHelper, buildPaginateHelper, buildEsLintConfig, buildKarmaConfigFile, buildEnvFile, buildEnvBrowserFile, buildRecordedClientFile, buildSampleTest, buildReadmeFile, buildSerializeHelper } from "@azure-tools/rlc-common";
5
+ import { transformRLCModel } from "./transform/transform.js";
6
+ import { emitContentByBuilder, emitModels } from "./emitUtil.js";
7
+ import { listClients, createSdkContext } from "@azure-tools/typespec-client-generator-core";
8
+ import * as path from "path";
9
+ import { buildSharedTypes } from "./modular/buildSharedTypes.js";
10
+ import { Project } from "ts-morph";
11
+ import { buildClientContext } from "./modular/buildClientContext.js";
12
+ import { emitCodeModel } from "./modular/buildCodeModel.js";
13
+ import { buildRootIndex } from "./modular/buildRootIndex.js";
14
+ import { buildModels } from "./modular/emitModels.js";
15
+ import { buildOperationFiles } from "./modular/buildOperations.js";
16
+ import { buildApiIndexFile } from "./modular/buildApiIndex.js";
17
+ import { buildClassicalClient } from "./modular/buildClassicalClient.js";
18
+ // import { emitPackage, emitTsConfig } from "./modular/buildProjectFiles.js";
19
+ export async function $onEmit(context) {
20
+ var _a;
21
+ const program = context.program;
22
+ const options = context.options;
23
+ const dpgContext = createSdkContext(context);
24
+ const clients = listClients(dpgContext);
25
+ const srcPath = context.emitterOutputDir;
26
+ let count = -1;
27
+ for (const client of clients) {
28
+ count++;
29
+ const rlcModels = await transformRLCModel(program, options, client, context.emitterOutputDir, dpgContext);
30
+ const pathToClear = options.isModularLibrary ? srcPath : rlcModels.srcPath;
31
+ clearSrcFolder(pathToClear, count, (_a = rlcModels === null || rlcModels === void 0 ? void 0 : rlcModels.options) === null || _a === void 0 ? void 0 : _a.multiClient);
32
+ await emitModels(rlcModels, program);
33
+ await emitContentByBuilder(program, buildClientDefinitions, rlcModels);
34
+ await emitContentByBuilder(program, buildResponseTypes, rlcModels);
35
+ await emitContentByBuilder(program, buildClient, rlcModels);
36
+ await emitContentByBuilder(program, buildParameterTypes, rlcModels);
37
+ await emitContentByBuilder(program, buildIsUnexpectedHelper, rlcModels);
38
+ await emitContentByBuilder(program, buildIndexFile, rlcModels);
39
+ await emitContentByBuilder(program, buildTopLevelIndex, rlcModels);
40
+ await emitContentByBuilder(program, buildPaginateHelper, rlcModels);
41
+ await emitContentByBuilder(program, buildPollingHelper, rlcModels);
42
+ // buildSerializeHelper
43
+ await emitContentByBuilder(program, buildSerializeHelper, rlcModels);
44
+ // build metadata relevant files
45
+ await emitContentByBuilder(program, [
46
+ buildEsLintConfig,
47
+ buildRollupConfig,
48
+ buildApiExtractorConfig,
49
+ buildReadmeFile,
50
+ buildPackageFile,
51
+ buildTsConfig
52
+ ], rlcModels, context.emitterOutputDir);
53
+ // build test relevant files
54
+ await emitContentByBuilder(program, [
55
+ buildKarmaConfigFile,
56
+ buildEnvFile,
57
+ buildEnvBrowserFile,
58
+ buildRecordedClientFile,
59
+ buildSampleTest
60
+ ], rlcModels, context.emitterOutputDir);
61
+ }
62
+ if (options.isModularLibrary) {
63
+ // TODO: Emit modular parts of the library
64
+ const project = new Project();
65
+ const modularCodeModel = emitCodeModel(context, { casing: "camel" });
66
+ for (const client of modularCodeModel.clients) {
67
+ buildSharedTypes(project, srcPath);
68
+ buildClientContext(client, project, srcPath);
69
+ buildModels(modularCodeModel, project, srcPath);
70
+ buildOperationFiles(client, project, srcPath);
71
+ buildApiIndexFile(project, srcPath);
72
+ buildClassicalClient(client, project, srcPath);
73
+ buildRootIndex(client, project, srcPath);
74
+ // emitPackage(project, srcPath, modularCodeModel);
75
+ // emitTsConfig(project, srcPath, modularCodeModel);
76
+ }
77
+ for (const file of project.getSourceFiles()) {
78
+ await emitContentByBuilder(program, () => ({ content: file.getFullText(), path: file.getFilePath() }), modularCodeModel);
79
+ // emitFile(program, { content: hrlcClient.content, path: hrlcClient.path });
80
+ }
81
+ }
82
+ }
83
+ function clearSrcFolder(srcPath, count, isMultiClient = false) {
84
+ fsextra.emptyDirSync(srcPath);
85
+ if (isMultiClient && count === 0) {
86
+ const folderPath = path.join(srcPath.substring(0, srcPath.indexOf(path.sep + "src") + 4));
87
+ fsextra.emptyDirSync(folderPath);
88
+ }
89
+ }
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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"}