@azure/ai-projects 1.0.0-alpha.20250505.4 → 1.0.0-alpha.20250512.4

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 (97) hide show
  1. package/dist/browser/aiProjectClient.d.ts +8 -0
  2. package/dist/browser/aiProjectClient.d.ts.map +1 -1
  3. package/dist/browser/aiProjectClient.js +15 -0
  4. package/dist/browser/aiProjectClient.js.map +1 -1
  5. package/dist/browser/api/aiProjectContext.d.ts +4 -0
  6. package/dist/browser/api/aiProjectContext.d.ts.map +1 -1
  7. package/dist/browser/api/aiProjectContext.js +1 -1
  8. package/dist/browser/api/aiProjectContext.js.map +1 -1
  9. package/dist/browser/api/connections/index.d.ts +1 -1
  10. package/dist/browser/api/connections/index.d.ts.map +1 -1
  11. package/dist/browser/api/connections/index.js +1 -1
  12. package/dist/browser/api/connections/index.js.map +1 -1
  13. package/dist/browser/api/connections/operations.d.ts +11 -1
  14. package/dist/browser/api/connections/operations.d.ts.map +1 -1
  15. package/dist/browser/api/connections/operations.js +40 -0
  16. package/dist/browser/api/connections/operations.js.map +1 -1
  17. package/dist/browser/classic/connections/index.d.ts +3 -1
  18. package/dist/browser/classic/connections/index.d.ts.map +1 -1
  19. package/dist/browser/classic/connections/index.js +2 -1
  20. package/dist/browser/classic/connections/index.js.map +1 -1
  21. package/dist/browser/constants.d.ts +9 -0
  22. package/dist/browser/constants.d.ts.map +1 -0
  23. package/dist/browser/constants.js +11 -0
  24. package/dist/browser/constants.js.map +1 -0
  25. package/dist/commonjs/aiProjectClient.d.ts +8 -0
  26. package/dist/commonjs/aiProjectClient.d.ts.map +1 -1
  27. package/dist/commonjs/aiProjectClient.js +15 -0
  28. package/dist/commonjs/aiProjectClient.js.map +1 -1
  29. package/dist/commonjs/api/aiProjectContext.d.ts +4 -0
  30. package/dist/commonjs/api/aiProjectContext.d.ts.map +1 -1
  31. package/dist/commonjs/api/aiProjectContext.js +1 -1
  32. package/dist/commonjs/api/aiProjectContext.js.map +1 -1
  33. package/dist/commonjs/api/connections/index.d.ts +1 -1
  34. package/dist/commonjs/api/connections/index.d.ts.map +1 -1
  35. package/dist/commonjs/api/connections/index.js +2 -1
  36. package/dist/commonjs/api/connections/index.js.map +1 -1
  37. package/dist/commonjs/api/connections/operations.d.ts +11 -1
  38. package/dist/commonjs/api/connections/operations.d.ts.map +1 -1
  39. package/dist/commonjs/api/connections/operations.js +41 -0
  40. package/dist/commonjs/api/connections/operations.js.map +1 -1
  41. package/dist/commonjs/classic/connections/index.d.ts +3 -1
  42. package/dist/commonjs/classic/connections/index.d.ts.map +1 -1
  43. package/dist/commonjs/classic/connections/index.js +1 -0
  44. package/dist/commonjs/classic/connections/index.js.map +1 -1
  45. package/dist/commonjs/constants.d.ts +9 -0
  46. package/dist/commonjs/constants.d.ts.map +1 -0
  47. package/dist/commonjs/constants.js +14 -0
  48. package/dist/commonjs/constants.js.map +1 -0
  49. package/dist/esm/aiProjectClient.d.ts +8 -0
  50. package/dist/esm/aiProjectClient.d.ts.map +1 -1
  51. package/dist/esm/aiProjectClient.js +15 -0
  52. package/dist/esm/aiProjectClient.js.map +1 -1
  53. package/dist/esm/api/aiProjectContext.d.ts +4 -0
  54. package/dist/esm/api/aiProjectContext.d.ts.map +1 -1
  55. package/dist/esm/api/aiProjectContext.js +1 -1
  56. package/dist/esm/api/aiProjectContext.js.map +1 -1
  57. package/dist/esm/api/connections/index.d.ts +1 -1
  58. package/dist/esm/api/connections/index.d.ts.map +1 -1
  59. package/dist/esm/api/connections/index.js +1 -1
  60. package/dist/esm/api/connections/index.js.map +1 -1
  61. package/dist/esm/api/connections/operations.d.ts +11 -1
  62. package/dist/esm/api/connections/operations.d.ts.map +1 -1
  63. package/dist/esm/api/connections/operations.js +40 -0
  64. package/dist/esm/api/connections/operations.js.map +1 -1
  65. package/dist/esm/classic/connections/index.d.ts +3 -1
  66. package/dist/esm/classic/connections/index.d.ts.map +1 -1
  67. package/dist/esm/classic/connections/index.js +2 -1
  68. package/dist/esm/classic/connections/index.js.map +1 -1
  69. package/dist/esm/constants.d.ts +9 -0
  70. package/dist/esm/constants.d.ts.map +1 -0
  71. package/dist/esm/constants.js +11 -0
  72. package/dist/esm/constants.js.map +1 -0
  73. package/dist/react-native/aiProjectClient.d.ts +8 -0
  74. package/dist/react-native/aiProjectClient.d.ts.map +1 -1
  75. package/dist/react-native/aiProjectClient.js +15 -0
  76. package/dist/react-native/aiProjectClient.js.map +1 -1
  77. package/dist/react-native/api/aiProjectContext.d.ts +4 -0
  78. package/dist/react-native/api/aiProjectContext.d.ts.map +1 -1
  79. package/dist/react-native/api/aiProjectContext.js +1 -1
  80. package/dist/react-native/api/aiProjectContext.js.map +1 -1
  81. package/dist/react-native/api/connections/index.d.ts +1 -1
  82. package/dist/react-native/api/connections/index.d.ts.map +1 -1
  83. package/dist/react-native/api/connections/index.js +1 -1
  84. package/dist/react-native/api/connections/index.js.map +1 -1
  85. package/dist/react-native/api/connections/operations.d.ts +11 -1
  86. package/dist/react-native/api/connections/operations.d.ts.map +1 -1
  87. package/dist/react-native/api/connections/operations.js +40 -0
  88. package/dist/react-native/api/connections/operations.js.map +1 -1
  89. package/dist/react-native/classic/connections/index.d.ts +3 -1
  90. package/dist/react-native/classic/connections/index.d.ts.map +1 -1
  91. package/dist/react-native/classic/connections/index.js +2 -1
  92. package/dist/react-native/classic/connections/index.js.map +1 -1
  93. package/dist/react-native/constants.d.ts +9 -0
  94. package/dist/react-native/constants.d.ts.map +1 -0
  95. package/dist/react-native/constants.js +11 -0
  96. package/dist/react-native/constants.js.map +1 -0
  97. package/package.json +16 -20
