@azure-tools/typespec-ts 0.54.0 → 0.54.2

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 (1116) hide show
  1. package/CHANGELOG.md +34 -10
  2. package/README.md +0 -4
  3. package/dist/src/context-manager.d.ts +75 -0
  4. package/dist/src/context-manager.d.ts.map +1 -0
  5. package/dist/src/context-manager.js +59 -0
  6. package/dist/src/context-manager.js.map +1 -0
  7. package/dist/src/framework/declaration.d.ts +1 -1
  8. package/dist/src/framework/declaration.d.ts.map +1 -1
  9. package/dist/src/framework/declaration.js +2 -4
  10. package/dist/src/framework/declaration.js.map +1 -1
  11. package/dist/src/framework/dependency.d.ts.map +1 -1
  12. package/dist/src/framework/hooks/binder.d.ts +1 -1
  13. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  14. package/dist/src/framework/hooks/binder.js +32 -41
  15. package/dist/src/framework/hooks/binder.js.map +1 -1
  16. package/dist/src/framework/hooks/sdk-types.d.ts +27 -0
  17. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -0
  18. package/dist/src/framework/hooks/sdk-types.js +158 -0
  19. package/dist/src/framework/hooks/sdk-types.js.map +1 -0
  20. package/dist/src/framework/hooks/use-dependencies.d.ts +4 -0
  21. package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -0
  22. package/dist/src/framework/hooks/use-dependencies.js +13 -0
  23. package/dist/src/framework/hooks/use-dependencies.js.map +1 -0
  24. package/dist/src/framework/load-static-helpers.d.ts +1 -1
  25. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  26. package/dist/src/framework/load-static-helpers.js +17 -31
  27. package/dist/src/framework/load-static-helpers.js.map +1 -1
  28. package/dist/src/framework/reference.d.ts.map +1 -1
  29. package/dist/src/framework/reference.js +2 -2
  30. package/dist/src/framework/reference.js.map +1 -1
  31. package/dist/src/framework/sample.js +8 -8
  32. package/dist/src/framework/sample.js.map +1 -1
  33. package/dist/src/index.d.ts +1 -1
  34. package/dist/src/index.d.ts.map +1 -1
  35. package/dist/src/index.js +111 -100
  36. package/dist/src/index.js.map +1 -1
  37. package/dist/src/lib.d.ts +1 -1
  38. package/dist/src/lib.d.ts.map +1 -1
  39. package/dist/src/lib.js +140 -140
  40. package/dist/src/lib.js.map +1 -1
  41. package/dist/src/meta-tree.d.ts +7 -0
  42. package/dist/src/meta-tree.d.ts.map +1 -0
  43. package/dist/src/meta-tree.js +2 -0
  44. package/dist/src/meta-tree.js.map +1 -0
  45. package/dist/src/modular/build-classical-client.d.ts +6 -0
  46. package/dist/src/modular/build-classical-client.d.ts.map +1 -0
  47. package/dist/src/modular/build-classical-client.js +345 -0
  48. package/dist/src/modular/build-classical-client.js.map +1 -0
  49. package/dist/src/modular/build-classical-operation-groups.d.ts +6 -0
  50. package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -0
  51. package/dist/src/modular/build-classical-operation-groups.js +48 -0
  52. package/dist/src/modular/build-classical-operation-groups.js.map +1 -0
  53. package/dist/src/modular/build-client-context.d.ts +13 -0
  54. package/dist/src/modular/build-client-context.d.ts.map +1 -0
  55. package/dist/src/modular/build-client-context.js +246 -0
  56. package/dist/src/modular/build-client-context.js.map +1 -0
  57. package/dist/src/modular/build-modular-options.d.ts +6 -0
  58. package/dist/src/modular/build-modular-options.d.ts.map +1 -0
  59. package/dist/src/modular/build-modular-options.js +14 -0
  60. package/dist/src/modular/build-modular-options.js.map +1 -0
  61. package/dist/src/modular/build-operations.d.ts +21 -0
  62. package/dist/src/modular/build-operations.d.ts.map +1 -0
  63. package/dist/src/modular/build-operations.js +172 -0
  64. package/dist/src/modular/build-operations.js.map +1 -0
  65. package/dist/src/modular/build-project-files.d.ts +4 -0
  66. package/dist/src/modular/build-project-files.d.ts.map +1 -0
  67. package/dist/src/modular/build-project-files.js +91 -0
  68. package/dist/src/modular/build-project-files.js.map +1 -0
  69. package/dist/src/modular/build-restore-poller.d.ts +5 -0
  70. package/dist/src/modular/build-restore-poller.d.ts.map +1 -0
  71. package/dist/src/modular/build-restore-poller.js +216 -0
  72. package/dist/src/modular/build-restore-poller.js.map +1 -0
  73. package/dist/src/modular/build-root-index.d.ts +13 -0
  74. package/dist/src/modular/build-root-index.d.ts.map +1 -0
  75. package/dist/src/modular/build-root-index.js +279 -0
  76. package/dist/src/modular/build-root-index.js.map +1 -0
  77. package/dist/src/modular/build-subpath-index.d.ts +16 -0
  78. package/dist/src/modular/build-subpath-index.d.ts.map +1 -0
  79. package/dist/src/modular/build-subpath-index.js +119 -0
  80. package/dist/src/modular/build-subpath-index.js.map +1 -0
  81. package/dist/src/modular/emit-logger-file.d.ts +3 -0
  82. package/dist/src/modular/emit-logger-file.d.ts.map +1 -0
  83. package/dist/src/modular/emit-logger-file.js +18 -0
  84. package/dist/src/modular/emit-logger-file.js.map +1 -0
  85. package/dist/src/modular/emit-models-options.d.ts +5 -0
  86. package/dist/src/modular/emit-models-options.d.ts.map +1 -0
  87. package/dist/src/modular/emit-models-options.js +35 -0
  88. package/dist/src/modular/emit-models-options.js.map +1 -0
  89. package/dist/src/modular/emit-models.d.ts +23 -0
  90. package/dist/src/modular/emit-models.d.ts.map +1 -0
  91. package/dist/src/modular/emit-models.js +864 -0
  92. package/dist/src/modular/emit-models.js.map +1 -0
  93. package/dist/src/modular/emit-samples.d.ts +7 -0
  94. package/dist/src/modular/emit-samples.d.ts.map +1 -0
  95. package/dist/src/modular/emit-samples.js +500 -0
  96. package/dist/src/modular/emit-samples.js.map +1 -0
  97. package/dist/src/modular/emit-tests.d.ts +7 -0
  98. package/dist/src/modular/emit-tests.d.ts.map +1 -0
  99. package/dist/src/modular/emit-tests.js +155 -0
  100. package/dist/src/modular/emit-tests.js.map +1 -0
  101. package/dist/src/modular/external-dependencies.js +54 -54
  102. package/dist/src/modular/helpers/classical-operation-helpers.d.ts +7 -0
  103. package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -0
  104. package/dist/src/modular/helpers/classical-operation-helpers.js +258 -0
  105. package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -0
  106. package/dist/src/modular/helpers/client-helpers.d.ts +34 -0
  107. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -0
  108. package/dist/src/modular/helpers/client-helpers.js +259 -0
  109. package/dist/src/modular/helpers/client-helpers.js.map +1 -0
  110. package/dist/src/modular/helpers/client-option-helpers.d.ts +43 -0
  111. package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -0
  112. package/dist/src/modular/helpers/client-option-helpers.js +103 -0
  113. package/dist/src/modular/helpers/client-option-helpers.js.map +1 -0
  114. package/dist/src/modular/helpers/docs-helpers.d.ts +3 -0
  115. package/dist/src/modular/helpers/docs-helpers.d.ts.map +1 -0
  116. package/dist/src/modular/helpers/docs-helpers.js +10 -0
  117. package/dist/src/modular/helpers/docs-helpers.js.map +1 -0
  118. package/dist/src/modular/helpers/example-value-helpers.d.ts +83 -0
  119. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -0
  120. package/dist/src/modular/helpers/example-value-helpers.js +639 -0
  121. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -0
  122. package/dist/src/modular/helpers/naming-helpers.d.ts +22 -0
  123. package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -0
  124. package/dist/src/modular/helpers/naming-helpers.js +59 -0
  125. package/dist/src/modular/helpers/naming-helpers.js.map +1 -0
  126. package/dist/src/modular/helpers/operation-helpers.d.ts +105 -0
  127. package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -0
  128. package/dist/src/modular/helpers/operation-helpers.js +2328 -0
  129. package/dist/src/modular/helpers/operation-helpers.js.map +1 -0
  130. package/dist/src/modular/helpers/type-helpers.d.ts +22 -0
  131. package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -0
  132. package/dist/src/modular/helpers/type-helpers.js +94 -0
  133. package/dist/src/modular/helpers/type-helpers.js.map +1 -0
  134. package/dist/src/modular/serialization/build-deserializer-function.d.ts +7 -0
  135. package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -0
  136. package/dist/src/modular/serialization/build-deserializer-function.js +401 -0
  137. package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -0
  138. package/dist/src/modular/serialization/build-serializer-function.d.ts +7 -0
  139. package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -0
  140. package/dist/src/modular/serialization/build-serializer-function.js +442 -0
  141. package/dist/src/modular/serialization/build-serializer-function.js.map +1 -0
  142. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +44 -0
  143. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -0
  144. package/dist/src/modular/serialization/build-xml-serializer-function.js +729 -0
  145. package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -0
  146. package/dist/src/modular/serialization/serialize-utils.d.ts +37 -0
  147. package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -0
  148. package/dist/src/modular/serialization/serialize-utils.js +145 -0
  149. package/dist/src/modular/serialization/serialize-utils.js.map +1 -0
  150. package/dist/src/modular/static-helpers-metadata.js +60 -60
  151. package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
  152. package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
  153. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
  154. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  155. package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
  156. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  157. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  158. package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
  159. package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
  160. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
  161. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  162. package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
  163. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  164. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  165. package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
  166. package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
  167. package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
  168. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  169. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  170. package/dist/src/rlc-common/build-client-definitions.d.ts +6 -0
  171. package/dist/src/rlc-common/build-client-definitions.d.ts.map +1 -0
  172. package/dist/src/rlc-common/build-client-definitions.js +157 -0
  173. package/dist/src/rlc-common/build-client-definitions.js.map +1 -0
  174. package/dist/src/rlc-common/build-client.d.ts +9 -0
  175. package/dist/src/rlc-common/build-client.d.ts.map +1 -0
  176. package/dist/src/rlc-common/build-client.js +391 -0
  177. package/dist/src/rlc-common/build-client.js.map +1 -0
  178. package/dist/src/rlc-common/build-index-file.d.ts +6 -0
  179. package/dist/src/rlc-common/build-index-file.d.ts.map +1 -0
  180. package/dist/src/rlc-common/build-index-file.js +241 -0
  181. package/dist/src/rlc-common/build-index-file.js.map +1 -0
  182. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +6 -0
  183. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +1 -0
  184. package/dist/src/rlc-common/build-is-unexpected-helper.js +223 -0
  185. package/dist/src/rlc-common/build-is-unexpected-helper.js.map +1 -0
  186. package/dist/src/rlc-common/build-logger.d.ts +6 -0
  187. package/dist/src/rlc-common/build-logger.d.ts.map +1 -0
  188. package/dist/src/rlc-common/build-logger.js +31 -0
  189. package/dist/src/rlc-common/build-logger.js.map +1 -0
  190. package/dist/src/rlc-common/build-method-shortcuts.d.ts +5 -0
  191. package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +1 -0
  192. package/dist/src/rlc-common/build-method-shortcuts.js +54 -0
  193. package/dist/src/rlc-common/build-method-shortcuts.js.map +1 -0
  194. package/dist/src/rlc-common/build-object-types.d.ts +29 -0
  195. package/dist/src/rlc-common/build-object-types.d.ts.map +1 -0
  196. package/dist/src/rlc-common/build-object-types.js +412 -0
  197. package/dist/src/rlc-common/build-object-types.js.map +1 -0
  198. package/dist/src/rlc-common/build-paginate-helper.d.ts +6 -0
  199. package/dist/src/rlc-common/build-paginate-helper.d.ts.map +1 -0
  200. package/dist/src/rlc-common/build-paginate-helper.js +27 -0
  201. package/dist/src/rlc-common/build-paginate-helper.js.map +1 -0
  202. package/dist/src/rlc-common/build-parameter-types.d.ts +14 -0
  203. package/dist/src/rlc-common/build-parameter-types.d.ts.map +1 -0
  204. package/dist/src/rlc-common/build-parameter-types.js +391 -0
  205. package/dist/src/rlc-common/build-parameter-types.js.map +1 -0
  206. package/dist/src/rlc-common/build-polling-helper.d.ts +6 -0
  207. package/dist/src/rlc-common/build-polling-helper.d.ts.map +1 -0
  208. package/dist/src/rlc-common/build-polling-helper.js +61 -0
  209. package/dist/src/rlc-common/build-polling-helper.js.map +1 -0
  210. package/dist/src/rlc-common/build-response-types.d.ts +6 -0
  211. package/dist/src/rlc-common/build-response-types.d.ts.map +1 -0
  212. package/dist/src/rlc-common/build-response-types.js +143 -0
  213. package/dist/src/rlc-common/build-response-types.js.map +1 -0
  214. package/dist/src/rlc-common/build-samples.d.ts +3 -0
  215. package/dist/src/rlc-common/build-samples.d.ts.map +1 -0
  216. package/dist/src/rlc-common/build-samples.js +30 -0
  217. package/dist/src/rlc-common/build-samples.js.map +1 -0
  218. package/dist/src/rlc-common/build-schema-type.d.ts +20 -0
  219. package/dist/src/rlc-common/build-schema-type.d.ts.map +1 -0
  220. package/dist/src/rlc-common/build-schema-type.js +71 -0
  221. package/dist/src/rlc-common/build-schema-type.js.map +1 -0
  222. package/dist/src/rlc-common/build-serialize-helper.d.ts +6 -0
  223. package/dist/src/rlc-common/build-serialize-helper.d.ts.map +1 -0
  224. package/dist/src/rlc-common/build-serialize-helper.js +36 -0
  225. package/dist/src/rlc-common/build-serialize-helper.js.map +1 -0
  226. package/dist/src/rlc-common/build-top-level-index-file.d.ts +6 -0
  227. package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +1 -0
  228. package/dist/src/rlc-common/build-top-level-index-file.js +48 -0
  229. package/dist/src/rlc-common/build-top-level-index-file.js.map +1 -0
  230. package/dist/src/rlc-common/helpers/api-version-util.d.ts +17 -0
  231. package/dist/src/rlc-common/helpers/api-version-util.d.ts.map +1 -0
  232. package/dist/src/rlc-common/helpers/api-version-util.js +43 -0
  233. package/dist/src/rlc-common/helpers/api-version-util.js.map +1 -0
  234. package/dist/src/rlc-common/helpers/imports-util.d.ts +18 -0
  235. package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -0
  236. package/dist/src/rlc-common/helpers/imports-util.js +164 -0
  237. package/dist/src/rlc-common/helpers/imports-util.js.map +1 -0
  238. package/dist/src/rlc-common/helpers/name-constructors.d.ts +42 -0
  239. package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -0
  240. package/dist/src/rlc-common/helpers/name-constructors.js +61 -0
  241. package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -0
  242. package/dist/src/rlc-common/helpers/name-utils.d.ts +37 -0
  243. package/dist/src/rlc-common/helpers/name-utils.d.ts.map +1 -0
  244. package/dist/src/rlc-common/helpers/name-utils.js +240 -0
  245. package/dist/src/rlc-common/helpers/name-utils.js.map +1 -0
  246. package/dist/src/rlc-common/helpers/operation-helpers.d.ts +16 -0
  247. package/dist/src/rlc-common/helpers/operation-helpers.d.ts.map +1 -0
  248. package/dist/src/rlc-common/helpers/operation-helpers.js +104 -0
  249. package/dist/src/rlc-common/helpers/operation-helpers.js.map +1 -0
  250. package/dist/src/rlc-common/helpers/package-util.d.ts +7 -0
  251. package/dist/src/rlc-common/helpers/package-util.d.ts.map +1 -0
  252. package/dist/src/rlc-common/helpers/package-util.js +10 -0
  253. package/dist/src/rlc-common/helpers/package-util.js.map +1 -0
  254. package/dist/src/rlc-common/helpers/path-utils.d.ts +2 -0
  255. package/dist/src/rlc-common/helpers/path-utils.d.ts.map +1 -0
  256. package/dist/src/rlc-common/helpers/path-utils.js +10 -0
  257. package/dist/src/rlc-common/helpers/path-utils.js.map +1 -0
  258. package/dist/src/rlc-common/helpers/schema-helpers.d.ts +10 -0
  259. package/dist/src/rlc-common/helpers/schema-helpers.d.ts.map +1 -0
  260. package/dist/src/rlc-common/helpers/schema-helpers.js +37 -0
  261. package/dist/src/rlc-common/helpers/schema-helpers.js.map +1 -0
  262. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +4 -0
  263. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +1 -0
  264. package/dist/src/rlc-common/helpers/shortcut-methods.js +49 -0
  265. package/dist/src/rlc-common/helpers/shortcut-methods.js.map +1 -0
  266. package/dist/src/rlc-common/helpers/type-util.d.ts +32 -0
  267. package/dist/src/rlc-common/helpers/type-util.d.ts.map +1 -0
  268. package/dist/src/rlc-common/helpers/type-util.js +162 -0
  269. package/dist/src/rlc-common/helpers/type-util.js.map +1 -0
  270. package/dist/src/rlc-common/helpers/value-generation-util.d.ts +12 -0
  271. package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +1 -0
  272. package/dist/src/rlc-common/helpers/value-generation-util.js +161 -0
  273. package/dist/src/rlc-common/helpers/value-generation-util.js.map +1 -0
  274. package/dist/src/rlc-common/index.d.ts +39 -39
  275. package/dist/src/rlc-common/index.d.ts.map +1 -1
  276. package/dist/src/rlc-common/index.js +39 -39
  277. package/dist/src/rlc-common/index.js.map +1 -1
  278. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  279. package/dist/src/rlc-common/interfaces.js.map +1 -1
  280. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +6 -0
  281. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -0
  282. package/dist/src/rlc-common/metadata/build-api-extractor-config.js +55 -0
  283. package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -0
  284. package/dist/src/rlc-common/metadata/build-changelog-file.d.ts +6 -0
  285. package/dist/src/rlc-common/metadata/build-changelog-file.d.ts.map +1 -0
  286. package/dist/src/rlc-common/metadata/build-changelog-file.js +25 -0
  287. package/dist/src/rlc-common/metadata/build-changelog-file.js.map +1 -0
  288. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +6 -0
  289. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -0
  290. package/dist/src/rlc-common/metadata/build-es-lint-config.js +79 -0
  291. package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -0
  292. package/dist/src/rlc-common/metadata/build-license-file.d.ts +5 -0
  293. package/dist/src/rlc-common/metadata/build-license-file.d.ts.map +1 -0
  294. package/dist/src/rlc-common/metadata/build-license-file.js +32 -0
  295. package/dist/src/rlc-common/metadata/build-license-file.js.map +1 -0
  296. package/dist/src/rlc-common/metadata/build-package-file.d.ts +25 -0
  297. package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -0
  298. package/dist/src/rlc-common/metadata/build-package-file.js +197 -0
  299. package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -0
  300. package/dist/src/rlc-common/metadata/build-readme-file.d.ts +11 -0
  301. package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -0
  302. package/dist/src/rlc-common/metadata/build-readme-file.js +418 -0
  303. package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -0
  304. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +6 -0
  305. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +1 -0
  306. package/dist/src/rlc-common/metadata/build-rollup-config.js +140 -0
  307. package/dist/src/rlc-common/metadata/build-rollup-config.js.map +1 -0
  308. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts +6 -0
  309. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -0
  310. package/dist/src/rlc-common/metadata/build-sample-env-file.js +15 -0
  311. package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -0
  312. package/dist/src/rlc-common/metadata/build-test-config.d.ts +16 -0
  313. package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -0
  314. package/dist/src/rlc-common/metadata/build-test-config.js +54 -0
  315. package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -0
  316. package/dist/src/rlc-common/metadata/build-ts-config.d.ts +61 -0
  317. package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -0
  318. package/dist/src/rlc-common/metadata/build-ts-config.js +170 -0
  319. package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -0
  320. package/dist/src/rlc-common/metadata/build-vitest-config.d.ts +6 -0
  321. package/dist/src/rlc-common/metadata/build-vitest-config.d.ts.map +1 -0
  322. package/dist/src/rlc-common/metadata/build-vitest-config.js +26 -0
  323. package/dist/src/rlc-common/metadata/build-vitest-config.js.map +1 -0
  324. package/dist/src/rlc-common/metadata/build-warp-config.d.ts +20 -0
  325. package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -0
  326. package/dist/src/rlc-common/metadata/build-warp-config.js +76 -0
  327. package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -0
  328. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +51 -0
  329. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -0
  330. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +121 -0
  331. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -0
  332. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +242 -0
  333. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -0
  334. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +171 -0
  335. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -0
  336. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +8 -0
  337. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +1 -0
  338. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +101 -0
  339. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +1 -0
  340. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +57 -0
  341. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +1 -0
  342. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +53 -0
  343. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +1 -0
  344. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +64 -0
  345. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -0
  346. package/dist/src/rlc-common/metadata/package-json/package-common.js +180 -0
  347. package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -0
  348. package/dist/src/rlc-common/metadata/utils.js +1 -2
  349. package/dist/src/rlc-common/metadata/utils.js.map +1 -1
  350. package/dist/src/rlc-common/static/paginate-content.d.ts +2 -0
  351. package/dist/src/rlc-common/static/paginate-content.d.ts.map +1 -0
  352. package/dist/src/rlc-common/static/paginate-content.js +345 -0
  353. package/dist/src/rlc-common/static/paginate-content.js.map +1 -0
  354. package/dist/src/rlc-common/static/polling-content.d.ts +2 -0
  355. package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -0
  356. package/dist/src/rlc-common/static/polling-content.js +225 -0
  357. package/dist/src/rlc-common/static/polling-content.js.map +1 -0
  358. package/dist/src/rlc-common/static/sample-template.d.ts +2 -0
  359. package/dist/src/rlc-common/static/sample-template.d.ts.map +1 -0
  360. package/dist/src/rlc-common/static/sample-template.js +56 -0
  361. package/dist/src/rlc-common/static/sample-template.js.map +1 -0
  362. package/dist/src/rlc-common/static/serialize-helper.d.ts +6 -0
  363. package/dist/src/rlc-common/static/serialize-helper.d.ts.map +1 -0
  364. package/dist/src/rlc-common/static/serialize-helper.js +31 -0
  365. package/dist/src/rlc-common/static/serialize-helper.js.map +1 -0
  366. package/dist/src/rlc-common/test/build-karma-config.d.ts +6 -0
  367. package/dist/src/rlc-common/test/build-karma-config.d.ts.map +1 -0
  368. package/dist/src/rlc-common/test/build-karma-config.js +11 -0
  369. package/dist/src/rlc-common/test/build-karma-config.js.map +1 -0
  370. package/dist/src/rlc-common/test/build-recorded-client.d.ts +6 -0
  371. package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -0
  372. package/dist/src/rlc-common/test/build-recorded-client.js +17 -0
  373. package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -0
  374. package/dist/src/rlc-common/test/build-sample-test.d.ts +6 -0
  375. package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -0
  376. package/dist/src/rlc-common/test/build-sample-test.js +14 -0
  377. package/dist/src/rlc-common/test/build-sample-test.js.map +1 -0
  378. package/dist/src/rlc-common/test/build-snippets.d.ts +6 -0
  379. package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -0
  380. package/dist/src/rlc-common/test/build-snippets.js +26 -0
  381. package/dist/src/rlc-common/test/build-snippets.js.map +1 -0
  382. package/dist/src/rlc-common/transform-sample-groups.d.ts +9 -0
  383. package/dist/src/rlc-common/transform-sample-groups.d.ts.map +1 -0
  384. package/dist/src/rlc-common/transform-sample-groups.js +313 -0
  385. package/dist/src/rlc-common/transform-sample-groups.js.map +1 -0
  386. package/dist/src/testing/index.d.ts.map +1 -1
  387. package/dist/src/testing/index.js +1 -1
  388. package/dist/src/testing/index.js.map +1 -1
  389. package/dist/src/transform/transform-api-version-info.d.ts +6 -0
  390. package/dist/src/transform/transform-api-version-info.d.ts.map +1 -0
  391. package/dist/src/transform/transform-api-version-info.js +78 -0
  392. package/dist/src/transform/transform-api-version-info.js.map +1 -0
  393. package/dist/src/transform/transform-helper-function-details.d.ts +5 -0
  394. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -0
  395. package/dist/src/transform/transform-helper-function-details.js +74 -0
  396. package/dist/src/transform/transform-helper-function-details.js.map +1 -0
  397. package/dist/src/transform/transform-parameters.d.ts +14 -0
  398. package/dist/src/transform/transform-parameters.d.ts.map +1 -0
  399. package/dist/src/transform/transform-parameters.js +201 -0
  400. package/dist/src/transform/transform-parameters.js.map +1 -0
  401. package/dist/src/transform/transform-paths.d.ts +5 -0
  402. package/dist/src/transform/transform-paths.d.ts.map +1 -0
  403. package/dist/src/transform/transform-paths.js +102 -0
  404. package/dist/src/transform/transform-paths.js.map +1 -0
  405. package/dist/src/transform/transform-responses.d.ts +5 -0
  406. package/dist/src/transform/transform-responses.d.ts.map +1 -0
  407. package/dist/src/transform/transform-responses.js +171 -0
  408. package/dist/src/transform/transform-responses.js.map +1 -0
  409. package/dist/src/transform/transform-schemas.d.ts +4 -0
  410. package/dist/src/transform/transform-schemas.d.ts.map +1 -0
  411. package/dist/src/transform/transform-schemas.js +191 -0
  412. package/dist/src/transform/transform-schemas.js.map +1 -0
  413. package/dist/src/transform/transform-telemetry-info.d.ts +4 -0
  414. package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -0
  415. package/dist/src/transform/transform-telemetry-info.js +22 -0
  416. package/dist/src/transform/transform-telemetry-info.js.map +1 -0
  417. package/dist/src/transform/transform.d.ts +1 -1
  418. package/dist/src/transform/transform.d.ts.map +1 -1
  419. package/dist/src/transform/transform.js +37 -36
  420. package/dist/src/transform/transform.js.map +1 -1
  421. package/dist/src/transform/transfrom-rlc-options.d.ts +14 -0
  422. package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -0
  423. package/dist/src/transform/transfrom-rlc-options.js +369 -0
  424. package/dist/src/transform/transfrom-rlc-options.js.map +1 -0
  425. package/dist/src/utils/client-utils.d.ts +10 -0
  426. package/dist/src/utils/client-utils.d.ts.map +1 -0
  427. package/dist/src/utils/client-utils.js +124 -0
  428. package/dist/src/utils/client-utils.js.map +1 -0
  429. package/dist/src/utils/credential-utils.d.ts +15 -0
  430. package/dist/src/utils/credential-utils.d.ts.map +1 -0
  431. package/dist/src/utils/credential-utils.js +68 -0
  432. package/dist/src/utils/credential-utils.js.map +1 -0
  433. package/dist/src/utils/cross-language-def.d.ts +6 -0
  434. package/dist/src/utils/cross-language-def.d.ts.map +1 -0
  435. package/dist/src/utils/cross-language-def.js +59 -0
  436. package/dist/src/utils/cross-language-def.js.map +1 -0
  437. package/dist/src/utils/emit-util.d.ts +5 -0
  438. package/dist/src/utils/emit-util.d.ts.map +1 -0
  439. package/dist/src/utils/emit-util.js +71 -0
  440. package/dist/src/utils/emit-util.js.map +1 -0
  441. package/dist/src/utils/file-system-utils.d.ts +5 -0
  442. package/dist/src/utils/file-system-utils.d.ts.map +1 -0
  443. package/dist/src/utils/file-system-utils.js +59 -0
  444. package/dist/src/utils/file-system-utils.js.map +1 -0
  445. package/dist/src/utils/import-helper.d.ts +10 -0
  446. package/dist/src/utils/import-helper.d.ts.map +1 -0
  447. package/dist/src/utils/import-helper.js +51 -0
  448. package/dist/src/utils/import-helper.js.map +1 -0
  449. package/dist/src/utils/interfaces.d.ts +2 -2
  450. package/dist/src/utils/interfaces.d.ts.map +1 -1
  451. package/dist/src/utils/media-types.d.ts +28 -0
  452. package/dist/src/utils/media-types.d.ts.map +1 -0
  453. package/dist/src/utils/media-types.js +124 -0
  454. package/dist/src/utils/media-types.js.map +1 -0
  455. package/dist/src/utils/model-utils.d.ts +60 -0
  456. package/dist/src/utils/model-utils.d.ts.map +1 -0
  457. package/dist/src/utils/model-utils.js +1480 -0
  458. package/dist/src/utils/model-utils.js.map +1 -0
  459. package/dist/src/utils/namespace-utils.d.ts +6 -0
  460. package/dist/src/utils/namespace-utils.d.ts.map +1 -0
  461. package/dist/src/utils/namespace-utils.js +69 -0
  462. package/dist/src/utils/namespace-utils.js.map +1 -0
  463. package/dist/src/utils/operation-util.d.ts +97 -0
  464. package/dist/src/utils/operation-util.d.ts.map +1 -0
  465. package/dist/src/utils/operation-util.js +547 -0
  466. package/dist/src/utils/operation-util.js.map +1 -0
  467. package/dist/src/utils/parameter-utils.d.ts +9 -0
  468. package/dist/src/utils/parameter-utils.d.ts.map +1 -0
  469. package/dist/src/utils/parameter-utils.js +147 -0
  470. package/dist/src/utils/parameter-utils.js.map +1 -0
  471. package/dist/src/utils/resolve-project-root.js +2 -2
  472. package/dist/src/utils/resolve-project-root.js.map +1 -1
  473. package/dist/tsconfig.tsbuildinfo +1 -1
  474. package/package.json +44 -55
  475. package/src/context-manager.ts +101 -0
  476. package/src/framework/declaration.ts +18 -28
  477. package/src/framework/dependency.ts +1 -2
  478. package/src/framework/hooks/binder.ts +48 -121
  479. package/src/framework/hooks/sdk-types.ts +219 -0
  480. package/src/framework/hooks/use-dependencies.ts +16 -0
  481. package/src/framework/load-static-helpers.ts +28 -51
  482. package/src/framework/reference.ts +2 -5
  483. package/src/framework/sample.ts +9 -9
  484. package/src/index.ts +149 -189
  485. package/src/lib.ts +143 -158
  486. package/src/meta-tree.ts +8 -0
  487. package/src/modular/build-classical-client.ts +434 -0
  488. package/src/modular/build-classical-operation-groups.ts +69 -0
  489. package/src/modular/build-client-context.ts +325 -0
  490. package/src/modular/build-modular-options.ts +22 -0
  491. package/src/modular/build-operations.ts +248 -0
  492. package/src/modular/build-project-files.ts +111 -0
  493. package/src/modular/build-restore-poller.ts +242 -0
  494. package/src/modular/build-root-index.ts +407 -0
  495. package/src/modular/build-subpath-index.ts +152 -0
  496. package/src/modular/emit-logger-file.ts +23 -0
  497. package/src/modular/emit-models-options.ts +56 -0
  498. package/src/modular/emit-models.ts +1096 -0
  499. package/src/modular/emit-samples.ts +675 -0
  500. package/src/modular/emit-tests.ts +194 -0
  501. package/src/modular/external-dependencies.ts +54 -54
  502. package/src/modular/helpers/classical-operation-helpers.ts +375 -0
  503. package/src/modular/helpers/client-helpers.ts +362 -0
  504. package/src/modular/helpers/client-option-helpers.ts +122 -0
  505. package/src/modular/helpers/example-value-helpers.ts +851 -0
  506. package/src/modular/helpers/naming-helpers.ts +84 -0
  507. package/src/modular/helpers/operation-helpers.ts +3035 -0
  508. package/src/modular/helpers/type-helpers.ts +134 -0
  509. package/src/modular/serialization/build-deserializer-function.ts +564 -0
  510. package/src/modular/serialization/build-serializer-function.ts +614 -0
  511. package/src/modular/serialization/build-xml-serializer-function.ts +951 -0
  512. package/src/modular/serialization/serialize-utils.ts +217 -0
  513. package/src/modular/static/rollup.test.config.js +11 -14
  514. package/src/modular/static/scripts/renameOutput.mjs +2 -2
  515. package/src/modular/static-helpers-metadata.ts +60 -60
  516. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  517. package/src/modular/type-expressions/get-enum-expression.ts +5 -10
  518. package/src/modular/type-expressions/get-model-expression.ts +13 -17
  519. package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
  520. package/src/modular/type-expressions/get-type-expression.ts +8 -12
  521. package/src/modular/type-expressions/get-union-expression.ts +4 -4
  522. package/src/modular/type-expressions/utils.ts +1 -1
  523. package/src/rlc-common/build-client-definitions.ts +235 -0
  524. package/src/rlc-common/build-client.ts +490 -0
  525. package/src/rlc-common/build-index-file.ts +344 -0
  526. package/src/rlc-common/build-is-unexpected-helper.ts +248 -0
  527. package/src/rlc-common/build-logger.ts +43 -0
  528. package/src/rlc-common/build-method-shortcuts.ts +71 -0
  529. package/src/rlc-common/build-object-types.ts +603 -0
  530. package/src/rlc-common/build-paginate-helper.ts +31 -0
  531. package/src/rlc-common/build-parameter-types.ts +554 -0
  532. package/src/rlc-common/build-polling-helper.ts +83 -0
  533. package/src/rlc-common/build-response-types.ts +180 -0
  534. package/src/rlc-common/build-samples.ts +32 -0
  535. package/src/rlc-common/build-schema-type.ts +89 -0
  536. package/src/rlc-common/build-serialize-helper.ts +49 -0
  537. package/src/rlc-common/build-top-level-index-file.ts +58 -0
  538. package/src/rlc-common/helpers/api-version-util.ts +48 -0
  539. package/src/rlc-common/helpers/imports-util.ts +184 -0
  540. package/src/rlc-common/helpers/name-constructors.ts +110 -0
  541. package/src/rlc-common/helpers/name-utils.ts +296 -0
  542. package/src/rlc-common/helpers/operation-helpers.ts +138 -0
  543. package/src/rlc-common/helpers/path-utils.ts +10 -0
  544. package/src/rlc-common/helpers/schema-helpers.ts +50 -0
  545. package/src/rlc-common/helpers/shortcut-methods.ts +58 -0
  546. package/src/rlc-common/helpers/type-util.ts +166 -0
  547. package/src/rlc-common/helpers/value-generation-util.ts +234 -0
  548. package/src/rlc-common/index.ts +39 -39
  549. package/src/rlc-common/interfaces.ts +3 -11
  550. package/src/rlc-common/metadata/build-api-extractor-config.ts +64 -0
  551. package/src/rlc-common/metadata/build-changelog-file.ts +29 -0
  552. package/src/rlc-common/metadata/build-es-lint-config.ts +84 -0
  553. package/src/rlc-common/metadata/build-license-file.ts +33 -0
  554. package/src/rlc-common/metadata/build-package-file.ts +242 -0
  555. package/src/rlc-common/metadata/build-readme-file.ts +515 -0
  556. package/src/rlc-common/metadata/build-rollup-config.ts +147 -0
  557. package/src/rlc-common/metadata/build-sample-env-file.ts +21 -0
  558. package/src/rlc-common/metadata/build-test-config.ts +72 -0
  559. package/src/rlc-common/metadata/build-ts-config.ts +219 -0
  560. package/src/rlc-common/metadata/build-vitest-config.ts +30 -0
  561. package/src/rlc-common/metadata/build-warp-config.ts +91 -0
  562. package/src/rlc-common/metadata/package-json/azure-package-common.ts +152 -0
  563. package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +199 -0
  564. package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +123 -0
  565. package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +68 -0
  566. package/src/rlc-common/metadata/package-json/package-common.ts +235 -0
  567. package/src/rlc-common/test/build-karma-config.ts +12 -0
  568. package/src/rlc-common/test/build-recorded-client.ts +18 -0
  569. package/src/rlc-common/test/build-sample-test.ts +15 -0
  570. package/src/rlc-common/test/build-snippets.ts +29 -0
  571. package/src/rlc-common/transform-sample-groups.ts +407 -0
  572. package/src/testing/index.ts +2 -5
  573. package/src/transform/transform-api-version-info.ts +103 -0
  574. package/src/transform/transform-helper-function-details.ts +88 -0
  575. package/src/transform/transform-parameters.ts +321 -0
  576. package/src/transform/transform-paths.ts +157 -0
  577. package/src/transform/transform-responses.ts +237 -0
  578. package/src/transform/transform-schemas.ts +212 -0
  579. package/src/transform/transform-telemetry-info.ts +33 -0
  580. package/src/transform/transform.ts +32 -44
  581. package/src/transform/transfrom-rlc-options.ts +461 -0
  582. package/src/utils/client-utils.ts +162 -0
  583. package/src/utils/credential-utils.ts +74 -0
  584. package/src/utils/cross-language-def.ts +66 -0
  585. package/src/utils/emit-util.ts +92 -0
  586. package/src/utils/file-system-utils.ts +69 -0
  587. package/src/utils/import-helper.ts +59 -0
  588. package/src/utils/interfaces.ts +2 -2
  589. package/src/utils/media-types.ts +150 -0
  590. package/src/utils/model-utils.ts +1727 -0
  591. package/src/utils/namespace-utils.ts +84 -0
  592. package/src/utils/operation-util.ts +763 -0
  593. package/src/utils/parameter-utils.ts +192 -0
  594. package/src/utils/resolve-project-root.ts +3 -3
  595. package/static/static-helpers/cloudSettingHelpers.ts +4 -6
  596. package/static/static-helpers/multipartHelpers.ts +3 -3
  597. package/static/static-helpers/pagingHelpers.ts +28 -63
  598. package/static/static-helpers/pollingHelpers.ts +16 -29
  599. package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
  600. package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
  601. package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
  602. package/static/static-helpers/serialization/get-binary-response.ts +2 -2
  603. package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
  604. package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
  605. package/static/static-helpers/serialization/serialize-record.ts +1 -1
  606. package/static/static-helpers/serialization/serializers.ts +5 -7
  607. package/static/static-helpers/serialization/xml-helpers.ts +42 -90
  608. package/static/static-helpers/simplePollerHelpers.ts +10 -19
  609. package/static/static-helpers/storageCompatResponse.ts +10 -27
  610. package/static/static-helpers/urlTemplate.ts +4 -7
  611. package/static/test-helpers/recordedClient.ts +5 -10
  612. package/dist/src/contextManager.d.ts +0 -75
  613. package/dist/src/contextManager.d.ts.map +0 -1
  614. package/dist/src/contextManager.js +0 -59
  615. package/dist/src/contextManager.js.map +0 -1
  616. package/dist/src/framework/hooks/sdkTypes.d.ts +0 -26
  617. package/dist/src/framework/hooks/sdkTypes.d.ts.map +0 -1
  618. package/dist/src/framework/hooks/sdkTypes.js +0 -161
  619. package/dist/src/framework/hooks/sdkTypes.js.map +0 -1
  620. package/dist/src/framework/hooks/useDependencies.d.ts +0 -4
  621. package/dist/src/framework/hooks/useDependencies.d.ts.map +0 -1
  622. package/dist/src/framework/hooks/useDependencies.js +0 -13
  623. package/dist/src/framework/hooks/useDependencies.js.map +0 -1
  624. package/dist/src/metaTree.d.ts +0 -7
  625. package/dist/src/metaTree.d.ts.map +0 -1
  626. package/dist/src/metaTree.js +0 -2
  627. package/dist/src/metaTree.js.map +0 -1
  628. package/dist/src/modular/buildClassicalClient.d.ts +0 -6
  629. package/dist/src/modular/buildClassicalClient.d.ts.map +0 -1
  630. package/dist/src/modular/buildClassicalClient.js +0 -359
  631. package/dist/src/modular/buildClassicalClient.js.map +0 -1
  632. package/dist/src/modular/buildClassicalOperationGroups.d.ts +0 -6
  633. package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +0 -1
  634. package/dist/src/modular/buildClassicalOperationGroups.js +0 -50
  635. package/dist/src/modular/buildClassicalOperationGroups.js.map +0 -1
  636. package/dist/src/modular/buildClientContext.d.ts +0 -13
  637. package/dist/src/modular/buildClientContext.d.ts.map +0 -1
  638. package/dist/src/modular/buildClientContext.js +0 -253
  639. package/dist/src/modular/buildClientContext.js.map +0 -1
  640. package/dist/src/modular/buildModularOptions.d.ts +0 -6
  641. package/dist/src/modular/buildModularOptions.d.ts.map +0 -1
  642. package/dist/src/modular/buildModularOptions.js +0 -15
  643. package/dist/src/modular/buildModularOptions.js.map +0 -1
  644. package/dist/src/modular/buildOperations.d.ts +0 -21
  645. package/dist/src/modular/buildOperations.d.ts.map +0 -1
  646. package/dist/src/modular/buildOperations.js +0 -174
  647. package/dist/src/modular/buildOperations.js.map +0 -1
  648. package/dist/src/modular/buildProjectFiles.d.ts +0 -4
  649. package/dist/src/modular/buildProjectFiles.d.ts.map +0 -1
  650. package/dist/src/modular/buildProjectFiles.js +0 -94
  651. package/dist/src/modular/buildProjectFiles.js.map +0 -1
  652. package/dist/src/modular/buildRestorePoller.d.ts +0 -5
  653. package/dist/src/modular/buildRestorePoller.d.ts.map +0 -1
  654. package/dist/src/modular/buildRestorePoller.js +0 -217
  655. package/dist/src/modular/buildRestorePoller.js.map +0 -1
  656. package/dist/src/modular/buildRootIndex.d.ts +0 -13
  657. package/dist/src/modular/buildRootIndex.d.ts.map +0 -1
  658. package/dist/src/modular/buildRootIndex.js +0 -293
  659. package/dist/src/modular/buildRootIndex.js.map +0 -1
  660. package/dist/src/modular/buildSubpathIndex.d.ts +0 -16
  661. package/dist/src/modular/buildSubpathIndex.d.ts.map +0 -1
  662. package/dist/src/modular/buildSubpathIndex.js +0 -128
  663. package/dist/src/modular/buildSubpathIndex.js.map +0 -1
  664. package/dist/src/modular/emitLoggerFile.d.ts +0 -3
  665. package/dist/src/modular/emitLoggerFile.d.ts.map +0 -1
  666. package/dist/src/modular/emitLoggerFile.js +0 -18
  667. package/dist/src/modular/emitLoggerFile.js.map +0 -1
  668. package/dist/src/modular/emitModels.d.ts +0 -23
  669. package/dist/src/modular/emitModels.d.ts.map +0 -1
  670. package/dist/src/modular/emitModels.js +0 -882
  671. package/dist/src/modular/emitModels.js.map +0 -1
  672. package/dist/src/modular/emitModelsOptions.d.ts +0 -5
  673. package/dist/src/modular/emitModelsOptions.d.ts.map +0 -1
  674. package/dist/src/modular/emitModelsOptions.js +0 -36
  675. package/dist/src/modular/emitModelsOptions.js.map +0 -1
  676. package/dist/src/modular/emitSamples.d.ts +0 -7
  677. package/dist/src/modular/emitSamples.d.ts.map +0 -1
  678. package/dist/src/modular/emitSamples.js +0 -508
  679. package/dist/src/modular/emitSamples.js.map +0 -1
  680. package/dist/src/modular/emitTests.d.ts +0 -7
  681. package/dist/src/modular/emitTests.d.ts.map +0 -1
  682. package/dist/src/modular/emitTests.js +0 -160
  683. package/dist/src/modular/emitTests.js.map +0 -1
  684. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +0 -7
  685. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +0 -1
  686. package/dist/src/modular/helpers/classicalOperationHelpers.js +0 -267
  687. package/dist/src/modular/helpers/classicalOperationHelpers.js.map +0 -1
  688. package/dist/src/modular/helpers/clientHelpers.d.ts +0 -34
  689. package/dist/src/modular/helpers/clientHelpers.d.ts.map +0 -1
  690. package/dist/src/modular/helpers/clientHelpers.js +0 -282
  691. package/dist/src/modular/helpers/clientHelpers.js.map +0 -1
  692. package/dist/src/modular/helpers/clientOptionHelpers.d.ts +0 -43
  693. package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +0 -1
  694. package/dist/src/modular/helpers/clientOptionHelpers.js +0 -103
  695. package/dist/src/modular/helpers/clientOptionHelpers.js.map +0 -1
  696. package/dist/src/modular/helpers/docsHelpers.d.ts +0 -3
  697. package/dist/src/modular/helpers/docsHelpers.d.ts.map +0 -1
  698. package/dist/src/modular/helpers/docsHelpers.js +0 -10
  699. package/dist/src/modular/helpers/docsHelpers.js.map +0 -1
  700. package/dist/src/modular/helpers/exampleValueHelpers.d.ts +0 -83
  701. package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +0 -1
  702. package/dist/src/modular/helpers/exampleValueHelpers.js +0 -651
  703. package/dist/src/modular/helpers/exampleValueHelpers.js.map +0 -1
  704. package/dist/src/modular/helpers/namingHelpers.d.ts +0 -22
  705. package/dist/src/modular/helpers/namingHelpers.d.ts.map +0 -1
  706. package/dist/src/modular/helpers/namingHelpers.js +0 -62
  707. package/dist/src/modular/helpers/namingHelpers.js.map +0 -1
  708. package/dist/src/modular/helpers/operationHelpers.d.ts +0 -105
  709. package/dist/src/modular/helpers/operationHelpers.d.ts.map +0 -1
  710. package/dist/src/modular/helpers/operationHelpers.js +0 -2412
  711. package/dist/src/modular/helpers/operationHelpers.js.map +0 -1
  712. package/dist/src/modular/helpers/typeHelpers.d.ts +0 -22
  713. package/dist/src/modular/helpers/typeHelpers.d.ts.map +0 -1
  714. package/dist/src/modular/helpers/typeHelpers.js +0 -96
  715. package/dist/src/modular/helpers/typeHelpers.js.map +0 -1
  716. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +0 -7
  717. package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +0 -1
  718. package/dist/src/modular/serialization/buildDeserializerFunction.js +0 -410
  719. package/dist/src/modular/serialization/buildDeserializerFunction.js.map +0 -1
  720. package/dist/src/modular/serialization/buildSerializerFunction.d.ts +0 -7
  721. package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +0 -1
  722. package/dist/src/modular/serialization/buildSerializerFunction.js +0 -454
  723. package/dist/src/modular/serialization/buildSerializerFunction.js.map +0 -1
  724. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +0 -44
  725. package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +0 -1
  726. package/dist/src/modular/serialization/buildXmlSerializerFunction.js +0 -746
  727. package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +0 -1
  728. package/dist/src/modular/serialization/serializeUtils.d.ts +0 -37
  729. package/dist/src/modular/serialization/serializeUtils.d.ts.map +0 -1
  730. package/dist/src/modular/serialization/serializeUtils.js +0 -153
  731. package/dist/src/modular/serialization/serializeUtils.js.map +0 -1
  732. package/dist/src/rlc-common/buildClient.d.ts +0 -9
  733. package/dist/src/rlc-common/buildClient.d.ts.map +0 -1
  734. package/dist/src/rlc-common/buildClient.js +0 -413
  735. package/dist/src/rlc-common/buildClient.js.map +0 -1
  736. package/dist/src/rlc-common/buildClientDefinitions.d.ts +0 -6
  737. package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +0 -1
  738. package/dist/src/rlc-common/buildClientDefinitions.js +0 -174
  739. package/dist/src/rlc-common/buildClientDefinitions.js.map +0 -1
  740. package/dist/src/rlc-common/buildIndexFile.d.ts +0 -6
  741. package/dist/src/rlc-common/buildIndexFile.d.ts.map +0 -1
  742. package/dist/src/rlc-common/buildIndexFile.js +0 -242
  743. package/dist/src/rlc-common/buildIndexFile.js.map +0 -1
  744. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts +0 -6
  745. package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +0 -1
  746. package/dist/src/rlc-common/buildIsUnexpectedHelper.js +0 -224
  747. package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +0 -1
  748. package/dist/src/rlc-common/buildLogger.d.ts +0 -6
  749. package/dist/src/rlc-common/buildLogger.d.ts.map +0 -1
  750. package/dist/src/rlc-common/buildLogger.js +0 -32
  751. package/dist/src/rlc-common/buildLogger.js.map +0 -1
  752. package/dist/src/rlc-common/buildMethodShortcuts.d.ts +0 -5
  753. package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +0 -1
  754. package/dist/src/rlc-common/buildMethodShortcuts.js +0 -54
  755. package/dist/src/rlc-common/buildMethodShortcuts.js.map +0 -1
  756. package/dist/src/rlc-common/buildObjectTypes.d.ts +0 -29
  757. package/dist/src/rlc-common/buildObjectTypes.d.ts.map +0 -1
  758. package/dist/src/rlc-common/buildObjectTypes.js +0 -451
  759. package/dist/src/rlc-common/buildObjectTypes.js.map +0 -1
  760. package/dist/src/rlc-common/buildPaginateHelper.d.ts +0 -6
  761. package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +0 -1
  762. package/dist/src/rlc-common/buildPaginateHelper.js +0 -27
  763. package/dist/src/rlc-common/buildPaginateHelper.js.map +0 -1
  764. package/dist/src/rlc-common/buildParameterTypes.d.ts +0 -14
  765. package/dist/src/rlc-common/buildParameterTypes.d.ts.map +0 -1
  766. package/dist/src/rlc-common/buildParameterTypes.js +0 -381
  767. package/dist/src/rlc-common/buildParameterTypes.js.map +0 -1
  768. package/dist/src/rlc-common/buildPollingHelper.d.ts +0 -6
  769. package/dist/src/rlc-common/buildPollingHelper.d.ts.map +0 -1
  770. package/dist/src/rlc-common/buildPollingHelper.js +0 -62
  771. package/dist/src/rlc-common/buildPollingHelper.js.map +0 -1
  772. package/dist/src/rlc-common/buildResponseTypes.d.ts +0 -6
  773. package/dist/src/rlc-common/buildResponseTypes.d.ts.map +0 -1
  774. package/dist/src/rlc-common/buildResponseTypes.js +0 -147
  775. package/dist/src/rlc-common/buildResponseTypes.js.map +0 -1
  776. package/dist/src/rlc-common/buildSamples.d.ts +0 -3
  777. package/dist/src/rlc-common/buildSamples.d.ts.map +0 -1
  778. package/dist/src/rlc-common/buildSamples.js +0 -30
  779. package/dist/src/rlc-common/buildSamples.js.map +0 -1
  780. package/dist/src/rlc-common/buildSchemaType.d.ts +0 -20
  781. package/dist/src/rlc-common/buildSchemaType.d.ts.map +0 -1
  782. package/dist/src/rlc-common/buildSchemaType.js +0 -53
  783. package/dist/src/rlc-common/buildSchemaType.js.map +0 -1
  784. package/dist/src/rlc-common/buildSerializeHelper.d.ts +0 -6
  785. package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +0 -1
  786. package/dist/src/rlc-common/buildSerializeHelper.js +0 -36
  787. package/dist/src/rlc-common/buildSerializeHelper.js.map +0 -1
  788. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts +0 -6
  789. package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +0 -1
  790. package/dist/src/rlc-common/buildTopLevelIndexFile.js +0 -52
  791. package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +0 -1
  792. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts +0 -17
  793. package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +0 -1
  794. package/dist/src/rlc-common/helpers/apiVersionUtil.js +0 -45
  795. package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +0 -1
  796. package/dist/src/rlc-common/helpers/importsUtil.d.ts +0 -18
  797. package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +0 -1
  798. package/dist/src/rlc-common/helpers/importsUtil.js +0 -169
  799. package/dist/src/rlc-common/helpers/importsUtil.js.map +0 -1
  800. package/dist/src/rlc-common/helpers/nameConstructors.d.ts +0 -42
  801. package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +0 -1
  802. package/dist/src/rlc-common/helpers/nameConstructors.js +0 -63
  803. package/dist/src/rlc-common/helpers/nameConstructors.js.map +0 -1
  804. package/dist/src/rlc-common/helpers/nameUtils.d.ts +0 -37
  805. package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +0 -1
  806. package/dist/src/rlc-common/helpers/nameUtils.js +0 -246
  807. package/dist/src/rlc-common/helpers/nameUtils.js.map +0 -1
  808. package/dist/src/rlc-common/helpers/operationHelpers.d.ts +0 -16
  809. package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +0 -1
  810. package/dist/src/rlc-common/helpers/operationHelpers.js +0 -119
  811. package/dist/src/rlc-common/helpers/operationHelpers.js.map +0 -1
  812. package/dist/src/rlc-common/helpers/packageUtil.d.ts +0 -7
  813. package/dist/src/rlc-common/helpers/packageUtil.d.ts.map +0 -1
  814. package/dist/src/rlc-common/helpers/packageUtil.js +0 -13
  815. package/dist/src/rlc-common/helpers/packageUtil.js.map +0 -1
  816. package/dist/src/rlc-common/helpers/pathUtils.d.ts +0 -2
  817. package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +0 -1
  818. package/dist/src/rlc-common/helpers/pathUtils.js +0 -12
  819. package/dist/src/rlc-common/helpers/pathUtils.js.map +0 -1
  820. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts +0 -10
  821. package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +0 -1
  822. package/dist/src/rlc-common/helpers/schemaHelpers.js +0 -41
  823. package/dist/src/rlc-common/helpers/schemaHelpers.js.map +0 -1
  824. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +0 -4
  825. package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +0 -1
  826. package/dist/src/rlc-common/helpers/shortcutMethods.js +0 -49
  827. package/dist/src/rlc-common/helpers/shortcutMethods.js.map +0 -1
  828. package/dist/src/rlc-common/helpers/typeUtil.d.ts +0 -32
  829. package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +0 -1
  830. package/dist/src/rlc-common/helpers/typeUtil.js +0 -167
  831. package/dist/src/rlc-common/helpers/typeUtil.js.map +0 -1
  832. package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts +0 -12
  833. package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts.map +0 -1
  834. package/dist/src/rlc-common/helpers/valueGenerationUtil.js +0 -165
  835. package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +0 -1
  836. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts +0 -6
  837. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +0 -1
  838. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +0 -56
  839. package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +0 -1
  840. package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts +0 -6
  841. package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts.map +0 -1
  842. package/dist/src/rlc-common/metadata/buildChangelogFile.js +0 -26
  843. package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +0 -1
  844. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts +0 -6
  845. package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +0 -1
  846. package/dist/src/rlc-common/metadata/buildESLintConfig.js +0 -82
  847. package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +0 -1
  848. package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts +0 -5
  849. package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts.map +0 -1
  850. package/dist/src/rlc-common/metadata/buildLicenseFile.js +0 -32
  851. package/dist/src/rlc-common/metadata/buildLicenseFile.js.map +0 -1
  852. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts +0 -25
  853. package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +0 -1
  854. package/dist/src/rlc-common/metadata/buildPackageFile.js +0 -201
  855. package/dist/src/rlc-common/metadata/buildPackageFile.js.map +0 -1
  856. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts +0 -11
  857. package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +0 -1
  858. package/dist/src/rlc-common/metadata/buildReadmeFile.js +0 -426
  859. package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +0 -1
  860. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts +0 -6
  861. package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +0 -1
  862. package/dist/src/rlc-common/metadata/buildRollupConfig.js +0 -142
  863. package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +0 -1
  864. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts +0 -6
  865. package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +0 -1
  866. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +0 -17
  867. package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +0 -1
  868. package/dist/src/rlc-common/metadata/buildTestConfig.d.ts +0 -16
  869. package/dist/src/rlc-common/metadata/buildTestConfig.d.ts.map +0 -1
  870. package/dist/src/rlc-common/metadata/buildTestConfig.js +0 -55
  871. package/dist/src/rlc-common/metadata/buildTestConfig.js.map +0 -1
  872. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts +0 -61
  873. package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +0 -1
  874. package/dist/src/rlc-common/metadata/buildTsConfig.js +0 -170
  875. package/dist/src/rlc-common/metadata/buildTsConfig.js.map +0 -1
  876. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts +0 -6
  877. package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +0 -1
  878. package/dist/src/rlc-common/metadata/buildVitestConfig.js +0 -28
  879. package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +0 -1
  880. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts +0 -20
  881. package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +0 -1
  882. package/dist/src/rlc-common/metadata/buildWarpConfig.js +0 -77
  883. package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +0 -1
  884. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +0 -51
  885. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +0 -1
  886. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +0 -121
  887. package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +0 -1
  888. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts +0 -242
  889. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +0 -1
  890. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +0 -176
  891. package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +0 -1
  892. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts +0 -8
  893. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +0 -1
  894. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +0 -102
  895. package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +0 -1
  896. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts +0 -57
  897. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts.map +0 -1
  898. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +0 -53
  899. package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +0 -1
  900. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts +0 -64
  901. package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +0 -1
  902. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +0 -183
  903. package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +0 -1
  904. package/dist/src/rlc-common/static/paginateContent.d.ts +0 -2
  905. package/dist/src/rlc-common/static/paginateContent.d.ts.map +0 -1
  906. package/dist/src/rlc-common/static/paginateContent.js +0 -345
  907. package/dist/src/rlc-common/static/paginateContent.js.map +0 -1
  908. package/dist/src/rlc-common/static/pollingContent.d.ts +0 -2
  909. package/dist/src/rlc-common/static/pollingContent.d.ts.map +0 -1
  910. package/dist/src/rlc-common/static/pollingContent.js +0 -225
  911. package/dist/src/rlc-common/static/pollingContent.js.map +0 -1
  912. package/dist/src/rlc-common/static/sampleTemplate.d.ts +0 -2
  913. package/dist/src/rlc-common/static/sampleTemplate.d.ts.map +0 -1
  914. package/dist/src/rlc-common/static/sampleTemplate.js +0 -56
  915. package/dist/src/rlc-common/static/sampleTemplate.js.map +0 -1
  916. package/dist/src/rlc-common/static/serializeHelper.d.ts +0 -6
  917. package/dist/src/rlc-common/static/serializeHelper.d.ts.map +0 -1
  918. package/dist/src/rlc-common/static/serializeHelper.js +0 -31
  919. package/dist/src/rlc-common/static/serializeHelper.js.map +0 -1
  920. package/dist/src/rlc-common/test/buildKarmaConfig.d.ts +0 -6
  921. package/dist/src/rlc-common/test/buildKarmaConfig.d.ts.map +0 -1
  922. package/dist/src/rlc-common/test/buildKarmaConfig.js +0 -11
  923. package/dist/src/rlc-common/test/buildKarmaConfig.js.map +0 -1
  924. package/dist/src/rlc-common/test/buildRecordedClient.d.ts +0 -6
  925. package/dist/src/rlc-common/test/buildRecordedClient.d.ts.map +0 -1
  926. package/dist/src/rlc-common/test/buildRecordedClient.js +0 -18
  927. package/dist/src/rlc-common/test/buildRecordedClient.js.map +0 -1
  928. package/dist/src/rlc-common/test/buildSampleTest.d.ts +0 -6
  929. package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +0 -1
  930. package/dist/src/rlc-common/test/buildSampleTest.js +0 -15
  931. package/dist/src/rlc-common/test/buildSampleTest.js.map +0 -1
  932. package/dist/src/rlc-common/test/buildSnippets.d.ts +0 -6
  933. package/dist/src/rlc-common/test/buildSnippets.d.ts.map +0 -1
  934. package/dist/src/rlc-common/test/buildSnippets.js +0 -29
  935. package/dist/src/rlc-common/test/buildSnippets.js.map +0 -1
  936. package/dist/src/rlc-common/transformSampleGroups.d.ts +0 -9
  937. package/dist/src/rlc-common/transformSampleGroups.d.ts.map +0 -1
  938. package/dist/src/rlc-common/transformSampleGroups.js +0 -317
  939. package/dist/src/rlc-common/transformSampleGroups.js.map +0 -1
  940. package/dist/src/transform/transformApiVersionInfo.d.ts +0 -6
  941. package/dist/src/transform/transformApiVersionInfo.d.ts.map +0 -1
  942. package/dist/src/transform/transformApiVersionInfo.js +0 -80
  943. package/dist/src/transform/transformApiVersionInfo.js.map +0 -1
  944. package/dist/src/transform/transformHelperFunctionDetails.d.ts +0 -5
  945. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +0 -1
  946. package/dist/src/transform/transformHelperFunctionDetails.js +0 -77
  947. package/dist/src/transform/transformHelperFunctionDetails.js.map +0 -1
  948. package/dist/src/transform/transformParameters.d.ts +0 -14
  949. package/dist/src/transform/transformParameters.d.ts.map +0 -1
  950. package/dist/src/transform/transformParameters.js +0 -214
  951. package/dist/src/transform/transformParameters.js.map +0 -1
  952. package/dist/src/transform/transformPaths.d.ts +0 -5
  953. package/dist/src/transform/transformPaths.d.ts.map +0 -1
  954. package/dist/src/transform/transformPaths.js +0 -106
  955. package/dist/src/transform/transformPaths.js.map +0 -1
  956. package/dist/src/transform/transformResponses.d.ts +0 -5
  957. package/dist/src/transform/transformResponses.d.ts.map +0 -1
  958. package/dist/src/transform/transformResponses.js +0 -175
  959. package/dist/src/transform/transformResponses.js.map +0 -1
  960. package/dist/src/transform/transformSchemas.d.ts +0 -4
  961. package/dist/src/transform/transformSchemas.d.ts.map +0 -1
  962. package/dist/src/transform/transformSchemas.js +0 -202
  963. package/dist/src/transform/transformSchemas.js.map +0 -1
  964. package/dist/src/transform/transformTelemetryInfo.d.ts +0 -4
  965. package/dist/src/transform/transformTelemetryInfo.d.ts.map +0 -1
  966. package/dist/src/transform/transformTelemetryInfo.js +0 -22
  967. package/dist/src/transform/transformTelemetryInfo.js.map +0 -1
  968. package/dist/src/transform/transfromRLCOptions.d.ts +0 -14
  969. package/dist/src/transform/transfromRLCOptions.d.ts.map +0 -1
  970. package/dist/src/transform/transfromRLCOptions.js +0 -380
  971. package/dist/src/transform/transfromRLCOptions.js.map +0 -1
  972. package/dist/src/utils/clientUtils.d.ts +0 -10
  973. package/dist/src/utils/clientUtils.d.ts.map +0 -1
  974. package/dist/src/utils/clientUtils.js +0 -132
  975. package/dist/src/utils/clientUtils.js.map +0 -1
  976. package/dist/src/utils/credentialUtils.d.ts +0 -15
  977. package/dist/src/utils/credentialUtils.d.ts.map +0 -1
  978. package/dist/src/utils/credentialUtils.js +0 -69
  979. package/dist/src/utils/credentialUtils.js.map +0 -1
  980. package/dist/src/utils/crossLanguageDef.d.ts +0 -6
  981. package/dist/src/utils/crossLanguageDef.d.ts.map +0 -1
  982. package/dist/src/utils/crossLanguageDef.js +0 -63
  983. package/dist/src/utils/crossLanguageDef.js.map +0 -1
  984. package/dist/src/utils/emitUtil.d.ts +0 -5
  985. package/dist/src/utils/emitUtil.d.ts.map +0 -1
  986. package/dist/src/utils/emitUtil.js +0 -73
  987. package/dist/src/utils/emitUtil.js.map +0 -1
  988. package/dist/src/utils/fileSystemUtils.d.ts +0 -3
  989. package/dist/src/utils/fileSystemUtils.d.ts.map +0 -1
  990. package/dist/src/utils/fileSystemUtils.js +0 -40
  991. package/dist/src/utils/fileSystemUtils.js.map +0 -1
  992. package/dist/src/utils/importHelper.d.ts +0 -10
  993. package/dist/src/utils/importHelper.d.ts.map +0 -1
  994. package/dist/src/utils/importHelper.js +0 -54
  995. package/dist/src/utils/importHelper.js.map +0 -1
  996. package/dist/src/utils/mediaTypes.d.ts +0 -28
  997. package/dist/src/utils/mediaTypes.d.ts.map +0 -1
  998. package/dist/src/utils/mediaTypes.js +0 -136
  999. package/dist/src/utils/mediaTypes.js.map +0 -1
  1000. package/dist/src/utils/modelUtils.d.ts +0 -60
  1001. package/dist/src/utils/modelUtils.d.ts.map +0 -1
  1002. package/dist/src/utils/modelUtils.js +0 -1577
  1003. package/dist/src/utils/modelUtils.js.map +0 -1
  1004. package/dist/src/utils/namespaceUtils.d.ts +0 -6
  1005. package/dist/src/utils/namespaceUtils.d.ts.map +0 -1
  1006. package/dist/src/utils/namespaceUtils.js +0 -70
  1007. package/dist/src/utils/namespaceUtils.js.map +0 -1
  1008. package/dist/src/utils/operationUtil.d.ts +0 -97
  1009. package/dist/src/utils/operationUtil.d.ts.map +0 -1
  1010. package/dist/src/utils/operationUtil.js +0 -568
  1011. package/dist/src/utils/operationUtil.js.map +0 -1
  1012. package/dist/src/utils/parameterUtils.d.ts +0 -9
  1013. package/dist/src/utils/parameterUtils.d.ts.map +0 -1
  1014. package/dist/src/utils/parameterUtils.js +0 -154
  1015. package/dist/src/utils/parameterUtils.js.map +0 -1
  1016. package/src/contextManager.ts +0 -104
  1017. package/src/framework/hooks/sdkTypes.ts +0 -245
  1018. package/src/framework/hooks/useDependencies.ts +0 -18
  1019. package/src/metaTree.ts +0 -8
  1020. package/src/modular/buildClassicalClient.ts +0 -511
  1021. package/src/modular/buildClassicalOperationGroups.ts +0 -94
  1022. package/src/modular/buildClientContext.ts +0 -354
  1023. package/src/modular/buildModularOptions.ts +0 -23
  1024. package/src/modular/buildOperations.ts +0 -275
  1025. package/src/modular/buildProjectFiles.ts +0 -140
  1026. package/src/modular/buildRestorePoller.ts +0 -261
  1027. package/src/modular/buildRootIndex.ts +0 -481
  1028. package/src/modular/buildSubpathIndex.ts +0 -175
  1029. package/src/modular/emitLoggerFile.ts +0 -28
  1030. package/src/modular/emitModels.ts +0 -1211
  1031. package/src/modular/emitModelsOptions.ts +0 -62
  1032. package/src/modular/emitSamples.ts +0 -763
  1033. package/src/modular/emitTests.ts +0 -227
  1034. package/src/modular/helpers/classicalOperationHelpers.ts +0 -428
  1035. package/src/modular/helpers/clientHelpers.ts +0 -409
  1036. package/src/modular/helpers/clientOptionHelpers.ts +0 -129
  1037. package/src/modular/helpers/exampleValueHelpers.ts +0 -967
  1038. package/src/modular/helpers/namingHelpers.ts +0 -100
  1039. package/src/modular/helpers/operationHelpers.ts +0 -3362
  1040. package/src/modular/helpers/typeHelpers.ts +0 -142
  1041. package/src/modular/serialization/buildDeserializerFunction.ts +0 -598
  1042. package/src/modular/serialization/buildSerializerFunction.ts +0 -654
  1043. package/src/modular/serialization/buildXmlSerializerFunction.ts +0 -1030
  1044. package/src/modular/serialization/serializeUtils.ts +0 -227
  1045. package/src/rlc-common/buildClient.ts +0 -561
  1046. package/src/rlc-common/buildClientDefinitions.ts +0 -278
  1047. package/src/rlc-common/buildIndexFile.ts +0 -344
  1048. package/src/rlc-common/buildIsUnexpectedHelper.ts +0 -255
  1049. package/src/rlc-common/buildLogger.ts +0 -43
  1050. package/src/rlc-common/buildMethodShortcuts.ts +0 -83
  1051. package/src/rlc-common/buildObjectTypes.ts +0 -680
  1052. package/src/rlc-common/buildPaginateHelper.ts +0 -34
  1053. package/src/rlc-common/buildParameterTypes.ts +0 -575
  1054. package/src/rlc-common/buildPollingHelper.ts +0 -83
  1055. package/src/rlc-common/buildResponseTypes.ts +0 -203
  1056. package/src/rlc-common/buildSamples.ts +0 -32
  1057. package/src/rlc-common/buildSchemaType.ts +0 -81
  1058. package/src/rlc-common/buildSerializeHelper.ts +0 -49
  1059. package/src/rlc-common/buildTopLevelIndexFile.ts +0 -65
  1060. package/src/rlc-common/helpers/apiVersionUtil.ts +0 -53
  1061. package/src/rlc-common/helpers/importsUtil.ts +0 -187
  1062. package/src/rlc-common/helpers/nameConstructors.ts +0 -144
  1063. package/src/rlc-common/helpers/nameUtils.ts +0 -319
  1064. package/src/rlc-common/helpers/operationHelpers.ts +0 -155
  1065. package/src/rlc-common/helpers/pathUtils.ts +0 -15
  1066. package/src/rlc-common/helpers/schemaHelpers.ts +0 -61
  1067. package/src/rlc-common/helpers/shortcutMethods.ts +0 -67
  1068. package/src/rlc-common/helpers/typeUtil.ts +0 -173
  1069. package/src/rlc-common/helpers/valueGenerationUtil.ts +0 -257
  1070. package/src/rlc-common/metadata/buildApiExtractorConfig.ts +0 -71
  1071. package/src/rlc-common/metadata/buildChangelogFile.ts +0 -29
  1072. package/src/rlc-common/metadata/buildESLintConfig.ts +0 -86
  1073. package/src/rlc-common/metadata/buildLicenseFile.ts +0 -33
  1074. package/src/rlc-common/metadata/buildPackageFile.ts +0 -250
  1075. package/src/rlc-common/metadata/buildReadmeFile.ts +0 -528
  1076. package/src/rlc-common/metadata/buildRollupConfig.ts +0 -150
  1077. package/src/rlc-common/metadata/buildSampleEnvFile.ts +0 -22
  1078. package/src/rlc-common/metadata/buildTestConfig.ts +0 -72
  1079. package/src/rlc-common/metadata/buildTsConfig.ts +0 -222
  1080. package/src/rlc-common/metadata/buildVitestConfig.ts +0 -36
  1081. package/src/rlc-common/metadata/buildWarpConfig.ts +0 -94
  1082. package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +0 -161
  1083. package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +0 -220
  1084. package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +0 -134
  1085. package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +0 -70
  1086. package/src/rlc-common/metadata/packageJson/packageCommon.ts +0 -255
  1087. package/src/rlc-common/test/buildKarmaConfig.ts +0 -12
  1088. package/src/rlc-common/test/buildRecordedClient.ts +0 -18
  1089. package/src/rlc-common/test/buildSampleTest.ts +0 -15
  1090. package/src/rlc-common/test/buildSnippets.ts +0 -35
  1091. package/src/rlc-common/transformSampleGroups.ts +0 -458
  1092. package/src/transform/transformApiVersionInfo.ts +0 -116
  1093. package/src/transform/transformHelperFunctionDetails.ts +0 -100
  1094. package/src/transform/transformParameters.ts +0 -371
  1095. package/src/transform/transformPaths.ts +0 -174
  1096. package/src/transform/transformResponses.ts +0 -244
  1097. package/src/transform/transformSchemas.ts +0 -230
  1098. package/src/transform/transformTelemetryInfo.ts +0 -39
  1099. package/src/transform/transfromRLCOptions.ts +0 -524
  1100. package/src/utils/clientUtils.ts +0 -181
  1101. package/src/utils/credentialUtils.ts +0 -85
  1102. package/src/utils/crossLanguageDef.ts +0 -85
  1103. package/src/utils/emitUtil.ts +0 -98
  1104. package/src/utils/fileSystemUtils.ts +0 -47
  1105. package/src/utils/importHelper.ts +0 -64
  1106. package/src/utils/mediaTypes.ts +0 -171
  1107. package/src/utils/modelUtils.ts +0 -1946
  1108. package/src/utils/namespaceUtils.ts +0 -100
  1109. package/src/utils/operationUtil.ts +0 -855
  1110. package/src/utils/parameterUtils.ts +0 -215
  1111. /package/src/modular/helpers/{docsHelpers.ts → docs-helpers.ts} +0 -0
  1112. /package/src/rlc-common/helpers/{packageUtil.ts → package-util.ts} +0 -0
  1113. /package/src/rlc-common/static/{paginateContent.ts → paginate-content.ts} +0 -0
  1114. /package/src/rlc-common/static/{pollingContent.ts → polling-content.ts} +0 -0
  1115. /package/src/rlc-common/static/{sampleTemplate.ts → sample-template.ts} +0 -0
  1116. /package/src/rlc-common/static/{serializeHelper.ts → serialize-helper.ts} +0 -0
