@wildix/wim-wilma-client 0.0.2
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/dist-cjs/Wilma.js +21 -0
- package/dist-cjs/WilmaClient.js +41 -0
- package/dist-cjs/commands/DeleteChatCommand.js +21 -0
- package/dist-cjs/commands/DislikeAnswerCommand.js +21 -0
- package/dist-cjs/commands/GetChatCommand.js +21 -0
- package/dist-cjs/commands/LikeAnswerCommand.js +21 -0
- package/dist-cjs/commands/ListChatsCommand.js +21 -0
- package/dist-cjs/commands/index.js +8 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +10 -0
- package/dist-cjs/models/WilmaServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +47 -0
- package/dist-cjs/protocols/Aws_restJson1.js +269 -0
- package/dist-cjs/runtimeConfig.browser.js +32 -0
- package/dist-cjs/runtimeConfig.js +37 -0
- package/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist-cjs/runtimeConfig.shared.js +21 -0
- package/dist-cjs/runtimeExtensions.js +11 -0
- package/dist-es/Wilma.js +17 -0
- package/dist-es/WilmaClient.js +37 -0
- package/dist-es/commands/DeleteChatCommand.js +17 -0
- package/dist-es/commands/DislikeAnswerCommand.js +17 -0
- package/dist-es/commands/GetChatCommand.js +17 -0
- package/dist-es/commands/LikeAnswerCommand.js +17 -0
- package/dist-es/commands/ListChatsCommand.js +17 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/WilmaServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +41 -0
- package/dist-es/protocols/Aws_restJson1.js +256 -0
- package/dist-es/runtimeConfig.browser.js +27 -0
- package/dist-es/runtimeConfig.js +32 -0
- package/dist-es/runtimeConfig.native.js +11 -0
- package/dist-es/runtimeConfig.shared.js +17 -0
- package/dist-es/runtimeExtensions.js +7 -0
- package/dist-types/Wilma.d.ts +45 -0
- package/dist-types/WilmaClient.d.ts +148 -0
- package/dist-types/commands/DeleteChatCommand.d.ts +76 -0
- package/dist-types/commands/DislikeAnswerCommand.d.ts +83 -0
- package/dist-types/commands/GetChatCommand.d.ts +94 -0
- package/dist-types/commands/LikeAnswerCommand.d.ts +83 -0
- package/dist-types/commands/ListChatsCommand.d.ts +87 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/extensionConfiguration.d.ts +7 -0
- package/dist-types/index.d.ts +7 -0
- package/dist-types/models/WilmaServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +195 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +47 -0
- package/dist-types/runtimeConfig.browser.d.ts +31 -0
- package/dist-types/runtimeConfig.d.ts +31 -0
- package/dist-types/runtimeConfig.native.d.ts +30 -0
- package/dist-types/runtimeConfig.shared.d.ts +15 -0
- package/dist-types/runtimeExtensions.d.ts +17 -0
- package/package.json +83 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Wilma = void 0;
|
|
4
|
+
const WilmaClient_1 = require("./WilmaClient");
|
|
5
|
+
const DeleteChatCommand_1 = require("./commands/DeleteChatCommand");
|
|
6
|
+
const DislikeAnswerCommand_1 = require("./commands/DislikeAnswerCommand");
|
|
7
|
+
const GetChatCommand_1 = require("./commands/GetChatCommand");
|
|
8
|
+
const LikeAnswerCommand_1 = require("./commands/LikeAnswerCommand");
|
|
9
|
+
const ListChatsCommand_1 = require("./commands/ListChatsCommand");
|
|
10
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
11
|
+
const commands = {
|
|
12
|
+
DeleteChatCommand: DeleteChatCommand_1.DeleteChatCommand,
|
|
13
|
+
DislikeAnswerCommand: DislikeAnswerCommand_1.DislikeAnswerCommand,
|
|
14
|
+
GetChatCommand: GetChatCommand_1.GetChatCommand,
|
|
15
|
+
LikeAnswerCommand: LikeAnswerCommand_1.LikeAnswerCommand,
|
|
16
|
+
ListChatsCommand: ListChatsCommand_1.ListChatsCommand,
|
|
17
|
+
};
|
|
18
|
+
class Wilma extends WilmaClient_1.WilmaClient {
|
|
19
|
+
}
|
|
20
|
+
exports.Wilma = Wilma;
|
|
21
|
+
(0, smithy_client_1.createAggregatedClient)(commands, Wilma);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WilmaClient = exports.__Client = void 0;
|
|
4
|
+
const runtimeConfig_1 = require("./runtimeConfig");
|
|
5
|
+
const runtimeExtensions_1 = require("./runtimeExtensions");
|
|
6
|
+
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
|
7
|
+
const middleware_content_length_1 = require("@smithy/middleware-content-length");
|
|
8
|
+
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
9
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
10
|
+
Object.defineProperty(exports, "__Client", { enumerable: true, get: function () { return smithy_client_1.Client; } });
|
|
11
|
+
const smithy_utils_1 = require("@wildix/smithy-utils");
|
|
12
|
+
class WilmaClient extends smithy_client_1.Client {
|
|
13
|
+
config;
|
|
14
|
+
constructor(...[configuration]) {
|
|
15
|
+
let _config_0 = (0, runtimeConfig_1.getRuntimeConfig)(configuration || {});
|
|
16
|
+
super(_config_0);
|
|
17
|
+
this.initConfig = _config_0;
|
|
18
|
+
let _config_1 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_0);
|
|
19
|
+
let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
|
|
20
|
+
let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
|
|
21
|
+
const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `wilma-${configuration.env}.api.wildix.com` : 'wilma.api.wildix.com';
|
|
22
|
+
const endpoint = () => {
|
|
23
|
+
return {
|
|
24
|
+
hostname,
|
|
25
|
+
protocol: "https",
|
|
26
|
+
port: '443',
|
|
27
|
+
path: ''
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const config = { ..._config_3, endpoint };
|
|
31
|
+
this.config = config;
|
|
32
|
+
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
33
|
+
this.middlewareStack.use((0, middleware_user_agent_1.getUserAgentPlugin)(this.config));
|
|
34
|
+
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
35
|
+
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
36
|
+
}
|
|
37
|
+
destroy() {
|
|
38
|
+
super.destroy();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.WilmaClient = WilmaClient;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteChatCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class DeleteChatCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("Wilma", "DeleteChat", {})
|
|
15
|
+
.n("WilmaClient", "DeleteChatCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_DeleteChatCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_DeleteChatCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.DeleteChatCommand = DeleteChatCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DislikeAnswerCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class DislikeAnswerCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("Wilma", "DislikeAnswer", {})
|
|
15
|
+
.n("WilmaClient", "DislikeAnswerCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_DislikeAnswerCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_DislikeAnswerCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.DislikeAnswerCommand = DislikeAnswerCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GetChatCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class GetChatCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("Wilma", "GetChat", {})
|
|
15
|
+
.n("WilmaClient", "GetChatCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_GetChatCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_GetChatCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.GetChatCommand = GetChatCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LikeAnswerCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class LikeAnswerCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("Wilma", "LikeAnswer", {})
|
|
15
|
+
.n("WilmaClient", "LikeAnswerCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_LikeAnswerCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_LikeAnswerCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.LikeAnswerCommand = LikeAnswerCommand;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListChatsCommand = exports.$Command = void 0;
|
|
4
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
class ListChatsCommand extends smithy_client_1.Command.classBuilder()
|
|
9
|
+
.m(function (Command, cs, config, o) {
|
|
10
|
+
return [
|
|
11
|
+
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
|
+
];
|
|
13
|
+
})
|
|
14
|
+
.s("Wilma", "ListChats", {})
|
|
15
|
+
.n("WilmaClient", "ListChatsCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_ListChatsCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_ListChatsCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.ListChatsCommand = ListChatsCommand;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./DeleteChatCommand"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./DislikeAnswerCommand"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./GetChatCommand"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./LikeAnswerCommand"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./ListChatsCommand"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WilmaServiceException = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./WilmaClient"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./Wilma"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./commands"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./models"), exports);
|
|
9
|
+
var WilmaServiceException_1 = require("./models/WilmaServiceException");
|
|
10
|
+
Object.defineProperty(exports, "WilmaServiceException", { enumerable: true, get: function () { return WilmaServiceException_1.WilmaServiceException; } });
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WilmaServiceException = exports.__ServiceException = void 0;
|
|
4
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
Object.defineProperty(exports, "__ServiceException", { enumerable: true, get: function () { return smithy_client_1.ServiceException; } });
|
|
6
|
+
class WilmaServiceException extends smithy_client_1.ServiceException {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
super(options);
|
|
9
|
+
Object.setPrototypeOf(this, WilmaServiceException.prototype);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.WilmaServiceException = WilmaServiceException;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChatFeedbackScore = exports.ForbiddenException = exports.ValidationException = exports.NotFoundException = void 0;
|
|
4
|
+
const WilmaServiceException_1 = require("./WilmaServiceException");
|
|
5
|
+
class NotFoundException extends WilmaServiceException_1.WilmaServiceException {
|
|
6
|
+
name = "NotFoundException";
|
|
7
|
+
$fault = "client";
|
|
8
|
+
constructor(opts) {
|
|
9
|
+
super({
|
|
10
|
+
name: "NotFoundException",
|
|
11
|
+
$fault: "client",
|
|
12
|
+
...opts
|
|
13
|
+
});
|
|
14
|
+
Object.setPrototypeOf(this, NotFoundException.prototype);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.NotFoundException = NotFoundException;
|
|
18
|
+
class ValidationException extends WilmaServiceException_1.WilmaServiceException {
|
|
19
|
+
name = "ValidationException";
|
|
20
|
+
$fault = "client";
|
|
21
|
+
constructor(opts) {
|
|
22
|
+
super({
|
|
23
|
+
name: "ValidationException",
|
|
24
|
+
$fault: "client",
|
|
25
|
+
...opts
|
|
26
|
+
});
|
|
27
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ValidationException = ValidationException;
|
|
31
|
+
class ForbiddenException extends WilmaServiceException_1.WilmaServiceException {
|
|
32
|
+
name = "ForbiddenException";
|
|
33
|
+
$fault = "client";
|
|
34
|
+
constructor(opts) {
|
|
35
|
+
super({
|
|
36
|
+
name: "ForbiddenException",
|
|
37
|
+
$fault: "client",
|
|
38
|
+
...opts
|
|
39
|
+
});
|
|
40
|
+
Object.setPrototypeOf(this, ForbiddenException.prototype);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ForbiddenException = ForbiddenException;
|
|
44
|
+
exports.ChatFeedbackScore = {
|
|
45
|
+
DISLIKE: "DISLIKE",
|
|
46
|
+
LIKE: "LIKE",
|
|
47
|
+
};
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_ListChatsCommand = exports.de_LikeAnswerCommand = exports.de_GetChatCommand = exports.de_DislikeAnswerCommand = exports.de_DeleteChatCommand = exports.se_ListChatsCommand = exports.se_LikeAnswerCommand = exports.se_GetChatCommand = exports.se_DislikeAnswerCommand = exports.se_DeleteChatCommand = void 0;
|
|
4
|
+
const WilmaServiceException_1 = require("../models/WilmaServiceException");
|
|
5
|
+
const models_0_1 = require("../models/models_0");
|
|
6
|
+
const core_1 = require("@aws-sdk/core");
|
|
7
|
+
const core_2 = require("@smithy/core");
|
|
8
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
9
|
+
const se_DeleteChatCommand = async (input, context) => {
|
|
10
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
11
|
+
const headers = {};
|
|
12
|
+
b.bp("/v2/wilma/chats/{id}");
|
|
13
|
+
b.p('id', () => input.id, '{id}', false);
|
|
14
|
+
const query = (0, smithy_client_1.map)({
|
|
15
|
+
[_c]: [, input[_c]],
|
|
16
|
+
[_u]: [, input[_u]],
|
|
17
|
+
});
|
|
18
|
+
let body;
|
|
19
|
+
b.m("DELETE")
|
|
20
|
+
.h(headers)
|
|
21
|
+
.q(query)
|
|
22
|
+
.b(body);
|
|
23
|
+
return b.build();
|
|
24
|
+
};
|
|
25
|
+
exports.se_DeleteChatCommand = se_DeleteChatCommand;
|
|
26
|
+
const se_DislikeAnswerCommand = async (input, context) => {
|
|
27
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
28
|
+
const headers = {
|
|
29
|
+
'content-type': 'application/json',
|
|
30
|
+
};
|
|
31
|
+
b.bp("/v2/wilma/feedback/dislike");
|
|
32
|
+
const query = (0, smithy_client_1.map)({
|
|
33
|
+
[_c]: [, input[_c]],
|
|
34
|
+
[_u]: [, input[_u]],
|
|
35
|
+
});
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
38
|
+
'chatId': [],
|
|
39
|
+
'feedback': _ => (0, smithy_client_1._json)(_),
|
|
40
|
+
'message': _ => se_Document(_, context),
|
|
41
|
+
}));
|
|
42
|
+
b.m("POST")
|
|
43
|
+
.h(headers)
|
|
44
|
+
.q(query)
|
|
45
|
+
.b(body);
|
|
46
|
+
return b.build();
|
|
47
|
+
};
|
|
48
|
+
exports.se_DislikeAnswerCommand = se_DislikeAnswerCommand;
|
|
49
|
+
const se_GetChatCommand = async (input, context) => {
|
|
50
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
51
|
+
const headers = {};
|
|
52
|
+
b.bp("/v2/wilma/chats/{id}");
|
|
53
|
+
b.p('id', () => input.id, '{id}', false);
|
|
54
|
+
const query = (0, smithy_client_1.map)({
|
|
55
|
+
[_c]: [, input[_c]],
|
|
56
|
+
[_u]: [, input[_u]],
|
|
57
|
+
});
|
|
58
|
+
let body;
|
|
59
|
+
b.m("GET")
|
|
60
|
+
.h(headers)
|
|
61
|
+
.q(query)
|
|
62
|
+
.b(body);
|
|
63
|
+
return b.build();
|
|
64
|
+
};
|
|
65
|
+
exports.se_GetChatCommand = se_GetChatCommand;
|
|
66
|
+
const se_LikeAnswerCommand = async (input, context) => {
|
|
67
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
68
|
+
const headers = {
|
|
69
|
+
'content-type': 'application/json',
|
|
70
|
+
};
|
|
71
|
+
b.bp("/v2/wilma/feedback/like");
|
|
72
|
+
const query = (0, smithy_client_1.map)({
|
|
73
|
+
[_c]: [, input[_c]],
|
|
74
|
+
[_u]: [, input[_u]],
|
|
75
|
+
});
|
|
76
|
+
let body;
|
|
77
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
78
|
+
'chatId': [],
|
|
79
|
+
'feedback': _ => (0, smithy_client_1._json)(_),
|
|
80
|
+
'message': _ => se_Document(_, context),
|
|
81
|
+
}));
|
|
82
|
+
b.m("POST")
|
|
83
|
+
.h(headers)
|
|
84
|
+
.q(query)
|
|
85
|
+
.b(body);
|
|
86
|
+
return b.build();
|
|
87
|
+
};
|
|
88
|
+
exports.se_LikeAnswerCommand = se_LikeAnswerCommand;
|
|
89
|
+
const se_ListChatsCommand = async (input, context) => {
|
|
90
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
91
|
+
const headers = {};
|
|
92
|
+
b.bp("/v1/wilma/chats");
|
|
93
|
+
const query = (0, smithy_client_1.map)({
|
|
94
|
+
[_c]: [, input[_c]],
|
|
95
|
+
[_u]: [, input[_u]],
|
|
96
|
+
[_eSK]: [, input[_eSK]],
|
|
97
|
+
});
|
|
98
|
+
let body;
|
|
99
|
+
b.m("GET")
|
|
100
|
+
.h(headers)
|
|
101
|
+
.q(query)
|
|
102
|
+
.b(body);
|
|
103
|
+
return b.build();
|
|
104
|
+
};
|
|
105
|
+
exports.se_ListChatsCommand = se_ListChatsCommand;
|
|
106
|
+
const de_DeleteChatCommand = async (output, context) => {
|
|
107
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
108
|
+
return de_CommandError(output, context);
|
|
109
|
+
}
|
|
110
|
+
const contents = (0, smithy_client_1.map)({
|
|
111
|
+
$metadata: deserializeMetadata(output),
|
|
112
|
+
});
|
|
113
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
114
|
+
return contents;
|
|
115
|
+
};
|
|
116
|
+
exports.de_DeleteChatCommand = de_DeleteChatCommand;
|
|
117
|
+
const de_DislikeAnswerCommand = async (output, context) => {
|
|
118
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
119
|
+
return de_CommandError(output, context);
|
|
120
|
+
}
|
|
121
|
+
const contents = (0, smithy_client_1.map)({
|
|
122
|
+
$metadata: deserializeMetadata(output),
|
|
123
|
+
});
|
|
124
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
125
|
+
return contents;
|
|
126
|
+
};
|
|
127
|
+
exports.de_DislikeAnswerCommand = de_DislikeAnswerCommand;
|
|
128
|
+
const de_GetChatCommand = async (output, context) => {
|
|
129
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
130
|
+
return de_CommandError(output, context);
|
|
131
|
+
}
|
|
132
|
+
const contents = (0, smithy_client_1.map)({
|
|
133
|
+
$metadata: deserializeMetadata(output),
|
|
134
|
+
});
|
|
135
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
136
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
137
|
+
'chat': smithy_client_1._json,
|
|
138
|
+
'history': _ => de_ChatHistory(_, context),
|
|
139
|
+
});
|
|
140
|
+
Object.assign(contents, doc);
|
|
141
|
+
return contents;
|
|
142
|
+
};
|
|
143
|
+
exports.de_GetChatCommand = de_GetChatCommand;
|
|
144
|
+
const de_LikeAnswerCommand = async (output, context) => {
|
|
145
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
146
|
+
return de_CommandError(output, context);
|
|
147
|
+
}
|
|
148
|
+
const contents = (0, smithy_client_1.map)({
|
|
149
|
+
$metadata: deserializeMetadata(output),
|
|
150
|
+
});
|
|
151
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
152
|
+
return contents;
|
|
153
|
+
};
|
|
154
|
+
exports.de_LikeAnswerCommand = de_LikeAnswerCommand;
|
|
155
|
+
const de_ListChatsCommand = async (output, context) => {
|
|
156
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
157
|
+
return de_CommandError(output, context);
|
|
158
|
+
}
|
|
159
|
+
const contents = (0, smithy_client_1.map)({
|
|
160
|
+
$metadata: deserializeMetadata(output),
|
|
161
|
+
});
|
|
162
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
163
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
164
|
+
'chats': smithy_client_1._json,
|
|
165
|
+
'lastEvaluatedKey': smithy_client_1.expectString,
|
|
166
|
+
});
|
|
167
|
+
Object.assign(contents, doc);
|
|
168
|
+
return contents;
|
|
169
|
+
};
|
|
170
|
+
exports.de_ListChatsCommand = de_ListChatsCommand;
|
|
171
|
+
const de_CommandError = async (output, context) => {
|
|
172
|
+
const parsedOutput = {
|
|
173
|
+
...output,
|
|
174
|
+
body: await (0, core_1.parseJsonErrorBody)(output.body, context)
|
|
175
|
+
};
|
|
176
|
+
const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
177
|
+
switch (errorCode) {
|
|
178
|
+
case "ForbiddenException":
|
|
179
|
+
case "smithy.framework#ForbiddenException":
|
|
180
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
181
|
+
case "ValidationException":
|
|
182
|
+
case "smithy.framework#ValidationException":
|
|
183
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
184
|
+
case "NotFoundException":
|
|
185
|
+
case "smithy.framework#NotFoundException":
|
|
186
|
+
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
187
|
+
default:
|
|
188
|
+
const parsedBody = parsedOutput.body;
|
|
189
|
+
return throwDefaultError({
|
|
190
|
+
output,
|
|
191
|
+
parsedBody,
|
|
192
|
+
errorCode
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(WilmaServiceException_1.WilmaServiceException);
|
|
197
|
+
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
198
|
+
const contents = (0, smithy_client_1.map)({});
|
|
199
|
+
const data = parsedOutput.body;
|
|
200
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
201
|
+
'message': smithy_client_1.expectString,
|
|
202
|
+
});
|
|
203
|
+
Object.assign(contents, doc);
|
|
204
|
+
const exception = new models_0_1.ForbiddenException({
|
|
205
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
206
|
+
...contents
|
|
207
|
+
});
|
|
208
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
209
|
+
};
|
|
210
|
+
const de_NotFoundExceptionRes = async (parsedOutput, context) => {
|
|
211
|
+
const contents = (0, smithy_client_1.map)({});
|
|
212
|
+
const data = parsedOutput.body;
|
|
213
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
214
|
+
'message': smithy_client_1.expectString,
|
|
215
|
+
});
|
|
216
|
+
Object.assign(contents, doc);
|
|
217
|
+
const exception = new models_0_1.NotFoundException({
|
|
218
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
219
|
+
...contents
|
|
220
|
+
});
|
|
221
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
222
|
+
};
|
|
223
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
224
|
+
const contents = (0, smithy_client_1.map)({});
|
|
225
|
+
const data = parsedOutput.body;
|
|
226
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
227
|
+
'message': smithy_client_1.expectString,
|
|
228
|
+
});
|
|
229
|
+
Object.assign(contents, doc);
|
|
230
|
+
const exception = new models_0_1.ValidationException({
|
|
231
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
232
|
+
...contents
|
|
233
|
+
});
|
|
234
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
235
|
+
};
|
|
236
|
+
const se_Document = (input, context) => {
|
|
237
|
+
return input;
|
|
238
|
+
};
|
|
239
|
+
const de_Document = (output, context) => {
|
|
240
|
+
return output;
|
|
241
|
+
};
|
|
242
|
+
const de_ChatHistory = (output, context) => {
|
|
243
|
+
return (0, smithy_client_1.take)(output, {
|
|
244
|
+
'mentions': (_) => de_ChatMentionsList(_, context),
|
|
245
|
+
'messages': (_) => de_ChatMessagesList(_, context),
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
const de_ChatMentionsList = (output, context) => {
|
|
249
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
250
|
+
return de_Document(entry, context);
|
|
251
|
+
});
|
|
252
|
+
return retVal;
|
|
253
|
+
};
|
|
254
|
+
const de_ChatMessagesList = (output, context) => {
|
|
255
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
256
|
+
return de_Document(entry, context);
|
|
257
|
+
});
|
|
258
|
+
return retVal;
|
|
259
|
+
};
|
|
260
|
+
const deserializeMetadata = (output) => ({
|
|
261
|
+
httpStatusCode: output.statusCode,
|
|
262
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
263
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
264
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
265
|
+
});
|
|
266
|
+
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
267
|
+
const _c = "company";
|
|
268
|
+
const _eSK = "exclusiveStartKey";
|
|
269
|
+
const _u = "user";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
|
+
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
8
|
+
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
9
|
+
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
10
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
11
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
12
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
13
|
+
const util_defaults_mode_browser_1 = require("@smithy/util-defaults-mode-browser");
|
|
14
|
+
const getRuntimeConfig = (config) => {
|
|
15
|
+
const defaultsMode = (0, util_defaults_mode_browser_1.resolveDefaultsModeConfig)(config);
|
|
16
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
17
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
18
|
+
return {
|
|
19
|
+
...clientSharedValues,
|
|
20
|
+
...config,
|
|
21
|
+
runtime: "browser",
|
|
22
|
+
defaultsMode,
|
|
23
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_browser_1.calculateBodyLength,
|
|
24
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_browser_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
25
|
+
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
26
|
+
requestHandler: fetch_http_handler_1.FetchHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
27
|
+
retryMode: config?.retryMode ?? (async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE),
|
|
28
|
+
sha256: config?.sha256 ?? sha256_browser_1.Sha256,
|
|
29
|
+
streamCollector: config?.streamCollector ?? fetch_http_handler_1.streamCollector,
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
6
|
+
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
7
|
+
const hash_node_1 = require("@smithy/hash-node");
|
|
8
|
+
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
9
|
+
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
10
|
+
const node_http_handler_1 = require("@smithy/node-http-handler");
|
|
11
|
+
const util_body_length_node_1 = require("@smithy/util-body-length-node");
|
|
12
|
+
const util_retry_1 = require("@smithy/util-retry");
|
|
13
|
+
const runtimeConfig_shared_1 = require("./runtimeConfig.shared");
|
|
14
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
15
|
+
const util_defaults_mode_node_1 = require("@smithy/util-defaults-mode-node");
|
|
16
|
+
const smithy_client_2 = require("@smithy/smithy-client");
|
|
17
|
+
const getRuntimeConfig = (config) => {
|
|
18
|
+
(0, smithy_client_2.emitWarningIfUnsupportedVersion)(process.version);
|
|
19
|
+
const defaultsMode = (0, util_defaults_mode_node_1.resolveDefaultsModeConfig)(config);
|
|
20
|
+
const defaultConfigProvider = () => defaultsMode().then(smithy_client_1.loadConfigsForDefaultMode);
|
|
21
|
+
const clientSharedValues = (0, runtimeConfig_shared_1.getRuntimeConfig)(config);
|
|
22
|
+
return {
|
|
23
|
+
...clientSharedValues,
|
|
24
|
+
...config,
|
|
25
|
+
runtime: "node",
|
|
26
|
+
defaultsMode,
|
|
27
|
+
bodyLengthChecker: config?.bodyLengthChecker ?? util_body_length_node_1.calculateBodyLength,
|
|
28
|
+
defaultUserAgentProvider: config?.defaultUserAgentProvider ?? (0, util_user_agent_node_1.createDefaultUserAgentProvider)({ serviceId: package_json_1.default.name, clientVersion: package_json_1.default.version }),
|
|
29
|
+
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS, config),
|
|
30
|
+
requestHandler: node_http_handler_1.NodeHttpHandler.create(config?.requestHandler ?? defaultConfigProvider),
|
|
31
|
+
retryMode: config?.retryMode ?? (0, node_config_provider_1.loadConfig)({ ...middleware_retry_1.NODE_RETRY_MODE_CONFIG_OPTIONS, default: async () => (await defaultConfigProvider()).retryMode || util_retry_1.DEFAULT_RETRY_MODE, }, config),
|
|
32
|
+
sha256: config?.sha256 ?? hash_node_1.Hash.bind(null, "sha256"),
|
|
33
|
+
streamCollector: config?.streamCollector ?? node_http_handler_1.streamCollector,
|
|
34
|
+
userAgentAppId: config?.userAgentAppId ?? (0, node_config_provider_1.loadConfig)(util_user_agent_node_1.NODE_APP_ID_CONFIG_OPTIONS, { profile: 'wildix' }),
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const sha256_js_1 = require("@aws-crypto/sha256-js");
|
|
5
|
+
const runtimeConfig_browser_1 = require("./runtimeConfig.browser");
|
|
6
|
+
const getRuntimeConfig = (config) => {
|
|
7
|
+
const browserDefaults = (0, runtimeConfig_browser_1.getRuntimeConfig)(config);
|
|
8
|
+
return {
|
|
9
|
+
...browserDefaults,
|
|
10
|
+
...config,
|
|
11
|
+
runtime: "react-native",
|
|
12
|
+
sha256: config?.sha256 ?? sha256_js_1.Sha256,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getRuntimeConfig = void 0;
|
|
4
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
|
+
const url_parser_1 = require("@smithy/url-parser");
|
|
6
|
+
const util_base64_1 = require("@smithy/util-base64");
|
|
7
|
+
const util_utf8_1 = require("@smithy/util-utf8");
|
|
8
|
+
const getRuntimeConfig = (config) => {
|
|
9
|
+
return {
|
|
10
|
+
apiVersion: "v1",
|
|
11
|
+
base64Decoder: config?.base64Decoder ?? util_base64_1.fromBase64,
|
|
12
|
+
base64Encoder: config?.base64Encoder ?? util_base64_1.toBase64,
|
|
13
|
+
disableHostPrefix: config?.disableHostPrefix ?? false,
|
|
14
|
+
extensions: config?.extensions ?? [],
|
|
15
|
+
logger: config?.logger ?? new smithy_client_1.NoOpLogger(),
|
|
16
|
+
urlParser: config?.urlParser ?? url_parser_1.parseUrl,
|
|
17
|
+
utf8Decoder: config?.utf8Decoder ?? util_utf8_1.fromUtf8,
|
|
18
|
+
utf8Encoder: config?.utf8Encoder ?? util_utf8_1.toUtf8,
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
exports.getRuntimeConfig = getRuntimeConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveRuntimeExtensions = void 0;
|
|
4
|
+
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
7
|
+
const extensionConfiguration = Object.assign((0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig));
|
|
8
|
+
extensions.forEach(extension => extension.configure(extensionConfiguration));
|
|
9
|
+
return Object.assign(runtimeConfig, (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration));
|
|
10
|
+
};
|
|
11
|
+
exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
|