@instructure/athena-api-client 1.0.0 → 1.0.2
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 +7 -0
- package/dist/apis/ChatsApi.d.ts +14 -0
- package/dist/apis/ChatsApi.js +41 -0
- package/dist/apis/LearningMomentsApi.d.ts +33 -0
- package/dist/apis/LearningMomentsApi.js +76 -0
- package/dist/apis/MessagesApi.d.ts +30 -1
- package/dist/apis/MessagesApi.js +88 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/ChatsApi.d.ts +14 -0
- package/dist/esm/apis/ChatsApi.js +41 -0
- package/dist/esm/apis/LearningMomentsApi.d.ts +33 -0
- package/dist/esm/apis/LearningMomentsApi.js +72 -0
- package/dist/esm/apis/MessagesApi.d.ts +30 -1
- package/dist/esm/apis/MessagesApi.js +89 -1
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/Account.d.ts +6 -0
- package/dist/esm/models/Account.js +2 -0
- package/dist/esm/models/LearningMoment.d.ts +86 -0
- package/dist/esm/models/LearningMoment.js +73 -0
- package/dist/esm/models/Message.d.ts +6 -0
- package/dist/esm/models/Message.js +4 -0
- package/dist/esm/models/MessageCountResponse.d.ts +32 -0
- package/dist/esm/models/MessageCountResponse.js +43 -0
- package/dist/esm/models/PaginatedLearningMoments.d.ts +39 -0
- package/dist/esm/models/PaginatedLearningMoments.js +48 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/models/Account.d.ts +6 -0
- package/dist/models/Account.js +2 -0
- package/dist/models/LearningMoment.d.ts +86 -0
- package/dist/models/LearningMoment.js +80 -0
- package/dist/models/Message.d.ts +6 -0
- package/dist/models/Message.js +4 -0
- package/dist/models/MessageCountResponse.d.ts +32 -0
- package/dist/models/MessageCountResponse.js +50 -0
- package/dist/models/PaginatedLearningMoments.d.ts +39 -0
- package/dist/models/PaginatedLearningMoments.js +55 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,10 +60,14 @@ All URIs are relative to *http://localhost:3000*
|
|
|
60
60
|
*ChatsApi* | [**deleteChat**](docs/ChatsApi.md#deletechat) | **DELETE** /api/v1/chats/{chatId} | Delete a chat
|
|
61
61
|
*ChatsApi* | [**getChat**](docs/ChatsApi.md#getchat) | **GET** /api/v1/chats/{chatId} | Get a chat
|
|
62
62
|
*ChatsApi* | [**listChats**](docs/ChatsApi.md#listchats) | **GET** /api/v1/chats | List chats
|
|
63
|
+
*ChatsApi* | [**markChatAsViewed**](docs/ChatsApi.md#markchatasviewed) | **PATCH** /api/v1/chats/{chatId}/viewed | Mark chat as viewed
|
|
63
64
|
*ChatsApi* | [**sendChatMessage**](docs/ChatsApi.md#sendchatmessage) | **POST** /api/v1/chat | Send a message to a chat
|
|
64
65
|
*ChatsApi* | [**updateChat**](docs/ChatsApi.md#updatechatoperation) | **PATCH** /api/v1/chats/{chatId} | Update a chat
|
|
65
66
|
*HealthApi* | [**healthCheck**](docs/HealthApi.md#healthcheck) | **GET** /health | Health check endpoint
|
|
67
|
+
*LearningMomentsApi* | [**listLearningMoments**](docs/LearningMomentsApi.md#listlearningmoments) | **GET** /api/v1/learning-moments | List learning moments
|
|
68
|
+
*MessagesApi* | [**getChatMessage**](docs/MessagesApi.md#getchatmessage) | **GET** /api/v1/chats/{chatId}/messages/{messageId} | Get a chat message
|
|
66
69
|
*MessagesApi* | [**getChatMessages**](docs/MessagesApi.md#getchatmessages) | **GET** /api/v1/chats/{chatId}/messages | List chat messages
|
|
70
|
+
*MessagesApi* | [**getMessageCount**](docs/MessagesApi.md#getmessagecount) | **GET** /api/v1/messages/count | Count user messages
|
|
67
71
|
*ServiceTokensApi* | [**createServiceToken**](docs/ServiceTokensApi.md#createservicetoken) | **POST** /api/v1/tokens | Create a new service token
|
|
68
72
|
*ServiceTokensApi* | [**deleteServiceToken**](docs/ServiceTokensApi.md#deleteservicetoken) | **DELETE** /api/v1/tokens/{id} | Delete service token
|
|
69
73
|
*ServiceTokensApi* | [**getServiceToken**](docs/ServiceTokensApi.md#getservicetoken) | **GET** /api/v1/tokens/{id} | Get service token by ID
|
|
@@ -82,10 +86,13 @@ All URIs are relative to *http://localhost:3000*
|
|
|
82
86
|
- [CreateTokenRequest](docs/CreateTokenRequest.md)
|
|
83
87
|
- [CreateTokenResponse](docs/CreateTokenResponse.md)
|
|
84
88
|
- [HealthCheck](docs/HealthCheck.md)
|
|
89
|
+
- [LearningMoment](docs/LearningMoment.md)
|
|
85
90
|
- [Message](docs/Message.md)
|
|
91
|
+
- [MessageCountResponse](docs/MessageCountResponse.md)
|
|
86
92
|
- [MessagePartsInner](docs/MessagePartsInner.md)
|
|
87
93
|
- [ModelError](docs/ModelError.md)
|
|
88
94
|
- [PaginatedChats](docs/PaginatedChats.md)
|
|
95
|
+
- [PaginatedLearningMoments](docs/PaginatedLearningMoments.md)
|
|
89
96
|
- [PaginatedMessages](docs/PaginatedMessages.md)
|
|
90
97
|
- [ServiceToken](docs/ServiceToken.md)
|
|
91
98
|
- [Tag](docs/Tag.md)
|
package/dist/apis/ChatsApi.d.ts
CHANGED
|
@@ -28,6 +28,10 @@ export interface ListChatsRequest {
|
|
|
28
28
|
limit?: number;
|
|
29
29
|
cursor?: string;
|
|
30
30
|
}
|
|
31
|
+
export interface MarkChatAsViewedRequest {
|
|
32
|
+
xUserId: string;
|
|
33
|
+
chatId: string;
|
|
34
|
+
}
|
|
31
35
|
export interface SendChatMessageRequest {
|
|
32
36
|
xUserId: string;
|
|
33
37
|
chatRequest: ChatRequest;
|
|
@@ -82,6 +86,16 @@ export declare class ChatsApi extends runtime.BaseAPI {
|
|
|
82
86
|
* List chats
|
|
83
87
|
*/
|
|
84
88
|
listChats(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedChats>;
|
|
89
|
+
/**
|
|
90
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
91
|
+
* Mark chat as viewed
|
|
92
|
+
*/
|
|
93
|
+
markChatAsViewedRaw(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
|
|
94
|
+
/**
|
|
95
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
96
|
+
* Mark chat as viewed
|
|
97
|
+
*/
|
|
98
|
+
markChatAsViewed(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
|
|
85
99
|
/**
|
|
86
100
|
* 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.
|
|
87
101
|
* Send a message to a chat
|
package/dist/apis/ChatsApi.js
CHANGED
|
@@ -192,6 +192,47 @@ class ChatsApi extends runtime.BaseAPI {
|
|
|
192
192
|
return yield response.value();
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
|
+
/**
|
|
196
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
197
|
+
* Mark chat as viewed
|
|
198
|
+
*/
|
|
199
|
+
markChatAsViewedRaw(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 markChatAsViewed().');
|
|
203
|
+
}
|
|
204
|
+
if (requestParameters['chatId'] == null) {
|
|
205
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling markChatAsViewed().');
|
|
206
|
+
}
|
|
207
|
+
const queryParameters = {};
|
|
208
|
+
const headerParameters = {};
|
|
209
|
+
if (requestParameters['xUserId'] != null) {
|
|
210
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
211
|
+
}
|
|
212
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
213
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
214
|
+
}
|
|
215
|
+
let urlPath = `/api/v1/chats/{chatId}/viewed`;
|
|
216
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
217
|
+
const response = yield this.request({
|
|
218
|
+
path: urlPath,
|
|
219
|
+
method: 'PATCH',
|
|
220
|
+
headers: headerParameters,
|
|
221
|
+
query: queryParameters,
|
|
222
|
+
}, initOverrides);
|
|
223
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ChatFromJSON)(jsonValue));
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
228
|
+
* Mark chat as viewed
|
|
229
|
+
*/
|
|
230
|
+
markChatAsViewed(requestParameters, initOverrides) {
|
|
231
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
+
const response = yield this.markChatAsViewedRaw(requestParameters, initOverrides);
|
|
233
|
+
return yield response.value();
|
|
234
|
+
});
|
|
235
|
+
}
|
|
195
236
|
/**
|
|
196
237
|
* 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
238
|
* Send a message to a chat
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { PaginatedLearningMoments } from '../models/index';
|
|
14
|
+
export interface ListLearningMomentsRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
cursor?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare class LearningMomentsApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
25
|
+
* List learning moments
|
|
26
|
+
*/
|
|
27
|
+
listLearningMomentsRaw(requestParameters: ListLearningMomentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedLearningMoments>>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
30
|
+
* List learning moments
|
|
31
|
+
*/
|
|
32
|
+
listLearningMoments(requestParameters: ListLearningMomentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedLearningMoments>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.LearningMomentsApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class LearningMomentsApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
34
|
+
* List learning moments
|
|
35
|
+
*/
|
|
36
|
+
listLearningMomentsRaw(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 listLearningMoments().');
|
|
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/learning-moments`;
|
|
56
|
+
const response = yield this.request({
|
|
57
|
+
path: urlPath,
|
|
58
|
+
method: 'GET',
|
|
59
|
+
headers: headerParameters,
|
|
60
|
+
query: queryParameters,
|
|
61
|
+
}, initOverrides);
|
|
62
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedLearningMomentsFromJSON)(jsonValue));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
67
|
+
* List learning moments
|
|
68
|
+
*/
|
|
69
|
+
listLearningMoments(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const response = yield this.listLearningMomentsRaw(requestParameters, initOverrides);
|
|
72
|
+
return yield response.value();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.LearningMomentsApi = LearningMomentsApi;
|
|
@@ -10,17 +10,36 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { PaginatedMessages } from '../models/index';
|
|
13
|
+
import type { Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
14
|
+
export interface GetChatMessageRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
messageId: string;
|
|
18
|
+
}
|
|
14
19
|
export interface GetChatMessagesRequest {
|
|
15
20
|
xUserId: string;
|
|
16
21
|
chatId: string;
|
|
17
22
|
limit?: number;
|
|
18
23
|
cursor?: string;
|
|
19
24
|
}
|
|
25
|
+
export interface GetMessageCountRequest {
|
|
26
|
+
xUserId: string;
|
|
27
|
+
hours: number;
|
|
28
|
+
}
|
|
20
29
|
/**
|
|
21
30
|
*
|
|
22
31
|
*/
|
|
23
32
|
export declare class MessagesApi extends runtime.BaseAPI {
|
|
33
|
+
/**
|
|
34
|
+
* Returns a single message belonging to the specified chat.
|
|
35
|
+
* Get a chat message
|
|
36
|
+
*/
|
|
37
|
+
getChatMessageRaw(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Message>>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a single message belonging to the specified chat.
|
|
40
|
+
* Get a chat message
|
|
41
|
+
*/
|
|
42
|
+
getChatMessage(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Message>;
|
|
24
43
|
/**
|
|
25
44
|
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
26
45
|
* List chat messages
|
|
@@ -31,4 +50,14 @@ export declare class MessagesApi extends runtime.BaseAPI {
|
|
|
31
50
|
* List chat messages
|
|
32
51
|
*/
|
|
33
52
|
getChatMessages(requestParameters: GetChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedMessages>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
55
|
+
* Count user messages
|
|
56
|
+
*/
|
|
57
|
+
getMessageCountRaw(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageCountResponse>>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
60
|
+
* Count user messages
|
|
61
|
+
*/
|
|
62
|
+
getMessageCount(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageCountResponse>;
|
|
34
63
|
}
|
package/dist/apis/MessagesApi.js
CHANGED
|
@@ -29,6 +29,51 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class MessagesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns a single message belonging to the specified chat.
|
|
34
|
+
* Get a chat message
|
|
35
|
+
*/
|
|
36
|
+
getChatMessageRaw(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 getChatMessage().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['chatId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling getChatMessage().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['messageId'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('messageId', 'Required parameter "messageId" was null or undefined when calling getChatMessage().');
|
|
46
|
+
}
|
|
47
|
+
const queryParameters = {};
|
|
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/{messageId}`;
|
|
56
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
57
|
+
urlPath = urlPath.replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters['messageId'])));
|
|
58
|
+
const response = yield this.request({
|
|
59
|
+
path: urlPath,
|
|
60
|
+
method: 'GET',
|
|
61
|
+
headers: headerParameters,
|
|
62
|
+
query: queryParameters,
|
|
63
|
+
}, initOverrides);
|
|
64
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MessageFromJSON)(jsonValue));
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns a single message belonging to the specified chat.
|
|
69
|
+
* Get a chat message
|
|
70
|
+
*/
|
|
71
|
+
getChatMessage(requestParameters, initOverrides) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
const response = yield this.getChatMessageRaw(requestParameters, initOverrides);
|
|
74
|
+
return yield response.value();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
32
77
|
/**
|
|
33
78
|
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
34
79
|
* List chat messages
|
|
@@ -76,5 +121,48 @@ class MessagesApi extends runtime.BaseAPI {
|
|
|
76
121
|
return yield response.value();
|
|
77
122
|
});
|
|
78
123
|
}
|
|
124
|
+
/**
|
|
125
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
126
|
+
* Count user messages
|
|
127
|
+
*/
|
|
128
|
+
getMessageCountRaw(requestParameters, initOverrides) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
if (requestParameters['xUserId'] == null) {
|
|
131
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getMessageCount().');
|
|
132
|
+
}
|
|
133
|
+
if (requestParameters['hours'] == null) {
|
|
134
|
+
throw new runtime.RequiredError('hours', 'Required parameter "hours" was null or undefined when calling getMessageCount().');
|
|
135
|
+
}
|
|
136
|
+
const queryParameters = {};
|
|
137
|
+
if (requestParameters['hours'] != null) {
|
|
138
|
+
queryParameters['hours'] = requestParameters['hours'];
|
|
139
|
+
}
|
|
140
|
+
const headerParameters = {};
|
|
141
|
+
if (requestParameters['xUserId'] != null) {
|
|
142
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
143
|
+
}
|
|
144
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
145
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
146
|
+
}
|
|
147
|
+
let urlPath = `/api/v1/messages/count`;
|
|
148
|
+
const response = yield this.request({
|
|
149
|
+
path: urlPath,
|
|
150
|
+
method: 'GET',
|
|
151
|
+
headers: headerParameters,
|
|
152
|
+
query: queryParameters,
|
|
153
|
+
}, initOverrides);
|
|
154
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MessageCountResponseFromJSON)(jsonValue));
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
159
|
+
* Count user messages
|
|
160
|
+
*/
|
|
161
|
+
getMessageCount(requestParameters, initOverrides) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const response = yield this.getMessageCountRaw(requestParameters, initOverrides);
|
|
164
|
+
return yield response.value();
|
|
165
|
+
});
|
|
166
|
+
}
|
|
79
167
|
}
|
|
80
168
|
exports.MessagesApi = MessagesApi;
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -19,6 +19,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
19
19
|
__exportStar(require("./AccountsApi"), exports);
|
|
20
20
|
__exportStar(require("./ChatsApi"), exports);
|
|
21
21
|
__exportStar(require("./HealthApi"), exports);
|
|
22
|
+
__exportStar(require("./LearningMomentsApi"), exports);
|
|
22
23
|
__exportStar(require("./MessagesApi"), exports);
|
|
23
24
|
__exportStar(require("./ServiceTokensApi"), exports);
|
|
24
25
|
__exportStar(require("./TagsApi"), exports);
|
|
@@ -28,6 +28,10 @@ export interface ListChatsRequest {
|
|
|
28
28
|
limit?: number;
|
|
29
29
|
cursor?: string;
|
|
30
30
|
}
|
|
31
|
+
export interface MarkChatAsViewedRequest {
|
|
32
|
+
xUserId: string;
|
|
33
|
+
chatId: string;
|
|
34
|
+
}
|
|
31
35
|
export interface SendChatMessageRequest {
|
|
32
36
|
xUserId: string;
|
|
33
37
|
chatRequest: ChatRequest;
|
|
@@ -82,6 +86,16 @@ export declare class ChatsApi extends runtime.BaseAPI {
|
|
|
82
86
|
* List chats
|
|
83
87
|
*/
|
|
84
88
|
listChats(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedChats>;
|
|
89
|
+
/**
|
|
90
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
91
|
+
* Mark chat as viewed
|
|
92
|
+
*/
|
|
93
|
+
markChatAsViewedRaw(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
|
|
94
|
+
/**
|
|
95
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
96
|
+
* Mark chat as viewed
|
|
97
|
+
*/
|
|
98
|
+
markChatAsViewed(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
|
|
85
99
|
/**
|
|
86
100
|
* 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.
|
|
87
101
|
* Send a message to a chat
|
|
@@ -189,6 +189,47 @@ export class ChatsApi extends runtime.BaseAPI {
|
|
|
189
189
|
return yield response.value();
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
194
|
+
* Mark chat as viewed
|
|
195
|
+
*/
|
|
196
|
+
markChatAsViewedRaw(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 markChatAsViewed().');
|
|
200
|
+
}
|
|
201
|
+
if (requestParameters['chatId'] == null) {
|
|
202
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling markChatAsViewed().');
|
|
203
|
+
}
|
|
204
|
+
const queryParameters = {};
|
|
205
|
+
const headerParameters = {};
|
|
206
|
+
if (requestParameters['xUserId'] != null) {
|
|
207
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
208
|
+
}
|
|
209
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
210
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
211
|
+
}
|
|
212
|
+
let urlPath = `/api/v1/chats/{chatId}/viewed`;
|
|
213
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
214
|
+
const response = yield this.request({
|
|
215
|
+
path: urlPath,
|
|
216
|
+
method: 'PATCH',
|
|
217
|
+
headers: headerParameters,
|
|
218
|
+
query: queryParameters,
|
|
219
|
+
}, initOverrides);
|
|
220
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ChatFromJSON(jsonValue));
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
225
|
+
* Mark chat as viewed
|
|
226
|
+
*/
|
|
227
|
+
markChatAsViewed(requestParameters, initOverrides) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
const response = yield this.markChatAsViewedRaw(requestParameters, initOverrides);
|
|
230
|
+
return yield response.value();
|
|
231
|
+
});
|
|
232
|
+
}
|
|
192
233
|
/**
|
|
193
234
|
* 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
235
|
* Send a message to a chat
|
|
@@ -0,0 +1,33 @@
|
|
|
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 { PaginatedLearningMoments } from '../models/index';
|
|
14
|
+
export interface ListLearningMomentsRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
limit?: number;
|
|
17
|
+
cursor?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare class LearningMomentsApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
25
|
+
* List learning moments
|
|
26
|
+
*/
|
|
27
|
+
listLearningMomentsRaw(requestParameters: ListLearningMomentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedLearningMoments>>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
30
|
+
* List learning moments
|
|
31
|
+
*/
|
|
32
|
+
listLearningMoments(requestParameters: ListLearningMomentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedLearningMoments>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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 { PaginatedLearningMomentsFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class LearningMomentsApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
31
|
+
* List learning moments
|
|
32
|
+
*/
|
|
33
|
+
listLearningMomentsRaw(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 listLearningMoments().');
|
|
37
|
+
}
|
|
38
|
+
const queryParameters = {};
|
|
39
|
+
if (requestParameters['limit'] != null) {
|
|
40
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
41
|
+
}
|
|
42
|
+
if (requestParameters['cursor'] != null) {
|
|
43
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
44
|
+
}
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
if (requestParameters['xUserId'] != null) {
|
|
47
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
48
|
+
}
|
|
49
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
50
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
51
|
+
}
|
|
52
|
+
let urlPath = `/api/v1/learning-moments`;
|
|
53
|
+
const response = yield this.request({
|
|
54
|
+
path: urlPath,
|
|
55
|
+
method: 'GET',
|
|
56
|
+
headers: headerParameters,
|
|
57
|
+
query: queryParameters,
|
|
58
|
+
}, initOverrides);
|
|
59
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedLearningMomentsFromJSON(jsonValue));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns paginated learning moments belonging to the authenticated account user, ordered by creation date (newest first).
|
|
64
|
+
* List learning moments
|
|
65
|
+
*/
|
|
66
|
+
listLearningMoments(requestParameters, initOverrides) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const response = yield this.listLearningMomentsRaw(requestParameters, initOverrides);
|
|
69
|
+
return yield response.value();
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -10,17 +10,36 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { PaginatedMessages } from '../models/index';
|
|
13
|
+
import type { Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
14
|
+
export interface GetChatMessageRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
messageId: string;
|
|
18
|
+
}
|
|
14
19
|
export interface GetChatMessagesRequest {
|
|
15
20
|
xUserId: string;
|
|
16
21
|
chatId: string;
|
|
17
22
|
limit?: number;
|
|
18
23
|
cursor?: string;
|
|
19
24
|
}
|
|
25
|
+
export interface GetMessageCountRequest {
|
|
26
|
+
xUserId: string;
|
|
27
|
+
hours: number;
|
|
28
|
+
}
|
|
20
29
|
/**
|
|
21
30
|
*
|
|
22
31
|
*/
|
|
23
32
|
export declare class MessagesApi extends runtime.BaseAPI {
|
|
33
|
+
/**
|
|
34
|
+
* Returns a single message belonging to the specified chat.
|
|
35
|
+
* Get a chat message
|
|
36
|
+
*/
|
|
37
|
+
getChatMessageRaw(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Message>>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns a single message belonging to the specified chat.
|
|
40
|
+
* Get a chat message
|
|
41
|
+
*/
|
|
42
|
+
getChatMessage(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Message>;
|
|
24
43
|
/**
|
|
25
44
|
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
26
45
|
* List chat messages
|
|
@@ -31,4 +50,14 @@ export declare class MessagesApi extends runtime.BaseAPI {
|
|
|
31
50
|
* List chat messages
|
|
32
51
|
*/
|
|
33
52
|
getChatMessages(requestParameters: GetChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedMessages>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
55
|
+
* Count user messages
|
|
56
|
+
*/
|
|
57
|
+
getMessageCountRaw(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageCountResponse>>;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
60
|
+
* Count user messages
|
|
61
|
+
*/
|
|
62
|
+
getMessageCount(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageCountResponse>;
|
|
34
63
|
}
|