@azure-tools/typespec-ts 0.13.0 → 0.13.1-alpha.20230609.1

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 (512) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/src/index.d.ts.map +1 -1
  3. package/dist/src/index.js +37 -1
  4. package/dist/src/index.js.map +1 -1
  5. package/dist/src/modelUtils.d.ts +2 -0
  6. package/dist/src/modelUtils.d.ts.map +1 -1
  7. package/dist/src/modelUtils.js +82 -13
  8. package/dist/src/modelUtils.js.map +1 -1
  9. package/dist/src/modular/buildApiIndex.d.ts.map +1 -1
  10. package/dist/src/modular/buildApiIndex.js +1 -1
  11. package/dist/src/modular/buildApiIndex.js.map +1 -1
  12. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
  13. package/dist/src/modular/buildClassicalClient.js +6 -6
  14. package/dist/src/modular/buildClassicalClient.js.map +1 -1
  15. package/dist/src/modular/buildClientContext.d.ts.map +1 -1
  16. package/dist/src/modular/buildClientContext.js +9 -3
  17. package/dist/src/modular/buildClientContext.js.map +1 -1
  18. package/dist/src/modular/buildCodeModel.d.ts.map +1 -1
  19. package/dist/src/modular/buildCodeModel.js +190 -169
  20. package/dist/src/modular/buildCodeModel.js.map +1 -1
  21. package/dist/src/modular/buildOperations.d.ts.map +1 -1
  22. package/dist/src/modular/buildOperations.js +20 -2
  23. package/dist/src/modular/buildOperations.js.map +1 -1
  24. package/dist/src/modular/buildRootIndex.js +2 -2
  25. package/dist/src/modular/buildRootIndex.js.map +1 -1
  26. package/dist/src/modular/buildSharedTypes.d.ts.map +1 -1
  27. package/dist/src/modular/buildSharedTypes.js +8 -10
  28. package/dist/src/modular/buildSharedTypes.js.map +1 -1
  29. package/dist/src/modular/emitModels.d.ts.map +1 -1
  30. package/dist/src/modular/emitModels.js +19 -6
  31. package/dist/src/modular/emitModels.js.map +1 -1
  32. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
  33. package/dist/src/modular/helpers/clientHelpers.js +2 -11
  34. package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
  35. package/dist/src/modular/helpers/credentialHelpers.js +1 -1
  36. package/dist/src/modular/helpers/credentialHelpers.js.map +1 -1
  37. package/dist/src/modular/helpers/fixmeHelpers.d.ts +2 -0
  38. package/dist/src/modular/helpers/fixmeHelpers.d.ts.map +1 -0
  39. package/dist/src/modular/helpers/fixmeHelpers.js +4 -0
  40. package/dist/src/modular/helpers/fixmeHelpers.js.map +1 -0
  41. package/dist/src/modular/helpers/namingHelpers.d.ts +10 -1
  42. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
  43. package/dist/src/modular/helpers/namingHelpers.js +20 -0
  44. package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
  45. package/dist/src/modular/helpers/operationHelpers.d.ts +2 -0
  46. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
  47. package/dist/src/modular/helpers/operationHelpers.js +117 -35
  48. package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
  49. package/dist/src/modular/helpers/parameterHelpers.js +1 -1
  50. package/dist/src/modular/helpers/parameterHelpers.js.map +1 -1
  51. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
  52. package/dist/src/modular/helpers/typeHelpers.js +31 -12
  53. package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
  54. package/dist/src/modular/modularCodeModel.d.ts +2 -1
  55. package/dist/src/modular/modularCodeModel.d.ts.map +1 -1
  56. package/dist/src/operationUtil.d.ts +1 -1
  57. package/dist/src/operationUtil.d.ts.map +1 -1
  58. package/dist/src/operationUtil.js +21 -3
  59. package/dist/src/operationUtil.js.map +1 -1
  60. package/dist/src/transform/transform.d.ts.map +1 -1
  61. package/dist/src/transform/transform.js +2 -2
  62. package/dist/src/transform/transform.js.map +1 -1
  63. package/dist/src/transform/transformApiVersionInfo.js +9 -0
  64. package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
  65. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
  66. package/dist/src/transform/transformHelperFunctionDetails.js +27 -1
  67. package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
  68. package/dist/src/transform/transformParameters.d.ts +1 -0
  69. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  70. package/dist/src/transform/transformParameters.js +36 -35
  71. package/dist/src/transform/transformParameters.js.map +1 -1
  72. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  73. package/dist/src/transform/transformPaths.js +9 -0
  74. package/dist/src/transform/transformPaths.js.map +1 -1
  75. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  76. package/dist/src/transform/transformResponses.js +10 -1
  77. package/dist/src/transform/transformResponses.js.map +1 -1
  78. package/dist/src/transform/transformSchemas.d.ts.map +1 -1
  79. package/dist/src/transform/transformSchemas.js +9 -0
  80. package/dist/src/transform/transformSchemas.js.map +1 -1
  81. package/dist/tsconfig.tsbuildinfo +1 -1
  82. package/package.json +20 -15
  83. package/src/index.ts +47 -2
  84. package/src/modelUtils.ts +90 -15
  85. package/src/modular/buildApiIndex.ts +3 -1
  86. package/src/modular/buildClassicalClient.ts +8 -6
  87. package/src/modular/buildClientContext.ts +11 -3
  88. package/src/modular/buildCodeModel.ts +221 -196
  89. package/src/modular/buildOperations.ts +23 -1
  90. package/src/modular/buildRootIndex.ts +2 -2
  91. package/src/modular/buildSharedTypes.ts +8 -10
  92. package/src/modular/emitModels.ts +14 -0
  93. package/src/modular/helpers/clientHelpers.ts +3 -13
  94. package/src/modular/helpers/credentialHelpers.ts +1 -1
  95. package/src/modular/helpers/fixmeHelpers.ts +3 -0
  96. package/src/modular/helpers/namingHelpers.ts +35 -1
  97. package/src/modular/helpers/operationHelpers.ts +173 -66
  98. package/src/modular/helpers/parameterHelpers.ts +1 -1
  99. package/src/modular/helpers/typeHelpers.ts +33 -12
  100. package/src/modular/modularCodeModel.ts +3 -1
  101. package/src/operationUtil.ts +24 -3
  102. package/src/transform/transform.ts +4 -1
  103. package/src/transform/transformApiVersionInfo.ts +8 -0
  104. package/src/transform/transformHelperFunctionDetails.ts +25 -1
  105. package/src/transform/transformParameters.ts +52 -41
  106. package/src/transform/transformPaths.ts +8 -0
  107. package/src/transform/transformResponses.ts +9 -1
  108. package/src/transform/transformSchemas.ts +8 -0
  109. package/.eslintrc.json +0 -23
  110. package/.prettierignore +0 -1
  111. package/.prettierrc +0 -7
  112. package/.rush/temp/operation/build/all.log +0 -1
  113. package/.rush/temp/operation/build/state.json +0 -3
  114. package/.rush/temp/package-deps_build.json +0 -442
  115. package/.rush/temp/shrinkwrap-deps.json +0 -490
  116. package/CONTRIBUTING.md +0 -137
  117. package/test/commands/cadl-ranch-list.ts +0 -116
  118. package/test/commands/check-clean-tree.ts +0 -55
  119. package/test/commands/childProcessOnExit.ts +0 -16
  120. package/test/commands/gen-cadl-ranch.ts +0 -25
  121. package/test/commands/run.ts +0 -31
  122. package/test/integration/arrayItemTypes.spec.ts +0 -96
  123. package/test/integration/authApiKey.spec.ts +0 -38
  124. package/test/integration/authOauth2.spec.ts +0 -65
  125. package/test/integration/authUnion.spec.ts +0 -72
  126. package/test/integration/azurecore.spec.ts +0 -170
  127. package/test/integration/collectionFormat.spec.ts +0 -118
  128. package/test/integration/dictionary.spec.ts +0 -106
  129. package/test/integration/extensibleEnums.spec.ts +0 -61
  130. package/test/integration/fixedEnums.spec.ts +0 -52
  131. package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +0 -35
  132. package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +0 -165
  133. package/test/integration/generated/arrays/itemTypes/src/index.ts +0 -13
  134. package/test/integration/generated/arrays/itemTypes/src/logger.ts +0 -5
  135. package/test/integration/generated/arrays/itemTypes/src/models.ts +0 -9
  136. package/test/integration/generated/arrays/itemTypes/src/outputModels.ts +0 -9
  137. package/test/integration/generated/arrays/itemTypes/src/parameters.ts +0 -86
  138. package/test/integration/generated/arrays/itemTypes/src/responses.ts +0 -115
  139. package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +0 -15
  140. package/test/integration/generated/authentication/apiKey/.eslintrc.json +0 -11
  141. package/test/integration/generated/authentication/apiKey/README.md +0 -56
  142. package/test/integration/generated/authentication/apiKey/api-extractor.json +0 -18
  143. package/test/integration/generated/authentication/apiKey/karma.conf.js +0 -133
  144. package/test/integration/generated/authentication/apiKey/package.json +0 -103
  145. package/test/integration/generated/authentication/apiKey/rollup.config.js +0 -118
  146. package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +0 -45
  147. package/test/integration/generated/authentication/apiKey/src/clientDefinitions.ts +0 -33
  148. package/test/integration/generated/authentication/apiKey/src/index.ts +0 -12
  149. package/test/integration/generated/authentication/apiKey/src/logger.ts +0 -5
  150. package/test/integration/generated/authentication/apiKey/src/outputModels.ts +0 -6
  151. package/test/integration/generated/authentication/apiKey/src/parameters.ts +0 -7
  152. package/test/integration/generated/authentication/apiKey/src/responses.ts +0 -21
  153. package/test/integration/generated/authentication/apiKey/test/public/sampleTest.spec.ts +0 -23
  154. package/test/integration/generated/authentication/apiKey/test/public/utils/env.browser.ts +0 -2
  155. package/test/integration/generated/authentication/apiKey/test/public/utils/env.ts +0 -6
  156. package/test/integration/generated/authentication/apiKey/test/public/utils/recordedClient.ts +0 -29
  157. package/test/integration/generated/authentication/apiKey/tsconfig.json +0 -25
  158. package/test/integration/generated/authentication/apiKey/tspconfig.yaml +0 -13
  159. package/test/integration/generated/authentication/oauth2/karma.conf.js +0 -133
  160. package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +0 -45
  161. package/test/integration/generated/authentication/oauth2/src/clientDefinitions.ts +0 -33
  162. package/test/integration/generated/authentication/oauth2/src/index.ts +0 -12
  163. package/test/integration/generated/authentication/oauth2/src/logger.ts +0 -5
  164. package/test/integration/generated/authentication/oauth2/src/outputModels.ts +0 -6
  165. package/test/integration/generated/authentication/oauth2/src/parameters.ts +0 -7
  166. package/test/integration/generated/authentication/oauth2/src/responses.ts +0 -21
  167. package/test/integration/generated/authentication/oauth2/test/public/sampleTest.spec.ts +0 -23
  168. package/test/integration/generated/authentication/oauth2/test/public/utils/env.browser.ts +0 -2
  169. package/test/integration/generated/authentication/oauth2/test/public/utils/env.ts +0 -6
  170. package/test/integration/generated/authentication/oauth2/test/public/utils/recordedClient.ts +0 -29
  171. package/test/integration/generated/authentication/oauth2/tspconfig.yaml +0 -15
  172. package/test/integration/generated/authentication/union/karma.conf.js +0 -133
  173. package/test/integration/generated/authentication/union/src/authUnionClient.ts +0 -46
  174. package/test/integration/generated/authentication/union/src/clientDefinitions.ts +0 -27
  175. package/test/integration/generated/authentication/union/src/index.ts +0 -11
  176. package/test/integration/generated/authentication/union/src/logger.ts +0 -5
  177. package/test/integration/generated/authentication/union/src/parameters.ts +0 -7
  178. package/test/integration/generated/authentication/union/src/responses.ts +0 -14
  179. package/test/integration/generated/authentication/union/test/public/sampleTest.spec.ts +0 -23
  180. package/test/integration/generated/authentication/union/test/public/utils/env.browser.ts +0 -2
  181. package/test/integration/generated/authentication/union/test/public/utils/env.ts +0 -6
  182. package/test/integration/generated/authentication/union/test/public/utils/recordedClient.ts +0 -29
  183. package/test/integration/generated/authentication/union/tspconfig.yaml +0 -15
  184. package/test/integration/generated/azure/core/.eslintrc.json +0 -11
  185. package/test/integration/generated/azure/core/README.md +0 -56
  186. package/test/integration/generated/azure/core/api-extractor.json +0 -18
  187. package/test/integration/generated/azure/core/package.json +0 -81
  188. package/test/integration/generated/azure/core/rollup.config.js +0 -118
  189. package/test/integration/generated/azure/core/src/azureCoreClient.ts +0 -35
  190. package/test/integration/generated/azure/core/src/clientDefinitions.ts +0 -108
  191. package/test/integration/generated/azure/core/src/index.ts +0 -16
  192. package/test/integration/generated/azure/core/src/isUnexpected.ts +0 -178
  193. package/test/integration/generated/azure/core/src/logger.ts +0 -5
  194. package/test/integration/generated/azure/core/src/models.ts +0 -18
  195. package/test/integration/generated/azure/core/src/outputModels.ts +0 -38
  196. package/test/integration/generated/azure/core/src/paginateHelper.ts +0 -204
  197. package/test/integration/generated/azure/core/src/parameters.ts +0 -68
  198. package/test/integration/generated/azure/core/src/responses.ts +0 -158
  199. package/test/integration/generated/azure/core/src/serializeHelper.ts +0 -16
  200. package/test/integration/generated/azure/core/tsconfig.json +0 -25
  201. package/test/integration/generated/azure/core/tspconfig.yaml +0 -15
  202. package/test/integration/generated/azure/core-traits/.eslintrc.json +0 -11
  203. package/test/integration/generated/azure/core-traits/README.md +0 -56
  204. package/test/integration/generated/azure/core-traits/api-extractor.json +0 -18
  205. package/test/integration/generated/azure/core-traits/package.json +0 -80
  206. package/test/integration/generated/azure/core-traits/rollup.config.js +0 -118
  207. package/test/integration/generated/azure/core-traits/src/azureCoreTraitsClient.ts +0 -35
  208. package/test/integration/generated/azure/core-traits/src/clientDefinitions.ts +0 -22
  209. package/test/integration/generated/azure/core-traits/src/index.ts +0 -13
  210. package/test/integration/generated/azure/core-traits/src/isUnexpected.ts +0 -97
  211. package/test/integration/generated/azure/core-traits/src/logger.ts +0 -5
  212. package/test/integration/generated/azure/core-traits/src/outputModels.ts +0 -25
  213. package/test/integration/generated/azure/core-traits/src/parameters.ts +0 -26
  214. package/test/integration/generated/azure/core-traits/src/responses.ts +0 -32
  215. package/test/integration/generated/azure/core-traits/tsconfig.json +0 -25
  216. package/test/integration/generated/azure/core-traits/tspconfig.yaml +0 -15
  217. package/test/integration/generated/dictionary/.eslintrc.json +0 -11
  218. package/test/integration/generated/dictionary/README.md +0 -56
  219. package/test/integration/generated/dictionary/api-extractor.json +0 -18
  220. package/test/integration/generated/dictionary/package.json +0 -80
  221. package/test/integration/generated/dictionary/rollup.config.js +0 -118
  222. package/test/integration/generated/dictionary/src/clientDefinitions.ts +0 -180
  223. package/test/integration/generated/dictionary/src/dictClient.ts +0 -33
  224. package/test/integration/generated/dictionary/src/index.ts +0 -13
  225. package/test/integration/generated/dictionary/src/logger.ts +0 -5
  226. package/test/integration/generated/dictionary/src/models.ts +0 -9
  227. package/test/integration/generated/dictionary/src/outputModels.ts +0 -9
  228. package/test/integration/generated/dictionary/src/parameters.ts +0 -94
  229. package/test/integration/generated/dictionary/src/responses.ts +0 -126
  230. package/test/integration/generated/dictionary/tsconfig.json +0 -25
  231. package/test/integration/generated/dictionary/tspconfig.yaml +0 -15
  232. package/test/integration/generated/enums/extensible/.eslintrc.json +0 -11
  233. package/test/integration/generated/enums/extensible/README.md +0 -56
  234. package/test/integration/generated/enums/extensible/api-extractor.json +0 -18
  235. package/test/integration/generated/enums/extensible/package.json +0 -80
  236. package/test/integration/generated/enums/extensible/rollup.config.js +0 -118
  237. package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +0 -45
  238. package/test/integration/generated/enums/extensible/src/index.ts +0 -11
  239. package/test/integration/generated/enums/extensible/src/logger.ts +0 -5
  240. package/test/integration/generated/enums/extensible/src/parameters.ts +0 -23
  241. package/test/integration/generated/enums/extensible/src/responses.ts +0 -26
  242. package/test/integration/generated/enums/extensible/src/typeEnumExtensible.ts +0 -35
  243. package/test/integration/generated/enums/extensible/tsconfig.json +0 -25
  244. package/test/integration/generated/enums/extensible/tspconfig.yaml +0 -14
  245. package/test/integration/generated/enums/fixed/.eslintrc.json +0 -11
  246. package/test/integration/generated/enums/fixed/README.md +0 -56
  247. package/test/integration/generated/enums/fixed/api-extractor.json +0 -18
  248. package/test/integration/generated/enums/fixed/package.json +0 -80
  249. package/test/integration/generated/enums/fixed/rollup.config.js +0 -118
  250. package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +0 -43
  251. package/test/integration/generated/enums/fixed/src/index.ts +0 -11
  252. package/test/integration/generated/enums/fixed/src/logger.ts +0 -5
  253. package/test/integration/generated/enums/fixed/src/parameters.ts +0 -36
  254. package/test/integration/generated/enums/fixed/src/responses.ts +0 -27
  255. package/test/integration/generated/enums/fixed/src/typeEnumFixed.ts +0 -35
  256. package/test/integration/generated/enums/fixed/tsconfig.json +0 -25
  257. package/test/integration/generated/enums/fixed/tspconfig.yaml +0 -14
  258. package/test/integration/generated/hello/.eslintrc.json +0 -11
  259. package/test/integration/generated/hello/README.md +0 -56
  260. package/test/integration/generated/hello/api-extractor.json +0 -18
  261. package/test/integration/generated/hello/package.json +0 -80
  262. package/test/integration/generated/hello/rollup.config.js +0 -118
  263. package/test/integration/generated/hello/src/clientDefinitions.ts +0 -19
  264. package/test/integration/generated/hello/src/hello.ts +0 -29
  265. package/test/integration/generated/hello/src/index.ts +0 -11
  266. package/test/integration/generated/hello/src/parameters.ts +0 -6
  267. package/test/integration/generated/hello/src/responses.ts +0 -10
  268. package/test/integration/generated/hello/tsconfig.json +0 -25
  269. package/test/integration/generated/hello/tspconfig.yaml +0 -14
  270. package/test/integration/generated/internal/src/clientDefinitions.ts +0 -53
  271. package/test/integration/generated/internal/src/index.ts +0 -12
  272. package/test/integration/generated/internal/src/internalClient.ts +0 -35
  273. package/test/integration/generated/internal/src/logger.ts +0 -5
  274. package/test/integration/generated/internal/src/outputModels.ts +0 -17
  275. package/test/integration/generated/internal/src/parameters.ts +0 -45
  276. package/test/integration/generated/internal/src/responses.ts +0 -33
  277. package/test/integration/generated/internal/tspconfig.yaml +0 -14
  278. package/test/integration/generated/lro/lroCore/.eslintrc.json +0 -11
  279. package/test/integration/generated/lro/lroCore/README.md +0 -56
  280. package/test/integration/generated/lro/lroCore/api-extractor.json +0 -18
  281. package/test/integration/generated/lro/lroCore/package.json +0 -82
  282. package/test/integration/generated/lro/lroCore/rollup.config.js +0 -118
  283. package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +0 -54
  284. package/test/integration/generated/lro/lroCore/src/index.ts +0 -15
  285. package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +0 -135
  286. package/test/integration/generated/lro/lroCore/src/logger.ts +0 -5
  287. package/test/integration/generated/lro/lroCore/src/models.ts +0 -8
  288. package/test/integration/generated/lro/lroCore/src/outputModels.ts +0 -50
  289. package/test/integration/generated/lro/lroCore/src/parameters.ts +0 -25
  290. package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +0 -113
  291. package/test/integration/generated/lro/lroCore/src/responses.ts +0 -109
  292. package/test/integration/generated/lro/lroCore/src/specsAzureCoreLroStandard.ts +0 -35
  293. package/test/integration/generated/lro/lroCore/tsconfig.json +0 -25
  294. package/test/integration/generated/lro/lroCore/tspconfig.yaml +0 -14
  295. package/test/integration/generated/lro/lroRPC/.eslintrc.json +0 -11
  296. package/test/integration/generated/lro/lroRPC/README.md +0 -56
  297. package/test/integration/generated/lro/lroRPC/api-extractor.json +0 -18
  298. package/test/integration/generated/lro/lroRPC/package.json +0 -82
  299. package/test/integration/generated/lro/lroRPC/rollup.config.js +0 -118
  300. package/test/integration/generated/lro/lroRPC/src/clientDefinitions.ts +0 -79
  301. package/test/integration/generated/lro/lroRPC/src/index.ts +0 -15
  302. package/test/integration/generated/lro/lroRPC/src/isUnexpected.ts +0 -153
  303. package/test/integration/generated/lro/lroRPC/src/logger.ts +0 -5
  304. package/test/integration/generated/lro/lroRPC/src/models.ts +0 -8
  305. package/test/integration/generated/lro/lroRPC/src/outputModels.ts +0 -40
  306. package/test/integration/generated/lro/lroRPC/src/parameters.ts +0 -20
  307. package/test/integration/generated/lro/lroRPC/src/pollingHelper.ts +0 -127
  308. package/test/integration/generated/lro/lroRPC/src/responses.ts +0 -124
  309. package/test/integration/generated/lro/lroRPC/src/specsAzureCoreLroRpc.ts +0 -35
  310. package/test/integration/generated/lro/lroRPC/tsconfig.json +0 -25
  311. package/test/integration/generated/lro/lroRPC/tspconfig.yaml +0 -14
  312. package/test/integration/generated/models/inheritance/.eslintrc.json +0 -11
  313. package/test/integration/generated/models/inheritance/README.md +0 -56
  314. package/test/integration/generated/models/inheritance/api-extractor.json +0 -18
  315. package/test/integration/generated/models/inheritance/package.json +0 -80
  316. package/test/integration/generated/models/inheritance/rollup.config.js +0 -118
  317. package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +0 -81
  318. package/test/integration/generated/models/inheritance/src/index.ts +0 -13
  319. package/test/integration/generated/models/inheritance/src/logger.ts +0 -5
  320. package/test/integration/generated/models/inheritance/src/models.ts +0 -52
  321. package/test/integration/generated/models/inheritance/src/outputModels.ts +0 -52
  322. package/test/integration/generated/models/inheritance/src/parameters.ts +0 -35
  323. package/test/integration/generated/models/inheritance/src/responses.ts +0 -56
  324. package/test/integration/generated/models/inheritance/src/typeModelInheritance.ts +0 -35
  325. package/test/integration/generated/models/inheritance/tsconfig.json +0 -25
  326. package/test/integration/generated/models/inheritance/tspconfig.yaml +0 -14
  327. package/test/integration/generated/models/propertyNullable/.eslintrc.json +0 -11
  328. package/test/integration/generated/models/propertyNullable/README.md +0 -56
  329. package/test/integration/generated/models/propertyNullable/api-extractor.json +0 -18
  330. package/test/integration/generated/models/propertyNullable/package.json +0 -80
  331. package/test/integration/generated/models/propertyNullable/rollup.config.js +0 -118
  332. package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +0 -227
  333. package/test/integration/generated/models/propertyNullable/src/index.ts +0 -13
  334. package/test/integration/generated/models/propertyNullable/src/logger.ts +0 -5
  335. package/test/integration/generated/models/propertyNullable/src/models.ts +0 -56
  336. package/test/integration/generated/models/propertyNullable/src/outputModels.ts +0 -56
  337. package/test/integration/generated/models/propertyNullable/src/parameters.ts +0 -197
  338. package/test/integration/generated/models/propertyNullable/src/responses.ts +0 -144
  339. package/test/integration/generated/models/propertyNullable/src/typePropertyNullable.ts +0 -35
  340. package/test/integration/generated/models/propertyNullable/tsconfig.json +0 -25
  341. package/test/integration/generated/models/propertyNullable/tspconfig.yaml +0 -14
  342. package/test/integration/generated/models/propertyOptional/.eslintrc.json +0 -11
  343. package/test/integration/generated/models/propertyOptional/README.md +0 -56
  344. package/test/integration/generated/models/propertyOptional/api-extractor.json +0 -18
  345. package/test/integration/generated/models/propertyOptional/package.json +0 -80
  346. package/test/integration/generated/models/propertyOptional/rollup.config.js +0 -118
  347. package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +0 -263
  348. package/test/integration/generated/models/propertyOptional/src/index.ts +0 -13
  349. package/test/integration/generated/models/propertyOptional/src/logger.ts +0 -5
  350. package/test/integration/generated/models/propertyOptional/src/models.ts +0 -46
  351. package/test/integration/generated/models/propertyOptional/src/outputModels.ts +0 -46
  352. package/test/integration/generated/models/propertyOptional/src/parameters.ts +0 -125
  353. package/test/integration/generated/models/propertyOptional/src/responses.ts +0 -169
  354. package/test/integration/generated/models/propertyOptional/src/typePropertyOptional.ts +0 -35
  355. package/test/integration/generated/models/propertyOptional/tsconfig.json +0 -25
  356. package/test/integration/generated/models/propertyOptional/tspconfig.yaml +0 -14
  357. package/test/integration/generated/models/propertyTypes/.eslintrc.json +0 -11
  358. package/test/integration/generated/models/propertyTypes/README.md +0 -56
  359. package/test/integration/generated/models/propertyTypes/api-extractor.json +0 -18
  360. package/test/integration/generated/models/propertyTypes/package.json +0 -80
  361. package/test/integration/generated/models/propertyTypes/rollup.config.js +0 -118
  362. package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +0 -310
  363. package/test/integration/generated/models/propertyTypes/src/index.ts +0 -13
  364. package/test/integration/generated/models/propertyTypes/src/logger.ts +0 -5
  365. package/test/integration/generated/models/propertyTypes/src/models.ts +0 -123
  366. package/test/integration/generated/models/propertyTypes/src/outputModels.ts +0 -123
  367. package/test/integration/generated/models/propertyTypes/src/parameters.ts +0 -189
  368. package/test/integration/generated/models/propertyTypes/src/responses.ts +0 -234
  369. package/test/integration/generated/models/propertyTypes/src/typePropertyValueTypes.ts +0 -35
  370. package/test/integration/generated/models/propertyTypes/tsconfig.json +0 -25
  371. package/test/integration/generated/models/propertyTypes/tspconfig.yaml +0 -14
  372. package/test/integration/generated/models/usage/.eslintrc.json +0 -11
  373. package/test/integration/generated/models/usage/README.md +0 -56
  374. package/test/integration/generated/models/usage/api-extractor.json +0 -18
  375. package/test/integration/generated/models/usage/package.json +0 -80
  376. package/test/integration/generated/models/usage/rollup.config.js +0 -118
  377. package/test/integration/generated/models/usage/src/clientDefinitions.ts +0 -41
  378. package/test/integration/generated/models/usage/src/index.ts +0 -13
  379. package/test/integration/generated/models/usage/src/logger.ts +0 -5
  380. package/test/integration/generated/models/usage/src/models.ts +0 -12
  381. package/test/integration/generated/models/usage/src/outputModels.ts +0 -12
  382. package/test/integration/generated/models/usage/src/parameters.ts +0 -19
  383. package/test/integration/generated/models/usage/src/responses.ts +0 -22
  384. package/test/integration/generated/models/usage/src/typeModelUsage.ts +0 -35
  385. package/test/integration/generated/models/usage/tsconfig.json +0 -25
  386. package/test/integration/generated/models/usage/tspconfig.yaml +0 -14
  387. package/test/integration/generated/models/visibility/.eslintrc.json +0 -11
  388. package/test/integration/generated/models/visibility/README.md +0 -56
  389. package/test/integration/generated/models/visibility/api-extractor.json +0 -18
  390. package/test/integration/generated/models/visibility/package.json +0 -80
  391. package/test/integration/generated/models/visibility/rollup.config.js +0 -118
  392. package/test/integration/generated/models/visibility/src/clientDefinitions.ts +0 -40
  393. package/test/integration/generated/models/visibility/src/index.ts +0 -13
  394. package/test/integration/generated/models/visibility/src/logger.ts +0 -5
  395. package/test/integration/generated/models/visibility/src/models.ts +0 -14
  396. package/test/integration/generated/models/visibility/src/outputModels.ts +0 -16
  397. package/test/integration/generated/models/visibility/src/parameters.ts +0 -41
  398. package/test/integration/generated/models/visibility/src/responses.ts +0 -36
  399. package/test/integration/generated/models/visibility/src/typeModelVisibility.ts +0 -35
  400. package/test/integration/generated/models/visibility/tsconfig.json +0 -25
  401. package/test/integration/generated/models/visibility/tspconfig.yaml +0 -14
  402. package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +0 -63
  403. package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +0 -35
  404. package/test/integration/generated/parameters/collection-format/src/index.ts +0 -12
  405. package/test/integration/generated/parameters/collection-format/src/logger.ts +0 -5
  406. package/test/integration/generated/parameters/collection-format/src/parameters.ts +0 -71
  407. package/test/integration/generated/parameters/collection-format/src/responses.ts +0 -34
  408. package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +0 -28
  409. package/test/integration/generated/parameters/collection-format/tspconfig.yaml +0 -14
  410. package/test/integration/generated/parameters/spread/src/clientDefinitions.ts +0 -61
  411. package/test/integration/generated/parameters/spread/src/index.ts +0 -12
  412. package/test/integration/generated/parameters/spread/src/logger.ts +0 -5
  413. package/test/integration/generated/parameters/spread/src/models.ts +0 -7
  414. package/test/integration/generated/parameters/spread/src/parameters.ts +0 -61
  415. package/test/integration/generated/parameters/spread/src/parametersSpread.ts +0 -35
  416. package/test/integration/generated/parameters/spread/src/responses.ts +0 -25
  417. package/test/integration/generated/parameters/spread/tspconfig.yaml +0 -12
  418. package/test/integration/generated/projection/src/clientDefinitions.ts +0 -71
  419. package/test/integration/generated/projection/src/index.ts +0 -12
  420. package/test/integration/generated/projection/src/logger.ts +0 -5
  421. package/test/integration/generated/projection/src/models.ts +0 -22
  422. package/test/integration/generated/projection/src/parameters.ts +0 -48
  423. package/test/integration/generated/projection/src/projectionClient.ts +0 -35
  424. package/test/integration/generated/projection/src/responses.ts +0 -34
  425. package/test/integration/generated/projection/tspconfig.yaml +0 -14
  426. package/test/integration/generated/resiliency/srvDriven1/.eslintrc.json +0 -11
  427. package/test/integration/generated/resiliency/srvDriven1/README.md +0 -56
  428. package/test/integration/generated/resiliency/srvDriven1/api-extractor.json +0 -18
  429. package/test/integration/generated/resiliency/srvDriven1/package.json +0 -80
  430. package/test/integration/generated/resiliency/srvDriven1/rollup.config.js +0 -118
  431. package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +0 -46
  432. package/test/integration/generated/resiliency/srvDriven1/src/index.ts +0 -11
  433. package/test/integration/generated/resiliency/srvDriven1/src/logger.ts +0 -5
  434. package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +0 -30
  435. package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +0 -19
  436. package/test/integration/generated/resiliency/srvDriven1/src/serviceDrivenOldClient.ts +0 -43
  437. package/test/integration/generated/resiliency/srvDriven1/tsconfig.json +0 -25
  438. package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +0 -15
  439. package/test/integration/generated/resiliency/srvDriven2/.eslintrc.json +0 -11
  440. package/test/integration/generated/resiliency/srvDriven2/README.md +0 -65
  441. package/test/integration/generated/resiliency/srvDriven2/api-extractor.json +0 -18
  442. package/test/integration/generated/resiliency/srvDriven2/package.json +0 -80
  443. package/test/integration/generated/resiliency/srvDriven2/rollup.config.js +0 -118
  444. package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +0 -57
  445. package/test/integration/generated/resiliency/srvDriven2/src/index.ts +0 -11
  446. package/test/integration/generated/resiliency/srvDriven2/src/logger.ts +0 -5
  447. package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +0 -45
  448. package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +0 -24
  449. package/test/integration/generated/resiliency/srvDriven2/src/serviceDrivenNewClient.ts +0 -43
  450. package/test/integration/generated/resiliency/srvDriven2/tsconfig.json +0 -25
  451. package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +0 -15
  452. package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +0 -35
  453. package/test/integration/generated/server/path/multiple/src/index.ts +0 -11
  454. package/test/integration/generated/server/path/multiple/src/logger.ts +0 -5
  455. package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +0 -43
  456. package/test/integration/generated/server/path/multiple/src/parameters.ts +0 -7
  457. package/test/integration/generated/server/path/multiple/src/responses.ts +0 -14
  458. package/test/integration/generated/server/path/multiple/tspconfig.yaml +0 -14
  459. package/test/integration/generated/server/path/single/src/clientDefinitions.ts +0 -19
  460. package/test/integration/generated/server/path/single/src/index.ts +0 -11
  461. package/test/integration/generated/server/path/single/src/logger.ts +0 -5
  462. package/test/integration/generated/server/path/single/src/parameters.ts +0 -6
  463. package/test/integration/generated/server/path/single/src/responses.ts +0 -9
  464. package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +0 -38
  465. package/test/integration/generated/server/path/single/tspconfig.yaml +0 -14
  466. package/test/integration/generated/specialWords/src/clientDefinitions.ts +0 -61
  467. package/test/integration/generated/specialWords/src/index.ts +0 -13
  468. package/test/integration/generated/specialWords/src/logger.ts +0 -5
  469. package/test/integration/generated/specialWords/src/models.ts +0 -17
  470. package/test/integration/generated/specialWords/src/outputModels.ts +0 -17
  471. package/test/integration/generated/specialWords/src/parameters.ts +0 -37
  472. package/test/integration/generated/specialWords/src/responses.ts +0 -31
  473. package/test/integration/generated/specialWords/src/specialWordsClient.ts +0 -35
  474. package/test/integration/generated/specialWords/tspconfig.yaml +0 -14
  475. package/test/integration/generated/unions/src/clientDefinitions.ts +0 -53
  476. package/test/integration/generated/unions/src/index.ts +0 -12
  477. package/test/integration/generated/unions/src/logger.ts +0 -5
  478. package/test/integration/generated/unions/src/models.ts +0 -27
  479. package/test/integration/generated/unions/src/parameters.ts +0 -34
  480. package/test/integration/generated/unions/src/responses.ts +0 -24
  481. package/test/integration/generated/unions/src/unionsClient.ts +0 -35
  482. package/test/integration/generated/unions/tspconfig.yaml +0 -14
  483. package/test/integration/internal.spec.ts +0 -76
  484. package/test/integration/lroCore.spec.ts +0 -89
  485. package/test/integration/modelInheritance.spec.ts +0 -192
  486. package/test/integration/modelPropertyNullable.spec.ts +0 -115
  487. package/test/integration/modelPropertyOptional.spec.ts +0 -362
  488. package/test/integration/modelPropertyType.spec.ts +0 -135
  489. package/test/integration/modelUsage.spec.ts +0 -47
  490. package/test/integration/projection.spec.ts +0 -102
  491. package/test/integration/resiliencyDpgCustomization.spec.ts +0 -147
  492. package/test/integration/server.spec.ts +0 -59
  493. package/test/integration/specialWords.spec.ts +0 -73
  494. package/test/integration/spreadParameters.spec.ts +0 -82
  495. package/test/integration/unions.spec.ts +0 -69
  496. package/test/tsconfig.json +0 -4
  497. package/test/unit/apiVersion.spec.ts +0 -400
  498. package/test/unit/azureCoreOperationsGenerator.spec.ts +0 -71
  499. package/test/unit/clientDefinitionGenerator.spec.ts +0 -73
  500. package/test/unit/clientFactoryGenerator.spec.ts +0 -404
  501. package/test/unit/docsGenerator.spec.ts +0 -201
  502. package/test/unit/modelsGenerator.spec.ts +0 -1529
  503. package/test/unit/parametersGenerator.spec.ts +0 -561
  504. package/test/unit/responsesGenerator.spec.ts +0 -462
  505. package/test/unit/spreadAndAlias.spec.ts +0 -200
  506. package/test/unit/util/emitUtil.ts +0 -166
  507. package/test/unit/util/testUtil.ts +0 -88
  508. package/test/util/customBearerTokenTestingPolicy.ts +0 -78
  509. package/test/util/matrix.ts +0 -48
  510. package/tsconfig.json +0 -36
  511. package/tsconfig.test.json +0 -7
  512. package/typespec-ts.build.log +0 -1
