@wildix/wim-knowledge-base-client 0.0.7 → 0.0.9
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/KnowledgeBaseClient.js +2 -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/KnowledgeBaseClient.js +2 -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 +5 -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/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +1 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- 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,
|
|
@@ -19,14 +19,14 @@ class KnowledgeBaseClient extends smithy_client_1.Client {
|
|
|
19
19
|
let _config_2 = (0, middleware_retry_1.resolveRetryConfig)(_config_1);
|
|
20
20
|
let _config_3 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_2, configuration?.extensions || []);
|
|
21
21
|
const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `kb.wim-${configuration.env}.wildix.com` : 'kb.wim.wildix.com';
|
|
22
|
-
const endpoint = () => {
|
|
22
|
+
const endpoint = configuration.endpoint || (() => {
|
|
23
23
|
return {
|
|
24
24
|
hostname,
|
|
25
25
|
protocol: "https",
|
|
26
26
|
port: '443',
|
|
27
27
|
path: ''
|
|
28
28
|
};
|
|
29
|
-
};
|
|
29
|
+
});
|
|
30
30
|
const config = { ..._config_3, endpoint };
|
|
31
31
|
this.config = config;
|
|
32
32
|
this.middlewareStack.add(smithy_utils_1.authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
@@ -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,
|
|
@@ -16,14 +16,14 @@ export class KnowledgeBaseClient extends __Client {
|
|
|
16
16
|
let _config_2 = resolveRetryConfig(_config_1);
|
|
17
17
|
let _config_3 = resolveRuntimeExtensions(_config_2, configuration?.extensions || []);
|
|
18
18
|
const hostname = ['stable', 'stage'].includes(configuration.env || '') ? `kb.wim-${configuration.env}.wildix.com` : 'kb.wim.wildix.com';
|
|
19
|
-
const endpoint = () => {
|
|
19
|
+
const endpoint = configuration.endpoint || (() => {
|
|
20
20
|
return {
|
|
21
21
|
hostname,
|
|
22
22
|
protocol: "https",
|
|
23
23
|
port: '443',
|
|
24
24
|
path: ''
|
|
25
25
|
};
|
|
26
|
-
};
|
|
26
|
+
});
|
|
27
27
|
const config = { ..._config_3, endpoint };
|
|
28
28
|
this.config = config;
|
|
29
29
|
this.middlewareStack.add(authorizationMiddleware.bind(this, configuration.token), { step: "build" });
|
|
@@ -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 = {}));
|