tigertag 1.1.0 → 1.2.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/bin/tigertag.js CHANGED
@@ -25,24 +25,33 @@ const fs = require('fs');
25
25
  const path = require('path');
26
26
 
27
27
  const { TigerTag, TigerTagDB, SignatureResult, syncDatabases } = require('../src/index');
28
- const { _BUNDLED_DB_PATH } = require('../src/db');
29
28
 
30
29
  const VERSION = require('../package.json').version;
31
30
 
32
31
  const HELP = `
33
32
  Usage: tigertag [dump.bin] [options]
33
+ tigertag update [--force] [--catalog] [--data-dir PATH | --db PATH]
34
34
 
35
35
  Parse, verify, and export TigerTag RFID chip dumps.
36
36
 
37
37
  Arguments:
38
38
  dump.bin Binary .bin file to parse
39
39
 
40
+ Commands:
41
+ update Check for new reference tables now and download the changed ones
42
+ (into the data dir, or into --db PATH)
43
+
40
44
  Options:
41
- --db <path> Database folder (default: bundled database)
45
+ --db <path> Custom database folder, used exclusively (no fallback)
46
+ --data-dir <path> Folder for downloaded reference data (default: TIGERTAG_DATA_DIR
47
+ or the per-user cache folder)
48
+ --offline No network call at all (same as TIGERTAG_OFFLINE=1)
49
+ --force update: re-download every table
50
+ --catalog update: also check for a new product catalogue
42
51
  --json Output as JSON
43
52
  --raw Raw protocol fields, no DB lookup
44
- --no-sync Do not auto-download databases
45
- --sync-only Update databases and exit
53
+ --no-sync Do not run the automatic daily check
54
+ --sync-only Same as "update"
46
55
  --version Show version
47
56
  -h, --help Show this help
48
57
 
@@ -54,39 +63,56 @@ Dump formats:
54
63
  Examples:
55
64
  tigertag dump.bin Parse + human-readable output
56
65
  tigertag dump.bin --json Output as JSON
57
- tigertag dump.bin --raw Raw protocol fields, no DB lookup
58
- tigertag --sync-only Update reference databases and exit
66
+ tigertag dump.bin --offline Parse without any network call
67
+ tigertag update Update the reference tables now
68
+ tigertag update --catalog Same, plus the product catalogue
59
69
 
60
70
  Spec: https://github.com/TigerTag-Project/TigerTag-RFID-Guide
61
71
  `.trim();
62
72
 
63
73
  function parseArgs(argv) {
64
- const args = { dump: null, db: null, json: false, raw: false, noSync: false, syncOnly: false };
74
+ const args = {
75
+ dump: null, db: null, dataDir: null, json: false, raw: false, noSync: false,
76
+ update: false, force: false, catalog: false, offline: false,
77
+ };
65
78
  for (let i = 0; i < argv.length; i++) {
66
79
  const a = argv[i];
67
- if (a === '--json') args.json = true;
68
- else if (a === '--raw') args.raw = true;
69
- else if (a === '--no-sync') args.noSync = true;
70
- else if (a === '--sync-only') args.syncOnly = true;
80
+ if (a === '--json') args.json = true;
81
+ else if (a === '--raw') args.raw = true;
82
+ else if (a === '--no-sync') args.noSync = true;
83
+ else if (a === '--sync-only' || (a === 'update' && !args.dump && !args.update)) args.update = true;
84
+ else if (a === '--force') args.force = true;
85
+ else if (a === '--catalog') args.catalog = true;
86
+ else if (a === '--offline') args.offline = true;
71
87
  else if (a === '--version') { console.log(`tigertag ${VERSION}`); process.exit(0); }
72
88
  else if (a === '-h' || a === '--help') { console.log(HELP); process.exit(0); }
73
- else if (a === '--db') args.db = argv[++i];
74
- else if (!a.startsWith('-')) args.dump = a;
89
+ else if (a === '--db') args.db = argv[++i];
90
+ else if (a === '--data-dir') args.dataDir = argv[++i];
91
+ else if (!a.startsWith('-')) args.dump = a;
75
92
  }
76
93
  return args;
77
94
  }
78
95
 