@@ -1,204 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import {
5
- getPagedAsyncIterator,
6
- PagedAsyncIterableIterator,
7
- PagedResult,
8
- } from "@azure/core-paging";
9
- import {
10
- Client,
11
- createRestError,
12
- PathUncheckedResponse,
13
- } from "@azure-rest/core-client";
14
-
15
- /**
16
- * Helper type to extract the type of an array
17
- */
18
- export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
19
-
20
- /**
21
- * The type of a custom function that defines how to get a page and a link to the next one if any.
22
- */
23
- export type GetPage<TPage> = (
24
- pageLink: string,
25
- maxPageSize?: number
26
- ) => Promise<{
27
- page: TPage;
28
- nextPageLink?: string;
29
- }>;
30
-
31
- /**
32
- * Options for the paging helper
33
- */
34
- export interface PagingOptions<TResponse> {
35
- /**
36
- * Custom function to extract pagination details for crating the PagedAsyncIterableIterator
37
- */
38
- customGetPage?: GetPage<PaginateReturn<TResponse>[]>;
39
- }
40
-
41
- /**
42
- * Helper type to infer the Type of the paged elements from the response type
43
- * This type is generated based on the swagger information for x-ms-pageable
44
- * specifically on the itemName property which indicates the property of the response
45
- * where the page items are found. The default value is `value`.
46
- * This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
47
- */
48
- export type PaginateReturn<TResult> = TResult extends
49
- | {
50
- body: { value?: infer TPage };
51
- }
52
- | {
53
- body: { items?: infer TPage };
54
- }
55
- ? GetArrayType<TPage>
56
- : Array<unknown>;
57
-
58
- /**
59
- * Helper to paginate results from an initial response that follows the specification of Autorest `x-ms-pageable` extension
60
- * @param client - Client to use for sending the next page requests
61
- * @param initialResponse - Initial response containing the nextLink and current page of elements
62
- * @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
63
- * @returns - PagedAsyncIterableIterator to iterate the elements
64
- */
65
- export function paginate<TResponse extends PathUncheckedResponse>(
66
- client: Client,
67
- initialResponse: TResponse,
68
- options: PagingOptions<TResponse> = {}
69
- ): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {
70
- // Extract element type from initial response
71
- type TElement = PaginateReturn<TResponse>;
72
- let firstRun = true;
73
- // We need to check the response for success before trying to inspect it looking for
74
- // the properties to use for nextLink and itemName
75
- checkPagingRequest(initialResponse);
76
- const { itemName, nextLinkName } = getPaginationProperties(initialResponse);
77
- const { customGetPage } = options;
78
- const pagedResult: PagedResult<TElement[]> = {
79
- firstPageLink: "",
80
- getPage:
81
- typeof customGetPage === "function"
82
- ? customGetPage
83
- : async (pageLink: string) => {
84
- const result = firstRun
85
- ? initialResponse
86
- : await client.pathUnchecked(pageLink).get();
87
- firstRun = false;
88
- checkPagingRequest(result);
89
- const nextLink = getNextLink(result.body, nextLinkName);
90
- const values = getElements<TElement>(result.body, itemName);
91
- return {
92
- page: values,
93
- nextPageLink: nextLink,
94
- };
95
- },
96
- };
97
-
98
- return getPagedAsyncIterator(pagedResult);
99
- }
100
-
101
- /**
102
- * Gets for the value of nextLink in the body
103
- */
104
- function getNextLink(body: unknown, nextLinkName?: string): string | undefined {
105
- if (!nextLinkName) {
106
- return undefined;
107
- }
108
-
109
- const nextLink = (body as Record<string, unknown>)[nextLinkName];
110
-
111
- if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
112
- throw new Error(
113
- `Body Property ${nextLinkName} should be a string or undefined`
114
- );
115
- }
116
-
117
- return nextLink;
118
- }
119
-
120
- /**
121
- * Gets the elements of the current request in the body.
122
- */
123
- function getElements<T = unknown>(body: unknown, itemName: string): T[] {
124
- const value = (body as Record<string, unknown>)[itemName] as T[];
125
-
126
- // value has to be an array according to the x-ms-pageable extension.
127
- // The fact that this must be an array is used above to calculate the
128
- // type of elements in the page in PaginateReturn
129
- if (!Array.isArray(value)) {
130
- throw new Error(
131
- `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`
132
- );
133
- }
134
-
135
- return value ?? [];
136
- }
137
-
138
- /**
139
- * Checks if a request failed
140
- */
141
- function checkPagingRequest(response: PathUncheckedResponse): void {
142
- const Http2xxStatusCodes = [
143
- "200",
144
- "201",
145
- "202",
146
- "203",
147
- "204",
148
- "205",
149
- "206",
150
- "207",
151
- "208",
152
- "226",
153
- ];
154
- if (!Http2xxStatusCodes.includes(response.status)) {
155
- throw createRestError(
156
- `Pagination failed with unexpected statusCode ${response.status}`,
157
- response
158
- );
159
- }
160
- }
161
-
162
- /**
163
- * Extracts the itemName and nextLinkName from the initial response to use them for pagination
164
- */
165
- function getPaginationProperties(initialResponse: PathUncheckedResponse) {
166
- // Build a set with the passed custom nextLinkNames
167
- const nextLinkNames = new Set(["nextLink"]);
168
-
169
- // Build a set with the passed custom set of itemNames
170
- const itemNames = new Set(["value", "items"]);
171
-
172
- let nextLinkName: string | undefined;
173
- let itemName: string | undefined;
174
-
175
- for (const name of nextLinkNames) {
176
- const nextLink = (initialResponse.body as Record<string, unknown>)[
177
- name
178
- ] as string;
179
- if (nextLink) {
180
- nextLinkName = name;
181
- break;
182
- }
183
- }
184
-
185
- for (const name of itemNames) {
186
- const item = (initialResponse.body as Record<string, unknown>)[
187
- name
188
- ] as string;
189
- if (item) {
190
- itemName = name;
191
- break;
192
- }
193
- }
194
-
195
- if (!itemName) {
196
- throw new Error(
197
- `Couldn't paginate response\n Body doesn't contain an array property with name: ${[
198
- ...itemNames,
199
- ].join(" OR ")}`
200
- );
201
- }
202
-
203
- return { itemName, nextLinkName };
204
- }
@@ -1,68 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import { RequestParameters } from "@azure-rest/core-client";
5
- import { User } from "./models";
6
-
7
- /** The resource instance. */
8
- export type UserResourceMergeAndPatch = Partial<User>;
9
-
10
- export interface CreateOrUpdateBodyParam {
11
- /** The resource instance. */
12
- body: UserResourceMergeAndPatch;
13
- }
14
-
15
- export interface CreateOrUpdateMediaTypesParam {
16
- /** This request has a JSON Merge Patch body. */
17
- contentType: "application/merge-patch+json";
18
- }
19
-
20
- export type CreateOrUpdateParameters = CreateOrUpdateMediaTypesParam &
21
- CreateOrUpdateBodyParam &
22
- RequestParameters;
23
-
24
- export interface CreateOrReplaceBodyParam {
25
- /** The resource instance. */
26
- body: User;
27
- }
28
-
29
- export type CreateOrReplaceParameters = CreateOrReplaceBodyParam &
30
- RequestParameters;
31
- export type GetParameters = RequestParameters;
32
-
33
- export interface ListQueryParamProperties {
34
- /** The number of result items to return. */
35
- top?: number;
36
- /** The number of result items to skip. */
37
- skip?: number;
38
- /** The maximum number of result items per page. */
39
- maxpagesize?: number;
40
- /** Expressions that specify the order of returned results. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
41
- orderby?: string;
42
- /** Filter the result list using the given expression. */
43
- filter?: string;
44
- /** Select the specified fields to be included in the response. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
45
- select?: string;
46
- /** Expand the indicated resources into the response. This parameter needs to be formatted as multi collection, we provide buildMultiCollection from serializeHelper.ts to help, you will probably need to set skipUrlEncoding as true when sending the request */
47
- expand?: string;
48
- }
49
-
50
- export interface ListQueryParam {
51
- queryParameters?: ListQueryParamProperties;
52
- }
53
-
54
- export type ListParameters = ListQueryParam & RequestParameters;
55
- export type ListWithPageParameters = RequestParameters;
56
- export type ListWithCustomPageModelParameters = RequestParameters;
57
- export type DeleteParameters = RequestParameters;
58
-
59
- export interface ExportQueryParamProperties {
60
- /** The format of the data. */
61
- format: string;
62
- }
63
-
64
- export interface ExportQueryParam {
65
- queryParameters: ExportQueryParamProperties;
66
- }
67
-
68
- export type ExportParameters = ExportQueryParam & RequestParameters;
@@ -1,158 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- import { RawHttpHeaders } from "@azure/core-rest-pipeline";
5
- import { HttpResponse, ErrorResponse } from "@azure-rest/core-client";
6
- import {
7
- UserOutput,
8
- UserListOutput,
9
- PagedUserOutput,
10
- UserListResultsOutput,
11
- } from "./outputModels";
12
-
13
- /** The request has succeeded. */
14
- export interface CreateOrUpdate200Response extends HttpResponse {
15
- status: "200";
16
- body: UserOutput;
17
- }
18
-
19
- /** The request has succeeded and a new resource has been created as a result. */
20
- export interface CreateOrUpdate201Response extends HttpResponse {
21
- status: "201";
22
- body: UserOutput;
23
- }
24
-
25
- export interface CreateOrUpdateDefaultHeaders {
26
- /** String error code indicating what went wrong. */
27
- "x-ms-error-code"?: string;
28
- }
29
-
30
- export interface CreateOrUpdateDefaultResponse extends HttpResponse {
31
- status: string;
32
- body: ErrorResponse;
33
- headers: RawHttpHeaders & CreateOrUpdateDefaultHeaders;
34
- }
35
-
36
- /** The request has succeeded. */
37
- export interface CreateOrReplace200Response extends HttpResponse {
38
- status: "200";
39
- body: UserOutput;
40
- }
41
-
42
- /** The request has succeeded and a new resource has been created as a result. */
43
- export interface CreateOrReplace201Response extends HttpResponse {
44
- status: "201";
45
- body: UserOutput;
46
- }
47
-
48
- export interface CreateOrReplaceDefaultHeaders {
49
- /** String error code indicating what went wrong. */
50
- "x-ms-error-code"?: string;
51
- }
52
-
53
- export interface CreateOrReplaceDefaultResponse extends HttpResponse {
54
- status: string;
55
- body: ErrorResponse;
56
- headers: RawHttpHeaders & CreateOrReplaceDefaultHeaders;
57
- }
58
-
59
- /** The request has succeeded. */
60
- export interface Get200Response extends HttpResponse {
61
- status: "200";
62
- body: UserOutput;
63
- }
64
-
65
- export interface GetDefaultHeaders {
66
- /** String error code indicating what went wrong. */
67
- "x-ms-error-code"?: string;
68
- }
69
-
70
- export interface GetDefaultResponse extends HttpResponse {
71
- status: string;
72
- body: ErrorResponse;
73
- headers: RawHttpHeaders & GetDefaultHeaders;
74
- }
75
-
76
- /** The request has succeeded. */
77
- export interface List200Response extends HttpResponse {
78
- status: "200";
79
- body: UserListOutput;
80
- }
81
-
82
- export interface ListDefaultHeaders {
83
- /** String error code indicating what went wrong. */
84
- "x-ms-error-code"?: string;
85
- }
86
-
87
- export interface ListDefaultResponse extends HttpResponse {
88
- status: string;
89
- body: ErrorResponse;
90
- headers: RawHttpHeaders & ListDefaultHeaders;
91
- }
92
-
93
- /** The request has succeeded. */
94
- export interface ListWithPage200Response extends HttpResponse {
95
- status: "200";
96
- body: PagedUserOutput;
97
- }
98
-
99
- export interface ListWithPageDefaultHeaders {
100
- /** String error code indicating what went wrong. */
101
- "x-ms-error-code"?: string;
102
- }
103
-
104
- export interface ListWithPageDefaultResponse extends HttpResponse {
105
- status: string;
106
- body: ErrorResponse;
107
- headers: RawHttpHeaders & ListWithPageDefaultHeaders;
108
- }
109
-
110
- /** The request has succeeded. */
111
- export interface ListWithCustomPageModel200Response extends HttpResponse {
112
- status: "200";
113
- body: UserListResultsOutput;
114
- }
115
-
116
- export interface ListWithCustomPageModelDefaultHeaders {
117
- /** String error code indicating what went wrong. */
118
- "x-ms-error-code"?: string;
119
- }
120
-
121
- export interface ListWithCustomPageModelDefaultResponse extends HttpResponse {
122
- status: string;
123
- body: ErrorResponse;
124
- headers: RawHttpHeaders & ListWithCustomPageModelDefaultHeaders;
125
- }
126
-
127
- /** There is no content to send for this request, but the headers may be useful. */
128
- export interface Delete204Response extends HttpResponse {
129
- status: "204";
130
- }
131
-
132
- export interface DeleteDefaultHeaders {
133
- /** String error code indicating what went wrong. */
134
- "x-ms-error-code"?: string;
135
- }
136
-
137
- export interface DeleteDefaultResponse extends HttpResponse {
138
- status: string;
139
- body: ErrorResponse;
140
- headers: RawHttpHeaders & DeleteDefaultHeaders;
141
- }
142
-
143
- /** The request has succeeded. */
144
- export interface Export200Response extends HttpResponse {
145
- status: "200";
146
- body: UserOutput;
147
- }
148
-
149
- export interface ExportDefaultHeaders {
150
- /** String error code indicating what went wrong. */
151
- "x-ms-error-code"?: string;
152
- }
153
-
154
- export interface ExportDefaultResponse extends HttpResponse {
155
- status: string;
156
- body: ErrorResponse;
157
- headers: RawHttpHeaders & ExportDefaultHeaders;
158
- }
@@ -1,16 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
-
4
- export function buildMultiCollection(
5
- queryParameters: string[],
6
- parameterName: string
7
- ) {
8
- return queryParameters
9
- .map((item, index) => {
10
- if (index === 0) {
11
- return item;
12
- }
13
- return `${parameterName}=${item}`;
14
- })
15
- .join("&");
16
- }
@@ -1,25 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2017",
4
- "module": "es6",
5
- "lib": [],
6
- "declaration": true,
7
- "declarationMap": true,
8
- "inlineSources": true,
9
- "sourceMap": true,
10
- "importHelpers": true,
11
- "strict": true,
12
- "alwaysStrict": true,
13
- "noUnusedLocals": true,
14
- "noUnusedParameters": true,
15
- "noImplicitReturns": true,
16
- "noFallthroughCasesInSwitch": true,
17
- "forceConsistentCasingInFileNames": true,
18
- "moduleResolution": "node",
19
- "allowSyntheticDefaultImports": true,
20
- "esModuleInterop": true,
21
- "outDir": "./dist-esm",
22
- "declarationDir": "./types"
23
- },
24
- "include": ["./src/**/*.ts"]
25
- }
@@ -1,15 +0,0 @@
1
- emit:
2
- - "@azure-tools/typespec-ts"
3
- options:
4
- "@azure-tools/typespec-ts":
5
- "emitter-output-dir": "{project-root}"
6
- generateMetadata: true
7
- generateTest: false
8
- addCredentials: false
9
- azureSdkForJs: false
10
- isCadlTest: true
11
- title: AzureCoreClient
12
- packageDetails:
13
- name: "@msinternal/azurecore"
14
- description: "AzureCore Test Service"
15
- version: "1.0.0"
@@ -1,11 +0,0 @@
1
- {
2
- "plugins": ["@azure/azure-sdk"],
3
- "extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
4
- "rules": {
5
- "@azure/azure-sdk/ts-modules-only-named": "warn",
6
- "@azure/azure-sdk/ts-apiextractor-json-types": "warn",
7
- "@azure/azure-sdk/ts-package-json-types": "warn",
8
- "@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
9
- "tsdoc/syntax": "warn"
10
- }
11
- }
@@ -1,56 +0,0 @@
1
- # AzureCoreTraits REST client library for JavaScript
2
-
3
- Illustrates Azure Core operation customizations by traits
4
-
5
- **Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
6
-
7
- Key links:
8
-
9
- - [Package (NPM)](https://www.npmjs.com/package/@msinternal/azurecoretraits)
10
-
11
- ## Getting started
12
-
13
- ### Currently supported environments
14
-
15
- - LTS versions of Node.js
16
-
17
- ### Prerequisites
18
-
19
- - You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
20
-
21
- ### Install the `@msinternal/azurecoretraits` package
22
-
23
- Install the AzureCoreTraits REST client REST client library for JavaScript with `npm`:
24
-
25
- ```bash
26
- npm install @msinternal/azurecoretraits
27
- ```
28
-
29
- ### Create and authenticate a `AzureCoreTraitsClient`
30
-
31
- To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
32
- provide an instance of the desired credential type obtained from the
33
- [@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
34
-
35
- To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
36
-
37
- After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
38
- As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
39
- can be used to authenticate the client.
40
-
41
- Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
42
- AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
43
-
44
- ## Troubleshooting
45
-
46
- ### Logging
47
-
48
- Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
49
-
50
- ```javascript
51
- const { setLogLevel } = require("@azure/logger");
52
-
53
- setLogLevel("info");
54
- ```
55
-
56
- For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
@@ -1,18 +0,0 @@
1
- {
2
- "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "mainEntryPointFilePath": "./types/index.d.ts",
4
- "docModel": { "enabled": true },
5
- "apiReport": { "enabled": true, "reportFolder": "./review" },
6
- "dtsRollup": {
7
- "enabled": true,
8
- "untrimmedFilePath": "",
9
- "publicTrimmedFilePath": "./types/azurecoretraits.d.ts"
10
- },
11
- "messages": {
12
- "tsdocMessageReporting": { "default": { "logLevel": "none" } },
13
- "extractorMessageReporting": {
14
- "ae-missing-release-tag": { "logLevel": "none" },
15
- "ae-unresolved-link": { "logLevel": "none" }
16
- }
17
- }
18
- }
@@ -1,80 +0,0 @@
1
- {
2
- "name": "@msinternal/azurecoretraits",
3
- "sdk-type": "client",
4
- "author": "Microsoft Corporation",
5
- "version": "1.0.0",
6
- "description": "AzureCoreTraits Test Service",
7
- "keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
8
- "license": "MIT",
9
- "main": "dist/index.js",
10
- "module": "./dist-esm/index.js",
11
- "types": "./types/azurecoretraits.d.ts",
12
- "repository": "github:Azure/azure-sdk-for-js",
13
- "bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
14
- "files": [
15
- "dist/",
16
- "dist-esm/",
17
- "types/azurecoretraits.d.ts",
18
- "README.md",
19
- "LICENSE",
20
- "review/*"
21
- ],
22
- "engines": { "node": ">=14.0.0" },
23
- "scripts": {
24
- "audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
25
- "build:browser": "echo skipped.",
26
- "build:node": "echo skipped.",
27
- "build:samples": "echo skipped.",
28
- "build:test": "echo skipped.",
29
- "build:debug": "echo skipped.",
30
- "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
31
- "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
32
- "execute:samples": "echo skipped",
33
- "extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
34
- "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
35
- "generate:client": "echo skipped",
36
- "integration-test:browser": "echo skipped",
37
- "integration-test:node": "echo skipped",
38
- "integration-test": "echo skipped",
39
- "lint:fix": "eslint package.json api-extractor.json src --ext .ts --fix --fix-type [problem,suggestion]",
40
- "lint": "eslint package.json api-extractor.json src --ext .ts",
41
- "pack": "npm pack 2>&1",
42
- "test:browser": "echo skipped",
43
- "test:node": "echo skipped",
44
- "test": "echo \"Error: no test specified\" && exit 1",
45
- "unit-test": "echo skipped",
46
- "unit-test:node": "echo skipped",
47
- "unit-test:browser": "echo skipped",
48
- "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
49
- "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js"
50
- },
51
- "sideEffects": false,
52
- "autoPublish": false,
53
- "dependencies": {
54
- "@azure/core-auth": "^1.3.0",
55
- "@azure-rest/core-client": "^1.1.3",
56
- "@azure/core-rest-pipeline": "^1.8.0",
57
- "@azure/logger": "^1.0.0",
58
- "tslib": "^2.2.0"
59
- },
60
- "devDependencies": {
61
- "@microsoft/api-extractor": "^7.31.1",
62
- "autorest": "latest",
63
- "@types/node": "^14.0.0",
64
- "dotenv": "^16.0.0",
65
- "eslint": "^8.0.0",
66
- "mkdirp": "^2.1.2",
67
- "prettier": "^2.5.1",
68
- "rimraf": "^3.0.0",
69
- "source-map-support": "^0.5.9",
70
- "typescript": "~5.0.0",
71
- "@rollup/plugin-commonjs": "^24.0.0",
72
- "@rollup/plugin-json": "^6.0.0",
73
- "@rollup/plugin-multi-entry": "^6.0.0",
74
- "@rollup/plugin-node-resolve": "^13.1.3",
75
- "rollup": "^2.66.1",
76
- "rollup-plugin-sourcemaps": "^0.6.3",
77
- "uglify-js": "^3.4.9"
78
- },
79
- "type": "module"
80
- }