@aidc-toolkit/app-extension 1.0.23-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-resources-generator.ts +14 -10
- 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/i18n.ts +3 -5
- package/src/locale/i18next.d.ts +1 -1
- 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-resources.d.ts +0 -617
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -616
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -617
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -616
- 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 -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
package/dist/descriptor.d.ts
DELETED
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import type { AppExtension } from "./app-extension.js";
|
|
2
|
-
import { LibProxy } from "./lib-proxy.js";
|
|
3
|
-
import type { ErrorExtends } from "./types.js";
|
|
4
|
-
/**
|
|
5
|
-
* Core descriptor.
|
|
6
|
-
*/
|
|
7
|
-
interface Descriptor {
|
|
8
|
-
readonly name: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Types supported by proxy methods.
|
|
12
|
-
*/
|
|
13
|
-
export declare const Types: {
|
|
14
|
-
/**
|
|
15
|
-
* String.
|
|
16
|
-
*/
|
|
17
|
-
readonly String: 0;
|
|
18
|
-
/**
|
|
19
|
-
* Number or enumeration.
|
|
20
|
-
*/
|
|
21
|
-
readonly Number: 1;
|
|
22
|
-
/**
|
|
23
|
-
* Boolean.
|
|
24
|
-
*/
|
|
25
|
-
readonly Boolean: 2;
|
|
26
|
-
/**
|
|
27
|
-
* Any.
|
|
28
|
-
*/
|
|
29
|
-
readonly Any: 3;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Type.
|
|
33
|
-
*/
|
|
34
|
-
export type Type = typeof Types[keyof typeof Types];
|
|
35
|
-
/**
|
|
36
|
-
* Type descriptor.
|
|
37
|
-
*/
|
|
38
|
-
interface TypeDescriptor extends Descriptor {
|
|
39
|
-
/**
|
|
40
|
-
* Type.
|
|
41
|
-
*/
|
|
42
|
-
readonly type: Type;
|
|
43
|
-
/**
|
|
44
|
-
* True if type is a matrix (method accepts or returns a two-dimensional array).
|
|
45
|
-
*/
|
|
46
|
-
readonly isMatrix: boolean;
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* Base parameter descriptor; all attributes required.
|
|
50
|
-
*/
|
|
51
|
-
export interface BaseParameterDescriptor extends TypeDescriptor {
|
|
52
|
-
/**
|
|
53
|
-
* True if required.
|
|
54
|
-
*/
|
|
55
|
-
readonly isRequired: boolean;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Extends parameter descriptor; extends a parameter descriptor and overrides select attributes.
|
|
59
|
-
*/
|
|
60
|
-
export interface ExtendsParameterDescriptor extends Partial<BaseParameterDescriptor> {
|
|
61
|
-
/**
|
|
62
|
-
* Base parameter descriptor that this one extends.
|
|
63
|
-
*/
|
|
64
|
-
readonly extendsDescriptor: ParameterDescriptor;
|
|
65
|
-
/**
|
|
66
|
-
* Sort order within base parameter descriptor if applicable.
|
|
67
|
-
*/
|
|
68
|
-
readonly sortOrder?: number;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Parameter descriptor, either base or extends.
|
|
72
|
-
*/
|
|
73
|
-
export type ParameterDescriptor = BaseParameterDescriptor | ExtendsParameterDescriptor;
|
|
74
|
-
/**
|
|
75
|
-
* Expand a parameter descriptor to its full form with all required attributes.
|
|
76
|
-
*
|
|
77
|
-
* @param parameterDescriptor
|
|
78
|
-
* Parameter descriptor.
|
|
79
|
-
*
|
|
80
|
-
* @returns
|
|
81
|
-
* Parameter descriptor in its full form.
|
|
82
|
-
*/
|
|
83
|
-
export declare function expandParameterDescriptor(parameterDescriptor: ParameterDescriptor): BaseParameterDescriptor;
|
|
84
|
-
/**
|
|
85
|
-
* Method descriptor.
|
|
86
|
-
*/
|
|
87
|
-
export interface MethodDescriptor extends TypeDescriptor {
|
|
88
|
-
/**
|
|
89
|
-
* If true, application-specific invocation context is required.
|
|
90
|
-
*/
|
|
91
|
-
readonly requiresContext?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* If true, method infix is ignored.
|
|
94
|
-
*/
|
|
95
|
-
readonly ignoreInfix?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* String before which method infix appears. If undefined, infix is appended to the method name. Ignored if
|
|
98
|
-
* `ignoreInfix` is true.
|
|
99
|
-
*/
|
|
100
|
-
readonly infixBefore?: string;
|
|
101
|
-
/**
|
|
102
|
-
* Parameter descriptors.
|
|
103
|
-
*/
|
|
104
|
-
readonly parameterDescriptors: readonly ParameterDescriptor[];
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Class descriptor.
|
|
108
|
-
*/
|
|
109
|
-
export interface ClassDescriptor extends Descriptor {
|
|
110
|
-
/**
|
|
111
|
-
* Class namespace. If not provided, class is at the top level.
|
|
112
|
-
*/
|
|
113
|
-
readonly namespace?: string;
|
|
114
|
-
/**
|
|
115
|
-
* Method infix. If undefined, method name is generated verbatim.
|
|
116
|
-
*/
|
|
117
|
-
readonly methodInfix?: string;
|
|
118
|
-
/**
|
|
119
|
-
* Replace parameter descriptors for class hierarchies where enumeration parameter descriptors can change.
|
|
120
|
-
*/
|
|
121
|
-
readonly replaceParameterDescriptors?: ReadonlyArray<{
|
|
122
|
-
readonly name: string;
|
|
123
|
-
readonly replacement: ParameterDescriptor;
|
|
124
|
-
}>;
|
|
125
|
-
/**
|
|
126
|
-
* Method descriptors.
|
|
127
|
-
*/
|
|
128
|
-
readonly methodDescriptors: readonly MethodDescriptor[];
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Proxy class type with fixed constructor.
|
|
132
|
-
*/
|
|
133
|
-
type ProxyClassType<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>> = (new (appExtension: AppExtension<ThrowError, TError, TInvocationContext, TBigInt>) => T) & typeof LibProxy;
|
|
134
|
-
/**
|
|
135
|
-
* Proxy parameter decorator.
|
|
136
|
-
*
|
|
137
|
-
* @param parameterDescriptor
|
|
138
|
-
* Parameter descriptor.
|
|
139
|
-
*
|
|
140
|
-
* @returns
|
|
141
|
-
* Function defining metadata for the parameter.
|
|
142
|
-
*/
|
|
143
|
-
export declare function ProxyParameter<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>>(parameterDescriptor: ParameterDescriptor): ((target: T, propertyKey: string, parameterIndex: number) => void);
|
|
144
|
-
/**
|
|
145
|
-
* Proxy method decorator.
|
|
146
|
-
*
|
|
147
|
-
* @param methodDescriptor
|
|
148
|
-
* Method descriptor.
|
|
149
|
-
*
|
|
150
|
-
* @returns
|
|
151
|
-
* Function defining metadata for the method.
|
|
152
|
-
*/
|
|
153
|
-
export declare function ProxyMethod<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>>(methodDescriptor: Omit<MethodDescriptor, "name" | "parameterDescriptors">): ((target: T, propertyKey: string, propertyDescriptor: PropertyDescriptor) => void);
|
|
154
|
-
/**
|
|
155
|
-
* Proxy class decorator.
|
|
156
|
-
*
|
|
157
|
-
* @param classDescriptor
|
|
158
|
-
* Class descriptor.
|
|
159
|
-
*
|
|
160
|
-
* @returns
|
|
161
|
-
* Function defining metadata for the class.
|
|
162
|
-
*/
|
|
163
|
-
export declare function ProxyClass<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TBigInt, T extends LibProxy<ThrowError, TError, TInvocationContext, TBigInt>>(classDescriptor?: Omit<ClassDescriptor, "name" | "methodDescriptors">): ((classType: ProxyClassType<ThrowError, TError, TInvocationContext, TBigInt, T>) => void);
|
|
164
|
-
/**
|
|
165
|
-
* Get class descriptors.
|
|
166
|
-
*
|
|
167
|
-
* @returns
|
|
168
|
-
* Class descriptors.
|
|
169
|
-
*/
|
|
170
|
-
export declare function getClassDescriptors(): ReadonlyMap<string, ClassDescriptor>;
|
|
171
|
-
export {};
|
|
172
|
-
//# sourceMappingURL=descriptor.d.ts.map
|
package/dist/descriptor.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAiB,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AAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,SAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,kBAAkB,EAAE,kBAAkB,KAAK,IAAI,CAAC,CA4ChW;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,SAAS,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,eAAe,GAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,mBAAmB,CAAM,GAAG,CAAC,CAAC,SAAS,EAAE,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAmDtW;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAE1E"}
|
package/dist/descriptor.js
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { LibProxy } from "./lib-proxy.js";
|
|
2
|
-
/**
|
|
3
|
-
* Types supported by proxy methods.
|
|
4
|
-
*/
|
|
5
|
-
export const Types = {
|
|
6
|
-
/**
|
|
7
|
-
* String.
|
|
8
|
-
*/
|
|
9
|
-
String: 0,
|
|
10
|
-
/**
|
|
11
|
-
* Number or enumeration.
|
|
12
|
-
*/
|
|
13
|
-
Number: 1,
|
|
14
|
-
/**
|
|
15
|
-
* Boolean.
|
|
16
|
-
*/
|
|
17
|
-
Boolean: 2,
|
|
18
|
-
/**
|
|
19
|
-
* Any.
|
|
20
|
-
*/
|
|
21
|
-
Any: 3
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Expand a parameter descriptor to its full form with all required attributes.
|
|
25
|
-
*
|
|
26
|
-
* @param parameterDescriptor
|
|
27
|
-
* Parameter descriptor.
|
|
28
|
-
*
|
|
29
|
-
* @returns
|
|
30
|
-
* Parameter descriptor in its full form.
|
|
31
|
-
*/
|
|
32
|
-
export function expandParameterDescriptor(parameterDescriptor) {
|
|
33
|
-
return !("extendsDescriptor" in parameterDescriptor) ?
|
|
34
|
-
parameterDescriptor :
|
|
35
|
-
{
|
|
36
|
-
...expandParameterDescriptor(parameterDescriptor.extendsDescriptor),
|
|
37
|
-
...parameterDescriptor
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Pending parameter descriptors, consumed and reset when method is described.
|
|
42
|
-
*/
|
|
43
|
-
let pendingParameterDescriptors = [];
|
|
44
|
-
/**
|
|
45
|
-
* Class method descriptors, keyed on declaration class name and method name.
|
|
46
|
-
*/
|
|
47
|
-
const classMethodsDescriptorsMap = new Map();
|
|
48
|
-
/**
|
|
49
|
-
* Class descriptors, keyed on declaration class name.
|
|
50
|
-
*/
|
|
51
|
-
const classDescriptorsMap = new Map();
|
|
52
|
-
/**
|
|
53
|
-
* Proxy parameter decorator.
|
|
54
|
-
*
|
|
55
|
-
* @param parameterDescriptor
|
|
56
|
-
* Parameter descriptor.
|
|
57
|
-
*
|
|
58
|
-
* @returns
|
|
59
|
-
* Function defining metadata for the parameter.
|
|
60
|
-
*/
|
|
61
|
-
export function ProxyParameter(parameterDescriptor) {
|
|
62
|
-
return (_target, _propertyKey, parameterIndex) => {
|
|
63
|
-
pendingParameterDescriptors[parameterIndex] = parameterDescriptor;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Proxy method decorator.
|
|
68
|
-
*
|
|
69
|
-
* @param methodDescriptor
|
|
70
|
-
* Method descriptor.
|
|
71
|
-
*
|
|
72
|
-
* @returns
|
|
73
|
-
* Function defining metadata for the method.
|
|
74
|
-
*/
|
|
75
|
-
export function ProxyMethod(methodDescriptor) {
|
|
76
|
-
return (target, propertyKey, propertyDescriptor) => {
|
|
77
|
-
const declarationClassName = target.constructor.name;
|
|
78
|
-
// Validate that method descriptor is applied to a function.
|
|
79
|
-
if (typeof propertyDescriptor.value !== "function") {
|
|
80
|
-
throw new Error(`${declarationClassName}.${propertyKey} is not a method`);
|
|
81
|
-
}
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Known to be a method.
|
|
83
|
-
const parameterCount = propertyDescriptor.value.length - (!(methodDescriptor.requiresContext ?? false) ? 0 : 1);
|
|
84
|
-
let anyOptional = false;
|
|
85
|
-
// Validate that all parameters have descriptors.
|
|
86
|
-
for (let index = 0; index < parameterCount; index++) {
|
|
87
|
-
const parameterDescriptor = expandParameterDescriptor(pendingParameterDescriptors[index]);
|
|
88
|
-
if (typeof parameterDescriptor === "undefined") {
|
|
89
|
-
throw new Error(`Missing parameter descriptor at index ${index} of ${declarationClassName}.${propertyKey}`);
|
|
90
|
-
}
|
|
91
|
-
if (!parameterDescriptor.isRequired) {
|
|
92
|
-
anyOptional = true;
|
|
93
|
-
}
|
|
94
|
-
else if (anyOptional) {
|
|
95
|
-
throw new Error(`Parameter descriptor ${parameterDescriptor.name} at index ${index} of ${declarationClassName}.${propertyKey} is required but prior parameter descriptor ${pendingParameterDescriptors[index - 1].name} is optional`);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
let methodDescriptors = classMethodsDescriptorsMap.get(declarationClassName);
|
|
99
|
-
if (methodDescriptors === undefined) {
|
|
100
|
-
methodDescriptors = [];
|
|
101
|
-
classMethodsDescriptorsMap.set(declarationClassName, methodDescriptors);
|
|
102
|
-
}
|
|
103
|
-
// Method descriptors array is constructed in reverse order so that final result is in the correct order.
|
|
104
|
-
methodDescriptors.push({
|
|
105
|
-
name: propertyKey,
|
|
106
|
-
...methodDescriptor,
|
|
107
|
-
parameterDescriptors: pendingParameterDescriptors
|
|
108
|
-
});
|
|
109
|
-
pendingParameterDescriptors = [];
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Proxy class decorator.
|
|
114
|
-
*
|
|
115
|
-
* @param classDescriptor
|
|
116
|
-
* Class descriptor.
|
|
117
|
-
*
|
|
118
|
-
* @returns
|
|
119
|
-
* Function defining metadata for the class.
|
|
120
|
-
*/
|
|
121
|
-
export function ProxyClass(classDescriptor = {}) {
|
|
122
|
-
return (classType) => {
|
|
123
|
-
const methodDescriptorsMap = new Map();
|
|
124
|
-
/**
|
|
125
|
-
* Build method descriptors map from every class in hierarchy until LibProxy class is reached.
|
|
126
|
-
*
|
|
127
|
-
* @param classType
|
|
128
|
-
* Class type.
|
|
129
|
-
*/
|
|
130
|
-
function buildMethodDescriptorsMap(classType) {
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Class hierarchy is known.
|
|
132
|
-
const baseClassType = Object.getPrototypeOf(classType);
|
|
133
|
-
// Start with class furthest up the hierarchy.
|
|
134
|
-
if (baseClassType !== LibProxy) {
|
|
135
|
-
buildMethodDescriptorsMap(baseClassType);
|
|
136
|
-
}
|
|
137
|
-
const classMethodDescriptors = classMethodsDescriptorsMap.get(classType.name);
|
|
138
|
-
if (classMethodDescriptors !== undefined) {
|
|
139
|
-
for (const classMethodDescriptor of classMethodDescriptors) {
|
|
140
|
-
// If any class overrides a base class method, it will appear in the same position as the base class method.
|
|
141
|
-
methodDescriptorsMap.set(classMethodDescriptor.name, classMethodDescriptor);
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
buildMethodDescriptorsMap(classType);
|
|
146
|
-
let methodDescriptors;
|
|
147
|
-
if (classDescriptor.replaceParameterDescriptors !== undefined) {
|
|
148
|
-
const replacementParameterDescriptorsMap = new Map(classDescriptor.replaceParameterDescriptors.map(replaceParameterDescriptor => [replaceParameterDescriptor.name, replaceParameterDescriptor.replacement]));
|
|
149
|
-
// Method descriptors for class have to be built as copies due to possible mutation of parameter descriptors.
|
|
150
|
-
methodDescriptors = Array.from(methodDescriptorsMap.values()).map(methodDescriptor => ({
|
|
151
|
-
...methodDescriptor,
|
|
152
|
-
parameterDescriptors: methodDescriptor.parameterDescriptors.map(parameterDescriptor => replacementParameterDescriptorsMap.get(expandParameterDescriptor(parameterDescriptor).name) ?? parameterDescriptor)
|
|
153
|
-
}));
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
methodDescriptors = Array.from(methodDescriptorsMap.values());
|
|
157
|
-
}
|
|
158
|
-
classDescriptorsMap.set(classType.name, {
|
|
159
|
-
name: classType.name,
|
|
160
|
-
...classDescriptor,
|
|
161
|
-
methodDescriptors
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Get class descriptors.
|
|
167
|
-
*
|
|
168
|
-
* @returns
|
|
169
|
-
* Class descriptors.
|
|
170
|
-
*/
|
|
171
|
-
export function getClassDescriptors() {
|
|
172
|
-
return classDescriptorsMap;
|
|
173
|
-
}
|
|
174
|
-
//# sourceMappingURL=descriptor.js.map
|
package/dist/descriptor.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAU1C;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,GAAG,EAAE,CAAC;CACA,CAAC;AAoDX;;;;;;;;GAQG;AACH,MAAM,UAAU,yBAAyB,CAAC,mBAAwC;IAC9E,OAAO,CAAC,CAAC,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,CAAC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE;YACpC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,GAAG,eAAe;YAClB,iBAAiB;SACpB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB;IAC/B,OAAO,mBAAmB,CAAC;AAC/B,CAAC"}
|
|
@@ -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
|
-
//# sourceMappingURL=descriptor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../../src/generator/descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEnG;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACtD;;OAEG;IACH,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,YAAY;IAC1D;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,wBAAwB;IAClE;;OAEG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IAEpC;;OAEG;IACH,QAAQ,CAAC,eAAe,EAAE,eAAe,CAAC;CAC7C;AAED;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB;IAC/D;;OAEG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,wBAAwB,EAAE,sBAAsB,CAAC,qBAAqB,CAAC;IACrH;;OAEG;IACH,QAAQ,CAAC,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,E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