@sythos/js_barcode_universal 1.5.13 → 1.5.15

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.
Files changed (137) hide show
  1. package/LICENSE +22 -4
  2. package/NOTICE.md +10 -1
  3. package/README.md +416 -22
  4. package/bundle/sythos-barcode.esm.js +22176 -11991
  5. package/bundle/sythos-barcode.js +22059 -11991
  6. package/licenses/README.md +12 -1
  7. package/licenses/codablockf.license +51 -0
  8. package/licenses/code16k.license +52 -0
  9. package/licenses/code25.license +58 -0
  10. package/licenses/code32.license +51 -0
  11. package/licenses/dotcode.license +66 -0
  12. package/licenses/gs1-composite.license +106 -0
  13. package/licenses/gs1-databar.license +21 -14
  14. package/licenses/hanxin.license +95 -0
  15. package/licenses/maxicode.license +62 -0
  16. package/licenses/postal.license +61 -0
  17. package/licenses/pzn.license +53 -0
  18. package/licenses/telepen.license +73 -0
  19. package/llms.txt +62 -6
  20. package/package.json +47 -3
  21. package/src/index.d.ts +111 -6
  22. package/src/index.js +362 -13
  23. package/src/js/codablockf/decoder.js +198 -0
  24. package/src/js/codablockf/encoder.js +97 -0
  25. package/src/js/codablockf/index.js +3 -0
  26. package/src/js/code16k/decoder.js +303 -0
  27. package/src/js/code16k/detector.js +187 -0
  28. package/src/js/code16k/encoder.js +153 -0
  29. package/src/js/code16k/index.js +14 -0
  30. package/src/js/code16k/tables.js +152 -0
  31. package/src/js/composite/index.js +570 -0
  32. package/src/js/core/detection-contract.js +185 -0
  33. package/src/js/core/symbol-layout.js +155 -0
  34. package/src/js/databar/expanded.js +968 -0
  35. package/src/js/databar/index.js +4 -0
  36. package/src/js/databar/layout.js +192 -0
  37. package/src/js/databar/limited.js +533 -0
  38. package/src/js/databar/stacked-omnidirectional.js +548 -0
  39. package/src/js/databar/stacked.js +528 -0
  40. package/src/js/dotcode/decoder.js +548 -0
  41. package/src/js/dotcode/detector.js +251 -0
  42. package/src/js/dotcode/encoder.js +453 -0
  43. package/src/js/dotcode/index.js +34 -0
  44. package/src/js/dotcode/tables.js +168 -0
  45. package/src/js/hanxin/decoder.js +299 -0
  46. package/src/js/hanxin/detector.js +122 -0
  47. package/src/js/hanxin/encoder.js +259 -0
  48. package/src/js/hanxin/index.js +16 -0
  49. package/src/js/hanxin/tables.js +316 -0
  50. package/src/js/image/height-coded.js +164 -0
  51. package/src/js/maxicode/decoder.js +275 -0
  52. package/src/js/maxicode/detector.js +118 -0
  53. package/src/js/maxicode/encoder.js +438 -0
  54. package/src/js/maxicode/index.js +34 -0
  55. package/src/js/maxicode/tables.js +132 -0
  56. package/src/js/oned/code25.js +148 -0
  57. package/src/js/oned/index.js +21 -3
  58. package/src/js/oned/postal.js +889 -0
  59. package/src/js/oned/reader.js +272 -7
  60. package/src/js/oned/telepen.js +361 -0
  61. package/src/js/oned/writers.js +186 -12
  62. package/src/js/stacked128/common.js +208 -0
  63. package/src/ts/codablockf/decoder.ts +212 -0
  64. package/src/ts/codablockf/encoder.ts +128 -0
  65. package/src/ts/codablockf/index.d.ts +31 -0
  66. package/src/ts/codablockf/index.ts +6 -0
  67. package/src/ts/code16k/decoder.d.ts +25 -0
  68. package/src/ts/code16k/decoder.ts +313 -0
  69. package/src/ts/code16k/detector.d.ts +21 -0
  70. package/src/ts/code16k/detector.ts +203 -0
  71. package/src/ts/code16k/encoder.d.ts +26 -0
  72. package/src/ts/code16k/encoder.ts +198 -0
  73. package/src/ts/code16k/index.d.ts +10 -0
  74. package/src/ts/code16k/index.ts +47 -0
  75. package/src/ts/code16k/tables.d.ts +54 -0
  76. package/src/ts/code16k/tables.ts +195 -0
  77. package/src/ts/composite/index.d.ts +74 -0
  78. package/src/ts/composite/index.ts +547 -0
  79. package/src/ts/core/detection-contract.d.ts +119 -0
  80. package/src/ts/core/detection-contract.ts +267 -0
  81. package/src/ts/core/symbol-layout.d.ts +108 -0
  82. package/src/ts/core/symbol-layout.ts +236 -0
  83. package/src/ts/databar/expanded.d.ts +40 -0
  84. package/src/ts/databar/expanded.ts +948 -0
  85. package/src/ts/databar/index.d.ts +48 -0
  86. package/src/ts/databar/index.ts +48 -0
  87. package/src/ts/databar/layout.d.ts +122 -0
  88. package/src/ts/databar/layout.ts +275 -0
  89. package/src/ts/databar/limited.d.ts +85 -0
  90. package/src/ts/databar/limited.ts +553 -0
  91. package/src/ts/databar/stacked-omnidirectional.d.ts +128 -0
  92. package/src/ts/databar/stacked-omnidirectional.ts +559 -0
  93. package/src/ts/databar/stacked.d.ts +96 -0
  94. package/src/ts/databar/stacked.ts +549 -0
  95. package/src/ts/dotcode/decoder.d.ts +58 -0
  96. package/src/ts/dotcode/decoder.ts +467 -0
  97. package/src/ts/dotcode/detector.d.ts +63 -0
  98. package/src/ts/dotcode/detector.ts +263 -0
  99. package/src/ts/dotcode/encoder.d.ts +69 -0
  100. package/src/ts/dotcode/encoder.ts +427 -0
  101. package/src/ts/dotcode/index.d.ts +37 -0
  102. package/src/ts/dotcode/index.ts +72 -0
  103. package/src/ts/dotcode/tables.d.ts +74 -0
  104. package/src/ts/dotcode/tables.ts +174 -0
  105. package/src/ts/hanxin/decoder.d.ts +48 -0
  106. package/src/ts/hanxin/decoder.ts +314 -0
  107. package/src/ts/hanxin/detector.d.ts +45 -0
  108. package/src/ts/hanxin/detector.ts +124 -0
  109. package/src/ts/hanxin/encoder.d.ts +41 -0
  110. package/src/ts/hanxin/encoder.ts +290 -0
  111. package/src/ts/hanxin/index.d.ts +16 -0
  112. package/src/ts/hanxin/index.ts +18 -0
  113. package/src/ts/hanxin/tables.d.ts +80 -0
  114. package/src/ts/hanxin/tables.ts +348 -0
  115. package/src/ts/image/height-coded.d.ts +101 -0
  116. package/src/ts/image/height-coded.ts +227 -0
  117. package/src/ts/index.d.ts +46 -2
  118. package/src/ts/index.ts +380 -13
  119. package/src/ts/maxicode/decoder.ts +265 -0
  120. package/src/ts/maxicode/detector.ts +109 -0
  121. package/src/ts/maxicode/encoder.ts +414 -0
  122. package/src/ts/maxicode/index.d.ts +96 -0
  123. package/src/ts/maxicode/index.ts +44 -0
  124. package/src/ts/maxicode/tables.ts +136 -0
  125. package/src/ts/oned/code25.d.ts +42 -0
  126. package/src/ts/oned/code25.ts +170 -0
  127. package/src/ts/oned/index.d.ts +7 -2
  128. package/src/ts/oned/index.ts +45 -3
  129. package/src/ts/oned/postal.d.ts +44 -0
  130. package/src/ts/oned/postal.ts +819 -0
  131. package/src/ts/oned/reader.d.ts +35 -0
  132. package/src/ts/oned/reader.ts +261 -7
  133. package/src/ts/oned/telepen.d.ts +65 -0
  134. package/src/ts/oned/telepen.ts +368 -0
  135. package/src/ts/oned/writers.d.ts +32 -0
  136. package/src/ts/oned/writers.ts +184 -13
  137. package/src/ts/stacked128/common.ts +225 -0
