@wildix/wim-knowledge-base-client 0.0.10 → 0.0.13

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.
Files changed (32) hide show
  1. package/dist-cjs/KnowledgeBase.js +4 -0
  2. package/dist-cjs/commands/CleanDataSourceCommand.js +21 -0
  3. package/dist-cjs/commands/CloneDataSourceCommand.js +21 -0
  4. package/dist-cjs/commands/index.js +2 -0
  5. package/dist-cjs/models/models_0.js +37 -36
  6. package/dist-cjs/protocols/Aws_restJson1.js +70 -3
  7. package/dist-es/KnowledgeBase.js +4 -0
  8. package/dist-es/commands/CleanDataSourceCommand.js +17 -0
  9. package/dist-es/commands/CloneDataSourceCommand.js +17 -0
  10. package/dist-es/commands/index.js +2 -0
  11. package/dist-es/models/models_0.js +36 -35
  12. package/dist-es/protocols/Aws_restJson1.js +64 -2
  13. package/dist-types/KnowledgeBase.d.ts +14 -0
  14. package/dist-types/KnowledgeBaseClient.d.ts +4 -2
  15. package/dist-types/commands/CleanDataSourceCommand.d.ts +83 -0
  16. package/dist-types/commands/CloneDataSourceCommand.d.ts +85 -0
  17. package/dist-types/commands/CreateDataSourceCommand.d.ts +4 -4
  18. package/dist-types/commands/CreateDocumentCommand.d.ts +1 -1
  19. package/dist-types/commands/GetDataSourceCommand.d.ts +2 -2
  20. package/dist-types/commands/GetDocumentCommand.d.ts +1 -1
  21. package/dist-types/commands/GetSyncLogsCommand.d.ts +2 -0
  22. package/dist-types/commands/GetSyncStatusCommand.d.ts +7 -0
  23. package/dist-types/commands/ListDataSourcesCommand.d.ts +2 -2
  24. package/dist-types/commands/ListDocumentsCommand.d.ts +1 -1
  25. package/dist-types/commands/QueryKnowledgeBaseCommand.d.ts +2 -1
  26. package/dist-types/commands/SearchKnowledgeBaseCommand.d.ts +3 -1
  27. package/dist-types/commands/UpdateDataSourceCommand.d.ts +4 -4
  28. package/dist-types/commands/UpdateDocumentCommand.d.ts +1 -1
  29. package/dist-types/commands/index.d.ts +2 -0
  30. package/dist-types/models/models_0.d.ts +243 -35
  31. package/dist-types/protocols/Aws_restJson1.d.ts +18 -0
  32. package/package.json +1 -1
@@ -2,6 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.KnowledgeBase = void 0;
4
4
  const KnowledgeBaseClient_1 = require("./KnowledgeBaseClient");
5
+ const CleanDataSourceCommand_1 = require("./commands/CleanDataSourceCommand");
6
+ const CloneDataSourceCommand_1 = require("./commands/CloneDataSourceCommand");
5
7
  const CreateDataSourceCommand_1 = require("./commands/CreateDataSourceCommand");
6
8
  const CreateDocumentCommand_1 = require("./commands/CreateDocumentCommand");
7
9
  const CreateKnowledgeBaseCommand_1 = require("./commands/CreateKnowledgeBaseCommand");
@@ -28,6 +30,8 @@ const UpdateDocumentCommand_1 = require("./commands/UpdateDocumentCommand");
28
30
  const UpdateKnowledgeBaseCommand_1 = require("./commands/UpdateKnowledgeBaseCommand");
29
31
  const smithy_client_1 = require("@smithy/smithy-client");