@@ -1,1577 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { NameType, SchemaContext, isArraySchema, normalizeName } from "../rlc-common/index.js";
4
- import { NoTarget, getDiscriminator, getDoc, getEffectiveModelType, getEncode, getFormat, getFriendlyName, getLifecycleVisibilityEnum, getMaxLength, getMaxValue, getMinLength, getMinValue, getPattern, getProperty, getPropertyType, getSummary, getVisibilityForClass, isArrayModelType, isNeverType, isNullType, isNumericType, isRecordModelType, isSecret, isStringType, isTemplateDeclaration, isUnknownType, listServices } from "@typespec/compiler";
5
- import { Visibility, getHeaderFieldName, getHttpFileModel, getHttpPart, getPathParamName, getQueryParamName, isBody, isStatusCode } from "@typespec/http";
6
- import { KnownMediaType, hasMediaType, isMediaTypeMultipartFormData } from "./mediaTypes.js";
7
- import { getDefaultApiVersion, getWireName, isApiVersion } from "@azure-tools/typespec-client-generator-core";
8
- import { getUnionAsEnum } from "@azure-tools/typespec-azure-core";
9
- import { getModelNamespaceName } from "./namespaceUtils.js";
10
- import { reportDiagnostic } from "../lib.js";
11
- export const BINARY_TYPE_UNION = "string | Uint8Array | ReadableStream<Uint8Array> | NodeJS.ReadableStream";
12
- export const BINARY_AND_FILE_TYPE_UNION = `${BINARY_TYPE_UNION} | File`;
13
- export function getBinaryType(usage) {
14
- return usage.includes(SchemaContext.Output)
15
- ? "Uint8Array"
16
- : BINARY_TYPE_UNION;
17
- }
18
- export function isByteOrByteUnion(dpgContext, type) {
19
- const schema = getSchemaForType(dpgContext, type);
20
- return isBytesType(schema) || isBytesUnion(schema);
21
- }
22
- function isBytesType(schema) {
23
- return (schema.type === "string" &&
24
- (schema.format === "bytes" || schema.format === "binary"));
25
- }
26
- function isBytesUnion(schema) {
27
- if (!Array.isArray(schema.enum)) {
28
- return false;
29
- }
30
- for (const ele of schema.enum) {
31
- if (isBytesType(ele)) {
32
- return true;
33
- }
34
- }
35
- return false;
36
- }
37
- function refineByteType(schema) {
38
- schema.typeName = getBinaryType([
39
- SchemaContext.Input,
40
- SchemaContext.Exception
41
- ]);
42
- schema.outputTypeName = getBinaryType([SchemaContext.Output]);
43
- return schema;
44
- }
45
- export function enrichBinaryTypeInBody(schema) {
46
- if (isBytesType(schema)) {
47
- refineByteType(schema);
48
- }
49
- else if (isBytesUnion(schema)) {
50
- const inputType = [];
51
- for (const item of schema.enum) {
52
- if (isBytesType(item)) {
53
- refineByteType(item);
54
- }
55
- // ignore the string type for input because we already have it in bytes union
56
- if (getTypeName(item, [SchemaContext.Input]) !== "string") {
57
- inputType.push(getTypeName(item, [SchemaContext.Input]));
58
- }
59
- }
60
- // refine the input type
61
- schema.typeName = inputType.join(" | ");
62
- }
63
- return schema;
64
- }
65
- export function getSchemaForType(dpgContext, typeInput, options) {
66
- var _a, _b, _c, _d;
67
- const program = dpgContext.program;
68
- const { usage } = options !== null && options !== void 0 ? options : {};
69
- const type = getEffectiveModelFromType(dpgContext, typeInput);
70
- const builtinType = getSchemaForLiteral(type);
71
- if (builtinType !== undefined) {
72
- // add in description elements for types derived from primitive types (SecureString, etc.)
73
- const doc = getDoc(program, type);
74
- if (doc) {
75
- builtinType.description = doc;
76
- }
77
- return builtinType;
78
- }
79
- if (type.kind === "ModelProperty") {
80
- return getSchemaForType(dpgContext, type.type, options);
81
- }
82
- if (type.kind === "Model") {
83
- const httpPart = getHttpPart(program, type);
84
- if (httpPart) {
85
- const fileModel = getHttpFileModel(program, httpPart.type);
86
- if (fileModel) {
87
- const schema = getSchemaForType(dpgContext, fileModel.contents, options);
88
- return {
89
- ...schema,
90
- multipartOptions: {
91
- filenameSchema: {
92
- required: !fileModel.filename.optional,
93
- ...getSchemaForType(dpgContext, fileModel.filename, options)
94
- },
95
- contentTypeSchema: {
96
- required: !fileModel.contentType.optional,
97
- ...getSchemaForType(dpgContext, fileModel.contentType, options)
98
- }
99
- }
100
- };
101
- }
102
- else {
103
- // extract body if required
104
- const body = (httpPart.type.kind === "Model" &&
105
- [...httpPart.type.properties.values()].find((x) => isBody(program, x))) ||
106
- httpPart.type;
107
- return getSchemaForType(dpgContext, body, options);
108
- }
109
- }
110
- const schema = getSchemaForModel(dpgContext, type, options);
111
- if (isAnonymousObjectSchema(schema)) {
112
- if (Object.keys((_a = schema.properties) !== null && _a !== void 0 ? _a : {}).length === 0) {
113
- // Handle empty anonymous model as Record
114
- schema.typeName =
115
- schema.type === "object" ? "Record<string, unknown>" : "unknown";
116
- if (usage && usage.includes(SchemaContext.Output)) {
117
- schema.outputTypeName =
118
- schema.type === "object" ? "Record<string, any>" : "any";
119
- }
120
- schema.type = "unknown";
121
- }
122
- else {
123
- // Handle non-empty anonymous model as inline model
124
- if (usage && usage.includes(SchemaContext.Output)) {
125
- schema.outputTypeName = getModelInlineSigniture(schema, {
126
- usage: [SchemaContext.Output]
127
- });
128
- }
129
- schema.typeName = getModelInlineSigniture(schema, {
130
- usage: [SchemaContext.Input],
131
- multipart: (options === null || options === void 0 ? void 0 : options.isRequestBody) &&
132
- isMediaTypeMultipartFormData((_b = options === null || options === void 0 ? void 0 : options.mediaTypes) !== null && _b !== void 0 ? _b : [])
133
- });
134
- schema.type = "object";
135
- }
136
- }
137
- else if (!isArrayModelType(type) && !isRecordModelType(type)) {
138
- if (usage && usage.includes(SchemaContext.Output)) {
139
- schema.outputTypeName = `${schema.name}Output`;
140
- }
141
- schema.typeName = `${schema.name}`;
142
- }
143
- schema.usage = usage;
144
- return schema;
145
- }
146
- else if (type.kind === "Union") {
147
- return getSchemaForUnion(dpgContext, type, options);
148
- }
149
- else if (type.kind === "UnionVariant") {
150
- return getSchemaForUnionVariant(dpgContext, type, options);
151
- }
152
- else if (type.kind === "Enum") {
153
- return getSchemaForEnum(dpgContext, type);
154
- }
155
- else if (type.kind === "Scalar") {
156
- return getSchemaForScalar(dpgContext, type, options);
157
- }
158
- else if (type.kind === "EnumMember") {
159
- return getSchemaForEnumMember(program, type);
160
- }
161
- if (isUnknownType(type)) {
162
- const returnType = { name: "unknown", type: "unknown" };
163
- if (usage && usage.includes(SchemaContext.Output)) {
164
- returnType.outputTypeName = "any";
165
- returnType.typeName = "unknown";
166
- }
167
- return returnType;
168
- }
169
- if (isNeverType(type)) {
170
- return { name: "never", type: "never" };
171
- }
172
- if (isNullType(type)) {
173
- return { name: "null", type: "null" };
174
- }
175
- if (type.kind === "Intrinsic" && type.name === "void") {
176
- return { name: "void", type: "void" };
177
- }
178
- reportDiagnostic(program, {
179
- code: "invalid-schema",
180
- format: {
181
- type: type.kind,
182
- property: (_d = (_c = options === null || options === void 0 ? void 0 : options.relevantProperty) === null || _c === void 0 ? void 0 : _c.name) !== null && _d !== void 0 ? _d : ""
183
- },
184
- target: type
185
- });
186
- return undefined;
187
- }
188
- export function getEffectiveModelFromType(context, type) {
189
- /**
190
- * If type is an anonymous model, tries to find a named model that has the same
191
- * set of properties when non-schema properties are excluded.
192
- */
193
- if (type.kind === "Model" && type.name === "") {
194
- const effective = getEffectiveModelType(context.program, type, (property) => isSchemaProperty(context.program, property));
195
- if (effective.name) {
196
- return effective;
197
- }
198
- }
199
- return type;
200
- }
201
- export function includeDerivedModel(model, needRef = false) {
202
- var _a;
203
- return (!needRef &&
204
- !isTemplateDeclaration(model) &&
205
- (!model.templateMapper ||
206
- !model.templateMapper.args ||
207
- ((_a = model.templateMapper.args) === null || _a === void 0 ? void 0 : _a.length) === 0 ||
208
- model.derivedModels.length > 0));
209
- }
210
- function applyEncoding(dpgContext, typespecType, target = {}) {
211
- const encodeData = getEncode(dpgContext.program, typespecType);
212
- if (encodeData) {
213
- const newTarget = { ...target };
214
- const newType = getSchemaForScalar(dpgContext, encodeData.type);
215
- newTarget["type"] = newType["type"];
216
- newTarget["typeName"] = newType["typeName"];
217
- newTarget["outputTypeName"] = newType["outputTypeName"];
218
- // If the target already has a format it takes priority. (e.g. int32)
219
- newTarget["format"] = mergeFormatAndEncoding(newTarget.format, encodeData.encoding, newType["format"]);
220
- return newTarget;
221
- }
222
- return target;
223
- }
224
- function mergeFormatAndEncoding(format, encoding, encodeAsFormat) {
225
- var _a, _b;
226
- switch (format) {
227
- case undefined:
228
- return (_a = encodeAsFormat !== null && encodeAsFormat !== void 0 ? encodeAsFormat : encoding) !== null && _a !== void 0 ? _a : format;
229
- case "date-time":
230
- return encoding;
231
- case "duration":
232
- default:
233
- return (_b = encodeAsFormat !== null && encodeAsFormat !== void 0 ? encodeAsFormat : encoding) !== null && _b !== void 0 ? _b : format;
234
- }
235
- }
236
- function getSchemaForScalar(dpgContext, scalar, options) {
237
- let result = {};
238
- const isStd = dpgContext.program.checker.isStdType(scalar);
239
- const { relevantProperty, isRequestBody, isParentRequestBody, mediaTypes: contentTypes } = options !== null && options !== void 0 ? options : {};
240
- if (isStd) {
241
- result = getSchemaForStdScalar(dpgContext.program, scalar, {
242
- relevantProperty
243
- });
244
- }
245
- else if (scalar.baseScalar) {
246
- result = getSchemaForScalar(dpgContext, scalar.baseScalar);
247
- }
248
- if (isBinaryAsRequestBody()) {
249
- // bytes in the body of application/octet-stream is the raw binary payload/file
250
- result.typeName = BINARY_TYPE_UNION;
251
- result.outputTypeName = "Uint8Array";
252
- return result;
253
- }
254
- else if (isFormDataBytesInRequestBody()) {
255
- // bytes inside a multipart part (for now) is assumed to be file
256
- result.typeName = BINARY_AND_FILE_TYPE_UNION;
257
- result.outputTypeName = "Uint8Array";
258
- return result;
259
- }
260
- else {
261
- // for other cases we would trust the @encode decorator if not present we would treat it as string
262
- const withDecorators = applyEncoding(dpgContext, scalar, result
263
- ? applyIntrinsicDecorators(dpgContext.program, scalar, result)
264
- : undefined);
265
- if (withDecorators.type === "string" &&
266
- withDecorators.format === "binary") {
267
- withDecorators.typeName = BINARY_TYPE_UNION;
268
- withDecorators.outputTypeName = "Uint8Array";
269
- }
270
- return withDecorators;
271
- }
272
- function isBinaryAsRequestBody() {
273
- return (hasMediaType(KnownMediaType.Binary, contentTypes) &&
274
- isRequestBody &&
275
- isBytesType(result));
276
- }
277
- function isFormDataBytesInRequestBody() {
278
- return (hasMediaType(KnownMediaType.MultipartFormData, contentTypes) &&
279
- isParentRequestBody &&
280
- isBytesType(result));
281
- }
282
- }
283
- function getSchemaForUnion(dpgContext, union, options) {
284
- var _a, _b;
285
- const [asEnum, _] = getUnionAsEnum(union);
286
- const variants = Array.from(union.variants.values());
287
- const values = [];
288
- let namedUnionMember = false;
289
- if (!((options === null || options === void 0 ? void 0 : options.needRef) && union.name && !asEnum)) {
290
- if ((asEnum === null || asEnum === void 0 ? void 0 : asEnum.open) && asEnum.members.size > 0) {
291
- for (const [_, member] of asEnum.members.entries()) {
292
- const memberType = getSchemaForType(dpgContext, member.type, {
293
- ...options,
294
- needRef: (_a = options === null || options === void 0 ? void 0 : options.needRef) !== null && _a !== void 0 ? _a : false
295
- });
296
- values.push(memberType);
297
- if (memberType.name) {
298
- namedUnionMember = true;
299
- }
300
- }
301
- }
302
- else {
303
- for (const variant of variants) {
304
- // We already know it's not a model type
305
- const variantType = getSchemaForType(dpgContext, variant.type, {
306
- ...options,
307
- needRef: isAnonymousModelType(variant.type) ? false : true
308
- });
309
- values.push(variantType);
310
- if (variantType.typeName) {
311
- namedUnionMember = true;
312
- }
313
- }
314
- }
315
- }
316
- const schema = {};
317
- if (values.length > 0) {
318
- schema.enum = values;
319
- const unionAlias = (asEnum === null || asEnum === void 0 ? void 0 : asEnum.open) && (asEnum === null || asEnum === void 0 ? void 0 : asEnum.kind) && !namedUnionMember
320
- ? asEnum.kind + (asEnum.nullable ? " | null" : "")
321
- : values
322
- .map((item) => { var _a; return `${(_a = getTypeName(item, [SchemaContext.Input])) !== null && _a !== void 0 ? _a : item}`; })
323
- .join(" | ");
324
- const outputUnionAlias = (asEnum === null || asEnum === void 0 ? void 0 : asEnum.open) && (asEnum === null || asEnum === void 0 ? void 0 : asEnum.kind) && !namedUnionMember
325
- ? asEnum.kind + (asEnum.nullable ? " | null" : "")
326
- : values
327
- .map((item) => { var _a; return `${(_a = getTypeName(item, [SchemaContext.Output])) !== null && _a !== void 0 ? _a : item}`; })
328
- .join(" | ");
329
- schema.alias = unionAlias;
330
- schema.outputAlias = outputUnionAlias;
331
- }
332
- if (!union.expression) {
333
- const unionName = union.name
334
- ? normalizeName(union.name, NameType.Interface)
335
- : undefined;
336
- schema.name = unionName;
337
- schema.type = "object";
338
- schema.typeName = unionName;
339
- schema.outputTypeName = unionName + "Output";
340
- }
341
- else if (union.expression && !union.name) {
342
- schema.type = "union";
343
- schema.typeName = schema.alias;
344
- schema.outputTypeName = schema.outputAlias;
345
- delete schema.alias;
346
- delete schema.outputAlias;
347
- }
348
- else {
349
- schema.type = "union";
350
- schema.typeName = (_b = union.name) !== null && _b !== void 0 ? _b : schema.alias;
351
- schema.outputTypeName = union.name
352
- ? union.name + "Output"
353
- : schema.outputAlias;
354
- delete schema.alias;
355
- delete schema.outputAlias;
356
- }
357
- return schema;
358
- }
359
- function getSchemaForUnionVariant(dpgContext, variant, options) {
360
- return getSchemaForType(dpgContext, variant.type, options);
361
- }
362
- // An openapi "string" can be defined in several different ways in typespec
363
- function isOasString(type) {
364
- if (type.kind === "String") {
365
- // A string literal
366
- return true;
367
- }
368
- else if (type.kind === "Scalar" && type.name === "string") {
369
- // string type
370
- return true;
371
- }
372
- else if (type.kind === "Union") {
373
- // A union where all variants are an OasString
374
- for (const variant of type.variants) {
375
- if (!isOasString(variant[1].type)) {
376
- return false;
377
- }
378
- }
379
- return true;
380
- }
381
- else if (type.kind === "UnionVariant") {
382
- // A union variant where the type is an OasString
383
- return isOasString(type.type);
384
- }
385
- return false;
386
- }
387
- function isStringLiteral(type) {
388
- var _a;
389
- if (type.kind === "Union") {
390
- // A union where all variants are an OasString
391
- for (const variant of type.variants) {
392
- if (!isStringLiteral(variant[1].type)) {
393
- return false;
394
- }
395
- }
396
- return true;
397
- }
398
- return (type.kind === "String" ||
399
- (type.kind === "EnumMember" &&
400
- typeof ((_a = type.value) !== null && _a !== void 0 ? _a : type.name) === "string") ||
401
- (type.kind === "UnionVariant" && type.type.kind === "String"));
402
- }
403
- // Return any string literal values for type
404
- function getStringValues(type) {
405
- var _a;
406
- switch (type.kind) {
407
- case "String":
408
- return [type.value];
409
- case "Union":
410
- return [...type.variants.values()]
411
- .flatMap((x) => getStringValues(x.type))
412
- .filter((x) => x !== undefined);
413
- case "EnumMember":
414
- return typeof type.value !== "number" ? [(_a = type.value) !== null && _a !== void 0 ? _a : type.name] : [];
415
- case "UnionVariant":
416
- return getStringValues(type.type);
417
- default:
418
- return [];
419
- }
420
- }
421
- function validateDiscriminator(program, discriminator, derivedModels) {
422
- var _a;
423
- const { propertyName } = discriminator;
424
- const retVals = derivedModels.map((t) => {
425
- const prop = getProperty(t, propertyName);
426
- if (!prop) {
427
- reportDiagnostic(program, {
428
- code: "discriminator",
429
- messageId: "missing",
430
- target: t
431
- });
432
- return false;
433
- }
434
- let retval = true;
435
- if (!isOasString(prop.type) &&
436
- prop.type.kind !== "EnumMember" &&
437
- prop.type.kind !== "Enum") {
438
- reportDiagnostic(program, {
439
- code: "discriminator",
440
- messageId: "type",
441
- target: prop
442
- });
443
- retval = false;
444
- }
445
- if (prop.optional) {
446
- reportDiagnostic(program, {
447
- code: "discriminator",
448
- messageId: "required",
449
- target: prop
450
- });
451
- retval = false;
452
- }
453
- return retval;
454
- });
455
- // Map of discriminator value to the model in which it is declared
456
- const discriminatorValues = new Map();
457
- for (const t of derivedModels) {
458
- // Get the discriminator property directly in the child model
459
- const prop = (_a = t.properties) === null || _a === void 0 ? void 0 : _a.get(propertyName);
460
- // Issue warning diagnostic if discriminator property missing or is not a string literal
461
- if (!prop || !isStringLiteral(prop.type)) {
462
- reportDiagnostic(program, {
463
- code: "discriminator-value",
464
- messageId: "literal",
465
- target: prop || t
466
- });
467
- }
468
- if (prop) {
469
- const vals = getStringValues(prop.type);
470
- vals.forEach((val) => {
471
- if (discriminatorValues.has(val)) {
472
- reportDiagnostic(program, {
473
- code: "discriminator",
474
- messageId: "duplicate",
475
- format: {
476
- val: val,
477
- model1: discriminatorValues.get(val),
478
- model2: t.name
479
- },
480
- target: prop
481
- });
482
- retVals.push(false);
483
- }
484
- else {
485
- discriminatorValues.set(val, t.name);
486
- }
487
- });
488
- }
489
- }
490
- return retVals.every((v) => v);
491
- }
492
- function getSchemaForModel(dpgContext, model, options) {
493
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
494
- const { usage, needRef, isRequestBody, mediaTypes: contentTypes } = options !== null && options !== void 0 ? options : {};
495
- if (isArrayModelType(model)) {
496
- return getSchemaForArrayModel(dpgContext, model, options);
497
- }
498
- const program = dpgContext.program;
499
- const isMultipartBody = isMediaTypeMultipartFormData(contentTypes !== null && contentTypes !== void 0 ? contentTypes : []);
500
- const isCoreModel = isAzureCoreErrorType(program, model);
501
- const modelSchema = {
502
- name: getModelName(dpgContext, model),
503
- type: "object",
504
- isMultipartBody,
505
- description: (_a = getDoc(program, model)) !== null && _a !== void 0 ? _a : "",
506
- fromCore: isCoreModel
507
- };
508
- // normalized the output name
509
- modelSchema.name = normalizeName(modelSchema.name, NameType.Interface, true /** shouldGuard */);
510
- if (model.name === "Record" && isRecordModelType(model)) {
511
- return getSchemaForRecordModel(dpgContext, model, { usage });
512
- }
513
- modelSchema.typeName = modelSchema.name;
514
- if (usage && usage.includes(SchemaContext.Output)) {
515
- modelSchema.outputTypeName = modelSchema.name + "Output";
516
- }
517
- modelSchema.properties = {};
518
- // getSchemaOrRef on all children to push them into components.schemas
519
- const discriminator = getDiscriminator(program, model);
520
- // should respect needRef for derived models unless there's a discriminator in base model
521
- const derivedModels = model.derivedModels.filter((dm) => {
522
- return includeDerivedModel(dm, discriminator ? false : needRef);
523
- });
524
- if (derivedModels.length > 0) {
525
- modelSchema.children = {
526
- all: [],
527
- immediate: []
528
- };
529
- }
530
- for (const child of derivedModels) {
531
- const childSchema = getSchemaForType(dpgContext, child, {
532
- usage,
533
- needRef: true
534
- });
535
- for (const [name, prop] of child.properties) {
536
- if (name === (discriminator === null || discriminator === void 0 ? void 0 : discriminator.propertyName)) {
537
- const propSchema = getSchemaForType(dpgContext, prop.type, {
538
- usage,
539
- needRef: !isAnonymousModelType(prop.type),
540
- relevantProperty: prop
541
- });
542
- childSchema.discriminatorValue = propSchema.type.replace(/"/g, "");
543
- break;
544
- }
545
- }
546
- (_c = (_b = modelSchema.children) === null || _b === void 0 ? void 0 : _b.all) === null || _c === void 0 ? void 0 : _c.push(childSchema);
547
- (_e = (_d = modelSchema.children) === null || _d === void 0 ? void 0 : _d.immediate) === null || _e === void 0 ? void 0 : _e.push(childSchema);
548
- }
549
- // Enable option `isPolyParent` and discriminator only when it has valid children
550
- if (discriminator &&
551
- ((_g = (_f = modelSchema === null || modelSchema === void 0 ? void 0 : modelSchema.children) === null || _f === void 0 ? void 0 : _f.all) === null || _g === void 0 ? void 0 : _g.length) &&
552
- ((_j = (_h = modelSchema === null || modelSchema === void 0 ? void 0 : modelSchema.children) === null || _h === void 0 ? void 0 : _h.all) === null || _j === void 0 ? void 0 : _j.length) > 0) {
553
- if (!validateDiscriminator(program, discriminator, derivedModels)) {
554
- // appropriate diagnostic is generated in the validate function
555
- return {};
556
- }
557
- const { propertyName } = discriminator;
558
- modelSchema.discriminator = {
559
- name: propertyName,
560
- type: "string",
561
- description: `Discriminator property for ${model.name}.`
562
- };
563
- modelSchema.discriminatorValue = propertyName;
564
- modelSchema.isPolyParent = true;
565
- }
566
- // applyExternalDocs(model, modelSchema);
567
- if (needRef) {
568
- return modelSchema;
569
- }
570
- if (isRecordModelType(model)) {
571
- modelSchema.parents = {
572
- all: [getSchemaForRecordModel(dpgContext, model, { usage })],
573
- immediate: [getSchemaForRecordModel(dpgContext, model, { usage })]
574
- };
575
- }
576
- for (const [propName, prop] of model.properties) {
577
- const restApiName = getWireName(dpgContext, prop);
578
- const name = `"${restApiName !== null && restApiName !== void 0 ? restApiName : propName}"`;
579
- if (!isSchemaProperty(program, prop)) {
580
- continue;
581
- }
582
- const propSchema = getSchemaForType(dpgContext, prop.type, {
583
- usage,
584
- needRef: isAnonymousModelType(prop.type) ? false : true,
585
- relevantProperty: prop,
586
- isParentRequestBody: isRequestBody,
587
- isRequestBody: false,
588
- mediaTypes: contentTypes
589
- });
590
- if (propSchema === undefined) {
591
- continue;
592
- }
593
- if (!prop.optional) {
594
- propSchema.required = true;
595
- }
596
- const propertyDescription = getFormattedPropertyDoc(program, prop, propSchema);
597
- propSchema.usage = usage;
598
- // Use the description from ModelProperty not derived from Model Type
599
- propSchema.description = propertyDescription;
600
- modelSchema.properties[name] = propSchema;
601
- // if this property is a discriminator property, remove it to keep autorest validation happy
602
- const { propertyName } = getDiscriminator(program, model) || {};
603
- if (propertyName &&
604
- name === `"${propertyName}"` &&
605
- modelSchema.discriminator) {
606
- modelSchema.discriminator = {
607
- ...modelSchema.discriminator,
608
- ...{
609
- type: (_k = propSchema.typeName) !== null && _k !== void 0 ? _k : propSchema.type,
610
- typeName: propSchema.typeName,
611
- outputTypeName: propSchema.outputTypeName
612
- }
613
- };
614
- continue;
615
- }
616
- // Apply decorators on the property to the type's schema
617
- const newPropSchema = applyIntrinsicDecorators(program, prop, propSchema);
618
- if (newPropSchema === undefined) {
619
- continue;
620
- }
621
- // Use the description from ModelProperty not devired from Model Type
622
- newPropSchema.description = propertyDescription;
623
- // Should the property be marked as readOnly?
624
- const vis = getSdkVisibility(program, prop);
625
- if (vis && vis.includes(Visibility.Read)) {
626
- const mutability = [];
627
- if (vis.includes(Visibility.Read)) {
628
- if (vis.length > 1) {
629
- mutability.push(SchemaContext.Output);
630
- }
631
- else {
632
- newPropSchema["readOnly"] = true;
633
- }
634
- }
635
- if (vis.includes(Visibility.Create) || vis.includes(Visibility.Update)) {
636
- mutability.push(SchemaContext.Input);
637
- }
638
- if (mutability.length > 0) {
639
- newPropSchema["usage"] = mutability;
640
- }
641
- }
642
- modelSchema.properties[name] = newPropSchema;
643
- }
644
- if (model.baseModel) {
645
- if (modelSchema.parents === undefined) {
646
- modelSchema.parents = {
647
- all: [],
648
- immediate: []
649
- };
650
- }
651
- (_l = modelSchema.parents.all) === null || _l === void 0 ? void 0 : _l.push(getSchemaForType(dpgContext, model.baseModel, {
652
- usage,
653
- needRef: true
654
- }));
655
- (_m = modelSchema.parents.immediate) === null || _m === void 0 ? void 0 : _m.push(getSchemaForType(dpgContext, model.baseModel, {
656
- usage,
657
- needRef: true
658
- }));
659
- }
660
- return modelSchema;
661
- }
662
- function getSdkVisibility(program, type) {
663
- const lifecycle = getLifecycleVisibilityEnum(program);
664
- const visibility = getVisibilityForClass(program, type, lifecycle);
665
- if (visibility) {
666
- const result = [];
667
- if (lifecycle.members.get("Read") &&
668
- visibility.has(lifecycle.members.get("Read"))) {
669
- result.push(Visibility.Read);
670
- }
671
- if (lifecycle.members.get("Create") &&
672
- visibility.has(lifecycle.members.get("Create"))) {
673
- result.push(Visibility.Create);
674
- }
675
- if (lifecycle.members.get("Update") &&
676
- visibility.has(lifecycle.members.get("Update"))) {
677
- result.push(Visibility.Update);
678
- }
679
- if (lifecycle.members.get("Delete") &&
680
- visibility.has(lifecycle.members.get("Delete"))) {
681
- result.push(Visibility.Delete);
682
- }
683
- if (lifecycle.members.get("Query") &&
684
- visibility.has(lifecycle.members.get("Query"))) {
685
- result.push(Visibility.Query);
686
- }
687
- return result;
688
- }
689
- return undefined;
690
- }
691
- /**
692
- * Return the model name for a given model
693
- */
694
- function getModelName(dpgContext, model) {
695
- var _a, _b;
696
- const { program } = dpgContext;
697
- // 1. check if this is an anonymous model
698
- if (model.name === "") {
699
- return "";
700
- }
701
- // 2. check if there's a friendly name
702
- const friendlyName = getFriendlyName(program, model);
703
- if (friendlyName) {
704
- return friendlyName;
705
- }
706
- // 3. check if this is an Azure Core error model
707
- const isCoreModel = isAzureCoreErrorType(program, model);
708
- if (isCoreModel) {
709
- return model.name;
710
- }
711
- // 4. check if this is a model with template arguments
712
- let name = model.name;
713
- if ((_a = model.templateMapper) === null || _a === void 0 ? void 0 : _a.args) {
714
- // const isPage = getPagedResult(program, model);
715
- const templateTypeNames = model.templateMapper.args
716
- .map((arg) => (arg.entityKind === "Indeterminate" ? arg.type : arg))
717
- .map((arg) => {
718
- var _a, _b;
719
- switch (arg.kind) {
720
- case "Model":
721
- case "Enum":
722
- case "Union":
723
- case "Scalar":
724
- return (_a = arg.name) !== null && _a !== void 0 ? _a : "";
725
- case "String":
726
- case "Boolean":
727
- case "Number":
728
- return (_b = arg.value) !== null && _b !== void 0 ? _b : "";
729
- default:
730
- return "";
731
- }
732
- })
733
- .filter((arg) => arg !== "")
734
- .join(" ");
735
- name = normalizeName(`${name} ${templateTypeNames}`, NameType.Interface);
736
- }
737
- let fullNamespacePrefix = getModelNamespaceName(dpgContext, model.namespace)
738
- .map((nsName) => {
739
- return normalizeName(nsName, NameType.Interface);
740
- })
741
- .join("");
742
- if (fullNamespacePrefix.startsWith("AzureResourceManager") ||
743
- fullNamespacePrefix.startsWith("AzureCore") ||
744
- fullNamespacePrefix.startsWith("TypeSpecRest") ||
745
- fullNamespacePrefix.startsWith("TypeSpecHttp")) {
746
- fullNamespacePrefix = "";
747
- }
748
- // 5. check if this model should be namespaced
749
- return ((_b = dpgContext.rlcOptions) === null || _b === void 0 ? void 0 : _b.enableModelNamespace)
750
- ? `${fullNamespacePrefix}${name}`
751
- : name;
752
- }
753
- // Map an typespec type to an OA schema. Returns undefined when the resulting
754
- // OA schema is just a regular object schema.
755
- function getSchemaForLiteral(type) {
756
- switch (type.kind) {
757
- case "Number":
758
- return { type: `${type.value}`, isConstant: true };
759
- case "String":
760
- return { type: `"${type.value}"`, isConstant: true };
761
- case "Boolean":
762
- return { type: `${type.value}`, isConstant: true };
763
- }
764
- if (type.kind === undefined) {
765
- if (typeof type === "string") {
766
- return { type: `"${type}"` };
767
- }
768
- else if (typeof type === "number" || typeof type === "boolean") {
769
- return { type: `${type}` };
770
- }
771
- }
772
- return undefined;
773
- }
774
- function applyIntrinsicDecorators(program, type, target) {
775
- const newTarget = { ...target };
776
- const docStr = getDoc(program, type);
777
- const isString = isStringType(program, getPropertyType(type));
778
- const isNumeric = isNumericType(program, getPropertyType(type));
779
- if (isString && !(target === null || target === void 0 ? void 0 : target.documentation) && docStr) {
780
- newTarget.description = docStr;
781
- }
782
- const summaryStr = getSummary(program, type);
783
- if (isString && !target.summary && summaryStr) {
784
- newTarget.summary = summaryStr;
785
- }
786
- const formatStr = getFormat(program, type);
787
- if (isString && !target.format && formatStr) {
788
- newTarget.format = formatStr;
789
- }
790
- const pattern = getPattern(program, type);
791
- if (isString && !target.pattern && pattern) {
792
- newTarget.pattern = pattern;
793
- }
794
- const minLength = getMinLength(program, type);
795
- if (isString && !target.minLength && minLength !== undefined) {
796
- newTarget.minLength = minLength;
797
- }
798
- const maxLength = getMaxLength(program, type);
799
- if (isString && !target.maxLength && maxLength !== undefined) {
800
- newTarget.maxLength = maxLength;
801
- }
802
- const minValue = getMinValue(program, type);
803
- if (isNumeric && !target.minimum && minValue !== undefined) {
804
- newTarget.minimum = minValue;
805
- }
806
- const maxValue = getMaxValue(program, type);
807
- if (isNumeric && !target.maximum && maxValue !== undefined) {
808
- newTarget.maximum = maxValue;
809
- }
810
- if (isSecret(program, type)) {
811
- newTarget.format = "password";
812
- newTarget["x-ms-secret"] = true;
813
- }
814
- return newTarget;
815
- }
816
- function getSchemaForEnumMember(program, e) {
817
- var _a;
818
- const value = (_a = e.value) !== null && _a !== void 0 ? _a : e.name;
819
- const type = enumMemberType(e) === "string" ? `"${value}"` : `${value}`;
820
- return { type, description: getDoc(program, e), isConstant: true };
821
- }
822
- function getSchemaForEnum(dpgContext, e) {
823
- const values = [];
824
- const memberValues = Array.from(e.members.values());
825
- if (memberValues.length === 0) {
826
- return {};
827
- }
828
- const type = enumMemberType(memberValues[0]);
829
- for (const option of memberValues) {
830
- if (type !== enumMemberType(option)) {
831
- reportDiagnostic(dpgContext.program, {
832
- code: "union-unsupported",
833
- target: e
834
- });
835
- continue;
836
- }
837
- values.push(getSchemaForType(dpgContext, option));
838
- }
839
- const schema = {
840
- type: "object",
841
- name: e.name,
842
- typeName: normalizeName(e.name, NameType.Interface),
843
- outputTypeName: normalizeName(e.name, NameType.Interface) + "Output",
844
- description: getDoc(dpgContext.program, e),
845
- memberType: type
846
- };
847
- if (values.length > 0) {
848
- schema.enum = values;
849
- const unionAlias = values
850
- .map((item) => { var _a; return `${(_a = getTypeName(item, [SchemaContext.Input])) !== null && _a !== void 0 ? _a : item}`; })
851
- .join(" | ");
852
- schema.alias = unionAlias;
853
- schema.outputAlias = unionAlias;
854
- }
855
- return schema;
856
- }
857
- function enumMemberType(member) {
858
- const memberValue = member.value;
859
- if (typeof memberValue === "number") {
860
- return "number";
861
- }
862
- return "string";
863
- }
864
- /**
865
- * Map TypeSpec intrinsic models to open api definitions
866
- */
867
- function getSchemaForArrayModel(dpgContext, type, options) {
868
- var _a, _b, _c;
869
- const { program } = dpgContext;
870
- const { indexer } = type;
871
- const { usage, isParentRequestBody, mediaTypes: contentTypes } = options !== null && options !== void 0 ? options : {};
872
- let schema = {};
873
- if (!indexer) {
874
- return schema;
875
- }
876
- if (isArrayModelType(type)) {
877
- schema = {
878
- type: "array",
879
- items: getSchemaForType(dpgContext, indexer.value, {
880
- usage,
881
- isRequestBody: false,
882
- mediaTypes: contentTypes,
883
- // special handling for array in formdata
884
- isParentRequestBody: hasMediaType(KnownMediaType.MultipartFormData, contentTypes)
885
- ? isParentRequestBody
886
- : false,
887
- needRef: !isAnonymousModelType(indexer.value)
888
- }),
889
- description: getDoc(program, type)
890
- };
891
- if (!program.checker.isStdType(indexer.value) &&
892
- !isUnknownType(indexer.value) &&
893
- ((_a = indexer.value) === null || _a === void 0 ? void 0 : _a.kind) &&
894
- schema.items.name &&
895
- !schema.items.enum) {
896
- schema.typeName = `Array<${schema.items.name}>`;
897
- if (usage && usage.includes(SchemaContext.Output)) {
898
- schema.outputTypeName = `Array<${schema.items.name}Output>`;
899
- }
900
- }
901
- else {
902
- if (schema.items.typeName) {
903
- if (schema.items.type === "dictionary") {
904
- schema.typeName = `${schema.items.typeName}[]`;
905
- if (usage && usage.includes(SchemaContext.Output)) {
906
- schema.outputTypeName = `(${schema.items.outputTypeName})[]`;
907
- }
908
- }
909
- else if (schema.items.type === "union") {
910
- schema.typeName = `(${schema.items.typeName})[]`;
911
- if (usage && usage.includes(SchemaContext.Output)) {
912
- schema.outputTypeName = `(${schema.items.outputTypeName})[]`;
913
- }
914
- }
915
- else if (schema.items.typeName.includes(BINARY_TYPE_UNION) &&
916
- schema.items.type === "string") {
917
- schema.typeName = `(${schema.items.typeName})[]`;
918
- if (usage && usage.includes(SchemaContext.Output)) {
919
- schema.outputTypeName = `(${schema.items.outputTypeName})[]`;
920
- }
921
- }
922
- else if (isAnonymousObjectSchema(schema.items)) {
923
- schema.typeName = `${schema.items.typeName}[]`;
924
- if (usage && usage.includes(SchemaContext.Output)) {
925
- schema.outputTypeName = `${schema.items.outputTypeName}[]`;
926
- }
927
- }
928
- else {
929
- schema.typeName = schema.items.typeName
930
- .split("|")
931
- .map((typeName) => {
932
- return `${typeName}[]`;
933
- })
934
- .join(" | ");
935
- if (schema.items.outputTypeName &&
936
- usage &&
937
- usage.includes(SchemaContext.Output)) {
938
- schema.outputTypeName = schema.items.outputTypeName
939
- .split("|")
940
- .map((typeName) => {
941
- return `${typeName}[]`;
942
- })
943
- .join(" | ");
944
- }
945
- }
946
- }
947
- else if ((_c = (_b = schema.items) === null || _b === void 0 ? void 0 : _b.type) === null || _c === void 0 ? void 0 : _c.includes("|")) {
948
- schema.typeName = `(${schema.items.type})[]`;
949
- }
950
- else {
951
- schema.typeName = `${schema.items.type}[]`;
952
- }
953
- }
954
- schema.usage = usage;
955
- return schema;
956
- }
957
- }
958
- function getSchemaForRecordModel(dpgContext, type, options) {
959
- var _a, _b;
960
- const { program } = dpgContext;
961
- const { indexer } = type;
962
- const { usage } = options !== null && options !== void 0 ? options : {};
963
- let schema = {};
964
- if (!indexer) {
965
- return schema;
966
- }
967
- if (isRecordModelType(type)) {
968
- const valueType = getSchemaForType(dpgContext, indexer === null || indexer === void 0 ? void 0 : indexer.value, {
969
- usage,
970
- needRef: !isAnonymousModelType(indexer.value)
971
- });
972
- schema = {
973
- type: "dictionary",
974
- additionalProperties: valueType,
975
- description: getDoc(program, type)
976
- };
977
- if (!program.checker.isStdType(indexer.value) &&
978
- !isUnknownType(indexer.value) &&
979
- !isUnionType(indexer.value)) {
980
- schema.typeName = `Record<string, ${valueType.typeName}>`;
981
- schema.valueTypeName = valueType.name;
982
- if (usage && usage.includes(SchemaContext.Output)) {
983
- schema.outputTypeName = `Record<string, ${valueType.outputTypeName}>`;
984
- schema.outputValueTypeName = `${valueType.outputTypeName}`;
985
- }
986
- }
987
- else if (isUnknownType(indexer.value)) {
988
- schema.typeName = `Record<string, ${(_a = valueType.typeName) !== null && _a !== void 0 ? _a : valueType.type}>`;
989
- if (usage && usage.includes(SchemaContext.Output)) {
990
- schema.outputTypeName = `Record<string, ${(_b = valueType.outputTypeName) !== null && _b !== void 0 ? _b : valueType.type}>`;
991
- }
992
- }
993
- else {
994
- schema.typeName = `Record<string, ${getTypeName(valueType, [
995
- SchemaContext.Input
996
- ])}>`;
997
- schema.outputTypeName = `Record<string, ${getTypeName(valueType, [
998
- SchemaContext.Output
999
- ])}>`;
1000
- }
1001
- schema.usage = usage;
1002
- return schema;
1003
- }
1004
- }
1005
- function isUnionType(type) {
1006
- return type.kind === "Union";
1007
- }
1008
- export function isObjectOrDictType(schema) {
1009
- return ((schema.type === "object" &&
1010
- schema.properties !== undefined) ||
1011
- schema.type === "dictionary");
1012
- }
1013
- export function isArrayType(schema) {
1014
- return schema.type === "array";
1015
- }
1016
- function getSchemaForStdScalar(program, type, options) {
1017
- var _a, _b;
1018
- const { relevantProperty } = options !== null && options !== void 0 ? options : {};
1019
- if (!program.checker.isStdType(type)) {
1020
- return undefined;
1021
- }
1022
- /**
1023
- * lookup for @encode decorator
1024
- * if absent use typespec type (or default way of serializing that type)
1025
- * if present respect type provided in @encode
1026
- */
1027
- let format = undefined;
1028
- if (relevantProperty) {
1029
- const encodeData = getEncode(program, relevantProperty);
1030
- if (encodeData && isEncodeTypeEffective(type, encodeData)) {
1031
- type = encodeData.type;
1032
- format = encodeData.encoding;
1033
- }
1034
- }
1035
- const name = type.name;
1036
- const description = getSummary(program, type);
1037
- switch (name) {
1038
- case "bytes":
1039
- return { type: "string", format: "bytes", description };
1040
- case "integer":
1041
- return applyIntrinsicDecorators(program, type, {
1042
- type: "number"
1043
- });
1044
- case "int8":
1045
- return applyIntrinsicDecorators(program, type, {
1046
- type: "number",
1047
- format: "int8"
1048
- });
1049
- case "int16":
1050
- return applyIntrinsicDecorators(program, type, {
1051
- type: "number",
1052
- format: "int16"
1053
- });
1054
- case "int32":
1055
- return applyIntrinsicDecorators(program, type, {
1056
- type: "number",
1057
- format: "int32"
1058
- });
1059
- case "int64":
1060
- return applyIntrinsicDecorators(program, type, {
1061
- type: "number",
1062
- format: "int64"
1063
- });
1064
- case "safeint":
1065
- return applyIntrinsicDecorators(program, type, {
1066
- type: "number",
1067
- format: "safeint"
1068
- });
1069
- case "numeric":
1070
- return applyIntrinsicDecorators(program, type, {
1071
- type: "number"
1072
- });
1073
- case "uint8":
1074
- return applyIntrinsicDecorators(program, type, {
1075
- type: "number",
1076
- format: "uint8"
1077
- });
1078
- case "uint16":
1079
- return applyIntrinsicDecorators(program, type, {
1080
- type: "number",
1081
- format: "uint16"
1082
- });
1083
- case "uint32":
1084
- return applyIntrinsicDecorators(program, type, {
1085
- type: "number",
1086
- format: "uint32"
1087
- });
1088
- case "uint64":
1089
- return applyIntrinsicDecorators(program, type, {
1090
- type: "number",
1091
- format: "uint64"
1092
- });
1093
- case "float64":
1094
- return applyIntrinsicDecorators(program, type, {
1095
- type: "number",
1096
- format: "float64"
1097
- });
1098
- case "float32":
1099
- return applyIntrinsicDecorators(program, type, {
1100
- type: "number",
1101
- format: "float32"
1102
- });
1103
- case "float":
1104
- return applyIntrinsicDecorators(program, type, {
1105
- type: "number",
1106
- format: "float"
1107
- });
1108
- case "decimal":
1109
- reportDiagnostic(program, {
1110
- code: "decimal-to-number",
1111
- format: {
1112
- propertyName: (_a = relevantProperty === null || relevantProperty === void 0 ? void 0 : relevantProperty.name) !== null && _a !== void 0 ? _a : ""
1113
- },
1114
- target: relevantProperty !== null && relevantProperty !== void 0 ? relevantProperty : NoTarget
1115
- });
1116
- return applyIntrinsicDecorators(program, type, {
1117
- type: "number",
1118
- format: "decimal",
1119
- description: "decimal"
1120
- });
1121
- case "decimal128":
1122
- reportDiagnostic(program, {
1123
- code: "decimal-to-number",
1124
- format: {
1125
- propertyName: (_b = relevantProperty === null || relevantProperty === void 0 ? void 0 : relevantProperty.name) !== null && _b !== void 0 ? _b : ""
1126
- },
1127
- target: relevantProperty !== null && relevantProperty !== void 0 ? relevantProperty : NoTarget
1128
- });
1129
- return applyIntrinsicDecorators(program, type, {
1130
- type: "number",
1131
- format: "decimal128",
1132
- description: "decimal128"
1133
- });
1134
- case "string":
1135
- if (format === "binary") {
1136
- return {
1137
- type: "string",
1138
- format: "binary",
1139
- description,
1140
- typeName: BINARY_TYPE_UNION,
1141
- outputTypeName: "Uint8Array"
1142
- };
1143
- }
1144
- return applyIntrinsicDecorators(program, type, {
1145
- type: "string"
1146
- });
1147
- case "boolean":
1148
- return { type: "boolean", description };
1149
- case "plainDate":
1150
- return {
1151
- type: "string",
1152
- format,
1153
- description,
1154
- typeName: "string",
1155
- outputTypeName: "string"
1156
- };
1157
- case "utcDateTime":
1158
- return {
1159
- type: "string",
1160
- format,
1161
- description,
1162
- typeName: "Date | string",
1163
- outputTypeName: "string"
1164
- };
1165
- case "offsetDateTime":
1166
- return {
1167
- type: "string",
1168
- format: "date-time",
1169
- description,
1170
- typeName: "string",
1171
- outputTypeName: "string"
1172
- };
1173
- case "plainTime":
1174
- return {
1175
- type: "string",
1176
- format: "time",
1177
- description,
1178
- typeName: "string",
1179
- outputTypeName: "string"
1180
- };
1181
- case "duration":
1182
- return { type: "string", format, description };
1183
- case "url":
1184
- return { type: "string", format: "uri" };
1185
- }
1186
- }
1187
- function isEncodeTypeEffective(type, encodeData) {
1188
- if (!encodeData) {
1189
- return false;
1190
- }
1191
- const datetimeTypes = [
1192
- "plaindate",
1193
- "utcdatetime",
1194
- "offsetdatetime",
1195
- "plaintime"
1196
- ];
1197
- if (datetimeTypes.includes(type.name.toLowerCase()) &&
1198
- encodeData.type.name === "string") {
1199
- return false;
1200
- }
1201
- return true;
1202
- }
1203
- export function getTypeName(schema, usage) {
1204
- var _a, _b;
1205
- // TODO: Handle more cases
1206
- return (_b = (_a = getPriorityName(schema, usage)) !== null && _a !== void 0 ? _a : schema.type) !== null && _b !== void 0 ? _b : "any";
1207
- }
1208
- export function getImportedModelName(schema, usage) {
1209
- var _a, _b;
1210
- switch (schema.type) {
1211
- case "array": {
1212
- const ret = new Set();
1213
- [schema.items]
1214
- .filter((i) => !!i)
1215
- .forEach((i) => getImportedModelName(i, usage).forEach((it) => ret.add(it)));
1216
- return [...ret];
1217
- }
1218
- case "object": {
1219
- if (isAnonymousObjectSchema(schema)) {
1220
- const ret = new Set();
1221
- const properties = (_a = schema.properties) !== null && _a !== void 0 ? _a : {};
1222
- for (const name in properties) {
1223
- if (!properties[name]) {
1224
- continue;
1225
- }
1226
- getImportedModelName(properties[name], usage).forEach((it) => ret.add(it));
1227
- }
1228
- return [...ret];
1229
- }
1230
- return getPriorityName(schema, usage)
1231
- ? [getPriorityName(schema, usage)]
1232
- : [];
1233
- }
1234
- case "dictionary": {
1235
- const ret = new Set();
1236
- [schema.additionalProperties]
1237
- .filter((i) => !!i)
1238
- .forEach((i) => getImportedModelName(i, usage).forEach((it) => ret.add(it)));
1239
- return [...ret];
1240
- }
1241
- case "union": {
1242
- const ret = new Set();
1243
- ((_b = schema.enum) !== null && _b !== void 0 ? _b : [])
1244
- .filter((i) => !!i)
1245
- .forEach((i) => getImportedModelName(i, usage).forEach((it) => ret.add(it)));
1246
- return [...ret];
1247
- }
1248
- default:
1249
- return [];
1250
- }
1251
- }
1252
- function getPriorityName(schema, usage) {
1253
- var _a, _b, _c;
1254
- return usage &&
1255
- usage.includes(SchemaContext.Input) &&
1256
- !usage.includes(SchemaContext.Output)
1257
- ? ((_a = schema.typeName) !== null && _a !== void 0 ? _a : schema.name)
1258
- : ((_c = (_b = schema.outputTypeName) !== null && _b !== void 0 ? _b : schema.typeName) !== null && _c !== void 0 ? _c : schema.name);
1259
- }
1260
- function getEnumStringDescription(type) {
1261
- if ((type.name === "string" ||
1262
- type.alias === "string" ||
1263
- type.name === "number" ||
1264
- type.alias === "number" ||
1265
- type.name === "boolean" ||
1266
- type.alias === "boolean") &&
1267
- type.enum &&
1268
- type.enum.length > 0) {
1269
- return `Possible values: ${type.enum
1270
- .map((e) => {
1271
- return e.type;
1272
- })
1273
- .join(", ")}`;
1274
- }
1275
- return undefined;
1276
- }
1277
- function getBinaryDescription(type) {
1278
- var _a;
1279
- if ((_a = type === null || type === void 0 ? void 0 : type.typeName) === null || _a === void 0 ? void 0 : _a.includes(BINARY_TYPE_UNION)) {
1280
- return `Value may contain any sequence of octets`;
1281
- }
1282
- return undefined;
1283
- }
1284
- function getDecimalDescription(type) {
1285
- if ((type.format === "decimal" || type.format === "decimal128") &&
1286
- type.type === "number") {
1287
- return `NOTE: This property is represented as a 'number' in JavaScript, but it corresponds to a 'decimal' type in other languages.
1288
- Due to the inherent limitations of floating-point arithmetic in JavaScript, precision issues may arise when performing arithmetic operations.
1289
- If your application requires high precision for arithmetic operations or when round-tripping data back to other languages, consider using a library like decimal.js, which provides an arbitrary-precision Decimal type.
1290
- For simpler cases, where you need to control the number of decimal places for display purposes, you can use the 'toFixed()' method. However, be aware that 'toFixed()' returns a string and may not be suitable for all arithmetic precision requirements.
1291
- Always be cautious with direct arithmetic operations and consider implementing appropriate rounding strategies to maintain accuracy.
1292
- `;
1293
- }
1294
- return undefined;
1295
- }
1296
- export function getFormattedPropertyDoc(program, type, schemaType, sperator = "\n\n") {
1297
- var _a, _b;
1298
- const propertyDoc = getDoc(program, type);
1299
- const enhancedDocFromType = (_b = (_a = getEnumStringDescription(schemaType)) !== null && _a !== void 0 ? _a : getDecimalDescription(schemaType)) !== null && _b !== void 0 ? _b : getBinaryDescription(schemaType);
1300
- if (propertyDoc && enhancedDocFromType) {
1301
- return `${propertyDoc}${sperator}${enhancedDocFromType}`;
1302
- }
1303
- return propertyDoc !== null && propertyDoc !== void 0 ? propertyDoc : enhancedDocFromType;
1304
- }
1305
- export function getBodyType(route) {
1306
- var _a;
1307
- const bodyModel = (_a = route.parameters.body) === null || _a === void 0 ? void 0 : _a.type;
1308
- return bodyModel;
1309
- }
1310
- export function getValueTypeValue(value) {
1311
- var _a;
1312
- switch (value.valueKind) {
1313
- case "ArrayValue":
1314
- return value.values.map((x) => getValueTypeValue(x));
1315
- case "BooleanValue":
1316
- case "StringValue":
1317
- case "NullValue":
1318
- return value.value;
1319
- case "NumericValue":
1320
- return value.value.asNumber();
1321
- case "EnumValue":
1322
- return (_a = value.value.value) !== null && _a !== void 0 ? _a : value.value.name;
1323
- case "ObjectValue":
1324
- return Object.fromEntries([...value.properties.keys()].map((x) => [
1325
- x,
1326
- getValueTypeValue(value.properties.get(x).value)
1327
- ]));
1328
- default:
1329
- // TODO: handle scalar value
1330
- return undefined;
1331
- }
1332
- }
1333
- /**
1334
- * Predict if the default value exists in param, we would follow the rules:
1335
- * 1. If we have specific default literal in param
1336
- * 2. If we take the default api-version value into considerations
1337
- * @param program
1338
- * @param dpgContext
1339
- * @param param The param to predict
1340
- * @returns
1341
- */
1342
- export function predictDefaultValue(dpgContext, param) {
1343
- var _a, _b;
1344
- if (!param) {
1345
- return;
1346
- }
1347
- const program = dpgContext.program;
1348
- const specificDefault = param.defaultValue
1349
- ? getValueTypeValue(param.defaultValue)
1350
- : undefined;
1351
- if (specificDefault) {
1352
- if (typeof specificDefault === "object") {
1353
- reportDiagnostic(program, {
1354
- code: "default-value-object",
1355
- format: {
1356
- propertyName: param.name
1357
- },
1358
- target: param
1359
- });
1360
- return specificDefault.toString();
1361
- }
1362
- return specificDefault;
1363
- }
1364
- const serviceNamespace = (_b = getDefaultService(program, (_a = dpgContext.rlcOptions) === null || _a === void 0 ? void 0 : _a.isModularLibrary)) === null || _b === void 0 ? void 0 : _b.type;
1365
- if (!serviceNamespace) {
1366
- return;
1367
- }
1368
- const defaultApiVersion = getDefaultApiVersionString(dpgContext);
1369
- if (param && isApiVersion(dpgContext, param) && defaultApiVersion) {
1370
- return defaultApiVersion;
1371
- }
1372
- return;
1373
- }
1374
- export function getDefaultService(program, isModularLibrary = true) {
1375
- const services = listServices(program);
1376
- if (!services || services.length === 0) {
1377
- reportDiagnostic(program, {
1378
- code: "no-service-defined",
1379
- target: NoTarget
1380
- });
1381
- }
1382
- if (services.length > 1 && !isModularLibrary) {
1383
- reportDiagnostic(program, {
1384
- code: "more-than-one-service",
1385
- target: NoTarget
1386
- });
1387
- }
1388
- return services[0];
1389
- }
1390
- /**
1391
- * Return the default api version from the program; undefined if no default
1392
- */
1393
- export function getDefaultApiVersionString(dpgContext) {
1394
- var _a, _b;
1395
- const program = dpgContext.program;
1396
- const isModularLibrary = (_a = dpgContext.rlcOptions) === null || _a === void 0 ? void 0 : _a.isModularLibrary;
1397
- return getDefaultService(program, isModularLibrary)
1398
- ? (_b = getDefaultApiVersion(dpgContext, getDefaultService(program, isModularLibrary).type)) === null || _b === void 0 ? void 0 : _b.value
1399
- : undefined;
1400
- }
1401
- export function trimUsage(model) {
1402
- if (typeof model !== "object") {
1403
- return model;
1404
- }
1405
- const tmpModel = Object.assign({}, model);
1406
- const tmpModelKeys = Object.keys(tmpModel).filter((item) => {
1407
- return item !== "usage";
1408
- });
1409
- const ordered = tmpModelKeys.sort().reduce((obj, key) => {
1410
- obj[key] = trimUsage(tmpModel[key]);
1411
- return obj;
1412
- }, {});
1413
- return ordered;
1414
- }
1415
- export function isAzureCoreErrorType(program, t) {
1416
- if (!t || t.kind !== "Model") {
1417
- return false;
1418
- }
1419
- const effective = getEffectiveSchemaType(program, t);
1420
- if (!["error", "errorresponse", "innererror"].includes(effective.name.toLowerCase())) {
1421
- return false;
1422
- }
1423
- return isAzureCoreFoundationsNamespace(effective);
1424
- }
1425
- function isAzureCoreFoundationsNamespace(t, skipFoundation = false) {
1426
- var _a;
1427
- const namespaces = (skipFoundation ? ".Azure.Core" : ".Azure.Core.Foundations").split(".");
1428
- while (namespaces.length > 0 &&
1429
- ((t === null || t === void 0 ? void 0 : t.kind) === "Model" ||
1430
- (t === null || t === void 0 ? void 0 : t.kind) === "Enum" ||
1431
- (t === null || t === void 0 ? void 0 : t.kind) === "Union" ||
1432
- (t === null || t === void 0 ? void 0 : t.kind) === "Namespace") &&
1433
- ((_a = t.namespace) === null || _a === void 0 ? void 0 : _a.name) === namespaces.pop()) {
1434
- t = t.namespace;
1435
- }
1436
- return namespaces.length == 0;
1437
- }
1438
- // Check if the schema is an anonymous object
1439
- export function isAnonymousObjectSchema(schema) {
1440
- return schema.name === "" && schema.type === "object";
1441
- }
1442
- // Check if the type is an anonymous model
1443
- export function isAnonymousModelType(type) {
1444
- if (type.kind === "Model") {
1445
- return type.name === "";
1446
- }
1447
- return false;
1448
- }
1449
- /**
1450
- * Get the inline signiture of the model
1451
- * @param schema object schema detail
1452
- * @param options other optional parameters
1453
- * @returns
1454
- */
1455
- export function getModelInlineSigniture(schema, options = {}) {
1456
- if (options.multipart) {
1457
- return getMultipartInlineSignature(schema, options.importedModels, options.usage);
1458
- }
1459
- let schemaSignature = `{`;
1460
- for (const propName in schema.properties) {
1461
- const propType = schema.properties[propName];
1462
- const propTypeName = getTypeName(propType, options.usage);
1463
- if (!propType || !propTypeName) {
1464
- continue;
1465
- }
1466
- if (options.importedModels) {
1467
- const importNames = getImportedModelName(propType);
1468
- if (importNames) {
1469
- importNames.forEach(options.importedModels.add, options.importedModels);
1470
- }
1471
- }
1472
- const isOptional = propType.required ? "" : "?";
1473
- schemaSignature += `${propName}${isOptional}: ${propTypeName};`;
1474
- }
1475
- schemaSignature += `}`;
1476
- return schemaSignature;
1477
- }
1478
- function getMultipartInlineSignature(schema, importedModels, usage) {
1479
- var _a;
1480
- const types = Object.entries((_a = schema.properties) !== null && _a !== void 0 ? _a : {})
1481
- .map(([propertyName, property]) => {
1482
- let schema;
1483
- // Flatten arrays for file uploads
1484
- if (isArraySchema(property) &&
1485
- property.items &&
1486
- getTypeName(property.items, usage).includes(BINARY_AND_FILE_TYPE_UNION)) {
1487
- schema = property.items;
1488
- }
1489
- else {
1490
- schema = property;
1491
- }
1492
- const typeName = getTypeName(schema, usage);
1493
- if (!typeName) {
1494
- return undefined;
1495
- }
1496
- const importNames = getImportedModelName(schema);
1497
- if (importedModels && importNames) {
1498
- importNames.forEach(importedModels.add.bind(importedModels));
1499
- }
1500
- if (typeName.includes("File")) {
1501
- return `{ name: ${propertyName}, body: ${typeName}, filename?: string, contentType?: string }`;
1502
- }
1503
- else {
1504
- return `{ name: ${propertyName}, body: ${typeName} }`;
1505
- }
1506
- })
1507
- .filter(Boolean)
1508
- .join(" | ");
1509
- return `FormData | Array<${types}>`;
1510
- }
1511
- /**
1512
- * A "schema property" here is a property that is emitted to OpenAPI schema.
1513
- *
1514
- * Headers, parameters, status codes are not schema properties even they are
1515
- * represented as properties in typespec.
1516
- */
1517
- export function isSchemaProperty(program, property) {
1518
- var _a;
1519
- const headerInfo = getHeaderFieldName(program, property);
1520
- const queryInfo = getQueryParamName(program, property);
1521
- const pathInfo = getPathParamName(program, property);
1522
- const statusCodeInfo = isStatusCode(program, property);
1523
- const isNonVisibility = (_a = getSdkVisibility(program, property)) === null || _a === void 0 ? void 0 : _a.includes(Visibility.None);
1524
- return !(headerInfo ||
1525
- queryInfo ||
1526
- pathInfo ||
1527
- statusCodeInfo ||
1528
- isNonVisibility);
1529
- }
1530
- export function getEffectiveSchemaType(program, type) {
1531
- var _a, _b;
1532
- // If type is an anonymous model, tries to find a named model that has the same properties
1533
- let effective = undefined;
1534
- if (type.kind === "Union") {
1535
- const nonNullOptions = [...type.variants.values()]
1536
- .map((x) => x.type)
1537
- .filter((t) => !isNullType(t));
1538
- if (nonNullOptions.length === 1 &&
1539
- ((_a = nonNullOptions[0]) === null || _a === void 0 ? void 0 : _a.kind) === "Model" &&
1540
- ((_b = nonNullOptions[0]) === null || _b === void 0 ? void 0 : _b.name) === "") {
1541
- effective = getEffectiveModelType(program, nonNullOptions[0]);
1542
- }
1543
- return type;
1544
- }
1545
- else if (type.name === "") {
1546
- effective = getEffectiveModelType(program, type, (property) => isSchemaProperty(program, property));
1547
- }
1548
- if (effective === null || effective === void 0 ? void 0 : effective.name) {
1549
- return effective;
1550
- }
1551
- return type;
1552
- }
1553
- export function isBodyRequired(parameter) {
1554
- var _a, _b, _c;
1555
- return ((_a = parameter.body) === null || _a === void 0 ? void 0 : _a.type) && ((_c = (_b = parameter.body) === null || _b === void 0 ? void 0 : _b.property) === null || _c === void 0 ? void 0 : _c.optional) !== true
1556
- ? true
1557
- : false;
1558
- }
1559
- export function getCollectionFormat(context, param) {
1560
- const type = param.param;
1561
- const encode = getEncode(context.program, param.param);
1562
- if (type.type.kind === "Model" && isArrayModelType(type.type)) {
1563
- if (param.explode) {
1564
- return "multi";
1565
- }
1566
- switch (encode === null || encode === void 0 ? void 0 : encode.encoding) {
1567
- case "ArrayEncoding.pipeDelimited":
1568
- return "pipes";
1569
- case "ArrayEncoding.spaceDelimited":
1570
- return "ssv";
1571
- default:
1572
- return "csv";
1573
- }
1574
- }
1575
- return;
1576
- }
1577
- //# sourceMappingURL=modelUtils.js.map