@aui.io/aui-client 3.1.2 → 3.2.0
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.
- package/README.md +196 -69
- package/dist/cjs/ApolloClientWrapper.d.ts +52 -24
- package/dist/cjs/ApolloClientWrapper.js +86 -58
- package/dist/cjs/BaseClient.d.ts +5 -0
- package/dist/cjs/Client.d.ts +4 -1
- package/dist/cjs/Client.js +24 -9
- package/dist/cjs/api/resources/agentVersions/client/Client.d.ts +26 -2
- package/dist/cjs/api/resources/agentVersions/client/Client.js +96 -43
- package/dist/cjs/api/resources/agentVersions/client/requests/AgentVersionPushRequest.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/Client.d.ts +22 -7
- package/dist/cjs/api/resources/agents/client/Client.js +80 -39
- package/dist/cjs/api/resources/agents/client/requests/{ExternalAgentCreateRequest.d.ts → AgentCreateRequest.d.ts} +1 -1
- package/dist/{esm/api/resources/agents/client/requests/ExternalAgentUpdateRequest.d.mts → cjs/api/resources/agents/client/requests/AgentUpdateRequest.d.ts} +1 -1
- package/dist/cjs/api/resources/agents/client/requests/ListAgentsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/agents/client/requests/index.d.ts +2 -2
- package/dist/cjs/api/resources/auth/client/Client.d.ts +3 -2
- package/dist/cjs/api/resources/auth/client/Client.js +20 -8
- package/dist/cjs/api/resources/channels/client/Client.d.ts +7 -6
- package/dist/cjs/api/resources/channels/client/Client.js +24 -12
- package/dist/cjs/api/resources/channels/client/requests/InitiateThreadRequest.d.ts +3 -10
- package/dist/cjs/api/resources/messaging/client/Client.d.ts +51 -14
- package/dist/cjs/api/resources/messaging/client/Client.js +249 -50
- package/dist/cjs/api/resources/messaging/client/requests/GenerateFollowupSuggestionsRequest.d.ts +9 -0
- package/dist/cjs/api/resources/messaging/client/requests/RerunMessageRequest.d.ts +2 -2
- package/dist/cjs/api/resources/messaging/client/requests/StreamMessageRequest.d.ts +0 -1
- package/dist/cjs/api/resources/messaging/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/projects/client/Client.d.ts +14 -2
- package/dist/cjs/api/resources/projects/client/Client.js +66 -31
- package/dist/cjs/api/resources/session/client/Client.d.ts +2 -1
- package/dist/cjs/api/resources/session/client/Client.js +12 -2
- package/dist/cjs/api/resources/threads/client/Client.d.ts +37 -2
- package/dist/cjs/api/resources/threads/client/Client.js +155 -31
- package/dist/cjs/api/resources/threads/client/requests/UpdateThreadRequest.d.ts +8 -0
- package/dist/cjs/api/resources/threads/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/{ExternalAgent.d.ts → Agent.d.ts} +1 -1
- package/dist/cjs/api/types/{ExternalAgentCreateResponse.d.ts → AgentCreateResponse.d.ts} +1 -1
- package/dist/cjs/api/types/{ExternalAgentListFilters.d.ts → AgentListFilters.d.ts} +1 -1
- package/dist/{esm/api/types/ExternalAgentUpdateResponse.d.mts → cjs/api/types/AgentUpdateResponse.d.ts} +1 -1
- package/dist/cjs/api/types/AgentVariables.d.ts +12 -0
- package/dist/cjs/api/types/AgentVersionPullResponse.d.ts +2 -3
- package/dist/cjs/api/types/AgentVersionPushResponse.d.ts +1 -1
- package/dist/cjs/api/types/AgentVersionWelcomeMessageResponse.d.ts +6 -0
- package/dist/cjs/api/types/GenerateFollowupSuggestionsResponse.d.ts +4 -0
- package/dist/cjs/api/types/PageAgent.d.ts +6 -0
- package/dist/cjs/api/types/PageAgentVersion.d.ts +6 -0
- package/dist/cjs/api/types/PageAgentVersion.js +3 -0
- package/dist/cjs/api/types/{ExternalPageLinks.d.ts → PageLinks.d.ts} +1 -1
- package/dist/cjs/api/types/PageLinks.js +3 -0
- package/dist/cjs/api/types/{ExternalPageMeta.d.ts → PageMeta.d.ts} +1 -1
- package/dist/cjs/api/types/PageMeta.js +3 -0
- package/dist/cjs/api/types/PageProject.d.ts +6 -0
- package/dist/cjs/api/types/PageProject.js +3 -0
- package/dist/cjs/api/types/PageThreadListItem.d.ts +6 -0
- package/dist/cjs/api/types/PageThreadListItem.js +3 -0
- package/dist/cjs/api/types/Project.d.ts +1 -1
- package/dist/cjs/api/types/SendMessageRequest.d.ts +7 -5
- package/dist/cjs/api/types/ThreadListFilters.d.ts +2 -5
- package/dist/cjs/api/types/TokenResponse.d.ts +4 -8
- package/dist/cjs/api/types/TraceDecision.d.ts +1 -2
- package/dist/cjs/api/types/VersionStats.d.ts +1 -2
- package/dist/cjs/api/types/index.d.ts +13 -10
- package/dist/cjs/api/types/index.js +13 -10
- package/dist/cjs/core/auth/AuthProvider.d.ts +4 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +5 -0
- package/dist/cjs/core/auth/BearerToken.js +15 -0
- package/dist/cjs/core/auth/index.d.ts +4 -0
- package/dist/cjs/core/auth/index.js +7 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/environments.d.ts +2 -2
- package/dist/cjs/environments.js +2 -2
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +3 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/ApolloClientWrapper.d.mts +52 -24
- package/dist/esm/ApolloClientWrapper.mjs +83 -56
- package/dist/esm/BaseClient.d.mts +5 -0
- package/dist/esm/Client.d.mts +4 -1
- package/dist/esm/Client.mjs +25 -10
- package/dist/esm/api/resources/agentVersions/client/Client.d.mts +26 -2
- package/dist/esm/api/resources/agentVersions/client/Client.mjs +97 -44
- package/dist/esm/api/resources/agentVersions/client/requests/AgentVersionPushRequest.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/Client.d.mts +22 -7
- package/dist/esm/api/resources/agents/client/Client.mjs +81 -40
- package/dist/esm/api/resources/agents/client/requests/{ExternalAgentCreateRequest.d.mts → AgentCreateRequest.d.mts} +1 -1
- package/dist/{cjs/api/resources/agents/client/requests/ExternalAgentUpdateRequest.d.ts → esm/api/resources/agents/client/requests/AgentUpdateRequest.d.mts} +1 -1
- package/dist/esm/api/resources/agents/client/requests/ListAgentsRequest.d.mts +1 -1
- package/dist/esm/api/resources/agents/client/requests/index.d.mts +2 -2
- package/dist/esm/api/resources/auth/client/Client.d.mts +3 -2
- package/dist/esm/api/resources/auth/client/Client.mjs +21 -9
- package/dist/esm/api/resources/channels/client/Client.d.mts +7 -6
- package/dist/esm/api/resources/channels/client/Client.mjs +25 -13
- package/dist/esm/api/resources/channels/client/requests/InitiateThreadRequest.d.mts +3 -10
- package/dist/esm/api/resources/messaging/client/Client.d.mts +51 -14
- package/dist/esm/api/resources/messaging/client/Client.mjs +249 -50
- package/dist/esm/api/resources/messaging/client/requests/GenerateFollowupSuggestionsRequest.d.mts +9 -0
- package/dist/esm/api/resources/messaging/client/requests/RerunMessageRequest.d.mts +2 -2
- package/dist/esm/api/resources/messaging/client/requests/StreamMessageRequest.d.mts +0 -1
- package/dist/esm/api/resources/messaging/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/projects/client/Client.d.mts +14 -2
- package/dist/esm/api/resources/projects/client/Client.mjs +67 -32
- package/dist/esm/api/resources/session/client/Client.d.mts +2 -1
- package/dist/esm/api/resources/session/client/Client.mjs +12 -2
- package/dist/esm/api/resources/threads/client/Client.d.mts +37 -2
- package/dist/esm/api/resources/threads/client/Client.mjs +156 -32
- package/dist/esm/api/resources/threads/client/requests/UpdateThreadRequest.d.mts +8 -0
- package/dist/esm/api/resources/threads/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/{ExternalAgent.d.mts → Agent.d.mts} +1 -1
- package/dist/esm/api/types/{ExternalAgentCreateResponse.d.mts → AgentCreateResponse.d.mts} +1 -1
- package/dist/esm/api/types/{ExternalAgentListFilters.d.mts → AgentListFilters.d.mts} +1 -1
- package/dist/{cjs/api/types/ExternalAgentUpdateResponse.d.ts → esm/api/types/AgentUpdateResponse.d.mts} +1 -1
- package/dist/esm/api/types/AgentVariables.d.mts +12 -0
- package/dist/esm/api/types/AgentVersionPullResponse.d.mts +2 -3
- package/dist/esm/api/types/AgentVersionPushResponse.d.mts +1 -1
- package/dist/esm/api/types/AgentVersionWelcomeMessageResponse.d.mts +6 -0
- package/dist/esm/api/types/GenerateFollowupSuggestionsResponse.d.mts +4 -0
- package/dist/esm/api/types/PageAgent.d.mts +6 -0
- package/dist/esm/api/types/PageAgentVersion.d.mts +6 -0
- package/dist/esm/api/types/PageAgentVersion.mjs +2 -0
- package/dist/esm/api/types/{ExternalPageLinks.d.mts → PageLinks.d.mts} +1 -1
- package/dist/esm/api/types/PageLinks.mjs +2 -0
- package/dist/esm/api/types/{ExternalPageMeta.d.mts → PageMeta.d.mts} +1 -1
- package/dist/esm/api/types/PageMeta.mjs +2 -0
- package/dist/esm/api/types/PageProject.d.mts +6 -0
- package/dist/esm/api/types/PageProject.mjs +2 -0
- package/dist/esm/api/types/PageThreadListItem.d.mts +6 -0
- package/dist/esm/api/types/PageThreadListItem.mjs +2 -0
- package/dist/esm/api/types/Project.d.mts +1 -1
- package/dist/esm/api/types/SendMessageRequest.d.mts +7 -5
- package/dist/esm/api/types/ThreadListFilters.d.mts +2 -5
- package/dist/esm/api/types/TokenResponse.d.mts +4 -8
- package/dist/esm/api/types/TraceDecision.d.mts +1 -2
- package/dist/esm/api/types/VersionStats.d.mts +1 -2
- package/dist/esm/api/types/index.d.mts +13 -10
- package/dist/esm/api/types/index.mjs +13 -10
- package/dist/esm/core/auth/AuthProvider.d.mts +4 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +5 -0
- package/dist/esm/core/auth/BearerToken.mjs +12 -0
- package/dist/esm/core/auth/index.d.mts +4 -0
- package/dist/esm/core/auth/index.mjs +2 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/environments.d.mts +2 -2
- package/dist/esm/environments.mjs +2 -2
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +568 -29
- package/dist/cjs/api/types/ExternalPageAgentVersion.d.ts +0 -6
- package/dist/cjs/api/types/ExternalPageExternalAgent.d.ts +0 -6
- package/dist/cjs/api/types/ExternalPageProject.d.ts +0 -6
- package/dist/cjs/api/types/ExternalPageThreadListItem.d.ts +0 -6
- package/dist/esm/api/types/ExternalPageAgentVersion.d.mts +0 -6
- package/dist/esm/api/types/ExternalPageExternalAgent.d.mts +0 -6
- package/dist/esm/api/types/ExternalPageProject.d.mts +0 -6
- package/dist/esm/api/types/ExternalPageThreadListItem.d.mts +0 -6
- /package/dist/cjs/api/resources/agents/client/requests/{ExternalAgentCreateRequest.js → AgentCreateRequest.js} +0 -0
- /package/dist/cjs/api/resources/agents/client/requests/{ExternalAgentUpdateRequest.js → AgentUpdateRequest.js} +0 -0
- /package/dist/cjs/api/{types/ExternalAgent.js → resources/messaging/client/requests/GenerateFollowupSuggestionsRequest.js} +0 -0
- /package/dist/cjs/api/{types/ExternalAgentCreateResponse.js → resources/threads/client/requests/UpdateThreadRequest.js} +0 -0
- /package/dist/cjs/api/types/{ExternalAgentListFilters.js → Agent.js} +0 -0
- /package/dist/cjs/api/types/{ExternalAgentUpdateResponse.js → AgentCreateResponse.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageAgentVersion.js → AgentListFilters.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageExternalAgent.js → AgentUpdateResponse.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageLinks.js → AgentVariables.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageMeta.js → AgentVersionWelcomeMessageResponse.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageProject.js → GenerateFollowupSuggestionsResponse.js} +0 -0
- /package/dist/cjs/api/types/{ExternalPageThreadListItem.js → PageAgent.js} +0 -0
- /package/dist/esm/api/resources/agents/client/requests/{ExternalAgentCreateRequest.mjs → AgentCreateRequest.mjs} +0 -0
- /package/dist/esm/api/resources/agents/client/requests/{ExternalAgentUpdateRequest.mjs → AgentUpdateRequest.mjs} +0 -0
- /package/dist/esm/api/{types/ExternalAgent.mjs → resources/messaging/client/requests/GenerateFollowupSuggestionsRequest.mjs} +0 -0
- /package/dist/esm/api/{types/ExternalAgentCreateResponse.mjs → resources/threads/client/requests/UpdateThreadRequest.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalAgentListFilters.mjs → Agent.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalAgentUpdateResponse.mjs → AgentCreateResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageAgentVersion.mjs → AgentListFilters.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageExternalAgent.mjs → AgentUpdateResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageLinks.mjs → AgentVariables.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageMeta.mjs → AgentVersionWelcomeMessageResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageProject.mjs → GenerateFollowupSuggestionsResponse.mjs} +0 -0
- /package/dist/esm/api/types/{ExternalPageThreadListItem.mjs → PageAgent.mjs} +0 -0
package/dist/esm/Client.mjs
CHANGED
|
@@ -16,17 +16,18 @@ import { Messaging } from "./api/resources/messaging/client/Client.mjs";
|
|
|
16
16
|
import { Projects } from "./api/resources/projects/client/Client.mjs";
|
|
17
17
|
import { Session } from "./api/resources/session/client/Client.mjs";
|
|
18
18
|
import { Threads } from "./api/resources/threads/client/Client.mjs";
|
|
19
|
-
import { mergeHeaders } from "./core/headers.mjs";
|
|
19
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "./core/headers.mjs";
|
|
20
20
|
import * as core from "./core/index.mjs";
|
|
21
21
|
import * as environments from "./environments.mjs";
|
|
22
22
|
import * as errors from "./errors/index.mjs";
|
|
23
23
|
export class ApolloClient {
|
|
24
|
-
constructor(_options
|
|
24
|
+
constructor(_options) {
|
|
25
25
|
this._options = Object.assign(Object.assign({}, _options), { logging: core.logging.createLogger(_options === null || _options === void 0 ? void 0 : _options.logging), headers: mergeHeaders({
|
|
26
|
+
"x-organization-api-key": _options === null || _options === void 0 ? void 0 : _options.organizationApiKey,
|
|
26
27
|
"X-Fern-Language": "JavaScript",
|
|
27
28
|
"X-Fern-SDK-Name": "@aui.io/aui-client",
|
|
28
|
-
"X-Fern-SDK-Version": "3.
|
|
29
|
-
"User-Agent": "@aui.io/aui-client/3.
|
|
29
|
+
"X-Fern-SDK-Version": "3.2.0",
|
|
30
|
+
"User-Agent": "@aui.io/aui-client/3.2.0",
|
|
30
31
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
31
32
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
32
33
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -64,6 +65,8 @@ export class ApolloClient {
|
|
|
64
65
|
return ((_a = this._session) !== null && _a !== void 0 ? _a : (this._session = new Session(this._options)));
|
|
65
66
|
}
|
|
66
67
|
/**
|
|
68
|
+
* Liveness probe. Returns ``{"status": "ok"}`` when the service is up.
|
|
69
|
+
*
|
|
67
70
|
* @param {ApolloClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
68
71
|
*
|
|
69
72
|
* @example
|
|
@@ -74,17 +77,20 @@ export class ApolloClient {
|
|
|
74
77
|
}
|
|
75
78
|
__health(requestOptions) {
|
|
76
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
80
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
81
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
82
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
83
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
84
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
79
85
|
const _response = yield core.fetcher({
|
|
80
|
-
url: core.url.join((
|
|
86
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, "health"),
|
|
81
87
|
method: "GET",
|
|
82
88
|
headers: _headers,
|
|
83
89
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
84
|
-
timeoutMs: ((
|
|
85
|
-
maxRetries: (
|
|
90
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
91
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
86
92
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
87
|
-
fetchFn: (
|
|
93
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
88
94
|
logging: this._options.logging,
|
|
89
95
|
});
|
|
90
96
|
if (_response.ok) {
|
|
@@ -114,4 +120,13 @@ export class ApolloClient {
|
|
|
114
120
|
}
|
|
115
121
|
});
|
|
116
122
|
}
|
|
123
|
+
_getAuthorizationHeader() {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
126
|
+
if (bearer != null) {
|
|
127
|
+
return `Bearer ${bearer}`;
|
|
128
|
+
}
|
|
129
|
+
return undefined;
|
|
130
|
+
});
|
|
131
|
+
}
|
|
117
132
|
}
|
|
@@ -9,8 +9,11 @@ export declare namespace AgentVersions {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class AgentVersions {
|
|
11
11
|
protected readonly _options: AgentVersions.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options: AgentVersions.Options);
|
|
13
13
|
/**
|
|
14
|
+
* List an agent's versions, newest first. Filter by status, tag, label,
|
|
15
|
+
* or version number; set ``exclude_revisions`` to see only base versions.
|
|
16
|
+
*
|
|
14
17
|
* @param {string} agentId
|
|
15
18
|
* @param {Apollo.ListVersionsRequest} request
|
|
16
19
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -28,9 +31,13 @@ export declare class AgentVersions {
|
|
|
28
31
|
* filters: {}
|
|
29
32
|
* })
|
|
30
33
|
*/
|
|
31
|
-
listVersions(agentId: string, request: Apollo.ListVersionsRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.
|
|
34
|
+
listVersions(agentId: string, request: Apollo.ListVersionsRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.PageAgentVersion>;
|
|
32
35
|
private __listVersions;
|
|
33
36
|
/**
|
|
37
|
+
* Create a new draft version — empty, from a template, or cloned from an
|
|
38
|
+
* existing version (``source`` selects which). Drafts stay editable until
|
|
39
|
+
* published.
|
|
40
|
+
*
|
|
34
41
|
* @param {string} agentId
|
|
35
42
|
* @param {Apollo.AgentVersionCreateRequest} request
|
|
36
43
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -51,6 +58,9 @@ export declare class AgentVersions {
|
|
|
51
58
|
createVersion(agentId: string, request: Apollo.AgentVersionCreateRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionCreateResponse>;
|
|
52
59
|
private __createVersion;
|
|
53
60
|
/**
|
|
61
|
+
* Update a version's metadata: label, tags, and notes. The configuration
|
|
62
|
+
* itself changes through push, never here.
|
|
63
|
+
*
|
|
54
64
|
* @param {string} agentId
|
|
55
65
|
* @param {string} versionId
|
|
56
66
|
* @param {Apollo.AgentVersionUpdateRequest} request
|
|
@@ -70,6 +80,10 @@ export declare class AgentVersions {
|
|
|
70
80
|
updateVersion(agentId: string, versionId: string, request?: Apollo.AgentVersionUpdateRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionUpdateResponse>;
|
|
71
81
|
private __updateVersion;
|
|
72
82
|
/**
|
|
83
|
+
* Make this version the agent's live version. Publishing a draft freezes
|
|
84
|
+
* it first; publishing an already-published version re-activates it — the
|
|
85
|
+
* same call handles shipping, switching, and rolling back.
|
|
86
|
+
*
|
|
73
87
|
* @param {string} agentId
|
|
74
88
|
* @param {string} versionId
|
|
75
89
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -88,6 +102,9 @@ export declare class AgentVersions {
|
|
|
88
102
|
publishVersion(agentId: string, versionId: string, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionPublishResponse>;
|
|
89
103
|
private __publishVersion;
|
|
90
104
|
/**
|
|
105
|
+
* Archive a version to retire it from everyday use. The agent's live
|
|
106
|
+
* version can't be archived — publish another version first.
|
|
107
|
+
*
|
|
91
108
|
* @param {string} agentId
|
|
92
109
|
* @param {string} versionId
|
|
93
110
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -106,6 +123,9 @@ export declare class AgentVersions {
|
|
|
106
123
|
archiveVersion(agentId: string, versionId: string, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionArchiveResponse>;
|
|
107
124
|
private __archiveVersion;
|
|
108
125
|
/**
|
|
126
|
+
* Upload a configuration bundle to a version, committing a new revision.
|
|
127
|
+
* The response carries the new revision's tag and content digest.
|
|
128
|
+
*
|
|
109
129
|
* @param {string} agentId
|
|
110
130
|
* @param {string} versionId
|
|
111
131
|
* @param {Apollo.AgentVersionPushRequest} request
|
|
@@ -130,6 +150,9 @@ export declare class AgentVersions {
|
|
|
130
150
|
pushVersion(agentId: string, versionId: string, request: Apollo.AgentVersionPushRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionPushResponse>;
|
|
131
151
|
private __pushVersion;
|
|
132
152
|
/**
|
|
153
|
+
* Download a version's configuration bundle — the current revision, or a
|
|
154
|
+
* specific one via ``version_tag``.
|
|
155
|
+
*
|
|
133
156
|
* @param {string} agentId
|
|
134
157
|
* @param {string} versionId
|
|
135
158
|
* @param {Apollo.PullVersionRequest} request
|
|
@@ -150,4 +173,5 @@ export declare class AgentVersions {
|
|
|
150
173
|
*/
|
|
151
174
|
pullVersion(agentId: string, versionId: string, request?: Apollo.PullVersionRequest, requestOptions?: AgentVersions.RequestOptions): core.HttpResponsePromise<Apollo.AgentVersionPullResponse>;
|
|
152
175
|
private __pullVersion;
|
|
176
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
153
177
|
}
|
|
@@ -8,16 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
11
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
12
12
|
import * as core from "../../../../core/index.mjs";
|
|
13
13
|
import * as environments from "../../../../environments.mjs";
|
|
14
14
|
import * as errors from "../../../../errors/index.mjs";
|
|
15
15
|
import * as Apollo from "../../../index.mjs";
|
|
16
16
|
export class AgentVersions {
|
|
17
|
-
constructor(_options
|
|
17
|
+
constructor(_options) {
|
|
18
18
|
this._options = _options;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
+
* List an agent's versions, newest first. Filter by status, tag, label,
|
|
22
|
+
* or version number; set ``exclude_revisions`` to see only base versions.
|
|
23
|
+
*
|
|
21
24
|
* @param {string} agentId
|
|
22
25
|
* @param {Apollo.ListVersionsRequest} request
|
|
23
26
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -40,7 +43,7 @@ export class AgentVersions {
|
|
|
40
43
|
}
|
|
41
44
|
__listVersions(agentId, request, requestOptions) {
|
|
42
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
46
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
44
47
|
const { filters, "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, sort_by: sortBy, sort_order: sortOrder, } = request;
|
|
45
48
|
const _queryParams = {};
|
|
46
49
|
_queryParams.filters = filters;
|
|
@@ -59,16 +62,19 @@ export class AgentVersions {
|
|
|
59
62
|
if (sortOrder != null) {
|
|
60
63
|
_queryParams.sort_order = sortOrder;
|
|
61
64
|
}
|
|
62
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
65
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
66
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
67
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
68
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
63
69
|
const _response = yield core.fetcher({
|
|
64
|
-
url: core.url.join((
|
|
70
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions`),
|
|
65
71
|
method: "GET",
|
|
66
72
|
headers: _headers,
|
|
67
73
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
68
|
-
timeoutMs: ((
|
|
69
|
-
maxRetries: (
|
|
74
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
75
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
70
76
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
71
|
-
fetchFn: (
|
|
77
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
72
78
|
logging: this._options.logging,
|
|
73
79
|
});
|
|
74
80
|
if (_response.ok) {
|
|
@@ -116,6 +122,10 @@ export class AgentVersions {
|
|
|
116
122
|
});
|
|
117
123
|
}
|
|
118
124
|
/**
|
|
125
|
+
* Create a new draft version — empty, from a template, or cloned from an
|
|
126
|
+
* existing version (``source`` selects which). Drafts stay editable until
|
|
127
|
+
* published.
|
|
128
|
+
*
|
|
119
129
|
* @param {string} agentId
|
|
120
130
|
* @param {Apollo.AgentVersionCreateRequest} request
|
|
121
131
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -138,20 +148,23 @@ export class AgentVersions {
|
|
|
138
148
|
}
|
|
139
149
|
__createVersion(agentId, request, requestOptions) {
|
|
140
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
142
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
151
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
152
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
153
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
154
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
155
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
143
156
|
const _response = yield core.fetcher({
|
|
144
|
-
url: core.url.join((
|
|
157
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions`),
|
|
145
158
|
method: "POST",
|
|
146
159
|
headers: _headers,
|
|
147
160
|
contentType: "application/json",
|
|
148
161
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
149
162
|
requestType: "json",
|
|
150
163
|
body: request,
|
|
151
|
-
timeoutMs: ((
|
|
152
|
-
maxRetries: (
|
|
164
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
165
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
153
166
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
154
|
-
fetchFn: (
|
|
167
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
155
168
|
logging: this._options.logging,
|
|
156
169
|
});
|
|
157
170
|
if (_response.ok) {
|
|
@@ -199,6 +212,9 @@ export class AgentVersions {
|
|
|
199
212
|
});
|
|
200
213
|
}
|
|
201
214
|
/**
|
|
215
|
+
* Update a version's metadata: label, tags, and notes. The configuration
|
|
216
|
+
* itself changes through push, never here.
|
|
217
|
+
*
|
|
202
218
|
* @param {string} agentId
|
|
203
219
|
* @param {string} versionId
|
|
204
220
|
* @param {Apollo.AgentVersionUpdateRequest} request
|
|
@@ -220,20 +236,23 @@ export class AgentVersions {
|
|
|
220
236
|
}
|
|
221
237
|
__updateVersion(agentId_1, versionId_1) {
|
|
222
238
|
return __awaiter(this, arguments, void 0, function* (agentId, versionId, request = {}, requestOptions) {
|
|
223
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
224
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
239
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
240
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
241
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
242
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
243
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
225
244
|
const _response = yield core.fetcher({
|
|
226
|
-
url: core.url.join((
|
|
245
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions/${core.url.encodePathParam(versionId)}`),
|
|
227
246
|
method: "PATCH",
|
|
228
247
|
headers: _headers,
|
|
229
248
|
contentType: "application/json",
|
|
230
249
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
231
250
|
requestType: "json",
|
|
232
251
|
body: request,
|
|
233
|
-
timeoutMs: ((
|
|
234
|
-
maxRetries: (
|
|
252
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
253
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
235
254
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
236
|
-
fetchFn: (
|
|
255
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
237
256
|
logging: this._options.logging,
|
|
238
257
|
});
|
|
239
258
|
if (_response.ok) {
|
|
@@ -281,6 +300,10 @@ export class AgentVersions {
|
|
|
281
300
|
});
|
|
282
301
|
}
|
|
283
302
|
/**
|
|
303
|
+
* Make this version the agent's live version. Publishing a draft freezes
|
|
304
|
+
* it first; publishing an already-published version re-activates it — the
|
|
305
|
+
* same call handles shipping, switching, and rolling back.
|
|
306
|
+
*
|
|
284
307
|
* @param {string} agentId
|
|
285
308
|
* @param {string} versionId
|
|
286
309
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -301,17 +324,20 @@ export class AgentVersions {
|
|
|
301
324
|
}
|
|
302
325
|
__publishVersion(agentId, versionId, requestOptions) {
|
|
303
326
|
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
305
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
327
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
328
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
329
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
330
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
331
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
306
332
|
const _response = yield core.fetcher({
|
|
307
|
-
url: core.url.join((
|
|
333
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions/${core.url.encodePathParam(versionId)}/publish`),
|
|
308
334
|
method: "POST",
|
|
309
335
|
headers: _headers,
|
|
310
336
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
311
|
-
timeoutMs: ((
|
|
312
|
-
maxRetries: (
|
|
337
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
338
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
313
339
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
314
|
-
fetchFn: (
|
|
340
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
315
341
|
logging: this._options.logging,
|
|
316
342
|
});
|
|
317
343
|
if (_response.ok) {
|
|
@@ -359,6 +385,9 @@ export class AgentVersions {
|
|
|
359
385
|
});
|
|
360
386
|
}
|
|
361
387
|
/**
|
|
388
|
+
* Archive a version to retire it from everyday use. The agent's live
|
|
389
|
+
* version can't be archived — publish another version first.
|
|
390
|
+
*
|
|
362
391
|
* @param {string} agentId
|
|
363
392
|
* @param {string} versionId
|
|
364
393
|
* @param {AgentVersions.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -379,17 +408,20 @@ export class AgentVersions {
|
|
|
379
408
|
}
|
|
380
409
|
__archiveVersion(agentId, versionId, requestOptions) {
|
|
381
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
382
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
383
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
411
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
412
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
413
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
414
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
415
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
384
416
|
const _response = yield core.fetcher({
|
|
385
|
-
url: core.url.join((
|
|
417
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions/${core.url.encodePathParam(versionId)}/archive`),
|
|
386
418
|
method: "POST",
|
|
387
419
|
headers: _headers,
|
|
388
420
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
389
|
-
timeoutMs: ((
|
|
390
|
-
maxRetries: (
|
|
421
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
422
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
391
423
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
392
|
-
fetchFn: (
|
|
424
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
393
425
|
logging: this._options.logging,
|
|
394
426
|
});
|
|
395
427
|
if (_response.ok) {
|
|
@@ -437,6 +469,9 @@ export class AgentVersions {
|
|
|
437
469
|
});
|
|
438
470
|
}
|
|
439
471
|
/**
|
|
472
|
+
* Upload a configuration bundle to a version, committing a new revision.
|
|
473
|
+
* The response carries the new revision's tag and content digest.
|
|
474
|
+
*
|
|
440
475
|
* @param {string} agentId
|
|
441
476
|
* @param {string} versionId
|
|
442
477
|
* @param {Apollo.AgentVersionPushRequest} request
|
|
@@ -463,20 +498,23 @@ export class AgentVersions {
|
|
|
463
498
|
}
|
|
464
499
|
__pushVersion(agentId, versionId, request, requestOptions) {
|
|
465
500
|
return __awaiter(this, void 0, void 0, function* () {
|
|
466
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
467
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
501
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
502
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
503
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
504
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
505
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
468
506
|
const _response = yield core.fetcher({
|
|
469
|
-
url: core.url.join((
|
|
507
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions/${core.url.encodePathParam(versionId)}/push`),
|
|
470
508
|
method: "POST",
|
|
471
509
|
headers: _headers,
|
|
472
510
|
contentType: "application/json",
|
|
473
511
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
474
512
|
requestType: "json",
|
|
475
513
|
body: request,
|
|
476
|
-
timeoutMs: ((
|
|
477
|
-
maxRetries: (
|
|
514
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
515
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
478
516
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
479
|
-
fetchFn: (
|
|
517
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
480
518
|
logging: this._options.logging,
|
|
481
519
|
});
|
|
482
520
|
if (_response.ok) {
|
|
@@ -524,6 +562,9 @@ export class AgentVersions {
|
|
|
524
562
|
});
|
|
525
563
|
}
|
|
526
564
|
/**
|
|
565
|
+
* Download a version's configuration bundle — the current revision, or a
|
|
566
|
+
* specific one via ``version_tag``.
|
|
567
|
+
*
|
|
527
568
|
* @param {string} agentId
|
|
528
569
|
* @param {string} versionId
|
|
529
570
|
* @param {Apollo.PullVersionRequest} request
|
|
@@ -547,22 +588,25 @@ export class AgentVersions {
|
|
|
547
588
|
}
|
|
548
589
|
__pullVersion(agentId_1, versionId_1) {
|
|
549
590
|
return __awaiter(this, arguments, void 0, function* (agentId, versionId, request = {}, requestOptions) {
|
|
550
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
591
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
551
592
|
const { version_tag: versionTag } = request;
|
|
552
593
|
const _queryParams = {};
|
|
553
594
|
if (versionTag != null) {
|
|
554
595
|
_queryParams.version_tag = versionTag;
|
|
555
596
|
}
|
|
556
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
597
|
+
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
598
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
599
|
+
"x-organization-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.organizationApiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.organizationApiKey,
|
|
600
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
557
601
|
const _response = yield core.fetcher({
|
|
558
|
-
url: core.url.join((
|
|
602
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : ((_e = (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.ApolloEnvironment.Gcp).base, `management/v1/agents/${core.url.encodePathParam(agentId)}/versions/${core.url.encodePathParam(versionId)}/pull`),
|
|
559
603
|
method: "GET",
|
|
560
604
|
headers: _headers,
|
|
561
605
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
562
|
-
timeoutMs: ((
|
|
563
|
-
maxRetries: (
|
|
606
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
607
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
564
608
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
565
|
-
fetchFn: (
|
|
609
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
566
610
|
logging: this._options.logging,
|
|
567
611
|
});
|
|
568
612
|
if (_response.ok) {
|
|
@@ -609,4 +653,13 @@ export class AgentVersions {
|
|
|
609
653
|
}
|
|
610
654
|
});
|
|
611
655
|
}
|
|
656
|
+
_getAuthorizationHeader() {
|
|
657
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
658
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
659
|
+
if (bearer != null) {
|
|
660
|
+
return `Bearer ${bearer}`;
|
|
661
|
+
}
|
|
662
|
+
return undefined;
|
|
663
|
+
});
|
|
664
|
+
}
|
|
612
665
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
export interface AgentVersionPushRequest {
|
|
11
11
|
caller: AgentVersionPushRequest.Caller;
|
|
12
12
|
commit_message?: string;
|
|
13
|
-
/** Versioned agent
|
|
13
|
+
/** Versioned agent configuration bundle. Must include 'schema_version' and 'general_settings'. */
|
|
14
14
|
bundle: Record<string, unknown>;
|
|
15
15
|
}
|
|
16
16
|
export declare namespace AgentVersionPushRequest {
|
|
@@ -9,8 +9,10 @@ export declare namespace Agents {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class Agents {
|
|
11
11
|
protected readonly _options: Agents.Options;
|
|
12
|
-
constructor(_options
|
|
12
|
+
constructor(_options: Agents.Options);
|
|
13
13
|
/**
|
|
14
|
+
* List the project's agents, optionally filtered by name.
|
|
15
|
+
*
|
|
14
16
|
* @param {string} projectId
|
|
15
17
|
* @param {Apollo.ListAgentsRequest} request
|
|
16
18
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -28,11 +30,14 @@ export declare class Agents {
|
|
|
28
30
|
* filters: {}
|
|
29
31
|
* })
|
|
30
32
|
*/
|
|
31
|
-
listAgents(projectId: string, request: Apollo.ListAgentsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.
|
|
33
|
+
listAgents(projectId: string, request: Apollo.ListAgentsRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.PageAgent>;
|
|
32
34
|
private __listAgents;
|
|
33
35
|
/**
|
|
36
|
+
* Create an agent in the project. New agents start without a live version
|
|
37
|
+
* — create and publish a version to make the agent answer.
|
|
38
|
+
*
|
|
34
39
|
* @param {string} projectId
|
|
35
|
-
* @param {Apollo.
|
|
40
|
+
* @param {Apollo.AgentCreateRequest} request
|
|
36
41
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
42
|
*
|
|
38
43
|
* @throws {@link Apollo.BadRequestError}
|
|
@@ -48,9 +53,11 @@ export declare class Agents {
|
|
|
48
53
|
* name: "name"
|
|
49
54
|
* })
|
|
50
55
|
*/
|
|
51
|
-
createAgent(projectId: string, request: Apollo.
|
|
56
|
+
createAgent(projectId: string, request: Apollo.AgentCreateRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.AgentCreateResponse>;
|
|
52
57
|
private __createAgent;
|
|
53
58
|
/**
|
|
59
|
+
* Fetch one agent, including which version is currently live.
|
|
60
|
+
*
|
|
54
61
|
* @param {string} agentId
|
|
55
62
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
63
|
*
|
|
@@ -65,9 +72,11 @@ export declare class Agents {
|
|
|
65
72
|
* @example
|
|
66
73
|
* await client.agents.getAgent("agentId")
|
|
67
74
|
*/
|
|
68
|
-
getAgent(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.
|
|
75
|
+
getAgent(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.Agent>;
|
|
69
76
|
private __getAgent;
|
|
70
77
|
/**
|
|
78
|
+
* Delete an agent and all of its versions. This cannot be undone.
|
|
79
|
+
*
|
|
71
80
|
* @param {string} agentId
|
|
72
81
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
82
|
*
|
|
@@ -85,8 +94,11 @@ export declare class Agents {
|
|
|
85
94
|
deleteAgent(agentId: string, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<void>;
|
|
86
95
|
private __deleteAgent;
|
|
87
96
|
/**
|
|
97
|
+
* Rename an agent. To change which version is live, publish a version
|
|
98
|
+
* instead.
|
|
99
|
+
*
|
|
88
100
|
* @param {string} agentId
|
|
89
|
-
* @param {Apollo.
|
|
101
|
+
* @param {Apollo.AgentUpdateRequest} request
|
|
90
102
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
103
|
*
|
|
92
104
|
* @throws {@link Apollo.BadRequestError}
|
|
@@ -100,9 +112,11 @@ export declare class Agents {
|
|
|
100
112
|
* @example
|
|
101
113
|
* await client.agents.updateAgent("agentId")
|
|
102
114
|
*/
|
|
103
|
-
updateAgent(agentId: string, request?: Apollo.
|
|
115
|
+
updateAgent(agentId: string, request?: Apollo.AgentUpdateRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.AgentUpdateResponse>;
|
|
104
116
|
private __updateAgent;
|
|
105
117
|
/**
|
|
118
|
+
* Usage metrics for one agent, optionally bounded by a date range.
|
|
119
|
+
*
|
|
106
120
|
* @param {string} agentId
|
|
107
121
|
* @param {Apollo.GetAgentUsageRequest} request
|
|
108
122
|
* @param {Agents.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -123,4 +137,5 @@ export declare class Agents {
|
|
|
123
137
|
*/
|
|
124
138
|
getAgentUsage(agentId: string, request?: Apollo.GetAgentUsageRequest, requestOptions?: Agents.RequestOptions): core.HttpResponsePromise<Apollo.UsageResponse>;
|
|
125
139
|
private __getAgentUsage;
|
|
140
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
126
141
|
}
|