@aidc-toolkit/app-extension 1.0.49-beta → 1.0.50-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/app-extension-options.d.ts +52 -0
- package/dist/app-extension-options.d.ts.map +1 -0
- package/dist/app-extension-options.js +2 -0
- package/dist/app-extension-options.js.map +1 -0
- package/dist/app-extension.d.ts +15 -31
- package/dist/app-extension.d.ts.map +1 -1
- package/dist/app-extension.js +0 -15
- package/dist/app-extension.js.map +1 -1
- package/dist/app-helper-proxy.d.ts +9 -23
- package/dist/app-helper-proxy.d.ts.map +1 -1
- package/dist/app-helper-proxy.js +27 -26
- package/dist/app-helper-proxy.js.map +1 -1
- package/dist/generator/functions-generator.d.ts +1 -17
- package/dist/generator/functions-generator.d.ts.map +1 -1
- package/dist/generator/functions-generator.js +13 -40
- package/dist/generator/functions-generator.js.map +1 -1
- package/dist/generator/generator.d.ts.map +1 -1
- package/dist/generator/generator.js +17 -14
- package/dist/generator/generator.js.map +1 -1
- package/dist/generator/locale-resources-generator.js +64 -44
- package/dist/generator/locale-resources-generator.js.map +1 -1
- package/dist/gs1/character-set-proxy.d.ts +6 -7
- package/dist/gs1/character-set-proxy.d.ts.map +1 -1
- package/dist/gs1/character-set-proxy.js.map +1 -1
- package/dist/gs1/check-proxy.d.ts +8 -8
- package/dist/gs1/check-proxy.d.ts.map +1 -1
- package/dist/gs1/check-proxy.js.map +1 -1
- package/dist/gs1/gcp-length-proxy.d.ts +6 -6
- package/dist/gs1/gcp-length-proxy.d.ts.map +1 -1
- package/dist/gs1/gcp-length-proxy.js.map +1 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +4 -4
- package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/gtin-creator-proxy.js.map +1 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +12 -12
- package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/gtin-validator-proxy.js.map +1 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +14 -14
- package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/identifier-creator-proxy.js.map +1 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +10 -10
- package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/identifier-validator-proxy.js.map +1 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +22 -23
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -1
- package/dist/gs1/non-gtin-creator-proxy.js.map +1 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +22 -23
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -1
- package/dist/gs1/non-gtin-validator-proxy.js.map +1 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +2 -2
- package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -1
- package/dist/gs1/prefix-manager-proxy.js.map +1 -1
- package/dist/gs1/variable-measure-proxy.d.ts +4 -4
- package/dist/gs1/variable-measure-proxy.d.ts.map +1 -1
- package/dist/gs1/variable-measure-proxy.js.map +1 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +4 -4
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -1
- package/dist/gs1/verified-by-gs1-proxy.js +2 -8
- package/dist/gs1/verified-by-gs1-proxy.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib-proxy.d.ts +12 -26
- package/dist/lib-proxy.d.ts.map +1 -1
- package/dist/lib-proxy.js +1 -18
- package/dist/lib-proxy.js.map +1 -1
- package/dist/locale/en/locale-resources.js +1 -1
- package/dist/locale/en/locale-resources.js.map +1 -1
- package/dist/proxy.d.ts +3 -4
- package/dist/proxy.d.ts.map +1 -1
- package/dist/proxy.js.map +1 -1
- package/dist/streaming.d.ts +2 -2
- package/dist/streaming.d.ts.map +1 -1
- package/dist/type.d.ts +3 -22
- package/dist/type.d.ts.map +1 -1
- package/dist/utility/character-set-proxy.d.ts +17 -16
- package/dist/utility/character-set-proxy.d.ts.map +1 -1
- package/dist/utility/character-set-proxy.js.map +1 -1
- package/dist/utility/reg-exp-proxy.d.ts +2 -2
- package/dist/utility/reg-exp-proxy.d.ts.map +1 -1
- package/dist/utility/reg-exp-proxy.js.map +1 -1
- package/dist/utility/string-proxy.d.ts +2 -2
- package/dist/utility/string-proxy.d.ts.map +1 -1
- package/dist/utility/string-proxy.js.map +1 -1
- package/dist/utility/transformer-proxy.d.ts +6 -5
- package/dist/utility/transformer-proxy.d.ts.map +1 -1
- package/dist/utility/transformer-proxy.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
- package/src/app-extension-options.ts +61 -0
- package/src/app-extension.ts +22 -32
- package/src/app-helper-proxy.ts +21 -33
- package/src/generator/functions-generator.ts +14 -45
- package/src/generator/generator.ts +28 -18
- package/src/generator/locale-resources-generator.ts +79 -52
- package/src/gs1/character-set-proxy.ts +6 -7
- package/src/gs1/check-proxy.ts +8 -8
- package/src/gs1/gcp-length-proxy.ts +8 -8
- package/src/gs1/gtin-creator-proxy.ts +4 -4
- package/src/gs1/gtin-validator-proxy.ts +12 -12
- package/src/gs1/identifier-creator-proxy.ts +14 -14
- package/src/gs1/identifier-validator-proxy.ts +10 -10
- package/src/gs1/non-gtin-creator-proxy.ts +22 -23
- package/src/gs1/non-gtin-validator-proxy.ts +22 -23
- package/src/gs1/prefix-manager-proxy.ts +2 -2
- package/src/gs1/variable-measure-proxy.ts +4 -4
- package/src/gs1/verified-by-gs1-proxy.ts +5 -11
- package/src/index.ts +1 -0
- package/src/lib-proxy.ts +27 -43
- package/src/locale/en/locale-resources.ts +1 -1
- package/src/proxy.ts +12 -15
- package/src/streaming.ts +3 -3
- package/src/type.ts +3 -22
- package/src/utility/character-set-proxy.ts +17 -16
- package/src/utility/reg-exp-proxy.ts +2 -2
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-proxy.ts +6 -5
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
|
@@ -70,21 +70,21 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
70
70
|
readonly #parametersSequencer: ParametersSequencer = {};
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Template parameters locale resources.
|
|
74
74
|
*/
|
|
75
|
-
readonly #
|
|
75
|
+
readonly #templateParametersLocaleResources: LocaleResources = {};
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* Template functions locale resources.
|
|
79
79
|
*/
|
|
80
|
-
readonly #
|
|
80
|
+
readonly #templateFunctionsLocaleResources: LocaleResources = {};
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
*
|
|
83
|
+
* Template locale resources.
|
|
84
84
|
*/
|
|
85
|
-
readonly #
|
|
86
|
-
Parameters: this.#
|
|
87
|
-
Functions: this.#
|
|
85
|
+
readonly #templateLocaleResources: LocaleResources = {
|
|
86
|
+
Parameters: this.#templateParametersLocaleResources,
|
|
87
|
+
Functions: this.#templateFunctionsLocaleResources
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
/**
|
|
@@ -201,7 +201,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
201
201
|
this.#saveParameterSequence(parameterDescriptor, true);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
let functionsLocaleResources = this.#
|
|
204
|
+
let functionsLocaleResources = this.#templateFunctionsLocaleResources;
|
|
205
205
|
|
|
206
206
|
const namespace = classDescriptor.namespace;
|
|
207
207
|
|
|
@@ -234,68 +234,92 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
|
-
* Merge
|
|
237
|
+
* Merge template locale resources into existing import locale resources.
|
|
238
|
+
*
|
|
239
|
+
* @param mergedLocaleResources
|
|
240
|
+
* Merged locale resources.
|
|
238
241
|
*
|
|
239
|
-
* @param
|
|
240
|
-
* If true,
|
|
242
|
+
* @param isDefaultLocale
|
|
243
|
+
* If true, locale being merged is the default.
|
|
241
244
|
*
|
|
242
245
|
* @param parentKey
|
|
243
246
|
* Parent key for logging purposes.
|
|
244
247
|
*
|
|
245
|
-
* @param
|
|
246
|
-
*
|
|
248
|
+
* @param templateLocaleResources
|
|
249
|
+
* Template locale resources.
|
|
247
250
|
*
|
|
248
|
-
* @param
|
|
249
|
-
*
|
|
251
|
+
* @param importLocaleResources
|
|
252
|
+
* Import locale resources.
|
|
250
253
|
*
|
|
251
254
|
* @param addMissing
|
|
252
255
|
* Add missing if true; applies to locale resources that are not regional.
|
|
253
256
|
*
|
|
254
257
|
* @returns
|
|
255
|
-
*
|
|
258
|
+
* True if any changes.
|
|
256
259
|
*/
|
|
257
|
-
#merge(
|
|
260
|
+
#merge(mergedLocaleResources: LocaleResources, isDefaultLocale: boolean, parentKey: string, templateLocaleResources: LocaleResources, importLocaleResources: LocaleResources, addMissing: boolean): boolean {
|
|
261
|
+
let anyChanges = false;
|
|
262
|
+
|
|
258
263
|
// Some entries at the root are not part of the generator output.
|
|
259
264
|
const atRoot = parentKey === "";
|
|
260
265
|
|
|
261
|
-
|
|
266
|
+
if (parentKey.startsWith("Functions.") && "titleCaseName" in importLocaleResources && !("titleCaseName" in templateLocaleResources)) {
|
|
267
|
+
const description = templateLocaleResources["description"];
|
|
268
|
+
|
|
269
|
+
const patchTemplateLocaleResources = templateLocaleResources;
|
|
270
|
+
|
|
271
|
+
// Patch template locale resources to preserve required position of titleCaseName.
|
|
272
|
+
delete patchTemplateLocaleResources["description"];
|
|
273
|
+
patchTemplateLocaleResources["titleCaseName"] = undefined;
|
|
274
|
+
patchTemplateLocaleResources["description"] = description;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
const patchMergedLocaleResources = mergedLocaleResources;
|
|
262
278
|
|
|
263
|
-
|
|
279
|
+
// Copy over or delete any import keys that are not in template.
|
|
280
|
+
for (const [key, importValue] of Object.entries(importLocaleResources)) {
|
|
281
|
+
if (!(key in templateLocaleResources)) {
|
|
282
|
+
if (atRoot) {
|
|
283
|
+
patchMergedLocaleResources[key] = importValue;
|
|
284
|
+
} else {
|
|
285
|
+
if (isDefaultLocale) {
|
|
286
|
+
this.logger.info(`Deleting ${parentKey}${key}...`);
|
|
287
|
+
}
|
|
264
288
|
|
|
265
|
-
|
|
266
|
-
for (const [key, destinationValue] of Object.entries(destinationLocaleResources)) {
|
|
267
|
-
if (!(key in sourceLocaleResources)) {
|
|
268
|
-
if (atRoot || (atFunction && key === "titleCaseName")) {
|
|
269
|
-
newDestinationLocaleResources[key] = destinationValue;
|
|
270
|
-
} else if (logChanges) {
|
|
271
|
-
this.logger.info(`Deleting ${parentKey}${key}...`);
|
|
289
|
+
anyChanges = true;
|
|
272
290
|
}
|
|
273
291
|
}
|
|
274
292
|
}
|
|
275
293
|
|
|
276
|
-
for (const [key,
|
|
277
|
-
if (!(key in
|
|
294
|
+
for (const [key, templateValue] of Object.entries(templateLocaleResources)) {
|
|
295
|
+
if (!(key in importLocaleResources)) {
|
|
278
296
|
if (addMissing) {
|
|
279
|
-
if (
|
|
297
|
+
if (isDefaultLocale) {
|
|
280
298
|
this.logger.info(`Adding ${parentKey}${key}...`);
|
|
281
299
|
}
|
|
282
300
|
|
|
283
|
-
|
|
301
|
+
patchMergedLocaleResources[key] = templateValue;
|
|
302
|
+
|
|
303
|
+
anyChanges = true;
|
|
284
304
|
}
|
|
285
305
|
} else {
|
|
286
|
-
const
|
|
306
|
+
const importValue = importLocaleResources[key];
|
|
287
307
|
|
|
288
|
-
if (typeof
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
308
|
+
if (typeof templateValue === "object" && typeof importValue === "object") {
|
|
309
|
+
patchMergedLocaleResources[key] = {};
|
|
310
|
+
|
|
311
|
+
if (this.#merge(patchMergedLocaleResources[key], isDefaultLocale, `${parentKey}${key}.`, templateValue, importValue, addMissing)) {
|
|
312
|
+
anyChanges = true;
|
|
313
|
+
}
|
|
314
|
+
} else if ((typeof templateValue === "string" || typeof templateValue === "undefined") && (typeof importValue === "string" || typeof importValue === "undefined" || typeof importValue === "object")) {
|
|
315
|
+
patchMergedLocaleResources[key] = importValue;
|
|
292
316
|
} else {
|
|
293
317
|
throw new Error(`Mismatched types at ${parentKey}${key}`);
|
|
294
318
|
}
|
|
295
319
|
}
|
|
296
320
|
}
|
|
297
321
|
|
|
298
|
-
return
|
|
322
|
+
return anyChanges;
|
|
299
323
|
}
|
|
300
324
|
|
|
301
325
|
/**
|
|
@@ -336,7 +360,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
336
360
|
|
|
337
361
|
for (const [parameterName, parametersSequencerEntry] of entries) {
|
|
338
362
|
if (parametersSequencerEntry.isUsed) {
|
|
339
|
-
this.#
|
|
363
|
+
this.#templateParametersLocaleResources[parameterName] = {
|
|
340
364
|
name: parameterName,
|
|
341
365
|
description: "*** LOCALIZATION REQUIRED ***"
|
|
342
366
|
};
|
|
@@ -363,13 +387,14 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
363
387
|
* @returns
|
|
364
388
|
* Output string.
|
|
365
389
|
*/
|
|
366
|
-
static #buildOutput(prefix: string, value: LocaleResources | string, indentLevel: number): string {
|
|
367
|
-
return `${" ".repeat(indentLevel)}${prefix} ${
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
390
|
+
static #buildOutput(prefix: string, value: LocaleResources | string | undefined, indentLevel: number): string {
|
|
391
|
+
return `${" ".repeat(indentLevel)}${prefix} ${
|
|
392
|
+
typeof value === "object" ?
|
|
393
|
+
`{\n${
|
|
394
|
+
Object.entries(value).map(entry => LocaleResourcesGenerator.#buildOutput(`${entry[0]}:`, entry[1], indentLevel + 1)).join(",\n")
|
|
395
|
+
}\n${" ".repeat(indentLevel)}}` :
|
|
396
|
+
// JSON.stringify() will apply quotes as appropriate.
|
|
397
|
+
JSON.stringify(value)
|
|
373
398
|
}`;
|
|
374
399
|
}
|
|
375
400
|
|
|
@@ -380,18 +405,20 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
380
405
|
if (success) {
|
|
381
406
|
this.#buildParametersLocaleResources(this.#parametersSequencer);
|
|
382
407
|
|
|
383
|
-
await Promise.all(fs.
|
|
408
|
+
await Promise.all(await fs.promises.readdir(LocaleResourcesGenerator.#IMPORT_PATH, {
|
|
384
409
|
withFileTypes: true
|
|
385
|
-
}).filter(entry => entry.isDirectory()).map(async (entry) => {
|
|
410
|
+
}).then(entries => entries.filter(entry => entry.isDirectory()).map(async (entry) => {
|
|
386
411
|
const localeResourcesSource = path.resolve(LocaleResourcesGenerator.#IMPORT_PATH, entry.name, "locale-resources.ts");
|
|
387
412
|
|
|
388
|
-
return import(localeResourcesSource).then((module) => {
|
|
389
|
-
|
|
390
|
-
const localeResources = this.#merge(entry.name === "en", "", this.#LocaleResources, (module as LocaleResourcesModule).default, !entry.name.includes("-"));
|
|
413
|
+
return import(localeResourcesSource).then(async (module) => {
|
|
414
|
+
const mergedLocaleResources: LocaleResources = {};
|
|
391
415
|
|
|
392
|
-
|
|
416
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Module format is known.
|
|
417
|
+
return this.#merge(mergedLocaleResources, entry.name === "en", "", this.#templateLocaleResources, (module as LocaleResourcesModule).default, !entry.name.includes("-")) ?
|
|
418
|
+
fs.promises.writeFile(localeResourcesSource, `${LocaleResourcesGenerator.#buildOutput("export default", mergedLocaleResources, 0)};\n`) :
|
|
419
|
+
undefined;
|
|
393
420
|
});
|
|
394
|
-
}));
|
|
421
|
+
})));
|
|
395
422
|
}
|
|
396
423
|
}
|
|
397
424
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AI39_CREATOR, AI64_VALIDATOR, AI82_CREATOR } from "@aidc-toolkit/gs1";
|
|
2
2
|
import type { AppExtension } from "../app-extension.js";
|
|
3
3
|
import { expandParameterDescriptor, proxy } from "../proxy.js";
|
|
4
|
-
import type { ErrorExtends } from "../type.js";
|
|
5
4
|
import {
|
|
6
5
|
exclusionAllNumericParameterDescriptor,
|
|
7
6
|
exclusionNoneParameterDescriptor
|
|
@@ -18,8 +17,8 @@ import { CharacterSetCreatorProxy, CharacterSetValidatorProxy } from "../utility
|
|
|
18
17
|
}
|
|
19
18
|
]
|
|
20
19
|
})
|
|
21
|
-
export class AI82Proxy
|
|
22
|
-
constructor(appExtension: AppExtension
|
|
20
|
+
export class AI82Proxy extends CharacterSetCreatorProxy {
|
|
21
|
+
constructor(appExtension: AppExtension) {
|
|
23
22
|
super(appExtension, AI82_CREATOR);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
@@ -34,8 +33,8 @@ export class AI82Proxy<ThrowError extends boolean, TError extends ErrorExtends<T
|
|
|
34
33
|
}
|
|
35
34
|
]
|
|
36
35
|
})
|
|
37
|
-
export class AI39Proxy
|
|
38
|
-
constructor(appExtension: AppExtension
|
|
36
|
+
export class AI39Proxy extends CharacterSetCreatorProxy {
|
|
37
|
+
constructor(appExtension: AppExtension) {
|
|
39
38
|
super(appExtension, AI39_CREATOR);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
@@ -44,8 +43,8 @@ export class AI39Proxy<ThrowError extends boolean, TError extends ErrorExtends<T
|
|
|
44
43
|
namespace: "GS1",
|
|
45
44
|
methodInfix: "AI64"
|
|
46
45
|
})
|
|
47
|
-
export class AI64Proxy
|
|
48
|
-
constructor(appExtension: AppExtension
|
|
46
|
+
export class AI64Proxy extends CharacterSetValidatorProxy {
|
|
47
|
+
constructor(appExtension: AppExtension) {
|
|
49
48
|
super(appExtension, AI64_VALIDATOR);
|
|
50
49
|
}
|
|
51
50
|
}
|
package/src/gs1/check-proxy.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
10
10
|
import { LibProxy } from "../lib-proxy.js";
|
|
11
11
|
import { proxy } from "../proxy.js";
|
|
12
|
-
import type {
|
|
12
|
+
import type { Matrix, MatrixResult, SingletonResult } from "../type.js";
|
|
13
13
|
|
|
14
14
|
const checkSParameterDescriptor: ParameterDescriptor = {
|
|
15
15
|
name: "checkS",
|
|
@@ -56,13 +56,13 @@ const ai82SWithCheckCharacterPairParameterDescriptor: ExtendsParameterDescriptor
|
|
|
56
56
|
namespace: "GS1",
|
|
57
57
|
category: "checkCharacter"
|
|
58
58
|
})
|
|
59
|
-
export class CheckProxy
|
|
59
|
+
export class CheckProxy extends LibProxy {
|
|
60
60
|
@proxy.describeMethod({
|
|
61
61
|
type: Types.String,
|
|
62
62
|
multiplicity: Multiplicities.Matrix,
|
|
63
63
|
parameterDescriptors: [numericSParameterDescriptor]
|
|
64
64
|
})
|
|
65
|
-
checkDigit(matrixSs: Matrix<string>): MatrixResult<string
|
|
65
|
+
checkDigit(matrixSs: Matrix<string>): MatrixResult<string> {
|
|
66
66
|
return this.matrixResult(matrixSs, s => checkDigit(s));
|
|
67
67
|
}
|
|
68
68
|
|
|
@@ -71,7 +71,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
71
71
|
multiplicity: Multiplicities.Matrix,
|
|
72
72
|
parameterDescriptors: [numericSWithCheckDigitParameterDescriptor]
|
|
73
73
|
})
|
|
74
|
-
hasValidCheckDigit(matrixSs: Matrix<string>): MatrixResult<boolean
|
|
74
|
+
hasValidCheckDigit(matrixSs: Matrix<string>): MatrixResult<boolean> {
|
|
75
75
|
return this.matrixResult(matrixSs, s => hasValidCheckDigit(s));
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -80,7 +80,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
80
80
|
multiplicity: Multiplicities.Matrix,
|
|
81
81
|
parameterDescriptors: [numericSFourOrFiveDigitsParameterDescriptor]
|
|
82
82
|
})
|
|
83
|
-
priceOrWeightCheckDigit(matrixSs: Matrix<string>): MatrixResult<string
|
|
83
|
+
priceOrWeightCheckDigit(matrixSs: Matrix<string>): MatrixResult<string> {
|
|
84
84
|
return this.matrixResult(matrixSs, s => priceOrWeightCheckDigit(s));
|
|
85
85
|
}
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
92
92
|
multiplicity: Multiplicities.Singleton
|
|
93
93
|
}, checkDigitParameterDescriptor]
|
|
94
94
|
})
|
|
95
|
-
isValidPriceOrWeightCheckDigit(s: string, checkDigit: string): SingletonResult<boolean
|
|
95
|
+
isValidPriceOrWeightCheckDigit(s: string, checkDigit: string): SingletonResult<boolean> {
|
|
96
96
|
return this.singletonResult(() => isValidPriceOrWeightCheckDigit(s, checkDigit));
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -101,7 +101,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
101
101
|
multiplicity: Multiplicities.Matrix,
|
|
102
102
|
parameterDescriptors: [ai82SParameterDescriptor]
|
|
103
103
|
})
|
|
104
|
-
checkCharacterPair(matrixSs: Matrix<string>): MatrixResult<string
|
|
104
|
+
checkCharacterPair(matrixSs: Matrix<string>): MatrixResult<string> {
|
|
105
105
|
return this.matrixResult(matrixSs, s => checkCharacterPair(s));
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
110
110
|
multiplicity: Multiplicities.Matrix,
|
|
111
111
|
parameterDescriptors: [ai82SWithCheckCharacterPairParameterDescriptor]
|
|
112
112
|
})
|
|
113
|
-
hasValidCheckCharacterPair(matrixSs: Matrix<string>): MatrixResult<boolean
|
|
113
|
+
hasValidCheckCharacterPair(matrixSs: Matrix<string>): MatrixResult<boolean> {
|
|
114
114
|
return this.matrixResult(matrixSs, s => hasValidCheckCharacterPair(s));
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -4,7 +4,7 @@ import type { AppExtension } from "../app-extension.js";
|
|
|
4
4
|
import { type ExtendsParameterDescriptor, Multiplicities, Types } from "../descriptor.js";
|
|
5
5
|
import { LibProxy } from "../lib-proxy.js";
|
|
6
6
|
import { proxy } from "../proxy.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { Matrix, MatrixResult, SingletonResult } from "../type.js";
|
|
8
8
|
import { identifierParameterDescriptor, identifierTypeParameterDescriptor } from "./identifier-descriptor.js";
|
|
9
9
|
import { validateIdentifierType } from "./identifier-type.js";
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ const gcpLengthIdentifierParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
16
16
|
/**
|
|
17
17
|
* Application extension GCP length cache. Data is stored in application extension shared data.
|
|
18
18
|
*/
|
|
19
|
-
class AppExtensionGCPLengthCache
|
|
19
|
+
class AppExtensionGCPLengthCache extends RemoteGCPLengthCache {
|
|
20
20
|
/**
|
|
21
21
|
* Logger.
|
|
22
22
|
*/
|
|
@@ -28,7 +28,7 @@ class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends Erro
|
|
|
28
28
|
* @param appExtension
|
|
29
29
|
* Application extension.
|
|
30
30
|
*/
|
|
31
|
-
constructor(appExtension: AppExtension
|
|
31
|
+
constructor(appExtension: AppExtension) {
|
|
32
32
|
super(appExtension.sharedAppDataStorage, RemoteGCPLengthCache.DEFAULT_BASE_URL, appExtension.httpFetch);
|
|
33
33
|
|
|
34
34
|
this.#logger = appExtension.logger;
|
|
@@ -100,10 +100,10 @@ class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends Erro
|
|
|
100
100
|
namespace: "GS1",
|
|
101
101
|
category: "service"
|
|
102
102
|
})
|
|
103
|
-
export class GCPLengthProxy
|
|
103
|
+
export class GCPLengthProxy extends LibProxy {
|
|
104
104
|
readonly #gcpLength: GCPLength;
|
|
105
105
|
|
|
106
|
-
constructor(appExtension: AppExtension
|
|
106
|
+
constructor(appExtension: AppExtension) {
|
|
107
107
|
super(appExtension);
|
|
108
108
|
|
|
109
109
|
this.#gcpLength = new GCPLength(new AppExtensionGCPLengthCache(appExtension));
|
|
@@ -128,7 +128,7 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
128
128
|
isAsync: true,
|
|
129
129
|
parameterDescriptors: [identifierTypeParameterDescriptor, gcpLengthIdentifierParameterDescriptor]
|
|
130
130
|
})
|
|
131
|
-
async gcpLengthOf(identifierType: string, matrixIdentifiers: Matrix<string>): Promise<MatrixResult<number
|
|
131
|
+
async gcpLengthOf(identifierType: string, matrixIdentifiers: Matrix<string>): Promise<MatrixResult<number>> {
|
|
132
132
|
return this.#loadGCPLengthData().then(() => this.setUpMatrixResult(
|
|
133
133
|
() => validateIdentifierType(identifierType),
|
|
134
134
|
matrixIdentifiers,
|
|
@@ -142,7 +142,7 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
142
142
|
isAsync: true,
|
|
143
143
|
parameterDescriptors: []
|
|
144
144
|
})
|
|
145
|
-
async gcpLengthDateTime(): Promise<SingletonResult<string
|
|
145
|
+
async gcpLengthDateTime(): Promise<SingletonResult<string>> {
|
|
146
146
|
return this.#loadGCPLengthData().then(() =>
|
|
147
147
|
this.singletonResult(() => this.#gcpLength.dateTime.toISOString())
|
|
148
148
|
);
|
|
@@ -154,7 +154,7 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
154
154
|
isAsync: true,
|
|
155
155
|
parameterDescriptors: []
|
|
156
156
|
})
|
|
157
|
-
async gcpLengthDisclaimer(): Promise<SingletonResult<string
|
|
157
|
+
async gcpLengthDisclaimer(): Promise<SingletonResult<string>> {
|
|
158
158
|
return this.#loadGCPLengthData().then(() =>
|
|
159
159
|
this.singletonResult(() => this.#gcpLength.disclaimer)
|
|
160
160
|
);
|
|
@@ -3,7 +3,7 @@ import type { GTINCreator, GTINType } from "@aidc-toolkit/gs1";
|
|
|
3
3
|
import type { AppExtension } from "../app-extension.js";
|
|
4
4
|
import { Multiplicities, Types } from "../descriptor.js";
|
|
5
5
|
import { expandParameterDescriptor, proxy } from "../proxy.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
7
7
|
import { valueParameterDescriptor } from "../utility/transformer-descriptor.js";
|
|
8
8
|
import { indicatorDigitParameterDescriptor } from "./gtin-descriptor.js";
|
|
9
9
|
import { NumericIdentifierCreatorProxy, sparseParameterDescriptor } from "./identifier-creator-proxy.js";
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
}
|
|
22
22
|
]
|
|
23
23
|
})
|
|
24
|
-
export class GTINCreatorProxy
|
|
25
|
-
constructor(appExtension: AppExtension
|
|
24
|
+
export class GTINCreatorProxy extends NumericIdentifierCreatorProxy<GTINType, GTINCreator> {
|
|
25
|
+
constructor(appExtension: AppExtension) {
|
|
26
26
|
super(appExtension, prefixManager => prefixManager.gtinCreator);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -32,7 +32,7 @@ export class GTINCreatorProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
32
32
|
ignoreInfix: true,
|
|
33
33
|
parameterDescriptors: [indicatorDigitParameterDescriptor, prefixDefinitionAnyParameterDescriptor, valueParameterDescriptor, sparseParameterDescriptor]
|
|
34
34
|
})
|
|
35
|
-
createGTIN14(indicatorDigit: string, prefixDefinition: Matrix<unknown>, matrixValues: Matrix<number | bigint>, sparse: Nullishable<boolean>): MatrixResult<string
|
|
35
|
+
createGTIN14(indicatorDigit: string, prefixDefinition: Matrix<unknown>, matrixValues: Matrix<number | bigint>, sparse: Nullishable<boolean>): MatrixResult<string> {
|
|
36
36
|
const sparseOrUndefined = sparse ?? undefined;
|
|
37
37
|
|
|
38
38
|
return this.setUpMatrixResult(() =>
|
|
@@ -4,7 +4,7 @@ import type { AppExtension } from "../app-extension.js";
|
|
|
4
4
|
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "../descriptor.js";
|
|
5
5
|
import { LibProxy } from "../lib-proxy.js";
|
|
6
6
|
import { proxy } from "../proxy.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
8
8
|
import { indicatorDigitParameterDescriptor } from "./gtin-descriptor.js";
|
|
9
9
|
import { identifierParameterDescriptor } from "./identifier-descriptor.js";
|
|
10
10
|
import { GTINValidatorProxy } from "./identifier-validator-proxy.js";
|
|
@@ -12,8 +12,8 @@ import { GTINValidatorProxy } from "./identifier-validator-proxy.js";
|
|
|
12
12
|
@proxy.describeClass(false, {
|
|
13
13
|
methodInfix: "GTIN13"
|
|
14
14
|
})
|
|
15
|
-
export class GTIN13ValidatorProxy
|
|
16
|
-
constructor(appExtension: AppExtension
|
|
15
|
+
export class GTIN13ValidatorProxy extends GTINValidatorProxy {
|
|
16
|
+
constructor(appExtension: AppExtension) {
|
|
17
17
|
super(appExtension, IdentifierValidators.GTIN[GTINLengths.GTIN13]);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -21,8 +21,8 @@ export class GTIN13ValidatorProxy<ThrowError extends boolean, TError extends Err
|
|
|
21
21
|
@proxy.describeClass(false, {
|
|
22
22
|
methodInfix: "GTIN12"
|
|
23
23
|
})
|
|
24
|
-
export class GTIN12ValidatorProxy
|
|
25
|
-
constructor(appExtension: AppExtension
|
|
24
|
+
export class GTIN12ValidatorProxy extends GTINValidatorProxy {
|
|
25
|
+
constructor(appExtension: AppExtension) {
|
|
26
26
|
super(appExtension, IdentifierValidators.GTIN[GTINLengths.GTIN12]);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -30,8 +30,8 @@ export class GTIN12ValidatorProxy<ThrowError extends boolean, TError extends Err
|
|
|
30
30
|
@proxy.describeClass(false, {
|
|
31
31
|
methodInfix: "GTIN8"
|
|
32
32
|
})
|
|
33
|
-
export class GTIN8ValidatorProxy
|
|
34
|
-
constructor(appExtension: AppExtension
|
|
33
|
+
export class GTIN8ValidatorProxy extends GTINValidatorProxy {
|
|
34
|
+
constructor(appExtension: AppExtension) {
|
|
35
35
|
super(appExtension, IdentifierValidators.GTIN[GTINLengths.GTIN8]);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -77,13 +77,13 @@ const validateGTIN14ParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
77
77
|
namespace: "GS1",
|
|
78
78
|
category: "identifierValidation"
|
|
79
79
|
})
|
|
80
|
-
export class GTINValidatorStaticProxy
|
|
80
|
+
export class GTINValidatorStaticProxy extends LibProxy {
|
|
81
81
|
@proxy.describeMethod({
|
|
82
82
|
type: Types.String,
|
|
83
83
|
multiplicity: Multiplicities.Matrix,
|
|
84
84
|
parameterDescriptors: [zeroSuppressibleGTIN12ParameterDescriptor]
|
|
85
85
|
})
|
|
86
|
-
zeroSuppressGTIN12(matrixGTIN12s: Matrix<string>): MatrixResult<string
|
|
86
|
+
zeroSuppressGTIN12(matrixGTIN12s: Matrix<string>): MatrixResult<string> {
|
|
87
87
|
return this.matrixResult(matrixGTIN12s, gtin12 => GTINValidator.zeroSuppress(gtin12));
|
|
88
88
|
}
|
|
89
89
|
|
|
@@ -92,7 +92,7 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
92
92
|
multiplicity: Multiplicities.Matrix,
|
|
93
93
|
parameterDescriptors: [zeroSuppressedGTIN12ParameterDescriptor]
|
|
94
94
|
})
|
|
95
|
-
zeroExpandGTIN12(matrixZeroSuppressedGTIN12s: Matrix<string>): MatrixResult<string
|
|
95
|
+
zeroExpandGTIN12(matrixZeroSuppressedGTIN12s: Matrix<string>): MatrixResult<string> {
|
|
96
96
|
return this.matrixResult(matrixZeroSuppressedGTIN12s, zeroSuppressedGTIN12 => GTINValidator.zeroExpand(zeroSuppressedGTIN12));
|
|
97
97
|
}
|
|
98
98
|
|
|
@@ -101,7 +101,7 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
101
101
|
multiplicity: Multiplicities.Matrix,
|
|
102
102
|
parameterDescriptors: [indicatorDigitParameterDescriptor, convertGTINParameterDescriptor]
|
|
103
103
|
})
|
|
104
|
-
convertToGTIN14(indicatorDigit: string, matrixGTINs: Matrix<string>): MatrixResult<string
|
|
104
|
+
convertToGTIN14(indicatorDigit: string, matrixGTINs: Matrix<string>): MatrixResult<string> {
|
|
105
105
|
return this.matrixResult(matrixGTINs, gtin => GTINValidator.convertToGTIN14(indicatorDigit, gtin));
|
|
106
106
|
}
|
|
107
107
|
|
|
@@ -110,7 +110,7 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
110
110
|
multiplicity: Multiplicities.Matrix,
|
|
111
111
|
parameterDescriptors: [normalizeGTINParameterDescriptor]
|
|
112
112
|
})
|
|
113
|
-
normalizeGTIN(matrixGTINs: Matrix<string>): MatrixResult<string
|
|
113
|
+
normalizeGTIN(matrixGTINs: Matrix<string>): MatrixResult<string> {
|
|
114
114
|
return this.matrixResult(matrixGTINs, gtin => GTINValidator.normalize(gtin));
|
|
115
115
|
}
|
|
116
116
|
|
|
@@ -25,7 +25,7 @@ import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescript
|
|
|
25
25
|
import { LibProxy } from "../lib-proxy.js";
|
|
26
26
|
import { i18nextAppExtension } from "../locale/i18n.js";
|
|
27
27
|
import { proxy } from "../proxy.js";
|
|
28
|
-
import type {
|
|
28
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
29
29
|
import {
|
|
30
30
|
countParameterDescriptor,
|
|
31
31
|
startValueParameterDescriptor,
|
|
@@ -38,12 +38,12 @@ import { prefixDefinitionGS1UPCParameterDescriptor } from "./prefix-definition-d
|
|
|
38
38
|
namespace: "GS1",
|
|
39
39
|
category: "identifierCreation"
|
|
40
40
|
})
|
|
41
|
-
abstract class IdentifierCreatorProxy<
|
|
41
|
+
abstract class IdentifierCreatorProxy<TIdentifierType extends IdentifierType, TIdentifierValidation extends IdentifierValidation, TIdentifierCreator extends IdentifierCreator<TIdentifierType, TIdentifierValidation>> extends LibProxy {
|
|
42
42
|
static readonly #PREFIX_TYPES: Array<PrefixType | undefined> = [PrefixTypes.GS1CompanyPrefix, PrefixTypes.UPCCompanyPrefix, PrefixTypes.GS18Prefix];
|
|
43
43
|
|
|
44
44
|
readonly #getCreator: (prefixManager: PrefixManager) => TIdentifierCreator;
|
|
45
45
|
|
|
46
|
-
constructor(appExtension: AppExtension
|
|
46
|
+
constructor(appExtension: AppExtension, getCreator: (prefixManager: PrefixManager) => TIdentifierCreator) {
|
|
47
47
|
super(appExtension);
|
|
48
48
|
|
|
49
49
|
this.#getCreator = getCreator;
|
|
@@ -131,13 +131,13 @@ export const sparseParameterDescriptor: ParameterDescriptor = {
|
|
|
131
131
|
};
|
|
132
132
|
|
|
133
133
|
@proxy.describeClass(true)
|
|
134
|
-
export abstract class NumericIdentifierCreatorProxy<
|
|
134
|
+
export abstract class NumericIdentifierCreatorProxy<TNumericIdentifierType extends NumericIdentifierType, TNumericIdentifierCreator extends NumericIdentifierCreator<TNumericIdentifierType>> extends IdentifierCreatorProxy<TNumericIdentifierType, NumericIdentifierValidation, TNumericIdentifierCreator> {
|
|
135
135
|
@proxy.describeMethod({
|
|
136
136
|
type: Types.String,
|
|
137
137
|
multiplicity: Multiplicities.Matrix,
|
|
138
138
|
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, valueParameterDescriptor, sparseParameterDescriptor]
|
|
139
139
|
})
|
|
140
|
-
create(prefixDefinition: Matrix<unknown>, matrixValues: Matrix<number | bigint>, sparse: Nullishable<boolean>): MatrixResult<string
|
|
140
|
+
create(prefixDefinition: Matrix<unknown>, matrixValues: Matrix<number | bigint>, sparse: Nullishable<boolean>): MatrixResult<string> {
|
|
141
141
|
const sparseOrUndefined = sparse ?? undefined;
|
|
142
142
|
|
|
143
143
|
return this.setUpMatrixResult(() =>
|
|
@@ -153,7 +153,7 @@ export abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean,
|
|
|
153
153
|
multiplicity: Multiplicities.Array,
|
|
154
154
|
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, sparseParameterDescriptor]
|
|
155
155
|
})
|
|
156
|
-
createSequence(prefixDefinition: Matrix<unknown>, startValue: number, count: number, sparse: Nullishable<boolean>): MatrixResult<string
|
|
156
|
+
createSequence(prefixDefinition: Matrix<unknown>, startValue: number, count: number, sparse: Nullishable<boolean>): MatrixResult<string> {
|
|
157
157
|
return this.iterableResult(() => {
|
|
158
158
|
this.appExtension.validateSequenceCount(count);
|
|
159
159
|
|
|
@@ -166,7 +166,7 @@ export abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean,
|
|
|
166
166
|
multiplicity: Multiplicities.Array,
|
|
167
167
|
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor]
|
|
168
168
|
})
|
|
169
|
-
createAll(prefixDefinition: Matrix<unknown>): MatrixResult<string
|
|
169
|
+
createAll(prefixDefinition: Matrix<unknown>): MatrixResult<string> {
|
|
170
170
|
return this.iterableResult(() => {
|
|
171
171
|
const creator = this.getCreator(prefixDefinition);
|
|
172
172
|
|
|
@@ -177,10 +177,10 @@ export abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean,
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
abstract class NonGTINNumericIdentifierCreatorProxy<
|
|
180
|
+
abstract class NonGTINNumericIdentifierCreatorProxy<TNonGTINNumericIdentifierType extends NonGTINNumericIdentifierType, TNonGTINNumericIdentifierCreator extends NonGTINNumericIdentifierCreator> extends NumericIdentifierCreatorProxy<TNonGTINNumericIdentifierType, TNonGTINNumericIdentifierCreator> {
|
|
181
181
|
}
|
|
182
182
|
|
|
183
|
-
export abstract class NonSerializableNumericIdentifierCreatorProxy<
|
|
183
|
+
export abstract class NonSerializableNumericIdentifierCreatorProxy<TNonSerializableNumericIdentifierType extends NonSerializableNumericIdentifierType, TNonGTINNumericIdentifierCreator extends NonGTINNumericIdentifierCreator> extends NonGTINNumericIdentifierCreatorProxy<TNonSerializableNumericIdentifierType, TNonGTINNumericIdentifierCreator> {
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
const singleValueParameterDescriptor: ExtendsParameterDescriptor = {
|
|
@@ -202,13 +202,13 @@ const serialComponentParameterDescriptor: ParameterDescriptor = {
|
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
@proxy.describeClass(true)
|
|
205
|
-
export abstract class SerializableNumericIdentifierCreatorProxy
|
|
205
|
+
export abstract class SerializableNumericIdentifierCreatorProxy extends NonGTINNumericIdentifierCreatorProxy<SerializableNumericIdentifierType, SerializableNumericIdentifierCreator> {
|
|
206
206
|
@proxy.describeMethod({
|
|
207
207
|
type: Types.String,
|
|
208
208
|
multiplicity: Multiplicities.Matrix,
|
|
209
209
|
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, singleValueParameterDescriptor, serialComponentParameterDescriptor, sparseParameterDescriptor]
|
|
210
210
|
})
|
|
211
|
-
createSerialized(prefixDefinition: Matrix<unknown>, value: number, matrixSerialComponents: Matrix<string>, sparse: Nullishable<boolean>): MatrixResult<string
|
|
211
|
+
createSerialized(prefixDefinition: Matrix<unknown>, value: number | bigint, matrixSerialComponents: Matrix<string>, sparse: Nullishable<boolean>): MatrixResult<string> {
|
|
212
212
|
const sparseOrUndefined = sparse ?? undefined;
|
|
213
213
|
|
|
214
214
|
return this.setUpMatrixResult(() =>
|
|
@@ -223,7 +223,7 @@ export abstract class SerializableNumericIdentifierCreatorProxy<ThrowError exten
|
|
|
223
223
|
multiplicity: Multiplicities.Matrix,
|
|
224
224
|
parameterDescriptors: [baseIdentifierParameterDescriptor, serialComponentParameterDescriptor]
|
|
225
225
|
})
|
|
226
|
-
concatenate(baseIdentifier: string, matrixSerialComponents: Matrix<string>): MatrixResult<string
|
|
226
|
+
concatenate(baseIdentifier: string, matrixSerialComponents: Matrix<string>): MatrixResult<string> {
|
|
227
227
|
return this.setUpMatrixResult(() =>
|
|
228
228
|
this.getCreator([[baseIdentifier.substring(0, !baseIdentifier.startsWith("0") ? PrefixValidator.GS1_COMPANY_PREFIX_MINIMUM_LENGTH : PrefixValidator.UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1), PrefixTypes.GS1CompanyPrefix]]),
|
|
229
229
|
matrixSerialComponents, (creator, serialComponent) =>
|
|
@@ -240,13 +240,13 @@ const referenceParameterDescriptor: ParameterDescriptor = {
|
|
|
240
240
|
};
|
|
241
241
|
|
|
242
242
|
@proxy.describeClass(true)
|
|
243
|
-
export abstract class NonNumericIdentifierCreatorProxy
|
|
243
|
+
export abstract class NonNumericIdentifierCreatorProxy extends IdentifierCreatorProxy<NonNumericIdentifierType, NonNumericIdentifierValidation, NonNumericIdentifierCreator> {
|
|
244
244
|
@proxy.describeMethod({
|
|
245
245
|
type: Types.String,
|
|
246
246
|
multiplicity: Multiplicities.Matrix,
|
|
247
247
|
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, referenceParameterDescriptor]
|
|
248
248
|
})
|
|
249
|
-
create(prefixDefinition: Matrix<unknown>, matrixReferences: Matrix<string>): MatrixResult<string
|
|
249
|
+
create(prefixDefinition: Matrix<unknown>, matrixReferences: Matrix<string>): MatrixResult<string> {
|
|
250
250
|
return this.setUpMatrixResult(() =>
|
|
251
251
|
this.getCreator(prefixDefinition),
|
|
252
252
|
matrixReferences, (creator, reference) =>
|