feat(plugins): add document CRUD methods to Plugin SDK
Wire issue document list/get/upsert/delete operations through the JSON-RPC protocol so plugins can manage issue documents with the same capabilities available via the REST API. Fixes #940
This commit is contained in:
@@ -422,6 +422,23 @@ export function createTestHarness(options: TestHarnessOptions): TestHarness {
|
||||
issueComments.set(issueId, current);
|
||||
return comment;
|
||||
},
|
||||
documents: {
|
||||
async list(_issueId, _companyId) {
|
||||
requireCapability(manifest, capabilitySet, "issue.documents.read" as any);
|
||||
return [];
|
||||
},
|
||||
async get(_issueId, _key, _companyId) {
|
||||
requireCapability(manifest, capabilitySet, "issue.documents.read" as any);
|
||||
return null;
|
||||
},
|
||||
async upsert(_input) {
|
||||
requireCapability(manifest, capabilitySet, "issue.documents.write" as any);
|
||||
throw new Error("documents.upsert is not implemented in test context");
|
||||
},
|
||||
async delete(_issueId, _key, _companyId) {
|
||||
requireCapability(manifest, capabilitySet, "issue.documents.write" as any);
|
||||
},
|
||||
},
|
||||
},
|
||||
agents: {
|
||||
async list(input) {
|
||||
|
||||
Reference in New Issue
Block a user