@@ -2,9 +2,10 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.get = exports.getWithCredentials = exports.list = void 0;
5
+ exports.getDefault = exports.get = exports.getWithCredentials = exports.list = void 0;
6
6
  var operations_js_1 = require("./operations.js");
7
7
  Object.defineProperty(exports, "list", { enumerable: true, get: function () { return operations_js_1.list; } });
8
8
  Object.defineProperty(exports, "getWithCredentials", { enumerable: true, get: function () { return operations_js_1.getWithCredentials; } });
9
9
  Object.defineProperty(exports, "get", { enumerable: true, get: function () { return operations_js_1.get; } });
10
+ Object.defineProperty(exports, "getDefault", { enumerable: true, get: function () { return operations_js_1.getDefault; } });
10
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAAgE;AAAvD,qGAAA,IAAI,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAAE,oGAAA,GAAG,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { list, getWithCredentials, get } from \"./operations.js\";\nexport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,iDAA4E;AAAnE,qGAAA,IAAI,OAAA;AAAE,mHAAA,kBAAkB,OAAA;AAAE,oGAAA,GAAG,OAAA;AAAE,2GAAA,UAAU,OAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { list, getWithCredentials, get, getDefault } from \"./operations.js\";\nexport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  import { AIProjectContext as Client } from "../index.js";
2
- import { Connection, _PagedConnection } from "../../models/models.js";
2
+ import { Connection, _PagedConnection, ConnectionType } from "../../models/models.js";
3
3
  import { ConnectionsListOptionalParams, ConnectionsGetWithCredentialsOptionalParams, ConnectionsGetOptionalParams } from "./options.js";
4
4
  import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
5
5
  import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
