1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | const automation_client_1 = require("@atomist/automation-client");
|
19 | const sdm_1 = require("@atomist/sdm");
|
20 | const closeCodeInspectionIssues_1 = require("./event/closeCodeInspectionIssues");
|
21 | const labelIssueOnDeployment_1 = require("./event/labelIssueOnDeployment");
|
22 |
|
23 |
|
24 |
|
25 | exports.IssueSupport = Object.assign({}, sdm_1.metadata(), { configure: sdm => {
|
26 | sdm.addEvent(labelIssueOnDeployment_1.labelIssuesOnDeployment(sdm));
|
27 | return sdm;
|
28 | } });
|
29 | const DefaultIssueSupportOptions = {
|
30 | labelIssuesOnDeployment: true,
|
31 | closeCodeInspectionIssuesOnBranchDeletion: {
|
32 | enabled: false,
|
33 | source: [],
|
34 | },
|
35 | };
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | function issueSupport(options = {}) {
|
41 | return Object.assign({}, sdm_1.metadata(), { configure: sdm => {
|
42 | const optsToUse = Object.assign({}, DefaultIssueSupportOptions, options);
|
43 | if (optsToUse.labelIssuesOnDeployment) {
|
44 | sdm.addEvent(labelIssueOnDeployment_1.labelIssuesOnDeployment(sdm));
|
45 | }
|
46 | if (optsToUse.closeCodeInspectionIssuesOnBranchDeletion &&
|
47 | optsToUse.closeCodeInspectionIssuesOnBranchDeletion.enabled) {
|
48 | sdm.addEvent(closeCodeInspectionIssues_1.closeCodeInspectionIssues(sdm, ...automation_client_1.toStringArray(optsToUse.closeCodeInspectionIssuesOnBranchDeletion.source)));
|
49 | }
|
50 | } });
|
51 | }
|
52 | exports.issueSupport = issueSupport;
|
53 |
|
\ | No newline at end of file |