@easyedu/js-lsm-api 1.39.0 → 1.41.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.
- package/.openapi-generator/FILES +18 -0
- package/README.md +24 -9
- package/dist/apis/ChatApi.d.ts +95 -0
- package/dist/apis/ChatApi.js +235 -0
- package/dist/apis/PortalApi.d.ts +32 -1
- package/dist/apis/PortalApi.js +99 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/ChatApi.d.ts +95 -0
- package/dist/esm/apis/ChatApi.js +231 -0
- package/dist/esm/apis/PortalApi.d.ts +32 -1
- package/dist/esm/apis/PortalApi.js +100 -1
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/GetChatMessage.d.ts +44 -0
- package/dist/esm/models/GetChatMessage.js +51 -0
- package/dist/esm/models/GetConversation.d.ts +50 -0
- package/dist/esm/models/GetConversation.js +53 -0
- package/dist/esm/models/GetConversationList.d.ts +57 -0
- package/dist/esm/models/GetConversationList.js +60 -0
- package/dist/esm/models/GetPortal.d.ts +1 -1
- package/dist/esm/models/GetPortal.js +1 -3
- package/dist/esm/models/GetPortalLogoUpload.d.ts +32 -0
- package/dist/esm/models/GetPortalLogoUpload.js +43 -0
- package/dist/esm/models/PostConversation.d.ts +32 -0
- package/dist/esm/models/PostConversation.js +43 -0
- package/dist/esm/models/PostConversationResponse.d.ts +44 -0
- package/dist/esm/models/PostConversationResponse.js +51 -0
- package/dist/esm/models/PostMessage.d.ts +32 -0
- package/dist/esm/models/PostMessage.js +43 -0
- package/dist/esm/models/PostMessageResponse.d.ts +38 -0
- package/dist/esm/models/PostMessageResponse.js +47 -0
- package/dist/esm/models/index.d.ts +8 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/models/GetChatMessage.d.ts +44 -0
- package/dist/models/GetChatMessage.js +58 -0
- package/dist/models/GetConversation.d.ts +50 -0
- package/dist/models/GetConversation.js +60 -0
- package/dist/models/GetConversationList.d.ts +57 -0
- package/dist/models/GetConversationList.js +67 -0
- package/dist/models/GetPortal.d.ts +1 -1
- package/dist/models/GetPortal.js +1 -3
- package/dist/models/GetPortalLogoUpload.d.ts +32 -0
- package/dist/models/GetPortalLogoUpload.js +50 -0
- package/dist/models/PostConversation.d.ts +32 -0
- package/dist/models/PostConversation.js +50 -0
- package/dist/models/PostConversationResponse.d.ts +44 -0
- package/dist/models/PostConversationResponse.js +58 -0
- package/dist/models/PostMessage.d.ts +32 -0
- package/dist/models/PostMessage.js +50 -0
- package/dist/models/PostMessageResponse.d.ts +38 -0
- package/dist/models/PostMessageResponse.js +54 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.js +8 -0
- package/docs/ChatApi.md +357 -0
- package/docs/GetChatMessage.md +38 -0
- package/docs/GetConversation.md +40 -0
- package/docs/GetConversationList.md +42 -0
- package/docs/GetPortalLogoUpload.md +34 -0
- package/docs/PortalApi.md +138 -0
- package/docs/PostConversation.md +34 -0
- package/docs/PostConversationResponse.md +38 -0
- package/docs/PostMessage.md +34 -0
- package/docs/PostMessageResponse.md +36 -0
- package/package.json +1 -1
- package/src/apis/ChatApi.ts +303 -0
- package/src/apis/PortalApi.ts +129 -0
- package/src/apis/index.ts +1 -0
- package/src/models/GetChatMessage.ts +84 -0
- package/src/models/GetConversation.ts +92 -0
- package/src/models/GetConversationList.ts +110 -0
- package/src/models/GetPortal.ts +2 -3
- package/src/models/GetPortalLogoUpload.ts +66 -0
- package/src/models/PostConversation.ts +66 -0
- package/src/models/PostConversationResponse.ts +84 -0
- package/src/models/PostMessage.ts +66 -0
- package/src/models/PostMessageResponse.ts +75 -0
- package/src/models/index.ts +8 -0
package/dist/apis/PortalApi.js
CHANGED
|
@@ -29,6 +29,44 @@ const index_1 = require("../models/index");
|
|
|
29
29
|
*
|
|
30
30
|
*/
|
|
31
31
|
class PortalApi extends runtime.BaseAPI {
|
|
32
|
+
/**
|
|
33
|
+
* Creates request options for deletePortalLogo without sending the request
|
|
34
|
+
*/
|
|
35
|
+
deletePortalLogoRequestOpts(requestParameters) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
if (requestParameters['portalId'] == null) {
|
|
38
|
+
throw new runtime.RequiredError('portalId', 'Required parameter "portalId" was null or undefined when calling deletePortalLogo().');
|
|
39
|
+
}
|
|
40
|
+
const queryParameters = {};
|
|
41
|
+
const headerParameters = {};
|
|
42
|
+
let urlPath = `/portals/{portalId}/branding/logo`;
|
|
43
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
44
|
+
return {
|
|
45
|
+
path: urlPath,
|
|
46
|
+
method: 'DELETE',
|
|
47
|
+
headers: headerParameters,
|
|
48
|
+
query: queryParameters,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Remove the portal logo
|
|
54
|
+
*/
|
|
55
|
+
deletePortalLogoRaw(requestParameters, initOverrides) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const requestOptions = yield this.deletePortalLogoRequestOpts(requestParameters);
|
|
58
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
59
|
+
return new runtime.VoidApiResponse(response);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Remove the portal logo
|
|
64
|
+
*/
|
|
65
|
+
deletePortalLogo(requestParameters, initOverrides) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
yield this.deletePortalLogoRaw(requestParameters, initOverrides);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
32
70
|
/**
|
|
33
71
|
* Creates request options for getPortalById without sending the request
|
|
34
72
|
*/
|
|
@@ -240,6 +278,67 @@ class PortalApi extends runtime.BaseAPI {
|
|
|
240
278
|
return yield response.value();
|
|
241
279
|
});
|
|
242
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* Creates request options for postPortalLogoUpload without sending the request
|
|
283
|
+
*/
|
|
284
|
+
postPortalLogoUploadRequestOpts(requestParameters) {
|
|
285
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
286
|
+
if (requestParameters['portalId'] == null) {
|
|
287
|
+
throw new runtime.RequiredError('portalId', 'Required parameter "portalId" was null or undefined when calling postPortalLogoUpload().');
|
|
288
|
+
}
|
|
289
|
+
if (requestParameters['file'] == null) {
|
|
290
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling postPortalLogoUpload().');
|
|
291
|
+
}
|
|
292
|
+
const queryParameters = {};
|
|
293
|
+
const headerParameters = {};
|
|
294
|
+
const consumes = [
|
|
295
|
+
{ contentType: 'multipart/form-data' },
|
|
296
|
+
];
|
|
297
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
298
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
299
|
+
let formParams;
|
|
300
|
+
let useForm = false;
|
|
301
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
302
|
+
useForm = canConsumeForm;
|
|
303
|
+
if (useForm) {
|
|
304
|
+
formParams = new FormData();
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
formParams = new URLSearchParams();
|
|
308
|
+
}
|
|
309
|
+
if (requestParameters['file'] != null) {
|
|
310
|
+
formParams.append('file', requestParameters['file']);
|
|
311
|
+
}
|
|
312
|
+
let urlPath = `/portals/{portalId}/branding/logo`;
|
|
313
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
314
|
+
return {
|
|
315
|
+
path: urlPath,
|
|
316
|
+
method: 'POST',
|
|
317
|
+
headers: headerParameters,
|
|
318
|
+
query: queryParameters,
|
|
319
|
+
body: formParams,
|
|
320
|
+
};
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Upload a logo image for portal branding
|
|
325
|
+
*/
|
|
326
|
+
postPortalLogoUploadRaw(requestParameters, initOverrides) {
|
|
327
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
328
|
+
const requestOptions = yield this.postPortalLogoUploadRequestOpts(requestParameters);
|
|
329
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
330
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GetPortalLogoUploadFromJSON)(jsonValue));
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Upload a logo image for portal branding
|
|
335
|
+
*/
|
|
336
|
+
postPortalLogoUpload(requestParameters, initOverrides) {
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
const response = yield this.postPortalLogoUploadRaw(requestParameters, initOverrides);
|
|
339
|
+
return yield response.value();
|
|
340
|
+
});
|
|
341
|
+
}
|
|
243
342
|
/**
|
|
244
343
|
* Creates request options for putPortalBranding without sending the request
|
|
245
344
|
*/
|
package/dist/apis/index.d.ts
CHANGED
package/dist/apis/index.js
CHANGED
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* LMS API
|
|
5
|
+
* LMS API
|
|
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 { GetChatMessageFromJSON, GetConversationListFromJSON, PostConversationToJSON, PostConversationResponseFromJSON, PostMessageToJSON, PostMessageResponseFromJSON, } from '../models/index';
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class ChatApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for deleteConversation without sending the request
|
|
31
|
+
*/
|
|
32
|
+
deleteConversationRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['conversationId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling deleteConversation().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
let urlPath = `/chat/conversations/{conversationId}`;
|
|
40
|
+
urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
|
|
41
|
+
return {
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: 'DELETE',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Delete a conversation
|
|
51
|
+
*/
|
|
52
|
+
deleteConversationRaw(requestParameters, initOverrides) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const requestOptions = yield this.deleteConversationRequestOpts(requestParameters);
|
|
55
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
56
|
+
return new runtime.VoidApiResponse(response);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Delete a conversation
|
|
61
|
+
*/
|
|
62
|
+
deleteConversation(requestParameters, initOverrides) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield this.deleteConversationRaw(requestParameters, initOverrides);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for getConversationMessages without sending the request
|
|
69
|
+
*/
|
|
70
|
+
getConversationMessagesRequestOpts(requestParameters) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
if (requestParameters['conversationId'] == null) {
|
|
73
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling getConversationMessages().');
|
|
74
|
+
}
|
|
75
|
+
const queryParameters = {};
|
|
76
|
+
const headerParameters = {};
|
|
77
|
+
let urlPath = `/chat/conversations/{conversationId}/messages`;
|
|
78
|
+
urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
|
|
79
|
+
return {
|
|
80
|
+
path: urlPath,
|
|
81
|
+
method: 'GET',
|
|
82
|
+
headers: headerParameters,
|
|
83
|
+
query: queryParameters,
|
|
84
|
+
};
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get all messages in a conversation
|
|
89
|
+
*/
|
|
90
|
+
getConversationMessagesRaw(requestParameters, initOverrides) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const requestOptions = yield this.getConversationMessagesRequestOpts(requestParameters);
|
|
93
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
94
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(GetChatMessageFromJSON));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Get all messages in a conversation
|
|
99
|
+
*/
|
|
100
|
+
getConversationMessages(requestParameters, initOverrides) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
const response = yield this.getConversationMessagesRaw(requestParameters, initOverrides);
|
|
103
|
+
return yield response.value();
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates request options for getConversations without sending the request
|
|
108
|
+
*/
|
|
109
|
+
getConversationsRequestOpts(requestParameters) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
const queryParameters = {};
|
|
112
|
+
if (requestParameters['page'] != null) {
|
|
113
|
+
queryParameters['page'] = requestParameters['page'];
|
|
114
|
+
}
|
|
115
|
+
if (requestParameters['pageSize'] != null) {
|
|
116
|
+
queryParameters['pageSize'] = requestParameters['pageSize'];
|
|
117
|
+
}
|
|
118
|
+
const headerParameters = {};
|
|
119
|
+
let urlPath = `/chat/conversations`;
|
|
120
|
+
return {
|
|
121
|
+
path: urlPath,
|
|
122
|
+
method: 'GET',
|
|
123
|
+
headers: headerParameters,
|
|
124
|
+
query: queryParameters,
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* List conversations for the current user
|
|
130
|
+
*/
|
|
131
|
+
getConversationsRaw(requestParameters, initOverrides) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
const requestOptions = yield this.getConversationsRequestOpts(requestParameters);
|
|
134
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
135
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetConversationListFromJSON(jsonValue));
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* List conversations for the current user
|
|
140
|
+
*/
|
|
141
|
+
getConversations() {
|
|
142
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
143
|
+
const response = yield this.getConversationsRaw(requestParameters, initOverrides);
|
|
144
|
+
return yield response.value();
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Creates request options for postConversation without sending the request
|
|
149
|
+
*/
|
|
150
|
+
postConversationRequestOpts(requestParameters) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
152
|
+
if (requestParameters['postConversation'] == null) {
|
|
153
|
+
throw new runtime.RequiredError('postConversation', 'Required parameter "postConversation" was null or undefined when calling postConversation().');
|
|
154
|
+
}
|
|
155
|
+
const queryParameters = {};
|
|
156
|
+
const headerParameters = {};
|
|
157
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
158
|
+
let urlPath = `/chat/conversations`;
|
|
159
|
+
return {
|
|
160
|
+
path: urlPath,
|
|
161
|
+
method: 'POST',
|
|
162
|
+
headers: headerParameters,
|
|
163
|
+
query: queryParameters,
|
|
164
|
+
body: PostConversationToJSON(requestParameters['postConversation']),
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Create a new conversation
|
|
170
|
+
*/
|
|
171
|
+
postConversationRaw(requestParameters, initOverrides) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
const requestOptions = yield this.postConversationRequestOpts(requestParameters);
|
|
174
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
175
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PostConversationResponseFromJSON(jsonValue));
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Create a new conversation
|
|
180
|
+
*/
|
|
181
|
+
postConversation(requestParameters, initOverrides) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
const response = yield this.postConversationRaw(requestParameters, initOverrides);
|
|
184
|
+
return yield response.value();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates request options for postMessage without sending the request
|
|
189
|
+
*/
|
|
190
|
+
postMessageRequestOpts(requestParameters) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (requestParameters['conversationId'] == null) {
|
|
193
|
+
throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling postMessage().');
|
|
194
|
+
}
|
|
195
|
+
if (requestParameters['postMessage'] == null) {
|
|
196
|
+
throw new runtime.RequiredError('postMessage', 'Required parameter "postMessage" was null or undefined when calling postMessage().');
|
|
197
|
+
}
|
|
198
|
+
const queryParameters = {};
|
|
199
|
+
const headerParameters = {};
|
|
200
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
201
|
+
let urlPath = `/chat/conversations/{conversationId}/messages`;
|
|
202
|
+
urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
|
|
203
|
+
return {
|
|
204
|
+
path: urlPath,
|
|
205
|
+
method: 'POST',
|
|
206
|
+
headers: headerParameters,
|
|
207
|
+
query: queryParameters,
|
|
208
|
+
body: PostMessageToJSON(requestParameters['postMessage']),
|
|
209
|
+
};
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Send a message to a conversation
|
|
214
|
+
*/
|
|
215
|
+
postMessageRaw(requestParameters, initOverrides) {
|
|
216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
const requestOptions = yield this.postMessageRequestOpts(requestParameters);
|
|
218
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
219
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PostMessageResponseFromJSON(jsonValue));
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Send a message to a conversation
|
|
224
|
+
*/
|
|
225
|
+
postMessage(requestParameters, initOverrides) {
|
|
226
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
+
const response = yield this.postMessageRaw(requestParameters, initOverrides);
|
|
228
|
+
return yield response.value();
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
|
-
import type { GetPortal, GetPortalList, GetPortalUserList, PostPortal, PostPortalInvite, PutPortalBranding } from '../models/index';
|
|
13
|
+
import type { GetPortal, GetPortalList, GetPortalLogoUpload, GetPortalUserList, PostPortal, PostPortalInvite, PutPortalBranding } from '../models/index';
|
|
14
|
+
export interface DeletePortalLogoRequest {
|
|
15
|
+
portalId: string;
|
|
16
|
+
}
|
|
14
17
|
export interface GetPortalByIdRequest {
|
|
15
18
|
portalId: string;
|
|
16
19
|
}
|
|
@@ -29,6 +32,10 @@ export interface InviteUserToPortalRequest {
|
|
|
29
32
|
export interface PostPortalRequest {
|
|
30
33
|
postPortal: PostPortal;
|
|
31
34
|
}
|
|
35
|
+
export interface PostPortalLogoUploadRequest {
|
|
36
|
+
portalId: string;
|
|
37
|
+
file: Blob;
|
|
38
|
+
}
|
|
32
39
|
export interface PutPortalBrandingRequest {
|
|
33
40
|
portalId: string;
|
|
34
41
|
putPortalBranding: PutPortalBranding;
|
|
@@ -40,6 +47,18 @@ export interface UpdateSelectedPortalRequest {
|
|
|
40
47
|
*
|
|
41
48
|
*/
|
|
42
49
|
export declare class PortalApi extends runtime.BaseAPI {
|
|
50
|
+
/**
|
|
51
|
+
* Creates request options for deletePortalLogo without sending the request
|
|
52
|
+
*/
|
|
53
|
+
deletePortalLogoRequestOpts(requestParameters: DeletePortalLogoRequest): Promise<runtime.RequestOpts>;
|
|
54
|
+
/**
|
|
55
|
+
* Remove the portal logo
|
|
56
|
+
*/
|
|
57
|
+
deletePortalLogoRaw(requestParameters: DeletePortalLogoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
58
|
+
/**
|
|
59
|
+
* Remove the portal logo
|
|
60
|
+
*/
|
|
61
|
+
deletePortalLogo(requestParameters: DeletePortalLogoRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
43
62
|
/**
|
|
44
63
|
* Creates request options for getPortalById without sending the request
|
|
45
64
|
*/
|
|
@@ -100,6 +119,18 @@ export declare class PortalApi extends runtime.BaseAPI {
|
|
|
100
119
|
* Create a new portal as a child of the current selected portal
|
|
101
120
|
*/
|
|
102
121
|
postPortal(requestParameters: PostPortalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetPortal>;
|
|
122
|
+
/**
|
|
123
|
+
* Creates request options for postPortalLogoUpload without sending the request
|
|
124
|
+
*/
|
|
125
|
+
postPortalLogoUploadRequestOpts(requestParameters: PostPortalLogoUploadRequest): Promise<runtime.RequestOpts>;
|
|
126
|
+
/**
|
|
127
|
+
* Upload a logo image for portal branding
|
|
128
|
+
*/
|
|
129
|
+
postPortalLogoUploadRaw(requestParameters: PostPortalLogoUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetPortalLogoUpload>>;
|
|
130
|
+
/**
|
|
131
|
+
* Upload a logo image for portal branding
|
|
132
|
+
*/
|
|
133
|
+
postPortalLogoUpload(requestParameters: PostPortalLogoUploadRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetPortalLogoUpload>;
|
|
103
134
|
/**
|
|
104
135
|
* Creates request options for putPortalBranding without sending the request
|
|
105
136
|
*/
|
|
@@ -21,11 +21,49 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
import * as runtime from '../runtime';
|
|
24
|
-
import { GetPortalFromJSON, GetPortalListFromJSON, GetPortalUserListFromJSON, PostPortalToJSON, PostPortalInviteToJSON, PutPortalBrandingToJSON, } from '../models/index';
|
|
24
|
+
import { GetPortalFromJSON, GetPortalListFromJSON, GetPortalLogoUploadFromJSON, GetPortalUserListFromJSON, PostPortalToJSON, PostPortalInviteToJSON, PutPortalBrandingToJSON, } from '../models/index';
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
27
|
*/
|
|
28
28
|
export class PortalApi extends runtime.BaseAPI {
|
|
29
|
+
/**
|
|
30
|
+
* Creates request options for deletePortalLogo without sending the request
|
|
31
|
+
*/
|
|
32
|
+
deletePortalLogoRequestOpts(requestParameters) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
if (requestParameters['portalId'] == null) {
|
|
35
|
+
throw new runtime.RequiredError('portalId', 'Required parameter "portalId" was null or undefined when calling deletePortalLogo().');
|
|
36
|
+
}
|
|
37
|
+
const queryParameters = {};
|
|
38
|
+
const headerParameters = {};
|
|
39
|
+
let urlPath = `/portals/{portalId}/branding/logo`;
|
|
40
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
41
|
+
return {
|
|
42
|
+
path: urlPath,
|
|
43
|
+
method: 'DELETE',
|
|
44
|
+
headers: headerParameters,
|
|
45
|
+
query: queryParameters,
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Remove the portal logo
|
|
51
|
+
*/
|
|
52
|
+
deletePortalLogoRaw(requestParameters, initOverrides) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const requestOptions = yield this.deletePortalLogoRequestOpts(requestParameters);
|
|
55
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
56
|
+
return new runtime.VoidApiResponse(response);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Remove the portal logo
|
|
61
|
+
*/
|
|
62
|
+
deletePortalLogo(requestParameters, initOverrides) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
yield this.deletePortalLogoRaw(requestParameters, initOverrides);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
29
67
|
/**
|
|
30
68
|
* Creates request options for getPortalById without sending the request
|
|
31
69
|
*/
|
|
@@ -237,6 +275,67 @@ export class PortalApi extends runtime.BaseAPI {
|
|
|
237
275
|
return yield response.value();
|
|
238
276
|
});
|
|
239
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Creates request options for postPortalLogoUpload without sending the request
|
|
280
|
+
*/
|
|
281
|
+
postPortalLogoUploadRequestOpts(requestParameters) {
|
|
282
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
283
|
+
if (requestParameters['portalId'] == null) {
|
|
284
|
+
throw new runtime.RequiredError('portalId', 'Required parameter "portalId" was null or undefined when calling postPortalLogoUpload().');
|
|
285
|
+
}
|
|
286
|
+
if (requestParameters['file'] == null) {
|
|
287
|
+
throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling postPortalLogoUpload().');
|
|
288
|
+
}
|
|
289
|
+
const queryParameters = {};
|
|
290
|
+
const headerParameters = {};
|
|
291
|
+
const consumes = [
|
|
292
|
+
{ contentType: 'multipart/form-data' },
|
|
293
|
+
];
|
|
294
|
+
// @ts-ignore: canConsumeForm may be unused
|
|
295
|
+
const canConsumeForm = runtime.canConsumeForm(consumes);
|
|
296
|
+
let formParams;
|
|
297
|
+
let useForm = false;
|
|
298
|
+
// use FormData to transmit files using content-type "multipart/form-data"
|
|
299
|
+
useForm = canConsumeForm;
|
|
300
|
+
if (useForm) {
|
|
301
|
+
formParams = new FormData();
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
formParams = new URLSearchParams();
|
|
305
|
+
}
|
|
306
|
+
if (requestParameters['file'] != null) {
|
|
307
|
+
formParams.append('file', requestParameters['file']);
|
|
308
|
+
}
|
|
309
|
+
let urlPath = `/portals/{portalId}/branding/logo`;
|
|
310
|
+
urlPath = urlPath.replace(`{${"portalId"}}`, encodeURIComponent(String(requestParameters['portalId'])));
|
|
311
|
+
return {
|
|
312
|
+
path: urlPath,
|
|
313
|
+
method: 'POST',
|
|
314
|
+
headers: headerParameters,
|
|
315
|
+
query: queryParameters,
|
|
316
|
+
body: formParams,
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Upload a logo image for portal branding
|
|
322
|
+
*/
|
|
323
|
+
postPortalLogoUploadRaw(requestParameters, initOverrides) {
|
|
324
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
+
const requestOptions = yield this.postPortalLogoUploadRequestOpts(requestParameters);
|
|
326
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
327
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetPortalLogoUploadFromJSON(jsonValue));
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Upload a logo image for portal branding
|
|
332
|
+
*/
|
|
333
|
+
postPortalLogoUpload(requestParameters, initOverrides) {
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const response = yield this.postPortalLogoUploadRaw(requestParameters, initOverrides);
|
|
336
|
+
return yield response.value();
|
|
337
|
+
});
|
|
338
|
+
}
|
|
240
339
|
/**
|
|
241
340
|
* Creates request options for putPortalBranding without sending the request
|
|
242
341
|
*/
|
package/dist/esm/apis/index.d.ts
CHANGED