@wildix/wim-knowledge-base-client 0.0.7 → 0.0.8
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 +4 -2
- package/dist-cjs/commands/StartSyncDataSourceCommand.js +21 -0
- package/dist-cjs/commands/{SyncDataSourceCommand.js → StopSyncDataSourceCommand.js} +7 -7
- package/dist-cjs/commands/index.js +2 -1
- package/dist-cjs/models/models_0.js +7 -1
- package/dist-cjs/protocols/Aws_restJson1.js +124 -12
- package/dist-es/KnowledgeBase.js +4 -2
- package/dist-es/commands/StartSyncDataSourceCommand.js +17 -0
- package/dist-es/commands/StopSyncDataSourceCommand.js +17 -0
- package/dist-es/commands/index.js +2 -1
- package/dist-es/models/models_0.js +6 -0
- package/dist-es/protocols/Aws_restJson1.js +122 -12
- package/dist-types/KnowledgeBase.d.ts +12 -5
- package/dist-types/KnowledgeBaseClient.d.ts +4 -3
- package/dist-types/commands/CreateDataSourceCommand.d.ts +30 -0
- package/dist-types/commands/GetDataSourceCommand.d.ts +15 -0
- package/dist-types/commands/ListDataSourcesCommand.d.ts +15 -0
- package/dist-types/commands/StartSyncDataSourceCommand.d.ts +84 -0
- package/dist-types/commands/StopSyncDataSourceCommand.d.ts +83 -0
- package/dist-types/commands/UpdateDataSourceCommand.d.ts +30 -0
- package/dist-types/commands/index.d.ts +2 -1
- package/dist-types/models/models_0.d.ts +93 -3
- package/dist-types/protocols/Aws_restJson1.d.ts +14 -5
- package/package.json +1 -1
- package/dist-es/commands/SyncDataSourceCommand.js +0 -17
- package/dist-types/commands/SyncDataSourceCommand.d.ts +0 -84
|
@@ -21,7 +21,8 @@ const ListDocumentsCommand_1 = require("./commands/ListDocumentsCommand");
|
|
|
21
21
|
const ListKnowledgeBasesCommand_1 = require("./commands/ListKnowledgeBasesCommand");
|
|
22
22
|
const QueryKnowledgeBaseCommand_1 = require("./commands/QueryKnowledgeBaseCommand");
|
|
23
23
|
const SearchKnowledgeBaseCommand_1 = require("./commands/SearchKnowledgeBaseCommand");
|
|
24
|
-
const
|
|
24
|
+
const StartSyncDataSourceCommand_1 = require("./commands/StartSyncDataSourceCommand");
|
|
25
|
+
const StopSyncDataSourceCommand_1 = require("./commands/StopSyncDataSourceCommand");
|
|
25
26
|
const UpdateDataSourceCommand_1 = require("./commands/UpdateDataSourceCommand");
|
|
26
27
|
const UpdateDocumentCommand_1 = require("./commands/UpdateDocumentCommand");
|
|
27
28
|
const UpdateKnowledgeBaseCommand_1 = require("./commands/UpdateKnowledgeBaseCommand");
|
|
@@ -46,7 +47,8 @@ const commands = {
|
|
|
46
47
|
ListKnowledgeBasesCommand: ListKnowledgeBasesCommand_1.ListKnowledgeBasesCommand,
|
|
47
48
|
QueryKnowledgeBaseCommand: QueryKnowledgeBaseCommand_1.QueryKnowledgeBaseCommand,
|
|
48
49
|
SearchKnowledgeBaseCommand: SearchKnowledgeBaseCommand_1.SearchKnowledgeBaseCommand,
|
|
49
|
-
|
|
50
|
+
StartSyncDataSourceCommand: StartSyncDataSourceCommand_1.StartSyncDataSourceCommand,
|
|
51
|
+
StopSyncDataSourceCommand: StopSyncDataSourceCommand_1.StopSyncDataSourceCommand,
|
|
50
52
|
UpdateDataSourceCommand: UpdateDataSourceCommand_1.UpdateDataSourceCommand,
|
|
51
53
|
UpdateDocumentCommand: UpdateDocumentCommand_1.UpdateDocumentCommand,
|
|
52
54
|
UpdateKnowledgeBaseCommand: UpdateKnowledgeBaseCommand_1.UpdateKnowledgeBaseCommand,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StartSyncDataSourceCommand = 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 StartSyncDataSourceCommand 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("KnowledgeBase", "StartSyncDataSource", {})
|
|
15
|
+
.n("KnowledgeBaseClient", "StartSyncDataSourceCommand")
|
|
16
|
+
.f(void 0, void 0)
|
|
17
|
+
.ser(Aws_restJson1_1.se_StartSyncDataSourceCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_StartSyncDataSourceCommand)
|
|
19
|
+
.build() {
|
|
20
|
+
}
|
|
21
|
+
exports.StartSyncDataSourceCommand = StartSyncDataSourceCommand;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.StopSyncDataSourceCommand = exports.$Command = void 0;
|
|
4
4
|
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
5
5
|
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
6
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
7
|
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
-
class
|
|
8
|
+
class StopSyncDataSourceCommand extends smithy_client_1.Command.classBuilder()
|
|
9
9
|
.m(function (Command, cs, config, o) {
|
|
10
10
|
return [
|
|
11
11
|
(0, middleware_serde_1.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
12
12
|
];
|
|
13
13
|
})
|
|
14
|
-
.s("KnowledgeBase", "
|
|
15
|
-
.n("KnowledgeBaseClient", "
|
|
14
|
+
.s("KnowledgeBase", "StopSyncDataSource", {})
|
|
15
|
+
.n("KnowledgeBaseClient", "StopSyncDataSourceCommand")
|
|
16
16
|
.f(void 0, void 0)
|
|
17
|
-
.ser(Aws_restJson1_1.
|
|
18
|
-
.de(Aws_restJson1_1.
|
|
17
|
+
.ser(Aws_restJson1_1.se_StopSyncDataSourceCommand)
|
|
18
|
+
.de(Aws_restJson1_1.de_StopSyncDataSourceCommand)
|
|
19
19
|
.build() {
|
|
20
20
|
}
|
|
21
|
-
exports.
|
|
21
|
+
exports.StopSyncDataSourceCommand = StopSyncDataSourceCommand;
|
|
@@ -20,7 +20,8 @@ tslib_1.__exportStar(require("./ListDocumentsCommand"), exports);
|
|
|
20
20
|
tslib_1.__exportStar(require("./ListKnowledgeBasesCommand"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("./QueryKnowledgeBaseCommand"), exports);
|
|
22
22
|
tslib_1.__exportStar(require("./SearchKnowledgeBaseCommand"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./
|
|
23
|
+
tslib_1.__exportStar(require("./StartSyncDataSourceCommand"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./StopSyncDataSourceCommand"), exports);
|
|
24
25
|
tslib_1.__exportStar(require("./UpdateDataSourceCommand"), exports);
|
|
25
26
|
tslib_1.__exportStar(require("./UpdateDocumentCommand"), exports);
|
|
26
27
|
tslib_1.__exportStar(require("./UpdateKnowledgeBaseCommand"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchStrategy = exports.SyncLogLevel = exports.DownloadDocumentType = exports.DocumentStatus = exports.KnowledgeBaseNotFoundException = exports.DocumentNotFoundException = exports.DataSourceNotFoundException = exports.SyncDataSourceStatus = exports.SyncDataSourceMode = exports.DataSourceType = exports.DataSourceConfig = exports.UnauthorizedException = exports.ForbiddenException = exports.ValidationException = void 0;
|
|
3
|
+
exports.SearchStrategy = exports.SyncLogLevel = exports.DownloadDocumentType = exports.DocumentStatus = exports.KnowledgeBaseNotFoundException = exports.DocumentNotFoundException = exports.DataSourceNotFoundException = exports.SyncDataSourceStatus = exports.SyncDataSourceMode = exports.DataSourceType = exports.DataSourceConfig = exports.ProxyMethod = exports.UnauthorizedException = exports.ForbiddenException = exports.ValidationException = void 0;
|
|
4
4
|
const KnowledgeBaseServiceException_1 = require("./KnowledgeBaseServiceException");
|
|
5
5
|
class ValidationException extends KnowledgeBaseServiceException_1.KnowledgeBaseServiceException {
|
|
6
6
|
name = "ValidationException";
|
|
@@ -41,6 +41,10 @@ class UnauthorizedException extends KnowledgeBaseServiceException_1.KnowledgeBas
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.UnauthorizedException = UnauthorizedException;
|
|
44
|
+
exports.ProxyMethod = {
|
|
45
|
+
GET: "GET",
|
|
46
|
+
POST: "POST",
|
|
47
|
+
};
|
|
44
48
|
var DataSourceConfig;
|
|
45
49
|
(function (DataSourceConfig) {
|
|
46
50
|
DataSourceConfig.visit = (value, visitor) => {
|
|
@@ -50,6 +54,8 @@ var DataSourceConfig;
|
|
|
50
54
|
return visitor.gdrive(value.gdrive);
|
|
51
55
|
if (value.files !== undefined)
|
|
52
56
|
return visitor.files(value.files);
|
|
57
|
+
if (value.proxy !== undefined)
|
|
58
|
+
return visitor.proxy(value.proxy);
|
|
53
59
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
54
60
|
};
|
|
55
61
|
})(DataSourceConfig || (exports.DataSourceConfig = DataSourceConfig = {}));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = exports.de_UpdateDataSourceCommand = exports.
|
|
3
|
+
exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = exports.de_UpdateDataSourceCommand = exports.de_StopSyncDataSourceCommand = exports.de_StartSyncDataSourceCommand = 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_StopSyncDataSourceCommand = exports.se_StartSyncDataSourceCommand = 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
4
|
const KnowledgeBaseServiceException_1 = require("../models/KnowledgeBaseServiceException");
|
|
5
5
|
const models_0_1 = require("../models/models_0");
|
|
6
6
|
const core_1 = require("@aws-sdk/core");
|
|
@@ -17,7 +17,7 @@ const se_CreateDataSourceCommand = async (input, context) => {
|
|
|
17
17
|
});
|
|
18
18
|
let body;
|
|
19
19
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
20
|
-
'config': _ => (
|
|
20
|
+
'config': _ => se_DataSourceConfig(_, context),
|
|
21
21
|
'description': [],
|
|
22
22
|
'enabled': [],
|
|
23
23
|
'name': [],
|
|
@@ -351,10 +351,10 @@ const se_SearchKnowledgeBaseCommand = async (input, context) => {
|
|
|
351
351
|
return b.build();
|
|
352
352
|
};
|
|
353
353
|
exports.se_SearchKnowledgeBaseCommand = se_SearchKnowledgeBaseCommand;
|
|
354
|
-
const
|
|
354
|
+
const se_StartSyncDataSourceCommand = async (input, context) => {
|
|
355
355
|
const b = (0, core_2.requestBuilder)(input, context);
|
|
356
356
|
const headers = {};
|
|
357
|
-
b.bp("/api/v1/data-sources/{dataSourceId}/sync");
|
|
357
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/start-sync");
|
|
358
358
|
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
359
359
|
const query = (0, smithy_client_1.map)({
|
|
360
360
|
[_c]: [, input[_cI]],
|
|
@@ -367,7 +367,23 @@ const se_SyncDataSourceCommand = async (input, context) => {
|
|
|
367
367
|
.b(body);
|
|
368
368
|
return b.build();
|
|
369
369
|
};
|
|
370
|
-
exports.
|
|
370
|
+
exports.se_StartSyncDataSourceCommand = se_StartSyncDataSourceCommand;
|
|
371
|
+
const se_StopSyncDataSourceCommand = async (input, context) => {
|
|
372
|
+
const b = (0, core_2.requestBuilder)(input, context);
|
|
373
|
+
const headers = {};
|
|
374
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/stop-sync");
|
|
375
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
376
|
+
const query = (0, smithy_client_1.map)({
|
|
377
|
+
[_c]: [, input[_cI]],
|
|
378
|
+
});
|
|
379
|
+
let body;
|
|
380
|
+
b.m("POST")
|
|
381
|
+
.h(headers)
|
|
382
|
+
.q(query)
|
|
383
|
+
.b(body);
|
|
384
|
+
return b.build();
|
|
385
|
+
};
|
|
386
|
+
exports.se_StopSyncDataSourceCommand = se_StopSyncDataSourceCommand;
|
|
371
387
|
const se_UpdateDataSourceCommand = async (input, context) => {
|
|
372
388
|
const b = (0, core_2.requestBuilder)(input, context);
|
|
373
389
|
const headers = {
|
|
@@ -380,7 +396,7 @@ const se_UpdateDataSourceCommand = async (input, context) => {
|
|
|
380
396
|
});
|
|
381
397
|
let body;
|
|
382
398
|
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
383
|
-
'config': _ => (
|
|
399
|
+
'config': _ => se_DataSourceConfig(_, context),
|
|
384
400
|
'description': [],
|
|
385
401
|
'enabled': [],
|
|
386
402
|
'name': [],
|
|
@@ -453,7 +469,7 @@ const de_CreateDataSourceCommand = async (output, context) => {
|
|
|
453
469
|
});
|
|
454
470
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
455
471
|
const doc = (0, smithy_client_1.take)(data, {
|
|
456
|
-
'dataSource':
|
|
472
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
457
473
|
});
|
|
458
474
|
Object.assign(contents, doc);
|
|
459
475
|
return contents;
|
|
@@ -546,7 +562,7 @@ const de_GetDataSourceCommand = async (output, context) => {
|
|
|
546
562
|
});
|
|
547
563
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
548
564
|
const doc = (0, smithy_client_1.take)(data, {
|
|
549
|
-
'dataSource':
|
|
565
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
550
566
|
});
|
|
551
567
|
Object.assign(contents, doc);
|
|
552
568
|
return contents;
|
|
@@ -653,7 +669,7 @@ const de_ListDataSourcesCommand = async (output, context) => {
|
|
|
653
669
|
});
|
|
654
670
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
655
671
|
const doc = (0, smithy_client_1.take)(data, {
|
|
656
|
-
'dataSources':
|
|
672
|
+
'dataSources': _ => de_DataSourceList(_, context),
|
|
657
673
|
});
|
|
658
674
|
Object.assign(contents, doc);
|
|
659
675
|
return contents;
|
|
@@ -720,7 +736,7 @@ const de_SearchKnowledgeBaseCommand = async (output, context) => {
|
|
|
720
736
|
return contents;
|
|
721
737
|
};
|
|
722
738
|
exports.de_SearchKnowledgeBaseCommand = de_SearchKnowledgeBaseCommand;
|
|
723
|
-
const
|
|
739
|
+
const de_StartSyncDataSourceCommand = async (output, context) => {
|
|
724
740
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
725
741
|
return de_CommandError(output, context);
|
|
726
742
|
}
|
|
@@ -730,7 +746,18 @@ const de_SyncDataSourceCommand = async (output, context) => {
|
|
|
730
746
|
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
731
747
|
return contents;
|
|
732
748
|
};
|
|
733
|
-
exports.
|
|
749
|
+
exports.de_StartSyncDataSourceCommand = de_StartSyncDataSourceCommand;
|
|
750
|
+
const de_StopSyncDataSourceCommand = async (output, context) => {
|
|
751
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
752
|
+
return de_CommandError(output, context);
|
|
753
|
+
}
|
|
754
|
+
const contents = (0, smithy_client_1.map)({
|
|
755
|
+
$metadata: deserializeMetadata(output),
|
|
756
|
+
});
|
|
757
|
+
await (0, smithy_client_1.collectBody)(output.body, context);
|
|
758
|
+
return contents;
|
|
759
|
+
};
|
|
760
|
+
exports.de_StopSyncDataSourceCommand = de_StopSyncDataSourceCommand;
|
|
734
761
|
const de_UpdateDataSourceCommand = async (output, context) => {
|
|
735
762
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
736
763
|
return de_CommandError(output, context);
|
|
@@ -740,7 +767,7 @@ const de_UpdateDataSourceCommand = async (output, context) => {
|
|
|
740
767
|
});
|
|
741
768
|
const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
|
|
742
769
|
const doc = (0, smithy_client_1.take)(data, {
|
|
743
|
-
'dataSource':
|
|
770
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
744
771
|
});
|
|
745
772
|
Object.assign(contents, doc);
|
|
746
773
|
return contents;
|
|
@@ -889,6 +916,18 @@ const de_KnowledgeBaseNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
889
916
|
});
|
|
890
917
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
891
918
|
};
|
|
919
|
+
const se_Document = (input, context) => {
|
|
920
|
+
return input;
|
|
921
|
+
};
|
|
922
|
+
const se_DataSourceConfig = (input, context) => {
|
|
923
|
+
return models_0_1.DataSourceConfig.visit(input, {
|
|
924
|
+
confluence: value => ({ "confluence": (0, smithy_client_1._json)(value) }),
|
|
925
|
+
files: value => ({ "files": (0, smithy_client_1._json)(value) }),
|
|
926
|
+
gdrive: value => ({ "gdrive": (0, smithy_client_1._json)(value) }),
|
|
927
|
+
proxy: value => ({ "proxy": se_ProxyConfig(value, context) }),
|
|
928
|
+
_: (name, value) => ({ [name]: value })
|
|
929
|
+
});
|
|
930
|
+
};
|
|
892
931
|
const se_LlmConfig = (input, context) => {
|
|
893
932
|
return (0, smithy_client_1.take)(input, {
|
|
894
933
|
'model': [],
|
|
@@ -897,6 +936,19 @@ const se_LlmConfig = (input, context) => {
|
|
|
897
936
|
'temperature': smithy_client_1.serializeFloat,
|
|
898
937
|
});
|
|
899
938
|
};
|
|
939
|
+
const se_ProxyConfig = (input, context) => {
|
|
940
|
+
return (0, smithy_client_1.take)(input, {
|
|
941
|
+
'body': _ => se_Document(_, context),
|
|
942
|
+
'headers': smithy_client_1._json,
|
|
943
|
+
'method': [],
|
|
944
|
+
'password': [],
|
|
945
|
+
'responseMapping': smithy_client_1._json,
|
|
946
|
+
'timeoutMs': [],
|
|
947
|
+
'token': [],
|
|
948
|
+
'url': [],
|
|
949
|
+
'username': [],
|
|
950
|
+
});
|
|
951
|
+
};
|
|
900
952
|
const se_SearchConfig = (input, context) => {
|
|
901
953
|
return (0, smithy_client_1.take)(input, {
|
|
902
954
|
'searchStrategy': [],
|
|
@@ -907,6 +959,66 @@ const se_SearchConfig = (input, context) => {
|
|
|
907
959
|
const de_Document = (output, context) => {
|
|
908
960
|
return output;
|
|
909
961
|
};
|
|
962
|
+
const de_DataSourceConfig = (output, context) => {
|
|
963
|
+
if (output.confluence != null) {
|
|
964
|
+
return {
|
|
965
|
+
confluence: (0, smithy_client_1._json)(output.confluence)
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
if (output.files != null) {
|
|
969
|
+
return {
|
|
970
|
+
files: (0, smithy_client_1._json)(output.files)
|
|
971
|
+
};
|
|
972
|
+
}
|
|
973
|
+
if (output.gdrive != null) {
|
|
974
|
+
return {
|
|
975
|
+
gdrive: (0, smithy_client_1._json)(output.gdrive)
|
|
976
|
+
};
|
|
977
|
+
}
|
|
978
|
+
if (output.proxy != null) {
|
|
979
|
+
return {
|
|
980
|
+
proxy: de_ProxyConfig(output.proxy, context)
|
|
981
|
+
};
|
|
982
|
+
}
|
|
983
|
+
return { $unknown: Object.entries(output)[0] };
|
|
984
|
+
};
|
|
985
|
+
const de_DataSourceItem = (output, context) => {
|
|
986
|
+
return (0, smithy_client_1.take)(output, {
|
|
987
|
+
'companyId': smithy_client_1.expectString,
|
|
988
|
+
'config': (_) => de_DataSourceConfig((0, core_1.awsExpectUnion)(_), context),
|
|
989
|
+
'createdAt': smithy_client_1.expectString,
|
|
990
|
+
'description': smithy_client_1.expectString,
|
|
991
|
+
'enabled': smithy_client_1.expectBoolean,
|
|
992
|
+
'id': smithy_client_1.expectString,
|
|
993
|
+
'lastSyncErrorMessage': smithy_client_1.expectString,
|
|
994
|
+
'lastSyncMode': smithy_client_1.expectString,
|
|
995
|
+
'lastSyncedAt': smithy_client_1.expectString,
|
|
996
|
+
'name': smithy_client_1.expectString,
|
|
997
|
+
'syncSchedule': smithy_client_1.expectString,
|
|
998
|
+
'syncStatus': smithy_client_1.expectString,
|
|
999
|
+
'type': smithy_client_1.expectString,
|
|
1000
|
+
'updatedAt': smithy_client_1.expectString,
|
|
1001
|
+
});
|
|
1002
|
+
};
|
|
1003
|
+
const de_DataSourceList = (output, context) => {
|
|
1004
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
1005
|
+
return de_DataSourceItem(entry, context);
|
|
1006
|
+
});
|
|
1007
|
+
return retVal;
|
|
1008
|
+
};
|
|
1009
|
+
const de_ProxyConfig = (output, context) => {
|
|
1010
|
+
return (0, smithy_client_1.take)(output, {
|
|
1011
|
+
'body': (_) => de_Document(_, context),
|
|
1012
|
+
'headers': smithy_client_1._json,
|
|
1013
|
+
'method': smithy_client_1.expectString,
|
|
1014
|
+
'password': smithy_client_1.expectString,
|
|
1015
|
+
'responseMapping': smithy_client_1._json,
|
|
1016
|
+
'timeoutMs': smithy_client_1.expectInt32,
|
|
1017
|
+
'token': smithy_client_1.expectString,
|
|
1018
|
+
'url': smithy_client_1.expectString,
|
|
1019
|
+
'username': smithy_client_1.expectString,
|
|
1020
|
+
});
|
|
1021
|
+
};
|
|
910
1022
|
const de_SearchKnowledgeBaseResult = (output, context) => {
|
|
911
1023
|
return (0, smithy_client_1.take)(output, {
|
|
912
1024
|
'content': smithy_client_1.expectString,
|
package/dist-es/KnowledgeBase.js
CHANGED
|
@@ -18,7 +18,8 @@ import { ListDocumentsCommand, } from "./commands/ListDocumentsCommand";
|
|
|
18
18
|
import { ListKnowledgeBasesCommand, } from "./commands/ListKnowledgeBasesCommand";
|
|
19
19
|
import { QueryKnowledgeBaseCommand, } from "./commands/QueryKnowledgeBaseCommand";
|
|
20
20
|
import { SearchKnowledgeBaseCommand, } from "./commands/SearchKnowledgeBaseCommand";
|
|
21
|
-
import {
|
|
21
|
+
import { StartSyncDataSourceCommand, } from "./commands/StartSyncDataSourceCommand";
|
|
22
|
+
import { StopSyncDataSourceCommand, } from "./commands/StopSyncDataSourceCommand";
|
|
22
23
|
import { UpdateDataSourceCommand, } from "./commands/UpdateDataSourceCommand";
|
|
23
24
|
import { UpdateDocumentCommand, } from "./commands/UpdateDocumentCommand";
|
|
24
25
|
import { UpdateKnowledgeBaseCommand, } from "./commands/UpdateKnowledgeBaseCommand";
|
|
@@ -43,7 +44,8 @@ const commands = {
|
|
|
43
44
|
ListKnowledgeBasesCommand,
|
|
44
45
|
QueryKnowledgeBaseCommand,
|
|
45
46
|
SearchKnowledgeBaseCommand,
|
|
46
|
-
|
|
47
|
+
StartSyncDataSourceCommand,
|
|
48
|
+
StopSyncDataSourceCommand,
|
|
47
49
|
UpdateDataSourceCommand,
|
|
48
50
|
UpdateDocumentCommand,
|
|
49
51
|
UpdateKnowledgeBaseCommand,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_StartSyncDataSourceCommand, se_StartSyncDataSourceCommand, } 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 StartSyncDataSourceCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("KnowledgeBase", "StartSyncDataSource", {})
|
|
12
|
+
.n("KnowledgeBaseClient", "StartSyncDataSourceCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_StartSyncDataSourceCommand)
|
|
15
|
+
.de(de_StartSyncDataSourceCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { de_StopSyncDataSourceCommand, se_StopSyncDataSourceCommand, } 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 StopSyncDataSourceCommand extends $Command.classBuilder()
|
|
6
|
+
.m(function (Command, cs, config, o) {
|
|
7
|
+
return [
|
|
8
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
9
|
+
];
|
|
10
|
+
})
|
|
11
|
+
.s("KnowledgeBase", "StopSyncDataSource", {})
|
|
12
|
+
.n("KnowledgeBaseClient", "StopSyncDataSourceCommand")
|
|
13
|
+
.f(void 0, void 0)
|
|
14
|
+
.ser(se_StopSyncDataSourceCommand)
|
|
15
|
+
.de(de_StopSyncDataSourceCommand)
|
|
16
|
+
.build() {
|
|
17
|
+
}
|
|
@@ -17,7 +17,8 @@ export * from "./ListDocumentsCommand";
|
|
|
17
17
|
export * from "./ListKnowledgeBasesCommand";
|
|
18
18
|
export * from "./QueryKnowledgeBaseCommand";
|
|
19
19
|
export * from "./SearchKnowledgeBaseCommand";
|
|
20
|
-
export * from "./
|
|
20
|
+
export * from "./StartSyncDataSourceCommand";
|
|
21
|
+
export * from "./StopSyncDataSourceCommand";
|
|
21
22
|
export * from "./UpdateDataSourceCommand";
|
|
22
23
|
export * from "./UpdateDocumentCommand";
|
|
23
24
|
export * from "./UpdateKnowledgeBaseCommand";
|
|
@@ -35,6 +35,10 @@ export class UnauthorizedException extends __BaseException {
|
|
|
35
35
|
Object.setPrototypeOf(this, UnauthorizedException.prototype);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
+
export const ProxyMethod = {
|
|
39
|
+
GET: "GET",
|
|
40
|
+
POST: "POST",
|
|
41
|
+
};
|
|
38
42
|
export var DataSourceConfig;
|
|
39
43
|
(function (DataSourceConfig) {
|
|
40
44
|
DataSourceConfig.visit = (value, visitor) => {
|
|
@@ -44,6 +48,8 @@ export var DataSourceConfig;
|
|
|
44
48
|
return visitor.gdrive(value.gdrive);
|
|
45
49
|
if (value.files !== undefined)
|
|
46
50
|
return visitor.files(value.files);
|
|
51
|
+
if (value.proxy !== undefined)
|
|
52
|
+
return visitor.proxy(value.proxy);
|
|
47
53
|
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
48
54
|
};
|
|
49
55
|
})(DataSourceConfig || (DataSourceConfig = {}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { KnowledgeBaseServiceException as __BaseException } from "../models/KnowledgeBaseServiceException";
|
|
2
|
-
import { DataSourceNotFoundException, DocumentNotFoundException, ForbiddenException, KnowledgeBaseNotFoundException, UnauthorizedException, ValidationException, } from "../models/models_0";
|
|
3
|
-
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
2
|
+
import { DataSourceConfig, DataSourceNotFoundException, DocumentNotFoundException, ForbiddenException, KnowledgeBaseNotFoundException, UnauthorizedException, ValidationException, } from "../models/models_0";
|
|
3
|
+
import { awsExpectUnion as __expectUnion, loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody, } from "@aws-sdk/core";
|
|
4
4
|
import { requestBuilder as rb } from "@smithy/core";
|
|
5
|
-
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
5
|
+
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, serializeFloat as __serializeFloat, _json, collectBody, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
6
6
|
export const se_CreateDataSourceCommand = async (input, context) => {
|
|
7
7
|
const b = rb(input, context);
|
|
8
8
|
const headers = {
|
|
@@ -14,7 +14,7 @@ export const se_CreateDataSourceCommand = async (input, context) => {
|
|
|
14
14
|
});
|
|
15
15
|
let body;
|
|
16
16
|
body = JSON.stringify(take(input, {
|
|
17
|
-
'config': _ =>
|
|
17
|
+
'config': _ => se_DataSourceConfig(_, context),
|
|
18
18
|
'description': [],
|
|
19
19
|
'enabled': [],
|
|
20
20
|
'name': [],
|
|
@@ -329,10 +329,10 @@ export const se_SearchKnowledgeBaseCommand = async (input, context) => {
|
|
|
329
329
|
.b(body);
|
|
330
330
|
return b.build();
|
|
331
331
|
};
|
|
332
|
-
export const
|
|
332
|
+
export const se_StartSyncDataSourceCommand = async (input, context) => {
|
|
333
333
|
const b = rb(input, context);
|
|
334
334
|
const headers = {};
|
|
335
|
-
b.bp("/api/v1/data-sources/{dataSourceId}/sync");
|
|
335
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/start-sync");
|
|
336
336
|
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
337
337
|
const query = map({
|
|
338
338
|
[_c]: [, input[_cI]],
|
|
@@ -345,6 +345,21 @@ export const se_SyncDataSourceCommand = async (input, context) => {
|
|
|
345
345
|
.b(body);
|
|
346
346
|
return b.build();
|
|
347
347
|
};
|
|
348
|
+
export const se_StopSyncDataSourceCommand = async (input, context) => {
|
|
349
|
+
const b = rb(input, context);
|
|
350
|
+
const headers = {};
|
|
351
|
+
b.bp("/api/v1/data-sources/{dataSourceId}/stop-sync");
|
|
352
|
+
b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
|
|
353
|
+
const query = map({
|
|
354
|
+
[_c]: [, input[_cI]],
|
|
355
|
+
});
|
|
356
|
+
let body;
|
|
357
|
+
b.m("POST")
|
|
358
|
+
.h(headers)
|
|
359
|
+
.q(query)
|
|
360
|
+
.b(body);
|
|
361
|
+
return b.build();
|
|
362
|
+
};
|
|
348
363
|
export const se_UpdateDataSourceCommand = async (input, context) => {
|
|
349
364
|
const b = rb(input, context);
|
|
350
365
|
const headers = {
|
|
@@ -357,7 +372,7 @@ export const se_UpdateDataSourceCommand = async (input, context) => {
|
|
|
357
372
|
});
|
|
358
373
|
let body;
|
|
359
374
|
body = JSON.stringify(take(input, {
|
|
360
|
-
'config': _ =>
|
|
375
|
+
'config': _ => se_DataSourceConfig(_, context),
|
|
361
376
|
'description': [],
|
|
362
377
|
'enabled': [],
|
|
363
378
|
'name': [],
|
|
@@ -427,7 +442,7 @@ export const de_CreateDataSourceCommand = async (output, context) => {
|
|
|
427
442
|
});
|
|
428
443
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
429
444
|
const doc = take(data, {
|
|
430
|
-
'dataSource':
|
|
445
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
431
446
|
});
|
|
432
447
|
Object.assign(contents, doc);
|
|
433
448
|
return contents;
|
|
@@ -513,7 +528,7 @@ export const de_GetDataSourceCommand = async (output, context) => {
|
|
|
513
528
|
});
|
|
514
529
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
515
530
|
const doc = take(data, {
|
|
516
|
-
'dataSource':
|
|
531
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
517
532
|
});
|
|
518
533
|
Object.assign(contents, doc);
|
|
519
534
|
return contents;
|
|
@@ -613,7 +628,7 @@ export const de_ListDataSourcesCommand = async (output, context) => {
|
|
|
613
628
|
});
|
|
614
629
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
615
630
|
const doc = take(data, {
|
|
616
|
-
'dataSources':
|
|
631
|
+
'dataSources': _ => de_DataSourceList(_, context),
|
|
617
632
|
});
|
|
618
633
|
Object.assign(contents, doc);
|
|
619
634
|
return contents;
|
|
@@ -675,7 +690,17 @@ export const de_SearchKnowledgeBaseCommand = async (output, context) => {
|
|
|
675
690
|
Object.assign(contents, doc);
|
|
676
691
|
return contents;
|
|
677
692
|
};
|
|
678
|
-
export const
|
|
693
|
+
export const de_StartSyncDataSourceCommand = async (output, context) => {
|
|
694
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
695
|
+
return de_CommandError(output, context);
|
|
696
|
+
}
|
|
697
|
+
const contents = map({
|
|
698
|
+
$metadata: deserializeMetadata(output),
|
|
699
|
+
});
|
|
700
|
+
await collectBody(output.body, context);
|
|
701
|
+
return contents;
|
|
702
|
+
};
|
|
703
|
+
export const de_StopSyncDataSourceCommand = async (output, context) => {
|
|
679
704
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
680
705
|
return de_CommandError(output, context);
|
|
681
706
|
}
|
|
@@ -694,7 +719,7 @@ export const de_UpdateDataSourceCommand = async (output, context) => {
|
|
|
694
719
|
});
|
|
695
720
|
const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
|
|
696
721
|
const doc = take(data, {
|
|
697
|
-
'dataSource':
|
|
722
|
+
'dataSource': _ => de_DataSourceItem(_, context),
|
|
698
723
|
});
|
|
699
724
|
Object.assign(contents, doc);
|
|
700
725
|
return contents;
|
|
@@ -840,6 +865,18 @@ const de_KnowledgeBaseNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
840
865
|
});
|
|
841
866
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
842
867
|
};
|
|
868
|
+
const se_Document = (input, context) => {
|
|
869
|
+
return input;
|
|
870
|
+
};
|
|
871
|
+
const se_DataSourceConfig = (input, context) => {
|
|
872
|
+
return DataSourceConfig.visit(input, {
|
|
873
|
+
confluence: value => ({ "confluence": _json(value) }),
|
|
874
|
+
files: value => ({ "files": _json(value) }),
|
|
875
|
+
gdrive: value => ({ "gdrive": _json(value) }),
|
|
876
|
+
proxy: value => ({ "proxy": se_ProxyConfig(value, context) }),
|
|
877
|
+
_: (name, value) => ({ [name]: value })
|
|
878
|
+
});
|
|
879
|
+
};
|
|
843
880
|
const se_LlmConfig = (input, context) => {
|
|
844
881
|
return take(input, {
|
|
845
882
|
'model': [],
|
|
@@ -848,6 +885,19 @@ const se_LlmConfig = (input, context) => {
|
|
|
848
885
|
'temperature': __serializeFloat,
|
|
849
886
|
});
|
|
850
887
|
};
|
|
888
|
+
const se_ProxyConfig = (input, context) => {
|
|
889
|
+
return take(input, {
|
|
890
|
+
'body': _ => se_Document(_, context),
|
|
891
|
+
'headers': _json,
|
|
892
|
+
'method': [],
|
|
893
|
+
'password': [],
|
|
894
|
+
'responseMapping': _json,
|
|
895
|
+
'timeoutMs': [],
|
|
896
|
+
'token': [],
|
|
897
|
+
'url': [],
|
|
898
|
+
'username': [],
|
|
899
|
+
});
|
|
900
|
+
};
|
|
851
901
|
const se_SearchConfig = (input, context) => {
|
|
852
902
|
return take(input, {
|
|
853
903
|
'searchStrategy': [],
|
|
@@ -858,6 +908,66 @@ const se_SearchConfig = (input, context) => {
|
|
|
858
908
|
const de_Document = (output, context) => {
|
|
859
909
|
return output;
|
|
860
910
|
};
|
|
911
|
+
const de_DataSourceConfig = (output, context) => {
|
|
912
|
+
if (output.confluence != null) {
|
|
913
|
+
return {
|
|
914
|
+
confluence: _json(output.confluence)
|
|
915
|
+
};
|
|
916
|
+
}
|
|
917
|
+
if (output.files != null) {
|
|
918
|
+
return {
|
|
919
|
+
files: _json(output.files)
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
if (output.gdrive != null) {
|
|
923
|
+
return {
|
|
924
|
+
gdrive: _json(output.gdrive)
|
|
925
|
+
};
|
|
926
|
+
}
|
|
927
|
+
if (output.proxy != null) {
|
|
928
|
+
return {
|
|
929
|
+
proxy: de_ProxyConfig(output.proxy, context)
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
return { $unknown: Object.entries(output)[0] };
|
|
933
|
+
};
|
|
934
|
+
const de_DataSourceItem = (output, context) => {
|
|
935
|
+
return take(output, {
|
|
936
|
+
'companyId': __expectString,
|
|
937
|
+
'config': (_) => de_DataSourceConfig(__expectUnion(_), context),
|
|
938
|
+
'createdAt': __expectString,
|
|
939
|
+
'description': __expectString,
|
|
940
|
+
'enabled': __expectBoolean,
|
|
941
|
+
'id': __expectString,
|
|
942
|
+
'lastSyncErrorMessage': __expectString,
|
|
943
|
+
'lastSyncMode': __expectString,
|
|
944
|
+
'lastSyncedAt': __expectString,
|
|
945
|
+
'name': __expectString,
|
|
946
|
+
'syncSchedule': __expectString,
|
|
947
|
+
'syncStatus': __expectString,
|
|
948
|
+
'type': __expectString,
|
|
949
|
+
'updatedAt': __expectString,
|
|
950
|
+
});
|
|
951
|
+
};
|
|
952
|
+
const de_DataSourceList = (output, context) => {
|
|
953
|
+
const retVal = (output || []).filter((e) => e != null).map((entry) => {
|
|
954
|
+
return de_DataSourceItem(entry, context);
|
|
955
|
+
});
|
|
956
|
+
return retVal;
|
|
957
|
+
};
|
|
958
|
+
const de_ProxyConfig = (output, context) => {
|
|
959
|
+
return take(output, {
|
|
960
|
+
'body': (_) => de_Document(_, context),
|
|
961
|
+
'headers': _json,
|
|
962
|
+
'method': __expectString,
|
|
963
|
+
'password': __expectString,
|
|
964
|
+
'responseMapping': _json,
|
|
965
|
+
'timeoutMs': __expectInt32,
|
|
966
|
+
'token': __expectString,
|
|
967
|
+
'url': __expectString,
|
|
968
|
+
'username': __expectString,
|
|
969
|
+
});
|
|
970
|
+
};
|
|
861
971
|
const de_SearchKnowledgeBaseResult = (output, context) => {
|
|
862
972
|
return take(output, {
|
|
863
973
|
'content': __expectString,
|