@aidc-toolkit/app-extension 1.0.48-beta → 1.0.49
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/character-set-proxy-BOW94WCe.d.cts +473 -0
- package/dist/character-set-proxy-BOW94WCe.d.ts +473 -0
- package/dist/chunk-22IRLVWO.js +1 -0
- package/dist/chunk-MR63TJ3B.js +1 -0
- package/dist/chunk-TWX7TPRC.js +1 -0
- package/dist/{descriptor.d.ts → descriptor-D6tZH-vc.d.cts} +13 -13
- package/dist/descriptor-D6tZH-vc.d.ts +185 -0
- package/dist/generator/index.cjs +17 -0
- package/dist/generator/index.d.cts +240 -0
- package/dist/generator/index.d.ts +239 -17
- package/dist/generator/index.js +1 -2
- package/dist/gs1/index.cjs +1 -0
- package/dist/gs1/index.d.cts +185 -0
- package/dist/gs1/index.d.ts +185 -11
- package/dist/gs1/index.js +1 -11
- package/dist/index.cjs +17 -0
- package/dist/{locale/en/locale-resources.d.ts → index.d.cts} +113 -2
- package/dist/index.d.ts +862 -21
- package/dist/index.js +1 -7
- package/package.json +5 -5
- package/src/app-extension.ts +29 -0
- package/src/app-helper-proxy.ts +45 -7
- package/src/generator/functions-generator.ts +292 -0
- package/src/generator/generator.ts +9 -29
- package/src/generator/index.ts +1 -0
- package/src/generator/locale-resources-generator.ts +9 -7
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/gtin-validator-proxy.ts +2 -2
- package/src/gs1/identifier-validator-proxy.ts +2 -2
- package/src/locale/fr/locale-resources.ts +2 -2
- package/src/locale/i18n.ts +5 -5
- package/src/version.ts +4 -0
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/app-extension.d.ts +0 -198
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -133
- package/dist/app-extension.js.map +0 -1
- package/dist/app-helper-proxy.d.ts +0 -61
- package/dist/app-helper-proxy.d.ts.map +0 -1
- package/dist/app-helper-proxy.js +0 -333
- package/dist/app-helper-proxy.js.map +0 -1
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -44
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -124
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -198
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js.map +0 -1
- package/dist/generator/locale-resources-generator.d.ts +0 -2
- package/dist/generator/locale-resources-generator.d.ts.map +0 -1
- package/dist/generator/locale-resources-generator.js +0 -312
- package/dist/generator/locale-resources-generator.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -13
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -126
- package/dist/gs1/character-set-proxy.js.map +0 -1
- package/dist/gs1/check-proxy.d.ts +0 -11
- package/dist/gs1/check-proxy.d.ts.map +0 -1
- package/dist/gs1/check-proxy.js +0 -163
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/gcp-length-proxy.d.ts +0 -11
- package/dist/gs1/gcp-length-proxy.d.ts.map +0 -1
- package/dist/gs1/gcp-length-proxy.js +0 -187
- package/dist/gs1/gcp-length-proxy.js.map +0 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +0 -10
- package/dist/gs1/gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-creator-proxy.js +0 -85
- package/dist/gs1/gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/gtin-descriptor.d.ts +0 -3
- package/dist/gs1/gtin-descriptor.d.ts.map +0 -1
- package/dist/gs1/gtin-descriptor.js +0 -8
- package/dist/gs1/gtin-descriptor.js.map +0 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +0 -26
- package/dist/gs1/gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-validator-proxy.js +0 -256
- package/dist/gs1/gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +0 -30
- package/dist/gs1/identifier-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-creator-proxy.js +0 -318
- package/dist/gs1/identifier-creator-proxy.js.map +0 -1
- package/dist/gs1/identifier-descriptor.d.ts +0 -4
- package/dist/gs1/identifier-descriptor.d.ts.map +0 -1
- package/dist/gs1/identifier-descriptor.js +0 -14
- package/dist/gs1/identifier-descriptor.js.map +0 -1
- package/dist/gs1/identifier-type.d.ts +0 -22
- package/dist/gs1/identifier-type.d.ts.map +0 -1
- package/dist/gs1/identifier-type.js +0 -34
- package/dist/gs1/identifier-type.js.map +0 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +0 -29
- package/dist/gs1/identifier-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-validator-proxy.js +0 -212
- package/dist/gs1/identifier-validator-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +0 -38
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.js +0 -301
- package/dist/gs1/non-gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +0 -37
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.js +0 -302
- package/dist/gs1/non-gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.d.ts +0 -4
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.js +0 -16
- package/dist/gs1/prefix-definition-descriptor.js.map +0 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +0 -8
- package/dist/gs1/prefix-manager-proxy.d.ts.map +0 -1
- package/dist/gs1/prefix-manager-proxy.js +0 -94
- package/dist/gs1/prefix-manager-proxy.js.map +0 -1
- package/dist/gs1/variable-measure-proxy.d.ts +0 -7
- package/dist/gs1/variable-measure-proxy.d.ts.map +0 -1
- package/dist/gs1/variable-measure-proxy.js +0 -114
- package/dist/gs1/variable-measure-proxy.js.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +0 -7
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.js +0 -106
- package/dist/gs1/verified-by-gs1-proxy.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib-proxy.d.ts +0 -135
- package/dist/lib-proxy.d.ts.map +0 -1
- package/dist/lib-proxy.js +0 -276
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -754
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -755
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -754
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -36
- package/dist/locale/i18n.js.map +0 -1
- package/dist/proxy.d.ts +0 -136
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -291
- package/dist/proxy.js.map +0 -1
- package/dist/streaming.d.ts +0 -10
- package/dist/streaming.d.ts.map +0 -1
- package/dist/streaming.js +0 -2
- package/dist/streaming.js.map +0 -1
- package/dist/type.d.ts +0 -91
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -2
- package/dist/type.js.map +0 -1
- package/dist/utility/character-set-descriptor.d.ts +0 -6
- package/dist/utility/character-set-descriptor.d.ts.map +0 -1
- package/dist/utility/character-set-descriptor.js +0 -28
- package/dist/utility/character-set-descriptor.js.map +0 -1
- package/dist/utility/character-set-proxy.d.ts +0 -31
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -278
- package/dist/utility/character-set-proxy.js.map +0 -1
- package/dist/utility/index.d.ts +0 -4
- package/dist/utility/index.d.ts.map +0 -1
- package/dist/utility/index.js +0 -4
- package/dist/utility/index.js.map +0 -1
- package/dist/utility/reg-exp-proxy.d.ts +0 -8
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -103
- package/dist/utility/reg-exp-proxy.js.map +0 -1
- package/dist/utility/string-descriptor.d.ts +0 -4
- package/dist/utility/string-descriptor.d.ts.map +0 -1
- package/dist/utility/string-descriptor.js +0 -12
- package/dist/utility/string-descriptor.js.map +0 -1
- package/dist/utility/string-proxy.d.ts +0 -7
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -63
- package/dist/utility/string-proxy.js.map +0 -1
- package/dist/utility/transformer-descriptor.d.ts +0 -6
- package/dist/utility/transformer-descriptor.d.ts.map +0 -1
- package/dist/utility/transformer-descriptor.js +0 -24
- package/dist/utility/transformer-descriptor.js.map +0 -1
- package/dist/utility/transformer-proxy.d.ts +0 -9
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -111
- package/dist/utility/transformer-proxy.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import{a as b}from"./chunk-MR63TJ3B.js";import{A as y,B as S,C,D as I,E as v,i as c,j as l,k as n,l as p,m as T,n as u,o as E,u as h,w as x,z as d}from"./chunk-22IRLVWO.js";import{getLogger as m,LogLevels as a,MemoryTransport as g}from"@aidc-toolkit/core";var i=class e{static APPLICATION_NAME="AIDCToolkit";static VERSION_NAME=`${e.APPLICATION_NAME}.version`;static#i=120;static#s=100;#t;#r;#o;#e;#n;#a=new WeakMap;constructor(t,r,s){this.#t=t,this.#r=r,this.#o=s;let o=!t.includes("-");this.#e=m(o?a.Info:a.Debug,{type:o?"hidden":"pretty"}),this.#n=new g(this.#e,e.#i,e.#s)}async initialize(){await this.getDocumentProperty(e.VERSION_NAME)!==this.#t&&await this.setDocumentProperty(e.VERSION_NAME,this.#t)}get version(){return this.#t}get throwError(){return this.#o}get logger(){return this.#e}get memoryTransport(){return this.#n}getProxy(t){let r=this.#a.get(t);return r===void 0&&(r=new t(this),this.#a.set(t,r)),r}validateSequenceCount(t){let r=Math.abs(t);if(r>this.#r)throw new RangeError(n.t("AppExtension.sequenceCountMustBeLessThanOrEqualTo",{sequenceCount:r,maximumSequenceCount:this.#r}))}};export{I as AlphabeticProxy,v as AlphanumericProxy,i as AppExtension,b as AppHelperProxy,y as CharacterSetCreatorProxy,d as CharacterSetValidatorProxy,C as HexadecimalProxy,T as LibProxy,E as Multiplicities,S as NumericProxy,x as RegExpProxy,h as TransformerProxy,u as Types,c as appExtensionNS,l as appExtensionResourceBundle,p as i18nAppExtensionInit,n as i18nextAppExtension};
|
|
1
2
|
/*!
|
|
2
3
|
* Copyright © 2024-2026 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
3
4
|
* contributors
|
|
@@ -14,10 +15,3 @@
|
|
|
14
15
|
* See the License for the specific language governing permissions and
|
|
15
16
|
* limitations under the License.
|
|
16
17
|
*/
|
|
17
|
-
export * from "./locale/i18n.js";
|
|
18
|
-
export * from "./app-extension.js";
|
|
19
|
-
export * from "./lib-proxy.js";
|
|
20
|
-
export * from "./descriptor.js";
|
|
21
|
-
export * from "./app-helper-proxy.js";
|
|
22
|
-
export * from "./utility/index.js";
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/app-extension",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "Application extension framework for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@aidc-toolkit/dev": "1.0.
|
|
37
|
+
"@aidc-toolkit/dev": "^1.0.43"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@aidc-toolkit/core": "1.0.
|
|
41
|
-
"@aidc-toolkit/gs1": "1.0.
|
|
42
|
-
"@aidc-toolkit/utility": "1.0.
|
|
40
|
+
"@aidc-toolkit/core": "^1.0.44",
|
|
41
|
+
"@aidc-toolkit/gs1": "^1.0.46",
|
|
42
|
+
"@aidc-toolkit/utility": "^1.0.45"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/src/app-extension.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
type Promisable
|
|
9
9
|
} from "@aidc-toolkit/core";
|
|
10
10
|
import type { Logger } from "tslog";
|
|
11
|
+
import type { LibProxy } from "./lib-proxy.js";
|
|
11
12
|
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
12
13
|
import type { StreamingCancelledCallback, StreamingConsumerCallback } from "./streaming.js";
|
|
13
14
|
import type { ErrorExtends, MatrixResult, SheetAddress, SheetRange, SingletonResult } from "./type.js";
|
|
@@ -76,6 +77,11 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
76
77
|
*/
|
|
77
78
|
readonly #memoryTransport: MemoryTransport<object>;
|
|
78
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Proxies map for lazy loading and memory management.
|
|
82
|
+
*/
|
|
83
|
+
readonly #proxiesMap = new WeakMap<object, LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>>();
|
|
84
|
+
|
|
79
85
|
/**
|
|
80
86
|
* Constructor.
|
|
81
87
|
*
|
|
@@ -155,6 +161,29 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
155
161
|
*/
|
|
156
162
|
abstract get maximumHeight(): number;
|
|
157
163
|
|
|
164
|
+
/**
|
|
165
|
+
* Get a proxy instance. The use of a weak map ensures that proxies are loaded only as needed and may be garbage
|
|
166
|
+
* collected if required.
|
|
167
|
+
*
|
|
168
|
+
* @param ProxyConstructor
|
|
169
|
+
* Proxy constructor.
|
|
170
|
+
*
|
|
171
|
+
* @returns
|
|
172
|
+
* Proxy instance.
|
|
173
|
+
*/
|
|
174
|
+
getProxy<T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>>(ProxyConstructor: new (appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) => T): T {
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type is managed in this method.
|
|
176
|
+
let proxy = this.#proxiesMap.get(ProxyConstructor) as T | undefined;
|
|
177
|
+
|
|
178
|
+
if (proxy === undefined) {
|
|
179
|
+
proxy = new ProxyConstructor(this);
|
|
180
|
+
|
|
181
|
+
this.#proxiesMap.set(ProxyConstructor, proxy);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return proxy;
|
|
185
|
+
}
|
|
186
|
+
|
|
158
187
|
/**
|
|
159
188
|
* Get the sheet address from an invocation context.
|
|
160
189
|
*
|
package/src/app-helper-proxy.ts
CHANGED
|
@@ -31,6 +31,13 @@ const spillMaximumHeightParameterDescriptor: ExtendsParameterDescriptor = {
|
|
|
31
31
|
name: "spillMaximumHeight"
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
const logLevelParameterDescriptor: ParameterDescriptor = {
|
|
35
|
+
name: "logLevel",
|
|
36
|
+
type: Types.String,
|
|
37
|
+
multiplicity: Multiplicities.Singleton,
|
|
38
|
+
isRequired: false
|
|
39
|
+
};
|
|
40
|
+
|
|
34
41
|
/**
|
|
35
42
|
* Maximum dimensions.
|
|
36
43
|
*/
|
|
@@ -257,6 +264,42 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
257
264
|
return result;
|
|
258
265
|
}
|
|
259
266
|
|
|
267
|
+
/**
|
|
268
|
+
* Get the logger messages. This is a snapshot, with the option to change the log level for the next call.
|
|
269
|
+
*
|
|
270
|
+
* @param logLevelString
|
|
271
|
+
* Log level as string.
|
|
272
|
+
*
|
|
273
|
+
* @returns
|
|
274
|
+
* Logger messages.
|
|
275
|
+
*/
|
|
276
|
+
@proxy.describeMethod({
|
|
277
|
+
type: Types.String,
|
|
278
|
+
multiplicity: Multiplicities.Array,
|
|
279
|
+
isHidden: true,
|
|
280
|
+
parameterDescriptors: [logLevelParameterDescriptor]
|
|
281
|
+
})
|
|
282
|
+
loggerMessages(logLevelString: Nullishable<string>): MatrixResult<string, ThrowError, TError> {
|
|
283
|
+
const appExtension = this.appExtension;
|
|
284
|
+
|
|
285
|
+
let logLevel: LogLevel | undefined = undefined;
|
|
286
|
+
|
|
287
|
+
if (!isNullish(logLevelString)) {
|
|
288
|
+
try {
|
|
289
|
+
logLevel = logLevelOf(logLevelString);
|
|
290
|
+
} catch {
|
|
291
|
+
// Ignore error.
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Set log level if required.
|
|
296
|
+
if (logLevel !== undefined) {
|
|
297
|
+
appExtension.logger.settings.minLevel = logLevel;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return appExtension.memoryTransport.messages.map(message => [message]);
|
|
301
|
+
}
|
|
302
|
+
|
|
260
303
|
/**
|
|
261
304
|
* Get the logger messages as a stream.
|
|
262
305
|
*
|
|
@@ -271,14 +314,9 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
271
314
|
multiplicity: Multiplicities.Array,
|
|
272
315
|
isHidden: true,
|
|
273
316
|
isStream: true,
|
|
274
|
-
parameterDescriptors: [
|
|
275
|
-
name: "logLevel",
|
|
276
|
-
type: Types.String,
|
|
277
|
-
multiplicity: Multiplicities.Singleton,
|
|
278
|
-
isRequired: false
|
|
279
|
-
}]
|
|
317
|
+
parameterDescriptors: [logLevelParameterDescriptor]
|
|
280
318
|
})
|
|
281
|
-
|
|
319
|
+
loggerStream(logLevelString: Nullishable<string>, streamingInvocationContext: Nullishable<TStreamingInvocationContext>): void {
|
|
282
320
|
if (isNullish(streamingInvocationContext)) {
|
|
283
321
|
// Application error; no localization necessary.
|
|
284
322
|
throw new Error("Streaming invocation context not provided by application");
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ClassDescriptor,
|
|
3
|
+
type MethodDescriptor,
|
|
4
|
+
type ParameterDescriptor,
|
|
5
|
+
type Type,
|
|
6
|
+
Types
|
|
7
|
+
} from "../descriptor.js";
|
|
8
|
+
import { type FunctionLocalization, Generator, type Localization } from "./generator.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Class type alias.
|
|
12
|
+
*/
|
|
13
|
+
export interface ClassTypeAlias {
|
|
14
|
+
/**
|
|
15
|
+
* Name.
|
|
16
|
+
*/
|
|
17
|
+
readonly name: string;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Getter function.
|
|
21
|
+
*/
|
|
22
|
+
readonly getter: string;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Declaration associating name with implementation type and creating getter function.
|
|
26
|
+
*/
|
|
27
|
+
readonly declaration: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Function implementation.
|
|
32
|
+
*/
|
|
33
|
+
export interface FunctionImplementation {
|
|
34
|
+
/**
|
|
35
|
+
* Function name.
|
|
36
|
+
*/
|
|
37
|
+
readonly functionName: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Parameter localizations with JavaScript type and parameter descriptor.
|
|
41
|
+
*/
|
|
42
|
+
readonly parameterLocalizations: ReadonlyArray<Localization & {
|
|
43
|
+
/**
|
|
44
|
+
* JavaScript type.
|
|
45
|
+
*/
|
|
46
|
+
javaScriptType: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Parameter descriptor.
|
|
50
|
+
*/
|
|
51
|
+
parameterDescriptor?: ParameterDescriptor;
|
|
52
|
+
}>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Declaration.
|
|
56
|
+
*/
|
|
57
|
+
readonly declaration: string[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Generator with helpers for writing TypeScript functions file.
|
|
62
|
+
*/
|
|
63
|
+
export abstract class FunctionsGenerator extends Generator {
|
|
64
|
+
/**
|
|
65
|
+
* Mapping of descriptor types to JavaScript types.
|
|
66
|
+
*/
|
|
67
|
+
static readonly #DESCRIPTOR_TYPE_STRINGS: Readonly<Record<Type, string>> = {
|
|
68
|
+
[Types.String]: "string",
|
|
69
|
+
[Types.Number]: "number",
|
|
70
|
+
[Types.Boolean]: "boolean",
|
|
71
|
+
[Types.Any]: "any"
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
protected static readonly BASE_IMPORTS = [
|
|
75
|
+
"import * as AppExtension from \"@aidc-toolkit/app-extension\";",
|
|
76
|
+
"import { appExtension } from \"./app-extension.js\";"
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* If true, functions are declared inline rather than using `function`.
|
|
81
|
+
*/
|
|
82
|
+
readonly #inline: boolean;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* If true, application extension supports context.
|
|
86
|
+
*/
|
|
87
|
+
readonly #supportsContext: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Invocation context type name.
|
|
91
|
+
*/
|
|
92
|
+
readonly #invocationContextTypeName: string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Streaming invocation context type name.
|
|
96
|
+
*/
|
|
97
|
+
readonly #streamingInvocationContextTypeName: string;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Template declaration for type alias.
|
|
101
|
+
*/
|
|
102
|
+
readonly #templateDeclaration: string;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Current class type alias.
|
|
106
|
+
*/
|
|
107
|
+
#classTypeAlias!: ClassTypeAlias;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Constructor.
|
|
111
|
+
*
|
|
112
|
+
* @param version
|
|
113
|
+
* Package version.
|
|
114
|
+
*
|
|
115
|
+
* @param inline
|
|
116
|
+
* If true, functions are declared inline rather than using `function`.
|
|
117
|
+
*
|
|
118
|
+
* @param throwError
|
|
119
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
120
|
+
*
|
|
121
|
+
* @param errorTypeName
|
|
122
|
+
* Error type name.
|
|
123
|
+
*
|
|
124
|
+
* @param supportsContext
|
|
125
|
+
* If true, application extension supports context.
|
|
126
|
+
*
|
|
127
|
+
* Big integer type name.
|
|
128
|
+
* @param invocationContextTypeName
|
|
129
|
+
* Invocation context type name.
|
|
130
|
+
*
|
|
131
|
+
* @param streamingInvocationContextTypeName
|
|
132
|
+
* Streaming invocation context type name.
|
|
133
|
+
*
|
|
134
|
+
* @param bigIntTypeName
|
|
135
|
+
* Big integer type name.
|
|
136
|
+
*/
|
|
137
|
+
constructor(version: string, inline: boolean, throwError: boolean, errorTypeName: string, supportsContext: boolean, invocationContextTypeName: string, streamingInvocationContextTypeName: string, bigIntTypeName: string) {
|
|
138
|
+
super(version, true);
|
|
139
|
+
|
|
140
|
+
this.#inline = inline;
|
|
141
|
+
|
|
142
|
+
this.#supportsContext = supportsContext;
|
|
143
|
+
this.#invocationContextTypeName = invocationContextTypeName;
|
|
144
|
+
this.#streamingInvocationContextTypeName = streamingInvocationContextTypeName;
|
|
145
|
+
|
|
146
|
+
this.#templateDeclaration = `<${throwError}, ${errorTypeName}, ${invocationContextTypeName}, ${streamingInvocationContextTypeName}, ${bigIntTypeName}>`;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get the class type alias.
|
|
151
|
+
*/
|
|
152
|
+
get classTypeAlias(): ClassTypeAlias {
|
|
153
|
+
return this.#classTypeAlias;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get the import statement for a namespace.
|
|
158
|
+
*
|
|
159
|
+
* @param namespace
|
|
160
|
+
* Namespace.
|
|
161
|
+
*
|
|
162
|
+
* @returns
|
|
163
|
+
* Import statement.
|
|
164
|
+
*/
|
|
165
|
+
protected getNamespaceImport(namespace: string): string {
|
|
166
|
+
return `import * as AppExtension${namespace} from "@aidc-toolkit/app-extension/${namespace.toLowerCase()}";`;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* @inheritDoc
|
|
171
|
+
*/
|
|
172
|
+
protected override createClassProxy(classDescriptor: ClassDescriptor): void {
|
|
173
|
+
const classDescriptorNamespace = classDescriptor.namespace ?? "";
|
|
174
|
+
const name = `${classDescriptorNamespace}${classDescriptor.name}`;
|
|
175
|
+
const getter = `get${name}()`;
|
|
176
|
+
const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}${this.#templateDeclaration}`;
|
|
177
|
+
|
|
178
|
+
this.#classTypeAlias = {
|
|
179
|
+
name,
|
|
180
|
+
getter,
|
|
181
|
+
declaration: [
|
|
182
|
+
"",
|
|
183
|
+
"/**",
|
|
184
|
+
" * Class type alias name.",
|
|
185
|
+
" */",
|
|
186
|
+
`type ${name} = ${implementation};`,
|
|
187
|
+
"",
|
|
188
|
+
"/**",
|
|
189
|
+
" * Getter function to get an instance of the class.",
|
|
190
|
+
" *",
|
|
191
|
+
" * @returns",
|
|
192
|
+
" * Class instance.",
|
|
193
|
+
" */",
|
|
194
|
+
`function ${getter}: ${name} {`,
|
|
195
|
+
` return appExtension.getProxy(${implementation});`,
|
|
196
|
+
"}"
|
|
197
|
+
]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Get a function implementation.
|
|
203
|
+
*
|
|
204
|
+
* @param methodDescriptor
|
|
205
|
+
* Method descriptor.
|
|
206
|
+
*
|
|
207
|
+
* @param functionNamePrefix
|
|
208
|
+
* Function name prefix.
|
|
209
|
+
*
|
|
210
|
+
* @param functionLocalization
|
|
211
|
+
* Function localization. May be undefined for hidden functions, in which case generated
|
|
212
|
+
*
|
|
213
|
+
* @param parameterCallback
|
|
214
|
+
* Callback to modify parameter in implementation function call.
|
|
215
|
+
*
|
|
216
|
+
* @returns
|
|
217
|
+
* Function implementation.
|
|
218
|
+
*/
|
|
219
|
+
protected getFunctionImplementation(methodDescriptor: MethodDescriptor, functionNamePrefix: string, functionLocalization: FunctionLocalization | undefined, parameterCallback?: (name: string, parameterDescriptor: ParameterDescriptor) => string): FunctionImplementation {
|
|
220
|
+
const methodType = `${this.classTypeAlias.name}["${methodDescriptor.name}"]`;
|
|
221
|
+
|
|
222
|
+
const parameterDescriptors = methodDescriptor.parameterDescriptors;
|
|
223
|
+
|
|
224
|
+
const parameterLocalizations: Array<FunctionImplementation["parameterLocalizations"][number]> = parameterDescriptors.map((parameterDescriptor) => {
|
|
225
|
+
const parameterLocalization = functionLocalization?.parametersMap.get(parameterDescriptor.name) ?? {
|
|
226
|
+
name: parameterDescriptor.name,
|
|
227
|
+
description: "*** NO LOCALIZATION ***"
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
...parameterLocalization,
|
|
232
|
+
javaScriptType: FunctionsGenerator.#DESCRIPTOR_TYPE_STRINGS[parameterDescriptor.type],
|
|
233
|
+
parameterDescriptor
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const dummyParameters: string[] = [];
|
|
238
|
+
|
|
239
|
+
if (this.#supportsContext) {
|
|
240
|
+
if (methodDescriptor.requiresContext === true) {
|
|
241
|
+
parameterLocalizations.push({
|
|
242
|
+
name: "invocationContext",
|
|
243
|
+
description: "Invocation context.",
|
|
244
|
+
javaScriptType: this.#invocationContextTypeName
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (methodDescriptor.isStream === true) {
|
|
249
|
+
parameterLocalizations.push({
|
|
250
|
+
name: "streamingInvocationContext",
|
|
251
|
+
description: "Streaming invocation context.",
|
|
252
|
+
javaScriptType: this.#streamingInvocationContextTypeName
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
} else {
|
|
256
|
+
if (methodDescriptor.requiresContext === true) {
|
|
257
|
+
// Invocation context type name represents a literal dummy value.
|
|
258
|
+
dummyParameters.push(this.#invocationContextTypeName);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (methodDescriptor.isStream === true) {
|
|
262
|
+
// Streaming invocation context type name represents a literal dummy value.
|
|
263
|
+
dummyParameters.push(this.#streamingInvocationContextTypeName);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const asyncQualifier = methodDescriptor.isAsync === true ? "async " : "";
|
|
268
|
+
const functionName = functionNamePrefix === "" ?
|
|
269
|
+
functionLocalization?.name ?? methodDescriptor.name :
|
|
270
|
+
`${functionNamePrefix}${functionLocalization?.titleCaseName ?? methodDescriptor.name.replace(/^[a-z]/u, c => c.toUpperCase())}`;
|
|
271
|
+
|
|
272
|
+
return {
|
|
273
|
+
functionName,
|
|
274
|
+
parameterLocalizations,
|
|
275
|
+
declaration: [
|
|
276
|
+
`${
|
|
277
|
+
!this.#inline ?
|
|
278
|
+
`export ${asyncQualifier}function ${functionName}` :
|
|
279
|
+
asyncQualifier
|
|
280
|
+
}(${parameterLocalizations.map((parameterLocalization, index) =>
|
|
281
|
+
`${parameterLocalization.name}: Parameters<${methodType}>[${index}]`
|
|
282
|
+
).join(", ")}): ReturnType<${methodType}> ${!this.#inline ? "{" : "=>"}`,
|
|
283
|
+
` ${!this.#inline ? "return " : ""}${(this.classTypeAlias.getter)}.${methodDescriptor.name}(${[...parameterLocalizations.map(parameterLocalization =>
|
|
284
|
+
parameterCallback === undefined || parameterLocalization.parameterDescriptor === undefined ?
|
|
285
|
+
parameterLocalization.name :
|
|
286
|
+
parameterCallback(parameterLocalization.name, parameterLocalization.parameterDescriptor)
|
|
287
|
+
), ...dummyParameters].join(", ")})${(!this.#inline ? ";" : "")}`,
|
|
288
|
+
...!this.#inline ? ["}"] : []
|
|
289
|
+
]
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ALPHA_URL, getLogger,
|
|
1
|
+
import { ALPHA_URL, getLogger, I18nLanguageDetectors, type Promisable, websiteURL } from "@aidc-toolkit/core";
|
|
2
2
|
import type { DefaultNamespace, ParseKeys } from "i18next";
|
|
3
3
|
import type { Logger } from "tslog";
|
|
4
4
|
import { AppHelperProxy } from "../app-helper-proxy.js";
|
|
@@ -155,18 +155,15 @@ export abstract class Generator {
|
|
|
155
155
|
protected abstract createCategory(namespace: string | undefined, category: string, categoryLocalizationsMap: ReadonlyMap<string, string>): void;
|
|
156
156
|
|
|
157
157
|
/**
|
|
158
|
-
* Create a proxy
|
|
159
|
-
*
|
|
160
|
-
* @param objectName
|
|
161
|
-
* Object name, derived from namespace and class name.
|
|
158
|
+
* Create a proxy for a class.
|
|
162
159
|
*
|
|
163
160
|
* @param classDescriptor
|
|
164
161
|
* Class descriptor.
|
|
165
162
|
*/
|
|
166
|
-
protected abstract
|
|
163
|
+
protected abstract createClassProxy(classDescriptor: ClassDescriptor): void;
|
|
167
164
|
|
|
168
165
|
/**
|
|
169
|
-
* Create a proxy
|
|
166
|
+
* Create a proxy for a method.
|
|
170
167
|
*
|
|
171
168
|
* @param classDescriptor
|
|
172
169
|
* Class descriptor.
|
|
@@ -177,7 +174,7 @@ export abstract class Generator {
|
|
|
177
174
|
* @param functionLocalizationsMap
|
|
178
175
|
* Function localizations map.
|
|
179
176
|
*/
|
|
180
|
-
protected abstract
|
|
177
|
+
protected abstract createMethodProxy(classDescriptor: ClassDescriptor, methodDescriptor: MethodDescriptor, functionLocalizationsMap: ReadonlyMap<string, FunctionLocalization>): void;
|
|
181
178
|
|
|
182
179
|
/**
|
|
183
180
|
* Finalize the generation of the output.
|
|
@@ -228,7 +225,7 @@ export abstract class Generator {
|
|
|
228
225
|
async generate(): Promise<void> {
|
|
229
226
|
let success = false;
|
|
230
227
|
|
|
231
|
-
await i18nAppExtensionInit(
|
|
228
|
+
await i18nAppExtensionInit(I18nLanguageDetectors.CLI);
|
|
232
229
|
|
|
233
230
|
const documentationBaseURL = websiteURL(this.version, true, await ALPHA_URL);
|
|
234
231
|
|
|
@@ -293,31 +290,14 @@ export abstract class Generator {
|
|
|
293
290
|
|
|
294
291
|
namespaceClassNamesSet.add(namespaceClassName);
|
|
295
292
|
|
|
296
|
-
|
|
297
|
-
// - one or more uppercase letters followed by zero or more numbers; or
|
|
298
|
-
// - single uppercase letter followed by zero or more characters except uppercase letters or period.
|
|
299
|
-
//
|
|
300
|
-
// Second capture group is:
|
|
301
|
-
// - single uppercase letter followed by zero or more characters except period; or
|
|
302
|
-
// - zero characters (empty string).
|
|
303
|
-
//
|
|
304
|
-
// Third capture group, separated by optional period, is:
|
|
305
|
-
// - single uppercase letter followed by zero or more characters (remainder of string); or
|
|
306
|
-
// - zero characters (empty string).
|
|
307
|
-
const objectNameGroups = /^(?<namespaceFirstWord>[A-Z]+[0-9]*|[A-Z][^A-Z.]*)(?<namespaceRemaining>[A-Z][^.]*|)\.?(?<className>[A-Z].*|)$/u.exec(namespaceClassName)?.groups;
|
|
308
|
-
|
|
309
|
-
if (objectNameGroups === undefined) {
|
|
310
|
-
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
this.createProxyObject(`${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`, classDescriptor);
|
|
293
|
+
this.createClassProxy(classDescriptor);
|
|
314
294
|
|
|
315
295
|
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
316
296
|
const functionLocalizationsMap = new Map(methodDescriptor.isHidden !== true ?
|
|
317
297
|
this.locales.map(locale =>
|
|
318
298
|
[locale, Generator.#generateLocalization<FunctionLocalization>(locale, `Functions.${namespacePrefix}${methodDescriptor.functionName}`, (locale, localization) => ({
|
|
319
299
|
...localization,
|
|
320
|
-
titleCaseName: localization.titleCaseName ??
|
|
300
|
+
titleCaseName: localization.titleCaseName ?? localization.name.replace(/^[a-z]/u, c => c.toUpperCase()),
|
|
321
301
|
documentationURL: `${documentationBaseURL}/${locale === this.defaultLocale ? "" : `${locale}/`}${Generator.#DOCUMENTATION_PATH}${namespacePath}${localization.name}.html`,
|
|
322
302
|
parametersMap: new Map(methodDescriptor.parameterDescriptors.map(parameterDescriptor =>
|
|
323
303
|
// eslint-disable-next-line max-nested-callbacks -- Callback is empty.
|
|
@@ -329,7 +309,7 @@ export abstract class Generator {
|
|
|
329
309
|
[]
|
|
330
310
|
);
|
|
331
311
|
|
|
332
|
-
this.
|
|
312
|
+
this.createMethodProxy(classDescriptor, methodDescriptor, functionLocalizationsMap);
|
|
333
313
|
}
|
|
334
314
|
}
|
|
335
315
|
}
|
package/src/generator/index.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { LocaleResources } from "@aidc-toolkit/core";
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as path from "node:path";
|
|
4
|
-
import packageConfiguration from "../../package.json" with { type: "json" };
|
|
5
4
|
import type {
|
|
6
5
|
ClassDescriptor,
|
|
7
6
|
ExtendsParameterDescriptor,
|
|
8
7
|
MethodDescriptor,
|
|
9
8
|
ParameterDescriptor
|
|
10
9
|
} from "../descriptor.js";
|
|
10
|
+
import { VERSION } from "../version.js";
|
|
11
11
|
import { Generator } from "./generator.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -91,7 +91,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
91
91
|
* Constructor.
|
|
92
92
|
*/
|
|
93
93
|
constructor() {
|
|
94
|
-
super(
|
|
94
|
+
super(VERSION, false);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
@@ -115,7 +115,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
115
115
|
/**
|
|
116
116
|
* @inheritDoc
|
|
117
117
|
*/
|
|
118
|
-
protected override
|
|
118
|
+
protected override createClassProxy(): void {
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/**
|
|
@@ -193,7 +193,7 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
193
193
|
/**
|
|
194
194
|
* @inheritDoc
|
|
195
195
|
*/
|
|
196
|
-
protected override
|
|
196
|
+
protected override createMethodProxy(classDescriptor: ClassDescriptor, methodDescriptor: MethodDescriptor): void {
|
|
197
197
|
// Hidden functions aren't localized.
|
|
198
198
|
if (methodDescriptor.isHidden !== true) {
|
|
199
199
|
// Add any parameters that are not already known.
|
|
@@ -255,15 +255,17 @@ class LocaleResourcesGenerator extends Generator {
|
|
|
255
255
|
* Merged locale resources.
|
|
256
256
|
*/
|
|
257
257
|
#merge(logChanges: boolean, parentKey: string, sourceLocaleResources: LocaleResources, destinationLocaleResources: LocaleResources, addMissing: boolean): LocaleResources {
|
|
258
|
-
// Some entries at the
|
|
259
|
-
const
|
|
258
|
+
// Some entries at the root are not part of the generator output.
|
|
259
|
+
const atRoot = parentKey === "";
|
|
260
|
+
|
|
261
|
+
const atFunction = parentKey.startsWith("Functions.");
|
|
260
262
|
|
|
261
263
|
const newDestinationLocaleResources: LocaleResources = {};
|
|
262
264
|
|
|
263
265
|
// Copy over or delete any destination keys that are not in source.
|
|
264
266
|
for (const [key, destinationValue] of Object.entries(destinationLocaleResources)) {
|
|
265
267
|
if (!(key in sourceLocaleResources)) {
|
|
266
|
-
if (
|
|
268
|
+
if (atRoot || (atFunction && key === "titleCaseName")) {
|
|
267
269
|
newDestinationLocaleResources[key] = destinationValue;
|
|
268
270
|
} else if (logChanges) {
|
|
269
271
|
this.logger.info(`Deleting ${parentKey}${key}...`);
|
package/src/gs1/check-proxy.ts
CHANGED
|
@@ -67,7 +67,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
@proxy.describeMethod({
|
|
70
|
-
type: Types.
|
|
70
|
+
type: Types.Boolean,
|
|
71
71
|
multiplicity: Multiplicities.Matrix,
|
|
72
72
|
parameterDescriptors: [numericSWithCheckDigitParameterDescriptor]
|
|
73
73
|
})
|
|
@@ -85,7 +85,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
@proxy.describeMethod({
|
|
88
|
-
type: Types.
|
|
88
|
+
type: Types.Boolean,
|
|
89
89
|
multiplicity: Multiplicities.Singleton,
|
|
90
90
|
parameterDescriptors: [{
|
|
91
91
|
...numericSFourOrFiveDigitsParameterDescriptor,
|
|
@@ -106,7 +106,7 @@ export class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
@proxy.describeMethod({
|
|
109
|
-
type: Types.
|
|
109
|
+
type: Types.Boolean,
|
|
110
110
|
multiplicity: Multiplicities.Matrix,
|
|
111
111
|
parameterDescriptors: [ai82SWithCheckCharacterPairParameterDescriptor]
|
|
112
112
|
})
|
|
@@ -128,7 +128,7 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
@proxy.describeMethod({
|
|
131
|
-
type: Types.
|
|
131
|
+
type: Types.Boolean,
|
|
132
132
|
multiplicity: Multiplicities.Matrix,
|
|
133
133
|
parameterDescriptors: [validateGTINParameterDescriptor, gtinLevelParameterDescriptor]
|
|
134
134
|
})
|
|
@@ -148,7 +148,7 @@ export class GTINValidatorStaticProxy<ThrowError extends boolean, TError extends
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
@proxy.describeMethod({
|
|
151
|
-
type: Types.
|
|
151
|
+
type: Types.Boolean,
|
|
152
152
|
multiplicity: Multiplicities.Matrix,
|
|
153
153
|
parameterDescriptors: [validateGTIN14ParameterDescriptor]
|
|
154
154
|
})
|
|
@@ -61,7 +61,7 @@ abstract class NumericIdentifierValidatorProxy<ThrowError extends boolean, TErro
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
@proxy.describeMethod({
|
|
64
|
-
type: Types.
|
|
64
|
+
type: Types.Boolean,
|
|
65
65
|
multiplicity: Multiplicities.Matrix,
|
|
66
66
|
parameterDescriptors: [validateIdentifierParameterDescriptor]
|
|
67
67
|
})
|
|
@@ -109,7 +109,7 @@ export abstract class NonNumericIdentifierValidatorProxy<ThrowError extends bool
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
@proxy.describeMethod({
|
|
112
|
-
type: Types.
|
|
112
|
+
type: Types.Boolean,
|
|
113
113
|
multiplicity: Multiplicities.Matrix,
|
|
114
114
|
parameterDescriptors: [validateIdentifierParameterDescriptor, exclusionAllNumericParameterDescriptor]
|
|
115
115
|
})
|