Skip to content

Commit e57f06d

Browse files
dw-itomiglarhip
andcommitted
Prepare initial release (#4)
* prepare Release base of the guideline from n8n * chore: remove unused icons and docs * feat: add create delete and stimulus operations * refactor: improve UX with alphabetical operations and sensible limit default * refactor: improve code structure and fix operation descriptions * Use list_operations instead of check_credentials * refactor: improve error handling and UX consistency --------- Co-authored-by: Lars Kaltefleiter <lars.kaltefleiter@itomig.de>
1 parent 54e70db commit e57f06d

34 files changed

+897
-1580
lines changed

CHANGELOG.md

Whitespace-only changes.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ITOMIG GmbH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

credentials/GithubIssuesApi.credentials.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

credentials/GithubIssuesOAuth2Api.credentials.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

credentials/ITopApi.credentials.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ import type {
33
ICredentialTestRequest,
44
ICredentialType,
55
INodeProperties,
6+
Icon,
67
} from 'n8n-workflow';
78

89
export class ITopApi implements ICredentialType {
910
name = 'iTopApi';
1011

1112
displayName = 'iTop API';
1213

14+
icon: Icon = {
15+
light: 'file:../nodes/ITop/icons/itop.svg',
16+
dark: 'file:../nodes/ITop/icons/itop-dark.svg',
17+
};
18+
1319
documentationUrl = 'https://www.itophub.io/wiki/page?id=latest:advancedtopics:rest_json';
1420

1521
properties: INodeProperties[] = [
@@ -60,7 +66,7 @@ export class ITopApi implements ICredentialType {
6066
'Content-Type': 'application/x-www-form-urlencoded',
6167
},
6268
body: {
63-
json_data: '={{ JSON.stringify({ operation: "core/check_credentials" }) }}',
69+
json_data: '={{ JSON.stringify({ operation: "list_operations" }) }}',
6470
auth_user: '={{$credentials.username}}',
6571
auth_pwd: '={{$credentials.password}}',
6672
},
@@ -69,11 +75,19 @@ export class ITopApi implements ICredentialType {
6975
{
7076
type: 'responseSuccessBody',
7177
properties: {
72-
key: 'authorized',
73-
value: true,
74-
message: 'Authentication failed. Please check your username and password.',
78+
key: 'code',
79+
value: 1,
80+
message: 'Authentication failed. Missing/wrong credentials or the user does not have enough rights to perform the requested operation.',
7581
},
7682
},
83+
{
84+
type: 'responseSuccessBody',
85+
properties: {
86+
key: 'code',
87+
value: 100,
88+
message: 'Request failed. Internal iTop Error.',
89+
},
90+
}
7791
],
7892
};
7993
}

credentials/ITopTokenApi.credentials.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,19 @@ import type {
33
ICredentialTestRequest,
44
ICredentialType,
55
INodeProperties,
6+
Icon,
67
} from 'n8n-workflow';
78

89
export class ITopTokenApi implements ICredentialType {
910
name = 'iTopTokenApi';
1011

1112
displayName = 'iTop Token API';
1213

14+
icon: Icon = {
15+
light: 'file:../nodes/ITop/icons/itop.svg',
16+
dark: 'file:../nodes/ITop/icons/itop-dark.svg',
17+
};
18+
1319
documentationUrl = 'https://www.itophub.io/wiki/page?id=latest:advancedtopics:rest_json';
1420

1521
properties: INodeProperties[] = [
@@ -54,19 +60,27 @@ export class ITopTokenApi implements ICredentialType {
5460
'Content-Type': 'application/x-www-form-urlencoded',
5561
},
5662
body: {
57-
json_data: '={{ JSON.stringify({ operation: "core/check_credentials" }) }}',
63+
json_data: '={{ JSON.stringify({ operation: "list_operations" }) }}',
5864
auth_token: '={{$credentials.authToken}}',
5965
},
6066
},
6167
rules: [
6268
{
6369
type: 'responseSuccessBody',
6470
properties: {
65-
key: 'authorized',
66-
value: true,
67-
message: 'Authentication failed. Please check your token.',
71+
key: 'code',
72+
value: 1,
73+
message: 'Authentication failed. Missing/wrong credentials or the user does not have enough rights to perform the requested operation.',
6874
},
6975
},
76+
{
77+
type: 'responseSuccessBody',
78+
properties: {
79+
key: 'code',
80+
value: 100,
81+
message: 'Request failed. Internal iTop Error.',
82+
},
83+
}
7084
],
7185
};
7286
}

icons/github.dark.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

icons/github.svg

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)