n8n-nodes-test-node 1.0.15 → 1.0.17

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "n8n-nodes-test-node",
3
- "version": "1.0.15",
4
- "description": "OpenAPI 3 specification for the Gofile REST API, based on the official Gofile API documentation last updated May 16, 2025. Gofile is a beta API and may change. Authentication uses an API token as a Bearer token in the Authorization header. Most endpoints require a premium account; basic operations such as uploading, creating folders, renaming content, and removing content are available to free accounts.",
3
+ "version": "1.0.17",
4
+ "description": "GitHub's v3 REST API.",
5
5
  "keywords": [
6
6
  "n8n-community-node-package"
7
7
  ],
@@ -16,19 +16,16 @@
16
16
  "n8n": {
17
17
  "n8nNodesApiVersion": 1,
18
18
  "credentials": [
19
- "dist/GofileAPIApi.credentials.js"
19
+ "dist/GitHubV3RESTAPIApi.credentials.js"
20
20
  ],
21
21
  "nodes": [
22
- "dist/GofileAPINode.node.js",
23
- "dist/GofileAPIToolNode.node.js",
24
- "dist/GofileAPIFilesNode.node.js",
25
- "dist/GofileAPIFilesToolNode.node.js"
22
+ "dist/GitHubV3RESTAPINode.node.js",
23
+ "dist/GitHubV3RESTAPIToolNode.node.js"
26
24
  ]
27
25
  },
28
26
  "devDependencies": {
29
27
  "typescript": "^5.5.4",
30
- "n8n-workflow": "*",
31
- "@types/node": "^20.0.0"
28
+ "n8n-workflow": "*"
32
29
  },
