@azure/ai-projects 1.0.0-beta.9 → 1.0.1-alpha.20250924.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 (467) hide show
  1. package/README.md +5 -136
  2. package/dist/browser/aiProjectClient.d.ts +10 -15
  3. package/dist/browser/aiProjectClient.d.ts.map +1 -1
  4. package/dist/browser/aiProjectClient.js +48 -18
  5. package/dist/browser/aiProjectClient.js.map +1 -1
  6. package/dist/browser/api/aiProjectContext.js +20 -12
  7. package/dist/browser/api/aiProjectContext.js.map +1 -1
  8. package/dist/browser/api/connections/operations.js +41 -37
  9. package/dist/browser/api/connections/operations.js.map +1 -1
  10. package/dist/browser/api/datasets/operations.d.ts +4 -4
  11. package/dist/browser/api/datasets/operations.d.ts.map +1 -1
  12. package/dist/browser/api/datasets/operations.js +72 -34
  13. package/dist/browser/api/datasets/operations.js.map +1 -1
  14. package/dist/browser/api/deployments/operations.js +25 -13
  15. package/dist/browser/api/deployments/operations.js.map +1 -1
  16. package/dist/browser/api/indexes/operations.d.ts +2 -2
  17. package/dist/browser/api/indexes/operations.d.ts.map +1 -1
  18. package/dist/browser/api/indexes/operations.js +45 -18
  19. package/dist/browser/api/indexes/operations.js.map +1 -1
  20. package/dist/browser/api/inference/operations.d.ts +0 -40
  21. package/dist/browser/api/inference/operations.d.ts.map +1 -1
  22. package/dist/browser/api/inference/operations.js +6 -87
  23. package/dist/browser/api/inference/operations.js.map +1 -1
  24. package/dist/browser/api/inference/options.d.ts +4 -1
  25. package/dist/browser/api/inference/options.d.ts.map +1 -1
  26. package/dist/browser/api/inference/options.js.map +1 -1
  27. package/dist/browser/api/telemetry/operations.d.ts +1 -1
  28. package/dist/browser/api/telemetry/operations.d.ts.map +1 -1
  29. package/dist/browser/api/telemetry/operations.js +8 -23
  30. package/dist/browser/api/telemetry/operations.js.map +1 -1
  31. package/dist/browser/classic/connections/index.js +3 -1
  32. package/dist/browser/classic/connections/index.js.map +1 -1
  33. package/dist/browser/classic/datasets/index.d.ts +2 -2
  34. package/dist/browser/classic/datasets/index.d.ts.map +1 -1
  35. package/dist/browser/classic/datasets/index.js +7 -5
  36. package/dist/browser/classic/datasets/index.js.map +1 -1
  37. package/dist/browser/classic/deployments/index.js +3 -1
  38. package/dist/browser/classic/deployments/index.js.map +1 -1
  39. package/dist/browser/classic/index.d.ts +0 -2
  40. package/dist/browser/classic/index.d.ts.map +1 -1
  41. package/dist/browser/classic/index.js.map +1 -1
  42. package/dist/browser/classic/indexes/index.d.ts +1 -1
  43. package/dist/browser/classic/indexes/index.d.ts.map +1 -1
  44. package/dist/browser/classic/indexes/index.js +4 -2
  45. package/dist/browser/classic/indexes/index.js.map +1 -1
  46. package/dist/browser/classic/inference/index.d.ts +0 -7
  47. package/dist/browser/classic/inference/index.d.ts.map +1 -1
  48. package/dist/browser/classic/inference/index.js +4 -5
  49. package/dist/browser/classic/inference/index.js.map +1 -1
  50. package/dist/browser/classic/telemetry/index.d.ts +1 -4
  51. package/dist/browser/classic/telemetry/index.d.ts.map +1 -1
  52. package/dist/browser/classic/telemetry/index.js +1 -2
  53. package/dist/browser/classic/telemetry/index.js.map +1 -1
  54. package/dist/browser/constants.d.ts +1 -1
  55. package/dist/browser/constants.d.ts.map +1 -1
  56. package/dist/browser/constants.js +1 -1
  57. package/dist/browser/constants.js.map +1 -1
  58. package/dist/browser/index.d.ts +5 -5
  59. package/dist/browser/index.d.ts.map +1 -1
  60. package/dist/browser/index.js +1 -1
  61. package/dist/browser/index.js.map +1 -1
  62. package/dist/browser/models/index.d.ts +1 -2
  63. package/dist/browser/models/index.d.ts.map +1 -1
  64. package/dist/browser/models/index.js +0 -1
  65. package/dist/browser/models/index.js.map +1 -1
  66. package/dist/browser/models/models.d.ts +3 -203
  67. package/dist/browser/models/models.d.ts.map +1 -1
  68. package/dist/browser/models/models.js +2 -249
  69. package/dist/browser/models/models.js.map +1 -1
  70. package/dist/browser/static-helpers/pagingHelpers.js +31 -50
  71. package/dist/browser/static-helpers/pagingHelpers.js.map +1 -1
  72. package/dist/browser/static-helpers/urlTemplate.js +2 -2
  73. package/dist/browser/static-helpers/urlTemplate.js.map +1 -1
  74. package/dist/commonjs/aiProjectClient.d.ts +10 -15
  75. package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
  76. package/dist/commonjs/aiProjectClient.js +58 -28
  77. package/dist/commonjs/aiProjectClient.js.map +1 -1
  78. package/dist/commonjs/api/aiProjectContext.js +20 -12
  79. package/dist/commonjs/api/aiProjectContext.js.map +1 -1
  80. package/dist/commonjs/api/connections/operations.js +41 -37
  81. package/dist/commonjs/api/connections/operations.js.map +1 -1
  82. package/dist/commonjs/api/datasets/operations.d.ts +4 -4
  83. package/dist/commonjs/api/datasets/operations.d.ts.map +1 -1
  84. package/dist/commonjs/api/datasets/operations.js +82 -44
  85. package/dist/commonjs/api/datasets/operations.js.map +1 -1
  86. package/dist/commonjs/api/deployments/operations.js +25 -13
  87. package/dist/commonjs/api/deployments/operations.js.map +1 -1
  88. package/dist/commonjs/api/indexes/operations.d.ts +2 -2
  89. package/dist/commonjs/api/indexes/operations.d.ts.map +1 -1
  90. package/dist/commonjs/api/indexes/operations.js +45 -18
  91. package/dist/commonjs/api/indexes/operations.js.map +1 -1
  92. package/dist/commonjs/api/inference/operations.d.ts +0 -40
  93. package/dist/commonjs/api/inference/operations.d.ts.map +1 -1
  94. package/dist/commonjs/api/inference/operations.js +6 -93
  95. package/dist/commonjs/api/inference/operations.js.map +1 -1
  96. package/dist/commonjs/api/inference/options.d.ts +4 -1
  97. package/dist/commonjs/api/inference/options.d.ts.map +1 -1
  98. package/dist/commonjs/api/inference/options.js.map +1 -1
  99. package/dist/commonjs/api/telemetry/operations.d.ts +1 -1
  100. package/dist/commonjs/api/telemetry/operations.d.ts.map +1 -1
  101. package/dist/commonjs/api/telemetry/operations.js +8 -23
  102. package/dist/commonjs/api/telemetry/operations.js.map +1 -1
  103. package/dist/commonjs/classic/connections/index.js +3 -1
  104. package/dist/commonjs/classic/connections/index.js.map +1 -1
  105. package/dist/commonjs/classic/datasets/index.d.ts +2 -2
  106. package/dist/commonjs/classic/datasets/index.d.ts.map +1 -1
  107. package/dist/commonjs/classic/datasets/index.js +7 -5
  108. package/dist/commonjs/classic/datasets/index.js.map +1 -1
  109. package/dist/commonjs/classic/deployments/index.js +3 -1
  110. package/dist/commonjs/classic/deployments/index.js.map +1 -1
  111. package/dist/commonjs/classic/index.d.ts +0 -2
  112. package/dist/commonjs/classic/index.d.ts.map +1 -1
  113. package/dist/commonjs/classic/index.js.map +1 -1
  114. package/dist/commonjs/classic/indexes/index.d.ts +1 -1
  115. package/dist/commonjs/classic/indexes/index.d.ts.map +1 -1
  116. package/dist/commonjs/classic/indexes/index.js +4 -2
  117. package/dist/commonjs/classic/indexes/index.js.map +1 -1
  118. package/dist/commonjs/classic/inference/index.d.ts +0 -7
  119. package/dist/commonjs/classic/inference/index.d.ts.map +1 -1
  120. package/dist/commonjs/classic/inference/index.js +3 -4
  121. package/dist/commonjs/classic/inference/index.js.map +1 -1
  122. package/dist/commonjs/classic/telemetry/index.d.ts +1 -4
  123. package/dist/commonjs/classic/telemetry/index.d.ts.map +1 -1
  124. package/dist/commonjs/classic/telemetry/index.js +1 -4
  125. package/dist/commonjs/classic/telemetry/index.js.map +1 -1
  126. package/dist/commonjs/constants.d.ts +1 -1
  127. package/dist/commonjs/constants.d.ts.map +1 -1
  128. package/dist/commonjs/constants.js +1 -1
  129. package/dist/commonjs/constants.js.map +1 -1
  130. package/dist/commonjs/index.d.ts +5 -5
  131. package/dist/commonjs/index.d.ts.map +1 -1
  132. package/dist/commonjs/index.js +1 -2
  133. package/dist/commonjs/index.js.map +1 -1
  134. package/dist/commonjs/models/index.d.ts +1 -2
  135. package/dist/commonjs/models/index.d.ts.map +1 -1
  136. package/dist/commonjs/models/index.js +1 -3
  137. package/dist/commonjs/models/index.js.map +1 -1
  138. package/dist/commonjs/models/models.d.ts +3 -203
  139. package/dist/commonjs/models/models.d.ts.map +1 -1
  140. package/dist/commonjs/models/models.js +2 -281
  141. package/dist/commonjs/models/models.js.map +1 -1
  142. package/dist/commonjs/static-helpers/pagingHelpers.js +31 -50
  143. package/dist/commonjs/static-helpers/pagingHelpers.js.map +1 -1
  144. package/dist/commonjs/static-helpers/urlTemplate.js +2 -2
  145. package/dist/commonjs/static-helpers/urlTemplate.js.map +1 -1
  146. package/dist/commonjs/tsdoc-metadata.json +11 -11
  147. package/dist/esm/aiProjectClient.d.ts +10 -15
  148. package/dist/esm/aiProjectClient.d.ts.map +1 -1
  149. package/dist/esm/aiProjectClient.js +48 -18
  150. package/dist/esm/aiProjectClient.js.map +1 -1
  151. package/dist/esm/api/aiProjectContext.js +20 -12
  152. package/dist/esm/api/aiProjectContext.js.map +1 -1
  153. package/dist/esm/api/connections/operations.js +41 -37
  154. package/dist/esm/api/connections/operations.js.map +1 -1
  155. package/dist/esm/api/datasets/operations.d.ts +4 -4
  156. package/dist/esm/api/datasets/operations.d.ts.map +1 -1
  157. package/dist/esm/api/datasets/operations.js +72 -34
  158. package/dist/esm/api/datasets/operations.js.map +1 -1
  159. package/dist/esm/api/deployments/operations.js +25 -13
  160. package/dist/esm/api/deployments/operations.js.map +1 -1
  161. package/dist/esm/api/indexes/operations.d.ts +2 -2
  162. package/dist/esm/api/indexes/operations.d.ts.map +1 -1
  163. package/dist/esm/api/indexes/operations.js +45 -18
  164. package/dist/esm/api/indexes/operations.js.map +1 -1
  165. package/dist/esm/api/inference/operations.d.ts +0 -40
  166. package/dist/esm/api/inference/operations.d.ts.map +1 -1
  167. package/dist/esm/api/inference/operations.js +6 -87
  168. package/dist/esm/api/inference/operations.js.map +1 -1
  169. package/dist/esm/api/inference/options.d.ts +4 -1
  170. package/dist/esm/api/inference/options.d.ts.map +1 -1
  171. package/dist/esm/api/inference/options.js.map +1 -1
  172. package/dist/esm/api/telemetry/operations.d.ts +1 -1
  173. package/dist/esm/api/telemetry/operations.d.ts.map +1 -1
  174. package/dist/esm/api/telemetry/operations.js +8 -23
  175. package/dist/esm/api/telemetry/operations.js.map +1 -1
  176. package/dist/esm/classic/connections/index.js +3 -1
  177. package/dist/esm/classic/connections/index.js.map +1 -1
  178. package/dist/esm/classic/datasets/index.d.ts +2 -2
  179. package/dist/esm/classic/datasets/index.d.ts.map +1 -1
  180. package/dist/esm/classic/datasets/index.js +7 -5
  181. package/dist/esm/classic/datasets/index.js.map +1 -1
  182. package/dist/esm/classic/deployments/index.js +3 -1
  183. package/dist/esm/classic/deployments/index.js.map +1 -1
  184. package/dist/esm/classic/index.d.ts +0 -2
  185. package/dist/esm/classic/index.d.ts.map +1 -1
  186. package/dist/esm/classic/index.js.map +1 -1
  187. package/dist/esm/classic/indexes/index.d.ts +1 -1
  188. package/dist/esm/classic/indexes/index.d.ts.map +1 -1
  189. package/dist/esm/classic/indexes/index.js +4 -2
  190. package/dist/esm/classic/indexes/index.js.map +1 -1
  191. package/dist/esm/classic/inference/index.d.ts +0 -7
  192. package/dist/esm/classic/inference/index.d.ts.map +1 -1
  193. package/dist/esm/classic/inference/index.js +4 -5
  194. package/dist/esm/classic/inference/index.js.map +1 -1
  195. package/dist/esm/classic/telemetry/index.d.ts +1 -4
  196. package/dist/esm/classic/telemetry/index.d.ts.map +1 -1
  197. package/dist/esm/classic/telemetry/index.js +1 -2
  198. package/dist/esm/classic/telemetry/index.js.map +1 -1
  199. package/dist/esm/constants.d.ts +1 -1
  200. package/dist/esm/constants.d.ts.map +1 -1
  201. package/dist/esm/constants.js +1 -1
  202. package/dist/esm/constants.js.map +1 -1
  203. package/dist/esm/index.d.ts +5 -5
  204. package/dist/esm/index.d.ts.map +1 -1
  205. package/dist/esm/index.js +1 -1
  206. package/dist/esm/index.js.map +1 -1
  207. package/dist/esm/models/index.d.ts +1 -2
  208. package/dist/esm/models/index.d.ts.map +1 -1
  209. package/dist/esm/models/index.js +0 -1
  210. package/dist/esm/models/index.js.map +1 -1
  211. package/dist/esm/models/models.d.ts +3 -203
  212. package/dist/esm/models/models.d.ts.map +1 -1
  213. package/dist/esm/models/models.js +2 -249
  214. package/dist/esm/models/models.js.map +1 -1
  215. package/dist/esm/static-helpers/pagingHelpers.js +31 -50
  216. package/dist/esm/static-helpers/pagingHelpers.js.map +1 -1
  217. package/dist/esm/static-helpers/urlTemplate.js +2 -2
  218. package/dist/esm/static-helpers/urlTemplate.js.map +1 -1
  219. package/dist/react-native/aiProjectClient.d.ts +10 -15
  220. package/dist/react-native/aiProjectClient.d.ts.map +1 -1
  221. package/dist/react-native/aiProjectClient.js +48 -18
  222. package/dist/react-native/aiProjectClient.js.map +1 -1
  223. package/dist/react-native/api/aiProjectContext.js +20 -12
  224. package/dist/react-native/api/aiProjectContext.js.map +1 -1
  225. package/dist/react-native/api/connections/operations.js +41 -37
  226. package/dist/react-native/api/connections/operations.js.map +1 -1
  227. package/dist/react-native/api/datasets/operations.d.ts +4 -4
  228. package/dist/react-native/api/datasets/operations.d.ts.map +1 -1
  229. package/dist/react-native/api/datasets/operations.js +72 -34
  230. package/dist/react-native/api/datasets/operations.js.map +1 -1
  231. package/dist/react-native/api/deployments/operations.js +25 -13
  232. package/dist/react-native/api/deployments/operations.js.map +1 -1
  233. package/dist/react-native/api/indexes/operations.d.ts +2 -2
  234. package/dist/react-native/api/indexes/operations.d.ts.map +1 -1
  235. package/dist/react-native/api/indexes/operations.js +45 -18
  236. package/dist/react-native/api/indexes/operations.js.map +1 -1
  237. package/dist/react-native/api/inference/operations.d.ts +0 -40
  238. package/dist/react-native/api/inference/operations.d.ts.map +1 -1
  239. package/dist/react-native/api/inference/operations.js +6 -87
  240. package/dist/react-native/api/inference/operations.js.map +1 -1
  241. package/dist/react-native/api/inference/options.d.ts +4 -1
  242. package/dist/react-native/api/inference/options.d.ts.map +1 -1
  243. package/dist/react-native/api/inference/options.js.map +1 -1
  244. package/dist/react-native/api/telemetry/operations.d.ts +1 -1
  245. package/dist/react-native/api/telemetry/operations.d.ts.map +1 -1
  246. package/dist/react-native/api/telemetry/operations.js +8 -23
  247. package/dist/react-native/api/telemetry/operations.js.map +1 -1
  248. package/dist/react-native/classic/connections/index.js +3 -1
  249. package/dist/react-native/classic/connections/index.js.map +1 -1
  250. package/dist/react-native/classic/datasets/index.d.ts +2 -2
  251. package/dist/react-native/classic/datasets/index.d.ts.map +1 -1
  252. package/dist/react-native/classic/datasets/index.js +7 -5
  253. package/dist/react-native/classic/datasets/index.js.map +1 -1
  254. package/dist/react-native/classic/deployments/index.js +3 -1
  255. package/dist/react-native/classic/deployments/index.js.map +1 -1
  256. package/dist/react-native/classic/index.d.ts +0 -2
  257. package/dist/react-native/classic/index.d.ts.map +1 -1
  258. package/dist/react-native/classic/index.js.map +1 -1
  259. package/dist/react-native/classic/indexes/index.d.ts +1 -1
  260. package/dist/react-native/classic/indexes/index.d.ts.map +1 -1
  261. package/dist/react-native/classic/indexes/index.js +4 -2
  262. package/dist/react-native/classic/indexes/index.js.map +1 -1
  263. package/dist/react-native/classic/inference/index.d.ts +0 -7
  264. package/dist/react-native/classic/inference/index.d.ts.map +1 -1
  265. package/dist/react-native/classic/inference/index.js +4 -5
  266. package/dist/react-native/classic/inference/index.js.map +1 -1
  267. package/dist/react-native/classic/telemetry/index.d.ts +1 -4
  268. package/dist/react-native/classic/telemetry/index.d.ts.map +1 -1
  269. package/dist/react-native/classic/telemetry/index.js +1 -2
  270. package/dist/react-native/classic/telemetry/index.js.map +1 -1
  271. package/dist/react-native/constants.d.ts +1 -1
  272. package/dist/react-native/constants.d.ts.map +1 -1
  273. package/dist/react-native/constants.js +1 -1
  274. package/dist/react-native/constants.js.map +1 -1
  275. package/dist/react-native/index.d.ts +5 -5
  276. package/dist/react-native/index.d.ts.map +1 -1
  277. package/dist/react-native/index.js +1 -1
  278. package/dist/react-native/index.js.map +1 -1
  279. package/dist/react-native/models/index.d.ts +1 -2
  280. package/dist/react-native/models/index.d.ts.map +1 -1
  281. package/dist/react-native/models/index.js +0 -1
  282. package/dist/react-native/models/index.js.map +1 -1
  283. package/dist/react-native/models/models.d.ts +3 -203
  284. package/dist/react-native/models/models.d.ts.map +1 -1
  285. package/dist/react-native/models/models.js +2 -249
  286. package/dist/react-native/models/models.js.map +1 -1
  287. package/dist/react-native/static-helpers/pagingHelpers.js +31 -50
  288. package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -1
  289. package/dist/react-native/static-helpers/urlTemplate.js +2 -2
  290. package/dist/react-native/static-helpers/urlTemplate.js.map +1 -1
  291. package/package.json +46 -72
  292. package/dist/browser/api/evaluations/index.d.ts +0 -3
  293. package/dist/browser/api/evaluations/index.d.ts.map +0 -1
  294. package/dist/browser/api/evaluations/index.js +0 -4
  295. package/dist/browser/api/evaluations/index.js.map +0 -1
  296. package/dist/browser/api/evaluations/operations.d.ts +0 -22
  297. package/dist/browser/api/evaluations/operations.d.ts.map +0 -1
  298. package/dist/browser/api/evaluations/operations.js +0 -99
  299. package/dist/browser/api/evaluations/operations.js.map +0 -1
  300. package/dist/browser/api/evaluations/options.d.ts +0 -18
  301. package/dist/browser/api/evaluations/options.d.ts.map +0 -1
  302. package/dist/browser/api/evaluations/options.js +0 -4
  303. package/dist/browser/api/evaluations/options.js.map +0 -1
  304. package/dist/browser/api/inference/enableTelemetry.d.ts +0 -21
  305. package/dist/browser/api/inference/enableTelemetry.d.ts.map +0 -1
  306. package/dist/browser/api/inference/enableTelemetry.js +0 -185
  307. package/dist/browser/api/inference/enableTelemetry.js.map +0 -1
  308. package/dist/browser/api/inference/index.d.ts +0 -5
  309. package/dist/browser/api/inference/index.d.ts.map +0 -1
  310. package/dist/browser/api/inference/index.js +0 -7
  311. package/dist/browser/api/inference/index.js.map +0 -1
  312. package/dist/browser/api/redTeams/index.d.ts +0 -3
  313. package/dist/browser/api/redTeams/index.d.ts.map +0 -1
  314. package/dist/browser/api/redTeams/index.js +0 -4
  315. package/dist/browser/api/redTeams/index.js.map +0 -1
  316. package/dist/browser/api/redTeams/operations.d.ts +0 -18
  317. package/dist/browser/api/redTeams/operations.d.ts.map +0 -1
  318. package/dist/browser/api/redTeams/operations.js +0 -74
  319. package/dist/browser/api/redTeams/operations.js.map +0 -1
  320. package/dist/browser/api/redTeams/options.d.ts +0 -15
  321. package/dist/browser/api/redTeams/options.d.ts.map +0 -1
  322. package/dist/browser/api/redTeams/options.js +0 -4
  323. package/dist/browser/api/redTeams/options.js.map +0 -1
  324. package/dist/browser/classic/evaluations/index.d.ts +0 -17
  325. package/dist/browser/classic/evaluations/index.d.ts.map +0 -1
  326. package/dist/browser/classic/evaluations/index.js +0 -15
  327. package/dist/browser/classic/evaluations/index.js.map +0 -1
  328. package/dist/browser/classic/redTeams/index.d.ts +0 -15
  329. package/dist/browser/classic/redTeams/index.d.ts.map +0 -1
  330. package/dist/browser/classic/redTeams/index.js +0 -14
  331. package/dist/browser/classic/redTeams/index.js.map +0 -1
  332. package/dist/browser/models/evaluations.d.ts +0 -55
  333. package/dist/browser/models/evaluations.d.ts.map +0 -1
  334. package/dist/browser/models/evaluations.js +0 -56
  335. package/dist/browser/models/evaluations.js.map +0 -1
  336. package/dist/commonjs/api/evaluations/index.d.ts +0 -3
  337. package/dist/commonjs/api/evaluations/index.d.ts.map +0 -1
  338. package/dist/commonjs/api/evaluations/index.js +0 -11
  339. package/dist/commonjs/api/evaluations/index.js.map +0 -1
  340. package/dist/commonjs/api/evaluations/operations.d.ts +0 -22
  341. package/dist/commonjs/api/evaluations/operations.d.ts.map +0 -1
  342. package/dist/commonjs/api/evaluations/operations.js +0 -113
  343. package/dist/commonjs/api/evaluations/operations.js.map +0 -1
  344. package/dist/commonjs/api/evaluations/options.d.ts +0 -18
  345. package/dist/commonjs/api/evaluations/options.d.ts.map +0 -1
  346. package/dist/commonjs/api/evaluations/options.js +0 -5
  347. package/dist/commonjs/api/evaluations/options.js.map +0 -1
  348. package/dist/commonjs/api/inference/enableTelemetry.d.ts +0 -21
  349. package/dist/commonjs/api/inference/enableTelemetry.d.ts.map +0 -1
  350. package/dist/commonjs/api/inference/enableTelemetry.js +0 -189
  351. package/dist/commonjs/api/inference/enableTelemetry.js.map +0 -1
  352. package/dist/commonjs/api/inference/index.d.ts +0 -5
  353. package/dist/commonjs/api/inference/index.d.ts.map +0 -1
  354. package/dist/commonjs/api/inference/index.js +0 -11
  355. package/dist/commonjs/api/inference/index.js.map +0 -1
  356. package/dist/commonjs/api/redTeams/index.d.ts +0 -3
  357. package/dist/commonjs/api/redTeams/index.d.ts.map +0 -1
  358. package/dist/commonjs/api/redTeams/index.js +0 -10
  359. package/dist/commonjs/api/redTeams/index.js.map +0 -1
  360. package/dist/commonjs/api/redTeams/operations.d.ts +0 -18
  361. package/dist/commonjs/api/redTeams/operations.d.ts.map +0 -1
  362. package/dist/commonjs/api/redTeams/operations.js +0 -85
  363. package/dist/commonjs/api/redTeams/operations.js.map +0 -1
  364. package/dist/commonjs/api/redTeams/options.d.ts +0 -15
  365. package/dist/commonjs/api/redTeams/options.d.ts.map +0 -1
  366. package/dist/commonjs/api/redTeams/options.js +0 -5
  367. package/dist/commonjs/api/redTeams/options.js.map +0 -1
  368. package/dist/commonjs/classic/evaluations/index.d.ts +0 -17
  369. package/dist/commonjs/classic/evaluations/index.d.ts.map +0 -1
  370. package/dist/commonjs/classic/evaluations/index.js +0 -18
  371. package/dist/commonjs/classic/evaluations/index.js.map +0 -1
  372. package/dist/commonjs/classic/redTeams/index.d.ts +0 -15
  373. package/dist/commonjs/classic/redTeams/index.d.ts.map +0 -1
  374. package/dist/commonjs/classic/redTeams/index.js +0 -17
  375. package/dist/commonjs/classic/redTeams/index.js.map +0 -1
  376. package/dist/commonjs/models/evaluations.d.ts +0 -55
  377. package/dist/commonjs/models/evaluations.d.ts.map +0 -1
  378. package/dist/commonjs/models/evaluations.js +0 -59
  379. package/dist/commonjs/models/evaluations.js.map +0 -1
  380. package/dist/esm/api/evaluations/index.d.ts +0 -3
  381. package/dist/esm/api/evaluations/index.d.ts.map +0 -1
  382. package/dist/esm/api/evaluations/index.js +0 -4
  383. package/dist/esm/api/evaluations/index.js.map +0 -1
  384. package/dist/esm/api/evaluations/operations.d.ts +0 -22
  385. package/dist/esm/api/evaluations/operations.d.ts.map +0 -1
  386. package/dist/esm/api/evaluations/operations.js +0 -99
  387. package/dist/esm/api/evaluations/operations.js.map +0 -1
  388. package/dist/esm/api/evaluations/options.d.ts +0 -18
  389. package/dist/esm/api/evaluations/options.d.ts.map +0 -1
  390. package/dist/esm/api/evaluations/options.js +0 -4
  391. package/dist/esm/api/evaluations/options.js.map +0 -1
  392. package/dist/esm/api/inference/enableTelemetry.d.ts +0 -21
  393. package/dist/esm/api/inference/enableTelemetry.d.ts.map +0 -1
  394. package/dist/esm/api/inference/enableTelemetry.js +0 -185
  395. package/dist/esm/api/inference/enableTelemetry.js.map +0 -1
  396. package/dist/esm/api/inference/index.d.ts +0 -5
  397. package/dist/esm/api/inference/index.d.ts.map +0 -1
  398. package/dist/esm/api/inference/index.js +0 -7
  399. package/dist/esm/api/inference/index.js.map +0 -1
  400. package/dist/esm/api/redTeams/index.d.ts +0 -3
  401. package/dist/esm/api/redTeams/index.d.ts.map +0 -1
  402. package/dist/esm/api/redTeams/index.js +0 -4
  403. package/dist/esm/api/redTeams/index.js.map +0 -1
  404. package/dist/esm/api/redTeams/operations.d.ts +0 -18
  405. package/dist/esm/api/redTeams/operations.d.ts.map +0 -1
  406. package/dist/esm/api/redTeams/operations.js +0 -74
  407. package/dist/esm/api/redTeams/operations.js.map +0 -1
  408. package/dist/esm/api/redTeams/options.d.ts +0 -15
  409. package/dist/esm/api/redTeams/options.d.ts.map +0 -1
  410. package/dist/esm/api/redTeams/options.js +0 -4
  411. package/dist/esm/api/redTeams/options.js.map +0 -1
  412. package/dist/esm/classic/evaluations/index.d.ts +0 -17
  413. package/dist/esm/classic/evaluations/index.d.ts.map +0 -1
  414. package/dist/esm/classic/evaluations/index.js +0 -15
  415. package/dist/esm/classic/evaluations/index.js.map +0 -1
  416. package/dist/esm/classic/redTeams/index.d.ts +0 -15
  417. package/dist/esm/classic/redTeams/index.d.ts.map +0 -1
  418. package/dist/esm/classic/redTeams/index.js +0 -14
  419. package/dist/esm/classic/redTeams/index.js.map +0 -1
  420. package/dist/esm/models/evaluations.d.ts +0 -55
  421. package/dist/esm/models/evaluations.d.ts.map +0 -1
  422. package/dist/esm/models/evaluations.js +0 -56
  423. package/dist/esm/models/evaluations.js.map +0 -1
  424. package/dist/react-native/api/evaluations/index.d.ts +0 -3
  425. package/dist/react-native/api/evaluations/index.d.ts.map +0 -1
  426. package/dist/react-native/api/evaluations/index.js +0 -4
  427. package/dist/react-native/api/evaluations/index.js.map +0 -1
  428. package/dist/react-native/api/evaluations/operations.d.ts +0 -22
  429. package/dist/react-native/api/evaluations/operations.d.ts.map +0 -1
  430. package/dist/react-native/api/evaluations/operations.js +0 -99
  431. package/dist/react-native/api/evaluations/operations.js.map +0 -1
  432. package/dist/react-native/api/evaluations/options.d.ts +0 -18
  433. package/dist/react-native/api/evaluations/options.d.ts.map +0 -1
  434. package/dist/react-native/api/evaluations/options.js +0 -4
  435. package/dist/react-native/api/evaluations/options.js.map +0 -1
  436. package/dist/react-native/api/inference/enableTelemetry.d.ts +0 -21
  437. package/dist/react-native/api/inference/enableTelemetry.d.ts.map +0 -1
  438. package/dist/react-native/api/inference/enableTelemetry.js +0 -185
  439. package/dist/react-native/api/inference/enableTelemetry.js.map +0 -1
  440. package/dist/react-native/api/inference/index.d.ts +0 -5
  441. package/dist/react-native/api/inference/index.d.ts.map +0 -1
  442. package/dist/react-native/api/inference/index.js +0 -7
  443. package/dist/react-native/api/inference/index.js.map +0 -1
  444. package/dist/react-native/api/redTeams/index.d.ts +0 -3
  445. package/dist/react-native/api/redTeams/index.d.ts.map +0 -1
  446. package/dist/react-native/api/redTeams/index.js +0 -4
  447. package/dist/react-native/api/redTeams/index.js.map +0 -1
  448. package/dist/react-native/api/redTeams/operations.d.ts +0 -18
  449. package/dist/react-native/api/redTeams/operations.d.ts.map +0 -1
  450. package/dist/react-native/api/redTeams/operations.js +0 -74
  451. package/dist/react-native/api/redTeams/operations.js.map +0 -1
  452. package/dist/react-native/api/redTeams/options.d.ts +0 -15
  453. package/dist/react-native/api/redTeams/options.d.ts.map +0 -1
  454. package/dist/react-native/api/redTeams/options.js +0 -4
  455. package/dist/react-native/api/redTeams/options.js.map +0 -1
  456. package/dist/react-native/classic/evaluations/index.d.ts +0 -17
  457. package/dist/react-native/classic/evaluations/index.d.ts.map +0 -1
  458. package/dist/react-native/classic/evaluations/index.js +0 -15
  459. package/dist/react-native/classic/evaluations/index.js.map +0 -1
  460. package/dist/react-native/classic/redTeams/index.d.ts +0 -15
  461. package/dist/react-native/classic/redTeams/index.d.ts.map +0 -1
  462. package/dist/react-native/classic/redTeams/index.js +0 -14
  463. package/dist/react-native/classic/redTeams/index.js.map +0 -1
  464. package/dist/react-native/models/evaluations.d.ts +0 -55
  465. package/dist/react-native/models/evaluations.d.ts.map +0 -1
  466. package/dist/react-native/models/evaluations.js +0 -56
  467. package/dist/react-native/models/evaluations.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.d.ts","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAqC,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,kBAAkB,EAA0B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAyB,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAE,kBAAkB,EAA0B,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAA6B,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAA2B,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACL,mBAAmB,EAGnB,mBAAmB,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,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,uCAAuC;IACvC,SAAgB,OAAO,EAAE,iBAAiB,CAAC;IAC3C,wCAAwC;IACxC,SAAgB,QAAQ,EAAE,kBAAkB,CAAC;IAC7C,2CAA2C;IAC3C,SAAgB,WAAW,EAAE,qBAAqB,CAAC;IACnD,yCAAyC;IACzC,yCAAyC;IACzC,SAAgB,SAAS,EAAE,mBAAmB,CAAC;IAC/C;;;OAGG;IACI,cAAc,IAAI,MAAM;IAI/B;;;OAGG;IACI,oBAAoB,CAAC,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxF;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC,GAC1C,eAAe;IAIlB;;;;OAIG;IAEH,IAAW,MAAM,IAAI,YAAY,CAUhC;CACF"}
