@aidc-toolkit/gs1 1.0.46 → 1.0.47
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/dist/index.cjs +2 -2
- package/dist/index.d.cts +106 -48
- package/dist/index.d.ts +106 -48
- package/dist/index.js +2 -2
- package/package.json +4 -4
- package/src/abstract-numeric-identifier-creator.ts +11 -9
- package/src/gtin-creator.ts +29 -17
- package/src/non-numeric-identifier-creator.ts +21 -23
- package/src/numeric-identifier-creator.ts +32 -18
- package/src/serializable-numeric-identifier-creator.ts +70 -32
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I18nLanguageDetector, Hyperlink, AbstractConstructor, AppData, Cache, AppDataStorage, HTTPFetch } from '@aidc-toolkit/core';
|
|
2
2
|
import { Resource, i18n, ParseKeys } from 'i18next';
|
|
3
|
-
import { CharacterSetCreator, CharacterSetValidator, CharacterSetValidation, StringValidation, StringValidator, Exclusions
|
|
3
|
+
import { CharacterSetCreator, CharacterSetValidator, CharacterSetValidation, StringValidation, StringValidator, Exclusions } from '@aidc-toolkit/utility';
|
|
4
4
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
AI64CharacterSetValidator: {
|
|
@@ -1400,23 +1400,36 @@ interface NumericIdentifierCreator<TNumericIdentifierType extends NumericIdentif
|
|
|
1400
1400
|
* Set the tweak for sparse creation.
|
|
1401
1401
|
*/
|
|
1402
1402
|
set tweak(value: bigint);
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1403
|
+
create: {
|
|
1404
|
+
/**
|
|
1405
|
+
* Create an identifier with a reference based on a numeric value. The value is converted to a reference of the
|
|
1406
|
+
* appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1407
|
+
*
|
|
1408
|
+
* @param value
|
|
1409
|
+
* Numeric value.
|
|
1410
|
+
*
|
|
1411
|
+
* @param sparse
|
|
1412
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1413
|
+
*
|
|
1414
|
+
* @returns
|
|
1415
|
+
* Identifier.
|
|
1416
|
+
*/
|
|
1417
|
+
(value: number | bigint, sparse?: boolean): string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Create identifiers with references based on numeric values. The values are converted to references of the
|
|
1420
|
+
* appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1421
|
+
*
|
|
1422
|
+
* @param values
|
|
1423
|
+
* Numeric values.
|
|
1424
|
+
*
|
|
1425
|
+
* @param sparse
|
|
1426
|
+
* If true, the values are mapped to a sparse sequence resistant to discovery.
|
|
1427
|
+
*
|
|
1428
|
+
* @returns
|
|
1429
|
+
* Identifiers.
|
|
1430
|
+
*/
|
|
1431
|
+
(values: Iterable<number | bigint>, sparse?: boolean): Iterable<string>;
|
|
1432
|
+
};
|
|
1420
1433
|
/**
|
|
1421
1434
|
* Create all identifiers for the prefix from `0` to `capacity - 1`.
|
|
1422
1435
|
*
|
|
@@ -1466,25 +1479,39 @@ declare class GTINCreator extends GTINCreator_base {
|
|
|
1466
1479
|
*/
|
|
1467
1480
|
get prefix(): string;
|
|
1468
1481
|
/**
|
|
1469
|
-
* Create GTIN-14
|
|
1470
|
-
*
|
|
1482
|
+
* Create GTIN-14 with an indicator digit and reference based on a numeric value. The value is converted to a
|
|
1483
|
+
* reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1484
|
+
*
|
|
1485
|
+
* @param indicatorDigit
|
|
1486
|
+
* Indicator digit.
|
|
1487
|
+
*
|
|
1488
|
+
* @param value
|
|
1489
|
+
* Numeric value.
|
|
1471
1490
|
*
|
|
1472
|
-
* @
|
|
1473
|
-
*
|
|
1491
|
+
* @param sparse
|
|
1492
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1493
|
+
*
|
|
1494
|
+
* @returns
|
|
1495
|
+
* GTIN-14.
|
|
1496
|
+
*/
|
|
1497
|
+
createGTIN14(indicatorDigit: string, value: number | bigint, sparse?: boolean): string;
|
|
1498
|
+
/**
|
|
1499
|
+
* Create GTIN-14s with an indicator digit and references based on numeric values. The values are converted to
|
|
1500
|
+
* references of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1474
1501
|
*
|
|
1475
1502
|
* @param indicatorDigit
|
|
1476
1503
|
* Indicator digit.
|
|
1477
1504
|
*
|
|
1478
|
-
* @param
|
|
1479
|
-
* Numeric
|
|
1505
|
+
* @param values
|
|
1506
|
+
* Numeric values.
|
|
1480
1507
|
*
|
|
1481
1508
|
* @param sparse
|
|
1482
|
-
* If true, the
|
|
1509
|
+
* If true, the values are mapped to a sparse sequence resistant to discovery.
|
|
1483
1510
|
*
|
|
1484
1511
|
* @returns
|
|
1485
|
-
* GTIN-
|
|
1512
|
+
* GTIN-14s.
|
|
1486
1513
|
*/
|
|
1487
|
-
createGTIN14
|
|
1514
|
+
createGTIN14(indicatorDigit: string, values: Iterable<number | bigint>, sparse?: boolean): Iterable<string>;
|
|
1488
1515
|
}
|
|
1489
1516
|
|
|
1490
1517
|
/**
|
|
@@ -1510,41 +1537,65 @@ declare const SerializableNumericIdentifierCreator_base: abstract new (...args:
|
|
|
1510
1537
|
declare class SerializableNumericIdentifierCreator extends SerializableNumericIdentifierCreator_base {
|
|
1511
1538
|
#private;
|
|
1512
1539
|
/**
|
|
1513
|
-
* Create serialized identifier
|
|
1540
|
+
* Create a serialized identifier with a reference based on a numeric value concatenated with a serial component.
|
|
1514
1541
|
* The value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1515
1542
|
*
|
|
1516
|
-
* @
|
|
1517
|
-
*
|
|
1543
|
+
* @param value
|
|
1544
|
+
* Numeric value of the reference.
|
|
1545
|
+
*
|
|
1546
|
+
* @param serialComponent
|
|
1547
|
+
* Serial component.
|
|
1548
|
+
*
|
|
1549
|
+
* @param sparse
|
|
1550
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1551
|
+
*
|
|
1552
|
+
* @returns
|
|
1553
|
+
* Serialized identifier.
|
|
1554
|
+
*/
|
|
1555
|
+
createSerialized(value: number | bigint, serialComponent: string, sparse?: boolean): string;
|
|
1556
|
+
/**
|
|
1557
|
+
* Create serialized identifiers with a reference based on a numeric value concatenated with serial components. The
|
|
1558
|
+
* value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1518
1559
|
*
|
|
1519
1560
|
* @param value
|
|
1520
1561
|
* Numeric value of the reference.
|
|
1521
1562
|
*
|
|
1522
|
-
* @param
|
|
1523
|
-
* Serial
|
|
1563
|
+
* @param serialComponents
|
|
1564
|
+
* Serial components.
|
|
1524
1565
|
*
|
|
1525
1566
|
* @param sparse
|
|
1526
|
-
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1567
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1527
1568
|
*
|
|
1528
1569
|
* @returns
|
|
1529
1570
|
* Serialized identifiers.
|
|
1530
1571
|
*/
|
|
1531
|
-
createSerialized
|
|
1572
|
+
createSerialized(value: number | bigint, serialComponents: Iterable<string>, sparse?: boolean): Iterable<string>;
|
|
1532
1573
|
/**
|
|
1533
|
-
* Concatenate a base identifier with serial component
|
|
1574
|
+
* Concatenate a base identifier with a serial component.
|
|
1575
|
+
*
|
|
1576
|
+
* @param baseIdentifier
|
|
1577
|
+
* Base identifier.
|
|
1578
|
+
*
|
|
1579
|
+
* @param serialComponent
|
|
1580
|
+
* Serial component.
|
|
1534
1581
|
*
|
|
1535
|
-
* @
|
|
1536
|
-
*
|
|
1582
|
+
* @returns
|
|
1583
|
+
* Serialized identifier.
|
|
1584
|
+
*/
|
|
1585
|
+
concatenate(baseIdentifier: string, serialComponent: string): string;
|
|
1586
|
+
/**
|
|
1587
|
+
* Concatenate a base identifier with serial components.
|
|
1537
1588
|
*
|
|
1538
1589
|
* @param baseIdentifier
|
|
1539
1590
|
* Base identifier.
|
|
1540
1591
|
*
|
|
1541
|
-
* @param
|
|
1542
|
-
* Serial
|
|
1592
|
+
* @param serialComponents
|
|
1593
|
+
* Serial components.
|
|
1543
1594
|
*
|
|
1544
1595
|
* @returns
|
|
1545
|
-
* Serialized
|
|
1596
|
+
* Serialized identifiers.
|
|
1546
1597
|
*/
|
|
1547
|
-
concatenate
|
|
1598
|
+
concatenate(baseIdentifier: string, serialComponents: Iterable<string>): Iterable<string>;
|
|
1548
1599
|
}
|
|
1549
1600
|
|
|
1550
1601
|
/**
|
|
@@ -1587,18 +1638,25 @@ declare class NonNumericIdentifierCreator extends NonNumericIdentifierCreator_ba
|
|
|
1587
1638
|
*/
|
|
1588
1639
|
protected get referenceValidation(): CharacterSetValidation;
|
|
1589
1640
|
/**
|
|
1590
|
-
* Create identifier
|
|
1641
|
+
* Create an identifier with a reference.
|
|
1642
|
+
*
|
|
1643
|
+
* @param reference
|
|
1644
|
+
* Reference.
|
|
1591
1645
|
*
|
|
1592
|
-
* @
|
|
1593
|
-
*
|
|
1646
|
+
* @returns
|
|
1647
|
+
* Identifier.
|
|
1648
|
+
*/
|
|
1649
|
+
create(reference: string): string;
|
|
1650
|
+
/**
|
|
1651
|
+
* Create identifiers with references.
|
|
1594
1652
|
*
|
|
1595
|
-
* @param
|
|
1596
|
-
*
|
|
1653
|
+
* @param references
|
|
1654
|
+
* References.
|
|
1597
1655
|
*
|
|
1598
1656
|
* @returns
|
|
1599
|
-
*
|
|
1657
|
+
* Identifiers.
|
|
1600
1658
|
*/
|
|
1601
|
-
create
|
|
1659
|
+
create(references: Iterable<string>): Iterable<string>;
|
|
1602
1660
|
}
|
|
1603
1661
|
|
|
1604
1662
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I18nLanguageDetector, Hyperlink, AbstractConstructor, AppData, Cache, AppDataStorage, HTTPFetch } from '@aidc-toolkit/core';
|
|
2
2
|
import { Resource, i18n, ParseKeys } from 'i18next';
|
|
3
|
-
import { CharacterSetCreator, CharacterSetValidator, CharacterSetValidation, StringValidation, StringValidator, Exclusions
|
|
3
|
+
import { CharacterSetCreator, CharacterSetValidator, CharacterSetValidation, StringValidation, StringValidator, Exclusions } from '@aidc-toolkit/utility';
|
|
4
4
|
|
|
5
5
|
declare const _default: {
|
|
6
6
|
AI64CharacterSetValidator: {
|
|
@@ -1400,23 +1400,36 @@ interface NumericIdentifierCreator<TNumericIdentifierType extends NumericIdentif
|
|
|
1400
1400
|
* Set the tweak for sparse creation.
|
|
1401
1401
|
*/
|
|
1402
1402
|
set tweak(value: bigint);
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1403
|
+
create: {
|
|
1404
|
+
/**
|
|
1405
|
+
* Create an identifier with a reference based on a numeric value. The value is converted to a reference of the
|
|
1406
|
+
* appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1407
|
+
*
|
|
1408
|
+
* @param value
|
|
1409
|
+
* Numeric value.
|
|
1410
|
+
*
|
|
1411
|
+
* @param sparse
|
|
1412
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1413
|
+
*
|
|
1414
|
+
* @returns
|
|
1415
|
+
* Identifier.
|
|
1416
|
+
*/
|
|
1417
|
+
(value: number | bigint, sparse?: boolean): string;
|
|
1418
|
+
/**
|
|
1419
|
+
* Create identifiers with references based on numeric values. The values are converted to references of the
|
|
1420
|
+
* appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1421
|
+
*
|
|
1422
|
+
* @param values
|
|
1423
|
+
* Numeric values.
|
|
1424
|
+
*
|
|
1425
|
+
* @param sparse
|
|
1426
|
+
* If true, the values are mapped to a sparse sequence resistant to discovery.
|
|
1427
|
+
*
|
|
1428
|
+
* @returns
|
|
1429
|
+
* Identifiers.
|
|
1430
|
+
*/
|
|
1431
|
+
(values: Iterable<number | bigint>, sparse?: boolean): Iterable<string>;
|
|
1432
|
+
};
|
|
1420
1433
|
/**
|
|
1421
1434
|
* Create all identifiers for the prefix from `0` to `capacity - 1`.
|
|
1422
1435
|
*
|
|
@@ -1466,25 +1479,39 @@ declare class GTINCreator extends GTINCreator_base {
|
|
|
1466
1479
|
*/
|
|
1467
1480
|
get prefix(): string;
|
|
1468
1481
|
/**
|
|
1469
|
-
* Create GTIN-14
|
|
1470
|
-
*
|
|
1482
|
+
* Create GTIN-14 with an indicator digit and reference based on a numeric value. The value is converted to a
|
|
1483
|
+
* reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1484
|
+
*
|
|
1485
|
+
* @param indicatorDigit
|
|
1486
|
+
* Indicator digit.
|
|
1487
|
+
*
|
|
1488
|
+
* @param value
|
|
1489
|
+
* Numeric value.
|
|
1471
1490
|
*
|
|
1472
|
-
* @
|
|
1473
|
-
*
|
|
1491
|
+
* @param sparse
|
|
1492
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1493
|
+
*
|
|
1494
|
+
* @returns
|
|
1495
|
+
* GTIN-14.
|
|
1496
|
+
*/
|
|
1497
|
+
createGTIN14(indicatorDigit: string, value: number | bigint, sparse?: boolean): string;
|
|
1498
|
+
/**
|
|
1499
|
+
* Create GTIN-14s with an indicator digit and references based on numeric values. The values are converted to
|
|
1500
|
+
* references of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1474
1501
|
*
|
|
1475
1502
|
* @param indicatorDigit
|
|
1476
1503
|
* Indicator digit.
|
|
1477
1504
|
*
|
|
1478
|
-
* @param
|
|
1479
|
-
* Numeric
|
|
1505
|
+
* @param values
|
|
1506
|
+
* Numeric values.
|
|
1480
1507
|
*
|
|
1481
1508
|
* @param sparse
|
|
1482
|
-
* If true, the
|
|
1509
|
+
* If true, the values are mapped to a sparse sequence resistant to discovery.
|
|
1483
1510
|
*
|
|
1484
1511
|
* @returns
|
|
1485
|
-
* GTIN-
|
|
1512
|
+
* GTIN-14s.
|
|
1486
1513
|
*/
|
|
1487
|
-
createGTIN14
|
|
1514
|
+
createGTIN14(indicatorDigit: string, values: Iterable<number | bigint>, sparse?: boolean): Iterable<string>;
|
|
1488
1515
|
}
|
|
1489
1516
|
|
|
1490
1517
|
/**
|
|
@@ -1510,41 +1537,65 @@ declare const SerializableNumericIdentifierCreator_base: abstract new (...args:
|
|
|
1510
1537
|
declare class SerializableNumericIdentifierCreator extends SerializableNumericIdentifierCreator_base {
|
|
1511
1538
|
#private;
|
|
1512
1539
|
/**
|
|
1513
|
-
* Create serialized identifier
|
|
1540
|
+
* Create a serialized identifier with a reference based on a numeric value concatenated with a serial component.
|
|
1514
1541
|
* The value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1515
1542
|
*
|
|
1516
|
-
* @
|
|
1517
|
-
*
|
|
1543
|
+
* @param value
|
|
1544
|
+
* Numeric value of the reference.
|
|
1545
|
+
*
|
|
1546
|
+
* @param serialComponent
|
|
1547
|
+
* Serial component.
|
|
1548
|
+
*
|
|
1549
|
+
* @param sparse
|
|
1550
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1551
|
+
*
|
|
1552
|
+
* @returns
|
|
1553
|
+
* Serialized identifier.
|
|
1554
|
+
*/
|
|
1555
|
+
createSerialized(value: number | bigint, serialComponent: string, sparse?: boolean): string;
|
|
1556
|
+
/**
|
|
1557
|
+
* Create serialized identifiers with a reference based on a numeric value concatenated with serial components. The
|
|
1558
|
+
* value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
1518
1559
|
*
|
|
1519
1560
|
* @param value
|
|
1520
1561
|
* Numeric value of the reference.
|
|
1521
1562
|
*
|
|
1522
|
-
* @param
|
|
1523
|
-
* Serial
|
|
1563
|
+
* @param serialComponents
|
|
1564
|
+
* Serial components.
|
|
1524
1565
|
*
|
|
1525
1566
|
* @param sparse
|
|
1526
|
-
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1567
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery.
|
|
1527
1568
|
*
|
|
1528
1569
|
* @returns
|
|
1529
1570
|
* Serialized identifiers.
|
|
1530
1571
|
*/
|
|
1531
|
-
createSerialized
|
|
1572
|
+
createSerialized(value: number | bigint, serialComponents: Iterable<string>, sparse?: boolean): Iterable<string>;
|
|
1532
1573
|
/**
|
|
1533
|
-
* Concatenate a base identifier with serial component
|
|
1574
|
+
* Concatenate a base identifier with a serial component.
|
|
1575
|
+
*
|
|
1576
|
+
* @param baseIdentifier
|
|
1577
|
+
* Base identifier.
|
|
1578
|
+
*
|
|
1579
|
+
* @param serialComponent
|
|
1580
|
+
* Serial component.
|
|
1534
1581
|
*
|
|
1535
|
-
* @
|
|
1536
|
-
*
|
|
1582
|
+
* @returns
|
|
1583
|
+
* Serialized identifier.
|
|
1584
|
+
*/
|
|
1585
|
+
concatenate(baseIdentifier: string, serialComponent: string): string;
|
|
1586
|
+
/**
|
|
1587
|
+
* Concatenate a base identifier with serial components.
|
|
1537
1588
|
*
|
|
1538
1589
|
* @param baseIdentifier
|
|
1539
1590
|
* Base identifier.
|
|
1540
1591
|
*
|
|
1541
|
-
* @param
|
|
1542
|
-
* Serial
|
|
1592
|
+
* @param serialComponents
|
|
1593
|
+
* Serial components.
|
|
1543
1594
|
*
|
|
1544
1595
|
* @returns
|
|
1545
|
-
* Serialized
|
|
1596
|
+
* Serialized identifiers.
|
|
1546
1597
|
*/
|
|
1547
|
-
concatenate
|
|
1598
|
+
concatenate(baseIdentifier: string, serialComponents: Iterable<string>): Iterable<string>;
|
|
1548
1599
|
}
|
|
1549
1600
|
|
|
1550
1601
|
/**
|
|
@@ -1587,18 +1638,25 @@ declare class NonNumericIdentifierCreator extends NonNumericIdentifierCreator_ba
|
|
|
1587
1638
|
*/
|
|
1588
1639
|
protected get referenceValidation(): CharacterSetValidation;
|
|
1589
1640
|
/**
|
|
1590
|
-
* Create identifier
|
|
1641
|
+
* Create an identifier with a reference.
|
|
1642
|
+
*
|
|
1643
|
+
* @param reference
|
|
1644
|
+
* Reference.
|
|
1591
1645
|
*
|
|
1592
|
-
* @
|
|
1593
|
-
*
|
|
1646
|
+
* @returns
|
|
1647
|
+
* Identifier.
|
|
1648
|
+
*/
|
|
1649
|
+
create(reference: string): string;
|
|
1650
|
+
/**
|
|
1651
|
+
* Create identifiers with references.
|
|
1594
1652
|
*
|
|
1595
|
-
* @param
|
|
1596
|
-
*
|
|
1653
|
+
* @param references
|
|
1654
|
+
* References.
|
|
1597
1655
|
*
|
|
1598
1656
|
* @returns
|
|
1599
|
-
*
|
|
1657
|
+
* Identifiers.
|
|
1600
1658
|
*/
|
|
1601
|
-
create
|
|
1659
|
+
create(references: Iterable<string>): Iterable<string>;
|
|
1602
1660
|
}
|
|
1603
1661
|
|
|
1604
1662
|
/**
|