feat(knowledge-fs): add bulk logical document deletion support

This commit is contained in:
FFXN 2026-08-11 19:47:37 +08:00
parent 7f0efa20fa
commit 0853258f92
5 changed files with 36 additions and 4 deletions

View File

@ -1,9 +1,9 @@
{
"schemaVersion": 5,
"subtreeTree": "7d1965b8a633038b7f143411b76daed454ccf3d8",
"openapiSha256": "6e89f6e365256b7b169aece12c102296038629e78edfa105a8c99da0d122b57c",
"subtreeTree": "470763aeba38646e4fb95e348da1c45843b77f8c",
"openapiSha256": "3d844b2cdf46ddb140803def327533dde4b108f9ac08b0bc7374b58e4ee81ab0",
"capabilityV2AuthManifestSha256": "fc0a47e23cce12544882f0298522b4933002e892b84ce1815df7e81d36a7a0c7",
"capabilityV2AuthTestVectorSha256": "ae0de37b1ff05c40f905cf17a7b410d8971acacf64db07d5ee3d6fecfa559ce3",
"productOperationManifestSha256": "bff8cd8a42cb9fd0f64c0a004af54be9f369536879bd490cf09d2d36e74565c5",
"productOperationManifestSha256": "7856029dc281c9dbdddb3ba2e6cd46eae9961c7b6f02318cbb2d67482a53c505",
"productOperationGapManifestSha256": "332c80165bd5cf8e79bc511374dde771a8175510404db603a8067f1a22d36df8"
}

View File

@ -1572,6 +1572,23 @@
},
"resourceType": "knowledge_space"
},
{
"action": "logical_documents.delete",
"allowedCallerKinds": [
"interactive",
"service",
"agent",
"workflow"
],
"method": "DELETE",
"operationId": "requestBulkLogicalDocumentDeletion",
"parentResourceBinding": null,
"path": "/knowledge-spaces/{id}/logical-documents/bulk",
"resourceBinding": {
"pathParameter": "id"
},
"resourceType": "knowledge_space"
},
{
"action": "documents.delete",
"allowedCallerKinds": [

View File

@ -426,6 +426,12 @@ describe("Dify Capability v2 request guard", () => {
"documents.bulk.delete",
"knowledge_space",
],
requestBulkLogicalDocumentDeletion: [
"DELETE",
"/knowledge-spaces/{id}/logical-documents/bulk",
"logical_documents.delete",
"knowledge_space",
],
requestDocumentDeletion: [
"DELETE",
"/knowledge-spaces/{id}/documents/{documentId}",

View File

@ -722,6 +722,15 @@ export const DIFY_CAPABILITY_V2_OPERATIONS: readonly DifyCapabilityV2Operation[]
resource: { pathParameter: "id" },
resourceType: "knowledge_space",
},
{
action: "logical_documents.delete",
allowedCallerKinds: STANDARD_CALLERS,
method: "DELETE",
operationId: "requestBulkLogicalDocumentDeletion",
pathTemplate: "/knowledge-spaces/{id}/logical-documents/bulk",
resource: { pathParameter: "id" },
resourceType: "knowledge_space",
},
{
action: "logical_documents.delete",
allowedCallerKinds: STANDARD_CALLERS,

View File

@ -20,7 +20,7 @@ test("Capability v2 operation export is deterministic and includes internal life
);
const document = JSON.parse(readFileSync(output, "utf8"));
assert.equal(document.schemaVersion, 1);
assert.equal(new Set(document.operations.map((operation) => operation.operationId)).size, 112);
assert.equal(new Set(document.operations.map((operation) => operation.operationId)).size, 113);
assert.deepEqual(
document.operations.find(
(operation) => operation.operationId === "createSourceCrawlImportWorkflow",