@@ -4,17 +4,14 @@
4
4
  /* eslint-disable tsdoc/syntax */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AIProjectClient = void 0;
7
- const tslib_1 = require("tslib");
8
7
  const ai_agents_1 = require("@azure/ai-agents");
9
8
  const index_js_1 = require("./api/index.js");
10
- const index_js_2 = require("./classic/redTeams/index.js");
11
- const index_js_3 = require("./classic/deployments/index.js");
12
- const index_js_4 = require("./classic/indexes/index.js");
13
- const index_js_5 = require("./classic/datasets/index.js");
14
- const index_js_6 = require("./classic/evaluations/index.js");
15
- const index_js_7 = require("./classic/connections/index.js");
16
- const index_js_8 = require("./classic/inference/index.js");
17
- const index_js_9 = require("./classic/telemetry/index.js");
9
+ const index_js_2 = require("./classic/deployments/index.js");
10
+ const index_js_3 = require("./classic/indexes/index.js");
11
+ const index_js_4 = require("./classic/datasets/index.js");
12
+ const index_js_5 = require("./classic/connections/index.js");
13
+ const index_js_6 = require("./classic/inference/index.js");
14
+ const index_js_7 = require("./classic/telemetry/index.js");
18
15
  /**
19
16
  * The main client for the AIProjectClient service. It provides access to the various operations available in the service.
20
17
  * @class AIProjectClient
@@ -24,39 +21,62 @@ const index_js_9 = require("./classic/telemetry/index.js");
24
21
  * @param {string} endpoint - The endpoint to use
25
22
  * @param {TokenCredential} credential - The credential to use
26
23
  * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.
27
- * @property {RedTeamsOperations} redTeams - The operation groups for redTeams
28
24
  * @property {DeploymentsOperations} deployments - The operation groups for deployments
29
25
  * @property {IndexesOperations} indexes - The operation groups for indexes
30
26
  * @property {DatasetsOperations} datasets - The operation groups for datasets
31
- * @property {EvaluationsOperations} evaluations - The operation groups for evaluations
32
27
  * @property {ConnectionsOperations} connections - The operation groups for connections
33
- * @property {InferenceOperations} inference - The operation groups for inference
28
+ * @method {getAzureOpenAIClient} getAzureOpenAIClient - get the Azure OpenAI client for the project
34
29
  * @property {TelemetryOperations} telemetry - The operation groups for telemetry
35
- * @property {EnableTelemetryType} enableTelemetry - The operation groups for enabling telemetry
36
30
  */
