@skriptfabrik/n8n-nodes-clockify-enhanced 0.3.0 → 0.4.0
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/README.md +2 -0
- package/package.json +1 -1
- package/src/nodes/ClockifyEnhanced/ClockifyEnhanced.node.d.ts +6 -7
- package/src/nodes/ClockifyEnhanced/ClockifyEnhanced.node.js +113 -15
- package/src/nodes/ClockifyEnhanced/ClockifyEnhanced.node.js.map +1 -1
- package/src/nodes/ClockifyEnhanced/descriptions/ProjectMembershipsDescription.js +67 -11
- package/src/nodes/ClockifyEnhanced/descriptions/ProjectMembershipsDescription.js.map +1 -1
package/README.md
CHANGED
|
@@ -38,6 +38,8 @@ It supports these operations:
|
|
|
38
38
|
- Register a webhook in the API which will call the trigger node on configured event
|
|
39
39
|
- Update a project with the given ID
|
|
40
40
|
- Patch the memberships of a project with the given ID
|
|
41
|
+
- Add members to a project with the given ID
|
|
42
|
+
- Remove members from a project with the given ID
|
|
41
43
|
|
|
42
44
|
## Credentials
|
|
43
45
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type IExecuteFunctions, type ILoadOptionsFunctions, type INodeExecutionData, type INodePropertyOptions, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
2
|
export declare class ClockifyEnhanced implements INodeType {
|
|
3
3
|
description: INodeTypeDescription;
|
|
4
4
|
methods: {
|
|
5
5
|
loadOptions: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
loadCustomFieldsForWorkspace(this: import("n8n-workflow").ILoadOptionsFunctions): Promise<import("n8n-workflow").INodePropertyOptions[]>;
|
|
6
|
+
loadWorkspaces(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
loadProjects(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
loadUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
loadNonProjectUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
10
|
+
loadProjectUsers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
11
|
};
|
|
13
12
|
};
|
|
14
13
|
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const GenericFunctions_1 = require("n8n-nodes-base/dist/nodes/Clockify/GenericFunctions");
|
|
6
6
|
const ProjectDescription_1 = require("./descriptions/ProjectDescription");
|
|
7
7
|
const ProjectMembershipsDescription_1 = require("./descriptions/ProjectMembershipsDescription");
|
|
8
|
-
const Clockify_node_1 = require("n8n-nodes-base/dist/nodes/Clockify/Clockify.node");
|
|
9
8
|
class ClockifyEnhanced {
|
|
10
9
|
constructor() {
|
|
11
10
|
this.description = {
|
|
@@ -39,8 +38,8 @@ class ClockifyEnhanced {
|
|
|
39
38
|
value: 'project',
|
|
40
39
|
},
|
|
41
40
|
{
|
|
42
|
-
name: '
|
|
43
|
-
value: '
|
|
41
|
+
name: 'Project Membership',
|
|
42
|
+
value: 'project membership',
|
|
44
43
|
},
|
|
45
44
|
],
|
|
46
45
|
default: 'project',
|
|
@@ -51,23 +50,110 @@ class ClockifyEnhanced {
|
|
|
51
50
|
displayName: 'Workspace Name or ID',
|
|
52
51
|
name: 'workspaceId',
|
|
53
52
|
type: 'options',
|
|
54
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
55
53
|
typeOptions: {
|
|
56
|
-
loadOptionsMethod: '
|
|
54
|
+
loadOptionsMethod: 'loadWorkspaces',
|
|
57
55
|
},
|
|
58
|
-
required: true,
|
|
59
56
|
default: '',
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
57
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
58
|
+
required: true,
|
|
59
|
+
requiresDataPath: 'single',
|
|
60
|
+
validateType: 'string',
|
|
65
61
|
},
|
|
66
62
|
...ProjectDescription_1.projectFields,
|
|
67
63
|
...ProjectMembershipsDescription_1.projectMembershipFields,
|
|
68
64
|
],
|
|
69
65
|
};
|
|
70
|
-
this.methods =
|
|
66
|
+
this.methods = {
|
|
67
|
+
loadOptions: {
|
|
68
|
+
loadWorkspaces() {
|
|
69
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
const workspaces = yield GenericFunctions_1.clockifyApiRequest.call(this, 'GET', 'workspaces');
|
|
71
|
+
if (!workspaces) {
|
|
72
|
+
return [];
|
|
73
|
+
}
|
|
74
|
+
return workspaces.map((value) => ({
|
|
75
|
+
name: value.name,
|
|
76
|
+
value: value.id,
|
|
77
|
+
}));
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
loadProjects() {
|
|
81
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
83
|
+
if (!workspaceId) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const projects = yield GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `workspaces/${workspaceId}/projects`);
|
|
87
|
+
if (!projects) {
|
|
88
|
+
return [];
|
|
89
|
+
}
|
|
90
|
+
return projects.map((project) => ({
|
|
91
|
+
name: project.name,
|
|
92
|
+
value: project.id,
|
|
93
|
+
}));
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
loadUsers() {
|
|
97
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
99
|
+
if (!workspaceId) {
|
|
100
|
+
return [];
|
|
101
|
+
}
|
|
102
|
+
const users = yield GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `workspaces/${workspaceId}/users`);
|
|
103
|
+
if (!users) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
return users.map((value) => ({
|
|
107
|
+
name: value.name,
|
|
108
|
+
value: value.id,
|
|
109
|
+
}));
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
loadNonProjectUsers() {
|
|
113
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
115
|
+
const projectId = this.getCurrentNodeParameter('projectId');
|
|
116
|
+
if (!workspaceId || !projectId) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
const users = yield GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `workspaces/${workspaceId}/users`, undefined, {
|
|
120
|
+
memberships: 'PROJECT',
|
|
121
|
+
});
|
|
122
|
+
if (!users) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
return users
|
|
126
|
+
.filter((user) => {
|
|
127
|
+
const memberships = user.memberships.filter((membership) => membership.targetId === projectId);
|
|
128
|
+
return memberships.length <= 0;
|
|
129
|
+
})
|
|
130
|
+
.map((user) => ({
|
|
131
|
+
name: user.name,
|
|
132
|
+
value: user.id,
|
|
133
|
+
}));
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
loadProjectUsers() {
|
|
137
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
138
|
+
const workspaceId = this.getCurrentNodeParameter('workspaceId');
|
|
139
|
+
const projectId = this.getCurrentNodeParameter('projectId');
|
|
140
|
+
if (!workspaceId || !projectId) {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
const users = yield GenericFunctions_1.clockifyApiRequestAllItems.call(this, 'GET', `workspaces/${workspaceId}/users`, undefined, {
|
|
144
|
+
projectId,
|
|
145
|
+
});
|
|
146
|
+
if (!users) {
|
|
147
|
+
return [];
|
|
148
|
+
}
|
|
149
|
+
return users.map((user) => ({
|
|
150
|
+
name: user.name,
|
|
151
|
+
value: user.id,
|
|
152
|
+
}));
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
};
|
|
71
157
|
}
|
|
72
158
|
execute() {
|
|
73
159
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -86,15 +172,27 @@ class ClockifyEnhanced {
|
|
|
86
172
|
responseData = yield GenericFunctions_1.clockifyApiRequest.call(this, 'PUT', `/workspaces/${workspaceId}/projects/${projectId}`, updateFields);
|
|
87
173
|
}
|
|
88
174
|
}
|
|
89
|
-
if (resource === '
|
|
175
|
+
if (resource === 'project membership') {
|
|
176
|
+
const workspaceId = this.getNodeParameter('workspaceId', item);
|
|
177
|
+
const projectId = this.getNodeParameter('projectId', item);
|
|
90
178
|
if (operation === 'patch') {
|
|
91
|
-
const workspaceId = this.getNodeParameter('workspaceId', item);
|
|
92
|
-
const projectId = this.getNodeParameter('projectId', item);
|
|
93
179
|
const memberships = this.getNodeParameter('memberships', item).map((membership) => ({ userId: membership }));
|
|
94
180
|
responseData = yield GenericFunctions_1.clockifyApiRequest.call(this, 'PATCH', `/workspaces/${workspaceId}/projects/${projectId}/memberships`, {
|
|
95
181
|
memberships,
|
|
96
182
|
});
|
|
97
183
|
}
|
|
184
|
+
if (operation === 'assign') {
|
|
185
|
+
responseData = yield GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/projects/${projectId}/memberships`, {
|
|
186
|
+
remove: false,
|
|
187
|
+
userIds: this.getNodeParameter('userIdsToAssign', item),
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
if (operation === 'remove') {
|
|
191
|
+
responseData = yield GenericFunctions_1.clockifyApiRequest.call(this, 'POST', `/workspaces/${workspaceId}/projects/${projectId}/memberships`, {
|
|
192
|
+
remove: true,
|
|
193
|
+
userIds: this.getNodeParameter('userIdsToRemove', item),
|
|
194
|
+
});
|
|
195
|
+
}
|
|
98
196
|
}
|
|
99
197
|
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item } });
|
|
100
198
|
returnData.push(...executionData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClockifyEnhanced.node.js","sourceRoot":"","sources":["../../../../../../nodes/clockify-enhanced/src/nodes/ClockifyEnhanced/ClockifyEnhanced.node.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"ClockifyEnhanced.node.js","sourceRoot":"","sources":["../../../../../../nodes/clockify-enhanced/src/nodes/ClockifyEnhanced/ClockifyEnhanced.node.ts"],"names":[],"mappings":";;;;AAWA,0FAG6D;AAe7D,0EAG2C;AAE3C,gGAGsD;AAEtD,MAAa,gBAAgB;IAA7B;QACE,gBAAW,GAAyB;YAClC,WAAW,EAAE,mBAAmB;YAEhC,IAAI,EAAE,kBAAkB;YAExB,IAAI,EAAE,kCAAkC;YAExC,KAAK,EAAE,CAAC,WAAW,CAAC;YAEpB,OAAO,EAAE,CAAC;YAEV,QAAQ,EAAE,8DAA8D;YAExE,WAAW,EAAE,2BAA2B;YAExC,QAAQ,EAAE;gBACR,IAAI,EAAE,mBAAmB;aAC1B;YAED,MAAM,EAAE,CAAC,MAAM,CAAC;YAEhB,OAAO,EAAE,CAAC,MAAM,CAAC;YAEjB,WAAW,EAAE;gBACX;oBACE,IAAI,EAAE,aAAa;oBACnB,QAAQ,EAAE,IAAI;iBACf;aACF;YAED,UAAU,EAAE;gBACV;oBACE,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,gBAAgB,EAAE,IAAI;oBACtB,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,SAAS;yBACjB;wBACD;4BACE,IAAI,EAAE,oBAAoB;4BAC1B,KAAK,EAAE,oBAAoB;yBAC5B;qBACF;oBACD,OAAO,EAAE,SAAS;iBACnB;gBACD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,CAAC;KAAA;CACF;AAhUD,4CAgUC"}
|
|
@@ -9,15 +9,27 @@ exports.projectMembershipOperations = [
|
|
|
9
9
|
noDataExpression: true,
|
|
10
10
|
displayOptions: {
|
|
11
11
|
show: {
|
|
12
|
-
resource: ['
|
|
12
|
+
resource: ['project membership'],
|
|
13
13
|
},
|
|
14
14
|
},
|
|
15
15
|
options: [
|
|
16
16
|
{
|
|
17
17
|
name: 'Patch',
|
|
18
18
|
value: 'patch',
|
|
19
|
-
description: '
|
|
20
|
-
action: '
|
|
19
|
+
description: 'Patch the project membership',
|
|
20
|
+
action: 'Patch the project membership',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'Assign',
|
|
24
|
+
value: 'assign',
|
|
25
|
+
description: 'Assign users to a project',
|
|
26
|
+
action: 'Assign users to a project',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'Remove',
|
|
30
|
+
value: 'remove',
|
|
31
|
+
description: 'Remove users from a project',
|
|
32
|
+
action: 'Remove users from a project',
|
|
21
33
|
},
|
|
22
34
|
],
|
|
23
35
|
default: 'patch',
|
|
@@ -31,36 +43,80 @@ exports.projectMembershipFields = [
|
|
|
31
43
|
displayName: 'Project Name or ID',
|
|
32
44
|
name: 'projectId',
|
|
33
45
|
type: 'options',
|
|
34
|
-
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
35
46
|
typeOptions: {
|
|
36
47
|
loadOptionsDependsOn: ['workspaceId'],
|
|
37
|
-
loadOptionsMethod: '
|
|
48
|
+
loadOptionsMethod: 'loadProjects',
|
|
38
49
|
},
|
|
39
|
-
required: true,
|
|
40
50
|
default: '',
|
|
51
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
41
52
|
displayOptions: {
|
|
42
53
|
show: {
|
|
43
|
-
operation: ['patch'],
|
|
44
|
-
resource: ['
|
|
54
|
+
operation: ['patch', 'assign', 'remove'],
|
|
55
|
+
resource: ['project membership'],
|
|
45
56
|
},
|
|
46
57
|
},
|
|
58
|
+
required: true,
|
|
59
|
+
requiresDataPath: 'single',
|
|
60
|
+
validateType: 'string',
|
|
47
61
|
},
|
|
48
62
|
{
|
|
49
63
|
displayName: 'User Names or IDs',
|
|
50
64
|
name: 'memberships',
|
|
51
65
|
type: 'multiOptions',
|
|
52
|
-
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
53
66
|
typeOptions: {
|
|
54
67
|
loadOptionsDependsOn: ['workspaceId'],
|
|
55
|
-
loadOptionsMethod: '
|
|
68
|
+
loadOptionsMethod: 'loadUsers',
|
|
56
69
|
},
|
|
57
70
|
default: [],
|
|
71
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
58
72
|
displayOptions: {
|
|
59
73
|
show: {
|
|
60
74
|
operation: ['patch'],
|
|
61
|
-
resource: ['
|
|
75
|
+
resource: ['project membership'],
|
|
62
76
|
},
|
|
63
77
|
},
|
|
78
|
+
requiresDataPath: 'multiple',
|
|
79
|
+
validateType: 'array',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'User Names or IDs',
|
|
83
|
+
name: 'userIdsToAssign',
|
|
84
|
+
type: 'multiOptions',
|
|
85
|
+
typeOptions: {
|
|
86
|
+
loadOptionsDependsOn: ['workspaceId', 'projectId'],
|
|
87
|
+
loadOptionsMethod: 'loadNonProjectUsers',
|
|
88
|
+
},
|
|
89
|
+
default: [],
|
|
90
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
91
|
+
displayOptions: {
|
|
92
|
+
show: {
|
|
93
|
+
operation: ['assign'],
|
|
94
|
+
resource: ['project membership'],
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
required: true,
|
|
98
|
+
requiresDataPath: 'multiple',
|
|
99
|
+
validateType: 'array',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
displayName: 'User Names or IDs',
|
|
103
|
+
name: 'userIdsToRemove',
|
|
104
|
+
type: 'multiOptions',
|
|
105
|
+
typeOptions: {
|
|
106
|
+
loadOptionsDependsOn: ['workspaceId', 'projectId'],
|
|
107
|
+
loadOptionsMethod: 'loadProjectUsers',
|
|
108
|
+
},
|
|
109
|
+
default: [],
|
|
110
|
+
description: 'Choose from the list, or specify IDs using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>',
|
|
111
|
+
displayOptions: {
|
|
112
|
+
show: {
|
|
113
|
+
operation: ['remove'],
|
|
114
|
+
resource: ['project membership'],
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
required: true,
|
|
118
|
+
requiresDataPath: 'multiple',
|
|
119
|
+
validateType: 'array',
|
|
64
120
|
},
|
|
65
121
|
];
|
|
66
122
|
//# sourceMappingURL=ProjectMembershipsDescription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectMembershipsDescription.js","sourceRoot":"","sources":["../../../../../../../nodes/clockify-enhanced/src/nodes/ClockifyEnhanced/descriptions/ProjectMembershipsDescription.ts"],"names":[],"mappings":";;;AAEa,QAAA,2BAA2B,GAAsB;IAC5D;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACd,IAAI,EAAE;gBACJ,QAAQ,EAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"ProjectMembershipsDescription.js","sourceRoot":"","sources":["../../../../../../../nodes/clockify-enhanced/src/nodes/ClockifyEnhanced/descriptions/ProjectMembershipsDescription.ts"],"names":[],"mappings":";;;AAEa,QAAA,2BAA2B,GAAsB;IAC5D;QACE,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IA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