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