@aidc-toolkit/app-extension 1.0.33-beta → 1.0.35-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/README.md +1 -5
- package/dist/app-extension.d.ts +194 -0
- package/dist/app-extension.d.ts.map +1 -0
- package/dist/app-extension.js +133 -0
- package/dist/app-extension.js.map +1 -0
- package/dist/app-helper-proxy.d.ts +61 -0
- package/dist/app-helper-proxy.d.ts.map +1 -0
- package/dist/app-helper-proxy.js +332 -0
- package/dist/app-helper-proxy.js.map +1 -0
- package/dist/descriptor.d.ts +189 -0
- package/dist/descriptor.d.ts.map +1 -0
- package/dist/descriptor.js +44 -0
- package/dist/descriptor.js.map +1 -0
- package/dist/generator/generator.d.ts +117 -0
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +187 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/index.d.ts +2 -0
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +2 -0
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/locale-resources-generator.d.ts +2 -0
- package/dist/generator/locale-resources-generator.d.ts.map +1 -0
- package/dist/generator/locale-resources-generator.js +311 -0
- package/dist/generator/locale-resources-generator.js.map +1 -0
- package/dist/gs1/character-set-proxy.d.ts +13 -0
- package/dist/gs1/character-set-proxy.d.ts.map +1 -0
- package/dist/gs1/character-set-proxy.js +126 -0
- package/dist/gs1/character-set-proxy.js.map +1 -0
- package/dist/gs1/check-proxy.d.ts +11 -0
- package/dist/gs1/check-proxy.d.ts.map +1 -0
- package/dist/gs1/check-proxy.js +163 -0
- package/dist/gs1/check-proxy.js.map +1 -0
- package/dist/gs1/gtin-creator-proxy.d.ts +10 -0
- package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/gtin-creator-proxy.js +85 -0
- package/dist/gs1/gtin-creator-proxy.js.map +1 -0
- package/dist/gs1/gtin-descriptor.d.ts +3 -0
- package/dist/gs1/gtin-descriptor.d.ts.map +1 -0
- package/dist/gs1/gtin-descriptor.js +8 -0
- package/dist/gs1/gtin-descriptor.js.map +1 -0
- package/dist/gs1/gtin-validator-proxy.d.ts +26 -0
- package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/gtin-validator-proxy.js +256 -0
- package/dist/gs1/gtin-validator-proxy.js.map +1 -0
- package/dist/gs1/identifier-creator-proxy.d.ts +30 -0
- package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/identifier-creator-proxy.js +302 -0
- package/dist/gs1/identifier-creator-proxy.js.map +1 -0
- package/dist/gs1/identifier-descriptor.d.ts +4 -0
- package/dist/gs1/identifier-descriptor.d.ts.map +1 -0
- package/dist/gs1/identifier-descriptor.js +14 -0
- package/dist/gs1/identifier-descriptor.js.map +1 -0
- package/dist/gs1/identifier-type.d.ts +22 -0
- package/dist/gs1/identifier-type.d.ts.map +1 -0
- package/dist/gs1/identifier-type.js +34 -0
- package/dist/gs1/identifier-type.js.map +1 -0
- package/dist/gs1/identifier-validator-proxy.d.ts +29 -0
- package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/identifier-validator-proxy.js +212 -0
- package/dist/gs1/identifier-validator-proxy.js.map +1 -0
- package/dist/gs1/index.d.ts +10 -0
- package/dist/gs1/index.d.ts.map +1 -0
- package/dist/gs1/index.js +10 -0
- package/dist/gs1/index.js.map +1 -0
- package/dist/gs1/non-gtin-creator-proxy.d.ts +38 -0
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/non-gtin-creator-proxy.js +301 -0
- package/dist/gs1/non-gtin-creator-proxy.js.map +1 -0
- package/dist/gs1/non-gtin-validator-proxy.d.ts +37 -0
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/non-gtin-validator-proxy.js +302 -0
- package/dist/gs1/non-gtin-validator-proxy.js.map +1 -0
- package/dist/gs1/prefix-definition-descriptor.d.ts +4 -0
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +1 -0
- package/dist/gs1/prefix-definition-descriptor.js +16 -0
- package/dist/gs1/prefix-definition-descriptor.js.map +1 -0
- package/dist/gs1/prefix-manager-proxy.d.ts +14 -0
- package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
- package/dist/gs1/prefix-manager-proxy.js +213 -0
- package/dist/gs1/prefix-manager-proxy.js.map +1 -0
- package/dist/gs1/service-proxy.d.ts +7 -0
- package/dist/gs1/service-proxy.d.ts.map +1 -0
- package/dist/gs1/service-proxy.js +105 -0
- package/dist/gs1/service-proxy.js.map +1 -0
- package/dist/gs1/variable-measure-proxy.d.ts +7 -0
- package/dist/gs1/variable-measure-proxy.d.ts.map +1 -0
- package/dist/gs1/variable-measure-proxy.js +114 -0
- package/dist/gs1/variable-measure-proxy.js.map +1 -0
- package/dist/index.d.ts +28 -1865
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -2
- package/dist/index.js.map +1 -0
- package/dist/lib-proxy.d.ts +135 -0
- package/dist/lib-proxy.d.ts.map +1 -0
- package/dist/lib-proxy.js +276 -0
- package/dist/lib-proxy.js.map +1 -0
- package/dist/locale/en/locale-resources.d.ts +752 -0
- package/dist/locale/en/locale-resources.d.ts.map +1 -0
- package/dist/locale/en/locale-resources.js +751 -0
- package/dist/locale/en/locale-resources.js.map +1 -0
- package/dist/locale/fr/locale-resources.d.ts +752 -0
- package/dist/locale/fr/locale-resources.d.ts.map +1 -0
- package/dist/locale/fr/locale-resources.js +751 -0
- package/dist/locale/fr/locale-resources.js.map +1 -0
- package/dist/locale/i18n.d.ts +27 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/dist/locale/i18n.js +36 -0
- package/dist/locale/i18n.js.map +1 -0
- package/dist/proxy.d.ts +136 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +295 -0
- package/dist/proxy.js.map +1 -0
- package/dist/streaming.d.ts +10 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +2 -0
- package/dist/streaming.js.map +1 -0
- package/dist/type.d.ts +91 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +2 -0
- package/dist/type.js.map +1 -0
- package/dist/utility/character-set-descriptor.d.ts +6 -0
- package/dist/utility/character-set-descriptor.d.ts.map +1 -0
- package/dist/utility/character-set-descriptor.js +28 -0
- package/dist/utility/character-set-descriptor.js.map +1 -0
- package/dist/utility/character-set-proxy.d.ts +31 -0
- package/dist/utility/character-set-proxy.d.ts.map +1 -0
- package/dist/utility/character-set-proxy.js +278 -0
- package/dist/utility/character-set-proxy.js.map +1 -0
- package/dist/utility/index.d.ts +4 -0
- package/dist/utility/index.d.ts.map +1 -0
- package/dist/utility/index.js +4 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/utility/reg-exp-proxy.d.ts +8 -0
- package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
- package/dist/utility/reg-exp-proxy.js +103 -0
- package/dist/utility/reg-exp-proxy.js.map +1 -0
- package/dist/utility/string-descriptor.d.ts +4 -0
- package/dist/utility/string-descriptor.d.ts.map +1 -0
- package/dist/utility/string-descriptor.js +12 -0
- package/dist/utility/string-descriptor.js.map +1 -0
- package/dist/utility/string-proxy.d.ts +7 -0
- package/dist/utility/string-proxy.d.ts.map +1 -0
- package/dist/utility/string-proxy.js +63 -0
- package/dist/utility/string-proxy.js.map +1 -0
- package/dist/utility/transformer-descriptor.d.ts +6 -0
- package/dist/utility/transformer-descriptor.d.ts.map +1 -0
- package/dist/utility/transformer-descriptor.js +24 -0
- package/dist/utility/transformer-descriptor.js.map +1 -0
- package/dist/utility/transformer-proxy.d.ts +9 -0
- package/dist/utility/transformer-proxy.d.ts.map +1 -0
- package/dist/utility/transformer-proxy.js +111 -0
- package/dist/utility/transformer-proxy.js.map +1 -0
- package/package.json +11 -10
- package/src/descriptor.ts +0 -5
- package/src/generator/generator.ts +59 -9
- package/src/index.ts +2 -1
- package/src/proxy.ts +0 -29
- package/tsconfig-src.json +7 -1
- package/tsconfig-src.tsbuildinfo +1 -0
- package/dist/index.cjs +0 -17
- package/dist/index.d.cts +0 -1865
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
2
|
+
export const sParameterDescriptor = {
|
|
3
|
+
name: "s",
|
|
4
|
+
type: Types.String,
|
|
5
|
+
multiplicity: Multiplicities.Matrix,
|
|
6
|
+
isRequired: true
|
|
7
|
+
};
|
|
8
|
+
export const validateSParameterDescriptor = {
|
|
9
|
+
extendsDescriptor: sParameterDescriptor,
|
|
10
|
+
name: "validateS"
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=string-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-descriptor.js","sourceRoot":"","sources":["../../src/utility/string-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEpH,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACrD,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,MAAM;IACnC,UAAU,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAA+B;IACpE,iBAAiB,EAAE,oBAAoB;IACvC,IAAI,EAAE,WAAW;CACpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StringValidation, StringValidator } from "@aidc-toolkit/utility";
|
|
2
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
3
|
+
import type { ErrorExtends, Matrix } from "../type.js";
|
|
4
|
+
export declare abstract class StringProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
5
|
+
protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=string-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEvD,8BAGsB,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAE,SAAQ,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAC;IAC3P,SAAS,CAAC,cAAc,CAAC,iBAAiB,SAAS,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;CAKhM"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
36
|
+
import { proxy } from "../proxy.js";
|
|
37
|
+
let StringProxy = (() => {
|
|
38
|
+
let _classDecorators = [proxy.describeClass(true, {
|
|
39
|
+
category: "string"
|
|
40
|
+
})];
|
|
41
|
+
let _classDescriptor;
|
|
42
|
+
let _classExtraInitializers = [];
|
|
43
|
+
let _classThis;
|
|
44
|
+
let _classSuper = LibProxy;
|
|
45
|
+
var StringProxy = class extends _classSuper {
|
|
46
|
+
static { _classThis = this; }
|
|
47
|
+
static {
|
|
48
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
49
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
50
|
+
StringProxy = _classThis = _classDescriptor.value;
|
|
51
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
validateString(validator, matrixSs, validation) {
|
|
55
|
+
return this.matrixErrorResult(matrixSs, (s) => {
|
|
56
|
+
validator.validate(s, validation);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return StringProxy = _classThis;
|
|
61
|
+
})();
|
|
62
|
+
export { StringProxy };
|
|
63
|
+
//# sourceMappingURL=string-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-proxy.js","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;IAMd,WAAW;4BAHhC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;YACvB,QAAQ,EAAE,QAAQ;SACrB,CAAC;;;;sBACuK,QAAQ;2BAAhB,SAAQ,WAAsF;;;;YAA/P,6KAMC;;;YANqB,uDAAW;;QACnB,cAAc,CAA6C,SAA6C,EAAE,QAAwB,EAAE,UAA8B;YACxK,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC1C,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC;;;;SALiB,WAAW"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ExtendsParameterDescriptor, type ParameterDescriptor } from "../descriptor.js";
|
|
2
|
+
export declare const valueParameterDescriptor: ParameterDescriptor;
|
|
3
|
+
export declare const startValueParameterDescriptor: ExtendsParameterDescriptor;
|
|
4
|
+
export declare const countParameterDescriptor: ExtendsParameterDescriptor;
|
|
5
|
+
export declare const tweakParameterDescriptor: ParameterDescriptor;
|
|
6
|
+
//# sourceMappingURL=transformer-descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-descriptor.d.ts","sourceRoot":"","sources":["../../src/utility/transformer-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAkB,KAAK,mBAAmB,EAAS,MAAM,kBAAkB,CAAC;AAEpH,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,0BAI3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,0BAItC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
2
|
+
export const valueParameterDescriptor = {
|
|
3
|
+
name: "value",
|
|
4
|
+
type: Types.Number,
|
|
5
|
+
multiplicity: Multiplicities.Matrix,
|
|
6
|
+
isRequired: true
|
|
7
|
+
};
|
|
8
|
+
export const startValueParameterDescriptor = {
|
|
9
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
10
|
+
name: "startValue",
|
|
11
|
+
multiplicity: Multiplicities.Singleton
|
|
12
|
+
};
|
|
13
|
+
export const countParameterDescriptor = {
|
|
14
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
15
|
+
name: "count",
|
|
16
|
+
multiplicity: Multiplicities.Singleton
|
|
17
|
+
};
|
|
18
|
+
export const tweakParameterDescriptor = {
|
|
19
|
+
name: "tweak",
|
|
20
|
+
type: Types.Number,
|
|
21
|
+
multiplicity: Multiplicities.Singleton,
|
|
22
|
+
isRequired: false
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=transformer-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-descriptor.js","sourceRoot":"","sources":["../../src/utility/transformer-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEpH,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IACzD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,MAAM;IACnC,UAAU,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAA+B;IACrE,iBAAiB,EAAE,wBAAwB;IAC3C,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,cAAc,CAAC,SAAS;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAA+B;IAChE,iBAAiB,EAAE,wBAAwB;IAC3C,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,cAAc,CAAC,SAAS;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IACzD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,SAAS;IACtC,UAAU,EAAE,KAAK;CACpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
2
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
3
|
+
import type { ErrorExtends, Matrix, MatrixResult } from "../type.js";
|
|
4
|
+
export declare class TransformerProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
5
|
+
forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
6
|
+
forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
7
|
+
reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=transformer-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/transformer-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoBrE,qBAIa,gBAAgB,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAE,SAAQ,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAC;IAMvP,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IAcvJ,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IAa3J,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;CAOrK"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { mapIterable, Sequence, Transformer } from "@aidc-toolkit/utility";
|
|
36
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
37
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
38
|
+
import { proxy } from "../proxy.js";
|
|
39
|
+
import { countParameterDescriptor, startValueParameterDescriptor, tweakParameterDescriptor, valueParameterDescriptor } from "./transformer-descriptor.js";
|
|
40
|
+
const domainParameterDescriptor = {
|
|
41
|
+
name: "domain",
|
|
42
|
+
type: Types.Number,
|
|
43
|
+
multiplicity: Multiplicities.Singleton,
|
|
44
|
+
isRequired: true
|
|
45
|
+
};
|
|
46
|
+
const transformedValueParameterDescriptor = {
|
|
47
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
48
|
+
name: "transformedValue"
|
|
49
|
+
};
|
|
50
|
+
let TransformerProxy = (() => {
|
|
51
|
+
let _classDecorators = [proxy.describeClass(false, {
|
|
52
|
+
category: "transformation",
|
|
53
|
+
methodInfix: "Transform"
|
|
54
|
+
})];
|
|
55
|
+
let _classDescriptor;
|
|
56
|
+
let _classExtraInitializers = [];
|
|
57
|
+
let _classThis;
|
|
58
|
+
let _classSuper = LibProxy;
|
|
59
|
+
let _instanceExtraInitializers = [];
|
|
60
|
+
let _forward_decorators;
|
|
61
|
+
let _forwardSequence_decorators;
|
|
62
|
+
let _reverse_decorators;
|
|
63
|
+
var TransformerProxy = class extends _classSuper {
|
|
64
|
+
static { _classThis = this; }
|
|
65
|
+
static {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
_forward_decorators = [proxy.describeMethod({
|
|
68
|
+
type: Types.Number,
|
|
69
|
+
multiplicity: Multiplicities.Matrix,
|
|
70
|
+
parameterDescriptors: [domainParameterDescriptor, valueParameterDescriptor, tweakParameterDescriptor]
|
|
71
|
+
})];
|
|
72
|
+
_forwardSequence_decorators = [proxy.describeMethod({
|
|
73
|
+
infixBefore: "Sequence",
|
|
74
|
+
type: Types.Number,
|
|
75
|
+
multiplicity: Multiplicities.Array,
|
|
76
|
+
parameterDescriptors: [domainParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, tweakParameterDescriptor]
|
|
77
|
+
})];
|
|
78
|
+
_reverse_decorators = [proxy.describeMethod({
|
|
79
|
+
type: Types.Number,
|
|
80
|
+
multiplicity: Multiplicities.Matrix,
|
|
81
|
+
parameterDescriptors: [domainParameterDescriptor, transformedValueParameterDescriptor, tweakParameterDescriptor]
|
|
82
|
+
})];
|
|
83
|
+
__esDecorate(this, null, _forward_decorators, { kind: "method", name: "forward", static: false, private: false, access: { has: obj => "forward" in obj, get: obj => obj.forward }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
84
|
+
__esDecorate(this, null, _forwardSequence_decorators, { kind: "method", name: "forwardSequence", static: false, private: false, access: { has: obj => "forwardSequence" in obj, get: obj => obj.forwardSequence }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
85
|
+
__esDecorate(this, null, _reverse_decorators, { kind: "method", name: "reverse", static: false, private: false, access: { has: obj => "reverse" in obj, get: obj => obj.reverse }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
86
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
87
|
+
TransformerProxy = _classThis = _classDescriptor.value;
|
|
88
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
89
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
90
|
+
}
|
|
91
|
+
forward(domain, matrixValues, tweak) {
|
|
92
|
+
return this.setUpMatrixResult(() => Transformer.get(domain, tweak ?? undefined), matrixValues, (transformer, value) => this.mapBigInt(transformer.forward(value)));
|
|
93
|
+
}
|
|
94
|
+
forwardSequence(domain, startValue, count, tweak) {
|
|
95
|
+
return this.iterableResult(() => {
|
|
96
|
+
this.appExtension.validateSequenceCount(count);
|
|
97
|
+
return mapIterable(Transformer.get(domain, tweak ?? undefined).forward(new Sequence(startValue, count)), value => this.mapBigInt(value));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
reverse(domain, matrixTransformedValues, tweak) {
|
|
101
|
+
return this.setUpMatrixResult(() => Transformer.get(domain, tweak ?? undefined), matrixTransformedValues, (transformer, transformedValue) => this.mapBigInt(transformer.reverse(transformedValue)));
|
|
102
|
+
}
|
|
103
|
+
constructor() {
|
|
104
|
+
super(...arguments);
|
|
105
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return TransformerProxy = _classThis;
|
|
109
|
+
})();
|
|
110
|
+
export { TransformerProxy };
|
|
111
|
+
//# sourceMappingURL=transformer-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-proxy.js","sourceRoot":"","sources":["../../src/utility/transformer-proxy.ts"],"names":[],"mappings":"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"}
|
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.35-beta",
|
|
4
4
|
"description": "Application extension framework for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,19 +20,20 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"lint": "eslint",
|
|
23
|
-
"
|
|
24
|
-
"build:
|
|
25
|
-
"build:
|
|
26
|
-
"build:
|
|
27
|
-
"build:
|
|
23
|
+
"tsc-src": "tsc --project tsconfig-src.json",
|
|
24
|
+
"build:non-prod": "rimraf dist tsconfig-src.tsbuildinfo && npm run tsc-src -- --declarationMap --sourceMap",
|
|
25
|
+
"build:alpha": "npm run build:non-prod && tsc --project tsconfig-config.json --noEmit",
|
|
26
|
+
"build:beta": "npm run build:non-prod",
|
|
27
|
+
"build:prod": "npm run tsc-src -- --noEmit && tsup",
|
|
28
|
+
"build:doc": "npm run build:non-prod",
|
|
28
29
|
"generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
|
-
"@aidc-toolkit/dev": "1.0.
|
|
32
|
+
"@aidc-toolkit/dev": "1.0.34-beta"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@aidc-toolkit/core": "1.0.
|
|
35
|
-
"@aidc-toolkit/gs1": "1.0.
|
|
36
|
-
"@aidc-toolkit/utility": "1.0.
|
|
35
|
+
"@aidc-toolkit/core": "1.0.34-beta",
|
|
36
|
+
"@aidc-toolkit/gs1": "1.0.34-beta",
|
|
37
|
+
"@aidc-toolkit/utility": "1.0.34-beta"
|
|
37
38
|
}
|
|
38
39
|
}
|
package/src/descriptor.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { getLogger, I18nEnvironments, type Promisable } from "@aidc-toolkit/core";
|
|
1
|
+
import { getLogger, I18nEnvironments, LocalAppDataStorage, phaseURL, type Promisable } from "@aidc-toolkit/core";
|
|
2
2
|
import type { DefaultNamespace, ParseKeys } from "i18next";
|
|
3
3
|
import type { Logger } from "tslog";
|
|
4
|
+
import packageConfiguration from "../../package.json" with { type: "json" };
|
|
4
5
|
import { AppHelperProxy } from "../app-helper-proxy.js";
|
|
5
6
|
import type { ClassDescriptor, MethodDescriptor } from "../descriptor.js";
|
|
6
7
|
import * as GS1 from "../gs1/index.js";
|
|
@@ -19,6 +20,23 @@ function registerProxies(..._proxies: unknown[]): void {
|
|
|
19
20
|
|
|
20
21
|
registerProxies(AppHelperProxy, Utility, GS1);
|
|
21
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Configuration directory, expected to be present in all repositories that use the generator.
|
|
25
|
+
*/
|
|
26
|
+
const CONFIGURATION_DIRECTORY = "config";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Local resources file, expected to be present in all repositories that use the generator.
|
|
30
|
+
*/
|
|
31
|
+
const LOCAL_RESOURCES_KEY = "resources.local";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Local resources.
|
|
35
|
+
*/
|
|
36
|
+
interface LocalResources {
|
|
37
|
+
alphaURL: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
22
40
|
/**
|
|
23
41
|
* Localization.
|
|
24
42
|
*/
|
|
@@ -58,11 +76,6 @@ export interface FunctionLocalization extends Localization {
|
|
|
58
76
|
* Abstract generator.
|
|
59
77
|
*/
|
|
60
78
|
export abstract class Generator {
|
|
61
|
-
/**
|
|
62
|
-
* Documentation base URL.
|
|
63
|
-
*/
|
|
64
|
-
static readonly #DOCUMENTATION_BASE_URL = "https://aidc-toolkit.com/";
|
|
65
|
-
|
|
66
79
|
/**
|
|
67
80
|
* Documentation path, optionally preceded by locale.
|
|
68
81
|
*/
|
|
@@ -145,10 +158,13 @@ export abstract class Generator {
|
|
|
145
158
|
/**
|
|
146
159
|
* Create a proxy object for a class.
|
|
147
160
|
*
|
|
161
|
+
* @param objectName
|
|
162
|
+
* Object name, derived from namespace and class name.
|
|
163
|
+
*
|
|
148
164
|
* @param classDescriptor
|
|
149
165
|
* Class descriptor.
|
|
150
166
|
*/
|
|
151
|
-
protected abstract createProxyObject(classDescriptor: ClassDescriptor): void;
|
|
167
|
+
protected abstract createProxyObject(objectName: string, classDescriptor: ClassDescriptor): void;
|
|
152
168
|
|
|
153
169
|
/**
|
|
154
170
|
* Create a proxy function for a class and method.
|
|
@@ -208,6 +224,13 @@ export abstract class Generator {
|
|
|
208
224
|
|
|
209
225
|
await i18nAppExtensionInit(I18nEnvironments.CLI);
|
|
210
226
|
|
|
227
|
+
const baseURL = await LocalAppDataStorage.then(async LocalAppDataStorage =>
|
|
228
|
+
new LocalAppDataStorage(CONFIGURATION_DIRECTORY).read(LOCAL_RESOURCES_KEY)
|
|
229
|
+
).then(resources =>
|
|
230
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- File must exist and have this type.
|
|
231
|
+
phaseURL(packageConfiguration.version, (resources as LocalResources).alphaURL)
|
|
232
|
+
);
|
|
233
|
+
|
|
211
234
|
this.initialize();
|
|
212
235
|
|
|
213
236
|
const namespaceHierarchy = new Map<string | undefined, Map<string, ClassDescriptor[]>>();
|
|
@@ -258,15 +281,42 @@ export abstract class Generator {
|
|
|
258
281
|
|
|
259
282
|
this.createCategory(namespace, category, categoryLocalizationsMap);
|
|
260
283
|
|
|
284
|
+
const namespaceClassNamesSet = new Set<string>();
|
|
285
|
+
|
|
261
286
|
for (const classDescriptor of classDescriptors) {
|
|
262
|
-
|
|
287
|
+
const namespaceClassName = classDescriptor.namespaceClassName;
|
|
288
|
+
|
|
289
|
+
if (namespaceClassNamesSet.has(namespaceClassName)) {
|
|
290
|
+
throw new Error(`Duplicate class ${namespaceClassName}`);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
namespaceClassNamesSet.add(namespaceClassName);
|
|
294
|
+
|
|
295
|
+
// First capture group is:
|
|
296
|
+
// - one or more uppercase letters followed by zero or more numbers; or
|
|
297
|
+
// - single uppercase letter followed by zero or more characters except uppercase letters or period.
|
|
298
|
+
//
|
|
299
|
+
// Second capture group is:
|
|
300
|
+
// - single uppercase letter followed by zero or more characters except period; or
|
|
301
|
+
// - zero characters (empty string).
|
|
302
|
+
//
|
|
303
|
+
// Third capture group, separated by optional period, is:
|
|
304
|
+
// - single uppercase letter followed by zero or more characters (remainder of string); or
|
|
305
|
+
// - zero characters (empty string).
|
|
306
|
+
const objectNameGroups = /^(?<namespaceFirstWord>[A-Z]+[0-9]*|[A-Z][^A-Z.]*)(?<namespaceRemaining>[A-Z][^.]*|)\.?(?<className>[A-Z].*|)$/u.exec(namespaceClassName)?.groups;
|
|
307
|
+
|
|
308
|
+
if (objectNameGroups === undefined) {
|
|
309
|
+
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
this.createProxyObject(`${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`, classDescriptor);
|
|
263
313
|
|
|
264
314
|
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
265
315
|
const functionLocalizationsMap = new Map(this.locales.map(locale =>
|
|
266
316
|
[locale, Generator.#generateLocalization<FunctionLocalization>(locale, `Functions.${methodDescriptor.namespaceFunctionName}`, (locale, localization) => ({
|
|
267
317
|
...localization,
|
|
268
318
|
namespaceFunctionName: `${namespacePrefix}${localization.name}`,
|
|
269
|
-
documentationURL: `${
|
|
319
|
+
documentationURL: `${baseURL}/${locale === this.defaultLocale ? "" : `${locale}/`}${Generator.#DOCUMENTATION_PATH}${namespacePath}${localization.name}.html`,
|
|
270
320
|
parametersMap: new Map(methodDescriptor.parameterDescriptors.map(parameterDescriptor =>
|
|
271
321
|
// eslint-disable-next-line max-nested-callbacks -- Callback is empty.
|
|
272
322
|
[parameterDescriptor.name, Generator.#generateLocalization(locale, `Parameters.${parameterDescriptor.name}`, (_locale, localization) => localization)]
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright © 2024-
|
|
2
|
+
* Copyright © 2024-2026 Dolphin Data Development Ltd. and AIDC Toolkit
|
|
3
3
|
* contributors
|
|
4
4
|
*
|
|
5
5
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
+
|
|
17
18
|
export * from "./locale/i18n.js";
|
|
18
19
|
|
|
19
20
|
export type * from "./type.js";
|
package/src/proxy.ts
CHANGED
|
@@ -180,11 +180,6 @@ export class Proxy {
|
|
|
180
180
|
*/
|
|
181
181
|
readonly #concreteClassDescriptorsMap = new Map<typeof LibProxy, ClassDescriptor>();
|
|
182
182
|
|
|
183
|
-
/**
|
|
184
|
-
* Namespace class names set for duplicate detection.
|
|
185
|
-
*/
|
|
186
|
-
readonly #namespaceClassNamesSet = new Set<string>();
|
|
187
|
-
|
|
188
183
|
/**
|
|
189
184
|
* Interim object.
|
|
190
185
|
*/
|
|
@@ -293,16 +288,10 @@ export class Proxy {
|
|
|
293
288
|
const namespacePrefix = namespace === undefined ? "" : `${namespace}.`;
|
|
294
289
|
const namespaceClassName = `${namespacePrefix}${className}`;
|
|
295
290
|
|
|
296
|
-
if (this.#namespaceClassNamesSet.has(namespaceClassName)) {
|
|
297
|
-
throw new Error(`Duplicate class ${namespaceClassName}`);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
291
|
if (category === undefined) {
|
|
301
292
|
throw new Error(`Missing category for ${namespaceClassName}`);
|
|
302
293
|
}
|
|
303
294
|
|
|
304
|
-
this.#namespaceClassNamesSet.add(namespaceClassName);
|
|
305
|
-
|
|
306
295
|
// Replace base class method descriptors with matching names or append new method descriptor.
|
|
307
296
|
for (const classInterimMethodDescriptor of interim.methodDescriptors) {
|
|
308
297
|
const existingIndex = interimMethodDescriptors.findIndex(interimMethodDescriptor => interimMethodDescriptor.name === classInterimMethodDescriptor.name);
|
|
@@ -352,30 +341,12 @@ export class Proxy {
|
|
|
352
341
|
methodDescriptors.push(methodDescriptor);
|
|
353
342
|
}
|
|
354
343
|
|
|
355
|
-
// First capture group is:
|
|
356
|
-
// - one or more uppercase letters followed by zero or more numbers; or
|
|
357
|
-
// - single uppercase letter followed by zero or more characters except uppercase letters or period.
|
|
358
|
-
//
|
|
359
|
-
// Second capture group is:
|
|
360
|
-
// - single uppercase letter followed by zero or more characters except period; or
|
|
361
|
-
// - zero characters (empty string).
|
|
362
|
-
//
|
|
363
|
-
// Third capture group, separated by optional period, is:
|
|
364
|
-
// - single uppercase letter followed by zero or more characters (remainder of string); or
|
|
365
|
-
// - zero characters (empty string).
|
|
366
|
-
const objectNameGroups = /^(?<namespaceFirstWord>[A-Z]+[0-9]*|[A-Z][^A-Z.]*)(?<namespaceRemaining>[A-Z][^.]*|)\.?(?<className>[A-Z].*|)$/u.exec(namespaceClassName)?.groups;
|
|
367
|
-
|
|
368
|
-
if (objectNameGroups === undefined) {
|
|
369
|
-
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
370
|
-
}
|
|
371
|
-
|
|
372
344
|
const classDescriptor: ClassDescriptor = {
|
|
373
345
|
...interimClassDescriptor,
|
|
374
346
|
name: className,
|
|
375
347
|
namespace,
|
|
376
348
|
category,
|
|
377
349
|
namespaceClassName,
|
|
378
|
-
objectName: `${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`,
|
|
379
350
|
methodDescriptors
|
|
380
351
|
};
|
|
381
352
|
|
package/tsconfig-src.json
CHANGED