@azure-tools/typespec-ts 0.54.2 → 0.55.0-dev.10

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 (345) hide show
  1. package/CHANGELOG.md +0 -9
  2. package/README.md +68 -105
  3. package/dist/src/framework/hooks/binder.d.ts +1 -1
  4. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  5. package/dist/src/framework/hooks/binder.js +3 -4
  6. package/dist/src/framework/hooks/binder.js.map +1 -1
  7. package/dist/src/framework/hooks/sdk-types.d.ts +2 -3
  8. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  9. package/dist/src/framework/hooks/sdk-types.js +2 -3
  10. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  11. package/dist/src/framework/load-static-helpers.d.ts +4 -1
  12. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  13. package/dist/src/framework/load-static-helpers.js +26 -34
  14. package/dist/src/framework/load-static-helpers.js.map +1 -1
  15. package/dist/src/framework/sample.js +1 -1
  16. package/dist/src/framework/sample.js.map +1 -1
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/index.js +104 -170
  19. package/dist/src/index.js.map +1 -1
  20. package/dist/src/lib.d.ts +2 -18
  21. package/dist/src/lib.d.ts.map +1 -1
  22. package/dist/src/lib.js +30 -124
  23. package/dist/src/lib.js.map +1 -1
  24. package/dist/src/modular/build-classical-client.js +2 -2
  25. package/dist/src/modular/build-classical-client.js.map +1 -1
  26. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  27. package/dist/src/modular/build-client-context.js +6 -15
  28. package/dist/src/modular/build-client-context.js.map +1 -1
  29. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  30. package/dist/src/modular/build-project-files.js +4 -4
  31. package/dist/src/modular/build-project-files.js.map +1 -1
  32. package/dist/src/modular/build-restore-poller.js +2 -2
  33. package/dist/src/modular/build-restore-poller.js.map +1 -1
  34. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  35. package/dist/src/modular/build-root-index.js +9 -13
  36. package/dist/src/modular/build-root-index.js.map +1 -1
  37. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  38. package/dist/src/modular/build-subpath-index.js +4 -4
  39. package/dist/src/modular/build-subpath-index.js.map +1 -1
  40. package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
  41. package/dist/src/modular/emit-logger-file.js +0 -3
  42. package/dist/src/modular/emit-logger-file.js.map +1 -1
  43. package/dist/src/modular/emit-models-options.js +2 -2
  44. package/dist/src/modular/emit-models-options.js.map +1 -1
  45. package/dist/src/modular/emit-models.d.ts.map +1 -1
  46. package/dist/src/modular/emit-models.js +7 -22
  47. package/dist/src/modular/emit-models.js.map +1 -1
  48. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  49. package/dist/src/modular/emit-samples.js +10 -28
  50. package/dist/src/modular/emit-samples.js.map +1 -1
  51. package/dist/src/modular/emit-tests.d.ts +2 -1
  52. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  53. package/dist/src/modular/emit-tests.js +21 -11
  54. package/dist/src/modular/emit-tests.js.map +1 -1
  55. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  56. package/dist/src/modular/helpers/client-helpers.js +6 -16
  57. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  58. package/dist/src/modular/helpers/example-value-helpers.d.ts +1 -1
  59. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  60. package/dist/src/modular/helpers/example-value-helpers.js +11 -28
  61. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  62. package/dist/src/modular/serialization/serialize-utils.js +2 -2
  63. package/dist/src/modular/serialization/serialize-utils.js.map +1 -1
  64. package/dist/src/rlc-common/helpers/imports-util.d.ts +3 -4
  65. package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -1
  66. package/dist/src/rlc-common/helpers/imports-util.js +43 -56
  67. package/dist/src/rlc-common/helpers/imports-util.js.map +1 -1
  68. package/dist/src/rlc-common/helpers/name-constructors.d.ts +0 -9
  69. package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -1
  70. package/dist/src/rlc-common/helpers/name-constructors.js +1 -17
  71. package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -1
  72. package/dist/src/rlc-common/index.d.ts +0 -18
  73. package/dist/src/rlc-common/index.d.ts.map +1 -1
  74. package/dist/src/rlc-common/index.js +0 -18
  75. package/dist/src/rlc-common/index.js.map +1 -1
  76. package/dist/src/rlc-common/interfaces.d.ts +2 -20
  77. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  78. package/dist/src/rlc-common/interfaces.js.map +1 -1
  79. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +1 -1
  80. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -1
  81. package/dist/src/rlc-common/metadata/build-api-extractor-config.js +5 -42
  82. package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -1
  83. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +2 -2
  84. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -1
  85. package/dist/src/rlc-common/metadata/build-es-lint-config.js +3 -41
  86. package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -1
  87. package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -1
  88. package/dist/src/rlc-common/metadata/build-package-file.js +25 -73
  89. package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -1
  90. package/dist/src/rlc-common/metadata/build-readme-file.d.ts +2 -2
  91. package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -1
  92. package/dist/src/rlc-common/metadata/build-readme-file.js +18 -108
  93. package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -1
  94. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -1
  95. package/dist/src/rlc-common/metadata/build-sample-env-file.js +1 -2
  96. package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -1
  97. package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -1
  98. package/dist/src/rlc-common/metadata/build-test-config.js +1 -4
  99. package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -1
  100. package/dist/src/rlc-common/metadata/build-ts-config.d.ts +2 -2
  101. package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -1
  102. package/dist/src/rlc-common/metadata/build-ts-config.js +19 -60
  103. package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -1
  104. package/dist/src/rlc-common/metadata/build-warp-config.d.ts +1 -1
  105. package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -1
  106. package/dist/src/rlc-common/metadata/build-warp-config.js +0 -3
  107. package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -1
  108. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +1 -38
  109. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -1
  110. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +1 -108
  111. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -1
  112. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +0 -39
  113. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  114. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +4 -20
  115. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  116. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +1 -22
  117. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -1
  118. package/dist/src/rlc-common/metadata/package-json/package-common.js +21 -98
  119. package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -1
  120. package/dist/src/rlc-common/static/polling-content.d.ts +1 -1
  121. package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -1
  122. package/dist/src/rlc-common/static/polling-content.js +1 -1
  123. package/dist/src/rlc-common/test/build-recorded-client.d.ts +1 -1
  124. package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -1
  125. package/dist/src/rlc-common/test/build-recorded-client.js +2 -5
  126. package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -1
  127. package/dist/src/rlc-common/test/build-sample-test.d.ts +1 -1
  128. package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -1
  129. package/dist/src/rlc-common/test/build-sample-test.js +2 -5
  130. package/dist/src/rlc-common/test/build-sample-test.js.map +1 -1
  131. package/dist/src/rlc-common/test/build-snippets.d.ts +1 -1
  132. package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -1
  133. package/dist/src/rlc-common/test/build-snippets.js +2 -6
  134. package/dist/src/rlc-common/test/build-snippets.js.map +1 -1
  135. package/dist/src/rlc-common/test/template.d.ts +3 -3
  136. package/dist/src/rlc-common/test/template.d.ts.map +1 -1
  137. package/dist/src/rlc-common/test/template.js +1 -35
  138. package/dist/src/rlc-common/test/template.js.map +1 -1
  139. package/dist/src/transform/transform-helper-function-details.d.ts +2 -2
  140. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  141. package/dist/src/transform/transform-helper-function-details.js +1 -9
  142. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  143. package/dist/src/transform/transform-schemas.js +1 -1
  144. package/dist/src/transform/transform-schemas.js.map +1 -1
  145. package/dist/src/transform/transform.d.ts.map +1 -1
  146. package/dist/src/transform/transform.js +9 -16
  147. package/dist/src/transform/transform.js.map +1 -1
  148. package/dist/src/transform/transfrom-rlc-options.d.ts +2 -2
  149. package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -1
  150. package/dist/src/transform/transfrom-rlc-options.js +29 -94
  151. package/dist/src/transform/transfrom-rlc-options.js.map +1 -1
  152. package/dist/src/utils/client-utils.d.ts +1 -1
  153. package/dist/src/utils/client-utils.d.ts.map +1 -1
  154. package/dist/src/utils/client-utils.js +4 -5
  155. package/dist/src/utils/client-utils.js.map +1 -1
  156. package/dist/src/utils/emit-util.d.ts +0 -1
  157. package/dist/src/utils/emit-util.d.ts.map +1 -1
  158. package/dist/src/utils/emit-util.js +13 -24
  159. package/dist/src/utils/emit-util.js.map +1 -1
  160. package/dist/src/utils/file-system-utils.d.ts +4 -4
  161. package/dist/src/utils/file-system-utils.d.ts.map +1 -1
  162. package/dist/src/utils/file-system-utils.js +14 -16
  163. package/dist/src/utils/file-system-utils.js.map +1 -1
  164. package/dist/src/utils/import-helper.js +3 -3
  165. package/dist/src/utils/import-helper.js.map +1 -1
  166. package/dist/src/utils/model-utils.d.ts +1 -1
  167. package/dist/src/utils/model-utils.d.ts.map +1 -1
  168. package/dist/src/utils/model-utils.js +4 -11
  169. package/dist/src/utils/model-utils.js.map +1 -1
  170. package/dist/src/utils/resolve-project-root.d.ts +6 -4
  171. package/dist/src/utils/resolve-project-root.d.ts.map +1 -1
  172. package/dist/src/utils/resolve-project-root.js +11 -18
  173. package/dist/src/utils/resolve-project-root.js.map +1 -1
  174. package/dist/tsconfig.tsbuildinfo +1 -1
  175. package/package.json +44 -59
  176. package/src/framework/hooks/binder.ts +4 -5
  177. package/src/framework/hooks/sdk-types.ts +2 -3
  178. package/src/framework/load-static-helpers.ts +38 -41
  179. package/src/framework/sample.ts +1 -1
  180. package/src/index.ts +126 -204
  181. package/src/lib.ts +32 -143
  182. package/src/modular/build-classical-client.ts +2 -2
  183. package/src/modular/build-client-context.ts +6 -14
  184. package/src/modular/build-project-files.ts +11 -4
  185. package/src/modular/build-restore-poller.ts +2 -2
  186. package/src/modular/build-root-index.ts +9 -13
  187. package/src/modular/build-subpath-index.ts +4 -4
  188. package/src/modular/emit-logger-file.ts +0 -3
  189. package/src/modular/emit-models-options.ts +2 -2
  190. package/src/modular/emit-models.ts +7 -23
  191. package/src/modular/emit-samples.ts +10 -26
  192. package/src/modular/emit-tests.ts +28 -11
  193. package/src/modular/helpers/client-helpers.ts +7 -17
  194. package/src/modular/helpers/example-value-helpers.ts +11 -26
  195. package/src/modular/serialization/serialize-utils.ts +2 -2
  196. package/src/rlc-common/helpers/imports-util.ts +44 -56
  197. package/src/rlc-common/helpers/name-constructors.ts +1 -23
  198. package/src/rlc-common/index.ts +0 -18
  199. package/src/rlc-common/interfaces.ts +2 -23
  200. package/src/rlc-common/metadata/build-api-extractor-config.ts +5 -47
  201. package/src/rlc-common/metadata/build-es-lint-config.ts +3 -42
  202. package/src/rlc-common/metadata/build-package-file.ts +24 -86
  203. package/src/rlc-common/metadata/build-readme-file.ts +19 -121
  204. package/src/rlc-common/metadata/build-sample-env-file.ts +1 -4
  205. package/src/rlc-common/metadata/build-test-config.ts +1 -6
  206. package/src/rlc-common/metadata/build-ts-config.ts +30 -72
  207. package/src/rlc-common/metadata/build-warp-config.ts +0 -4
  208. package/src/rlc-common/metadata/package-json/azure-package-common.ts +2 -134
  209. package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +4 -24
  210. package/src/rlc-common/metadata/package-json/package-common.ts +22 -120
  211. package/src/rlc-common/static/polling-content.ts +1 -1
  212. package/src/rlc-common/test/build-recorded-client.ts +2 -5
  213. package/src/rlc-common/test/build-sample-test.ts +2 -5
  214. package/src/rlc-common/test/build-snippets.ts +2 -6
  215. package/src/rlc-common/test/template.ts +1 -35
  216. package/src/transform/transform-helper-function-details.ts +1 -10
  217. package/src/transform/transform-schemas.ts +1 -1
  218. package/src/transform/transform.ts +8 -19
  219. package/src/transform/transfrom-rlc-options.ts +29 -127
  220. package/src/utils/client-utils.ts +4 -5
  221. package/src/utils/emit-util.ts +14 -39
  222. package/src/utils/file-system-utils.ts +14 -15
  223. package/src/utils/import-helper.ts +3 -3
  224. package/src/utils/model-utils.ts +4 -17
  225. package/src/utils/resolve-project-root.ts +11 -24
  226. package/dist/src/rlc-common/build-client-definitions.d.ts +0 -6
  227. package/dist/src/rlc-common/build-client-definitions.d.ts.map +0 -1
  228. package/dist/src/rlc-common/build-client-definitions.js +0 -157
  229. package/dist/src/rlc-common/build-client-definitions.js.map +0 -1
  230. package/dist/src/rlc-common/build-client.d.ts +0 -9
  231. package/dist/src/rlc-common/build-client.d.ts.map +0 -1
  232. package/dist/src/rlc-common/build-client.js +0 -391
  233. package/dist/src/rlc-common/build-client.js.map +0 -1
  234. package/dist/src/rlc-common/build-index-file.d.ts +0 -6
  235. package/dist/src/rlc-common/build-index-file.d.ts.map +0 -1
  236. package/dist/src/rlc-common/build-index-file.js +0 -241
  237. package/dist/src/rlc-common/build-index-file.js.map +0 -1
  238. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +0 -6
  239. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +0 -1
  240. package/dist/src/rlc-common/build-is-unexpected-helper.js +0 -223
  241. package/dist/src/rlc-common/build-is-unexpected-helper.js.map +0 -1
  242. package/dist/src/rlc-common/build-logger.d.ts +0 -6
  243. package/dist/src/rlc-common/build-logger.d.ts.map +0 -1
  244. package/dist/src/rlc-common/build-logger.js +0 -31
  245. package/dist/src/rlc-common/build-logger.js.map +0 -1
  246. package/dist/src/rlc-common/build-method-shortcuts.d.ts +0 -5
  247. package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +0 -1
  248. package/dist/src/rlc-common/build-method-shortcuts.js +0 -54
  249. package/dist/src/rlc-common/build-method-shortcuts.js.map +0 -1
  250. package/dist/src/rlc-common/build-object-types.d.ts +0 -29
  251. package/dist/src/rlc-common/build-object-types.d.ts.map +0 -1
  252. package/dist/src/rlc-common/build-object-types.js +0 -412
  253. package/dist/src/rlc-common/build-object-types.js.map +0 -1
  254. package/dist/src/rlc-common/build-paginate-helper.d.ts +0 -6
  255. package/dist/src/rlc-common/build-paginate-helper.d.ts.map +0 -1
  256. package/dist/src/rlc-common/build-paginate-helper.js +0 -27
  257. package/dist/src/rlc-common/build-paginate-helper.js.map +0 -1
  258. package/dist/src/rlc-common/build-parameter-types.d.ts +0 -14
  259. package/dist/src/rlc-common/build-parameter-types.d.ts.map +0 -1
  260. package/dist/src/rlc-common/build-parameter-types.js +0 -391
  261. package/dist/src/rlc-common/build-parameter-types.js.map +0 -1
  262. package/dist/src/rlc-common/build-polling-helper.d.ts +0 -6
  263. package/dist/src/rlc-common/build-polling-helper.d.ts.map +0 -1
  264. package/dist/src/rlc-common/build-polling-helper.js +0 -61
  265. package/dist/src/rlc-common/build-polling-helper.js.map +0 -1
  266. package/dist/src/rlc-common/build-response-types.d.ts +0 -6
  267. package/dist/src/rlc-common/build-response-types.d.ts.map +0 -1
  268. package/dist/src/rlc-common/build-response-types.js +0 -143
  269. package/dist/src/rlc-common/build-response-types.js.map +0 -1
  270. package/dist/src/rlc-common/build-samples.d.ts +0 -3
  271. package/dist/src/rlc-common/build-samples.d.ts.map +0 -1
  272. package/dist/src/rlc-common/build-samples.js +0 -30
  273. package/dist/src/rlc-common/build-samples.js.map +0 -1
  274. package/dist/src/rlc-common/build-schema-type.d.ts +0 -20
  275. package/dist/src/rlc-common/build-schema-type.d.ts.map +0 -1
  276. package/dist/src/rlc-common/build-schema-type.js +0 -71
  277. package/dist/src/rlc-common/build-schema-type.js.map +0 -1
  278. package/dist/src/rlc-common/build-serialize-helper.d.ts +0 -6
  279. package/dist/src/rlc-common/build-serialize-helper.d.ts.map +0 -1
  280. package/dist/src/rlc-common/build-serialize-helper.js +0 -36
  281. package/dist/src/rlc-common/build-serialize-helper.js.map +0 -1
  282. package/dist/src/rlc-common/build-top-level-index-file.d.ts +0 -6
  283. package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +0 -1
  284. package/dist/src/rlc-common/build-top-level-index-file.js +0 -48
  285. package/dist/src/rlc-common/build-top-level-index-file.js.map +0 -1
  286. package/dist/src/rlc-common/helpers/package-util.d.ts +0 -7
  287. package/dist/src/rlc-common/helpers/package-util.d.ts.map +0 -1
  288. package/dist/src/rlc-common/helpers/package-util.js +0 -10
  289. package/dist/src/rlc-common/helpers/package-util.js.map +0 -1
  290. package/dist/src/rlc-common/helpers/path-utils.d.ts +0 -2
  291. package/dist/src/rlc-common/helpers/path-utils.d.ts.map +0 -1
  292. package/dist/src/rlc-common/helpers/path-utils.js +0 -10
  293. package/dist/src/rlc-common/helpers/path-utils.js.map +0 -1
  294. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +0 -4
  295. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +0 -1
  296. package/dist/src/rlc-common/helpers/shortcut-methods.js +0 -49
  297. package/dist/src/rlc-common/helpers/shortcut-methods.js.map +0 -1
  298. package/dist/src/rlc-common/helpers/value-generation-util.d.ts +0 -12
  299. package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +0 -1
  300. package/dist/src/rlc-common/helpers/value-generation-util.js +0 -161
  301. package/dist/src/rlc-common/helpers/value-generation-util.js.map +0 -1
  302. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +0 -6
  303. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +0 -1
  304. package/dist/src/rlc-common/metadata/build-rollup-config.js +0 -140
  305. package/dist/src/rlc-common/metadata/build-rollup-config.js.map +0 -1
  306. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +0 -8
  307. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +0 -1
  308. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +0 -101
  309. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +0 -1
  310. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +0 -57
  311. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +0 -1
  312. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +0 -53
  313. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +0 -1
  314. package/dist/src/rlc-common/transform-sample-groups.d.ts +0 -9
  315. package/dist/src/rlc-common/transform-sample-groups.d.ts.map +0 -1
  316. package/dist/src/rlc-common/transform-sample-groups.js +0 -313
  317. package/dist/src/rlc-common/transform-sample-groups.js.map +0 -1
  318. package/dist/src/utils/dirname.d.ts +0 -9
  319. package/dist/src/utils/dirname.d.ts.map +0 -1
  320. package/dist/src/utils/dirname.js +0 -12
  321. package/dist/src/utils/dirname.js.map +0 -1
  322. package/src/rlc-common/build-client-definitions.ts +0 -235
  323. package/src/rlc-common/build-client.ts +0 -490
  324. package/src/rlc-common/build-index-file.ts +0 -344
  325. package/src/rlc-common/build-is-unexpected-helper.ts +0 -248
  326. package/src/rlc-common/build-logger.ts +0 -43
  327. package/src/rlc-common/build-method-shortcuts.ts +0 -71
  328. package/src/rlc-common/build-object-types.ts +0 -603
  329. package/src/rlc-common/build-paginate-helper.ts +0 -31
  330. package/src/rlc-common/build-parameter-types.ts +0 -554
  331. package/src/rlc-common/build-polling-helper.ts +0 -83
  332. package/src/rlc-common/build-response-types.ts +0 -180
  333. package/src/rlc-common/build-samples.ts +0 -32
  334. package/src/rlc-common/build-schema-type.ts +0 -89
  335. package/src/rlc-common/build-serialize-helper.ts +0 -49
  336. package/src/rlc-common/build-top-level-index-file.ts +0 -58
  337. package/src/rlc-common/helpers/package-util.ts +0 -13
  338. package/src/rlc-common/helpers/path-utils.ts +0 -10
  339. package/src/rlc-common/helpers/shortcut-methods.ts +0 -58
  340. package/src/rlc-common/helpers/value-generation-util.ts +0 -234
  341. package/src/rlc-common/metadata/build-rollup-config.ts +0 -147
  342. package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +0 -123
  343. package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +0 -68
  344. package/src/rlc-common/transform-sample-groups.ts +0 -407
  345. package/src/utils/dirname.ts +0 -12