@@ -15,4 +15,14 @@ export declare function _getSend(context: Client, name: string, options?: Connec
15
15
  export declare function _getDeserialize(result: PathUncheckedResponse): Promise<Connection>;
16
16
  /** Get a connection by name, without populating connection credentials */
17
17
  export declare function get(context: Client, name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams): Promise<Connection>;
18
+ /**
19
+ * Get the default connection for a given connection type.
20
+ *
21
+ * @param context - The AIProjectContext client
22
+ * @param connectionType - The type of the connection. Required.
23
+ * @param includeCredentials - Whether to include credentials in the response. Default is false.
24
+ * @returns A Connection object
25
+ * @throws Error if no default connection is found for the given type.
26
+ */
27
+ export declare function getDefault(context: Client, connectionType: ConnectionType, includeCredentials?: boolean): Promise<Connection>;
18
28
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,UAAU,EAEV,gBAAgB,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAsD,GAC9D,gBAAgB,CAyBlB;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAO/F;AAED,qFAAqF;AACrF,wBAAgB,IAAI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 exports.getWithCredentials = getWithCredentials;
11
11
  exports._getSend = _getSend;
12
12
  exports._getDeserialize = _getDeserialize;
13
13
  exports.get = get;
14
+ exports.getDefault = getDefault;
15
+ const tslib_1 = require("tslib");
14
16
  const models_js_1 = require("../../models/models.js");
15
17
  const urlTemplate_js_1 = require("../../static-helpers/urlTemplate.js");
16
18
  const pagingHelpers_js_1 = require("../../static-helpers/pagingHelpers.js");
@@ -93,4 +95,43 @@ async function get(context, name, includeCredentials, options = { requestOptions
93
95
  const result = await _getSend(context, name, options);
94
96
  return _getDeserialize(result);
95
97
  }
98
+ /**
99
+ * Get the default connection for a given connection type.
100
+ *
101
+ * @param context - The AIProjectContext client
102
+ * @param connectionType - The type of the connection. Required.
103
+ * @param includeCredentials - Whether to include credentials in the response. Default is false.
104
+ * @returns A Connection object
105
+ * @throws Error if no default connection is found for the given type.
106
+ */
107
+ async function getDefault(context, connectionType, includeCredentials = false) {
108
+ var _a, e_1, _b, _c;
109
+ const listOptions = {
110
+ connectionType,
111
+ defaultConnection: true,
112
+ };
113
+ // Use the list function to find default connections of the specified type
114
+ const connections = list(context, listOptions);
115
+ try {
116
+ // Find the first default connection
117
+ 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) {
118
+ _c = connections_1_1.value;
119
+ _d = false;
120
+ const connection = _c;
121
+ if (includeCredentials) {
122
+ // If credentials are requested, get the connection with credentials
123
+ return getWithCredentials(context, connection.name);
124
+ }
125
+ return connection;
126
+ }
127
+ }
128
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
129
+ finally {
130
+ try {
131
+ if (!_d && !_a && (_b = connections_1.return)) await _b.call(connections_1);
132
+ }
133
+ finally { if (e_1) throw e_1.error; }
134
+ }
135
+ throw new Error(`No default connection found for type: ${connectionType}.`);
136
+ }
96
137
  //# sourceMappingURL=operations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":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AAe,EAAE;YACxD,CAAC,CAAC,EAAE,CAAC,KACP,MAAM,EAAE,kBAAkB,KACvB,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAEM,KAAK,UAAU,eAAe,CAAC,MAA6B;IACjE,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAA,6BAAe,EAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,IAAA,kCAAsB,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,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","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} 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,top,skip,maxpagesize}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n top: options?.top,\n skip: options?.skip,\n maxpagesize: options?.maxpagesize,\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"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2BlC,8BA4BC;AAED,4CAOC;AAGD,oBAWC;AAED,0DAyBC;AAED,wEASC;AAGD,gDAOC;AAED,4BAyBC;AAED,0CAOC;AAGD,kBAWC;AAWD,gCAuBC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c,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,top,skip,maxpagesize}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n top: options?.top,\n skip: options?.skip,\n maxpagesize: options?.maxpagesize,\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,5 +1,5 @@
1
1
  import { AIProjectContext } from "../../api/aiProjectContext.js";
2
- import { Connection } from "../../models/models.js";
2
+ import { Connection, ConnectionType } from "../../models/models.js";
3
3
  import { ConnectionsListOptionalParams, ConnectionsGetWithCredentialsOptionalParams, ConnectionsGetOptionalParams } from "../../api/connections/options.js";
4
4
  import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
5
5
  /** Interface representing a Connections operations. */
@@ -10,6 +10,8 @@ export interface ConnectionsOperations {
10
10
  getWithCredentials: (name: string, options?: ConnectionsGetWithCredentialsOptionalParams) => Promise<Connection>;
11
11
  /** Get a connection by name, without populating connection credentials */
12
12
  get: (name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams) => Promise<Connection>;
13
+ /** Get the default connection for the project */
14
+ getDefault: (connectionType: ConnectionType, includeCredentials?: boolean) => Promise<Connection>;
13
15
  }
14
16
  export declare function _getConnectionsOperations(context: AIProjectContext): ConnectionsOperations;
15
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC1F,gEAAgE;IAChE,kBAAkB,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,2CAA2C,KAClD,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,0EAA0E;IAC1E,GAAG,EAAE,CACH,IAAI,EAAE,MAAM,EACZ,kBAAkB,CAAC,EAAE,OAAO,EAC5B,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B;AAYD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CAI1F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC1F,gEAAgE;IAChE,kBAAkB,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,2CAA2C,KAClD,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,0EAA0E;IAC1E,GAAG,EAAE,CACH,IAAI,EAAE,MAAM,EACZ,kBAAkB,CAAC,EAAE,OAAO,EAC5B,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,iDAAiD;IACjD,UAAU,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,kBAAkB,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACnG;AAcD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CAI1F"}
@@ -9,6 +9,7 @@ function _getConnections(context) {
9
9
  list: (options) => (0, operations_js_1.list)(context, options),
10
10
  getWithCredentials: (name, options) => (0, operations_js_1.getWithCredentials)(context, name, options),
11
11
  get: (name, includeCredentials, options) => (0, operations_js_1.get)(context, name, includeCredentials, options),
12
+ getDefault: (connectionType, includeCredentials) => (0, operations_js_1.getDefault)(context, connectionType, includeCredentials),
12
13
  };
13
14
  }
