@wildix/wim-knowledge-base-client 0.0.38 → 0.0.40

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.
@@ -23,6 +23,7 @@ const ListDataSourcesCommand_1 = require("./commands/ListDataSourcesCommand");
23
23
  const ListDocumentsCommand_1 = require("./commands/ListDocumentsCommand");
24
24
  const ListKnowledgeBasesCommand_1 = require("./commands/ListKnowledgeBasesCommand");
25
25
  const QueryKnowledgeBaseCommand_1 = require("./commands/QueryKnowledgeBaseCommand");
26
+ const SearchHistoryCommand_1 = require("./commands/SearchHistoryCommand");
26
27
  const SearchKnowledgeBaseCommand_1 = require("./commands/SearchKnowledgeBaseCommand");
27
28
  const StartSyncDataSourceCommand_1 = require("./commands/StartSyncDataSourceCommand");
28
29
  const StopSyncDataSourceCommand_1 = require("./commands/StopSyncDataSourceCommand");
@@ -52,6 +53,7 @@ const commands = {
52
53
  ListDocumentsCommand: ListDocumentsCommand_1.ListDocumentsCommand,
53
54
  ListKnowledgeBasesCommand: ListKnowledgeBasesCommand_1.ListKnowledgeBasesCommand,
54
55
  QueryKnowledgeBaseCommand: QueryKnowledgeBaseCommand_1.QueryKnowledgeBaseCommand,
56
+ SearchHistoryCommand: SearchHistoryCommand_1.SearchHistoryCommand,
55
57
  SearchKnowledgeBaseCommand: SearchKnowledgeBaseCommand_1.SearchKnowledgeBaseCommand,
56
58
  StartSyncDataSourceCommand: StartSyncDataSourceCommand_1.StartSyncDataSourceCommand,
57
59
  StopSyncDataSourceCommand: StopSyncDataSourceCommand_1.StopSyncDataSourceCommand,
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SearchHistoryCommand = 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 SearchHistoryCommand 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", "SearchHistory", {})
15
+ .n("KnowledgeBaseClient", "SearchHistoryCommand")
16
+ .f(void 0, void 0)
17
+ .ser(Aws_restJson1_1.se_SearchHistoryCommand)
18
+ .de(Aws_restJson1_1.de_SearchHistoryCommand)
19
+ .build() {
20
+ }
21
+ exports.SearchHistoryCommand = SearchHistoryCommand;
@@ -22,6 +22,7 @@ tslib_1.__exportStar(require("./ListDataSourcesCommand"), exports);
22
22
  tslib_1.__exportStar(require("./ListDocumentsCommand"), exports);
23
23
  tslib_1.__exportStar(require("./ListKnowledgeBasesCommand"), exports);
24
24
  tslib_1.__exportStar(require("./QueryKnowledgeBaseCommand"), exports);
25
+ tslib_1.__exportStar(require("./SearchHistoryCommand"), exports);
25
26
  tslib_1.__exportStar(require("./SearchKnowledgeBaseCommand"), exports);
26
27
  tslib_1.__exportStar(require("./StartSyncDataSourceCommand"), exports);
27
28
  tslib_1.__exportStar(require("./StopSyncDataSourceCommand"), exports);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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_DescribeDataSourceCommand = exports.de_DeleteKnowledgeBaseCommand = exports.de_DeleteDocumentCommand = exports.de_DeleteDataSourceCommand = exports.de_CreateKnowledgeBaseCommand = exports.de_CreateDocumentCommand = exports.de_CreateDataSourceCommand = exports.de_ConfigureDataSourceCommand = 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_GetDocumentPresignedUploadUrlCommand = exports.se_GetDocumentPresignedDownloadUrlCommand = exports.se_GetDocumentCommand = exports.se_GetDataSourceCommand = exports.se_DescribeDataSourceCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteDocumentCommand = exports.se_DeleteDataSourceCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateDocumentCommand = exports.se_CreateDataSourceCommand = exports.se_ConfigureDataSourceCommand = exports.se_CloneDataSourceCommand = exports.se_CleanDataSourceCommand = void 0;
4
- exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = exports.de_UpdateDataSourceCommand = exports.de_StopSyncDataSourceCommand = void 0;
3
+ exports.de_SearchHistoryCommand = 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_DescribeDataSourceCommand = exports.de_DeleteKnowledgeBaseCommand = exports.de_DeleteDocumentCommand = exports.de_DeleteDataSourceCommand = exports.de_CreateKnowledgeBaseCommand = exports.de_CreateDocumentCommand = exports.de_CreateDataSourceCommand = exports.de_ConfigureDataSourceCommand = 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_SearchHistoryCommand = 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_DescribeDataSourceCommand = exports.se_DeleteKnowledgeBaseCommand = exports.se_DeleteDocumentCommand = exports.se_DeleteDataSourceCommand = exports.se_CreateKnowledgeBaseCommand = exports.se_CreateDocumentCommand = exports.se_CreateDataSourceCommand = exports.se_ConfigureDataSourceCommand = exports.se_CloneDataSourceCommand = exports.se_CleanDataSourceCommand = void 0;
4
+ exports.de_UpdateKnowledgeBaseCommand = exports.de_UpdateDocumentCommand = exports.de_UpdateDataSourceCommand = exports.de_StopSyncDataSourceCommand = exports.de_StartSyncDataSourceCommand = exports.de_SearchKnowledgeBaseCommand = void 0;
5
5
  const KnowledgeBaseServiceException_1 = require("../models/KnowledgeBaseServiceException");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const core_1 = require("@aws-sdk/core");
@@ -96,6 +96,7 @@ const se_CreateDocumentCommand = async (input, context) => {
96
96
  let body;
97
97
  body = JSON.stringify((0, smithy_client_1.take)(input, {
98
98
  'content': [],
99
+ 'metadata': _ => se_Document(_, context),
99
100
  'originalFormat': [],
100
101
  'originalId': [],
101
102
  'originalName': [],
@@ -394,11 +395,35 @@ const se_QueryKnowledgeBaseCommand = async (input, context) => {
394
395
  return b.build();
395
396
  };
396
397
  exports.se_QueryKnowledgeBaseCommand = se_QueryKnowledgeBaseCommand;
398
+ const se_SearchHistoryCommand = async (input, context) => {
399
+ const b = (0, core_2.requestBuilder)(input, context);
400
+ const headers = {
401
+ 'content-type': 'application/json',
402
+ };
403
+ b.bp("/api/v1/history/search");
404
+ const query = (0, smithy_client_1.map)({
405
+ [_c]: [, input[_cI]],
406
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
407
+ [_o]: [() => input.offset !== void 0, () => (input[_o].toString())],
408
+ [_s]: [, input[_s]],
409
+ });
410
+ let body;
411
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
412
+ 'filter': _ => (0, smithy_client_1._json)(_),
413
+ }));
414
+ b.m("POST")
415
+ .h(headers)
416
+ .q(query)
417
+ .b(body);
418
+ return b.build();
419
+ };
420
+ exports.se_SearchHistoryCommand = se_SearchHistoryCommand;
397
421
  const se_SearchKnowledgeBaseCommand = async (input, context) => {
398
422
  const b = (0, core_2.requestBuilder)(input, context);
399
423
  const headers = (0, smithy_client_1.map)({}, smithy_client_1.isSerializableHeaderValue, {
400
424
  'content-type': 'application/json',
401
425
  [_xsu]: input[_sU],
426
+ [_xesi]: input[_eSI],
402
427
  });
403
428
  b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}/search");
404
429
  b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
@@ -829,6 +854,21 @@ const de_QueryKnowledgeBaseCommand = async (output, context) => {
829
854
  return contents;
830
855
  };
831
856
  exports.de_QueryKnowledgeBaseCommand = de_QueryKnowledgeBaseCommand;
857
+ const de_SearchHistoryCommand = async (output, context) => {
858
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
859
+ return de_CommandError(output, context);
860
+ }
861
+ const contents = (0, smithy_client_1.map)({
862
+ $metadata: deserializeMetadata(output),
863
+ });
864
+ const data = (0, smithy_client_1.expectNonNull)(((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context))), "body");
865
+ const doc = (0, smithy_client_1.take)(data, {
866
+ 'results': _ => de_SearchHistoryResults(_, context),
867
+ });
868
+ Object.assign(contents, doc);
869
+ return contents;
870
+ };
871
+ exports.de_SearchHistoryCommand = de_SearchHistoryCommand;
832
872
  const de_SearchKnowledgeBaseCommand = async (output, context) => {
833
873
  if (output.statusCode !== 200 && output.statusCode >= 300) {
834
874
  return de_CommandError(output, context);
@@ -1147,6 +1187,12 @@ const de_ProxyConfig = (output, context) => {
1147
1187
  'username': smithy_client_1.expectString,
1148
1188
  });
1149
1189
  };
