@jetbrains/n8n-nodes-youtrack 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +163 -0
- package/dist/common/youtrack-logo.svg +1 -0
- package/dist/credentials/PermanentTokenCredentialForYouTrackApi.credentials.d.ts +10 -0
- package/dist/credentials/PermanentTokenCredentialForYouTrackApi.credentials.js +51 -0
- package/dist/credentials/PermanentTokenCredentialForYouTrackApi.credentials.js.map +1 -0
- package/dist/credentials/YouTrackWebhookAuthApi.credentials.d.ts +10 -0
- package/dist/credentials/YouTrackWebhookAuthApi.credentials.js +56 -0
- package/dist/credentials/YouTrackWebhookAuthApi.credentials.js.map +1 -0
- package/dist/images/action.png +0 -0
- package/dist/images/trigger.png +0 -0
- package/dist/nodes/YouTrack/YouTrack.node.json +20 -0
- package/dist/nodes/YouTrack/YouTrackTrigger.node.json +20 -0
- package/dist/nodes/YouTrack/Youtrack.node.d.ts +4 -0
- package/dist/nodes/YouTrack/Youtrack.node.js +40 -0
- package/dist/nodes/YouTrack/Youtrack.node.js.map +1 -0
- package/dist/nodes/YouTrack/YoutrackTrigger.node.d.ts +12 -0
- package/dist/nodes/YouTrack/YoutrackTrigger.node.js +229 -0
- package/dist/nodes/YouTrack/YoutrackTrigger.node.js.map +1 -0
- package/dist/nodes/YouTrack/resources/command/execute.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/command/execute.js +106 -0
- package/dist/nodes/YouTrack/resources/command/execute.js.map +1 -0
- package/dist/nodes/YouTrack/resources/command/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/command/index.js +36 -0
- package/dist/nodes/YouTrack/resources/command/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/command/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/command/shared.js +51 -0
- package/dist/nodes/YouTrack/resources/command/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/command/utils.d.ts +4 -0
- package/dist/nodes/YouTrack/resources/command/utils.js +22 -0
- package/dist/nodes/YouTrack/resources/command/utils.js.map +1 -0
- package/dist/nodes/YouTrack/resources/comment/add.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/comment/add.js +56 -0
- package/dist/nodes/YouTrack/resources/comment/add.js.map +1 -0
- package/dist/nodes/YouTrack/resources/comment/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/comment/index.js +53 -0
- package/dist/nodes/YouTrack/resources/comment/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/comment/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/comment/list.js +84 -0
- package/dist/nodes/YouTrack/resources/comment/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/comment/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/comment/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/comment/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/index.d.ts +3 -0
- package/dist/nodes/YouTrack/resources/index.js +86 -0
- package/dist/nodes/YouTrack/resources/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/create.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/create.js +86 -0
- package/dist/nodes/YouTrack/resources/issue/create.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/get.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/get.js +34 -0
- package/dist/nodes/YouTrack/resources/issue/get.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/index.js +100 -0
- package/dist/nodes/YouTrack/resources/issue/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/list.js +98 -0
- package/dist/nodes/YouTrack/resources/issue/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/issue/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issue/update.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issue/update.js +63 -0
- package/dist/nodes/YouTrack/resources/issue/update.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/create.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/create.js +109 -0
- package/dist/nodes/YouTrack/resources/issueDraft/create.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/get.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/get.js +34 -0
- package/dist/nodes/YouTrack/resources/issueDraft/get.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/index.js +100 -0
- package/dist/nodes/YouTrack/resources/issueDraft/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/list.js +84 -0
- package/dist/nodes/YouTrack/resources/issueDraft/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/issueDraft/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/issueDraft/update.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/issueDraft/update.js +93 -0
- package/dist/nodes/YouTrack/resources/issueDraft/update.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/get.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/get.js +34 -0
- package/dist/nodes/YouTrack/resources/project/get.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/getFieldsSchema.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/getFieldsSchema.js +66 -0
- package/dist/nodes/YouTrack/resources/project/getFieldsSchema.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/getIssues.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/getIssues.js +80 -0
- package/dist/nodes/YouTrack/resources/project/getIssues.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/index.js +78 -0
- package/dist/nodes/YouTrack/resources/project/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/list.js +98 -0
- package/dist/nodes/YouTrack/resources/project/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/project/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/project/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/project/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/savedQueries/create.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/savedQueries/create.js +76 -0
- package/dist/nodes/YouTrack/resources/savedQueries/create.js.map +1 -0
- package/dist/nodes/YouTrack/resources/savedQueries/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/savedQueries/index.js +48 -0
- package/dist/nodes/YouTrack/resources/savedQueries/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/savedQueries/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/savedQueries/list.js +84 -0
- package/dist/nodes/YouTrack/resources/savedQueries/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/addToIssue.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/addToIssue.js +55 -0
- package/dist/nodes/YouTrack/resources/tag/addToIssue.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/getIssueTags.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/getIssueTags.js +46 -0
- package/dist/nodes/YouTrack/resources/tag/getIssueTags.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/index.js +94 -0
- package/dist/nodes/YouTrack/resources/tag/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/list.js +98 -0
- package/dist/nodes/YouTrack/resources/tag/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/removeFromIssue.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/removeFromIssue.js +21 -0
- package/dist/nodes/YouTrack/resources/tag/removeFromIssue.js.map +1 -0
- package/dist/nodes/YouTrack/resources/tag/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/tag/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/tag/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/types.d.ts +26 -0
- package/dist/nodes/YouTrack/resources/types.js +3 -0
- package/dist/nodes/YouTrack/resources/types.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/get.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/get.js +34 -0
- package/dist/nodes/YouTrack/resources/user/get.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getCurrent.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getCurrent.js +34 -0
- package/dist/nodes/YouTrack/resources/user/getCurrent.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getGeneralProfile.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getGeneralProfile.js +34 -0
- package/dist/nodes/YouTrack/resources/user/getGeneralProfile.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getNotificationsProfile.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getNotificationsProfile.js +34 -0
- package/dist/nodes/YouTrack/resources/user/getNotificationsProfile.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getSavedQueries.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getSavedQueries.js +66 -0
- package/dist/nodes/YouTrack/resources/user/getSavedQueries.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getTags.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getTags.js +66 -0
- package/dist/nodes/YouTrack/resources/user/getTags.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/getTimeTrackingProfile.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/getTimeTrackingProfile.js +34 -0
- package/dist/nodes/YouTrack/resources/user/getTimeTrackingProfile.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/index.js +134 -0
- package/dist/nodes/YouTrack/resources/user/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/list.js +84 -0
- package/dist/nodes/YouTrack/resources/user/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/user/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/user/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/user/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/userGroup/get.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/userGroup/get.js +34 -0
- package/dist/nodes/YouTrack/resources/userGroup/get.js.map +1 -0
- package/dist/nodes/YouTrack/resources/userGroup/getMembers.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/userGroup/getMembers.js +34 -0
- package/dist/nodes/YouTrack/resources/userGroup/getMembers.js.map +1 -0
- package/dist/nodes/YouTrack/resources/userGroup/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/userGroup/index.js +64 -0
- package/dist/nodes/YouTrack/resources/userGroup/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/userGroup/list.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/userGroup/list.js +84 -0
- package/dist/nodes/YouTrack/resources/userGroup/list.js.map +1 -0
- package/dist/nodes/YouTrack/resources/userGroup/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/userGroup/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/userGroup/shared.js.map +1 -0
- package/dist/nodes/YouTrack/resources/workitem/add.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/workitem/add.js +95 -0
- package/dist/nodes/YouTrack/resources/workitem/add.js.map +1 -0
- package/dist/nodes/YouTrack/resources/workitem/index.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/workitem/index.js +36 -0
- package/dist/nodes/YouTrack/resources/workitem/index.js.map +1 -0
- package/dist/nodes/YouTrack/resources/workitem/shared.d.ts +2 -0
- package/dist/nodes/YouTrack/resources/workitem/shared.js +21 -0
- package/dist/nodes/YouTrack/resources/workitem/shared.js.map +1 -0
- package/dist/package.json +55 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.YoutrackTrigger = void 0;
|
|
4
|
+
const YOUTRACK_EVENTS = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Issue Created',
|
|
7
|
+
value: 'issueCreated',
|
|
8
|
+
description: 'Trigger when a new issue is created',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Issue Updated',
|
|
12
|
+
value: 'issueUpdated',
|
|
13
|
+
description: 'Trigger when an issue is updated',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Issue Deleted',
|
|
17
|
+
value: 'issueDeleted',
|
|
18
|
+
description: 'Trigger when an issue is deleted',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Comment Added',
|
|
22
|
+
value: 'commentAdded',
|
|
23
|
+
description: 'Trigger when a new comment is added to an issue',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Comment Updated',
|
|
27
|
+
value: 'commentUpdated',
|
|
28
|
+
description: 'Trigger when a new comment is updated',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Comment Deleted',
|
|
32
|
+
value: 'commentDeleted',
|
|
33
|
+
description: 'Trigger when a comment is deleted',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Work Item Added',
|
|
37
|
+
value: 'workItemAdded',
|
|
38
|
+
description: 'Trigger when a work item is added to an issue',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Work Item Updated',
|
|
42
|
+
value: 'workItemUpdated',
|
|
43
|
+
description: 'Trigger when a work item is updated',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Work Item Deleted',
|
|
47
|
+
value: 'workItemDeleted',
|
|
48
|
+
description: 'Trigger when a work item is deleted',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Issue Attachment Added',
|
|
52
|
+
value: 'issueAttachmentAdded',
|
|
53
|
+
description: 'Trigger when an attachment is added to an issue',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'Issue Attachment Deleted',
|
|
57
|
+
value: 'issueAttachmentDeleted',
|
|
58
|
+
description: 'Trigger when an attachment is deleted from an issue',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
61
|
+
const EVENT_VALUES = YOUTRACK_EVENTS.map(e => e.value);
|
|
62
|
+
class YoutrackTrigger {
|
|
63
|
+
constructor() {
|
|
64
|
+
this.description = {
|
|
65
|
+
displayName: 'YouTrack Trigger',
|
|
66
|
+
name: 'youtrackTrigger',
|
|
67
|
+
icon: 'file:../../common/youtrack-logo.svg',
|
|
68
|
+
group: ['trigger'],
|
|
69
|
+
version: 2,
|
|
70
|
+
subtitle: '={{$parameter["events"] && $parameter["events"].length > 0 ? $parameter["events"].join(", ") : "No events selected"}}',
|
|
71
|
+
description: 'Triggers workflow on YouTrack events',
|
|
72
|
+
defaults: {
|
|
73
|
+
name: 'YouTrack Trigger',
|
|
74
|
+
},
|
|
75
|
+
inputs: [],
|
|
76
|
+
outputs: ['main'],
|
|
77
|
+
usableAsTool: undefined,
|
|
78
|
+
credentials: [
|
|
79
|
+
{
|
|
80
|
+
name: 'permanentTokenCredentialForYouTrackApi',
|
|
81
|
+
required: true,
|
|
82
|
+
displayName: 'Credentials to Connect to YouTrack',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'youTrackWebhookAuthApi',
|
|
86
|
+
required: true,
|
|
87
|
+
displayName: 'Authenticate Incoming Webhook',
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
webhooks: [
|
|
91
|
+
{
|
|
92
|
+
name: 'default',
|
|
93
|
+
httpMethod: 'POST',
|
|
94
|
+
responseMode: 'onReceived',
|
|
95
|
+
path: 'webhook',
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
properties: [
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Events',
|
|
101
|
+
name: 'events',
|
|
102
|
+
type: 'multiOptions',
|
|
103
|
+
required: true,
|
|
104
|
+
default: ['issueCreated'],
|
|
105
|
+
options: [
|
|
106
|
+
{
|
|
107
|
+
name: '* All Events',
|
|
108
|
+
value: '*',
|
|
109
|
+
description: 'Trigger on any YouTrack event',
|
|
110
|
+
},
|
|
111
|
+
...YOUTRACK_EVENTS,
|
|
112
|
+
],
|
|
113
|
+
description: 'Select one or more events to listen to. Choose "* All Events" to listen to all events.',
|
|
114
|
+
},
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
this.webhookMethods = {
|
|
118
|
+
default: {
|
|
119
|
+
async checkExists() {
|
|
120
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
121
|
+
return !!webhookData.webhookUrl;
|
|
122
|
+
},
|
|
123
|
+
async create() {
|
|
124
|
+
const webhookUrl = this.getNodeWebhookUrl('default');
|
|
125
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
126
|
+
webhookData.webhookUrl = webhookUrl;
|
|
127
|
+
return true;
|
|
128
|
+
},
|
|
129
|
+
async delete() {
|
|
130
|
+
const webhookData = this.getWorkflowStaticData('node');
|
|
131
|
+
delete webhookData.webhookUrl;
|
|
132
|
+
return true;
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async webhook() {
|
|
138
|
+
var _a;
|
|
139
|
+
const req = this.getRequestObject();
|
|
140
|
+
const selectedEvents = this.getNodeParameter('events', []);
|
|
141
|
+
try {
|
|
142
|
+
const webhookCredentials = await this.getCredentials('youTrackWebhookAuthApi');
|
|
143
|
+
if (webhookCredentials) {
|
|
144
|
+
const authMethod = webhookCredentials.authMethod;
|
|
145
|
+
const expectedToken = webhookCredentials.authToken;
|
|
146
|
+
let receivedToken;
|
|
147
|
+
if (authMethod === 'headerAuth') {
|
|
148
|
+
const headerName = webhookCredentials.headerName;
|
|
149
|
+
receivedToken = req.headers[headerName.toLowerCase()];
|
|
150
|
+
}
|
|
151
|
+
else if (authMethod === 'queryAuth') {
|
|
152
|
+
const queryParamName = webhookCredentials.queryParameterName;
|
|
153
|
+
receivedToken = (_a = req.query) === null || _a === void 0 ? void 0 : _a[queryParamName];
|
|
154
|
+
}
|
|
155
|
+
if (!receivedToken || receivedToken !== expectedToken) {
|
|
156
|
+
return {
|
|
157
|
+
webhookResponse: {
|
|
158
|
+
message: 'Unauthorized: Invalid or missing authentication token',
|
|
159
|
+
statusCode: 401,
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
return {
|
|
167
|
+
webhookResponse: {
|
|
168
|
+
message: `Error validating authentication: ${error}`,
|
|
169
|
+
statusCode: 401,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
let body = {};
|
|
174
|
+
try {
|
|
175
|
+
body = req.body || {};
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
return {
|
|
179
|
+
webhookResponse: {
|
|
180
|
+
error: `Invalid payload format. ${error}`,
|
|
181
|
+
statusCode: 400,
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
let detectedEvent = 'unknown';
|
|
186
|
+
if (body && typeof body === 'object') {
|
|
187
|
+
if (body.event && typeof body.event === 'string') {
|
|
188
|
+
const eventValue = body.event;
|
|
189
|
+
if (EVENT_VALUES.includes(eventValue)) {
|
|
190
|
+
detectedEvent = eventValue;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const acceptsAllEvents = selectedEvents && selectedEvents.length > 0 && selectedEvents.includes('*');
|
|
195
|
+
if (!acceptsAllEvents) {
|
|
196
|
+
if (!selectedEvents || selectedEvents.length === 0) {
|
|
197
|
+
return {
|
|
198
|
+
webhookResponse: {
|
|
199
|
+
message: 'No events selected',
|
|
200
|
+
statusCode: 200,
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
if (!selectedEvents.includes(detectedEvent)) {
|
|
205
|
+
return {
|
|
206
|
+
webhookResponse: {
|
|
207
|
+
message: `Event type '${detectedEvent}' does not match filter. Selected events: ${selectedEvents.join(', ')}`,
|
|
208
|
+
statusCode: 200,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return {
|
|
214
|
+
workflowData: [
|
|
215
|
+
[
|
|
216
|
+
{
|
|
217
|
+
json: body,
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
],
|
|
221
|
+
webhookResponse: {
|
|
222
|
+
message: 'Webhook received successfully',
|
|
223
|
+
statusCode: 200,
|
|
224
|
+
},
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
exports.YoutrackTrigger = YoutrackTrigger;
|
|
229
|
+
//# sourceMappingURL=YoutrackTrigger.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"YoutrackTrigger.node.js","sourceRoot":"","sources":["../../../nodes/YouTrack/YoutrackTrigger.node.ts"],"names":[],"mappings":";;;AAUA,MAAM,eAAe,GAAG;IACvB;QACC,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,qCAAqC;KAClD;IACD;QACC,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE,cAAc;QACrB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AAC,IAAI,CAAC,IAAI,CAAC,EAAE;wBAC7G,UAAU,EAAE,GAAG;qBACf;iBACD,CAAC;YACH,CAAC;QACF,CAAC;QAED,OAAO;YACN,YAAY,EAAE;gBACb;oBACC;wBACC,IAAI,EAAE,IAAI;qBACV;iBACD;aACD;YACD,eAAe,EAAE;gBAChB,OAAO,EAAE,+BAA+B;gBACxC,UAAU,EAAE,GAAG;aACf;SACD,CAAC;IACH,CAAC;CACD;AAzLD,0CAyLC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandExecuteDescription = void 0;
|
|
4
|
+
const utils_1 = require("./utils");
|
|
5
|
+
exports.commandExecuteDescription = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Command Query',
|
|
8
|
+
name: 'query',
|
|
9
|
+
type: 'string',
|
|
10
|
+
required: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['command'],
|
|
14
|
+
operation: ['execute'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
placeholder: 'e.g. tag MyTag for me',
|
|
19
|
+
description: 'YouTrack command string. Examples: "tag MyTag", "for me", "tag To deploy for jane.doe", "vote+1", "star username", "work 2h Fixed bug", "visible to Developers", "add visible to john.doe". Note: "vote+1" cannot be used on your own issues. Any unrecognized words will be treated as tag names. For assignee commands, use "for me" (current user) or "for username" (must be a valid YouTrack username - if you get "Assignee expected" error, verify the username exists).',
|
|
20
|
+
routing: {
|
|
21
|
+
send: {
|
|
22
|
+
type: 'body',
|
|
23
|
+
property: 'query',
|
|
24
|
+
preSend: [
|
|
25
|
+
async function (requestOptions) {
|
|
26
|
+
const query = this.getNodeParameter('query');
|
|
27
|
+
(0, utils_1.validateCommandQuery)(query, this);
|
|
28
|
+
const normalizedQuery = (0, utils_1.normalizeCommandQuery)(query);
|
|
29
|
+
if (requestOptions.body && typeof requestOptions.body === 'object') {
|
|
30
|
+
requestOptions.body.query = normalizedQuery;
|
|
31
|
+
}
|
|
32
|
+
return requestOptions;
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Additional Options',
|
|
40
|
+
name: 'additionalOptions',
|
|
41
|
+
type: 'collection',
|
|
42
|
+
placeholder: 'Add Option',
|
|
43
|
+
default: {},
|
|
44
|
+
displayOptions: {
|
|
45
|
+
show: {
|
|
46
|
+
resource: ['command'],
|
|
47
|
+
operation: ['execute'],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
options: [
|
|
51
|
+
{
|
|
52
|
+
displayName: 'Comment',
|
|
53
|
+
name: 'comment',
|
|
54
|
+
type: 'string',
|
|
55
|
+
typeOptions: {
|
|
56
|
+
rows: 4,
|
|
57
|
+
},
|
|
58
|
+
default: '',
|
|
59
|
+
description: 'Comment text to add along with the command. This is the correct way to add comments in YouTrack - do NOT use "comment" in the Command Query field (that will create a tag). Use this field to add comments with commands like "for me", "tag MyTag", etc.',
|
|
60
|
+
routing: {
|
|
61
|
+
send: {
|
|
62
|
+
type: 'body',
|
|
63
|
+
property: 'comment',
|
|
64
|
+
preSend: [
|
|
65
|
+
async function (requestOptions) {
|
|
66
|
+
const comment = this.getNodeParameter('additionalOptions.comment');
|
|
67
|
+
const normalizedComment = (0, utils_1.normalizeComment)(comment);
|
|
68
|
+
if (normalizedComment && requestOptions.body && typeof requestOptions.body === 'object') {
|
|
69
|
+
requestOptions.body.comment = normalizedComment;
|
|
70
|
+
}
|
|
71
|
+
return requestOptions;
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Fields to Return',
|
|
79
|
+
name: 'fields',
|
|
80
|
+
type: 'string',
|
|
81
|
+
default: 'issues(id,idReadable),query,visibility(permittedGroups(id,name),permittedUsers(id,login))',
|
|
82
|
+
description: 'Comma-separated list of fields to return in response. Example: issues(ID,idReadable,summary),query.',
|
|
83
|
+
routing: {
|
|
84
|
+
send: {
|
|
85
|
+
type: 'query',
|
|
86
|
+
property: 'fields',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
displayName: 'Silent',
|
|
92
|
+
name: 'silent',
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
default: false,
|
|
95
|
+
description: 'Whether enabled, suppresses update notifications. Useful for bulk updates. Requires "Apply Commands Silently" permission.',
|
|
96
|
+
routing: {
|
|
97
|
+
send: {
|
|
98
|
+
type: 'body',
|
|
99
|
+
property: 'silent',
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/command/execute.ts"],"names":[],"mappings":";;;AAEA,mCAAwF;AAE3E,QAAA,yBAAyB,GAAsB;IAE3D;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,OAAO;QACb,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,SAAS,CAAC;aACtB;SACD;QACD,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QACpC,WAAW,EACV,idAAid;QACld,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,OAAO;gBACjB,OAAO,EAAE;oBACR,KAAK,WAAiB,cAAc;wBACnC,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAW,CA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gCACD,OAAO,cAAc,CAAC;4BACvB,CAAC;yBACD;qBACD;iBACD;aACD;YACD;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,2FAA2F;gBACpG,WAAW,EACV,qGAAqG;gBACtG,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,QAAQ,EAAE,QAAQ;qBAClB;iBACD;aACD;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,SAAS;gBACf,OAAO,EAAE,KAAK;gBACd,WAAW,EACV,2HAA2H;gBAC5H,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,IAAI,EAAE,MAAM;wBACZ,QAAQ,EAAE,QAAQ;qBAClB;iBACD;aACD;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandDescription = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
const execute_1 = require("./execute");
|
|
6
|
+
exports.commandDescription = [
|
|
7
|
+
{
|
|
8
|
+
displayName: 'Operation',
|
|
9
|
+
name: 'operation',
|
|
10
|
+
type: 'options',
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['command'],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
options: [
|
|
17
|
+
{
|
|
18
|
+
name: 'Execute',
|
|
19
|
+
value: 'execute',
|
|
20
|
+
description: 'Execute a YouTrack command on one or more issues (bulk operations supported). Supports all YouTrack commands: tags, assignees, comments, work items, votes, watchers, links, custom fields, and more. For star/watcher commands, use "star username" or "watcher username".',
|
|
21
|
+
action: 'Execute a command',
|
|
22
|
+
routing: {
|
|
23
|
+
request: {
|
|
24
|
+
method: 'POST',
|
|
25
|
+
url: '/commands',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
default: 'execute',
|
|
31
|
+
noDataExpression: true,
|
|
32
|
+
},
|
|
33
|
+
...shared_1.commandSharedDescription,
|
|
34
|
+
...execute_1.commandExecuteDescription,
|
|
35
|
+
];
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/command/index.ts"],"names":[],"mappings":";;;AAEA,qCAAoD;AACpD,uCAAsD;AAEzC,QAAA,kBAAkB,GAAsB;IACpD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;aACrB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,SAAS;gBAChB,WAAW,EACV,6QAA6Q;gBAC9Q,MAAM,EAAE,mBAAmB;gBAC3B,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,WAAW;qBAChB;iBACD;aACD;SACD;QACD,OAAO,EAAE,SAAS;QAClB,gBAAgB,EAAE,IAAI;KACtB;IAED,GAAG,iCAAwB;IAC3B,GAAG,mCAAyB;CAC5B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commandSharedDescription = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
exports.commandSharedDescription = [
|
|
6
|
+
{
|
|
7
|
+
displayName: 'Issue IDs',
|
|
8
|
+
name: 'issueIds',
|
|
9
|
+
type: 'string',
|
|
10
|
+
required: true,
|
|
11
|
+
displayOptions: {
|
|
12
|
+
show: {
|
|
13
|
+
resource: ['command'],
|
|
14
|
+
operation: ['execute'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
default: '',
|
|
18
|
+
placeholder: 'e.g. PROJECT-123, PROJECT-124, 2-15',
|
|
19
|
+
description: 'Comma-separated list of issue IDs for bulk operations. Examples: "PROJECT-123, PROJECT-124" (readable IDs) or "2-15, 2-16" (database IDs). Supports mixing both formats. The command will be applied to all listed issues.',
|
|
20
|
+
routing: {
|
|
21
|
+
send: {
|
|
22
|
+
type: 'body',
|
|
23
|
+
property: 'issues',
|
|
24
|
+
preSend: [
|
|
25
|
+
async function (requestOptions) {
|
|
26
|
+
const issueIds = this.getNodeParameter('issueIds');
|
|
27
|
+
if (!issueIds) {
|
|
28
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Issue IDs are required', { itemIndex: this.getItemIndex() });
|
|
29
|
+
}
|
|
30
|
+
const ids = issueIds
|
|
31
|
+
.split(',')
|
|
32
|
+
.map((id) => id.trim())
|
|
33
|
+
.filter((id) => id.length > 0);
|
|
34
|
+
const issues = ids.map((id) => {
|
|
35
|
+
const isDatabaseId = /^\d+-\d+$/.test(id);
|
|
36
|
+
if (isDatabaseId) {
|
|
37
|
+
return { id };
|
|
38
|
+
}
|
|
39
|
+
return { idReadable: id };
|
|
40
|
+
});
|
|
41
|
+
if (requestOptions.body && typeof requestOptions.body === 'object') {
|
|
42
|
+
requestOptions.body.issues = issues;
|
|
43
|
+
}
|
|
44
|
+
return requestOptions;
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/command/shared.ts"],"names":[],"mappings":";;;AACA,+CAAkD;AAGrC,QAAA,wBAAwB,GAAsB;IAE1D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c,CAAC,IAAI,IAAI,OAAO,cAAc,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;4BACnE,cAAc,CAAC,IAAiC,CAAC,MAAM,GAAG,MAAM,CAAC;wBACnE,CAAC;wBAED,OAAO,cAAc,CAAC;oBACvB,CAAC;iBACD;aACD;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IExecuteSingleFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare function normalizeCommandQuery(query: string): string;
|
|
3
|
+
export declare function validateCommandQuery(query: string | undefined, context: IExecuteSingleFunctions): void;
|
|
4
|
+
export declare function normalizeComment(comment: string | undefined): string | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeCommandQuery = normalizeCommandQuery;
|
|
4
|
+
exports.validateCommandQuery = validateCommandQuery;
|
|
5
|
+
exports.normalizeComment = normalizeComment;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
function normalizeCommandQuery(query) {
|
|
8
|
+
return query.trim().replace(/\n+/g, ' ').replace(/\s+/g, ' ');
|
|
9
|
+
}
|
|
10
|
+
function validateCommandQuery(query, context) {
|
|
11
|
+
if (!query) {
|
|
12
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), 'Command query is required');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function normalizeComment(comment) {
|
|
16
|
+
if (!comment) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const trimmed = comment.trim();
|
|
20
|
+
return trimmed || undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/command/utils.ts"],"names":[],"mappings":";;AAYA,sDAEC;AASD,oDAUC;AAQD,4CAMC;AA/CD,+CAAkD;AAYlD,SAAgB,qBAAqB,CAAC,KAAa;IAClD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC/D,CAAC;AASD,SAAgB,oBAAoB,CACnC,KAAyB,EACzB,OAAgC;IAEhC,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,2BAA2B,CAC3B,CAAC;IACH,CAAC;AACF,CAAC;AAQD,SAAgB,gBAAgB,CAAC,OAA2B;IAC3D,IAAI,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAC/B,OAAO,OAAO,IAAI,SAAS,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commentAddDescription = void 0;
|
|
4
|
+
exports.commentAddDescription = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Comment Text',
|
|
7
|
+
name: 'text',
|
|
8
|
+
type: 'string',
|
|
9
|
+
typeOptions: {
|
|
10
|
+
rows: 4,
|
|
11
|
+
},
|
|
12
|
+
required: true,
|
|
13
|
+
displayOptions: {
|
|
14
|
+
show: {
|
|
15
|
+
resource: ['comment'],
|
|
16
|
+
operation: ['add'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
default: '',
|
|
20
|
+
routing: {
|
|
21
|
+
send: {
|
|
22
|
+
type: 'body',
|
|
23
|
+
property: 'text',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'Additional Options',
|
|
29
|
+
name: 'additionalOptions',
|
|
30
|
+
type: 'collection',
|
|
31
|
+
placeholder: 'Add Fields',
|
|
32
|
+
default: {},
|
|
33
|
+
displayOptions: {
|
|
34
|
+
show: {
|
|
35
|
+
resource: ['comment'],
|
|
36
|
+
operation: ['add'],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Fields to Return',
|
|
42
|
+
name: 'fields',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: 'id,text,created,updated,author(login,name)',
|
|
45
|
+
description: 'Comma-separated list of fields to return in response',
|
|
46
|
+
routing: {
|
|
47
|
+
send: {
|
|
48
|
+
type: 'query',
|
|
49
|
+
property: 'fields',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/comment/add.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAsB;IAEvD;QACC,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;YACZ,IAAI,EAAE,CAAC;SACP;QACD,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR,IAAI,EAAE;gBACL,IAAI,EAAE,MAAM;gBACZ,QAAQ,EAAE,MAAM;aAChB;SACD;KACD;IAGD;QACC,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,mBAAmB;QACzB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;gBACrB,SAAS,EAAE,CAAC,KAAK,CAAC;aAClB;SACD;QACD,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,kBAAkB;gBAC/B,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,4CAA4C;gBACrD,WAAW,EAAE,sDAAsD;gBACnE,OAAO,EAAE;oBACR,IAAI,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,QAAQ,EAAE,QAAQ;qBAClB;iBACD;aACD;SACD;KACD;CACD,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commentDescription = void 0;
|
|
4
|
+
const shared_1 = require("./shared");
|
|
5
|
+
const add_1 = require("./add");
|
|
6
|
+
const list_1 = require("./list");
|
|
7
|
+
exports.commentDescription = [
|
|
8
|
+
{
|
|
9
|
+
displayName: 'Operation',
|
|
10
|
+
name: 'operation',
|
|
11
|
+
type: 'options',
|
|
12
|
+
displayOptions: {
|
|
13
|
+
show: {
|
|
14
|
+
resource: ['comment'],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'Add',
|
|
20
|
+
value: 'add',
|
|
21
|
+
description: 'Add a comment to an issue',
|
|
22
|
+
action: 'Add a comment',
|
|
23
|
+
routing: {
|
|
24
|
+
request: {
|
|
25
|
+
method: 'POST',
|
|
26
|
+
url: '=/issues/{{$parameter.issueId}}/comments',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Get Many',
|
|
32
|
+
value: 'list',
|
|
33
|
+
description: 'Get many comments on an issue',
|
|
34
|
+
action: 'Get many comments',
|
|
35
|
+
routing: {
|
|
36
|
+
request: {
|
|
37
|
+
method: 'GET',
|
|
38
|
+
url: '=/issues/{{$parameter.issueId}}/comments',
|
|
39
|
+
qs: {
|
|
40
|
+
fields: 'id,text,created,updated,author(login,name)',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
default: 'add',
|
|
47
|
+
noDataExpression: true,
|
|
48
|
+
},
|
|
49
|
+
...shared_1.commentSharedDescription,
|
|
50
|
+
...add_1.commentAddDescription,
|
|
51
|
+
...list_1.commentListDescription,
|
|
52
|
+
];
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/YouTrack/resources/comment/index.ts"],"names":[],"mappings":";;;AAEA,qCAAoD;AACpD,+BAA8C;AAC9C,iCAAgD;AAEnC,QAAA,kBAAkB,GAAsB;IACpD;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,SAAS,CAAC;aACrB;SACD;QACD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,2BAA2B;gBACxC,MAAM,EAAE,eAAe;gBACvB,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,0CAA0C;qBAC/C;iBACD;aACD;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,+BAA+B;gBAC5C,MAAM,EAAE,mBAAmB;gBAC3B,OAAO,EAAE;oBACR,OAAO,EAAE;wBACR,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,0CAA0C;wBAC/C,EAAE,EAAE;4BACH,MAAM,EAAE,4CAA4C;yBACpD;qBACD;iBACD;aACD;SACD;QACD,OAAO,EAAE,KAAK;QACd,gBAAgB,EAAE,IAAI;KACtB;IAED,GAAG,iCAAwB;IAC3B,GAAG,2BAAqB;IACxB,GAAG,6BAAsB;CACzB,CAAC"}
|