@atom8n/node-cli 0.17.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.
Files changed (152) hide show
  1. package/README.md +289 -0
  2. package/bin/n8n-node.mjs +5 -0
  3. package/dist/build.tsbuildinfo +1 -0
  4. package/dist/commands/build.d.ts +8 -0
  5. package/dist/commands/build.js +61 -0
  6. package/dist/commands/build.js.map +1 -0
  7. package/dist/commands/cloud-support.d.ts +14 -0
  8. package/dist/commands/cloud-support.js +136 -0
  9. package/dist/commands/cloud-support.js.map +1 -0
  10. package/dist/commands/dev/index.d.ts +10 -0
  11. package/dist/commands/dev/index.js +103 -0
  12. package/dist/commands/dev/index.js.map +1 -0
  13. package/dist/commands/dev/utils.d.ts +27 -0
  14. package/dist/commands/dev/utils.js +462 -0
  15. package/dist/commands/dev/utils.js.map +1 -0
  16. package/dist/commands/lint.d.ts +13 -0
  17. package/dist/commands/lint.js +124 -0
  18. package/dist/commands/lint.js.map +1 -0
  19. package/dist/commands/new/index.d.ts +14 -0
  20. package/dist/commands/new/index.js +141 -0
  21. package/dist/commands/new/index.js.map +1 -0
  22. package/dist/commands/new/prompts.d.ts +3 -0
  23. package/dist/commands/new/prompts.js +42 -0
  24. package/dist/commands/new/prompts.js.map +1 -0
  25. package/dist/commands/new/utils.d.ts +1 -0
  26. package/dist/commands/new/utils.js +13 -0
  27. package/dist/commands/new/utils.js.map +1 -0
  28. package/dist/commands/prerelease.d.ts +8 -0
  29. package/dist/commands/prerelease.js +20 -0
  30. package/dist/commands/prerelease.js.map +1 -0
  31. package/dist/commands/release.d.ts +7 -0
  32. package/dist/commands/release.js +52 -0
  33. package/dist/commands/release.js.map +1 -0
  34. package/dist/configs/eslint.d.ts +3 -0
  35. package/dist/configs/eslint.js +65 -0
  36. package/dist/configs/eslint.js.map +1 -0
  37. package/dist/index.d.ts +16 -0
  38. package/dist/index.js +23 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/template/core.d.ts +29 -0
  41. package/dist/template/core.js +55 -0
  42. package/dist/template/core.js.map +1 -0
  43. package/dist/template/templates/declarative/custom/ast.d.ts +17 -0
  44. package/dist/template/templates/declarative/custom/ast.js +110 -0
  45. package/dist/template/templates/declarative/custom/ast.js.map +1 -0
  46. package/dist/template/templates/declarative/custom/ast.ts +161 -0
  47. package/dist/template/templates/declarative/custom/prompts.d.ts +3 -0
  48. package/dist/template/templates/declarative/custom/prompts.js +80 -0
  49. package/dist/template/templates/declarative/custom/prompts.js.map +1 -0
  50. package/dist/template/templates/declarative/custom/prompts.ts +87 -0
  51. package/dist/template/templates/declarative/custom/template/README.md +46 -0
  52. package/dist/template/templates/declarative/custom/template/nodes/Example/Example.node.json +18 -0
  53. package/dist/template/templates/declarative/custom/template/nodes/Example/Example.node.ts +50 -0
  54. package/dist/template/templates/declarative/custom/template/nodes/Example/example.dark.svg +13 -0
  55. package/dist/template/templates/declarative/custom/template/nodes/Example/example.svg +13 -0
  56. package/dist/template/templates/declarative/custom/template/nodes/Example/resources/company/getAll.ts +61 -0
  57. package/dist/template/templates/declarative/custom/template/nodes/Example/resources/company/index.ts +34 -0
  58. package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/create.ts +26 -0
  59. package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/get.ts +17 -0
  60. package/dist/template/templates/declarative/custom/template/nodes/Example/resources/user/index.ts +60 -0
  61. package/dist/template/templates/declarative/custom/template/package.json +48 -0
  62. package/dist/template/templates/declarative/custom/template/tsconfig.json +25 -0
  63. package/dist/template/templates/declarative/custom/template.d.ts +2 -0
  64. package/dist/template/templates/declarative/custom/template.js +83 -0
  65. package/dist/template/templates/declarative/custom/template.js.map +1 -0
  66. package/dist/template/templates/declarative/custom/template.ts +121 -0
  67. package/dist/template/templates/declarative/custom/types.d.ts +9 -0
  68. package/dist/template/templates/declarative/custom/types.js +3 -0
  69. package/dist/template/templates/declarative/custom/types.js.map +1 -0
  70. package/dist/template/templates/declarative/custom/types.ts +8 -0
  71. package/dist/template/templates/declarative/github-issues/template/README.md +73 -0
  72. package/dist/template/templates/declarative/github-issues/template/credentials/GithubIssuesApi.credentials.ts +45 -0
  73. package/dist/template/templates/declarative/github-issues/template/credentials/GithubIssuesOAuth2Api.credentials.ts +54 -0
  74. package/dist/template/templates/declarative/github-issues/template/icons/github.dark.svg +3 -0
  75. package/dist/template/templates/declarative/github-issues/template/icons/github.svg +3 -0
  76. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/GithubIssues.node.json +18 -0
  77. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/GithubIssues.node.ts +96 -0
  78. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getIssues.ts +49 -0
  79. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getRepositories.ts +50 -0
  80. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/listSearch/getUsers.ts +49 -0
  81. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/create.ts +74 -0
  82. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/get.ts +14 -0
  83. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/getAll.ts +124 -0
  84. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issue/index.ts +75 -0
  85. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issueComment/getAll.ts +65 -0
  86. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/resources/issueComment/index.ts +47 -0
  87. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/descriptions.ts +151 -0
  88. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/transport.ts +32 -0
  89. package/dist/template/templates/declarative/github-issues/template/nodes/GithubIssues/shared/utils.ts +14 -0
  90. package/dist/template/templates/declarative/github-issues/template/package.json +51 -0
  91. package/dist/template/templates/declarative/github-issues/template/tsconfig.json +25 -0
  92. package/dist/template/templates/declarative/github-issues/template.d.ts +1 -0
  93. package/dist/template/templates/declarative/github-issues/template.js +14 -0
  94. package/dist/template/templates/declarative/github-issues/template.js.map +1 -0
  95. package/dist/template/templates/declarative/github-issues/template.ts +9 -0
  96. package/dist/template/templates/index.d.ts +15 -0
  97. package/dist/template/templates/index.js +28 -0
  98. package/dist/template/templates/index.js.map +1 -0
  99. package/dist/template/templates/index.ts +35 -0
  100. package/dist/template/templates/programmatic/example/template/README.md +46 -0
  101. package/dist/template/templates/programmatic/example/template/nodes/Example/Example.node.json +18 -0
  102. package/dist/template/templates/programmatic/example/template/nodes/Example/Example.node.ts +78 -0
  103. package/dist/template/templates/programmatic/example/template/nodes/Example/example.dark.svg +13 -0
  104. package/dist/template/templates/programmatic/example/template/nodes/Example/example.svg +13 -0
  105. package/dist/template/templates/programmatic/example/template/package.json +48 -0
  106. package/dist/template/templates/programmatic/example/template/tsconfig.json +25 -0
  107. package/dist/template/templates/programmatic/example/template.d.ts +1 -0
  108. package/dist/template/templates/programmatic/example/template.js +14 -0
  109. package/dist/template/templates/programmatic/example/template.js.map +1 -0
  110. package/dist/template/templates/programmatic/example/template.ts +9 -0
  111. package/dist/template/templates/shared/credentials/apiKey.credentials.ts +42 -0
  112. package/dist/template/templates/shared/credentials/basicAuth.credentials.ts +50 -0
  113. package/dist/template/templates/shared/credentials/bearer.credentials.ts +42 -0
  114. package/dist/template/templates/shared/credentials/custom.credentials.ts +48 -0
  115. package/dist/template/templates/shared/credentials/oauth2AuthorizationCode.credentials.ts +51 -0
  116. package/dist/template/templates/shared/credentials/oauth2ClientCredentials.credentials.ts +45 -0
  117. package/dist/template/templates/shared/default/.github/workflows/ci.yml +28 -0
  118. package/dist/template/templates/shared/default/.prettierrc.js +51 -0
  119. package/dist/template/templates/shared/default/.vscode/launch.json +12 -0
  120. package/dist/template/templates/shared/default/CHANGELOG.md +0 -0
  121. package/dist/template/templates/shared/default/eslint.config.mjs +3 -0
  122. package/dist/utils/ast.d.ts +11 -0
  123. package/dist/utils/ast.js +32 -0
  124. package/dist/utils/ast.js.map +1 -0
  125. package/dist/utils/child-process.d.ts +17 -0
  126. package/dist/utils/child-process.js +65 -0
  127. package/dist/utils/child-process.js.map +1 -0
  128. package/dist/utils/command-suggestions.d.ts +6 -0
  129. package/dist/utils/command-suggestions.js +30 -0
  130. package/dist/utils/command-suggestions.js.map +1 -0
  131. package/dist/utils/filesystem.d.ts +12 -0
  132. package/dist/utils/filesystem.js +105 -0
  133. package/dist/utils/filesystem.js.map +1 -0
  134. package/dist/utils/git.d.ts +7 -0
  135. package/dist/utils/git.js +36 -0
  136. package/dist/utils/git.js.map +1 -0
  137. package/dist/utils/json.d.ts +1 -0
  138. package/dist/utils/json.js +12 -0
  139. package/dist/utils/json.js.map +1 -0
  140. package/dist/utils/package-manager.d.ts +4 -0
  141. package/dist/utils/package-manager.js +48 -0
  142. package/dist/utils/package-manager.js.map +1 -0
  143. package/dist/utils/package.d.ts +15 -0
  144. package/dist/utils/package.js +53 -0
  145. package/dist/utils/package.js.map +1 -0
  146. package/dist/utils/prompts.d.ts +5 -0
  147. package/dist/utils/prompts.js +65 -0
  148. package/dist/utils/prompts.js.map +1 -0
  149. package/dist/utils/validation.d.ts +3 -0
  150. package/dist/utils/validation.js +23 -0
  151. package/dist/utils/validation.js.map +1 -0
  152. package/package.json +77 -0
