mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 02:40:39 +09:00
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:
parent
3dc3347a58
commit
0d4dd50b35
7 changed files with 216 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue