Skip to content

Commit e7de34f

Browse files
dw-itomiglarhip
andauthored
Fixed n8n feedback (#6)
* N8N Feedback: Remove authenticate option from credentials ITopApi.credentials.ts#L55 - This should be used to prevent issues when trying to use the credential with a http request node. If you are not using this please remove it. * N8N Feedback: Resources are missing ITop.node.ts#L55 - Resources are missing, Nodes should have Resources and Operations. * N8N Feedback: Remove IAuthenticateGeneric import. --------- Co-authored-by: Lars Kaltefleiter <lars.kaltefleiter@itomig.de>
1 parent 59bb1cd commit e7de34f

File tree

8 files changed

+43
-13
lines changed

8 files changed

+43
-13
lines changed

credentials/ITopApi.credentials.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type {
2-
IAuthenticateGeneric,
32
ICredentialTestRequest,
43
ICredentialType,
54
INodeProperties,
@@ -52,11 +51,6 @@ export class ITopApi implements ICredentialType {
5251
},
5352
];
5453

55-
authenticate: IAuthenticateGeneric = {
56-
type: 'generic',
57-
properties: {},
58-
};
59-
6054
test: ICredentialTestRequest = {
6155
request: {
6256
baseURL: '={{$credentials.url}}/webservices/rest.php',

credentials/ITopTokenApi.credentials.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import type {
2-
IAuthenticateGeneric,
32
ICredentialTestRequest,
43
ICredentialType,
54
INodeProperties,
@@ -46,11 +45,6 @@ export class ITopTokenApi implements ICredentialType {
4645
},
4746
];
4847

49-
authenticate: IAuthenticateGeneric = {
50-
type: 'generic',
51-
properties: {},
52-
};
53-
5448
test: ICredentialTestRequest = {
5549
request: {
5650
baseURL: '={{$credentials.url}}/webservices/rest.php',

nodes/ITop/ITop.node.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class ITop implements INodeType {
2424
},
2525
group: ['transform'],
2626
version: 1,
27-
subtitle: '={{$parameter["operation"]}}',
27+
subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}',
2828
description: 'Interact with iTop CMDB via REST API',
2929
usableAsTool: true,
3030
defaults: {
@@ -69,11 +69,29 @@ export class ITop implements INodeType {
6969
],
7070
default: 'credentials',
7171
},
72+
{
73+
displayName: 'Resource',
74+
name: 'resource',
75+
type: 'options',
76+
noDataExpression: true,
77+
options: [
78+
{
79+
name: 'Object',
80+
value: 'object',
81+
},
82+
],
83+
default: 'object',
84+
},
7285
{
7386
displayName: 'Operation',
7487
name: 'operation',
7588
type: 'options',
7689
noDataExpression: true,
90+
displayOptions: {
91+
show: {
92+
resource: ['object'],
93+
},
94+
},
7795
options: [
7896
{
7997
name: 'Apply Stimulus',

nodes/ITop/operations/apply_stimulus.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const applyStimulusFields: INodeProperties[] = [
66
...classNameField,
77
displayOptions: {
88
show: {
9+
resource: ['object'],
910
operation: ['apply_stimulus'],
1011
},
1112
},
@@ -15,6 +16,7 @@ export const applyStimulusFields: INodeProperties[] = [
1516
description: 'Object identifier: numeric ID or search criteria. Must uniquely identify one object.',
1617
displayOptions: {
1718
show: {
19+
resource: ['object'],
1820
operation: ['apply_stimulus'],
1921
},
2022
},
@@ -28,6 +30,7 @@ export const applyStimulusFields: INodeProperties[] = [
2830
description: 'The stimulus to apply (e.g. ev_assign)',
2931
displayOptions: {
3032
show: {
33+
resource: ['object'],
3134
operation: ['apply_stimulus'],
3235
},
3336
},
@@ -43,6 +46,7 @@ export const applyStimulusFields: INodeProperties[] = [
4346
default: {},
4447
displayOptions: {
4548
show: {
49+
resource: ['object'],
4650
operation: ['apply_stimulus'],
4751
},
4852
},
@@ -74,6 +78,7 @@ export const applyStimulusFields: INodeProperties[] = [
7478
...outputFieldsField,
7579
displayOptions: {
7680
show: {
81+
resource: ['object'],
7782
operation: ['apply_stimulus'],
7883
},
7984
},
@@ -82,6 +87,7 @@ export const applyStimulusFields: INodeProperties[] = [
8287
...commentField,
8388
displayOptions: {
8489
show: {
90+
resource: ['object'],
8591
operation: ['apply_stimulus'],
8692
},
8793
},

nodes/ITop/operations/create.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const createFields: INodeProperties[] = [
66
...classNameField,
77
displayOptions: {
88
show: {
9+
resource: ['object'],
910
operation: ['create'],
1011
},
1112
},
@@ -22,6 +23,7 @@ export const createFields: INodeProperties[] = [
2223
required: true,
2324
displayOptions: {
2425
show: {
26+
resource: ['object'],
2527
operation: ['create'],
2628
},
2729
},
@@ -53,6 +55,7 @@ export const createFields: INodeProperties[] = [
5355
...outputFieldsField,
5456
displayOptions: {
5557
show: {
58+
resource: ['object'],
5659
operation: ['create'],
5760
},
5861
},
@@ -61,6 +64,7 @@ export const createFields: INodeProperties[] = [
6164
...commentField,
6265
displayOptions: {
6366
show: {
67+
resource: ['object'],
6468
operation: ['create'],
6569
},
6670
},

nodes/ITop/operations/delete.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const deleteFields: INodeProperties[] = [
66
...classNameField,
77
displayOptions: {
88
show: {
9+
resource: ['object'],
910
operation: ['delete'],
1011
},
1112
},
@@ -15,6 +16,7 @@ export const deleteFields: INodeProperties[] = [
1516
description: 'The key or ID of the object to delete. Must uniquely identify one object.',
1617
displayOptions: {
1718
show: {
19+
resource: ['object'],
1820
operation: ['delete'],
1921
},
2022
},
@@ -23,6 +25,7 @@ export const deleteFields: INodeProperties[] = [
2325
...commentField,
2426
displayOptions: {
2527
show: {
28+
resource: ['object'],
2629
operation: ['delete'],
2730
},
2831
},

nodes/ITop/operations/get.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const getFields: INodeProperties[] = [
66
...classNameField,
77
displayOptions: {
88
show: {
9+
resource: ['object'],
910
operation: ['get'],
1011
},
1112
},
@@ -14,6 +15,7 @@ export const getFields: INodeProperties[] = [
1415
...keyField,
1516
displayOptions: {
1617
show: {
18+
resource: ['object'],
1719
operation: ['get'],
1820
},
1921
},
@@ -22,6 +24,7 @@ export const getFields: INodeProperties[] = [
2224
...outputFieldsField,
2325
displayOptions: {
2426
show: {
27+
resource: ['object'],
2528
operation: ['get'],
2629
},
2730
},
@@ -30,6 +33,7 @@ export const getFields: INodeProperties[] = [
3033
...limitField,
3134
displayOptions: {
3235
show: {
36+
resource: ['object'],
3337
operation: ['get'],
3438
},
3539
},
@@ -42,6 +46,7 @@ export const getFields: INodeProperties[] = [
4246
default: {},
4347
displayOptions: {
4448
show: {
49+
resource: ['object'],
4550
operation: ['get'],
4651
},
4752
},

nodes/ITop/operations/update.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export const updateFields: INodeProperties[] = [
66
...classNameField,
77
displayOptions: {
88
show: {
9+
resource: ['object'],
910
operation: ['update'],
1011
},
1112
},
@@ -15,6 +16,7 @@ export const updateFields: INodeProperties[] = [
1516
description: 'Object identifier: numeric ID or search criteria. Note: Key must identify exactly ONE object, bulk updates are not supported.',
1617
displayOptions: {
1718
show: {
19+
resource: ['object'],
1820
operation: ['update'],
1921
},
2022
},
@@ -31,6 +33,7 @@ export const updateFields: INodeProperties[] = [
3133
required: true,
3234
displayOptions: {
3335
show: {
36+
resource: ['object'],
3437
operation: ['update'],
3538
},
3639
},
@@ -62,6 +65,7 @@ export const updateFields: INodeProperties[] = [
6265
...outputFieldsField,
6366
displayOptions: {
6467
show: {
68+
resource: ['object'],
6569
operation: ['update'],
6670
},
6771
},
@@ -70,6 +74,7 @@ export const updateFields: INodeProperties[] = [
7074
...commentField,
7175
displayOptions: {
7276
show: {
77+
resource: ['object'],
7378
operation: ['update'],
7479
},
7580
},
@@ -82,6 +87,7 @@ export const updateFields: INodeProperties[] = [
8287
default: {},
8388
displayOptions: {
8489
show: {
90+
resource: ['object'],
8591
operation: ['update'],
8692
},
8793
},

0 commit comments

Comments
 (0)