79
96
  async function main() {
80
97
  const args = parseArgs(process.argv.slice(2));
81
- const dbPath = args.db ? path.resolve(args.db) : _BUNDLED_DB_PATH;
98
+ if (args.offline) process.env.TIGERTAG_OFFLINE = '1'; // no network call anywhere in this process
99
+ const dbPath = args.db ? path.resolve(args.db) : undefined;
100
+ const dataDir = args.dataDir ? path.resolve(args.dataDir) : undefined;
82
101
 
83
- if (args.syncOnly) {
102
+ if (args.update) {
84
103
  try {
85
- const updated = await syncDatabases(dbPath, { verbose: true });
104
+ let updated;
105
+ if (dbPath) {
106
+ updated = await syncDatabases(dbPath, { force: args.force, verbose: true });
107
+ } else {
108
+ const db = new TigerTagDB({ dataDir, offline: args.offline || undefined, autoUpdate: false, verbose: true });
109
+ updated = await db.update({ force: args.force, catalog: args.catalog });
110
+ console.log(`Data dir: ${db.info().dataDir}`);
111
+ }
86
112
  if (updated.length > 0) {
87
113
  console.log(`\nUpdated ${updated.length} file(s): ${updated.join(', ')}`);
88
114
  } else {
89
- console.log('\nAll databases already up to date.');
115
+ console.log('\nAll reference data already up to date.');
90
116
  }
91
117
  } catch (err) {
92
118
  process.stderr.write(`Error: ${err.message}\n`);
@@ -120,12 +146,24 @@ async function main() {
120
146
  process.stderr.write(`Warning: ${w}\n`);
121
147
  }
122
148
 
149
+ let db;
150
+ try {
151
+ db = new TigerTagDB({
152
+ dbPath, dataDir,
153
+ offline: args.offline || undefined,
154
+ autoUpdate: !args.noSync && !args.raw,
155
+ });
156
+ } catch (err) {
157
+ process.stderr.write(`Error: ${err.message}\n`);
158
+ process.exit(1);
159
+ }
160
+ tag._db = db; // every lookup (toRawDict / toDict / pretty) uses this database
161
+
123
162
  if (args.raw) {
124
163
  console.log(JSON.stringify(tag.toRawDict(), null, 2));
125
164
  return;
126
165
  }
127
166
 
128
- const db = new TigerTagDB({ dbPath });
129
167
  const sigResult = tag.isSigned
130
168
  ? tag.verify(db)
131
169
  : new SignatureResult(SignatureResult.UNSIGNED);
@@ -59,6 +59,11 @@
59
59
  "label": "Gloss",
60
60
  "color_count": 1
61
61
  },
62
+ {
63
+ "id": 132,
64
+ "label": "Fiber",
65
+ "color_count": 1
66
+ },
62
67
  {
63
68
  "id": 134,
64
69
  "label": "Satin",
@@ -4,6 +4,8 @@
4
4
  "name": "Atome3D",
5
5
  "type_ids": [
6
6
  142,
7
+ 116,
8
+ 41,
7
9
  173
8
10
  ]
9
11
  },
@@ -25,7 +27,18 @@
25
27
  "id": 1421,
26
28
  "name": "3DJake",
27
29
  "type_ids": [
28
- 142
30
+ 142,
31
+ 116,
32
+ 41,
33
+ 173
34
+ ]
35
+ },
36
+ {
37
+ "id": 2049,
38
+ "name": "Inslogic",
39
+ "type_ids": [
40
+ 142,
41
+ 173
29
42
  ]
30
43
  },
31
44
  {
@@ -106,6 +119,13 @@
106
119
  142
107
120
  ]
108
121
  },
122
+ {
123
+ "id": 5048,
124
+ "name": "Marswork",
125
+ "type_ids": [
126
+ 142
127
+ ]
128
+ },
109
129
  {
110
130
  "id": 6305,
111
131
  "name": "Markforged",
@@ -169,6 +189,14 @@
169
189
  142
170
190
  ]
171
191
  },
192
+ {
193
+ "id": 8503,
194
+ "name": "E3D",
195
+ "type_ids": [
196
+ 116,
197
+ 41
198
+ ]
199
+ },
172
200
  {
173
201
  "id": 8586,
174
202
  "name": "NinjaTek",
@@ -192,7 +220,7 @@
192
220
  },
193
221
  {
194
222
  "id": 8921,
195
- "name": "Duramic 3D",
223
+ "name": "Duramic 3D",
196
224
  "type_ids": [
197
225
  142
198
226
  ]
@@ -260,6 +288,13 @@
260
288
  142
261
289
  ]
262
290
  },
291
+ {
292
+ "id": 11750,
293
+ "name": "VOXELPLA",
294
+ "type_ids": [
295
+ 142
296
+ ]
297
+ },
263
298
  {
264
299
  "id": 12345,
265
300
  "name": "MakerBot",
@@ -278,7 +313,9 @@
278
313
  "id": 12635,
279
314
  "name": "Snapmaker",
280
315
  "type_ids": [
281
- 142
316
+ 142,
317
+ 116,
318
+ 41
282
319
  ]
283
320
  },
284
321
  {
@@ -314,6 +351,8 @@
314
351
  "name": "Anycubic",
315
352
  "type_ids": [
316
353
  142,
354
+ 116,
355
+ 41,
317
356
  173
318
357
  ]
319
358
  },
@@ -381,6 +420,13 @@
381
420
  142
382
421
  ]
383
422
  },
423
+ {
424
+ "id": 26145,
425
+ "name": "3DMA",
426
+ "type_ids": [
427
+ 142
428
+ ]
429
+ },
384
430
  {
385
431
  "id": 26379,
386
432
  "name": "Formlabs",
@@ -400,6 +446,8 @@
400
446
  "name": "Creality",
401
447
  "type_ids": [
402
448
  142,
449
+ 116,
450
+ 41,
403
451
  173
404
452
  ]
405
453
  },
