n8n-nodes-vestaboard-note 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.
@@ -0,0 +1,2 @@
1
+ import type { CharacterMatrix } from './types';
2
+ export declare function renderSvgGrid(characters: CharacterMatrix): string;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.renderSvgGrid = renderSvgGrid;
4
+ const characterCodes_1 = require("./characterCodes");
5
+ const CELL_WIDTH = 48;
6
+ const CELL_HEIGHT = 60;
7
+ const CELL_GAP = 4;
8
+ const PADDING = 16;
9
+ const TILE_COLORS = {
10
+ 63: '#e53935',
11
+ 64: '#fb8c00',
12
+ 65: '#fdd835',
13
+ 66: '#43a047',
14
+ 67: '#1e88e5',
15
+ 68: '#8e24aa',
16
+ 69: '#f5f5f5',
17
+ 70: '#050505',
18
+ 71: '#f5f5f5',
19
+ };
20
+ function escapeXml(value) {
21
+ return value
22
+ .replace(/&/g, '&')
23
+ .replace(/</g, '&lt;')
24
+ .replace(/>/g, '&gt;')
25
+ .replace(/"/g, '&quot;')
26
+ .replace(/'/g, '&apos;');
27
+ }
28
+ function renderCell(code, row, column) {
29
+ const x = PADDING + column * (CELL_WIDTH + CELL_GAP);
30
+ const y = PADDING + row * (CELL_HEIGHT + CELL_GAP);
31
+ const tileColor = TILE_COLORS[code];
32
+ const fill = tileColor !== null && tileColor !== void 0 ? tileColor : '#181818';
33
+ const stroke = code === 70 ? '#555555' : '#3a3a3a';
34
+ const glyph = code >= 63 ? '' : (0, characterCodes_1.decodeCharacterCode)(code);
35
+ const textColor = code === 0 ? '#181818' : '#f5f5f5';
36
+ return [
37
+ `<rect x="${x}" y="${y}" width="${CELL_WIDTH}" height="${CELL_HEIGHT}" rx="3" fill="${fill}" stroke="${stroke}" stroke-width="2"/>`,
38
+ glyph === ''
39
+ ? ''
40
+ : `<text x="${x + CELL_WIDTH / 2}" y="${y + CELL_HEIGHT / 2 + 10}" text-anchor="middle" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="30" font-weight="700" fill="${textColor}">${escapeXml(glyph)}</text>`,
41
+ ].join('');
42
+ }
43
+ function renderSvgGrid(characters) {
44
+ const width = PADDING * 2 + characterCodes_1.NOTE_COLUMNS * CELL_WIDTH + (characterCodes_1.NOTE_COLUMNS - 1) * CELL_GAP;
45
+ const height = PADDING * 2 + characterCodes_1.NOTE_ROWS * CELL_HEIGHT + (characterCodes_1.NOTE_ROWS - 1) * CELL_GAP;
46
+ const cells = characters
47
+ .flatMap((row, rowIndex) => row.map((code, columnIndex) => renderCell(code, rowIndex, columnIndex)))
48
+ .join('');
49
+ return [
50
+ `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" role="img" aria-label="Vestaboard Note 3 by 15 preview">`,
51
+ `<rect width="${width}" height="${height}" rx="10" fill="#0b0b0b"/>`,
52
+ cells,
53
+ '</svg>',
54
+ ].join('');
55
+ }
56
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.js","sourceRoot":"","sources":["../../../nodes/VestaboardNote/render.ts"],"names":[],"mappings":";;AA8CA,sCAeC;AA7DD,qDAAgF;AAGhF,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,MAAM,WAAW,GAAG,EAAE,CAAC;AACvB,MAAM,QAAQ,GAAG,CAAC,CAAC;AACnB,MAAM,OAAO,GAAG,EAAE,CAAC;AAEnB,MAAM,WAAW,GAA2B;IAC3C,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,SAAS;CACb,CAAC;AAEF,SAAS,SAAS,CAAC,KAAa;IAC/B,OAAO,KAAK;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AAC,CAAC;AACZ,CAAC;AAED,SAAgB,aAAa,CAAC,UAA2B;IACxD,MAAM,KAAK,GAAG,OAAO,GAAG,CAAC,GAAG,6BAAY,GAAG,UAAU,GAAG,CAAC,6BAAY,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IACtF,MAAM,MAAM,GAAG,OAAO,GAAG,CAAC,GAAG,0BAAS,GAAG,WAAW,GAAG,CAAC,0BAAS,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;IAClF,MAAM,KAAK,GAAG,UAAU;SACtB,OAAO,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAC1B,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CACvE;SACA,IAAI,CAAC,EAAE,CAAC,CAAC;IAEX,OAAO;QACN,kDAAkD,KAAK,aAAa,MAAM,kBAAkB,KAAK,IAAI,MAAM,4DAA4D;QACvK,gBAAgB,KAAK,aAAa,MAAM,4BAA4B;QACpE,KAAK;QACL,QAAQ;KACR,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { IDataObject } from 'n8n-workflow';
2
+ export type CharacterMatrix = number[][];
3
+ export type InputMode = 'characters' | 'text' | 'vbml';
4
+ export interface CurrentMessage {
5
+ id?: string;
6
+ characters: CharacterMatrix;
7
+ }
8
+ export interface SendMessageResponse extends IDataObject {
9
+ status?: string;
10
+ id?: string;
11
+ created?: number;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../nodes/VestaboardNote/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="10" fill="#f4f4f4"/>
3
+ <g fill="#111111">
4
+ <rect x="8" y="10" width="12" height="12" rx="2"/>
5
+ <rect x="26" y="10" width="12" height="12" rx="2"/>
6
+ <rect x="44" y="10" width="12" height="12" rx="2"/>
7
+ <rect x="8" y="26" width="12" height="12" rx="2"/>
8
+ <rect x="26" y="26" width="12" height="12" rx="2"/>
9
+ <rect x="44" y="26" width="12" height="12" rx="2"/>
10
+ <rect x="8" y="42" width="12" height="12" rx="2"/>
11
+ <rect x="26" y="42" width="12" height="12" rx="2"/>
12
+ <rect x="44" y="42" width="12" height="12" rx="2"/>
13
+ </g>
14
+ </svg>
@@ -0,0 +1,14 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
2
+ <rect width="64" height="64" rx="10" fill="#111111"/>
3
+ <g fill="#f4f4f4">
4
+ <rect x="8" y="10" width="12" height="12" rx="2"/>
5
+ <rect x="26" y="10" width="12" height="12" rx="2"/>
6
+ <rect x="44" y="10" width="12" height="12" rx="2"/>
7
+ <rect x="8" y="26" width="12" height="12" rx="2"/>
8
+ <rect x="26" y="26" width="12" height="12" rx="2"/>
9
+ <rect x="44" y="26" width="12" height="12" rx="2"/>
10
+ <rect x="8" y="42" width="12" height="12" rx="2"/>
11
+ <rect x="26" y="42" width="12" height="12" rx="2"/>
12
+ <rect x="44" y="42" width="12" height="12" rx="2"/>
13
+ </g>
14
+ </svg>
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "n8n-nodes-vestaboard-note",
3
+ "version": "0.1.0",
4
+ "description": "Send, retrieve, and preview messages on a Vestaboard Note from n8n.",
5
+ "license": "MIT",
6
+ "homepage": "https://github.com/Scarzer/n8n-nodes-vestaboard-note#readme",
7
+ "keywords": [
8
+ "n8n-community-node-package",
9
+ "n8n",
10
+ "vestaboard",
11
+ "vestaboard-note",
12
+ "vbml"
13
+ ],
14
+ "author": {
15
+ "name": "Irv",
16
+ "email": "irving.derin@gmail.com"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/Scarzer/n8n-nodes-vestaboard-note.git"
21
+ },
22
+ "scripts": {
23
+ "build": "n8n-node build",
24
+ "build:watch": "tsc --watch",
25
+ "dev": "n8n-node dev",
26
+ "lint": "n8n-node lint",
27
+ "lint:fix": "n8n-node lint --fix",
28
+ "test": "vitest run",
29
+ "release": "n8n-node release",
30
+ "prepublishOnly": "n8n-node prerelease"
31
+ },
32
+ "publishConfig": {
33
+ "access": "public"
34
+ },
35
+ "engines": {
36
+ "node": ">=22"
37
+ },
38
+ "files": [
39
+ "dist"
40
+ ],
41
+ "n8n": {
42
+ "n8nNodesApiVersion": 1,
43
+ "strict": true,
44
+ "credentials": [
45
+ "dist/credentials/VestaboardCloudApi.credentials.js"
46
+ ],
47
+ "nodes": [
48
+ "dist/nodes/VestaboardNote/VestaboardNote.node.js"
49
+ ]
50
+ },
51
+ "devDependencies": {
52
+ "@n8n/node-cli": "*",
53
+ "eslint": "9.32.0",
54
+ "prettier": "3.6.2",
55
+ "release-it": "^19.0.4",
56
+ "n8n-workflow": "2.16.0",
57
+ "typescript": "5.9.2",
58
+ "vitest": "^4.1.11"
59
+ },
60
+ "peerDependencies": {
61
+ "n8n-workflow": "*"
62
+ }
63
+ }