@@ -0,0 +1,47 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+ import { repoNameSelect, repoOwnerSelect } from '../../shared/descriptions';
3
+ import { issueCommentGetManyDescription } from './getAll';
4
+
5
+ const showOnlyForIssueComments = {
6
+ resource: ['issueComment'],
7
+ };
8
+
9
+ export const issueCommentDescription: INodeProperties[] = [
10
+ {
11
+ displayName: 'Operation',
12
+ name: 'operation',
13
+ type: 'options',
14
+ noDataExpression: true,
15
+ displayOptions: {
16
+ show: showOnlyForIssueComments,
17
+ },
18
+ options: [
19
+ {
20
+ name: 'Get Many',
21
+ value: 'getAll',
22
+ action: 'Get issue comments',
23
+ description: 'Get issue comments',
24
+ routing: {
25
+ request: {
26
+ method: 'GET',
27
+ url: '=/repos/{{$parameter.owner}}/{{$parameter.repository}}/issues/comments',
28
+ },
29
+ },
30
+ },
31
+ ],
32
+ default: 'getAll',
33
+ },
34
+ {
35
+ ...repoOwnerSelect,
36
+ displayOptions: {
37
+ show: showOnlyForIssueComments,
38
+ },
39
+ },
40
+ {
41
+ ...repoNameSelect,
42
+ displayOptions: {
43
+ show: showOnlyForIssueComments,
44
+ },
45
+ },
46
+ ...issueCommentGetManyDescription,
47
+ ];
@@ -0,0 +1,151 @@
1
+ import type { INodeProperties } from 'n8n-workflow';
2
+
3
+ export const repoOwnerSelect: INodeProperties = {
4
+ displayName: 'Repository Owner',
5
+ name: 'owner',
6
+ type: 'resourceLocator',
7
+ default: { mode: 'list', value: '' },
8
+ required: true,
9
+ modes: [
10
+ {
11
+ displayName: 'Repository Owner',
12
+ name: 'list',
13
+ type: 'list',
14
+ placeholder: 'Select an owner...',
15
+ typeOptions: {
16
+ searchListMethod: 'getUsers',
17
+ searchable: true,
18
+ searchFilterRequired: false,
19
+ },
20
+ },
21
+ {
22
+ displayName: 'Link',
23
+ name: 'url',
24
+ type: 'string',
25
+ placeholder: 'e.g. https://github.com/n8n-io',
26
+ extractValue: {
27
+ type: 'regex',
28
+ regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)',
29
+ },
30
+ validation: [
31
+ {
32
+ type: 'regex',
33
+ properties: {
34
+ regex: 'https:\\/\\/github.com\\/([-_0-9a-zA-Z]+)(?:.*)',
35
+ errorMessage: 'Not a valid GitHub URL',
36
+ },
37
+ },
38
+ ],
39
+ },
40
+ {
41
+ displayName: 'By Name',
42
+ name: 'name',
43
+ type: 'string',
44
+ placeholder: 'e.g. n8n-io',
45
+ validation: [
46
+ {
47
+ type: 'regex',
48
+ properties: {
49
+ regex: '[-_a-zA-Z0-9]+',
50
+ errorMessage: 'Not a valid GitHub Owner Name',
51
+ },
52
+ },
53
+ ],
54
+ url: '=https://github.com/{{$value}}',
55
+ },
56
+ ],
57
+ };
58
+
59
+ export const repoNameSelect: INodeProperties = {
60
+ displayName: 'Repository Name',
61
+ name: 'repository',
62
+ type: 'resourceLocator',
63
+ default: {
64
+ mode: 'list',
65
+ value: '',
66
+ },
67
+ required: true,
68
+ modes: [
69
+ {
70
+ displayName: 'Repository Name',
71
+ name: 'list',
72
+ type: 'list',
73
+ placeholder: 'Select an Repository...',
74
+ typeOptions: {
75
+ searchListMethod: 'getRepositories',
76
+ searchable: true,
77
+ },
78
+ },
79
+ {
80
+ displayName: 'Link',
81
+ name: 'url',
82
+ type: 'string',
83
+ placeholder: 'e.g. https://github.com/n8n-io/n8n',
84
+ extractValue: {
85
+ type: 'regex',
86
+ regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)',
87
+ },
88
+ validation: [
89
+ {
90
+ type: 'regex',
91
+ properties: {
92
+ regex: 'https:\\/\\/github.com\\/(?:[-_0-9a-zA-Z]+)\\/([-_.0-9a-zA-Z]+)(?:.*)',
93
+ errorMessage: 'Not a valid GitHub Repository URL',
94
+ },
95
+ },
96
+ ],
97
+ },
98
+ {
99
+ displayName: 'By Name',
100
+ name: 'name',
101
+ type: 'string',
102
+ placeholder: 'e.g. n8n',
103
+ validation: [
104
+ {
105
+ type: 'regex',
106
+ properties: {
107
+ regex: '[-_.0-9a-zA-Z]+',
108
+ errorMessage: 'Not a valid GitHub Repository Name',
109
+ },
110
+ },
111
+ ],
112
+ url: '=https://github.com/{{$parameter["owner"]}}/{{$value}}',
113
+ },
114
+ ],
115
+ displayOptions: {
116
+ hide: {
117
+ resource: ['user', 'organization'],
118
+ operation: ['getRepositories'],
119
+ },
120
+ },
121
+ };
122
+
123
+ export const issueSelect: INodeProperties = {
124
+ displayName: 'Issue',
125
+ name: 'issue',
126
+ type: 'resourceLocator',
127
+ default: {
128
+ mode: 'list',
129
+ value: '',
130
+ },
131
+ required: true,
132
+ modes: [
133
+ {
134
+ displayName: 'Issue',
135
+ name: 'list',
136
+ type: 'list',
137
+ placeholder: 'Select an Issue...',
138
+ typeOptions: {
139
+ searchListMethod: 'getIssues',
140
+ searchable: true,
141
+ },
142
+ },
143
+ {
144
+ displayName: 'By ID',
145
+ name: 'name',
146
+ type: 'string',
147
+ placeholder: 'e.g. 123',
148
+ url: '=https://github.com/{{$parameter.owner}}/{{$parameter.repository}}/issues/{{$value}}',
149
+ },
150
+ ],
151
+ };
@@ -0,0 +1,32 @@
1
+ import type {
2
+ IHookFunctions,
3
+ IExecuteFunctions,
4
+ IExecuteSingleFunctions,
5
+ ILoadOptionsFunctions,
6
+ IHttpRequestMethods,
7
+ IDataObject,
8
+ IHttpRequestOptions,
9
+ } from 'n8n-workflow';
10
+
11
+ export async function githubApiRequest(
12
+ this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions,
13
+ method: IHttpRequestMethods,
14
+ resource: string,
15
+ qs: IDataObject = {},
16
+ body: IDataObject | undefined = undefined,
17
+ ) {
18
+ const authenticationMethod = this.getNodeParameter('authentication', 0);
19
+
20
+ const options: IHttpRequestOptions = {
21
+ method: method,
22
+ qs,
23
+ body,
24
+ url: `https://api.github.com${resource}`,
25
+ json: true,
26
+ };
27
+
28
+ const credentialType =
29
+ authenticationMethod === 'accessToken' ? 'githubIssuesApi' : 'githubIssuesOAuth2Api';
30
+
31
+ return this.helpers.httpRequestWithAuthentication.call(this, credentialType, options);
32
+ }
@@ -0,0 +1,14 @@
1
+ export function parseLinkHeader(header?: string): { [rel: string]: string } {
2
+ const links: { [rel: string]: string } = {};
3
+
4
+ for (const part of header?.split(',') ?? []) {
5
+ const section = part.trim();
6
+ const match = section.match(/^<([^>]+)>\s*;\s*rel="?([^"]+)"?/);
7
+ if (match) {
8
+ const [, url, rel] = match;
9
+ links[rel] = url;
10
+ }
11
+ }
12
+
13
+ return links;
14
+ }
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "{{nodePackageName}}",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "license": "MIT",
6
+ "homepage": "",
7
+ "keywords": [
8
+ "n8n-community-node-package"
9
+ ],
10
+ "author": {
11
+ "name": "{{user.name}}",
12
+ "email": "{{user.email}}"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/<...>/n8n-nodes-<...>.git"
17
+ },
18
+ "scripts": {
19
+ "build": "n8n-node build",
20
+ "build:watch": "tsc --watch",
21
+ "dev": "n8n-node dev",
22
+ "lint": "n8n-node lint",
23
+ "lint:fix": "n8n-node lint --fix",
24
+ "release": "n8n-node release",
25
+ "prepublishOnly": "n8n-node prerelease"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "n8n": {
31
+ "n8nNodesApiVersion": 1,
32
+ "strict": true,
33
+ "credentials": [
34
+ "dist/credentials/GithubIssuesApi.credentials.js",
35
+ "dist/credentials/GithubIssuesOAuth2Api.credentials.js"
36
+ ],
37
+ "nodes": [
38
+ "dist/nodes/GithubIssues/GithubIssues.node.js"
39
+ ]
40
+ },
41
+ "devDependencies": {
42
+ "@atom8n/node-cli": "*",
43
+ "eslint": "9.32.0",
44
+ "prettier": "3.6.2",
45
+ "release-it": "^19.0.4",
46
+ "typescript": "5.9.2"
47
+ },
48
+ "peerDependencies": {
49
+ "@atom8n/n8n-workflow": "*"
50
+ }
51
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "strict": true,
4
+ "module": "commonjs",
5
+ "moduleResolution": "node",
6
+ "target": "es2019",
7
+ "lib": ["es2019", "es2020", "es2022.error"],
8
+ "removeComments": true,
9
+ "useUnknownInCatchVariables": false,
10
+ "forceConsistentCasingInFileNames": true,
11
+ "noImplicitAny": true,
12
+ "noImplicitReturns": true,
13
+ "noUnusedLocals": true,
14
+ "strictNullChecks": true,
15
+ "preserveConstEnums": true,
16
+ "esModuleInterop": true,
17
+ "resolveJsonModule": true,
18
+ "incremental": true,
19
+ "declaration": true,
20
+ "sourceMap": true,
21
+ "skipLibCheck": true,
22
+ "outDir": "./dist/"
23
+ },
24
+ "include": ["credentials/**/*", "nodes/**/*", "nodes/**/*.json", "package.json"]
25
+ }
@@ -0,0 +1 @@
1
+ export declare const githubIssuesTemplate: import("../../../core").TemplateWithRun<object>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.githubIssuesTemplate = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const core_1 = require("../../../core");
9
+ exports.githubIssuesTemplate = (0, core_1.createTemplate)({
10
+ name: 'GitHub Issues API',
11
+ description: 'Demo node with multiple operations and credentials',
12
+ path: node_path_1.default.join(__dirname, 'template'),
13
+ });
14
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/template/templates/declarative/github-issues/template.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,wCAA+C;AAElC,QAAA,oBAAoB,GAAG,IAAA,qBAAc,EAAC;IAClD,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,oDAAoD;IACjE,IAAI,EAAE,mBAAI,CAAC,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC;CACtC,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import path from 'node:path';
2
+
3
+ import { createTemplate } from '../../../core';
4
+
5
+ export const githubIssuesTemplate = createTemplate({
6
+ name: 'GitHub Issues API',
7
+ description: 'Demo node with multiple operations and credentials',
8
+ path: path.join(__dirname, 'template'),
9
+ });
@@ -0,0 +1,15 @@
1
+ export declare const templates: {
2
+ readonly declarative: {
3
+ readonly githubIssues: import("../core").TemplateWithRun<object>;
4
+ readonly custom: import("../core").TemplateWithRun<import("./declarative/custom/types").CustomTemplateConfig>;
5
+ };
6
+ readonly programmatic: {
7
+ readonly example: import("../core").TemplateWithRun<object>;
8
+ };
9
+ };
10
+ export type TemplateMap = typeof templates;
11
+ export type TemplateType = keyof TemplateMap;
12
+ export type TemplateName<T extends TemplateType> = keyof TemplateMap[T];
13
+ export declare function getTemplate<T extends TemplateType, N extends TemplateName<T>>(type: T, name: N): TemplateMap[T][N];
14
+ export declare function isTemplateType(val: unknown): val is TemplateType;
15
+ export declare function isTemplateName<T extends TemplateType>(type: T, name: unknown): name is TemplateName<T>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.templates = void 0;
4
+ exports.getTemplate = getTemplate;
5
+ exports.isTemplateType = isTemplateType;
6
+ exports.isTemplateName = isTemplateName;
7
+ const template_1 = require("./declarative/custom/template");
8
+ const template_2 = require("./declarative/github-issues/template");
9
+ const template_3 = require("./programmatic/example/template");
10
+ exports.templates = {
11
+ declarative: {
12
+ githubIssues: template_2.githubIssuesTemplate,
13
+ custom: template_1.customTemplate,
14
+ },
15
+ programmatic: {
16
+ example: template_3.exampleTemplate,
17
+ },
18
+ };
19
+ function getTemplate(type, name) {
20
+ return exports.templates[type][name];
21
+ }
22
+ function isTemplateType(val) {
23
+ return typeof val === 'string' && val in exports.templates;
24
+ }
25
+ function isTemplateName(type, name) {
26
+ return typeof name === 'string' && name in exports.templates[type];
27
+ }
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/template/templates/index.ts"],"names":[],"mappings":";;;AAkBA,kCAKC;AAED,wCAEC;AAED,wCAKC;AAlCD,4DAA+D;AAC/D,mEAA4E;AAC5E,8DAAkE;AAErD,QAAA,SAAS,GAAG;IACxB,WAAW,EAAE;QACZ,YAAY,EAAE,+BAAoB;QAClC,MAAM,EAAE,yBAAc;KACtB;IACD,YAAY,EAAE;QACb,OAAO,EAAE,0BAAe;KACxB;CACQ,CAAC;AAMX,SAAgB,WAAW,CAC1B,IAAO,EACP,IAAO;IAEP,OAAO,iBAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAC9B,CAAC;AAED,SAAgB,cAAc,CAAC,GAAY;IAC1C,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,iBAAS,CAAC;AACpD,CAAC;AAED,SAAgB,cAAc,CAC7B,IAAO,EACP,IAAa;IAEb,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,IAAI,iBAAS,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { customTemplate } from './declarative/custom/template';
2
+ import { githubIssuesTemplate } from './declarative/github-issues/template';
3
+ import { exampleTemplate } from './programmatic/example/template';
4
+
5
+ export const templates = {
6
+ declarative: {
7
+ githubIssues: githubIssuesTemplate,
8
+ custom: customTemplate,
9
+ },
10
+ programmatic: {
11
+ example: exampleTemplate,
12
+ },
13
+ } as const;
14
+
15
+ export type TemplateMap = typeof templates;
16
+ export type TemplateType = keyof TemplateMap;
17
+ export type TemplateName<T extends TemplateType> = keyof TemplateMap[T];
18
+
19
+ export function getTemplate<T extends TemplateType, N extends TemplateName<T>>(
20
+ type: T,
21
+ name: N,
22
+ ): TemplateMap[T][N] {
23
+ return templates[type][name];
24
+ }
25
+
26
+ export function isTemplateType(val: unknown): val is TemplateType {
27
+ return typeof val === 'string' && val in templates;
28
+ }
29
+
30
+ export function isTemplateName<T extends TemplateType>(
31
+ type: T,
32
+ name: unknown,
33
+ ): name is TemplateName<T> {
34
+ return typeof name === 'string' && name in templates[type];
35
+ }
@@ -0,0 +1,46 @@
1
+ # {{nodePackageName}}
2
+
3
+ This is an n8n community node. It lets you use _app/service name_ in your n8n workflows.
4
+
5
+ _App/service name_ is _one or two sentences describing the service this node integrates with_.
6
+
7
+ [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/sustainable-use-license/) workflow automation platform.
8
+
9
+ [Installation](#installation)
10
+ [Operations](#operations)
11
+ [Credentials](#credentials)
12
+ [Compatibility](#compatibility)
13
+ [Usage](#usage)
14
+ [Resources](#resources)
15
+ [Version history](#version-history)
16
+
17
+ ## Installation
18
+
19
+ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
20
+
21
+ ## Operations
22
+
23
+ _List the operations supported by your node._
24
+
25
+ ## Credentials
26
+
27
+ _If users need to authenticate with the app/service, provide details here. You should include prerequisites (such as signing up with the service), available authentication methods, and how to set them up._
28
+
29
+ ## Compatibility
30
+
31
+ _State the minimum n8n version, as well as which versions you test against. You can also include any known version incompatibility issues._
32
+
33
+ ## Usage
34
+
35
+ _This is an optional section. Use it to help users with any difficult or confusing aspects of the node._
36
+
37
+ _By the time users are looking for community nodes, they probably already know n8n basics. But if you expect new users, you can link to the [Try it out](https://docs.n8n.io/try-it-out/) documentation to help them get started._
38
+
39
+ ## Resources
40
+
41
+ * [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
42
+ * _Link to app/service documentation._
43
+
44
+ ## Version history
45
+
46
+ _This is another optional section. If your node has multiple versions, include a short description of available versions and what changed, as well as any compatibility impact._
@@ -0,0 +1,18 @@
1
+ {
2
+ "node": "{{nodePackageName}}",
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
+ }
@@ -0,0 +1,78 @@
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
+ }
@@ -0,0 +1,13 @@
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>
@@ -0,0 +1,13 @@
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>
@@ -0,0 +1,48 @@
1
+ {
2
+ "name": "{{nodePackageName}}",
3
+ "version": "0.1.0",
4
+ "description": "",
5
+ "license": "MIT",
6
+ "homepage": "",
7
+ "keywords": [
8
+ "n8n-community-node-package"
9
+ ],
10
+ "author": {
11
+ "name": "{{user.name}}",
12
+ "email": "{{user.email}}"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "https://github.com/<...>/n8n-nodes-<...>.git"
17
+ },
18
+ "scripts": {
19
+ "build": "n8n-node build",
20
+ "build:watch": "tsc --watch",
21
+ "dev": "n8n-node dev",
22
+ "lint": "n8n-node lint",
23
+ "lint:fix": "n8n-node lint --fix",
24
+ "release": "n8n-node release",
25
+ "prepublishOnly": "n8n-node prerelease"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "n8n": {
31
+ "n8nNodesApiVersion": 1,
32
+ "strict": true,
33
+ "credentials": [],
34
+ "nodes": [
35
+ "dist/nodes/Example/Example.node.js"
36
+ ]
37
+ },
38
+ "devDependencies": {
39
+ "@atom8n/node-cli": "*",
40
+ "eslint": "9.32.0",
41
+ "prettier": "3.6.2",
42
+ "release-it": "^19.0.4",
43
+ "typescript": "5.9.2"
44
+ },
45
+ "peerDependencies": {
46
+ "@atom8n/n8n-workflow": "*"
47
+ }
48
+ }