37
31
  class AIProjectClient {
32
+ _cognitiveScopeClient;
33
+ _azureScopeClient;
34
+ _endpoint;
35
+ _credential;
36
+ _agents;
37
+ _options;
38
+ _inference;
39
+ /** The pipeline used by this client to make requests */
40
+ pipeline;
38
41
  constructor(endpointParam, credential, options = {}) {
39
- var _a;
40
42
  this._endpoint = endpointParam;
41
43
  this._credential = credential;
42
44
  this._options = options;
43
- const prefixFromOptions = (_a = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _a === void 0 ? void 0 : _a.userAgentPrefix;
45
+ const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
44
46
  const userAgentPrefix = prefixFromOptions
45
47
  ? `${prefixFromOptions} azsdk-js-client`
46
48
  : `azsdk-js-client`;
47
- this._cognitiveScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, Object.assign(Object.assign({}, options), { userAgentOptions: { userAgentPrefix } }));
48
- this._azureScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, Object.assign(Object.assign({}, options), { credentials: Object.assign(Object.assign({}, options.credentials), { scopes: ["https://ai.azure.com/.default"] }), userAgentOptions: { userAgentPrefix } }));
49
+ this._cognitiveScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, {
50
+ ...options,
51
+ userAgentOptions: { userAgentPrefix },
52
+ });
53
+ this._azureScopeClient = (0, index_js_1.createAIProject)(endpointParam, credential, {
54
+ ...options,
55
+ credentials: {
56
+ ...options.credentials,
57
+ scopes: ["https://ai.azure.com/.default"],
58
+ },
59
+ userAgentOptions: { userAgentPrefix },
60
+ });
49
61
  this.pipeline = this._cognitiveScopeClient.pipeline;
