n8n-nodes-hackclub-ships 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -0
- package/dist/credentials/HackClubShipsApi.credentials.d.ts +14 -0
- package/dist/credentials/HackClubShipsApi.credentials.js +27 -0
- package/dist/credentials/HackClubShipsApi.credentials.js.map +1 -0
- package/dist/nodes/HackClubShips/HackClubShips.node.d.ts +6 -0
- package/dist/nodes/HackClubShips/HackClubShips.node.js +71 -0
- package/dist/nodes/HackClubShips/HackClubShips.node.js.map +1 -0
- package/dist/nodes/HackClubShips/hackclubships.svg +4 -0
- package/package.json +54 -0
package/README.md
ADDED
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class HackClubShipsApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
properties: INodeProperties[];
|
|
6
|
+
authenticate: {
|
|
7
|
+
type: "generic";
|
|
8
|
+
properties: {
|
|
9
|
+
headers: {
|
|
10
|
+
Authorization: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HackClubShipsApi = void 0;
|
|
4
|
+
class HackClubShipsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = 'hackClubShipsApi';
|
|
7
|
+
this.displayName = 'Hack Club Ships API';
|
|
8
|
+
this.properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'API Key',
|
|
11
|
+
name: 'apiKey',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
this.authenticate = {
|
|
17
|
+
type: 'generic',
|
|
18
|
+
properties: {
|
|
19
|
+
headers: {
|
|
20
|
+
Authorization: 'Bearer {{$credentials.apiKey}}',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.HackClubShipsApi = HackClubShipsApi;
|
|
27
|
+
//# sourceMappingURL=HackClubShipsApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HackClubShipsApi.credentials.js","sourceRoot":"","sources":["../../credentials/HackClubShipsApi.credentials.ts"],"names":[],"mappings":";;;AAEA,MAAa,gBAAgB;IAA7B;QACI,SAAI,GAAG,kBAAkB,CAAC;QAC1B,gBAAW,GAAG,qBAAqB,CAAC;QACpC,eAAU,GAAsB;YAC5B;gBACI,WAAW,EAAE,SAAS;gBACtB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACd;SACJ,CAAC;QAEF,iBAAY,GAAG;YACX,IAAI,EAAE,SAAkB;YACxB,UAAU,EAAE;gBACR,OAAO,EAAE;oBACL,aAAa,EAAE,gCAAgC;iBAClD;aACJ;SACJ,CAAC;IACN,CAAC;CAAA;AApBD,4CAoBC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
3
|
+
export declare class HackClubShips implements INodeType {
|
|
4
|
+
description: INodeTypeDescription;
|
|
5
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HackClubShips = void 0;
|
|
4
|
+
class HackClubShips {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.description = {
|
|
7
|
+
displayName: 'Hack Club Ships',
|
|
8
|
+
name: 'hackClubShips',
|
|
9
|
+
group: ['transform'],
|
|
10
|
+
version: 1,
|
|
11
|
+
description: 'Interact with Hack Club Ships API',
|
|
12
|
+
defaults: {
|
|
13
|
+
name: 'Hack Club Ships',
|
|
14
|
+
},
|
|
15
|
+
inputs: ['main'],
|
|
16
|
+
outputs: ['main'],
|
|
17
|
+
credentials: [
|
|
18
|
+
{
|
|
19
|
+
name: 'hackClubShipsApi',
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
properties: [
|
|
24
|
+
{
|
|
25
|
+
displayName: 'Endpoint',
|
|
26
|
+
name: 'endpoint',
|
|
27
|
+
type: 'options',
|
|
28
|
+
options: [
|
|
29
|
+
{
|
|
30
|
+
name: 'YSWS Entries',
|
|
31
|
+
value: '/api/v1/ysws_entries',
|
|
32
|
+
description: 'Get YSWS entries',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Stats',
|
|
36
|
+
value: '/api/v1/stats',
|
|
37
|
+
description: 'Get stats',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Me',
|
|
41
|
+
value: '/api/v1/me',
|
|
42
|
+
description: 'Get your user info (requires API key)',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Dashboard',
|
|
46
|
+
value: '/api/v1/dashboard',
|
|
47
|
+
description: 'Get dashboard info (requires API key)',
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
default: '/api/v1/ysws_entries',
|
|
51
|
+
description: 'Select the API endpoint to call',
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async execute() {
|
|
57
|
+
const items = this.getInputData();
|
|
58
|
+
const returnData = [];
|
|
59
|
+
const endpoint = this.getNodeParameter('endpoint', 0);
|
|
60
|
+
for (let i = 0; i < items.length; i++) {
|
|
61
|
+
const responseData = await this.helpers.requestWithAuthentication.call(this, 'hackClubShipsApi', {
|
|
62
|
+
method: 'GET',
|
|
63
|
+
url: `https://api.ships.hackclub.com${endpoint}`,
|
|
64
|
+
});
|
|
65
|
+
returnData.push({ json: responseData });
|
|
66
|
+
}
|
|
67
|
+
return [returnData];
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.HackClubShips = HackClubShips;
|
|
71
|
+
//# sourceMappingURL=HackClubShips.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HackClubShips.node.js","sourceRoot":"","sources":["../../../nodes/HackClubShips/HackClubShips.node.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAA1B;QACI,gBAAW,GAAyB;YAChC,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,eAAe;YACrB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE;gBACN,IAAI,EAAE,iBAAiB;aAC1B;YACD,MAAM,EAAE,CAAC,MAAM,CAAC;YAChB,OAAO,EAAE,CAAC,MAAM,CAAC;YACjB,WAAW,EAAE;gBACT;oBACI,IAAI,EAAE,kBAAkB;oBACxB,QAAQ,EAAE,IAAI;iBACjB;aACJ;YACD,UAAU,EAAE;gBACR;oBACI,WAAW,EAAE,UAAU;oBACvB,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE;wBACL;4BACI,IAAI,EAAE,cAAc;4BACpB,KAAK,EAAE,sBAAsB;4BAC7B,WAAW,EAAE,kBAAkB;yBAClC;wBACD;4BACI,IAAI,EAAE,OAAO;4BACb,KAAK,EAAE,eAAe;4BACtB,WAAW,EAAE,WAAW;yBAC3B;wBACD;4BACI,IAAI,EAAE,IAAI;4BACV,KAAK,EAAE,YAAY;4BACnB,WAAW,EAAE,uCAAuC;yBACvD;wBACD;4BACI,IAAI,EAAE,WAAW;4BACjB,KAAK,EAAE,mBAAmB;4BAC1B,WAAW,EAAE,uCAAuC;yBACvD;qBACJ;oBACD,OAAO,EAAE,sBAAsB;oBAC/B,WAAW,EAAE,iCAAiC;iBACjD;aACJ;SACJ,CAAC;IAoBN,CAAC;IAlBG,KAAK,CAAC,OAAO;QACT,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,UAAU,GAAyB,EAAE,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC,CAAW,CAAC;QAEhE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACpC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAClE,IAAI,EACJ,kBAAkB,EAClB;gBACI,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,iCAAiC,QAAQ,EAAE;aACnD,CACJ,CAAC;YACF,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;CACJ;AArED,sCAqEC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "n8n-nodes-hackclub-ships",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "n8n community node for Hack Club Ships API",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"n8n-community-node-package",
|
|
7
|
+
"hackclub",
|
|
8
|
+
"ships"
|
|
9
|
+
],
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"homepage": "",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "Christian"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": ""
|
|
18
|
+
},
|
|
19
|
+
"main": "index.js",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsc && gulp build:icons",
|
|
22
|
+
"dev": "tsc --watch",
|
|
23
|
+
"format": "prettier nodes credentials --write",
|
|
24
|
+
"lint": "eslint nodes credentials package.json",
|
|
25
|
+
"lintfix": "eslint nodes credentials package.json --fix",
|
|
26
|
+
"prepublishOnly": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"n8n": {
|
|
32
|
+
"n8nNodesApiVersion": 1,
|
|
33
|
+
"credentials": [
|
|
34
|
+
"dist/credentials/HackClubShipsApi.credentials.js"
|
|
35
|
+
],
|
|
36
|
+
"nodes": [
|
|
37
|
+
"dist/nodes/HackClubShips/HackClubShips.node.js"
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@types/node": "^20.10.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
43
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
44
|
+
"eslint": "^8.56.0",
|
|
45
|
+
"eslint-plugin-n8n-nodes-base": "^1.16.1",
|
|
46
|
+
"gulp": "^4.0.2",
|
|
47
|
+
"n8n-workflow": "^1.0.0",
|
|
48
|
+
"prettier": "^3.1.0",
|
|
49
|
+
"typescript": "^5.3.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"n8n-workflow": "*"
|
|
53
|
+
}
|
|
54
|
+
}
|