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