50
- this.redTeams = (0, index_js_2._getRedTeamsOperations)(this._azureScopeClient);
51
- this.deployments = (0, index_js_3._getDeploymentsOperations)(this._azureScopeClient);
52
- this.indexes = (0, index_js_4._getIndexesOperations)(this._azureScopeClient);
53
- this.datasets = (0, index_js_5._getDatasetsOperations)(this._azureScopeClient, this._options);
54
- this.evaluations = (0, index_js_6._getEvaluationsOperations)(this._azureScopeClient);
55
- this.connections = (0, index_js_7._getConnectionsOperations)(this._azureScopeClient);
56
- this.inference = (0, index_js_8._getInferenceOperations)(this._cognitiveScopeClient, this.connections);
57
- this.telemetry = (0, index_js_9._getTelemetryOperations)(this.connections);
58
- this.enableTelemetry = index_js_9.enableTelemetry;
62
+ this.deployments = (0, index_js_2._getDeploymentsOperations)(this._azureScopeClient);
63
+ this.indexes = (0, index_js_3._getIndexesOperations)(this._azureScopeClient);
64
+ this.datasets = (0, index_js_4._getDatasetsOperations)(this._azureScopeClient, this._options);
65
+ this.connections = (0, index_js_5._getConnectionsOperations)(this._azureScopeClient);
66
+ this._inference = (0, index_js_6._getInferenceOperations)(this._cognitiveScopeClient, this.connections);
67
+ this.telemetry = (0, index_js_7._getTelemetryOperations)(this.connections);
59
68
  }