@@ -449,7 +497,9 @@
449
497
  "id": 31438,
450
498
  "name": "Wondermaker",
451
499
  "type_ids": [
452
- 142
500
+ 142,
501
+ 116,
502
+ 41
453
503
  ]
454
504
  },
455
505
  {
@@ -506,7 +556,9 @@
506
556
  "id": 35123,
507
557
  "name": "Bambu Lab",
508
558
  "type_ids": [
509
- 142
559
+ 142,
560
+ 116,
561
+ 41
510
562
  ]
511
563
  },
512
564
  {
@@ -552,6 +604,13 @@
552
604
  142
553
605
  ]
554
606
  },
607
+ {
608
+ "id": 38953,
609
+ "name": "Tucab",
610
+ "type_ids": [
611
+ 142
612
+ ]
613
+ },
555
614
  {
556
615
  "id": 39002,
557
616
  "name": "GreenGate3D",
@@ -592,7 +651,9 @@
592
651
  "id": 42911,
593
652
  "name": "UltiMaker",
594
653
  "type_ids": [
595
- 142
654
+ 142,
655
+ 116,
656
+ 41
596
657
  ]
597
658
  },
598
659
  {
@@ -636,14 +697,27 @@
636
697
  "name": "Prusament",
637
698
  "type_ids": [
638
699
  142,
700
+ 116,
701
+ 41,
639
702
  173
640
703
  ]
641
704
  },
705
+ {
706
+ "id": 47122,
707
+ "name": "Zimple3D",
708
+ "type_ids": [
709
+ 116,
710
+ 41
711
+ ]
712
+ },
642
713
  {
643
714
  "id": 47560,
644
715
  "name": "Wanhao",
645
716
  "type_ids": [
646
- 142
717
+ 142,
718
+ 116,
719
+ 41,
720
+ 173
647
721
  ]
648
722
  },
649
723
  {
@@ -738,7 +812,9 @@
738
812
  "id": 52757,
739
813
  "name": "Yumi",
740
814
  "type_ids": [
741
- 142
815
+ 142,
816
+ 116,
817
+ 41
742
818
  ]
743
819
  },
744
820
  {
@@ -749,6 +825,14 @@
749
825
  173
750
826
  ]
751
827
  },
828
+ {
829
+ "id": 53146,
830
+ "name": "EPAX",
831
+ "type_ids": [
832
+ 142,
833
+ 173
834
+ ]
835
+ },
752
836
  {
753
837
  "id": 53640,
754
838
  "name": "Magigoo",
@@ -772,7 +856,7 @@
772
856
  },
773
857
  {
774
858
  "id": 55229,
775
- "name": "Filament PM",
859
+ "name": "Filament PM",
776
860
  "type_ids": [
777
861
  142
778
862
  ]
@@ -788,7 +872,9 @@
788
872
  "id": 55869,
789
873
  "name": "Biqu",
790
874
  "type_ids": [
791
- 142
875
+ 142,
876
+ 116,
877
+ 41
792
878
  ]
793
879
  },
794
880
  {
@@ -817,6 +903,8 @@
817
903
  "name": "ELEGOO",
818
904
  "type_ids": [
819
905
  142,
906
+ 116,
907
+ 41,
820
908
  173
821
909
  ]
822
910
  },
@@ -848,6 +936,13 @@
848
936
  142
849
937
  ]
850
938
  },
939
+ {
940
+ "id": 60073,
941
+ "name": "3D Lac",
942
+ "type_ids": [
943
+ 116
944
+ ]
945
+ },
851
946
  {
852
947
  "id": 60882,
853
948
  "name": "Recreus",
@@ -876,6 +971,20 @@
876
971
  142
877
972
  ]
878
973
  },
974
+ {
975
+ "id": 63757,
976
+ "name": "Copper3D",
977
+ "type_ids": [
978
+ 142
979
+ ]
980
+ },
981
+ {
982
+ "id": 65178,
983
+ "name": "Smart3DPT",
984
+ "type_ids": [
985
+ 142
986
+ ]
987
+ },
879
988
  {
880
989
  "id": 65535,
881
990
  "name": "Generic",
Binary file
@@ -0,0 +1,9 @@
1
+ {
2
+ "url": "https://raw.githubusercontent.com/TigerTag-Project/TigerTag-RFID-Guide/refs/heads/main/database/id_catalog.json",
3
+ "count": 14164,
4
+ "fetchedAt": "2026-10-01T00:21:04.647Z",
5
+ "etag": "W/\"7449ae9629b94cbaeec7846e392006cab8a5ba061d256ec13bb1b944a0e73157\"",
6
+ "lastModified": null,
7
+ "bytes": 11827953,
8
+ "sha256": "19db0fc3101a5e30449393d81df7b6da990eb8d88aa251d0100b5943dde466a1"
9
+ }