@aidc-toolkit/gs1 1.0.23-beta → 1.0.24-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/index.cjs +4624 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1588 -0
- package/dist/index.d.ts +1588 -36
- package/dist/index.js +4541 -19
- package/dist/index.js.map +1 -1
- package/package.json +4 -8
- package/src/character-set.ts +16 -1
- package/src/check.ts +2 -2
- package/src/gtin-creator.ts +4 -4
- package/src/gtin-validator.ts +6 -6
- package/src/identifier-creator.ts +3 -3
- package/src/identifier-validator.ts +4 -4
- package/src/index.ts +19 -19
- package/src/locale/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- package/src/non-gtin-numeric-identifier-creator.ts +4 -4
- package/src/non-gtin-numeric-identifier-validator.ts +3 -3
- package/src/non-numeric-identifier-creator.ts +6 -6
- package/src/non-numeric-identifier-validator.ts +6 -6
- package/src/numeric-identifier-creator.ts +3 -3
- package/src/numeric-identifier-validator.ts +5 -5
- package/src/prefix-manager.ts +16 -16
- package/src/prefix-provider.ts +1 -1
- package/src/prefix-validator.ts +2 -2
- package/src/serializable-numeric-identifier-creator.ts +4 -4
- package/src/serializable-numeric-identifier-validator.ts +5 -5
- package/test/creator.test.ts +3 -3
- package/test/gtin-creator.ts +1 -1
- package/test/gtin-validator.test.ts +1 -1
- package/test/identifier-creator.ts +4 -4
- package/test/non-gtin-numeric-identifier-creator.ts +1 -1
- package/test/non-gtin-numeric-identifier-validator.ts +1 -1
- package/test/non-numeric-identifier-validator.ts +2 -2
- package/test/numeric-identifier-creator.ts +1 -1
- package/test/numeric-identifier-validator.ts +1 -1
- package/test/prefix-manager.test.ts +1 -1
- package/test/serializable-numeric-identifier-creator.ts +1 -1
- package/test/serializable-numeric-identifier-validator.ts +2 -2
- package/test/validator.test.ts +4 -4
- package/tsup.config.ts +3 -0
- package/typedoc.json +1 -3
- package/dist/character-set.d.ts +0 -22
- package/dist/character-set.d.ts.map +0 -1
- package/dist/character-set.js +0 -36
- package/dist/character-set.js.map +0 -1
- package/dist/check.d.ts +0 -81
- package/dist/check.d.ts.map +0 -1
- package/dist/check.js +0 -218
- package/dist/check.js.map +0 -1
- package/dist/gtin-creator.d.ts +0 -68
- package/dist/gtin-creator.d.ts.map +0 -1
- package/dist/gtin-creator.js +0 -158
- package/dist/gtin-creator.js.map +0 -1
- package/dist/gtin-validator.d.ts +0 -202
- package/dist/gtin-validator.d.ts.map +0 -1
- package/dist/gtin-validator.js +0 -470
- package/dist/gtin-validator.js.map +0 -1
- package/dist/identifier-creator.d.ts +0 -72
- package/dist/identifier-creator.d.ts.map +0 -1
- package/dist/identifier-creator.js +0 -50
- package/dist/identifier-creator.js.map +0 -1
- package/dist/identifier-type.d.ts +0 -58
- package/dist/identifier-type.d.ts.map +0 -1
- package/dist/identifier-type.js +0 -54
- package/dist/identifier-type.js.map +0 -1
- package/dist/identifier-validator.d.ts +0 -174
- package/dist/identifier-validator.d.ts.map +0 -1
- package/dist/identifier-validator.js +0 -145
- package/dist/identifier-validator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -43
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -42
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -43
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -42
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -37
- package/dist/locale/i18n.js.map +0 -1
- package/dist/non-gtin-numeric-identifier-creator.d.ts +0 -30
- package/dist/non-gtin-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/non-gtin-numeric-identifier-creator.js +0 -30
- package/dist/non-gtin-numeric-identifier-creator.js.map +0 -1
- package/dist/non-gtin-numeric-identifier-validator.d.ts +0 -41
- package/dist/non-gtin-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/non-gtin-numeric-identifier-validator.js +0 -40
- package/dist/non-gtin-numeric-identifier-validator.js.map +0 -1
- package/dist/non-numeric-identifier-creator.d.ts +0 -55
- package/dist/non-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/non-numeric-identifier-creator.js +0 -93
- package/dist/non-numeric-identifier-creator.js.map +0 -1
- package/dist/non-numeric-identifier-validator.d.ts +0 -78
- package/dist/non-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/non-numeric-identifier-validator.js +0 -95
- package/dist/non-numeric-identifier-validator.js.map +0 -1
- package/dist/numeric-identifier-creator.d.ts +0 -121
- package/dist/numeric-identifier-creator.d.ts.map +0 -1
- package/dist/numeric-identifier-creator.js +0 -135
- package/dist/numeric-identifier-creator.js.map +0 -1
- package/dist/numeric-identifier-validator.d.ts +0 -76
- package/dist/numeric-identifier-validator.d.ts.map +0 -1
- package/dist/numeric-identifier-validator.js +0 -84
- package/dist/numeric-identifier-validator.js.map +0 -1
- package/dist/prefix-manager.d.ts +0 -224
- package/dist/prefix-manager.d.ts.map +0 -1
- package/dist/prefix-manager.js +0 -369
- package/dist/prefix-manager.js.map +0 -1
- package/dist/prefix-provider.d.ts +0 -27
- package/dist/prefix-provider.d.ts.map +0 -1
- package/dist/prefix-provider.js +0 -2
- package/dist/prefix-provider.js.map +0 -1
- package/dist/prefix-type.d.ts +0 -22
- package/dist/prefix-type.d.ts.map +0 -1
- package/dist/prefix-type.js +0 -18
- package/dist/prefix-type.js.map +0 -1
- package/dist/prefix-validator.d.ts +0 -58
- package/dist/prefix-validator.d.ts.map +0 -1
- package/dist/prefix-validator.js +0 -154
- package/dist/prefix-validator.js.map +0 -1
- package/dist/serializable-numeric-identifier-creator.d.ts +0 -86
- package/dist/serializable-numeric-identifier-creator.d.ts.map +0 -1
- package/dist/serializable-numeric-identifier-creator.js +0 -116
- package/dist/serializable-numeric-identifier-creator.js.map +0 -1
- package/dist/serializable-numeric-identifier-validator.d.ts +0 -79
- package/dist/serializable-numeric-identifier-validator.d.ts.map +0 -1
- package/dist/serializable-numeric-identifier-validator.js +0 -99
- package/dist/serializable-numeric-identifier-validator.js.map +0 -1
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
Check: {
|
|
3
|
-
lengthOfStringForPriceOrWeightMustBeExactly: "Length {{length, number}} of string for price or weight must be 4 or 5",
|
|
4
|
-
priceOrWeightComponent: "price or weight",
|
|
5
|
-
lengthOfStringForCheckCharacterPairMustBeLessThanOrEqualTo: "Length {{length, number}} of string for check character pair must be less than or equal to {{maximumLength, number}}"
|
|
6
|
-
},
|
|
7
|
-
Identifier: {
|
|
8
|
-
identifierTypeLength: "{{identifierType}} must be {{length, number}} digits long",
|
|
9
|
-
invalidCheckDigit: "Invalid check digit",
|
|
10
|
-
invalidGTINLength: "GTIN must be 13, 12, 8, or 14 digits long",
|
|
11
|
-
invalidGTIN14Length: "GTIN must be 14 digits long",
|
|
12
|
-
invalidZeroSuppressedGTIN12: "Invalid zero-suppressed GTIN-12",
|
|
13
|
-
invalidZeroSuppressibleGTIN12: "GTIN-12 not zero-suppressible",
|
|
14
|
-
invalidZeroSuppressedGTIN12AsGTIN13: "Invalid zero-suppressed GTIN-12 as GTIN-13",
|
|
15
|
-
invalidZeroSuppressedGTIN12AsGTIN14: "Invalid zero-suppressed GTIN-12 as GTIN-14",
|
|
16
|
-
invalidGTIN13AtRetail: "GTIN-13 at retail consumer trade item level can't start with zero",
|
|
17
|
-
invalidGTINAtRetail: "GTIN not supported at retail consumer trade item level",
|
|
18
|
-
invalidGTINAtOtherThanRetail: "GTIN not supported at other than retail consumer trade item level",
|
|
19
|
-
invalidRCNLength: "RCN length must match format length",
|
|
20
|
-
invalidVariableMeasureRCNFormat: "Invalid variable measure RCN format",
|
|
21
|
-
invalidVariableMeasureRCNPrefix: "Invalid variable measure RCN prefix",
|
|
22
|
-
invalidVariableMeasurePriceOrWeight: "Invalid variable measure price or weight",
|
|
23
|
-
indicatorDigit: "indicator digit",
|
|
24
|
-
serialComponent: "serial component",
|
|
25
|
-
reference: "reference",
|
|
26
|
-
referenceCantBeAllNumeric: "Reference can't be all-numeric",
|
|
27
|
-
invalidCheckCharacterPair: "Invalid check character pair"
|
|
28
|
-
},
|
|
29
|
-
Prefix: {
|
|
30
|
-
gs1CompanyPrefix: "GS1 Company Prefix",
|
|
31
|
-
upcCompanyPrefix: "U.P.C. Company Prefix",
|
|
32
|
-
gs18Prefix: "GS1-8 Prefix",
|
|
33
|
-
invalidPrefixType: "Invalid prefix type",
|
|
34
|
-
gs1CompanyPrefixCantStartWith0: "GS1 Company Prefix can't start with \"0\"",
|
|
35
|
-
gs1CompanyPrefixCantStartWith00000: "GS1 Company Prefix can't start with \"00000\"",
|
|
36
|
-
gs1CompanyPrefixCantStartWith000000: "GS1 Company Prefix can't start with \"000000\"",
|
|
37
|
-
upcCompanyPrefixCantStartWith0000: "U.P.C. Company Prefix can't start with \"0000\"",
|
|
38
|
-
gs18PrefixCantStartWith0: "GS1-8 Prefix can't start with \"0\"",
|
|
39
|
-
identifierTypeNotSupportedByGS18Prefix: "{{identifierType}} not supported by GS1-8 Prefix"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=locale-resources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/en/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,KAAK,EAAE;QACH,2CAA2C,EAAE,wEAAwE;QACrH,sBAAsB,EAAE,iBAAiB;QACzC,0DAA0D,EAAE,sHAAsH;KACrL;IACD,UAAU,EAAE;QACR,oBAAoB,EAAE,2DAA2D;QACjF,iBAAiB,EAAE,qBAAqB;QACxC,iBAAiB,EAAE,2CAA2C;QAC9D,mBAAmB,EAAE,6BAA6B;QAClD,2BAA2B,EAAE,iCAAiC;QAC9D,6BAA6B,EAAE,+BAA+B;QAC9D,mCAAmC,EAAE,4CAA4C;QACjF,mCAAmC,EAAE,4CAA4C;QACjF,qBAAqB,EAAE,mEAAmE;QAC1F,mBAAmB,EAAE,wDAAwD;QAC7E,4BAA4B,EAAE,mEAAmE;QACjG,gBAAgB,EAAE,qCAAqC;QACvD,+BAA+B,EAAE,qCAAqC;QACtE,+BAA+B,EAAE,qCAAqC;QACtE,mCAAmC,EAAE,0CAA0C;QAC/E,cAAc,EAAE,iBAAiB;QACjC,eAAe,EAAE,kBAAkB;QACnC,SAAS,EAAE,WAAW;QACtB,yBAAyB,EAAE,gCAAgC;QAC3D,yBAAyB,EAAE,8BAA8B;KAC5D;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,oBAAoB;QACtC,gBAAgB,EAAE,uBAAuB;QACzC,UAAU,EAAE,cAAc;QAC1B,iBAAiB,EAAE,qBAAqB;QACxC,8BAA8B,EAAE,2CAA2C;QAC3E,kCAAkC,EAAE,+CAA+C;QACnF,mCAAmC,EAAE,gDAAgD;QACrF,iCAAiC,EAAE,iDAAiD;QACpF,wBAAwB,EAAE,qCAAqC;QAC/D,sCAAsC,EAAE,kDAAkD;KAC7F;CACK,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
declare const _default: {
|
|
2
|
-
readonly Check: {
|
|
3
|
-
readonly lengthOfStringForPriceOrWeightMustBeExactly: "La longueur {{length, number}} de la chaîne pour le prix ou le poids doit être 4 ou 5";
|
|
4
|
-
readonly priceOrWeightComponent: "prix ou poids";
|
|
5
|
-
readonly lengthOfStringForCheckCharacterPairMustBeLessThanOrEqualTo: "La longueur {{length, number}} de la chaîne pour la paire de caractères de vérification doit être inférieure ou égale à {{maximumLength, number}}";
|
|
6
|
-
};
|
|
7
|
-
readonly Identifier: {
|
|
8
|
-
readonly identifierTypeLength: "{{identifierType}} doit comporter {{length, number}} chiffres";
|
|
9
|
-
readonly invalidCheckDigit: "Chiffre de contrôle non valide";
|
|
10
|
-
readonly invalidGTINLength: "Le GTIN doit comporter 13, 12, 8 ou 14 chiffres";
|
|
11
|
-
readonly invalidGTIN14Length: "Le GTIN doit comporter 14 chiffres";
|
|
12
|
-
readonly invalidZeroSuppressedGTIN12: "Code GTIN-12 non valide avec zéro supprimé";
|
|
13
|
-
readonly invalidZeroSuppressibleGTIN12: "Le GTIN-12 ne peut pas être supprimé par zéro";
|
|
14
|
-
readonly invalidZeroSuppressedGTIN12AsGTIN13: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-13";
|
|
15
|
-
readonly invalidZeroSuppressedGTIN12AsGTIN14: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-14";
|
|
16
|
-
readonly invalidGTIN13AtRetail: "Le GTIN-13 au niveau des articles de consommation au détail ne peut pas commencer par zéro";
|
|
17
|
-
readonly invalidGTINAtRetail: "Le GTIN n'est pas pris en charge au niveau des articles de consommation au détail";
|
|
18
|
-
readonly invalidGTINAtOtherThanRetail: "Le GTIN n'est pas pris en charge à d'autres niveaux que ceux des articles de consommation au détail";
|
|
19
|
-
readonly invalidRCNLength: "La longueur du RCN doit correspondre à la longueur du format";
|
|
20
|
-
readonly invalidVariableMeasureRCNFormat: "Format RCN de mesure variable non valide";
|
|
21
|
-
readonly invalidVariableMeasureRCNPrefix: "Préfixe RCN de mesure variable non valide";
|
|
22
|
-
readonly invalidVariableMeasurePriceOrWeight: "Mesure variable invalide : prix ou poids";
|
|
23
|
-
readonly indicatorDigit: "chiffre indicateur";
|
|
24
|
-
readonly serialComponent: "composant série";
|
|
25
|
-
readonly reference: "référence";
|
|
26
|
-
readonly referenceCantBeAllNumeric: "La référence ne peut pas être entièrement numérique";
|
|
27
|
-
readonly invalidCheckCharacterPair: "Paire de caractères de contrôle non valide";
|
|
28
|
-
};
|
|
29
|
-
readonly Prefix: {
|
|
30
|
-
readonly gs1CompanyPrefix: "Préfixe de l'entreprise GS1";
|
|
31
|
-
readonly upcCompanyPrefix: "Préfixe de l'entreprise U.P.C.";
|
|
32
|
-
readonly gs18Prefix: "Préfixe GS1-8";
|
|
33
|
-
readonly invalidPrefixType: "Type de préfixe invalide";
|
|
34
|
-
readonly gs1CompanyPrefixCantStartWith0: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"0\"";
|
|
35
|
-
readonly gs1CompanyPrefixCantStartWith00000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"00000\"";
|
|
36
|
-
readonly gs1CompanyPrefixCantStartWith000000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"000000\"";
|
|
37
|
-
readonly upcCompanyPrefixCantStartWith0000: "Le préfixe de l'entreprise U.P.C. ne peut pas commencer par \"0000\"";
|
|
38
|
-
readonly gs18PrefixCantStartWith0: "Le préfixe GS1-8 ne peut pas commencer par \"0\"";
|
|
39
|
-
readonly identifierTypeNotSupportedByGS18Prefix: "{{identifierType}} non pris en charge par le préfixe GS1-8";
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
export default _default;
|
|
43
|
-
//# sourceMappingURL=locale-resources.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-resources.d.ts","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAwCW"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
Check: {
|
|
3
|
-
lengthOfStringForPriceOrWeightMustBeExactly: "La longueur {{length, number}} de la chaîne pour le prix ou le poids doit être 4 ou 5",
|
|
4
|
-
priceOrWeightComponent: "prix ou poids",
|
|
5
|
-
lengthOfStringForCheckCharacterPairMustBeLessThanOrEqualTo: "La longueur {{length, number}} de la chaîne pour la paire de caractères de vérification doit être inférieure ou égale à {{maximumLength, number}}"
|
|
6
|
-
},
|
|
7
|
-
Identifier: {
|
|
8
|
-
identifierTypeLength: "{{identifierType}} doit comporter {{length, number}} chiffres",
|
|
9
|
-
invalidCheckDigit: "Chiffre de contrôle non valide",
|
|
10
|
-
invalidGTINLength: "Le GTIN doit comporter 13, 12, 8 ou 14 chiffres",
|
|
11
|
-
invalidGTIN14Length: "Le GTIN doit comporter 14 chiffres",
|
|
12
|
-
invalidZeroSuppressedGTIN12: "Code GTIN-12 non valide avec zéro supprimé",
|
|
13
|
-
invalidZeroSuppressibleGTIN12: "Le GTIN-12 ne peut pas être supprimé par zéro",
|
|
14
|
-
invalidZeroSuppressedGTIN12AsGTIN13: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-13",
|
|
15
|
-
invalidZeroSuppressedGTIN12AsGTIN14: "GTIN-12 non valide avec zéro supprimé en tant que GTIN-14",
|
|
16
|
-
invalidGTIN13AtRetail: "Le GTIN-13 au niveau des articles de consommation au détail ne peut pas commencer par zéro",
|
|
17
|
-
invalidGTINAtRetail: "Le GTIN n'est pas pris en charge au niveau des articles de consommation au détail",
|
|
18
|
-
invalidGTINAtOtherThanRetail: "Le GTIN n'est pas pris en charge à d'autres niveaux que ceux des articles de consommation au détail",
|
|
19
|
-
invalidRCNLength: "La longueur du RCN doit correspondre à la longueur du format",
|
|
20
|
-
invalidVariableMeasureRCNFormat: "Format RCN de mesure variable non valide",
|
|
21
|
-
invalidVariableMeasureRCNPrefix: "Préfixe RCN de mesure variable non valide",
|
|
22
|
-
invalidVariableMeasurePriceOrWeight: "Mesure variable invalide : prix ou poids",
|
|
23
|
-
indicatorDigit: "chiffre indicateur",
|
|
24
|
-
serialComponent: "composant série",
|
|
25
|
-
reference: "référence",
|
|
26
|
-
referenceCantBeAllNumeric: "La référence ne peut pas être entièrement numérique",
|
|
27
|
-
invalidCheckCharacterPair: "Paire de caractères de contrôle non valide"
|
|
28
|
-
},
|
|
29
|
-
Prefix: {
|
|
30
|
-
gs1CompanyPrefix: "Préfixe de l'entreprise GS1",
|
|
31
|
-
upcCompanyPrefix: "Préfixe de l'entreprise U.P.C.",
|
|
32
|
-
gs18Prefix: "Préfixe GS1-8",
|
|
33
|
-
invalidPrefixType: "Type de préfixe invalide",
|
|
34
|
-
gs1CompanyPrefixCantStartWith0: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"0\"",
|
|
35
|
-
gs1CompanyPrefixCantStartWith00000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"00000\"",
|
|
36
|
-
gs1CompanyPrefixCantStartWith000000: "Le préfixe de l'entreprise GS1 ne peut pas commencer par \"000000\"",
|
|
37
|
-
upcCompanyPrefixCantStartWith0000: "Le préfixe de l'entreprise U.P.C. ne peut pas commencer par \"0000\"",
|
|
38
|
-
gs18PrefixCantStartWith0: "Le préfixe GS1-8 ne peut pas commencer par \"0\"",
|
|
39
|
-
identifierTypeNotSupportedByGS18Prefix: "{{identifierType}} non pris en charge par le préfixe GS1-8"
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=locale-resources.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-resources.js","sourceRoot":"","sources":["../../../src/locale/fr/locale-resources.ts"],"names":[],"mappings":"AAAA,eAAe;IACX,KAAK,EAAE;QACH,2CAA2C,EAAE,uFAAuF;QACpI,sBAAsB,EAAE,eAAe;QACvC,0DAA0D,EAAE,mJAAmJ;KAClN;IACD,UAAU,EAAE;QACR,oBAAoB,EAAE,+DAA+D;QACrF,iBAAiB,EAAE,gCAAgC;QACnD,iBAAiB,EAAE,iDAAiD;QACpE,mBAAmB,EAAE,oCAAoC;QACzD,2BAA2B,EAAE,4CAA4C;QACzE,6BAA6B,EAAE,+CAA+C;QAC9E,mCAAmC,EAAE,2DAA2D;QAChG,mCAAmC,EAAE,2DAA2D;QAChG,qBAAqB,EAAE,4FAA4F;QACnH,mBAAmB,EAAE,mFAAmF;QACxG,4BAA4B,EAAE,qGAAqG;QACnI,gBAAgB,EAAE,8DAA8D;QAChF,+BAA+B,EAAE,0CAA0C;QAC3E,+BAA+B,EAAE,2CAA2C;QAC5E,mCAAmC,EAAE,0CAA0C;QAC/E,cAAc,EAAE,oBAAoB;QACpC,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,WAAW;QACtB,yBAAyB,EAAE,qDAAqD;QAChF,yBAAyB,EAAE,4CAA4C;KAC1E;IACD,MAAM,EAAE;QACJ,gBAAgB,EAAE,6BAA6B;QAC/C,gBAAgB,EAAE,gCAAgC;QAClD,UAAU,EAAE,eAAe;QAC3B,iBAAiB,EAAE,0BAA0B;QAC7C,8BAA8B,EAAE,gEAAgE;QAChG,kCAAkC,EAAE,oEAAoE;QACxG,mCAAmC,EAAE,qEAAqE;QAC1G,iCAAiC,EAAE,sEAAsE;QACzG,wBAAwB,EAAE,kDAAkD;QAC5E,sCAAsC,EAAE,4DAA4D;KACvG;CACK,CAAC"}
|
package/dist/locale/i18n.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { type I18nEnvironment } from "@aidc-toolkit/core";
|
|
2
|
-
import { type i18n, type Resource } from "i18next";
|
|
3
|
-
import enLocaleResources from "./en/locale-resources.js";
|
|
4
|
-
export declare const gs1NS = "aidct_gs1";
|
|
5
|
-
/**
|
|
6
|
-
* Locale strings type is extracted from the English locale strings object.
|
|
7
|
-
*/
|
|
8
|
-
export type GS1LocaleResources = typeof enLocaleResources;
|
|
9
|
-
/**
|
|
10
|
-
* GS1 resources.
|
|
11
|
-
*/
|
|
12
|
-
export declare const gs1Resources: Resource;
|
|
13
|
-
export declare const i18nextGS1: i18n;
|
|
14
|
-
/**
|
|
15
|
-
* Initialize internationalization.
|
|
16
|
-
*
|
|
17
|
-
* @param environment
|
|
18
|
-
* Environment in which the application is running.
|
|
19
|
-
*
|
|
20
|
-
* @param debug
|
|
21
|
-
* Debug setting.
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
24
|
-
* Void promise.
|
|
25
|
-
*/
|
|
26
|
-
export declare function i18nGS1Init(environment: I18nEnvironment, debug?: boolean): Promise<void>;
|
|
27
|
-
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAElG,OAAgB,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAGzD,eAAO,MAAM,KAAK,cAAc,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,iBAAiB,CAAC;AAI1D;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,QAO1B,CAAC;AAGF,eAAO,MAAM,UAAU,EAAE,IAA+B,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAAC,WAAW,EAAE,eAAe,EAAE,KAAK,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAG5F"}
|
package/dist/locale/i18n.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { i18nAssertValidResources, i18nCoreInit } from "@aidc-toolkit/core";
|
|
2
|
-
import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
|
|
3
|
-
import i18next from "i18next";
|
|
4
|
-
import enLocaleResources from "./en/locale-resources.js";
|
|
5
|
-
import frLocaleResources from "./fr/locale-resources.js";
|
|
6
|
-
export const gs1NS = "aidct_gs1";
|
|
7
|
-
i18nAssertValidResources(enLocaleResources, "fr", frLocaleResources);
|
|
8
|
-
/**
|
|
9
|
-
* GS1 resources.
|
|
10
|
-
*/
|
|
11
|
-
export const gs1Resources = {
|
|
12
|
-
en: {
|
|
13
|
-
aidct_gs1: enLocaleResources
|
|
14
|
-
},
|
|
15
|
-
fr: {
|
|
16
|
-
aidct_gs1: frLocaleResources
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
// Explicit type is necessary to work around bug in type discovery with linked packages.
|
|
20
|
-
export const i18nextGS1 = i18next.createInstance();
|
|
21
|
-
/**
|
|
22
|
-
* Initialize internationalization.
|
|
23
|
-
*
|
|
24
|
-
* @param environment
|
|
25
|
-
* Environment in which the application is running.
|
|
26
|
-
*
|
|
27
|
-
* @param debug
|
|
28
|
-
* Debug setting.
|
|
29
|
-
*
|
|
30
|
-
* @returns
|
|
31
|
-
* Void promise.
|
|
32
|
-
*/
|
|
33
|
-
export async function i18nGS1Init(environment, debug = false) {
|
|
34
|
-
await i18nUtilityInit(environment, debug);
|
|
35
|
-
await i18nCoreInit(i18nextGS1, environment, debug, gs1NS, utilityResources, gs1Resources);
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=i18n.js.map
|
package/dist/locale/i18n.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../src/locale/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAwB,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,OAAqC,MAAM,SAAS,CAAC;AAC5D,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AACzD,OAAO,iBAAiB,MAAM,0BAA0B,CAAC;AAEzD,MAAM,CAAC,MAAM,KAAK,GAAG,WAAW,CAAC;AAOjC,wBAAwB,CAAC,iBAAiB,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAa;IAClC,EAAE,EAAE;QACA,SAAS,EAAE,iBAAiB;KAC/B;IACD,EAAE,EAAE;QACA,SAAS,EAAE,iBAAiB;KAC/B;CACJ,CAAC;AAEF,wFAAwF;AACxF,MAAM,CAAC,MAAM,UAAU,GAAS,OAAO,CAAC,cAAc,EAAE,CAAC;AAEzD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAA4B,EAAE,KAAK,GAAG,KAAK;IACzE,MAAM,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,YAAY,CAAC,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { IdentifierType } from "./identifier-type.js";
|
|
2
|
-
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
3
|
-
import { AbstractNumericIdentifierCreator } from "./numeric-identifier-creator.js";
|
|
4
|
-
import { type LeaderType } from "./numeric-identifier-validator.js";
|
|
5
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
6
|
-
declare const NonGTINNumericIdentifierCreator_base: import("ts-mixer/dist/types/types.js").Class<any[], NonGTINNumericIdentifierValidator & AbstractNumericIdentifierCreator, typeof NonGTINNumericIdentifierValidator & typeof AbstractNumericIdentifierCreator>;
|
|
7
|
-
/**
|
|
8
|
-
* Non-GTIN numeric identifier creator.
|
|
9
|
-
*/
|
|
10
|
-
export declare class NonGTINNumericIdentifierCreator extends NonGTINNumericIdentifierCreator_base {
|
|
11
|
-
/**
|
|
12
|
-
* Constructor. Typically called internally by a prefix manager but may be called by other code with another prefix
|
|
13
|
-
* provider type.
|
|
14
|
-
*
|
|
15
|
-
* @param prefixProvider
|
|
16
|
-
* Prefix provider.
|
|
17
|
-
*
|
|
18
|
-
* @param identifierType
|
|
19
|
-
* Identifier type.
|
|
20
|
-
*
|
|
21
|
-
* @param length
|
|
22
|
-
* Length.
|
|
23
|
-
*
|
|
24
|
-
* @param leaderType
|
|
25
|
-
* Leader type.
|
|
26
|
-
*/
|
|
27
|
-
constructor(prefixProvider: PrefixProvider, identifierType: IdentifierType, length: number, leaderType?: LeaderType);
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=non-gtin-numeric-identifier-creator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-gtin-numeric-identifier-creator.d.ts","sourceRoot":"","sources":["../src/non-gtin-numeric-identifier-creator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAExD;;GAEG;AACH,qBAAa,+BAAgC,SAAQ,oCAA0E;IAC3H;;;;;;;;;;;;;;;OAeG;gBACS,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,UAA6B;CAKxI"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Mixin } from "ts-mixer";
|
|
2
|
-
import { NonGTINNumericIdentifierValidator } from "./non-gtin-numeric-identifier-validator.js";
|
|
3
|
-
import { AbstractNumericIdentifierCreator } from "./numeric-identifier-creator.js";
|
|
4
|
-
import { LeaderTypes } from "./numeric-identifier-validator.js";
|
|
5
|
-
/**
|
|
6
|
-
* Non-GTIN numeric identifier creator.
|
|
7
|
-
*/
|
|
8
|
-
export class NonGTINNumericIdentifierCreator extends Mixin(NonGTINNumericIdentifierValidator, AbstractNumericIdentifierCreator) {
|
|
9
|
-
/**
|
|
10
|
-
* Constructor. Typically called internally by a prefix manager but may be called by other code with another prefix
|
|
11
|
-
* provider type.
|
|
12
|
-
*
|
|
13
|
-
* @param prefixProvider
|
|
14
|
-
* Prefix provider.
|
|
15
|
-
*
|
|
16
|
-
* @param identifierType
|
|
17
|
-
* Identifier type.
|
|
18
|
-
*
|
|
19
|
-
* @param length
|
|
20
|
-
* Length.
|
|
21
|
-
*
|
|
22
|
-
* @param leaderType
|
|
23
|
-
* Leader type.
|
|
24
|
-
*/
|
|
25
|
-
constructor(prefixProvider, identifierType, length, leaderType = LeaderTypes.None) {
|
|
26
|
-
super(identifierType, length, leaderType);
|
|
27
|
-
this.init(prefixProvider, prefixProvider.gs1CompanyPrefix);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=non-gtin-numeric-identifier-creator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-gtin-numeric-identifier-creator.js","sourceRoot":"","sources":["../src/non-gtin-numeric-identifier-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,EAAE,gCAAgC,EAAE,MAAM,iCAAiC,CAAC;AACnF,OAAO,EAAmB,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGjF;;GAEG;AACH,MAAM,OAAO,+BAAgC,SAAQ,KAAK,CAAC,iCAAiC,EAAE,gCAAgC,CAAC;IAC3H;;;;;;;;;;;;;;;OAeG;IACH,YAAY,cAA8B,EAAE,cAA8B,EAAE,MAAc,EAAE,aAAyB,WAAW,CAAC,IAAI;QACjI,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAE1C,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC/D,CAAC;CACJ"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { type IdentifierType, IdentifierTypes } from "./identifier-type.js";
|
|
2
|
-
import { AbstractNumericIdentifierValidator, type LeaderType, type NumericIdentifierType } from "./numeric-identifier-validator.js";
|
|
3
|
-
/**
|
|
4
|
-
* Non-GTIN numeric identifier type.
|
|
5
|
-
*/
|
|
6
|
-
export type NonGTINNumericIdentifierType = Exclude<NumericIdentifierType, typeof IdentifierTypes.GTIN>;
|
|
7
|
-
/**
|
|
8
|
-
* Non-GTIN numeric identifier validator.
|
|
9
|
-
*/
|
|
10
|
-
export declare class NonGTINNumericIdentifierValidator extends AbstractNumericIdentifierValidator {
|
|
11
|
-
/**
|
|
12
|
-
* Constructor.
|
|
13
|
-
*
|
|
14
|
-
* @param identifierType
|
|
15
|
-
* Identifier type.
|
|
16
|
-
*
|
|
17
|
-
* @param length
|
|
18
|
-
* Length.
|
|
19
|
-
*
|
|
20
|
-
* @param leaderType
|
|
21
|
-
* Leader type.
|
|
22
|
-
*/
|
|
23
|
-
constructor(identifierType: IdentifierType, length: number, leaderType?: LeaderType);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* GLN validator.
|
|
27
|
-
*/
|
|
28
|
-
export declare const GLN_VALIDATOR: NonGTINNumericIdentifierValidator;
|
|
29
|
-
/**
|
|
30
|
-
* SSCC validator.
|
|
31
|
-
*/
|
|
32
|
-
export declare const SSCC_VALIDATOR: NonGTINNumericIdentifierValidator;
|
|
33
|
-
/**
|
|
34
|
-
* GSRN validator.
|
|
35
|
-
*/
|
|
36
|
-
export declare const GSRN_VALIDATOR: NonGTINNumericIdentifierValidator;
|
|
37
|
-
/**
|
|
38
|
-
* GSIN validator.
|
|
39
|
-
*/
|
|
40
|
-
export declare const GSIN_VALIDATOR: NonGTINNumericIdentifierValidator;
|
|
41
|
-
//# sourceMappingURL=non-gtin-numeric-identifier-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-gtin-numeric-identifier-validator.d.ts","sourceRoot":"","sources":["../src/non-gtin-numeric-identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACH,kCAAkC,EAClC,KAAK,UAAU,EAEf,KAAK,qBAAqB,EAC7B,MAAM,mCAAmC,CAAC;AAG3C;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,qBAAqB,EAAE,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;AAEvG;;GAEG;AACH,qBAAa,iCAAkC,SAAQ,kCAAkC;IACrF;;;;;;;;;;;OAWG;gBACS,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAE,UAA6B;CAGxG;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,mCAAiE,CAAC;AAE5F;;GAEG;AACH,eAAO,MAAM,cAAc,mCAA8F,CAAC;AAE1H;;GAEG;AACH,eAAO,MAAM,cAAc,mCAAkE,CAAC;AAE9F;;GAEG;AACH,eAAO,MAAM,cAAc,mCAAkE,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { IdentifierTypes } from "./identifier-type.js";
|
|
2
|
-
import { AbstractNumericIdentifierValidator, LeaderTypes } from "./numeric-identifier-validator.js";
|
|
3
|
-
import { PrefixTypes } from "./prefix-type.js";
|
|
4
|
-
/**
|
|
5
|
-
* Non-GTIN numeric identifier validator.
|
|
6
|
-
*/
|
|
7
|
-
export class NonGTINNumericIdentifierValidator extends AbstractNumericIdentifierValidator {
|
|
8
|
-
/**
|
|
9
|
-
* Constructor.
|
|
10
|
-
*
|
|
11
|
-
* @param identifierType
|
|
12
|
-
* Identifier type.
|
|
13
|
-
*
|
|
14
|
-
* @param length
|
|
15
|
-
* Length.
|
|
16
|
-
*
|
|
17
|
-
* @param leaderType
|
|
18
|
-
* Leader type.
|
|
19
|
-
*/
|
|
20
|
-
constructor(identifierType, length, leaderType = LeaderTypes.None) {
|
|
21
|
-
super(identifierType, PrefixTypes.GS1CompanyPrefix, length, leaderType);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* GLN validator.
|
|
26
|
-
*/
|
|
27
|
-
export const GLN_VALIDATOR = new NonGTINNumericIdentifierValidator(IdentifierTypes.GLN, 13);
|
|
28
|
-
/**
|
|
29
|
-
* SSCC validator.
|
|
30
|
-
*/
|
|
31
|
-
export const SSCC_VALIDATOR = new NonGTINNumericIdentifierValidator(IdentifierTypes.SSCC, 18, LeaderTypes.ExtensionDigit);
|
|
32
|
-
/**
|
|
33
|
-
* GSRN validator.
|
|
34
|
-
*/
|
|
35
|
-
export const GSRN_VALIDATOR = new NonGTINNumericIdentifierValidator(IdentifierTypes.GSRN, 18);
|
|
36
|
-
/**
|
|
37
|
-
* GSIN validator.
|
|
38
|
-
*/
|
|
39
|
-
export const GSIN_VALIDATOR = new NonGTINNumericIdentifierValidator(IdentifierTypes.GSIN, 17);
|
|
40
|
-
//# sourceMappingURL=non-gtin-numeric-identifier-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-gtin-numeric-identifier-validator.js","sourceRoot":"","sources":["../src/non-gtin-numeric-identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACH,kCAAkC,EAElC,WAAW,EAEd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAO/C;;GAEG;AACH,MAAM,OAAO,iCAAkC,SAAQ,kCAAkC;IACrF;;;;;;;;;;;OAWG;IACH,YAAY,cAA8B,EAAE,MAAc,EAAE,aAAyB,WAAW,CAAC,IAAI;QACjG,KAAK,CAAC,cAAc,EAAE,WAAW,CAAC,gBAAgB,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC5E,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,iCAAiC,CAAC,eAAe,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAE5F;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iCAAiC,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;AAE1H;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iCAAiC,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAE9F;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,IAAI,iCAAiC,CAAC,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { type CharacterSetValidation, type TransformerInput, type TransformerOutput } from "@aidc-toolkit/utility";
|
|
2
|
-
import { AbstractIdentifierCreator } from "./identifier-creator.js";
|
|
3
|
-
import type { IdentifierType } from "./identifier-type.js";
|
|
4
|
-
import type { ContentCharacterSet } from "./identifier-validator.js";
|
|
5
|
-
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
6
|
-
import type { PrefixProvider } from "./prefix-provider";
|
|
7
|
-
declare const NonNumericIdentifierCreator_base: import("ts-mixer/dist/types/types.js").Class<any[], NonNumericIdentifierValidator & AbstractIdentifierCreator, typeof NonNumericIdentifierValidator & typeof AbstractIdentifierCreator>;
|
|
8
|
-
/**
|
|
9
|
-
* Non-numeric identifier creator.
|
|
10
|
-
*/
|
|
11
|
-
export declare class NonNumericIdentifierCreator extends NonNumericIdentifierCreator_base {
|
|
12
|
-
/**
|
|
13
|
-
* Reference validation parameters.
|
|
14
|
-
*/
|
|
15
|
-
private readonly _referenceValidation;
|
|
16
|
-
/**
|
|
17
|
-
* Constructor. Typically called internally by a prefix manager but may be called by other code with another prefix
|
|
18
|
-
* provider type.
|
|
19
|
-
*
|
|
20
|
-
* @param prefixProvider
|
|
21
|
-
* Prefix provider.
|
|
22
|
-
*
|
|
23
|
-
* @param identifierType
|
|
24
|
-
* Identifier type.
|
|
25
|
-
*
|
|
26
|
-
* @param length
|
|
27
|
-
* Length.
|
|
28
|
-
*
|
|
29
|
-
* @param referenceCharacterSet
|
|
30
|
-
* Reference character set.
|
|
31
|
-
*
|
|
32
|
-
* @param requiresCheckCharacterPair
|
|
33
|
-
* True if the identifier requires a check character pair.
|
|
34
|
-
*/
|
|
35
|
-
constructor(prefixProvider: PrefixProvider, identifierType: IdentifierType, length: number, referenceCharacterSet: ContentCharacterSet, requiresCheckCharacterPair?: boolean);
|
|
36
|
-
/**
|
|
37
|
-
* Get the reference validation parameters.
|
|
38
|
-
*/
|
|
39
|
-
protected get referenceValidation(): CharacterSetValidation;
|
|
40
|
-
/**
|
|
41
|
-
* Create identifier(s) with reference(s).
|
|
42
|
-
*
|
|
43
|
-
* @template TTransformerInput
|
|
44
|
-
* Transformer input type.
|
|
45
|
-
*
|
|
46
|
-
* @param referenceOrReferences
|
|
47
|
-
* Reference(s).
|
|
48
|
-
*
|
|
49
|
-
* @returns
|
|
50
|
-
* Identifier(s).
|
|
51
|
-
*/
|
|
52
|
-
create<TTransformerInput extends TransformerInput<string>>(referenceOrReferences: TTransformerInput): TransformerOutput<TTransformerInput, string>;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
|
55
|
-
//# sourceMappingURL=non-numeric-identifier-creator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-numeric-identifier-creator.d.ts","sourceRoot":"","sources":["../src/non-numeric-identifier-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACzB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AACtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;;AAExD;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,gCAA+D;IAC5G;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAyB;IAE9D;;;;;;;;;;;;;;;;;;OAkBG;gBACS,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,0BAA0B,UAAQ;IAa1K;;OAEG;IACH,SAAS,KAAK,mBAAmB,IAAI,sBAAsB,CAE1D;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,iBAAiB,SAAS,gBAAgB,CAAC,MAAM,CAAC,EAAE,qBAAqB,EAAE,iBAAiB,GAAG,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,CAAC;CAmCrJ"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { mapIterable } from "@aidc-toolkit/utility";
|
|
2
|
-
import { Mixin } from "ts-mixer";
|
|
3
|
-
import { checkCharacterPair } from "./check.js";
|
|
4
|
-
import { AbstractIdentifierCreator } from "./identifier-creator.js";
|
|
5
|
-
import { i18nextGS1 } from "./locale/i18n.js";
|
|
6
|
-
import { NonNumericIdentifierValidator } from "./non-numeric-identifier-validator.js";
|
|
7
|
-
/**
|
|
8
|
-
* Non-numeric identifier creator.
|
|
9
|
-
*/
|
|
10
|
-
export class NonNumericIdentifierCreator extends Mixin(NonNumericIdentifierValidator, AbstractIdentifierCreator) {
|
|
11
|
-
/**
|
|
12
|
-
* Reference validation parameters.
|
|
13
|
-
*/
|
|
14
|
-
_referenceValidation;
|
|
15
|
-
/**
|
|
16
|
-
* Constructor. Typically called internally by a prefix manager but may be called by other code with another prefix
|
|
17
|
-
* provider type.
|
|
18
|
-
*
|
|
19
|
-
* @param prefixProvider
|
|
20
|
-
* Prefix provider.
|
|
21
|
-
*
|
|
22
|
-
* @param identifierType
|
|
23
|
-
* Identifier type.
|
|
24
|
-
*
|
|
25
|
-
* @param length
|
|
26
|
-
* Length.
|
|
27
|
-
*
|
|
28
|
-
* @param referenceCharacterSet
|
|
29
|
-
* Reference character set.
|
|
30
|
-
*
|
|
31
|
-
* @param requiresCheckCharacterPair
|
|
32
|
-
* True if the identifier requires a check character pair.
|
|
33
|
-
*/
|
|
34
|
-
constructor(prefixProvider, identifierType, length, referenceCharacterSet, requiresCheckCharacterPair = false) {
|
|
35
|
-
super(identifierType, length, referenceCharacterSet, requiresCheckCharacterPair);
|
|
36
|
-
this.init(prefixProvider, prefixProvider.gs1CompanyPrefix, 2 * Number(requiresCheckCharacterPair));
|
|
37
|
-
this._referenceValidation = {
|
|
38
|
-
minimumLength: 1,
|
|
39
|
-
// Maximum reference length has to account for prefix and check character pair.
|
|
40
|
-
maximumLength: this.referenceLength,
|
|
41
|
-
component: () => i18nextGS1.t("Identifier.reference")
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Get the reference validation parameters.
|
|
46
|
-
*/
|
|
47
|
-
get referenceValidation() {
|
|
48
|
-
return this._referenceValidation;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Create identifier(s) with reference(s).
|
|
52
|
-
*
|
|
53
|
-
* @template TTransformerInput
|
|
54
|
-
* Transformer input type.
|
|
55
|
-
*
|
|
56
|
-
* @param referenceOrReferences
|
|
57
|
-
* Reference(s).
|
|
58
|
-
*
|
|
59
|
-
* @returns
|
|
60
|
-
* Identifier(s).
|
|
61
|
-
*/
|
|
62
|
-
create(referenceOrReferences) {
|
|
63
|
-
// TODO Refactor type when https://github.com/microsoft/TypeScript/pull/56941 released.
|
|
64
|
-
let result;
|
|
65
|
-
const referenceCreator = this.referenceCreator;
|
|
66
|
-
const referenceValidation = this.referenceValidation;
|
|
67
|
-
const prefix = this.prefix;
|
|
68
|
-
const requiresCheckCharacterPair = this.requiresCheckCharacterPair;
|
|
69
|
-
/**
|
|
70
|
-
* Validate a reference and create an identifier.
|
|
71
|
-
*
|
|
72
|
-
* @param reference
|
|
73
|
-
* Reference.
|
|
74
|
-
*
|
|
75
|
-
* @returns
|
|
76
|
-
* Identifier.
|
|
77
|
-
*/
|
|
78
|
-
function validateAndCreate(reference) {
|
|
79
|
-
referenceCreator.validate(reference, referenceValidation);
|
|
80
|
-
const partialIdentifier = prefix + reference;
|
|
81
|
-
return requiresCheckCharacterPair ? partialIdentifier + checkCharacterPair(partialIdentifier) : partialIdentifier;
|
|
82
|
-
}
|
|
83
|
-
if (typeof referenceOrReferences !== "object") {
|
|
84
|
-
result = validateAndCreate(referenceOrReferences);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
result = mapIterable(referenceOrReferences, validateAndCreate);
|
|
88
|
-
}
|
|
89
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type determination is handled above.
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=non-numeric-identifier-creator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-numeric-identifier-creator.js","sourceRoot":"","sources":["../src/non-numeric-identifier-creator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,WAAW,EAGd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAGpE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,6BAA6B,EAAE,MAAM,uCAAuC,CAAC;AAGtF;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK,CAAC,6BAA6B,EAAE,yBAAyB,CAAC;IAC5G;;OAEG;IACc,oBAAoB,CAAyB;IAE9D;;;;;;;;;;;;;;;;;;OAkBG;IACH,YAAY,cAA8B,EAAE,cAA8B,EAAE,MAAc,EAAE,qBAA0C,EAAE,0BAA0B,GAAG,KAAK;QACtK,KAAK,CAAC,cAAc,EAAE,MAAM,EAAE,qBAAqB,EAAE,0BAA0B,CAAC,CAAC;QAEjF,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,gBAAgB,EAAE,CAAC,GAAG,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;QAEnG,IAAI,CAAC,oBAAoB,GAAG;YACxB,aAAa,EAAE,CAAC;YAChB,+EAA+E;YAC/E,aAAa,EAAE,IAAI,CAAC,eAAe;YACnC,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,sBAAsB,CAAC;SACxD,CAAC;IACN,CAAC;IAED;;OAEG;IACH,IAAc,mBAAmB;QAC7B,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAqD,qBAAwC;QAC/F,uFAAuF;QACvF,IAAI,MAAiC,CAAC;QAEtC,MAAM,gBAAgB,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC/C,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,CAAC;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3B,MAAM,0BAA0B,GAAG,IAAI,CAAC,0BAA0B,CAAC;QAEnE;;;;;;;;WAQG;QACH,SAAS,iBAAiB,CAAC,SAAiB;YACxC,gBAAgB,CAAC,QAAQ,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC;YAE1D,MAAM,iBAAiB,GAAG,MAAM,GAAG,SAAS,CAAC;YAE7C,OAAO,0BAA0B,CAAC,CAAC,CAAC,iBAAiB,GAAG,kBAAkB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC;QACtH,CAAC;QAED,IAAI,OAAO,qBAAqB,KAAK,QAAQ,EAAE,CAAC;YAC5C,MAAM,GAAG,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;QACtD,CAAC;aAAM,CAAC;YACJ,MAAM,GAAG,WAAW,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;QACnE,CAAC;QAED,+GAA+G;QAC/G,OAAO,MAAsD,CAAC;IAClE,CAAC;CACJ"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Exclusions } from "@aidc-toolkit/utility";
|
|
2
|
-
import { type IdentifierType } from "./identifier-type.js";
|
|
3
|
-
import { AbstractIdentifierValidator, type ContentCharacterSet, type IdentifierValidation } from "./identifier-validator.js";
|
|
4
|
-
import type { NumericIdentifierType } from "./numeric-identifier-validator.js";
|
|
5
|
-
/**
|
|
6
|
-
* Non-numeric identifier type.
|
|
7
|
-
*/
|
|
8
|
-
export type NonNumericIdentifierType = Exclude<IdentifierType, NumericIdentifierType>;
|
|
9
|
-
/**
|
|
10
|
-
* Non-numeric identifier validation parameters.
|
|
11
|
-
*/
|
|
12
|
-
export interface NonNumericIdentifierValidation extends IdentifierValidation {
|
|
13
|
-
/**
|
|
14
|
-
* Exclusion support for reference. Prevents non-numeric identifier from being mistaken for numeric
|
|
15
|
-
* identifier.
|
|
16
|
-
*/
|
|
17
|
-
exclusion?: typeof Exclusions.None | typeof Exclusions.AllNumeric | undefined;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Non-numeric identifier validator.
|
|
21
|
-
*/
|
|
22
|
-
export declare class NonNumericIdentifierValidator extends AbstractIdentifierValidator<NonNumericIdentifierValidation> {
|
|
23
|
-
/**
|
|
24
|
-
* Validator to ensure that an identifier (minus check character pair) is not all numeric.
|
|
25
|
-
*/
|
|
26
|
-
private static readonly NOT_ALL_NUMERIC_VALIDATOR;
|
|
27
|
-
/**
|
|
28
|
-
* True if the identifier requires a check character pair.
|
|
29
|
-
*/
|
|
30
|
-
private readonly _requiresCheckCharacterPair;
|
|
31
|
-
/**
|
|
32
|
-
* Constructor.
|
|
33
|
-
*
|
|
34
|
-
* @param identifierType
|
|
35
|
-
* Identifier type.
|
|
36
|
-
*
|
|
37
|
-
* @param length
|
|
38
|
-
* Length.
|
|
39
|
-
*
|
|
40
|
-
* @param referenceCharacterSet
|
|
41
|
-
* Reference character set.
|
|
42
|
-
*
|
|
43
|
-
* @param requiresCheckCharacterPair
|
|
44
|
-
* True if the identifier requires a check character pair.
|
|
45
|
-
*/
|
|
46
|
-
constructor(identifierType: IdentifierType, length: number, referenceCharacterSet: ContentCharacterSet, requiresCheckCharacterPair?: boolean);
|
|
47
|
-
/**
|
|
48
|
-
* Determine if the identifier requires a check character pair.
|
|
49
|
-
*/
|
|
50
|
-
get requiresCheckCharacterPair(): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Validate a non-numeric identifier and throw an error if validation fails.
|
|
53
|
-
*
|
|
54
|
-
* @param identifier
|
|
55
|
-
* Identifier.
|
|
56
|
-
*
|
|
57
|
-
* @param validation
|
|
58
|
-
* Validation parameters.
|
|
59
|
-
*/
|
|
60
|
-
validate(identifier: string, validation?: NonNumericIdentifierValidation): void;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* GIAI validator.
|
|
64
|
-
*/
|
|
65
|
-
export declare const GIAI_VALIDATOR: NonNumericIdentifierValidator;
|
|
66
|
-
/**
|
|
67
|
-
* GINC validator.
|
|
68
|
-
*/
|
|
69
|
-
export declare const GINC_VALIDATOR: NonNumericIdentifierValidator;
|
|
70
|
-
/**
|
|
71
|
-
* CPID validator.
|
|
72
|
-
*/
|
|
73
|
-
export declare const CPID_VALIDATOR: NonNumericIdentifierValidator;
|
|
74
|
-
/**
|
|
75
|
-
* GMN validator.
|
|
76
|
-
*/
|
|
77
|
-
export declare const GMN_VALIDATOR: NonNumericIdentifierValidator;
|
|
78
|
-
//# sourceMappingURL=non-numeric-identifier-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"non-numeric-identifier-validator.d.ts","sourceRoot":"","sources":["../src/non-numeric-identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,uBAAuB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAmB,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EACH,2BAA2B,EAC3B,KAAK,mBAAmB,EAExB,KAAK,oBAAoB,EAC5B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG/E;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,oBAAoB;IACxE;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,UAAU,CAAC,IAAI,GAAG,OAAO,UAAU,CAAC,UAAU,GAAG,SAAS,CAAC;CACjF;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,2BAA2B,CAAC,8BAA8B,CAAC;IAC1G;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAOzC;IAER;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,2BAA2B,CAAU;IAEtD;;;;;;;;;;;;;;OAcG;gBACS,cAAc,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,0BAA0B,UAAQ;IAM1I;;OAEG;IACH,IAAI,0BAA0B,IAAI,OAAO,CAExC;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,8BAA8B,GAAG,IAAI;CAoBlF;AAED;;GAEG;AACH,eAAO,MAAM,cAAc,+BAAyF,CAAC;AAErH;;GAEG;AACH,eAAO,MAAM,cAAc,+BAAyF,CAAC;AAErH;;GAEG;AACH,eAAO,MAAM,cAAc,+BAAyF,CAAC;AAErH;;GAEG;AACH,eAAO,MAAM,aAAa,+BAA8F,CAAC"}
|