@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.
Files changed (59) hide show
  1. package/app-extension.iml +3 -1
  2. package/dist/app-utility-proxy.js +6 -6
  3. package/dist/app-utility-proxy.js.map +1 -1
  4. package/dist/descriptor.d.ts +10 -6
  5. package/dist/descriptor.d.ts.map +1 -1
  6. package/dist/descriptor.js +6 -7
  7. package/dist/descriptor.js.map +1 -1
  8. package/dist/generator/generator.js +2 -2
  9. package/dist/generator/generator.js.map +1 -1
  10. package/dist/gs1/check-proxy.js +8 -8
  11. package/dist/gs1/check-proxy.js.map +1 -1
  12. package/dist/gs1/{idkey-proxy.d.ts → identifier-proxy.d.ts} +44 -43
  13. package/dist/gs1/identifier-proxy.d.ts.map +1 -0
  14. package/dist/gs1/{idkey-proxy.js → identifier-proxy.js} +113 -110
  15. package/dist/gs1/identifier-proxy.js.map +1 -0
  16. package/dist/gs1/index.d.ts +1 -1
  17. package/dist/gs1/index.d.ts.map +1 -1
  18. package/dist/gs1/index.js +1 -1
  19. package/dist/gs1/index.js.map +1 -1
  20. package/dist/locale/en/locale-strings.d.ts +3 -3
  21. package/dist/locale/en/locale-strings.js +11 -11
  22. package/dist/locale/en/locale-strings.js.map +1 -1
  23. package/dist/locale/fr/locale-strings.d.ts +3 -3
  24. package/dist/locale/fr/locale-strings.js +4 -4
  25. package/dist/locale/fr/locale-strings.js.map +1 -1
  26. package/dist/utility/character-set-descriptor.d.ts.map +1 -1
  27. package/dist/utility/character-set-descriptor.js +2 -2
  28. package/dist/utility/character-set-descriptor.js.map +1 -1
  29. package/dist/utility/character-set-proxy.js +7 -7
  30. package/dist/utility/character-set-proxy.js.map +1 -1
  31. package/dist/utility/reg-exp-proxy.js +5 -5
  32. package/dist/utility/reg-exp-proxy.js.map +1 -1
  33. package/dist/utility/string-descriptor.d.ts.map +1 -1
  34. package/dist/utility/string-descriptor.js +2 -2
  35. package/dist/utility/string-descriptor.js.map +1 -1
  36. package/dist/utility/transformer-descriptor.d.ts.map +1 -1
  37. package/dist/utility/transformer-descriptor.js +3 -3
  38. package/dist/utility/transformer-descriptor.js.map +1 -1
  39. package/dist/utility/transformer-proxy.js +6 -6
  40. package/dist/utility/transformer-proxy.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/app-utility-proxy.ts +6 -6
  43. package/src/descriptor.ts +11 -6
  44. package/src/generator/generator.ts +2 -2
  45. package/src/generator/locale-strings-generator.ts +1 -1
  46. package/src/generator/logger.ts +18 -7
  47. package/src/gs1/check-proxy.ts +8 -8
  48. package/src/gs1/{idkey-proxy.ts → identifier-proxy.ts} +125 -120
  49. package/src/gs1/index.ts +1 -1
  50. package/src/locale/en/locale-strings.ts +11 -11
  51. package/src/locale/fr/locale-strings.ts +4 -4
  52. package/src/utility/character-set-descriptor.ts +2 -2
  53. package/src/utility/character-set-proxy.ts +7 -7
  54. package/src/utility/reg-exp-proxy.ts +5 -5
  55. package/src/utility/string-descriptor.ts +2 -2
  56. package/src/utility/transformer-descriptor.ts +3 -3
  57. package/src/utility/transformer-proxy.ts +6 -6
  58. package/dist/gs1/idkey-proxy.d.ts.map +0 -1
  59. 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, PrefixType, SSCC_VALIDATOR } from "@aidc-toolkit/gs1";
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, Type } from "../descriptor.js";
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 identificationKeyParameterDescriptor = {
20
- name: "identificationKey",
21
- type: Type.String,
19
+ const identifierParameterDescriptor = {
20
+ name: "identifier",
21
+ type: Types.String,
22
22
  isMatrix: true,
23
23
  isRequired: true
24
24
  };
25
- const validateIdentificationKeyParameterDescriptor = {
26
- extendsDescriptor: identificationKeyParameterDescriptor,
25
+ const validateIdentifierParameterDescriptor = {
26
+ extendsDescriptor: identifierParameterDescriptor,
27
27
  sortOrder: 0,
28
- name: "validateIdentificationKey"
28
+ name: "validateIdentifier"
29
29
  };
30
- class IdentificationKeyValidatorProxy extends StringProxy {
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 NumericIdentificationKeyValidatorProxy extends IdentificationKeyValidatorProxy {
41
- validate(matrixIdentificationKeys) {
42
- return this.validateString(this.validator, matrixIdentificationKeys);
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: Type.String,
47
+ type: Types.String,
48
48
  isMatrix: true
49
49
  }),
50
- __param(0, ProxyParameter(validateIdentificationKeyParameterDescriptor))
51
- ], NumericIdentificationKeyValidatorProxy.prototype, "validate", null);
52
- class GTINValidatorProxy extends NumericIdentificationKeyValidatorProxy {
50
+ __param(0, ProxyParameter(validateIdentifierParameterDescriptor))
51
+ ], NumericIdentifierValidatorProxy.prototype, "validate", null);
52
+ class GTINValidatorProxy extends NumericIdentifierValidatorProxy {
53
53
  }