30
32
  const commands = {
33
+ CleanDataSourceCommand: CleanDataSourceCommand_1.CleanDataSourceCommand,
34
+ CloneDataSourceCommand: CloneDataSourceCommand_1.CloneDataSourceCommand,
31
35
  CreateDataSourceCommand: CreateDataSourceCommand_1.CreateDataSourceCommand,
32
36
  CreateDocumentCommand: CreateDocumentCommand_1.CreateDocumentCommand,
33
37
  CreateKnowledgeBaseCommand: CreateKnowledgeBaseCommand_1.CreateKnowledgeBaseCommand,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CleanDataSourceCommand = 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 CleanDataSourceCommand 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", "CleanDataSource", {})
15
+ .n("KnowledgeBaseClient", "CleanDataSourceCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_CleanDataSourceCommand)
18
+ .de(Aws_restJson1_1.de_CleanDataSourceCommand)
19
+ .build() {
20
+ }
21
+ exports.CleanDataSourceCommand = CleanDataSourceCommand;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CloneDataSourceCommand = 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 CloneDataSourceCommand 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", "CloneDataSource", {})
15
+ .n("KnowledgeBaseClient", "CloneDataSourceCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_CloneDataSourceCommand)
18
+ .de(Aws_restJson1_1.de_CloneDataSourceCommand)
19
+ .build() {
20
+ }
21
+ exports.CloneDataSourceCommand = CloneDataSourceCommand;
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./CleanDataSourceCommand"), exports);
5
+ tslib_1.__exportStar(require("./CloneDataSourceCommand"), exports);
4
6
  tslib_1.__exportStar(require("./CreateDataSourceCommand"), exports);
5
7
  tslib_1.__exportStar(require("./CreateDocumentCommand"), exports);
6
8
  tslib_1.__exportStar(require("./CreateKnowledgeBaseCommand"), 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.ProxyMethod = exports.UnauthorizedException = exports.ForbiddenException = exports.ValidationException = void 0;
3
+ exports.SearchStrategy = exports.SyncLogLevel = exports.DownloadDocumentType = exports.DocumentStatus = exports.SyncDataSourceStatus = exports.SyncDataSourceMode = exports.DataSourceType = exports.DataSourceConfig = exports.ProxyMethod = exports.KnowledgeBaseNotFoundException = exports.DocumentNotFoundException = exports.DataSourceNotFoundException = 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,41 +41,6 @@ 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
- };
48
- var DataSourceConfig;
49
- (function (DataSourceConfig) {
50
- DataSourceConfig.visit = (value, visitor) => {
51
- if (value.confluence !== undefined)
52
- return visitor.confluence(value.confluence);
53
- if (value.gdrive !== undefined)
54
- return visitor.gdrive(value.gdrive);
55
- if (value.files !== undefined)
56
- return visitor.files(value.files);
57
- if (value.proxy !== undefined)
58
- return visitor.proxy(value.proxy);
59
- return visitor._(value.$unknown[0], value.$unknown[1]);
60
- };
61
- })(DataSourceConfig || (exports.DataSourceConfig = DataSourceConfig = {}));
62
- exports.DataSourceType = {
63
- CONFLUENCE: "confluence",
64
- FILES: "files",
65
- GDRIVE: "gdrive",
66
- PROXY: "proxy",
67
- };
68
- exports.SyncDataSourceMode = {
69
- FULL: "full",
70
- INCREMENTAL: "incremental",
71
- UNKNOWN: "unknown",
72
- };
73
- exports.SyncDataSourceStatus = {
74
- FAILED: "failed",
75
- IDLE: "idle",
76
- RUNNING: "running",
77
- SUCCESS: "success",
78
- };
79
44
  class DataSourceNotFoundException extends KnowledgeBaseServiceException_1.KnowledgeBaseServiceException {
80
45
  name = "DataSourceNotFoundException";
81
46
  $fault = "client";
@@ -115,8 +80,44 @@ class KnowledgeBaseNotFoundException extends KnowledgeBaseServiceException_1.Kno
115
80
  }
116
81
  }
117
82
  exports.KnowledgeBaseNotFoundException = KnowledgeBaseNotFoundException;
83
+ exports.ProxyMethod = {
84
+ GET: "GET",
85
+ POST: "POST",
86
+ };
87
+ var DataSourceConfig;
88
+ (function (DataSourceConfig) {
89
+ DataSourceConfig.visit = (value, visitor) => {
90
+ if (value.confluence !== undefined)
91
+ return visitor.confluence(value.confluence);
92
+ if (value.gdrive !== undefined)
93
+ return visitor.gdrive(value.gdrive);
94
+ if (value.files !== undefined)
95
+ return visitor.files(value.files);
96
+ if (value.proxy !== undefined)
97
+ return visitor.proxy(value.proxy);
98
+ return visitor._(value.$unknown[0], value.$unknown[1]);
99
+ };
100
+ })(DataSourceConfig || (exports.DataSourceConfig = DataSourceConfig = {}));
101
+ exports.DataSourceType = {
102
+ CONFLUENCE: "confluence",
103
+ FILES: "files",
104
+ GDRIVE: "gdrive",
105
+ PROXY: "proxy",
106
+ };
107
+ exports.SyncDataSourceMode = {
108
+ FULL: "full",
109
+ INCREMENTAL: "incremental",
110
+ UNKNOWN: "unknown",
111
+ };
112
+ exports.SyncDataSourceStatus = {
113
+ FAILED: "failed",
114
+ IDLE: "idle",
115
+ RUNNING: "running",
116
+ SUCCESS: "success",
117
+ };
118
118
  exports.DocumentStatus = {
119
119
  COMPLETED: "completed",
120
+ DRAFT: "draft",
120
121
  FAILED: "failed",
121
122
  PENDING: "pending",
122
123
  PROCESSING: "processing",
@@ -1,11 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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_GetExtraInfoForDataSourceCommand = exports.de_GetDocumentPresignedUploadUrlCommand = exports.de_GetDocumentPresignedDownloadUrlCommand = exports.de_GetDocumentCommand = exports.de_GetDataSourceCommand = 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_GetExtraInfoForDataSourceCommand = exports.se_GetDocumentPresignedUploadUrlCommand = exports.se_GetDocumentPresignedDownloadUrlCommand = exports.se_GetDocumentCommand = exports.se_GetDataSourceCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteDocumentCommand = exports.se_DeleteDataSourceCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateDocumentCommand = exports.se_CreateDataSourceCommand = void 0;
3
+ 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_GetExtraInfoForDataSourceCommand = exports.de_GetDocumentPresignedUploadUrlCommand = exports.de_GetDocumentPresignedDownloadUrlCommand = exports.de_GetDocumentCommand = exports.de_GetDataSourceCommand = exports.de_DeleteKnowledgeBaseCommand = exports.de_DeleteDocumentCommand = exports.de_DeleteDataSourceCommand = exports.de_CreateKnowledgeBaseCommand = exports.de_CreateDocumentCommand = exports.de_CreateDataSourceCommand = exports.de_CloneDataSourceCommand = exports.de_CleanDataSourceCommand = 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_GetExtraInfoForDataSourceCommand = exports.se_GetDocumentPresignedUploadUrlCommand = exports.se_GetDocumentPresignedDownloadUrlCommand = exports.se_GetDocumentCommand = exports.se_GetDataSourceCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteDocumentCommand = exports.se_DeleteDataSourceCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateDocumentCommand = exports.se_CreateDataSourceCommand = exports.se_CloneDataSourceCommand = exports.se_CleanDataSourceCommand = void 0;
4
+ exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = void 0;
4
5
  const KnowledgeBaseServiceException_1 = require("../models/KnowledgeBaseServiceException");
5
6
  const models_0_1 = require("../models/models_0");
6
7
  const core_1 = require("@aws-sdk/core");
7
8
  const core_2 = require("@smithy/core");
8
9
  const smithy_client_1 = require("@smithy/smithy-client");
10
+ const se_CleanDataSourceCommand = async (input, context) => {
11
+ const b = (0, core_2.requestBuilder)(input, context);
12
+ const headers = {};
13
+ b.bp("/api/v1/data-sources/{dataSourceId}/clean");
14
+ b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
15
+ const query = (0, smithy_client_1.map)({
16
+ [_c]: [, input[_cI]],
17
+ });
18
+ let body;
19
+ b.m("POST")
20
+ .h(headers)
21
+ .q(query)
22
+ .b(body);
23
+ return b.build();
24
+ };
25
+ exports.se_CleanDataSourceCommand = se_CleanDataSourceCommand;
26
+ const se_CloneDataSourceCommand = async (input, context) => {
27
+ const b = (0, core_2.requestBuilder)(input, context);
28
+ const headers = {};
29
+ b.bp("/api/v1/data-sources/{dataSourceId}/clone");
30
+ b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
31
+ const query = (0, smithy_client_1.map)({
32
+ [_c]: [, input[_cI]],
33
+ });
34
+ let body;
35
+ b.m("POST")
36
+ .h(headers)
37
+ .q(query)
38
+ .b(body);
39
+ return b.build();
40
+ };
41
+ exports.se_CloneDataSourceCommand = se_CloneDataSourceCommand;
9
42
  const se_CreateDataSourceCommand = async (input, context) => {
10
43
  const b = (0, core_2.requestBuilder)(input, context);
11
44
  const headers = {
@@ -240,6 +273,8 @@ const se_GetSyncLogsCommand = async (input, context) => {
240
273
  b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
241
274
  const query = (0, smithy_client_1.map)({
242
275
  [_c]: [, input[_cI]],
276
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
277
+ [_o]: [() => input.offset !== void 0, () => (input[_o].toString())],
243
278
  });
244
279
  let body;
245
280
  b.m("GET")
@@ -465,6 +500,32 @@ const se_UpdateKnowledgeBaseCommand = async (input, context) => {
465
500
  return b.build();
466
501
  };
467
502
  exports.se_UpdateKnowledgeBaseCommand = se_UpdateKnowledgeBaseCommand;
503
+ const de_CleanDataSourceCommand = 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_CleanDataSourceCommand = de_CleanDataSourceCommand;
514
+ const de_CloneDataSourceCommand = 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
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
522
+ const doc = (0, smithy_client_1.take)(data, {
523
+ 'dataSourceId': smithy_client_1.expectString,
524
+ });
525
+ Object.assign(contents, doc);
526
+ return contents;
527
+ };
528
+ exports.de_CloneDataSourceCommand = de_CloneDataSourceCommand;
468
529
  const de_CreateDataSourceCommand = async (output, context) => {
469
530
  if (output.statusCode !== 201 && output.statusCode >= 300) {
470
531
  return de_CommandError(output, context);
@@ -657,6 +718,7 @@ const de_GetSyncStatusCommand = async (output, context) => {
657
718
  });
658
719
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
659
720
  const doc = (0, smithy_client_1.take)(data, {
721
+ 'lastSyncLogs': smithy_client_1._json,
660
722
  'progress': smithy_client_1.expectInt32,
661
723
  'syncErrorMessage': smithy_client_1.expectString,
662
724
  'syncStatus': smithy_client_1.expectString,
@@ -719,8 +781,9 @@ const de_QueryKnowledgeBaseCommand = async (output, context) => {
719
781
  });
720
782
  const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
721
783
  const doc = (0, smithy_client_1.take)(data, {
784
+ 'answer': smithy_client_1.expectString,
722
785
  'metadata': _ => de_Document(_, context),
723
- 'result': smithy_client_1.expectString,
786
+ 'sources': _ => de_Document(_, context),
724
787
  });
725
788
  Object.assign(contents, doc);
726
789
  return contents;
@@ -1027,10 +1090,12 @@ const de_ProxyConfig = (output, context) => {
1027
1090
  const de_SearchKnowledgeBaseResult = (output, context) => {
1028
1091
  return (0, smithy_client_1.take)(output, {
1029
1092
  'content': smithy_client_1.expectString,
1093
+ 'dataSourceType': smithy_client_1.expectString,
1030
1094
  'documentId': smithy_client_1.expectString,
1095
+ 'documentTitle': smithy_client_1.expectString,
1096
+ 'documentUrl': smithy_client_1.expectString,
1031
1097
  'score': smithy_client_1.limitedParseDouble,
1032
1098
  'source': smithy_client_1.expectString,
1033
- 'url': smithy_client_1.expectString,
1034
1099
  });
1035
1100
  };
1036
1101
  const de_SearchKnowledgeBaseResults = (output, context) => {
@@ -1049,5 +1114,7 @@ const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBo
1049
1114
  const _c = "company";
1050
1115
  const _cI = "companyId";
1051
1116
  const _dT = "documentType";
1117
+ const _l = "limit";
1118
+ const _o = "offset";
1052
1119
  const _q = "query";
1053
1120
  const _sT = "syncType";
@@ -1,4 +1,6 @@
1
1
  import { KnowledgeBaseClient, } from "./KnowledgeBaseClient";
2
+ import { CleanDataSourceCommand, } from "./commands/CleanDataSourceCommand";
3
+ import { CloneDataSourceCommand, } from "./commands/CloneDataSourceCommand";
2
4
  import { CreateDataSourceCommand, } from "./commands/CreateDataSourceCommand";
3
5
  import { CreateDocumentCommand, } from "./commands/CreateDocumentCommand";
4
6
  import { CreateKnowledgeBaseCommand, } from "./commands/CreateKnowledgeBaseCommand";
@@ -25,6 +27,8 @@ import { UpdateDocumentCommand, } from "./commands/UpdateDocumentCommand";
25
27
  import { UpdateKnowledgeBaseCommand, } from "./commands/UpdateKnowledgeBaseCommand";
26
28
  import { createAggregatedClient } from "@smithy/smithy-client";
27
29
  const commands = {
30
+ CleanDataSourceCommand,
31
+ CloneDataSourceCommand,
28
32
  CreateDataSourceCommand,
29
33
  CreateDocumentCommand,
30
34
  CreateKnowledgeBaseCommand,
@@ -0,0 +1,17 @@
1
+ import { de_CleanDataSourceCommand, se_CleanDataSourceCommand, } 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 CleanDataSourceCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("KnowledgeBase", "CleanDataSource", {})
12
+ .n("KnowledgeBaseClient", "CleanDataSourceCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_CleanDataSourceCommand)
15
+ .de(de_CleanDataSourceCommand)
16
+ .build() {
17
+ }
@@ -0,0 +1,17 @@
1
+ import { de_CloneDataSourceCommand, se_CloneDataSourceCommand, } 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 CloneDataSourceCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("KnowledgeBase", "CloneDataSource", {})
12
+ .n("KnowledgeBaseClient", "CloneDataSourceCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_CloneDataSourceCommand)
15
+ .de(de_CloneDataSourceCommand)
16
+ .build() {
17
+ }
@@ -1,3 +1,5 @@
1
+ export * from "./CleanDataSourceCommand";
2
+ export * from "./CloneDataSourceCommand";
1
3
  export * from "./CreateDataSourceCommand";
2
4
  export * from "./CreateDocumentCommand";
3
5
  export * from "./CreateKnowledgeBaseCommand";
@@ -35,41 +35,6 @@ 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
- };
42
- export var DataSourceConfig;
43
- (function (DataSourceConfig) {
44
- DataSourceConfig.visit = (value, visitor) => {
45
- if (value.confluence !== undefined)
46
- return visitor.confluence(value.confluence);
47
- if (value.gdrive !== undefined)
48
- return visitor.gdrive(value.gdrive);
49
- if (value.files !== undefined)
50
- return visitor.files(value.files);
51
- if (value.proxy !== undefined)
52
- return visitor.proxy(value.proxy);
53
- return visitor._(value.$unknown[0], value.$unknown[1]);
54
- };
55
- })(DataSourceConfig || (DataSourceConfig = {}));
56
- export const DataSourceType = {
57
- CONFLUENCE: "confluence",
58
- FILES: "files",
59
- GDRIVE: "gdrive",
60
- PROXY: "proxy",
61
- };
62
- export const SyncDataSourceMode = {
63
- FULL: "full",
64
- INCREMENTAL: "incremental",
65
- UNKNOWN: "unknown",
66
- };
67
- export const SyncDataSourceStatus = {
68
- FAILED: "failed",
69
- IDLE: "idle",
70
- RUNNING: "running",
71
- SUCCESS: "success",
72
- };
73
38
  export class DataSourceNotFoundException extends __BaseException {
74
39
  name = "DataSourceNotFoundException";
75
40
  $fault = "client";
@@ -106,8 +71,44 @@ export class KnowledgeBaseNotFoundException extends __BaseException {
106
71
  Object.setPrototypeOf(this, KnowledgeBaseNotFoundException.prototype);
107
72
  }
108
73
  }
74
+ export const ProxyMethod = {
75
+ GET: "GET",
76
+ POST: "POST",
77
+ };
78
+ export var DataSourceConfig;
79
+ (function (DataSourceConfig) {
80
+ DataSourceConfig.visit = (value, visitor) => {
81
+ if (value.confluence !== undefined)
82
+ return visitor.confluence(value.confluence);
83
+ if (value.gdrive !== undefined)
84
+ return visitor.gdrive(value.gdrive);
85
+ if (value.files !== undefined)
86
+ return visitor.files(value.files);
87
+ if (value.proxy !== undefined)
88
+ return visitor.proxy(value.proxy);
89
+ return visitor._(value.$unknown[0], value.$unknown[1]);
90
+ };
91
+ })(DataSourceConfig || (DataSourceConfig = {}));
92
+ export const DataSourceType = {
93
+ CONFLUENCE: "confluence",
94
+ FILES: "files",
95
+ GDRIVE: "gdrive",
96
+ PROXY: "proxy",
97
+ };
98
+ export const SyncDataSourceMode = {
99
+ FULL: "full",
100
+ INCREMENTAL: "incremental",
101
+ UNKNOWN: "unknown",
102
+ };
103
+ export const SyncDataSourceStatus = {
104
+ FAILED: "failed",
105
+ IDLE: "idle",
106
+ RUNNING: "running",
107
+ SUCCESS: "success",
108
+ };
109
109
  export const DocumentStatus = {
110
110
  COMPLETED: "completed",
111
+ DRAFT: "draft",
111
112
  FAILED: "failed",
112
113
  PENDING: "pending",
113
114
  PROCESSING: "processing",
@@ -3,6 +3,36 @@ import { DataSourceConfig, DataSourceNotFoundException, DocumentNotFoundExceptio
3
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
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
+ export const se_CleanDataSourceCommand = async (input, context) => {
7
+ const b = rb(input, context);
8
+ const headers = {};
9
+ b.bp("/api/v1/data-sources/{dataSourceId}/clean");
10
+ b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
11
+ const query = map({
12
+ [_c]: [, input[_cI]],
13
+ });
14
+ let body;
15
+ b.m("POST")
16
+ .h(headers)
17
+ .q(query)
18
+ .b(body);
19
+ return b.build();
20
+ };
21
+ export const se_CloneDataSourceCommand = async (input, context) => {
22
+ const b = rb(input, context);
23
+ const headers = {};
24
+ b.bp("/api/v1/data-sources/{dataSourceId}/clone");
25
+ b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
26
+ const query = map({
27
+ [_c]: [, input[_cI]],
28
+ });
29
+ let body;
30
+ b.m("POST")
31
+ .h(headers)
32
+ .q(query)
33
+ .b(body);
34
+ return b.build();
35
+ };
6
36
  export const se_CreateDataSourceCommand = async (input, context) => {
7
37
  const b = rb(input, context);
8
38
  const headers = {
@@ -225,6 +255,8 @@ export const se_GetSyncLogsCommand = async (input, context) => {
225
255
  b.p('dataSourceId', () => input.dataSourceId, '{dataSourceId}', false);
226
256
  const query = map({
227
257
  [_c]: [, input[_cI]],
258
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
259
+ [_o]: [() => input.offset !== void 0, () => (input[_o].toString())],
228
260
  });
229
261
  let body;
230
262
  b.m("GET")
@@ -438,6 +470,30 @@ export const se_UpdateKnowledgeBaseCommand = async (input, context) => {
438
470
  .b(body);
439
471
  return b.build();
440
472
  };
473
+ export const de_CleanDataSourceCommand = async (output, context) => {
474
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
475
+ return de_CommandError(output, context);
476
+ }
477
+ const contents = map({
478
+ $metadata: deserializeMetadata(output),
479
+ });
480
+ await collectBody(output.body, context);
481
+ return contents;
482
+ };
483
+ export const de_CloneDataSourceCommand = async (output, context) => {
484
+ if (output.statusCode !== 204 && output.statusCode >= 300) {
485
+ return de_CommandError(output, context);
486
+ }
487
+ const contents = map({
488
+ $metadata: deserializeMetadata(output),
489
+ });
490
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
491
+ const doc = take(data, {
492
+ 'dataSourceId': __expectString,
493
+ });
494
+ Object.assign(contents, doc);
495
+ return contents;
496
+ };
441
497
  export const de_CreateDataSourceCommand = async (output, context) => {
442
498
  if (output.statusCode !== 201 && output.statusCode >= 300) {
443
499
  return de_CommandError(output, context);
@@ -617,6 +673,7 @@ export const de_GetSyncStatusCommand = async (output, context) => {
617
673
  });
618
674
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
619
675
  const doc = take(data, {
676
+ 'lastSyncLogs': _json,
620
677
  'progress': __expectInt32,
621
678
  'syncErrorMessage': __expectString,
622
679
  'syncStatus': __expectString,
@@ -675,8 +732,9 @@ export const de_QueryKnowledgeBaseCommand = async (output, context) => {
675
732
  });
676
733
  const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
677
734
  const doc = take(data, {
735
+ 'answer': __expectString,
678
736
  'metadata': _ => de_Document(_, context),
679
- 'result': __expectString,
737
+ 'sources': _ => de_Document(_, context),
680
738
  });
681
739
  Object.assign(contents, doc);
682
740
  return contents;
@@ -976,10 +1034,12 @@ const de_ProxyConfig = (output, context) => {
976
1034
  const de_SearchKnowledgeBaseResult = (output, context) => {
977
1035
  return take(output, {
978
1036
  'content': __expectString,
1037
+ 'dataSourceType': __expectString,
979
1038
  'documentId': __expectString,
1039
+ 'documentTitle': __expectString,
1040
+ 'documentUrl': __expectString,
980
1041
  'score': __limitedParseDouble,
981
1042
  'source': __expectString,
982
- 'url': __expectString,
983
1043
  });
984
1044
  };
985
1045
  const de_SearchKnowledgeBaseResults = (output, context) => {
@@ -998,5 +1058,7 @@ const collectBodyString = (streamBody, context) => collectBody(streamBody, conte
998
1058
  const _c = "company";
999
1059
  const _cI = "companyId";
1000
1060
  const _dT = "documentType";
1061
+ const _l = "limit";
1062
+ const _o = "offset";
1001
1063
  const _q = "query";
1002
1064
  const _sT = "syncType";
@@ -1,4 +1,6 @@
1
1
  import { KnowledgeBaseClient } from "./KnowledgeBaseClient";
2
+ import { CleanDataSourceCommandInput, CleanDataSourceCommandOutput } from "./commands/CleanDataSourceCommand";
3
+ import { CloneDataSourceCommandInput, CloneDataSourceCommandOutput } from "./commands/CloneDataSourceCommand";
2
4
  import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "./commands/CreateDataSourceCommand";
3
5
  import { CreateDocumentCommandInput, CreateDocumentCommandOutput } from "./commands/CreateDocumentCommand";
4
6
  import { CreateKnowledgeBaseCommandInput, CreateKnowledgeBaseCommandOutput } from "./commands/CreateKnowledgeBaseCommand";
@@ -25,6 +27,18 @@ import { UpdateDocumentCommandInput, UpdateDocumentCommandOutput } from "./comma
25
27
  import { UpdateKnowledgeBaseCommandInput, UpdateKnowledgeBaseCommandOutput } from "./commands/UpdateKnowledgeBaseCommand";
26
28
  import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types";
27
29
  export interface KnowledgeBase {
30
+ /**
31
+ * @see {@link CleanDataSourceCommand}
32
+ */
33
+ cleanDataSource(args: CleanDataSourceCommandInput, options?: __HttpHandlerOptions): Promise<CleanDataSourceCommandOutput>;
34
+ cleanDataSource(args: CleanDataSourceCommandInput, cb: (err: any, data?: CleanDataSourceCommandOutput) => void): void;
35
+ cleanDataSource(args: CleanDataSourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CleanDataSourceCommandOutput) => void): void;
36
+ /**
37
+ * @see {@link CloneDataSourceCommand}
38
+ */
39
+ cloneDataSource(args: CloneDataSourceCommandInput, options?: __HttpHandlerOptions): Promise<CloneDataSourceCommandOutput>;
40
+ cloneDataSource(args: CloneDataSourceCommandInput, cb: (err: any, data?: CloneDataSourceCommandOutput) => void): void;
41
+ cloneDataSource(args: CloneDataSourceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CloneDataSourceCommandOutput) => void): void;
28
42
  /**
29
43
  * @see {@link CreateDataSourceCommand}
30
44
  */
@@ -1,3 +1,5 @@
1
+ import { CleanDataSourceCommandInput, CleanDataSourceCommandOutput } from "./commands/CleanDataSourceCommand";
2
+ import { CloneDataSourceCommandInput, CloneDataSourceCommandOutput } from "./commands/CloneDataSourceCommand";
1
3
  import { CreateDataSourceCommandInput, CreateDataSourceCommandOutput } from "./commands/CreateDataSourceCommand";
2
4
  import { CreateDocumentCommandInput, CreateDocumentCommandOutput } from "./commands/CreateDocumentCommand";
3
5
  import { CreateKnowledgeBaseCommandInput, CreateKnowledgeBaseCommandOutput } from "./commands/CreateKnowledgeBaseCommand";
@@ -33,11 +35,11 @@ export { __Client };
33
35
  /**
34
36
  * @public
35
37
  */
36
- export type ServiceInputTypes = CreateDataSourceCommandInput | CreateDocumentCommandInput | CreateKnowledgeBaseCommandInput | DeleteDataSourceCommandInput | DeleteDocumentCommandInput | DeleteKnowledgeBaseCommandInput | GetDataSourceCommandInput | GetDocumentCommandInput | GetDocumentPresignedDownloadUrlCommandInput | GetDocumentPresignedUploadUrlCommandInput | GetExtraInfoForDataSourceCommandInput | GetKnowledgeBaseCommandInput | GetSyncLogsCommandInput | GetSyncStatusCommandInput | ListDataSourcesCommandInput | ListDocumentsCommandInput | ListKnowledgeBasesCommandInput | QueryKnowledgeBaseCommandInput | SearchKnowledgeBaseCommandInput | StartSyncDataSourceCommandInput | StopSyncDataSourceCommandInput | UpdateDataSourceCommandInput | UpdateDocumentCommandInput | UpdateKnowledgeBaseCommandInput;
38
+ export type ServiceInputTypes = CleanDataSourceCommandInput | CloneDataSourceCommandInput | CreateDataSourceCommandInput | CreateDocumentCommandInput | CreateKnowledgeBaseCommandInput | DeleteDataSourceCommandInput | DeleteDocumentCommandInput | DeleteKnowledgeBaseCommandInput | GetDataSourceCommandInput | GetDocumentCommandInput | GetDocumentPresignedDownloadUrlCommandInput | GetDocumentPresignedUploadUrlCommandInput | GetExtraInfoForDataSourceCommandInput | GetKnowledgeBaseCommandInput | GetSyncLogsCommandInput | GetSyncStatusCommandInput | ListDataSourcesCommandInput | ListDocumentsCommandInput | ListKnowledgeBasesCommandInput | QueryKnowledgeBaseCommandInput | SearchKnowledgeBaseCommandInput | StartSyncDataSourceCommandInput | StopSyncDataSourceCommandInput | UpdateDataSourceCommandInput | UpdateDocumentCommandInput | UpdateKnowledgeBaseCommandInput;
37
39
  /**
38
40
  * @public
39
41
  */
40
- export type ServiceOutputTypes = CreateDataSourceCommandOutput | CreateDocumentCommandOutput | CreateKnowledgeBaseCommandOutput | DeleteDataSourceCommandOutput | DeleteDocumentCommandOutput | DeleteKnowledgeBaseCommandOutput | GetDataSourceCommandOutput | GetDocumentCommandOutput | GetDocumentPresignedDownloadUrlCommandOutput | GetDocumentPresignedUploadUrlCommandOutput | GetExtraInfoForDataSourceCommandOutput | GetKnowledgeBaseCommandOutput | GetSyncLogsCommandOutput | GetSyncStatusCommandOutput | ListDataSourcesCommandOutput | ListDocumentsCommandOutput | ListKnowledgeBasesCommandOutput | QueryKnowledgeBaseCommandOutput | SearchKnowledgeBaseCommandOutput | StartSyncDataSourceCommandOutput | StopSyncDataSourceCommandOutput | UpdateDataSourceCommandOutput | UpdateDocumentCommandOutput | UpdateKnowledgeBaseCommandOutput;
42
+ export type ServiceOutputTypes = CleanDataSourceCommandOutput | CloneDataSourceCommandOutput | CreateDataSourceCommandOutput | CreateDocumentCommandOutput | CreateKnowledgeBaseCommandOutput | DeleteDataSourceCommandOutput | DeleteDocumentCommandOutput | DeleteKnowledgeBaseCommandOutput | GetDataSourceCommandOutput | GetDocumentCommandOutput | GetDocumentPresignedDownloadUrlCommandOutput | GetDocumentPresignedUploadUrlCommandOutput | GetExtraInfoForDataSourceCommandOutput | GetKnowledgeBaseCommandOutput | GetSyncLogsCommandOutput | GetSyncStatusCommandOutput | ListDataSourcesCommandOutput | ListDocumentsCommandOutput | ListKnowledgeBasesCommandOutput | QueryKnowledgeBaseCommandOutput | SearchKnowledgeBaseCommandOutput | StartSyncDataSourceCommandOutput | StopSyncDataSourceCommandOutput | UpdateDataSourceCommandOutput | UpdateDocumentCommandOutput | UpdateKnowledgeBaseCommandOutput;
41
43
  /**
42
44
  * @public
43
45
  */