69
+ /** The operation groups for deployments */
70
+ deployments;
71
+ /** The operation groups for indexes */
72
+ indexes;
73
+ /** The operation groups for datasets */
74
+ datasets;
75
+ /** The operation groups for connections */
76
+ connections;
77
+ /** The operation groups for inference */
78
+ /** The operation groups for telemetry */
79
+ telemetry;
60
80
  /**
61
81
  * gets the endpoint of the client
62
82
  * @returns the endpoint of the client
@@ -64,6 +84,13 @@ class AIProjectClient {
64
84
  getEndpointUrl() {
65
85
  return this._endpoint;
66
86
  }
87
+ /**
88
+ * Gets the Azure OpenAI client for the project.
89
+ * @returns The Azure OpenAI client for the project.
90
+ */
91
+ getAzureOpenAIClient(options) {
92
+ return this._inference.azureOpenAI(options);
93
+ }
67
94
  /**
68
95
  * Creates a new instance of AzureAIProjectClient
69
96
  * @param endpoint - The endpoint to use
@@ -80,9 +107,12 @@ class AIProjectClient {
80
107
  */
81
108
  // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients
82
109
  get agents() {
83
- const _a = this._options, { apiVersion } = _a, clientOptions = tslib_1.__rest(_a, ["apiVersion"]);
110
+ const { apiVersion, ...clientOptions } = this._options;
84
111
  if (!this._agents) {
85
- this._agents = new ai_agents_1.AgentsClient(this._endpoint, this._credential, Object.assign(Object.assign({}, clientOptions), { userAgentOptions: this._cognitiveScopeClient.getUserAgent() }));
112
+ this._agents = new ai_agents_1.AgentsClient(this._endpoint, this._credential, {
113
+ ...clientOptions,
114
+ userAgentOptions: this._cognitiveScopeClient.getUserAgent(),
115
+ });
86
116
  }
87
117
  return this._agents;
88
118
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;;;AAEjC,gDAAgD;AAChD,6CAAkG;AAClG,0DAAyF;AACzF,6DAAkG;AAClG,yDAAsF;AACtF,0DAAyF;AACzF,6DAAkG;AAClG,6DAAkG;AAClG,2DAA4F;AAC5F,2DAKsC;AAMtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,eAAe;IAU1B,YACE,aAA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QACrE,IAAI,CAAC,WAAW,GAAG,IAAA,oCAAyB,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACrE,IAAI,CAAC,SAAS,GAAG,IAAA,kCAAuB,EAAC,IAAI,CAAC,qBAAqB,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACvF,IAAI,CAAC,SAAS,GAAG,IAAA,kCAAuB,EAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC3D,IAAI,CAAC,eAAe,GAAG,0BAAe,CAAC;IACzC,CAAC;IAqBD;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;QAE3C,OAAO,IAAI,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,iEAAiE;IACjE,IAAW,MAAM;QACf,MAAM,KAAmC,IAAI,CAAC,QAAQ,EAAhD,EAAE,UAAU,OAAoC,EAA/B,aAAa,sBAA9B,cAAgC,CAAgB,CAAC;QAEvD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,kCAC3D,aAAa,KAChB,gBAAgB,EAAE,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE,IAC3D,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AA1GD,0CA0GC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport { AgentsClient } from \"@azure/ai-agents\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { RedTeamsOperations, _getRedTeamsOperations } from \"./classic/redTeams/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { EvaluationsOperations, _getEvaluationsOperations } from \"./classic/evaluations/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { InferenceOperations, _getInferenceOperations } from \"./classic/inference/index.js\";\nimport {\n TelemetryOperations,\n _getTelemetryOperations,\n enableTelemetry,\n EnableTelemetryType,\n} from \"./classic/telemetry/index.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {RedTeamsOperations} redTeams - The operation groups for redTeams\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {EvaluationsOperations} evaluations - The operation groups for evaluations\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @property {InferenceOperations} inference - The operation groups for inference\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n * @property {EnableTelemetryType} enableTelemetry - The operation groups for enabling telemetry\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _agents: AgentsClient | undefined;\n private _options: AIProjectClientOptionalParams;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpointParam;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this._azureScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n userAgentOptions: { userAgentPrefix },\n });\n\n this.pipeline = this._cognitiveScopeClient.pipeline;\n this.redTeams = _getRedTeamsOperations(this._azureScopeClient);\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.evaluations = _getEvaluationsOperations(this._azureScopeClient);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this.inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);\n this.telemetry = _getTelemetryOperations(this.connections);\n this.enableTelemetry = enableTelemetry;\n }\n\n /** The operation groups for redTeams */\n public readonly redTeams: RedTeamsOperations;\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for evaluations */\n public readonly evaluations: EvaluationsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for inference */\n public readonly inference: InferenceOperations;\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /** The operation groups for enabling telemetry */\n public readonly enableTelemetry: EnableTelemetryType;\n\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public getEndpointUrl(): string {\n return this._endpoint;\n }\n\n /**\n * Creates a new instance of AzureAIProjectClient\n * @param endpoint - The endpoint to use\n * @param credential - The credential to use\n * @param options - The parameter for all optional parameters\n */\n static fromEndpoint(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ): AIProjectClient {\n return new AIProjectClient(endpoint, credential, options);\n }\n\n /**\n * Get the AgentsClient associated with this AIProjectClient.\n *\n * @returns The AgentsClient associated with this AIProjectClient\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients\n public get agents(): AgentsClient {\n const { apiVersion, ...clientOptions } = this._options;\n\n if (!this._agents) {\n this._agents = new AgentsClient(this._endpoint, this._credential, {\n ...clientOptions,\n userAgentOptions: this._cognitiveScopeClient.getUserAgent(),\n });\n }\n return this._agents;\n }\n}\n"]}
1
+ {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;;;AAEjC,gDAAgD;AAEhD,6CAAkG;AAClG,6DAAkG;AAClG,yDAAsF;AACtF,0DAAyF;AACzF,6DAAkG;AAClG,2DAA4F;AAC5F,2DAA4F;AAO5F;;;;;;;;;;;;;;;GAeG;AACH,MAAa,eAAe;IAClB,qBAAqB,CAAmB;IACxC,iBAAiB,CAAmB;IACpC,SAAS,CAAS;IAClB,WAAW,CAAkB;IAC7B,OAAO,CAA2B;IAClC,QAAQ,CAAgC;IAC/B,UAAU,CAAsB;IACjD,wDAAwD;IACxC,QAAQ,CAAW;IAEnC,YACE,aAAqB,EACrB,UAA2B,EAC3B,UAAyC,EAAE;QAE3C,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,MAAM,iBAAiB,GAAG,OAAO,EAAE,gBAAgB,EAAE,eAAe,CAAC;QACrE,MAAM,eAAe,GAAG,iBAAiB;YACvC,CAAC,CAAC,GAAG,iBAAiB,kBA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ACzB,SAAS,CAAsB;IAC/C;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,oBAAoB,CAAC,OAAqC;QAC/D,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,YAAY,CACjB,QAAgB,EAChB,UAA2B,EAC3B,UAAyC,EAAE;QAE3C,OAAO,IAAI,eAAe,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,iEAAiE;IACjE,IAAW,MAAM;QACf,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QAEvD,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,wBAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE;gBAChE,GAAG,aAAa;gBAChB,gBAAgB,EAAE,IAAI,CAAC,qBAAqB,CAAC,YAAY,EAAE;aAC5D,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF;AAxGD,0CAwGC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\nimport { AgentsClient } from \"@azure/ai-agents\";\nimport type { AzureOpenAI } from \"openai\";\nimport { createAIProject, AIProjectContext, AIProjectClientOptionalParams } from \"./api/index.js\";\nimport { DeploymentsOperations, _getDeploymentsOperations } from \"./classic/deployments/index.js\";\nimport { IndexesOperations, _getIndexesOperations } from \"./classic/indexes/index.js\";\nimport { DatasetsOperations, _getDatasetsOperations } from \"./classic/datasets/index.js\";\nimport { ConnectionsOperations, _getConnectionsOperations } from \"./classic/connections/index.js\";\nimport { InferenceOperations, _getInferenceOperations } from \"./classic/inference/index.js\";\nimport { TelemetryOperations, _getTelemetryOperations } from \"./classic/telemetry/index.js\";\nimport { GetAzureOpenAIClientOptions } from \"./api/inference/options.js\";\nimport type { Pipeline } from \"@azure/core-rest-pipeline\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport { AIProjectClientOptionalParams } from \"./api/aiProjectContext.js\";\n\n/**\n * The main client for the AIProjectClient service. It provides access to the various operations available in the service.\n * @class AIProjectClient\n * @extends {AIProjectContext}\n * @description The main client for the AIProjectClient\n * @constructor\n * @param {string} endpoint - The endpoint to use\n * @param {TokenCredential} credential - The credential to use\n * @param {AIProjectClientOptionalParams} [options] - Optional parameters for the client.\n * @property {DeploymentsOperations} deployments - The operation groups for deployments\n * @property {IndexesOperations} indexes - The operation groups for indexes\n * @property {DatasetsOperations} datasets - The operation groups for datasets\n * @property {ConnectionsOperations} connections - The operation groups for connections\n * @method {getAzureOpenAIClient} getAzureOpenAIClient - get the Azure OpenAI client for the project\n * @property {TelemetryOperations} telemetry - The operation groups for telemetry\n */\nexport class AIProjectClient {\n private _cognitiveScopeClient: AIProjectContext;\n private _azureScopeClient: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _agents: AgentsClient | undefined;\n private _options: AIProjectClientOptionalParams;\n private readonly _inference: InferenceOperations;\n /** The pipeline used by this client to make requests */\n public readonly pipeline: Pipeline;\n\n constructor(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ) {\n this._endpoint = endpointParam;\n this._credential = credential;\n this._options = options;\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._cognitiveScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n\n this._azureScopeClient = createAIProject(endpointParam, credential, {\n ...options,\n credentials: {\n ...options.credentials,\n scopes: [\"https://ai.azure.com/.default\"],\n },\n userAgentOptions: { userAgentPrefix },\n });\n\n this.pipeline = this._cognitiveScopeClient.pipeline;\n this.deployments = _getDeploymentsOperations(this._azureScopeClient);\n this.indexes = _getIndexesOperations(this._azureScopeClient);\n this.datasets = _getDatasetsOperations(this._azureScopeClient, this._options);\n this.connections = _getConnectionsOperations(this._azureScopeClient);\n this._inference = _getInferenceOperations(this._cognitiveScopeClient, this.connections);\n this.telemetry = _getTelemetryOperations(this.connections);\n }\n\n /** The operation groups for deployments */\n public readonly deployments: DeploymentsOperations;\n /** The operation groups for indexes */\n public readonly indexes: IndexesOperations;\n /** The operation groups for datasets */\n public readonly datasets: DatasetsOperations;\n /** The operation groups for connections */\n public readonly connections: ConnectionsOperations;\n /** The operation groups for inference */\n /** The operation groups for telemetry */\n public readonly telemetry: TelemetryOperations;\n /**\n * gets the endpoint of the client\n * @returns the endpoint of the client\n */\n public getEndpointUrl(): string {\n return this._endpoint;\n }\n\n /**\n * Gets the Azure OpenAI client for the project.\n * @returns The Azure OpenAI client for the project.\n */\n public getAzureOpenAIClient(options?: GetAzureOpenAIClientOptions): Promise<AzureOpenAI> {\n return this._inference.azureOpenAI(options);\n }\n\n /**\n * Creates a new instance of AzureAIProjectClient\n * @param endpoint - The endpoint to use\n * @param credential - The credential to use\n * @param options - The parameter for all optional parameters\n */\n static fromEndpoint(\n endpoint: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n ): AIProjectClient {\n return new AIProjectClient(endpoint, credential, options);\n }\n\n /**\n * Get the AgentsClient associated with this AIProjectClient.\n *\n * @returns The AgentsClient associated with this AIProjectClient\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients\n public get agents(): AgentsClient {\n const { apiVersion, ...clientOptions } = this._options;\n\n if (!this._agents) {\n this._agents = new AgentsClient(this._endpoint, this._credential, {\n ...clientOptions,\n userAgentOptions: this._cognitiveScopeClient.getUserAgent(),\n });\n }\n return this._agents;\n }\n}\n"]}
@@ -3,31 +3,33 @@
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
5
  exports.createAIProject = createAIProject;
