@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,603 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
-
4
- import {
5
- InterfaceDeclarationStructure,
6
- OptionalKind,
7
- PropertySignatureStructure,
8
- StructureKind,
9
- TypeAliasDeclarationStructure,
10
- } from "ts-morph";
11
- import { getMultipartPartTypeName } from "./helpers/name-constructors.js";
12
- import { NameType, normalizeName } from "./helpers/name-utils.js";
13
- import { isArraySchema, isDictionarySchema, isObjectSchema } from "./helpers/schema-helpers.js";
14
- import {
15
- ArraySchema,
16
- ObjectSchema,
17
- Parameter,
18
- Property,
19
- RLCModel,
20
- Schema,
21
- SchemaContext,
22
- } from "./interfaces.js";
23
-
24
- /**
25
- * Generates interfaces for ObjectSchemas
26
- */
27
- export function buildObjectInterfaces(
28
- model: RLCModel,
29
- importedModels: Set<string>,
30
- schemaUsage: SchemaContext[],
31
- ): InterfaceDeclarationStructure[] {
32
- const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
33
- (o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
34
- );
35
- const objectInterfaces: InterfaceDeclarationStructure[] = [];
36
-
37
- for (const objectSchema of objectSchemas) {
38
- if (objectSchema.alias || objectSchema.outputAlias || objectSchema.fromCore) {
39
- continue;
40
- }
41
-
42
- // FIXME: disabling new multipart generation for modular while we figure out the story
43
- if (objectSchema.isMultipartBody && !model.options?.isModularLibrary) {
44
- objectInterfaces.push(
45
- ...buildMultipartPartDefinitions(objectSchema, importedModels, schemaUsage),
46
- );
47
- continue;
48
- }
49
-
50
- const baseName = getObjectBaseName(objectSchema, schemaUsage);
51
- const interfaceDeclaration = getObjectInterfaceDeclaration(
52
- model,
53
- baseName,
54
- objectSchema,
55
- schemaUsage,
56
- importedModels,
57
- );
58
-
59
- objectInterfaces.push(interfaceDeclaration);
60
- }
61
- return objectInterfaces;
62
- }
63
-
64
- const MULTIPART_FILE_METADATA_PROPERTIES: OptionalKind<PropertySignatureStructure>[] = [
65
- {
66
- name: "filename",
67
- hasQuestionToken: true,
68
- type: "string",
69
- },
70
- {
71
- name: "contentType",
72
- hasQuestionToken: true,
73
- type: "string",
74
- },
75
- ];
76
-
77
- function buildMultipartPartDefinitions(
78
- schema: ObjectSchema,
79
- importedModels: Set<string>,
80
- schemaUsage: SchemaContext[],
81
- ): InterfaceDeclarationStructure[] {
82
- if (!schema.isMultipartBody) {
83
- return [];
84
- }
85
-
86
- // Transform property signatures into individual models
87
- const propertySignatures = getPropertySignatures(
88
- schema.properties ?? {},
89
- schemaUsage,
90
- importedModels,
91
- { flattenBinaryArrays: true },
92
- );
93
-
94
- const structures: InterfaceDeclarationStructure[] = [];
95
-
96
- for (const signature of propertySignatures) {
97
- const name = signature.name;
98
- const propertySchema = schema.properties?.[name];
99
- const typeName = getMultipartPartTypeName(schema.name, name);
100
-
101
- const isFileUpload = signature.type?.toString().includes("File") ?? false;
102
-
103
- const additionalProperties: any[] = [];
104
-
105
- if ((propertySchema as any).multipartOptions) {
106
- const multipartOptions: any = (propertySchema as any).multipartOptions;
107
- if (multipartOptions.filenameSchema) {
108
- additionalProperties.push(
109
- getPropertySignature(
110
- { name: "filename", ...multipartOptions.filenameSchema },
111
- [SchemaContext.Input],
112
- importedModels,
113
- ),
114
- );
115
- }
116
- if (multipartOptions.contentTypeSchema) {
117
- additionalProperties.push(
118
- getPropertySignature(
119
- { name: "contentType", ...multipartOptions.contentTypeSchema },
120
- [SchemaContext.Input],
121
- importedModels,
122
- ),
123
- );
124
- }
125
- } else if (isFileUpload) {
126
- // default additional file metadata properties (legacy)
127
- additionalProperties.push(...MULTIPART_FILE_METADATA_PROPERTIES);
128
- }
129
-
130
- structures.push({
131
- kind: StructureKind.Interface,
132
- isExported: true,
133
- name: typeName,
134
- properties: [
135
- {
136
- name: "name",
137
- type: name,
138
- },
139
- {
140
- name: "body",
141
- type: signature.type,
142
- },
143
- ...additionalProperties,
144
- ],
145
- });
146
- }
147
-
148
- return structures;
149
- }
150
-
151
- export function buildObjectAliases(
152
- model: RLCModel,
153
- importedModels: Set<string>,
154
- schemaUsage: SchemaContext[],
155
- ) {
156
- const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
157
- (o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
158
- );
159
- const objectAliases: TypeAliasDeclarationStructure[] = [];
160
-
161
- for (const objectSchema of objectSchemas) {
162
- // FIXME: disabling new multipart generation for modular while we figure out the story
163
- if (objectSchema.isMultipartBody && !model.options?.isModularLibrary) {
164
- const propertySignatures = getPropertySignatures(
165
- objectSchema.properties ?? {},
166
- schemaUsage,
167
- importedModels,
168
- { flattenBinaryArrays: true },
169
- );
170
-
171
- const objectTypeNames = propertySignatures.map((sig) =>
172
- getMultipartPartTypeName(objectSchema.name, sig.name),
173
- );
174
-
175
- objectAliases.push({
176
- kind: StructureKind.TypeAlias,
177
- ...(objectSchema.description && {
178
- docs: [{ description: objectSchema.description }],
179
- }),
180
- name: objectSchema.typeName!,
181
- type: `FormData | Array<${objectTypeNames.join("|") || "unknown"}>`,
182
- isExported: true,
183
- });
184
- }
185
-
186
- if (objectSchema.alias || objectSchema.outputAlias) {
187
- const description = objectSchema.description;
188
- const modelName = schemaUsage.includes(SchemaContext.Input)
189
- ? `${objectSchema.typeName}`
190
- : `${objectSchema.outputTypeName}`;
191
- objectAliases.push({
192
- kind: StructureKind.TypeAlias,
193
- ...(description && { docs: [{ description }] }),
194
- name: modelName,
195
- type: schemaUsage.includes(SchemaContext.Input)
196
- ? `${objectSchema.alias}`
197
- : `${objectSchema.outputAlias}`,
198
- isExported: true,
199
- docs: [description ?? "Alias for " + modelName],
200
- });
201
- }
202
- }
203
- return objectAliases;
204
- }
205
-
206
- export function buildPolymorphicAliases(model: RLCModel, schemaUsage: SchemaContext[]) {
207
- // We'll add aliases for polymorphic objects
208
- const objectAliases: TypeAliasDeclarationStructure[] = [];
209
- const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
210
- (o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
211
- );
212
- for (const objectSchema of objectSchemas) {
213
- const baseName = getObjectBaseName(objectSchema, schemaUsage);
214
- const typeAlias = getPolymorphicTypeAlias(baseName, objectSchema, schemaUsage);
215
- if (typeAlias) {
216
- objectAliases.push(typeAlias);
217
- }
218
- }
219
-
220
- return objectAliases;
221
- }
222
-
223
- /**
224
- * Gets a base name for an object schema this is tipically used with suffixes when building interface or type names
225
- */
226
- function getObjectBaseName(objectSchema: ObjectSchema, schemaUsage: SchemaContext[]) {
227
- const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
228
- const name = normalizeName(objectSchema.name, NameType.Interface, true /** guard name */);
229
-
230
- return `${name}${nameSuffix}`;
231
- }
232
-
233
- /**
234
- * If the current object is a Polymorphic parent, we need to create
235
- * a type alias with the union of its children to enable polymorphism
236
- */
237
- function getPolymorphicTypeAlias(
238
- baseName: string,
239
- objectSchema: ObjectSchema,
240
- schemaUsage: SchemaContext[],
241
- ): TypeAliasDeclarationStructure | undefined {
242
- if (!isPolymorphicParent(objectSchema)) {
243
- return undefined;
244
- }
245
-
246
- const unionTypes: string[] = [];
247
-
248
- // If the object itself has a discriminatorValue add its base to the union
249
- if (objectSchema.discriminatorValue) {
250
- unionTypes.push(`${baseName}Parent`);
251
- }
252
-
253
- for (const child of objectSchema.children?.all ?? []) {
254
- const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
255
- const name = normalizeName(child.name, NameType.Interface, true /** shouldGuard */);
256
-
257
- unionTypes.push(`${name}${nameSuffix}`);
258
- }
259
-
260
- const description = objectSchema.description;
261
-
262
- return {
263
- kind: StructureKind.TypeAlias,
264
- ...(description && { docs: [{ description }] }),
265
- name: `${baseName}`,
266
- type: unionTypes.join(" | "),
267
- isExported: true,
268
- };
269
- }
270
-
271
- /**
272
- * Builds the interface for the current object schema. If it is a polymorphic
273
- * root node it will suffix it with Base.
274
- */
275
- export function getObjectInterfaceDeclaration(
276
- model: RLCModel,
277
- baseName: string,
278
- objectSchema: ObjectSchema,
279
- schemaUsage: SchemaContext[],
280
- importedModels: Set<string>,
281
- ): InterfaceDeclarationStructure {
282
- let interfaceName = `${baseName}`;
283
- if (isPolymorphicParent(objectSchema)) {
284
- interfaceName = `${baseName}Parent`;
285
- }
286
-
287
- const properties = objectSchema.properties ?? {};
288
-
289
- let propertySignatures = getPropertySignatures(properties, schemaUsage, importedModels);
290
-
291
- // Add the polymorphic property if exists
292
- propertySignatures = addDiscriminatorProperty(
293
- model,
294
- objectSchema,
295
- propertySignatures,
296
- schemaUsage,
297
- );
298
-
299
- // Calculate the parents of the current object
300
- const extendFrom = getImmediateParentsNames(objectSchema, schemaUsage);
301
-
302
- const description = objectSchema.description;
303
- return {
304
- kind: StructureKind.Interface,
305
- ...(description && { docs: [{ description }] }),
306
- name: interfaceName,
307
- isExported: true,
308
- properties: propertySignatures,
309
- ...(extendFrom && { extends: extendFrom }),
310
- };
311
- }
312
-
313
- function isPolymorphicParent(objectSchema: ObjectSchema) {
314
- return objectSchema.isPolyParent ? true : false;
315
- }
316
-
317
- function addDiscriminatorProperty(
318
- model: RLCModel,
319
- objectSchema: ObjectSchema,
320
- properties: PropertySignatureStructure[],
321
- schemaUsage: SchemaContext[],
322
- ): PropertySignatureStructure[] {
323
- const polymorphicProperty = getDiscriminatorProperty(model, objectSchema, schemaUsage);
324
-
325
- if (polymorphicProperty) {
326
- // It is possible that the polymorphic property needs to override an existing property.
327
- // This is usually the case on the top level parent where the property already has a type of string
328
- // we need to replace it with the polymorphic values of its children
329
- const filteredProperties = properties.filter((p) => p.name !== polymorphicProperty.name);
330
- return [...filteredProperties, polymorphicProperty];
331
- }
332
-
333
- return properties;
334
- }
335
-
336
- /**
337
- * Finds the name of the property used as discriminator and the discriminator value.
338
- */
339
- function getDiscriminatorProperty(
340
- model: RLCModel,
341
- objectSchema: ObjectSchema,
342
- schemaUsage: SchemaContext[],
343
- ): PropertySignatureStructure | undefined {
344
- const discriminatorValue = objectSchema.discriminatorValue;
345
- if (!discriminatorValue && !objectSchema.discriminator) {
346
- return undefined;
347
- }
348
-
349
- const discriminators = getDiscriminatorValue(objectSchema);
350
- const discriminatorPropertyName = getDiscriminatorPropertyName(objectSchema);
351
-
352
- if (discriminators) {
353
- if (discriminatorPropertyName === undefined) {
354
- throw new Error(
355
- `getDiscriminatorProperty: Expected object ${objectSchema.name} to have a discriminator in its hierarchy but found none`,
356
- );
357
- }
358
- const inputTypeName = objectSchema.discriminator?.typeName ?? objectSchema.discriminator?.type;
359
- return {
360
- kind: StructureKind.PropertySignature,
361
- name: `"${discriminatorPropertyName}"`,
362
- type:
363
- model.options?.sourceFrom === "Swagger"
364
- ? discriminators
365
- : schemaUsage.includes(SchemaContext.Output)
366
- ? (objectSchema.discriminator?.outputTypeName ?? inputTypeName)
367
- : inputTypeName,
368
- };
369
- }
370
-
371
- return undefined;
372
- }
373
-
374
- /**
375
- * Finds the closest discriminator property
376
- */
377
- function getDiscriminatorPropertyName(objectSchema: ObjectSchema) {
378
- if (objectSchema.discriminator !== undefined) {
379
- return objectSchema.discriminator.name;
380
- }
381
-
382
- const allParents = objectSchema.parents?.all ?? [];
383
-
384
- for (const parent of allParents) {
385
- if (isObjectSchema(parent) && parent.discriminator) {
386
- return parent.discriminator.name;
387
- }
388
- }
389
- return undefined;
390
- }
391
-
392
- /**
393
- * Calculates the discriminator values that a given object needs
394
- */
395
- function getDiscriminatorValue(objectSchema: ObjectSchema): string | undefined {
396
- const discriminatorValue = objectSchema.discriminatorValue
397
- ? objectSchema.discriminatorValue
398
- : objectSchema.discriminator
399
- ? objectSchema.name
400
- : undefined;
401
- const children = objectSchema.children?.immediate ?? [];
402
-
403
- // If the current object has a discriminatorValue but doesn't have any children
404
- // it is a leaf node and the only discriminator value needed is itself
405
- if (discriminatorValue && !children.length) {
406
- return `"${discriminatorValue}"`;
407
- }
408
-
409
- // when the current object has both discriminator and discriminatorValue
410
- if (children) {
411
- const discriminatorProperty = objectSchema.discriminator;
412
- // Even when there are children, if no discriminatorProperty is present this is a leaf in the polymorphism tree
413
- if (!discriminatorProperty) {
414
- return `"${discriminatorValue}"`;
415
- }
416
-
417
- // the current object has discriminated children we need to find all the discriminatorValues for each of its children
418
- const allChildren = objectSchema.children?.all ?? [];
419
-
420
- // Top level parents may not have a discriminator of their own.
421
- const selfDiscriminator = discriminatorValue ? [`"${discriminatorValue}"`] : [];
422
-
423
- const childValues = getChildDiscriminatorValues(allChildren).map((v) => `"${v}"`);
424
-
425
- return [...selfDiscriminator, ...childValues].join(" | ");
426
- }
427
-
428
- return undefined;
429
- }
430
-
431
- /**
432
- * Looks into the children and grabs all possible discriminatorValues
433
- */
434
- function getChildDiscriminatorValues(children: ObjectSchema[]): string[] {
435
- const discriminatorValues = new Set<string>();
436
- for (const child of children) {
437
- if (isObjectSchema(child) && child.discriminatorValue) {
438
- discriminatorValues.add(child.discriminatorValue);
439
- }
440
- }
441
-
442
- return [...discriminatorValues];
443
- }
444
-
445
- /**
446
- * Gets a list of types a given object may extend from
447
- */
448
- export function getImmediateParentsNames(
449
- objectSchema: ObjectSchema,
450
- schemaUsage: SchemaContext[],
451
- ): string[] {
452
- if (!objectSchema.parents?.immediate) {
453
- return [];
454
- }
455
-
456
- const extendFrom: string[] = [];
457
-
458
- // If an immediate parent is an empty DictionarySchema, that means that the object has been marked
459
- // with additional properties. We need to add Record<string, unknown> to the extend list and
460
- if (objectSchema.parents.immediate.find((im) => isDictionarySchema(im, { filterEmpty: true }))) {
461
- extendFrom.push("Record<string, unknown>");
462
- }
463
-
464
- // Get the rest of the parents excluding any DictionarySchemas
465
- const parents = objectSchema.parents.immediate
466
- .filter((p) => !isDictionarySchema(p, { filterEmpty: true }))
467
- .map((parent) => {
468
- const nameSuffix = schemaUsage.includes(SchemaContext.Output) ? "Output" : "";
469
- const name = isDictionarySchema(parent)
470
- ? Object.entries(objectSchema.properties!)?.some((prop) => {
471
- const typeName = prop[1].typeName ?? prop[1].type;
472
- return (
473
- `Record<string, ${typeName}>` !== parent.typeName &&
474
- !(parent as any).additionalProperties?.typeName?.includes(typeName)
475
- );
476
- })
477
- ? schemaUsage.includes(SchemaContext.Output)
478
- ? "Record<string, any>"
479
- : "Record<string, unknown>"
480
- : `${
481
- (schemaUsage.includes(SchemaContext.Output)
482
- ? parent.outputTypeName
483
- : parent.typeName) ?? parent.name
484
- }`
485
- : `${normalizeName(parent.name, NameType.Interface, true /** shouldGuard */)}${nameSuffix}`;
486
-
487
- return isObjectSchema(parent) && isPolymorphicParent(parent) ? `${name}Parent` : name;
488
- });
489
-
490
- return [...parents, ...extendFrom];
491
- }
492
-
493
- interface GetPropertySignatureOptions {
494
- flattenBinaryArrays?: boolean;
495
- }
496
-
497
- function getPropertySignatures(
498
- properties: { [key: string]: Property },
499
- schemaUsage: SchemaContext[],
500
- importedModels: Set<string>,
501
- options: GetPropertySignatureOptions = {},
502
- ) {
503
- let validProperties = Object.keys(properties);
504
- const readOnlyFilter = (name: string) => {
505
- const prop = properties[name];
506
- return !(schemaUsage.includes(SchemaContext.Input) && prop?.readOnly);
507
- };
508
- const neverFilter = (name: string) => {
509
- const prop = properties[name];
510
- return prop?.type !== "never";
511
- };
512
- validProperties = validProperties.filter(readOnlyFilter).filter(neverFilter);
513
- return validProperties.map((p) => {
514
- const prop = properties[p];
515
- if (!prop) {
516
- throw new Error(`Property '${p}' not found`);
517
- }
518
- return getPropertySignature(
519
- { ...prop, name: p } as Schema,
520
- schemaUsage,
521
- importedModels,
522
- options,
523
- );
524
- });
525
- }
526
-
527
- function isBinaryArray(schema: Schema): boolean {
528
- return Boolean(
529
- isArraySchema(schema) &&
530
- (schema.items?.typeName?.includes("NodeReadableStream") ||
531
- schema.items?.outputTypeName?.includes("NodeReadableStream")),
532
- );
533
- }
534
-
535
- /**
536
- * Builds a Typescript property or parameter signature
537
- * @param schema - Property or parameter to get the Typescript signature for
538
- * @param importedModels - Set to track the models that need to be imported
539
- * @returns a PropertySignatureStructure for the property.
540
- */
541
- export function getPropertySignature(
542
- property: Property | Parameter,
543
- schemaUsage: SchemaContext[],
544
- importedModels: Set<string>,
545
- options: GetPropertySignatureOptions = {},
546
- ): PropertySignatureStructure {
547
- let schema: Schema;
548
- if (options.flattenBinaryArrays && isBinaryArray(property)) {
549
- schema = {
550
- ...((property as ArraySchema).items ?? property),
551
- name: property.name,
552
- };
553
- } else {
554
- schema = property;
555
- }
556
-
557
- const propertyName = schema.name;
558
- const description = schema.description;
559
- let type;
560
- const hasCoreInArray =
561
- schema.type === "array" && (schema as any).items && (schema as any).items.fromCore;
562
- const hasCoreInRecord =
563
- schema.type === "dictionary" &&
564
- (schema as any).additionalProperties &&
565
- (schema as any).additionalProperties.fromCore;
566
- if (hasCoreInArray && schema.typeName) {
567
- type = schema.typeName;
568
- importedModels.add((schema as any).items.typeName ?? (schema as any).items.name);
569
- } else if (hasCoreInRecord && schema.typeName) {
570
- type = schema.typeName;
571
- importedModels.add(
572
- (schema as any).additionalProperties.typeName ?? (schema as any).additionalProperties.name,
573
- );
574
- } else {
575
- type =
576
- generateForOutput(schemaUsage, schema.usage) && schema.outputTypeName
577
- ? schema.outputTypeName
578
- : schema.typeName
579
- ? schema.typeName
580
- : schema.type;
581
- if (schema.typeName && schema.fromCore) {
582
- importedModels.add(schema.typeName);
583
- type = schema.typeName;
584
- }
585
- }
586
-
587
- return {
588
- name: propertyName,
589
- ...(description && { docs: [{ description }] }),
590
- hasQuestionToken: !schema.required,
591
- isReadonly: generateForOutput(schemaUsage, schema.usage) && schema.readOnly,
592
- type,
593
- kind: StructureKind.PropertySignature,
594
- };
595
- }
596
-
597
- function generateForOutput(schemaUsage: SchemaContext[], propertyUsage?: SchemaContext[]) {
598
- return (
599
- (schemaUsage.includes(SchemaContext.Output) && propertyUsage?.includes(SchemaContext.Output)) ||
600
- (schemaUsage.includes(SchemaContext.Exception) &&
601
- propertyUsage?.includes(SchemaContext.Exception))
602
- );
603
- }
@@ -1,31 +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 { paginateContent } from "./static/paginate-content.js";
7
-
8
- export function buildPaginateHelper(model: RLCModel) {
9
- const pagingInfo = model.helperDetails;
10
- // return directly if no paging info
11
- if (!pagingInfo || pagingInfo.hasPaging !== true || !pagingInfo.pageDetails) {
12
- return;
13
- }
14
-
15
- hbs.registerHelper("quoteWrap", function (value: string | number | boolean | string[]) {
16
- if (Array.isArray(value)) {
17
- return value.map((element) => `"${element}"`).join();
18
- }
19
-
20
- return `"${value}"`;
21
- });
22
-
23
- const { srcPath } = model;
24
- const paginateHelperContents = hbs.compile(paginateContent, {
25
- noEscape: true,
26
- });
27
- return {
28
- path: path.join(srcPath, "paginateHelper.ts"),
29
- content: paginateHelperContents(pagingInfo.pageDetails),
30
- };
31
- }