@instructure/athena-api-client 1.0.1 → 1.0.3
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 +10 -0
- package/dist/apis/ChatsApi.d.ts +15 -0
- package/dist/apis/ChatsApi.js +44 -0
- package/dist/apis/LearningDaysApi.d.ts +33 -0
- package/dist/apis/LearningDaysApi.js +82 -0
- package/dist/apis/LearningMomentsApi.d.ts +33 -0
- package/dist/apis/LearningMomentsApi.js +76 -0
- package/dist/apis/MessagesApi.d.ts +45 -1
- package/dist/apis/MessagesApi.js +134 -0
- package/dist/apis/index.d.ts +2 -0
- package/dist/apis/index.js +2 -0
- package/dist/esm/apis/ChatsApi.d.ts +15 -0
- package/dist/esm/apis/ChatsApi.js +44 -0
- package/dist/esm/apis/LearningDaysApi.d.ts +33 -0
- package/dist/esm/apis/LearningDaysApi.js +78 -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 +45 -1
- package/dist/esm/apis/MessagesApi.js +135 -1
- package/dist/esm/apis/index.d.ts +2 -0
- package/dist/esm/apis/index.js +2 -0
- package/dist/esm/models/Account.d.ts +6 -0
- package/dist/esm/models/Account.js +2 -0
- package/dist/esm/models/LearningDaysResponse.d.ts +38 -0
- package/dist/esm/models/LearningDaysResponse.js +47 -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 +4 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/models/Account.d.ts +6 -0
- package/dist/models/Account.js +2 -0
- package/dist/models/LearningDaysResponse.d.ts +38 -0
- package/dist/models/LearningDaysResponse.js +54 -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 +4 -0
- package/dist/models/index.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,10 +60,16 @@ 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
|
+
*LearningDaysApi* | [**getLearningDays**](docs/LearningDaysApi.md#getlearningdays) | **GET** /api/v1/learning-days | Get learning days in range
|
|
68
|
+
*LearningMomentsApi* | [**listLearningMoments**](docs/LearningMomentsApi.md#listlearningmoments) | **GET** /api/v1/learning-moments | List learning moments
|
|
69
|
+
*MessagesApi* | [**deleteMessages**](docs/MessagesApi.md#deletemessages) | **DELETE** /api/v1/chats/{chatId}/messages | Delete messages from timestamp
|
|
70
|
+
*MessagesApi* | [**getChatMessage**](docs/MessagesApi.md#getchatmessage) | **GET** /api/v1/chats/{chatId}/messages/{messageId} | Get a chat message
|
|
66
71
|
*MessagesApi* | [**getChatMessages**](docs/MessagesApi.md#getchatmessages) | **GET** /api/v1/chats/{chatId}/messages | List chat messages
|
|
72
|
+
*MessagesApi* | [**getMessageCount**](docs/MessagesApi.md#getmessagecount) | **GET** /api/v1/messages/count | Count user messages
|
|
67
73
|
*ServiceTokensApi* | [**createServiceToken**](docs/ServiceTokensApi.md#createservicetoken) | **POST** /api/v1/tokens | Create a new service token
|
|
68
74
|
*ServiceTokensApi* | [**deleteServiceToken**](docs/ServiceTokensApi.md#deleteservicetoken) | **DELETE** /api/v1/tokens/{id} | Delete service token
|
|
69
75
|
*ServiceTokensApi* | [**getServiceToken**](docs/ServiceTokensApi.md#getservicetoken) | **GET** /api/v1/tokens/{id} | Get service token by ID
|
|
@@ -82,10 +88,14 @@ All URIs are relative to *http://localhost:3000*
|
|
|
82
88
|
- [CreateTokenRequest](docs/CreateTokenRequest.md)
|
|
83
89
|
- [CreateTokenResponse](docs/CreateTokenResponse.md)
|
|
84
90
|
- [HealthCheck](docs/HealthCheck.md)
|
|
91
|
+
- [LearningDaysResponse](docs/LearningDaysResponse.md)
|
|
92
|
+
- [LearningMoment](docs/LearningMoment.md)
|
|
85
93
|
- [Message](docs/Message.md)
|
|
94
|
+
- [MessageCountResponse](docs/MessageCountResponse.md)
|
|
86
95
|
- [MessagePartsInner](docs/MessagePartsInner.md)
|
|
87
96
|
- [ModelError](docs/ModelError.md)
|
|
88
97
|
- [PaginatedChats](docs/PaginatedChats.md)
|
|
98
|
+
- [PaginatedLearningMoments](docs/PaginatedLearningMoments.md)
|
|
89
99
|
- [PaginatedMessages](docs/PaginatedMessages.md)
|
|
90
100
|
- [ServiceToken](docs/ServiceToken.md)
|
|
91
101
|
- [Tag](docs/Tag.md)
|
package/dist/apis/ChatsApi.d.ts
CHANGED
|
@@ -28,9 +28,14 @@ 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;
|
|
38
|
+
xUserTimezone?: string;
|
|
34
39
|
xCanvasToken?: string;
|
|
35
40
|
}
|
|
36
41
|
export interface UpdateChatOperationRequest {
|
|
@@ -82,6 +87,16 @@ export declare class ChatsApi extends runtime.BaseAPI {
|
|
|
82
87
|
* List chats
|
|
83
88
|
*/
|
|
84
89
|
listChats(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedChats>;
|
|
90
|
+
/**
|
|
91
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
92
|
+
* Mark chat as viewed
|
|
93
|
+
*/
|
|
94
|
+
markChatAsViewedRaw(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
|
|
95
|
+
/**
|
|
96
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
97
|
+
* Mark chat as viewed
|
|
98
|
+
*/
|
|
99
|
+
markChatAsViewed(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
|
|
85
100
|
/**
|
|
86
101
|
* 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
102
|
* 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
|
|
@@ -207,6 +248,9 @@ class ChatsApi extends runtime.BaseAPI {
|
|
|
207
248
|
const queryParameters = {};
|
|
208
249
|
const headerParameters = {};
|
|
209
250
|
headerParameters['Content-Type'] = 'application/json';
|
|
251
|
+
if (requestParameters['xUserTimezone'] != null) {
|
|
252
|
+
headerParameters['X-User-Timezone'] = String(requestParameters['xUserTimezone']);
|
|
253
|
+
}
|
|
210
254
|
if (requestParameters['xCanvasToken'] != null) {
|
|
211
255
|
headerParameters['X-Canvas-Token'] = String(requestParameters['xCanvasToken']);
|
|
212
256
|
}
|
|
@@ -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 { LearningDaysResponse } from '../models/index';
|
|
14
|
+
export interface GetLearningDaysRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
startDate: Date;
|
|
17
|
+
endDate: Date;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export declare class LearningDaysApi extends runtime.BaseAPI {
|
|
23
|
+
/**
|
|
24
|
+
* Returns distinct dates within the given range on which the user had at least one learning moment, plus the date of their most recent learning moment overall.
|
|
25
|
+
* Get learning days in range
|
|
26
|
+
*/
|
|
27
|
+
getLearningDaysRaw(requestParameters: GetLearningDaysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LearningDaysResponse>>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns distinct dates within the given range on which the user had at least one learning moment, plus the date of their most recent learning moment overall.
|
|
30
|
+
* Get learning days in range
|
|
31
|
+
*/
|
|
32
|
+
getLearningDays(requestParameters: GetLearningDaysRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LearningDaysResponse>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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.LearningDaysApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class LearningDaysApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns distinct dates within the given range on which the user had at least one learning moment, plus the date of their most recent learning moment overall.
|
|
34
|
+
* Get learning days in range
|
|
35
|
+
*/
|
|
36
|
+
getLearningDaysRaw(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 getLearningDays().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['startDate'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('startDate', 'Required parameter "startDate" was null or undefined when calling getLearningDays().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['endDate'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('endDate', 'Required parameter "endDate" was null or undefined when calling getLearningDays().');
|
|
46
|
+
}
|
|
47
|
+
const queryParameters = {};
|
|
48
|
+
if (requestParameters['startDate'] != null) {
|
|
49
|
+
queryParameters['startDate'] = requestParameters['startDate'].toISOString().substring(0, 10);
|
|
50
|
+
}
|
|
51
|
+
if (requestParameters['endDate'] != null) {
|
|
52
|
+
queryParameters['endDate'] = requestParameters['endDate'].toISOString().substring(0, 10);
|
|
53
|
+
}
|
|
54
|
+
const headerParameters = {};
|
|
55
|
+
if (requestParameters['xUserId'] != null) {
|
|
56
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
57
|
+
}
|
|
58
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
59
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
60
|
+
}
|
|
61
|
+
let urlPath = `/api/v1/learning-days`;
|
|
62
|
+
const response = yield this.request({
|
|
63
|
+
path: urlPath,
|
|
64
|
+
method: 'GET',
|
|
65
|
+
headers: headerParameters,
|
|
66
|
+
query: queryParameters,
|
|
67
|
+
}, initOverrides);
|
|
68
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LearningDaysResponseFromJSON)(jsonValue));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Returns distinct dates within the given range on which the user had at least one learning moment, plus the date of their most recent learning moment overall.
|
|
73
|
+
* Get learning days in range
|
|
74
|
+
*/
|
|
75
|
+
getLearningDays(requestParameters, initOverrides) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const response = yield this.getLearningDaysRaw(requestParameters, initOverrides);
|
|
78
|
+
return yield response.value();
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.LearningDaysApi = LearningDaysApi;
|
|
@@ -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,51 @@
|
|
|
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 DeleteMessagesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
since: Date;
|
|
18
|
+
}
|
|
19
|
+
export interface GetChatMessageRequest {
|
|
20
|
+
xUserId: string;
|
|
21
|
+
chatId: string;
|
|
22
|
+
messageId: string;
|
|
23
|
+
}
|
|
14
24
|
export interface GetChatMessagesRequest {
|
|
15
25
|
xUserId: string;
|
|
16
26
|
chatId: string;
|
|
17
27
|
limit?: number;
|
|
18
28
|
cursor?: string;
|
|
19
29
|
}
|
|
30
|
+
export interface GetMessageCountRequest {
|
|
31
|
+
xUserId: string;
|
|
32
|
+
hours: number;
|
|
33
|
+
}
|
|
20
34
|
/**
|
|
21
35
|
*
|
|
22
36
|
*/
|
|
23
37
|
export declare class MessagesApi extends runtime.BaseAPI {
|
|
38
|
+
/**
|
|
39
|
+
* Deletes all messages in a chat at or after the given timestamp.
|
|
40
|
+
* Delete messages from timestamp
|
|
41
|
+
*/
|
|
42
|
+
deleteMessagesRaw(requestParameters: DeleteMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
43
|
+
/**
|
|
44
|
+
* Deletes all messages in a chat at or after the given timestamp.
|
|
45
|
+
* Delete messages from timestamp
|
|
46
|
+
*/
|
|
47
|
+
deleteMessages(requestParameters: DeleteMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a single message belonging to the specified chat.
|
|
50
|
+
* Get a chat message
|
|
51
|
+
*/
|
|
52
|
+
getChatMessageRaw(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Message>>;
|
|
53
|
+
/**
|
|
54
|
+
* Returns a single message belonging to the specified chat.
|
|
55
|
+
* Get a chat message
|
|
56
|
+
*/
|
|
57
|
+
getChatMessage(requestParameters: GetChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Message>;
|
|
24
58
|
/**
|
|
25
59
|
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
26
60
|
* List chat messages
|
|
@@ -31,4 +65,14 @@ export declare class MessagesApi extends runtime.BaseAPI {
|
|
|
31
65
|
* List chat messages
|
|
32
66
|
*/
|
|
33
67
|
getChatMessages(requestParameters: GetChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedMessages>;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
70
|
+
* Count user messages
|
|
71
|
+
*/
|
|
72
|
+
getMessageCountRaw(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MessageCountResponse>>;
|
|
73
|
+
/**
|
|
74
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
75
|
+
* Count user messages
|
|
76
|
+
*/
|
|
77
|
+
getMessageCount(requestParameters: GetMessageCountRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MessageCountResponse>;
|
|
34
78
|
}
|
package/dist/apis/MessagesApi.js
CHANGED
|
@@ -29,6 +29,97 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class MessagesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Deletes all messages in a chat at or after the given timestamp.
|
|
34
|
+
* Delete messages from timestamp
|
|
35
|
+
*/
|
|
36
|
+
deleteMessagesRaw(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 deleteMessages().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['chatId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling deleteMessages().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['since'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('since', 'Required parameter "since" was null or undefined when calling deleteMessages().');
|
|
46
|
+
}
|
|
47
|
+
const queryParameters = {};
|
|
48
|
+
if (requestParameters['since'] != null) {
|
|
49
|
+
queryParameters['since'] = requestParameters['since'].toISOString();
|
|
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: 'DELETE',
|
|
63
|
+
headers: headerParameters,
|
|
64
|
+
query: queryParameters,
|
|
65
|
+
}, initOverrides);
|
|
66
|
+
return new runtime.VoidApiResponse(response);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Deletes all messages in a chat at or after the given timestamp.
|
|
71
|
+
* Delete messages from timestamp
|
|
72
|
+
*/
|
|
73
|
+
deleteMessages(requestParameters, initOverrides) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
yield this.deleteMessagesRaw(requestParameters, initOverrides);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Returns a single message belonging to the specified chat.
|
|
80
|
+
* Get a chat message
|
|
81
|
+
*/
|
|
82
|
+
getChatMessageRaw(requestParameters, initOverrides) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
if (requestParameters['xUserId'] == null) {
|
|
85
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getChatMessage().');
|
|
86
|
+
}
|
|
87
|
+
if (requestParameters['chatId'] == null) {
|
|
88
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling getChatMessage().');
|
|
89
|
+
}
|
|
90
|
+
if (requestParameters['messageId'] == null) {
|
|
91
|
+
throw new runtime.RequiredError('messageId', 'Required parameter "messageId" was null or undefined when calling getChatMessage().');
|
|
92
|
+
}
|
|
93
|
+
const queryParameters = {};
|
|
94
|
+
const headerParameters = {};
|
|
95
|
+
if (requestParameters['xUserId'] != null) {
|
|
96
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
97
|
+
}
|
|
98
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
99
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
100
|
+
}
|
|
101
|
+
let urlPath = `/api/v1/chats/{chatId}/messages/{messageId}`;
|
|
102
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
103
|
+
urlPath = urlPath.replace(`{${"messageId"}}`, encodeURIComponent(String(requestParameters['messageId'])));
|
|
104
|
+
const response = yield this.request({
|
|
105
|
+
path: urlPath,
|
|
106
|
+
method: 'GET',
|
|
107
|
+
headers: headerParameters,
|
|
108
|
+
query: queryParameters,
|
|
109
|
+
}, initOverrides);
|
|
110
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MessageFromJSON)(jsonValue));
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Returns a single message belonging to the specified chat.
|
|
115
|
+
* Get a chat message
|
|
116
|
+
*/
|
|
117
|
+
getChatMessage(requestParameters, initOverrides) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
119
|
+
const response = yield this.getChatMessageRaw(requestParameters, initOverrides);
|
|
120
|
+
return yield response.value();
|
|
121
|
+
});
|
|
122
|
+
}
|
|
32
123
|
/**
|
|
33
124
|
* Returns paginated messages belonging to the specified chat, ordered by creation date (newest first).
|
|
34
125
|
* List chat messages
|
|
@@ -76,5 +167,48 @@ class MessagesApi extends runtime.BaseAPI {
|
|
|
76
167
|
return yield response.value();
|
|
77
168
|
});
|
|
78
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
172
|
+
* Count user messages
|
|
173
|
+
*/
|
|
174
|
+
getMessageCountRaw(requestParameters, initOverrides) {
|
|
175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
if (requestParameters['xUserId'] == null) {
|
|
177
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling getMessageCount().');
|
|
178
|
+
}
|
|
179
|
+
if (requestParameters['hours'] == null) {
|
|
180
|
+
throw new runtime.RequiredError('hours', 'Required parameter "hours" was null or undefined when calling getMessageCount().');
|
|
181
|
+
}
|
|
182
|
+
const queryParameters = {};
|
|
183
|
+
if (requestParameters['hours'] != null) {
|
|
184
|
+
queryParameters['hours'] = requestParameters['hours'];
|
|
185
|
+
}
|
|
186
|
+
const headerParameters = {};
|
|
187
|
+
if (requestParameters['xUserId'] != null) {
|
|
188
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
189
|
+
}
|
|
190
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
191
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
192
|
+
}
|
|
193
|
+
let urlPath = `/api/v1/messages/count`;
|
|
194
|
+
const response = yield this.request({
|
|
195
|
+
path: urlPath,
|
|
196
|
+
method: 'GET',
|
|
197
|
+
headers: headerParameters,
|
|
198
|
+
query: queryParameters,
|
|
199
|
+
}, initOverrides);
|
|
200
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.MessageCountResponseFromJSON)(jsonValue));
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Returns the number of user-role messages sent by the authenticated account user within the given time window.
|
|
205
|
+
* Count user messages
|
|
206
|
+
*/
|
|
207
|
+
getMessageCount(requestParameters, initOverrides) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
209
|
+
const response = yield this.getMessageCountRaw(requestParameters, initOverrides);
|
|
210
|
+
return yield response.value();
|
|
211
|
+
});
|
|
212
|
+
}
|
|
79
213
|
}
|
|
80
214
|
exports.MessagesApi = MessagesApi;
|
package/dist/apis/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './AccountsApi';
|
|
2
2
|
export * from './ChatsApi';
|
|
3
3
|
export * from './HealthApi';
|
|
4
|
+
export * from './LearningDaysApi';
|
|
5
|
+
export * from './LearningMomentsApi';
|
|
4
6
|
export * from './MessagesApi';
|
|
5
7
|
export * from './ServiceTokensApi';
|
|
6
8
|
export * from './TagsApi';
|
package/dist/apis/index.js
CHANGED
|
@@ -19,6 +19,8 @@ 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("./LearningDaysApi"), exports);
|
|
23
|
+
__exportStar(require("./LearningMomentsApi"), exports);
|
|
22
24
|
__exportStar(require("./MessagesApi"), exports);
|
|
23
25
|
__exportStar(require("./ServiceTokensApi"), exports);
|
|
24
26
|
__exportStar(require("./TagsApi"), exports);
|
|
@@ -28,9 +28,14 @@ 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;
|
|
38
|
+
xUserTimezone?: string;
|
|
34
39
|
xCanvasToken?: string;
|
|
35
40
|
}
|
|
36
41
|
export interface UpdateChatOperationRequest {
|
|
@@ -82,6 +87,16 @@ export declare class ChatsApi extends runtime.BaseAPI {
|
|
|
82
87
|
* List chats
|
|
83
88
|
*/
|
|
84
89
|
listChats(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedChats>;
|
|
90
|
+
/**
|
|
91
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
92
|
+
* Mark chat as viewed
|
|
93
|
+
*/
|
|
94
|
+
markChatAsViewedRaw(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
|
|
95
|
+
/**
|
|
96
|
+
* Updates the lastViewedAt timestamp for a chat belonging to the authenticated account user.
|
|
97
|
+
* Mark chat as viewed
|
|
98
|
+
*/
|
|
99
|
+
markChatAsViewed(requestParameters: MarkChatAsViewedRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
|
|
85
100
|
/**
|
|
86
101
|
* 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
102
|
* Send a message to a chat
|