6
- const tslib_1 = require("tslib");
7
6
  const logger_js_1 = require("../logger.js");
8
7
  const core_client_1 = require("@azure-rest/core-client");
9
8
  function createAIProject(endpointParam, credential, options = {}) {
10
- var _a, _b, _c, _d, _e, _f, _g, _h;
11
- const endpointUrl = (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUrl) !== null && _b !== void 0 ? _b : String(endpointParam);
12
- const prefixFromOptions = (_c = options === null || options === void 0 ? void 0 : options.userAgentOptions) === null || _c === void 0 ? void 0 : _c.userAgentPrefix;
13
- const userAgentInfo = `azsdk-js-ai-projects/1.0.0-beta.8`;
9
+ const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);
10
+ const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;
11
+ const userAgentInfo = `azsdk-js-ai-projects/1.0.0`;
14
12
  const userAgentPrefix = prefixFromOptions
15
13
  ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`
16
14
  : `azsdk-js-api ${userAgentInfo}`;
17
- const _j = Object.assign(Object.assign({}, options), { userAgentOptions: { userAgentPrefix }, loggingOptions: { logger: (_e = (_d = options.loggingOptions) === null || _d === void 0 ? void 0 : _d.logger) !== null && _e !== void 0 ? _e : logger_js_1.logger.info }, credentials: {
18
- scopes: (_g = (_f = options.credentials) === null || _f === void 0 ? void 0 : _f.scopes) !== null && _g !== void 0 ? _g : ["https://cognitiveservices.azure.com/.default"],
19
- } }), { apiVersion: _ } = _j, updatedOptions = tslib_1.__rest(_j, ["apiVersion"]);
15
+ const { apiVersion: _, ...updatedOptions } = {
16
+ ...options,
17
+ userAgentOptions: { userAgentPrefix },
18
+ loggingOptions: { logger: options.loggingOptions?.logger ?? logger_js_1.logger.info },
19
+ credentials: {
20
+ scopes: options.credentials?.scopes ?? ["https://cognitiveservices.azure.com/.default"],
21
+ },
22
+ };
20
23
  const clientContext = (0, core_client_1.getClient)(endpointUrl, credential, updatedOptions);
21
24
  clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" });
22
- const apiVersion = (_h = options.apiVersion) !== null && _h !== void 0 ? _h : "2025-05-15-preview";
25
+ const apiVersion = options.apiVersion ?? "v1";
23
26
  clientContext.pipeline.addPolicy({
24
27
  name: "ClientApiVersionPolicy",
25
28
  sendRequest: (req, next) => {
26
- var _a;
27
29
  // Use the apiVersion defined in request url directly
28
30
  // Append one if there is no apiVersion and we have one at client options
29
31
  const url = new URL(req.url);
30
- const defaultApiVersion = (_a = url.searchParams.get("api-version")) !== null && _a !== void 0 ? _a : apiVersion;
32
+ const defaultApiVersion = url.searchParams.get("api-version") ?? apiVersion;
31
33
  // remove api-version from url
32
34
  url.searchParams.delete("api-version");
33
35
  // add api-version to url
@@ -35,6 +37,12 @@ function createAIProject(endpointParam, credential, options = {}) {
35
37
  return next(req);
36
38
  },
37
39
  });
38
- return Object.assign(Object.assign({}, clientContext), { apiVersion, getEndpointUrl: () => endpointUrl, getUserAgent: () => ({ userAgentPrefix }), getCredential: () => credential });
40
+ return {
41
+ ...clientContext,
42
+ apiVersion,
43
+ getEndpointUrl: () => endpointUrl,
44
+ getUserAgent: () => ({ userAgentPrefix }),
45
+ getCredential: () => credential,
46
+ };
39
47
  }
40
48
  //# sourceMappingURL=aiProjectContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0BlC,0CA6CC;;AArED,4CAAsC;AAEtC,yDAA2E;AAsB3E,SAAgB,eAAe,CAC7B,aAAqB,EACrB,UAA2B,EAC3B,UAAyC,EAAE;;IAE3C,MAAM,WAAW,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBA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Y,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;YACvC,yBAAyB;YACzB,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,GACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,iBAAiB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,gCACF,aAAa,KAChB,UAAU,EACV,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,EACjC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC,EACzC,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU,GACZ,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n /** The endpoint URL used to construct AIProjectClient. */\n getEndpointUrl(): string;\n /** The user agent string used to construct AIProjectClient. */\n getUserAgent(): { userAgentPrefix: string };\n /** The credential used to construct AIProjectClient. */\n getCredential(): TokenCredential;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAIProject(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/1.0.0-beta.8`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"2025-05-15-preview\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n const defaultApiVersion = url.searchParams.get(\"api-version\") ?? apiVersion;\n // remove api-version from url\n url.searchParams.delete(\"api-version\");\n // add api-version to url\n req.url = `${url.toString()}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${defaultApiVersion}`;\n return next(req);\n },\n });\n return {\n ...clientContext,\n apiVersion,\n getEndpointUrl: () => endpointUrl,\n getUserAgent: () => ({ userAgentPrefix }),\n getCredential: () => credential,\n } as AIProjectContext;\n}\n"]}
