@wildix/wim-knowledge-base-client 0.0.7
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/KnowledgeBase.js +57 -0
- package/dist-cjs/KnowledgeBaseClient.js +41 -0
- package/dist-cjs/commands/CreateDataSourceCommand.js +21 -0
- package/dist-cjs/commands/CreateDocumentCommand.js +21 -0
- package/dist-cjs/commands/CreateKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/DeleteDataSourceCommand.js +21 -0
- package/dist-cjs/commands/DeleteDocumentCommand.js +21 -0
- package/dist-cjs/commands/DeleteKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/GetAuthorizationSessionForDataSourceCommand.js +21 -0
- package/dist-cjs/commands/GetDataSourceCommand.js +21 -0
- package/dist-cjs/commands/GetDocumentCommand.js +21 -0
- package/dist-cjs/commands/GetDocumentPresignedDownloadUrlCommand.js +21 -0
- package/dist-cjs/commands/GetDocumentPresignedUploadUrlCommand.js +21 -0
- package/dist-cjs/commands/GetKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/GetSyncLogsCommand.js +21 -0
- package/dist-cjs/commands/GetSyncStatusCommand.js +21 -0
- package/dist-cjs/commands/ListDataSourcesCommand.js +21 -0
- package/dist-cjs/commands/ListDocumentsCommand.js +21 -0
- package/dist-cjs/commands/ListKnowledgeBasesCommand.js +21 -0
- package/dist-cjs/commands/QueryKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/SearchKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/SyncDataSourceCommand.js +21 -0
- package/dist-cjs/commands/UpdateDataSourceCommand.js +21 -0
- package/dist-cjs/commands/UpdateDocumentCommand.js +21 -0
- package/dist-cjs/commands/UpdateKnowledgeBaseCommand.js +21 -0
- package/dist-cjs/commands/index.js +26 -0
- package/dist-cjs/extensionConfiguration.js +2 -0
- package/dist-cjs/index.js +10 -0
- package/dist-cjs/models/KnowledgeBaseServiceException.js +12 -0
- package/dist-cjs/models/index.js +4 -0
- package/dist-cjs/models/models_0.js +132 -0
- package/dist-cjs/protocols/Aws_restJson1.js +936 -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/KnowledgeBase.js +53 -0
- package/dist-es/KnowledgeBaseClient.js +37 -0
- package/dist-es/commands/CreateDataSourceCommand.js +17 -0
- package/dist-es/commands/CreateDocumentCommand.js +17 -0
- package/dist-es/commands/CreateKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/DeleteDataSourceCommand.js +17 -0
- package/dist-es/commands/DeleteDocumentCommand.js +17 -0
- package/dist-es/commands/DeleteKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/GetAuthorizationSessionForDataSourceCommand.js +17 -0
- package/dist-es/commands/GetDataSourceCommand.js +17 -0
- package/dist-es/commands/GetDocumentCommand.js +17 -0
- package/dist-es/commands/GetDocumentPresignedDownloadUrlCommand.js +17 -0
- package/dist-es/commands/GetDocumentPresignedUploadUrlCommand.js +17 -0
- package/dist-es/commands/GetKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/GetSyncLogsCommand.js +17 -0
- package/dist-es/commands/GetSyncStatusCommand.js +17 -0
- package/dist-es/commands/ListDataSourcesCommand.js +17 -0
- package/dist-es/commands/ListDocumentsCommand.js +17 -0
- package/dist-es/commands/ListKnowledgeBasesCommand.js +17 -0
- package/dist-es/commands/QueryKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/SearchKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/SyncDataSourceCommand.js +17 -0
- package/dist-es/commands/UpdateDataSourceCommand.js +17 -0
- package/dist-es/commands/UpdateDocumentCommand.js +17 -0
- package/dist-es/commands/UpdateKnowledgeBaseCommand.js +17 -0
- package/dist-es/commands/index.js +23 -0
- package/dist-es/extensionConfiguration.js +1 -0
- package/dist-es/index.js +5 -0
- package/dist-es/models/KnowledgeBaseServiceException.js +8 -0
- package/dist-es/models/index.js +1 -0
- package/dist-es/models/models_0.js +123 -0
- package/dist-es/protocols/Aws_restJson1.js +887 -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/KnowledgeBase.d.ts +172 -0
- package/dist-types/KnowledgeBaseClient.d.ts +166 -0
- package/dist-types/commands/CreateDataSourceCommand.d.ts +167 -0
- package/dist-types/commands/CreateDocumentCommand.d.ts +107 -0
- package/dist-types/commands/CreateKnowledgeBaseCommand.d.ts +99 -0
- package/dist-types/commands/DeleteDataSourceCommand.d.ts +83 -0
- package/dist-types/commands/DeleteDocumentCommand.d.ts +84 -0
- package/dist-types/commands/DeleteKnowledgeBaseCommand.d.ts +83 -0
- package/dist-types/commands/GetAuthorizationSessionForDataSourceCommand.d.ts +85 -0
- package/dist-types/commands/GetDataSourceCommand.d.ts +131 -0
- package/dist-types/commands/GetDocumentCommand.d.ts +102 -0
- package/dist-types/commands/GetDocumentPresignedDownloadUrlCommand.d.ts +87 -0
- package/dist-types/commands/GetDocumentPresignedUploadUrlCommand.d.ts +86 -0
- package/dist-types/commands/GetKnowledgeBaseCommand.d.ts +95 -0
- package/dist-types/commands/GetSyncLogsCommand.d.ts +91 -0
- package/dist-types/commands/GetSyncStatusCommand.d.ts +87 -0
- package/dist-types/commands/ListDataSourcesCommand.d.ts +132 -0
- package/dist-types/commands/ListDocumentsCommand.d.ts +103 -0
- package/dist-types/commands/ListKnowledgeBasesCommand.d.ts +96 -0
- package/dist-types/commands/QueryKnowledgeBaseCommand.d.ts +98 -0
- package/dist-types/commands/SearchKnowledgeBaseCommand.d.ts +99 -0
- package/dist-types/commands/SyncDataSourceCommand.d.ts +84 -0
- package/dist-types/commands/UpdateDataSourceCommand.d.ts +168 -0
- package/dist-types/commands/UpdateDocumentCommand.d.ts +108 -0
- package/dist-types/commands/UpdateKnowledgeBaseCommand.d.ts +100 -0
- package/dist-types/commands/index.d.ts +23 -0
- package/dist-types/extensionConfiguration.d.ts +7 -0
- package/dist-types/index.d.ts +7 -0
- package/dist-types/models/KnowledgeBaseServiceException.d.ts +14 -0
- package/dist-types/models/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +981 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +209 -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,936 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = exports.de_UpdateDataSourceCommand = exports.de_SyncDataSourceCommand = exports.de_SearchKnowledgeBaseCommand = exports.de_QueryKnowledgeBaseCommand = exports.de_ListKnowledgeBasesCommand = exports.de_ListDocumentsCommand = exports.de_ListDataSourcesCommand = exports.de_GetSyncStatusCommand = exports.de_GetSyncLogsCommand = exports.de_GetKnowledgeBaseCommand = exports.de_GetDocumentPresignedUploadUrlCommand = exports.de_GetDocumentPresignedDownloadUrlCommand = exports.de_GetDocumentCommand = exports.de_GetDataSourceCommand = exports.de_GetAuthorizationSessionForDataSourceCommand = exports.de_DeleteKnowledgeBaseCommand = exports.de_DeleteDocumentCommand = exports.de_DeleteDataSourceCommand = exports.de_CreateKnowledgeBaseCommand = exports.de_CreateDocumentCommand = exports.de_CreateDataSourceCommand = exports.se_UpdateKnowledgeBaseCommand = exports.se_UpdateDocumentCommand = exports.se_UpdateDataSourceCommand = exports.se_SyncDataSourceCommand = exports.se_SearchKnowledgeBaseCommand = exports.se_QueryKnowledgeBaseCommand = exports.se_ListKnowledgeBasesCommand = exports.se_ListDocumentsCommand = exports.se_ListDataSourcesCommand = exports.se_GetSyncStatusCommand = exports.se_GetSyncLogsCommand = exports.se_GetKnowledgeBaseCommand = exports.se_GetDocumentPresignedUploadUrlCommand = exports.se_GetDocumentPresignedDownloadUrlCommand = exports.se_GetDocumentCommand = exports.se_GetDataSourceCommand = exports.se_GetAuthorizationSessionForDataSourceCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteDocumentCommand = exports.se_DeleteDataSourceCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateDocumentCommand = exports.se_CreateDataSourceCommand = void 0;
|
|
4
|
+
const KnowledgeBaseServiceException_1 = require("../models/KnowledgeBaseServiceException");
|
|
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_CreateDataSourceCommand = async (input, context) => {
|
|
10
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
11
|
+
const headers = {
|
|
12
|
+
'content-type': 'application/json',
|
|
13
|
+
};
|
|
14
|
+
b.bp("/api/v1/data-sources");
|
|
15
|
+
const query = (0, smithy_client_1.map)({
|
|
16
|
+
[_c]: [, input[_cI]],
|
|
17
|
+
});
|
|
18
|
+
let body;
|
|
19
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
20
|
+
'config': _ => (0, smithy_client_1._json)(_),
|
|
21
|
+
'description': [],
|
|
22
|
+
'enabled': [],
|
|
23
|
+
'name': [],
|
|
24
|
+
'syncSchedule': [],
|
|
25
|
+
'type': [],
|
|
26
|
+
}));
|
|
27
|
+
b.m("POST")
|
|
28
|
+
.h(headers)
|
|
29
|
+
.q(query)
|
|
30
|
+
.b(body);
|
|
31
|
+
return b.build();
|
|
32
|
+
};
|
|
33
|
+
exports.se_CreateDataSourceCommand = se_CreateDataSourceCommand;
|
|
34
|
+
const se_CreateDocumentCommand = async (input, context) => {
|
|
35
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
36
|
+
const headers = {
|
|
37
|
+
'content-type': 'application/json',
|
|
38
|
+
};
|
|
39
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents");
|
|
40
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
41
|
+
const query = (0, smithy_client_1.map)({
|
|
42
|
+
[_c]: [, input[_cI]],
|
|
43
|
+
});
|
|
44
|
+
let body;
|
|
45
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
46
|
+
'content': [],
|
|
47
|
+
'originalFormat': [],
|
|
48
|
+
'originalId': [],
|
|
49
|
+
'originalName': [],
|
|
50
|
+
'title': [],
|
|
51
|
+
'url': [],
|
|
52
|
+
}));
|
|
53
|
+
b.m("POST")
|
|
54
|
+
.h(headers)
|
|
55
|
+
.q(query)
|
|
56
|
+
.b(body);
|
|
57
|
+
return b.build();
|
|
58
|
+
};
|
|
59
|
+
exports.se_CreateDocumentCommand = se_CreateDocumentCommand;
|
|
60
|
+
const se_CreateKnowledgeBaseCommand = async (input, context) => {
|
|
61
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
62
|
+
const headers = {
|
|
63
|
+
'content-type': 'application/json',
|
|
64
|
+
};
|
|
65
|
+
b.bp("/api/v1/knowledge-bases");
|
|
66
|
+
const query = (0, smithy_client_1.map)({
|
|
67
|
+
[_c]: [, input[_cI]],
|
|
68
|
+
});
|
|
69
|
+
let body;
|
|
70
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
71
|
+
'dataSources': _ => (0, smithy_client_1._json)(_),
|
|
72
|
+
'description': [],
|
|
73
|
+
'name': [],
|
|
74
|
+
}));
|
|
75
|
+
b.m("POST")
|
|
76
|
+
.h(headers)
|
|
77
|
+
.q(query)
|
|
78
|
+
.b(body);
|
|
79
|
+
return b.build();
|
|
80
|
+
};
|
|
81
|
+
exports.se_CreateKnowledgeBaseCommand = se_CreateKnowledgeBaseCommand;
|
|
82
|
+
const se_DeleteDataSourceCommand = async (input, context) => {
|
|
83
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
84
|
+
const headers = {};
|
|
85
|
+
b.bp("/api/v1/data-sources/{dataSourceId}");
|
|
86
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
87
|
+
const query = (0, smithy_client_1.map)({
|
|
88
|
+
[_c]: [, input[_cI]],
|
|
89
|
+
});
|
|
90
|
+
let body;
|
|
91
|
+
b.m("DELETE")
|
|
92
|
+
.h(headers)
|
|
93
|
+
.q(query)
|
|
94
|
+
.b(body);
|
|
95
|
+
return b.build();
|
|
96
|
+
};
|
|
97
|
+
exports.se_DeleteDataSourceCommand = se_DeleteDataSourceCommand;
|
|
98
|
+
const se_DeleteDocumentCommand = async (input, context) => {
|
|
99
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
100
|
+
const headers = {};
|
|
101
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents/{documentId}");
|
|
102
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
103
|
+
b.p('documentId', () => input.documentId, '{documentId}', false);
|
|
104
|
+
const query = (0, smithy_client_1.map)({
|
|
105
|
+
[_c]: [, input[_cI]],
|
|
106
|
+
});
|
|
107
|
+
let body;
|
|
108
|
+
b.m("DELETE")
|
|
109
|
+
.h(headers)
|
|
110
|
+
.q(query)
|
|
111
|
+
.b(body);
|
|
112
|
+
return b.build();
|
|
113
|
+
};
|
|
114
|
+
exports.se_DeleteDocumentCommand = se_DeleteDocumentCommand;
|
|
115
|
+
const se_DeleteKnowledgeBaseCommand = async (input, context) => {
|
|
116
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
117
|
+
const headers = {};
|
|
118
|
+
b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}");
|
|
119
|
+
b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
|
|
120
|
+
const query = (0, smithy_client_1.map)({
|
|
121
|
+
[_c]: [, input[_cI]],
|
|
122
|
+
});
|
|
123
|
+
let body;
|
|
124
|
+
b.m("DELETE")
|
|
125
|
+
.h(headers)
|
|
126
|
+
.q(query)
|
|
127
|
+
.b(body);
|
|
128
|
+
return b.build();
|
|
129
|
+
};
|
|
130
|
+
exports.se_DeleteKnowledgeBaseCommand = se_DeleteKnowledgeBaseCommand;
|
|
131
|
+
const se_GetAuthorizationSessionForDataSourceCommand = async (input, context) => {
|
|
132
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
133
|
+
const headers = {};
|
|
134
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/authorization-session");
|
|
135
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
136
|
+
const query = (0, smithy_client_1.map)({
|
|
137
|
+
[_c]: [, input[_cI]],
|
|
138
|
+
});
|
|
139
|
+
let body;
|
|
140
|
+
b.m("GET")
|
|
141
|
+
.h(headers)
|
|
142
|
+
.q(query)
|
|
143
|
+
.b(body);
|
|
144
|
+
return b.build();
|
|
145
|
+
};
|
|
146
|
+
exports.se_GetAuthorizationSessionForDataSourceCommand = se_GetAuthorizationSessionForDataSourceCommand;
|
|
147
|
+
const se_GetDataSourceCommand = async (input, context) => {
|
|
148
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
149
|
+
const headers = {};
|
|
150
|
+
b.bp("/api/v1/data-sources/{dataSourceId}");
|
|
151
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
152
|
+
const query = (0, smithy_client_1.map)({
|
|
153
|
+
[_c]: [, input[_cI]],
|
|
154
|
+
});
|
|
155
|
+
let body;
|
|
156
|
+
b.m("GET")
|
|
157
|
+
.h(headers)
|
|
158
|
+
.q(query)
|
|
159
|
+
.b(body);
|
|
160
|
+
return b.build();
|
|
161
|
+
};
|
|
162
|
+
exports.se_GetDataSourceCommand = se_GetDataSourceCommand;
|
|
163
|
+
const se_GetDocumentCommand = async (input, context) => {
|
|
164
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
165
|
+
const headers = {};
|
|
166
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents/{documentId}");
|
|
167
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
168
|
+
b.p('documentId', () => input.documentId, '{documentId}', false);
|
|
169
|
+
const query = (0, smithy_client_1.map)({
|
|
170
|
+
[_c]: [, input[_cI]],
|
|
171
|
+
});
|
|
172
|
+
let body;
|
|
173
|
+
b.m("GET")
|
|
174
|
+
.h(headers)
|
|
175
|
+
.q(query)
|
|
176
|
+
.b(body);
|
|
177
|
+
return b.build();
|
|
178
|
+
};
|
|
179
|
+
exports.se_GetDocumentCommand = se_GetDocumentCommand;
|
|
180
|
+
const se_GetDocumentPresignedDownloadUrlCommand = async (input, context) => {
|
|
181
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
182
|
+
const headers = {};
|
|
183
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents/{documentId}/download_url");
|
|
184
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
185
|
+
b.p('documentId', () => input.documentId, '{documentId}', false);
|
|
186
|
+
const query = (0, smithy_client_1.map)({
|
|
187
|
+
[_c]: [, input[_cI]],
|
|
188
|
+
[_dT]: [, input[_dT]],
|
|
189
|
+
});
|
|
190
|
+
let body;
|
|
191
|
+
b.m("GET")
|
|
192
|
+
.h(headers)
|
|
193
|
+
.q(query)
|
|
194
|
+
.b(body);
|
|
195
|
+
return b.build();
|
|
196
|
+
};
|
|
197
|
+
exports.se_GetDocumentPresignedDownloadUrlCommand = se_GetDocumentPresignedDownloadUrlCommand;
|
|
198
|
+
const se_GetDocumentPresignedUploadUrlCommand = async (input, context) => {
|
|
199
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
200
|
+
const headers = {};
|
|
201
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents/{documentId}/upload_url");
|
|
202
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
203
|
+
b.p('documentId', () => input.documentId, '{documentId}', false);
|
|
204
|
+
const query = (0, smithy_client_1.map)({
|
|
205
|
+
[_c]: [, input[_cI]],
|
|
206
|
+
});
|
|
207
|
+
let body;
|
|
208
|
+
b.m("GET")
|
|
209
|
+
.h(headers)
|
|
210
|
+
.q(query)
|
|
211
|
+
.b(body);
|
|
212
|
+
return b.build();
|
|
213
|
+
};
|
|
214
|
+
exports.se_GetDocumentPresignedUploadUrlCommand = se_GetDocumentPresignedUploadUrlCommand;
|
|
215
|
+
const se_GetKnowledgeBaseCommand = async (input, context) => {
|
|
216
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
217
|
+
const headers = {};
|
|
218
|
+
b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}");
|
|
219
|
+
b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
|
|
220
|
+
const query = (0, smithy_client_1.map)({
|
|
221
|
+
[_c]: [, input[_cI]],
|
|
222
|
+
});
|
|
223
|
+
let body;
|
|
224
|
+
b.m("GET")
|
|
225
|
+
.h(headers)
|
|
226
|
+
.q(query)
|
|
227
|
+
.b(body);
|
|
228
|
+
return b.build();
|
|
229
|
+
};
|
|
230
|
+
exports.se_GetKnowledgeBaseCommand = se_GetKnowledgeBaseCommand;
|
|
231
|
+
const se_GetSyncLogsCommand = async (input, context) => {
|
|
232
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
233
|
+
const headers = {};
|
|
234
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/sync-logs");
|
|
235
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
236
|
+
const query = (0, smithy_client_1.map)({
|
|
237
|
+
[_c]: [, input[_cI]],
|
|
238
|
+
});
|
|
239
|
+
let body;
|
|
240
|
+
b.m("GET")
|
|
241
|
+
.h(headers)
|
|
242
|
+
.q(query)
|
|
243
|
+
.b(body);
|
|
244
|
+
return b.build();
|
|
245
|
+
};
|
|
246
|
+
exports.se_GetSyncLogsCommand = se_GetSyncLogsCommand;
|
|
247
|
+
const se_GetSyncStatusCommand = async (input, context) => {
|
|
248
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
249
|
+
const headers = {};
|
|
250
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/sync-status");
|
|
251
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
252
|
+
const query = (0, smithy_client_1.map)({
|
|
253
|
+
[_c]: [, input[_cI]],
|
|
254
|
+
});
|
|
255
|
+
let body;
|
|
256
|
+
b.m("GET")
|
|
257
|
+
.h(headers)
|
|
258
|
+
.q(query)
|
|
259
|
+
.b(body);
|
|
260
|
+
return b.build();
|
|
261
|
+
};
|
|
262
|
+
exports.se_GetSyncStatusCommand = se_GetSyncStatusCommand;
|
|
263
|
+
const se_ListDataSourcesCommand = async (input, context) => {
|
|
264
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
265
|
+
const headers = {};
|
|
266
|
+
b.bp("/api/v1/data-sources");
|
|
267
|
+
const query = (0, smithy_client_1.map)({
|
|
268
|
+
[_c]: [, input[_cI]],
|
|
269
|
+
});
|
|
270
|
+
let body;
|
|
271
|
+
b.m("GET")
|
|
272
|
+
.h(headers)
|
|
273
|
+
.q(query)
|
|
274
|
+
.b(body);
|
|
275
|
+
return b.build();
|
|
276
|
+
};
|
|
277
|
+
exports.se_ListDataSourcesCommand = se_ListDataSourcesCommand;
|
|
278
|
+
const se_ListDocumentsCommand = async (input, context) => {
|
|
279
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
280
|
+
const headers = {};
|
|
281
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents");
|
|
282
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
283
|
+
const query = (0, smithy_client_1.map)({
|
|
284
|
+
[_c]: [, input[_cI]],
|
|
285
|
+
});
|
|
286
|
+
let body;
|
|
287
|
+
b.m("GET")
|
|
288
|
+
.h(headers)
|
|
289
|
+
.q(query)
|
|
290
|
+
.b(body);
|
|
291
|
+
return b.build();
|
|
292
|
+
};
|
|
293
|
+
exports.se_ListDocumentsCommand = se_ListDocumentsCommand;
|
|
294
|
+
const se_ListKnowledgeBasesCommand = async (input, context) => {
|
|
295
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
296
|
+
const headers = {};
|
|
297
|
+
b.bp("/api/v1/knowledge-bases");
|
|
298
|
+
const query = (0, smithy_client_1.map)({
|
|
299
|
+
[_c]: [, input[_cI]],
|
|
300
|
+
});
|
|
301
|
+
let body;
|
|
302
|
+
b.m("GET")
|
|
303
|
+
.h(headers)
|
|
304
|
+
.q(query)
|
|
305
|
+
.b(body);
|
|
306
|
+
return b.build();
|
|
307
|
+
};
|
|
308
|
+
exports.se_ListKnowledgeBasesCommand = se_ListKnowledgeBasesCommand;
|
|
309
|
+
const se_QueryKnowledgeBaseCommand = async (input, context) => {
|
|
310
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
311
|
+
const headers = {
|
|
312
|
+
'content-type': 'application/json',
|
|
313
|
+
};
|
|
314
|
+
b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}/query");
|
|
315
|
+
b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
|
|
316
|
+
const query = (0, smithy_client_1.map)({
|
|
317
|
+
[_c]: [, input[_cI]],
|
|
318
|
+
[_q]: [, (0, smithy_client_1.expectNonNull)(input[_q], `query`)],
|
|
319
|
+
});
|
|
320
|
+
let body;
|
|
321
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
322
|
+
'llmConfig': _ => se_LlmConfig(_, context),
|
|
323
|
+
'searchConfig': _ => se_SearchConfig(_, context),
|
|
324
|
+
}));
|
|
325
|
+
b.m("POST")
|
|
326
|
+
.h(headers)
|
|
327
|
+
.q(query)
|
|
328
|
+
.b(body);
|
|
329
|
+
return b.build();
|
|
330
|
+
};
|
|
331
|
+
exports.se_QueryKnowledgeBaseCommand = se_QueryKnowledgeBaseCommand;
|
|
332
|
+
const se_SearchKnowledgeBaseCommand = async (input, context) => {
|
|
333
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
334
|
+
const headers = {
|
|
335
|
+
'content-type': 'application/json',
|
|
336
|
+
};
|
|
337
|
+
b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}/search");
|
|
338
|
+
b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
|
|
339
|
+
const query = (0, smithy_client_1.map)({
|
|
340
|
+
[_c]: [, input[_cI]],
|
|
341
|
+
[_q]: [, (0, smithy_client_1.expectNonNull)(input[_q], `query`)],
|
|
342
|
+
});
|
|
343
|
+
let body;
|
|
344
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
345
|
+
'searchConfig': _ => se_SearchConfig(_, context),
|
|
346
|
+
}));
|
|
347
|
+
b.m("POST")
|
|
348
|
+
.h(headers)
|
|
349
|
+
.q(query)
|
|
350
|
+
.b(body);
|
|
351
|
+
return b.build();
|
|
352
|
+
};
|
|
353
|
+
exports.se_SearchKnowledgeBaseCommand = se_SearchKnowledgeBaseCommand;
|
|
354
|
+
const se_SyncDataSourceCommand = async (input, context) => {
|
|
355
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
356
|
+
const headers = {};
|
|
357
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/sync");
|
|
358
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
359
|
+
const query = (0, smithy_client_1.map)({
|
|
360
|
+
[_c]: [, input[_cI]],
|
|
361
|
+
[_sT]: [, (0, smithy_client_1.expectNonNull)(input[_sT], `syncType`)],
|
|
362
|
+
});
|
|
363
|
+
let body;
|
|
364
|
+
b.m("POST")
|
|
365
|
+
.h(headers)
|
|
366
|
+
.q(query)
|
|
367
|
+
.b(body);
|
|
368
|
+
return b.build();
|
|
369
|
+
};
|
|
370
|
+
exports.se_SyncDataSourceCommand = se_SyncDataSourceCommand;
|
|
371
|
+
const se_UpdateDataSourceCommand = async (input, context) => {
|
|
372
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
373
|
+
const headers = {
|
|
374
|
+
'content-type': 'application/json',
|
|
375
|
+
};
|
|
376
|
+
b.bp("/api/v1/data-sources/{dataSourceId}");
|
|
377
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
378
|
+
const query = (0, smithy_client_1.map)({
|
|
379
|
+
[_c]: [, input[_cI]],
|
|
380
|
+
});
|
|
381
|
+
let body;
|
|
382
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
383
|
+
'config': _ => (0, smithy_client_1._json)(_),
|
|
384
|
+
'description': [],
|
|
385
|
+
'enabled': [],
|
|
386
|
+
'name': [],
|
|
387
|
+
'syncSchedule': [],
|
|
388
|
+
'type': [],
|
|
389
|
+
}));
|
|
390
|
+
b.m("PUT")
|
|
391
|
+
.h(headers)
|
|
392
|
+
.q(query)
|
|
393
|
+
.b(body);
|
|
394
|
+
return b.build();
|
|
395
|
+
};
|
|
396
|
+
exports.se_UpdateDataSourceCommand = se_UpdateDataSourceCommand;
|
|
397
|
+
const se_UpdateDocumentCommand = async (input, context) => {
|
|
398
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
399
|
+
const headers = {
|
|
400
|
+
'content-type': 'application/json',
|
|
401
|
+
};
|
|
402
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/documents/{documentId}");
|
|
403
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
404
|
+
b.p('documentId', () => input.documentId, '{documentId}', false);
|
|
405
|
+
const query = (0, smithy_client_1.map)({
|
|
406
|
+
[_c]: [, input[_cI]],
|
|
407
|
+
});
|
|
408
|
+
let body;
|
|
409
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
410
|
+
'content': [],
|
|
411
|
+
'originalFormat': [],
|
|
412
|
+
'originalId': [],
|
|
413
|
+
'originalName': [],
|
|
414
|
+
'title': [],
|
|
415
|
+
'url': [],
|
|
416
|
+
}));
|
|
417
|
+
b.m("PUT")
|
|
418
|
+
.h(headers)
|
|
419
|
+
.q(query)
|
|
420
|
+
.b(body);
|
|
421
|
+
return b.build();
|
|
422
|
+
};
|
|
423
|
+
exports.se_UpdateDocumentCommand = se_UpdateDocumentCommand;
|
|
424
|
+
const se_UpdateKnowledgeBaseCommand = async (input, context) => {
|
|
425
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
426
|
+
const headers = {
|
|
427
|
+
'content-type': 'application/json',
|
|
428
|
+
};
|
|
429
|
+
b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}");
|
|
430
|
+
b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
|
|
431
|
+
const query = (0, smithy_client_1.map)({
|
|
432
|
+
[_c]: [, input[_cI]],
|
|
433
|
+
});
|
|
434
|
+
let body;
|
|
435
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
436
|
+
'dataSources': _ => (0, smithy_client_1._json)(_),
|
|
437
|
+
'description': [],
|
|
438
|
+
'name': [],
|
|
439
|
+
}));
|
|
440
|
+
b.m("PUT")
|
|
441
|
+
.h(headers)
|
|
442
|
+
.q(query)
|
|
443
|
+
.b(body);
|
|
444
|
+
return b.build();
|
|
445
|
+
};
|
|
446
|
+
exports.se_UpdateKnowledgeBaseCommand = se_UpdateKnowledgeBaseCommand;
|
|
447
|
+
const de_CreateDataSourceCommand = async (output, context) => {
|
|
448
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
449
|
+
return de_CommandError(output, context);
|
|
450
|
+
}
|
|
451
|
+
const contents = (0, smithy_client_1.map)({
|
|
452
|
+
$metadata: deserializeMetadata(output),
|
|
453
|
+
});
|
|
454
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
455
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
456
|
+
'dataSource': smithy_client_1._json,
|
|
457
|
+
});
|
|
458
|
+
Object.assign(contents, doc);
|
|
459
|
+
return contents;
|
|
460
|
+
};
|
|
461
|
+
exports.de_CreateDataSourceCommand = de_CreateDataSourceCommand;
|
|
462
|
+
const de_CreateDocumentCommand = async (output, context) => {
|
|
463
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
464
|
+
return de_CommandError(output, context);
|
|
465
|
+
}
|
|
466
|
+
const contents = (0, smithy_client_1.map)({
|
|
467
|
+
$metadata: deserializeMetadata(output),
|
|
468
|
+
});
|
|
469
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
470
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
471
|
+
'document': smithy_client_1._json,
|
|
472
|
+
});
|
|
473
|
+
Object.assign(contents, doc);
|
|
474
|
+
return contents;
|
|
475
|
+
};
|
|
476
|
+
exports.de_CreateDocumentCommand = de_CreateDocumentCommand;
|
|
477
|
+
const de_CreateKnowledgeBaseCommand = async (output, context) => {
|
|
478
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
479
|
+
return de_CommandError(output, context);
|
|
480
|
+
}
|
|
481
|
+
const contents = (0, smithy_client_1.map)({
|
|
482
|
+
$metadata: deserializeMetadata(output),
|
|
483
|
+
});
|
|
484
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
485
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
486
|
+
'knowledgeBase': smithy_client_1._json,
|
|
487
|
+
});
|
|
488
|
+
Object.assign(contents, doc);
|
|
489
|
+
return contents;
|
|
490
|
+
};
|
|
491
|
+
exports.de_CreateKnowledgeBaseCommand = de_CreateKnowledgeBaseCommand;
|
|
492
|
+
const de_DeleteDataSourceCommand = async (output, context) => {
|
|
493
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
494
|
+
return de_CommandError(output, context);
|
|
495
|
+
}
|
|
496
|
+
const contents = (0, smithy_client_1.map)({
|
|
497
|
+
$metadata: deserializeMetadata(output),
|
|
498
|
+
});
|
|
499
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
500
|
+
return contents;
|
|
501
|
+
};
|
|
502
|
+
exports.de_DeleteDataSourceCommand = de_DeleteDataSourceCommand;
|
|
503
|
+
const de_DeleteDocumentCommand = async (output, context) => {
|
|
504
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
505
|
+
return de_CommandError(output, context);
|
|
506
|
+
}
|
|
507
|
+
const contents = (0, smithy_client_1.map)({
|
|
508
|
+
$metadata: deserializeMetadata(output),
|
|
509
|
+
});
|
|
510
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
511
|
+
return contents;
|
|
512
|
+
};
|
|
513
|
+
exports.de_DeleteDocumentCommand = de_DeleteDocumentCommand;
|
|
514
|
+
const de_DeleteKnowledgeBaseCommand = async (output, context) => {
|
|
515
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
516
|
+
return de_CommandError(output, context);
|
|
517
|
+
}
|
|
518
|
+
const contents = (0, smithy_client_1.map)({
|
|
519
|
+
$metadata: deserializeMetadata(output),
|
|
520
|
+
});
|
|
521
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
522
|
+
return contents;
|
|
523
|
+
};
|
|
524
|
+
exports.de_DeleteKnowledgeBaseCommand = de_DeleteKnowledgeBaseCommand;
|
|
525
|
+
const de_GetAuthorizationSessionForDataSourceCommand = async (output, context) => {
|
|
526
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
527
|
+
return de_CommandError(output, context);
|
|
528
|
+
}
|
|
529
|
+
const contents = (0, smithy_client_1.map)({
|
|
530
|
+
$metadata: deserializeMetadata(output),
|
|
531
|
+
});
|
|
532
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
533
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
534
|
+
'authorizationSession': smithy_client_1.expectString,
|
|
535
|
+
});
|
|
536
|
+
Object.assign(contents, doc);
|
|
537
|
+
return contents;
|
|
538
|
+
};
|
|
539
|
+
exports.de_GetAuthorizationSessionForDataSourceCommand = de_GetAuthorizationSessionForDataSourceCommand;
|
|
540
|
+
const de_GetDataSourceCommand = async (output, context) => {
|
|
541
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
542
|
+
return de_CommandError(output, context);
|
|
543
|
+
}
|
|
544
|
+
const contents = (0, smithy_client_1.map)({
|
|
545
|
+
$metadata: deserializeMetadata(output),
|
|
546
|
+
});
|
|
547
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
548
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
549
|
+
'dataSource': smithy_client_1._json,
|
|
550
|
+
});
|
|
551
|
+
Object.assign(contents, doc);
|
|
552
|
+
return contents;
|
|
553
|
+
};
|
|
554
|
+
exports.de_GetDataSourceCommand = de_GetDataSourceCommand;
|
|
555
|
+
const de_GetDocumentCommand = async (output, context) => {
|
|
556
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
557
|
+
return de_CommandError(output, context);
|
|
558
|
+
}
|
|
559
|
+
const contents = (0, smithy_client_1.map)({
|
|
560
|
+
$metadata: deserializeMetadata(output),
|
|
561
|
+
});
|
|
562
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
563
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
564
|
+
'document': smithy_client_1._json,
|
|
565
|
+
});
|
|
566
|
+
Object.assign(contents, doc);
|
|
567
|
+
return contents;
|
|
568
|
+
};
|
|
569
|
+
exports.de_GetDocumentCommand = de_GetDocumentCommand;
|
|
570
|
+
const de_GetDocumentPresignedDownloadUrlCommand = async (output, context) => {
|
|
571
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
572
|
+
return de_CommandError(output, context);
|
|
573
|
+
}
|
|
574
|
+
const contents = (0, smithy_client_1.map)({
|
|
575
|
+
$metadata: deserializeMetadata(output),
|
|
576
|
+
});
|
|
577
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
578
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
579
|
+
'presignedDownloadUrl': smithy_client_1.expectString,
|
|
580
|
+
});
|
|
581
|
+
Object.assign(contents, doc);
|
|
582
|
+
return contents;
|
|
583
|
+
};
|
|
584
|
+
exports.de_GetDocumentPresignedDownloadUrlCommand = de_GetDocumentPresignedDownloadUrlCommand;
|
|
585
|
+
const de_GetDocumentPresignedUploadUrlCommand = async (output, context) => {
|
|
586
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
587
|
+
return de_CommandError(output, context);
|
|
588
|
+
}
|
|
589
|
+
const contents = (0, smithy_client_1.map)({
|
|
590
|
+
$metadata: deserializeMetadata(output),
|
|
591
|
+
});
|
|
592
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
593
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
594
|
+
'presignedUploadUrl': smithy_client_1.expectString,
|
|
595
|
+
});
|
|
596
|
+
Object.assign(contents, doc);
|
|
597
|
+
return contents;
|
|
598
|
+
};
|
|
599
|
+
exports.de_GetDocumentPresignedUploadUrlCommand = de_GetDocumentPresignedUploadUrlCommand;
|
|
600
|
+
const de_GetKnowledgeBaseCommand = async (output, context) => {
|
|
601
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
602
|
+
return de_CommandError(output, context);
|
|
603
|
+
}
|
|
604
|
+
const contents = (0, smithy_client_1.map)({
|
|
605
|
+
$metadata: deserializeMetadata(output),
|
|
606
|
+
});
|
|
607
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
608
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
609
|
+
'knowledgeBase': smithy_client_1._json,
|
|
610
|
+
});
|
|
611
|
+
Object.assign(contents, doc);
|
|
612
|
+
return contents;
|
|
613
|
+
};
|
|
614
|
+
exports.de_GetKnowledgeBaseCommand = de_GetKnowledgeBaseCommand;
|
|
615
|
+
const de_GetSyncLogsCommand = async (output, context) => {
|
|
616
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
617
|
+
return de_CommandError(output, context);
|
|
618
|
+
}
|
|
619
|
+
const contents = (0, smithy_client_1.map)({
|
|
620
|
+
$metadata: deserializeMetadata(output),
|
|
621
|
+
});
|
|
622
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
623
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
624
|
+
'logs': smithy_client_1._json,
|
|
625
|
+
});
|
|
626
|
+
Object.assign(contents, doc);
|
|
627
|
+
return contents;
|
|
628
|
+
};
|
|
629
|
+
exports.de_GetSyncLogsCommand = de_GetSyncLogsCommand;
|
|
630
|
+
const de_GetSyncStatusCommand = async (output, context) => {
|
|
631
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
632
|
+
return de_CommandError(output, context);
|
|
633
|
+
}
|
|
634
|
+
const contents = (0, smithy_client_1.map)({
|
|
635
|
+
$metadata: deserializeMetadata(output),
|
|
636
|
+
});
|
|
637
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
638
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
639
|
+
'progress': smithy_client_1.expectInt32,
|
|
640
|
+
'syncErrorMessage': smithy_client_1.expectString,
|
|
641
|
+
'syncStatus': smithy_client_1.expectString,
|
|
642
|
+
});
|
|
643
|
+
Object.assign(contents, doc);
|
|
644
|
+
return contents;
|
|
645
|
+
};
|
|
646
|
+
exports.de_GetSyncStatusCommand = de_GetSyncStatusCommand;
|
|
647
|
+
const de_ListDataSourcesCommand = async (output, context) => {
|
|
648
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
649
|
+
return de_CommandError(output, context);
|
|
650
|
+
}
|
|
651
|
+
const contents = (0, smithy_client_1.map)({
|
|
652
|
+
$metadata: deserializeMetadata(output),
|
|
653
|
+
});
|
|
654
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
655
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
656
|
+
'dataSources': smithy_client_1._json,
|
|
657
|
+
});
|
|
658
|
+
Object.assign(contents, doc);
|
|
659
|
+
return contents;
|
|
660
|
+
};
|
|
661
|
+
exports.de_ListDataSourcesCommand = de_ListDataSourcesCommand;
|
|
662
|
+
const de_ListDocumentsCommand = async (output, context) => {
|
|
663
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
664
|
+
return de_CommandError(output, context);
|
|
665
|
+
}
|
|
666
|
+
const contents = (0, smithy_client_1.map)({
|
|
667
|
+
$metadata: deserializeMetadata(output),
|
|
668
|
+
});
|
|
669
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
670
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
671
|
+
'documents': smithy_client_1._json,
|
|
672
|
+
});
|
|
673
|
+
Object.assign(contents, doc);
|
|
674
|
+
return contents;
|
|
675
|
+
};
|
|
676
|
+
exports.de_ListDocumentsCommand = de_ListDocumentsCommand;
|
|
677
|
+
const de_ListKnowledgeBasesCommand = async (output, context) => {
|
|
678
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
679
|
+
return de_CommandError(output, context);
|
|
680
|
+
}
|
|
681
|
+
const contents = (0, smithy_client_1.map)({
|
|
682
|
+
$metadata: deserializeMetadata(output),
|
|
683
|
+
});
|
|
684
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
685
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
686
|
+
'knowledgeBases': smithy_client_1._json,
|
|
687
|
+
});
|
|
688
|
+
Object.assign(contents, doc);
|
|
689
|
+
return contents;
|
|
690
|
+
};
|
|
691
|
+
exports.de_ListKnowledgeBasesCommand = de_ListKnowledgeBasesCommand;
|
|
692
|
+
const de_QueryKnowledgeBaseCommand = async (output, context) => {
|
|
693
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
694
|
+
return de_CommandError(output, context);
|
|
695
|
+
}
|
|
696
|
+
const contents = (0, smithy_client_1.map)({
|
|
697
|
+
$metadata: deserializeMetadata(output),
|
|
698
|
+
});
|
|
699
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
700
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
701
|
+
'metadata': _ => de_Document(_, context),
|
|
702
|
+
'result': smithy_client_1.expectString,
|
|
703
|
+
});
|
|
704
|
+
Object.assign(contents, doc);
|
|
705
|
+
return contents;
|
|
706
|
+
};
|
|
707
|
+
exports.de_QueryKnowledgeBaseCommand = de_QueryKnowledgeBaseCommand;
|
|
708
|
+
const de_SearchKnowledgeBaseCommand = async (output, context) => {
|
|
709
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
710
|
+
return de_CommandError(output, context);
|
|
711
|
+
}
|
|
712
|
+
const contents = (0, smithy_client_1.map)({
|
|
713
|
+
$metadata: deserializeMetadata(output),
|
|
714
|
+
});
|
|
715
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
716
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
717
|
+
'results': _ => de_SearchKnowledgeBaseResults(_, context),
|
|
718
|
+
});
|
|
719
|
+
Object.assign(contents, doc);
|
|
720
|
+
return contents;
|
|
721
|
+
};
|
|
722
|
+
exports.de_SearchKnowledgeBaseCommand = de_SearchKnowledgeBaseCommand;
|
|
723
|
+
const de_SyncDataSourceCommand = async (output, context) => {
|
|
724
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
725
|
+
return de_CommandError(output, context);
|
|
726
|
+
}
|
|
727
|
+
const contents = (0, smithy_client_1.map)({
|
|
728
|
+
$metadata: deserializeMetadata(output),
|
|
729
|
+
});
|
|
730
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
731
|
+
return contents;
|
|
732
|
+
};
|
|
733
|
+
exports.de_SyncDataSourceCommand = de_SyncDataSourceCommand;
|
|
734
|
+
const de_UpdateDataSourceCommand = async (output, context) => {
|
|
735
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
736
|
+
return de_CommandError(output, context);
|
|
737
|
+
}
|
|
738
|
+
const contents = (0, smithy_client_1.map)({
|
|
739
|
+
$metadata: deserializeMetadata(output),
|
|
740
|
+
});
|
|
741
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
742
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
743
|
+
'dataSource': smithy_client_1._json,
|
|
744
|
+
});
|
|
745
|
+
Object.assign(contents, doc);
|
|
746
|
+
return contents;
|
|
747
|
+
};
|
|
748
|
+
exports.de_UpdateDataSourceCommand = de_UpdateDataSourceCommand;
|
|
749
|
+
const de_UpdateDocumentCommand = async (output, context) => {
|
|
750
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
751
|
+
return de_CommandError(output, context);
|
|
752
|
+
}
|
|
753
|
+
const contents = (0, smithy_client_1.map)({
|
|
754
|
+
$metadata: deserializeMetadata(output),
|
|
755
|
+
});
|
|
756
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
757
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
758
|
+
'document': smithy_client_1._json,
|
|
759
|
+
});
|
|
760
|
+
Object.assign(contents, doc);
|
|
761
|
+
return contents;
|
|
762
|
+
};
|
|
763
|
+
exports.de_UpdateDocumentCommand = de_UpdateDocumentCommand;
|
|
764
|
+
const de_UpdateKnowledgeBaseCommand = async (output, context) => {
|
|
765
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
766
|
+
return de_CommandError(output, context);
|
|
767
|
+
}
|
|
768
|
+
const contents = (0, smithy_client_1.map)({
|
|
769
|
+
$metadata: deserializeMetadata(output),
|
|
770
|
+
});
|
|
771
|
+
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
772
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
773
|
+
'knowledgeBase': smithy_client_1._json,
|
|
774
|
+
});
|
|
775
|
+
Object.assign(contents, doc);
|
|
776
|
+
return contents;
|
|
777
|
+
};
|
|
778
|
+
exports.de_UpdateKnowledgeBaseCommand = de_UpdateKnowledgeBaseCommand;
|
|
779
|
+
const de_CommandError = async (output, context) => {
|
|
780
|
+
const parsedOutput = {
|
|
781
|
+
...output,
|
|
782
|
+
body: await (0, core_1.parseJsonErrorBody)(output.body, context)
|
|
783
|
+
};
|
|
784
|
+
const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
785
|
+
switch (errorCode) {
|
|
786
|
+
case "DataSourceNotFoundException":
|
|
787
|
+
case "wildix.wim.knowledge_base#DataSourceNotFoundException":
|
|
788
|
+
throw await de_DataSourceNotFoundExceptionRes(parsedOutput, context);
|
|
789
|
+
case "DocumentNotFoundException":
|
|
790
|
+
case "wildix.wim.knowledge_base#DocumentNotFoundException":
|
|
791
|
+
throw await de_DocumentNotFoundExceptionRes(parsedOutput, context);
|
|
792
|
+
case "ForbiddenException":
|
|
793
|
+
case "smithy.framework#ForbiddenException":
|
|
794
|
+
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
795
|
+
case "KnowledgeBaseNotFoundException":
|
|
796
|
+
case "wildix.wim.knowledge_base#KnowledgeBaseNotFoundException":
|
|
797
|
+
throw await de_KnowledgeBaseNotFoundExceptionRes(parsedOutput, context);
|
|
798
|
+
case "UnauthorizedException":
|
|
799
|
+
case "smithy.framework#UnauthorizedException":
|
|
800
|
+
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
801
|
+
case "ValidationException":
|
|
802
|
+
case "smithy.framework#ValidationException":
|
|
803
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
804
|
+
default:
|
|
805
|
+
const parsedBody = parsedOutput.body;
|
|
806
|
+
return throwDefaultError({
|
|
807
|
+
output,
|
|
808
|
+
parsedBody,
|
|
809
|
+
errorCode
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
};
|
|
813
|
+
const throwDefaultError = (0, smithy_client_1.withBaseException)(KnowledgeBaseServiceException_1.KnowledgeBaseServiceException);
|
|
814
|
+
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
815
|
+
const contents = (0, smithy_client_1.map)({});
|
|
816
|
+
const data = parsedOutput.body;
|
|
817
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
818
|
+
'message': smithy_client_1.expectString,
|
|
819
|
+
});
|
|
820
|
+
Object.assign(contents, doc);
|
|
821
|
+
const exception = new models_0_1.ForbiddenException({
|
|
822
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
823
|
+
...contents
|
|
824
|
+
});
|
|
825
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
826
|
+
};
|
|
827
|
+
const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
|
|
828
|
+
const contents = (0, smithy_client_1.map)({});
|
|
829
|
+
const data = parsedOutput.body;
|
|
830
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
831
|
+
'message': smithy_client_1.expectString,
|
|
832
|
+
});
|
|
833
|
+
Object.assign(contents, doc);
|
|
834
|
+
const exception = new models_0_1.UnauthorizedException({
|
|
835
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
836
|
+
...contents
|
|
837
|
+
});
|
|
838
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
839
|
+
};
|
|
840
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
841
|
+
const contents = (0, smithy_client_1.map)({});
|
|
842
|
+
const data = parsedOutput.body;
|
|
843
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
844
|
+
'message': smithy_client_1.expectString,
|
|
845
|
+
});
|
|
846
|
+
Object.assign(contents, doc);
|
|
847
|
+
const exception = new models_0_1.ValidationException({
|
|
848
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
849
|
+
...contents
|
|
850
|
+
});
|
|
851
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
852
|
+
};
|
|
853
|
+
const de_DataSourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
854
|
+
const contents = (0, smithy_client_1.map)({});
|
|
855
|
+
const data = parsedOutput.body;
|
|
856
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
857
|
+
'message': smithy_client_1.expectString,
|
|
858
|
+
});
|
|
859
|
+
Object.assign(contents, doc);
|
|
860
|
+
const exception = new models_0_1.DataSourceNotFoundException({
|
|
861
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
862
|
+
...contents
|
|
863
|
+
});
|
|
864
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
865
|
+
};
|
|
866
|
+
const de_DocumentNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
867
|
+
const contents = (0, smithy_client_1.map)({});
|
|
868
|
+
const data = parsedOutput.body;
|
|
869
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
870
|
+
'message': smithy_client_1.expectString,
|
|
871
|
+
});
|
|
872
|
+
Object.assign(contents, doc);
|
|
873
|
+
const exception = new models_0_1.DocumentNotFoundException({
|
|
874
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
875
|
+
...contents
|
|
876
|
+
});
|
|
877
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
878
|
+
};
|
|
879
|
+
const de_KnowledgeBaseNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
880
|
+
const contents = (0, smithy_client_1.map)({});
|
|
881
|
+
const data = parsedOutput.body;
|
|
882
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
883
|
+
'message': smithy_client_1.expectString,
|
|
884
|
+
});
|
|
885
|
+
Object.assign(contents, doc);
|
|
886
|
+
const exception = new models_0_1.KnowledgeBaseNotFoundException({
|
|
887
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
888
|
+
...contents
|
|
889
|
+
});
|
|
890
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
891
|
+
};
|
|
892
|
+
const se_LlmConfig = (input, context) => {
|
|
893
|
+
return (0, smithy_client_1.take)(input, {
|
|
894
|
+
'model': [],
|
|
895
|
+
'provider': [],
|
|
896
|
+
'systemPrompt': [],
|
|
897
|
+
'temperature': smithy_client_1.serializeFloat,
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
const se_SearchConfig = (input, context) => {
|
|
901
|
+
return (0, smithy_client_1.take)(input, {
|
|
902
|
+
'searchStrategy': [],
|
|
903
|
+
'threshold': smithy_client_1.serializeFloat,
|
|
904
|
+
'topK': [],
|
|
905
|
+
});
|
|
906
|
+
};
|
|
907
|
+
const de_Document = (output, context) => {
|
|
908
|
+
return output;
|
|
909
|
+
};
|
|
910
|
+
const de_SearchKnowledgeBaseResult = (output, context) => {
|
|
911
|
+
return (0, smithy_client_1.take)(output, {
|
|
912
|
+
'content': smithy_client_1.expectString,
|
|
913
|
+
'documentId': smithy_client_1.expectString,
|
|
914
|
+
'score': smithy_client_1.limitedParseDouble,
|
|
915
|
+
'source': smithy_client_1.expectString,
|
|
916
|
+
'url': smithy_client_1.expectString,
|
|
917
|
+
});
|
|
918
|
+
};
|
|
919
|
+
const de_SearchKnowledgeBaseResults = (output, context) => {
|
|
920
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
921
|
+
return de_SearchKnowledgeBaseResult(entry, context);
|
|
922
|
+
});
|
|
923
|
+
return retVal;
|
|
924
|
+
};
|
|
925
|
+
const deserializeMetadata = (output) => ({
|
|
926
|
+
httpStatusCode: output.statusCode,
|
|
927
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
928
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
929
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
930
|
+
});
|
|
931
|
+
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then(body => context.utf8Encoder(body));
|
|
932
|
+
const _c = "company";
|
|
933
|
+
const _cI = "companyId";
|
|
934
|
+
const _dT = "documentType";
|
|
935
|
+
const _q = "query";
|
|
936
|
+
const _sT = "syncType";
|