diff --git a/api/knowledge-fs-contract.lock.json b/api/knowledge-fs-contract.lock.json index 4fa8c478d86..dad8a33b28a 100644 --- a/api/knowledge-fs-contract.lock.json +++ b/api/knowledge-fs-contract.lock.json @@ -1,9 +1,9 @@ { "schemaVersion": 5, - "subtreeTree": "7d1965b8a633038b7f143411b76daed454ccf3d8", - "openapiSha256": "6e89f6e365256b7b169aece12c102296038629e78edfa105a8c99da0d122b57c", + "subtreeTree": "470763aeba38646e4fb95e348da1c45843b77f8c", + "openapiSha256": "3d844b2cdf46ddb140803def327533dde4b108f9ac08b0bc7374b58e4ee81ab0", "capabilityV2AuthManifestSha256": "fc0a47e23cce12544882f0298522b4933002e892b84ce1815df7e81d36a7a0c7", "capabilityV2AuthTestVectorSha256": "ae0de37b1ff05c40f905cf17a7b410d8971acacf64db07d5ee3d6fecfa559ce3", - "productOperationManifestSha256": "bff8cd8a42cb9fd0f64c0a004af54be9f369536879bd490cf09d2d36e74565c5", + "productOperationManifestSha256": "7856029dc281c9dbdddb3ba2e6cd46eae9961c7b6f02318cbb2d67482a53c505", "productOperationGapManifestSha256": "332c80165bd5cf8e79bc511374dde771a8175510404db603a8067f1a22d36df8" } diff --git a/knowledge-fs/contracts/dify-capability-v2-operations.json b/knowledge-fs/contracts/dify-capability-v2-operations.json index 4f9c2471007..efebfb5fc96 100644 --- a/knowledge-fs/contracts/dify-capability-v2-operations.json +++ b/knowledge-fs/contracts/dify-capability-v2-operations.json @@ -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": [ diff --git a/knowledge-fs/packages/api/src/dify-capability-v2.test.ts b/knowledge-fs/packages/api/src/dify-capability-v2.test.ts index 0d02eeab125..fae0912d09a 100644 --- a/knowledge-fs/packages/api/src/dify-capability-v2.test.ts +++ b/knowledge-fs/packages/api/src/dify-capability-v2.test.ts @@ -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}", diff --git a/knowledge-fs/packages/api/src/dify-capability-v2.ts b/knowledge-fs/packages/api/src/dify-capability-v2.ts index 01bd4792b4c..96bd1016e73 100644 --- a/knowledge-fs/packages/api/src/dify-capability-v2.ts +++ b/knowledge-fs/packages/api/src/dify-capability-v2.ts @@ -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, diff --git a/knowledge-fs/scripts/export-capability-v2-operations.test.mjs b/knowledge-fs/scripts/export-capability-v2-operations.test.mjs index 5960ab5b50a..f1b2774a5e0 100644 --- a/knowledge-fs/scripts/export-capability-v2-operations.test.mjs +++ b/knowledge-fs/scripts/export-capability-v2-operations.test.mjs @@ -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",