@easyedu/js-lsm-api 1.39.0 → 1.40.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 (61) hide show
  1. package/.openapi-generator/FILES +16 -0
  2. package/README.md +21 -9
  3. package/dist/apis/ChatApi.d.ts +95 -0
  4. package/dist/apis/ChatApi.js +235 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/esm/apis/ChatApi.d.ts +95 -0
  8. package/dist/esm/apis/ChatApi.js +231 -0
  9. package/dist/esm/apis/index.d.ts +1 -0
  10. package/dist/esm/apis/index.js +1 -0
  11. package/dist/esm/models/GetChatMessage.d.ts +44 -0
  12. package/dist/esm/models/GetChatMessage.js +51 -0
  13. package/dist/esm/models/GetConversation.d.ts +50 -0
  14. package/dist/esm/models/GetConversation.js +53 -0
  15. package/dist/esm/models/GetConversationList.d.ts +57 -0
  16. package/dist/esm/models/GetConversationList.js +60 -0
  17. package/dist/esm/models/PostConversation.d.ts +32 -0
  18. package/dist/esm/models/PostConversation.js +43 -0
  19. package/dist/esm/models/PostConversationResponse.d.ts +44 -0
  20. package/dist/esm/models/PostConversationResponse.js +51 -0
  21. package/dist/esm/models/PostMessage.d.ts +32 -0
  22. package/dist/esm/models/PostMessage.js +43 -0
  23. package/dist/esm/models/PostMessageResponse.d.ts +38 -0
  24. package/dist/esm/models/PostMessageResponse.js +47 -0
  25. package/dist/esm/models/index.d.ts +7 -0
  26. package/dist/esm/models/index.js +7 -0
  27. package/dist/models/GetChatMessage.d.ts +44 -0
  28. package/dist/models/GetChatMessage.js +58 -0
  29. package/dist/models/GetConversation.d.ts +50 -0
  30. package/dist/models/GetConversation.js +60 -0
  31. package/dist/models/GetConversationList.d.ts +57 -0
  32. package/dist/models/GetConversationList.js +67 -0
  33. package/dist/models/PostConversation.d.ts +32 -0
  34. package/dist/models/PostConversation.js +50 -0
  35. package/dist/models/PostConversationResponse.d.ts +44 -0
  36. package/dist/models/PostConversationResponse.js +58 -0
  37. package/dist/models/PostMessage.d.ts +32 -0
  38. package/dist/models/PostMessage.js +50 -0
  39. package/dist/models/PostMessageResponse.d.ts +38 -0
  40. package/dist/models/PostMessageResponse.js +54 -0
  41. package/dist/models/index.d.ts +7 -0
  42. package/dist/models/index.js +7 -0
  43. package/docs/ChatApi.md +357 -0
  44. package/docs/GetChatMessage.md +38 -0
  45. package/docs/GetConversation.md +40 -0
  46. package/docs/GetConversationList.md +42 -0
  47. package/docs/PostConversation.md +34 -0
  48. package/docs/PostConversationResponse.md +38 -0
  49. package/docs/PostMessage.md +34 -0
  50. package/docs/PostMessageResponse.md +36 -0
  51. package/package.json +1 -1
  52. package/src/apis/ChatApi.ts +303 -0
  53. package/src/apis/index.ts +1 -0
  54. package/src/models/GetChatMessage.ts +84 -0
  55. package/src/models/GetConversation.ts +92 -0
  56. package/src/models/GetConversationList.ts +110 -0
  57. package/src/models/PostConversation.ts +66 -0
  58. package/src/models/PostConversationResponse.ts +84 -0
  59. package/src/models/PostMessage.ts +66 -0
  60. package/src/models/PostMessageResponse.ts +75 -0
  61. package/src/models/index.ts +7 -0
@@ -2,6 +2,7 @@
2
2
  .npmignore
3
3
  .openapi-generator-ignore
4
4
  README.md
5
+ docs/ChatApi.md
5
6
  docs/ContentApi.md
6
7
  docs/CourseApi.md