1190
+ const de_SearchHistoryResults = (output, context) => {
1191
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1192
+ return de_Document(entry, context);
1193
+ });
1194
+ return retVal;
1195
+ };
1150
1196
  const de_SearchKnowledgeBaseResult = (output, context) => {
1151
1197
  return (0, smithy_client_1.take)(output, {
1152
1198
  'content': smithy_client_1.expectString,
@@ -1178,6 +1224,7 @@ const _eSI = "externalSessionId";
1178
1224
  const _l = "limit";
1179
1225
  const _o = "offset";
1180
1226
  const _q = "query";
1227
+ const _s = "sort";
1181
1228
  const _sT = "syncType";
1182
1229
  const _sU = "searchUser";
1183
1230
  const _wC = "withContent";
@@ -20,6 +20,7 @@ import { ListDataSourcesCommand, } from "./commands/ListDataSourcesCommand";
20
20
  import { ListDocumentsCommand, } from "./commands/ListDocumentsCommand";
21
21
  import { ListKnowledgeBasesCommand, } from "./commands/ListKnowledgeBasesCommand";
22
22
  import { QueryKnowledgeBaseCommand, } from "./commands/QueryKnowledgeBaseCommand";
23
+ import { SearchHistoryCommand, } from "./commands/SearchHistoryCommand";
23
24
  import { SearchKnowledgeBaseCommand, } from "./commands/SearchKnowledgeBaseCommand";
24
25
  import { StartSyncDataSourceCommand, } from "./commands/StartSyncDataSourceCommand";
25
26
  import { StopSyncDataSourceCommand, } from "./commands/StopSyncDataSourceCommand";
@@ -49,6 +50,7 @@ const commands = {
49
50
  ListDocumentsCommand,
50
51
  ListKnowledgeBasesCommand,
51
52
  QueryKnowledgeBaseCommand,
53
+ SearchHistoryCommand,
52
54
  SearchKnowledgeBaseCommand,
53
55
  StartSyncDataSourceCommand,
54
56
  StopSyncDataSourceCommand,
@@ -0,0 +1,17 @@
1
+ import { de_SearchHistoryCommand, se_SearchHistoryCommand, } 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 SearchHistoryCommand extends $Command.classBuilder()
6
+ .m(function (Command, cs, config, o) {
7
+ return [
8
+ getSerdePlugin(config, this.serialize, this.deserialize),
9
+ ];
10
+ })
11
+ .s("KnowledgeBase", "SearchHistory", {})
12
+ .n("KnowledgeBaseClient", "SearchHistoryCommand")
13
+ .f(void 0, void 0)
14
+ .ser(se_SearchHistoryCommand)
15
+ .de(de_SearchHistoryCommand)
16
+ .build() {
17
+ }
@@ -19,6 +19,7 @@ export * from "./ListDataSourcesCommand";
19
19
  export * from "./ListDocumentsCommand";
20
20
  export * from "./ListKnowledgeBasesCommand";
21
21
  export * from "./QueryKnowledgeBaseCommand";
22
+ export * from "./SearchHistoryCommand";
22
23
  export * from "./SearchKnowledgeBaseCommand";
23
24
  export * from "./StartSyncDataSourceCommand";
24
25
  export * from "./StopSyncDataSourceCommand";
@@ -88,6 +88,7 @@ export const se_CreateDocumentCommand = async (input, context) => {
88
88
  let body;
89
89
  body = JSON.stringify(take(input, {
90
90
  'content': [],
91
+ 'metadata': _ => se_Document(_, context),
91
92
  'originalFormat': [],
92
93
  'originalId': [],
93
94
  'originalName': [],
@@ -369,11 +370,34 @@ export const se_QueryKnowledgeBaseCommand = async (input, context) => {
369
370
  .b(body);
370
371
  return b.build();
371
372
  };
373
+ export const se_SearchHistoryCommand = async (input, context) => {
374
+ const b = rb(input, context);
375
+ const headers = {
376
+ 'content-type': 'application/json',
377
+ };
378
+ b.bp("/api/v1/history/search");
379
+ const query = map({
380
+ [_c]: [, input[_cI]],
381
+ [_l]: [() => input.limit !== void 0, () => (input[_l].toString())],
382
+ [_o]: [() => input.offset !== void 0, () => (input[_o].toString())],
383
+ [_s]: [, input[_s]],
384
+ });
385
+ let body;
386
+ body = JSON.stringify(take(input, {
387
+ 'filter': _ => _json(_),
388
+ }));
389
+ b.m("POST")
390
+ .h(headers)
391
+ .q(query)
392
+ .b(body);
393
+ return b.build();
394
+ };
372
395
  export const se_SearchKnowledgeBaseCommand = async (input, context) => {
373
396
  const b = rb(input, context);
374
397
  const headers = map({}, isSerializableHeaderValue, {
375
398
  'content-type': 'application/json',
376
399
  [_xsu]: input[_sU],
400
+ [_xesi]: input[_eSI],
377
401
  });
378
402
  b.bp("/api/v1/knowledge-bases/{knowledgeBaseId}/search");
379
403
  b.p('knowledgeBaseId', () => input.knowledgeBaseId, '{knowledgeBaseId}', false);
@@ -777,6 +801,20 @@ export const de_QueryKnowledgeBaseCommand = async (output, context) => {
777
801
  Object.assign(contents, doc);
778
802
  return contents;
779
803
  };
804
+ export const de_SearchHistoryCommand = async (output, context) => {
805
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
806
+ return de_CommandError(output, context);
807
+ }
808
+ const contents = map({
809
+ $metadata: deserializeMetadata(output),
810
+ });
811
+ const data = __expectNonNull((__expectObject(await parseBody(output.body, context))), "body");
812
+ const doc = take(data, {
813
+ 'results': _ => de_SearchHistoryResults(_, context),
814
+ });
815
+ Object.assign(contents, doc);
816
+ return contents;
817
+ };
780
818
  export const de_SearchKnowledgeBaseCommand = async (output, context) => {
781
819
  if (output.statusCode !== 200 && output.statusCode >= 300) {
782
820
  return de_CommandError(output, context);
@@ -1089,6 +1127,12 @@ const de_ProxyConfig = (output, context) => {
1089
1127
  'username': __expectString,
1090
1128
  });
1091
1129
  };
1130
+ const de_SearchHistoryResults = (output, context) => {
1131
+ const retVal = (output || []).filter((e) => e != null).map((entry) => {
1132
+ return de_Document(entry, context);
1133
+ });
1134
+ return retVal;
1135
+ };
1092
1136
  const de_SearchKnowledgeBaseResult = (output, context) => {
1093
1137
  return take(output, {
1094
1138
  'content': __expectString,
@@ -1120,6 +1164,7 @@ const _eSI = "externalSessionId";
1120
1164
  const _l = "limit";
1121
1165
  const _o = "offset";
1122
1166
  const _q = "query";
1167
+ const _s = "sort";
1123
1168
  const _sT = "syncType";
1124
1169
  const _sU = "searchUser";
1125
1170
  const _wC = "withContent";
@@ -20,6 +20,7 @@ import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "./com
20
20
  import { ListDocumentsCommandInput, ListDocumentsCommandOutput } from "./commands/ListDocumentsCommand";
21
21
  import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "./commands/ListKnowledgeBasesCommand";
22
22
  import { QueryKnowledgeBaseCommandInput, QueryKnowledgeBaseCommandOutput } from "./commands/QueryKnowledgeBaseCommand";
23
+ import { SearchHistoryCommandInput, SearchHistoryCommandOutput } from "./commands/SearchHistoryCommand";
23
24
  import { SearchKnowledgeBaseCommandInput, SearchKnowledgeBaseCommandOutput } from "./commands/SearchKnowledgeBaseCommand";
24
25
  import { StartSyncDataSourceCommandInput, StartSyncDataSourceCommandOutput } from "./commands/StartSyncDataSourceCommand";
25
26
  import { StopSyncDataSourceCommandInput, StopSyncDataSourceCommandOutput } from "./commands/StopSyncDataSourceCommand";
@@ -156,6 +157,12 @@ export interface KnowledgeBase {
156
157
  queryKnowledgeBase(args: QueryKnowledgeBaseCommandInput, options?: __HttpHandlerOptions): Promise<QueryKnowledgeBaseCommandOutput>;
157
158
  queryKnowledgeBase(args: QueryKnowledgeBaseCommandInput, cb: (err: any, data?: QueryKnowledgeBaseCommandOutput) => void): void;
158
159
  queryKnowledgeBase(args: QueryKnowledgeBaseCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: QueryKnowledgeBaseCommandOutput) => void): void;
160
+ /**
161
+ * @see {@link SearchHistoryCommand}
162
+ */
163
+ searchHistory(args: SearchHistoryCommandInput, options?: __HttpHandlerOptions): Promise<SearchHistoryCommandOutput>;
164
+ searchHistory(args: SearchHistoryCommandInput, cb: (err: any, data?: SearchHistoryCommandOutput) => void): void;
165
+ searchHistory(args: SearchHistoryCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SearchHistoryCommandOutput) => void): void;
159
166
  /**
160
167
  * @see {@link SearchKnowledgeBaseCommand}
161
168
  */
@@ -19,6 +19,7 @@ import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "./com
19
19
  import { ListDocumentsCommandInput, ListDocumentsCommandOutput } from "./commands/ListDocumentsCommand";
20
20
  import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "./commands/ListKnowledgeBasesCommand";
21
21
  import { QueryKnowledgeBaseCommandInput, QueryKnowledgeBaseCommandOutput } from "./commands/QueryKnowledgeBaseCommand";
22
+ import { SearchHistoryCommandInput, SearchHistoryCommandOutput } from "./commands/SearchHistoryCommand";
22
23
  import { SearchKnowledgeBaseCommandInput, SearchKnowledgeBaseCommandOutput } from "./commands/SearchKnowledgeBaseCommand";
23
24
  import { StartSyncDataSourceCommandInput, StartSyncDataSourceCommandOutput } from "./commands/StartSyncDataSourceCommand";
24
25
  import { StopSyncDataSourceCommandInput, StopSyncDataSourceCommandOutput } from "./commands/StopSyncDataSourceCommand";
@@ -36,11 +37,11 @@ export { __Client };
36
37
  /**
37
38
  * @public
38
39
  */
39
- export type ServiceInputTypes = CleanDataSourceCommandInput | CloneDataSourceCommandInput | ConfigureDataSourceCommandInput | CreateDataSourceCommandInput | CreateDocumentCommandInput | CreateKnowledgeBaseCommandInput | DeleteDataSourceCommandInput | DeleteDocumentCommandInput | DeleteKnowledgeBaseCommandInput | DescribeDataSourceCommandInput | GetDataSourceCommandInput | GetDocumentCommandInput | GetDocumentPresignedDownloadUrlCommandInput | GetDocumentPresignedUploadUrlCommandInput | GetKnowledgeBaseCommandInput | GetSyncLogsCommandInput | GetSyncStatusCommandInput | ListDataSourcesCommandInput | ListDocumentsCommandInput | ListKnowledgeBasesCommandInput | QueryKnowledgeBaseCommandInput | SearchKnowledgeBaseCommandInput | StartSyncDataSourceCommandInput | StopSyncDataSourceCommandInput | UpdateDataSourceCommandInput | UpdateDocumentCommandInput | UpdateKnowledgeBaseCommandInput;
40
+ export type ServiceInputTypes = CleanDataSourceCommandInput | CloneDataSourceCommandInput | ConfigureDataSourceCommandInput | CreateDataSourceCommandInput | CreateDocumentCommandInput | CreateKnowledgeBaseCommandInput | DeleteDataSourceCommandInput | DeleteDocumentCommandInput | DeleteKnowledgeBaseCommandInput | DescribeDataSourceCommandInput | GetDataSourceCommandInput | GetDocumentCommandInput | GetDocumentPresignedDownloadUrlCommandInput | GetDocumentPresignedUploadUrlCommandInput | GetKnowledgeBaseCommandInput | GetSyncLogsCommandInput | GetSyncStatusCommandInput | ListDataSourcesCommandInput | ListDocumentsCommandInput | ListKnowledgeBasesCommandInput | QueryKnowledgeBaseCommandInput | SearchHistoryCommandInput | SearchKnowledgeBaseCommandInput | StartSyncDataSourceCommandInput | StopSyncDataSourceCommandInput | UpdateDataSourceCommandInput | UpdateDocumentCommandInput | UpdateKnowledgeBaseCommandInput;
40
41
  /**
41
42
  * @public
42
43
  */
43
- export type ServiceOutputTypes = CleanDataSourceCommandOutput | CloneDataSourceCommandOutput | ConfigureDataSourceCommandOutput | CreateDataSourceCommandOutput | CreateDocumentCommandOutput | CreateKnowledgeBaseCommandOutput | DeleteDataSourceCommandOutput | DeleteDocumentCommandOutput | DeleteKnowledgeBaseCommandOutput | DescribeDataSourceCommandOutput | GetDataSourceCommandOutput | GetDocumentCommandOutput | GetDocumentPresignedDownloadUrlCommandOutput | GetDocumentPresignedUploadUrlCommandOutput | GetKnowledgeBaseCommandOutput | GetSyncLogsCommandOutput | GetSyncStatusCommandOutput | ListDataSourcesCommandOutput | ListDocumentsCommandOutput | ListKnowledgeBasesCommandOutput | QueryKnowledgeBaseCommandOutput | SearchKnowledgeBaseCommandOutput | StartSyncDataSourceCommandOutput | StopSyncDataSourceCommandOutput | UpdateDataSourceCommandOutput | UpdateDocumentCommandOutput | UpdateKnowledgeBaseCommandOutput;
44
+ export type ServiceOutputTypes = CleanDataSourceCommandOutput | CloneDataSourceCommandOutput | ConfigureDataSourceCommandOutput | CreateDataSourceCommandOutput | CreateDocumentCommandOutput | CreateKnowledgeBaseCommandOutput | DeleteDataSourceCommandOutput | DeleteDocumentCommandOutput | DeleteKnowledgeBaseCommandOutput | DescribeDataSourceCommandOutput | GetDataSourceCommandOutput | GetDocumentCommandOutput | GetDocumentPresignedDownloadUrlCommandOutput | GetDocumentPresignedUploadUrlCommandOutput | GetKnowledgeBaseCommandOutput | GetSyncLogsCommandOutput | GetSyncStatusCommandOutput | ListDataSourcesCommandOutput | ListDocumentsCommandOutput | ListKnowledgeBasesCommandOutput | QueryKnowledgeBaseCommandOutput | SearchHistoryCommandOutput | SearchKnowledgeBaseCommandOutput | StartSyncDataSourceCommandOutput | StopSyncDataSourceCommandOutput | UpdateDataSourceCommandOutput | UpdateDocumentCommandOutput | UpdateKnowledgeBaseCommandOutput;
44
45
  /**
45
46
  * @public
46
47
  */
@@ -43,6 +43,7 @@ declare const CreateDocumentCommand_base: {
43
43
  * originalId: "STRING_VALUE",
44
44
  * companyId: "STRING_VALUE",
45
45
  * dataSourceId: "STRING_VALUE", // required
46
+ * metadata: "DOCUMENT_VALUE",
46
47
  * };
47
48
  * const command = new CreateDocumentCommand(input);
48
49
  * const response = await client.send(command);
@@ -27,7 +27,7 @@ declare const GetDocumentPresignedUploadUrlCommand_base: {
27
27
  getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
28
  };
29
29
  /**
30
- * Get a presigned URL for uploading the original file of the document
30
+ * Get a presigned URL for uploading the original file of the document. You must upload the file to this URL using the PUT method.
31
31
  * @example
32
32
  * Use a bare-bones client and the command you need to make an API call.
33
33
  * ```javascript
@@ -0,0 +1,96 @@
1
+ import { KnowledgeBaseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../KnowledgeBaseClient";
2
+ import { SearchHistoryInput, SearchHistoryOutput } from "../models/models_0";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
5
+ /**
6
+ * @public
7
+ */
8
+ export type { __MetadataBearer };
9
+ export { $Command };
10
+ /**
11
+ * @public
12
+ *
13
+ * The input for {@link SearchHistoryCommand}.
14
+ */
15
+ export interface SearchHistoryCommandInput extends SearchHistoryInput {
16
+ }
17
+ /**
18
+ * @public
19
+ *
20
+ * The output of {@link SearchHistoryCommand}.
21
+ */
22
+ export interface SearchHistoryCommandOutput extends SearchHistoryOutput, __MetadataBearer {
23
+ }
24
+ declare const SearchHistoryCommand_base: {
25
+ new (input: SearchHistoryCommandInput): import("@smithy/smithy-client").CommandImpl<SearchHistoryCommandInput, SearchHistoryCommandOutput, KnowledgeBaseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
26
+ new (__0_0: SearchHistoryCommandInput): import("@smithy/smithy-client").CommandImpl<SearchHistoryCommandInput, SearchHistoryCommandOutput, KnowledgeBaseClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes>;
27
+ getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions;
28
+ };
29
+ /**
30
+ * You can use this endpoint to retrieve the search history of the knowledge base.
31
+ * @example
32
+ * Use a bare-bones client and the command you need to make an API call.
33
+ * ```javascript
34
+ * import { KnowledgeBaseClient, SearchHistoryCommand } from "@wildix/wim-knowledge-base-client"; // ES Modules import
35
+ * // const { KnowledgeBaseClient, SearchHistoryCommand } = require("@wildix/wim-knowledge-base-client"); // CommonJS import
36
+ * const client = new KnowledgeBaseClient(config);
37
+ * const input = { // SearchHistoryInput
38
+ * companyId: "STRING_VALUE",
39
+ * limit: Number("int"),
40
+ * offset: Number("int"),
41
+ * sort: "STRING_VALUE",
42
+ * filter: { // SearchHistoryFilter
43
+ * knowledgeBaseId: "STRING_VALUE",
44
+ * dataSourceId: "STRING_VALUE",
45
+ * sessionId: "STRING_VALUE",
46
+ * externalSessionId: "STRING_VALUE",
47
+ * searchUser: "STRING_VALUE",
48
+ * },
49
+ * };
50
+ * const command = new SearchHistoryCommand(input);
51
+ * const response = await client.send(command);
52
+ * // { // SearchHistoryOutput
53
+ * // results: [ // SearchHistoryResults // required
54
+ * // "DOCUMENT_VALUE",
55
+ * // ],
56
+ * // };
57
+ *
58
+ * ```
59
+ *
60
+ * @param SearchHistoryCommandInput - {@link SearchHistoryCommandInput}
61
+ * @returns {@link SearchHistoryCommandOutput}
62
+ * @see {@link SearchHistoryCommandInput} for command's `input` shape.
63
+ * @see {@link SearchHistoryCommandOutput} for command's `response` shape.
64
+ * @see {@link KnowledgeBaseClientResolvedConfig | config} for KnowledgeBaseClient's `config` shape.
65
+ *
66
+ * @throws {@link ValidationException} (client fault)
67
+ *
68
+ * @throws {@link UnauthorizedException} (client fault)
69
+ *
70
+ * @throws {@link ForbiddenException} (client fault)
71
+ *
72
+ * @throws {@link KnowledgeBaseNotFoundException} (client fault)
73
+ *
74
+ * @throws {@link DataSourceNotFoundException} (client fault)
75
+ *
76
+ * @throws {@link DocumentNotFoundException} (client fault)
77
+ *
78
+ * @throws {@link KnowledgeBaseServiceException}
79
+ * <p>Base exception class for all service exceptions from KnowledgeBase service.</p>
80
+ *
81
+ *
82
+ * @public
83
+ */
84
+ export declare class SearchHistoryCommand extends SearchHistoryCommand_base {
85
+ /** @internal type navigation helper, not in runtime. */
86
+ protected static __types: {
87
+ api: {
88
+ input: SearchHistoryInput;
89
+ output: SearchHistoryOutput;
90
+ };
91
+ sdk: {
92
+ input: SearchHistoryCommandInput;
93
+ output: SearchHistoryCommandOutput;
94
+ };
95
+ };
96
+ }
@@ -47,6 +47,7 @@ declare const SearchKnowledgeBaseCommand_base: {
47
47
  * },
48
48
  * withMetadata: true || false,
49
49
  * searchUser: "STRING_VALUE",
50
+ * externalSessionId: "STRING_VALUE",
50
51
  * };
51
52
  * const command = new SearchKnowledgeBaseCommand(input);
52
53
  * const response = await client.send(command);
@@ -19,6 +19,7 @@ export * from "./ListDataSourcesCommand";
19
19
  export * from "./ListDocumentsCommand";
20
20
  export * from "./ListKnowledgeBasesCommand";
21
21
  export * from "./QueryKnowledgeBaseCommand";
22
+ export * from "./SearchHistoryCommand";
22
23
  export * from "./SearchKnowledgeBaseCommand";
23
24
  export * from "./StartSyncDataSourceCommand";
24
25
  export * from "./StopSyncDataSourceCommand";
@@ -530,7 +530,7 @@ export interface CreateDocumentInput {
530
530
  */
531
531
  url?: string | undefined;
532
532
  /**
533
- * Optional document content in plain text or markdown format. For file uploads, can be the document content. For integrated sources (Confluence, GDrive), typically populated during sync from the original source
533
+ * Optional document content in plain text or markdown format. For file uploads, can be the document content.
534
534
  * @public
535
535
  */
536
536
  content?: string | undefined;
@@ -545,7 +545,7 @@ export interface CreateDocumentInput {
545
545
  */
546
546
  originalName: string;
547
547
  /**
548
- * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive)
548
+ * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive), sha1(original-file-content) (for file uploads)
549
549
  * @public
550
550
  */
551
551
  originalId?: string | undefined;
@@ -559,6 +559,11 @@ export interface CreateDocumentInput {
559
559
  * @public
560
560
  */
561
561
  dataSourceId: string;
562
+ /**
563
+ * Additional metadata of the document. Example: \{ 'createdAt': '2025-01-01T00:00:00Z', 'updatedAt': '2025-05-01T00:00:00Z', 'createdBy': 'user@example.com' \}
564
+ * @public
565
+ */
566
+ metadata?: __DocumentType | undefined;
562
567
  }
563
568
  /**
564
569
  * @public
@@ -590,7 +595,7 @@ export interface DocumentItem {
590
595
  */
591
596
  url?: string | undefined;
592
597
  /**
593
- * Optional document content in plain text or markdown format. For file uploads, can be the document content. For integrated sources (Confluence, GDrive), typically populated during sync from the original source
598
+ * Optional document content in plain text or markdown format. For file uploads, can be the document content.
594
599
  * @public
595
600
  */
596
601
  content?: string | undefined;
@@ -605,7 +610,7 @@ export interface DocumentItem {
605
610
  */
606
611
  originalName: string;
607
612
  /**
608
- * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive)
613
+ * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive), sha1(original-file-content) (for file uploads)
609
614
  * @public
610
615
  */
611
616
  originalId?: string | undefined;
@@ -1477,7 +1482,7 @@ export interface QueryKnowledgeBaseInput {
1477
1482
  */
1478
1483
  searchUser?: string | undefined;
1479
1484
  /**
1480
- * The external session ID. Used for tracking and analytics purposes.
1485
+ * The external session ID from the client.
1481
1486
  * @public
1482
1487
  */
1483
1488
  externalSessionId?: string | undefined;
@@ -1490,6 +1495,64 @@ export interface QueryKnowledgeBaseOutput {
1490
1495
  metadata: __DocumentType;
1491
1496
  sources: __DocumentType;
1492
1497
  }
1498
+ /**
1499
+ * @public
1500
+ */
1501
+ export interface SearchHistoryFilter {
1502
+ /**
1503
+ * Unique identifier of the knowledge base
1504
+ * @public
1505
+ */
1506
+ knowledgeBaseId?: string | undefined;
1507
+ /**
1508
+ * Unique identifier of the data source
1509
+ * @public
1510
+ */
1511
+ dataSourceId?: string | undefined;
1512
+ /**
1513
+ * The internal session ID. Used for tracking and analytics purposes.
1514
+ * @public
1515
+ */
1516
+ sessionId?: string | undefined;
1517
+ /**
1518
+ * The external session ID from the client.
1519
+ * @public
1520
+ */
1521
+ externalSessionId?: string | undefined;
1522
+ /**
1523
+ * The user who performs the search in the knowledge base. Example: user@example.com
1524
+ * @public
1525
+ */
1526
+ searchUser?: string | undefined;
1527
+ }
1528
+ /**
1529
+ * @public
1530
+ */
1531
+ export interface SearchHistoryInput {
1532
+ /**
1533
+ * The unique identifier of the tenant when a service token is used.
1534
+ * @public
1535
+ */
1536
+ companyId?: string | undefined;
1537
+ limit?: number | undefined;
1538
+ offset?: number | undefined;
1539
+ /**
1540
+ * Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order.
1541
+ * @public
1542
+ */
1543
+ sort?: string | undefined;
1544
+ /**
1545
+ * Filters for the history query. All filters are optional.
1546
+ * @public
1547
+ */
1548
+ filter: SearchHistoryFilter;
1549
+ }
1550
+ /**
1551
+ * @public
1552
+ */
1553
+ export interface SearchHistoryOutput {
1554
+ results: (__DocumentType)[];
1555
+ }
1493
1556
  /**
1494
1557
  * @public
1495
1558
  */
@@ -1524,6 +1587,11 @@ export interface SearchKnowledgeBaseInput {
1524
1587
  * @public
1525
1588
  */
1526
1589
  searchUser?: string | undefined;
1590
+ /**
1591
+ * The external session ID. Used for tracking and analytics purposes. Example: 123e4567-e89b-12d3-a456-426614174000
1592
+ * @public
1593
+ */
1594
+ externalSessionId?: string | undefined;
1527
1595
  }
1528
1596
  /**
1529
1597
  * @public
@@ -1643,7 +1711,7 @@ export interface UpdateDocumentInput {
1643
1711
  */
1644
1712
  url?: string | undefined;
1645
1713
  /**
1646
- * Optional document content in plain text or markdown format. For file uploads, can be the document content. For integrated sources (Confluence, GDrive), typically populated during sync from the original source
1714
+ * Optional document content in plain text or markdown format. For file uploads, can be the document content.
1647
1715
  * @public
1648
1716
  */
1649
1717
  content?: string | undefined;
@@ -1658,7 +1726,7 @@ export interface UpdateDocumentInput {
1658
1726
  */
1659
1727
  originalName: string;
1660
1728
  /**
1661
- * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive)
1729
+ * Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive), sha1(original-file-content) (for file uploads)
1662
1730
  * @public
1663
1731
  */
1664
1732
  originalId?: string | undefined;
@@ -19,6 +19,7 @@ import { ListDataSourcesCommandInput, ListDataSourcesCommandOutput } from "../co
19
19
  import { ListDocumentsCommandInput, ListDocumentsCommandOutput } from "../commands/ListDocumentsCommand";
20
20
  import { ListKnowledgeBasesCommandInput, ListKnowledgeBasesCommandOutput } from "../commands/ListKnowledgeBasesCommand";
21
21
  import { QueryKnowledgeBaseCommandInput, QueryKnowledgeBaseCommandOutput } from "../commands/QueryKnowledgeBaseCommand";
22
+ import { SearchHistoryCommandInput, SearchHistoryCommandOutput } from "../commands/SearchHistoryCommand";
22
23
  import { SearchKnowledgeBaseCommandInput, SearchKnowledgeBaseCommandOutput } from "../commands/SearchKnowledgeBaseCommand";
23
24
  import { StartSyncDataSourceCommandInput, StartSyncDataSourceCommandOutput } from "../commands/StartSyncDataSourceCommand";
24
25
  import { StopSyncDataSourceCommandInput, StopSyncDataSourceCommandOutput } from "../commands/StopSyncDataSourceCommand";
@@ -111,6 +112,10 @@ export declare const se_ListKnowledgeBasesCommand: (input: ListKnowledgeBasesCom
111
112
  * serializeAws_restJson1QueryKnowledgeBaseCommand
112
113
  */
113
114
  export declare const se_QueryKnowledgeBaseCommand: (input: QueryKnowledgeBaseCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
115
+ /**
116
+ * serializeAws_restJson1SearchHistoryCommand
117
+ */
118
+ export declare const se_SearchHistoryCommand: (input: SearchHistoryCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
114
119
  /**
115
120
  * serializeAws_restJson1SearchKnowledgeBaseCommand
116
121
  */
@@ -219,6 +224,10 @@ export declare const de_ListKnowledgeBasesCommand: (output: __HttpResponse, cont
219
224
  * deserializeAws_restJson1QueryKnowledgeBaseCommand
220
225
  */
221
226
  export declare const de_QueryKnowledgeBaseCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<QueryKnowledgeBaseCommandOutput>;
227
+ /**
228
+ * deserializeAws_restJson1SearchHistoryCommand
229
+ */
230
+ export declare const de_SearchHistoryCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<SearchHistoryCommandOutput>;
222
231
  /**
223
232
  * deserializeAws_restJson1SearchKnowledgeBaseCommand
224
233
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wildix/wim-knowledge-base-client",
3
3
  "description": "@wildix/wim-knowledge-base-client client",
4
- "version": "0.0.38",
4
+ "version": "0.0.40",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",