node-toypad 2.0.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 +30 -0
- package/data/minifigs.json +77 -0
- package/data/upgrades.json +246 -0
- package/data/vehicles.json +246 -0
- package/dist/connection.d.ts +32 -0
- package/dist/connection.js +158 -0
- package/dist/constants.d.ts +30 -0
- package/dist/constants.js +44 -0
- package/dist/ids.d.ts +571 -0
- package/dist/ids.js +574 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +6 -0
- package/dist/metadata.d.ts +25 -0
- package/dist/metadata.js +70 -0
- package/dist/protocol.d.ts +35 -0
- package/dist/protocol.js +177 -0
- package/dist/tag.d.ts +10 -0
- package/dist/tag.js +96 -0
- package/dist/toypad.d.ts +81 -0
- package/dist/toypad.js +318 -0
- package/dist/upgrade-token-map.d.ts +2 -0
- package/dist/upgrade-token-map.js +199 -0
- package/dist/upgrades-data.d.ts +5105 -0
- package/dist/upgrades-data.js +6213 -0
- package/dist/upgrades.d.ts +32 -0
- package/dist/upgrades.js +225 -0
- package/dist/vehicle-map.d.ts +2 -0
- package/dist/vehicle-map.js +246 -0
- package/package.json +34 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { UpgradeId } from "./ids.js";
|
|
2
|
+
export type UpgradeGroup = "speed" | "power" | "weapons" | "extras" | "colors";
|
|
3
|
+
export type UpgradeOverrideValue = boolean | number;
|
|
4
|
+
export interface UpgradeOverride {
|
|
5
|
+
id: UpgradeId;
|
|
6
|
+
value: UpgradeOverrideValue | undefined | null;
|
|
7
|
+
}
|
|
8
|
+
export type UpgradeOverrides = UpgradeOverride[];
|
|
9
|
+
interface UpgradeSlotDefinition {
|
|
10
|
+
slot: number;
|
|
11
|
+
max: number;
|
|
12
|
+
digitId?: number;
|
|
13
|
+
label?: string;
|
|
14
|
+
id: UpgradeId;
|
|
15
|
+
}
|
|
16
|
+
export declare function encodeUpgradePayload(mapId: number, overrides: UpgradeOverrides, basePayload?: Buffer): Buffer;
|
|
17
|
+
export declare function getPresetOverrides(mapId: number, step: number): UpgradeOverrides | undefined;
|
|
18
|
+
export declare function encodePresetPayload(mapId: number, step: number): Buffer | undefined;
|
|
19
|
+
export interface UpgradeSlotInfo extends UpgradeSlotDefinition {
|
|
20
|
+
group: UpgradeGroup;
|
|
21
|
+
id: UpgradeId;
|
|
22
|
+
}
|
|
23
|
+
export interface UpgradeSlotState extends UpgradeSlotInfo {
|
|
24
|
+
value: number;
|
|
25
|
+
}
|
|
26
|
+
export interface UpgradeValue {
|
|
27
|
+
id: UpgradeId;
|
|
28
|
+
value: boolean | number;
|
|
29
|
+
}
|
|
30
|
+
export declare function listUpgradeSlots(mapId: number): UpgradeSlotInfo[];
|
|
31
|
+
export declare function decodeUpgradePayload(mapId: number, payload: Buffer): UpgradeSlotState[];
|
|
32
|
+
export {};
|
package/dist/upgrades.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import debug from "debug";
|
|
3
|
+
import { UPGRADE_DEFINITIONS } from "./upgrades-data.js";
|
|
4
|
+
import { getUpgradeLabel } from "./metadata.js";
|
|
5
|
+
import { getUpgradeDigits } from "./upgrade-token-map.js";
|
|
6
|
+
const GROUPS = ["speed", "power", "weapons", "extras", "colors"];
|
|
7
|
+
const log = debug("node-toypad:upgrades");
|
|
8
|
+
const upgradeDefinitions = (_a = UPGRADE_DEFINITIONS) !== null && _a !== void 0 ? _a : [];
|
|
9
|
+
const missingSlotWarnings = new Set();
|
|
10
|
+
function findUpgradeDefinition(mapId) {
|
|
11
|
+
return upgradeDefinitions.find((entry) => entry.map === mapId);
|
|
12
|
+
}
|
|
13
|
+
function getDefinition(mapId) {
|
|
14
|
+
const definition = findUpgradeDefinition(mapId);
|
|
15
|
+
if (!definition) {
|
|
16
|
+
throw new Error(`Unknown upgrade map ${mapId}`);
|
|
17
|
+
}
|
|
18
|
+
return definition;
|
|
19
|
+
}
|
|
20
|
+
function buildSlotLookup(definition) {
|
|
21
|
+
var _a;
|
|
22
|
+
const lookup = new Map();
|
|
23
|
+
for (const group of GROUPS) {
|
|
24
|
+
const slots = (_a = definition.slots[group]) !== null && _a !== void 0 ? _a : [];
|
|
25
|
+
for (const slotDef of slots) {
|
|
26
|
+
lookup.set(slotDef.id, slotDef);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return lookup;
|
|
30
|
+
}
|
|
31
|
+
function getDigitEntries(mapId) {
|
|
32
|
+
const digits = getUpgradeDigits(mapId);
|
|
33
|
+
if (!digits.length) {
|
|
34
|
+
return [];
|
|
35
|
+
}
|
|
36
|
+
return digits.map((maxValue, index) => ({
|
|
37
|
+
id: index,
|
|
38
|
+
maxValue: maxValue || 0
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
function warnMissingSlot(mapId, slotId, group, max) {
|
|
42
|
+
if (max <= 1) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const key = `${mapId}:${slotId}`;
|
|
46
|
+
if (missingSlotWarnings.has(key)) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
missingSlotWarnings.add(key);
|
|
50
|
+
log(`Upgrade slot ${slotId} (map ${mapId}, group ${group}) is missing encoder metadata and will decode as 0.`);
|
|
51
|
+
}
|
|
52
|
+
function clamp(value, maxValue) {
|
|
53
|
+
if (!Number.isFinite(value)) {
|
|
54
|
+
return 0;
|
|
55
|
+
}
|
|
56
|
+
if (maxValue <= 0) {
|
|
57
|
+
return 0;
|
|
58
|
+
}
|
|
59
|
+
if (value < 0) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
if (value > maxValue) {
|
|
63
|
+
return maxValue;
|
|
64
|
+
}
|
|
65
|
+
return Math.trunc(value);
|
|
66
|
+
}
|
|
67
|
+
function decodeEncoderValues(entries, payload) {
|
|
68
|
+
if (payload.length < 8) {
|
|
69
|
+
throw new Error("Upgrade payload must be 8 bytes.");
|
|
70
|
+
}
|
|
71
|
+
const total = payload.readBigUInt64BE(0);
|
|
72
|
+
const values = entries.map(() => 0);
|
|
73
|
+
let remainder = total;
|
|
74
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
75
|
+
const baseValue = entries[i].maxValue || 0;
|
|
76
|
+
const base = BigInt(baseValue + 1);
|
|
77
|
+
if (base === BigInt(0)) {
|
|
78
|
+
values[i] = 0;
|
|
79
|
+
continue;
|
|
80
|
+
}
|
|
81
|
+
const digit = remainder % base;
|
|
82
|
+
values[i] = Number(digit);
|
|
83
|
+
remainder = remainder / base;
|
|
84
|
+
}
|
|
85
|
+
return values;
|
|
86
|
+
}
|
|
87
|
+
export function encodeUpgradePayload(mapId, overrides, basePayload) {
|
|
88
|
+
if (!overrides || !overrides.length) {
|
|
89
|
+
throw new Error("No upgrades specified.");
|
|
90
|
+
}
|
|
91
|
+
const definition = getDefinition(mapId);
|
|
92
|
+
const entries = getDigitEntries(definition.map);
|
|
93
|
+
const values = basePayload && basePayload.length >= 8 ? decodeEncoderValues(entries, basePayload) : entries.map(() => 0);
|
|
94
|
+
const slotLookup = buildSlotLookup(definition);
|
|
95
|
+
for (const override of overrides) {
|
|
96
|
+
const rawValue = override.value;
|
|
97
|
+
if (rawValue === undefined) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const slotDef = slotLookup.get(override.id);
|
|
101
|
+
if (!slotDef) {
|
|
102
|
+
throw new Error(`Upgrade ${override.id} is not valid for map ${mapId}.`);
|
|
103
|
+
}
|
|
104
|
+
if (typeof slotDef.digitId !== "number") {
|
|
105
|
+
throw new Error(`Upgrade ${override.id} cannot be written because encoder metadata is missing.`);
|
|
106
|
+
}
|
|
107
|
+
const entry = entries[slotDef.digitId];
|
|
108
|
+
if (!entry) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const maxValue = entry.maxValue;
|
|
112
|
+
const normalized = normalizeOverrideValue(rawValue, maxValue, slotDef.id);
|
|
113
|
+
if (normalized === undefined) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
values[slotDef.digitId] = normalized;
|
|
117
|
+
}
|
|
118
|
+
let total = BigInt(0);
|
|
119
|
+
let multiplier = BigInt(1);
|
|
120
|
+
for (let i = entries.length - 1; i >= 0; i--) {
|
|
121
|
+
total += BigInt(values[i]) * multiplier;
|
|
122
|
+
const base = BigInt((entries[i].maxValue || 0) + 1);
|
|
123
|
+
multiplier *= base === BigInt(0) ? BigInt(1) : base;
|
|
124
|
+
}
|
|
125
|
+
const buffer = Buffer.alloc(8);
|
|
126
|
+
buffer.writeBigUInt64BE(total);
|
|
127
|
+
return buffer;
|
|
128
|
+
}
|
|
129
|
+
function buildOverridesFromPreset(preset) {
|
|
130
|
+
var _a;
|
|
131
|
+
const overrides = [];
|
|
132
|
+
for (const group of GROUPS) {
|
|
133
|
+
const slots = preset[group];
|
|
134
|
+
if (!slots) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
for (const slot of slots) {
|
|
138
|
+
if (typeof slot.digitId !== "number") {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
overrides.push({
|
|
142
|
+
id: slot.id,
|
|
143
|
+
value: (_a = slot.value) !== null && _a !== void 0 ? _a : 0
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return overrides;
|
|
148
|
+
}
|
|
149
|
+
export function getPresetOverrides(mapId, step) {
|
|
150
|
+
const definition = findUpgradeDefinition(mapId);
|
|
151
|
+
if (!definition || !definition.presets) {
|
|
152
|
+
return undefined;
|
|
153
|
+
}
|
|
154
|
+
const preset = definition.presets[`step${step}`];
|
|
155
|
+
if (!preset) {
|
|
156
|
+
return undefined;
|
|
157
|
+
}
|
|
158
|
+
const overrides = buildOverridesFromPreset(preset);
|
|
159
|
+
return overrides.length ? overrides : undefined;
|
|
160
|
+
}
|
|
161
|
+
export function encodePresetPayload(mapId, step) {
|
|
162
|
+
const overrides = getPresetOverrides(mapId, step);
|
|
163
|
+
if (!overrides) {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
return encodeUpgradePayload(mapId, overrides);
|
|
167
|
+
}
|
|
168
|
+
function normalizeOverrideValue(value, maxValue, slotId) {
|
|
169
|
+
if (value === undefined || value === null) {
|
|
170
|
+
return undefined;
|
|
171
|
+
}
|
|
172
|
+
if (typeof value === "boolean") {
|
|
173
|
+
return value ? maxValue : 0;
|
|
174
|
+
}
|
|
175
|
+
if (typeof value === "number") {
|
|
176
|
+
return clamp(value, maxValue);
|
|
177
|
+
}
|
|
178
|
+
throw new Error(`Invalid override for ${slotId}: expected boolean or number.`);
|
|
179
|
+
}
|
|
180
|
+
export function listUpgradeSlots(mapId) {
|
|
181
|
+
var _a;
|
|
182
|
+
const definition = findUpgradeDefinition(mapId);
|
|
183
|
+
if (!definition) {
|
|
184
|
+
return [];
|
|
185
|
+
}
|
|
186
|
+
const slots = [];
|
|
187
|
+
for (const group of GROUPS) {
|
|
188
|
+
for (const slot of ((_a = definition.slots[group]) !== null && _a !== void 0 ? _a : []).slice().sort((a, b) => a.slot - b.slot)) {
|
|
189
|
+
const label = getUpgradeLabel(slot.id);
|
|
190
|
+
slots.push({
|
|
191
|
+
...slot,
|
|
192
|
+
...(label ? { label } : {}),
|
|
193
|
+
group
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return slots;
|
|
198
|
+
}
|
|
199
|
+
export function decodeUpgradePayload(mapId, payload) {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
if (!payload || payload.length < 8) {
|
|
202
|
+
throw new Error("Upgrade payload must be 8 bytes.");
|
|
203
|
+
}
|
|
204
|
+
const definition = getDefinition(mapId);
|
|
205
|
+
const entries = getDigitEntries(definition.map);
|
|
206
|
+
const entryValues = decodeEncoderValues(entries, payload);
|
|
207
|
+
const states = [];
|
|
208
|
+
for (const group of GROUPS) {
|
|
209
|
+
for (const slot of ((_a = definition.slots[group]) !== null && _a !== void 0 ? _a : []).slice().sort((a, b) => a.slot - b.slot)) {
|
|
210
|
+
const digitId = typeof slot.digitId === "number" ? slot.digitId : undefined;
|
|
211
|
+
const value = digitId !== undefined ? (_b = entryValues[digitId]) !== null && _b !== void 0 ? _b : 0 : 0;
|
|
212
|
+
if (digitId === undefined) {
|
|
213
|
+
warnMissingSlot(mapId, slot.id, group, slot.max);
|
|
214
|
+
}
|
|
215
|
+
const label = getUpgradeLabel(slot.id);
|
|
216
|
+
states.push({
|
|
217
|
+
...slot,
|
|
218
|
+
...(label ? { label } : {}),
|
|
219
|
+
group,
|
|
220
|
+
value
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return states;
|
|
225
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
export const VEHICLE_MAP_BY_ID = {
|
|
2
|
+
[0]: 0,
|
|
3
|
+
[1000]: 1,
|
|
4
|
+
[1001]: 1,
|
|
5
|
+
[1002]: 1,
|
|
6
|
+
[1003]: 1,
|
|
7
|
+
[1004]: 1,
|
|
8
|
+
[1005]: 1,
|
|
9
|
+
[1006]: 1,
|
|
10
|
+
[1007]: 1,
|
|
11
|
+
[1008]: 1,
|
|
12
|
+
[1009]: 1,
|
|
13
|
+
[1010]: 1,
|
|
14
|
+
[1011]: 1,
|
|
15
|
+
[1012]: 1,
|
|
16
|
+
[1013]: 1,
|
|
17
|
+
[1014]: 1,
|
|
18
|
+
[1015]: 2,
|
|
19
|
+
[1016]: 2,
|
|
20
|
+
[1017]: 2,
|
|
21
|
+
[1018]: 1,
|
|
22
|
+
[1019]: 1,
|
|
23
|
+
[1020]: 1,
|
|
24
|
+
[1021]: 1,
|
|
25
|
+
[1022]: 1,
|
|
26
|
+
[1023]: 1,
|
|
27
|
+
[1024]: 1,
|
|
28
|
+
[1025]: 1,
|
|
29
|
+
[1026]: 1,
|
|
30
|
+
[1027]: 2,
|
|
31
|
+
[1028]: 2,
|
|
32
|
+
[1029]: 2,
|
|
33
|
+
[1030]: 1,
|
|
34
|
+
[1031]: 1,
|
|
35
|
+
[1032]: 1,
|
|
36
|
+
[1033]: 1,
|
|
37
|
+
[1034]: 1,
|
|
38
|
+
[1035]: 1,
|
|
39
|
+
[1036]: 4,
|
|
40
|
+
[1037]: 4,
|
|
41
|
+
[1038]: 4,
|
|
42
|
+
[1039]: 1,
|
|
43
|
+
[1040]: 1,
|
|
44
|
+
[1041]: 1,
|
|
45
|
+
[1042]: 2,
|
|
46
|
+
[1043]: 2,
|
|
47
|
+
[1044]: 2,
|
|
48
|
+
[1045]: 1,
|
|
49
|
+
[1046]: 1,
|
|
50
|
+
[1047]: 1,
|
|
51
|
+
[1048]: 1,
|
|
52
|
+
[1049]: 1,
|
|
53
|
+
[1050]: 1,
|
|
54
|
+
[1051]: 2,
|
|
55
|
+
[1052]: 2,
|
|
56
|
+
[1053]: 2,
|
|
57
|
+
[1054]: 1,
|
|
58
|
+
[1055]: 1,
|
|
59
|
+
[1056]: 1,
|
|
60
|
+
[1057]: 1,
|
|
61
|
+
[1058]: 1,
|
|
62
|
+
[1059]: 1,
|
|
63
|
+
[1060]: 1,
|
|
64
|
+
[1061]: 1,
|
|
65
|
+
[1062]: 1,
|
|
66
|
+
[1063]: 1,
|
|
67
|
+
[1064]: 1,
|
|
68
|
+
[1065]: 1,
|
|
69
|
+
[1066]: 1,
|
|
70
|
+
[1067]: 1,
|
|
71
|
+
[1068]: 1,
|
|
72
|
+
[1069]: 1,
|
|
73
|
+
[1070]: 1,
|
|
74
|
+
[1071]: 1,
|
|
75
|
+
[1072]: 1,
|
|
76
|
+
[1073]: 1,
|
|
77
|
+
[1074]: 1,
|
|
78
|
+
[1075]: 1,
|
|
79
|
+
[1076]: 1,
|
|
80
|
+
[1077]: 1,
|
|
81
|
+
[1078]: 1,
|
|
82
|
+
[1079]: 1,
|
|
83
|
+
[1080]: 1,
|
|
84
|
+
[1081]: 6,
|
|
85
|
+
[1082]: 6,
|
|
86
|
+
[1083]: 6,
|
|
87
|
+
[1084]: 3,
|
|
88
|
+
[1085]: 3,
|
|
89
|
+
[1086]: 3,
|
|
90
|
+
[1087]: 7,
|
|
91
|
+
[1088]: 7,
|
|
92
|
+
[1089]: 7,
|
|
93
|
+
[1090]: 1,
|
|
94
|
+
[1091]: 1,
|
|
95
|
+
[1092]: 1,
|
|
96
|
+
[1093]: 1,
|
|
97
|
+
[1094]: 1,
|
|
98
|
+
[1095]: 1,
|
|
99
|
+
[1096]: 1,
|
|
100
|
+
[1097]: 1,
|
|
101
|
+
[1098]: 1,
|
|
102
|
+
[1099]: 1,
|
|
103
|
+
[1100]: 1,
|
|
104
|
+
[1101]: 1,
|
|
105
|
+
[1102]: 1,
|
|
106
|
+
[1103]: 1,
|
|
107
|
+
[1104]: 1,
|
|
108
|
+
[1105]: 1,
|
|
109
|
+
[1106]: 1,
|
|
110
|
+
[1107]: 1,
|
|
111
|
+
[1108]: 1,
|
|
112
|
+
[1109]: 1,
|
|
113
|
+
[1110]: 1,
|
|
114
|
+
[1111]: 1,
|
|
115
|
+
[1112]: 1,
|
|
116
|
+
[1113]: 1,
|
|
117
|
+
[1114]: 1,
|
|
118
|
+
[1115]: 1,
|
|
119
|
+
[1116]: 1,
|
|
120
|
+
[1117]: 1,
|
|
121
|
+
[1118]: 1,
|
|
122
|
+
[1119]: 1,
|
|
123
|
+
[1120]: 1,
|
|
124
|
+
[1121]: 1,
|
|
125
|
+
[1122]: 1,
|
|
126
|
+
[1123]: 6,
|
|
127
|
+
[1124]: 6,
|
|
128
|
+
[1125]: 6,
|
|
129
|
+
[1132]: 1,
|
|
130
|
+
[1133]: 1,
|
|
131
|
+
[1134]: 1,
|
|
132
|
+
[1144]: 1,
|
|
133
|
+
[1145]: 1,
|
|
134
|
+
[1146]: 1,
|
|
135
|
+
[1155]: 5,
|
|
136
|
+
[1156]: 5,
|
|
137
|
+
[1157]: 5,
|
|
138
|
+
[1158]: 1,
|
|
139
|
+
[1159]: 1,
|
|
140
|
+
[1160]: 1,
|
|
141
|
+
[1161]: 1,
|
|
142
|
+
[1162]: 1,
|
|
143
|
+
[1163]: 1,
|
|
144
|
+
[1164]: 1,
|
|
145
|
+
[1165]: 1,
|
|
146
|
+
[1166]: 1,
|
|
147
|
+
[1167]: 1,
|
|
148
|
+
[1168]: 1,
|
|
149
|
+
[1169]: 1,
|
|
150
|
+
[1170]: 1,
|
|
151
|
+
[1171]: 1,
|
|
152
|
+
[1172]: 1,
|
|
153
|
+
[1173]: 1,
|
|
154
|
+
[1174]: 1,
|
|
155
|
+
[1175]: 1,
|
|
156
|
+
[1176]: 1,
|
|
157
|
+
[1177]: 1,
|
|
158
|
+
[1178]: 1,
|
|
159
|
+
[1179]: 1,
|
|
160
|
+
[1180]: 1,
|
|
161
|
+
[1181]: 1,
|
|
162
|
+
[1182]: 1,
|
|
163
|
+
[1183]: 1,
|
|
164
|
+
[1184]: 1,
|
|
165
|
+
[1185]: 1,
|
|
166
|
+
[1186]: 1,
|
|
167
|
+
[1187]: 1,
|
|
168
|
+
[1188]: 1,
|
|
169
|
+
[1189]: 1,
|
|
170
|
+
[1190]: 1,
|
|
171
|
+
[1191]: 1,
|
|
172
|
+
[1192]: 1,
|
|
173
|
+
[1193]: 1,
|
|
174
|
+
[1194]: 1,
|
|
175
|
+
[1195]: 1,
|
|
176
|
+
[1196]: 1,
|
|
177
|
+
[1197]: 1,
|
|
178
|
+
[1198]: 1,
|
|
179
|
+
[1199]: 1,
|
|
180
|
+
[1200]: 1,
|
|
181
|
+
[1201]: 1,
|
|
182
|
+
[1202]: 1,
|
|
183
|
+
[1203]: 1,
|
|
184
|
+
[1204]: 1,
|
|
185
|
+
[1205]: 1,
|
|
186
|
+
[1206]: 1,
|
|
187
|
+
[1207]: 1,
|
|
188
|
+
[1208]: 1,
|
|
189
|
+
[1209]: 1,
|
|
190
|
+
[1210]: 1,
|
|
191
|
+
[1211]: 1,
|
|
192
|
+
[1212]: 1,
|
|
193
|
+
[1213]: 1,
|
|
194
|
+
[1214]: 1,
|
|
195
|
+
[1215]: 1,
|
|
196
|
+
[1216]: 1,
|
|
197
|
+
[1217]: 1,
|
|
198
|
+
[1218]: 1,
|
|
199
|
+
[1219]: 1,
|
|
200
|
+
[1220]: 1,
|
|
201
|
+
[1221]: 1,
|
|
202
|
+
[1222]: 1,
|
|
203
|
+
[1223]: 1,
|
|
204
|
+
[1224]: 1,
|
|
205
|
+
[1225]: 1,
|
|
206
|
+
[1226]: 1,
|
|
207
|
+
[1227]: 1,
|
|
208
|
+
[1228]: 1,
|
|
209
|
+
[1229]: 1,
|
|
210
|
+
[1230]: 1,
|
|
211
|
+
[1231]: 1,
|
|
212
|
+
[1232]: 1,
|
|
213
|
+
[1233]: 1,
|
|
214
|
+
[1234]: 1,
|
|
215
|
+
[1235]: 1,
|
|
216
|
+
[1236]: 1,
|
|
217
|
+
[1237]: 1,
|
|
218
|
+
[1238]: 1,
|
|
219
|
+
[1239]: 1,
|
|
220
|
+
[1240]: 1,
|
|
221
|
+
[1241]: 1,
|
|
222
|
+
[1242]: 1,
|
|
223
|
+
[1243]: 1,
|
|
224
|
+
[1244]: 1,
|
|
225
|
+
[1245]: 1,
|
|
226
|
+
[1246]: 1,
|
|
227
|
+
[1247]: 1,
|
|
228
|
+
[1248]: 1,
|
|
229
|
+
[1249]: 1,
|
|
230
|
+
[1250]: 1,
|
|
231
|
+
[1251]: 1,
|
|
232
|
+
[1252]: 1,
|
|
233
|
+
[1253]: 1,
|
|
234
|
+
[1254]: 1,
|
|
235
|
+
[1255]: 1,
|
|
236
|
+
[1256]: 1,
|
|
237
|
+
[1257]: 1,
|
|
238
|
+
[1258]: 1,
|
|
239
|
+
[1259]: 1,
|
|
240
|
+
[1260]: 1,
|
|
241
|
+
[1261]: 1,
|
|
242
|
+
[1262]: 1,
|
|
243
|
+
[1263]: 1,
|
|
244
|
+
[1264]: 1,
|
|
245
|
+
[1265]: 1,
|
|
246
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "node-toypad",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "A JavaScript module to control the LEGO Dimensions ToyPad",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsc -b",
|
|
10
|
+
"clean": "rimraf dist",
|
|
11
|
+
"prepare": "npm run build",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:coverage": "vitest run --coverage",
|
|
14
|
+
"test:connection": "node tests/toypad-connection-test.js"
|
|
15
|
+
},
|
|
16
|
+
"author": "Nathan Kellenicki <nathan@kellenicki.com>",
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"data"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"debug": "^4.4.3",
|
|
24
|
+
"node-hid": "^3.2.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/debug": "^4.1.12",
|
|
28
|
+
"@types/node": "^25.0.3",
|
|
29
|
+
"@vitest/coverage-v8": "^4.0.16",
|
|
30
|
+
"rimraf": "^6.1.2",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"vitest": "^4.0.16"
|
|
33
|
+
}
|
|
34
|
+
}
|