14
15
  function _getConnectionsOperations(context) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuClC,8DAIC;AAlCD,uEAAoF;AAoBpF,SAAS,eAAe,CAAC,OAAyB;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,OAAuC,EAAE,EAAE,CAAC,IAAA,oBAAI,EAAC,OAAO,EAAE,OAAO,CAAC;QACzE,kBAAkB,EAAE,CAAC,IAAY,EAAE,OAAqD,EAAE,EAAE,CAC1F,IAAA,kCAAkB,EAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;QAC5C,GAAG,EAAE,CAAC,IAAY,EAAE,kBAA4B,EAAE,OAAsC,EAAE,EAAE,CAC1F,IAAA,mBAAG,EAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC;KAClD,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CAAC,OAAyB;IACjE,yBACK,eAAe,CAAC,OAAO,CAAC,EAC3B;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext } from \"../../api/aiProjectContext.js\";\nimport { Connection } from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"../../api/connections/options.js\";\nimport { list, getWithCredentials, get } from \"../../api/connections/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Connections operations. */\nexport interface ConnectionsOperations {\n /** List all connections in the project, without populating connection credentials */\n list: (options?: ConnectionsListOptionalParams) => PagedAsyncIterableIterator<Connection>;\n /** Get a connection by name, with its connection credentials */\n getWithCredentials: (\n name: string,\n options?: ConnectionsGetWithCredentialsOptionalParams,\n ) => Promise<Connection>;\n /** Get a connection by name, without populating connection credentials */\n get: (\n name: string,\n includeCredentials?: boolean,\n options?: ConnectionsGetOptionalParams,\n ) => Promise<Connection>;\n}\n\nfunction _getConnections(context: AIProjectContext) {\n return {\n list: (options?: ConnectionsListOptionalParams) => list(context, options),\n getWithCredentials: (name: string, options?: ConnectionsGetWithCredentialsOptionalParams) =>\n getWithCredentials(context, name, options),\n get: (name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams) =>\n get(context, name, includeCredentials, options),\n };\n}\n\nexport function _getConnectionsOperations(context: AIProjectContext): ConnectionsOperations {\n return {\n ..._getConnections(context),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA2ClC,8DAIC;AAtCD,uEAAgG;AAsBhG,SAAS,eAAe,CAAC,OAAyB;IAChD,OAAO;QACL,IAAI,EAAE,CAAC,OAAuC,EAAE,EAAE,CAAC,IAAA,oBAAI,EAAC,OAAO,EAAE,OAAO,CAAC;QACzE,kBAAkB,EAAE,CAAC,IAAY,EAAE,OAAqD,EAAE,EAAE,CAC1F,IAAA,kCAAkB,EAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC;QAC5C,GAAG,EAAE,CAAC,IAAY,EAAE,kBAA4B,EAAE,OAAsC,EAAE,EAAE,CAC1F,IAAA,mBAAG,EAAC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC;QACjD,UAAU,EAAE,CAAC,cAA8B,EAAE,kBAA4B,EAAE,EAAE,CAC3E,IAAA,0BAAU,EAAC,OAAO,EAAE,cAAc,EAAE,kBAAkB,CAAC;KAC1D,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CAAC,OAAyB;IACjE,yBACK,eAAe,CAAC,OAAO,CAAC,EAC3B;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AIProjectContext } from \"../../api/aiProjectContext.js\";\nimport { Connection, ConnectionType } from \"../../models/models.js\";\nimport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"../../api/connections/options.js\";\nimport { list, getWithCredentials, get, getDefault } from \"../../api/connections/operations.js\";\nimport { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a Connections operations. */\nexport interface ConnectionsOperations {\n /** List all connections in the project, without populating connection credentials */\n list: (options?: ConnectionsListOptionalParams) => PagedAsyncIterableIterator<Connection>;\n /** Get a connection by name, with its connection credentials */\n getWithCredentials: (\n name: string,\n options?: ConnectionsGetWithCredentialsOptionalParams,\n ) => Promise<Connection>;\n /** Get a connection by name, without populating connection credentials */\n get: (\n name: string,\n includeCredentials?: boolean,\n options?: ConnectionsGetOptionalParams,\n ) => Promise<Connection>;\n /** Get the default connection for the project */\n getDefault: (connectionType: ConnectionType, includeCredentials?: boolean) => Promise<Connection>;\n}\n\nfunction _getConnections(context: AIProjectContext) {\n return {\n list: (options?: ConnectionsListOptionalParams) => list(context, options),\n getWithCredentials: (name: string, options?: ConnectionsGetWithCredentialsOptionalParams) =>\n getWithCredentials(context, name, options),\n get: (name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams) =>\n get(context, name, includeCredentials, options),\n getDefault: (connectionType: ConnectionType, includeCredentials?: boolean) =>\n getDefault(context, connectionType, includeCredentials),\n };\n}\n\nexport function _getConnectionsOperations(context: AIProjectContext): ConnectionsOperations {\n return {\n ..._getConnections(context),\n };\n}\n"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Current version of the `@azure/ai-projects` package.
