@aidc-toolkit/gs1 1.0.25-beta → 1.0.27-beta
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/abstract-identifier-creator.d.ts +75 -0
- package/dist/abstract-identifier-creator.d.ts.map +1 -0
- package/dist/abstract-identifier-creator.js +79 -0
- package/dist/abstract-identifier-creator.js.map +1 -0
- package/dist/abstract-non-gtin-numeric-identifier-creator.d.ts +42 -0
- package/dist/abstract-non-gtin-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/abstract-non-gtin-numeric-identifier-creator.js +40 -0
- package/dist/abstract-non-gtin-numeric-identifier-creator.js.map +1 -0
- package/dist/abstract-numeric-identifier-creator.d.ts +43 -0
- package/dist/abstract-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/abstract-numeric-identifier-creator.js +160 -0
- package/dist/abstract-numeric-identifier-creator.js.map +1 -0
- package/dist/character-set.d.ts +27 -0
- package/dist/character-set.d.ts.map +1 -0
- package/dist/character-set.js +50 -0
- package/dist/character-set.js.map +1 -0
- package/dist/check.d.ts +81 -0
- package/dist/check.d.ts.map +1 -0
- package/dist/check.js +218 -0
- package/dist/check.js.map +1 -0
- package/dist/content-character-set-creators.d.ts +4 -0
- package/dist/content-character-set-creators.d.ts.map +1 -0
- package/dist/content-character-set-creators.js +9 -0
- package/dist/content-character-set-creators.js.map +1 -0
- package/dist/content-character-set.d.ts +26 -0
- package/dist/content-character-set.d.ts.map +1 -0
- package/dist/content-character-set.js +18 -0
- package/dist/content-character-set.js.map +1 -0
- package/dist/gtin-creator.d.ts +64 -0
- package/dist/gtin-creator.d.ts.map +1 -0
- package/dist/gtin-creator.js +156 -0
- package/dist/gtin-creator.js.map +1 -0
- package/dist/gtin-descriptor.d.ts +22 -0
- package/dist/gtin-descriptor.d.ts.map +1 -0
- package/dist/gtin-descriptor.js +2 -0
- package/dist/gtin-descriptor.js.map +1 -0
- package/dist/gtin-length.d.ts +64 -0
- package/dist/gtin-length.d.ts.map +1 -0
- package/dist/gtin-length.js +36 -0
- package/dist/gtin-length.js.map +1 -0
- package/dist/gtin-type.d.ts +26 -0
- package/dist/gtin-type.d.ts.map +1 -0
- package/dist/gtin-type.js +7 -0
- package/dist/gtin-type.js.map +1 -0
- package/dist/gtin-validator.d.ts +177 -0
- package/dist/gtin-validator.d.ts.map +1 -0
- package/dist/gtin-validator.js +443 -0
- package/dist/gtin-validator.js.map +1 -0
- package/dist/identifier-creator.d.ts +31 -0
- package/dist/identifier-creator.d.ts.map +1 -0
- package/dist/identifier-creator.js +2 -0
- package/dist/identifier-creator.js.map +1 -0
- package/dist/identifier-creators.d.ts +90 -0
- package/dist/identifier-creators.d.ts.map +1 -0
- package/dist/identifier-creators.js +74 -0
- package/dist/identifier-creators.js.map +1 -0
- package/dist/identifier-descriptor.d.ts +27 -0
- package/dist/identifier-descriptor.d.ts.map +1 -0
- package/dist/identifier-descriptor.js +2 -0
- package/dist/identifier-descriptor.js.map +1 -0
- package/dist/identifier-descriptors.d.ts +106 -0
- package/dist/identifier-descriptors.d.ts.map +1 -0
- package/dist/identifier-descriptors.js +262 -0
- package/dist/identifier-descriptors.js.map +1 -0
- package/dist/identifier-extension.d.ts +82 -0
- package/dist/identifier-extension.d.ts.map +1 -0
- package/dist/identifier-extension.js +79 -0
- package/dist/identifier-extension.js.map +1 -0
- package/dist/identifier-type.d.ts +62 -0
- package/dist/identifier-type.d.ts.map +1 -0
- package/dist/identifier-type.js +54 -0
- package/dist/identifier-type.js.map +1 -0
- package/dist/identifier-validator.d.ts +88 -0
- package/dist/identifier-validator.d.ts.map +1 -0
- package/dist/identifier-validator.js +110 -0
- package/dist/identifier-validator.js.map +1 -0
- package/dist/identifier-validators.d.ts +106 -0
- package/dist/identifier-validators.d.ts.map +1 -0
- package/dist/identifier-validators.js +153 -0
- package/dist/identifier-validators.js.map +1 -0
- package/dist/index.d.ts +58 -1949
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -4727
- package/dist/index.js.map +1 -1
- package/dist/leader-type.d.ts +26 -0
- package/dist/leader-type.d.ts.map +1 -0
- package/dist/leader-type.js +18 -0
- package/dist/leader-type.js.map +1 -0
- package/dist/locale/en/locale-resources.d.ts +42 -0
- package/dist/locale/en/locale-resources.d.ts.map +1 -0
- package/dist/locale/en/locale-resources.js +41 -0
- package/dist/locale/en/locale-resources.js.map +1 -0
- package/dist/locale/fr/locale-resources.d.ts +42 -0
- package/dist/locale/fr/locale-resources.d.ts.map +1 -0
- package/dist/locale/fr/locale-resources.js +41 -0
- package/dist/locale/fr/locale-resources.js.map +1 -0
- package/dist/locale/i18n.d.ts +27 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/dist/locale/i18n.js +36 -0
- package/dist/locale/i18n.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-creator.d.ts +12 -0
- package/dist/non-gtin-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-creator.js +2 -0
- package/dist/non-gtin-numeric-identifier-creator.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-descriptor.d.ts +22 -0
- package/dist/non-gtin-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-descriptor.js +2 -0
- package/dist/non-gtin-numeric-identifier-descriptor.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-type.d.ts +26 -0
- package/dist/non-gtin-numeric-identifier-type.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-type.js +8 -0
- package/dist/non-gtin-numeric-identifier-type.js.map +1 -0
- package/dist/non-gtin-numeric-identifier-validator.d.ts +12 -0
- package/dist/non-gtin-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/non-gtin-numeric-identifier-validator.js +10 -0
- package/dist/non-gtin-numeric-identifier-validator.js.map +1 -0
- package/dist/non-numeric-identifier-creator.d.ts +40 -0
- package/dist/non-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/non-numeric-identifier-creator.js +82 -0
- package/dist/non-numeric-identifier-creator.js.map +1 -0
- package/dist/non-numeric-identifier-descriptor.d.ts +26 -0
- package/dist/non-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/non-numeric-identifier-descriptor.js +2 -0
- package/dist/non-numeric-identifier-descriptor.js.map +1 -0
- package/dist/non-numeric-identifier-type.d.ts +26 -0
- package/dist/non-numeric-identifier-type.d.ts.map +1 -0
- package/dist/non-numeric-identifier-type.js +8 -0
- package/dist/non-numeric-identifier-type.js.map +1 -0
- package/dist/non-numeric-identifier-validator.d.ts +41 -0
- package/dist/non-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/non-numeric-identifier-validator.js +69 -0
- package/dist/non-numeric-identifier-validator.js.map +1 -0
- package/dist/non-serializable-numeric-identifier-creator.d.ts +10 -0
- package/dist/non-serializable-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/non-serializable-numeric-identifier-creator.js +8 -0
- package/dist/non-serializable-numeric-identifier-creator.js.map +1 -0
- package/dist/non-serializable-numeric-identifier-descriptor.d.ts +7 -0
- package/dist/non-serializable-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/non-serializable-numeric-identifier-descriptor.js +2 -0
- package/dist/non-serializable-numeric-identifier-descriptor.js.map +1 -0
- package/dist/non-serializable-numeric-identifier-type.d.ts +26 -0
- package/dist/non-serializable-numeric-identifier-type.d.ts.map +1 -0
- package/dist/non-serializable-numeric-identifier-type.js +7 -0
- package/dist/non-serializable-numeric-identifier-type.js.map +1 -0
- package/dist/non-serializable-numeric-identifier-validator.d.ts +16 -0
- package/dist/non-serializable-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/non-serializable-numeric-identifier-validator.js +17 -0
- package/dist/non-serializable-numeric-identifier-validator.js.map +1 -0
- package/dist/numeric-identifier-creator.d.ts +53 -0
- package/dist/numeric-identifier-creator.d.ts.map +1 -0
- package/dist/numeric-identifier-creator.js +2 -0
- package/dist/numeric-identifier-creator.js.map +1 -0
- package/dist/numeric-identifier-descriptor.d.ts +22 -0
- package/dist/numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/numeric-identifier-descriptor.js +2 -0
- package/dist/numeric-identifier-descriptor.js.map +1 -0
- package/dist/numeric-identifier-type.d.ts +26 -0
- package/dist/numeric-identifier-type.d.ts.map +1 -0
- package/dist/numeric-identifier-type.js +7 -0
- package/dist/numeric-identifier-type.js.map +1 -0
- package/dist/numeric-identifier-validator.d.ts +38 -0
- package/dist/numeric-identifier-validator.d.ts.map +1 -0
- package/dist/numeric-identifier-validator.js +61 -0
- package/dist/numeric-identifier-validator.js.map +1 -0
- package/dist/prefix-manager.d.ts +136 -0
- package/dist/prefix-manager.d.ts.map +1 -0
- package/dist/prefix-manager.js +339 -0
- package/dist/prefix-manager.js.map +1 -0
- package/dist/prefix-provider.d.ts +27 -0
- package/dist/prefix-provider.d.ts.map +1 -0
- package/dist/prefix-provider.js +2 -0
- package/dist/prefix-provider.js.map +1 -0
- package/dist/prefix-type.d.ts +26 -0
- package/dist/prefix-type.d.ts.map +1 -0
- package/dist/prefix-type.js +18 -0
- package/dist/prefix-type.js.map +1 -0
- package/dist/prefix-validator.d.ts +70 -0
- package/dist/prefix-validator.d.ts.map +1 -0
- package/dist/prefix-validator.js +208 -0
- package/dist/prefix-validator.js.map +1 -0
- package/dist/serializable-numeric-identifier-creator.d.ts +48 -0
- package/dist/serializable-numeric-identifier-creator.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-creator.js +93 -0
- package/dist/serializable-numeric-identifier-creator.js.map +1 -0
- package/dist/serializable-numeric-identifier-descriptor.d.ts +26 -0
- package/dist/serializable-numeric-identifier-descriptor.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-descriptor.js +2 -0
- package/dist/serializable-numeric-identifier-descriptor.js.map +1 -0
- package/dist/serializable-numeric-identifier-type.d.ts +26 -0
- package/dist/serializable-numeric-identifier-type.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-type.js +8 -0
- package/dist/serializable-numeric-identifier-type.js.map +1 -0
- package/dist/serializable-numeric-identifier-validator.d.ts +41 -0
- package/dist/serializable-numeric-identifier-validator.d.ts.map +1 -0
- package/dist/serializable-numeric-identifier-validator.js +78 -0
- package/dist/serializable-numeric-identifier-validator.js.map +1 -0
- package/package.json +11 -8
- package/src/abstract-identifier-creator.ts +157 -76
- package/src/abstract-non-gtin-numeric-identifier-creator.ts +86 -0
- package/src/abstract-numeric-identifier-creator.ts +205 -136
- package/src/check.ts +2 -2
- package/src/content-character-set-creators.ts +9 -0
- package/src/gtin-creator.ts +20 -19
- package/src/gtin-descriptor.ts +10 -4
- package/src/gtin-length.ts +61 -0
- package/src/gtin-type.ts +6 -37
- package/src/gtin-validator.ts +39 -46
- package/src/identifier-creator.ts +6 -6
- package/src/{creators.ts → identifier-creators.ts} +45 -31
- package/src/identifier-descriptor.ts +3 -3
- package/src/{descriptors.ts → identifier-descriptors.ts} +65 -63
- package/src/identifier-extension.ts +155 -0
- package/src/identifier-validator.ts +94 -11
- package/src/{validators.ts → identifier-validators.ts} +56 -41
- package/src/index.ts +50 -43
- package/src/leader-type.ts +29 -0
- package/src/locale/i18n.ts +3 -3
- package/src/locale/i18next.d.ts +1 -1
- package/src/non-gtin-numeric-identifier-creator.ts +8 -23
- package/src/non-gtin-numeric-identifier-descriptor.ts +4 -4
- package/src/non-gtin-numeric-identifier-type.ts +14 -3
- package/src/non-gtin-numeric-identifier-validator.ts +7 -15
- package/src/non-numeric-identifier-creator.ts +21 -16
- package/src/non-numeric-identifier-descriptor.ts +4 -4
- package/src/non-numeric-identifier-type.ts +14 -3
- package/src/non-numeric-identifier-validator.ts +12 -13
- package/src/non-serializable-numeric-identifier-creator.ts +12 -0
- package/src/non-serializable-numeric-identifier-descriptor.ts +7 -0
- package/src/non-serializable-numeric-identifier-type.ts +22 -0
- package/src/non-serializable-numeric-identifier-validator.ts +19 -0
- package/src/numeric-identifier-creator.ts +9 -8
- package/src/numeric-identifier-descriptor.ts +4 -3
- package/src/numeric-identifier-type.ts +17 -35
- package/src/numeric-identifier-validator.ts +62 -7
- package/src/prefix-manager.ts +79 -76
- package/src/prefix-provider.ts +1 -1
- package/src/prefix-validator.ts +3 -3
- package/src/serializable-numeric-identifier-creator.ts +13 -27
- package/src/serializable-numeric-identifier-descriptor.ts +4 -4
- package/src/serializable-numeric-identifier-type.ts +14 -5
- package/src/serializable-numeric-identifier-validator.ts +22 -21
- package/test/check.test.ts +1 -1
- package/test/creator.test.ts +5 -5
- package/test/gtin-creator.ts +10 -3
- package/test/gtin-validator.test.ts +10 -12
- package/test/identifier-creator.ts +12 -12
- package/test/identifier-validator.ts +1 -1
- package/test/non-gtin-numeric-identifier-creator.ts +3 -3
- package/test/non-gtin-numeric-identifier-validator.ts +8 -3
- package/test/non-numeric-identifier-creator.ts +1 -1
- package/test/non-numeric-identifier-validator.ts +3 -3
- package/test/non-serializable-numeric-identifier-creator.ts +64 -0
- package/test/non-serializable-numeric-identifier-validator.ts +6 -0
- package/test/numeric-identifier-creator.ts +9 -4
- package/test/numeric-identifier-validator.ts +2 -2
- package/test/prefix-manager.test.ts +2 -2
- package/test/serializable-numeric-identifier-creator.ts +2 -2
- package/test/serializable-numeric-identifier-validator.ts +3 -3
- package/test/setup.ts +1 -1
- package/test/sparse.test.ts +1 -1
- package/test/utility.ts +1 -1
- package/test/validator.test.ts +16 -15
- package/test/variable-measure-rcn.test.ts +24 -24
- package/tsconfig-config.json +4 -0
- package/tsconfig-src.json +8 -0
- package/tsconfig-test.json +9 -0
- package/tsconfig.json +12 -1
- package/tsup.config.ts +3 -2
- package/dist/index.cjs +0 -4813
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -1949
- package/src/abstract-identifier-validator.ts +0 -140
- package/src/abstract-numeric-identifier-validator.ts +0 -69
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { NUMERIC_CREATOR } from "@aidc-toolkit/utility";
|
|
2
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
3
|
+
import { PrefixTypes } from "./prefix-type.js";
|
|
4
|
+
/**
|
|
5
|
+
* GS1 Company Prefix minimum length.
|
|
6
|
+
*/
|
|
7
|
+
const GS1_COMPANY_PREFIX_MINIMUM_LENGTH = 4;
|
|
8
|
+
/**
|
|
9
|
+
* GS1 Company Prefix maximum length.
|
|
10
|
+
*/
|
|
11
|
+
const GS1_COMPANY_PREFIX_MAXIMUM_LENGTH = 12;
|
|
12
|
+
/**
|
|
13
|
+
* U.P.C. Company Prefix minimum length.
|
|
14
|
+
*/
|
|
15
|
+
const UPC_COMPANY_PREFIX_MINIMUM_LENGTH = 6;
|
|
16
|
+
/**
|
|
17
|
+
* U.P.C. Company Prefix maximum length.
|
|
18
|
+
*/
|
|
19
|
+
const UPC_COMPANY_PREFIX_MAXIMUM_LENGTH = 11;
|
|
20
|
+
/**
|
|
21
|
+
* GS1-8 Prefix minimum length.
|
|
22
|
+
*/
|
|
23
|
+
const GS1_8_PREFIX_MINIMUM_LENGTH = 2;
|
|
24
|
+
/**
|
|
25
|
+
* GS1-8 Prefix maximum length.
|
|
26
|
+
*/
|
|
27
|
+
const GS1_8_PREFIX_MAXIMUM_LENGTH = 7;
|
|
28
|
+
/**
|
|
29
|
+
* Validation parameters for GS1 Company Prefix.
|
|
30
|
+
*/
|
|
31
|
+
const GS1_COMPANY_PREFIX_VALIDATION = {
|
|
32
|
+
minimumLength: GS1_COMPANY_PREFIX_MINIMUM_LENGTH,
|
|
33
|
+
maximumLength: GS1_COMPANY_PREFIX_MAXIMUM_LENGTH,
|
|
34
|
+
component: () => i18nextGS1.t("Prefix.gs1CompanyPrefix")
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Validation parameters for U.P.C. Company Prefix expressed as GS1 Company Prefix.
|
|
38
|
+
*/
|
|
39
|
+
const UPC_COMPANY_PREFIX_AS_GS1_COMPANY_PREFIX_VALIDATION = {
|
|
40
|
+
minimumLength: UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1,
|
|
41
|
+
maximumLength: UPC_COMPANY_PREFIX_MAXIMUM_LENGTH + 1,
|
|
42
|
+
component: () => i18nextGS1.t("Prefix.gs1CompanyPrefix")
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Validation parameters for GS1-8 Prefix expressed as GS1 Company Prefix.
|
|
46
|
+
*/
|
|
47
|
+
const GS1_8_PREFIX_AS_GS1_COMPANY_PREFIX_VALIDATION = {
|
|
48
|
+
minimumLength: GS1_8_PREFIX_MINIMUM_LENGTH + 5,
|
|
49
|
+
maximumLength: GS1_8_PREFIX_MAXIMUM_LENGTH + 5,
|
|
50
|
+
component: () => i18nextGS1.t("Prefix.gs1CompanyPrefix")
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Validation parameters for U.P.C. Company Prefix.
|
|
54
|
+
*/
|
|
55
|
+
const UPC_COMPANY_PREFIX_VALIDATION = {
|
|
56
|
+
minimumLength: UPC_COMPANY_PREFIX_MINIMUM_LENGTH,
|
|
57
|
+
maximumLength: UPC_COMPANY_PREFIX_MAXIMUM_LENGTH,
|
|
58
|
+
component: () => i18nextGS1.t("Prefix.upcCompanyPrefix")
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Validation parameters for GS1-8 Prefix.
|
|
62
|
+
*/
|
|
63
|
+
const GS1_8_PREFIX_VALIDATION = {
|
|
64
|
+
minimumLength: GS1_8_PREFIX_MINIMUM_LENGTH,
|
|
65
|
+
maximumLength: GS1_8_PREFIX_MAXIMUM_LENGTH,
|
|
66
|
+
component: () => i18nextGS1.t("Prefix.gs18Prefix")
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Prefix validator.
|
|
70
|
+
*/
|
|
71
|
+
export const PrefixValidator = {
|
|
72
|
+
GS1_COMPANY_PREFIX_MINIMUM_LENGTH,
|
|
73
|
+
GS1_COMPANY_PREFIX_MAXIMUM_LENGTH,
|
|
74
|
+
UPC_COMPANY_PREFIX_MINIMUM_LENGTH,
|
|
75
|
+
UPC_COMPANY_PREFIX_MAXIMUM_LENGTH,
|
|
76
|
+
GS1_8_PREFIX_MINIMUM_LENGTH,
|
|
77
|
+
GS1_8_PREFIX_MAXIMUM_LENGTH,
|
|
78
|
+
/**
|
|
79
|
+
* Validate a prefix.
|
|
80
|
+
*
|
|
81
|
+
* @param prefixType
|
|
82
|
+
* Prefix type.
|
|
83
|
+
*
|
|
84
|
+
* @param allowUPCCompanyPrefix
|
|
85
|
+
* If true, a U.P.C. Company Prefix expressed as a GS1 Company Prefix is permitted.
|
|
86
|
+
*
|
|
87
|
+
* @param allowGS18Prefix
|
|
88
|
+
* If true, a GS1-8 Prefix expressed as a GS1 Company Prefix is permitted.
|
|
89
|
+
*
|
|
90
|
+
* @param prefix
|
|
91
|
+
* Prefix.
|
|
92
|
+
*
|
|
93
|
+
* @param isFromIdentifier
|
|
94
|
+
* If true, the prefix is from an identifier and should be trimmed before its character set is validated.
|
|
95
|
+
*
|
|
96
|
+
* @param isNumericIdentifier
|
|
97
|
+
* If true, the prefix is from a numeric identifier and its character set will be validated by the caller.
|
|
98
|
+
*
|
|
99
|
+
* @param positionOffset
|
|
100
|
+
* Position offset within a larger string.
|
|
101
|
+
*/
|
|
102
|
+
validate(prefixType, allowUPCCompanyPrefix, allowGS18Prefix, prefix, isFromIdentifier = false, isNumericIdentifier = false, positionOffset) {
|
|
103
|
+
let baseValidation;
|
|
104
|
+
// Validate the prefix type and determine the prefix validation parameters.
|
|
105
|
+
switch (prefixType) {
|
|
106
|
+
case PrefixTypes.GS1CompanyPrefix:
|
|
107
|
+
if (!prefix.startsWith("0")) {
|
|
108
|
+
baseValidation = GS1_COMPANY_PREFIX_VALIDATION;
|
|
109
|
+
}
|
|
110
|
+
else if (!prefix.startsWith("00000")) {
|
|
111
|
+
if (!allowUPCCompanyPrefix) {
|
|
112
|
+
throw new RangeError(i18nextGS1.t("Prefix.gs1CompanyPrefixCantStartWith0"));
|
|
113
|
+
}
|
|
114
|
+
baseValidation = UPC_COMPANY_PREFIX_AS_GS1_COMPANY_PREFIX_VALIDATION;
|
|
115
|
+
}
|
|
116
|
+
else if (!prefix.startsWith("000000")) {
|
|
117
|
+
if (!allowGS18Prefix) {
|
|
118
|
+
throw new RangeError(i18nextGS1.t("Prefix.gs1CompanyPrefixCantStartWith00000"));
|
|
119
|
+
}
|
|
120
|
+
baseValidation = GS1_8_PREFIX_AS_GS1_COMPANY_PREFIX_VALIDATION;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
throw new RangeError(i18nextGS1.t("Prefix.gs1CompanyPrefixCantStartWith000000"));
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
case PrefixTypes.UPCCompanyPrefix:
|
|
127
|
+
if (prefix.startsWith("0000")) {
|
|
128
|
+
throw new RangeError(i18nextGS1.t("Prefix.upcCompanyPrefixCantStartWith0000"));
|
|
129
|
+
}
|
|
130
|
+
baseValidation = UPC_COMPANY_PREFIX_VALIDATION;
|
|
131
|
+
break;
|
|
132
|
+
case PrefixTypes.GS18Prefix:
|
|
133
|
+
if (prefix.startsWith("0")) {
|
|
134
|
+
throw new RangeError(i18nextGS1.t("Prefix.gs18PrefixCantStartWith0"));
|
|
135
|
+
}
|
|
136
|
+
baseValidation = GS1_8_PREFIX_VALIDATION;
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
const mergedValidation = {
|
|
140
|
+
...baseValidation,
|
|
141
|
+
positionOffset
|
|
142
|
+
};
|
|
143
|
+
// If from key and numeric, key validation will take care of character set validation.
|
|
144
|
+
if (!isFromIdentifier) {
|
|
145
|
+
NUMERIC_CREATOR.validate(prefix, mergedValidation);
|
|
146
|
+
}
|
|
147
|
+
else if (!isNumericIdentifier) {
|
|
148
|
+
// Validate only the minimum length, allowing at least one character for the (possibly non-numeric) reference.
|
|
149
|
+
NUMERIC_CREATOR.validate(prefix.substring(0, Math.min(mergedValidation.minimumLength, prefix.length - 1)), mergedValidation);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
/**
|
|
153
|
+
* Normalize a prefix.
|
|
154
|
+
*
|
|
155
|
+
* @param prefixType
|
|
156
|
+
* Prefix type.
|
|
157
|
+
*
|
|
158
|
+
* @param prefix
|
|
159
|
+
* Prefix.
|
|
160
|
+
*
|
|
161
|
+
* @returns
|
|
162
|
+
* Prefix provider with normalized prefix type and prefix.
|
|
163
|
+
*/
|
|
164
|
+
normalize(prefixType, prefix) {
|
|
165
|
+
// Validate first.
|
|
166
|
+
this.validate(prefixType, true, true, prefix);
|
|
167
|
+
let gs1CompanyPrefix;
|
|
168
|
+
// First step is to map the prefix to a GS1 Company Prefix.
|
|
169
|
+
switch (prefixType) {
|
|
170
|
+
case PrefixTypes.GS1CompanyPrefix:
|
|
171
|
+
gs1CompanyPrefix = prefix;
|
|
172
|
+
break;
|
|
173
|
+
case PrefixTypes.UPCCompanyPrefix:
|
|
174
|
+
gs1CompanyPrefix = "0" + prefix;
|
|
175
|
+
break;
|
|
176
|
+
case PrefixTypes.GS18Prefix:
|
|
177
|
+
gs1CompanyPrefix = "00000" + prefix;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
let normalizedPrefixType;
|
|
181
|
+
let normalizedPrefix;
|
|
182
|
+
let upcCompanyPrefix = undefined;
|
|
183
|
+
let gs18Prefix = undefined;
|
|
184
|
+
// Determine the prefix type and populate the remaining fields.
|
|
185
|
+
if (!gs1CompanyPrefix.startsWith("0")) {
|
|
186
|
+
normalizedPrefixType = PrefixTypes.GS1CompanyPrefix;
|
|
187
|
+
normalizedPrefix = gs1CompanyPrefix;
|
|
188
|
+
}
|
|
189
|
+
else if (!gs1CompanyPrefix.startsWith("00000")) {
|
|
190
|
+
normalizedPrefixType = PrefixTypes.UPCCompanyPrefix;
|
|
191
|
+
upcCompanyPrefix = gs1CompanyPrefix.substring(1);
|
|
192
|
+
normalizedPrefix = upcCompanyPrefix;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
normalizedPrefixType = PrefixTypes.GS18Prefix;
|
|
196
|
+
gs18Prefix = gs1CompanyPrefix.substring(5);
|
|
197
|
+
normalizedPrefix = gs18Prefix;
|
|
198
|
+
}
|
|
199
|
+
return {
|
|
200
|
+
prefixType: normalizedPrefixType,
|
|
201
|
+
prefix: normalizedPrefix,
|
|
202
|
+
gs1CompanyPrefix,
|
|
203
|
+
upcCompanyPrefix,
|
|
204
|
+
gs18Prefix
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
//# sourceMappingURL=prefix-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefix-validator.js","sourceRoot":"","sources":["../src/prefix-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EAAmB,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAsBhE;;GAEG;AACH,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAE7C;;GAEG;AACH,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAE5C;;GAEG;AACH,MAAM,iCAAiC,GAAG,EAAE,CAAC;AAE7C;;GAEG;AACH,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,2BAA2B,GAAG,CAAC,CAAC;AAEtC;;GAEG;AACH,MAAM,6BAA6B,GAA+B;IAC9D,aAAa,EAAE,iCAAiC;IAChD,aAAa,EAAE,iCAAiC;IAChD,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,yBAAyB,CAAC;CAC3D,CAAC;AAEF;;GAEG;AACH,MAAM,mDAAmD,GAA+B;IACpF,aAAa,EAAE,iCAAiC,GAAG,CAAC;IACpD,aAAa,EAAE,iCAAiC,GAAG,CAAC;IACpD,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,yB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AAgB,GAAG,gBAAgB,CAAC;QACxC,CAAC;aAAM,CAAC;YACJ,oBAAoB,GAAG,WAAW,CAAC,UAAU,CAAC;YAC9C,UAAU,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;YAC3C,gBAAgB,GAAG,UAAU,CAAC;QAClC,CAAC;QAED,OAAO;YACH,UAAU,EAAE,oBAAoB;YAChC,MAAM,EAAE,gBAAgB;YACxB,gBAAgB;YAChB,gBAAgB;YAChB,UAAU;SACb,CAAC;IACN,CAAC;CACK,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type TransformerInput, type TransformerOutput } from "@aidc-toolkit/utility";
|
|
2
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
3
|
+
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
4
|
+
declare const SerializableNumericIdentifierCreator_base: abstract new (prefixProvider: import("./prefix-provider.js").PrefixProvider, identifierType: SerializableNumericIdentifierType) => SerializableNumericIdentifierValidator & import("./non-gtin-numeric-identifier-creator.js").NonGTINNumericIdentifierCreator<SerializableNumericIdentifierType>;
|
|
5
|
+
/**
|
|
6
|
+
* Serializable numeric identifier creator.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SerializableNumericIdentifierCreator extends SerializableNumericIdentifierCreator_base {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* Create serialized identifier(s) with a reference based on a numeric value concatenated with serial component(s).
|
|
12
|
+
* The value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
13
|
+
*
|
|
14
|
+
* @template TTransformerInput
|
|
15
|
+
* Transformer input type.
|
|
16
|
+
*
|
|
17
|
+
* @param value
|
|
18
|
+
* Numeric value of the reference.
|
|
19
|
+
*
|
|
20
|
+
* @param serialComponentOrComponents
|
|
21
|
+
* Serial component(s).
|
|
22
|
+
*
|
|
23
|
+
* @param sparse
|
|
24
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery. Default is false.
|
|
25
|
+
*
|
|
26
|
+
* @returns
|
|
27
|
+
* Serialized identifiers.
|
|
28
|
+
*/
|
|
29
|
+
createSerialized<TTransformerInput extends TransformerInput<string>>(value: number, serialComponentOrComponents: TTransformerInput, sparse?: boolean): TransformerOutput<TTransformerInput, string>;
|
|
30
|
+
/**
|
|
31
|
+
* Concatenate a base identifier with serial component(s).
|
|
32
|
+
*
|
|
33
|
+
* @template TTransformerInput
|
|
34
|
+
* Transformer input type.
|
|
35
|
+
*
|
|
36
|
+
* @param baseIdentifier
|
|
37
|
+
* Base identifier.
|
|
38
|
+
*
|
|
39
|
+
* @param serialComponentOrComponents
|
|
40
|
+
* Serial component(s).
|
|
41
|
+
*
|
|
42
|
+
* @returns
|
|
43
|
+
* Serialized identifier(s).
|
|
44
|
+
*/
|
|
45
|
+
concatenate<TTransformerInput extends TransformerInput<string>>(baseIdentifier: string, serialComponentOrComponents: TTransformerInput): TransformerOutput<TTransformerInput, string>;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=serializable-numeric-identifier-creator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-creator.d.ts","sourceRoot":"","sources":["../src/serializable-numeric-identifier-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,KAAK,gBAAgB,EAAE,KAAK,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEpH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AACnG,OAAO,EAAE,sCAAsC,EAAE,MAAM,gDAAgD,CAAC;;AAExG;;GAEG;AACH,qBAAa,oCAAqC,SAAQ,yCAGjB;;IAgDrC;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAC,iBAAiB,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,2BAA2B,EAAE,iBAAiB,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,CAAC;IAInM;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,iBAAiB,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,MAAM,EAAE,2BAA2B,EAAE,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,CAAC;CAKxL"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Used in JSDoc.
|
|
2
|
+
import { mapIterable } from "@aidc-toolkit/utility";
|
|
3
|
+
import { MixinAbstractNonGTINNumericIdentifierCreator } from "./abstract-non-gtin-numeric-identifier-creator.js";
|
|
4
|
+
import { SerializableNumericIdentifierValidator } from "./serializable-numeric-identifier-validator.js";
|
|
5
|
+
/**
|
|
6
|
+
* Serializable numeric identifier creator.
|
|
7
|
+
*/
|
|
8
|
+
export class SerializableNumericIdentifierCreator extends MixinAbstractNonGTINNumericIdentifierCreator(SerializableNumericIdentifierValidator) {
|
|
9
|
+
/**
|
|
10
|
+
* Concatenate a validated base identifier with serial component(s).
|
|
11
|
+
*
|
|
12
|
+
* @template TTransformerInput
|
|
13
|
+
* Transformer input type.
|
|
14
|
+
*
|
|
15
|
+
* @param baseIdentifier
|
|
16
|
+
* Base identifier.
|
|
17
|
+
*
|
|
18
|
+
* @param serialComponentOrComponents
|
|
19
|
+
* Serial component(s).
|
|
20
|
+
*
|
|
21
|
+
* @returns
|
|
22
|
+
* Serialized identifier(s).
|
|
23
|
+
*/
|
|
24
|
+
#concatenateValidated(baseIdentifier, serialComponentOrComponents) {
|
|
25
|
+
// TODO Refactor type when https://github.com/microsoft/TypeScript/pull/56941 released.
|
|
26
|
+
let result;
|
|
27
|
+
const serialComponentCreator = this.serialComponentCreator;
|
|
28
|
+
const serialComponentValidation = this.serialComponentValidation;
|
|
29
|
+
/**
|
|
30
|
+
* Validate a serial component and concatenate it to the base identifier.
|
|
31
|
+
*
|
|
32
|
+
* @param serialComponent
|
|
33
|
+
* Serial component.
|
|
34
|
+
*
|
|
35
|
+
* @returns
|
|
36
|
+
* Serialized identifier.
|
|
37
|
+
*/
|
|
38
|
+
function validateAndConcatenate(serialComponent) {
|
|
39
|
+
serialComponentCreator.validate(serialComponent, serialComponentValidation);
|
|
40
|
+
return baseIdentifier + serialComponent;
|
|
41
|
+
}
|
|
42
|
+
if (typeof serialComponentOrComponents !== "object") {
|
|
43
|
+
result = validateAndConcatenate(serialComponentOrComponents);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
result = mapIterable(serialComponentOrComponents, validateAndConcatenate);
|
|
47
|
+
}
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type determination is handled above.
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Create serialized identifier(s) with a reference based on a numeric value concatenated with serial component(s).
|
|
53
|
+
* The value is converted to a reference of the appropriate length using {@linkcode NUMERIC_CREATOR}.
|
|
54
|
+
*
|
|
55
|
+
* @template TTransformerInput
|
|
56
|
+
* Transformer input type.
|
|
57
|
+
*
|
|
58
|
+
* @param value
|
|
59
|
+
* Numeric value of the reference.
|
|
60
|
+
*
|
|
61
|
+
* @param serialComponentOrComponents
|
|
62
|
+
* Serial component(s).
|
|
63
|
+
*
|
|
64
|
+
* @param sparse
|
|
65
|
+
* If true, the value is mapped to a sparse sequence resistant to discovery. Default is false.
|
|
66
|
+
*
|
|
67
|
+
* @returns
|
|
68
|
+
* Serialized identifiers.
|
|
69
|
+
*/
|
|
70
|
+
createSerialized(value, serialComponentOrComponents, sparse) {
|
|
71
|
+
return this.#concatenateValidated(this.create(value, sparse), serialComponentOrComponents);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Concatenate a base identifier with serial component(s).
|
|
75
|
+
*
|
|
76
|
+
* @template TTransformerInput
|
|
77
|
+
* Transformer input type.
|
|
78
|
+
*
|
|
79
|
+
* @param baseIdentifier
|
|
80
|
+
* Base identifier.
|
|
81
|
+
*
|
|
82
|
+
* @param serialComponentOrComponents
|
|
83
|
+
* Serial component(s).
|
|
84
|
+
*
|
|
85
|
+
* @returns
|
|
86
|
+
* Serialized identifier(s).
|
|
87
|
+
*/
|
|
88
|
+
concatenate(baseIdentifier, serialComponentOrComponents) {
|
|
89
|
+
this.validate(baseIdentifier);
|
|
90
|
+
return this.#concatenateValidated(baseIdentifier, serialComponentOrComponents);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=serializable-numeric-identifier-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-creator.js","sourceRoot":"","sources":["../src/serializable-numeric-identifier-creator.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAkE,MAAM,uBAAuB,CAAC;AACpH,OAAO,EAAE,4CAA4C,EAAE,MAAM,mDAAmD,CAAC;AAEjH,OAAO,EAAE,sCAAsC,EAAE,MAAM,gDAAgD,CAAC;AAExG;;GAEG;AACH,MAAM,OAAO,oCAAqC,SAAQ,4CAA4C,CAGpG,sCAAsC,CAAC;IACrC;;;;;;;;;;;;;;OAcG;IACH,qBAAqB,CAAqD,cAAsB,EAAE,2BAA8C;QAC5I,uFAAuF;QACvF,IAAI,MAAiC,CAAC;QAEtC,MAAM,sBAAsB,GAAG,IAAI,CAAC,sBAAsB,CAAC;QAC3D,MAAM,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,CAAC;QAEjE;;;;;;;;WAQG;QACH,SAAS,sBAAsB,CAAC,eAAuB;YACnD,sBAAsB,CAAC,QAAQ,CAAC,eAAe,EAAE,yBAAyB,CAAC,CAAC;YAE5E,OAAO,cAAc,GAAG,eAAe,CAAC;QAC5C,CAAC;QAED,IAAI,OAAO,2BAA2B,KAAK,QAAQ,EAAE,CAAC;YAClD,MAAM,GAAG,sBAAsB,CAAC,2BAA2B,CAAC,CAAC;QACjE,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,WAAW,CAAC,2BAA2B,EAAE,sBAAsB,CAAC,CAAC;QAC9E,CAAC;QAED,+GAA+G;QAC/G,OAAO,MAAsD,CAAC;IAClE,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,gBAAgB,CAAqD,KAAa,EAAE,2BAA8C,EAAE,MAAgB;QAChJ,OAAO,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,2BAA2B,CAAC,CAAC;IAC/F,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAqD,cAAsB,EAAE,2BAA8C;QAClI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAE9B,OAAO,IAAI,CAAC,qBAAqB,CAAC,cAAc,EAAE,2BAA2B,CAAC,CAAC;IACnF,CAAC;CACJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ContentCharacterSet } from "./content-character-set.js";
|
|
2
|
+
import type { LeaderTypes } from "./leader-type.js";
|
|
3
|
+
import type { NonGTINNumericIdentifierDescriptor } from "./non-gtin-numeric-identifier-descriptor.js";
|
|
4
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
5
|
+
/**
|
|
6
|
+
* Serializable numeric identifier descriptor.
|
|
7
|
+
*/
|
|
8
|
+
export interface SerializableNumericIdentifierDescriptor extends NonGTINNumericIdentifierDescriptor {
|
|
9
|
+
/**
|
|
10
|
+
* @inheritDoc
|
|
11
|
+
*/
|
|
12
|
+
readonly identifierType: SerializableNumericIdentifierType;
|
|
13
|
+
/**
|
|
14
|
+
* @inheritDoc
|
|
15
|
+
*/
|
|
16
|
+
readonly leaderType: typeof LeaderTypes.None;
|
|
17
|
+
/**
|
|
18
|
+
* Serial component length.
|
|
19
|
+
*/
|
|
20
|
+
readonly serialComponentLength: number;
|
|
21
|
+
/**
|
|
22
|
+
* Serial component character set.
|
|
23
|
+
*/
|
|
24
|
+
readonly serialComponentCharacterSet: ContentCharacterSet;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=serializable-numeric-identifier-descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-descriptor.d.ts","sourceRoot":"","sources":["../src/serializable-numeric-identifier-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACtG,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAEnG;;GAEG;AACH,MAAM,WAAW,uCAAwC,SAAQ,kCAAkC;IAC/F;;OAEG;IACH,QAAQ,CAAC,cAAc,EAAE,iCAAiC,CAAC;IAE3D;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,OAAO,WAAW,CAAC,IAAI,CAAC;IAE7C;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,2BAA2B,EAAE,mBAAmB,CAAC;CAC7D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-descriptor.js","sourceRoot":"","sources":["../src/serializable-numeric-identifier-descriptor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Serializable numeric identifier types.
|
|
3
|
+
*/
|
|
4
|
+
export declare const SerializableNumericIdentifierTypes: Omit<Omit<Pick<{
|
|
5
|
+
readonly GTIN: "GTIN";
|
|
6
|
+
readonly GLN: "GLN";
|
|
7
|
+
readonly SSCC: "SSCC";
|
|
8
|
+
readonly GRAI: "GRAI";
|
|
9
|
+
readonly GIAI: "GIAI";
|
|
10
|
+
readonly GSRN: "GSRN";
|
|
11
|
+
readonly GDTI: "GDTI";
|
|
12
|
+
readonly GINC: "GINC";
|
|
13
|
+
readonly GSIN: "GSIN";
|
|
14
|
+
readonly GCN: "GCN";
|
|
15
|
+
readonly CPID: "CPID";
|
|
16
|
+
readonly GMN: "GMN";
|
|
17
|
+
}, "GTIN" | "GLN" | "SSCC" | "GRAI" | "GSRN" | "GDTI" | "GSIN" | "GCN">, "GTIN">, "GLN" | "SSCC" | "GSRN" | "GSIN">;
|
|
18
|
+
/**
|
|
19
|
+
* Serializable numeric identifier type key.
|
|
20
|
+
*/
|
|
21
|
+
export type SerializableNumericIdentifierTypeKey = keyof typeof SerializableNumericIdentifierTypes;
|
|
22
|
+
/**
|
|
23
|
+
* Serializable numeric identifier type.
|
|
24
|
+
*/
|
|
25
|
+
export type SerializableNumericIdentifierType = typeof SerializableNumericIdentifierTypes[SerializableNumericIdentifierTypeKey];
|
|
26
|
+
//# sourceMappingURL=serializable-numeric-identifier-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-type.d.ts","sourceRoot":"","sources":["../src/serializable-numeric-identifier-type.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;mHAAgF,CAAC;AAEhI;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG,MAAM,OAAO,kCAAkC,CAAC;AAEnG;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAAG,OAAO,kCAAkC,CAAC,oCAAoC,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { exclude } from "@aidc-toolkit/core";
|
|
2
|
+
import { NonGTINNumericIdentifierTypes } from "./non-gtin-numeric-identifier-type.js";
|
|
3
|
+
import { NonSerializableNumericIdentifierTypes } from "./non-serializable-numeric-identifier-type.js";
|
|
4
|
+
/**
|
|
5
|
+
* Serializable numeric identifier types.
|
|
6
|
+
*/
|
|
7
|
+
export const SerializableNumericIdentifierTypes = exclude(NonGTINNumericIdentifierTypes, NonSerializableNumericIdentifierTypes);
|
|
8
|
+
//# sourceMappingURL=serializable-numeric-identifier-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-type.js","sourceRoot":"","sources":["../src/serializable-numeric-identifier-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,EAAE,qCAAqC,EAAE,MAAM,+CAA+C,CAAC;AAEtG;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,OAAO,CAAC,6BAA6B,EAAE,qCAAqC,CAAC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { CharacterSetCreator, CharacterSetValidation } from "@aidc-toolkit/utility";
|
|
2
|
+
import type { ContentCharacterSet } from "./content-character-set.js";
|
|
3
|
+
import type { IdentifierValidation } from "./identifier-validator.js";
|
|
4
|
+
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
5
|
+
import type { SerializableNumericIdentifierDescriptor } from "./serializable-numeric-identifier-descriptor.js";
|
|
6
|
+
import type { SerializableNumericIdentifierType } from "./serializable-numeric-identifier-type.js";
|
|
7
|
+
/**
|
|
8
|
+
* Serializable numeric identifier validator. Validates both serialized and non-serialized forms of numeric identifiers
|
|
9
|
+
* that support serialization.
|
|
10
|
+
*/
|
|
11
|
+
export declare class SerializableNumericIdentifierValidator extends NonGTINNumericIdentifierValidator<SerializableNumericIdentifierType> implements SerializableNumericIdentifierDescriptor {
|
|
12
|
+
#private;
|
|
13
|
+
/**
|
|
14
|
+
* Constructor.
|
|
15
|
+
*
|
|
16
|
+
* @param identifierType
|
|
17
|
+
* Identifier type.
|
|
18
|
+
*/
|
|
19
|
+
constructor(identifierType: SerializableNumericIdentifierType);
|
|
20
|
+
/**
|
|
21
|
+
* Get the serial component length.
|
|
22
|
+
*/
|
|
23
|
+
get serialComponentLength(): number;
|
|
24
|
+
/**
|
|
25
|
+
* Get the serial component character set.
|
|
26
|
+
*/
|
|
27
|
+
get serialComponentCharacterSet(): ContentCharacterSet;
|
|
28
|
+
/**
|
|
29
|
+
* Get the serial component validation parameters.
|
|
30
|
+
*/
|
|
31
|
+
protected get serialComponentValidation(): CharacterSetValidation;
|
|
32
|
+
/**
|
|
33
|
+
* Get the serial component creator.
|
|
34
|
+
*/
|
|
35
|
+
get serialComponentCreator(): CharacterSetCreator;
|
|
36
|
+
/**
|
|
37
|
+
* @inheritDoc
|
|
38
|
+
*/
|
|
39
|
+
validate(identifier: string, validation?: IdentifierValidation): void;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=serializable-numeric-identifier-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-numeric-identifier-validator.d.ts","sourceRoot":"","sources":["../src/serializable-numeric-identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,iDAAiD,CAAC;AAC/G,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAEnG;;;GAGG;AACH,qBAAa,sCAAuC,SAAQ,iCAAiC,CAAC,iCAAiC,CAAE,YAAW,uCAAuC;;IAqB/K;;;;;OAKG;gBACS,cAAc,EAAE,iCAAiC;IAiB7D;;OAEG;IACH,IAAI,qBAAqB,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,IAAI,2BAA2B,IAAI,mBAAmB,CAErD;IAED;;OAEG;IACH,SAAS,KAAK,yBAAyB,IAAI,sBAAsB,CAEhE;IAED;;OAEG;IACH,IAAI,sBAAsB,IAAI,mBAAmB,CAEhD;IAED;;OAEG;IACM,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,oBAAoB,GAAG,IAAI;CAOjF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { CONTENT_CHARACTER_SET_CREATORS } from "./content-character-set-creators.js";
|
|
2
|
+
import { IdentifierDescriptors } from "./identifier-descriptors.js";
|
|
3
|
+
import { i18nextGS1 } from "./locale/i18n.js";
|
|
4
|
+
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
5
|
+
/**
|
|
6
|
+
* Serializable numeric identifier validator. Validates both serialized and non-serialized forms of numeric identifiers
|
|
7
|
+
* that support serialization.
|
|
8
|
+
*/
|
|
9
|
+
export class SerializableNumericIdentifierValidator extends NonGTINNumericIdentifierValidator {
|
|
10
|
+
/**
|
|
11
|
+
* Serial component length.
|
|
12
|
+
*/
|
|
13
|
+
#serialComponentLength;
|
|
14
|
+
/**
|
|
15
|
+
* Serial component character set.
|
|
16
|
+
*/
|
|
17
|
+
#serialComponentCharacterSet;
|
|
18
|
+
/**
|
|
19
|
+
* Serial component validation parameters.
|
|
20
|
+
*/
|
|
21
|
+
#serialComponentValidation;
|
|
22
|
+
/**
|
|
23
|
+
* Serial component creator.
|
|
24
|
+
*/
|
|
25
|
+
#serialComponentCreator;
|
|
26
|
+
/**
|
|
27
|
+
* Constructor.
|
|
28
|
+
*
|
|
29
|
+
* @param identifierType
|
|
30
|
+
* Identifier type.
|
|
31
|
+
*/
|
|
32
|
+
constructor(identifierType) {
|
|
33
|
+
const identifierDescriptor = IdentifierDescriptors[identifierType];
|
|
34
|
+
super(identifierDescriptor);
|
|
35
|
+
this.#serialComponentLength = identifierDescriptor.serialComponentLength;
|
|
36
|
+
this.#serialComponentCharacterSet = identifierDescriptor.serialComponentCharacterSet;
|
|
37
|
+
this.#serialComponentValidation = {
|
|
38
|
+
minimumLength: 1,
|
|
39
|
+
maximumLength: identifierDescriptor.serialComponentLength,
|
|
40
|
+
component: () => i18nextGS1.t("Identifier.serialComponent")
|
|
41
|
+
};
|
|
42
|
+
this.#serialComponentCreator = CONTENT_CHARACTER_SET_CREATORS[identifierDescriptor.serialComponentCharacterSet];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the serial component length.
|
|
46
|
+
*/
|
|
47
|
+
get serialComponentLength() {
|
|
48
|
+
return this.#serialComponentLength;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get the serial component character set.
|
|
52
|
+
*/
|
|
53
|
+
get serialComponentCharacterSet() {
|
|
54
|
+
return this.#serialComponentCharacterSet;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the serial component validation parameters.
|
|
58
|
+
*/
|
|
59
|
+
get serialComponentValidation() {
|
|
60
|
+
return this.#serialComponentValidation;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the serial component creator.
|
|
64
|
+
*/
|
|
65
|
+
get serialComponentCreator() {
|
|
66
|
+
return this.#serialComponentCreator;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* @inheritDoc
|
|
70
|
+
*/
|
|
71
|
+
validate(identifier, validation) {
|
|
72
|
+
super.validate(identifier.substring(0, this.length), validation);
|
|
73
|
+
if (identifier.length > this.length) {
|
|
74
|
+
this.serialComponentCreator.validate(identifier.substring(this.length), this.#serialComponentValidation);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=serializable-numeric-identifier-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializable-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AC,0BAA0B,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAI,sBAAsB;QACtB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACxC,CAAC;IAED;;OAEG;IACM,QAAQ,CAAC,UAAkB,EAAE,UAAiC;QACnE,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;QAEjE,IAAI,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAClC,IAAI,CAAC,sBAAsB,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAC7G,CAAC;IACL,CAAC;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/gs1",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27-beta",
|
|
4
4
|
"description": "GS1 AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"homepage": "https://aidc-toolkit.com/",
|
|
8
|
-
"repository":
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/aidc-toolkit/gs1.git"
|
|
11
|
+
},
|
|
9
12
|
"bugs": {
|
|
10
13
|
"url": "https://github.com/aidc-toolkit/gs1/issues"
|
|
11
14
|
},
|
|
@@ -17,18 +20,18 @@
|
|
|
17
20
|
},
|
|
18
21
|
"scripts": {
|
|
19
22
|
"lint": "eslint",
|
|
20
|
-
"
|
|
21
|
-
"build:
|
|
23
|
+
"tsc:core": "tsc --project tsconfig-src.json",
|
|
24
|
+
"build:dev": "rimraf dist && npm run tsc:core -- --declarationMap --sourceMap",
|
|
25
|
+
"build:release": "npm run tsc:core -- --noEmit && tsup",
|
|
22
26
|
"build:doc": "npm run build:dev",
|
|
23
27
|
"test": "vitest run"
|
|
24
28
|
},
|
|
25
29
|
"devDependencies": {
|
|
26
|
-
"@aidc-toolkit/dev": "1.0.
|
|
30
|
+
"@aidc-toolkit/dev": "1.0.27-beta",
|
|
27
31
|
"vitest": "^4.0.15"
|
|
28
32
|
},
|
|
29
33
|
"dependencies": {
|
|
30
|
-
"@aidc-toolkit/core": "1.0.
|
|
31
|
-
"@aidc-toolkit/utility": "1.0.
|
|
32
|
-
"ts-mixer": "^6.0.4"
|
|
34
|
+
"@aidc-toolkit/core": "1.0.27-beta",
|
|
35
|
+
"@aidc-toolkit/utility": "1.0.27-beta"
|
|
33
36
|
}
|
|
34
37
|
}
|