@instructure/athena-api-client 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/README.md +155 -0
  2. package/dist/apis/AccountsApi.d.ts +41 -0
  3. package/dist/apis/AccountsApi.js +100 -0
  4. package/dist/apis/ChatsApi.d.ts +105 -0
  5. package/dist/apis/ChatsApi.js +289 -0
  6. package/dist/apis/HealthApi.d.ts +28 -0
  7. package/dist/apis/HealthApi.js +61 -0
  8. package/dist/apis/MessagesApi.d.ts +34 -0
  9. package/dist/apis/MessagesApi.js +80 -0
  10. package/dist/apis/ServiceTokensApi.d.ts +81 -0
  11. package/dist/apis/ServiceTokensApi.js +209 -0
  12. package/dist/apis/TagsApi.d.ts +28 -0
  13. package/dist/apis/TagsApi.js +61 -0
  14. package/dist/apis/index.d.ts +6 -0
  15. package/dist/apis/index.js +24 -0
  16. package/dist/esm/apis/AccountsApi.d.ts +41 -0
  17. package/dist/esm/apis/AccountsApi.js +96 -0
  18. package/dist/esm/apis/ChatsApi.d.ts +105 -0
  19. package/dist/esm/apis/ChatsApi.js +285 -0
  20. package/dist/esm/apis/HealthApi.d.ts +28 -0
  21. package/dist/esm/apis/HealthApi.js +57 -0
  22. package/dist/esm/apis/MessagesApi.d.ts +34 -0
  23. package/dist/esm/apis/MessagesApi.js +76 -0
  24. package/dist/esm/apis/ServiceTokensApi.d.ts +81 -0
  25. package/dist/esm/apis/ServiceTokensApi.js +205 -0
  26. package/dist/esm/apis/TagsApi.d.ts +28 -0
  27. package/dist/esm/apis/TagsApi.js +57 -0
  28. package/dist/esm/apis/index.d.ts +6 -0
  29. package/dist/esm/apis/index.js +8 -0
  30. package/dist/esm/index.d.ts +3 -0
  31. package/dist/esm/index.js +5 -0
  32. package/dist/esm/models/Account.d.ts +50 -0
  33. package/dist/esm/models/Account.js +55 -0
  34. package/dist/esm/models/Chat.d.ts +112 -0
  35. package/dist/esm/models/Chat.js +84 -0
  36. package/dist/esm/models/ChatRequest.d.ts +38 -0
  37. package/dist/esm/models/ChatRequest.js +45 -0
  38. package/dist/esm/models/CreateAccountRequest.d.ts +32 -0
  39. package/dist/esm/models/CreateAccountRequest.js +43 -0
  40. package/dist/esm/models/CreateChatRequest.d.ts +32 -0
  41. package/dist/esm/models/CreateChatRequest.js +41 -0
  42. package/dist/esm/models/CreateTokenRequest.d.ts +52 -0
  43. package/dist/esm/models/CreateTokenRequest.js +58 -0
  44. package/dist/esm/models/CreateTokenResponse.d.ts +50 -0
  45. package/dist/esm/models/CreateTokenResponse.js +55 -0
  46. package/dist/esm/models/HealthCheck.d.ts +39 -0
  47. package/dist/esm/models/HealthCheck.js +49 -0
  48. package/dist/esm/models/Message.d.ts +63 -0
  49. package/dist/esm/models/Message.js +64 -0
  50. package/dist/esm/models/MessagePartsInner.d.ts +38 -0
  51. package/dist/esm/models/MessagePartsInner.js +43 -0
  52. package/dist/esm/models/ModelError.d.ts +32 -0
  53. package/dist/esm/models/ModelError.js +43 -0
  54. package/dist/esm/models/PaginatedChats.d.ts +39 -0
  55. package/dist/esm/models/PaginatedChats.js +48 -0
  56. package/dist/esm/models/PaginatedMessages.d.ts +39 -0
  57. package/dist/esm/models/PaginatedMessages.js +48 -0
  58. package/dist/esm/models/ServiceToken.d.ts +70 -0
  59. package/dist/esm/models/ServiceToken.js +70 -0
  60. package/dist/esm/models/Tag.d.ts +38 -0
  61. package/dist/esm/models/Tag.js +47 -0
  62. package/dist/esm/models/UpdateChatRequest.d.ts +32 -0
  63. package/dist/esm/models/UpdateChatRequest.js +41 -0
  64. package/dist/esm/models/UpdateTokenRequest.d.ts +32 -0
  65. package/dist/esm/models/UpdateTokenRequest.js +43 -0
  66. package/dist/esm/models/UpdateTokenResponse.d.ts +50 -0
  67. package/dist/esm/models/UpdateTokenResponse.js +55 -0
  68. package/dist/esm/models/index.d.ts +18 -0
  69. package/dist/esm/models/index.js +20 -0
  70. package/dist/esm/runtime.d.ts +184 -0
  71. package/dist/esm/runtime.js +334 -0
  72. package/dist/index.d.ts +3 -0
  73. package/dist/index.js +21 -0
  74. package/dist/models/Account.d.ts +50 -0
  75. package/dist/models/Account.js +62 -0
  76. package/dist/models/Chat.d.ts +112 -0
  77. package/dist/models/Chat.js +92 -0
  78. package/dist/models/ChatRequest.d.ts +38 -0
  79. package/dist/models/ChatRequest.js +52 -0
  80. package/dist/models/CreateAccountRequest.d.ts +32 -0
  81. package/dist/models/CreateAccountRequest.js +50 -0
  82. package/dist/models/CreateChatRequest.d.ts +32 -0
  83. package/dist/models/CreateChatRequest.js +48 -0
  84. package/dist/models/CreateTokenRequest.d.ts +52 -0
  85. package/dist/models/CreateTokenRequest.js +66 -0
  86. package/dist/models/CreateTokenResponse.d.ts +50 -0
  87. package/dist/models/CreateTokenResponse.js +62 -0
  88. package/dist/models/HealthCheck.d.ts +39 -0
  89. package/dist/models/HealthCheck.js +57 -0
  90. package/dist/models/Message.d.ts +63 -0
  91. package/dist/models/Message.js +71 -0
  92. package/dist/models/MessagePartsInner.d.ts +38 -0
  93. package/dist/models/MessagePartsInner.js +50 -0
  94. package/dist/models/ModelError.d.ts +32 -0
  95. package/dist/models/ModelError.js +50 -0
  96. package/dist/models/PaginatedChats.d.ts +39 -0
  97. package/dist/models/PaginatedChats.js +55 -0
  98. package/dist/models/PaginatedMessages.d.ts +39 -0
  99. package/dist/models/PaginatedMessages.js +55 -0
  100. package/dist/models/ServiceToken.d.ts +70 -0
  101. package/dist/models/ServiceToken.js +78 -0
  102. package/dist/models/Tag.d.ts +38 -0
  103. package/dist/models/Tag.js +54 -0
  104. package/dist/models/UpdateChatRequest.d.ts +32 -0
  105. package/dist/models/UpdateChatRequest.js +48 -0
  106. package/dist/models/UpdateTokenRequest.d.ts +32 -0
  107. package/dist/models/UpdateTokenRequest.js +50 -0
  108. package/dist/models/UpdateTokenResponse.d.ts +50 -0
  109. package/dist/models/UpdateTokenResponse.js +62 -0
  110. package/dist/models/index.d.ts +18 -0
  111. package/dist/models/index.js +36 -0
  112. package/dist/runtime.d.ts +184 -0
  113. package/dist/runtime.js +350 -0
  114. package/package.json +30 -0
