@aidc-toolkit/app-extension 1.0.22-beta → 1.0.24-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 +3414 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1747 -0
- package/dist/index.d.ts +1747 -26
- package/dist/index.js +3379 -9
- package/dist/index.js.map +1 -1
- package/package.json +7 -10
- package/src/app-extension.ts +3 -10
- package/src/app-utility-proxy.ts +5 -4
- package/src/descriptor.ts +12 -8
- package/src/generator/descriptor.ts +1 -1
- package/src/generator/generator.ts +4 -4
- package/src/generator/index.ts +2 -2
- package/src/generator/{locale-strings-generator.ts → locale-resources-generator.ts} +66 -62
- package/src/gs1/character-set-proxy.ts +5 -5
- package/src/gs1/check-proxy.ts +3 -3
- package/src/gs1/identifier-proxy.ts +9 -8
- 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-strings.ts → locale-resources.ts} +1 -1
- package/src/locale/fr/{locale-strings.ts → locale-resources.ts} +1 -1
- package/src/locale/i18n.ts +7 -9
- package/src/locale/i18next.d.ts +6 -6
- package/{dist/types.d.ts → src/type.ts} +10 -38
- package/src/utility/character-set-descriptor.ts +1 -1
- package/src/utility/character-set-proxy.ts +9 -8
- package/src/utility/index.ts +3 -3
- package/src/utility/reg-exp-proxy.ts +5 -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 +5 -4
- package/tsup.config.ts +3 -0
- package/dist/app-extension.d.ts +0 -169
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -148
- package/dist/app-extension.js.map +0 -1
- package/dist/app-utility-proxy.d.ts +0 -66
- package/dist/app-utility-proxy.d.ts.map +0 -1
- package/dist/app-utility-proxy.js +0 -233
- package/dist/app-utility-proxy.js.map +0 -1
- package/dist/descriptor.d.ts +0 -172
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -174
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/descriptor.d.ts +0 -107
- package/dist/generator/descriptor.d.ts.map +0 -1
- package/dist/generator/descriptor.js +0 -2
- package/dist/generator/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts +0 -120
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -213
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts +0 -3
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js +0 -2
- package/dist/generator/index.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -10
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -47
- 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 -120
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/identifier-proxy.d.ts +0 -136
- package/dist/gs1/identifier-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-proxy.js +0 -782
- package/dist/gs1/identifier-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts +0 -4
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js +0 -4
- package/dist/gs1/index.js.map +0 -1
- package/dist/index.d.ts.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 -235
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-strings.d.ts +0 -616
- package/dist/locale/en/locale-strings.d.ts.map +0 -1
- package/dist/locale/en/locale-strings.js +0 -616
- package/dist/locale/en/locale-strings.js.map +0 -1
- package/dist/locale/fr/locale-strings.d.ts +0 -616
- package/dist/locale/fr/locale-strings.d.ts.map +0 -1
- package/dist/locale/fr/locale-strings.js +0 -616
- package/dist/locale/fr/locale-strings.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 -39
- package/dist/locale/i18n.js.map +0 -1
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -13
- package/dist/types.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 -26
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -167
- 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 -7
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -61
- 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 -8
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -12
- 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 -8
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -74
- package/dist/utility/transformer-proxy.js.map +0 -1
- package/src/generator/logger.ts +0 -45
- package/src/types.ts +0 -144
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { BaseParameterDescriptor, ClassDescriptor, MethodDescriptor } from "../descriptor.js";
|
|
2
|
-
/**
|
|
3
|
-
* Localization.
|
|
4
|
-
*/
|
|
5
|
-
export interface Localization {
|
|
6
|
-
/**
|
|
7
|
-
* Name.
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* Description.
|
|
12
|
-
*/
|
|
13
|
-
description: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Function localization.
|
|
17
|
-
*/
|
|
18
|
-
export interface FunctionLocalization extends Localization {
|
|
19
|
-
/**
|
|
20
|
-
* Documentation URL.
|
|
21
|
-
*/
|
|
22
|
-
documentationURL: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Parameter localization.
|
|
26
|
-
*/
|
|
27
|
-
export interface ParameterLocalization extends Localization {
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Localization descriptor.
|
|
31
|
-
*/
|
|
32
|
-
export interface LocalizationDescriptor<T extends Localization> {
|
|
33
|
-
/**
|
|
34
|
-
* Localizations map by locale.
|
|
35
|
-
*/
|
|
36
|
-
readonly localizationsMap: ReadonlyMap<string, T>;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Proxy namespace descriptor.
|
|
40
|
-
*/
|
|
41
|
-
export interface ProxyNamespaceDescriptor {
|
|
42
|
-
/**
|
|
43
|
-
* Namespace if any.
|
|
44
|
-
*/
|
|
45
|
-
readonly namespace: string | undefined;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Proxy class descriptor.
|
|
49
|
-
*/
|
|
50
|
-
export interface ProxyClassDescriptor extends ProxyNamespaceDescriptor {
|
|
51
|
-
/**
|
|
52
|
-
* Class name.
|
|
53
|
-
*/
|
|
54
|
-
readonly className: string;
|
|
55
|
-
/**
|
|
56
|
-
* Namespace-qualified class name.
|
|
57
|
-
*/
|
|
58
|
-
readonly namespaceClassName: string;
|
|
59
|
-
/**
|
|
60
|
-
* Class descriptor.
|
|
61
|
-
*/
|
|
62
|
-
readonly classDescriptor: ClassDescriptor;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Proxy object descriptor.
|
|
66
|
-
*/
|
|
67
|
-
export interface ProxyObjectDescriptor extends ProxyClassDescriptor {
|
|
68
|
-
/**
|
|
69
|
-
* Object name.
|
|
70
|
-
*/
|
|
71
|
-
readonly objectName: string;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Proxy parameter descriptor.
|
|
75
|
-
*/
|
|
76
|
-
export interface ProxyParameterDescriptor extends ProxyNamespaceDescriptor, LocalizationDescriptor<ParameterLocalization> {
|
|
77
|
-
/**
|
|
78
|
-
* Function name.
|
|
79
|
-
*/
|
|
80
|
-
readonly parameterName: string;
|
|
81
|
-
/**
|
|
82
|
-
* Parameter descriptor.
|
|
83
|
-
*/
|
|
84
|
-
readonly parameterDescriptor: BaseParameterDescriptor;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Proxy function descriptor.
|
|
88
|
-
*/
|
|
89
|
-
export interface ProxyFunctionDescriptor extends ProxyObjectDescriptor, LocalizationDescriptor<FunctionLocalization> {
|
|
90
|
-
/**
|
|
91
|
-
* Function name.
|
|
92
|
-
*/
|
|
93
|
-
readonly functionName: string;
|
|
94
|
-
/**
|
|
95
|
-
* Namespace-qualified function name.
|
|
96
|
-
*/
|
|
97
|
-
readonly namespaceFunctionName: string;
|
|
98
|
-
/**
|
|
99
|
-
* Proxy parameter descriptors
|
|
100
|
-
*/
|
|
101
|
-
readonly proxyParameterDescriptors: ProxyParameterDescriptor[];
|
|
102
|
-
/**
|
|
103
|
-
* Method descriptor.
|
|
104
|
-
*/
|
|
105
|
-
readonly methodDescriptor: MethodDescriptor;
|
|
106
|
-
}
|
|
107
|
-
//# sourceMapping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C,aAAa,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,mBAAmB,EAAE,uBAAuB,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB,EAAE,sBAAsB,CAAC,oBAAoB,CAAC;IAChH;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAEvC;;OAEG;IACH,QAAQ,CAAC,yBAAyB,EAAE,wBAAwB,EAAE,CAAC;IAE/D;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC/C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../../src/generator/descriptor.ts"],"names":[],"mappings":""}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import type { FunctionLocalization, ParameterLocalization, ProxyFunctionDescriptor, ProxyObjectDescriptor } from "./descriptor.js";
|
|
2
|
-
/**
|
|
3
|
-
* Abstract generator.
|
|
4
|
-
*/
|
|
5
|
-
export declare abstract class Generator {
|
|
6
|
-
/**
|
|
7
|
-
* Documentation base URL.
|
|
8
|
-
*/
|
|
9
|
-
private static readonly DOCUMENTATION_BASE_URL;
|
|
10
|
-
/**
|
|
11
|
-
* Documentation path, optionally preceded by locale.
|
|
12
|
-
*/
|
|
13
|
-
private static readonly DOCUMENTATION_PATH;
|
|
14
|
-
/**
|
|
15
|
-
* Locales.
|
|
16
|
-
*/
|
|
17
|
-
private readonly _locales;
|
|
18
|
-
/**
|
|
19
|
-
* Default locale.
|
|
20
|
-
*/
|
|
21
|
-
private readonly _defaultLocale;
|
|
22
|
-
/**
|
|
23
|
-
* Map of function localizations maps by namespace function name.
|
|
24
|
-
*/
|
|
25
|
-
private readonly _functionLocalizationsMapsMap;
|
|
26
|
-
/**
|
|
27
|
-
* Map of parameter localizations maps by namespace function parameter name.
|
|
28
|
-
*/
|
|
29
|
-
private readonly _parameterLocalizationsMapsMap;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* Constructor.
|
|
35
|
-
*
|
|
36
|
-
* @param includeLocalizations
|
|
37
|
-
* Include localizations if true.
|
|
38
|
-
*/
|
|
39
|
-
constructor(includeLocalizations?: boolean);
|
|
40
|
-
/**
|
|
41
|
-
* Get the locales.
|
|
42
|
-
*/
|
|
43
|
-
protected get locales(): readonly string[];
|
|
44
|
-
/**
|
|
45
|
-
* Get the default locale.
|
|
46
|
-
*/
|
|
47
|
-
protected get defaultLocale(): string;
|
|
48
|
-
/**
|
|
49
|
-
* Get function localization.
|
|
50
|
-
*
|
|
51
|
-
* @param namespaceFunctionName
|
|
52
|
-
* Namespace function name.
|
|
53
|
-
*
|
|
54
|
-
* @param locale
|
|
55
|
-
* Locale.
|
|
56
|
-
*
|
|
57
|
-
* @returns
|
|
58
|
-
* Function localization.
|
|
59
|
-
*/
|
|
60
|
-
protected getFunctionLocalization(namespaceFunctionName: string, locale: string): FunctionLocalization;
|
|
61
|
-
/**
|
|
62
|
-
* Get parameter localization.
|
|
63
|
-
*
|
|
64
|
-
* @param namespaceFunctionName
|
|
65
|
-
* Namespace function name.
|
|
66
|
-
*
|
|
67
|
-
* @param parameterName
|
|
68
|
-
* Parameter name.
|
|
69
|
-
*
|
|
70
|
-
* @param locale
|
|
71
|
-
* Locale.
|
|
72
|
-
*
|
|
73
|
-
* @returns
|
|
74
|
-
* Function localization.
|
|
75
|
-
*/
|
|
76
|
-
protected getParameterLocalization(namespaceFunctionName: string, parameterName: string, locale: string): ParameterLocalization;
|
|
77
|
-
/**
|
|
78
|
-
* Initialize the generation of the output.
|
|
79
|
-
*/
|
|
80
|
-
protected abstract initialize(): void;
|
|
81
|
-
/**
|
|
82
|
-
* Create a proxy object.
|
|
83
|
-
*
|
|
84
|
-
* @param proxyObjectDescriptor
|
|
85
|
-
* Proxy object descriptor.
|
|
86
|
-
*/
|
|
87
|
-
protected abstract createProxyObject(proxyObjectDescriptor: ProxyObjectDescriptor): void;
|
|
88
|
-
/**
|
|
89
|
-
* Create a proxy function.
|
|
90
|
-
*
|
|
91
|
-
* @param proxyFunctionDescriptor
|
|
92
|
-
* Proxy function descriptor.
|
|
93
|
-
*/
|
|
94
|
-
protected abstract createProxyFunction(proxyFunctionDescriptor: ProxyFunctionDescriptor): void;
|
|
95
|
-
/**
|
|
96
|
-
* Finalize the generation of the output.
|
|
97
|
-
*
|
|
98
|
-
* @param success
|
|
99
|
-
* True if successful.
|
|
100
|
-
*/
|
|
101
|
-
protected abstract finalize(success: boolean): void | Promise<void>;
|
|
102
|
-
/**
|
|
103
|
-
* Generate localizations map.
|
|
104
|
-
*
|
|
105
|
-
* @param localizedKeyPrefix
|
|
106
|
-
* Localized key prefix.
|
|
107
|
-
*
|
|
108
|
-
* @param localizationCallback
|
|
109
|
-
* Callback to finalize localization.
|
|
110
|
-
*
|
|
111
|
-
* @returns
|
|
112
|
-
* Localization map.
|
|
113
|
-
*/
|
|
114
|
-
private generateLocalizationsMap;
|
|
115
|
-
/**
|
|
116
|
-
* Generate by processing individual imports.
|
|
117
|
-
*/
|
|
118
|
-
generate(): Promise<void>;
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,oBAAoB,EAEpB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACxB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,8BAAsB,SAAS;IAC3B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,sBAAsB,CAA+B;IAE7E;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAoB;IAE9D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-
import { expandParameterDescriptor, getClassDescriptors } from "../descriptor.js";
|
|
3
|
-
import { appExtensionResources, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n.js";
|
|
4
|
-
/**
|
|
5
|
-
* Abstract generator.
|
|
6
|
-
*/
|
|
7
|
-
export class Generator {
|
|
8
|
-
/**
|
|
9
|
-
* Documentation base URL.
|
|
10
|
-
*/
|
|
11
|
-
static DOCUMENTATION_BASE_URL = "https://aidc-toolkit.com/";
|
|
12
|
-
/**
|
|
13
|
-
* Documentation path, optionally preceded by locale.
|
|
14
|
-
*/
|
|
15
|
-
static DOCUMENTATION_PATH = "app-extension/";
|
|
16
|
-
/**
|
|
17
|
-
* Locales.
|
|
18
|
-
*/
|
|
19
|
-
_locales;
|
|
20
|
-
/**
|
|
21
|
-
* Default locale.
|
|
22
|
-
*/
|
|
23
|
-
_defaultLocale;
|
|
24
|
-
/**
|
|
25
|
-
* Map of function localizations maps by namespace function name.
|
|
26
|
-
*/
|
|
27
|
-
_functionLocalizationsMapsMap = new Map();
|
|
28
|
-
/**
|
|
29
|
-
* Map of parameter localizations maps by namespace function parameter name.
|
|
30
|
-
*/
|
|
31
|
-
_parameterLocalizationsMapsMap = new Map();
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
/**
|
|
36
|
-
* Constructor.
|
|
37
|
-
*
|
|
38
|
-
* @param includeLocalizations
|
|
39
|
-
* Include localizations if true.
|
|
40
|
-
*/
|
|
41
|
-
constructor(includeLocalizations = true) {
|
|
42
|
-
this._locales = includeLocalizations ? Object.keys(appExtensionResources) : [];
|
|
43
|
-
this._defaultLocale = this._locales[0] ?? "";
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Get the locales.
|
|
47
|
-
*/
|
|
48
|
-
get locales() {
|
|
49
|
-
return this._locales;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Get the default locale.
|
|
53
|
-
*/
|
|
54
|
-
get defaultLocale() {
|
|
55
|
-
return this._defaultLocale;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get function localization.
|
|
59
|
-
*
|
|
60
|
-
* @param namespaceFunctionName
|
|
61
|
-
* Namespace function name.
|
|
62
|
-
*
|
|
63
|
-
* @param locale
|
|
64
|
-
* Locale.
|
|
65
|
-
*
|
|
66
|
-
* @returns
|
|
67
|
-
* Function localization.
|
|
68
|
-
*/
|
|
69
|
-
getFunctionLocalization(namespaceFunctionName, locale) {
|
|
70
|
-
const functionLocalization = this._functionLocalizationsMapsMap.get(namespaceFunctionName)?.get(locale);
|
|
71
|
-
if (functionLocalization === undefined) {
|
|
72
|
-
throw new Error(`Localization for function "${namespaceFunctionName}", locale "${locale}" not found`);
|
|
73
|
-
}
|
|
74
|
-
return functionLocalization;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Get parameter localization.
|
|
78
|
-
*
|
|
79
|
-
* @param namespaceFunctionName
|
|
80
|
-
* Namespace function name.
|
|
81
|
-
*
|
|
82
|
-
* @param parameterName
|
|
83
|
-
* Parameter name.
|
|
84
|
-
*
|
|
85
|
-
* @param locale
|
|
86
|
-
* Locale.
|
|
87
|
-
*
|
|
88
|
-
* @returns
|
|
89
|
-
* Function localization.
|
|
90
|
-
*/
|
|
91
|
-
getParameterLocalization(namespaceFunctionName, parameterName, locale) {
|
|
92
|
-
const parameterLocalization = this._parameterLocalizationsMapsMap.get(`${namespaceFunctionName}.${parameterName}`)?.get(locale);
|
|
93
|
-
if (parameterLocalization === undefined) {
|
|
94
|
-
throw new Error(`Localization for function "${namespaceFunctionName}", parameter "${parameterName}", locale "${locale}" not found`);
|
|
95
|
-
}
|
|
96
|
-
return parameterLocalization;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Generate localizations map.
|
|
100
|
-
*
|
|
101
|
-
* @param localizedKeyPrefix
|
|
102
|
-
* Localized key prefix.
|
|
103
|
-
*
|
|
104
|
-
* @param localizationCallback
|
|
105
|
-
* Callback to finalize localization.
|
|
106
|
-
*
|
|
107
|
-
* @returns
|
|
108
|
-
* Localization map.
|
|
109
|
-
*/
|
|
110
|
-
generateLocalizationsMap(localizedKeyPrefix, localizationCallback) {
|
|
111
|
-
return new Map(this._locales.map((locale) => {
|
|
112
|
-
const lngOption = {
|
|
113
|
-
lng: locale
|
|
114
|
-
};
|
|
115
|
-
return [locale, localizationCallback(locale, {
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
117
|
-
name: i18nextAppExtension.t(`${localizedKeyPrefix}name`, lngOption),
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
119
|
-
description: i18nextAppExtension.t(`${localizedKeyPrefix}description`, lngOption)
|
|
120
|
-
})];
|
|
121
|
-
}));
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Generate by processing individual imports.
|
|
125
|
-
*/
|
|
126
|
-
async generate() {
|
|
127
|
-
let success = false;
|
|
128
|
-
await i18nAppExtensionInit(I18nEnvironments.CLI);
|
|
129
|
-
this.initialize();
|
|
130
|
-
try {
|
|
131
|
-
for (const classDescriptor of getClassDescriptors().values()) {
|
|
132
|
-
const namespace = classDescriptor.namespace;
|
|
133
|
-
const namespacePrefix = namespace === undefined ? "" : `${namespace}.`;
|
|
134
|
-
const className = classDescriptor.name;
|
|
135
|
-
const methodInfix = classDescriptor.methodInfix;
|
|
136
|
-
// Namespace-qualified class name is used to construct object name.
|
|
137
|
-
const namespaceClassName = `${namespacePrefix}${className}`;
|
|
138
|
-
// First capture group is:
|
|
139
|
-
// - one or more uppercase letters followed by zero or more numbers; or
|
|
140
|
-
// - single uppercase letter followed by zero or more characters except uppercase letters or period.
|
|
141
|
-
// Second capture group is:
|
|
142
|
-
// - single uppercase letter followed by zero or more characters except period; or
|
|
143
|
-
// - zero characters (empty string).
|
|
144
|
-
// Third capture group, separated by optional period, is:
|
|
145
|
-
// - single uppercase letter followed by zero or more characters (remainder of string); or
|
|
146
|
-
// - zero characters (empty string).
|
|
147
|
-
const classNameMatch = /^([A-Z]+[0-9]*|[A-Z][^A-Z.]*)([A-Z][^.]*|)\.?([A-Z].*|)$/.exec(namespaceClassName);
|
|
148
|
-
if (classNameMatch === null) {
|
|
149
|
-
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
150
|
-
}
|
|
151
|
-
const proxyObjectDescriptor = {
|
|
152
|
-
namespace,
|
|
153
|
-
className,
|
|
154
|
-
namespaceClassName,
|
|
155
|
-
classDescriptor,
|
|
156
|
-
objectName: `${classNameMatch[1].toLowerCase()}${classNameMatch[2]}${classNameMatch[3]}`
|
|
157
|
-
};
|
|
158
|
-
this.createProxyObject(proxyObjectDescriptor);
|
|
159
|
-
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
160
|
-
const methodName = methodDescriptor.name;
|
|
161
|
-
const infixBefore = methodDescriptor.infixBefore;
|
|
162
|
-
let functionName;
|
|
163
|
-
if (methodInfix === undefined || methodDescriptor.ignoreInfix === true) {
|
|
164
|
-
// No other classes in the hierarchy or no infix required.
|
|
165
|
-
functionName = methodName;
|
|
166
|
-
}
|
|
167
|
-
else if (infixBefore === undefined) {
|
|
168
|
-
// Other classes in the hierarchy and infix is postfix.
|
|
169
|
-
functionName = `${methodName}${methodInfix}`;
|
|
170
|
-
}
|
|
171
|
-
else {
|
|
172
|
-
const insertIndex = methodName.indexOf(infixBefore);
|
|
173
|
-
if (insertIndex === -1) {
|
|
174
|
-
throw new Error(`Cannot find "${infixBefore}" in method name ${methodName}`);
|
|
175
|
-
}
|
|
176
|
-
// Other classes in the hierarchy and infix is in the middle of the string.
|
|
177
|
-
functionName = `${methodName.substring(0, insertIndex)}${methodInfix}${methodName.substring(insertIndex)}`;
|
|
178
|
-
}
|
|
179
|
-
const namespaceFunctionName = `${namespacePrefix}${functionName}`;
|
|
180
|
-
const functionLocalizationsMap = this.generateLocalizationsMap(`Functions.${namespaceFunctionName}.`, (locale, localization) => ({
|
|
181
|
-
...localization,
|
|
182
|
-
documentationURL: `${Generator.DOCUMENTATION_BASE_URL}${locale === this.defaultLocale ? "" : `${locale}/`}${Generator.DOCUMENTATION_PATH}${namespace === undefined ? "" : `${namespace}/`}${localization.name}.html`
|
|
183
|
-
}));
|
|
184
|
-
this._functionLocalizationsMapsMap.set(namespaceFunctionName, functionLocalizationsMap);
|
|
185
|
-
this.createProxyFunction({
|
|
186
|
-
...proxyObjectDescriptor,
|
|
187
|
-
functionName,
|
|
188
|
-
namespaceFunctionName,
|
|
189
|
-
localizationsMap: functionLocalizationsMap,
|
|
190
|
-
proxyParameterDescriptors: methodDescriptor.parameterDescriptors.map((parameterDescriptor) => {
|
|
191
|
-
const expandedParameterDescriptor = expandParameterDescriptor(parameterDescriptor);
|
|
192
|
-
const parameterName = expandedParameterDescriptor.name;
|
|
193
|
-
const parameterLocalizationsMap = this.generateLocalizationsMap(`Parameters.${parameterName}.`, (_locale, localization) => localization);
|
|
194
|
-
this._parameterLocalizationsMapsMap.set(`${namespaceFunctionName}.${parameterName}`, parameterLocalizationsMap);
|
|
195
|
-
return {
|
|
196
|
-
namespace,
|
|
197
|
-
parameterName,
|
|
198
|
-
localizationsMap: parameterLocalizationsMap,
|
|
199
|
-
parameterDescriptor: expandedParameterDescriptor
|
|
200
|
-
};
|
|
201
|
-
}),
|
|
202
|
-
methodDescriptor
|
|
203
|
-
});
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
success = true;
|
|
207
|
-
}
|
|
208
|
-
finally {
|
|
209
|
-
await this.finalize(success);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,OAAO,E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CAAC,mBAAmB,CAAC;wBACrB,GAAG,qBAAqB;wBACxB,YAAY;wBACZ,qBAAqB;wBACrB,gBAAgB,EAAE,wBAAwB;wBAC1C,yBAAyB,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC,mBAAmB,EAAE,EAAE;4BACzF,MAAM,2BAA2B,GAAG,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;4BAEnF,MAAM,aAAa,GAAG,2BAA2B,CAAC,IAAI,CAAC;4BAEvD,MAAM,yBAAyB,GAAG,IAAI,CAAC,wBAAwB,CAAC,cAAc,aAAa,GAAG,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC;4BAEzI,IAAI,CAAC,8BAA8B,CAAC,GAAG,CAAC,GAAG,qBAAqB,IAAI,aAAa,EAAE,EAAE,yBAAyB,CAAC,CAAC;4BAEhH,OAAO;gCACH,SAAS;gCACT,aAAa;gCACb,gBAAgB,EAAE,yBAAyB;gCAC3C,mBAAmB,EAAE,2BAA2B;6BACnD,CAAC;wBACN,CAAC,CAAC;wBACF,gBAAgB;qBACnB,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;YAED,OAAO,GAAG,IAAI,CAAC;QACnB,CAAC;gBAAS,CAAC;YACP,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QACjC,CAAC;IACL,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,iBAAiB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
package/dist/generator/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AppExtension } from "../app-extension.js";
|
|
2
|
-
import type { ErrorExtends } from "../types.js";
|
|
3
|
-
import { CharacterSetProxy } from "../utility/character-set-proxy.js";
|
|
4
|
-
export declare class AI82Proxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
5
|
-
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
|
|
6
|
-
}
|
|
7
|
-
export declare class AI39Proxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends CharacterSetProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
8
|
-
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>);
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=character-set-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set-proxy.d.ts","sourceRoot":"","sources":["../../src/gs1/character-set-proxy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAKhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,qBAUa,SAAS,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAE,SAAQ,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;gBACnL,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;CAG1F;AAED,qBAUa,SAAS,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAE,SAAQ,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;gBACnL,YAAY,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC;CAG1F"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { AI39_CREATOR, AI82_CREATOR } from "@aidc-toolkit/gs1";
|
|
8
|
-
import { expandParameterDescriptor, ProxyClass } from "../descriptor.js";
|
|
9
|
-
import { exclusionAllNumericParameterDescriptor, exclusionNoneParameterDescriptor } from "../utility/character-set-descriptor.js";
|
|
10
|
-
import { CharacterSetProxy } from "../utility/character-set-proxy.js";
|
|
11
|
-
let AI82Proxy = class AI82Proxy extends CharacterSetProxy {
|
|
12
|
-
constructor(appExtension) {
|
|
13
|
-
super(appExtension, AI82_CREATOR);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
AI82Proxy = __decorate([
|
|
17
|
-
ProxyClass({
|
|
18
|
-
namespace: "GS1",
|
|
19
|
-
methodInfix: "AI82",
|
|
20
|
-
replaceParameterDescriptors: [
|
|
21
|
-
{
|
|
22
|
-
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
23
|
-
replacement: exclusionAllNumericParameterDescriptor
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
})
|
|
27
|
-
], AI82Proxy);
|
|
28
|
-
export { AI82Proxy };
|
|
29
|
-
let AI39Proxy = class AI39Proxy extends CharacterSetProxy {
|
|
30
|
-
constructor(appExtension) {
|
|
31
|
-
super(appExtension, AI39_CREATOR);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
AI39Proxy = __decorate([
|
|
35
|
-
ProxyClass({
|
|
36
|
-
namespace: "GS1",
|
|
37
|
-
methodInfix: "AI39",
|
|
38
|
-
replaceParameterDescriptors: [
|
|
39
|
-
{
|
|
40
|
-
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
41
|
-
replacement: exclusionAllNumericParameterDescriptor
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
})
|
|
45
|
-
], AI39Proxy);
|
|
46
|
-
export { AI39Proxy };
|
|
47
|
-
//# sourceMappingURL=character-set-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"character-set-proxy.js","sourceRoot":"","sources":["../../src/gs1/character-set-proxy.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,EACH,sCAAsC,EACtC,gCAAgC,EACnC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAY/D,IAAM,SAAS,GAAf,MAAM,SAA4G,SAAQ,iBAAkE;IAC/L,YAAY,YAA2E;QACnF,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAJY,SAAS;IAVrB,UAAU,CAAC;QACR,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,MAAM;QACnB,2BAA2B,EAAE;YACzB;gBACI,IAAI,EAAE,yBAAyB,CAAC,gCAAgC,CAAC,CAAC,IAAI;gBACtE,WAAW,EAAE,sCAAsC;aACtD;SACJ;KACJ,CAAC;GACW,SAAS,CAIrB;;AAYM,IAAM,SAAS,GAAf,MAAM,SAA4G,SAAQ,iBAAkE;IAC/L,YAAY,YAA2E;QACnF,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACtC,CAAC;CACJ,CAAA;AAJY,SAAS;IAVrB,UAAU,CAAC;QACR,SAAS,EAAE,KAAK;QAChB,WAAW,EAAE,MAAM;QACnB,2BAA2B,EAAE;YACzB;gBACI,IAAI,EAAE,yBAAyB,CAAC,gCAAgC,CAAC,CAAC,IAAI;gBACtE,WAAW,EAAE,sCAAsC;aACtD;SACJ;KACJ,CAAC;GACW,SAAS,CAIrB"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LibProxy } from "../lib-proxy.js";
|
|
2
|
-
import type { ErrorExtends, Matrix, MatrixResultError, ResultError } from "../types.js";
|
|
3
|
-
export declare class CheckProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt> {
|
|
4
|
-
checkDigit(matrixSs: Matrix<string>): MatrixResultError<string, ThrowError, TError>;
|
|
5
|
-
hasValidCheckDigit(matrixSs: Matrix<string>): MatrixResultError<boolean, ThrowError, TError>;
|
|
6
|
-
priceOrWeightCheckDigit(matrixSs: Matrix<string>): MatrixResultError<string, ThrowError, TError>;
|
|
7
|
-
isValidPriceOrWeightCheckDigit(s: string, checkDigit: string): ResultError<boolean, ThrowError, TError>;
|
|
8
|
-
checkCharacterPair(matrixSs: Matrix<string>): MatrixResultError<string, ThrowError, TError>;
|
|
9
|
-
hasValidCheckCharacterPair(matrixSs: Matrix<string>): MatrixResultError<boolean, ThrowError, TError>;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=check-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"check-proxy.d.ts","sourceRoot":"","sources":["../../src/gs1/check-proxy.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,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