@aidc-toolkit/app-extension 0.9.20-beta → 1.0.22-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/app-extension.iml +3 -1
- package/dist/app-utility-proxy.js +6 -6
- package/dist/app-utility-proxy.js.map +1 -1
- package/dist/descriptor.d.ts +10 -6
- package/dist/descriptor.d.ts.map +1 -1
- package/dist/descriptor.js +6 -7
- package/dist/descriptor.js.map +1 -1
- package/dist/generator/generator.js +2 -2
- package/dist/generator/generator.js.map +1 -1
- package/dist/gs1/check-proxy.js +8 -8
- package/dist/gs1/check-proxy.js.map +1 -1
- package/dist/gs1/{idkey-proxy.d.ts → identifier-proxy.d.ts} +44 -43
- package/dist/gs1/identifier-proxy.d.ts.map +1 -0
- package/dist/gs1/{idkey-proxy.js → identifier-proxy.js} +113 -110
- package/dist/gs1/identifier-proxy.js.map +1 -0
- package/dist/gs1/index.d.ts +1 -1
- package/dist/gs1/index.d.ts.map +1 -1
- package/dist/gs1/index.js +1 -1
- package/dist/gs1/index.js.map +1 -1
- package/dist/locale/en/locale-strings.d.ts +3 -3
- package/dist/locale/en/locale-strings.js +11 -11
- package/dist/locale/en/locale-strings.js.map +1 -1
- package/dist/locale/fr/locale-strings.d.ts +3 -3
- package/dist/locale/fr/locale-strings.js +4 -4
- package/dist/locale/fr/locale-strings.js.map +1 -1
- package/dist/utility/character-set-descriptor.d.ts.map +1 -1
- package/dist/utility/character-set-descriptor.js +2 -2
- package/dist/utility/character-set-descriptor.js.map +1 -1
- package/dist/utility/character-set-proxy.js +7 -7
- package/dist/utility/character-set-proxy.js.map +1 -1
- package/dist/utility/reg-exp-proxy.js +5 -5
- package/dist/utility/reg-exp-proxy.js.map +1 -1
- package/dist/utility/string-descriptor.d.ts.map +1 -1
- package/dist/utility/string-descriptor.js +2 -2
- package/dist/utility/string-descriptor.js.map +1 -1
- package/dist/utility/transformer-descriptor.d.ts.map +1 -1
- package/dist/utility/transformer-descriptor.js +3 -3
- package/dist/utility/transformer-descriptor.js.map +1 -1
- package/dist/utility/transformer-proxy.js +6 -6
- package/dist/utility/transformer-proxy.js.map +1 -1
- package/package.json +1 -1
- package/src/app-utility-proxy.ts +6 -6
- package/src/descriptor.ts +11 -6
- package/src/generator/generator.ts +2 -2
- package/src/generator/locale-strings-generator.ts +1 -1
- package/src/generator/logger.ts +18 -7
- package/src/gs1/check-proxy.ts +8 -8
- package/src/gs1/{idkey-proxy.ts → identifier-proxy.ts} +125 -120
- package/src/gs1/index.ts +1 -1
- package/src/locale/en/locale-strings.ts +11 -11
- package/src/locale/fr/locale-strings.ts +4 -4
- package/src/utility/character-set-descriptor.ts +2 -2
- package/src/utility/character-set-proxy.ts +7 -7
- package/src/utility/reg-exp-proxy.ts +5 -5
- package/src/utility/string-descriptor.ts +2 -2
- package/src/utility/transformer-descriptor.ts +3 -3
- package/src/utility/transformer-proxy.ts +6 -6
- package/dist/gs1/idkey-proxy.d.ts.map +0 -1
- package/dist/gs1/idkey-proxy.js.map +0 -1
|
@@ -7,27 +7,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
8
8
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9
9
|
};
|
|
10
|
-
import { CPID_VALIDATOR, GCN_VALIDATOR, GDTI_VALIDATOR, GIAI_VALIDATOR, GINC_VALIDATOR, GLN_VALIDATOR, GMN_VALIDATOR, GRAI_VALIDATOR, GSIN_VALIDATOR, GSRN_VALIDATOR, GTIN12_VALIDATOR, GTIN13_VALIDATOR, GTIN8_VALIDATOR, GTINCreator, GTINValidator, PrefixManager,
|
|
10
|
+
import { CPID_VALIDATOR, GCN_VALIDATOR, GDTI_VALIDATOR, GIAI_VALIDATOR, GINC_VALIDATOR, GLN_VALIDATOR, GMN_VALIDATOR, GRAI_VALIDATOR, GSIN_VALIDATOR, GSRN_VALIDATOR, GTIN12_VALIDATOR, GTIN13_VALIDATOR, GTIN8_VALIDATOR, GTINCreator, GTINValidator, PrefixManager, PrefixTypes, PrefixValidator, SSCC_VALIDATOR } from "@aidc-toolkit/gs1";
|
|
11
11
|
import { Sequence } from "@aidc-toolkit/utility";
|
|
12
|
-
import { expandParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter,
|
|
12
|
+
import { expandParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor.js";
|
|
13
13
|
import { LibProxy } from "../lib-proxy.js";
|
|
14
14
|
import { i18nextAppExtension } from "../locale/i18n.js";
|
|
15
15
|
import { isNullish } from "../types.js";
|
|
16
16
|
import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor.js";
|
|
17
17
|
import { StringProxy } from "../utility/string-proxy.js";
|
|
18
18
|
import { countParameterDescriptor, startValueParameterDescriptor, valueParameterDescriptor } from "../utility/transformer-descriptor.js";
|
|
19
|
-
const
|
|
20
|
-
name: "
|
|
21
|
-
type:
|
|
19
|
+
const identifierParameterDescriptor = {
|
|
20
|
+
name: "identifier",
|
|
21
|
+
type: Types.String,
|
|
22
22
|
isMatrix: true,
|
|
23
23
|
isRequired: true
|
|
24
24
|
};
|
|
25
|
-
const
|
|
26
|
-
extendsDescriptor:
|
|
25
|
+
const validateIdentifierParameterDescriptor = {
|
|
26
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
27
27
|
sortOrder: 0,
|
|
28
|
-
name: "
|
|
28
|
+
name: "validateIdentifier"
|
|
29
29
|
};
|
|
30
|
-
class
|
|
30
|
+
class IdentifierValidatorProxy extends StringProxy {
|
|
31
31
|
_validator;
|
|
32
32
|
constructor(appExtension, validator) {
|
|
33
33
|
super(appExtension);
|
|
@@ -37,39 +37,39 @@ class IdentificationKeyValidatorProxy extends StringProxy {
|
|
|
37
37
|
return this._validator;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
class
|
|
41
|
-
validate(
|
|
42
|
-
return this.validateString(this.validator,
|
|
40
|
+
class NumericIdentifierValidatorProxy extends IdentifierValidatorProxy {
|
|
41
|
+
validate(matrixIdentifiers) {
|
|
42
|
+
return this.validateString(this.validator, matrixIdentifiers);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
__decorate([
|
|
46
46
|
ProxyMethod({
|
|
47
|
-
type:
|
|
47
|
+
type: Types.String,
|
|
48
48
|
isMatrix: true
|
|
49
49
|
}),
|
|
50
|
-
__param(0, ProxyParameter(
|
|
51
|
-
],
|
|
52
|
-
class GTINValidatorProxy extends
|
|
50
|
+
__param(0, ProxyParameter(validateIdentifierParameterDescriptor))
|
|
51
|
+
], NumericIdentifierValidatorProxy.prototype, "validate", null);
|
|
52
|
+
class GTINValidatorProxy extends NumericIdentifierValidatorProxy {
|
|
53
53
|
}
|
|
54
|
-
class
|
|
54
|
+
class NonGTINNumericIdentifierValidatorProxy extends NumericIdentifierValidatorProxy {
|
|
55
55
|
}
|
|
56
|
-
class
|
|
56
|
+
class SerializableNumericIdentifierValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
|
|
57
57
|
}
|
|
58
|
-
class
|
|
59
|
-
validate(
|
|
60
|
-
return this.validateString(this.validator,
|
|
58
|
+
class NonNumericIdentifierValidatorProxy extends IdentifierValidatorProxy {
|
|
59
|
+
validate(matrixIdentifiers, exclusion) {
|
|
60
|
+
return this.validateString(this.validator, matrixIdentifiers, {
|
|
61
61
|
exclusion: exclusion ?? undefined
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
__decorate([
|
|
66
66
|
ProxyMethod({
|
|
67
|
-
type:
|
|
67
|
+
type: Types.String,
|
|
68
68
|
isMatrix: true
|
|
69
69
|
}),
|
|
70
|
-
__param(0, ProxyParameter(
|
|
70
|
+
__param(0, ProxyParameter(validateIdentifierParameterDescriptor)),
|
|
71
71
|
__param(1, ProxyParameter(exclusionAllNumericParameterDescriptor))
|
|
72
|
-
],
|
|
72
|
+
], NonNumericIdentifierValidatorProxy.prototype, "validate", null);
|
|
73
73
|
let GTIN13ValidatorProxy = class GTIN13ValidatorProxy extends GTINValidatorProxy {
|
|
74
74
|
constructor(appExtension) {
|
|
75
75
|
super(appExtension, GTIN13_VALIDATOR);
|
|
@@ -107,62 +107,62 @@ GTIN8ValidatorProxy = __decorate([
|
|
|
107
107
|
], GTIN8ValidatorProxy);
|
|
108
108
|
export { GTIN8ValidatorProxy };
|
|
109
109
|
const zeroSuppressibleGTIN12ParameterDescriptor = {
|
|
110
|
-
extendsDescriptor:
|
|
110
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
111
111
|
name: "zeroSuppressibleGTIN12"
|
|
112
112
|
};
|
|
113
113
|
const zeroSuppressedGTIN12ParameterDescriptor = {
|
|
114
|
-
extendsDescriptor:
|
|
114
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
115
115
|
name: "zeroSuppressedGTIN12"
|
|
116
116
|
};
|
|
117
117
|
const indicatorDigitParameterDescriptor = {
|
|
118
118
|
name: "indicatorDigit",
|
|
119
|
-
type:
|
|
119
|
+
type: Types.String,
|
|
120
120
|
isMatrix: false,
|
|
121
121
|
isRequired: true
|
|
122
122
|
};
|
|
123
123
|
const convertGTINParameterDescriptor = {
|
|
124
|
-
extendsDescriptor:
|
|
124
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
125
125
|
name: "convertGTIN"
|
|
126
126
|
};
|
|
127
127
|
const normalizeGTINParameterDescriptor = {
|
|
128
|
-
extendsDescriptor:
|
|
128
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
129
129
|
name: "normalizeGTIN"
|
|
130
130
|
};
|
|
131
131
|
const validateGTINParameterDescriptor = {
|
|
132
|
-
extendsDescriptor:
|
|
132
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
133
133
|
name: "validateGTIN"
|
|
134
134
|
};
|
|
135
135
|
const gtinLevelParameterDescriptor = {
|
|
136
136
|
name: "gtinLevel",
|
|
137
|
-
type:
|
|
137
|
+
type: Types.Number,
|
|
138
138
|
isMatrix: false,
|
|
139
139
|
isRequired: false
|
|
140
140
|
};
|
|
141
141
|
const validateGTIN14ParameterDescriptor = {
|
|
142
|
-
extendsDescriptor:
|
|
142
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
143
143
|
name: "validateGTIN14"
|
|
144
144
|
};
|
|
145
145
|
const rcnFormatParameterDescriptor = {
|
|
146
146
|
name: "rcnFormat",
|
|
147
|
-
type:
|
|
147
|
+
type: Types.String,
|
|
148
148
|
isMatrix: false,
|
|
149
149
|
isRequired: true
|
|
150
150
|
};
|
|
151
151
|
const rcnParameterDescriptor = {
|
|
152
152
|
name: "rcn",
|
|
153
|
-
type:
|
|
153
|
+
type: Types.String,
|
|
154
154
|
isMatrix: true,
|
|
155
155
|
isRequired: true
|
|
156
156
|
};
|
|
157
157
|
const rcnItemReferenceParameterDescriptor = {
|
|
158
158
|
name: "rcnItemReference",
|
|
159
|
-
type:
|
|
159
|
+
type: Types.Number,
|
|
160
160
|
isMatrix: false,
|
|
161
161
|
isRequired: true
|
|
162
162
|
};
|
|
163
163
|
const rcnPriceOrWeightParameterDescriptor = {
|
|
164
164
|
name: "rcnPriceOrWeight",
|
|
165
|
-
type:
|
|
165
|
+
type: Types.Number,
|
|
166
166
|
isMatrix: true,
|
|
167
167
|
isRequired: true
|
|
168
168
|
};
|
|
@@ -199,21 +199,21 @@ let GTINValidatorStaticProxy = class GTINValidatorStaticProxy extends LibProxy {
|
|
|
199
199
|
};
|
|
200
200
|
__decorate([
|
|
201
201
|
ProxyMethod({
|
|
202
|
-
type:
|
|
202
|
+
type: Types.String,
|
|
203
203
|
isMatrix: true
|
|
204
204
|
}),
|
|
205
205
|
__param(0, ProxyParameter(zeroSuppressibleGTIN12ParameterDescriptor))
|
|
206
206
|
], GTINValidatorStaticProxy.prototype, "zeroSuppressGTIN12", null);
|
|
207
207
|
__decorate([
|
|
208
208
|
ProxyMethod({
|
|
209
|
-
type:
|
|
209
|
+
type: Types.String,
|
|
210
210
|
isMatrix: true
|
|
211
211
|
}),
|
|
212
212
|
__param(0, ProxyParameter(zeroSuppressedGTIN12ParameterDescriptor))
|
|
213
213
|
], GTINValidatorStaticProxy.prototype, "zeroExpandGTIN12", null);
|
|
214
214
|
__decorate([
|
|
215
215
|
ProxyMethod({
|
|
216
|
-
type:
|
|
216
|
+
type: Types.String,
|
|
217
217
|
isMatrix: true
|
|
218
218
|
}),
|
|
219
219
|
__param(0, ProxyParameter(indicatorDigitParameterDescriptor)),
|
|
@@ -221,14 +221,14 @@ __decorate([
|
|
|
221
221
|
], GTINValidatorStaticProxy.prototype, "convertToGTIN14", null);
|
|
222
222
|
__decorate([
|
|
223
223
|
ProxyMethod({
|
|
224
|
-
type:
|
|
224
|
+
type: Types.String,
|
|
225
225
|
isMatrix: true
|
|
226
226
|
}),
|
|
227
227
|
__param(0, ProxyParameter(normalizeGTINParameterDescriptor))
|
|
228
228
|
], GTINValidatorStaticProxy.prototype, "normalizeGTIN", null);
|
|
229
229
|
__decorate([
|
|
230
230
|
ProxyMethod({
|
|
231
|
-
type:
|
|
231
|
+
type: Types.String,
|
|
232
232
|
isMatrix: true
|
|
233
233
|
}),
|
|
234
234
|
__param(0, ProxyParameter(validateGTINParameterDescriptor)),
|
|
@@ -236,14 +236,14 @@ __decorate([
|
|
|
236
236
|
], GTINValidatorStaticProxy.prototype, "validateGTIN", null);
|
|
237
237
|
__decorate([
|
|
238
238
|
ProxyMethod({
|
|
239
|
-
type:
|
|
239
|
+
type: Types.String,
|
|
240
240
|
isMatrix: true
|
|
241
241
|
}),
|
|
242
242
|
__param(0, ProxyParameter(validateGTIN14ParameterDescriptor))
|
|
243
243
|
], GTINValidatorStaticProxy.prototype, "validateGTIN14", null);
|
|
244
244
|
__decorate([
|
|
245
245
|
ProxyMethod({
|
|
246
|
-
type:
|
|
246
|
+
type: Types.Number,
|
|
247
247
|
isMatrix: true
|
|
248
248
|
}),
|
|
249
249
|
__param(0, ProxyParameter(rcnFormatParameterDescriptor)),
|
|
@@ -255,7 +255,7 @@ GTINValidatorStaticProxy = __decorate([
|
|
|
255
255
|
})
|
|
256
256
|
], GTINValidatorStaticProxy);
|
|
257
257
|
export { GTINValidatorStaticProxy };
|
|
258
|
-
let GLNValidatorProxy = class GLNValidatorProxy extends
|
|
258
|
+
let GLNValidatorProxy = class GLNValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
|
|
259
259
|
constructor(appExtension) {
|
|
260
260
|
super(appExtension, GLN_VALIDATOR);
|
|
261
261
|
}
|
|
@@ -267,7 +267,7 @@ GLNValidatorProxy = __decorate([
|
|
|
267
267
|
})
|
|
268
268
|
], GLNValidatorProxy);
|
|
269
269
|
export { GLNValidatorProxy };
|
|
270
|
-
let SSCCValidatorProxy = class SSCCValidatorProxy extends
|
|
270
|
+
let SSCCValidatorProxy = class SSCCValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
|
|
271
271
|
constructor(appExtension) {
|
|
272
272
|
super(appExtension, SSCC_VALIDATOR);
|
|
273
273
|
}
|
|
@@ -279,7 +279,7 @@ SSCCValidatorProxy = __decorate([
|
|
|
279
279
|
})
|
|
280
280
|
], SSCCValidatorProxy);
|
|
281
281
|
export { SSCCValidatorProxy };
|
|
282
|
-
let GRAIValidatorProxy = class GRAIValidatorProxy extends
|
|
282
|
+
let GRAIValidatorProxy = class GRAIValidatorProxy extends SerializableNumericIdentifierValidatorProxy {
|
|
283
283
|
constructor(appExtension) {
|
|
284
284
|
super(appExtension, GRAI_VALIDATOR);
|
|
285
285
|
}
|
|
@@ -291,7 +291,7 @@ GRAIValidatorProxy = __decorate([
|
|
|
291
291
|
})
|
|
292
292
|
], GRAIValidatorProxy);
|
|
293
293
|
export { GRAIValidatorProxy };
|
|
294
|
-
let GIAIValidatorProxy = class GIAIValidatorProxy extends
|
|
294
|
+
let GIAIValidatorProxy = class GIAIValidatorProxy extends NonNumericIdentifierValidatorProxy {
|
|
295
295
|
constructor(appExtension) {
|
|
296
296
|
super(appExtension, GIAI_VALIDATOR);
|
|
297
297
|
}
|
|
@@ -303,7 +303,7 @@ GIAIValidatorProxy = __decorate([
|
|
|
303
303
|
})
|
|
304
304
|
], GIAIValidatorProxy);
|
|
305
305
|
export { GIAIValidatorProxy };
|
|
306
|
-
let GSRNValidatorProxy = class GSRNValidatorProxy extends
|
|
306
|
+
let GSRNValidatorProxy = class GSRNValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
|
|
307
307
|
constructor(appExtension) {
|
|
308
308
|
super(appExtension, GSRN_VALIDATOR);
|
|
309
309
|
}
|
|
@@ -315,7 +315,7 @@ GSRNValidatorProxy = __decorate([
|
|
|
315
315
|
})
|
|
316
316
|
], GSRNValidatorProxy);
|
|
317
317
|
export { GSRNValidatorProxy };
|
|
318
|
-
let GDTIValidatorProxy = class GDTIValidatorProxy extends
|
|
318
|
+
let GDTIValidatorProxy = class GDTIValidatorProxy extends SerializableNumericIdentifierValidatorProxy {
|
|
319
319
|
constructor(appExtension) {
|
|
320
320
|
super(appExtension, GDTI_VALIDATOR);
|
|
321
321
|
}
|
|
@@ -327,7 +327,7 @@ GDTIValidatorProxy = __decorate([
|
|
|
327
327
|
})
|
|
328
328
|
], GDTIValidatorProxy);
|
|
329
329
|
export { GDTIValidatorProxy };
|
|
330
|
-
let GINCValidatorProxy = class GINCValidatorProxy extends
|
|
330
|
+
let GINCValidatorProxy = class GINCValidatorProxy extends NonNumericIdentifierValidatorProxy {
|
|
331
331
|
constructor(appExtension) {
|
|
332
332
|
super(appExtension, GINC_VALIDATOR);
|
|
333
333
|
}
|
|
@@ -339,7 +339,7 @@ GINCValidatorProxy = __decorate([
|
|
|
339
339
|
})
|
|
340
340
|
], GINCValidatorProxy);
|
|
341
341
|
export { GINCValidatorProxy };
|
|
342
|
-
let GSINValidatorProxy = class GSINValidatorProxy extends
|
|
342
|
+
let GSINValidatorProxy = class GSINValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
|
|
343
343
|
constructor(appExtension) {
|
|
344
344
|
super(appExtension, GSIN_VALIDATOR);
|
|
345
345
|
}
|
|
@@ -351,7 +351,7 @@ GSINValidatorProxy = __decorate([
|
|
|
351
351
|
})
|
|
352
352
|
], GSINValidatorProxy);
|
|
353
353
|
export { GSINValidatorProxy };
|
|
354
|
-
let GCNValidatorProxy = class GCNValidatorProxy extends
|
|
354
|
+
let GCNValidatorProxy = class GCNValidatorProxy extends SerializableNumericIdentifierValidatorProxy {
|
|
355
355
|
constructor(appExtension) {
|
|
356
356
|
super(appExtension, GCN_VALIDATOR);
|
|
357
357
|
}
|
|
@@ -363,7 +363,7 @@ GCNValidatorProxy = __decorate([
|
|
|
363
363
|
})
|
|
364
364
|
], GCNValidatorProxy);
|
|
365
365
|
export { GCNValidatorProxy };
|
|
366
|
-
let CPIDValidatorProxy = class CPIDValidatorProxy extends
|
|
366
|
+
let CPIDValidatorProxy = class CPIDValidatorProxy extends NonNumericIdentifierValidatorProxy {
|
|
367
367
|
constructor(appExtension) {
|
|
368
368
|
super(appExtension, CPID_VALIDATOR);
|
|
369
369
|
}
|
|
@@ -375,7 +375,7 @@ CPIDValidatorProxy = __decorate([
|
|
|
375
375
|
})
|
|
376
376
|
], CPIDValidatorProxy);
|
|
377
377
|
export { CPIDValidatorProxy };
|
|
378
|
-
let GMNValidatorProxy = class GMNValidatorProxy extends
|
|
378
|
+
let GMNValidatorProxy = class GMNValidatorProxy extends NonNumericIdentifierValidatorProxy {
|
|
379
379
|
constructor(appExtension) {
|
|
380
380
|
super(appExtension, GMN_VALIDATOR);
|
|
381
381
|
}
|
|
@@ -389,25 +389,25 @@ GMNValidatorProxy = __decorate([
|
|
|
389
389
|
export { GMNValidatorProxy };
|
|
390
390
|
const prefixParameterDescriptor = {
|
|
391
391
|
name: "prefix",
|
|
392
|
-
type:
|
|
392
|
+
type: Types.String,
|
|
393
393
|
isMatrix: false,
|
|
394
394
|
isRequired: true
|
|
395
395
|
};
|
|
396
396
|
const prefixTypeParameterDescriptor = {
|
|
397
397
|
name: "prefixType",
|
|
398
|
-
type:
|
|
398
|
+
type: Types.Number,
|
|
399
399
|
isMatrix: false,
|
|
400
400
|
isRequired: false
|
|
401
401
|
};
|
|
402
402
|
const tweakFactorParameterDescriptor = {
|
|
403
403
|
name: "tweakFactor",
|
|
404
|
-
type:
|
|
404
|
+
type: Types.Number,
|
|
405
405
|
isMatrix: false,
|
|
406
406
|
isRequired: false
|
|
407
407
|
};
|
|
408
408
|
const prefixDefinitionParameterDescriptor = {
|
|
409
409
|
name: "prefixDefinition",
|
|
410
|
-
type:
|
|
410
|
+
type: Types.Any,
|
|
411
411
|
isMatrix: true,
|
|
412
412
|
isRequired: true
|
|
413
413
|
};
|
|
@@ -421,13 +421,13 @@ const prefixDefinitionAnyParameterDescriptor = {
|
|
|
421
421
|
};
|
|
422
422
|
let PrefixManagerProxy = class PrefixManagerProxy extends LibProxy {
|
|
423
423
|
definePrefix(prefix, prefixType, tweakFactor) {
|
|
424
|
-
// Parameters will be validated by
|
|
424
|
+
// Parameters will be validated by IdentifierCreatorProxy.getCreator().
|
|
425
425
|
return [[prefix, prefixType, tweakFactor]];
|
|
426
426
|
}
|
|
427
427
|
};
|
|
428
428
|
__decorate([
|
|
429
429
|
ProxyMethod({
|
|
430
|
-
type:
|
|
430
|
+
type: Types.Any,
|
|
431
431
|
isMatrix: true
|
|
432
432
|
}),
|
|
433
433
|
__param(0, ProxyParameter(prefixParameterDescriptor)),
|
|
@@ -440,7 +440,8 @@ PrefixManagerProxy = __decorate([
|
|
|
440
440
|
})
|
|
441
441
|
], PrefixManagerProxy);
|
|
442
442
|
export { PrefixManagerProxy };
|
|
443
|
-
class
|
|
443
|
+
class IdentifierCreatorProxy extends LibProxy {
|
|
444
|
+
static PREFIX_TYPES = [PrefixTypes.GS1CompanyPrefix, PrefixTypes.UPCCompanyPrefix, PrefixTypes.GS18Prefix];
|
|
444
445
|
_getCreator;
|
|
445
446
|
constructor(appExtension, getCreator) {
|
|
446
447
|
super(appExtension);
|
|
@@ -453,26 +454,28 @@ class IdentificationKeyCreatorProxy extends LibProxy {
|
|
|
453
454
|
// Prefix definition is vertical.
|
|
454
455
|
prefixDefinition.map((prefixDefinitionRow) => {
|
|
455
456
|
if (prefixDefinitionRow.length !== 1) {
|
|
456
|
-
throw new RangeError(i18nextAppExtension.t("
|
|
457
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixDefinitionMustBeOneDimensional"));
|
|
457
458
|
}
|
|
458
459
|
return prefixDefinitionRow[0];
|
|
459
460
|
});
|
|
460
461
|
if (reducedPrefixDefinition.length > 3) {
|
|
461
|
-
throw new RangeError(i18nextAppExtension.t("
|
|
462
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixDefinitionMustHaveMaximumThreeElements"));
|
|
462
463
|
}
|
|
463
464
|
const prefix = reducedPrefixDefinition[0];
|
|
464
465
|
if (typeof prefix !== "string") {
|
|
465
|
-
throw new RangeError(i18nextAppExtension.t("
|
|
466
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixMustBeString"));
|
|
466
467
|
}
|
|
467
|
-
const
|
|
468
|
-
if (typeof
|
|
469
|
-
throw new RangeError(i18nextAppExtension.t("
|
|
468
|
+
const prefixTypeIndex = reducedPrefixDefinition[1] ?? 0;
|
|
469
|
+
if (typeof prefixTypeIndex !== "number" || prefixTypeIndex < 0 || prefixTypeIndex >= IdentifierCreatorProxy.PREFIX_TYPES.length) {
|
|
470
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixTypeMustBeNumber", {
|
|
471
|
+
maximumPrefixType: IdentifierCreatorProxy.PREFIX_TYPES.length - 1
|
|
472
|
+
}));
|
|
470
473
|
}
|
|
471
|
-
const prefixManager = PrefixManager.get(
|
|
474
|
+
const prefixManager = PrefixManager.get(IdentifierCreatorProxy.PREFIX_TYPES[prefixTypeIndex], prefix);
|
|
472
475
|
const tweakFactor = reducedPrefixDefinition[2];
|
|
473
476
|
if (!isNullish(tweakFactor)) {
|
|
474
477
|
if (typeof tweakFactor !== "number") {
|
|
475
|
-
throw new RangeError(i18nextAppExtension.t("
|
|
478
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.tweakFactorMustBeNumber"));
|
|
476
479
|
}
|
|
477
480
|
prefixManager.tweakFactor = tweakFactor;
|
|
478
481
|
}
|
|
@@ -484,11 +487,11 @@ class IdentificationKeyCreatorProxy extends LibProxy {
|
|
|
484
487
|
}
|
|
485
488
|
const sparseParameterDescriptor = {
|
|
486
489
|
name: "sparse",
|
|
487
|
-
type:
|
|
490
|
+
type: Types.Boolean,
|
|
488
491
|
isMatrix: false,
|
|
489
492
|
isRequired: false
|
|
490
493
|
};
|
|
491
|
-
class
|
|
494
|
+
class NumericIdentifierCreatorProxy extends IdentifierCreatorProxy {
|
|
492
495
|
create(prefixDefinition, matrixValues, sparse) {
|
|
493
496
|
const creator = this.getCreator(prefixDefinition);
|
|
494
497
|
const sparseOrUndefined = sparse ?? undefined;
|
|
@@ -506,84 +509,84 @@ class NumericIdentificationKeyCreatorProxy extends IdentificationKeyCreatorProxy
|
|
|
506
509
|
}
|
|
507
510
|
__decorate([
|
|
508
511
|
ProxyMethod({
|
|
509
|
-
type:
|
|
512
|
+
type: Types.String,
|
|
510
513
|
isMatrix: true
|
|
511
514
|
}),
|
|
512
515
|
__param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
513
516
|
__param(1, ProxyParameter(valueParameterDescriptor)),
|
|
514
517
|
__param(2, ProxyParameter(sparseParameterDescriptor))
|
|
515
|
-
],
|
|
518
|
+
], NumericIdentifierCreatorProxy.prototype, "create", null);
|
|
516
519
|
__decorate([
|
|
517
520
|
ProxyMethod({
|
|
518
521
|
infixBefore: "Sequence",
|
|
519
|
-
type:
|
|
522
|
+
type: Types.String,
|
|
520
523
|
isMatrix: true
|
|
521
524
|
}),
|
|
522
525
|
__param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
523
526
|
__param(1, ProxyParameter(startValueParameterDescriptor)),
|
|
524
527
|
__param(2, ProxyParameter(countParameterDescriptor)),
|
|
525
528
|
__param(3, ProxyParameter(sparseParameterDescriptor))
|
|
526
|
-
],
|
|
529
|
+
], NumericIdentifierCreatorProxy.prototype, "createSequence", null);
|
|
527
530
|
__decorate([
|
|
528
531
|
ProxyMethod({
|
|
529
|
-
type:
|
|
532
|
+
type: Types.String,
|
|
530
533
|
isMatrix: true
|
|
531
534
|
}),
|
|
532
535
|
__param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor))
|
|
533
|
-
],
|
|
534
|
-
class
|
|
536
|
+
], NumericIdentifierCreatorProxy.prototype, "createAll", null);
|
|
537
|
+
class NonGTINNumericIdentifierCreatorProxy extends NumericIdentifierCreatorProxy {
|
|
535
538
|
}
|
|
536
539
|
const singleValueParameterDescriptor = {
|
|
537
540
|
extendsDescriptor: valueParameterDescriptor,
|
|
538
541
|
isMatrix: false
|
|
539
542
|
};
|
|
540
|
-
const
|
|
541
|
-
extendsDescriptor:
|
|
542
|
-
name: "
|
|
543
|
+
const baseIdentifierParameterDescriptor = {
|
|
544
|
+
extendsDescriptor: identifierParameterDescriptor,
|
|
545
|
+
name: "baseIdentifier",
|
|
543
546
|
isMatrix: false
|
|
544
547
|
};
|
|
545
548
|
const serialComponentParameterDescriptor = {
|
|
546
549
|
name: "serialComponent",
|
|
547
|
-
type:
|
|
550
|
+
type: Types.String,
|
|
548
551
|
isMatrix: true,
|
|
549
552
|
isRequired: true
|
|
550
553
|
};
|
|
551
|
-
class
|
|
554
|
+
class SerializableNumericIdentifierCreatorProxy extends NonGTINNumericIdentifierCreatorProxy {
|
|
552
555
|
createSerialized(prefixDefinition, value, matrixSerialComponents, sparse) {
|
|
553
556
|
const creator = this.getCreator(prefixDefinition);
|
|
554
557
|
const sparseOrUndefined = sparse ?? undefined;
|
|
555
558
|
return this.mapMatrix(matrixSerialComponents, serialComponent => creator.createSerialized(value, serialComponent, sparseOrUndefined));
|
|
556
559
|
}
|
|
557
|
-
concatenate(
|
|
558
|
-
const creator = this.getCreator([[
|
|
559
|
-
return this.mapMatrix(matrixSerialComponents, serialComponent => creator.concatenate(
|
|
560
|
+
concatenate(baseIdentifier, matrixSerialComponents) {
|
|
561
|
+
const creator = this.getCreator([[baseIdentifier.substring(0, !baseIdentifier.startsWith("0") ? PrefixValidator.GS1_COMPANY_PREFIX_MINIMUM_LENGTH : PrefixValidator.UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1), PrefixTypes.GS1CompanyPrefix]]);
|
|
562
|
+
return this.mapMatrix(matrixSerialComponents, serialComponent => creator.concatenate(baseIdentifier, serialComponent));
|
|
560
563
|
}
|
|
561
564
|
}
|
|
562
565
|
__decorate([
|
|
563
566
|
ProxyMethod({
|
|
564
|
-
type:
|
|
567
|
+
type: Types.String,
|
|
565
568
|
isMatrix: true
|
|
566
569
|
}),
|
|
567
570
|
__param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
568
571
|
__param(1, ProxyParameter(singleValueParameterDescriptor)),
|
|
569
572
|
__param(2, ProxyParameter(serialComponentParameterDescriptor)),
|
|
570
573
|
__param(3, ProxyParameter(sparseParameterDescriptor))
|
|
571
|
-
],
|
|
574
|
+
], SerializableNumericIdentifierCreatorProxy.prototype, "createSerialized", null);
|
|
572
575
|
__decorate([
|
|
573
576
|
ProxyMethod({
|
|
574
|
-
type:
|
|
577
|
+
type: Types.String,
|
|
575
578
|
isMatrix: true
|
|
576
579
|
}),
|
|
577
|
-
__param(0, ProxyParameter(
|
|
580
|
+
__param(0, ProxyParameter(baseIdentifierParameterDescriptor)),
|
|
578
581
|
__param(1, ProxyParameter(serialComponentParameterDescriptor))
|
|
579
|
-
],
|
|
582
|
+
], SerializableNumericIdentifierCreatorProxy.prototype, "concatenate", null);
|
|
580
583
|
const referenceParameterDescriptor = {
|
|
581
584
|
name: "reference",
|
|
582
|
-
type:
|
|
585
|
+
type: Types.String,
|
|
583
586
|
isMatrix: true,
|
|
584
587
|
isRequired: true
|
|
585
588
|
};
|
|
586
|
-
class
|
|
589
|
+
class NonNumericIdentifierCreatorProxy extends IdentifierCreatorProxy {
|
|
587
590
|
create(prefixDefinition, matrixReferences) {
|
|
588
591
|
const creator = this.getCreator(prefixDefinition);
|
|
589
592
|
return this.mapMatrix(matrixReferences, reference => creator.create(reference));
|
|
@@ -591,13 +594,13 @@ class NonNumericIdentificationKeyCreatorProxy extends IdentificationKeyCreatorPr
|
|
|
591
594
|
}
|
|
592
595
|
__decorate([
|
|
593
596
|
ProxyMethod({
|
|
594
|
-
type:
|
|
597
|
+
type: Types.String,
|
|
595
598
|
isMatrix: true
|
|
596
599
|
}),
|
|
597
600
|
__param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
598
601
|
__param(1, ProxyParameter(referenceParameterDescriptor))
|
|
599
|
-
],
|
|
600
|
-
let GTINCreatorProxy = class GTINCreatorProxy extends
|
|
602
|
+
], NonNumericIdentifierCreatorProxy.prototype, "create", null);
|
|
603
|
+
let GTINCreatorProxy = class GTINCreatorProxy extends NumericIdentifierCreatorProxy {
|
|
601
604
|
constructor(appExtension) {
|
|
602
605
|
super(appExtension, prefixManager => prefixManager.gtinCreator);
|
|
603
606
|
}
|
|
@@ -612,7 +615,7 @@ let GTINCreatorProxy = class GTINCreatorProxy extends NumericIdentificationKeyCr
|
|
|
612
615
|
};
|
|
613
616
|
__decorate([
|
|
614
617
|
ProxyMethod({
|
|
615
|
-
type:
|
|
618
|
+
type: Types.String,
|
|
616
619
|
isMatrix: true,
|
|
617
620
|
ignoreInfix: true
|
|
618
621
|
}),
|
|
@@ -623,7 +626,7 @@ __decorate([
|
|
|
623
626
|
], GTINCreatorProxy.prototype, "createGTIN14", null);
|
|
624
627
|
__decorate([
|
|
625
628
|
ProxyMethod({
|
|
626
|
-
type:
|
|
629
|
+
type: Types.String,
|
|
627
630
|
isMatrix: true,
|
|
628
631
|
ignoreInfix: true
|
|
629
632
|
}),
|
|
@@ -644,7 +647,7 @@ GTINCreatorProxy = __decorate([
|
|
|
644
647
|
})
|
|
645
648
|
], GTINCreatorProxy);
|
|
646
649
|
export { GTINCreatorProxy };
|
|
647
|
-
let GLNCreatorProxy = class GLNCreatorProxy extends
|
|
650
|
+
let GLNCreatorProxy = class GLNCreatorProxy extends NonGTINNumericIdentifierCreatorProxy {
|
|
648
651
|
constructor(appExtension) {
|
|
649
652
|
super(appExtension, prefixManager => prefixManager.glnCreator);
|
|
650
653
|
}
|
|
@@ -656,7 +659,7 @@ GLNCreatorProxy = __decorate([
|
|
|
656
659
|
})
|
|
657
660
|
], GLNCreatorProxy);
|
|
658
661
|
export { GLNCreatorProxy };
|
|
659
|
-
let SSCCCreatorProxy = class SSCCCreatorProxy extends
|
|
662
|
+
let SSCCCreatorProxy = class SSCCCreatorProxy extends NonGTINNumericIdentifierCreatorProxy {
|
|
660
663
|
constructor(appExtension) {
|
|
661
664
|
super(appExtension, prefixManager => prefixManager.ssccCreator);
|
|
662
665
|
}
|
|
@@ -668,7 +671,7 @@ SSCCCreatorProxy = __decorate([
|
|
|
668
671
|
})
|
|
669
672
|
], SSCCCreatorProxy);
|
|
670
673
|
export { SSCCCreatorProxy };
|
|
671
|
-
let GRAICreatorProxy = class GRAICreatorProxy extends
|
|
674
|
+
let GRAICreatorProxy = class GRAICreatorProxy extends SerializableNumericIdentifierCreatorProxy {
|
|
672
675
|
constructor(appExtension) {
|
|
673
676
|
super(appExtension, prefixManager => prefixManager.graiCreator);
|
|
674
677
|
}
|
|
@@ -680,7 +683,7 @@ GRAICreatorProxy = __decorate([
|
|
|
680
683
|
})
|
|
681
684
|
], GRAICreatorProxy);
|
|
682
685
|
export { GRAICreatorProxy };
|
|
683
|
-
let GIAICreatorProxy = class GIAICreatorProxy extends
|
|
686
|
+
let GIAICreatorProxy = class GIAICreatorProxy extends NonNumericIdentifierCreatorProxy {
|
|
684
687
|
constructor(appExtension) {
|
|
685
688
|
super(appExtension, prefixManager => prefixManager.giaiCreator);
|
|
686
689
|
}
|
|
@@ -692,7 +695,7 @@ GIAICreatorProxy = __decorate([
|
|
|
692
695
|
})
|
|
693
696
|
], GIAICreatorProxy);
|
|
694
697
|
export { GIAICreatorProxy };
|
|
695
|
-
let GSRNCreatorProxy = class GSRNCreatorProxy extends
|
|
698
|
+
let GSRNCreatorProxy = class GSRNCreatorProxy extends NonGTINNumericIdentifierCreatorProxy {
|
|
696
699
|
constructor(appExtension) {
|
|
697
700
|
super(appExtension, prefixManager => prefixManager.gsrnCreator);
|
|
698
701
|
}
|
|
@@ -704,7 +707,7 @@ GSRNCreatorProxy = __decorate([
|
|
|
704
707
|
})
|
|
705
708
|
], GSRNCreatorProxy);
|
|
706
709
|
export { GSRNCreatorProxy };
|
|
707
|
-
let GDTICreatorProxy = class GDTICreatorProxy extends
|
|
710
|
+
let GDTICreatorProxy = class GDTICreatorProxy extends SerializableNumericIdentifierCreatorProxy {
|
|
708
711
|
constructor(appExtension) {
|
|
709
712
|
super(appExtension, prefixManager => prefixManager.gdtiCreator);
|
|
710
713
|
}
|
|
@@ -716,7 +719,7 @@ GDTICreatorProxy = __decorate([
|
|
|
716
719
|
})
|
|
717
720
|
], GDTICreatorProxy);
|
|
718
721
|
export { GDTICreatorProxy };
|
|
719
|
-
let GINCCreatorProxy = class GINCCreatorProxy extends
|
|
722
|
+
let GINCCreatorProxy = class GINCCreatorProxy extends NonNumericIdentifierCreatorProxy {
|
|
720
723
|
constructor(appExtension) {
|
|
721
724
|
super(appExtension, prefixManager => prefixManager.gincCreator);
|
|
722
725
|
}
|
|
@@ -728,7 +731,7 @@ GINCCreatorProxy = __decorate([
|
|
|
728
731
|
})
|
|
729
732
|
], GINCCreatorProxy);
|
|
730
733
|
export { GINCCreatorProxy };
|
|
731
|
-
let GSINCreatorProxy = class GSINCreatorProxy extends
|
|
734
|
+
let GSINCreatorProxy = class GSINCreatorProxy extends NonGTINNumericIdentifierCreatorProxy {
|
|
732
735
|
constructor(appExtension) {
|
|
733
736
|
super(appExtension, prefixManager => prefixManager.gsinCreator);
|
|
734
737
|
}
|
|
@@ -740,7 +743,7 @@ GSINCreatorProxy = __decorate([
|
|
|
740
743
|
})
|
|
741
744
|
], GSINCreatorProxy);
|
|
742
745
|
export { GSINCreatorProxy };
|
|
743
|
-
let GCNCreatorProxy = class GCNCreatorProxy extends
|
|
746
|
+
let GCNCreatorProxy = class GCNCreatorProxy extends SerializableNumericIdentifierCreatorProxy {
|
|
744
747
|
constructor(appExtension) {
|
|
745
748
|
super(appExtension, prefixManager => prefixManager.gcnCreator);
|
|
746
749
|
}
|
|
@@ -752,7 +755,7 @@ GCNCreatorProxy = __decorate([
|
|
|
752
755
|
})
|
|
753
756
|
], GCNCreatorProxy);
|
|
754
757
|
export { GCNCreatorProxy };
|
|
755
|
-
let CPIDCreatorProxy = class CPIDCreatorProxy extends
|
|
758
|
+
let CPIDCreatorProxy = class CPIDCreatorProxy extends NonNumericIdentifierCreatorProxy {
|
|
756
759
|
constructor(appExtension) {
|
|
757
760
|
super(appExtension, prefixManager => prefixManager.cpidCreator);
|
|
758
761
|
}
|
|
@@ -764,7 +767,7 @@ CPIDCreatorProxy = __decorate([
|
|
|
764
767
|
})
|
|
765
768
|
], CPIDCreatorProxy);
|
|
766
769
|
export { CPIDCreatorProxy };
|
|
767
|
-
let GMNCreatorProxy = class GMNCreatorProxy extends
|
|
770
|
+
let GMNCreatorProxy = class GMNCreatorProxy extends NonNumericIdentifierCreatorProxy {
|
|
768
771
|
constructor(appExtension) {
|
|
769
772
|
super(appExtension, prefixManager => prefixManager.gmnCreator);
|
|
770
773
|
}
|
|
@@ -776,4 +779,4 @@ GMNCreatorProxy = __decorate([
|
|
|
776
779
|
})
|
|
777
780
|
], GMNCreatorProxy);
|
|
778
781
|
export { GMNCreatorProxy };
|
|
779
|
-
//# sourceMappingURL=
|
|
782
|
+
//# sourceMappingURL=identifier-proxy.js.map
|