@@ -1,180 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import * as path from "path";
5
- import {
6
- InterfaceDeclarationStructure,
7
- OptionalKind,
8
- Project,
9
- PropertySignatureStructure,
10
- StructureKind,
11
- } from "ts-morph";
12
- import { getImportSpecifier } from "./helpers/imports-util.js";
13
- import {
14
- getImportModuleName,
15
- getResponseBaseName,
16
- getResponseTypeName,
17
- } from "./helpers/name-constructors.js";
18
- import { ResponseHeaderSchema, ResponseMetadata, RLCModel } from "./interfaces.js";
19
-
20
- let hasErrorResponse = false;
21
- export function buildResponseTypes(model: RLCModel) {
22
- const project = new Project();
23
- const srcPath = model.srcPath;
24
- const filePath = path.join(srcPath, `responses.ts`);
25
- hasErrorResponse = false;
26
- const responsesFile = project.createSourceFile(filePath, undefined, {
27
- overwrite: true,
28
- });
29
- // Set used to track down which models need to be imported
30
- // Track if we need to import RawHttpHeaders
31
- let hasHeaders = false;
32
- if (!model.responses) {
33
- return;
34
- }
35
- for (const operationResponse of model.responses) {
36
- for (const response of operationResponse.responses) {
37
- // Building the response type base name
38
- const baseResponseName = getResponseBaseName(
39
- operationResponse.operationGroup,
40
- operationResponse.operationName,
41
- response.statusCode,
42
- );
43
-
44
- // Build the response header
45
- const headersInterface: InterfaceDeclarationStructure | undefined =
46
- getResponseHeaderInterfaceDefinition(response, baseResponseName);
47
- if (headersInterface) {
48
- hasHeaders = true;
49
- responsesFile.addInterface(headersInterface);
50
- }
51
-
52
- // Get the information to build the Response Interface
53
- const responseTypeName = response.predefinedName ?? getResponseTypeName(baseResponseName);
54
- const responseProperties = getResponseInterfaceProperties(response, headersInterface?.name);
55
-
56
- const responseInterfaceDefinition: OptionalKind<InterfaceDeclarationStructure> = {
57
- name: responseTypeName,
58
- properties: responseProperties,
59
- isExported: true,
60
- extends: ["HttpResponse"],
61
- };
62
-
63
- // Only add a description if one was provided in the Swagger
64
- // otherwise skip to avoid having empty TSDoc lines
65
- if (response.description) {
66
- responseInterfaceDefinition.docs = [{ description: response.description }];
67
- }
68
-
69
- // Add the response interface to the responses file
70
- responsesFile.addInterface(responseInterfaceDefinition);
71
- }
72
- }
73
-
74
- if (hasHeaders) {
75
- responsesFile.addImportDeclarations([
76
- {
77
- isTypeOnly: true,
78
- namedImports: ["RawHttpHeaders"],
79
- moduleSpecifier: getImportSpecifier("restPipeline", model.importInfo.runtimeImports),
80
- },
81
- ]);
82
- }
83
- const namedImports = ["HttpResponse"];
84
- if (hasErrorResponse) {
85
- namedImports.push("ErrorResponse");
86
- }
87
- responsesFile.addImportDeclarations([
88
- {
89
- isTypeOnly: true,
90
- namedImports,
91
- moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
92
- },
93
- ]);
94
-
95
- if ((model.importInfo.internalImports.response?.importsSet?.size ?? 0) > 0) {
96
- const modelNamedImports = Array.from(
97
- model.importInfo.internalImports.response!.importsSet!,
98
- ).filter((modelName) => {
99
- return !(modelName === "ErrorResponseOutput" && hasErrorResponse);
100
- });
101
- responsesFile.addImportDeclarations([
102
- {
103
- isTypeOnly: true,
104
- namedImports: modelNamedImports,
105
- moduleSpecifier: getImportModuleName(
106
- {
107
- cjsName: `./outputModels`,
108
- esModulesName: `./outputModels.js`,
109
- },
110
- model,
111
- ),
112
- },
113
- ]);
114
- }
115
- return { path: filePath, content: responsesFile.getFullText() };
116
- }
117
-
118
- function getResponseHeaderInterfaceDefinition(
119
- response: ResponseMetadata,
120
- baseName: string,
121
- ): undefined | InterfaceDeclarationStructure {
122
- // Check if there are any required headers
123
- if (!response.headers) {
124
- return;
125
- }
126
- const headersInterfaceName = `${baseName}Headers`;
127
- return {
128
- kind: StructureKind.Interface,
129
- isExported: true,
130
- name: headersInterfaceName,
131
- properties: response?.headers.map((h: ResponseHeaderSchema) => {
132
- const description = h.description;
133
- return {
134
- name: h.name,
135
- ...(description && { docs: [{ description }] }),
136
- type: h.type,
137
- hasQuestionToken: !h.required,
138
- };
139
- }),
140
- };
141
- }
142
-
143
- /**
144
- * Gets the properties that need to be part of the response interface
145
- */
146
- function getResponseInterfaceProperties(response: ResponseMetadata, headersInterfaceName?: string) {
147
- const statusCode = response.statusCode;
148
- const responseProperties: PropertySignatureStructure[] = [
149
- {
150
- name: "status",
151
- type: statusCode === "default" ? `string` : `"${statusCode}"`,
152
- kind: StructureKind.PropertySignature,
153
- },
154
- ];
155
-
156
- if (response.body) {
157
- const description = response.body.description;
158
- let type = response.body.type;
159
- if (response.body.type === "ErrorResponseOutput" && response.body.fromCore) {
160
- type = "ErrorResponse";
161
- hasErrorResponse = true;
162
- }
163
- responseProperties.push({
164
- name: "body",
165
- type,
166
- kind: StructureKind.PropertySignature,
167
- ...(description && { docs: [{ description }] }),
168
- });
169
- }
170
-
171
- if (headersInterfaceName) {
172
- responseProperties.push({
173
- name: "headers",
174
- type: `RawHttpHeaders & ${headersInterfaceName}`,
175
- kind: StructureKind.PropertySignature,
176
- });
177
- }
178
-
179
- return responseProperties;
180
- }
@@ -1,32 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import { File as RLCFile, RLCModel, RLCSampleGroup } from "./interfaces.js";
5
- import { sampleTemplate } from "./static/sample-template.js";
6
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
7
- // @ts-ignore: to fix the handlebars issue
8
- import hbs from "handlebars";
9
- import * as path from "path";
10
-
11
- // Build sample files for the model based on the sample groups
12
- export function buildSamples(model: RLCModel) {
13
- if (!model.options || !model.options.packageDetails) {
14
- return;
15
- }
16
- const sampleGroups: RLCSampleGroup[] | undefined = model.sampleGroups;
17
- if (!sampleGroups || sampleGroups.length === 0) {
18
- return;
19
- }
20
- const sampleFiles: RLCFile[] = [];
21
- for (const sampleGroup of sampleGroups) {
22
- const sampleGroupFileContents = hbs.compile(sampleTemplate, {
23
- noEscape: true,
24
- });
25
- const filePath = path.join("samples-dev", `${sampleGroup.filename}.ts`);
26
- sampleFiles.push({
27
- path: filePath,
28
- content: sampleGroupFileContents(sampleGroup),
29
- });
30
- }
31
- return sampleFiles;
32
- }
@@ -1,89 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import * as path from "path";
5
- import { Project } from "ts-morph";
6
- import {
7
- buildObjectAliases,
8
- buildObjectInterfaces,
9
- buildPolymorphicAliases,
10
- } from "./build-object-types.js";
11
- import { getImportSpecifier } from "./helpers/imports-util.js";
12
- import { getImportModuleName } from "./helpers/name-constructors.js";
13
- import { RLCModel, SchemaContext } from "./interfaces.js";
14
-
15
- /**
16
- * Generates types to represent schema definitions in the swagger
17
- */
18
- export function buildSchemaTypes(model: RLCModel) {
19
- const { srcPath } = model;
20
- const project = new Project();
21
- let filePath = path.join(srcPath, `models.ts`);
22
- const inputModelFile = generateModelFiles(model, project, filePath, [SchemaContext.Input]);
23
- filePath = path.join(srcPath, `outputModels.ts`);
24
- const outputModelFile = generateModelFiles(model, project, filePath, [
25
- SchemaContext.Output,
26
- SchemaContext.Exception,
27
- ]);
28
- return { inputModelFile, outputModelFile };
29
- }
30
-
31
- export function generateModelFiles(
32
- model: RLCModel,
33
- project: Project,
34
- filePath: string,
35
- schemaContext: SchemaContext[],
36
- ) {
37
- // Track models that need to be imported
38
- const importedModels = new Set<string>();
39
- const objectsDefinitions = buildObjectInterfaces(model, importedModels, schemaContext);
40
-
41
- const objectTypeAliases = buildPolymorphicAliases(model, schemaContext);
42
-
43
- const objectAliases = buildObjectAliases(model, importedModels, schemaContext);
44
-
45
- if (objectTypeAliases.length || objectsDefinitions.length || objectAliases.length) {
46
- const modelsFile = project.createSourceFile(filePath, undefined, {
47
- overwrite: true,
48
- });
49
-
50
- modelsFile.addInterfaces(objectsDefinitions);
51
- modelsFile.addTypeAliases(objectTypeAliases);
52
- modelsFile.addTypeAliases(objectAliases);
53
- if (importedModels.size > 0) {
54
- modelsFile.addImportDeclarations([
55
- {
56
- isTypeOnly: true,
57
- namedImports: [...Array.from(importedModels || [])],
58
- moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
59
- },
60
- ]);
61
- }
62
- // Add NodeReadableStream import if binary types are used in models.
63
- // platform-types.ts is generated directly under src/ (no static-helpers/
64
- // subdirectory) to match the RLC design where all output lives in src/.
65
- // The platform-types static helper resolves NodeReadableStream to
66
- // NodeJS.ReadableStream on Node and `never` on browser/react-native, so the
67
- // union arm drops out naturally in non-Node builds.
68
- if (modelsFile.getFullText().includes("NodeReadableStream")) {
69
- const platformTypesModuleSpecifier = model.options?.azureSdkForJs
70
- ? "#platform/platform-types"
71
- : getImportModuleName(
72
- {
73
- cjsName: `./platform-types`,
74
- esModulesName: `./platform-types.js`,
75
- },
76
- model,
77
- );
78
- modelsFile.addImportDeclarations([
79
- {
80
- isTypeOnly: true,
81
- namedImports: ["NodeReadableStream"],
82
- moduleSpecifier: platformTypesModuleSpecifier,
83
- },
84
- ]);
85
- }
86
- return { path: filePath, content: modelsFile.getFullText() };
87
- }
88
- return undefined;
89
- }
@@ -1,49 +0,0 @@
1
- import * as path from "path";
2
- import { RLCModel } from "./interfaces.js";
3
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
- // @ts-ignore: to fix the handlebars issue
5
- import hbs from "handlebars";
6
- import {
7
- hasCsvCollection,
8
- hasMultiCollection,
9
- hasPipeCollection,
10
- hasSsvCollection,
11
- hasTsvCollection,
12
- } from "./helpers/operation-helpers.js";
13
- import {
14
- buildCsvCollectionContent,
15
- buildMultiCollectionContent,
16
- buildPipeCollectionContent,
17
- buildSsvCollectionContent,
18
- buildTsvCollectionContent,
19
- } from "./static/serialize-helper.js";
20
-
21
- export function buildSerializeHelper(model: RLCModel) {
22
- let serializeHelperContent = "";
23
- if (hasMultiCollection(model)) {
24
- serializeHelperContent += "\n" + buildMultiCollectionContent;
25
- }
26
- if (hasPipeCollection(model)) {
27
- serializeHelperContent += "\n" + buildPipeCollectionContent;
28
- }
29
- if (hasSsvCollection(model)) {
30
- serializeHelperContent += "\n" + buildSsvCollectionContent;
31
- }
32
- if (hasTsvCollection(model)) {
33
- serializeHelperContent += "\n" + buildTsvCollectionContent;
34
- }
35
- if (hasCsvCollection(model)) {
36
- serializeHelperContent += "\n" + buildCsvCollectionContent;
37
- }
38
- if (serializeHelperContent !== "") {
39
- const readmeFileContents = hbs.compile(serializeHelperContent, {
40
- noEscape: true,
41
- });
42
- const { srcPath } = model;
43
- return {
44
- path: path.join(srcPath, "serializeHelper.ts"),
45
- content: readmeFileContents({}),
46
- };
47
- }
48
- return undefined;
49
- }
@@ -1,58 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import * as path from "path";
5
- import { Project } from "ts-morph";
6
- import { getImportModuleName } from "./helpers/name-constructors.js";
7
- import { NameType, normalizeName } from "./helpers/name-utils.js";
8
- import { getRelativePartFromSrcPath } from "./helpers/path-utils.js";
9
- import { RLCModel } from "./interfaces.js";
10
-
11
- const batchOutputFolder: [string, string, string][] = [];
12
-
13
- export function buildTopLevelIndex(model: RLCModel) {
14
- if (!model.options) {
15
- return undefined;
16
- }
17
- const project = new Project();
18
- const { srcPath } = model;
19
- const { multiClient } = model.options;
20
- const batch = model.options.batch;
21
- if (srcPath) {
22
- const clientName = model.libraryName;
23
- const moduleName = normalizeName(clientName, NameType.File);
24
- const relativePath = "./" + getRelativePartFromSrcPath(srcPath, model.options.isModularLibrary);
25
- batchOutputFolder.push([relativePath, clientName, moduleName]);
26
- }
27
- if (multiClient && batch && batch.length > 1 && batchOutputFolder.length === batch.length) {
28
- const indexFile = project.createSourceFile("index.ts", undefined, {
29
- overwrite: true,
30
- });
31
- const allModules: string[] = [];
32
- batchOutputFolder.forEach((item) => {
33
- indexFile.addImportDeclaration({
34
- isTypeOnly: true,
35
- namespaceImport: item[1],
36
- moduleSpecifier: getImportModuleName(
37
- {
38
- cjsName: `${item[0]}`,
39
- esModulesName: `${item[0]}/index.js`,
40
- },
41
- model,
42
- ),
43
- });
44
- allModules.push(item[1]);
45
- });
46
- indexFile.addExportDeclaration({
47
- namedExports: [...allModules],
48
- });
49
- const content = indexFile.getFullText();
50
- const filePath = path.join(
51
- srcPath.substring(0, srcPath.lastIndexOf("src") + 4),
52
- model.options.isModularLibrary ? "rest" : "",
53
- `index.ts`,
54
- );
55
- return { path: filePath, content };
56
- }
57
- return undefined;
58
- }
@@ -1,13 +0,0 @@
1
- import { RLCModel, RLCOptions } from "../interfaces.js";
2
-
3
- export function isAzurePackage(model: { options?: RLCOptions }): boolean {
4
- return Boolean(model.options?.flavor === "azure");
5
- }
6
-
7
- export function isAzureMonorepoPackage(model: RLCModel): boolean {
8
- return Boolean(model.options?.azureSdkForJs) && isAzurePackage(model);
9
- }
10
-
11
- export function isAzureStandalonePackage(model: RLCModel): boolean {
12
- return isAzurePackage(model) && !model.options?.azureSdkForJs;
13
- }
@@ -1,10 +0,0 @@
1
- import * as path from "path";
2
-
3
- export function getRelativePartFromSrcPath(srcPath: string, isModularLibrary: boolean = false) {
4
- const sep = srcPath.includes(path.sep + "src") ? path.sep : "/";
5
- let relativePart = srcPath.substring(srcPath.indexOf(sep + "src") + 4);
6
- if (isModularLibrary) {
7
- relativePart = relativePart.substring(srcPath.indexOf(sep + "rest"), +5);
8
- }
9
- return relativePart.startsWith(sep) ? relativePart.substring(1) : relativePart;
10
- }
@@ -1,58 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import { InterfaceDeclarationStructure, MethodSignatureStructure, OptionalKind } from "ts-morph";
5
- import { PathMetadata, Paths } from "../interfaces.js";
6
- import { NameType, normalizeName } from "./name-utils.js";
7
- import { buildMethodDefinitions } from "./operation-helpers.js";
8
-
9
- export function generateMethodShortcuts(
10
- paths: Paths,
11
- ): OptionalKind<InterfaceDeclarationStructure>[] {
12
- const keys: Record<string, OptionalKind<MethodSignatureStructure>[]> = {};
13
- for (const path in paths) {
14
- const pathMetadata = paths[path];
15
- if (!pathMetadata) {
16
- continue;
17
- }
18
- const groupName = pathMetadata.operationGroupName;
19
- const definitions = buildOperationDefinitions(pathMetadata);
20
- if (!keys[groupName]) {
21
- keys[groupName] = definitions;
22
- } else {
23
- keys[groupName] = [...keys[groupName], ...definitions];
24
- }
25
- }
26
-
27
- const interfaces: OptionalKind<InterfaceDeclarationStructure>[] = [];
28
-
29
- for (const interfaceName in keys) {
30
- const methods = keys[interfaceName];
31
- interfaces.push({
32
- name: `${interfaceName}Operations`,
33
- methods: methods,
34
- isExported: true,
35
- docs: [`Contains operations for ${interfaceName} operations`],
36
- });
37
- }
38
-
39
- return interfaces;
40
- }
41
-
42
- function buildOperationDefinitions(path: PathMetadata): OptionalKind<MethodSignatureStructure>[] {
43
- let ops: OptionalKind<MethodSignatureStructure>[] = [];
44
-
45
- for (const verb in path.methods) {
46
- const methods = path.methods[verb];
47
- if (!methods) {
48
- continue;
49
- }
50
- for (const method of methods) {
51
- const name = normalizeName(method.operationName, NameType.Property);
52
- const pathParams = path.pathParameters;
53
- const methodDefinitions = buildMethodDefinitions({ [name]: [method] }, pathParams);
54
- ops = [...ops, ...methodDefinitions];
55
- }
56
- }
57
- return ops;
58
- }