1
+ {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA0BlC,0CA6CC;AArED,4CAAsC;AAEtC,yDAA2E;AAsB3E,SAAgB,eAAe,CAC7B,aAAqB,EACrB,UAA2B,EAC3B,UAAyC,EAAE;IAE3C,MAAM,WAAW,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,OAAO,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;IACjF,MAAM,iBAAiB,GAAG,OA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,EAAE,GACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GACzD,eAAe,iBAAiB,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO;QACL,GAAG,aAAa;QAChB,UAAU;QACV,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW;QACjC,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,CAAC;QACzC,aAAa,EAAE,GAAG,EAAE,CAAC,UAAU;KACZ,CAAC;AACxB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { logger } from \"../logger.js\";\nimport { KnownVersions } from \"../models/models.js\";\nimport { Client, ClientOptions, getClient } from \"@azure-rest/core-client\";\nimport { TokenCredential } from \"@azure/core-auth\";\n\nexport interface AIProjectContext extends Client {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion: string;\n /** The endpoint URL used to construct AIProjectClient. */\n getEndpointUrl(): string;\n /** The user agent string used to construct AIProjectClient. */\n getUserAgent(): { userAgentPrefix: string };\n /** The credential used to construct AIProjectClient. */\n getCredential(): TokenCredential;\n}\n\n/** Optional parameters for the client. */\nexport interface AIProjectClientOptionalParams extends ClientOptions {\n /** The API version to use for this operation. */\n /** Known values of {@link KnownVersions} that the service accepts. */\n apiVersion?: string;\n}\n\nexport function createAIProject(\n endpointParam: string,\n credential: TokenCredential,\n options: AIProjectClientOptionalParams = {},\n): AIProjectContext {\n const endpointUrl = options.endpoint ?? options.baseUrl ?? String(endpointParam);\n const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentInfo = `azsdk-js-ai-projects/1.0.0`;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}`\n : `azsdk-js-api ${userAgentInfo}`;\n const { apiVersion: _, ...updatedOptions } = {\n ...options,\n userAgentOptions: { userAgentPrefix },\n loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info },\n credentials: {\n scopes: options.credentials?.scopes ?? [\"https://cognitiveservices.azure.com/.default\"],\n },\n };\n const clientContext = getClient(endpointUrl, credential, updatedOptions);\n clientContext.pipeline.removePolicy({ name: \"ApiVersionPolicy\" });\n const apiVersion = options.apiVersion ?? \"v1\";\n clientContext.pipeline.addPolicy({\n name: \"ClientApiVersionPolicy\",\n sendRequest: (req, next) => {\n // Use the apiVersion defined in request url directly\n // Append one if there is no apiVersion and we have one at client options\n const url = new URL(req.url);\n const defaultApiVersion = url.searchParams.get(\"api-version\") ?? apiVersion;\n // remove api-version from url\n url.searchParams.delete(\"api-version\");\n // add api-version to url\n req.url = `${url.toString()}${\n Array.from(url.searchParams.keys()).length > 0 ? \"&\" : \"?\"\n }api-version=${defaultApiVersion}`;\n return next(req);\n },\n });\n return {\n ...clientContext,\n apiVersion,\n getEndpointUrl: () => endpointUrl,\n getUserAgent: () => ({ userAgentPrefix }),\n getCredential: () => credential,\n } as AIProjectContext;\n}\n"]}
@@ -12,23 +12,28 @@ exports._getSend = _getSend;
12
12
  exports._getDeserialize = _getDeserialize;
13
13
  exports.get = get;
14
14
  exports.getDefault = getDefault;
15
- const tslib_1 = require("tslib");
16
15
  const models_js_1 = require("../../models/models.js");
17
16
  const urlTemplate_js_1 = require("../../static-helpers/urlTemplate.js");
18
17
  const pagingHelpers_js_1 = require("../../static-helpers/pagingHelpers.js");
19
18
  const core_client_1 = require("@azure-rest/core-client");
20
19
  function _listSend(context, options = { requestOptions: {} }) {
21
- var _a, _b;
22
20
  const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections{?api-version,connectionType,defaultConnection}", {
23
21
  "api-version": context.apiVersion,
24
- connectionType: options === null || options === void 0 ? void 0 : options.connectionType,
25
- defaultConnection: options === null || options === void 0 ? void 0 : options.defaultConnection,
22
+ connectionType: options?.connectionType,
23
+ defaultConnection: options?.defaultConnection,
26
24
  }, {
27
- allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
25
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
26
+ });
27
+ return context.path(path).get({
28
+ ...(0, core_client_1.operationOptionsToRequestParameters)(options),
29
+ headers: {
30
+ ...(options?.clientRequestId !== undefined
31
+ ? { "x-ms-client-request-id": options?.clientRequestId }
32
+ : {}),
33
+ accept: "application/json",
34
+ ...options.requestOptions?.headers,
35
+ },
28
36
  });
29
- return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
30
- ? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
31
- : {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
32
37
  }
33
38
  async function _listDeserialize(result) {
34
39
  const expectedStatuses = ["200"];
@@ -42,16 +47,22 @@ function list(context, options = { requestOptions: {} }) {
42
47
  return (0, pagingHelpers_js_1.buildPagedAsyncIterator)(context, () => _listSend(context, options), _listDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" });
43
48
  }
44
49
  function _getWithCredentialsSend(context, name, options = { requestOptions: {} }) {
45
- var _a, _b;
46
50
  const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections/{name}/getConnectionWithCredentials{?api-version}", {
47
51
  name: name,
48
52
  "api-version": context.apiVersion,
49
53
  }, {
50
- allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
54
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
55
+ });
56
+ return context.path(path).post({
57
+ ...(0, core_client_1.operationOptionsToRequestParameters)(options),
58
+ headers: {
59
+ ...(options?.clientRequestId !== undefined
60
+ ? { "x-ms-client-request-id": options?.clientRequestId }
61
+ : {}),
62
+ accept: "application/json",
63
+ ...options.requestOptions?.headers,
64
+ },
51
65
  });
52
- return context.path(path).post(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
53
- ? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
54
- : {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
55
66
  }
56
67
  async function _getWithCredentialsDeserialize(result) {
57
68
  const expectedStatuses = ["200"];
@@ -66,16 +77,22 @@ async function getWithCredentials(context, name, options = { requestOptions: {}
66
77
  return _getWithCredentialsDeserialize(result);
67
78
  }
68
79
  function _getSend(context, name, options = { requestOptions: {} }) {
69
- var _a, _b;
70
80
  const path = (0, urlTemplate_js_1.expandUrlTemplate)("/connections/{name}{?api-version}", {
71
81
  name: name,
72
82
  "api-version": context.apiVersion,
73
83
  }, {
74
- allowReserved: (_a = options === null || options === void 0 ? void 0 : options.requestOptions) === null || _a === void 0 ? void 0 : _a.skipUrlEncoding,
84
+ allowReserved: options?.requestOptions?.skipUrlEncoding,
85
+ });
86
+ return context.path(path).get({
87
+ ...(0, core_client_1.operationOptionsToRequestParameters)(options),
88
+ headers: {
89
+ ...(options?.clientRequestId !== undefined
90
+ ? { "x-ms-client-request-id": options?.clientRequestId }
91
+ : {}),
92
+ accept: "application/json",
93
+ ...options.requestOptions?.headers,
94
+ },
75
95
  });
76
- return context.path(path).get(Object.assign(Object.assign({}, (0, core_client_1.operationOptionsToRequestParameters)(options)), { headers: Object.assign(Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.clientRequestId) !== undefined
77
- ? { "x-ms-client-request-id": options === null || options === void 0 ? void 0 : options.clientRequestId }
78
- : {})), { accept: "application/json" }), (_b = options.requestOptions) === null || _b === void 0 ? void 0 : _b.headers) }));
79
96
  }