7
8
  docs/CriteriaBasedSelection.md
@@ -11,6 +12,7 @@ docs/Essay.md
11
12
  docs/Essay1.md
12
13
  docs/FillInBlank.md
13
14
  docs/FillInBlank1.md
15
+ docs/GetChatMessage.md
14
16
  docs/GetContent.md
15
17
  docs/GetContentContentData.md
16
18
  docs/GetContentGradeDetail.md
@@ -35,6 +37,8 @@ docs/GetContentVersionList.md
35
37
  docs/GetContentVersionListItemsInner.md
36
38
  docs/GetContentVersionSandbox.md
37
39
  docs/GetContentVersionScormData.md
40
+ docs/GetConversation.md
41
+ docs/GetConversationList.md
38
42
  docs/GetCourse.md
39
43
  docs/GetCourseEnrollment.md
40
44
  docs/GetCourseEnrollmentList.md
@@ -154,11 +158,15 @@ docs/PostContentQuizQuestionSelection.md
154
158
  docs/PostContentQuizSettings.md
155
159
  docs/PostContentSession.md
156
160
  docs/PostContentUpload.md
161
+ docs/PostConversation.md
162
+ docs/PostConversationResponse.md
157
163
  docs/PostCourse.md
158
164
  docs/PostCourseEnrollment.md
159
165
  docs/PostCourseExport.md
160
166
  docs/PostLogin.md
161
167
  docs/PostManualQuestionSelection.md
168
+ docs/PostMessage.md
169
+ docs/PostMessageResponse.md
162
170
  docs/PostModule.md
163
171
  docs/PostPortal.md
164
172
  docs/PostPortalInvite.md
@@ -222,6 +230,7 @@ docs/ShortAnswer1.md
222
230
  docs/SingleAnswer.md
223
231
  docs/UserApi.md
224
232
  package.json
233
+ src/apis/ChatApi.ts
225
234
  src/apis/ContentApi.ts
226
235
  src/apis/CourseApi.ts
227
236
  src/apis/ModuleApi.ts
@@ -241,6 +250,7 @@ src/models/Essay.ts
241
250
  src/models/Essay1.ts
242
251
  src/models/FillInBlank.ts
243
252
  src/models/FillInBlank1.ts
253
+ src/models/GetChatMessage.ts
244
254
  src/models/GetContent.ts
245
255
  src/models/GetContentContentData.ts
246
256
  src/models/GetContentGradeDetail.ts
@@ -265,6 +275,8 @@ src/models/GetContentVersionList.ts
265
275
  src/models/GetContentVersionListItemsInner.ts
266
276
  src/models/GetContentVersionSandbox.ts
267
277
  src/models/GetContentVersionScormData.ts
278
+ src/models/GetConversation.ts
279
+ src/models/GetConversationList.ts
268
280
  src/models/GetCourse.ts
269
281
  src/models/GetCourseEnrollment.ts
270
282
  src/models/GetCourseEnrollmentList.ts
@@ -381,11 +393,15 @@ src/models/PostContentQuizQuestionSelection.ts
381
393
  src/models/PostContentQuizSettings.ts
382
394
  src/models/PostContentSession.ts
383
395
  src/models/PostContentUpload.ts
396
+ src/models/PostConversation.ts
397
+ src/models/PostConversationResponse.ts
384
398
  src/models/PostCourse.ts
385
399
  src/models/PostCourseEnrollment.ts
386
400
  src/models/PostCourseExport.ts
387
401
  src/models/PostLogin.ts
388
402
  src/models/PostManualQuestionSelection.ts
403
+ src/models/PostMessage.ts
404
+ src/models/PostMessageResponse.ts
389
405
  src/models/PostModule.ts
390
406
  src/models/PostPortal.ts
391
407
  src/models/PostPortalInvite.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @easyedu/js-lsm-api@1.39.0
1
+ # @easyedu/js-lsm-api@1.40.0
2
2
 
3
3
  A TypeScript SDK client for the sbzw93t49b.execute-api.us-east-2.amazonaws.com API.