3
+ */
4
+ export declare const SDK_VERSION = "1.0.0-beta.5";
5
+ /**
6
+ * The package name of the `@azure/ai-projects` package.
7
+ */
8
+ export declare const PACKAGE_NAME = "@azure/ai-projects";
9
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,WAAW,iBAAiB,CAAC;AAE1C;;GAEG;AACH,eAAO,MAAM,YAAY,uBAAuB,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ // Copyright (c) Microsoft Corporation.
3
+ // Licensed under the MIT License.
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.PACKAGE_NAME = exports.SDK_VERSION = void 0;
6
+ /**
7
+ * Current version of the `@azure/ai-projects` package.
8
+ */
9
+ exports.SDK_VERSION = `1.0.0-beta.5`;
10
+ /**
11
+ * The package name of the `@azure/ai-projects` package.
12
+ */
13
+ exports.PACKAGE_NAME = "@azure/ai-projects";
14
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC;;GAEG;AACU,QAAA,WAAW,GAAG,cAAc,CAAC;AAE1C;;GAEG;AACU,QAAA,YAAY,GAAG,oBAAoB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Current version of the `@azure/ai-projects` package.\n */\nexport const SDK_VERSION = `1.0.0-beta.5`;\n\n/**\n * The package name of the `@azure/ai-projects` package.\n */\nexport const PACKAGE_NAME = \"@azure/ai-projects\";\n"]}
@@ -1,3 +1,4 @@
1
+ import { AgentsClient } from "@azure/ai-agents";
1
2
  import { AIProjectClientOptionalParams } from "./api/index.js";
2
3
  import { RedTeamsOperations } from "./classic/redTeams/index.js";
3
4
  import { DeploymentsOperations } from "./classic/deployments/index.js";
