@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,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 exampleTemplate: 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.exampleTemplate = void 0;
7
+ const node_path_1 = __importDefault(require("node:path"));
8
+ const core_1 = require("../../../core");
9
+ exports.exampleTemplate = (0, core_1.createTemplate)({
10
+ name: 'Example',
11
+ description: 'Barebones example node',
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/programmatic/example/template.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAE7B,wCAA+C;AAElC,QAAA,eAAe,GAAG,IAAA,qBAAc,EAAC;IAC7C,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,wBAAwB;IACrC,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 exampleTemplate = createTemplate({
6
+ name: 'Example',
7
+ description: 'Barebones example node',
8
+ path: path.join(__dirname, 'template'),
9
+ });
@@ -0,0 +1,42 @@
1
+ import type {
2
+ IAuthenticateGeneric,
3
+ ICredentialTestRequest,
4
+ ICredentialType,
5
+ INodeProperties,
6
+ } from 'n8n-workflow';
7
+
8
+ export class ExampleApi implements ICredentialType {
9
+ name = 'exampleApi';
10
+
11
+ displayName = 'Example API';
12
+
13
+ // Link to your community node's README
14
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
15
+
16
+ properties: INodeProperties[] = [
17
+ {
18
+ displayName: 'API Key',
19
+ name: 'apiKey',
20
+ type: 'string',
21
+ typeOptions: { password: true },
22
+ required: true,
23
+ default: '',
24
+ },
25
+ ];
26
+
27
+ authenticate: IAuthenticateGeneric = {
28
+ type: 'generic',
29
+ properties: {
30
+ headers: {
31
+ 'x-api-key': '={{$credentials.apiKey}}',
32
+ },
33
+ },
34
+ };
35
+
36
+ test: ICredentialTestRequest = {
37
+ request: {
38
+ baseURL: 'https://api.example.com/v2',
39
+ url: '/v1/user',
40
+ },
41
+ };
42
+ }
@@ -0,0 +1,50 @@
1
+ import type {
2
+ IAuthenticateGeneric,
3
+ ICredentialTestRequest,
4
+ ICredentialType,
5
+ INodeProperties,
6
+ } from 'n8n-workflow';
7
+
8
+ export class ExampleApi implements ICredentialType {
9
+ name = 'exampleApi';
10
+
11
+ displayName = 'Example API';
12
+
13
+ // Link to your community node's README
14
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
15
+
16
+ properties: INodeProperties[] = [
17
+ {
18
+ displayName: 'Username',
19
+ name: 'username',
20
+ type: 'string',
21
+ default: '',
22
+ },
23
+ {
24
+ displayName: 'Password',
25
+ name: 'password',
26
+ type: 'string',
27
+ typeOptions: {
28
+ password: true,
29
+ },
30
+ default: '',
31
+ },
32
+ ];
33
+
34
+ authenticate: IAuthenticateGeneric = {
35
+ type: 'generic',
36
+ properties: {
37
+ auth: {
38
+ username: '={{$credentials.username}}',
39
+ password: '={{$credentials.password}}',
40
+ },
41
+ },
42
+ };
43
+
44
+ test: ICredentialTestRequest = {
45
+ request: {
46
+ baseURL: 'https://api.example.com/v2',
47
+ url: '/v1/user',
48
+ },
49
+ };
50
+ }
@@ -0,0 +1,42 @@
1
+ import type {
2
+ IAuthenticateGeneric,
3
+ ICredentialTestRequest,
4
+ ICredentialType,
5
+ INodeProperties,
6
+ } from 'n8n-workflow';
7
+
8
+ export class ExampleApi implements ICredentialType {
9
+ name = 'exampleApi';
10
+
11
+ displayName = 'Example API';
12
+
13
+ // Link to your community node's README
14
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
15
+
16
+ properties: INodeProperties[] = [
17
+ {
18
+ displayName: 'Access Token',
19
+ name: 'accessToken',
20
+ type: 'string',
21
+ typeOptions: { password: true },
22
+ required: true,
23
+ default: '',
24
+ },
25
+ ];
26
+
27
+ authenticate: IAuthenticateGeneric = {
28
+ type: 'generic',
29
+ properties: {
30
+ headers: {
31
+ Authorization: '=Bearer {{$credentials.accessToken}}',
32
+ },
33
+ },
34
+ };
35
+
36
+ test: ICredentialTestRequest = {
37
+ request: {
38
+ baseURL: 'https://api.example.com/v2',
39
+ url: '/v1/user',
40
+ },
41
+ };
42
+ }
@@ -0,0 +1,48 @@
1
+ import type {
2
+ IAuthenticateGeneric,
3
+ ICredentialTestRequest,
4
+ ICredentialType,
5
+ INodeProperties,
6
+ } from 'n8n-workflow';
7
+
8
+ export class ExampleApi implements ICredentialType {
9
+ name = 'exampleApi';
10
+
11
+ displayName = 'Example API';
12
+
13
+ // Link to your community node's README
14
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
15
+
16
+ properties: INodeProperties[] = [
17
+ {
18
+ displayName: 'Access Token',
19
+ name: 'accessToken',
20
+ type: 'string',
21
+ typeOptions: { password: true },
22
+ required: true,
23
+ default: '',
24
+ },
25
+ ];
26
+
27
+ authenticate: IAuthenticateGeneric = {
28
+ type: 'generic',
29
+ properties: {
30
+ body: {
31
+ token: '={{$credentials.accessToken}}',
32
+ },
33
+ qs: {
34
+ token: '={{$credentials.accessToken}}',
35
+ },
36
+ headers: {
37
+ Authorization: '=Bearer {{$credentials.accessToken}}',
38
+ },
39
+ },
40
+ };
41
+
42
+ test: ICredentialTestRequest = {
43
+ request: {
44
+ baseURL: 'https://api.example.com/v2',
45
+ url: '/v1/user',
46
+ },
47
+ };
48
+ }
@@ -0,0 +1,51 @@
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+
3
+ export class ExampleOAuth2Api implements ICredentialType {
4
+ name = 'exampleOAuth2Api';
5
+
6
+ extends = ['oAuth2Api'];
7
+
8
+ displayName = 'Example OAuth2 API';
9
+
10
+ // Link to your community node's README
11
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
12
+
13
+ properties: INodeProperties[] = [
14
+ {
15
+ displayName: 'Grant Type',
16
+ name: 'grantType',
17
+ type: 'hidden',
18
+ default: 'authorizationCode',
19
+ },
20
+ {
21
+ displayName: 'Authorization URL',
22
+ name: 'authUrl',
23
+ type: 'hidden',
24
+ default: 'https://api.example.com/oauth/authorize',
25
+ },
26
+ {
27
+ displayName: 'Access Token URL',
28
+ name: 'accessTokenUrl',
29
+ type: 'hidden',
30
+ default: 'https://api.example.com/oauth/token',
31
+ },
32
+ {
33
+ displayName: 'Auth URI Query Parameters',
34
+ name: 'authQueryParameters',
35
+ type: 'hidden',
36
+ default: '',
37
+ },
38
+ {
39
+ displayName: 'Scope',
40
+ name: 'scope',
41
+ type: 'hidden',
42
+ default: 'users:read users:write companies:read',
43
+ },
44
+ {
45
+ displayName: 'Authentication',
46
+ name: 'authentication',
47
+ type: 'hidden',
48
+ default: 'header',
49
+ },
50
+ ];
51
+ }
@@ -0,0 +1,45 @@
1
+ import type { ICredentialType, INodeProperties } from 'n8n-workflow';
2
+
3
+ export class ExampleOAuth2Api implements ICredentialType {
4
+ name = 'exampleOAuth2Api';
5
+
6
+ extends = ['oAuth2Api'];
7
+
8
+ displayName = 'Example OAuth2 API';
9
+
10
+ // Link to your community node's README
11
+ documentationUrl = 'https://github.com/org/repo?tab=readme-ov-file#credentials';
12
+
13
+ properties: INodeProperties[] = [
14
+ {
15
+ displayName: 'Grant Type',
16
+ name: 'grantType',
17
+ type: 'hidden',
18
+ default: 'clientCredentials',
19
+ },
20
+ {
21
+ displayName: 'Access Token URL',
22
+ name: 'accessTokenUrl',
23
+ type: 'hidden',
24
+ default: 'https://api.example.com/oauth/token',
25
+ },
26
+ {
27
+ displayName: 'Auth URI Query Parameters',
28
+ name: 'authQueryParameters',
29
+ type: 'hidden',
30
+ default: '',
31
+ },
32
+ {
33
+ displayName: 'Scope',
34
+ name: 'scope',
35
+ type: 'hidden',
36
+ default: 'users:read users:write companies:read',
37
+ },
38
+ {
39
+ displayName: 'Authentication',
40
+ name: 'authentication',
41
+ type: 'hidden',
42
+ default: 'body',
43
+ },
44
+ ];
45
+ }
@@ -0,0 +1,28 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Use Node.js
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '22'
20
+
21
+ - name: Install dependencies
22
+ run: '{{packageManager.name}} {{packageManager.installCommand}}'
23
+
24
+ - name: Run lint
25
+ run: '{{packageManager.name}} run lint'
26
+
27
+ - name: Run build
28
+ run: '{{packageManager.name}} run build'
@@ -0,0 +1,51 @@
1
+ module.exports = {
2
+ /**
3
+ * https://prettier.io/docs/en/options.html#semicolons
4
+ */
5
+ semi: true,
6
+
7
+ /**
8
+ * https://prettier.io/docs/en/options.html#trailing-commas
9
+ */
10
+ trailingComma: 'all',
11
+
12
+ /**
13
+ * https://prettier.io/docs/en/options.html#bracket-spacing
14
+ */
15
+ bracketSpacing: true,
16
+
17
+ /**
18
+ * https://prettier.io/docs/en/options.html#tabs
19
+ */
20
+ useTabs: true,
21
+
22
+ /**
23
+ * https://prettier.io/docs/en/options.html#tab-width
24
+ */
25
+ tabWidth: 2,
26
+
27
+ /**
28
+ * https://prettier.io/docs/en/options.html#arrow-function-parentheses
29
+ */
30
+ arrowParens: 'always',
31
+
32
+ /**
33
+ * https://prettier.io/docs/en/options.html#quotes
34
+ */
35
+ singleQuote: true,
36
+
37
+ /**
38
+ * https://prettier.io/docs/en/options.html#quote-props
39
+ */
40
+ quoteProps: 'as-needed',
41
+
42
+ /**
43
+ * https://prettier.io/docs/en/options.html#end-of-line
44
+ */
45
+ endOfLine: 'lf',
46
+
47
+ /**
48
+ * https://prettier.io/docs/en/options.html#print-width
49
+ */
50
+ printWidth: 100,
51
+ };
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "Attach to running n8n",
6
+ "processId": "${command:PickProcess}",
7
+ "request": "attach",
8
+ "skipFiles": ["<node_internals>/**"],
9
+ "type": "node"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,3 @@
1
+ import { config } from '@n8n/node-cli/eslint';
2
+
3
+ export default config;
@@ -0,0 +1,11 @@
1
+ import { type ClassDeclaration, type ObjectLiteralExpression } from 'ts-morph';
2
+ export declare const loadSingleSourceFile: (path: string) => import("ts-morph").SourceFile;
3
+ export declare const updateStringProperty: ({ obj, key, value, }: {
4
+ obj: ObjectLiteralExpression | ClassDeclaration;
5
+ key: string;
6
+ value: string;
7
+ }) => void;
8
+ export declare const getChildObjectLiteral: ({ obj, key, }: {
9
+ obj: ObjectLiteralExpression;
10
+ key: string;
11
+ }) => ObjectLiteralExpression;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getChildObjectLiteral = exports.updateStringProperty = exports.loadSingleSourceFile = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const loadSingleSourceFile = (path) => {
6
+ const project = new ts_morph_1.Project({
7
+ skipFileDependencyResolution: true,
8
+ });
9
+ return project.addSourceFileAtPath(path);
10
+ };
11
+ exports.loadSingleSourceFile = loadSingleSourceFile;
12
+ const setStringInitializer = (prop, value) => {
13
+ prop.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.StringLiteral).setLiteralValue(value);
14
+ };
15
+ const updateStringProperty = ({ obj, key, value, }) => {
16
+ const prop = obj.getPropertyOrThrow(key);
17
+ if (prop.isKind(ts_morph_1.SyntaxKind.PropertyAssignment)) {
18
+ setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment), value);
19
+ }
20
+ else if (prop.isKind(ts_morph_1.SyntaxKind.PropertyDeclaration)) {
21
+ setStringInitializer(prop.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyDeclaration), value);
22
+ }
23
+ };
24
+ exports.updateStringProperty = updateStringProperty;
25
+ const getChildObjectLiteral = ({ obj, key, }) => {
26
+ return obj
27
+ .getPropertyOrThrow(key)
28
+ .asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment)
29
+ .getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression);
30
+ };
31
+ exports.getChildObjectLiteral = getChildObjectLiteral;
32
+ //# sourceMappingURL=ast.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/utils/ast.ts"],"names":[],"mappings":";;;AAAA,uCAOkB;AAEX,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,EAAE;IACpD,MAAM,OAAO,GAAG,IAAI,kBAAO,CAAC;QAC3B,4BAA4B,EAAE,IAAI;KAClC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B;AAEF,MAAM,oBAAoB,GAAG,CAAC,IAA8C,EAAE,KAAa,EAAE,EAAE;IAC9F,IAAI,CAAC,2BAA2B,CAAC,qBAAU,CAAC,aAAa,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AACnF,CAAC,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAAC,EACpC,GAAG,EACH,GAAG,EACH,KAAK,GAC4E,EAAE,EAAE;IACrF,MAAM,IAAI,GAAG,GAAG,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAEzC,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAU,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAChD,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAU,CAAC,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC;IAChF,CAAC;SAAM,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAU,CAAC,mBAAmB,CAAC,EAAE,CAAC;QACxD,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,qBAAU,CAAC,mBAAmB,CAAC,EAAE,KAAK,CAAC,CAAC;IACjF,CAAC;AACF,CAAC,CAAC;AAZW,QAAA,oBAAoB,wBAY/B;AAEK,MAAM,qBAAqB,GAAG,CAAC,EACrC,GAAG,EACH,GAAG,GAC4C,EAAE,EAAE;IACnD,OAAO,GAAG;SACR,kBAAkB,CAAC,GAAG,CAAC;SACvB,aAAa,CAAC,qBAAU,CAAC,kBAAkB,CAAC;SAC5C,2BAA2B,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC;AACnE,CAAC,CAAC;AARW,QAAA,qBAAqB,yBAQhC"}
@@ -0,0 +1,17 @@
1
+ import { type StdioOptions } from 'node:child_process';
2
+ export declare class ChildProcessError extends Error {
3
+ code: number | null;
4
+ signal: NodeJS.Signals | null;
5
+ constructor(message: string, code: number | null, signal: NodeJS.Signals | null);
6
+ }
7
+ export declare function runCommand(cmd: string, args?: string[], opts?: {
8
+ cwd?: string;
9
+ env?: NodeJS.ProcessEnv;
10
+ stdio?: StdioOptions;
11
+ context?: 'local' | 'global';
12
+ printOutput?: (options: {
13
+ stdout: Buffer[];
14
+ stderr: Buffer[];
15
+ }) => void;
16
+ alwaysPrintOutput?: boolean;
17
+ }): Promise<void>;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChildProcessError = void 0;
4
+ exports.runCommand = runCommand;
5
+ const node_child_process_1 = require("node:child_process");
6
+ const package_manager_1 = require("./package-manager");
7
+ class ChildProcessError extends Error {
8
+ constructor(message, code, signal) {
9
+ super(message);
10
+ this.code = code;
11
+ this.signal = signal;
12
+ }
13
+ }
14
+ exports.ChildProcessError = ChildProcessError;
15
+ async function runCommand(cmd, args = [], opts = {}) {
16
+ const packageManager = (await (0, package_manager_1.detectPackageManager)()) ?? 'npm';
17
+ return await new Promise((resolve, reject) => {
18
+ const options = {
19
+ cwd: opts.cwd,
20
+ env: { ...process.env, ...opts.env },
21
+ stdio: opts.stdio ?? ['ignore', 'pipe', 'pipe'],
22
+ shell: process.platform === 'win32',
23
+ };
24
+ const child = opts.context === 'local'
25
+ ? (0, node_child_process_1.spawn)(packageManager, ['exec', '--', cmd, ...args], options)
26
+ : (0, node_child_process_1.spawn)(cmd, args, options);
27
+ const stdoutBuffers = [];
28
+ const stderrBuffers = [];
29
+ child.stdout?.on('data', (data) => {
30
+ stdoutBuffers.push(data);
31
+ });
32
+ child.stderr?.on('data', (data) => {
33
+ stderrBuffers.push(data);
34
+ });
35
+ function printOutput() {
36
+ if (opts.printOutput) {
37
+ opts.printOutput({ stdout: stdoutBuffers, stderr: stderrBuffers });
38
+ return;
39
+ }
40
+ for (const buffer of stdoutBuffers) {
41
+ process.stdout.write(buffer);
42
+ }
43
+ for (const buffer of stderrBuffers) {
44
+ process.stderr.write(buffer);
45
+ }
46
+ }
47
+ child.on('error', (error) => {
48
+ printOutput();
49
+ reject(new ChildProcessError(error.message, null, null));
50
+ });
51
+ child.on('close', (code, signal) => {
52
+ if (code === 0) {
53
+ if (opts.alwaysPrintOutput) {
54
+ printOutput();
55
+ }
56
+ resolve();
57
+ }
58
+ else {
59
+ printOutput();
60
+ reject(new ChildProcessError(`${cmd} exited with code ${code}${signal ? ` (signal: ${signal})` : ''}`, code, signal));
61
+ }
62
+ });
63
+ });
64
+ }
65
+ //# sourceMappingURL=child-process.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"child-process.js","sourceRoot":"","sources":["../../src/utils/child-process.ts"],"names":[],"mappings":";;;AAcA,gCAyEC;AAvFD,2D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AAI,EACJ,MAAM,CACN,CACD,CAAC;YACH,CAAC;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ type ExecCommandType = 'cli' | 'script';
2
+ export declare function getExecCommand(type?: ExecCommandType): Promise<string>;
3
+ export declare function formatCommand(command: string): string;
4
+ export declare function suggestCloudSupportCommand(action: 'enable' | 'disable'): Promise<string>;
5
+ export declare function suggestLintCommand(): Promise<string>;
6
+ export {};
@@ -0,0 +1,30 @@
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.getExecCommand = getExecCommand;
7
+ exports.formatCommand = formatCommand;
8
+ exports.suggestCloudSupportCommand = suggestCloudSupportCommand;
9
+ exports.suggestLintCommand = suggestLintCommand;
10
+ const picocolors_1 = __importDefault(require("picocolors"));
11
+ const package_manager_1 = require("./package-manager");
12
+ async function getExecCommand(type = 'cli') {
13
+ const packageManager = (await (0, package_manager_1.detectPackageManager)()) ?? 'npm';
14
+ if (type === 'script') {
15
+ return packageManager === 'npm' ? 'npm run' : packageManager;
16
+ }
17
+ return packageManager === 'npm' ? 'npx' : packageManager;
18
+ }
19
+ function formatCommand(command) {
20
+ return picocolors_1.default.cyan(command);
21
+ }
22
+ async function suggestCloudSupportCommand(action) {
23
+ const execCommand = await getExecCommand('cli');
24
+ return formatCommand(`${execCommand} n8n-node cloud-support ${action}`);
25
+ }
26
+ async function suggestLintCommand() {
27
+ const execCommand = await getExecCommand('script');
28
+ return formatCommand(`${execCommand} lint`);
29
+ }
30
+ //# sourceMappingURL=command-suggestions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command-suggestions.js","sourceRoot":"","sources":["../../src/utils/command-suggestions.ts"],"names":[],"mappings":";;;;;AAMA,wCAQC;AAED,sCAEC;AAED,gEAGC;AAED,gDAGC;AA5BD,4DAAoC;AAEpC,uDAAyD;AAIlD,KAAK,UAAU,cAAc,CAAC,OAAwB,KAAK;IACjE,MAAM,cAAc,GAAG,CAAC,MAAM,IAAA,sCAAoB,GAAE,CAAC,IAAI,KAAK,CAAC;IAE/D,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvB,OAAO,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;IAC9D,CAAC;IAED,OAAO,cAAc,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,cAAc,CAAC;AAC1D,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe;IAC5C,OAAO,oBAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAEM,KAAK,UAAU,0BAA0B,CAAC,MAA4B;IAC5E,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,aAAa,CAAC,GAAG,WAAW,2BAA2B,MAAM,EAAE,CAAC,CAAC;AACzE,CAAC;AAEM,KAAK,UAAU,kBAAkB;IACvC,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAC;IACnD,OAAO,aAAa,CAAC,GAAG,WAAW,OAAO,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,12 @@
1
+ export declare function folderExists(dir: string): Promise<boolean>;
2
+ export declare function copyFolder({ source: source, destination, ignore, }: {
3
+ source: string;
4
+ destination: string;
5
+ ignore?: string[];
6
+ }): Promise<void>;
7
+ export declare function delayAtLeast<T>(promise: Promise<T>, minMs: number): Promise<T>;
8
+ export declare function writeFileSafe(filePath: string, contents: string | Uint8Array): Promise<void>;
9
+ export declare function ensureFolder(dir: string): Promise<string | undefined>;
10
+ export declare function renameFilesInDirectory(dirPath: string, oldName: string, newName: string): Promise<void>;
11
+ export declare function renameDirectory(oldDirPath: string, newDirName: string): Promise<string>;
12
+ export declare function createSymlink(target: string, linkPath: string): Promise<void>;