@instructure/athena-api-client 1.0.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 +155 -0
- package/dist/apis/AccountsApi.d.ts +41 -0
- package/dist/apis/AccountsApi.js +100 -0
- package/dist/apis/ChatsApi.d.ts +105 -0
- package/dist/apis/ChatsApi.js +289 -0
- package/dist/apis/HealthApi.d.ts +28 -0
- package/dist/apis/HealthApi.js +61 -0
- package/dist/apis/MessagesApi.d.ts +34 -0
- package/dist/apis/MessagesApi.js +80 -0
- package/dist/apis/ServiceTokensApi.d.ts +81 -0
- package/dist/apis/ServiceTokensApi.js +209 -0
- package/dist/apis/TagsApi.d.ts +28 -0
- package/dist/apis/TagsApi.js +61 -0
- package/dist/apis/index.d.ts +6 -0
- package/dist/apis/index.js +24 -0
- package/dist/esm/apis/AccountsApi.d.ts +41 -0
- package/dist/esm/apis/AccountsApi.js +96 -0
- package/dist/esm/apis/ChatsApi.d.ts +105 -0
- package/dist/esm/apis/ChatsApi.js +285 -0
- package/dist/esm/apis/HealthApi.d.ts +28 -0
- package/dist/esm/apis/HealthApi.js +57 -0
- package/dist/esm/apis/MessagesApi.d.ts +34 -0
- package/dist/esm/apis/MessagesApi.js +76 -0
- package/dist/esm/apis/ServiceTokensApi.d.ts +81 -0
- package/dist/esm/apis/ServiceTokensApi.js +205 -0
- package/dist/esm/apis/TagsApi.d.ts +28 -0
- package/dist/esm/apis/TagsApi.js +57 -0
- package/dist/esm/apis/index.d.ts +6 -0
- package/dist/esm/apis/index.js +8 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Account.d.ts +50 -0
- package/dist/esm/models/Account.js +55 -0
- package/dist/esm/models/Chat.d.ts +112 -0
- package/dist/esm/models/Chat.js +84 -0
- package/dist/esm/models/ChatRequest.d.ts +38 -0
- package/dist/esm/models/ChatRequest.js +45 -0
- package/dist/esm/models/CreateAccountRequest.d.ts +32 -0
- package/dist/esm/models/CreateAccountRequest.js +43 -0
- package/dist/esm/models/CreateChatRequest.d.ts +32 -0
- package/dist/esm/models/CreateChatRequest.js +41 -0
- package/dist/esm/models/CreateTokenRequest.d.ts +52 -0
- package/dist/esm/models/CreateTokenRequest.js +58 -0
- package/dist/esm/models/CreateTokenResponse.d.ts +50 -0
- package/dist/esm/models/CreateTokenResponse.js +55 -0
- package/dist/esm/models/HealthCheck.d.ts +39 -0
- package/dist/esm/models/HealthCheck.js +49 -0
- package/dist/esm/models/Message.d.ts +63 -0
- package/dist/esm/models/Message.js +64 -0
- package/dist/esm/models/MessagePartsInner.d.ts +38 -0
- package/dist/esm/models/MessagePartsInner.js +43 -0
- package/dist/esm/models/ModelError.d.ts +32 -0
- package/dist/esm/models/ModelError.js +43 -0
- package/dist/esm/models/PaginatedChats.d.ts +39 -0
- package/dist/esm/models/PaginatedChats.js +48 -0
- package/dist/esm/models/PaginatedMessages.d.ts +39 -0
- package/dist/esm/models/PaginatedMessages.js +48 -0
- package/dist/esm/models/ServiceToken.d.ts +70 -0
- package/dist/esm/models/ServiceToken.js +70 -0
- package/dist/esm/models/Tag.d.ts +38 -0
- package/dist/esm/models/Tag.js +47 -0
- package/dist/esm/models/UpdateChatRequest.d.ts +32 -0
- package/dist/esm/models/UpdateChatRequest.js +41 -0
- package/dist/esm/models/UpdateTokenRequest.d.ts +32 -0
- package/dist/esm/models/UpdateTokenRequest.js +43 -0
- package/dist/esm/models/UpdateTokenResponse.d.ts +50 -0
- package/dist/esm/models/UpdateTokenResponse.js +55 -0
- package/dist/esm/models/index.d.ts +18 -0
- package/dist/esm/models/index.js +20 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Account.d.ts +50 -0
- package/dist/models/Account.js +62 -0
- package/dist/models/Chat.d.ts +112 -0
- package/dist/models/Chat.js +92 -0
- package/dist/models/ChatRequest.d.ts +38 -0
- package/dist/models/ChatRequest.js +52 -0
- package/dist/models/CreateAccountRequest.d.ts +32 -0
- package/dist/models/CreateAccountRequest.js +50 -0
- package/dist/models/CreateChatRequest.d.ts +32 -0
- package/dist/models/CreateChatRequest.js +48 -0
- package/dist/models/CreateTokenRequest.d.ts +52 -0
- package/dist/models/CreateTokenRequest.js +66 -0
- package/dist/models/CreateTokenResponse.d.ts +50 -0
- package/dist/models/CreateTokenResponse.js +62 -0
- package/dist/models/HealthCheck.d.ts +39 -0
- package/dist/models/HealthCheck.js +57 -0
- package/dist/models/Message.d.ts +63 -0
- package/dist/models/Message.js +71 -0
- package/dist/models/MessagePartsInner.d.ts +38 -0
- package/dist/models/MessagePartsInner.js +50 -0
- package/dist/models/ModelError.d.ts +32 -0
- package/dist/models/ModelError.js +50 -0
- package/dist/models/PaginatedChats.d.ts +39 -0
- package/dist/models/PaginatedChats.js +55 -0
- package/dist/models/PaginatedMessages.d.ts +39 -0
- package/dist/models/PaginatedMessages.js +55 -0
- package/dist/models/ServiceToken.d.ts +70 -0
- package/dist/models/ServiceToken.js +78 -0
- package/dist/models/Tag.d.ts +38 -0
- package/dist/models/Tag.js +54 -0
- package/dist/models/UpdateChatRequest.d.ts +32 -0
- package/dist/models/UpdateChatRequest.js +48 -0
- package/dist/models/UpdateTokenRequest.d.ts +32 -0
- package/dist/models/UpdateTokenRequest.js +50 -0
- package/dist/models/UpdateTokenResponse.d.ts +50 -0
- package/dist/models/UpdateTokenResponse.js +62 -0
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.js +36 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/package.json +30 -0
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Athena API
|
|
6
|
+
* REST API for the Athena system
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.ChatsApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class ChatsApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates a new chat for the authenticated account user.
|
|
34
|
+
* Create a chat
|
|
35
|
+
*/
|
|
36
|
+
createChatRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters['xUserId'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling createChat().');
|
|
40
|
+
}
|
|
41
|
+
const queryParameters = {};
|
|
42
|
+
const headerParameters = {};
|
|
43
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
44
|
+
if (requestParameters['xUserId'] != null) {
|
|
45
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
46
|
+
}
|
|
47
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
48
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
49
|
+
}
|
|
50
|
+
let urlPath = `/api/v1/chats`;
|
|
51
|
+
const response = yield this.request({
|
|
52
|
+
path: urlPath,
|
|
53
|
+
method: 'POST',
|
|
54
|
+
headers: headerParameters,
|
|
55
|
+
query: queryParameters,
|
|
56
|
+
body: (0, index_1.CreateChatRequestToJSON)(requestParameters['createChatRequest']),
|
|
57
|
+
}, initOverrides);
|
|
58
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChatFromJSON)(jsonValue));
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new chat for the authenticated account user.
|
|
63
|
+
* Create a chat
|
|
64
|
+
*/
|
|
65
|
+
createChat(requestParameters, initOverrides) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const response = yield this.createChatRaw(requestParameters, initOverrides);
|
|
68
|
+
return yield response.value();
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Deletes a chat and its messages belonging to the authenticated account user.
|
|
73
|
+
* Delete a chat
|
|
74
|
+
*/
|
|
75
|
+
deleteChatRaw(requestParameters, initOverrides) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
if (requestParameters['xUserId'] == null) {
|
|
78
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling deleteChat().');
|
|
79
|
+
}
|
|
80
|
+
if (requestParameters['chatId'] == null) {
|
|
81
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling deleteChat().');
|
|
82
|
+
}
|
|
83
|
+
const queryParameters = {};
|
|
84
|
+
const headerParameters = {};
|
|
85
|
+
if (requestParameters['xUserId'] != null) {
|
|
86
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
87
|
+
}
|
|
88
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
89
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
90
|
+
}
|
|
91
|
+
let urlPath = `/api/v1/chats/{chatId}`;
|
|
92
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
93
|
+
const response = yield this.request({
|
|
94
|
+
path: urlPath,
|
|
95
|
+
method: 'DELETE',
|
|
96
|
+
headers: headerParameters,
|
|
97
|
+
query: queryParameters,
|
|
98
|
+
}, initOverrides);
|
|
99
|
+
return new runtime.VoidApiResponse(response);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Deletes a chat and its messages belonging to the authenticated account user.
|
|
104
|
+
* Delete a chat
|
|
105
|
+
*/
|
|
106
|
+
deleteChat(requestParameters, initOverrides) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
yield this.deleteChatRaw(requestParameters, initOverrides);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Returns a single chat belonging to the authenticated account user.
|
|
113
|
+
* Get a chat
|
|
114
|
+
*/
|
|
115
|
+
getChatRaw(requestParameters, initOverrides) {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
if (requestParameters['xUserId'] == null) {
|
|
118
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getChat().');
|
|
119
|
+
}
|
|
120
|
+
if (requestParameters['chatId'] == null) {
|
|
121
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling getChat().');
|
|
122
|
+
}
|
|
123
|
+
const queryParameters = {};
|
|
124
|
+
const headerParameters = {};
|
|
125
|
+
if (requestParameters['xUserId'] != null) {
|
|
126
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
127
|
+
}
|
|
128
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
129
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
130
|
+
}
|
|
131
|
+
let urlPath = `/api/v1/chats/{chatId}`;
|
|
132
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
133
|
+
const response = yield this.request({
|
|
134
|
+
path: urlPath,
|
|
135
|
+
method: 'GET',
|
|
136
|
+
headers: headerParameters,
|
|
137
|
+
query: queryParameters,
|
|
138
|
+
}, initOverrides);
|
|
139
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChatFromJSON)(jsonValue));
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Returns a single chat belonging to the authenticated account user.
|
|
144
|
+
* Get a chat
|
|
145
|
+
*/
|
|
146
|
+
getChat(requestParameters, initOverrides) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const response = yield this.getChatRaw(requestParameters, initOverrides);
|
|
149
|
+
return yield response.value();
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Returns paginated chats belonging to the authenticated account user, ordered by creation date (newest first).
|
|
154
|
+
* List chats
|
|
155
|
+
*/
|
|
156
|
+
listChatsRaw(requestParameters, initOverrides) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
if (requestParameters['xUserId'] == null) {
|
|
159
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling listChats().');
|
|
160
|
+
}
|
|
161
|
+
const queryParameters = {};
|
|
162
|
+
if (requestParameters['limit'] != null) {
|
|
163
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
164
|
+
}
|
|
165
|
+
if (requestParameters['cursor'] != null) {
|
|
166
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
167
|
+
}
|
|
168
|
+
const headerParameters = {};
|
|
169
|
+
if (requestParameters['xUserId'] != null) {
|
|
170
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
171
|
+
}
|
|
172
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
173
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
174
|
+
}
|
|
175
|
+
let urlPath = `/api/v1/chats`;
|
|
176
|
+
const response = yield this.request({
|
|
177
|
+
path: urlPath,
|
|
178
|
+
method: 'GET',
|
|
179
|
+
headers: headerParameters,
|
|
180
|
+
query: queryParameters,
|
|
181
|
+
}, initOverrides);
|
|
182
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedChatsFromJSON)(jsonValue));
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Returns paginated chats belonging to the authenticated account user, ordered by creation date (newest first).
|
|
187
|
+
* List chats
|
|
188
|
+
*/
|
|
189
|
+
listChats(requestParameters, initOverrides) {
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
const response = yield this.listChatsRaw(requestParameters, initOverrides);
|
|
192
|
+
return yield response.value();
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Sends a message to a chat conversation with an AI assistant. The client must provide a chatId (UUID v4). If the chatId doesn\'t exist, a new chat will be created with that ID. If it exists and belongs to the user, the conversation continues. The response is streamed in real-time.
|
|
197
|
+
* Send a message to a chat
|
|
198
|
+
*/
|
|
199
|
+
sendChatMessageRaw(requestParameters, initOverrides) {
|
|
200
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
201
|
+
if (requestParameters['xUserId'] == null) {
|
|
202
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling sendChatMessage().');
|
|
203
|
+
}
|
|
204
|
+
if (requestParameters['chatRequest'] == null) {
|
|
205
|
+
throw new runtime.RequiredError('chatRequest', 'Required parameter "chatRequest" was null or undefined when calling sendChatMessage().');
|
|
206
|
+
}
|
|
207
|
+
const queryParameters = {};
|
|
208
|
+
const headerParameters = {};
|
|
209
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
210
|
+
if (requestParameters['xCanvasToken'] != null) {
|
|
211
|
+
headerParameters['X-Canvas-Token'] = String(requestParameters['xCanvasToken']);
|
|
212
|
+
}
|
|
213
|
+
if (requestParameters['xUserId'] != null) {
|
|
214
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
215
|
+
}
|
|
216
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
217
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
218
|
+
}
|
|
219
|
+
let urlPath = `/api/v1/chat`;
|
|
220
|
+
const response = yield this.request({
|
|
221
|
+
path: urlPath,
|
|
222
|
+
method: 'POST',
|
|
223
|
+
headers: headerParameters,
|
|
224
|
+
query: queryParameters,
|
|
225
|
+
body: (0, index_1.ChatRequestToJSON)(requestParameters['chatRequest']),
|
|
226
|
+
}, initOverrides);
|
|
227
|
+
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
228
|
+
return new runtime.JSONApiResponse(response);
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
return new runtime.TextApiResponse(response);
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Sends a message to a chat conversation with an AI assistant. The client must provide a chatId (UUID v4). If the chatId doesn\'t exist, a new chat will be created with that ID. If it exists and belongs to the user, the conversation continues. The response is streamed in real-time.
|
|
237
|
+
* Send a message to a chat
|
|
238
|
+
*/
|
|
239
|
+
sendChatMessage(requestParameters, initOverrides) {
|
|
240
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
241
|
+
const response = yield this.sendChatMessageRaw(requestParameters, initOverrides);
|
|
242
|
+
return yield response.value();
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Updates a chat belonging to the authenticated account user.
|
|
247
|
+
* Update a chat
|
|
248
|
+
*/
|
|
249
|
+
updateChatRaw(requestParameters, initOverrides) {
|
|
250
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
if (requestParameters['xUserId'] == null) {
|
|
252
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling updateChat().');
|
|
253
|
+
}
|
|
254
|
+
if (requestParameters['chatId'] == null) {
|
|
255
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling updateChat().');
|
|
256
|
+
}
|
|
257
|
+
const queryParameters = {};
|
|
258
|
+
const headerParameters = {};
|
|
259
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
260
|
+
if (requestParameters['xUserId'] != null) {
|
|
261
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
262
|
+
}
|
|
263
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
264
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
265
|
+
}
|
|
266
|
+
let urlPath = `/api/v1/chats/{chatId}`;
|
|
267
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
268
|
+
const response = yield this.request({
|
|
269
|
+
path: urlPath,
|
|
270
|
+
method: 'PATCH',
|
|
271
|
+
headers: headerParameters,
|
|
272
|
+
query: queryParameters,
|
|
273
|
+
body: (0, index_1.UpdateChatRequestToJSON)(requestParameters['updateChatRequest']),
|
|
274
|
+
}, initOverrides);
|
|
275
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChatFromJSON)(jsonValue));
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Updates a chat belonging to the authenticated account user.
|
|
280
|
+
* Update a chat
|
|
281
|
+
*/
|
|
282
|
+
updateChat(requestParameters, initOverrides) {
|
|
283
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
|
+
const response = yield this.updateChatRaw(requestParameters, initOverrides);
|
|
285
|
+
return yield response.value();
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
exports.ChatsApi = ChatsApi;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Athena API
|
|
3
|
+
* REST API for the Athena system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { HealthCheck } from '../models/index';
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare class HealthApi extends runtime.BaseAPI {
|
|
18
|
+
/**
|
|
19
|
+
* Returns the health status of the API server
|
|
20
|
+
* Health check endpoint
|
|
21
|
+
*/
|
|
22
|
+
healthCheckRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<HealthCheck>>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the health status of the API server
|
|
25
|
+
* Health check endpoint
|
|
26
|
+
*/
|
|
27
|
+
healthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<HealthCheck>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Athena API
|
|
6
|
+
* REST API for the Athena system
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.HealthApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class HealthApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns the health status of the API server
|
|
34
|
+
* Health check endpoint
|
|
35
|
+
*/
|
|
36
|
+
healthCheckRaw(initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
const headerParameters = {};
|
|
40
|
+
let urlPath = `/health`;
|
|
41
|
+
const response = yield this.request({
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: 'GET',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
}, initOverrides);
|
|
47
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.HealthCheckFromJSON)(jsonValue));
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Returns the health status of the API server
|
|
52
|
+
* Health check endpoint
|
|
53
|
+
*/
|
|
54
|
+
healthCheck(initOverrides) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const response = yield this.healthCheckRaw(initOverrides);
|
|
57
|
+
return yield response.value();
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.HealthApi = HealthApi;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Athena API
|
|
3
|
+
* REST API for the Athena system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { PaginatedMessages } from '../models/index';
|
|
14
|
+
export interface GetChatMessagesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
limit?: number;
|
|
18
|
+
cursor?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export declare class MessagesApi extends runtime.BaseAPI {
|
|
24
|
+
/**
|
|
25
|
+
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
26
|
+
* List chat messages
|
|
27
|
+
*/
|
|
28
|
+
getChatMessagesRaw(requestParameters: GetChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedMessages>>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
31
|
+
* List chat messages
|
|
32
|
+
*/
|
|
33
|
+
getChatMessages(requestParameters: GetChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedMessages>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* Athena API
|
|
6
|
+
* REST API for the Athena system
|
|
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
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.MessagesApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class MessagesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
34
|
+
* List chat messages
|
|
35
|
+
*/
|
|
36
|
+
getChatMessagesRaw(requestParameters, initOverrides) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
if (requestParameters['xUserId'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getChatMessages().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['chatId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling getChatMessages().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
if (requestParameters['limit'] != null) {
|
|
46
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
47
|
+
}
|
|
48
|
+
if (requestParameters['cursor'] != null) {
|
|
49
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
50
|
+
}
|
|
51
|
+
const headerParameters = {};
|
|
52
|
+
if (requestParameters['xUserId'] != null) {
|
|
53
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
54
|
+
}
|
|
55
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
56
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
57
|
+
}
|
|
58
|
+
let urlPath = `/api/v1/chats/{chatId}/messages`;
|
|
59
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
60
|
+
const response = yield this.request({
|
|
61
|
+
path: urlPath,
|
|
62
|
+
method: 'GET',
|
|
63
|
+
headers: headerParameters,
|
|
64
|
+
query: queryParameters,
|
|
65
|
+
}, initOverrides);
|
|
66
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedMessagesFromJSON)(jsonValue));
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
71
|
+
* List chat messages
|
|
72
|
+
*/
|
|
73
|
+
getChatMessages(requestParameters, initOverrides) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const response = yield this.getChatMessagesRaw(requestParameters, initOverrides);
|
|
76
|
+
return yield response.value();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.MessagesApi = MessagesApi;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Athena API
|
|
3
|
+
* REST API for the Athena system
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import * as runtime from '../runtime';
|
|
13
|
+
import type { CreateTokenRequest, CreateTokenResponse, ServiceToken, UpdateTokenRequest, UpdateTokenResponse } from '../models/index';
|
|
14
|
+
export interface CreateServiceTokenRequest {
|
|
15
|
+
createTokenRequest: CreateTokenRequest;
|
|
16
|
+
}
|
|
17
|
+
export interface DeleteServiceTokenRequest {
|
|
18
|
+
id: string;
|
|
19
|
+
}
|
|
20
|
+
export interface GetServiceTokenRequest {
|
|
21
|
+
id: string;
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateServiceTokenRequest {
|
|
24
|
+
id: string;
|
|
25
|
+
updateTokenRequest: UpdateTokenRequest;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
export declare class ServiceTokensApi extends runtime.BaseAPI {
|
|
31
|
+
/**
|
|
32
|
+
* Creates a new service token with the specified consumer name, role, and account ID (admin only). The generated token is only shown once.
|
|
33
|
+
* Create a new service token
|
|
34
|
+
*/
|
|
35
|
+
createServiceTokenRaw(requestParameters: CreateServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateTokenResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a new service token with the specified consumer name, role, and account ID (admin only). The generated token is only shown once.
|
|
38
|
+
* Create a new service token
|
|
39
|
+
*/
|
|
40
|
+
createServiceToken(requestParameters: CreateServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateTokenResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Permanently deletes a service token (admin only)
|
|
43
|
+
* Delete service token
|
|
44
|
+
*/
|
|
45
|
+
deleteServiceTokenRaw(requestParameters: DeleteServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
46
|
+
/**
|
|
47
|
+
* Permanently deletes a service token (admin only)
|
|
48
|
+
* Delete service token
|
|
49
|
+
*/
|
|
50
|
+
deleteServiceToken(requestParameters: DeleteServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieves details of a specific service token by its ID (admin only)
|
|
53
|
+
* Get service token by ID
|
|
54
|
+
*/
|
|
55
|
+
getServiceTokenRaw(requestParameters: GetServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ServiceToken>>;
|
|
56
|
+
/**
|
|
57
|
+
* Retrieves details of a specific service token by its ID (admin only)
|
|
58
|
+
* Get service token by ID
|
|
59
|
+
*/
|
|
60
|
+
getServiceToken(requestParameters: GetServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ServiceToken>;
|
|
61
|
+
/**
|
|
62
|
+
* Retrieves a list of all service tokens (admin only)
|
|
63
|
+
* List all service tokens
|
|
64
|
+
*/
|
|
65
|
+
listServiceTokensRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ServiceToken>>>;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves a list of all service tokens (admin only)
|
|
68
|
+
* List all service tokens
|
|
69
|
+
*/
|
|
70
|
+
listServiceTokens(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ServiceToken>>;
|
|
71
|
+
/**
|
|
72
|
+
* Updates the active status of a service token (admin only)
|
|
73
|
+
* Update service token status
|
|
74
|
+
*/
|
|
75
|
+
updateServiceTokenRaw(requestParameters: UpdateServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UpdateTokenResponse>>;
|
|
76
|
+
/**
|
|
77
|
+
* Updates the active status of a service token (admin only)
|
|
78
|
+
* Update service token status
|
|
79
|
+
*/
|
|
80
|
+
updateServiceToken(requestParameters: UpdateServiceTokenRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UpdateTokenResponse>;
|
|
81
|
+
}
|