4
4
 
@@ -16,21 +16,21 @@ Next, try it out.
16
16
  ```ts
17
17
  import {
18
18
  Configuration,
19
- ContentApi,
19
+ ChatApi,
20
20
  } from '@easyedu/js-lsm-api';
21
- import type { CommitScormSessionRequest } from '@easyedu/js-lsm-api';
21
+ import type { DeleteConversationRequest } from '@easyedu/js-lsm-api';
22
22
 
23
23
  async function example() {
24
24
  console.log("🚀 Testing @easyedu/js-lsm-api SDK...");
25
- const api = new ContentApi();
25
+ const api = new ChatApi();
26
26
 
27
27
  const body = {
28
- // string | The external_id of the SCORM session
29
- scormSessionId: scormSessionId_example,
30
- } satisfies CommitScormSessionRequest;
28
+ // string
29
+ conversationId: conversationId_example,
30
+ } satisfies DeleteConversationRequest;
31
31
 
32
32
  try {
33
- const data = await api.commitScormSession(body);
33
+ const data = await api.deleteConversation(body);
34
34
  console.log(data);
35
35
  } catch (error) {
36
36
  console.error(error);
@@ -50,6 +50,11 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
50
50
 
51
51
  | Class | Method | HTTP request | Description
52
52
  | ----- | ------ | ------------ | -------------
53
+ *ChatApi* | [**deleteConversation**](docs/ChatApi.md#deleteconversation) | **DELETE** /chat/conversations/{conversationId} | Delete a conversation
54
+ *ChatApi* | [**getConversationMessages**](docs/ChatApi.md#getconversationmessages) | **GET** /chat/conversations/{conversationId}/messages | Get all messages in a conversation
55
+ *ChatApi* | [**getConversations**](docs/ChatApi.md#getconversations) | **GET** /chat/conversations | List conversations for the current user
56
+ *ChatApi* | [**postConversation**](docs/ChatApi.md#postconversation) | **POST** /chat/conversations | Create a new conversation
57
+ *ChatApi* | [**postMessage**](docs/ChatApi.md#postmessage) | **POST** /chat/conversations/{conversationId}/messages | Send a message to a conversation
53
58
  *ContentApi* | [**commitScormSession**](docs/ContentApi.md#commitscormsession) | **POST** /scorm/sessions/{scormSessionId}/commit | Commit SCORM session data
54
59
  *ContentApi* | [**getContent**](docs/ContentApi.md#getcontent) | **GET** /courses/{courseId}/modules/{moduleId}/contents/{contentId} | get content
55
60
  *ContentApi* | [**getContentList**](docs/ContentApi.md#getcontentlist) | **GET** /courses/{courseId}/modules/{moduleId}/contents | get content list
@@ -165,6 +170,7 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
165
170
  - [Essay1](docs/Essay1.md)
166
171
  - [FillInBlank](docs/FillInBlank.md)
167
172
  - [FillInBlank1](docs/FillInBlank1.md)
173
+ - [GetChatMessage](docs/GetChatMessage.md)
168
174
  - [GetContent](docs/GetContent.md)
169
175
  - [GetContentContentData](docs/GetContentContentData.md)
170
176
  - [GetContentGradeDetail](docs/GetContentGradeDetail.md)
@@ -189,6 +195,8 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
189
195
  - [GetContentVersionListItemsInner](docs/GetContentVersionListItemsInner.md)
190
196
  - [GetContentVersionSandbox](docs/GetContentVersionSandbox.md)
191
197
  - [GetContentVersionScormData](docs/GetContentVersionScormData.md)
198
+ - [GetConversation](docs/GetConversation.md)
199
+ - [GetConversationList](docs/GetConversationList.md)
192
200
  - [GetCourse](docs/GetCourse.md)
193
201
  - [GetCourseEnrollment](docs/GetCourseEnrollment.md)
194
202
  - [GetCourseEnrollmentList](docs/GetCourseEnrollmentList.md)
@@ -305,11 +313,15 @@ All URIs are relative to *https://sbzw93t49b.execute-api.us-east-2.amazonaws.com
305
313
  - [PostContentQuizSettings](docs/PostContentQuizSettings.md)
306
314
  - [PostContentSession](docs/PostContentSession.md)
307
315
  - [PostContentUpload](docs/PostContentUpload.md)
316
+ - [PostConversation](docs/PostConversation.md)
317
+ - [PostConversationResponse](docs/PostConversationResponse.md)
308
318
  - [PostCourse](docs/PostCourse.md)
309
319
  - [PostCourseEnrollment](docs/PostCourseEnrollment.md)
310
320
  - [PostCourseExport](docs/PostCourseExport.md)
311
321
  - [PostLogin](docs/PostLogin.md)
312
322
  - [PostManualQuestionSelection](docs/PostManualQuestionSelection.md)
323
+ - [PostMessage](docs/PostMessage.md)
324
+ - [PostMessageResponse](docs/PostMessageResponse.md)
313
325
  - [PostModule](docs/PostModule.md)
314
326
  - [PostPortal](docs/PostPortal.md)
315
327
  - [PostPortalInvite](docs/PostPortalInvite.md)
@@ -380,7 +392,7 @@ and is automatically generated by the
380
392
  [OpenAPI Generator](https://openapi-generator.tech) project:
381
393
 
382
394
  - API version: `1.0.0`
383
- - Package version: `1.39.0`
395
+ - Package version: `1.40.0`
384
396
  - Generator version: `7.21.0`
385
397
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
386
398
 
@@ -0,0 +1,95 @@
1
+ /**
2
+ * LMS API
3
+ * LMS API
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 { GetChatMessage, GetConversationList, PostConversation, PostConversationResponse, PostMessage, PostMessageResponse } from '../models/index';
14
+ export interface DeleteConversationRequest {
15
+ conversationId: string;
16
+ }
17
+ export interface GetConversationMessagesRequest {
18
+ conversationId: string;
19
+ }
20
+ export interface GetConversationsRequest {
21
+ page?: number;
22
+ pageSize?: number;
23
+ }
24
+ export interface PostConversationRequest {
25
+ postConversation: PostConversation;
26
+ }
27
+ export interface PostMessageRequest {
28
+ conversationId: string;
29
+ postMessage: PostMessage;
30
+ }
31
+ /**
32
+ *
33
+ */
34
+ export declare class ChatApi extends runtime.BaseAPI {
35
+ /**
36
+ * Creates request options for deleteConversation without sending the request
37
+ */
38
+ deleteConversationRequestOpts(requestParameters: DeleteConversationRequest): Promise<runtime.RequestOpts>;
39
+ /**
40
+ * Delete a conversation
41
+ */
42
+ deleteConversationRaw(requestParameters: DeleteConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
43
+ /**
44
+ * Delete a conversation
45
+ */
46
+ deleteConversation(requestParameters: DeleteConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
47
+ /**
48
+ * Creates request options for getConversationMessages without sending the request
49
+ */
50
+ getConversationMessagesRequestOpts(requestParameters: GetConversationMessagesRequest): Promise<runtime.RequestOpts>;
51
+ /**
52
+ * Get all messages in a conversation
53
+ */
54
+ getConversationMessagesRaw(requestParameters: GetConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetChatMessage>>>;
55
+ /**
56
+ * Get all messages in a conversation
57
+ */
58
+ getConversationMessages(requestParameters: GetConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetChatMessage>>;
59
+ /**
60
+ * Creates request options for getConversations without sending the request
61
+ */
62
+ getConversationsRequestOpts(requestParameters: GetConversationsRequest): Promise<runtime.RequestOpts>;
63
+ /**
64
+ * List conversations for the current user
65
+ */
66
+ getConversationsRaw(requestParameters: GetConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetConversationList>>;
67
+ /**
68
+ * List conversations for the current user
69
+ */
70
+ getConversations(requestParameters?: GetConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetConversationList>;
71
+ /**
72
+ * Creates request options for postConversation without sending the request
73
+ */
74
+ postConversationRequestOpts(requestParameters: PostConversationRequest): Promise<runtime.RequestOpts>;
75
+ /**
76
+ * Create a new conversation
77
+ */
78
+ postConversationRaw(requestParameters: PostConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostConversationResponse>>;
79
+ /**
80
+ * Create a new conversation
81
+ */
82
+ postConversation(requestParameters: PostConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostConversationResponse>;
83
+ /**
84
+ * Creates request options for postMessage without sending the request
85
+ */
86
+ postMessageRequestOpts(requestParameters: PostMessageRequest): Promise<runtime.RequestOpts>;
87
+ /**
88
+ * Send a message to a conversation
89
+ */
90
+ postMessageRaw(requestParameters: PostMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostMessageResponse>>;
91
+ /**
92
+ * Send a message to a conversation
93
+ */
94
+ postMessage(requestParameters: PostMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostMessageResponse>;
95
+ }
@@ -0,0 +1,235 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * LMS API
6
+ * LMS API
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.ChatApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class ChatApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates request options for deleteConversation without sending the request
34
+ */
35
+ deleteConversationRequestOpts(requestParameters) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['conversationId'] == null) {
38
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling deleteConversation().');
39
+ }
40
+ const queryParameters = {};
41
+ const headerParameters = {};
42
+ let urlPath = `/chat/conversations/{conversationId}`;
43
+ urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
44
+ return {
45
+ path: urlPath,
46
+ method: 'DELETE',
47
+ headers: headerParameters,
48
+ query: queryParameters,
49
+ };
50
+ });
51
+ }
52
+ /**
53
+ * Delete a conversation
54
+ */
55
+ deleteConversationRaw(requestParameters, initOverrides) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ const requestOptions = yield this.deleteConversationRequestOpts(requestParameters);
58
+ const response = yield this.request(requestOptions, initOverrides);
59
+ return new runtime.VoidApiResponse(response);
60
+ });
61
+ }
62
+ /**
63
+ * Delete a conversation
64
+ */
65
+ deleteConversation(requestParameters, initOverrides) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ yield this.deleteConversationRaw(requestParameters, initOverrides);
68
+ });
69
+ }
70
+ /**
71
+ * Creates request options for getConversationMessages without sending the request
72
+ */
73
+ getConversationMessagesRequestOpts(requestParameters) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ if (requestParameters['conversationId'] == null) {
76
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling getConversationMessages().');
77
+ }
78
+ const queryParameters = {};
79
+ const headerParameters = {};
80
+ let urlPath = `/chat/conversations/{conversationId}/messages`;
81
+ urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
82
+ return {
83
+ path: urlPath,
84
+ method: 'GET',
85
+ headers: headerParameters,
86
+ query: queryParameters,
87
+ };
88
+ });
89
+ }
90
+ /**
91
+ * Get all messages in a conversation
92
+ */
93
+ getConversationMessagesRaw(requestParameters, initOverrides) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ const requestOptions = yield this.getConversationMessagesRequestOpts(requestParameters);
96
+ const response = yield this.request(requestOptions, initOverrides);
97
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.GetChatMessageFromJSON));
98
+ });
99
+ }
100
+ /**
101
+ * Get all messages in a conversation
102
+ */
103
+ getConversationMessages(requestParameters, initOverrides) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ const response = yield this.getConversationMessagesRaw(requestParameters, initOverrides);
106
+ return yield response.value();
107
+ });
108
+ }
109
+ /**
110
+ * Creates request options for getConversations without sending the request
111
+ */
112
+ getConversationsRequestOpts(requestParameters) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ const queryParameters = {};
115
+ if (requestParameters['page'] != null) {
116
+ queryParameters['page'] = requestParameters['page'];
117
+ }
118
+ if (requestParameters['pageSize'] != null) {
119
+ queryParameters['pageSize'] = requestParameters['pageSize'];
120
+ }
121
+ const headerParameters = {};
122
+ let urlPath = `/chat/conversations`;
123
+ return {
124
+ path: urlPath,
125
+ method: 'GET',
126
+ headers: headerParameters,
127
+ query: queryParameters,
128
+ };
129
+ });
130
+ }
131
+ /**
132
+ * List conversations for the current user
133
+ */
134
+ getConversationsRaw(requestParameters, initOverrides) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const requestOptions = yield this.getConversationsRequestOpts(requestParameters);
137
+ const response = yield this.request(requestOptions, initOverrides);
138
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetConversationListFromJSON)(jsonValue));
139
+ });
140
+ }
141
+ /**
142
+ * List conversations for the current user
143
+ */
144
+ getConversations() {
145
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
146
+ const response = yield this.getConversationsRaw(requestParameters, initOverrides);
147
+ return yield response.value();
148
+ });
149
+ }
150
+ /**
151
+ * Creates request options for postConversation without sending the request
152
+ */
153
+ postConversationRequestOpts(requestParameters) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ if (requestParameters['postConversation'] == null) {
156
+ throw new runtime.RequiredError('postConversation', 'Required parameter "postConversation" was null or undefined when calling postConversation().');
157
+ }
158
+ const queryParameters = {};
159
+ const headerParameters = {};
160
+ headerParameters['Content-Type'] = 'application/json';
161
+ let urlPath = `/chat/conversations`;
162
+ return {
163
+ path: urlPath,
164
+ method: 'POST',
165
+ headers: headerParameters,
166
+ query: queryParameters,
167
+ body: (0, index_1.PostConversationToJSON)(requestParameters['postConversation']),
168
+ };
169
+ });
170
+ }
171
+ /**
172
+ * Create a new conversation
173
+ */
174
+ postConversationRaw(requestParameters, initOverrides) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ const requestOptions = yield this.postConversationRequestOpts(requestParameters);
177
+ const response = yield this.request(requestOptions, initOverrides);
178
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PostConversationResponseFromJSON)(jsonValue));
179
+ });
180
+ }
181
+ /**
182
+ * Create a new conversation
183
+ */
184
+ postConversation(requestParameters, initOverrides) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ const response = yield this.postConversationRaw(requestParameters, initOverrides);
187
+ return yield response.value();
188
+ });
189
+ }
190
+ /**
191
+ * Creates request options for postMessage without sending the request
192
+ */
193
+ postMessageRequestOpts(requestParameters) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ if (requestParameters['conversationId'] == null) {
196
+ throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling postMessage().');
197
+ }
198
+ if (requestParameters['postMessage'] == null) {
199
+ throw new runtime.RequiredError('postMessage', 'Required parameter "postMessage" was null or undefined when calling postMessage().');
200
+ }
201
+ const queryParameters = {};
202
+ const headerParameters = {};
203
+ headerParameters['Content-Type'] = 'application/json';
204
+ let urlPath = `/chat/conversations/{conversationId}/messages`;
205
+ urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
206
+ return {
207
+ path: urlPath,
208
+ method: 'POST',
209
+ headers: headerParameters,
210
+ query: queryParameters,
211
+ body: (0, index_1.PostMessageToJSON)(requestParameters['postMessage']),
212
+ };
213
+ });
214
+ }
215
+ /**
216
+ * Send a message to a conversation
217
+ */
218
+ postMessageRaw(requestParameters, initOverrides) {
219
+ return __awaiter(this, void 0, void 0, function* () {
220
+ const requestOptions = yield this.postMessageRequestOpts(requestParameters);
221
+ const response = yield this.request(requestOptions, initOverrides);
222
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PostMessageResponseFromJSON)(jsonValue));
223
+ });
224
+ }
225
+ /**
226
+ * Send a message to a conversation
227
+ */
228
+ postMessage(requestParameters, initOverrides) {
229
+ return __awaiter(this, void 0, void 0, function* () {
230
+ const response = yield this.postMessageRaw(requestParameters, initOverrides);
231
+ return yield response.value();
232
+ });
233
+ }
234
+ }
235
+ exports.ChatApi = ChatApi;
@@ -1,3 +1,4 @@
1
+ export * from './ChatApi';
1
2
  export * from './ContentApi';
2
3
  export * from './CourseApi';
3
4
  export * from './ModuleApi';
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
+ __exportStar(require("./ChatApi"), exports);
19
20
  __exportStar(require("./ContentApi"), exports);
20
21
  __exportStar(require("./CourseApi"), exports);
21
22
  __exportStar(require("./ModuleApi"), exports);
@@ -0,0 +1,95 @@
1
+ /**
2
+ * LMS API
3
+ * LMS API
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 { GetChatMessage, GetConversationList, PostConversation, PostConversationResponse, PostMessage, PostMessageResponse } from '../models/index';
14
+ export interface DeleteConversationRequest {
15
+ conversationId: string;
16
+ }
17
+ export interface GetConversationMessagesRequest {
18
+ conversationId: string;
19
+ }
20
+ export interface GetConversationsRequest {
21
+ page?: number;
22
+ pageSize?: number;
23
+ }
24
+ export interface PostConversationRequest {
25
+ postConversation: PostConversation;
26
+ }
27
+ export interface PostMessageRequest {
28
+ conversationId: string;
29
+ postMessage: PostMessage;
30
+ }
31
+ /**
32
+ *
33
+ */
34
+ export declare class ChatApi extends runtime.BaseAPI {
35
+ /**
36
+ * Creates request options for deleteConversation without sending the request
37
+ */
38
+ deleteConversationRequestOpts(requestParameters: DeleteConversationRequest): Promise<runtime.RequestOpts>;
39
+ /**
40
+ * Delete a conversation
41
+ */
42
+ deleteConversationRaw(requestParameters: DeleteConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
43
+ /**
44
+ * Delete a conversation
45
+ */
46
+ deleteConversation(requestParameters: DeleteConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
47
+ /**
48
+ * Creates request options for getConversationMessages without sending the request
49
+ */
50
+ getConversationMessagesRequestOpts(requestParameters: GetConversationMessagesRequest): Promise<runtime.RequestOpts>;
51
+ /**
52
+ * Get all messages in a conversation
53
+ */
54
+ getConversationMessagesRaw(requestParameters: GetConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<GetChatMessage>>>;
55
+ /**
56
+ * Get all messages in a conversation
57
+ */
58
+ getConversationMessages(requestParameters: GetConversationMessagesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<GetChatMessage>>;
59
+ /**
60
+ * Creates request options for getConversations without sending the request
61
+ */
62
+ getConversationsRequestOpts(requestParameters: GetConversationsRequest): Promise<runtime.RequestOpts>;
63
+ /**
64
+ * List conversations for the current user
65
+ */
66
+ getConversationsRaw(requestParameters: GetConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetConversationList>>;
67
+ /**
68
+ * List conversations for the current user
69
+ */
70
+ getConversations(requestParameters?: GetConversationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetConversationList>;
71
+ /**
72
+ * Creates request options for postConversation without sending the request
73
+ */
74
+ postConversationRequestOpts(requestParameters: PostConversationRequest): Promise<runtime.RequestOpts>;
75
+ /**
76
+ * Create a new conversation
77
+ */
78
+ postConversationRaw(requestParameters: PostConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostConversationResponse>>;
79
+ /**
80
+ * Create a new conversation
81
+ */
82
+ postConversation(requestParameters: PostConversationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostConversationResponse>;
83
+ /**
84
+ * Creates request options for postMessage without sending the request
85
+ */
86
+ postMessageRequestOpts(requestParameters: PostMessageRequest): Promise<runtime.RequestOpts>;
87
+ /**
88
+ * Send a message to a conversation
89
+ */
90
+ postMessageRaw(requestParameters: PostMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PostMessageResponse>>;
91
+ /**
92
+ * Send a message to a conversation
93
+ */
94
+ postMessage(requestParameters: PostMessageRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PostMessageResponse>;
95
+ }