gs1-core 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/LICENSE +21 -0
- package/dist/ai.d.ts +3 -0
- package/dist/ai.js +244 -0
- package/dist/ai.js.map +1 -0
- package/dist/check-digit.d.ts +3 -0
- package/dist/check-digit.js +22 -0
- package/dist/check-digit.js.map +1 -0
- package/dist/digital-link.d.ts +7 -0
- package/dist/digital-link.js +87 -0
- package/dist/digital-link.js.map +1 -0
- package/dist/element.d.ts +12 -0
- package/dist/element.js +41 -0
- package/dist/element.js.map +1 -0
- package/dist/generate.d.ts +8 -0
- package/dist/generate.js +30 -0
- package/dist/generate.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/interpret.d.ts +5 -0
- package/dist/interpret.js +107 -0
- package/dist/interpret.js.map +1 -0
- package/dist/parse.d.ts +10 -0
- package/dist/parse.js +94 -0
- package/dist/parse.js.map +1 -0
- package/dist/spec.d.ts +4 -0
- package/dist/spec.js +70 -0
- package/dist/spec.js.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/package.json +51 -0
- package/readme.md +195 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 rmingon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/ai.d.ts
ADDED
package/dist/ai.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { compileSpec } from './spec.js';
|
|
2
|
+
// Application identifier table, following the GS1 General Specifications.
|
|
3
|
+
// An AI ending in "n" is a family whose 4th digit gives the implied decimal
|
|
4
|
+
// point position (e.g. "310n" matches 3100-3109).
|
|
5
|
+
const TABLE = [
|
|
6
|
+
{ ai: '00', title: 'SSCC', description: 'Serial Shipping Container Code', spec: 'N18', pre: true, cd: 18 },
|
|
7
|
+
{ ai: '01', title: 'GTIN', description: 'Global Trade Item Number', spec: 'N14', pre: true, cd: 14 },
|
|
8
|
+
{ ai: '02', title: 'CONTENT', description: 'GTIN of contained trade items', spec: 'N14', pre: true, cd: 14 },
|
|
9
|
+
{ ai: '03', title: 'MTO GTIN', description: 'GTIN of a made-to-order trade item', spec: 'N14', pre: true, cd: 14 },
|
|
10
|
+
{ ai: '10', title: 'BATCH/LOT', description: 'Batch or lot number', spec: 'X..20' },
|
|
11
|
+
{ ai: '11', title: 'PROD DATE', description: 'Production date (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
12
|
+
{ ai: '12', title: 'DUE DATE', description: 'Due date for amount on payment slip (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
13
|
+
{ ai: '13', title: 'PACK DATE', description: 'Packaging date (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
14
|
+
{ ai: '15', title: 'BEST BEFORE or BEST BY', description: 'Best before date (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
15
|
+
{ ai: '16', title: 'SELL BY', description: 'Sell by date (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
16
|
+
{ ai: '17', title: 'USE BY OR EXPIRY', description: 'Expiration date (YYMMDD)', spec: 'N6', pre: true, kind: 'date' },
|
|
17
|
+
{ ai: '20', title: 'VARIANT', description: 'Internal product variant', spec: 'N2', pre: true },
|
|
18
|
+
{ ai: '21', title: 'SERIAL', description: 'Serial number', spec: 'X..20' },
|
|
19
|
+
{ ai: '22', title: 'CPV', description: 'Consumer product variant', spec: 'X..20' },
|
|
20
|
+
{ ai: '235', title: 'TPX', description: 'Third party controlled, serialised extension of GTIN', spec: 'X..28' },
|
|
21
|
+
{ ai: '240', title: 'ADDITIONAL ID', description: 'Additional product identification assigned by the manufacturer', spec: 'X..30' },
|
|
22
|
+
{ ai: '241', title: 'CUST. PART No.', description: 'Customer part number', spec: 'X..30' },
|
|
23
|
+
{ ai: '242', title: 'MTO VARIANT', description: 'Made-to-order variation number', spec: 'N..6' },
|
|
24
|
+
{ ai: '243', title: 'PCN', description: 'Packaging component number', spec: 'X..20' },
|
|
25
|
+
{ ai: '250', title: 'SECONDARY SERIAL', description: 'Secondary serial number', spec: 'X..30' },
|
|
26
|
+
{ ai: '251', title: 'REF. TO SOURCE', description: 'Reference to source entity', spec: 'X..30' },
|
|
27
|
+
{ ai: '253', title: 'GDTI', description: 'Global Document Type Identifier', spec: 'N13+X..17', cd: 13 },
|
|
28
|
+
{ ai: '254', title: 'GLN EXTENSION COMPONENT', description: 'GLN extension component', spec: 'X..20' },
|
|
29
|
+
{ ai: '255', title: 'GCN', description: 'Global Coupon Number', spec: 'N13+N..12', cd: 13 },
|
|
30
|
+
{ ai: '30', title: 'VAR. COUNT', description: 'Variable count of items', spec: 'N..8', kind: 'count' },
|
|
31
|
+
{ ai: '37', title: 'COUNT', description: 'Count of trade items or pieces contained in a logistic unit', spec: 'N..8', kind: 'count' },
|
|
32
|
+
// Trade measures (kind 'decimal': 4th AI digit = implied decimal position)
|
|
33
|
+
{ ai: '310n', title: 'NET WEIGHT (kg)', description: 'Net weight, kilograms', spec: 'N6', pre: true, kind: 'decimal' },
|
|
34
|
+
{ ai: '311n', title: 'LENGTH (m)', description: 'Length or first dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
35
|
+
{ ai: '312n', title: 'WIDTH (m)', description: 'Width, diameter or second dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
36
|
+
{ ai: '313n', title: 'HEIGHT (m)', description: 'Depth, thickness, height or third dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
37
|
+
{ ai: '314n', title: 'AREA (m²)', description: 'Area, square metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
38
|
+
{ ai: '315n', title: 'NET VOLUME (l)', description: 'Net volume, litres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
39
|
+
{ ai: '316n', title: 'NET VOLUME (m³)', description: 'Net volume, cubic metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
40
|
+
{ ai: '320n', title: 'NET WEIGHT (lb)', description: 'Net weight, pounds', spec: 'N6', pre: true, kind: 'decimal' },
|
|
41
|
+
{ ai: '321n', title: 'LENGTH (in)', description: 'Length or first dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
42
|
+
{ ai: '322n', title: 'LENGTH (ft)', description: 'Length or first dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
43
|
+
{ ai: '323n', title: 'LENGTH (yd)', description: 'Length or first dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
44
|
+
{ ai: '324n', title: 'WIDTH (in)', description: 'Width, diameter or second dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
45
|
+
{ ai: '325n', title: 'WIDTH (ft)', description: 'Width, diameter or second dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
46
|
+
{ ai: '326n', title: 'WIDTH (yd)', description: 'Width, diameter or second dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
47
|
+
{ ai: '327n', title: 'HEIGHT (in)', description: 'Depth, thickness, height or third dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
48
|
+
{ ai: '328n', title: 'HEIGHT (ft)', description: 'Depth, thickness, height or third dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
49
|
+
{ ai: '329n', title: 'HEIGHT (yd)', description: 'Depth, thickness, height or third dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
50
|
+
// Logistic measures
|
|
51
|
+
{ ai: '330n', title: 'GROSS WEIGHT (kg)', description: 'Logistic weight, kilograms', spec: 'N6', pre: true, kind: 'decimal' },
|
|
52
|
+
{ ai: '331n', title: 'LENGTH (m), log', description: 'Logistic length or first dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
53
|
+
{ ai: '332n', title: 'WIDTH (m), log', description: 'Logistic width, diameter or second dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
54
|
+
{ ai: '333n', title: 'HEIGHT (m), log', description: 'Logistic depth, thickness, height or third dimension, metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
55
|
+
{ ai: '334n', title: 'AREA (m²), log', description: 'Logistic area, square metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
56
|
+
{ ai: '335n', title: 'VOLUME (l), log', description: 'Logistic volume, litres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
57
|
+
{ ai: '336n', title: 'VOLUME (m³), log', description: 'Logistic volume, cubic metres', spec: 'N6', pre: true, kind: 'decimal' },
|
|
58
|
+
{ ai: '337n', title: 'KG PER m²', description: 'Kilograms per square metre', spec: 'N6', pre: true, kind: 'decimal' },
|
|
59
|
+
{ ai: '340n', title: 'GROSS WEIGHT (lb)', description: 'Logistic weight, pounds', spec: 'N6', pre: true, kind: 'decimal' },
|
|
60
|
+
{ ai: '341n', title: 'LENGTH (in), log', description: 'Logistic length or first dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
61
|
+
{ ai: '342n', title: 'LENGTH (ft), log', description: 'Logistic length or first dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
62
|
+
{ ai: '343n', title: 'LENGTH (yd), log', description: 'Logistic length or first dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
63
|
+
{ ai: '344n', title: 'WIDTH (in), log', description: 'Logistic width, diameter or second dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
64
|
+
{ ai: '345n', title: 'WIDTH (ft), log', description: 'Logistic width, diameter or second dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
65
|
+
{ ai: '346n', title: 'WIDTH (yd), log', description: 'Logistic width, diameter or second dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
66
|
+
{ ai: '347n', title: 'HEIGHT (in), log', description: 'Logistic depth, thickness, height or third dimension, inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
67
|
+
{ ai: '348n', title: 'HEIGHT (ft), log', description: 'Logistic depth, thickness, height or third dimension, feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
68
|
+
{ ai: '349n', title: 'HEIGHT (yd), log', description: 'Logistic depth, thickness, height or third dimension, yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
69
|
+
{ ai: '350n', title: 'AREA (in²)', description: 'Area, square inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
70
|
+
{ ai: '351n', title: 'AREA (ft²)', description: 'Area, square feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
71
|
+
{ ai: '352n', title: 'AREA (yd²)', description: 'Area, square yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
72
|
+
{ ai: '353n', title: 'AREA (in²), log', description: 'Logistic area, square inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
73
|
+
{ ai: '354n', title: 'AREA (ft²), log', description: 'Logistic area, square feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
74
|
+
{ ai: '355n', title: 'AREA (yd²), log', description: 'Logistic area, square yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
75
|
+
{ ai: '356n', title: 'NET WEIGHT (t oz)', description: 'Net weight, troy ounces', spec: 'N6', pre: true, kind: 'decimal' },
|
|
76
|
+
{ ai: '357n', title: 'NET VOLUME (oz)', description: 'Net weight or volume, ounces', spec: 'N6', pre: true, kind: 'decimal' },
|
|
77
|
+
{ ai: '360n', title: 'NET VOLUME (qt)', description: 'Net volume, quarts', spec: 'N6', pre: true, kind: 'decimal' },
|
|
78
|
+
{ ai: '361n', title: 'NET VOLUME (gal)', description: 'Net volume, gallons US', spec: 'N6', pre: true, kind: 'decimal' },
|
|
79
|
+
{ ai: '362n', title: 'VOLUME (qt), log', description: 'Logistic volume, quarts', spec: 'N6', pre: true, kind: 'decimal' },
|
|
80
|
+
{ ai: '363n', title: 'VOLUME (gal), log', description: 'Logistic volume, gallons US', spec: 'N6', pre: true, kind: 'decimal' },
|
|
81
|
+
{ ai: '364n', title: 'VOLUME (in³)', description: 'Net volume, cubic inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
82
|
+
{ ai: '365n', title: 'VOLUME (ft³)', description: 'Net volume, cubic feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
83
|
+
{ ai: '366n', title: 'VOLUME (yd³)', description: 'Net volume, cubic yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
84
|
+
{ ai: '367n', title: 'VOLUME (in³), log', description: 'Logistic volume, cubic inches', spec: 'N6', pre: true, kind: 'decimal' },
|
|
85
|
+
{ ai: '368n', title: 'VOLUME (ft³), log', description: 'Logistic volume, cubic feet', spec: 'N6', pre: true, kind: 'decimal' },
|
|
86
|
+
{ ai: '369n', title: 'VOLUME (yd³), log', description: 'Logistic volume, cubic yards', spec: 'N6', pre: true, kind: 'decimal' },
|
|
87
|
+
{ ai: '390n', title: 'AMOUNT', description: 'Amount payable or coupon value, local currency', spec: 'N..15', kind: 'decimal' },
|
|
88
|
+
{ ai: '391n', title: 'AMOUNT', description: 'Amount payable and ISO currency code', spec: 'N3+N..15', kind: 'currencyDecimal' },
|
|
89
|
+
{ ai: '392n', title: 'PRICE', description: 'Amount payable for a variable measure trade item, single monetary area', spec: 'N..15', kind: 'decimal' },
|
|
90
|
+
{ ai: '393n', title: 'PRICE', description: 'Amount payable for a variable measure trade item and ISO currency code', spec: 'N3+N..15', kind: 'currencyDecimal' },
|
|
91
|
+
{ ai: '394n', title: 'PRCNT OFF', description: 'Percentage discount of a coupon', spec: 'N4', kind: 'decimal' },
|
|
92
|
+
{ ai: '395n', title: 'PRICE/UoM', description: 'Amount payable per unit of measure, single monetary area', spec: 'N6', kind: 'decimal' },
|
|
93
|
+
{ ai: '400', title: 'ORDER NUMBER', description: 'Customer purchase order number', spec: 'X..30' },
|
|
94
|
+
{ ai: '401', title: 'GINC', description: 'Global Identification Number for Consignment', spec: 'X..30' },
|
|
95
|
+
{ ai: '402', title: 'GSIN', description: 'Global Shipment Identification Number', spec: 'N17', cd: 17 },
|
|
96
|
+
{ ai: '403', title: 'ROUTE', description: 'Routing code', spec: 'X..30' },
|
|
97
|
+
{ ai: '410', title: 'SHIP TO LOC', description: 'Ship to / deliver to GLN', spec: 'N13', pre: true, cd: 13 },
|
|
98
|
+
{ ai: '411', title: 'BILL TO', description: 'Bill to / invoice to GLN', spec: 'N13', pre: true, cd: 13 },
|
|
99
|
+
{ ai: '412', title: 'PURCHASE FROM', description: 'Purchased from GLN', spec: 'N13', pre: true, cd: 13 },
|
|
100
|
+
{ ai: '413', title: 'SHIP FOR LOC', description: 'Ship for / deliver for / forward to GLN', spec: 'N13', pre: true, cd: 13 },
|
|
101
|
+
{ ai: '414', title: 'LOC No.', description: 'Identification of a physical location (GLN)', spec: 'N13', pre: true, cd: 13 },
|
|
102
|
+
{ ai: '415', title: 'PAY TO', description: 'GLN of the invoicing party', spec: 'N13', pre: true, cd: 13 },
|
|
103
|
+
{ ai: '416', title: 'PROD/SERV LOC', description: 'GLN of the production or service location', spec: 'N13', pre: true, cd: 13 },
|
|
104
|
+
{ ai: '417', title: 'PARTY', description: 'Party GLN', spec: 'N13', pre: true, cd: 13 },
|
|
105
|
+
{ ai: '420', title: 'SHIP TO POST', description: 'Ship to / deliver to postal code, single postal authority', spec: 'X..20' },
|
|
106
|
+
{ ai: '421', title: 'SHIP TO POST', description: 'Ship to / deliver to postal code with ISO country code', spec: 'N3+X..9' },
|
|
107
|
+
{ ai: '422', title: 'ORIGIN', description: 'Country of origin (ISO 3166 numeric)', spec: 'N3' },
|
|
108
|
+
{ ai: '423', title: 'COUNTRY - INITIAL PROCESS.', description: 'Country of initial processing', spec: 'N3+N..12' },
|
|
109
|
+
{ ai: '424', title: 'COUNTRY - PROCESS.', description: 'Country of processing', spec: 'N3' },
|
|
110
|
+
{ ai: '425', title: 'COUNTRY - DISASSEMBLY', description: 'Country of disassembly', spec: 'N3+N..12' },
|
|
111
|
+
{ ai: '426', title: 'COUNTRY - FULL PROCESS', description: 'Country covering full process chain', spec: 'N3' },
|
|
112
|
+
{ ai: '427', title: 'ORIGIN SUBDIVISION', description: 'Country subdivision of origin', spec: 'X..3' },
|
|
113
|
+
{ ai: '4300', title: 'SHIP TO COMP', description: 'Ship to / deliver to company name', spec: 'X..35' },
|
|
114
|
+
{ ai: '4301', title: 'SHIP TO NAME', description: 'Ship to / deliver to contact name', spec: 'X..35' },
|
|
115
|
+
{ ai: '4302', title: 'SHIP TO ADD1', description: 'Ship to / deliver to address line 1', spec: 'X..70' },
|
|
116
|
+
{ ai: '4303', title: 'SHIP TO ADD2', description: 'Ship to / deliver to address line 2', spec: 'X..70' },
|
|
117
|
+
{ ai: '4304', title: 'SHIP TO SUB', description: 'Ship to / deliver to suburb', spec: 'X..70' },
|
|
118
|
+
{ ai: '4305', title: 'SHIP TO LOC', description: 'Ship to / deliver to locality', spec: 'X..70' },
|
|
119
|
+
{ ai: '4306', title: 'SHIP TO REG', description: 'Ship to / deliver to region', spec: 'X..70' },
|
|
120
|
+
{ ai: '4307', title: 'SHIP TO COUNTRY', description: 'Ship to / deliver to country code (ISO 3166 alpha-2)', spec: 'X2' },
|
|
121
|
+
{ ai: '4308', title: 'SHIP TO PHONE', description: 'Ship to / deliver to telephone number', spec: 'X..30' },
|
|
122
|
+
{ ai: '4309', title: 'SHIP TO GEO', description: 'Ship to / deliver to GEO location', spec: 'N20' },
|
|
123
|
+
{ ai: '4310', title: 'RTN TO COMP', description: 'Return to company name', spec: 'X..35' },
|
|
124
|
+
{ ai: '4311', title: 'RTN TO NAME', description: 'Return to contact name', spec: 'X..35' },
|
|
125
|
+
{ ai: '4312', title: 'RTN TO ADD1', description: 'Return to address line 1', spec: 'X..70' },
|
|
126
|
+
{ ai: '4313', title: 'RTN TO ADD2', description: 'Return to address line 2', spec: 'X..70' },
|
|
127
|
+
{ ai: '4314', title: 'RTN TO SUB', description: 'Return to suburb', spec: 'X..70' },
|
|
128
|
+
{ ai: '4315', title: 'RTN TO LOC', description: 'Return to locality', spec: 'X..70' },
|
|
129
|
+
{ ai: '4316', title: 'RTN TO REG', description: 'Return to region', spec: 'X..70' },
|
|
130
|
+
{ ai: '4317', title: 'RTN TO COUNTRY', description: 'Return to country code (ISO 3166 alpha-2)', spec: 'X2' },
|
|
131
|
+
{ ai: '4318', title: 'RTN TO POST', description: 'Return to postal code', spec: 'X..20' },
|
|
132
|
+
{ ai: '4319', title: 'RTN TO PHONE', description: 'Return to telephone number', spec: 'X..30' },
|
|
133
|
+
{ ai: '4320', title: 'SRV DESCRIPTION', description: 'Service code description', spec: 'X..35' },
|
|
134
|
+
{ ai: '4321', title: 'DANGEROUS GOODS', description: 'Dangerous goods flag', spec: 'N1' },
|
|
135
|
+
{ ai: '4322', title: 'AUTH LEAVE', description: 'Authority to leave flag', spec: 'N1' },
|
|
136
|
+
{ ai: '4323', title: 'SIG REQUIRED', description: 'Signature required flag', spec: 'N1' },
|
|
137
|
+
{ ai: '4324', title: 'NOT BEF DEL DT', description: 'Not before delivery date/time (YYMMDDHHMM)', spec: 'N10', kind: 'datetime' },
|
|
138
|
+
{ ai: '4325', title: 'NOT AFT DEL DT', description: 'Not after delivery date/time (YYMMDDHHMM)', spec: 'N10', kind: 'datetime' },
|
|
139
|
+
{ ai: '4326', title: 'REL DATE', description: 'Release date (YYMMDD)', spec: 'N6', kind: 'date' },
|
|
140
|
+
{ ai: '4330', title: 'MAX TEMP F', description: 'Maximum temperature in Fahrenheit', spec: 'N6+M..1' },
|
|
141
|
+
{ ai: '4331', title: 'MAX TEMP C', description: 'Maximum temperature in Celsius', spec: 'N6+M..1' },
|
|
142
|
+
{ ai: '4332', title: 'MIN TEMP F', description: 'Minimum temperature in Fahrenheit', spec: 'N6+M..1' },
|
|
143
|
+
{ ai: '4333', title: 'MIN TEMP C', description: 'Minimum temperature in Celsius', spec: 'N6+M..1' },
|
|
144
|
+
{ ai: '7001', title: 'NSN', description: 'NATO Stock Number', spec: 'N13' },
|
|
145
|
+
{ ai: '7002', title: 'MEAT CUT', description: 'UNECE meat carcasses and cuts classification', spec: 'X..30' },
|
|
146
|
+
{ ai: '7003', title: 'EXPIRY TIME', description: 'Expiration date and time (YYMMDDHHMM)', spec: 'N10', kind: 'datetime' },
|
|
147
|
+
{ ai: '7004', title: 'ACTIVE POTENCY', description: 'Active potency', spec: 'N..4', kind: 'count' },
|
|
148
|
+
{ ai: '7005', title: 'CATCH AREA', description: 'Catch area', spec: 'X..12' },
|
|
149
|
+
{ ai: '7006', title: 'FIRST FREEZE DATE', description: 'First freeze date (YYMMDD)', spec: 'N6', kind: 'date' },
|
|
150
|
+
{ ai: '7007', title: 'HARVEST DATE', description: 'Harvest date or date range (YYMMDD[YYMMDD])', spec: 'N6+N..6', kind: 'dateRange' },
|
|
151
|
+
{ ai: '7008', title: 'AQUATIC SPECIES', description: 'Species for fishery purposes', spec: 'X..3' },
|
|
152
|
+
{ ai: '7009', title: 'FISHING GEAR TYPE', description: 'Fishing gear type', spec: 'X..10' },
|
|
153
|
+
{ ai: '7010', title: 'PROD METHOD', description: 'Production method', spec: 'X..2' },
|
|
154
|
+
{ ai: '7011', title: 'TEST BY DATE', description: 'Test by date (YYMMDD[HHMM])', spec: 'N6+N..4', kind: 'datetime' },
|
|
155
|
+
{ ai: '7020', title: 'REFURB LOT', description: 'Refurbishment lot ID', spec: 'X..20' },
|
|
156
|
+
{ ai: '7021', title: 'FUNC STAT', description: 'Functional status', spec: 'X..20' },
|
|
157
|
+
{ ai: '7022', title: 'REV STAT', description: 'Revision status', spec: 'X..20' },
|
|
158
|
+
{ ai: '7023', title: 'GIAI - ASSEMBLY', description: 'Global Individual Asset Identifier of an assembly', spec: 'X..30' },
|
|
159
|
+
{ ai: '7040', title: 'UIC+EXT', description: 'GS1 UIC with extension 1 and importer index', spec: 'N1+X3' },
|
|
160
|
+
{ ai: '710', title: 'NHRN PZN', description: 'National Healthcare Reimbursement Number - Germany PZN', spec: 'X..20' },
|
|
161
|
+
{ ai: '711', title: 'NHRN CIP', description: 'National Healthcare Reimbursement Number - France CIP', spec: 'X..20' },
|
|
162
|
+
{ ai: '712', title: 'NHRN CN', description: 'National Healthcare Reimbursement Number - Spain CN', spec: 'X..20' },
|
|
163
|
+
{ ai: '713', title: 'NHRN DRN', description: 'National Healthcare Reimbursement Number - Brazil DRN', spec: 'X..20' },
|
|
164
|
+
{ ai: '714', title: 'NHRN AIM', description: 'National Healthcare Reimbursement Number - Portugal AIM', spec: 'X..20' },
|
|
165
|
+
{ ai: '715', title: 'NHRN NDC', description: 'National Healthcare Reimbursement Number - United States NDC', spec: 'X..20' },
|
|
166
|
+
{ ai: '716', title: 'NHRN AIC', description: 'National Healthcare Reimbursement Number - Italy AIC', spec: 'X..20' },
|
|
167
|
+
{ ai: '7240', title: 'PROTOCOL', description: 'Protocol ID', spec: 'X..20' },
|
|
168
|
+
{ ai: '7241', title: 'AIDC MEDIA TYPE', description: 'AIDC media type', spec: 'N2' },
|
|
169
|
+
{ ai: '7242', title: 'VCN', description: 'Version control number', spec: 'X..25' },
|
|
170
|
+
{ ai: '8001', title: 'DIMENSIONS', description: 'Roll products: width, length, core diameter, direction, splices', spec: 'N14' },
|
|
171
|
+
{ ai: '8002', title: 'CMT No.', description: 'Cellular mobile telephone identifier', spec: 'X..20' },
|
|
172
|
+
{ ai: '8003', title: 'GRAI', description: 'Global Returnable Asset Identifier', spec: 'N14+X..16', cd: 14 },
|
|
173
|
+
{ ai: '8004', title: 'GIAI', description: 'Global Individual Asset Identifier', spec: 'X..30' },
|
|
174
|
+
{ ai: '8005', title: 'PRICE PER UNIT', description: 'Price per unit of measure', spec: 'N6' },
|
|
175
|
+
{ ai: '8006', title: 'ITIP', description: 'Identification of an individual trade item piece', spec: 'N14+N2+N2', cd: 14 },
|
|
176
|
+
{ ai: '8007', title: 'IBAN', description: 'International Bank Account Number', spec: 'X..34' },
|
|
177
|
+
{ ai: '8008', title: 'PROD TIME', description: 'Date and time of production (YYMMDDHH[MM[SS]])', spec: 'N8+N..4', kind: 'datetime' },
|
|
178
|
+
{ ai: '8009', title: 'OPTSEN', description: 'Optically readable sensor indicator', spec: 'X..50' },
|
|
179
|
+
{ ai: '8010', title: 'CPID', description: 'Component / Part Identifier', spec: 'Y..30' },
|
|
180
|
+
{ ai: '8011', title: 'CPID SERIAL', description: 'Component / Part Identifier serial number', spec: 'N..12', kind: 'count' },
|
|
181
|
+
{ ai: '8012', title: 'VERSION', description: 'Software version', spec: 'X..20' },
|
|
182
|
+
{ ai: '8013', title: 'GMN', description: 'Global Model Number', spec: 'X..25' },
|
|
183
|
+
{ ai: '8017', title: 'GSRN - PROVIDER', description: 'Global Service Relation Number - service provider', spec: 'N18', cd: 18 },
|
|
184
|
+
{ ai: '8018', title: 'GSRN - RECIPIENT', description: 'Global Service Relation Number - service recipient', spec: 'N18', cd: 18 },
|
|
185
|
+
{ ai: '8019', title: 'SRIN', description: 'Service Relation Instance Number', spec: 'N..10', kind: 'count' },
|
|
186
|
+
{ ai: '8020', title: 'REF No.', description: 'Payment slip reference number', spec: 'X..25' },
|
|
187
|
+
{ ai: '8026', title: 'ITIP CONTENT', description: 'ITIP of contained trade item pieces', spec: 'N14+N2+N2', cd: 14 },
|
|
188
|
+
{ ai: '8110', title: 'COUPON CODE', description: 'Coupon code identification for use in North America', spec: 'X..70' },
|
|
189
|
+
{ ai: '8111', title: 'POINTS', description: 'Loyalty points of a coupon', spec: 'N4', kind: 'count' },
|
|
190
|
+
{ ai: '8112', title: 'PAPERLESS COUPON', description: 'Positive offer file coupon code identification (North America)', spec: 'X..70' },
|
|
191
|
+
{ ai: '8200', title: 'PRODUCT URL', description: 'Extended packaging URL', spec: 'X..70' },
|
|
192
|
+
{ ai: '90', title: 'INTERNAL', description: 'Information mutually agreed between trading partners', spec: 'X..30' },
|
|
193
|
+
];
|
|
194
|
+
// AI families defined by ranges are generated here.
|
|
195
|
+
for (let d = 0; d <= 9; d++) {
|
|
196
|
+
TABLE.push({
|
|
197
|
+
ai: `703${d}`,
|
|
198
|
+
title: `PROCESSOR # ${d}`,
|
|
199
|
+
description: `Number of processor with ISO country code (sequence ${d})`,
|
|
200
|
+
spec: 'N3+X..27',
|
|
201
|
+
});
|
|
202
|
+
TABLE.push({
|
|
203
|
+
ai: `723${d}`,
|
|
204
|
+
title: `CERT # ${d}`,
|
|
205
|
+
description: `Certification reference (sequence ${d})`,
|
|
206
|
+
spec: 'X2+X..28',
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
for (let d = 1; d <= 9; d++) {
|
|
210
|
+
TABLE.push({
|
|
211
|
+
ai: `9${d}`,
|
|
212
|
+
title: `INTERNAL`,
|
|
213
|
+
description: 'Company internal information',
|
|
214
|
+
spec: 'X..90',
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
function compile(entry) {
|
|
218
|
+
const components = compileSpec(entry.spec);
|
|
219
|
+
const allFixed = components.every((c) => c.fixed);
|
|
220
|
+
return {
|
|
221
|
+
ai: entry.ai,
|
|
222
|
+
title: entry.title,
|
|
223
|
+
description: entry.description,
|
|
224
|
+
spec: entry.spec,
|
|
225
|
+
components,
|
|
226
|
+
predefinedLength: entry.pre ?? false,
|
|
227
|
+
fixedLength: allFixed
|
|
228
|
+
? components.reduce((sum, c) => sum + c.min, 0)
|
|
229
|
+
: undefined,
|
|
230
|
+
checkDigitPosition: entry.cd,
|
|
231
|
+
kind: entry.kind,
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
export const AI_DEFINITIONS = new Map(TABLE.map((entry) => [entry.ai, compile(entry)]));
|
|
235
|
+
export function getAIDefinition(ai) {
|
|
236
|
+
const exact = AI_DEFINITIONS.get(ai);
|
|
237
|
+
if (exact)
|
|
238
|
+
return exact;
|
|
239
|
+
if (ai.length === 4 && /^\d{4}$/.test(ai)) {
|
|
240
|
+
return AI_DEFINITIONS.get(ai.slice(0, 3) + 'n');
|
|
241
|
+
}
|
|
242
|
+
return undefined;
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=ai.js.map
|
package/dist/ai.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.js","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAYxC,0EAA0E;AAC1E,4EAA4E;AAC5E,kDAAkD;AAClD,MAAM,KAAK,GAAe;IACxB,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE;IAC1G,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,0BAA0B,EAAE,IAAI,EA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AE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YAC/C,CAAC,CAAC,SAAS;QACb,kBAAkB,EAAE,KAAK,CAAC,EAAE;QAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAsC,IAAI,GAAG,CACtE,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CACjD,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,EAAU;IACxC,MAAM,KAAK,GAAG,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC1C,OAAO,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { GS1Error } from './types.js';
|
|
2
|
+
export function computeCheckDigit(digits) {
|
|
3
|
+
if (!/^\d+$/.test(digits)) {
|
|
4
|
+
throw new GS1Error(`check digit input "${digits}" must be numeric`);
|
|
5
|
+
}
|
|
6
|
+
let sum = 0;
|
|
7
|
+
let weight = 3;
|
|
8
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
9
|
+
sum += (digits.charCodeAt(i) - 48) * weight;
|
|
10
|
+
weight = 4 - weight;
|
|
11
|
+
}
|
|
12
|
+
return (10 - (sum % 10)) % 10;
|
|
13
|
+
}
|
|
14
|
+
export function verifyCheckDigit(digits) {
|
|
15
|
+
if (!/^\d{2,}$/.test(digits))
|
|
16
|
+
return false;
|
|
17
|
+
return computeCheckDigit(digits.slice(0, -1)) === Number(digits.slice(-1));
|
|
18
|
+
}
|
|
19
|
+
export function withCheckDigit(digits) {
|
|
20
|
+
return digits + computeCheckDigit(digits);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=check-digit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-digit.js","sourceRoot":"","sources":["../src/check-digit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,QAAQ,CAAC,sBAAsB,MAAM,mBAAmB,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5C,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,MAAM,CAAC;QAC5C,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC;IACtB,CAAC;IACD,OAAO,CAAC,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,iBAAiB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,OAAO,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ElementInput, GS1Element } from './types.js';
|
|
2
|
+
import { ValidationOptions } from './element.js';
|
|
3
|
+
export interface DigitalLinkOptions extends ValidationOptions {
|
|
4
|
+
domain?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function generateDigitalLink(input: ElementInput, options?: DigitalLinkOptions): string;
|
|
7
|
+
export declare function parseDigitalLink(uri: string, options?: ValidationOptions): GS1Element[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { GS1Error } from './types.js';
|
|
2
|
+
import { getAIDefinition } from './ai.js';
|
|
3
|
+
import { createElement, normalizeInput } from './element.js';
|
|
4
|
+
// primary keys and their path qualifiers, in path order
|
|
5
|
+
const PRIMARY_KEYS = new Map([
|
|
6
|
+
['01', ['22', '10', '21']],
|
|
7
|
+
['8006', ['22', '10', '21']],
|
|
8
|
+
['8013', []],
|
|
9
|
+
['8010', ['8011']],
|
|
10
|
+
['414', ['254', '7040']],
|
|
11
|
+
['417', ['7040']],
|
|
12
|
+
['8017', ['8019']],
|
|
13
|
+
['8018', ['8019']],
|
|
14
|
+
['255', []],
|
|
15
|
+
['00', []],
|
|
16
|
+
['253', []],
|
|
17
|
+
['401', []],
|
|
18
|
+
['402', []],
|
|
19
|
+
['8003', []],
|
|
20
|
+
['8004', ['7040']],
|
|
21
|
+
]);
|
|
22
|
+
export function generateDigitalLink(input, options = {}) {
|
|
23
|
+
const domain = (options.domain ?? 'https://id.gs1.org').replace(/\/+$/, '');
|
|
24
|
+
const elements = normalizeInput(input).map(({ ai, value }) => createElement(ai, value, options));
|
|
25
|
+
const primaries = elements.filter((e) => PRIMARY_KEYS.has(e.ai));
|
|
26
|
+
if (primaries.length === 0) {
|
|
27
|
+
throw new GS1Error(`a Digital Link needs a primary key AI (one of ${[...PRIMARY_KEYS.keys()].join(', ')})`);
|
|
28
|
+
}
|
|
29
|
+
if (primaries.length > 1) {
|
|
30
|
+
throw new GS1Error(`only one primary key AI is allowed, got ${primaries.map((e) => e.ai).join(', ')}`);
|
|
31
|
+
}
|
|
32
|
+
const primary = primaries[0];
|
|
33
|
+
const qualifierOrder = PRIMARY_KEYS.get(primary.ai);
|
|
34
|
+
const used = new Set([primary]);
|
|
35
|
+
let path = `/${primary.ai}/${encodeURIComponent(primary.value)}`;
|
|
36
|
+
for (const qualifierAI of qualifierOrder) {
|
|
37
|
+
const el = elements.find((e) => e.ai === qualifierAI);
|
|
38
|
+
if (el) {
|
|
39
|
+
path += `/${el.ai}/${encodeURIComponent(el.value)}`;
|
|
40
|
+
used.add(el);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const query = elements
|
|
44
|
+
.filter((e) => !used.has(e))
|
|
45
|
+
.map((e) => `${e.ai}=${encodeURIComponent(e.value)}`)
|
|
46
|
+
.join('&');
|
|
47
|
+
return domain + path + (query ? `?${query}` : '');
|
|
48
|
+
}
|
|
49
|
+
export function parseDigitalLink(uri, options = {}) {
|
|
50
|
+
let url;
|
|
51
|
+
try {
|
|
52
|
+
url = new URL(uri);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
throw new GS1Error(`invalid URL "${uri}"`);
|
|
56
|
+
}
|
|
57
|
+
const segments = url.pathname.split('/').filter((s) => s.length > 0);
|
|
58
|
+
// anything before the leftmost primary key is resolver prefix
|
|
59
|
+
let start = -1;
|
|
60
|
+
for (let i = 0; i < segments.length - 1; i++) {
|
|
61
|
+
if (PRIMARY_KEYS.has(segments[i])) {
|
|
62
|
+
start = i;
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (start === -1 || (segments.length - start) % 2 !== 0) {
|
|
67
|
+
throw new GS1Error(`no GS1 Digital Link primary key found in path "${url.pathname}"`);
|
|
68
|
+
}
|
|
69
|
+
const pairs = [];
|
|
70
|
+
for (let i = start; i < segments.length; i += 2) {
|
|
71
|
+
pairs.push({ ai: segments[i], value: decodeURIComponent(segments[i + 1]) });
|
|
72
|
+
}
|
|
73
|
+
for (const [key, value] of url.searchParams) {
|
|
74
|
+
// non-AI query parameters (linkType, ...) are ignored
|
|
75
|
+
if (/^\d{2,4}$/.test(key) && getAIDefinition(key)) {
|
|
76
|
+
pairs.push({ ai: key, value });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return pairs.map(({ ai, value }) => {
|
|
80
|
+
// Digital Link allows shortened GTINs; element strings require N14
|
|
81
|
+
if ((ai === '01' || ai === '02' || ai === '03') && /^\d{8}$|^\d{12,13}$/.test(value)) {
|
|
82
|
+
value = value.padStart(14, '0');
|
|
83
|
+
}
|
|
84
|
+
return createElement(ai, value, options);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=digital-link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"digital-link.js","sourceRoot":"","sources":["../src/digital-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AAEhF,wDAAwD;AACxD,MAAM,YAAY,GAA2C,IAAI,GAAG,CAAC;IACnE,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1B,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,MAAM,EAAE,EAAE,CAAC;IACZ,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,CAAC;IAClB,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;I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E,CAAC,CAAC;IAC9E,CAAC;IACD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,CAAC;QAC5C,sDAAsD;QACtD,IAAI,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACjC,mEAAmE;QACnE,IAAI,CAAC,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,KAAK,IAAI,CAAC,IAAI,qBAAqB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACrF,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;QAClC,CAAC;QACD,OAAO,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IAC3C,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { GS1Element } from './types.js';
|
|
2
|
+
export interface ValidationOptions {
|
|
3
|
+
validate?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function createElement(ai: string, value: string, options?: ValidationOptions): GS1Element;
|
|
6
|
+
export declare function normalizeInput(input: Array<{
|
|
7
|
+
ai: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}> | Record<string, string>): Array<{
|
|
10
|
+
ai: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}>;
|
package/dist/element.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { GS1Error } from './types.js';
|
|
2
|
+
import { getAIDefinition } from './ai.js';
|
|
3
|
+
import { validateValue } from './spec.js';
|
|
4
|
+
import { verifyCheckDigit } from './check-digit.js';
|
|
5
|
+
import { interpretValue } from './interpret.js';
|
|
6
|
+
export function createElement(ai, value, options = {}) {
|
|
7
|
+
const definition = getAIDefinition(ai);
|
|
8
|
+
if (!definition)
|
|
9
|
+
throw new GS1Error(`unknown application identifier`, ai);
|
|
10
|
+
const validate = options.validate ?? true;
|
|
11
|
+
if (validate) {
|
|
12
|
+
validateValue(ai, definition.components, value);
|
|
13
|
+
checkDigitOf(ai, definition, value);
|
|
14
|
+
}
|
|
15
|
+
let interpreted;
|
|
16
|
+
try {
|
|
17
|
+
interpreted = interpretValue(ai, definition, value);
|
|
18
|
+
}
|
|
19
|
+
catch (err) {
|
|
20
|
+
if (validate)
|
|
21
|
+
throw err;
|
|
22
|
+
}
|
|
23
|
+
const element = { ai, value, definition };
|
|
24
|
+
if (interpreted !== undefined)
|
|
25
|
+
element.interpreted = interpreted;
|
|
26
|
+
return element;
|
|
27
|
+
}
|
|
28
|
+
function checkDigitOf(ai, definition, value) {
|
|
29
|
+
const pos = definition.checkDigitPosition;
|
|
30
|
+
if (pos === undefined)
|
|
31
|
+
return;
|
|
32
|
+
if (!verifyCheckDigit(value.slice(0, pos))) {
|
|
33
|
+
throw new GS1Error(`invalid check digit in "${value}" (position ${pos})`, ai);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function normalizeInput(input) {
|
|
37
|
+
if (Array.isArray(input))
|
|
38
|
+
return input;
|
|
39
|
+
return Object.entries(input).map(([ai, value]) => ({ ai, value }));
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../src/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC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K,eAAe,GAAG,GAAG,EACrD,EAAE,CACH,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,KAAoE;IAEpE,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ElementInput } from './types.js';
|
|
2
|
+
import { ValidationOptions } from './element.js';
|
|
3
|
+
export interface GenerateRawOptions extends ValidationOptions {
|
|
4
|
+
fnc1?: string;
|
|
5
|
+
optimize?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function generateElementString(input: ElementInput, options?: ValidationOptions): string;
|
|
8
|
+
export declare function generateRawString(input: ElementInput, options?: GenerateRawOptions): string;
|
package/dist/generate.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createElement, normalizeInput } from './element.js';
|
|
2
|
+
import { GS } from './parse.js';
|
|
3
|
+
export function generateElementString(input, options = {}) {
|
|
4
|
+
return buildElements(input, options)
|
|
5
|
+
.map((element) => `(${element.ai})${element.value}`)
|
|
6
|
+
.join('');
|
|
7
|
+
}
|
|
8
|
+
export function generateRawString(input, options = {}) {
|
|
9
|
+
const fnc1 = options.fnc1 ?? GS;
|
|
10
|
+
let elements = buildElements(input, options);
|
|
11
|
+
if (options.optimize ?? true) {
|
|
12
|
+
// predefined-length AIs first: they never need an FNC1 separator
|
|
13
|
+
elements = [
|
|
14
|
+
...elements.filter((e) => e.definition.predefinedLength),
|
|
15
|
+
...elements.filter((e) => !e.definition.predefinedLength),
|
|
16
|
+
];
|
|
17
|
+
}
|
|
18
|
+
let out = '';
|
|
19
|
+
elements.forEach((element, index) => {
|
|
20
|
+
out += element.ai + element.value;
|
|
21
|
+
const needsSeparator = !element.definition.predefinedLength && index < elements.length - 1;
|
|
22
|
+
if (needsSeparator)
|
|
23
|
+
out += fnc1;
|
|
24
|
+
});
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
function buildElements(input, options) {
|
|
28
|
+
return normalizeInput(input).map(({ ai, value }) => createElement(ai, value, options));
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAOhC,MAAM,UAAU,qBAAqB,CACnC,KAAmB,EACnB,UAA6B,EAAE;IAE/B,OAAO,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC;SACjC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,EAAE,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;SACnD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC;AAED,MAAM,UAAU,iBAAiB,CAC/B,KAAmB,EACnB,UAA8B,EAAE;IAEhC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;IAChC,IAAI,QAAQ,GAAG,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAE7C,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QAC7B,iEAAiE;QACjE,QAAQ,GAAG;YACT,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC;YACxD,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,gBAAgB,CAAC;SAC1D,CAAC;IACJ,CAAC;IAED,IAAI,GAAG,GAAG,EAAE,CAAC;IACb,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE;QAClC,GAAG,IAAI,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC;QAClC,MAAM,cAAc,GAClB,CAAC,OAAO,CAAC,UAAU,CAAC,gBAAgB,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACtE,IAAI,cAAc;YAAE,GAAG,IAAI,IAAI,CAAC;IAClC,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,aAAa,CACpB,KAAmB,EACnB,OAA0B;IAE1B,OAAO,cAAc,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CACjD,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAClC,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { GS1Error, type AIDefinition, type CharacterSet, type ElementInput, type GS1Date, type GS1DateTime, type GS1Element, type InterpretationKind, type InterpretedValue, type SpecComponent, } from './types.js';
|
|
2
|
+
export { AI_DEFINITIONS, getAIDefinition } from './ai.js';
|
|
3
|
+
export { computeCheckDigit, verifyCheckDigit, withCheckDigit, } from './check-digit.js';
|
|
4
|
+
export { parse, parseElementString, parseRawString, toRecord, GS, type ParseRawOptions, } from './parse.js';
|
|
5
|
+
export { generateElementString, generateRawString, type GenerateRawOptions, } from './generate.js';
|
|
6
|
+
export { generateDigitalLink, parseDigitalLink, type DigitalLinkOptions, } from './digital-link.js';
|
|
7
|
+
export { parseDate6, parseDateTime, resolveYear, interpretValue, } from './interpret.js';
|
|
8
|
+
export { type ValidationOptions } from './element.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { GS1Error, } from './types.js';
|
|
2
|
+
export { AI_DEFINITIONS, getAIDefinition } from './ai.js';
|
|
3
|
+
export { computeCheckDigit, verifyCheckDigit, withCheckDigit, } from './check-digit.js';
|
|
4
|
+
export { parse, parseElementString, parseRawString, toRecord, GS, } from './parse.js';
|
|
5
|
+
export { generateElementString, generateRawString, } from './generate.js';
|
|
6
|
+
export { generateDigitalLink, parseDigitalLink, } from './digital-link.js';
|
|
7
|
+
export { parseDate6, parseDateTime, resolveYear, interpretValue, } from './interpret.js';
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,GAUT,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1D,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,EAAE,GAEH,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,qBAAqB,EACrB,iBAAiB,GAElB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,GAEjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,UAAU,EACV,aAAa,EACb,WAAW,EACX,cAAc,GACf,MAAM,gBAAgB,CAAC"}
|