@@ -33,6 +34,7 @@ export declare class AIProjectClient {
33
34
  private _client;
34
35
  private _endpoint;
35
36
  private _credential;
37
+ private _agents;
36
38
  /** The pipeline used by this client to make requests */
37
39
  readonly pipeline: Pipeline;
38
40
  constructor(endpointParam: string, credential: TokenCredential, options?: AIProjectClientOptionalParams);
@@ -71,5 +73,11 @@ export declare class AIProjectClient {
71
73
  * @param options - The parameter for all optional parameters
72
74
  */
73
75
  static fromEndpoint(endpoint: string, credential: TokenCredential, options?: AIProjectClientOptionalParams): AIProjectClient;
76
+ /**
77
+ * Get the AgentsClient associated with this AIProjectClient.
78
+ *
79
+ * @returns The AgentsClient associated with this AIProjectClient
80
+ */
81
+ get agents(): AgentsClient;
74
82
  }
75
83
  //# sourceMappingURL=aiProjectClient.d.ts.map
@@ -1 +1 @@
1
-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* eslint-disable tsdoc/syntax */
4
+ import { AgentsClient } from "@azure/ai-agents";
4
5
  import { createAIProject } from "./api/index.js";
5
6
  import { _getRedTeamsOperations } from "./classic/redTeams/index.js";
6
7
  import { _getDeploymentsOperations } from "./classic/deployments/index.js";
@@ -73,5 +74,19 @@ export class AIProjectClient {
73
74
  static fromEndpoint(endpoint, credential, options = {}) {
74
75
  return new AIProjectClient(endpoint, credential, options);
75
76
  }
77
+ /**
78
+ * Get the AgentsClient associated with this AIProjectClient.
79
+ *
80
+ * @returns The AgentsClient associated with this AIProjectClient
81
+ */
82
+ // eslint-disable-next-line @azure/azure-sdk/ts-naming-subclients
83
+ get agents() {
84
+ if (!this._agents) {
85
+ this._agents = new AgentsClient(this._endpoint, this._credential, {
86
+ userAgentOptions: this._client.getUserAgent(),
87
+ });
88
+ }
89
+ return this._agents;
90
+ }
76
91
  }
77
92
  //# sourceMappingURL=aiProjectClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAqB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAuB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAEL,uBAAuB,EACvB,eAAe,GAEhB,MAAM,8BAA8B,CAAC;AAMtC;;;;;;;;;;;;;;;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,CAAC;IACzC,CAAC;IAqBD;;;OAGG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,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;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* eslint-disable tsdoc/syntax */\n\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 _client: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\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 const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.redTeams = _getRedTeamsOperations(this._client);\n this.deployments = _getDeploymentsOperations(this._client);\n this.indexes = _getIndexesOperations(this._client);\n this.datasets = _getDatasetsOperations(this._client);\n this.evaluations = _getEvaluationsOperations(this._client);\n this.connections = _getConnectionsOperations(this._client);\n this.inference = _getInferenceOperations(this._client, 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 * gets the credential of the client\n * @returns the credential of the client\n */\n public getCredential(): TokenCredential {\n return this._credential;\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"]}
1
+ {"version":3,"file":"aiProjectClient.js","sourceRoot":"","sources":["../../src/aiProjectClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,iCAAiC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAmD,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAqB,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACtF,OAAO,EAAsB,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAyB,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EAAuB,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EAEL,uBAAuB,EACvB,eAAe,GAEhB,MAAM,8BAA8B,CAAC;AAMtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,eAAe;IAQ1B,YACE,aAAqB,EACrB,UAA2B,EAC3B,UA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CAAC;IACxB,CAAC;IAED;;;OAGG;IACI,aAAa;QAClB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,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,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,OAAO,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE;gBAChE,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;aAC9C,CAAC,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;CACF","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 _client: AIProjectContext;\n private _endpoint: string;\n private _credential: TokenCredential;\n private _agents: AgentsClient | undefined;\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 const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix;\n const userAgentPrefix = prefixFromOptions\n ? `${prefixFromOptions} azsdk-js-client`\n : `azsdk-js-client`;\n this._client = createAIProject(endpointParam, credential, {\n ...options,\n userAgentOptions: { userAgentPrefix },\n });\n this.pipeline = this._client.pipeline;\n this.redTeams = _getRedTeamsOperations(this._client);\n this.deployments = _getDeploymentsOperations(this._client);\n this.indexes = _getIndexesOperations(this._client);\n this.datasets = _getDatasetsOperations(this._client);\n this.evaluations = _getEvaluationsOperations(this._client);\n this.connections = _getConnectionsOperations(this._client);\n this.inference = _getInferenceOperations(this._client, 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 * gets the credential of the client\n * @returns the credential of the client\n */\n public getCredential(): TokenCredential {\n return this._credential;\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 if (!this._agents) {\n this._agents = new AgentsClient(this._endpoint, this._credential, {\n userAgentOptions: this._client.getUserAgent(),\n });\n }\n return this._agents;\n }\n}\n"]}
@@ -6,6 +6,10 @@ export interface AIProjectContext extends Client {
6
6
  apiVersion: string;
7
7
  /** The endpoint URL used to construct AIProjectClient. */
8
8
  getEndpointUrl(): string;
9
+ /** The user agent string used to construct AIProjectClient. */
10
+ getUserAgent(): {
11
+ userAgentPrefix: string;
12
+ };
9
13
  /** The credential used to construct AIProjectClient. */
10
14
  getCredential(): TokenCredential;
11
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectContext.d.ts","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,gBAAiB,SAAQ,MAAM;IAC9C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,cAAc,IAAI,MAAM,CAAC;IACzB,wDAAwD;IACxD,aAAa,IAAI,eAAe,CAAC;CAClC;AAED,0CAA0C;AAC1C,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAClE,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC,GAC1C,gBAAgB,CAyClB"}
1
+ {"version":3,"file":"aiProjectContext.d.ts","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAa,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,gBAAiB,SAAQ,MAAM;IAC9C,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,cAAc,IAAI,MAAM,CAAC;IACzB,+DAA+D;IAC/D,YAAY,IAAI;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,wDAAwD;IACxD,aAAa,IAAI,eAAe,CAAC;CAClC;AAED,0CAA0C;AAC1C,MAAM,WAAW,6BAA8B,SAAQ,aAAa;IAClE,iDAAiD;IACjD,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,eAAe,EAC3B,OAAO,GAAE,6BAAkC,GAC1C,gBAAgB,CA0ClB"}
@@ -33,6 +33,6 @@ export function createAIProject(endpointParam, credential, options = {}) {
33
33
  return next(req);
34
34
  },
35
35
  });
