@justbrunasso/n8n-nodes-glpi-v2 1.0.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/.github/workflows/ci.yml +28 -0
- package/.prettierrc.js +51 -0
- package/.vscode/extensions.json +7 -0
- package/.vscode/launch.json +12 -0
- package/CHANGELOG.md +0 -0
- package/CODE_OF_CONDUCT.md +76 -0
- package/LICENSE.md +19 -0
- package/README.md +247 -0
- package/README_TEMPLATE.md +48 -0
- package/api_docs.json +1 -0
- package/credentials/GithubIssuesApi.credentials.ts +45 -0
- package/credentials/GithubIssuesOAuth2Api.credentials.ts +54 -0
- package/eslint.config.mjs +3 -0
- package/icons/github.dark.svg +3 -0
- package/icons/github.svg +3 -0
- package/nodes/Example/Example.node.json +18 -0
- package/nodes/Example/Example.node.ts +78 -0
- package/nodes/Example/example.dark.svg +13 -0
- package/nodes/Example/example.svg +13 -0
- package/nodes/GithubIssues/GithubIssues.node.json +18 -0
- package/nodes/GithubIssues/GithubIssues.node.ts +96 -0
- package/nodes/GithubIssues/listSearch/getIssues.ts +49 -0
- package/nodes/GithubIssues/listSearch/getRepositories.ts +50 -0
- package/nodes/GithubIssues/listSearch/getUsers.ts +49 -0
- package/nodes/GithubIssues/resources/issue/create.ts +74 -0
- package/nodes/GithubIssues/resources/issue/get.ts +14 -0
- package/nodes/GithubIssues/resources/issue/getAll.ts +124 -0
- package/nodes/GithubIssues/resources/issue/index.ts +75 -0
- package/nodes/GithubIssues/resources/issueComment/getAll.ts +65 -0
- package/nodes/GithubIssues/resources/issueComment/index.ts +47 -0
- package/nodes/GithubIssues/shared/descriptions.ts +151 -0
- package/nodes/GithubIssues/shared/transport.ts +32 -0
- package/nodes/GithubIssues/shared/utils.ts +14 -0
- package/nodes/GlpiV2/GlpiV2.credentials.ts +76 -0
- package/nodes/GlpiV2/GlpiV2.node.ts +50 -0
- package/nodes/GlpiV2/GlpiV2.svg +5 -0
- package/nodes/GlpiV2/resources/computer/create.ts +43 -0
- package/nodes/GlpiV2/resources/computer/delete.ts +37 -0
- package/nodes/GlpiV2/resources/computer/get.ts +37 -0
- package/nodes/GlpiV2/resources/computer/getAll.ts +61 -0
- package/nodes/GlpiV2/resources/computer/index.ts +61 -0
- package/nodes/GlpiV2/resources/computer/update.ts +55 -0
- package/package.json +33 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export const computerDelete = {
|
|
4
|
+
routing: {
|
|
5
|
+
request: {
|
|
6
|
+
method: 'DELETE' as const,
|
|
7
|
+
url: '=/Computer/{{$parameter["id"]}}',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
properties: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Endpoint',
|
|
13
|
+
name: 'noticeDelete',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
default: 'DELETE /api.php/v2.1/Computer/{id}',
|
|
16
|
+
displayOptions: {
|
|
17
|
+
show: {
|
|
18
|
+
resource: ['computer'],
|
|
19
|
+
operation: ['delete'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as INodeProperties,
|
|
23
|
+
{
|
|
24
|
+
displayName: 'ID',
|
|
25
|
+
name: 'id',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '',
|
|
28
|
+
required: true,
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: {
|
|
31
|
+
resource: ['computer'],
|
|
32
|
+
operation: ['delete'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
} as INodeProperties,
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export const computerGet = {
|
|
4
|
+
routing: {
|
|
5
|
+
request: {
|
|
6
|
+
method: 'GET' as const,
|
|
7
|
+
url: '=/Computer/{{$parameter["id"]}}',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
properties: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Endpoint',
|
|
13
|
+
name: 'noticeGet',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
default: 'GET /api.php/v2.1/Computer/{id}',
|
|
16
|
+
displayOptions: {
|
|
17
|
+
show: {
|
|
18
|
+
resource: ['computer'],
|
|
19
|
+
operation: ['get'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as INodeProperties,
|
|
23
|
+
{
|
|
24
|
+
displayName: 'ID',
|
|
25
|
+
name: 'id',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '',
|
|
28
|
+
required: true,
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: {
|
|
31
|
+
resource: ['computer'],
|
|
32
|
+
operation: ['get'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
} as INodeProperties,
|
|
36
|
+
],
|
|
37
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export const computerGetAll = {
|
|
4
|
+
routing: {
|
|
5
|
+
request: {
|
|
6
|
+
method: 'GET' as const,
|
|
7
|
+
url: '/Computer',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
properties: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Endpoint',
|
|
13
|
+
name: 'noticeGetAll',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
default: 'GET /api.php/v2.1/Computer',
|
|
16
|
+
displayOptions: {
|
|
17
|
+
show: {
|
|
18
|
+
resource: ['computer'],
|
|
19
|
+
operation: ['getAll'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as INodeProperties,
|
|
23
|
+
{
|
|
24
|
+
displayName: 'Return All',
|
|
25
|
+
name: 'returnAll',
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
default: false,
|
|
28
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: {
|
|
31
|
+
resource: ['computer'],
|
|
32
|
+
operation: ['getAll'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
} as INodeProperties,
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Limit',
|
|
38
|
+
name: 'limit',
|
|
39
|
+
type: 'number',
|
|
40
|
+
default: 50,
|
|
41
|
+
description: 'Max number of results to return',
|
|
42
|
+
typeOptions: {
|
|
43
|
+
minValue: 1,
|
|
44
|
+
},
|
|
45
|
+
displayOptions: {
|
|
46
|
+
show: {
|
|
47
|
+
resource: ['computer'],
|
|
48
|
+
operation: ['getAll'],
|
|
49
|
+
returnAll: [false],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
routing: {
|
|
53
|
+
send: {
|
|
54
|
+
type: 'query',
|
|
55
|
+
property: 'range',
|
|
56
|
+
value: '={{ "0-" + ($parameter["limit"] - 1) }}',
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
} as INodeProperties,
|
|
60
|
+
],
|
|
61
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import { computerCreate } from './create';
|
|
3
|
+
import { computerGet } from './get';
|
|
4
|
+
import { computerUpdate } from './update';
|
|
5
|
+
import { computerDelete } from './delete';
|
|
6
|
+
import { computerGetAll } from './getAll';
|
|
7
|
+
|
|
8
|
+
export const computerOperations: INodeProperties[] = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Operation',
|
|
11
|
+
name: 'operation',
|
|
12
|
+
type: 'options',
|
|
13
|
+
noDataExpression: true,
|
|
14
|
+
displayOptions: {
|
|
15
|
+
show: {
|
|
16
|
+
resource: ['computer'],
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
options: [
|
|
20
|
+
{
|
|
21
|
+
name: 'Create',
|
|
22
|
+
value: 'create',
|
|
23
|
+
action: 'Create a computer',
|
|
24
|
+
routing: computerCreate.routing,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Delete',
|
|
28
|
+
value: 'delete',
|
|
29
|
+
action: 'Delete a computer',
|
|
30
|
+
routing: computerDelete.routing,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Get',
|
|
34
|
+
value: 'get',
|
|
35
|
+
action: 'Get a computer',
|
|
36
|
+
routing: computerGet.routing,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'Get Many',
|
|
40
|
+
value: 'getAll',
|
|
41
|
+
action: 'Get many computers',
|
|
42
|
+
routing: computerGetAll.routing,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Update',
|
|
46
|
+
value: 'update',
|
|
47
|
+
action: 'Update a computer',
|
|
48
|
+
routing: computerUpdate.routing,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
default: 'create',
|
|
52
|
+
},
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
export const computerFields: INodeProperties[] = [
|
|
56
|
+
...computerCreate.properties,
|
|
57
|
+
...computerDelete.properties,
|
|
58
|
+
...computerGet.properties,
|
|
59
|
+
...computerGetAll.properties,
|
|
60
|
+
...computerUpdate.properties,
|
|
61
|
+
];
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
|
|
3
|
+
export const computerUpdate = {
|
|
4
|
+
routing: {
|
|
5
|
+
request: {
|
|
6
|
+
method: 'PUT' as const,
|
|
7
|
+
url: '=/Computer/{{$parameter["id"]}}',
|
|
8
|
+
},
|
|
9
|
+
},
|
|
10
|
+
properties: [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'API Endpoint',
|
|
13
|
+
name: 'noticeUpdate',
|
|
14
|
+
type: 'notice',
|
|
15
|
+
default: 'PUT /api.php/v2.1/Computer/{id}',
|
|
16
|
+
displayOptions: {
|
|
17
|
+
show: {
|
|
18
|
+
resource: ['computer'],
|
|
19
|
+
operation: ['update'],
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
} as INodeProperties,
|
|
23
|
+
{
|
|
24
|
+
displayName: 'ID',
|
|
25
|
+
name: 'id',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: '',
|
|
28
|
+
required: true,
|
|
29
|
+
displayOptions: {
|
|
30
|
+
show: {
|
|
31
|
+
resource: ['computer'],
|
|
32
|
+
operation: ['update'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
} as INodeProperties,
|
|
36
|
+
{
|
|
37
|
+
displayName: 'Name',
|
|
38
|
+
name: 'name',
|
|
39
|
+
type: 'string',
|
|
40
|
+
default: '',
|
|
41
|
+
displayOptions: {
|
|
42
|
+
show: {
|
|
43
|
+
resource: ['computer'],
|
|
44
|
+
operation: ['update'],
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
routing: {
|
|
48
|
+
send: {
|
|
49
|
+
type: 'body',
|
|
50
|
+
property: 'name',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
} as INodeProperties,
|
|
54
|
+
],
|
|
55
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@justbrunasso/n8n-nodes-glpi-v2",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "n8n node for GLPI v2 API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package"
|
|
7
|
+
],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"n8n": {
|
|
10
|
+
"nodes": [
|
|
11
|
+
"dist/nodes/GlpiV2/GlpiV2.node.js"
|
|
12
|
+
],
|
|
13
|
+
"credentials": [
|
|
14
|
+
"dist/nodes/GlpiV2/GlpiV2.credentials.js"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "tsc --watch",
|
|
20
|
+
"lint": "eslint nodes credentials",
|
|
21
|
+
"prepublishOnly": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"eslint": "^8.0.0",
|
|
25
|
+
"gulp": "^4.0.2",
|
|
26
|
+
"n8n-workflow": "*",
|
|
27
|
+
"n8n-core": "*",
|
|
28
|
+
"typescript": "^5.0.0"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"n8n-workflow": "*"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"rootDirs": ["nodes", "credentials"],
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"target": "ES2019",
|
|
6
|
+
"module": "commonjs",
|
|
7
|
+
"lib": ["ES2019", "DOM"],
|
|
8
|
+
"removeComments": true,
|
|
9
|
+
"preserveConstEnums": true,
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"esModuleInterop": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["nodes/**/*", "credentials/**/*"],
|
|
15
|
+
"exclude": ["node_modules", "dist"]
|
|
16
|
+
}
|