@@ -0,0 +1,61 @@
1
+ Postal 4-state family — format provenance and usability notes
2
+ ====================================================================
3
+
4
+ This file records the engineering and provenance boundary for the postal
5
+ formats implemented by Sythos Barcode Universal: USPS POSTNET, USPS PLANET,
6
+ Royal Mail 4-State Customer Code (RM4SCC), KIX, Australia Post 4-State, Japan
7
+ Post 4-State and USPS Intelligent Mail Barcode (IMb / OneCode).
8
+
9
+ Implementation
10
+ --------------
11
+
12
+ The TypeScript implementation and generated JavaScript in this repository are
13
+ original Sythos work and are distributed under the MIT License. The shared
14
+ height-coded classifier, state profiles, checks, Reed–Solomon arithmetic,
15
+ combinatorial IMb mapping and API dispatch are not copied from another barcode
16
+ implementation. The npm package has no runtime dependencies.
17
+
18
+ Public technical descriptions of the postal alphabets, bar heights, framing,
19
+ checks and payload envelopes were used as engineering input. The implementation
20
+ represents those public format rules in original Sythos data structures. This
21
+ file does not reproduce a standards document or grant certification.
22
+
23
+ Independent validation boundary
24
+ -------------------------------
25
+
26
+ BWIPP and bwip-js were invoked locally as independent black-box oracles. Their
27
+ rendered output was compared with Sythos encode/decode results for all seven
28
+ formats. They were used exclusively for verification and counter-checking; no
29
+ source code, lookup table, generated asset or runtime dependency from those
30
+ projects is copied into or shipped by this SDK. Agreement is engineering
31
+ evidence, not an endorsement or a licence grant.
32
+
33
+ Ownership and naming
34
+ --------------------
35
+
36
+ POSTNET, PLANET and IMb/OneCode are associated with the United States Postal
37
+ Service. RM4SCC is associated with Royal Mail. KIX is associated with the Dutch
38
+ postal system. Australia Post and Japan Post own or administer their respective
39
+ postal specifications and marks. Names are used descriptively to identify the
40
+ public symbology; this project is not endorsed, certified or operated by any of
41
+ those organisations.
42
+
43
+ Patent, copyright and trademark review
44
+ --------------------------------------
45
+
46
+ The code in this repository is MIT-licensed original Sythos work. Whether a
47
+ particular jurisdiction, implementation, service mark, specification edition or
48
+ postal-indicia programme imposes additional conditions is a separate legal
49
+ question. Users shipping a commercial postal workflow should obtain their own
50
+ professional review and any operator approval required for production mail.
51
+
52
+ [TO VERIFY] Current patent-family status and any jurisdiction-specific claims
53
+ for each postal symbology have not been independently searched in this project.
54
+
55
+ [TO VERIFY] Current trademark, certification-mark and operator-indicia rules
56
+ were not independently cleared here. Report a concrete notice, licence term or
57
+ conflicting source through a GitHub issue so it can be reviewed and recorded.
58
+
59
+ This engineering note intentionally keeps those questions visible instead of
60
+ making a broad “patent-free” or “certified” claim. See `LICENSE`, `NOTICE.md`
61
+ and `licenses/README.md` for the project-wide boundary.
@@ -0,0 +1,53 @@
1
+ PZN-7 and PZN-8 — format provenance and usability
2
+ =================================================
3
+
4
+ This file records the engineering provenance and redistribution boundary for
5
+ the PZN (Pharmazentralnummer) implementation shipped by Sythos Barcode
6
+ Universal.
7
+
8
+ It is an engineering inventory, not legal advice. Patent, copyright and
9
+ trademark conclusions still need independent review for the jurisdiction and
10
+ the intended product. Items marked [TO VERIFY] remain open questions.
11
+
12
+
13
+ FORMAT AND IMPLEMENTATION BASIS
14
+ -------------------------------
15
+
16
+ PZN-7 and PZN-8 are German pharmaceutical identifiers carried here in a
17
+ Code 39-shaped symbol. The writer accepts a six- or seven-digit body, computes
18
+ the corresponding modulo-11 check digit (rejecting the reserved value ten),
19
+ and emits the documented leading hyphen and check character. The reader first
20
+ validates the complete Code 39 carrier and then validates the PZN check digit;
21
+ it reports the detected PZN-7 or PZN-8 variant instead of guessing from a
22
+ partial payload.
23
+
24
+ The runtime is original Sythos TypeScript with generated JavaScript output and
25
+ is distributed under the MIT License. The names PZN, Pharmazentralnummer and
26
+ Code 39 are used descriptively and do not imply certification, sponsorship or
27
+ endorsement by a registry owner or standards organisation.
28
+
29
+
30
+ PATENT AND TRADEMARK REVIEW
31
+ ---------------------------
32
+
33
+ Historical pharmaceutical-label patents, national patent families and current
34
+ registrations for PZN or related marks have not been independently cleared
35
+ here. [TO VERIFY] This project makes no unconditional patent-free,
36
+ public-domain or trademark-clearance claim.
37
+
38
+
39
+ INDEPENDENT VALIDATION BOUNDARY
40
+ -------------------------------
41
+
42
+ BWIPP/bwip-js was used only as a local, independent black-box oracle to compare
43
+ rendered PZN-7 and PZN-8 symbols. Its source, tables and runtime are not copied
44
+ into or shipped by this SDK, and it is not a runtime dependency. The comparison
45
+ is an engineering check, not a legal opinion or a conformance certificate.
46
+
47
+
48
+ CONCLUSION
49
+ ----------
50
+
51
+ The original Sythos PZN implementation is MIT-licensed. If a rights holder or
52
+ user identifies a conflicting notice about the available material, please open
53
+ a GitHub issue with the reference so it can be reviewed and recorded.
@@ -0,0 +1,73 @@
1
+ Telepen — format provenance and usability
2
+ ==========================================
3
+
4
+ This file records the engineering provenance and redistribution boundary for
5
+ the Telepen Alpha and Telepen Numeric implementation shipped by Sythos Barcode
6
+ Universal.
7
+
8
+ It is an ENGINEERING INVENTORY, NOT LEGAL ADVICE. Patent, copyright and
9
+ trademark conclusions require independent review for the jurisdiction and use
10
+ case involved. Items marked [TO VERIFY] have not been independently confirmed.
11
+
12
+
13
+ ORIGIN AND SPECIFICATION
14
+ ------------------------
15
+
16
+ Telepen is a linear symbology associated with SB Electronic Systems Ltd. The
17
+ publicly described Alpha form carries seven-bit ASCII with an even parity bit;
18
+ the Numeric form compacts digit pairs and uses the same start, check and stop
19
+ grammar. No ISO/IEC standard text is reproduced or redistributed here.
20
+ [LEGAL REVIEW]
21
+
22
+
23
+ PATENT STATUS
24
+ -------------
25
+
26
+ Historical Telepen patent families and any jurisdiction-specific licensing
27
+ declarations require a current patent search. This project makes no unconditional
28
+ patent-free or public-domain claim. [TO VERIFY]
29
+
30
+
31
+ TRADEMARK STATUS
32
+ ----------------
33
+
34
+ The current ownership and registration status of the Telepen name have not
35
+ been independently searched. The name is used descriptively to identify the
36
+ symbology and does not imply certification, sponsorship or endorsement by SB
37
+ Electronic Systems Ltd or any standards or mark owner. [TO VERIFY]
38
+
39
+
40
+ IMPLEMENTATION BASIS IN THIS PROJECT
41
+ ------------------------------------
42
+
43
+ Telepen is implemented as original Sythos TypeScript with generated JavaScript
44
+ runtime files. The glyph mapping is generated algorithmically from the
45
+ published seven-bit/parity and narrow/wide rules rather than copied as a
46
+ third-party table. The writer enforces ASCII bounds, Numeric pair grammar,
47
+ payload length, modulo-127 check value and complete start/stop structure. The
48
+ reader uses scale-independent run matching, checksum validation and ambiguity
49
+ rejection; Numeric decoding is explicit so digit-pair glyphs are never guessed
50
+ as arbitrary ASCII control characters.
51
+
52
+ Independent implementations and public technical material were used only for
53
+ engineering review and black-box interoperability checks. In particular,
54
+ ZXing-C++ and BWIPP/bwip-js were invoked as external tools; no third-party
55
+ source code, lookup table or binary asset is copied into or shipped by this
56
+ project, and neither tool is a runtime dependency.
57
+
58
+
59
+ CONCLUSION
60
+ ----------
61
+
62
+ The original Sythos Telepen implementation is distributed under the MIT
63
+ License. This engineering note is not a conformance certificate, patent
64
+ clearance or legal opinion. If a rights holder or user identifies a conflicting
65
+ notice about the available materials, please open a GitHub issue with the
66
+ relevant reference so it can be reviewed and recorded.
67
+
68
+ References consulted:
69
+
70
+ - [Telepen overview](https://barcode.ro/tutorials/barcodes/telepen.html)
71
+ - [Telepen symbology notes](https://barcodeguide.seagullscientific.com/Content/Symbologies/Telepen.htm)
72
+ - [BWIPP Telepen implementation](https://github.com/bwipp/postscriptbarcode)
73
+ - Independent black-box validation recorded in `NOTICE.md`
package/llms.txt CHANGED
@@ -8,13 +8,20 @@
8
8
  - Project: Sythos Barcode Universal
9
9
  - Publisher and original author: Sythos — https://www.sythos.net
10
10
  - npm package: `@sythos/js_barcode_universal`
11
- - Current repository release: `1.5.13`
11
+ - Current repository release: `1.5.15`
12
12
  - License: MIT; copyright and attribution: Sythos
13
13
  - Runtime dependencies: none
14
14
  - Development tooling: TypeScript is a development-only dependency
15
15
  - Repository: https://github.com/Sythos/JS_Barcode_Universal
16
16
  - npm: https://www.npmjs.com/package/@sythos/js_barcode_universal
17
- - Documentation: https://github.com/Sythos/JS_Barcode_Universal#readme
17
+ - Documentation: https://sythos.github.io/JS_Barcode_Universal/
18
+ - Documentation source: https://github.com/Sythos/JS_Barcode_Universal/tree/main/docs
19
+ - API reference: https://sythos.github.io/JS_Barcode_Universal/api/overview/
20
+ - Format catalogue: https://sythos.github.io/JS_Barcode_Universal/formats/overview/
21
+ - Recipes: https://sythos.github.io/JS_Barcode_Universal/examples/create-barcode/
22
+ - FAQ: https://sythos.github.io/JS_Barcode_Universal/faq/
23
+ - Troubleshooting: https://sythos.github.io/JS_Barcode_Universal/troubleshooting/
24
+ - Compact project overview: https://github.com/Sythos/JS_Barcode_Universal#readme
18
25
  - Issue tracker: https://github.com/Sythos/JS_Barcode_Universal/issues
19
26
 
20
27
  ## What this SDK does
@@ -37,6 +44,9 @@ packages.
37
44
 
38
45
  The public `listFormats()` API reports writing and reading separately. A format
39
46
  marked `write-only` is intentionally not treated as a generic image reader.
47
+ At the current checkout it reports 50 writable entries and 49 readable entries;
48
+ Pharmacode is the sole intentionally write-only entry, while EAN-2 and EAN-5
49
+ remain parent-bound supplements.
40
50
 
41
51
  ### 1D linear formats
42
52
 
@@ -49,11 +59,24 @@ marked `write-only` is intentionally not treated as a generic image reader.
49
59
  - Code 93 — write and read
50
60
  - ITF (Interleaved 2 of 5) — write and read
51
61
  - ITF-14 — write and read through the ITF family
62
+ - Code 25 / Standard 2 of 5 — write and read as `standard2of5` or `code2of5`
63
+ - Industrial 2 of 5 — write and read with the canonical Industrial frame
64
+ - IATA 2 of 5 — write and read with the shorter IATA guard frame
52
65
  - Codabar — write and read
53
66
  - Code 11 — write and scanline/image read
54
67
  - MSI Plessey — write and read, with optional check-digit validation
68
+ - Code 32 (Italian Pharmacode) — write and read with validated pharmaceutical check digit
69
+ - PZN-7 and PZN-8 — write and read; the decoder exposes `pznVariant`
70
+ - Telepen — write and read in full seven-bit ASCII mode; explicit Telepen Numeric
71
+ mode handles digit pairs and `X` suffix pairs
55
72
  - Pharmacode — write-only in the generic image pipeline
56
- - GS1 DataBar Omnidirectional and Truncated — write and read through the verified physical layer
73
+ - GS1 DataBar Omnidirectional, Truncated, Limited, Stacked, Stacked Omnidirectional and Expanded — write and read through verified physical layers
74
+ - USPS POSTNET and PLANET — write and read with operator-specific Mod-10 checks
75
+ - Royal Mail 4-State Customer Code (RM4SCC) — write and read with a generated and verified check character
76
+ - KIX — write and read with the Dutch four-state alphabet and no check character
77
+ - Australia Post 4-State — write and read with FCC/DPID, GF(64) parity and explicit character or numeric customer data
78
+ - Japan Post 4-State — write and read with grouped public payloads, padding and Mod-19 validation
79
+ - USPS Intelligent Mail Barcode (IMb / OneCode) — write and read for 20-, 25-, 29- and 31-digit payloads with frame-check validation
57
80
  - EAN-2 and EAN-5 supplements — write and parent-bound read only; they require a validated EAN/UPC parent
58
81
 
59
82
  ### 2D matrix and stacked formats
@@ -68,10 +91,32 @@ marked `write-only` is intentionally not treated as a generic image reader.
68
91
  - Micro QR Code — write and read for the supported M1–M4 family; M1 is detection-only
69
92
  - rMQR Code — write and read for the supported standard rectangular geometries
70
93
  - Sythos Canvas QR profile — write and read as the non-certified `sythos-canvas-qr/1` profile
94
+ - MaxiCode — write and read for fixed 30×33 symbols, Modes 2–5 and ISO-8859-1 Code Sets A–E
95
+ - Codablock-F — write and read for stacked Code 128 rows with row and overall checks; clean integer-scale detection
96
+ - Code 16K — write and read for compact stacked Code 128 A/B/C rows, optional GS1 modes, dual modulo-107 checks and clean integer-scale detection
97
+ - DotCode — write and read for the bounded alternating-dot profile, four masks, GF(113) correction and clean integer-scale detection
98
+ - Han Xin Code — write and read for compact alignment-free versions 1–3, numeric/text/byte modes, four masks, GF(256) correction and clean integer-scale detection
99
+ - GS1 DataBar Composite — write and read for the bounded Sythos profile linking one validated DataBar host to a strict MicroPDF417-derived CC-A or CC-B component; complete ISO/IEC 24723 certification is not claimed
71
100
 
72
101
  The Sythos Canvas QR profile is not DENSO FrameQR® compatible and does not
73
102
  claim native DENSO interoperability.
74
103
 
104
+ Code 25-family aliases (`standard2of5`, `code2of5`, `industrial2of5` and
105
+ `iata2of5`) are explicit format selectors. Code 32 and PZN readers validate
106
+ their complete carrier and check digit before returning a result; incomplete
107
+ or ambiguous camera frames return nothing.
108
+
109
+ Postal aliases (`usps-postnet`, `usps-planet`, `royalmail`, `royal-mail`,
110
+ `australia-post`, `australiapost`, `japan-post`, `onecode` and `usps-onecode`)
111
+ resolve to the canonical ids `postnet`, `planet`, `rm4scc`, `auspost`,
112
+ `japanpost` and `imb`. Australia Post accepts `customerEncoding: 'character'`
113
+ or `'numeric'` (and the compatibility alias `custinfoenc`). Postal camera
114
+ reads require a measurable quiet zone and a complete validated symbol.
115
+ Han Xin root dispatch accepts both `hanxin` and `han-xin`; its focused
116
+ subpath is `@sythos/js_barcode_universal/hanxin`.
117
+ GS1 Composite root dispatch accepts `gs1composite`, `gs1-composite` and
118
+ `composite`; its focused subpath is `@sythos/js_barcode_universal/composite`.
119
+
75
120
  ## Main API
76
121
 
77
122
  The package root exports `encode`, `decode`, `decodeStrict`, `listFormats`,
@@ -90,6 +135,8 @@ subpaths are available for smaller imports, including:
90
135
  - `@sythos/js_barcode_universal/rmqr`
91
136
  - `@sythos/js_barcode_universal/frameqr`
92
137
  - `@sythos/js_barcode_universal/databar`
138
+ - `@sythos/js_barcode_universal/hanxin`
139
+ - `@sythos/js_barcode_universal/composite`
93
140
  - `@sythos/js_barcode_universal/render`
94
141
 
95
142
  Typical usage:
@@ -115,9 +162,7 @@ limitations are documented in `README.md` and `PLAN.md`.
115
162
  ## Deliberate scope boundaries
116
163
 
117
164
  - Data Matrix Rectangular Extension (DMRE) is not included.
118
- - GS1 DataBar Limited, Stacked, Stacked Omnidirectional and Expanded physical
119
- layouts remain outside the current release.
120
- - MaxiCode is not implemented.
165
+ - GS1 DataBar Expanded Stacked remains outside the current release; the linear Expanded variant is supported.
121
166
  - Micro QR ECI, FNC1/GS1 and Structured Append are outside the current API scope.
122
167
  - SQRC and Face Authentication SQRC are DENSO-licensed formats and are not
123
168
  included in this MIT SDK. A user must obtain the appropriate DENSO licence
@@ -140,6 +185,15 @@ the files under `licenses/`, including:
140
185
 
141
186
  - `licenses/pdf417.license`
142
187
  - `licenses/micropdf417.license`
188
+ - `licenses/maxicode.license`
189
+ - `licenses/gs1-databar.license`
190
+ - `licenses/code25.license`
191
+ - `licenses/code32.license`
192
+ - `licenses/pzn.license`
193
+ - `licenses/postal.license`
194
+ - `licenses/dotcode.license`
195
+ - `licenses/hanxin.license`
196
+ - `licenses/gs1-composite.license`
143
197
 
144
198
  Those files are engineering inventories, not legal advice. Patent, copyright,
145
199
  trademark, standards and jurisdictional questions should receive independent
@@ -148,6 +202,8 @@ professional review where required.
148
202
  ## Canonical project files
149
203
 
150
204
  - Human documentation: `README.md`
205
+ - Published documentation: https://sythos.github.io/JS_Barcode_Universal/
206
+ - Documentation source tree: `docs/`
151
207
  - Roadmap and implementation boundaries: `PLAN.md`
152
208
  - MIT terms: `LICENSE`
153
209
  - Attribution and provenance: `NOTICE.md`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sythos/js_barcode_universal",
3
- "version": "1.5.13",
3
+ "version": "1.5.15",
4
4
  "description": "Open-source MIT-licensed JavaScript/TypeScript barcode generator and barcode reader SDK with zero runtime dependencies for 1D and 2D barcodes in browsers, Web Workers and Node.js: QR, Data Matrix, Aztec, PDF417, GS1, EAN and more.",
5
5
  "author": {
6
6
  "name": "Sythos",
@@ -50,6 +50,30 @@
50
50
  "import": "./src/js/databar/index.js",
51
51
  "types": "./src/ts/databar/index.d.ts"
52
52
  },
53
+ "./maxicode": {
54
+ "import": "./src/js/maxicode/index.js",
55
+ "types": "./src/ts/maxicode/index.d.ts"
56
+ },
57
+ "./codablockf": {
58
+ "import": "./src/js/codablockf/index.js",
59
+ "types": "./src/ts/codablockf/index.d.ts"
60
+ },
61
+ "./code16k": {
62
+ "import": "./src/js/code16k/index.js",
63
+ "types": "./src/ts/code16k/index.d.ts"
64
+ },
65
+ "./dotcode": {
66
+ "import": "./src/js/dotcode/index.js",
67
+ "types": "./src/ts/dotcode/index.d.ts"
68
+ },
69
+ "./hanxin": {
70
+ "import": "./src/js/hanxin/index.js",
71
+ "types": "./src/ts/hanxin/index.d.ts"
72
+ },
73
+ "./composite": {
74
+ "import": "./src/js/composite/index.js",
75
+ "types": "./src/ts/composite/index.d.ts"
76
+ },
53
77
  "./aztec": {
54
78
  "import": "./src/js/aztec/index.js",
55
79
  "types": "./src/ts/aztec/index.d.ts"
@@ -171,8 +195,20 @@
171
195
  "code93",
172
196
  "itf",
173
197
  "itf14",
198
+ "code-25",
199
+ "code2of5",
200
+ "standard-2-of-5",
201
+ "industrial-2-of-5",
202
+ "iata-2-of-5",
174
203
  "codabar",
175
204
  "msi",
205
+ "code32",
206
+ "italian-pharmacode",
207
+ "pzn",
208
+ "pzn7",
209
+ "pzn8",
210
+ "telepen",
211
+ "telepen-numeric",
176
212
  "code11",
177
213
  "pharmacode",
178
214
  "scanner",
@@ -198,13 +234,21 @@
198
234
  "bugs": {
199
235
  "url": "https://github.com/Sythos/JS_Barcode_Universal/issues"
200
236
  },
201
- "homepage": "https://github.com/Sythos/JS_Barcode_Universal#readme",
237
+ "homepage": "https://sythos.github.io/JS_Barcode_Universal/",
202
238
  "scripts": {
203
239
  "build:ts": "node tools/compile-typescript.mjs",
204
- "types": "tsc -p tsconfig.json",
240
+ "lint": "eslint --max-warnings=0 src/index.js src/js tools .github/ci",
241
+ "test:docs": "node --test tools/exact-url.test.mjs",
242
+ "test:foundations": "node --test test/foundation.test.js",
243
+ "test:formats": "node --test test/maxicode.test.js test/databar-stacked.test.js test/databar-stacked-omnidirectional.test.js test/databar-limited.test.js test/databar-expanded.test.js test/telepen.test.js test/code25-code32.test.js test/postal.test.js test/codablockf.test.js test/code16k.test.js test/dotcode.test.js test/hanxin.test.js test/gs1-composite.test.js",
244
+ "test:fuzz": "node --test test/fuzz/property.test.js",
245
+ "types": "node node_modules/typescript/bin/tsc -p tsconfig.json",
205
246
  "types:api": "node tools/check-public-types.mjs"
206
247
  },
207
248
  "devDependencies": {
249
+ "@eslint/js": "10.0.1",
250
+ "eslint": "10.9.1",
251
+ "fast-check": "4.9.0",
208
252
  "typescript": "7.0.2"
209
253
  }
210
254
  }
package/src/index.d.ts CHANGED
@@ -45,6 +45,7 @@
45
45
  * @module @sythos/js_barcode_universal
46
46
  */
47
47
  import { BitMatrix } from './ts/core/bit-matrix.js';
48
+ import type { GS1CompositeComponent, GS1CompositeInput } from './ts/composite/index.js';
48
49
  export { BitMatrix };
49
50
  export { BarcodeError, EncodeError, NotFoundError, FormatError, ChecksumError, } from './ts/core/errors.js';
50
51
  export { LuminanceSource } from './ts/image/luminance.js';
@@ -62,10 +63,46 @@ export * from './ts/aztecrune/index.js';
62
63
  export { encodePDF417, decodePDF417, detectPDF417, detectAndDecodePDF417 } from './ts/pdf417/index.js';
63
64
  export * from './ts/compactpdf417/index.js';
64
65
  export * from './ts/databar/index.js';
66
+ export {
67
+ encodeMaxiCode,
68
+ decodeMaxiCode,
69
+ detectMaxiCode,
70
+ detectAndDecodeMaxiCode,
71
+ } from './ts/maxicode/index.js';
72
+ export {
73
+ encodeCodablockF,
74
+ decodeCodablockF,
75
+ detectCodablockF,
76
+ detectAndDecodeCodablockF,
77
+ } from './ts/codablockf/index.js';
78
+ export {
79
+ encodeCode16K,
80
+ decodeCode16K,
81
+ detectCode16K,
82
+ detectAndDecodeCode16K,
83
+ } from './ts/code16k/index.js';
84
+ export * from './ts/dotcode/index.js';
85
+ export * from './ts/hanxin/index.js';
65
86
  export { encodeMicroPDF417, decodeMicroPDF417, detectMicroPDF417, detectAndDecodeMicroPDF417, } from './ts/micropdf417/index.js';
66
87
  export { encodeMicroQR, decodeMicroQR, detectMicroQR, detectAndDecodeMicroQR } from './ts/microqr/index.js';
67
88
  export { encodeRMQR, decodeRMQR, detectRMQR, detectAndDecodeRMQR } from './ts/rmqr/index.js';
68
89
  export { encodeFrameQR, decodeFrameQR, detectFrameQR, detectAndDecodeFrameQR, } from './ts/frameqr/index.js';
90
+ export {
91
+ GS1_COMPOSITE_PROFILE,
92
+ GS1_COMPOSITE_HOSTS,
93
+ encodeGS1Composite,
94
+ decodeGS1Composite,
95
+ detectGS1Composite,
96
+ detectAndDecodeGS1Composite,
97
+ } from './ts/composite/index.js';
98
+ export type {
99
+ GS1CompositeHostFormat,
100
+ GS1CompositeComponent,
101
+ GS1Element,
102
+ GS1CompositeInput,
103
+ GS1CompositeOptions,
104
+ GS1CompositeResult,
105
+ } from './ts/composite/index.js';
69
106
  export type FormatInfo = {
70
107
  id: string;
71
108
  label: string;
@@ -93,14 +130,21 @@ export declare function listFormats(): FormatInfo[];
93
130
  * output medium. Linear symbols come back one module tall; height is a
94
131
  * rendering decision, not an encoding one.
95
132
  *
96
- * @param {string | number} text
133
+ * @param {string | number | GS1CompositeInput} text
97
134
  * @param {object} [options]
98
135
  * @param {string} [options.format] Format id. Default 'qr'.
99
- * @param {'L'|'M'|'Q'|'H'} [options.ecc] QR error-correction level.
100
- * @param {number} [options.version] QR version, 1-40. Auto if omitted.
136
+ * @param {'L'|'M'|'Q'|'H'|'L1'|'L2'|'L3'|'L4'|1|2|3|4} [options.ecc] QR or Han Xin error-correction level.
137
+ * @param {number} [options.version] QR version 1-40 or Han Xin version 1-3. Auto if omitted.
101
138
  * @param {boolean} [options.checkDigit] Append a check digit, where optional.
139
+ * @param {'character'|'numeric'} [options.customerEncoding] Australia Post customer-data encoding.
140
+ * @param {'character'|'numeric'} [options.custinfoenc] Australia Post compatibility alias.
141
+ * @param {boolean} [options.pzn8] Select the eight-digit PZN profile.
142
+ * @param {'pzn7'|'pzn8'|'standard'|'industrial'|'iata'} [options.variant] PZN or Code 25 variant.
143
+ * @param {number} [options.wideRatio] Wide-bar ratio for Code 25 variants.
102
144
  * @param {boolean} [options.fullAscii] Code 39 extended encoding.
103
145
  * @param {boolean} [options.gs1] Emit a leading FNC1.
146
+ * @param {GS1CompositeComponent} [options.component] Bounded GS1 Composite component selection.
147
+ * @param {1|2|3} [options.separatorGap] Composite separator rows.
104
148
  * @param {number} [options.layers] Aztec layer count; automatic if omitted.
105
149
  * @param {boolean} [options.compact] Force an Aztec Compact or Full symbol.
106
150
  * @param {number} [options.eccPercent] Requested Aztec error-correction percentage.
@@ -111,6 +155,8 @@ export declare function listFormats(): FormatInfo[];
111
155
  * @param {'auto'|'text'|'byte'|'numeric'} [options.compaction] PDF417 compaction mode.
112
156
  * @param {number} [options.eci] MicroPDF417 byte-compaction ECI assignment (3 or 26).
113
157
  * @param {number} [options.aspectRatio] Preferred MicroPDF417 symbol aspect ratio.
158
+ * @param {0|1|2|3} [options.mask] Han Xin data mask.
159
+ * @param {2|3|4|5|'auto'|'numeric'|'text'|'byte'} [options.mode] MaxiCode mode or Han Xin payload mode.
114
160
  * @param {object} [options.canvas] FrameQR Code artwork reservation.
115
161
  * @param {'square'|'circle'|'diamond'} [options.canvas.shape] Canvas shape.
116
162
  * @param {number} [options.canvas.size] Odd canvas size in QR modules.
@@ -121,11 +167,18 @@ export declare function listFormats(): FormatInfo[];
121
167
  * @param {0|90|180|270} [options.canvas.angle] Canvas quarter-turn.
122
168
  * @returns {BitMatrix}
123
169
  */
124
- export declare function encode(text: string | number, options?: {
170
+ export declare function encode(text: string | number | GS1CompositeInput, options?: {
125
171
  format?: string;
126
- ecc?: 'L' | 'M' | 'Q' | 'H';
172
+ ecc?: 'L' | 'M' | 'Q' | 'H' | 'L1' | 'L2' | 'L3' | 'L4' | 1 | 2 | 3 | 4;
127
173
  version?: number;
128
174
  checkDigit?: boolean;
175
+ customerEncoding?: 'character' | 'numeric';
176
+ custinfoenc?: 'character' | 'numeric';
177
+ pzn8?: boolean;
178
+ variant?: 'pzn7' | 'pzn8' | 'standard' | 'industrial' | 'iata';
179
+ wideRatio?: number;
180
+ telepenMode?: 'ascii' | 'numeric';
181
+ numeric?: boolean;
129
182
  fullAscii?: boolean;
130
183
  gs1?: boolean;
131
184
  layers?: number;
@@ -138,6 +191,20 @@ export declare function encode(text: string | number, options?: {
138
191
  compaction?: 'auto' | 'text' | 'byte' | 'numeric';
139
192
  eci?: number;
140
193
  aspectRatio?: number;
194
+ mode?: 2 | 3 | 4 | 5 | 'auto' | 'numeric' | 'text' | 'byte';
195
+ mask?: 0 | 1 | 2 | 3;
196
+ primary?: {
197
+ postalCode: string;
198
+ countryCode: number;
199
+ serviceClass: number;
200
+ };
201
+ charset?: 'latin1';
202
+ linkage?: boolean;
203
+ moduleScale?: number;
204
+ scale?: number;
205
+ height?: number;
206
+ component?: GS1CompositeComponent;
207
+ separatorGap?: 1 | 2 | 3;
141
208
  canvas?: {
142
209
  shape?: 'square' | 'circle' | 'diamond';
143
210
  size?: number;
@@ -203,6 +270,10 @@ export type DecodeResult = {
203
270
  * PDF417 row height in modules.
204
271
  */
205
272
  rowHeight?: number;
273
+ /** Detected integer module scale for stacked formats. */
274
+ moduleSize?: number;
275
+ /** Whether stacked-format row and overall checks passed. */
276
+ checksum?: boolean;
206
277
  /**
207
278
  * MicroPDF417 predefined variant number.
208
279
  */
@@ -286,6 +357,32 @@ export type DecodeResult = {
286
357
  * GS1 DataBar linkage flag.
287
358
  */
288
359
  linkage?: boolean;
360
+ /** Whether an optional numeric check digit was validated. */
361
+ checkDigit?: boolean;
362
+ /** PZN variant identified by the decoder. */
363
+ pznVariant?: 'pzn7' | 'pzn8';
364
+ /** Whether the bounded GS1 Composite component is CC-A or CC-B. */
365
+ component?: 'cc-a' | 'cc-b';
366
+ /** Selected MicroPDF417-derived composite component variant. */
367
+ componentVariant?: number;
368
+ componentRows?: number;
369
+ componentColumns?: number;
370
+ componentRowHeight?: number;
371
+ separatorGap?: number;
372
+ linearFormat?: string;
373
+ linear?: Record<string, unknown>;
374
+ /** MaxiCode mode or Han Xin payload mode. */
375
+ mode?: 2 | 3 | 4 | 5 | 'numeric' | 'text' | 'byte';
376
+ /** Han Xin data mask. */
377
+ mask?: 0 | 1 | 2 | 3;
378
+ /** Han Xin module polarity. */
379
+ inverted?: boolean;
380
+ /** MaxiCode structured primary message for modes 2 and 3. */
381
+ primary?: {
382
+ postalCode: string;
383
+ countryCode: number;
384
+ serviceClass: number;
385
+ };
289
386
  };
290
387
  /**
291
388
  * @typedef {object} DecodeResult
@@ -318,6 +415,10 @@ export type DecodeResult = {
318
415
  * @property {string} [gs1ParseError] Semantic GS1 parsing error after a valid physical read.
319
416
  * @property {string} [gtin] GS1 DataBar GTIN-14 payload.
320
417
  * @property {boolean} [linkage] GS1 DataBar linkage flag.
418
+ * @property {boolean} [checkDigit] Whether an optional numeric check digit was validated.
419
+ * @property {'pzn7'|'pzn8'} [pznVariant] PZN variant identified by the decoder.
420
+ * @property {0|1|2|3} [mask] Han Xin data mask.
421
+ * @property {boolean} [inverted] Han Xin module polarity.
321
422
  */
322
423
  /**
323
424
  * Find and decode every barcode in an image.
@@ -334,6 +435,8 @@ export type DecodeResult = {
334
435
  * @param {'camera'} [options.profile] Opt-in strict camera profile for validated 1D reads.
335
436
  * @param {object} [options.frameqr] FrameQR Code detector options when
336
437
  * the profile marker is not preserved through image rendering.
438
+ * @param {'character'|'numeric'} [options.customerEncoding] Australia Post customer-data encoding.
439
+ * @param {'character'|'numeric'} [options.custinfoenc] Australia Post compatibility alias.
337
440
  * @returns {DecodeResult[]}
338
441
  */
339
442
  export declare function decode(image: {
@@ -346,6 +449,8 @@ export declare function decode(image: {
346
449
  binarizer?: 'global' | 'hybrid' | 'auto';
347
450
  profile?: 'camera';
348
451
  frameqr?: object;
452
+ customerEncoding?: 'character' | 'numeric';
453
+ custinfoenc?: 'character' | 'numeric';
349
454
  }): DecodeResult[];
350
455
  /**
351
456
  * Decode, or throw if nothing is found.
@@ -360,4 +465,4 @@ export declare function decodeStrict(image: {
360
465
  height: number;
361
466
  }, options?: object): DecodeResult;
362
467
  /** Library version, matching package.json. */
363
- export declare const VERSION = "1.5.13";
468
+ export declare const VERSION = "1.5.15";