@epam/ai-dial-chat-api-client 1.3.0-dev.35 → 1.3.0-dev.354
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/generated/src/apis/ApplicationsApi.d.ts +58 -3
- package/generated/src/apis/ApplicationsApi.d.ts.map +1 -1
- package/generated/src/apis/ApplicationsApi.js +156 -2
- package/generated/src/apis/AuthApi.d.ts +10 -0
- package/generated/src/apis/AuthApi.d.ts.map +1 -1
- package/generated/src/apis/AuthApi.js +24 -0
- package/generated/src/apis/CelebrationsApi.d.ts +60 -0
- package/generated/src/apis/CelebrationsApi.d.ts.map +1 -0
- package/generated/src/apis/CelebrationsApi.js +107 -0
- package/generated/src/apis/ConversationsApi.d.ts +34 -7
- package/generated/src/apis/ConversationsApi.d.ts.map +1 -1
- package/generated/src/apis/ConversationsApi.js +86 -6
- package/generated/src/apis/CustomApiApi.d.ts +49 -4
- package/generated/src/apis/CustomApiApi.d.ts.map +1 -1
- package/generated/src/apis/CustomApiApi.js +113 -4
- package/generated/src/apis/DeploymentsApi.d.ts +13 -0
- package/generated/src/apis/DeploymentsApi.d.ts.map +1 -1
- package/generated/src/apis/DeploymentsApi.js +35 -0
- package/generated/src/apis/ExternalServicesApi.d.ts +30 -1
- package/generated/src/apis/ExternalServicesApi.d.ts.map +1 -1
- package/generated/src/apis/ExternalServicesApi.js +82 -0
- package/generated/src/apis/FilesApi.d.ts +25 -0
- package/generated/src/apis/FilesApi.d.ts.map +1 -1
- package/generated/src/apis/FilesApi.js +62 -1
- package/generated/src/apis/OfflineCredentialsApi.d.ts +10 -0
- package/generated/src/apis/OfflineCredentialsApi.d.ts.map +1 -1
- package/generated/src/apis/OfflineCredentialsApi.js +31 -0
- package/generated/src/apis/ProjectsApi.d.ts +309 -0
- package/generated/src/apis/ProjectsApi.d.ts.map +1 -0
- package/generated/src/apis/ProjectsApi.js +906 -0
- package/generated/src/apis/PublishApi.d.ts +30 -1
- package/generated/src/apis/PublishApi.d.ts.map +1 -1
- package/generated/src/apis/PublishApi.js +54 -1
- package/generated/src/apis/ShareApi.d.ts +13 -0
- package/generated/src/apis/ShareApi.d.ts.map +1 -1
- package/generated/src/apis/ShareApi.js +34 -0
- package/generated/src/apis/SkillsApi.d.ts +14 -1
- package/generated/src/apis/SkillsApi.d.ts.map +1 -1
- package/generated/src/apis/SkillsApi.js +36 -0
- package/generated/src/apis/ToolsetsApi.d.ts +29 -2
- package/generated/src/apis/ToolsetsApi.d.ts.map +1 -1
- package/generated/src/apis/ToolsetsApi.js +77 -3
- package/generated/src/apis/index.d.ts +2 -0
- package/generated/src/apis/index.d.ts.map +1 -1
- package/generated/src/apis/index.js +2 -0
- package/generated/src/models/index.d.ts +4583 -2622
- package/generated/src/models/index.d.ts.map +1 -1
- package/generated/src/models/index.js +225 -3
- package/package.json +2 -2
- package/tsconfig.lib.tsbuildinfo +1 -1
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Chat API
|
|
6
|
+
* REST API for the chat application. Provides endpoints for theme configuration, authentication, and management. All endpoints return appropriate HTTP status codes (200, 400, 401, 403, 404, 502, 503) with descriptive error messages.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.ProjectsApi = void 0;
|
|
17
|
+
const runtime = require("../runtime");
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
class ProjectsApi extends runtime.BaseAPI {
|
|
22
|
+
/**
|
|
23
|
+
* Replays the active generation of a project conversation as SSE, exactly as `POST /api/v1/conversations/completions/attach` does.
|
|
24
|
+
* Attach to a generation of a project conversation
|
|
25
|
+
*/
|
|
26
|
+
async attachToProjectGenerationRaw(requestParameters, initOverrides) {
|
|
27
|
+
if (requestParameters['id'] == null) {
|
|
28
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling attachToProjectGeneration().');
|
|
29
|
+
}
|
|
30
|
+
if (requestParameters['attachGenerationDto'] == null) {
|
|
31
|
+
throw new runtime.RequiredError('attachGenerationDto', 'Required parameter "attachGenerationDto" was null or undefined when calling attachToProjectGeneration().');
|
|
32
|
+
}
|
|
33
|
+
const queryParameters = {};
|
|
34
|
+
const headerParameters = {};
|
|
35
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
36
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
37
|
+
const token = this.configuration.accessToken;
|
|
38
|
+
const tokenString = await token('bearer', []);
|
|
39
|
+
if (tokenString) {
|
|
40
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions/attach`;
|
|
44
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
45
|
+
const response = await this.request({
|
|
46
|
+
path: urlPath,
|
|
47
|
+
method: 'POST',
|
|
48
|
+
headers: headerParameters,
|
|
49
|
+
query: queryParameters,
|
|
50
|
+
body: requestParameters['attachGenerationDto'],
|
|
51
|
+
}, initOverrides);
|
|
52
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
53
|
+
return new runtime.JSONApiResponse(response);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
return new runtime.TextApiResponse(response);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Replays the active generation of a project conversation as SSE, exactly as `POST /api/v1/conversations/completions/attach` does.
|
|
61
|
+
* Attach to a generation of a project conversation
|
|
62
|
+
*/
|
|
63
|
+
async attachToProjectGeneration(requestParameters, initOverrides) {
|
|
64
|
+
const response = await this.attachToProjectGenerationRaw(requestParameters, initOverrides);
|
|
65
|
+
return await response.value();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates a project at the root of the session user\'s bucket in one atomic, create-only DIAL Core call. The BFF writes PROJECT.md (YAML frontmatter with name and description, instructions as the body) and each context file under context/. Name, file names, types, per-file size, total size and file count are validated first; every domain rejection carries a ProjectCreateErrorCode.
|
|
69
|
+
* Create a project
|
|
70
|
+
*/
|
|
71
|
+
async createProjectRaw(requestParameters, initOverrides) {
|
|
72
|
+
if (requestParameters['name'] == null) {
|
|
73
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling createProject().');
|
|
74
|
+
}
|
|
75
|
+
const queryParameters = {};
|
|
76
|
+
const headerParameters = {};
|
|
77
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
78
|
+
const token = this.configuration.accessToken;
|
|
79
|
+
const tokenString = await token('bearer', []);
|
|
80
|
+
if (tokenString) {
|
|
81
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const consumes = [
|
|
85
|
+
{ contentType: 'multipart/form-data' },
|
|
86
|
+
];
|
|
87
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
88
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
89
|
+
let formParams;
|
|
90
|
+
let useForm = false;
|
|
91
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
92
|
+
useForm = canConsumeForm;
|
|
93
|
+
if (useForm) {
|
|
94
|
+
formParams = new FormData();
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
formParams = new URLSearchParams();
|
|
98
|
+
}
|
|
99
|
+
if (requestParameters['name'] != null) {
|
|
100
|
+
formParams.append('name', requestParameters['name']);
|
|
101
|
+
}
|
|
102
|
+
if (requestParameters['description'] != null) {
|
|
103
|
+
formParams.append('description', requestParameters['description']);
|
|
104
|
+
}
|
|
105
|
+
if (requestParameters['instructions'] != null) {
|
|
106
|
+
formParams.append('instructions', requestParameters['instructions']);
|
|
107
|
+
}
|
|
108
|
+
if (requestParameters['fileNames'] != null) {
|
|
109
|
+
formParams.append('fileNames', requestParameters['fileNames']);
|
|
110
|
+
}
|
|
111
|
+
if (requestParameters['files'] != null) {
|
|
112
|
+
requestParameters['files'].forEach((element) => {
|
|
113
|
+
formParams.append('files', element);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
let urlPath = `/api/v1/projects`;
|
|
117
|
+
const response = await this.request({
|
|
118
|
+
path: urlPath,
|
|
119
|
+
method: 'POST',
|
|
120
|
+
headers: headerParameters,
|
|
121
|
+
query: queryParameters,
|
|
122
|
+
body: formParams,
|
|
123
|
+
}, initOverrides);
|
|
124
|
+
return new runtime.JSONApiResponse(response);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Creates a project at the root of the session user\'s bucket in one atomic, create-only DIAL Core call. The BFF writes PROJECT.md (YAML frontmatter with name and description, instructions as the body) and each context file under context/. Name, file names, types, per-file size, total size and file count are validated first; every domain rejection carries a ProjectCreateErrorCode.
|
|
128
|
+
* Create a project
|
|
129
|
+
*/
|
|
130
|
+
async createProject(requestParameters, initOverrides) {
|
|
131
|
+
const response = await this.createProjectRaw(requestParameters, initOverrides);
|
|
132
|
+
return await response.value();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Creates a conversation inside the project from its first message, as `POST /api/v1/conversations` does at the top level.
|
|
136
|
+
* Create a project conversation
|
|
137
|
+
*/
|
|
138
|
+
async createProjectConversationRaw(requestParameters, initOverrides) {
|
|
139
|
+
if (requestParameters['id'] == null) {
|
|
140
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling createProjectConversation().');
|
|
141
|
+
}
|
|
142
|
+
if (requestParameters['createConversationDto'] == null) {
|
|
143
|
+
throw new runtime.RequiredError('createConversationDto', 'Required parameter "createConversationDto" was null or undefined when calling createProjectConversation().');
|
|
144
|
+
}
|
|
145
|
+
const queryParameters = {};
|
|
146
|
+
const headerParameters = {};
|
|
147
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
const token = this.configuration.accessToken;
|
|
150
|
+
const tokenString = await token('bearer', []);
|
|
151
|
+
if (tokenString) {
|
|
152
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
let urlPath = `/api/v1/projects/{id}/conversations`;
|
|
156
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
157
|
+
const response = await this.request({
|
|
158
|
+
path: urlPath,
|
|
159
|
+
method: 'POST',
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters,
|
|
162
|
+
body: requestParameters['createConversationDto'],
|
|
163
|
+
}, initOverrides);
|
|
164
|
+
return new runtime.JSONApiResponse(response);
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Creates a conversation inside the project from its first message, as `POST /api/v1/conversations` does at the top level.
|
|
168
|
+
* Create a project conversation
|
|
169
|
+
*/
|
|
170
|
+
async createProjectConversation(requestParameters, initOverrides) {
|
|
171
|
+
const response = await this.createProjectConversationRaw(requestParameters, initOverrides);
|
|
172
|
+
return await response.value();
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Deletes the project, its conversations included, only if its content is still the `contentVersion` named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
|
|
176
|
+
* Delete a project
|
|
177
|
+
*/
|
|
178
|
+
async deleteProjectRaw(requestParameters, initOverrides) {
|
|
179
|
+
if (requestParameters['id'] == null) {
|
|
180
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteProject().');
|
|
181
|
+
}
|
|
182
|
+
if (requestParameters['ifMatch'] == null) {
|
|
183
|
+
throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling deleteProject().');
|
|
184
|
+
}
|
|
185
|
+
const queryParameters = {};
|
|
186
|
+
const headerParameters = {};
|
|
187
|
+
if (requestParameters['ifMatch'] != null) {
|
|
188
|
+
headerParameters['If-Match'] = String(requestParameters['ifMatch']);
|
|
189
|
+
}
|
|
190
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
191
|
+
const token = this.configuration.accessToken;
|
|
192
|
+
const tokenString = await token('bearer', []);
|
|
193
|
+
if (tokenString) {
|
|
194
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
let urlPath = `/api/v1/projects/{id}`;
|
|
198
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
199
|
+
const response = await this.request({
|
|
200
|
+
path: urlPath,
|
|
201
|
+
method: 'DELETE',
|
|
202
|
+
headers: headerParameters,
|
|
203
|
+
query: queryParameters,
|
|
204
|
+
}, initOverrides);
|
|
205
|
+
return new runtime.VoidApiResponse(response);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Deletes the project, its conversations included, only if its content is still the `contentVersion` named by `If-Match`, then removes it from the caller\'s pins. Only a project in the caller\'s own bucket can be deleted.
|
|
209
|
+
* Delete a project
|
|
210
|
+
*/
|
|
211
|
+
async deleteProject(requestParameters, initOverrides) {
|
|
212
|
+
await this.deleteProjectRaw(requestParameters, initOverrides);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Delete a project conversation
|
|
216
|
+
*/
|
|
217
|
+
async deleteProjectConversationRaw(requestParameters, initOverrides) {
|
|
218
|
+
if (requestParameters['id'] == null) {
|
|
219
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteProjectConversation().');
|
|
220
|
+
}
|
|
221
|
+
if (requestParameters['conversationName'] == null) {
|
|
222
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling deleteProjectConversation().');
|
|
223
|
+
}
|
|
224
|
+
const queryParameters = {};
|
|
225
|
+
const headerParameters = {};
|
|
226
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
227
|
+
const token = this.configuration.accessToken;
|
|
228
|
+
const tokenString = await token('bearer', []);
|
|
229
|
+
if (tokenString) {
|
|
230
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
234
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
235
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
236
|
+
const response = await this.request({
|
|
237
|
+
path: urlPath,
|
|
238
|
+
method: 'DELETE',
|
|
239
|
+
headers: headerParameters,
|
|
240
|
+
query: queryParameters,
|
|
241
|
+
}, initOverrides);
|
|
242
|
+
return new runtime.VoidApiResponse(response);
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Delete a project conversation
|
|
246
|
+
*/
|
|
247
|
+
async deleteProjectConversation(requestParameters, initOverrides) {
|
|
248
|
+
await this.deleteProjectConversationRaw(requestParameters, initOverrides);
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
|
|
252
|
+
* Download a project as a ZIP archive
|
|
253
|
+
*/
|
|
254
|
+
async downloadProjectRaw(requestParameters, initOverrides) {
|
|
255
|
+
if (requestParameters['id'] == null) {
|
|
256
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadProject().');
|
|
257
|
+
}
|
|
258
|
+
const queryParameters = {};
|
|
259
|
+
const headerParameters = {};
|
|
260
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
261
|
+
const token = this.configuration.accessToken;
|
|
262
|
+
const tokenString = await token('bearer', []);
|
|
263
|
+
if (tokenString) {
|
|
264
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
let urlPath = `/api/v1/projects/{id}/archive`;
|
|
268
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
269
|
+
const response = await this.request({
|
|
270
|
+
path: urlPath,
|
|
271
|
+
method: 'GET',
|
|
272
|
+
headers: headerParameters,
|
|
273
|
+
query: queryParameters,
|
|
274
|
+
}, initOverrides);
|
|
275
|
+
return new runtime.BlobApiResponse(response);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Streams DIAL Core\'s archive of the whole project (`PROJECT.md` and `context/`) as an attachment.
|
|
279
|
+
* Download a project as a ZIP archive
|
|
280
|
+
*/
|
|
281
|
+
async downloadProject(requestParameters, initOverrides) {
|
|
282
|
+
const response = await this.downloadProjectRaw(requestParameters, initOverrides);
|
|
283
|
+
return await response.value();
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Streams one file directly under the project `artifacts/` folder as an attachment with `X-Content-Type-Options: nosniff`. Any reader of the project may call it.
|
|
287
|
+
* Download one output of a project
|
|
288
|
+
*/
|
|
289
|
+
async downloadProjectArtifactRaw(requestParameters, initOverrides) {
|
|
290
|
+
if (requestParameters['id'] == null) {
|
|
291
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadProjectArtifact().');
|
|
292
|
+
}
|
|
293
|
+
if (requestParameters['fileName'] == null) {
|
|
294
|
+
throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling downloadProjectArtifact().');
|
|
295
|
+
}
|
|
296
|
+
const queryParameters = {};
|
|
297
|
+
const headerParameters = {};
|
|
298
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
299
|
+
const token = this.configuration.accessToken;
|
|
300
|
+
const tokenString = await token('bearer', []);
|
|
301
|
+
if (tokenString) {
|
|
302
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
let urlPath = `/api/v1/projects/{id}/artifacts/{fileName}`;
|
|
306
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
307
|
+
urlPath = urlPath.replace(`{${'fileName'}}`, encodeURIComponent(String(requestParameters['fileName'])));
|
|
308
|
+
const response = await this.request({
|
|
309
|
+
path: urlPath,
|
|
310
|
+
method: 'GET',
|
|
311
|
+
headers: headerParameters,
|
|
312
|
+
query: queryParameters,
|
|
313
|
+
}, initOverrides);
|
|
314
|
+
return new runtime.BlobApiResponse(response);
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Streams one file directly under the project `artifacts/` folder as an attachment with `X-Content-Type-Options: nosniff`. Any reader of the project may call it.
|
|
318
|
+
* Download one output of a project
|
|
319
|
+
*/
|
|
320
|
+
async downloadProjectArtifact(requestParameters, initOverrides) {
|
|
321
|
+
const response = await this.downloadProjectArtifactRaw(requestParameters, initOverrides);
|
|
322
|
+
return await response.value();
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
|
|
326
|
+
* Download one context file of a project
|
|
327
|
+
*/
|
|
328
|
+
async downloadProjectFileRaw(requestParameters, initOverrides) {
|
|
329
|
+
if (requestParameters['id'] == null) {
|
|
330
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling downloadProjectFile().');
|
|
331
|
+
}
|
|
332
|
+
if (requestParameters['fileName'] == null) {
|
|
333
|
+
throw new runtime.RequiredError('fileName', 'Required parameter "fileName" was null or undefined when calling downloadProjectFile().');
|
|
334
|
+
}
|
|
335
|
+
const queryParameters = {};
|
|
336
|
+
const headerParameters = {};
|
|
337
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
338
|
+
const token = this.configuration.accessToken;
|
|
339
|
+
const tokenString = await token('bearer', []);
|
|
340
|
+
if (tokenString) {
|
|
341
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
let urlPath = `/api/v1/projects/{id}/files/{fileName}`;
|
|
345
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
346
|
+
urlPath = urlPath.replace(`{${'fileName'}}`, encodeURIComponent(String(requestParameters['fileName'])));
|
|
347
|
+
const response = await this.request({
|
|
348
|
+
path: urlPath,
|
|
349
|
+
method: 'GET',
|
|
350
|
+
headers: headerParameters,
|
|
351
|
+
query: queryParameters,
|
|
352
|
+
}, initOverrides);
|
|
353
|
+
return new runtime.BlobApiResponse(response);
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Streams one file directly under the project `context/` folder as an attachment with `X-Content-Type-Options: nosniff`.
|
|
357
|
+
* Download one context file of a project
|
|
358
|
+
*/
|
|
359
|
+
async downloadProjectFile(requestParameters, initOverrides) {
|
|
360
|
+
const response = await this.downloadProjectFileRaw(requestParameters, initOverrides);
|
|
361
|
+
return await response.value();
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes. `canEdit` is true for the owner and for a recipient the project is shared with with WRITE; `canManage` (rename, delete, share, publish) is true only for a project in the caller\'s own bucket.
|
|
365
|
+
* Get a project
|
|
366
|
+
*/
|
|
367
|
+
async getProjectRaw(requestParameters, initOverrides) {
|
|
368
|
+
if (requestParameters['id'] == null) {
|
|
369
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getProject().');
|
|
370
|
+
}
|
|
371
|
+
const queryParameters = {};
|
|
372
|
+
const headerParameters = {};
|
|
373
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
374
|
+
const token = this.configuration.accessToken;
|
|
375
|
+
const tokenString = await token('bearer', []);
|
|
376
|
+
if (tokenString) {
|
|
377
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
let urlPath = `/api/v1/projects/{id}`;
|
|
381
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
382
|
+
const response = await this.request({
|
|
383
|
+
path: urlPath,
|
|
384
|
+
method: 'GET',
|
|
385
|
+
headers: headerParameters,
|
|
386
|
+
query: queryParameters,
|
|
387
|
+
}, initOverrides);
|
|
388
|
+
return new runtime.JSONApiResponse(response);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Returns one project\'s name, description, instructions, context files with their sizes, and the ETag of the version they were read from. The BFF reads the project archive from DIAL Core, because project metadata carries no file sizes. `canEdit` is true for the owner and for a recipient the project is shared with with WRITE; `canManage` (rename, delete, share, publish) is true only for a project in the caller\'s own bucket.
|
|
392
|
+
* Get a project
|
|
393
|
+
*/
|
|
394
|
+
async getProject(requestParameters, initOverrides) {
|
|
395
|
+
const response = await this.getProjectRaw(requestParameters, initOverrides);
|
|
396
|
+
return await response.value();
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Get a project conversation
|
|
400
|
+
*/
|
|
401
|
+
async getProjectConversationRaw(requestParameters, initOverrides) {
|
|
402
|
+
if (requestParameters['id'] == null) {
|
|
403
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getProjectConversation().');
|
|
404
|
+
}
|
|
405
|
+
if (requestParameters['conversationName'] == null) {
|
|
406
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling getProjectConversation().');
|
|
407
|
+
}
|
|
408
|
+
const queryParameters = {};
|
|
409
|
+
const headerParameters = {};
|
|
410
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
411
|
+
const token = this.configuration.accessToken;
|
|
412
|
+
const tokenString = await token('bearer', []);
|
|
413
|
+
if (tokenString) {
|
|
414
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
418
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
419
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
420
|
+
const response = await this.request({
|
|
421
|
+
path: urlPath,
|
|
422
|
+
method: 'GET',
|
|
423
|
+
headers: headerParameters,
|
|
424
|
+
query: queryParameters,
|
|
425
|
+
}, initOverrides);
|
|
426
|
+
return new runtime.JSONApiResponse(response);
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Get a project conversation
|
|
430
|
+
*/
|
|
431
|
+
async getProjectConversation(requestParameters, initOverrides) {
|
|
432
|
+
const response = await this.getProjectConversationRaw(requestParameters, initOverrides);
|
|
433
|
+
return await response.value();
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Reads the bodies of the named conversations, as listed with `isTitlePending`, and returns them with their titles and read state resolved. Up to 100 names per request. Any reader of the project may call it.
|
|
437
|
+
* Resolve project conversations\' titles
|
|
438
|
+
*/
|
|
439
|
+
async getProjectConversationTitlesRaw(requestParameters, initOverrides) {
|
|
440
|
+
if (requestParameters['id'] == null) {
|
|
441
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getProjectConversationTitles().');
|
|
442
|
+
}
|
|
443
|
+
if (requestParameters['projectConversationTitlesBodyDto'] == null) {
|
|
444
|
+
throw new runtime.RequiredError('projectConversationTitlesBodyDto', 'Required parameter "projectConversationTitlesBodyDto" was null or undefined when calling getProjectConversationTitles().');
|
|
445
|
+
}
|
|
446
|
+
const queryParameters = {};
|
|
447
|
+
const headerParameters = {};
|
|
448
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
449
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
450
|
+
const token = this.configuration.accessToken;
|
|
451
|
+
const tokenString = await token('bearer', []);
|
|
452
|
+
if (tokenString) {
|
|
453
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
let urlPath = `/api/v1/projects/{id}/conversations/titles`;
|
|
457
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
458
|
+
const response = await this.request({
|
|
459
|
+
path: urlPath,
|
|
460
|
+
method: 'POST',
|
|
461
|
+
headers: headerParameters,
|
|
462
|
+
query: queryParameters,
|
|
463
|
+
body: requestParameters['projectConversationTitlesBodyDto'],
|
|
464
|
+
}, initOverrides);
|
|
465
|
+
return new runtime.JSONApiResponse(response);
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Reads the bodies of the named conversations, as listed with `isTitlePending`, and returns them with their titles and read state resolved. Up to 100 names per request. Any reader of the project may call it.
|
|
469
|
+
* Resolve project conversations\' titles
|
|
470
|
+
*/
|
|
471
|
+
async getProjectConversationTitles(requestParameters, initOverrides) {
|
|
472
|
+
const response = await this.getProjectConversationTitlesRaw(requestParameters, initOverrides);
|
|
473
|
+
return await response.value();
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Lists the files directly under the project `artifacts/` folder, where the agents of the project\'s chats save their outputs, newest first. Nested paths are not listed. Any reader of the project may call it.
|
|
477
|
+
* List a project\'s outputs
|
|
478
|
+
*/
|
|
479
|
+
async listProjectArtifactsRaw(requestParameters, initOverrides) {
|
|
480
|
+
if (requestParameters['id'] == null) {
|
|
481
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling listProjectArtifacts().');
|
|
482
|
+
}
|
|
483
|
+
const queryParameters = {};
|
|
484
|
+
const headerParameters = {};
|
|
485
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
486
|
+
const token = this.configuration.accessToken;
|
|
487
|
+
const tokenString = await token('bearer', []);
|
|
488
|
+
if (tokenString) {
|
|
489
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
let urlPath = `/api/v1/projects/{id}/artifacts`;
|
|
493
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
494
|
+
const response = await this.request({
|
|
495
|
+
path: urlPath,
|
|
496
|
+
method: 'GET',
|
|
497
|
+
headers: headerParameters,
|
|
498
|
+
query: queryParameters,
|
|
499
|
+
}, initOverrides);
|
|
500
|
+
return new runtime.JSONApiResponse(response);
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Lists the files directly under the project `artifacts/` folder, where the agents of the project\'s chats save their outputs, newest first. Nested paths are not listed. Any reader of the project may call it.
|
|
504
|
+
* List a project\'s outputs
|
|
505
|
+
*/
|
|
506
|
+
async listProjectArtifacts(requestParameters, initOverrides) {
|
|
507
|
+
const response = await this.listProjectArtifactsRaw(requestParameters, initOverrides);
|
|
508
|
+
return await response.value();
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Lists every conversation stored in the project\'s `conversations/` folder, newest first, with their authors. DIAL Core cannot page the folder in this order, so the list is not paged; the client pages it locally. Bodies are read for the 20 newest conversations only: the others have a cached title or carry `isTitlePending`, which `POST /api/v1/projects/:id/conversations/titles` resolves.
|
|
512
|
+
* List a project\'s conversations
|
|
513
|
+
*/
|
|
514
|
+
async listProjectConversationsRaw(requestParameters, initOverrides) {
|
|
515
|
+
if (requestParameters['id'] == null) {
|
|
516
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling listProjectConversations().');
|
|
517
|
+
}
|
|
518
|
+
const queryParameters = {};
|
|
519
|
+
const headerParameters = {};
|
|
520
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
521
|
+
const token = this.configuration.accessToken;
|
|
522
|
+
const tokenString = await token('bearer', []);
|
|
523
|
+
if (tokenString) {
|
|
524
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
let urlPath = `/api/v1/projects/{id}/conversations`;
|
|
528
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
529
|
+
const response = await this.request({
|
|
530
|
+
path: urlPath,
|
|
531
|
+
method: 'GET',
|
|
532
|
+
headers: headerParameters,
|
|
533
|
+
query: queryParameters,
|
|
534
|
+
}, initOverrides);
|
|
535
|
+
return new runtime.JSONApiResponse(response);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Lists every conversation stored in the project\'s `conversations/` folder, newest first, with their authors. DIAL Core cannot page the folder in this order, so the list is not paged; the client pages it locally. Bodies are read for the 20 newest conversations only: the others have a cached title or carry `isTitlePending`, which `POST /api/v1/projects/:id/conversations/titles` resolves.
|
|
539
|
+
* List a project\'s conversations
|
|
540
|
+
*/
|
|
541
|
+
async listProjectConversations(requestParameters, initOverrides) {
|
|
542
|
+
const response = await this.listProjectConversationsRaw(requestParameters, initOverrides);
|
|
543
|
+
return await response.value();
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Returns every DIAL project visible to the session user: the user\'s own bucket, the public (organization) bucket, and projects shared with the user, merged and de-duplicated by id. The BFF follows DIAL Core paging itself, so the list is complete up to a per-source page cap. A failing source is omitted; the request fails only when both bucket listings fail.
|
|
547
|
+
* List projects
|
|
548
|
+
*/
|
|
549
|
+
async listProjectsRaw(initOverrides) {
|
|
550
|
+
const queryParameters = {};
|
|
551
|
+
const headerParameters = {};
|
|
552
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
553
|
+
const token = this.configuration.accessToken;
|
|
554
|
+
const tokenString = await token('bearer', []);
|
|
555
|
+
if (tokenString) {
|
|
556
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
let urlPath = `/api/v1/projects`;
|
|
560
|
+
const response = await this.request({
|
|
561
|
+
path: urlPath,
|
|
562
|
+
method: 'GET',
|
|
563
|
+
headers: headerParameters,
|
|
564
|
+
query: queryParameters,
|
|
565
|
+
}, initOverrides);
|
|
566
|
+
return new runtime.JSONApiResponse(response);
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Returns every DIAL project visible to the session user: the user\'s own bucket, the public (organization) bucket, and projects shared with the user, merged and de-duplicated by id. The BFF follows DIAL Core paging itself, so the list is complete up to a per-source page cap. A failing source is omitted; the request fails only when both bucket listings fail.
|
|
570
|
+
* List projects
|
|
571
|
+
*/
|
|
572
|
+
async listProjects(initOverrides) {
|
|
573
|
+
const response = await this.listProjectsRaw(initOverrides);
|
|
574
|
+
return await response.value();
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Records the conversation\'s current version as seen by the caller, in the caller\'s own read state, so it is not reported unread until it changes. Any reader of the project may call it.
|
|
578
|
+
* Mark a project conversation as viewed
|
|
579
|
+
*/
|
|
580
|
+
async markProjectConversationViewedRaw(requestParameters, initOverrides) {
|
|
581
|
+
if (requestParameters['id'] == null) {
|
|
582
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling markProjectConversationViewed().');
|
|
583
|
+
}
|
|
584
|
+
if (requestParameters['conversationName'] == null) {
|
|
585
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling markProjectConversationViewed().');
|
|
586
|
+
}
|
|
587
|
+
const queryParameters = {};
|
|
588
|
+
const headerParameters = {};
|
|
589
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
590
|
+
const token = this.configuration.accessToken;
|
|
591
|
+
const tokenString = await token('bearer', []);
|
|
592
|
+
if (tokenString) {
|
|
593
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}/viewed`;
|
|
597
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
598
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
599
|
+
const response = await this.request({
|
|
600
|
+
path: urlPath,
|
|
601
|
+
method: 'PATCH',
|
|
602
|
+
headers: headerParameters,
|
|
603
|
+
query: queryParameters,
|
|
604
|
+
}, initOverrides);
|
|
605
|
+
return new runtime.VoidApiResponse(response);
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* Records the conversation\'s current version as seen by the caller, in the caller\'s own read state, so it is not reported unread until it changes. Any reader of the project may call it.
|
|
609
|
+
* Mark a project conversation as viewed
|
|
610
|
+
*/
|
|
611
|
+
async markProjectConversationViewed(requestParameters, initOverrides) {
|
|
612
|
+
await this.markProjectConversationViewedRaw(requestParameters, initOverrides);
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Rewrites the conversation\'s display name; its file name does not change.
|
|
616
|
+
* Rename a project conversation
|
|
617
|
+
*/
|
|
618
|
+
async renameProjectConversationRaw(requestParameters, initOverrides) {
|
|
619
|
+
if (requestParameters['id'] == null) {
|
|
620
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling renameProjectConversation().');
|
|
621
|
+
}
|
|
622
|
+
if (requestParameters['conversationName'] == null) {
|
|
623
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling renameProjectConversation().');
|
|
624
|
+
}
|
|
625
|
+
if (requestParameters['renameConversationBodyDto'] == null) {
|
|
626
|
+
throw new runtime.RequiredError('renameConversationBodyDto', 'Required parameter "renameConversationBodyDto" was null or undefined when calling renameProjectConversation().');
|
|
627
|
+
}
|
|
628
|
+
const queryParameters = {};
|
|
629
|
+
const headerParameters = {};
|
|
630
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
631
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
632
|
+
const token = this.configuration.accessToken;
|
|
633
|
+
const tokenString = await token('bearer', []);
|
|
634
|
+
if (tokenString) {
|
|
635
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
639
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
640
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
641
|
+
const response = await this.request({
|
|
642
|
+
path: urlPath,
|
|
643
|
+
method: 'PATCH',
|
|
644
|
+
headers: headerParameters,
|
|
645
|
+
query: queryParameters,
|
|
646
|
+
body: requestParameters['renameConversationBodyDto'],
|
|
647
|
+
}, initOverrides);
|
|
648
|
+
return new runtime.JSONApiResponse(response);
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Rewrites the conversation\'s display name; its file name does not change.
|
|
652
|
+
* Rename a project conversation
|
|
653
|
+
*/
|
|
654
|
+
async renameProjectConversation(requestParameters, initOverrides) {
|
|
655
|
+
const response = await this.renameProjectConversationRaw(requestParameters, initOverrides);
|
|
656
|
+
return await response.value();
|
|
657
|
+
}
|
|
658
|
+
/**
|
|
659
|
+
* Overwrites the conversation body, never over a pending background answer, as `PUT /api/v1/conversations` does.
|
|
660
|
+
* Save a project conversation
|
|
661
|
+
*/
|
|
662
|
+
async saveProjectConversationRaw(requestParameters, initOverrides) {
|
|
663
|
+
if (requestParameters['id'] == null) {
|
|
664
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling saveProjectConversation().');
|
|
665
|
+
}
|
|
666
|
+
if (requestParameters['conversationName'] == null) {
|
|
667
|
+
throw new runtime.RequiredError('conversationName', 'Required parameter "conversationName" was null or undefined when calling saveProjectConversation().');
|
|
668
|
+
}
|
|
669
|
+
if (requestParameters['saveConversationBodyDto'] == null) {
|
|
670
|
+
throw new runtime.RequiredError('saveConversationBodyDto', 'Required parameter "saveConversationBodyDto" was null or undefined when calling saveProjectConversation().');
|
|
671
|
+
}
|
|
672
|
+
const queryParameters = {};
|
|
673
|
+
const headerParameters = {};
|
|
674
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
675
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
676
|
+
const token = this.configuration.accessToken;
|
|
677
|
+
const tokenString = await token('bearer', []);
|
|
678
|
+
if (tokenString) {
|
|
679
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
let urlPath = `/api/v1/projects/{id}/conversations/{conversationName}`;
|
|
683
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
684
|
+
urlPath = urlPath.replace(`{${'conversationName'}}`, encodeURIComponent(String(requestParameters['conversationName'])));
|
|
685
|
+
const response = await this.request({
|
|
686
|
+
path: urlPath,
|
|
687
|
+
method: 'PUT',
|
|
688
|
+
headers: headerParameters,
|
|
689
|
+
query: queryParameters,
|
|
690
|
+
body: requestParameters['saveConversationBodyDto'],
|
|
691
|
+
}, initOverrides);
|
|
692
|
+
return new runtime.JSONApiResponse(response);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Overwrites the conversation body, never over a pending background answer, as `PUT /api/v1/conversations` does.
|
|
696
|
+
* Save a project conversation
|
|
697
|
+
*/
|
|
698
|
+
async saveProjectConversation(requestParameters, initOverrides) {
|
|
699
|
+
const response = await this.saveProjectConversationRaw(requestParameters, initOverrides);
|
|
700
|
+
return await response.value();
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Stop a generation of a project conversation
|
|
704
|
+
*/
|
|
705
|
+
async stopProjectCompletionRaw(requestParameters, initOverrides) {
|
|
706
|
+
if (requestParameters['id'] == null) {
|
|
707
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling stopProjectCompletion().');
|
|
708
|
+
}
|
|
709
|
+
if (requestParameters['stopCompletionDto'] == null) {
|
|
710
|
+
throw new runtime.RequiredError('stopCompletionDto', 'Required parameter "stopCompletionDto" was null or undefined when calling stopProjectCompletion().');
|
|
711
|
+
}
|
|
712
|
+
const queryParameters = {};
|
|
713
|
+
const headerParameters = {};
|
|
714
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
715
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
716
|
+
const token = this.configuration.accessToken;
|
|
717
|
+
const tokenString = await token('bearer', []);
|
|
718
|
+
if (tokenString) {
|
|
719
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions/stop`;
|
|
723
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
724
|
+
const response = await this.request({
|
|
725
|
+
path: urlPath,
|
|
726
|
+
method: 'POST',
|
|
727
|
+
headers: headerParameters,
|
|
728
|
+
query: queryParameters,
|
|
729
|
+
body: requestParameters['stopCompletionDto'],
|
|
730
|
+
}, initOverrides);
|
|
731
|
+
return new runtime.VoidApiResponse(response);
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* Stop a generation of a project conversation
|
|
735
|
+
*/
|
|
736
|
+
async stopProjectCompletion(requestParameters, initOverrides) {
|
|
737
|
+
await this.stopProjectCompletionRaw(requestParameters, initOverrides);
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Streams a completion as SSE exactly as `POST /api/v1/conversations/completions` does, with the `x-project-id` header on the model call and nothing else added to the request.
|
|
741
|
+
* Stream a completion of a project conversation
|
|
742
|
+
*/
|
|
743
|
+
async streamProjectCompletionRaw(requestParameters, initOverrides) {
|
|
744
|
+
if (requestParameters['id'] == null) {
|
|
745
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling streamProjectCompletion().');
|
|
746
|
+
}
|
|
747
|
+
if (requestParameters['sendCompletionDto'] == null) {
|
|
748
|
+
throw new runtime.RequiredError('sendCompletionDto', 'Required parameter "sendCompletionDto" was null or undefined when calling streamProjectCompletion().');
|
|
749
|
+
}
|
|
750
|
+
const queryParameters = {};
|
|
751
|
+
const headerParameters = {};
|
|
752
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
753
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
754
|
+
const token = this.configuration.accessToken;
|
|
755
|
+
const tokenString = await token('bearer', []);
|
|
756
|
+
if (tokenString) {
|
|
757
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
let urlPath = `/api/v1/projects/{id}/conversations/completions`;
|
|
761
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
762
|
+
const response = await this.request({
|
|
763
|
+
path: urlPath,
|
|
764
|
+
method: 'POST',
|
|
765
|
+
headers: headerParameters,
|
|
766
|
+
query: queryParameters,
|
|
767
|
+
body: requestParameters['sendCompletionDto'],
|
|
768
|
+
}, initOverrides);
|
|
769
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
770
|
+
return new runtime.JSONApiResponse(response);
|
|
771
|
+
}
|
|
772
|
+
else {
|
|
773
|
+
return new runtime.TextApiResponse(response);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
/**
|
|
777
|
+
* Streams a completion as SSE exactly as `POST /api/v1/conversations/completions` does, with the `x-project-id` header on the model call and nothing else added to the request.
|
|
778
|
+
* Stream a completion of a project conversation
|
|
779
|
+
*/
|
|
780
|
+
async streamProjectCompletion(requestParameters, initOverrides) {
|
|
781
|
+
const response = await this.streamProjectCompletionRaw(requestParameters, initOverrides);
|
|
782
|
+
return await response.value();
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts, carries the stored conversations over, and writes the whole project conditioned on the fresh snapshot\'s ETag, retrying a concurrent conversation write while `If-Match` still names the `contentVersion`. A different name then moves the project in its folder and keeps the caller\'s pin. The owner and a recipient the project is shared with with WRITE may save; only the owner may rename. Every domain rejection carries a ProjectCreateErrorCode.
|
|
786
|
+
* Save a project edit
|
|
787
|
+
*/
|
|
788
|
+
async updateProjectRaw(requestParameters, initOverrides) {
|
|
789
|
+
if (requestParameters['id'] == null) {
|
|
790
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateProject().');
|
|
791
|
+
}
|
|
792
|
+
if (requestParameters['ifMatch'] == null) {
|
|
793
|
+
throw new runtime.RequiredError('ifMatch', 'Required parameter "ifMatch" was null or undefined when calling updateProject().');
|
|
794
|
+
}
|
|
795
|
+
if (requestParameters['name'] == null) {
|
|
796
|
+
throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling updateProject().');
|
|
797
|
+
}
|
|
798
|
+
const queryParameters = {};
|
|
799
|
+
const headerParameters = {};
|
|
800
|
+
if (requestParameters['ifMatch'] != null) {
|
|
801
|
+
headerParameters['If-Match'] = String(requestParameters['ifMatch']);
|
|
802
|
+
}
|
|
803
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
804
|
+
const token = this.configuration.accessToken;
|
|
805
|
+
const tokenString = await token('bearer', []);
|
|
806
|
+
if (tokenString) {
|
|
807
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
const consumes = [
|
|
811
|
+
{ contentType: 'multipart/form-data' },
|
|
812
|
+
];
|
|
813
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
814
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
815
|
+
let formParams;
|
|
816
|
+
let useForm = false;
|
|
817
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
818
|
+
useForm = canConsumeForm;
|
|
819
|
+
if (useForm) {
|
|
820
|
+
formParams = new FormData();
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
formParams = new URLSearchParams();
|
|
824
|
+
}
|
|
825
|
+
if (requestParameters['name'] != null) {
|
|
826
|
+
formParams.append('name', requestParameters['name']);
|
|
827
|
+
}
|
|
828
|
+
if (requestParameters['description'] != null) {
|
|
829
|
+
formParams.append('description', requestParameters['description']);
|
|
830
|
+
}
|
|
831
|
+
if (requestParameters['instructions'] != null) {
|
|
832
|
+
formParams.append('instructions', requestParameters['instructions']);
|
|
833
|
+
}
|
|
834
|
+
if (requestParameters['fileNames'] != null) {
|
|
835
|
+
formParams.append('fileNames', requestParameters['fileNames']);
|
|
836
|
+
}
|
|
837
|
+
if (requestParameters['removedFileNames'] != null) {
|
|
838
|
+
formParams.append('removedFileNames', requestParameters['removedFileNames']);
|
|
839
|
+
}
|
|
840
|
+
if (requestParameters['files'] != null) {
|
|
841
|
+
requestParameters['files'].forEach((element) => {
|
|
842
|
+
formParams.append('files', element);
|
|
843
|
+
});
|
|
844
|
+
}
|
|
845
|
+
let urlPath = `/api/v1/projects/{id}`;
|
|
846
|
+
urlPath = urlPath.replace(`{${'id'}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
847
|
+
const response = await this.request({
|
|
848
|
+
path: urlPath,
|
|
849
|
+
method: 'PUT',
|
|
850
|
+
headers: headerParameters,
|
|
851
|
+
query: queryParameters,
|
|
852
|
+
body: formParams,
|
|
853
|
+
}, initOverrides);
|
|
854
|
+
return new runtime.JSONApiResponse(response);
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Saves the name, description, instructions and context of a project in one conditional DIAL Core write: the BFF rebuilds PROJECT.md, keeps every stored context file not listed in `removedFileNames`, adds the `files` parts, carries the stored conversations over, and writes the whole project conditioned on the fresh snapshot\'s ETag, retrying a concurrent conversation write while `If-Match` still names the `contentVersion`. A different name then moves the project in its folder and keeps the caller\'s pin. The owner and a recipient the project is shared with with WRITE may save; only the owner may rename. Every domain rejection carries a ProjectCreateErrorCode.
|
|
858
|
+
* Save a project edit
|
|
859
|
+
*/
|
|
860
|
+
async updateProject(requestParameters, initOverrides) {
|
|
861
|
+
const response = await this.updateProjectRaw(requestParameters, initOverrides);
|
|
862
|
+
return await response.value();
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Opens one DIAL Core resource subscription for the given project ids and streams project-level changes as SSE: each `data:` line is a `ProjectWatchEventDto`. Events of files inside a project are dropped, and a `: keepalive` comment is sent every 15 seconds. The stream lasts until the client disconnects or DIAL Core ends it.
|
|
866
|
+
* Follow changes to listed projects via SSE
|
|
867
|
+
*/
|
|
868
|
+
async watchProjectsRaw(requestParameters, initOverrides) {
|
|
869
|
+
if (requestParameters['watchProjectsBodyDto'] == null) {
|
|
870
|
+
throw new runtime.RequiredError('watchProjectsBodyDto', 'Required parameter "watchProjectsBodyDto" was null or undefined when calling watchProjects().');
|
|
871
|
+
}
|
|
872
|
+
const queryParameters = {};
|
|
873
|
+
const headerParameters = {};
|
|
874
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
875
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
876
|
+
const token = this.configuration.accessToken;
|
|
877
|
+
const tokenString = await token('bearer', []);
|
|
878
|
+
if (tokenString) {
|
|
879
|
+
headerParameters['Authorization'] = `Bearer ${tokenString}`;
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
let urlPath = `/api/v1/projects/watch`;
|
|
883
|
+
const response = await this.request({
|
|
884
|
+
path: urlPath,
|
|
885
|
+
method: 'POST',
|
|
886
|
+
headers: headerParameters,
|
|
887
|
+
query: queryParameters,
|
|
888
|
+
body: requestParameters['watchProjectsBodyDto'],
|
|
889
|
+
}, initOverrides);
|
|
890
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
891
|
+
return new runtime.JSONApiResponse(response);
|
|
892
|
+
}
|
|
893
|
+
else {
|
|
894
|
+
return new runtime.TextApiResponse(response);
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
/**
|
|
898
|
+
* Opens one DIAL Core resource subscription for the given project ids and streams project-level changes as SSE: each `data:` line is a `ProjectWatchEventDto`. Events of files inside a project are dropped, and a `: keepalive` comment is sent every 15 seconds. The stream lasts until the client disconnects or DIAL Core ends it.
|
|
899
|
+
* Follow changes to listed projects via SSE
|
|
900
|
+
*/
|
|
901
|
+
async watchProjects(requestParameters, initOverrides) {
|
|
902
|
+
const response = await this.watchProjectsRaw(requestParameters, initOverrides);
|
|
903
|
+
return await response.value();
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
exports.ProjectsApi = ProjectsApi;
|