54
- class NonGTINNumericIdentificationKeyValidatorProxy extends NumericIdentificationKeyValidatorProxy {
54
+ class NonGTINNumericIdentifierValidatorProxy extends NumericIdentifierValidatorProxy {
55
55
  }
56
- class SerializableNumericIdentificationKeyValidatorProxy extends NonGTINNumericIdentificationKeyValidatorProxy {
56
+ class SerializableNumericIdentifierValidatorProxy extends NonGTINNumericIdentifierValidatorProxy {
57
57
  }
58
- class NonNumericIdentificationKeyValidatorProxy extends IdentificationKeyValidatorProxy {
59
- validate(matrixIdentificationKeys, exclusion) {
60
- return this.validateString(this.validator, matrixIdentificationKeys, {
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: Type.String,
67
+ type: Types.String,
68
68
  isMatrix: true
69
69
  }),
70
- __param(0, ProxyParameter(validateIdentificationKeyParameterDescriptor)),
70
+ __param(0, ProxyParameter(validateIdentifierParameterDescriptor)),
71
71
  __param(1, ProxyParameter(exclusionAllNumericParameterDescriptor))
72
- ], NonNumericIdentificationKeyValidatorProxy.prototype, "validate", null);
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: identificationKeyParameterDescriptor,
110
+ extendsDescriptor: identifierParameterDescriptor,
111
111
  name: "zeroSuppressibleGTIN12"
112
112
  };
113
113
  const zeroSuppressedGTIN12ParameterDescriptor = {
114
- extendsDescriptor: identificationKeyParameterDescriptor,
114
+ extendsDescriptor: identifierParameterDescriptor,
115
115
  name: "zeroSuppressedGTIN12"
116
116
  };
117
117
  const indicatorDigitParameterDescriptor = {
118
118
  name: "indicatorDigit",
119
- type: Type.String,
119
+ type: Types.String,
120
120
  isMatrix: false,
121
121
  isRequired: true
122
122
  };
123
123
  const convertGTINParameterDescriptor = {
124
- extendsDescriptor: identificationKeyParameterDescriptor,
124
+ extendsDescriptor: identifierParameterDescriptor,
125
125
  name: "convertGTIN"
126
126
  };
127
127
  const normalizeGTINParameterDescriptor = {
128
- extendsDescriptor: identificationKeyParameterDescriptor,
128
+ extendsDescriptor: identifierParameterDescriptor,
129
129
  name: "normalizeGTIN"
130
130
  };
131
131
  const validateGTINParameterDescriptor = {
132
- extendsDescriptor: identificationKeyParameterDescriptor,
132
+ extendsDescriptor: identifierParameterDescriptor,
133
133
  name: "validateGTIN"
134
134
  };
135
135
  const gtinLevelParameterDescriptor = {
136
136
  name: "gtinLevel",
137
- type: Type.Number,
137
+ type: Types.Number,
138
138
  isMatrix: false,
139
139
  isRequired: false
140
140
  };
141
141
  const validateGTIN14ParameterDescriptor = {
142
- extendsDescriptor: identificationKeyParameterDescriptor,
142
+ extendsDescriptor: identifierParameterDescriptor,
143
143
  name: "validateGTIN14"
144
144
  };
145
145
  const rcnFormatParameterDescriptor = {
146
146
  name: "rcnFormat",
147
- type: Type.String,
147
+ type: Types.String,
148
148
  isMatrix: false,
149
149
  isRequired: true
150
150
  };
151
151
  const rcnParameterDescriptor = {
152
152
  name: "rcn",
153
- type: Type.String,
153
+ type: Types.String,
154
154
  isMatrix: true,
155
155
  isRequired: true
156
156
  };
157
157
  const rcnItemReferenceParameterDescriptor = {
158
158
  name: "rcnItemReference",
159
- type: Type.Number,
159
+ type: Types.Number,
160
160
  isMatrix: false,
161
161
  isRequired: true
162
162
  };
163
163
  const rcnPriceOrWeightParameterDescriptor = {
164
164
  name: "rcnPriceOrWeight",
165
- type: Type.Number,
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: Type.String,
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: Type.String,
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: Type.String,
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: Type.String,
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: Type.String,
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: Type.String,
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: Type.Number,
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 NonGTINNumericIdentificationKeyValidatorProxy {
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 NonGTINNumericIdentificationKeyValidatorProxy {
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 SerializableNumericIdentificationKeyValidatorProxy {
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 NonNumericIdentificationKeyValidatorProxy {
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 NonGTINNumericIdentificationKeyValidatorProxy {
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 SerializableNumericIdentificationKeyValidatorProxy {
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 NonNumericIdentificationKeyValidatorProxy {
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 NonGTINNumericIdentificationKeyValidatorProxy {
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 SerializableNumericIdentificationKeyValidatorProxy {
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 NonNumericIdentificationKeyValidatorProxy {
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 NonNumericIdentificationKeyValidatorProxy {
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: Type.String,
392
+ type: Types.String,
393
393
  isMatrix: false,
394
394
  isRequired: true
395
395
  };
396
396
  const prefixTypeParameterDescriptor = {
397
397
  name: "prefixType",
398
- type: Type.Number,
398
+ type: Types.Number,
399
399
  isMatrix: false,
400
400
  isRequired: false
401
401
  };
402
402
  const tweakFactorParameterDescriptor = {
403
403
  name: "tweakFactor",
404
- type: Type.Number,
404
+ type: Types.Number,
405
405
  isMatrix: false,
406
406
  isRequired: false
407
407
  };
408
408
  const prefixDefinitionParameterDescriptor = {
409
409
  name: "prefixDefinition",
410
- type: Type.Any,
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 IdentificationKeyCreatorProxy.getCreator().
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: Type.Any,
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 IdentificationKeyCreatorProxy extends LibProxy {
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("IdentificationKeyCreatorProxy.prefixDefinitionMustBeOneDimensional"));
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("IdentificationKeyCreatorProxy.prefixDefinitionMustHaveMaximumThreeElements"));
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("IdentificationKeyCreatorProxy.prefixMustBeString"));
466
+ throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixMustBeString"));
466
467
  }
467
- const prefixType = reducedPrefixDefinition[1] ?? PrefixType.GS1CompanyPrefix;
468
- if (typeof prefixType !== "number") {
469
- throw new RangeError(i18nextAppExtension.t("IdentificationKeyCreatorProxy.prefixTypeMustBeNumber"));
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(prefixType, prefix);
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("IdentificationKeyCreatorProxy.tweakFactorMustBeNumber"));
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: Type.Boolean,
490
+ type: Types.Boolean,
488
491
  isMatrix: false,
489
492
  isRequired: false
490
493
  };
491
- class NumericIdentificationKeyCreatorProxy extends IdentificationKeyCreatorProxy {
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: Type.String,
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
- ], NumericIdentificationKeyCreatorProxy.prototype, "create", null);
518
+ ], NumericIdentifierCreatorProxy.prototype, "create", null);
516
519
  __decorate([
517
520
  ProxyMethod({
518
521
  infixBefore: "Sequence",
519
- type: Type.String,
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
- ], NumericIdentificationKeyCreatorProxy.prototype, "createSequence", null);
529
+ ], NumericIdentifierCreatorProxy.prototype, "createSequence", null);
527
530
  __decorate([
528
531
  ProxyMethod({
529
- type: Type.String,
532
+ type: Types.String,
530
533
  isMatrix: true
531
534
  }),
532
535
  __param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor))
533
- ], NumericIdentificationKeyCreatorProxy.prototype, "createAll", null);
534
- class NonGTINNumericIdentificationKeyCreatorProxy extends NumericIdentificationKeyCreatorProxy {
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 baseIdentificationKeyParameterDescriptor = {
541
- extendsDescriptor: identificationKeyParameterDescriptor,
542
- name: "baseIdentificationKey",
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: Type.String,
550
+ type: Types.String,
548
551
  isMatrix: true,
549
552
  isRequired: true
550
553
  };
551
- class SerializableNumericIdentificationKeyCreatorProxy extends NonGTINNumericIdentificationKeyCreatorProxy {
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(baseIdentificationKey, matrixSerialComponents) {
558
- const creator = this.getCreator([[baseIdentificationKey.substring(0, !baseIdentificationKey.startsWith("0") ? PrefixManager.GS1_COMPANY_PREFIX_MINIMUM_LENGTH : PrefixManager.UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1), PrefixType.GS1CompanyPrefix]]);
559
- return this.mapMatrix(matrixSerialComponents, serialComponent => creator.concatenate(baseIdentificationKey, serialComponent));
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: Type.String,
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
- ], SerializableNumericIdentificationKeyCreatorProxy.prototype, "createSerialized", null);
574
+ ], SerializableNumericIdentifierCreatorProxy.prototype, "createSerialized", null);
572
575
  __decorate([
573
576
  ProxyMethod({
574
- type: Type.String,
577
+ type: Types.String,
575
578
  isMatrix: true
576
579
  }),
577
- __param(0, ProxyParameter(baseIdentificationKeyParameterDescriptor)),
580
+ __param(0, ProxyParameter(baseIdentifierParameterDescriptor)),
578
581
  __param(1, ProxyParameter(serialComponentParameterDescriptor))
579
- ], SerializableNumericIdentificationKeyCreatorProxy.prototype, "concatenate", null);
582
+ ], SerializableNumericIdentifierCreatorProxy.prototype, "concatenate", null);
580
583
  const referenceParameterDescriptor = {
581
584
  name: "reference",
582
- type: Type.String,
585
+ type: Types.String,
583
586
  isMatrix: true,
584
587
  isRequired: true
585
588
  };
586
- class NonNumericIdentificationKeyCreatorProxy extends IdentificationKeyCreatorProxy {
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: Type.String,
597
+ type: Types.String,
595
598
  isMatrix: true
596
599
  }),
597
600
  __param(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
598
601
  __param(1, ProxyParameter(referenceParameterDescriptor))
599
- ], NonNumericIdentificationKeyCreatorProxy.prototype, "create", null);
600
- let GTINCreatorProxy = class GTINCreatorProxy extends NumericIdentificationKeyCreatorProxy {
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: Type.String,
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: Type.String,
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 NonGTINNumericIdentificationKeyCreatorProxy {
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 NonGTINNumericIdentificationKeyCreatorProxy {
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 SerializableNumericIdentificationKeyCreatorProxy {
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 NonNumericIdentificationKeyCreatorProxy {
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 NonGTINNumericIdentificationKeyCreatorProxy {
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 SerializableNumericIdentificationKeyCreatorProxy {
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 NonNumericIdentificationKeyCreatorProxy {
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 NonGTINNumericIdentificationKeyCreatorProxy {
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 SerializableNumericIdentificationKeyCreatorProxy {
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 NonNumericIdentificationKeyCreatorProxy {
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 NonNumericIdentificationKeyCreatorProxy {
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=idkey-proxy.js.map
782
+ //# sourceMappingURL=identifier-proxy.js.map