@aidc-toolkit/app-extension 1.0.24-beta → 1.0.26-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +109 -50
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +59 -37
- package/dist/index.d.ts +59 -37
- package/dist/index.js +111 -65
- package/dist/index.js.map +1 -1
- package/package.json +14 -9
- package/src/app-extension.ts +2 -2
- package/src/app-utility-proxy.ts +4 -4
- package/src/descriptor.ts +9 -4
- package/src/generator/descriptor.ts +1 -1
- package/src/generator/generator.ts +24 -6
- package/src/generator/index.ts +2 -2
- package/src/generator/locale-resources-generator.ts +9 -9
- package/src/gs1/character-set-proxy.ts +18 -8
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/identifier-proxy.ts +70 -66
- package/src/gs1/index.ts +3 -3
- package/src/index.ts +9 -9
- package/src/lib-proxy.ts +3 -3
- package/src/locale/en/locale-resources.ts +9 -0
- package/src/locale/fr/locale-resources.ts +9 -0
- package/src/locale/i18n.ts +3 -3
- package/src/locale/i18next.d.ts +1 -1
- package/src/type.ts +1 -1
- package/src/utility/character-set-descriptor.ts +1 -1
- package/src/utility/character-set-proxy.ts +28 -17
- package/src/utility/index.ts +3 -3
- package/src/utility/reg-exp-proxy.ts +4 -4
- package/src/utility/string-descriptor.ts +1 -1
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-descriptor.ts +1 -1
- package/src/utility/transformer-proxy.ts +4 -4
- package/tsconfig-config.json +4 -0
- package/tsconfig-src.json +11 -0
- package/tsconfig.json +9 -4
- package/tsup.config.ts +3 -2
|
@@ -1,41 +1,38 @@
|
|
|
1
1
|
import { isNullish, type Nullishable } from "@aidc-toolkit/core";
|
|
2
2
|
import {
|
|
3
|
-
CPID_VALIDATOR,
|
|
4
|
-
GCN_VALIDATOR,
|
|
5
|
-
GDTI_VALIDATOR,
|
|
6
|
-
GIAI_VALIDATOR,
|
|
7
|
-
GINC_VALIDATOR,
|
|
8
|
-
GLN_VALIDATOR,
|
|
9
|
-
GMN_VALIDATOR,
|
|
10
|
-
GRAI_VALIDATOR,
|
|
11
|
-
GSIN_VALIDATOR,
|
|
12
|
-
GSRN_VALIDATOR,
|
|
13
|
-
GTIN12_VALIDATOR,
|
|
14
|
-
GTIN13_VALIDATOR,
|
|
15
|
-
GTIN8_VALIDATOR,
|
|
16
3
|
GTINCreator,
|
|
4
|
+
type GTINDescriptor,
|
|
17
5
|
type GTINLevel,
|
|
6
|
+
GTINTypes,
|
|
18
7
|
GTINValidator,
|
|
19
8
|
type IdentifierCreator,
|
|
9
|
+
type IdentifierDescriptor,
|
|
10
|
+
type IdentifierType,
|
|
11
|
+
type IdentifierTypes,
|
|
12
|
+
type IdentifierTypeValidator,
|
|
20
13
|
type IdentifierValidation,
|
|
21
|
-
|
|
14
|
+
IdentifierValidators,
|
|
22
15
|
type NonGTINNumericIdentifierCreator,
|
|
23
|
-
type
|
|
16
|
+
type NonGTINNumericIdentifierDescriptor,
|
|
17
|
+
type NonGTINNumericIdentifierType,
|
|
24
18
|
type NonNumericIdentifierCreator,
|
|
19
|
+
type NonNumericIdentifierDescriptor,
|
|
20
|
+
type NonNumericIdentifierType,
|
|
25
21
|
type NonNumericIdentifierValidation,
|
|
26
|
-
type NonNumericIdentifierValidator,
|
|
27
22
|
type NumericIdentifierCreator,
|
|
28
|
-
type
|
|
23
|
+
type NumericIdentifierDescriptor,
|
|
24
|
+
type NumericIdentifierType,
|
|
25
|
+
type NumericIdentifierValidation,
|
|
29
26
|
PrefixManager,
|
|
30
27
|
type PrefixType,
|
|
31
28
|
PrefixTypes,
|
|
32
29
|
PrefixValidator,
|
|
33
30
|
type SerializableNumericIdentifierCreator,
|
|
34
|
-
type
|
|
35
|
-
|
|
31
|
+
type SerializableNumericIdentifierDescriptor,
|
|
32
|
+
type SerializableNumericIdentifierType
|
|
36
33
|
} from "@aidc-toolkit/gs1";
|
|
37
34
|
import { Sequence } from "@aidc-toolkit/utility";
|
|
38
|
-
import type { AppExtension } from "../app-extension";
|
|
35
|
+
import type { AppExtension } from "../app-extension.js";
|
|
39
36
|
import {
|
|
40
37
|
expandParameterDescriptor,
|
|
41
38
|
type ParameterDescriptor,
|
|
@@ -43,17 +40,17 @@ import {
|
|
|
43
40
|
ProxyMethod,
|
|
44
41
|
ProxyParameter,
|
|
45
42
|
Types
|
|
46
|
-
} from "../descriptor";
|
|
47
|
-
import { LibProxy } from "../lib-proxy";
|
|
48
|
-
import { i18nextAppExtension } from "../locale/i18n";
|
|
49
|
-
import type { ErrorExtends, Matrix, MatrixResultError } from "../type";
|
|
50
|
-
import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor";
|
|
51
|
-
import { StringProxy } from "../utility/string-proxy";
|
|
43
|
+
} from "../descriptor.js";
|
|
44
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
45
|
+
import { i18nextAppExtension } from "../locale/i18n.js";
|
|
46
|
+
import type { ErrorExtends, Matrix, MatrixResultError } from "../type.js";
|
|
47
|
+
import { exclusionAllNumericParameterDescriptor } from "../utility/character-set-descriptor.js";
|
|
48
|
+
import { StringProxy } from "../utility/string-proxy.js";
|
|
52
49
|
import {
|
|
53
50
|
countParameterDescriptor,
|
|
54
51
|
startValueParameterDescriptor,
|
|
55
52
|
valueParameterDescriptor
|
|
56
|
-
} from "../utility/transformer-descriptor";
|
|
53
|
+
} from "../utility/transformer-descriptor.js";
|
|
57
54
|
|
|
58
55
|
const identifierParameterDescriptor: ParameterDescriptor = {
|
|
59
56
|
name: "identifier",
|
|
@@ -68,21 +65,21 @@ const validateIdentifierParameterDescriptor: ParameterDescriptor = {
|
|
|
68
65
|
name: "validateIdentifier"
|
|
69
66
|
};
|
|
70
67
|
|
|
71
|
-
abstract class IdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
|
|
72
|
-
private readonly _validator:
|
|
68
|
+
abstract class IdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TIdentifierType extends IdentifierType> extends StringProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
69
|
+
private readonly _validator: IdentifierTypeValidator<TIdentifierType>;
|
|
73
70
|
|
|
74
|
-
protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, validator:
|
|
71
|
+
protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, validator: IdentifierTypeValidator<TIdentifierType>) {
|
|
75
72
|
super(appExtension);
|
|
76
73
|
|
|
77
74
|
this._validator = validator;
|
|
78
75
|
}
|
|
79
76
|
|
|
80
|
-
protected get validator():
|
|
77
|
+
protected get validator(): IdentifierTypeValidator<TIdentifierType> {
|
|
81
78
|
return this._validator;
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
81
|
|
|
85
|
-
abstract class NumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
|
|
82
|
+
abstract class NumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNumericIdentifierType extends NumericIdentifierType> extends IdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt, TNumericIdentifierType> {
|
|
86
83
|
@ProxyMethod({
|
|
87
84
|
type: Types.String,
|
|
88
85
|
isMatrix: true
|
|
@@ -94,16 +91,16 @@ abstract class NumericIdentifierValidatorProxy<ThrowError extends boolean, TErro
|
|
|
94
91
|
}
|
|
95
92
|
}
|
|
96
93
|
|
|
97
|
-
abstract class GTINValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt,
|
|
94
|
+
abstract class GTINValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt, typeof IdentifierTypes.GTIN> {
|
|
98
95
|
}
|
|
99
96
|
|
|
100
|
-
abstract class NonGTINNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt,
|
|
97
|
+
abstract class NonGTINNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNonGTINNumericIdentifierType extends NonGTINNumericIdentifierType = NonGTINNumericIdentifierType> extends NumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt, TNonGTINNumericIdentifierType> {
|
|
101
98
|
}
|
|
102
99
|
|
|
103
|
-
abstract class SerializableNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt,
|
|
100
|
+
abstract class SerializableNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt, SerializableNumericIdentifierType> {
|
|
104
101
|
}
|
|
105
102
|
|
|
106
|
-
abstract class NonNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends IdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt,
|
|
103
|
+
abstract class NonNumericIdentifierValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends IdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonNumericIdentifierType> {
|
|
107
104
|
@ProxyMethod({
|
|
108
105
|
type: Types.String,
|
|
109
106
|
isMatrix: true
|
|
@@ -124,7 +121,7 @@ abstract class NonNumericIdentifierValidatorProxy<ThrowError extends boolean, TE
|
|
|
124
121
|
})
|
|
125
122
|
export class GTIN13ValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends GTINValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
126
123
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
127
|
-
super(appExtension,
|
|
124
|
+
super(appExtension, IdentifierValidators.GTIN[GTINTypes.GTIN13]);
|
|
128
125
|
}
|
|
129
126
|
}
|
|
130
127
|
|
|
@@ -134,7 +131,7 @@ export class GTIN13ValidatorProxy<ThrowError extends boolean, TError extends Err
|
|
|
134
131
|
})
|
|
135
132
|
export class GTIN12ValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends GTINValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
136
133
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
137
|
-
super(appExtension,
|
|
134
|
+
super(appExtension, IdentifierValidators.GTIN[GTINTypes.GTIN12]);
|
|
138
135
|
}
|
|
139
136
|
}
|
|
140
137
|
|
|
@@ -144,7 +141,7 @@ export class GTIN12ValidatorProxy<ThrowError extends boolean, TError extends Err
|
|
|
144
141
|
})
|
|
145
142
|
export class GTIN8ValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends GTINValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
146
143
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
147
|
-
super(appExtension,
|
|
144
|
+
super(appExtension, IdentifierValidators.GTIN[GTINTypes.GTIN8]);
|
|
148
145
|
}
|
|
149
146
|
}
|
|
150
147
|
|
|
@@ -312,9 +309,9 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
312
309
|
namespace: "GS1",
|
|
313
310
|
methodInfix: "GLN"
|
|
314
311
|
})
|
|
315
|
-
export class GLNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt
|
|
312
|
+
export class GLNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
316
313
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
317
|
-
super(appExtension,
|
|
314
|
+
super(appExtension, IdentifierValidators.GLN);
|
|
318
315
|
}
|
|
319
316
|
}
|
|
320
317
|
|
|
@@ -322,9 +319,9 @@ export class GLNValidatorProxy<ThrowError extends boolean, TError extends ErrorE
|
|
|
322
319
|
namespace: "GS1",
|
|
323
320
|
methodInfix: "SSCC"
|
|
324
321
|
})
|
|
325
|
-
export class SSCCValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt
|
|
322
|
+
export class SSCCValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
326
323
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
327
|
-
super(appExtension,
|
|
324
|
+
super(appExtension, IdentifierValidators.SSCC);
|
|
328
325
|
}
|
|
329
326
|
}
|
|
330
327
|
|
|
@@ -334,7 +331,7 @@ export class SSCCValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
334
331
|
})
|
|
335
332
|
export class GRAIValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends SerializableNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
336
333
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
337
|
-
super(appExtension,
|
|
334
|
+
super(appExtension, IdentifierValidators.GRAI);
|
|
338
335
|
}
|
|
339
336
|
}
|
|
340
337
|
|
|
@@ -344,7 +341,7 @@ export class GRAIValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
344
341
|
})
|
|
345
342
|
export class GIAIValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
346
343
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
347
|
-
super(appExtension,
|
|
344
|
+
super(appExtension, IdentifierValidators.GIAI);
|
|
348
345
|
}
|
|
349
346
|
}
|
|
350
347
|
|
|
@@ -352,9 +349,9 @@ export class GIAIValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
352
349
|
namespace: "GS1",
|
|
353
350
|
methodInfix: "GSRN"
|
|
354
351
|
})
|
|
355
|
-
export class GSRNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt
|
|
352
|
+
export class GSRNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
356
353
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
357
|
-
super(appExtension,
|
|
354
|
+
super(appExtension, IdentifierValidators.GSRN);
|
|
358
355
|
}
|
|
359
356
|
}
|
|
360
357
|
|
|
@@ -364,7 +361,7 @@ export class GSRNValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
364
361
|
})
|
|
365
362
|
export class GDTIValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends SerializableNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
366
363
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
367
|
-
super(appExtension,
|
|
364
|
+
super(appExtension, IdentifierValidators.GDTI);
|
|
368
365
|
}
|
|
369
366
|
}
|
|
370
367
|
|
|
@@ -374,7 +371,7 @@ export class GDTIValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
374
371
|
})
|
|
375
372
|
export class GINCValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
376
373
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
377
|
-
super(appExtension,
|
|
374
|
+
super(appExtension, IdentifierValidators.GINC);
|
|
378
375
|
}
|
|
379
376
|
}
|
|
380
377
|
|
|
@@ -382,9 +379,9 @@ export class GINCValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
382
379
|
namespace: "GS1",
|
|
383
380
|
methodInfix: "GSIN"
|
|
384
381
|
})
|
|
385
|
-
export class GSINValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt
|
|
382
|
+
export class GSINValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
386
383
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
387
|
-
super(appExtension,
|
|
384
|
+
super(appExtension, IdentifierValidators.GSIN);
|
|
388
385
|
}
|
|
389
386
|
}
|
|
390
387
|
|
|
@@ -394,7 +391,7 @@ export class GSINValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
394
391
|
})
|
|
395
392
|
export class GCNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends SerializableNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
396
393
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
397
|
-
super(appExtension,
|
|
394
|
+
super(appExtension, IdentifierValidators.GCN);
|
|
398
395
|
}
|
|
399
396
|
}
|
|
400
397
|
|
|
@@ -404,7 +401,7 @@ export class GCNValidatorProxy<ThrowError extends boolean, TError extends ErrorE
|
|
|
404
401
|
})
|
|
405
402
|
export class CPIDValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
406
403
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
407
|
-
super(appExtension,
|
|
404
|
+
super(appExtension, IdentifierValidators.CPID);
|
|
408
405
|
}
|
|
409
406
|
}
|
|
410
407
|
|
|
@@ -414,7 +411,7 @@ export class CPIDValidatorProxy<ThrowError extends boolean, TError extends Error
|
|
|
414
411
|
})
|
|
415
412
|
export class GMNValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonNumericIdentifierValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
416
413
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
417
|
-
super(appExtension,
|
|
414
|
+
super(appExtension, IdentifierValidators.GMN);
|
|
418
415
|
}
|
|
419
416
|
}
|
|
420
417
|
|
|
@@ -474,8 +471,8 @@ export class PrefixManagerProxy<ThrowError extends boolean, TError extends Error
|
|
|
474
471
|
}
|
|
475
472
|
}
|
|
476
473
|
|
|
477
|
-
abstract class IdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TIdentifierCreator extends IdentifierCreator
|
|
478
|
-
private static readonly PREFIX_TYPES: PrefixType
|
|
474
|
+
abstract class IdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TIdentifierDescriptor extends IdentifierDescriptor, TIdentifierValidation extends IdentifierValidation, TIdentifierCreator extends IdentifierCreator<TIdentifierDescriptor, TIdentifierValidation>> extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
475
|
+
private static readonly PREFIX_TYPES: Array<PrefixType | undefined> = [PrefixTypes.GS1CompanyPrefix, PrefixTypes.UPCCompanyPrefix, PrefixTypes.GS18Prefix];
|
|
479
476
|
|
|
480
477
|
private readonly _getCreator: (prefixManager: PrefixManager) => TIdentifierCreator;
|
|
481
478
|
|
|
@@ -515,7 +512,14 @@ abstract class IdentifierCreatorProxy<ThrowError extends boolean, TError extends
|
|
|
515
512
|
}));
|
|
516
513
|
}
|
|
517
514
|
|
|
518
|
-
const
|
|
515
|
+
const prefixType = IdentifierCreatorProxy.PREFIX_TYPES[prefixTypeIndex];
|
|
516
|
+
|
|
517
|
+
// Undefined is included in type in case of invalid input.
|
|
518
|
+
if (prefixType === undefined) {
|
|
519
|
+
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.invalidPrefixType"));
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const prefixManager = PrefixManager.get(prefixType, prefix);
|
|
519
523
|
|
|
520
524
|
const tweakFactor = reducedPrefixDefinition[2];
|
|
521
525
|
|
|
@@ -540,7 +544,7 @@ const sparseParameterDescriptor: ParameterDescriptor = {
|
|
|
540
544
|
isRequired: false
|
|
541
545
|
};
|
|
542
546
|
|
|
543
|
-
abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNumericIdentifierCreator extends NumericIdentifierCreator
|
|
547
|
+
abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNumericIdentifierDescriptor extends NumericIdentifierDescriptor, TNumericIdentifierCreator extends NumericIdentifierCreator<TNumericIdentifierDescriptor>> extends IdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, TNumericIdentifierDescriptor, NumericIdentifierValidation, TNumericIdentifierCreator> {
|
|
544
548
|
@ProxyMethod({
|
|
545
549
|
type: Types.String,
|
|
546
550
|
isMatrix: true
|
|
@@ -588,7 +592,7 @@ abstract class NumericIdentifierCreatorProxy<ThrowError extends boolean, TError
|
|
|
588
592
|
}
|
|
589
593
|
}
|
|
590
594
|
|
|
591
|
-
abstract class NonGTINNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNonGTINNumericIdentifierCreator extends NonGTINNumericIdentifierCreator> extends NumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, TNonGTINNumericIdentifierCreator> {
|
|
595
|
+
abstract class NonGTINNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, TNonGTINNumericIdentifierDescriptor extends NonGTINNumericIdentifierDescriptor, TNonGTINNumericIdentifierCreator extends NonGTINNumericIdentifierCreator> extends NumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, TNonGTINNumericIdentifierDescriptor, TNonGTINNumericIdentifierCreator> {
|
|
592
596
|
}
|
|
593
597
|
|
|
594
598
|
const singleValueParameterDescriptor: ParameterDescriptor = {
|
|
@@ -609,7 +613,7 @@ const serialComponentParameterDescriptor: ParameterDescriptor = {
|
|
|
609
613
|
isRequired: true
|
|
610
614
|
};
|
|
611
615
|
|
|
612
|
-
abstract class SerializableNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, SerializableNumericIdentifierCreator> {
|
|
616
|
+
abstract class SerializableNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, SerializableNumericIdentifierDescriptor, SerializableNumericIdentifierCreator> {
|
|
613
617
|
@ProxyMethod({
|
|
614
618
|
type: Types.String,
|
|
615
619
|
isMatrix: true
|
|
@@ -648,7 +652,7 @@ const referenceParameterDescriptor: ParameterDescriptor = {
|
|
|
648
652
|
isRequired: true
|
|
649
653
|
};
|
|
650
654
|
|
|
651
|
-
abstract class NonNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends IdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonNumericIdentifierCreator> {
|
|
655
|
+
abstract class NonNumericIdentifierCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends IdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonNumericIdentifierDescriptor, NonNumericIdentifierValidation, NonNumericIdentifierCreator> {
|
|
652
656
|
@ProxyMethod({
|
|
653
657
|
type: Types.String,
|
|
654
658
|
isMatrix: true
|
|
@@ -673,7 +677,7 @@ abstract class NonNumericIdentifierCreatorProxy<ThrowError extends boolean, TErr
|
|
|
673
677
|
}
|
|
674
678
|
]
|
|
675
679
|
})
|
|
676
|
-
export class GTINCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, GTINCreator> {
|
|
680
|
+
export class GTINCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, GTINDescriptor, GTINCreator> {
|
|
677
681
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
678
682
|
super(appExtension, prefixManager => prefixManager.gtinCreator);
|
|
679
683
|
}
|
|
@@ -714,7 +718,7 @@ export class GTINCreatorProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
714
718
|
namespace: "GS1",
|
|
715
719
|
methodInfix: "GLN"
|
|
716
720
|
})
|
|
717
|
-
export class GLNCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierCreator> {
|
|
721
|
+
export class GLNCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierDescriptor, NonGTINNumericIdentifierCreator> {
|
|
718
722
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
719
723
|
super(appExtension, prefixManager => prefixManager.glnCreator);
|
|
720
724
|
}
|
|
@@ -724,7 +728,7 @@ export class GLNCreatorProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
724
728
|
namespace: "GS1",
|
|
725
729
|
methodInfix: "SSCC"
|
|
726
730
|
})
|
|
727
|
-
export class SSCCCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierCreator> {
|
|
731
|
+
export class SSCCCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierDescriptor, NonGTINNumericIdentifierCreator> {
|
|
728
732
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
729
733
|
super(appExtension, prefixManager => prefixManager.ssccCreator);
|
|
730
734
|
}
|
|
@@ -754,7 +758,7 @@ export class GIAICreatorProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
754
758
|
namespace: "GS1",
|
|
755
759
|
methodInfix: "GSRN"
|
|
756
760
|
})
|
|
757
|
-
export class GSRNCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierCreator> {
|
|
761
|
+
export class GSRNCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierDescriptor, NonGTINNumericIdentifierCreator> {
|
|
758
762
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
759
763
|
super(appExtension, prefixManager => prefixManager.gsrnCreator);
|
|
760
764
|
}
|
|
@@ -784,7 +788,7 @@ export class GINCCreatorProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
784
788
|
namespace: "GS1",
|
|
785
789
|
methodInfix: "GSIN"
|
|
786
790
|
})
|
|
787
|
-
export class GSINCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierCreator> {
|
|
791
|
+
export class GSINCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends NonGTINNumericIdentifierCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt, NonGTINNumericIdentifierDescriptor, NonGTINNumericIdentifierCreator> {
|
|
788
792
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
789
793
|
super(appExtension, prefixManager => prefixManager.gsinCreator);
|
|
790
794
|
}
|
package/src/gs1/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "./character-set-proxy";
|
|
2
|
-
export * from "./check-proxy";
|
|
3
|
-
export * from "./identifier-proxy";
|
|
1
|
+
export * from "./character-set-proxy.js";
|
|
2
|
+
export * from "./check-proxy.js";
|
|
3
|
+
export * from "./identifier-proxy.js";
|
package/src/index.ts
CHANGED
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
export * from "./locale/i18n";
|
|
18
|
-
export type * from "./type";
|
|
19
|
-
export * from "./app-extension";
|
|
20
|
-
export * from "./lib-proxy";
|
|
21
|
-
export * from "./descriptor";
|
|
22
|
-
export * from "./app-utility-proxy";
|
|
23
|
-
export * from "./utility/index";
|
|
24
|
-
export * as GS1 from "./gs1/index";
|
|
25
|
-
export * from "./generator/index";
|
|
17
|
+
export * from "./locale/i18n.js";
|
|
18
|
+
export type * from "./type.js";
|
|
19
|
+
export * from "./app-extension.js";
|
|
20
|
+
export * from "./lib-proxy.js";
|
|
21
|
+
export * from "./descriptor.js";
|
|
22
|
+
export * from "./app-utility-proxy.js";
|
|
23
|
+
export * from "./utility/index.js";
|
|
24
|
+
export * as GS1 from "./gs1/index.js";
|
|
25
|
+
export * from "./generator/index.js";
|
package/src/lib-proxy.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mapIterable } from "@aidc-toolkit/utility";
|
|
2
|
-
import type { AppExtension } from "./app-extension";
|
|
3
|
-
import { i18nextAppExtension } from "./locale/i18n";
|
|
4
|
-
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./type";
|
|
2
|
+
import type { AppExtension } from "./app-extension.js";
|
|
3
|
+
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
4
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "./type.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Library proxy.
|
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
prefixDefinitionMustHaveMaximumThreeElements: "Prefix definition must have a maximum of 3 elements",
|
|
13
13
|
prefixMustBeString: "Prefix must be a string",
|
|
14
14
|
prefixTypeMustBeNumber: "Prefix type must be a number in the range of 0 to {{maximumPrefixType, number}}",
|
|
15
|
+
invalidPrefixType: "Invalid prefix type",
|
|
15
16
|
tweakFactorMustBeNumber: "Tweak factor must be a number"
|
|
16
17
|
},
|
|
17
18
|
Parameters: {
|
|
@@ -354,6 +355,14 @@ export default {
|
|
|
354
355
|
name: "valueForAI39",
|
|
355
356
|
description: "Get the value for a GS1 AI 39 encodable character set string."
|
|
356
357
|
},
|
|
358
|
+
validateAI64: {
|
|
359
|
+
name: "validateAI64",
|
|
360
|
+
description: "Validate a GS1 AI 64 encodable character set string."
|
|
361
|
+
},
|
|
362
|
+
isValidAI64: {
|
|
363
|
+
name: "isValidAI64",
|
|
364
|
+
description: "Determine if a string is GS1 AI 64 encodable character set."
|
|
365
|
+
},
|
|
357
366
|
checkDigit: {
|
|
358
367
|
name: "checkDigit",
|
|
359
368
|
description: "Calculate the check digit for a numeric string."
|
|
@@ -12,6 +12,7 @@ export default {
|
|
|
12
12
|
prefixDefinitionMustHaveMaximumThreeElements: "La définition du préfixe doit comporter un maximum de 3 éléments",
|
|
13
13
|
prefixMustBeString: "Le préfixe doit être une chaîne",
|
|
14
14
|
prefixTypeMustBeNumber: "Le type de préfixe doit être un nombre compris entre 0 et {{maximumPrefixType, number}}",
|
|
15
|
+
invalidPrefixType: "Type de préfixe invalide",
|
|
15
16
|
tweakFactorMustBeNumber: "Le facteur de réglage doit être un nombre"
|
|
16
17
|
},
|
|
17
18
|
Parameters: {
|
|
@@ -354,6 +355,14 @@ export default {
|
|
|
354
355
|
name: "valeurDeAI39",
|
|
355
356
|
description: "Obtenez la valeur d'une chaîne de caractères GS1 AI 39."
|
|
356
357
|
},
|
|
358
|
+
validateAI64: {
|
|
359
|
+
name: "validerAI64",
|
|
360
|
+
description: "Valider une chaîne de caractères GS1 AI 64."
|
|
361
|
+
},
|
|
362
|
+
isValidAI64: {
|
|
363
|
+
name: "estValideAI64",
|
|
364
|
+
description: "Déterminer si une chaîne est un jeu de caractères GS1 AI 64."
|
|
365
|
+
},
|
|
357
366
|
checkDigit: {
|
|
358
367
|
name: "chiffreDeControle",
|
|
359
368
|
description: "Calculer le chiffre de contrôle pour une chaîne numérique."
|
package/src/locale/i18n.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { i18nCoreInit, type I18nEnvironment } from "@aidc-toolkit/core";
|
|
|
2
2
|
import { gs1Resources, i18nGS1Init } from "@aidc-toolkit/gs1";
|
|
3
3
|
import { i18nUtilityInit, utilityResources } from "@aidc-toolkit/utility";
|
|
4
4
|
import i18next, { type i18n, type Resource } from "i18next";
|
|
5
|
-
import enLocaleResources from "./en/locale-resources";
|
|
6
|
-
import frLocaleResources from "./fr/locale-resources";
|
|
5
|
+
import enLocaleResources from "./en/locale-resources.js";
|
|
6
|
+
import frLocaleResources from "./fr/locale-resources.js";
|
|
7
7
|
|
|
8
8
|
export const appExtensionNS = "aidct_app_extension";
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ export const appExtensionResources: Resource = {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
// Explicit type is necessary
|
|
27
|
+
// Explicit type is necessary because type can't be inferred without additional references.
|
|
28
28
|
export const i18nextAppExtension: i18n = i18next.createInstance();
|
|
29
29
|
|
|
30
30
|
/**
|
package/src/locale/i18next.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GS1LocaleResources } from "@aidc-toolkit/gs1";
|
|
2
2
|
import type { UtilityLocaleResources } from "@aidc-toolkit/utility";
|
|
3
|
-
import type { AppExtensionLocaleResources } from "./i18n";
|
|
3
|
+
import type { AppExtensionLocaleResources } from "./i18n.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Internationalization module.
|
package/src/type.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Type that error type is expected to extend. If the application framework reports errors through the throw/catch
|
|
3
|
-
* mechanism, the error type is expected to extend {@
|
|
3
|
+
* mechanism, the error type is expected to extend {@linkcode Error}. Otherwise, it may extend any object type.
|
|
4
4
|
*
|
|
5
5
|
* @template ThrowError
|
|
6
6
|
* If true, errors are reported through the throw/catch mechanism.
|
|
@@ -4,12 +4,13 @@ import {
|
|
|
4
4
|
ALPHANUMERIC_CREATOR,
|
|
5
5
|
type CharacterSetCreator,
|
|
6
6
|
type CharacterSetValidation,
|
|
7
|
+
type CharacterSetValidator,
|
|
7
8
|
type Exclusion,
|
|
8
9
|
HEXADECIMAL_CREATOR,
|
|
9
10
|
NUMERIC_CREATOR,
|
|
10
11
|
Sequence
|
|
11
12
|
} from "@aidc-toolkit/utility";
|
|
12
|
-
import type { AppExtension } from "../app-extension";
|
|
13
|
+
import type { AppExtension } from "../app-extension.js";
|
|
13
14
|
import {
|
|
14
15
|
expandParameterDescriptor,
|
|
15
16
|
type ParameterDescriptor,
|
|
@@ -17,22 +18,22 @@ import {
|
|
|
17
18
|
ProxyMethod,
|
|
18
19
|
ProxyParameter,
|
|
19
20
|
Types
|
|
20
|
-
} from "../descriptor";
|
|
21
|
-
import { LibProxy } from "../lib-proxy";
|
|
22
|
-
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type";
|
|
21
|
+
} from "../descriptor.js";
|
|
22
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
23
|
+
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../type.js";
|
|
23
24
|
import {
|
|
24
25
|
exclusionAnyParameterDescriptor,
|
|
25
26
|
exclusionFirstZeroParameterDescriptor,
|
|
26
27
|
exclusionNoneParameterDescriptor
|
|
27
|
-
} from "./character-set-descriptor";
|
|
28
|
-
import { sParameterDescriptor, validateSParameterDescriptor } from "./string-descriptor";
|
|
29
|
-
import { StringProxy } from "./string-proxy";
|
|
28
|
+
} from "./character-set-descriptor.js";
|
|
29
|
+
import { sParameterDescriptor, validateSParameterDescriptor } from "./string-descriptor.js";
|
|
30
|
+
import { StringProxy } from "./string-proxy.js";
|
|
30
31
|
import {
|
|
31
32
|
countParameterDescriptor,
|
|
32
33
|
startValueParameterDescriptor,
|
|
33
34
|
tweakParameterDescriptor,
|
|
34
35
|
valueParameterDescriptor
|
|
35
|
-
} from "./transformer-descriptor";
|
|
36
|
+
} from "./transformer-descriptor.js";
|
|
36
37
|
|
|
37
38
|
const lengthParameterDescriptor: ParameterDescriptor = {
|
|
38
39
|
name: "length",
|
|
@@ -46,13 +47,13 @@ const valueForSParameterDescriptor: ParameterDescriptor = {
|
|
|
46
47
|
name: "valueForS"
|
|
47
48
|
};
|
|
48
49
|
|
|
49
|
-
export abstract class
|
|
50
|
-
private readonly
|
|
50
|
+
export abstract class CharacterSetValidatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends StringProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
51
|
+
private readonly _characterSetValidator: CharacterSetValidator;
|
|
51
52
|
|
|
52
|
-
protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>,
|
|
53
|
+
protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, characterSetValidator: CharacterSetValidator) {
|
|
53
54
|
super(appExtension);
|
|
54
55
|
|
|
55
|
-
this.
|
|
56
|
+
this._characterSetValidator = characterSetValidator;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
@ProxyMethod({
|
|
@@ -63,7 +64,7 @@ export abstract class CharacterSetProxy<ThrowError extends boolean, TError exten
|
|
|
63
64
|
@ProxyParameter(validateSParameterDescriptor) matrixSs: Matrix<string>,
|
|
64
65
|
@ProxyParameter(exclusionNoneParameterDescriptor) exclusion: Nullishable<Exclusion>
|
|
65
66
|
): MatrixResultError<string, ThrowError, TError> {
|
|
66
|
-
return this.validateString(this.
|
|
67
|
+
return this.validateString(this._characterSetValidator, matrixSs, {
|
|
67
68
|
exclusion: exclusion ?? undefined
|
|
68
69
|
} satisfies CharacterSetValidation);
|
|
69
70
|
}
|
|
@@ -78,6 +79,16 @@ export abstract class CharacterSetProxy<ThrowError extends boolean, TError exten
|
|
|
78
79
|
): MatrixResultError<boolean, ThrowError, TError> {
|
|
79
80
|
return this.isValidString(this.validate(matrixSs, exclusion));
|
|
80
81
|
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export abstract class CharacterSetCreatorProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetValidatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
85
|
+
private readonly _characterSetCreator: CharacterSetCreator;
|
|
86
|
+
|
|
87
|
+
protected constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>, characterSetCreator: CharacterSetCreator) {
|
|
88
|
+
super(appExtension, characterSetCreator);
|
|
89
|
+
|
|
90
|
+
this._characterSetCreator = characterSetCreator;
|
|
91
|
+
}
|
|
81
92
|
|
|
82
93
|
@ProxyMethod({
|
|
83
94
|
type: Types.String,
|
|
@@ -140,7 +151,7 @@ export abstract class CharacterSetProxy<ThrowError extends boolean, TError exten
|
|
|
140
151
|
}
|
|
141
152
|
]
|
|
142
153
|
})
|
|
143
|
-
export class NumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends
|
|
154
|
+
export class NumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
144
155
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
145
156
|
super(appExtension, NUMERIC_CREATOR);
|
|
146
157
|
}
|
|
@@ -155,7 +166,7 @@ export class NumericProxy<ThrowError extends boolean, TError extends ErrorExtend
|
|
|
155
166
|
}
|
|
156
167
|
]
|
|
157
168
|
})
|
|
158
|
-
export class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends
|
|
169
|
+
export class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
159
170
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
160
171
|
super(appExtension, HEXADECIMAL_CREATOR);
|
|
161
172
|
}
|
|
@@ -164,7 +175,7 @@ export class HexadecimalProxy<ThrowError extends boolean, TError extends ErrorEx
|
|
|
164
175
|
@ProxyClass({
|
|
165
176
|
methodInfix: "Alphabetic"
|
|
166
177
|
})
|
|
167
|
-
export class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends
|
|
178
|
+
export class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
168
179
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
169
180
|
super(appExtension, ALPHABETIC_CREATOR);
|
|
170
181
|
}
|
|
@@ -179,7 +190,7 @@ export class AlphabeticProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
179
190
|
}
|
|
180
191
|
]
|
|
181
192
|
})
|
|
182
|
-
export class AlphanumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends
|
|
193
|
+
export class AlphanumericProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetCreatorProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
183
194
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) {
|
|
184
195
|
super(appExtension, ALPHANUMERIC_CREATOR);
|
|
185
196
|
}
|