33
30
  "peerDependencies": {
34
31
  "n8n-workflow": "*"
@@ -1,9 +0,0 @@
1
- import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
- export declare class GofileAPIApi implements ICredentialType {
3
- name: string;
4
- displayName: string;
5
- documentationUrl: string;
6
- properties: INodeProperties[];
7
- authenticate: IAuthenticateGeneric;
8
- test: ICredentialTestRequest;
9
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GofileAPIApi = void 0;
4
- class GofileAPIApi {
5
- constructor() {
6
- this.name = 'gofileAPIApi';
7
- this.displayName = 'Gofile API';
8
- this.documentationUrl = '';
9
- this.properties = [
10
- {
11
- displayName: 'Base URL',
12
- name: 'baseUrl',
13
- type: 'string',
14
- default: 'https://api.gofile.io',
15
- required: true,
16
- description: 'Base URL every request is sent to. Change this to point the node at a different environment (staging, self-hosted, etc.).',
17
- },
18
- {
19
- displayName: 'Bearer Token',
20
- name: 'bearerAuthToken',
21
- type: 'string',
22
- typeOptions: { password: true },
23
- default: '',
24
- required: true,
25
- description: 'Sent as "Authorization: Bearer <token>" on every request.',
26
- },
27
- ];
28
- this.authenticate = {
29
- type: 'generic',
30
- properties: {
31
- headers: {
32
- Authorization: '=Bearer {{$credentials.bearerAuthToken}}',
33
- },
34
- },
35
- };
36
- this.test = {
37
- request: {
38
- baseURL: '={{$credentials.baseUrl}}',
39
- url: '/accounts/getid',
40
- method: 'GET',
41
- },
42
- };
43
- }
44
- }
45
- exports.GofileAPIApi = GofileAPIApi;
@@ -1,5 +0,0 @@
1
- import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class GofileAPIFilesNode implements INodeType {
3
- description: INodeTypeDescription;
4
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
- }
@@ -1,119 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GofileAPIFilesNode = void 0;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const CREDENTIAL_TYPE_NAME = 'gofileAPIApi';
6
- class GofileAPIFilesNode {
7
- constructor() {
8
- this.description = {
9
- displayName: 'Gofile API Files',
10
- name: 'gofileAPIFiles',
11
- icon: 'file:icon.svg',
12
- group: ['transform'],
13
- version: 1,
14
- subtitle: '={{$parameter["operation"] + ($parameter["resource"] ? " " + $parameter["resource"] : "")}}',
15
- description: 'File upload/download operations for the Gofile API API that need real binary handling (a separate, hand-written node -- see README).',
16
- defaults: {
17
- name: 'Gofile API Files',
18
- },
19
- inputs: ['main'],
20
- outputs: ['main'],
21
- credentials: [
22
- {
23
- name: CREDENTIAL_TYPE_NAME,
24
- required: true,
25
- },
26
- ],
27
- properties: [
28
- {
29
- displayName: 'Operation',
30
- name: 'operation',
31
- type: 'options',
32
- noDataExpression: true,
33
- options: [
34
- {
35
- name: 'Upload A File',
36
- value: 'uploadFile',
37
- action: 'Upload a file',
38
- description: 'Uploads a file to Gofile. If folderId is omitted, Gofile creates a new public folder. Regional upload hosts may be selected by changing the server URL. The official documentation states that the API uses Bearer-token authentication.',
39
- },
40
- ],
41
- default: 'uploadFile',
42
- },
43
- {
44
- displayName: 'Input Binary Field',
45
- name: 'binaryPropertyName',
46
- type: 'string',
47
- default: 'data',
48
- required: true,
49
- description: 'File to upload.',
50
- displayOptions: {
51
- show: {
52
- operation: ['uploadFile'],
53
- },
54
- },
55
- },
56
- {
57
- displayName: 'Folder Id',
58
- name: 'folderId',
59
- type: 'string',
60
- default: '',
61
- required: false,
62
- description: 'Destination folder ID. If omitted, a new public folder is created.',
63
- displayOptions: {
64
- show: {
65
- operation: ['uploadFile'],
66
- },
67
- },
68
- },
69
- ],
70
- };
71
- }
72
- async execute() {
73
- var _a;
74
- const items = this.getInputData();
75
- const returnData = [];
76
- const credentials = await this.getCredentials(CREDENTIAL_TYPE_NAME);
77
- const baseUrl = credentials.baseUrl;
78
- for (let i = 0; i < items.length; i++) {
79
- try {
80
- const operation = this.getNodeParameter('operation', i);
81
- switch (operation) {
82
- case 'uploadFile': {
83
- const url = `${baseUrl}/uploadfile`;
84
- const inputBinaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
85
- const fileBinaryData = this.helpers.assertBinaryData(i, inputBinaryPropertyName);
86
- const fileBuffer = await this.helpers.getBinaryDataBuffer(i, inputBinaryPropertyName);
87
- const formData = new FormData();
88
- formData.append('file', new Blob([fileBuffer], { type: fileBinaryData.mimeType }), fileBinaryData.fileName || 'file');
89
- formData.append('folderId', String(this.getNodeParameter('folderId', i, '')));
90
- const response = (await this.helpers.httpRequestWithAuthentication.call(this, CREDENTIAL_TYPE_NAME, {
91
- method: 'POST',
92
- url,
93
- body: formData,
94
- returnFullResponse: true,
95
- }));
96
- returnData.push({
97
- json: ((_a = response.body) !== null && _a !== void 0 ? _a : {}),
98
- pairedItem: { item: i },
99
- });
100
- break;
101
- }
102
- default:
103
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, {
104
- itemIndex: i,
105
- });
106
- }
107
- }
108
- catch (error) {
109
- if (this.continueOnFail()) {
110
- returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
111
- continue;
112
- }
113
- throw error;
114
- }
115
- }
116
- return [returnData];
117
- }
118
- }
119
- exports.GofileAPIFilesNode = GofileAPIFilesNode;
@@ -1,5 +0,0 @@
1
- import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
- export declare class GofileAPIFilesToolNode implements INodeType {
3
- description: INodeTypeDescription;
4
- execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
5
- }
@@ -1,120 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GofileAPIFilesToolNode = void 0;
4
- const n8n_workflow_1 = require("n8n-workflow");
5
- const CREDENTIAL_TYPE_NAME = 'gofileAPIApi';
6
- class GofileAPIFilesToolNode {
7
- constructor() {
8
- this.description = {
9
- displayName: 'Gofile API Files Tool',
10
- name: 'gofileAPIFilesTool',
11
- icon: 'file:icon.svg',
12
- group: ['transform'],
13
- version: 1,
14
- subtitle: '={{$parameter["operation"] + ($parameter["resource"] ? " " + $parameter["resource"] : "")}}',
15
- description: 'Use this tool to upload or download files via the Gofile API API.',
16
- usableAsTool: true,
17
- defaults: {
18
- name: 'Gofile API Files Tool',
19
- },
20
- inputs: ['main'],
21
- outputs: ['main'],
22
- credentials: [
23
- {
24
- name: CREDENTIAL_TYPE_NAME,
25
- required: true,
26
- },
27
- ],
28
- properties: [
29
- {
30
- displayName: 'Operation',
31
- name: 'operation',
32
- type: 'options',
33
- noDataExpression: true,
34
- options: [
35
- {
36
- name: 'Upload A File',
37
- value: 'uploadFile',
38
- action: 'Upload a file',
39
- description: 'Uploads a file to Gofile. If folderId is omitted, Gofile creates a new public folder. Regional upload hosts may be selected by changing the server URL. The official documentation states that the API uses Bearer-token authentication.',
40
- },
41
- ],
42
- default: 'uploadFile',
43
- },
44
- {
45
- displayName: 'Input Binary Field',
46
- name: 'binaryPropertyName',
47
- type: 'string',
48
- default: 'data',
49
- required: true,
50
- description: 'File to upload.',
51
- displayOptions: {
52
- show: {
53
- operation: ['uploadFile'],
54
- },
55
- },
56
- },
57
- {
58
- displayName: 'Folder Id',
59
- name: 'folderId',
60
- type: 'string',
61
- default: '',
62
- required: false,
63
- description: 'Destination folder ID. If omitted, a new public folder is created.',
64
- displayOptions: {
65
- show: {
66
- operation: ['uploadFile'],
67
- },
68
- },
69
- },
70
- ],
71
- };
72
- }
73
- async execute() {
74
- var _a;
75
- const items = this.getInputData();
76
- const returnData = [];
77
- const credentials = await this.getCredentials(CREDENTIAL_TYPE_NAME);
78
- const baseUrl = credentials.baseUrl;
79
- for (let i = 0; i < items.length; i++) {
80
- try {
81
- const operation = this.getNodeParameter('operation', i);
82
- switch (operation) {
83
- case 'uploadFile': {
84
- const url = `${baseUrl}/uploadfile`;
85
- const inputBinaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
86
- const fileBinaryData = this.helpers.assertBinaryData(i, inputBinaryPropertyName);
87
- const fileBuffer = await this.helpers.getBinaryDataBuffer(i, inputBinaryPropertyName);
88
- const formData = new FormData();
89
- formData.append('file', new Blob([fileBuffer], { type: fileBinaryData.mimeType }), fileBinaryData.fileName || 'file');
90
- formData.append('folderId', String(this.getNodeParameter('folderId', i, '')));
91
- const response = (await this.helpers.httpRequestWithAuthentication.call(this, CREDENTIAL_TYPE_NAME, {
92
- method: 'POST',
93
- url,
94
- body: formData,
95
- returnFullResponse: true,
96
- }));
97
- returnData.push({
98
- json: ((_a = response.body) !== null && _a !== void 0 ? _a : {}),
99
- pairedItem: { item: i },
100
- });
101
- break;
102
- }
103
- default:
104
- throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown operation: ${operation}`, {
105
- itemIndex: i,
106
- });
107
- }
108
- }
109
- catch (error) {
110
- if (this.continueOnFail()) {
111
- returnData.push({ json: { error: error.message }, pairedItem: { item: i } });
112
- continue;
113
- }
114
- throw error;
115
- }
116
- }
117
- return [returnData];
118
- }
119
- }
120
- exports.GofileAPIFilesToolNode = GofileAPIFilesToolNode;