@justbrunasso/n8n-nodes-glpi-v2 1.0.0 → 1.0.2
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 +21 -0
- package/dist/credentials/GithubIssuesApi.credentials.js +37 -0
- package/dist/credentials/GithubIssuesApi.credentials.js.map +1 -0
- package/dist/credentials/GithubIssuesOAuth2Api.credentials.js +54 -0
- package/dist/credentials/GithubIssuesOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/Example/Example.node.js +61 -0
- package/dist/nodes/Example/Example.node.js.map +1 -0
- package/dist/nodes/GithubIssues/GithubIssues.node.js +101 -0
- package/dist/nodes/GithubIssues/GithubIssues.node.js.map +1 -0
- package/dist/nodes/GithubIssues/listSearch/getIssues.js +28 -0
- package/dist/nodes/GithubIssues/listSearch/getIssues.js.map +1 -0
- package/dist/nodes/GithubIssues/listSearch/getRepositories.js +31 -0
- package/dist/nodes/GithubIssues/listSearch/getRepositories.js.map +1 -0
- package/dist/nodes/GithubIssues/listSearch/getUsers.js +29 -0
- package/dist/nodes/GithubIssues/listSearch/getUsers.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issue/create.js +75 -0
- package/dist/nodes/GithubIssues/resources/issue/create.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issue/get.js +15 -0
- package/dist/nodes/GithubIssues/resources/issue/get.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issue/getAll.js +125 -0
- package/dist/nodes/GithubIssues/resources/issue/getAll.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issue/index.js +76 -0
- package/dist/nodes/GithubIssues/resources/issue/index.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issueComment/getAll.js +66 -0
- package/dist/nodes/GithubIssues/resources/issueComment/getAll.js.map +1 -0
- package/dist/nodes/GithubIssues/resources/issueComment/index.js +48 -0
- package/dist/nodes/GithubIssues/resources/issueComment/index.js.map +1 -0
- package/dist/nodes/GithubIssues/shared/descriptions.js +151 -0
- package/dist/nodes/GithubIssues/shared/descriptions.js.map +1 -0
- package/dist/nodes/GithubIssues/shared/transport.js +16 -0
- package/dist/nodes/GithubIssues/shared/transport.js.map +1 -0
- package/dist/nodes/GithubIssues/shared/utils.js +17 -0
- package/dist/nodes/GithubIssues/shared/utils.js.map +1 -0
- package/dist/nodes/GlpiV2/GlpiV2.credentials.js +78 -0
- package/dist/nodes/GlpiV2/GlpiV2.credentials.js.map +1 -0
- package/dist/nodes/GlpiV2/GlpiV2.node.js +55 -0
- package/dist/nodes/GlpiV2/GlpiV2.node.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/create.js +45 -0
- package/dist/nodes/GlpiV2/resources/computer/create.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/delete.js +39 -0
- package/dist/nodes/GlpiV2/resources/computer/delete.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/get.js +39 -0
- package/dist/nodes/GlpiV2/resources/computer/get.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/getAll.js +63 -0
- package/dist/nodes/GlpiV2/resources/computer/getAll.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/index.js +62 -0
- package/dist/nodes/GlpiV2/resources/computer/index.js.map +1 -0
- package/dist/nodes/GlpiV2/resources/computer/update.js +57 -0
- package/dist/nodes/GlpiV2/resources/computer/update.js.map +1 -0
- package/package.json +6 -1
- package/.github/workflows/ci.yml +0 -28
- package/.prettierrc.js +0 -51
- package/.vscode/extensions.json +0 -7
- package/.vscode/launch.json +0 -12
- package/CHANGELOG.md +0 -0
- package/CODE_OF_CONDUCT.md +0 -76
- package/README_TEMPLATE.md +0 -48
- package/api_docs.json +0 -1
- package/credentials/GithubIssuesApi.credentials.ts +0 -45
- package/credentials/GithubIssuesOAuth2Api.credentials.ts +0 -54
- package/eslint.config.mjs +0 -3
- package/icons/github.dark.svg +0 -3
- package/icons/github.svg +0 -3
- package/nodes/Example/Example.node.json +0 -18
- package/nodes/Example/Example.node.ts +0 -78
- package/nodes/Example/example.dark.svg +0 -13
- package/nodes/Example/example.svg +0 -13
- package/nodes/GithubIssues/GithubIssues.node.json +0 -18
- package/nodes/GithubIssues/GithubIssues.node.ts +0 -96
- package/nodes/GithubIssues/listSearch/getIssues.ts +0 -49
- package/nodes/GithubIssues/listSearch/getRepositories.ts +0 -50
- package/nodes/GithubIssues/listSearch/getUsers.ts +0 -49
- package/nodes/GithubIssues/resources/issue/create.ts +0 -74
- package/nodes/GithubIssues/resources/issue/get.ts +0 -14
- package/nodes/GithubIssues/resources/issue/getAll.ts +0 -124
- package/nodes/GithubIssues/resources/issue/index.ts +0 -75
- package/nodes/GithubIssues/resources/issueComment/getAll.ts +0 -65
- package/nodes/GithubIssues/resources/issueComment/index.ts +0 -47
- package/nodes/GithubIssues/shared/descriptions.ts +0 -151
- package/nodes/GithubIssues/shared/transport.ts +0 -32
- package/nodes/GithubIssues/shared/utils.ts +0 -14
- package/nodes/GlpiV2/GlpiV2.credentials.ts +0 -76
- package/nodes/GlpiV2/GlpiV2.node.ts +0 -50
- package/nodes/GlpiV2/GlpiV2.svg +0 -5
- package/nodes/GlpiV2/resources/computer/create.ts +0 -43
- package/nodes/GlpiV2/resources/computer/delete.ts +0 -37
- package/nodes/GlpiV2/resources/computer/get.ts +0 -37
- package/nodes/GlpiV2/resources/computer/getAll.ts +0 -61
- package/nodes/GlpiV2/resources/computer/index.ts +0 -61
- package/nodes/GlpiV2/resources/computer/update.ts +0 -55
- package/tsconfig.json +0 -16
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IAuthenticateGeneric,
|
|
3
|
-
Icon,
|
|
4
|
-
ICredentialTestRequest,
|
|
5
|
-
ICredentialType,
|
|
6
|
-
INodeProperties,
|
|
7
|
-
} from 'n8n-workflow';
|
|
8
|
-
|
|
9
|
-
export class GithubIssuesApi implements ICredentialType {
|
|
10
|
-
name = 'githubIssuesApi';
|
|
11
|
-
|
|
12
|
-
displayName = 'GitHub Issues API';
|
|
13
|
-
|
|
14
|
-
icon: Icon = { light: 'file:../icons/github.svg', dark: 'file:../icons/github.dark.svg' };
|
|
15
|
-
|
|
16
|
-
documentationUrl =
|
|
17
|
-
'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#deleting-a-personal-access-token';
|
|
18
|
-
|
|
19
|
-
properties: INodeProperties[] = [
|
|
20
|
-
{
|
|
21
|
-
displayName: 'Access Token',
|
|
22
|
-
name: 'accessToken',
|
|
23
|
-
type: 'string',
|
|
24
|
-
typeOptions: { password: true },
|
|
25
|
-
default: '',
|
|
26
|
-
},
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
authenticate: IAuthenticateGeneric = {
|
|
30
|
-
type: 'generic',
|
|
31
|
-
properties: {
|
|
32
|
-
headers: {
|
|
33
|
-
Authorization: '=token {{$credentials?.accessToken}}',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
test: ICredentialTestRequest = {
|
|
39
|
-
request: {
|
|
40
|
-
baseURL: 'https://api.github.com',
|
|
41
|
-
url: '/user',
|
|
42
|
-
method: 'GET',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import type { Icon, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
export class GithubIssuesOAuth2Api implements ICredentialType {
|
|
4
|
-
name = 'githubIssuesOAuth2Api';
|
|
5
|
-
|
|
6
|
-
extends = ['oAuth2Api'];
|
|
7
|
-
|
|
8
|
-
displayName = 'GitHub Issues OAuth2 API';
|
|
9
|
-
|
|
10
|
-
icon: Icon = { light: 'file:../icons/github.svg', dark: 'file:../icons/github.dark.svg' };
|
|
11
|
-
|
|
12
|
-
documentationUrl = 'https://docs.github.com/en/apps/oauth-apps';
|
|
13
|
-
|
|
14
|
-
properties: INodeProperties[] = [
|
|
15
|
-
{
|
|
16
|
-
displayName: 'Grant Type',
|
|
17
|
-
name: 'grantType',
|
|
18
|
-
type: 'hidden',
|
|
19
|
-
default: 'authorizationCode',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
displayName: 'Authorization URL',
|
|
23
|
-
name: 'authUrl',
|
|
24
|
-
type: 'hidden',
|
|
25
|
-
default: 'https://github.com/login/oauth/authorize',
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
displayName: 'Access Token URL',
|
|
30
|
-
name: 'accessTokenUrl',
|
|
31
|
-
type: 'hidden',
|
|
32
|
-
default: 'https://github.com/login/oauth/access_token',
|
|
33
|
-
required: true,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
displayName: 'Scope',
|
|
37
|
-
name: 'scope',
|
|
38
|
-
type: 'hidden',
|
|
39
|
-
default: 'repo',
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
displayName: 'Auth URI Query Parameters',
|
|
43
|
-
name: 'authQueryParameters',
|
|
44
|
-
type: 'hidden',
|
|
45
|
-
default: '',
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
displayName: 'Authentication',
|
|
49
|
-
name: 'authentication',
|
|
50
|
-
type: 'hidden',
|
|
51
|
-
default: 'header',
|
|
52
|
-
},
|
|
53
|
-
];
|
|
54
|
-
}
|
package/eslint.config.mjs
DELETED
package/icons/github.dark.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0165 0C8.94791 0 0 9.01388 0 20.1653C0 29.0792 5.73324 36.6246 13.6868 39.2952C14.6812 39.496 15.0454 38.8613 15.0454 38.3274C15.0454 37.8599 15.0126 36.2575 15.0126 34.5879C9.4445 35.79 8.28498 32.1841 8.28498 32.1841C7.39015 29.847 6.06429 29.2463 6.06429 29.2463C4.24185 28.011 6.19704 28.011 6.19704 28.011C8.21861 28.1446 9.27938 30.081 9.27938 30.081C11.0686 33.1522 13.9518 32.2844 15.1118 31.7502C15.2773 30.4481 15.8079 29.5467 16.3713 29.046C11.9303 28.5785 7.25781 26.8425 7.25781 19.0967C7.25781 16.8932 8.05267 15.0905 9.31216 13.6884C9.11344 13.1877 8.41732 11.1174 9.51128 8.34644C9.51128 8.34644 11.2014 7.81217 15.0122 10.4164C16.6438 9.97495 18.3263 9.7504 20.0165 9.74851C21.7067 9.74851 23.4295 9.98246 25.0205 10.4164C28.8317 7.81217 30.5218 8.34644 30.5218 8.34644C31.6158 11.1174 30.9192 13.1877 30.7205 13.6884C32.0132 15.0905 32.7753 16.8932 32.7753 19.0967C32.7753 26.8425 28.1028 28.5449 23.6287 29.046C24.358 29.6802 24.9873 30.882 24.9873 32.7851C24.9873 35.4893 24.9545 37.6596 24.9545 38.327C24.9545 38.8613 25.3192 39.496 26.3132 39.2956C34.2667 36.6242 39.9999 29.0792 39.9999 20.1653C40.0327 9.01388 31.052 0 20.0165 0Z" fill="white"/>
|
|
3
|
-
</svg>
|
package/icons/github.svg
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M20.0165 0C8.94791 0 0 9.01388 0 20.1653C0 29.0792 5.73324 36.6246 13.6868 39.2952C14.6812 39.496 15.0454 38.8613 15.0454 38.3274C15.0454 37.8599 15.0126 36.2575 15.0126 34.5879C9.4445 35.79 8.28498 32.1841 8.28498 32.1841C7.39015 29.847 6.06429 29.2463 6.06429 29.2463C4.24185 28.011 6.19704 28.011 6.19704 28.011C8.21861 28.1446 9.27938 30.081 9.27938 30.081C11.0686 33.1522 13.9518 32.2844 15.1118 31.7502C15.2773 30.4481 15.8079 29.5467 16.3713 29.046C11.9303 28.5785 7.25781 26.8425 7.25781 19.0967C7.25781 16.8932 8.05267 15.0905 9.31216 13.6884C9.11344 13.1877 8.41732 11.1174 9.51128 8.34644C9.51128 8.34644 11.2014 7.81217 15.0122 10.4164C16.6438 9.97495 18.3263 9.7504 20.0165 9.74851C21.7067 9.74851 23.4295 9.98246 25.0205 10.4164C28.8317 7.81217 30.5218 8.34644 30.5218 8.34644C31.6158 11.1174 30.9192 13.1877 30.7205 13.6884C32.0132 15.0905 32.7753 16.8932 32.7753 19.0967C32.7753 26.8425 28.1028 28.5449 23.6287 29.046C24.358 29.6802 24.9873 30.882 24.9873 32.7851C24.9873 35.4893 24.9545 37.6596 24.9545 38.327C24.9545 38.8613 25.3192 39.496 26.3132 39.2956C34.2667 36.6242 39.9999 29.0792 39.9999 20.1653C40.0327 9.01388 31.052 0 20.0165 0Z" fill="#24292F"/>
|
|
3
|
-
</svg>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-example",
|
|
3
|
-
"nodeVersion": "1.0",
|
|
4
|
-
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Development", "Developer Tools"],
|
|
6
|
-
"resources": {
|
|
7
|
-
"credentialDocumentation": [
|
|
8
|
-
{
|
|
9
|
-
"url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"primaryDocumentation": [
|
|
13
|
-
{
|
|
14
|
-
"url": "https://github.com/org/repo?tab=readme-ov-file"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
IExecuteFunctions,
|
|
3
|
-
INodeExecutionData,
|
|
4
|
-
INodeType,
|
|
5
|
-
INodeTypeDescription,
|
|
6
|
-
} from 'n8n-workflow';
|
|
7
|
-
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
|
|
8
|
-
|
|
9
|
-
export class Example implements INodeType {
|
|
10
|
-
description: INodeTypeDescription = {
|
|
11
|
-
displayName: 'Example',
|
|
12
|
-
name: 'example',
|
|
13
|
-
icon: { light: 'file:example.svg', dark: 'file:example.dark.svg' },
|
|
14
|
-
group: ['input'],
|
|
15
|
-
version: 1,
|
|
16
|
-
description: 'Basic Example Node',
|
|
17
|
-
defaults: {
|
|
18
|
-
name: 'Example',
|
|
19
|
-
},
|
|
20
|
-
inputs: [NodeConnectionTypes.Main],
|
|
21
|
-
outputs: [NodeConnectionTypes.Main],
|
|
22
|
-
usableAsTool: true,
|
|
23
|
-
properties: [
|
|
24
|
-
// Node properties which the user gets displayed and
|
|
25
|
-
// can change on the node.
|
|
26
|
-
{
|
|
27
|
-
displayName: 'My String',
|
|
28
|
-
name: 'myString',
|
|
29
|
-
type: 'string',
|
|
30
|
-
default: '',
|
|
31
|
-
placeholder: 'Placeholder value',
|
|
32
|
-
description: 'The description text',
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// The function below is responsible for actually doing whatever this node
|
|
38
|
-
// is supposed to do. In this case, we're just appending the `myString` property
|
|
39
|
-
// with whatever the user has entered.
|
|
40
|
-
// You can make async calls and use `await`.
|
|
41
|
-
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
|
42
|
-
const items = this.getInputData();
|
|
43
|
-
|
|
44
|
-
let item: INodeExecutionData;
|
|
45
|
-
let myString: string;
|
|
46
|
-
|
|
47
|
-
// Iterates over all input items and add the key "myString" with the
|
|
48
|
-
// value the parameter "myString" resolves to.
|
|
49
|
-
// (This could be a different value for each item in case it contains an expression)
|
|
50
|
-
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
51
|
-
try {
|
|
52
|
-
myString = this.getNodeParameter('myString', itemIndex, '') as string;
|
|
53
|
-
item = items[itemIndex];
|
|
54
|
-
|
|
55
|
-
item.json.myString = myString;
|
|
56
|
-
} catch (error) {
|
|
57
|
-
// This node should never fail but we want to showcase how
|
|
58
|
-
// to handle errors.
|
|
59
|
-
if (this.continueOnFail()) {
|
|
60
|
-
items.push({ json: this.getInputData(itemIndex)[0].json, error, pairedItem: itemIndex });
|
|
61
|
-
} else {
|
|
62
|
-
// Adding `itemIndex` allows other workflows to handle this error
|
|
63
|
-
if (error.context) {
|
|
64
|
-
// If the error thrown already contains the context property,
|
|
65
|
-
// only append the itemIndex
|
|
66
|
-
error.context.itemIndex = itemIndex;
|
|
67
|
-
throw error;
|
|
68
|
-
}
|
|
69
|
-
throw new NodeOperationError(this.getNode(), error, {
|
|
70
|
-
itemIndex,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return [items];
|
|
77
|
-
}
|
|
78
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="aquamarine"
|
|
2
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cpu">
|
|
3
|
-
<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
|
|
4
|
-
<rect x="9" y="9" width="6" height="6"></rect>
|
|
5
|
-
<line x1="9" y1="1" x2="9" y2="4"></line>
|
|
6
|
-
<line x1="15" y1="1" x2="15" y2="4"></line>
|
|
7
|
-
<line x1="9" y1="20" x2="9" y2="23"></line>
|
|
8
|
-
<line x1="15" y1="20" x2="15" y2="23"></line>
|
|
9
|
-
<line x1="20" y1="9" x2="23" y2="9"></line>
|
|
10
|
-
<line x1="20" y1="14" x2="23" y2="14"></line>
|
|
11
|
-
<line x1="1" y1="9" x2="4" y2="9"></line>
|
|
12
|
-
<line x1="1" y1="14" x2="4" y2="14"></line>
|
|
13
|
-
</svg>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="darkblue"
|
|
2
|
-
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-cpu">
|
|
3
|
-
<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
|
|
4
|
-
<rect x="9" y="9" width="6" height="6"></rect>
|
|
5
|
-
<line x1="9" y1="1" x2="9" y2="4"></line>
|
|
6
|
-
<line x1="15" y1="1" x2="15" y2="4"></line>
|
|
7
|
-
<line x1="9" y1="20" x2="9" y2="23"></line>
|
|
8
|
-
<line x1="15" y1="20" x2="15" y2="23"></line>
|
|
9
|
-
<line x1="20" y1="9" x2="23" y2="9"></line>
|
|
10
|
-
<line x1="20" y1="14" x2="23" y2="14"></line>
|
|
11
|
-
<line x1="1" y1="9" x2="4" y2="9"></line>
|
|
12
|
-
<line x1="1" y1="14" x2="4" y2="14"></line>
|
|
13
|
-
</svg>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"node": "n8n-nodes-github-issues",
|
|
3
|
-
"nodeVersion": "1.0",
|
|
4
|
-
"codexVersion": "1.0",
|
|
5
|
-
"categories": ["Development", "Developer Tools"],
|
|
6
|
-
"resources": {
|
|
7
|
-
"credentialDocumentation": [
|
|
8
|
-
{
|
|
9
|
-
"url": "https://github.com/org/repo?tab=readme-ov-file#credentials"
|
|
10
|
-
}
|
|
11
|
-
],
|
|
12
|
-
"primaryDocumentation": [
|
|
13
|
-
{
|
|
14
|
-
"url": "https://github.com/org/repo?tab=readme-ov-file"
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { NodeConnectionTypes, type INodeType, type INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
-
import { issueDescription } from './resources/issue';
|
|
3
|
-
import { issueCommentDescription } from './resources/issueComment';
|
|
4
|
-
import { getRepositories } from './listSearch/getRepositories';
|
|
5
|
-
import { getUsers } from './listSearch/getUsers';
|
|
6
|
-
import { getIssues } from './listSearch/getIssues';
|
|
7
|
-
|
|
8
|
-
export class GithubIssues implements INodeType {
|
|
9
|
-
description: INodeTypeDescription = {
|
|
10
|
-
displayName: 'GitHub Issues',
|
|
11
|
-
name: 'githubIssues',
|
|
12
|
-
icon: { light: 'file:../../icons/github.svg', dark: 'file:../../icons/github.dark.svg' },
|
|
13
|
-
group: ['input'],
|
|
14
|
-
version: 1,
|
|
15
|
-
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
16
|
-
description: 'Consume issues from the GitHub API',
|
|
17
|
-
defaults: {
|
|
18
|
-
name: 'GitHub Issues',
|
|
19
|
-
},
|
|
20
|
-
usableAsTool: true,
|
|
21
|
-
inputs: [NodeConnectionTypes.Main],
|
|
22
|
-
outputs: [NodeConnectionTypes.Main],
|
|
23
|
-
credentials: [
|
|
24
|
-
{
|
|
25
|
-
name: 'githubIssuesApi',
|
|
26
|
-
required: true,
|
|
27
|
-
displayOptions: {
|
|
28
|
-
show: {
|
|
29
|
-
authentication: ['accessToken'],
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
name: 'githubIssuesOAuth2Api',
|
|
35
|
-
required: true,
|
|
36
|
-
displayOptions: {
|
|
37
|
-
show: {
|
|
38
|
-
authentication: ['oAuth2'],
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
requestDefaults: {
|
|
44
|
-
baseURL: 'https://api.github.com',
|
|
45
|
-
headers: {
|
|
46
|
-
Accept: 'application/json',
|
|
47
|
-
'Content-Type': 'application/json',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
properties: [
|
|
51
|
-
{
|
|
52
|
-
displayName: 'Authentication',
|
|
53
|
-
name: 'authentication',
|
|
54
|
-
type: 'options',
|
|
55
|
-
options: [
|
|
56
|
-
{
|
|
57
|
-
name: 'Access Token',
|
|
58
|
-
value: 'accessToken',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'OAuth2',
|
|
62
|
-
value: 'oAuth2',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
default: 'accessToken',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
displayName: 'Resource',
|
|
69
|
-
name: 'resource',
|
|
70
|
-
type: 'options',
|
|
71
|
-
noDataExpression: true,
|
|
72
|
-
options: [
|
|
73
|
-
{
|
|
74
|
-
name: 'Issue',
|
|
75
|
-
value: 'issue',
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
name: 'Issue Comment',
|
|
79
|
-
value: 'issueComment',
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
default: 'issue',
|
|
83
|
-
},
|
|
84
|
-
...issueDescription,
|
|
85
|
-
...issueCommentDescription,
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
methods = {
|
|
90
|
-
listSearch: {
|
|
91
|
-
getRepositories,
|
|
92
|
-
getUsers,
|
|
93
|
-
getIssues,
|
|
94
|
-
},
|
|
95
|
-
};
|
|
96
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ILoadOptionsFunctions,
|
|
3
|
-
INodeListSearchResult,
|
|
4
|
-
INodeListSearchItems,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
import { githubApiRequest } from '../shared/transport';
|
|
7
|
-
|
|
8
|
-
type IssueSearchItem = {
|
|
9
|
-
number: number;
|
|
10
|
-
title: string;
|
|
11
|
-
html_url: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
type IssueSearchResponse = {
|
|
15
|
-
items: IssueSearchItem[];
|
|
16
|
-
total_count: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export async function getIssues(
|
|
20
|
-
this: ILoadOptionsFunctions,
|
|
21
|
-
filter?: string,
|
|
22
|
-
paginationToken?: string,
|
|
23
|
-
): Promise<INodeListSearchResult> {
|
|
24
|
-
const page = paginationToken ? +paginationToken : 1;
|
|
25
|
-
const per_page = 100;
|
|
26
|
-
|
|
27
|
-
let responseData: IssueSearchResponse = {
|
|
28
|
-
items: [],
|
|
29
|
-
total_count: 0,
|
|
30
|
-
};
|
|
31
|
-
const owner = this.getNodeParameter('owner', '', { extractValue: true });
|
|
32
|
-
const repository = this.getNodeParameter('repository', '', { extractValue: true });
|
|
33
|
-
const filters = [filter, `repo:${owner}/${repository}`];
|
|
34
|
-
|
|
35
|
-
responseData = await githubApiRequest.call(this, 'GET', '/search/issues', {
|
|
36
|
-
q: filters.filter(Boolean).join(' '),
|
|
37
|
-
page,
|
|
38
|
-
per_page,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const results: INodeListSearchItems[] = responseData.items.map((item: IssueSearchItem) => ({
|
|
42
|
-
name: item.title,
|
|
43
|
-
value: item.number,
|
|
44
|
-
url: item.html_url,
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
|
48
|
-
return { results, paginationToken: nextPaginationToken };
|
|
49
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ILoadOptionsFunctions,
|
|
3
|
-
INodeListSearchItems,
|
|
4
|
-
INodeListSearchResult,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
import { githubApiRequest } from '../shared/transport';
|
|
7
|
-
|
|
8
|
-
type RepositorySearchItem = {
|
|
9
|
-
name: string;
|
|
10
|
-
html_url: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type RepositorySearchResponse = {
|
|
14
|
-
items: RepositorySearchItem[];
|
|
15
|
-
total_count: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export async function getRepositories(
|
|
19
|
-
this: ILoadOptionsFunctions,
|
|
20
|
-
filter?: string,
|
|
21
|
-
paginationToken?: string,
|
|
22
|
-
): Promise<INodeListSearchResult> {
|
|
23
|
-
const owner = this.getCurrentNodeParameter('owner', { extractValue: true });
|
|
24
|
-
const page = paginationToken ? +paginationToken : 1;
|
|
25
|
-
const per_page = 100;
|
|
26
|
-
const q = `${filter ?? ''} user:${owner} fork:true`;
|
|
27
|
-
let responseData: RepositorySearchResponse = {
|
|
28
|
-
items: [],
|
|
29
|
-
total_count: 0,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
responseData = await githubApiRequest.call(this, 'GET', '/search/repositories', {
|
|
34
|
-
q,
|
|
35
|
-
page,
|
|
36
|
-
per_page,
|
|
37
|
-
});
|
|
38
|
-
} catch {
|
|
39
|
-
// will fail if the owner does not have any repositories
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const results: INodeListSearchItems[] = responseData.items.map((item: RepositorySearchItem) => ({
|
|
43
|
-
name: item.name,
|
|
44
|
-
value: item.name,
|
|
45
|
-
url: item.html_url,
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
|
49
|
-
return { results, paginationToken: nextPaginationToken };
|
|
50
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ILoadOptionsFunctions,
|
|
3
|
-
INodeListSearchResult,
|
|
4
|
-
INodeListSearchItems,
|
|
5
|
-
} from 'n8n-workflow';
|
|
6
|
-
import { githubApiRequest } from '../shared/transport';
|
|
7
|
-
|
|
8
|
-
type UserSearchItem = {
|
|
9
|
-
login: string;
|
|
10
|
-
html_url: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
type UserSearchResponse = {
|
|
14
|
-
items: UserSearchItem[];
|
|
15
|
-
total_count: number;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export async function getUsers(
|
|
19
|
-
this: ILoadOptionsFunctions,
|
|
20
|
-
filter?: string,
|
|
21
|
-
paginationToken?: string,
|
|
22
|
-
): Promise<INodeListSearchResult> {
|
|
23
|
-
const page = paginationToken ? +paginationToken : 1;
|
|
24
|
-
const per_page = 100;
|
|
25
|
-
|
|
26
|
-
let responseData: UserSearchResponse = {
|
|
27
|
-
items: [],
|
|
28
|
-
total_count: 0,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
responseData = await githubApiRequest.call(this, 'GET', '/search/users', {
|
|
33
|
-
q: filter,
|
|
34
|
-
page,
|
|
35
|
-
per_page,
|
|
36
|
-
});
|
|
37
|
-
} catch {
|
|
38
|
-
// will fail if the owner does not have any users
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const results: INodeListSearchItems[] = responseData.items.map((item: UserSearchItem) => ({
|
|
42
|
-
name: item.login,
|
|
43
|
-
value: item.login,
|
|
44
|
-
url: item.html_url,
|
|
45
|
-
}));
|
|
46
|
-
|
|
47
|
-
const nextPaginationToken = page * per_page < responseData.total_count ? page + 1 : undefined;
|
|
48
|
-
return { results, paginationToken: nextPaginationToken };
|
|
49
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
|
|
3
|
-
const showOnlyForIssueCreate = {
|
|
4
|
-
operation: ['create'],
|
|
5
|
-
resource: ['issue'],
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const issueCreateDescription: INodeProperties[] = [
|
|
9
|
-
{
|
|
10
|
-
displayName: 'Title',
|
|
11
|
-
name: 'title',
|
|
12
|
-
type: 'string',
|
|
13
|
-
default: '',
|
|
14
|
-
required: true,
|
|
15
|
-
displayOptions: {
|
|
16
|
-
show: showOnlyForIssueCreate,
|
|
17
|
-
},
|
|
18
|
-
description: 'The title of the issue',
|
|
19
|
-
routing: {
|
|
20
|
-
send: {
|
|
21
|
-
type: 'body',
|
|
22
|
-
property: 'title',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
displayName: 'Body',
|
|
28
|
-
name: 'body',
|
|
29
|
-
type: 'string',
|
|
30
|
-
typeOptions: {
|
|
31
|
-
rows: 5,
|
|
32
|
-
},
|
|
33
|
-
default: '',
|
|
34
|
-
displayOptions: {
|
|
35
|
-
show: showOnlyForIssueCreate,
|
|
36
|
-
},
|
|
37
|
-
description: 'The body of the issue',
|
|
38
|
-
routing: {
|
|
39
|
-
send: {
|
|
40
|
-
type: 'body',
|
|
41
|
-
property: 'body',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
displayName: 'Labels',
|
|
47
|
-
name: 'labels',
|
|
48
|
-
type: 'collection',
|
|
49
|
-
typeOptions: {
|
|
50
|
-
multipleValues: true,
|
|
51
|
-
multipleValueButtonText: 'Add Label',
|
|
52
|
-
},
|
|
53
|
-
displayOptions: {
|
|
54
|
-
show: showOnlyForIssueCreate,
|
|
55
|
-
},
|
|
56
|
-
default: { label: '' },
|
|
57
|
-
options: [
|
|
58
|
-
{
|
|
59
|
-
displayName: 'Label',
|
|
60
|
-
name: 'label',
|
|
61
|
-
type: 'string',
|
|
62
|
-
default: '',
|
|
63
|
-
description: 'Label to add to issue',
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
routing: {
|
|
67
|
-
send: {
|
|
68
|
-
type: 'body',
|
|
69
|
-
property: 'labels',
|
|
70
|
-
value: '={{$value.map((data) => data.label)}}',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
];
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
-
import { issueSelect } from '../../shared/descriptions';
|
|
3
|
-
|
|
4
|
-
const showOnlyForIssueGet = {
|
|
5
|
-
operation: ['get'],
|
|
6
|
-
resource: ['issue'],
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const issueGetDescription: INodeProperties[] = [
|
|
10
|
-
{
|
|
11
|
-
...issueSelect,
|
|
12
|
-
displayOptions: { show: showOnlyForIssueGet },
|
|
13
|
-
},
|
|
14
|
-
];
|