@aidc-toolkit/gs1 1.0.22-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/en/{locale-strings.ts → locale-resources.ts} +1 -1
- package/src/locale/fr/{locale-strings.ts → locale-resources.ts} +2 -2
- package/src/locale/i18n.ts +6 -8
- package/src/locale/i18next.d.ts +4 -4
- 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 +36 -35
- 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-strings.d.ts +0 -42
- package/dist/locale/en/locale-strings.d.ts.map +0 -1
- package/dist/locale/en/locale-strings.js +0 -42
- package/dist/locale/en/locale-strings.js.map +0 -1
- package/dist/locale/fr/locale-strings.d.ts +0 -42
- package/dist/locale/fr/locale-strings.d.ts.map +0 -1
- package/dist/locale/fr/locale-strings.js +0 -42
- package/dist/locale/fr/locale-strings.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-type.d.ts","sourceRoot":"","sources":["../src/identifier-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe;IACxB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEG,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,eAAe,CAAC,MAAM,OAAO,eAAe,CAAC,CAAC"}
|
package/dist/identifier-type.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Identifier types.
|
|
3
|
-
*/
|
|
4
|
-
export const IdentifierTypes = {
|
|
5
|
-
/**
|
|
6
|
-
* Global Trade Item Number.
|
|
7
|
-
*/
|
|
8
|
-
GTIN: "GTIN",
|
|
9
|
-
/**
|
|
10
|
-
* Global Location Number.
|
|
11
|
-
*/
|
|
12
|
-
GLN: "GLN",
|
|
13
|
-
/**
|
|
14
|
-
* Serial Shipping Container Code.
|
|
15
|
-
*/
|
|
16
|
-
SSCC: "SSCC",
|
|
17
|
-
/**
|
|
18
|
-
* Global Returnable Asset Identifier.
|
|
19
|
-
*/
|
|
20
|
-
GRAI: "GRAI",
|
|
21
|
-
/**
|
|
22
|
-
* Global Individual Asset Identifier.
|
|
23
|
-
*/
|
|
24
|
-
GIAI: "GIAI",
|
|
25
|
-
/**
|
|
26
|
-
* Global Service Relation Number.
|
|
27
|
-
*/
|
|
28
|
-
GSRN: "GSRN",
|
|
29
|
-
/**
|
|
30
|
-
* Global Document Type Identifier.
|
|
31
|
-
*/
|
|
32
|
-
GDTI: "GDTI",
|
|
33
|
-
/**
|
|
34
|
-
* Global Identification Number for Consignment.
|
|
35
|
-
*/
|
|
36
|
-
GINC: "GINC",
|
|
37
|
-
/**
|
|
38
|
-
* Global Shipment Identification Number.
|
|
39
|
-
*/
|
|
40
|
-
GSIN: "GSIN",
|
|
41
|
-
/**
|
|
42
|
-
* Global Coupon Number.
|
|
43
|
-
*/
|
|
44
|
-
GCN: "GCN",
|
|
45
|
-
/**
|
|
46
|
-
* Component/Part Identifier.
|
|
47
|
-
*/
|
|
48
|
-
CPID: "CPID",
|
|
49
|
-
/**
|
|
50
|
-
* Global Model Number.
|
|
51
|
-
*/
|
|
52
|
-
GMN: "GMN"
|
|
53
|
-
};
|
|
54
|
-
//# sourceMappingURL=identifier-type.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-type.js","sourceRoot":"","sources":["../src/identifier-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG;IAC3B;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,GAAG,EAAE,KAAK;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,GAAG,EAAE,KAAK;IAEV;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,GAAG,EAAE,KAAK;CACJ,CAAC"}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { type CharacterSetCreator, type StringValidation, type StringValidator } from "@aidc-toolkit/utility";
|
|
2
|
-
import type { IdentifierType } from "./identifier-type.js";
|
|
3
|
-
import type { PrefixType } from "./prefix-type.js";
|
|
4
|
-
/**
|
|
5
|
-
* Character sets supported by the reference portion of an identifier or the serial component of a numeric identifier.
|
|
6
|
-
*/
|
|
7
|
-
export declare const ContentCharacterSets: {
|
|
8
|
-
/**
|
|
9
|
-
* Numeric.
|
|
10
|
-
*/
|
|
11
|
-
readonly Numeric: "Numeric";
|
|
12
|
-
/**
|
|
13
|
-
* GS1 AI encodable character set 82.
|
|
14
|
-
*/
|
|
15
|
-
readonly AI82: "AI82";
|
|
16
|
-
/**
|
|
17
|
-
* GS1 AI encodable character set 39.
|
|
18
|
-
*/
|
|
19
|
-
readonly AI39: "AI39";
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Content character set.
|
|
23
|
-
*/
|
|
24
|
-
export type ContentCharacterSet = typeof ContentCharacterSets[keyof typeof ContentCharacterSets];
|
|
25
|
-
/**
|
|
26
|
-
* Identifier validation parameters.
|
|
27
|
-
*/
|
|
28
|
-
export interface IdentifierValidation extends StringValidation {
|
|
29
|
-
/**
|
|
30
|
-
* Position offset within a larger string. Strings are sometimes composed of multiple substrings; this parameter
|
|
31
|
-
* ensures that the error notes the proper position in the string.
|
|
32
|
-
*/
|
|
33
|
-
positionOffset?: number | undefined;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Identifier validator. Validates an identifier against its definition in section 3 of the {@link
|
|
37
|
-
* https://www.gs1.org/genspecs | GS1 General Specifications}.
|
|
38
|
-
*
|
|
39
|
-
* @template TIdentifierValidation
|
|
40
|
-
* Identifier validation type.
|
|
41
|
-
*/
|
|
42
|
-
export interface IdentifierValidator<TIdentifierValidation extends IdentifierValidation = IdentifierValidation> extends StringValidator<TIdentifierValidation> {
|
|
43
|
-
/**
|
|
44
|
-
* Get the identifier type. Per the GS1 General Specifications, the identifier type determines the remaining
|
|
45
|
-
* properties.
|
|
46
|
-
*/
|
|
47
|
-
get identifierType(): IdentifierType;
|
|
48
|
-
/**
|
|
49
|
-
* Get the prefix type supported by the identifier type. For all identifier types except the GTIN, this is
|
|
50
|
-
* {@linkcode PrefixTypes.GS1CompanyPrefix}. For the GTIN, the prefix type determines the length.
|
|
51
|
-
*/
|
|
52
|
-
get prefixType(): PrefixType;
|
|
53
|
-
/**
|
|
54
|
-
* Get the length. For numeric identifier types, the length is fixed; for alphanumeric identifier types, the length
|
|
55
|
-
* is the maximum.
|
|
56
|
-
*/
|
|
57
|
-
get length(): number;
|
|
58
|
-
/**
|
|
59
|
-
* Get the reference character set.
|
|
60
|
-
*/
|
|
61
|
-
get referenceCharacterSet(): ContentCharacterSet;
|
|
62
|
-
/**
|
|
63
|
-
* Get the reference creator.
|
|
64
|
-
*/
|
|
65
|
-
get referenceCreator(): CharacterSetCreator;
|
|
66
|
-
/**
|
|
67
|
-
* Validate an identifier and throw an error if validation fails.
|
|
68
|
-
*
|
|
69
|
-
* @param identifier
|
|
70
|
-
* Identifier.
|
|
71
|
-
*
|
|
72
|
-
* @param validation
|
|
73
|
-
* Identifier validation parameters.
|
|
74
|
-
*/
|
|
75
|
-
validate: (identifier: string, validation?: TIdentifierValidation) => void;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Abstract identifier validator. Implements common functionality for an identifier validator.
|
|
79
|
-
*/
|
|
80
|
-
export declare abstract class AbstractIdentifierValidator<TIdentifierValidation extends IdentifierValidation = IdentifierValidation> implements IdentifierValidator<TIdentifierValidation> {
|
|
81
|
-
private static readonly CHARACTER_SET_CREATORS;
|
|
82
|
-
/**
|
|
83
|
-
* Identifier type.
|
|
84
|
-
*/
|
|
85
|
-
private readonly _identifierType;
|
|
86
|
-
/**
|
|
87
|
-
* Prefix type.
|
|
88
|
-
*/
|
|
89
|
-
private readonly _prefixType;
|
|
90
|
-
/**
|
|
91
|
-
* Length.
|
|
92
|
-
*/
|
|
93
|
-
private readonly _length;
|
|
94
|
-
/**
|
|
95
|
-
* Reference character set.
|
|
96
|
-
*/
|
|
97
|
-
private readonly _referenceCharacterSet;
|
|
98
|
-
/**
|
|
99
|
-
* Reference creator.
|
|
100
|
-
*/
|
|
101
|
-
private readonly _referenceCreator;
|
|
102
|
-
/**
|
|
103
|
-
* Get the character set creator for a character set.
|
|
104
|
-
*
|
|
105
|
-
* @param characterSet
|
|
106
|
-
* Character set.
|
|
107
|
-
*
|
|
108
|
-
* @returns
|
|
109
|
-
* Character set creator.
|
|
110
|
-
*/
|
|
111
|
-
protected static creatorFor(characterSet: ContentCharacterSet): CharacterSetCreator;
|
|
112
|
-
/**
|
|
113
|
-
* Constructor.
|
|
114
|
-
*
|
|
115
|
-
* @param identifierType
|
|
116
|
-
* Identifier type.
|
|
117
|
-
*
|
|
118
|
-
* @param prefixType
|
|
119
|
-
* Prefix type.
|
|
120
|
-
*
|
|
121
|
-
* @param length
|
|
122
|
-
* Length.
|
|
123
|
-
*
|
|
124
|
-
* @param referenceCharacterSet
|
|
125
|
-
* Reference character set.
|
|
126
|
-
*/
|
|
127
|
-
protected constructor(identifierType: IdentifierType, prefixType: PrefixType, length: number, referenceCharacterSet: ContentCharacterSet);
|
|
128
|
-
/**
|
|
129
|
-
* @inheritDoc
|
|
130
|
-
*/
|
|
131
|
-
get identifierType(): IdentifierType;
|
|
132
|
-
/**
|
|
133
|
-
* @inheritDoc
|
|
134
|
-
*/
|
|
135
|
-
get prefixType(): PrefixType;
|
|
136
|
-
/**
|
|
137
|
-
* @inheritDoc
|
|
138
|
-
*/
|
|
139
|
-
get length(): number;
|
|
140
|
-
/**
|
|
141
|
-
* @inheritDoc
|
|
142
|
-
*/
|
|
143
|
-
get referenceCharacterSet(): ContentCharacterSet;
|
|
144
|
-
/**
|
|
145
|
-
* @inheritDoc
|
|
146
|
-
*/
|
|
147
|
-
get referenceCreator(): CharacterSetCreator;
|
|
148
|
-
/**
|
|
149
|
-
* Pad an identifier on the left with zero-value character for validation purposes. This is done to align an
|
|
150
|
-
* identifier with a position offset for any error message that may be thrown by the reference validator.
|
|
151
|
-
*
|
|
152
|
-
* @param identifier
|
|
153
|
-
* Identifier.
|
|
154
|
-
*
|
|
155
|
-
* @param validation
|
|
156
|
-
* Identifier validation parameters.
|
|
157
|
-
*
|
|
158
|
-
* @returns
|
|
159
|
-
* Padded identifier.
|
|
160
|
-
*/
|
|
161
|
-
protected padIdentifier(identifier: string, validation: IdentifierValidation | undefined): string;
|
|
162
|
-
/**
|
|
163
|
-
* Validate the prefix within an identifier.
|
|
164
|
-
*
|
|
165
|
-
* @param partialIdentifier
|
|
166
|
-
* Partial identifier.
|
|
167
|
-
*
|
|
168
|
-
* @param positionOffset
|
|
169
|
-
* Position offset within a larger string.
|
|
170
|
-
*/
|
|
171
|
-
protected validatePrefix(partialIdentifier: string, positionOffset?: number): void;
|
|
172
|
-
abstract validate(identifier: string, validation?: TIdentifierValidation): void;
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=identifier-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-validator.d.ts","sourceRoot":"","sources":["../src/identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,mBAAmB,EAExB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACvB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGnD;;GAEG;AACH,eAAO,MAAM,oBAAoB;IAC7B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEG,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,oBAAoB,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC1D;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB,CAAC,qBAAqB,SAAS,oBAAoB,GAAG,oBAAoB,CAAE,SAAQ,eAAe,CAAC,qBAAqB,CAAC;IAC1J;;;OAGG;IACH,IAAI,cAAc,IAAI,cAAc,CAAC;IAErC;;;OAGG;IACH,IAAI,UAAU,IAAI,UAAU,CAAC;IAE7B;;;OAGG;IACH,IAAI,MAAM,IAAI,MAAM,CAAC;IAErB;;OAEG;IACH,IAAI,qBAAqB,IAAI,mBAAmB,CAAC;IAEjD;;OAEG;IACH,IAAI,gBAAgB,IAAI,mBAAmB,CAAC;IAE5C;;;;;;;;OAQG;IACH,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAC9E;AAED;;GAEG;AACH,8BAAsB,2BAA2B,CAAC,qBAAqB,SAAS,oBAAoB,GAAG,oBAAoB,CAAE,YAAW,mBAAmB,CAAC,qBAAqB,CAAC;IAC9K,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAI5C;IAEF;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAiB;IAEjD;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IAEzC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAsB;IAE7D;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAsB;IAExD;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,EAAE,mBAAmB,GAAG,mBAAmB;IAInF;;;;;;;;;;;;;;OAcG;IACH,SAAS,aAAa,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,EAAE,mBAAmB;IAQxI;;OAEG;IACH,IAAI,cAAc,IAAI,cAAc,CAEnC;IAED;;OAEG;IACH,IAAI,UAAU,IAAI,UAAU,CAE3B;IAED;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;OAEG;IACH,IAAI,qBAAqB,IAAI,mBAAmB,CAE/C;IAED;;OAEG;IACH,IAAI,gBAAgB,IAAI,mBAAmB,CAE1C;IAED;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,oBAAoB,GAAG,SAAS,GAAG,MAAM;IAKjG;;;;;;;;OAQG;IACH,SAAS,CAAC,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI;IAKlF,QAAQ,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,qBAAqB,GAAG,IAAI;CAClF"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { NUMERIC_CREATOR } from "@aidc-toolkit/utility";
|
|
2
|
-
import { AI39_CREATOR, AI82_CREATOR } from "./character-set.js";
|
|
3
|
-
import { PrefixValidator } from "./prefix-validator.js";
|
|
4
|
-
/**
|
|
5
|
-
* Character sets supported by the reference portion of an identifier or the serial component of a numeric identifier.
|
|
6
|
-
*/
|
|
7
|
-
export const ContentCharacterSets = {
|
|
8
|
-
/**
|
|
9
|
-
* Numeric.
|
|
10
|
-
*/
|
|
11
|
-
Numeric: "Numeric",
|
|
12
|
-
/**
|
|
13
|
-
* GS1 AI encodable character set 82.
|
|
14
|
-
*/
|
|
15
|
-
AI82: "AI82",
|
|
16
|
-
/**
|
|
17
|
-
* GS1 AI encodable character set 39.
|
|
18
|
-
*/
|
|
19
|
-
AI39: "AI39"
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Abstract identifier validator. Implements common functionality for an identifier validator.
|
|
23
|
-
*/
|
|
24
|
-
export class AbstractIdentifierValidator {
|
|
25
|
-
static CHARACTER_SET_CREATORS = {
|
|
26
|
-
[ContentCharacterSets.Numeric]: NUMERIC_CREATOR,
|
|
27
|
-
[ContentCharacterSets.AI82]: AI82_CREATOR,
|
|
28
|
-
[ContentCharacterSets.AI39]: AI39_CREATOR
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Identifier type.
|
|
32
|
-
*/
|
|
33
|
-
_identifierType;
|
|
34
|
-
/**
|
|
35
|
-
* Prefix type.
|
|
36
|
-
*/
|
|
37
|
-
_prefixType;
|
|
38
|
-
/**
|
|
39
|
-
* Length.
|
|
40
|
-
*/
|
|
41
|
-
_length;
|
|
42
|
-
/**
|
|
43
|
-
* Reference character set.
|
|
44
|
-
*/
|
|
45
|
-
_referenceCharacterSet;
|
|
46
|
-
/**
|
|
47
|
-
* Reference creator.
|
|
48
|
-
*/
|
|
49
|
-
_referenceCreator;
|
|
50
|
-
/**
|
|
51
|
-
* Get the character set creator for a character set.
|
|
52
|
-
*
|
|
53
|
-
* @param characterSet
|
|
54
|
-
* Character set.
|
|
55
|
-
*
|
|
56
|
-
* @returns
|
|
57
|
-
* Character set creator.
|
|
58
|
-
*/
|
|
59
|
-
static creatorFor(characterSet) {
|
|
60
|
-
return AbstractIdentifierValidator.CHARACTER_SET_CREATORS[characterSet];
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Constructor.
|
|
64
|
-
*
|
|
65
|
-
* @param identifierType
|
|
66
|
-
* Identifier type.
|
|
67
|
-
*
|
|
68
|
-
* @param prefixType
|
|
69
|
-
* Prefix type.
|
|
70
|
-
*
|
|
71
|
-
* @param length
|
|
72
|
-
* Length.
|
|
73
|
-
*
|
|
74
|
-
* @param referenceCharacterSet
|
|
75
|
-
* Reference character set.
|
|
76
|
-
*/
|
|
77
|
-
constructor(identifierType, prefixType, length, referenceCharacterSet) {
|
|
78
|
-
this._identifierType = identifierType;
|
|
79
|
-
this._prefixType = prefixType;
|
|
80
|
-
this._length = length;
|
|
81
|
-
this._referenceCharacterSet = referenceCharacterSet;
|
|
82
|
-
this._referenceCreator = AbstractIdentifierValidator.creatorFor(referenceCharacterSet);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* @inheritDoc
|
|
86
|
-
*/
|
|
87
|
-
get identifierType() {
|
|
88
|
-
return this._identifierType;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* @inheritDoc
|
|
92
|
-
*/
|
|
93
|
-
get prefixType() {
|
|
94
|
-
return this._prefixType;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* @inheritDoc
|
|
98
|
-
*/
|
|
99
|
-
get length() {
|
|
100
|
-
return this._length;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* @inheritDoc
|
|
104
|
-
*/
|
|
105
|
-
get referenceCharacterSet() {
|
|
106
|
-
return this._referenceCharacterSet;
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* @inheritDoc
|
|
110
|
-
*/
|
|
111
|
-
get referenceCreator() {
|
|
112
|
-
return this._referenceCreator;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Pad an identifier on the left with zero-value character for validation purposes. This is done to align an
|
|
116
|
-
* identifier with a position offset for any error message that may be thrown by the reference validator.
|
|
117
|
-
*
|
|
118
|
-
* @param identifier
|
|
119
|
-
* Identifier.
|
|
120
|
-
*
|
|
121
|
-
* @param validation
|
|
122
|
-
* Identifier validation parameters.
|
|
123
|
-
*
|
|
124
|
-
* @returns
|
|
125
|
-
* Padded identifier.
|
|
126
|
-
*/
|
|
127
|
-
padIdentifier(identifier, validation) {
|
|
128
|
-
// Identifier is returned as is if position offset is undefined.
|
|
129
|
-
return validation?.positionOffset === undefined ? identifier : this.referenceCreator.character(0).repeat(validation.positionOffset).concat(identifier);
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Validate the prefix within an identifier.
|
|
133
|
-
*
|
|
134
|
-
* @param partialIdentifier
|
|
135
|
-
* Partial identifier.
|
|
136
|
-
*
|
|
137
|
-
* @param positionOffset
|
|
138
|
-
* Position offset within a larger string.
|
|
139
|
-
*/
|
|
140
|
-
validatePrefix(partialIdentifier, positionOffset) {
|
|
141
|
-
// Delegate to prefix validator with support for U.P.C. Company Prefix but not GS1-8 Prefix.
|
|
142
|
-
PrefixValidator.validate(this.prefixType, true, false, partialIdentifier, true, this.referenceCharacterSet === ContentCharacterSets.Numeric, positionOffset);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=identifier-validator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"identifier-validator.js","sourceRoot":"","sources":["../src/identifier-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,eAAe,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,IAAI,EAAE,MAAM;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM;CACN,CAAC;AAkEX;;GAEG;AACH,MAAM,OAAgB,2BAA2B;IACrC,MAAM,CAAU,sBAAsB,GAAqD;QAC/F,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,eAAe;QAC/C,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,YAAY;QACzC,CAAC,oBAAoB,CAAC,IAAI,CAAC,EAAE,YAAY;KAC5C,CAAC;IAEF;;OAEG;IACc,eAAe,CAAiB;IAEjD;;OAEG;IACc,WAAW,CAAa;IAEzC;;OAEG;IACc,OAAO,CAAS;IAEjC;;OAEG;IACc,sBAAsB,CAAsB;IAE7D;;OAEG;IACc,iBAAiB,CAAsB;IAExD;;;;;;;;OAQG;IACO,MAAM,CAAC,UAAU,CAAC,YAAiC;QACzD,OAAO,2BAA2B,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,YAAsB,cAA8B,EAAE,UAAsB,EAAE,MAAc,EAAE,qBAA0C;QACpI,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,sBAAsB,GAAG,qBAAqB,CAAC;QACpD,IAAI,CAAC,iBAAiB,GAAG,2BAA2B,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;IAC3F,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,OAAO,IAAI,CAAC,eAAe,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,IAAI,UAAU;QACV,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAI,qBAAqB;QACrB,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAI,gBAAgB;QAChB,OAAO,IAAI,CAAC,iBAAiB,CAAC;IAClC,CAAC;IAED;;;;;;;;;;;;OAYG;IACO,aAAa,CAAC,UAAkB,EAAE,UAA4C;QACpF,gEAAgE;QAChE,OAAO,UAAU,EAAE,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IAC3J,CAAC;IAED;;;;;;;;OAQG;IACO,cAAc,CAAC,iBAAyB,EAAE,cAAuB;QACvE,4FAA4F;QAC5F,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,CAAC,qBAAqB,KAAK,oBAAoB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACjK,CAAC"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,qBAAqB,CAAC;AACpC,cAAc,4CAA4C,CAAC;AAC3D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,uCAAuC,CAAC;AACtD,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qCAAqC,CAAC;AACpD,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export declare const localeStrings: {
|
|
2
|
-
readonly Check: {
|
|
3
|
-
readonly lengthOfStringForPriceOrWeightMustBeExactly: "Length {{length, number}} of string for price or weight must be 4 or 5";
|
|
4
|
-
readonly priceOrWeightComponent: "price or weight";
|
|
5
|
-
readonly lengthOfStringForCheckCharacterPairMustBeLessThanOrEqualTo: "Length {{length, number}} of string for check character pair must be less than or equal to {{maximumLength, number}}";
|
|
6
|
-
};
|
|
7
|
-
readonly Identifier: {
|
|
8
|
-
readonly identifierTypeLength: "{{identifierType}} must be {{length, number}} digits long";
|
|
9
|
-
readonly invalidCheckDigit: "Invalid check digit";
|
|
10
|
-
readonly invalidGTINLength: "GTIN must be 13, 12, 8, or 14 digits long";
|
|
11
|
-
readonly invalidGTIN14Length: "GTIN must be 14 digits long";
|
|
12
|
-
readonly invalidZeroSuppressedGTIN12: "Invalid zero-suppressed GTIN-12";
|
|
13
|
-
readonly invalidZeroSuppressibleGTIN12: "GTIN-12 not zero-suppressible";
|
|
14
|
-
readonly invalidZeroSuppressedGTIN12AsGTIN13: "Invalid zero-suppressed GTIN-12 as GTIN-13";
|
|
15
|
-
readonly invalidZeroSuppressedGTIN12AsGTIN14: "Invalid zero-suppressed GTIN-12 as GTIN-14";
|
|
16
|
-
readonly invalidGTIN13AtRetail: "GTIN-13 at retail consumer trade item level can't start with zero";
|
|
17
|
-
readonly invalidGTINAtRetail: "GTIN not supported at retail consumer trade item level";
|
|
18
|
-
readonly invalidGTINAtOtherThanRetail: "GTIN not supported at other than retail consumer trade item level";
|
|
19
|
-
readonly invalidRCNLength: "RCN length must match format length";
|
|
20
|
-
readonly invalidVariableMeasureRCNFormat: "Invalid variable measure RCN format";
|
|
21
|
-
readonly invalidVariableMeasureRCNPrefix: "Invalid variable measure RCN prefix";
|
|
22
|
-
readonly invalidVariableMeasurePriceOrWeight: "Invalid variable measure price or weight";
|
|
23
|
-
readonly indicatorDigit: "indicator digit";
|
|
24
|
-
readonly serialComponent: "serial component";
|
|
25
|
-
readonly reference: "reference";
|
|
26
|
-
readonly referenceCantBeAllNumeric: "Reference can't be all-numeric";
|
|
27
|
-
readonly invalidCheckCharacterPair: "Invalid check character pair";
|
|
28
|
-
};
|
|
29
|
-
readonly Prefix: {
|
|
30
|
-
readonly gs1CompanyPrefix: "GS1 Company Prefix";
|
|
31
|
-
readonly upcCompanyPrefix: "U.P.C. Company Prefix";
|
|
32
|
-
readonly gs18Prefix: "GS1-8 Prefix";
|
|
33
|
-
readonly invalidPrefixType: "Invalid prefix type";
|
|
34
|
-
readonly gs1CompanyPrefixCantStartWith0: "GS1 Company Prefix can't start with \"0\"";
|
|
35
|
-
readonly gs1CompanyPrefixCantStartWith00000: "GS1 Company Prefix can't start with \"00000\"";
|
|
36
|
-
readonly gs1CompanyPrefixCantStartWith000000: "GS1 Company Prefix can't start with \"000000\"";
|
|
37
|
-
readonly upcCompanyPrefixCantStartWith0000: "U.P.C. Company Prefix can't start with \"0000\"";
|
|
38
|
-
readonly gs18PrefixCantStartWith0: "GS1-8 Prefix can't start with \"0\"";
|
|
39
|
-
readonly identifierTypeNotSupportedByGS18Prefix: "{{identifierType}} not supported by GS1-8 Prefix";
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
//# sourceMappingURL=locale-strings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-strings.d.ts","sourceRoot":"","sources":["../../../src/locale/en/locale-strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const localeStrings = {
|
|
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-strings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-strings.js","sourceRoot":"","sources":["../../../src/locale/en/locale-strings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,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,42 +0,0 @@
|
|
|
1
|
-
export declare const localeStrings: {
|
|
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 à {{maximum Length}}";
|
|
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
|
-
//# sourceMappingURL=locale-strings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-strings.d.ts","sourceRoot":"","sources":["../../../src/locale/fr/locale-strings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwChB,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
export const localeStrings = {
|
|
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 à {{maximum Length}}"
|
|
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-strings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locale-strings.js","sourceRoot":"","sources":["../../../src/locale/fr/locale-strings.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,KAAK,EAAE;QACH,2CAA2C,EAAE,uFAAuF;QACpI,sBAAsB,EAAE,eAAe;QACvC,0DAA0D,EAAE,4IAA4I;KAC3M;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 { localeStrings as enLocaleStrings } from "./en/locale-strings.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 GS1LocaleStrings = typeof enLocaleStrings;
|
|
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,EAAE,aAAa,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAG1E,eAAO,MAAM,KAAK,cAAc,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,OAAO,eAAe,CAAC;AAItD;;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 { localeStrings as enLocaleStrings } from "./en/locale-strings.js";
|
|
5
|
-
import { localeStrings as frLocaleStrings } from "./fr/locale-strings.js";
|
|
6
|
-
export const gs1NS = "aidct_gs1";
|
|
7
|
-
i18nAssertValidResources(enLocaleStrings, "fr", frLocaleStrings);
|
|
8
|
-
/**
|
|
9
|
-
* GS1 resources.
|
|
10
|
-
*/
|
|
11
|
-
export const gs1Resources = {
|
|
12
|
-
en: {
|
|
13
|
-
aidct_gs1: enLocaleStrings
|
|
14
|
-
},
|
|
15
|
-
fr: {
|
|
16
|
-
aidct_gs1: frLocaleStrings
|
|
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
|