@@ -0,0 +1,209 @@
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.ServiceTokensApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class ServiceTokensApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates a new service token with the specified consumer name, role, and account ID (admin only). The generated token is only shown once.
34
+ * Create a new service token
35
+ */
36
+ createServiceTokenRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['createTokenRequest'] == null) {
39
+ throw new runtime.RequiredError('createTokenRequest', 'Required parameter "createTokenRequest" was null or undefined when calling createServiceToken().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ if (this.configuration && this.configuration.apiKey) {
45
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
46
+ }
47
+ let urlPath = `/api/v1/tokens`;
48
+ const response = yield this.request({
49
+ path: urlPath,
50
+ method: 'POST',
51
+ headers: headerParameters,
52
+ query: queryParameters,
53
+ body: (0, index_1.CreateTokenRequestToJSON)(requestParameters['createTokenRequest']),
54
+ }, initOverrides);
55
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CreateTokenResponseFromJSON)(jsonValue));
56
+ });
57
+ }
58
+ /**
59
+ * Creates a new service token with the specified consumer name, role, and account ID (admin only). The generated token is only shown once.
60
+ * Create a new service token
61
+ */
62
+ createServiceToken(requestParameters, initOverrides) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const response = yield this.createServiceTokenRaw(requestParameters, initOverrides);
65
+ return yield response.value();
66
+ });
67
+ }
68
+ /**
69
+ * Permanently deletes a service token (admin only)
70
+ * Delete service token
71
+ */
72
+ deleteServiceTokenRaw(requestParameters, initOverrides) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ if (requestParameters['id'] == null) {
75
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteServiceToken().');
76
+ }
77
+ const queryParameters = {};
78
+ const headerParameters = {};
79
+ if (this.configuration && this.configuration.apiKey) {
80
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
81
+ }
82
+ let urlPath = `/api/v1/tokens/{id}`;
83
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
84
+ const response = yield this.request({
85
+ path: urlPath,
86
+ method: 'DELETE',
87
+ headers: headerParameters,
88
+ query: queryParameters,
89
+ }, initOverrides);
90
+ return new runtime.VoidApiResponse(response);
91
+ });
92
+ }
93
+ /**
94
+ * Permanently deletes a service token (admin only)
95
+ * Delete service token
96
+ */
97
+ deleteServiceToken(requestParameters, initOverrides) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ yield this.deleteServiceTokenRaw(requestParameters, initOverrides);
100
+ });
101
+ }
102
+ /**
103
+ * Retrieves details of a specific service token by its ID (admin only)
104
+ * Get service token by ID
105
+ */
106
+ getServiceTokenRaw(requestParameters, initOverrides) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ if (requestParameters['id'] == null) {
109
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getServiceToken().');
110
+ }
111
+ const queryParameters = {};
112
+ const headerParameters = {};
113
+ if (this.configuration && this.configuration.apiKey) {
114
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
115
+ }
116
+ let urlPath = `/api/v1/tokens/{id}`;
117
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
118
+ const response = yield this.request({
119
+ path: urlPath,
120
+ method: 'GET',
121
+ headers: headerParameters,
122
+ query: queryParameters,
123
+ }, initOverrides);
124
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ServiceTokenFromJSON)(jsonValue));
125
+ });
126
+ }
127
+ /**
128
+ * Retrieves details of a specific service token by its ID (admin only)
129
+ * Get service token by ID
130
+ */
131
+ getServiceToken(requestParameters, initOverrides) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ const response = yield this.getServiceTokenRaw(requestParameters, initOverrides);
134
+ return yield response.value();
135
+ });
136
+ }
137
+ /**
138
+ * Retrieves a list of all service tokens (admin only)
139
+ * List all service tokens
140
+ */
141
+ listServiceTokensRaw(initOverrides) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ const queryParameters = {};
144
+ const headerParameters = {};
145
+ if (this.configuration && this.configuration.apiKey) {
146
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
147
+ }
148
+ let urlPath = `/api/v1/tokens`;
149
+ const response = yield this.request({
150
+ path: urlPath,
151
+ method: 'GET',
152
+ headers: headerParameters,
153
+ query: queryParameters,
154
+ }, initOverrides);
155
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.ServiceTokenFromJSON));
156
+ });
157
+ }
158
+ /**
159
+ * Retrieves a list of all service tokens (admin only)
160
+ * List all service tokens
161
+ */
162
+ listServiceTokens(initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const response = yield this.listServiceTokensRaw(initOverrides);
165
+ return yield response.value();
166
+ });
167
+ }
168
+ /**
169
+ * Updates the active status of a service token (admin only)
170
+ * Update service token status
171
+ */
172
+ updateServiceTokenRaw(requestParameters, initOverrides) {
173
+ return __awaiter(this, void 0, void 0, function* () {
174
+ if (requestParameters['id'] == null) {
175
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateServiceToken().');
176
+ }
177
+ if (requestParameters['updateTokenRequest'] == null) {
178
+ throw new runtime.RequiredError('updateTokenRequest', 'Required parameter "updateTokenRequest" was null or undefined when calling updateServiceToken().');
179
+ }
180
+ const queryParameters = {};
181
+ const headerParameters = {};
182
+ headerParameters['Content-Type'] = 'application/json';
183
+ if (this.configuration && this.configuration.apiKey) {
184
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
185
+ }
186
+ let urlPath = `/api/v1/tokens/{id}`;
187
+ urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
188
+ const response = yield this.request({
189
+ path: urlPath,
190
+ method: 'PATCH',
191
+ headers: headerParameters,
192
+ query: queryParameters,
193
+ body: (0, index_1.UpdateTokenRequestToJSON)(requestParameters['updateTokenRequest']),
194
+ }, initOverrides);
195
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.UpdateTokenResponseFromJSON)(jsonValue));
196
+ });
197
+ }
198
+ /**
199
+ * Updates the active status of a service token (admin only)
200
+ * Update service token status
201
+ */
202
+ updateServiceToken(requestParameters, initOverrides) {
203
+ return __awaiter(this, void 0, void 0, function* () {
204
+ const response = yield this.updateServiceTokenRaw(requestParameters, initOverrides);
205
+ return yield response.value();
206
+ });
207
+ }
208
+ }
209
+ exports.ServiceTokensApi = ServiceTokensApi;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Athena API
3
+ * REST API for the Athena system
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Tag } from '../models/index';
14
+ /**
15
+ *
16
+ */
17
+ export declare class TagsApi extends runtime.BaseAPI {
18
+ /**
19
+ * Retrieves a list of all available tags
20
+ * List all tags
21
+ */
22
+ listTagsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Tag>>>;
23
+ /**
24
+ * Retrieves a list of all available tags
25
+ * List all tags
26
+ */
27
+ listTags(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Tag>>;
28
+ }
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Athena API
6
+ * REST API for the Athena system
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.TagsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class TagsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Retrieves a list of all available tags
34
+ * List all tags
35
+ */
36
+ listTagsRaw(initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ let urlPath = `/api/v1/tags`;
41
+ const response = yield this.request({
42
+ path: urlPath,
43
+ method: 'GET',
44
+ headers: headerParameters,
45
+ query: queryParameters,
46
+ }, initOverrides);
47
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.TagFromJSON));
48
+ });
49
+ }
50
+ /**
51
+ * Retrieves a list of all available tags
52
+ * List all tags
53
+ */
54
+ listTags(initOverrides) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const response = yield this.listTagsRaw(initOverrides);
57
+ return yield response.value();
58
+ });
59
+ }
60
+ }
61
+ exports.TagsApi = TagsApi;
@@ -0,0 +1,6 @@
1
+ export * from './AccountsApi';
2
+ export * from './ChatsApi';
3
+ export * from './HealthApi';
4
+ export * from './MessagesApi';
5
+ export * from './ServiceTokensApi';
6
+ export * from './TagsApi';
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /* tslint:disable */
18
+ /* eslint-disable */
19
+ __exportStar(require("./AccountsApi"), exports);
20
+ __exportStar(require("./ChatsApi"), exports);
21
+ __exportStar(require("./HealthApi"), exports);
22
+ __exportStar(require("./MessagesApi"), exports);
23
+ __exportStar(require("./ServiceTokensApi"), exports);
24
+ __exportStar(require("./TagsApi"), exports);
@@ -0,0 +1,41 @@
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 { Account, CreateAccountRequest } from '../models/index';
14
+ export interface CreateAccountOperationRequest {
15
+ createAccountRequest: CreateAccountRequest;
16
+ }
17
+ /**
18
+ *
19
+ */
20
+ export declare class AccountsApi extends runtime.BaseAPI {
21
+ /**
22
+ * Creates a new account (admin only)
23
+ * Create a new account
24
+ */
25
+ createAccountRaw(requestParameters: CreateAccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Account>>;
26
+ /**
27
+ * Creates a new account (admin only)
28
+ * Create a new account
29
+ */
30
+ createAccount(requestParameters: CreateAccountOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Account>;
31
+ /**
32
+ * Retrieves a list of all accounts (admin only)
33
+ * List all accounts
34
+ */
35
+ listAccountsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Account>>>;
36
+ /**
37
+ * Retrieves a list of all accounts (admin only)
38
+ * List all accounts
39
+ */
40
+ listAccounts(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Account>>;
41
+ }
@@ -0,0 +1,96 @@
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 { AccountFromJSON, CreateAccountRequestToJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class AccountsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates a new account (admin only)
31
+ * Create a new account
32
+ */
33
+ createAccountRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['createAccountRequest'] == null) {
36
+ throw new runtime.RequiredError('createAccountRequest', 'Required parameter "createAccountRequest" was null or undefined when calling createAccount().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ headerParameters['Content-Type'] = 'application/json';
41
+ if (this.configuration && this.configuration.apiKey) {
42
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
43
+ }
44
+ let urlPath = `/api/v1/accounts`;
45
+ const response = yield this.request({
46
+ path: urlPath,
47
+ method: 'POST',
48
+ headers: headerParameters,
49
+ query: queryParameters,
50
+ body: CreateAccountRequestToJSON(requestParameters['createAccountRequest']),
51
+ }, initOverrides);
52
+ return new runtime.JSONApiResponse(response, (jsonValue) => AccountFromJSON(jsonValue));
53
+ });
54
+ }
55
+ /**
56
+ * Creates a new account (admin only)
57
+ * Create a new account
58
+ */
59
+ createAccount(requestParameters, initOverrides) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ const response = yield this.createAccountRaw(requestParameters, initOverrides);
62
+ return yield response.value();
63
+ });
64
+ }
65
+ /**
66
+ * Retrieves a list of all accounts (admin only)
67
+ * List all accounts
68
+ */
69
+ listAccountsRaw(initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const queryParameters = {};
72
+ const headerParameters = {};
73
+ if (this.configuration && this.configuration.apiKey) {
74
+ headerParameters["X-Auth-Token"] = yield this.configuration.apiKey("X-Auth-Token"); // AuthToken authentication
75
+ }
76
+ let urlPath = `/api/v1/accounts`;
77
+ const response = yield this.request({
78
+ path: urlPath,
79
+ method: 'GET',
80
+ headers: headerParameters,
81
+ query: queryParameters,
82
+ }, initOverrides);
83
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AccountFromJSON));
84
+ });
85
+ }
86
+ /**
87
+ * Retrieves a list of all accounts (admin only)
88
+ * List all accounts
89
+ */
90
+ listAccounts(initOverrides) {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ const response = yield this.listAccountsRaw(initOverrides);
93
+ return yield response.value();
94
+ });
95
+ }
96
+ }
@@ -0,0 +1,105 @@
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 { Chat, ChatRequest, CreateChatRequest, PaginatedChats, UpdateChatRequest } from '../models/index';
14
+ export interface CreateChatOperationRequest {
15
+ xUserId: string;
16
+ createChatRequest?: CreateChatRequest;
17
+ }
18
+ export interface DeleteChatRequest {
19
+ xUserId: string;
20
+ chatId: string;
21
+ }
22
+ export interface GetChatRequest {
23
+ xUserId: string;
24
+ chatId: string;
25
+ }
26
+ export interface ListChatsRequest {
27
+ xUserId: string;
28
+ limit?: number;
29
+ cursor?: string;
30
+ }
31
+ export interface SendChatMessageRequest {
32
+ xUserId: string;
33
+ chatRequest: ChatRequest;
34
+ xCanvasToken?: string;
35
+ }
36
+ export interface UpdateChatOperationRequest {
37
+ xUserId: string;
38
+ chatId: string;
39
+ updateChatRequest?: UpdateChatRequest;
40
+ }
41
+ /**
42
+ *
43
+ */
44
+ export declare class ChatsApi extends runtime.BaseAPI {
45
+ /**
46
+ * Creates a new chat for the authenticated account user.
47
+ * Create a chat
48
+ */
49
+ createChatRaw(requestParameters: CreateChatOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
50
+ /**
51
+ * Creates a new chat for the authenticated account user.
52
+ * Create a chat
53
+ */
54
+ createChat(requestParameters: CreateChatOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
55
+ /**
56
+ * Deletes a chat and its messages belonging to the authenticated account user.
57
+ * Delete a chat
58
+ */
59
+ deleteChatRaw(requestParameters: DeleteChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
60
+ /**
61
+ * Deletes a chat and its messages belonging to the authenticated account user.
62
+ * Delete a chat
63
+ */
64
+ deleteChat(requestParameters: DeleteChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
65
+ /**
66
+ * Returns a single chat belonging to the authenticated account user.
67
+ * Get a chat
68
+ */
69
+ getChatRaw(requestParameters: GetChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
70
+ /**
71
+ * Returns a single chat belonging to the authenticated account user.
72
+ * Get a chat
73
+ */
74
+ getChat(requestParameters: GetChatRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
75
+ /**
76
+ * Returns paginated chats belonging to the authenticated account user, ordered by creation date (newest first).
77
+ * List chats
78
+ */
79
+ listChatsRaw(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedChats>>;
80
+ /**
81
+ * Returns paginated chats belonging to the authenticated account user, ordered by creation date (newest first).
82
+ * List chats
83
+ */
84
+ listChats(requestParameters: ListChatsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedChats>;
85
+ /**
86
+ * 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
+ * Send a message to a chat
88
+ */
89
+ sendChatMessageRaw(requestParameters: SendChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<string>>;
90
+ /**
91
+ * 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.
92
+ * Send a message to a chat
93
+ */
94
+ sendChatMessage(requestParameters: SendChatMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<string>;
95
+ /**
96
+ * Updates a chat belonging to the authenticated account user.
97
+ * Update a chat
98
+ */
99
+ updateChatRaw(requestParameters: UpdateChatOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Chat>>;
100
+ /**
101
+ * Updates a chat belonging to the authenticated account user.
102
+ * Update a chat
103
+ */
104
+ updateChat(requestParameters: UpdateChatOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Chat>;
105
+ }