starta.apiclient 1.37.1020 → 1.37.1024
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.
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { StartaRequestRunner } from '../types';
|
|
2
|
-
export default class
|
|
2
|
+
export default class Chats {
|
|
3
3
|
private _requestRunner;
|
|
4
4
|
constructor(requestRunner: StartaRequestRunner);
|
|
5
|
-
setRequestRunner(requestRunner: StartaRequestRunner): void;
|
|
6
5
|
getMessages(login: any): Promise<import("../types").StartaResponse>;
|
|
7
6
|
addMessage(login: any, { message: { text } }: {
|
|
8
7
|
message: {
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var
|
|
4
|
-
function
|
|
3
|
+
var Chats = /** @class */ (function () {
|
|
4
|
+
function Chats(requestRunner) {
|
|
5
5
|
this._requestRunner = requestRunner;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
this._requestRunner = requestRunner;
|
|
9
|
-
};
|
|
10
|
-
Chat.prototype.getMessages = function (login) {
|
|
7
|
+
Chats.prototype.getMessages = function (login) {
|
|
11
8
|
return this._requestRunner.performRequest({
|
|
12
9
|
url: "accounts/".concat(login, "/chatMessages"),
|
|
13
10
|
method: 'GET',
|
|
11
|
+
config: {
|
|
12
|
+
rewriteBaseUrl: function (url) {
|
|
13
|
+
return url.replace('/api', '/comm/api');
|
|
14
|
+
},
|
|
15
|
+
},
|
|
14
16
|
});
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
Chats.prototype.addMessage = function (login, _a) {
|
|
17
19
|
var text = _a.message.text;
|
|
18
20
|
return this._requestRunner.performRequest({
|
|
19
21
|
url: "accounts/".concat(login, "/chatMessages"),
|
|
@@ -23,8 +25,13 @@ var Chat = /** @class */ (function () {
|
|
|
23
25
|
text: text
|
|
24
26
|
},
|
|
25
27
|
},
|
|
28
|
+
config: {
|
|
29
|
+
rewriteBaseUrl: function (url) {
|
|
30
|
+
return url.replace('/api', '/comm/api');
|
|
31
|
+
},
|
|
32
|
+
},
|
|
26
33
|
});
|
|
27
34
|
};
|
|
28
|
-
return
|
|
35
|
+
return Chats;
|
|
29
36
|
}());
|
|
30
|
-
exports.default =
|
|
37
|
+
exports.default = Chats;
|
package/lib/services/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import Healthcheck from './healthcheck';
|
|
|
6
6
|
import PasswordResets from './passwordResets';
|
|
7
7
|
import EmailConfirmations from './emailConfirmations';
|
|
8
8
|
import System from './system';
|
|
9
|
-
import
|
|
9
|
+
import Chats from './chats';
|
|
10
10
|
import Webhooks from './webhooks';
|
|
11
11
|
export default class StartaApiClient {
|
|
12
12
|
private _requestRunner;
|
|
@@ -20,5 +20,5 @@ export default class StartaApiClient {
|
|
|
20
20
|
get system(): System;
|
|
21
21
|
get emailConfirmations(): EmailConfirmations;
|
|
22
22
|
get healthcheck(): Healthcheck;
|
|
23
|
-
get
|
|
23
|
+
get chats(): Chats;
|
|
24
24
|
}
|
package/lib/services/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var healthcheck_1 = require("./healthcheck");
|
|
|
7
7
|
var passwordResets_1 = require("./passwordResets");
|
|
8
8
|
var emailConfirmations_1 = require("./emailConfirmations");
|
|
9
9
|
var system_1 = require("./system");
|
|
10
|
-
var
|
|
10
|
+
var chats_1 = require("./chats");
|
|
11
11
|
var webhooks_1 = require("./webhooks");
|
|
12
12
|
var StartaApiClient = /** @class */ (function () {
|
|
13
13
|
function StartaApiClient(requestRunner) {
|
|
@@ -72,11 +72,9 @@ var StartaApiClient = /** @class */ (function () {
|
|
|
72
72
|
enumerable: false,
|
|
73
73
|
configurable: true
|
|
74
74
|
});
|
|
75
|
-
Object.defineProperty(StartaApiClient.prototype, "
|
|
75
|
+
Object.defineProperty(StartaApiClient.prototype, "chats", {
|
|
76
76
|
get: function () {
|
|
77
|
-
|
|
78
|
-
chat.setRequestRunner(this._requestRunner.replaceBaseUrl(function (baseUrl) { return baseUrl.replace('/api', '/comm/api'); }));
|
|
79
|
-
return chat;
|
|
77
|
+
return new chats_1.default(this._requestRunner);
|
|
80
78
|
},
|
|
81
79
|
enumerable: false,
|
|
82
80
|
configurable: true
|