Skip to content

Commit 84e7a1b

Browse files
authored
feat: create an interface to export and use in KDM (#758)
1 parent b07f061 commit 84e7a1b

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

src/controllers/Document.ts

+25-23
Original file line numberDiff line numberDiff line change
@@ -716,29 +716,7 @@ export class DocumentController extends BaseController {
716716
query: JSONObject,
717717
changes: Partial<TKDocumentContent>,
718718
options: ArgsDocumentControllerUpdateByQuery = {}
719-
): Promise<{
720-
/**
721-
* Array of successfully updated documents
722-
*/
723-
successes: KDocument<TKDocumentContent>[];
724-
/**
725-
* Array of failed creation
726-
*/
727-
errors: Array<{
728-
/**
729-
* Document that cause the error
730-
*/
731-
document: KDocument<TKDocumentContent>;
732-
/**
733-
* HTTP error status
734-
*/
735-
status: number;
736-
/**
737-
* Human readable reason
738-
*/
739-
reason: string;
740-
}>;
741-
}> {
719+
): Promise<UpdateByQueryResponse<TKDocumentContent>> {
742720
const request = {
743721
action: "updateByQuery",
744722
body: { changes, query },
@@ -940,3 +918,27 @@ export interface ArgsDocumentControllerUpsert<TKDocumentContent>
940918
}
941919

942920
export type ArgsDocumentControllerValidate = ArgsDefault;
921+
922+
export interface UpdateByQueryResponse<TKDocumentContent> {
923+
/**
924+
* Array of successfully updated documents
925+
*/
926+
successes: KDocument<TKDocumentContent>[];
927+
/**
928+
* Array of failed creation
929+
*/
930+
errors: Array<{
931+
/**
932+
* Document that cause the error
933+
*/
934+
document: KDocument<TKDocumentContent>;
935+
/**
936+
* HTTP error status
937+
*/
938+
status: number;
939+
/**
940+
* Human readable reason
941+
*/
942+
reason: string;
943+
}>;
944+
}

0 commit comments

Comments
 (0)