36
- return Object.assign(Object.assign({}, clientContext), { apiVersion, getEndpointUrl: () => endpointUrl, getCredential: () => credential });
36
+ return Object.assign(Object.assign({}, clientContext), { apiVersion, getEndpointUrl: () => endpointUrl, getUserAgent: () => ({ userAgentPrefix }), getCredential: () => credential });
37
37
  }
38
38
  //# sourceMappingURL=aiProjectContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aiProjectContext.js","sourceRoot":"","sources":["../../../src/api/aiProjectContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAoB3E,MAAM,UAAU,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,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0CAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,mCAAmC,CAAC;IAC1D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,qCACD,OAAO,KACV,gBAAgB,EAAE,EAAE,eAAe,EAAE,EACrC,cAAc,EAAE,EAAE,MAAM,EAAE,MAAA,MAAA,OAA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O,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;KACF,CAAC,CAAC;IACH,OAAO,gCACF,aAAa,KAChB,UAAU,EACV,cAAc,EAAE,GAAG,EAAE,CAAC,WAAW,EACjC,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 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.6`;\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 apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\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 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;;AAElC,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAyB,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAsB3E,MAAM,UAAU,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,iBAAiB,GAAG,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,gBAAgB,0CAAE,eAAe,CAAC;IACrE,MAAM,aAAa,GAAG,mCAAmC,CAAC;IAC1D,MAAM,eAAe,GAAG,iBAAiB;QACvC,CAAC,CAAC,GAAG,iBAAiB,iBAAiB,aAAa,EAAE;QACtD,CAAC,CAAC,gBAAgB,aAAa,EAAE,CAAC;IACpC,MAAM,qCACD,OAAO,KACV,gBAAgB,EAAE,EAAE,eAAe,EAAE,EACr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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.6`;\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 apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? \"Ocp-Apim-Subscription-Key\",\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,3 +1,3 @@
1
- export { list, getWithCredentials, get } from "./operations.js";
1
+ export { list, getWithCredentials, get, getDefault } from "./operations.js";
2
2
  export { ConnectionsListOptionalParams, ConnectionsGetWithCredentialsOptionalParams, ConnectionsGetOptionalParams, } from "./options.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,GAC7B,MAAM,cAAc,CAAC"}
@@ -1,4 +1,4 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- export { list, getWithCredentials, get } from "./operations.js";
3
+ export { list, getWithCredentials, get, getDefault } from "./operations.js";
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { list, getWithCredentials, get } from \"./operations.js\";\nexport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/connections/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { list, getWithCredentials, get, getDefault } from \"./operations.js\";\nexport {\n ConnectionsListOptionalParams,\n ConnectionsGetWithCredentialsOptionalParams,\n ConnectionsGetOptionalParams,\n} from \"./options.js\";\n"]}
@@ -1,5 +1,5 @@
1
1
  import { AIProjectContext as Client } from "../index.js";
2
- import { Connection, _PagedConnection } from "../../models/models.js";
2
+ import { Connection, _PagedConnection, ConnectionType } from "../../models/models.js";
3
3
  import { ConnectionsListOptionalParams, ConnectionsGetWithCredentialsOptionalParams, ConnectionsGetOptionalParams } from "./options.js";
4
4
  import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