80
97
  async function _getDeserialize(result) {
81
98
  const expectedStatuses = ["200"];
@@ -102,32 +119,19 @@ async function get(context, name, includeCredentials, options = { requestOptions
102
119
  * @throws Error if no default connection is found for the given type.
103
120
  */
104
121
  async function getDefault(context, connectionType, includeCredentials = false) {
105
- var _a, e_1, _b, _c;
106
122
  const listOptions = {
107
123
  connectionType,
108
124
  defaultConnection: true,
109
125
  };
110
126
  // Use the list function to find default connections of the specified type
111
127
  const connections = list(context, listOptions);
112
- try {
113
- // Find the first default connection
114
- for (var _d = true, connections_1 = tslib_1.__asyncValues(connections), connections_1_1; connections_1_1 = await connections_1.next(), _a = connections_1_1.done, !_a; _d = true) {
115
- _c = connections_1_1.value;
116
- _d = false;
117
- const connection = _c;
118
- if (includeCredentials) {
119
- // If credentials are requested, get the connection with credentials
120
- return getWithCredentials(context, connection.name);
121
- }
122
- return connection;
123
- }
124
- }
125
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
126
- finally {
127
- try {
128
- if (!_d && !_a && (_b = connections_1.return)) await _b.call(connections_1);
128
+ // Find the first default connection
129
+ for await (const connection of connections) {
130
+ if (includeCredentials) {
131
+ // If credentials are requested, get the connection with credentials
132
+ return getWithCredentials(context, connection.name);
129
133
  }
130
- finally { if (e_1) throw e_1.error; }
134
+ return connection;
131
135
  }
132
136
  throw new Error(`No default connection found for type: ${connectionType}.`);
133
137
  }
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,8BAyBC;AAED,4CAOC;AAGD,oBAWC;AAED,0DAyBC;AAED,wEASC;AAGD,gDAOC;AAED,4BAyBC;AAED,0CAOC;AAGD,kBAWC;AAWD,gCAuBC;;AA5MD,sDAMgC;AAMhC,wEAAwE;AACxE,4EAG+C;AAC/C,yDAKiC;AAEjC,SAAgB,S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,0EAA0E;AACnE,KAAK,UAAU,GAAG,CACvB,OAAe,EACf,IAAY,EACZ,kBAA4B,EAC5B,UAAwC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE9D,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,kBAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;IACD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,UAAU,CAC9B,OAAe,EACf,cAA8B,EAC9B,qBAA8B,KAAK;;IAEnC,MAAM,WAAW,GAAG;QAClB,cAAc;QACd,iBAAiB,EAAE,IAAI;KACxB,CAAC;IAEF,0EAA0E;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;;QAE/C,oCAAoC;QACpC,KAA+B,eAAA,gBAAA,sBAAA,WAAW,CAAA,iBAAA,2FAAE,CAAC;YAAd,2BAAW;YAAX,WAAW;YAA/B,MAAM,UAAU,KAAA,CAAA;YACzB,IAAI,kBAAkB,EAAE,CAAC;gBACvB,oEAAoE;gBACpE,OAAO,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,UAAU,CAAC;QACpB,CAAC;;;;;;;;;IAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Connection,\n connectionDeserializer,\n _PagedConnection,\n _pagedConnectionDeserializer,\n ConnectionType,\n} from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _listSend(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections{?api-version,connectionType,defaultConnection}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedConnection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedConnectionDeserializer(result.body);\n}\n\n/** List all connections in the project, without populating connection credentials */\nexport function list(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Connection> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getWithCredentialsSend(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}/getConnectionWithCredentials{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getWithCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, with its connection credentials */\nexport async function getWithCredentials(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n const result = await _getWithCredentialsSend(context, name, options);\n return _getWithCredentialsDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, without populating connection credentials */\nexport async function get(\n context: Client,\n name: string,\n includeCredentials?: boolean,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n if (includeCredentials) {\n return getWithCredentials(context, name, options);\n }\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n\n/**\n * Get the default connection for a given connection type.\n *\n * @param context - The AIProjectContext client\n * @param connectionType - The type of the connection. Required.\n * @param includeCredentials - Whether to include credentials in the response. Default is false.\n * @returns A Connection object\n * @throws Error if no default connection is found for the given type.\n */\nexport async function getDefault(\n context: Client,\n connectionType: ConnectionType,\n includeCredentials: boolean = false,\n): Promise<Connection> {\n const listOptions = {\n connectionType,\n defaultConnection: true,\n };\n\n // Use the list function to find default connections of the specified type\n const connections = list(context, listOptions);\n\n // Find the first default connection\n for await (const connection of connections) {\n if (includeCredentials) {\n // If credentials are requested, get the connection with credentials\n return getWithCredentials(context, connection.name);\n }\n return connection;\n }\n\n throw new Error(`No default connection found for type: ${connectionType}.`);\n}\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,8BAyBC;AAED,4CAOC;AAGD,oBAWC;AAED,0DAyBC;AAED,wEASC;AAGD,gDAOC;AAED,4BAyBC;AAED,0CAOC;AAGD,kBAWC;AAWD,gCAuBC;AA5MD,sDAMgC;AAMhC,wEAAwE;AACxE,4EAG+C;AAC/C,yDAKiC;AAEjC,SAAgB,SAAS,CACvB,OAAe,EACf,UAAyC,EAAE,cAAc,EAAE,EAAE,EAAE;IAE/D,MAAM,IAAI,GAAG,IAAA,kCAAiB,EAC5B,6DAA6D,EAC7D;QACE,aAAa,EAAE,OAAO,CAAC,UAAU;QACjC,cAAc,EAAE,OAAO,EAAE,cAAc;QACvC,iBAAiB,EAAE,OAAO,EAAE,iBAAiB;KAC9C,EACD;QACE,aAAa,EAAE,OAAO,EAAE,cAAc,EAAE,eAAe;KACxD,CACF,CAAC;IACF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC;QAC5B,GAAG,IAAA,iDAAmC,EAAC,OAAO,CAAC;QAC/C,OAAO,EAAE;YACP,GAAG,CAAC,OAAO,EAAE,eAAe,KAAK,SAAS;gBACxC,CAAC,CAAC,EAAE,wBAAwB,EAAE,OAAO,EAAE,eAAe,EAAE;gBACxD,CAAC,CAAC,EAA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AAI,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,GAAG,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext as Client } from \"../index.js\";\nimport {\n Connection,\n connectionDeserializer,\n _PagedConnection,\n _pagedConnectionDeserializer,\n ConnectionType,\n} from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\nimport { expandUrlTemplate } from \"../../static-helpers/urlTemplate.js\";\nimport {\n PagedAsyncIterableIterator,\n buildPagedAsyncIterator,\n} from \"../../static-helpers/pagingHelpers.js\";\nimport {\n StreamableMethod,\n PathUncheckedResponse,\n createRestError,\n operationOptionsToRequestParameters,\n} from \"@azure-rest/core-client\";\n\nexport function _listSend(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections{?api-version,connectionType,defaultConnection}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _listDeserialize(result: PathUncheckedResponse): Promise<_PagedConnection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return _pagedConnectionDeserializer(result.body);\n}\n\n/** List all connections in the project, without populating connection credentials */\nexport function list(\n context: Client,\n options: ConnectionsListOptionalParams = { requestOptions: {} },\n): PagedAsyncIterableIterator<Connection> {\n return buildPagedAsyncIterator(\n context,\n () => _listSend(context, options),\n _listDeserialize,\n [\"200\"],\n { itemName: \"value\", nextLinkName: \"nextLink\" },\n );\n}\n\nexport function _getWithCredentialsSend(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}/getConnectionWithCredentials{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).post({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getWithCredentialsDeserialize(\n result: PathUncheckedResponse,\n): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, with its connection credentials */\nexport async function getWithCredentials(\n context: Client,\n name: string,\n options: ConnectionsGetWithCredentialsOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n const result = await _getWithCredentialsSend(context, name, options);\n return _getWithCredentialsDeserialize(result);\n}\n\nexport function _getSend(\n context: Client,\n name: string,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): StreamableMethod {\n const path = expandUrlTemplate(\n \"/connections/{name}{?api-version}\",\n {\n name: name,\n \"api-version\": context.apiVersion,\n },\n {\n allowReserved: options?.requestOptions?.skipUrlEncoding,\n },\n );\n return context.path(path).get({\n ...operationOptionsToRequestParameters(options),\n headers: {\n ...(options?.clientRequestId !== undefined\n ? { \"x-ms-client-request-id\": options?.clientRequestId }\n : {}),\n accept: \"application/json\",\n ...options.requestOptions?.headers,\n },\n });\n}\n\nexport async function _getDeserialize(result: PathUncheckedResponse): Promise<Connection> {\n const expectedStatuses = [\"200\"];\n if (!expectedStatuses.includes(result.status)) {\n throw createRestError(result);\n }\n\n return connectionDeserializer(result.body);\n}\n\n/** Get a connection by name, without populating connection credentials */\nexport async function get(\n context: Client,\n name: string,\n includeCredentials?: boolean,\n options: ConnectionsGetOptionalParams = { requestOptions: {} },\n): Promise<Connection> {\n if (includeCredentials) {\n return getWithCredentials(context, name, options);\n }\n const result = await _getSend(context, name, options);\n return _getDeserialize(result);\n}\n\n/**\n * Get the default connection for a given connection type.\n *\n * @param context - The AIProjectContext client\n * @param connectionType - The type of the connection. Required.\n * @param includeCredentials - Whether to include credentials in the response. Default is false.\n * @returns A Connection object\n * @throws Error if no default connection is found for the given type.\n */\nexport async function getDefault(\n context: Client,\n connectionType: ConnectionType,\n includeCredentials: boolean = false,\n): Promise<Connection> {\n const listOptions = {\n connectionType,\n defaultConnection: true,\n };\n\n // Use the list function to find default connections of the specified type\n const connections = list(context, listOptions);\n\n // Find the first default connection\n for await (const connection of connections) {\n if (includeCredentials) {\n // If credentials are requested, get the connection with credentials\n return getWithCredentials(context, connection.name);\n }\n return connection;\n }\n\n throw new Error(`No default connection found for type: ${connectionType}.`);\n}\n"]}
@@ -7,16 +7,16 @@ export declare function _getCredentialsSend(context: Client, name: string, versi
7
7
  export declare function _getCredentialsDeserialize(result: PathUncheckedResponse): Promise<AssetCredentialResponse>;
8
8
  /** Get the SAS credential to access the storage account associated with a Dataset version. */
9
9
  export declare function getCredentials(context: Client, name: string, version: string, options?: DatasetsGetCredentialsOptionalParams): Promise<AssetCredentialResponse>;
10
- export declare function _pendingUploadSend(context: Client, name: string, version: string, body: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): StreamableMethod;
10
+ export declare function _pendingUploadSend(context: Client, name: string, version: string, pendingUploadRequest: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): StreamableMethod;
11
11
  export declare function _pendingUploadDeserialize(result: PathUncheckedResponse): Promise<PendingUploadResponse>;
12
12
  /** Start a new or get an existing pending upload of a dataset for a specific version. */
13
- export declare function pendingUpload(context: Client, name: string, version: string, body: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): Promise<PendingUploadResponse>;
13
+ export declare function pendingUpload(context: Client, name: string, version: string, pendingUploadRequest: PendingUploadRequest, options?: DatasetsPendingUploadOptionalParams): Promise<PendingUploadResponse>;
14
14
  export declare function uploadFile(context: Client, name: string, version: string, filePath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
15
15
  export declare function uploadFolder(context: Client, name: string, version: string, folderPath: string, options?: DatasetUploadInternalOptions): Promise<DatasetVersionUnion>;
16
- export declare function _createOrUpdateSend(context: Client, name: string, version: string, body: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): StreamableMethod;
16
+ export declare function _createOrUpdateSend(context: Client, name: string, version: string, datasetVersion: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): StreamableMethod;
17
17
  export declare function _createOrUpdateDeserialize(result: PathUncheckedResponse): Promise<DatasetVersionUnion>;
18
18
  /** Create a new or update an existing DatasetVersion with the given version id */
19
- export declare function createOrUpdate(context: Client, name: string, version: string, body: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): Promise<DatasetVersionUnion>;
19
+ export declare function createOrUpdate(context: Client, name: string, version: string, datasetVersion: DatasetVersionUnion, options?: DatasetsCreateOrUpdateOptionalParams): Promise<DatasetVersionUnion>;
20
20
  export declare function _$deleteSend(context: Client, name: string, version: string, options?: DatasetsDeleteOptionalParams): StreamableMethod;
21
21
  export declare function _$deleteDeserialize(result: PathUncheckedResponse): Promise<void>;
22
22
  /** Delete the specific version of the DatasetVersion */
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/datasets/operations.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,4BAA4B,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EACL,oBAAoB,EAIpB,mBAAmB,EACnB,oBAAoB,EA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