@instructure/athena-api-client 1.0.8 → 1.0.10
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 +9 -1
- package/dist/apis/HealthApi.d.ts +2 -5
- package/dist/apis/HealthApi.js +2 -6
- package/dist/apis/MessagesApi.d.ts +16 -1
- package/dist/apis/MessagesApi.js +46 -0
- package/dist/apis/VotesApi.d.ts +47 -0
- package/dist/apis/VotesApi.js +120 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/HealthApi.d.ts +2 -5
- package/dist/esm/apis/HealthApi.js +2 -6
- package/dist/esm/apis/MessagesApi.d.ts +16 -1
- package/dist/esm/apis/MessagesApi.js +47 -1
- package/dist/esm/apis/VotesApi.d.ts +47 -0
- package/dist/esm/apis/VotesApi.js +116 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/CreateChatMessages201Response.d.ts +33 -0
- package/dist/esm/models/CreateChatMessages201Response.js +42 -0
- package/dist/esm/models/CreateMessagesRequest.d.ts +33 -0
- package/dist/esm/models/CreateMessagesRequest.js +44 -0
- package/dist/esm/models/CreateMessagesRequestMessagesInner.d.ts +64 -0
- package/dist/esm/models/CreateMessagesRequestMessagesInner.js +62 -0
- package/dist/esm/models/ListChatVotes200Response.d.ts +33 -0
- package/dist/esm/models/ListChatVotes200Response.js +42 -0
- package/dist/esm/models/Message.d.ts +1 -1
- package/dist/esm/models/Message.js +1 -3
- package/dist/esm/models/UpsertVoteRequest.d.ts +46 -0
- package/dist/esm/models/UpsertVoteRequest.js +54 -0
- package/dist/esm/models/Vote.d.ts +44 -0
- package/dist/esm/models/Vote.js +51 -0
- package/dist/esm/models/index.d.ts +6 -1
- package/dist/esm/models/index.js +6 -1
- package/dist/models/CreateChatMessages201Response.d.ts +33 -0
- package/dist/models/CreateChatMessages201Response.js +49 -0
- package/dist/models/CreateMessagesRequest.d.ts +33 -0
- package/dist/models/CreateMessagesRequest.js +51 -0
- package/dist/models/CreateMessagesRequestMessagesInner.d.ts +64 -0
- package/dist/models/CreateMessagesRequestMessagesInner.js +70 -0
- package/dist/models/ListChatVotes200Response.d.ts +33 -0
- package/dist/models/ListChatVotes200Response.js +49 -0
- package/dist/models/Message.d.ts +1 -1
- package/dist/models/Message.js +1 -3
- package/dist/models/UpsertVoteRequest.d.ts +46 -0
- package/dist/models/UpsertVoteRequest.js +62 -0
- package/dist/models/Vote.d.ts +44 -0
- package/dist/models/Vote.js +58 -0
- package/dist/models/index.d.ts +6 -1
- package/dist/models/index.js +6 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ All URIs are relative to *http://localhost:3000*
|
|
|
68
68
|
*LearningDaysApi* | [**getLearningDays**](docs/LearningDaysApi.md#getlearningdays) | **GET** /api/v1/learning-days | Get learning days in range
|
|
69
69
|
*LearningMomentsApi* | [**listLearningMoments**](docs/LearningMomentsApi.md#listlearningmoments) | **GET** /api/v1/learning-moments | List learning moments
|
|
70
70
|
*LearningStreakApi* | [**getLearningStreak**](docs/LearningStreakApi.md#getlearningstreak) | **GET** /api/v1/learning-streak | Get learning streak
|
|
71
|
+
*MessagesApi* | [**createChatMessages**](docs/MessagesApi.md#createchatmessages) | **POST** /api/v1/chats/{chatId}/messages | Save messages to a chat
|
|
71
72
|
*MessagesApi* | [**deleteMessages**](docs/MessagesApi.md#deletemessages) | **DELETE** /api/v1/chats/{chatId}/messages | Delete messages from timestamp
|
|
72
73
|
*MessagesApi* | [**getChatMessage**](docs/MessagesApi.md#getchatmessage) | **GET** /api/v1/chats/{chatId}/messages/{messageId} | Get a chat message
|
|
73
74
|
*MessagesApi* | [**getChatMessages**](docs/MessagesApi.md#getchatmessages) | **GET** /api/v1/chats/{chatId}/messages | List chat messages
|
|
@@ -83,6 +84,8 @@ All URIs are relative to *http://localhost:3000*
|
|
|
83
84
|
*ServiceTokensApi* | [**listServiceTokens**](docs/ServiceTokensApi.md#listservicetokens) | **GET** /api/v1/tokens | List all service tokens
|
|
84
85
|
*ServiceTokensApi* | [**updateServiceToken**](docs/ServiceTokensApi.md#updateservicetoken) | **PATCH** /api/v1/tokens/{id} | Update service token status
|
|
85
86
|
*TagsApi* | [**listTags**](docs/TagsApi.md#listtags) | **GET** /api/v1/tags | List all tags
|
|
87
|
+
*VotesApi* | [**listChatVotes**](docs/VotesApi.md#listchatvotes) | **GET** /api/v1/chats/{chatId}/votes | List votes for a chat
|
|
88
|
+
*VotesApi* | [**upsertChatVote**](docs/VotesApi.md#upsertchatvote) | **PATCH** /api/v1/chats/{chatId}/votes | Create or update a vote
|
|
86
89
|
|
|
87
90
|
|
|
88
91
|
### Models
|
|
@@ -92,13 +95,16 @@ All URIs are relative to *http://localhost:3000*
|
|
|
92
95
|
- [ChatRequest](docs/ChatRequest.md)
|
|
93
96
|
- [ChatRequestAttachmentsInner](docs/ChatRequestAttachmentsInner.md)
|
|
94
97
|
- [CreateAccountRequest](docs/CreateAccountRequest.md)
|
|
98
|
+
- [CreateChatMessages201Response](docs/CreateChatMessages201Response.md)
|
|
95
99
|
- [CreateChatRequest](docs/CreateChatRequest.md)
|
|
100
|
+
- [CreateMessagesRequest](docs/CreateMessagesRequest.md)
|
|
101
|
+
- [CreateMessagesRequestMessagesInner](docs/CreateMessagesRequestMessagesInner.md)
|
|
96
102
|
- [CreateTokenRequest](docs/CreateTokenRequest.md)
|
|
97
103
|
- [CreateTokenResponse](docs/CreateTokenResponse.md)
|
|
98
|
-
- [HealthCheck](docs/HealthCheck.md)
|
|
99
104
|
- [LearningDaysResponse](docs/LearningDaysResponse.md)
|
|
100
105
|
- [LearningMoment](docs/LearningMoment.md)
|
|
101
106
|
- [LearningStreakResponse](docs/LearningStreakResponse.md)
|
|
107
|
+
- [ListChatVotes200Response](docs/ListChatVotes200Response.md)
|
|
102
108
|
- [Message](docs/Message.md)
|
|
103
109
|
- [MessageAttachmentsInner](docs/MessageAttachmentsInner.md)
|
|
104
110
|
- [MessageCountResponse](docs/MessageCountResponse.md)
|
|
@@ -126,6 +132,8 @@ All URIs are relative to *http://localhost:3000*
|
|
|
126
132
|
- [UploadUrlRequestFilesInner](docs/UploadUrlRequestFilesInner.md)
|
|
127
133
|
- [UploadUrlResponse](docs/UploadUrlResponse.md)
|
|
128
134
|
- [UploadUrlResponseFilesInner](docs/UploadUrlResponseFilesInner.md)
|
|
135
|
+
- [UpsertVoteRequest](docs/UpsertVoteRequest.md)
|
|
136
|
+
- [Vote](docs/Vote.md)
|
|
129
137
|
|
|
130
138
|
### Authorization
|
|
131
139
|
|
package/dist/apis/HealthApi.d.ts
CHANGED
|
@@ -10,19 +10,16 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { HealthCheck } from '../models/index';
|
|
14
13
|
/**
|
|
15
14
|
*
|
|
16
15
|
*/
|
|
17
16
|
export declare class HealthApi extends runtime.BaseAPI {
|
|
18
17
|
/**
|
|
19
|
-
* Returns the health status of the API server
|
|
20
18
|
* Health check endpoint
|
|
21
19
|
*/
|
|
22
|
-
healthCheckRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
20
|
+
healthCheckRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
23
21
|
/**
|
|
24
|
-
* Returns the health status of the API server
|
|
25
22
|
* Health check endpoint
|
|
26
23
|
*/
|
|
27
|
-
healthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
24
|
+
healthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
28
25
|
}
|
package/dist/apis/HealthApi.js
CHANGED
|
@@ -24,13 +24,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.HealthApi = void 0;
|
|
26
26
|
const runtime = require("../runtime");
|
|
27
|
-
const index_1 = require("../models/index");
|
|
28
27
|
/**
|
|
29
28
|
*
|
|
30
29
|
*/
|
|
31
30
|
class HealthApi extends runtime.BaseAPI {
|
|
32
31
|
/**
|
|
33
|
-
* Returns the health status of the API server
|
|
34
32
|
* Health check endpoint
|
|
35
33
|
*/
|
|
36
34
|
healthCheckRaw(initOverrides) {
|
|
@@ -44,17 +42,15 @@ class HealthApi extends runtime.BaseAPI {
|
|
|
44
42
|
headers: headerParameters,
|
|
45
43
|
query: queryParameters,
|
|
46
44
|
}, initOverrides);
|
|
47
|
-
return new runtime.
|
|
45
|
+
return new runtime.VoidApiResponse(response);
|
|
48
46
|
});
|
|
49
47
|
}
|
|
50
48
|
/**
|
|
51
|
-
* Returns the health status of the API server
|
|
52
49
|
* Health check endpoint
|
|
53
50
|
*/
|
|
54
51
|
healthCheck(initOverrides) {
|
|
55
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
|
|
57
|
-
return yield response.value();
|
|
53
|
+
yield this.healthCheckRaw(initOverrides);
|
|
58
54
|
});
|
|
59
55
|
}
|
|
60
56
|
}
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
13
|
+
import type { CreateChatMessages201Response, CreateMessagesRequest, Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
14
|
+
export interface CreateChatMessagesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
createMessagesRequest: CreateMessagesRequest;
|
|
18
|
+
}
|
|
14
19
|
export interface DeleteMessagesRequest {
|
|
15
20
|
xUserId: string;
|
|
16
21
|
chatId: string;
|
|
@@ -35,6 +40,16 @@ export interface GetMessageCountRequest {
|
|
|
35
40
|
*
|
|
36
41
|
*/
|
|
37
42
|
export declare class MessagesApi extends runtime.BaseAPI {
|
|
43
|
+
/**
|
|
44
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
45
|
+
* Save messages to a chat
|
|
46
|
+
*/
|
|
47
|
+
createChatMessagesRaw(requestParameters: CreateChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateChatMessages201Response>>;
|
|
48
|
+
/**
|
|
49
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
50
|
+
* Save messages to a chat
|
|
51
|
+
*/
|
|
52
|
+
createChatMessages(requestParameters: CreateChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateChatMessages201Response>;
|
|
38
53
|
/**
|
|
39
54
|
* Deletes all messages in a chat at or after the given timestamp.
|
|
40
55
|
* Delete messages from timestamp
|
package/dist/apis/MessagesApi.js
CHANGED
|
@@ -29,6 +29,52 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class MessagesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
34
|
+
* Save messages to a chat
|
|
35
|
+
*/
|
|
36
|
+
createChatMessagesRaw(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 createChatMessages().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['chatId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling createChatMessages().');
|
|
43
|
+
}
|
|
44
|
+
if (requestParameters['createMessagesRequest'] == null) {
|
|
45
|
+
throw new runtime.RequiredError('createMessagesRequest', 'Required parameter "createMessagesRequest" was null or undefined when calling createChatMessages().');
|
|
46
|
+
}
|
|
47
|
+
const queryParameters = {};
|
|
48
|
+
const headerParameters = {};
|
|
49
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
50
|
+
if (requestParameters['xUserId'] != null) {
|
|
51
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
52
|
+
}
|
|
53
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
54
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
55
|
+
}
|
|
56
|
+
let urlPath = `/api/v1/chats/{chatId}/messages`;
|
|
57
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
58
|
+
const response = yield this.request({
|
|
59
|
+
path: urlPath,
|
|
60
|
+
method: 'POST',
|
|
61
|
+
headers: headerParameters,
|
|
62
|
+
query: queryParameters,
|
|
63
|
+
body: (0, index_1.CreateMessagesRequestToJSON)(requestParameters['createMessagesRequest']),
|
|
64
|
+
}, initOverrides);
|
|
65
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateChatMessages201ResponseFromJSON)(jsonValue));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
70
|
+
* Save messages to a chat
|
|
71
|
+
*/
|
|
72
|
+
createChatMessages(requestParameters, initOverrides) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const response = yield this.createChatMessagesRaw(requestParameters, initOverrides);
|
|
75
|
+
return yield response.value();
|
|
76
|
+
});
|
|
77
|
+
}
|
|
32
78
|
/**
|
|
33
79
|
* Deletes all messages in a chat at or after the given timestamp.
|
|
34
80
|
* Delete messages from timestamp
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { ListChatVotes200Response, UpsertVoteRequest, Vote } from '../models/index';
|
|
14
|
+
export interface ListChatVotesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UpsertChatVoteRequest {
|
|
19
|
+
xUserId: string;
|
|
20
|
+
chatId: string;
|
|
21
|
+
upsertVoteRequest: UpsertVoteRequest;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare class VotesApi extends runtime.BaseAPI {
|
|
27
|
+
/**
|
|
28
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
29
|
+
* List votes for a chat
|
|
30
|
+
*/
|
|
31
|
+
listChatVotesRaw(requestParameters: ListChatVotesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListChatVotes200Response>>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
34
|
+
* List votes for a chat
|
|
35
|
+
*/
|
|
36
|
+
listChatVotes(requestParameters: ListChatVotesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListChatVotes200Response>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
39
|
+
* Create or update a vote
|
|
40
|
+
*/
|
|
41
|
+
upsertChatVoteRaw(requestParameters: UpsertChatVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vote>>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
44
|
+
* Create or update a vote
|
|
45
|
+
*/
|
|
46
|
+
upsertChatVote(requestParameters: UpsertChatVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vote>;
|
|
47
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
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.VotesApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const index_1 = require("../models/index");
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
class VotesApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
34
|
+
* List votes for a chat
|
|
35
|
+
*/
|
|
36
|
+
listChatVotesRaw(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 listChatVotes().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['chatId'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling listChatVotes().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
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/chats/{chatId}/votes`;
|
|
53
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
54
|
+
const response = yield this.request({
|
|
55
|
+
path: urlPath,
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: headerParameters,
|
|
58
|
+
query: queryParameters,
|
|
59
|
+
}, initOverrides);
|
|
60
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ListChatVotes200ResponseFromJSON)(jsonValue));
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
65
|
+
* List votes for a chat
|
|
66
|
+
*/
|
|
67
|
+
listChatVotes(requestParameters, initOverrides) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const response = yield this.listChatVotesRaw(requestParameters, initOverrides);
|
|
70
|
+
return yield response.value();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
75
|
+
* Create or update a vote
|
|
76
|
+
*/
|
|
77
|
+
upsertChatVoteRaw(requestParameters, initOverrides) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
if (requestParameters['xUserId'] == null) {
|
|
80
|
+
throw new runtime.RequiredError('xUserId', 'Required parameter "xUserId" was null or undefined when calling upsertChatVote().');
|
|
81
|
+
}
|
|
82
|
+
if (requestParameters['chatId'] == null) {
|
|
83
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling upsertChatVote().');
|
|
84
|
+
}
|
|
85
|
+
if (requestParameters['upsertVoteRequest'] == null) {
|
|
86
|
+
throw new runtime.RequiredError('upsertVoteRequest', 'Required parameter "upsertVoteRequest" was null or undefined when calling upsertChatVote().');
|
|
87
|
+
}
|
|
88
|
+
const queryParameters = {};
|
|
89
|
+
const headerParameters = {};
|
|
90
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
91
|
+
if (requestParameters['xUserId'] != null) {
|
|
92
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
93
|
+
}
|
|
94
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
95
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
96
|
+
}
|
|
97
|
+
let urlPath = `/api/v1/chats/{chatId}/votes`;
|
|
98
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
99
|
+
const response = yield this.request({
|
|
100
|
+
path: urlPath,
|
|
101
|
+
method: 'PATCH',
|
|
102
|
+
headers: headerParameters,
|
|
103
|
+
query: queryParameters,
|
|
104
|
+
body: (0, index_1.UpsertVoteRequestToJSON)(requestParameters['upsertVoteRequest']),
|
|
105
|
+
}, initOverrides);
|
|
106
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.VoteFromJSON)(jsonValue));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
111
|
+
* Create or update a vote
|
|
112
|
+
*/
|
|
113
|
+
upsertChatVote(requestParameters, initOverrides) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const response = yield this.upsertChatVoteRaw(requestParameters, initOverrides);
|
|
116
|
+
return yield response.value();
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.VotesApi = VotesApi;
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -10,19 +10,16 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { HealthCheck } from '../models/index';
|
|
14
13
|
/**
|
|
15
14
|
*
|
|
16
15
|
*/
|
|
17
16
|
export declare class HealthApi extends runtime.BaseAPI {
|
|
18
17
|
/**
|
|
19
|
-
* Returns the health status of the API server
|
|
20
18
|
* Health check endpoint
|
|
21
19
|
*/
|
|
22
|
-
healthCheckRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
20
|
+
healthCheckRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
23
21
|
/**
|
|
24
|
-
* Returns the health status of the API server
|
|
25
22
|
* Health check endpoint
|
|
26
23
|
*/
|
|
27
|
-
healthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
24
|
+
healthCheck(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
28
25
|
}
|
|
@@ -21,13 +21,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { HealthCheckFromJSON, } from '../models/index';
|
|
25
24
|
/**
|
|
26
25
|
*
|
|
27
26
|
*/
|
|
28
27
|
export class HealthApi extends runtime.BaseAPI {
|
|
29
28
|
/**
|
|
30
|
-
* Returns the health status of the API server
|
|
31
29
|
* Health check endpoint
|
|
32
30
|
*/
|
|
33
31
|
healthCheckRaw(initOverrides) {
|
|
@@ -41,17 +39,15 @@ export class HealthApi extends runtime.BaseAPI {
|
|
|
41
39
|
headers: headerParameters,
|
|
42
40
|
query: queryParameters,
|
|
43
41
|
}, initOverrides);
|
|
44
|
-
return new runtime.
|
|
42
|
+
return new runtime.VoidApiResponse(response);
|
|
45
43
|
});
|
|
46
44
|
}
|
|
47
45
|
/**
|
|
48
|
-
* Returns the health status of the API server
|
|
49
46
|
* Health check endpoint
|
|
50
47
|
*/
|
|
51
48
|
healthCheck(initOverrides) {
|
|
52
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
|
|
54
|
-
return yield response.value();
|
|
50
|
+
yield this.healthCheckRaw(initOverrides);
|
|
55
51
|
});
|
|
56
52
|
}
|
|
57
53
|
}
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
13
|
+
import type { CreateChatMessages201Response, CreateMessagesRequest, Message, MessageCountResponse, PaginatedMessages } from '../models/index';
|
|
14
|
+
export interface CreateChatMessagesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
createMessagesRequest: CreateMessagesRequest;
|
|
18
|
+
}
|
|
14
19
|
export interface DeleteMessagesRequest {
|
|
15
20
|
xUserId: string;
|
|
16
21
|
chatId: string;
|
|
@@ -35,6 +40,16 @@ export interface GetMessageCountRequest {
|
|
|
35
40
|
*
|
|
36
41
|
*/
|
|
37
42
|
export declare class MessagesApi extends runtime.BaseAPI {
|
|
43
|
+
/**
|
|
44
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
45
|
+
* Save messages to a chat
|
|
46
|
+
*/
|
|
47
|
+
createChatMessagesRaw(requestParameters: CreateChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateChatMessages201Response>>;
|
|
48
|
+
/**
|
|
49
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
50
|
+
* Save messages to a chat
|
|
51
|
+
*/
|
|
52
|
+
createChatMessages(requestParameters: CreateChatMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateChatMessages201Response>;
|
|
38
53
|
/**
|
|
39
54
|
* Deletes all messages in a chat at or after the given timestamp.
|
|
40
55
|
* Delete messages from timestamp
|
|
@@ -21,11 +21,57 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { MessageFromJSON, MessageCountResponseFromJSON, PaginatedMessagesFromJSON, } from '../models/index';
|
|
24
|
+
import { CreateChatMessages201ResponseFromJSON, CreateMessagesRequestToJSON, MessageFromJSON, MessageCountResponseFromJSON, PaginatedMessagesFromJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class MessagesApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
31
|
+
* Save messages to a chat
|
|
32
|
+
*/
|
|
33
|
+
createChatMessagesRaw(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 createChatMessages().');
|
|
37
|
+
}
|
|
38
|
+
if (requestParameters['chatId'] == null) {
|
|
39
|
+
throw new runtime.RequiredError('chatId', 'Required parameter "chatId" was null or undefined when calling createChatMessages().');
|
|
40
|
+
}
|
|
41
|
+
if (requestParameters['createMessagesRequest'] == null) {
|
|
42
|
+
throw new runtime.RequiredError('createMessagesRequest', 'Required parameter "createMessagesRequest" was null or undefined when calling createChatMessages().');
|
|
43
|
+
}
|
|
44
|
+
const queryParameters = {};
|
|
45
|
+
const headerParameters = {};
|
|
46
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
47
|
+
if (requestParameters['xUserId'] != null) {
|
|
48
|
+
headerParameters['X-User-Id'] = String(requestParameters['xUserId']);
|
|
49
|
+
}
|
|
50
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
51
|
+
headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
|
|
52
|
+
}
|
|
53
|
+
let urlPath = `/api/v1/chats/{chatId}/messages`;
|
|
54
|
+
urlPath = urlPath.replace(`{${"chatId"}}`, encodeURIComponent(String(requestParameters['chatId'])));
|
|
55
|
+
const response = yield this.request({
|
|
56
|
+
path: urlPath,
|
|
57
|
+
method: 'POST',
|
|
58
|
+
headers: headerParameters,
|
|
59
|
+
query: queryParameters,
|
|
60
|
+
body: CreateMessagesRequestToJSON(requestParameters['createMessagesRequest']),
|
|
61
|
+
}, initOverrides);
|
|
62
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CreateChatMessages201ResponseFromJSON(jsonValue));
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Saves one or more messages to the specified chat. Used by clients to persist user and assistant messages.
|
|
67
|
+
* Save messages to a chat
|
|
68
|
+
*/
|
|
69
|
+
createChatMessages(requestParameters, initOverrides) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
const response = yield this.createChatMessagesRaw(requestParameters, initOverrides);
|
|
72
|
+
return yield response.value();
|
|
73
|
+
});
|
|
74
|
+
}
|
|
29
75
|
/**
|
|
30
76
|
* Deletes all messages in a chat at or after the given timestamp.
|
|
31
77
|
* Delete messages from timestamp
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { ListChatVotes200Response, UpsertVoteRequest, Vote } from '../models/index';
|
|
14
|
+
export interface ListChatVotesRequest {
|
|
15
|
+
xUserId: string;
|
|
16
|
+
chatId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface UpsertChatVoteRequest {
|
|
19
|
+
xUserId: string;
|
|
20
|
+
chatId: string;
|
|
21
|
+
upsertVoteRequest: UpsertVoteRequest;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
export declare class VotesApi extends runtime.BaseAPI {
|
|
27
|
+
/**
|
|
28
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
29
|
+
* List votes for a chat
|
|
30
|
+
*/
|
|
31
|
+
listChatVotesRaw(requestParameters: ListChatVotesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListChatVotes200Response>>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns all votes for the specified chat belonging to the authenticated account user.
|
|
34
|
+
* List votes for a chat
|
|
35
|
+
*/
|
|
36
|
+
listChatVotes(requestParameters: ListChatVotesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListChatVotes200Response>;
|
|
37
|
+
/**
|
|
38
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
39
|
+
* Create or update a vote
|
|
40
|
+
*/
|
|
41
|
+
upsertChatVoteRaw(requestParameters: UpsertChatVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Vote>>;
|
|
42
|
+
/**
|
|
43
|
+
* Creates or updates a vote on a message in the specified chat. One vote per message is allowed.
|
|
44
|
+
* Create or update a vote
|
|
45
|
+
*/
|
|
46
|
+
upsertChatVote(requestParameters: UpsertChatVoteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Vote>;
|
|
47
|
+
}
|