5
5
  import { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client";
@@ -15,4 +15,14 @@ export declare function _getSend(context: Client, name: string, options?: Connec
15
15
  export declare function _getDeserialize(result: PathUncheckedResponse): Promise<Connection>;
16
16
  /** Get a connection by name, without populating connection credentials */
17
17
  export declare function get(context: Client, name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams): Promise<Connection>;
18
+ /**
19
+ * Get the default connection for a given connection type.
20
+ *
21
+ * @param context - The AIProjectContext client
22
+ * @param connectionType - The type of the connection. Required.
23
+ * @param includeCredentials - Whether to include credentials in the response. Default is false.
24
+ * @returns A Connection object
25
+ * @throws Error if no default connection is found for the given type.
26
+ */
27
+ export declare function getDefault(context: Client, connectionType: ConnectionType, includeCredentials?: boolean): Promise<Connection>;
18
28
  //# sourceMappingURL=operations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EACL,UAAU,EAEV,gBAAgB,EAEjB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,EAC7B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,0BAA0B,EAE3B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EAGtB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,SAAS,CACvB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAsD,GAC9D,gBAAgB,CAyBlB;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAO/F;AAED,qFAAqF;AAC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@ -1,5 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
+ import { __asyncValues } from "tslib";
3
4
  import { connectionDeserializer, _pagedConnectionDeserializer, } from "../../models/models.js";
4
5
  import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js";
5
6
  import { buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js";
@@ -82,4 +83,43 @@ export async function get(context, name, includeCredentials, options = { request
82
83
  const result = await _getSend(context, name, options);
83
84
  return _getDeserialize(result);
84
85
  }
86
+ /**
87
+ * Get the default connection for a given connection type.
88
+ *
89
+ * @param context - The AIProjectContext client
90
+ * @param connectionType - The type of the connection. Required.
91
+ * @param includeCredentials - Whether to include credentials in the response. Default is false.
92
+ * @returns A Connection object
93
+ * @throws Error if no default connection is found for the given type.
94
+ */
95
+ export async function getDefault(context, connectionType, includeCredentials = false) {
96
+ var _a, e_1, _b, _c;
97
+ const listOptions = {
98
+ connectionType,
99
+ defaultConnection: true,
100
+ };
101
+ // Use the list function to find default connections of the specified type
102
+ const connections = list(context, listOptions);
103
+ try {
104
+ // Find the first default connection
105
+ for (var _d = true, connections_1 = __asyncValues(connections), connections_1_1; connections_1_1 = await connections_1.next(), _a = connections_1_1.done, !_a; _d = true) {
106
+ _c = connections_1_1.value;
107
+ _d = false;
108
+ const connection = _c;
109
+ if (includeCredentials) {
110
+ // If credentials are requested, get the connection with credentials
111
+ return getWithCredentials(context, connection.name);
112
+ }
113
+ return connection;
114
+ }
115
+ }
116
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
117
+ finally {
118
+ try {
119
+ if (!_d && !_a && (_b = connections_1.return)) await _b.call(connections_1);
120
+ }
121
+ finally { if (e_1) throw e_1.error; }
122
+ }
123
+ throw new Error(`No default connection found for type: ${connectionType}.`);
124
+ }
85
125
  //# sourceMappingURL=operations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"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AP,OAAO,CAAE,eAAe,EAAE;YACxD,CAAC,CAAC,EAAE,CAAC,KACP,MAAM,EAAE,kBAAkB,KACvB,MAAA,OAAO,CAAC,cAAc,0CAAE,OAAO,KAEpC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAA6B;IACjE,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAC,CAAC;IACjC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9C,MAAM,eAAe,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,OAAO,sBAAsB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC;AAED,0EAA0E;AAC1E,MAAM,CAAC,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","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} 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,top,skip,maxpagesize}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n top: options?.top,\n skip: options?.skip,\n maxpagesize: options?.maxpagesize,\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"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../../src/api/connections/operations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAGlC,OAAO,EAEL,sBAAsB,EAEtB,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,iBAAiB,EAAE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,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,top,skip,maxpagesize}\",\n {\n \"api-version\": context.apiVersion,\n connectionType: options?.connectionType,\n defaultConnection: options?.defaultConnection,\n top: options?.top,\n skip: options?.skip,\n maxpagesize: options?.maxpagesize,\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,5 +1,5 @@
1
1
  import { AIProjectContext } from "../../api/aiProjectContext.js";
2
- import { Connection } from "../../models/models.js";
2
+ import { Connection, ConnectionType } from "../../models/models.js";
3
3
  import { ConnectionsListOptionalParams, ConnectionsGetWithCredentialsOptionalParams, ConnectionsGetOptionalParams } from "../../api/connections/options.js";
4
4
  import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
5
5
  /** Interface representing a Connections operations. */
@@ -10,6 +10,8 @@ export interface ConnectionsOperations {
10
10
  getWithCredentials: (name: string, options?: ConnectionsGetWithCredentialsOptionalParams) => Promise<Connection>;
11
11
  /** Get a connection by name, without populating connection credentials */
12
12
  get: (name: string, includeCredentials?: boolean, options?: ConnectionsGetOptionalParams) => Promise<Connection>;
13
+ /** Get the default connection for the project */
14
+ getDefault: (connectionType: ConnectionType, includeCredentials?: boolean) => Promise<Connection>;
13
15
  }
14
16
  export declare function _getConnectionsOperations(context: AIProjectContext): ConnectionsOperations;
15
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,EAC3C,4BAA4B,EAC7B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AAEnF,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,6BAA6B,KAAK,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC1F,gEAAgE;IAChE,kBAAkB,EAAE,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,2CAA2C,KAClD,OAAO,CAAC,UAAU,CAAC,CAAC;IACzB,0EAA0E;IAC1E,GAAG,EAAE,CACH,IAAI,EAAE,MAAM,EACZ,kBAAkB,CAAC,EAAE,OAAO,EAC5B,OAAO,CAAC,EAAE,4BAA4B,KACnC,OAAO,CAAC,UAAU,CAAC,CAAC;CAC1B;AAYD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,gBAAgB,GAAG,qBAAqB,CAI1F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/classic/connections/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EACL,6BAA6B,EAC7B,2CAA2C,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