@aidc-toolkit/app-extension 0.9.20-beta → 0.9.21-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app-extension.iml +3 -1
- package/dist/app-utility-proxy.js +6 -6
- package/dist/app-utility-proxy.js.map +1 -1
- package/dist/descriptor.d.ts +10 -6
- package/dist/descriptor.d.ts.map +1 -1
- package/dist/descriptor.js +6 -7
- package/dist/descriptor.js.map +1 -1
- package/dist/generator/generator.js +2 -2
- package/dist/generator/generator.js.map +1 -1
- package/dist/gs1/check-proxy.js +8 -8
- package/dist/gs1/check-proxy.js.map +1 -1
- package/dist/gs1/{idkey-proxy.d.ts → identifier-proxy.d.ts} +44 -43
- package/dist/gs1/identifier-proxy.d.ts.map +1 -0
- package/dist/gs1/{idkey-proxy.js → identifier-proxy.js} +113 -110
- package/dist/gs1/identifier-proxy.js.map +1 -0
- package/dist/gs1/index.d.ts +1 -1
- package/dist/gs1/index.d.ts.map +1 -1
- package/dist/gs1/index.js +1 -1
- package/dist/gs1/index.js.map +1 -1
- package/dist/locale/en/locale-strings.d.ts +3 -3
- package/dist/locale/en/locale-strings.js +11 -11
- package/dist/locale/en/locale-strings.js.map +1 -1
- package/dist/locale/fr/locale-strings.d.ts +3 -3
- package/dist/locale/fr/locale-strings.js +4 -4
- package/dist/locale/fr/locale-strings.js.map +1 -1
- package/dist/utility/character-set-descriptor.d.ts.map +1 -1
- package/dist/utility/character-set-descriptor.js +2 -2
- package/dist/utility/character-set-descriptor.js.map +1 -1
- package/dist/utility/character-set-proxy.js +7 -7
- package/dist/utility/character-set-proxy.js.map +1 -1
- package/dist/utility/reg-exp-proxy.js +5 -5
- package/dist/utility/reg-exp-proxy.js.map +1 -1
- package/dist/utility/string-descriptor.d.ts.map +1 -1
- package/dist/utility/string-descriptor.js +2 -2
- package/dist/utility/string-descriptor.js.map +1 -1
- package/dist/utility/transformer-descriptor.d.ts.map +1 -1
- package/dist/utility/transformer-descriptor.js +3 -3
- package/dist/utility/transformer-descriptor.js.map +1 -1
- package/dist/utility/transformer-proxy.js +6 -6
- package/dist/utility/transformer-proxy.js.map +1 -1
- package/package.json +1 -1
- package/src/app-utility-proxy.ts +6 -6
- package/src/descriptor.ts +11 -6
- package/src/generator/generator.ts +2 -2
- package/src/generator/locale-strings-generator.ts +1 -1
- package/src/generator/logger.ts +18 -7
- package/src/gs1/check-proxy.ts +8 -8
- package/src/gs1/{idkey-proxy.ts → identifier-proxy.ts} +125 -120
- package/src/gs1/index.ts +1 -1
- package/src/locale/en/locale-strings.ts +11 -11
- package/src/locale/fr/locale-strings.ts +4 -4
- package/src/utility/character-set-descriptor.ts +2 -2
- package/src/utility/character-set-proxy.ts +7 -7
- package/src/utility/reg-exp-proxy.ts +5 -5
- package/src/utility/string-descriptor.ts +2 -2
- package/src/utility/transformer-descriptor.ts +3 -3
- package/src/utility/transformer-proxy.ts +6 -6
- package/dist/gs1/idkey-proxy.d.ts.map +0 -1
- package/dist/gs1/idkey-proxy.js.map +0 -1
package/src/app-utility-proxy.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter,
|
|
1
|
+
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "./descriptor.js";
|
|
2
2
|
import { LibProxy } from "./lib-proxy.js";
|
|
3
3
|
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
4
4
|
import { type ErrorExtends, isNullish, type Matrix, type NonNullishable, type Nullishable } from "./types.js";
|
|
5
5
|
|
|
6
6
|
const spillMatrix: ParameterDescriptor = {
|
|
7
7
|
name: "spillMatrix",
|
|
8
|
-
type:
|
|
8
|
+
type: Types.Any,
|
|
9
9
|
isMatrix: true,
|
|
10
10
|
isRequired: true
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const spillMaximumParameterDescriptor: ParameterDescriptor = {
|
|
14
14
|
name: "spillMaximum",
|
|
15
|
-
type:
|
|
15
|
+
type: Types.Number,
|
|
16
16
|
isMatrix: false,
|
|
17
17
|
isRequired: false
|
|
18
18
|
};
|
|
@@ -56,7 +56,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
56
56
|
* Version.
|
|
57
57
|
*/
|
|
58
58
|
@ProxyMethod({
|
|
59
|
-
type:
|
|
59
|
+
type: Types.String,
|
|
60
60
|
isMatrix: false
|
|
61
61
|
})
|
|
62
62
|
version(): string {
|
|
@@ -124,7 +124,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
124
124
|
*/
|
|
125
125
|
@ProxyMethod({
|
|
126
126
|
requiresContext: true,
|
|
127
|
-
type:
|
|
127
|
+
type: Types.Any,
|
|
128
128
|
isMatrix: true
|
|
129
129
|
})
|
|
130
130
|
async vSpill(
|
|
@@ -203,7 +203,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
|
|
|
203
203
|
*/
|
|
204
204
|
@ProxyMethod({
|
|
205
205
|
requiresContext: true,
|
|
206
|
-
type:
|
|
206
|
+
type: Types.Any,
|
|
207
207
|
isMatrix: true
|
|
208
208
|
})
|
|
209
209
|
async hSpill(
|
package/src/descriptor.ts
CHANGED
|
@@ -12,27 +12,32 @@ interface Descriptor {
|
|
|
12
12
|
/**
|
|
13
13
|
* Types supported by proxy methods.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export const Types = {
|
|
16
16
|
/**
|
|
17
17
|
* String.
|
|
18
18
|
*/
|
|
19
|
-
String,
|
|
19
|
+
String: 0,
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Number or enumeration.
|
|
23
23
|
*/
|
|
24
|
-
Number,
|
|
24
|
+
Number: 1,
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Boolean.
|
|
28
28
|
*/
|
|
29
|
-
Boolean,
|
|
29
|
+
Boolean: 2,
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Any.
|
|
33
33
|
*/
|
|
34
|
-
Any
|
|
35
|
-
}
|
|
34
|
+
Any: 3
|
|
35
|
+
} as const;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Type.
|
|
39
|
+
*/
|
|
40
|
+
export type Type = typeof Types[keyof typeof Types];
|
|
36
41
|
|
|
37
42
|
/**
|
|
38
43
|
* Type descriptor.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { I18nEnvironments } from "@aidc-toolkit/core";
|
|
2
2
|
import type { ParseKeys } from "i18next";
|
|
3
3
|
import { expandParameterDescriptor, getClassDescriptors } from "../descriptor.js";
|
|
4
4
|
import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n.js";
|
|
@@ -182,7 +182,7 @@ export abstract class Generator {
|
|
|
182
182
|
async generate(): Promise<void> {
|
|
183
183
|
let success = false;
|
|
184
184
|
|
|
185
|
-
await i18nAppExtensionInit(
|
|
185
|
+
await i18nAppExtensionInit(I18nEnvironments.CLI);
|
|
186
186
|
|
|
187
187
|
this.initialize();
|
|
188
188
|
|
|
@@ -297,7 +297,7 @@ class LocaleStringsGenerator extends Generator {
|
|
|
297
297
|
if (parametersSequencerEntry.isUsed) {
|
|
298
298
|
this._parametersLocaleStrings[parameterName] = {
|
|
299
299
|
name: parameterName,
|
|
300
|
-
description: ""
|
|
300
|
+
description: "*** LOCALIZATION REQUIRED ***"
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
|
package/src/generator/logger.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { Logger } from "tslog";
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Log levels.
|
|
5
|
+
*/
|
|
6
|
+
export const LogLevels = {
|
|
7
|
+
Silly: 0,
|
|
8
|
+
Trace: 1,
|
|
9
|
+
Debug: 2,
|
|
10
|
+
Info: 3,
|
|
11
|
+
Warn: 4,
|
|
12
|
+
Error: 5,
|
|
13
|
+
Fatal: 6
|
|
14
|
+
} as const;
|
|
15
|
+
|
|
3
16
|
/**
|
|
4
17
|
* Log level.
|
|
5
18
|
*/
|
|
6
|
-
|
|
7
|
-
Silly, Trace, Debug, Info, Warn, Error, Fatal
|
|
8
|
-
}
|
|
19
|
+
export type LogLevel = typeof LogLevels[keyof typeof LogLevels];
|
|
9
20
|
|
|
10
21
|
/**
|
|
11
22
|
* Logger with a default minimum level of Info.
|
|
12
23
|
*/
|
|
13
24
|
export const logger = new Logger({
|
|
14
|
-
minLevel:
|
|
25
|
+
minLevel: LogLevels.Info
|
|
15
26
|
});
|
|
16
27
|
|
|
17
28
|
/**
|
|
@@ -20,11 +31,11 @@ export const logger = new Logger({
|
|
|
20
31
|
* @param logLevel
|
|
21
32
|
* Log level as enumeration value or string.
|
|
22
33
|
*/
|
|
23
|
-
export function setLogLevel(logLevel:
|
|
34
|
+
export function setLogLevel(logLevel: string | number): void {
|
|
24
35
|
if (typeof logLevel === "string") {
|
|
25
|
-
if (logLevel in
|
|
36
|
+
if (logLevel in LogLevels) {
|
|
26
37
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- String exists as a key.
|
|
27
|
-
logger.settings.minLevel =
|
|
38
|
+
logger.settings.minLevel = LogLevels[logLevel as keyof typeof LogLevels];
|
|
28
39
|
} else {
|
|
29
40
|
logger.error(`Unknown log level ${logLevel}`);
|
|
30
41
|
}
|
package/src/gs1/check-proxy.ts
CHANGED
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
isValidPriceOrWeightCheckDigit,
|
|
7
7
|
priceOrWeightCheckDigit
|
|
8
8
|
} from "@aidc-toolkit/gs1";
|
|
9
|
-
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter,
|
|
9
|
+
import { type ParameterDescriptor, ProxyClass, ProxyMethod, ProxyParameter, Types } from "../descriptor.js";
|
|
10
10
|
import { LibProxy } from "../lib-proxy.js";
|
|
11
11
|
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../types.js";
|
|
12
12
|
|
|
13
13
|
const checkSParameterDescriptor: ParameterDescriptor = {
|
|
14
14
|
name: "checkS",
|
|
15
|
-
type:
|
|
15
|
+
type: Types.String,
|
|
16
16
|
isMatrix: true,
|
|
17
17
|
isRequired: true
|
|
18
18
|
};
|
|
@@ -57,7 +57,7 @@ const ai82SWithCheckCharacterPairParameterDescriptor: ParameterDescriptor = {
|
|
|
57
57
|
})
|
|
58
58
|
export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
59
59
|
@ProxyMethod({
|
|
60
|
-
type:
|
|
60
|
+
type: Types.String,
|
|
61
61
|
isMatrix: true
|
|
62
62
|
})
|
|
63
63
|
checkDigit(
|
|
@@ -67,7 +67,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@ProxyMethod({
|
|
70
|
-
type:
|
|
70
|
+
type: Types.String,
|
|
71
71
|
isMatrix: true
|
|
72
72
|
})
|
|
73
73
|
hasValidCheckDigit(
|
|
@@ -77,7 +77,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
@ProxyMethod({
|
|
80
|
-
type:
|
|
80
|
+
type: Types.String,
|
|
81
81
|
isMatrix: true
|
|
82
82
|
})
|
|
83
83
|
priceOrWeightCheckDigit(
|
|
@@ -87,7 +87,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
@ProxyMethod({
|
|
90
|
-
type:
|
|
90
|
+
type: Types.String,
|
|
91
91
|
isMatrix: false
|
|
92
92
|
})
|
|
93
93
|
isValidPriceOrWeightCheckDigit(
|
|
@@ -101,7 +101,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
@ProxyMethod({
|
|
104
|
-
type:
|
|
104
|
+
type: Types.String,
|
|
105
105
|
isMatrix: true
|
|
106
106
|
})
|
|
107
107
|
checkCharacterPair(
|
|
@@ -111,7 +111,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@ProxyMethod({
|
|
114
|
-
type:
|
|
114
|
+
type: Types.String,
|
|
115
115
|
isMatrix: true
|
|
116
116
|
})
|
|
117
117
|
hasValidCheckCharacterPair(
|