@aidc-toolkit/app-extension 1.0.49 → 1.0.50-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/app-extension-options.d.ts +52 -0
- package/dist/app-extension-options.d.ts.map +1 -0
- package/dist/app-extension-options.js +2 -0
- package/dist/app-extension-options.js.map +1 -0
- package/dist/app-extension.d.ts +194 -0
- package/dist/app-extension.d.ts.map +1 -0
- package/dist/app-extension.js +141 -0
- package/dist/app-extension.js.map +1 -0
- package/dist/app-helper-proxy.d.ts +57 -0
- package/dist/app-helper-proxy.d.ts.map +1 -0
- package/dist/app-helper-proxy.js +369 -0
- package/dist/app-helper-proxy.js.map +1 -0
- package/dist/{descriptor-D6tZH-vc.d.cts → descriptor.d.ts} +13 -13
- package/dist/descriptor.d.ts.map +1 -0
- package/dist/descriptor.js +44 -0
- package/dist/descriptor.js.map +1 -0
- package/dist/generator/functions-generator.d.ts +103 -0
- package/dist/generator/functions-generator.d.ts.map +1 -0
- package/dist/generator/functions-generator.js +179 -0
- package/dist/generator/functions-generator.js.map +1 -0
- package/dist/generator/generator.d.ts +121 -0
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +186 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/index.d.ts +18 -239
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +3 -1
- 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 +333 -0
- package/dist/generator/locale-resources-generator.js.map +1 -0
- package/dist/gs1/character-set-proxy.d.ts +12 -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/gcp-length-proxy.d.ts +11 -0
- package/dist/gs1/gcp-length-proxy.d.ts.map +1 -0
- package/dist/gs1/gcp-length-proxy.js +187 -0
- package/dist/gs1/gcp-length-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 +318 -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 +11 -185
- package/dist/gs1/index.d.ts.map +1 -0
- package/dist/gs1/index.js +11 -1
- package/dist/gs1/index.js.map +1 -0
- package/dist/gs1/non-gtin-creator-proxy.d.ts +37 -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 +36 -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 +8 -0
- package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
- package/dist/gs1/prefix-manager-proxy.js +94 -0
- package/dist/gs1/prefix-manager-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/gs1/verified-by-gs1-proxy.d.ts +7 -0
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -0
- package/dist/gs1/verified-by-gs1-proxy.js +100 -0
- package/dist/gs1/verified-by-gs1-proxy.js.map +1 -0
- package/dist/index.d.ts +22 -862
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -0
- package/dist/lib-proxy.d.ts +121 -0
- package/dist/lib-proxy.d.ts.map +1 -0
- package/dist/lib-proxy.js +259 -0
- package/dist/lib-proxy.js.map +1 -0
- package/dist/{index.d.cts → locale/en/locale-resources.d.ts} +2 -113
- package/dist/locale/en/locale-resources.d.ts.map +1 -0
- package/dist/locale/en/locale-resources.js +754 -0
- package/dist/locale/en/locale-resources.js.map +1 -0
- package/dist/locale/fr/locale-resources.d.ts +755 -0
- package/dist/locale/fr/locale-resources.d.ts.map +1 -0
- package/dist/locale/fr/locale-resources.js +754 -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 +135 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +291 -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 +72 -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 +32 -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 +10 -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/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +5 -0
- package/dist/version.js.map +1 -0
- package/package.json +5 -5
- package/src/app-extension-options.ts +61 -0
- package/src/app-extension.ts +22 -32
- package/src/app-helper-proxy.ts +21 -33
- package/src/generator/functions-generator.ts +14 -45
- package/src/generator/generator.ts +28 -18
- package/src/generator/locale-resources-generator.ts +79 -52
- package/src/gs1/character-set-proxy.ts +6 -7
- package/src/gs1/check-proxy.ts +8 -8
- package/src/gs1/gcp-length-proxy.ts +8 -8
- package/src/gs1/gtin-creator-proxy.ts +4 -4
- package/src/gs1/gtin-validator-proxy.ts +12 -12
- package/src/gs1/identifier-creator-proxy.ts +14 -14
- package/src/gs1/identifier-validator-proxy.ts +10 -10
- package/src/gs1/non-gtin-creator-proxy.ts +22 -23
- package/src/gs1/non-gtin-validator-proxy.ts +22 -23
- package/src/gs1/prefix-manager-proxy.ts +2 -2
- package/src/gs1/variable-measure-proxy.ts +4 -4
- package/src/gs1/verified-by-gs1-proxy.ts +5 -11
- package/src/index.ts +1 -0
- package/src/lib-proxy.ts +27 -43
- package/src/locale/en/locale-resources.ts +1 -1
- package/src/proxy.ts +12 -15
- package/src/streaming.ts +3 -3
- package/src/type.ts +3 -22
- package/src/utility/character-set-proxy.ts +17 -16
- package/src/utility/reg-exp-proxy.ts +2 -2
- package/src/utility/string-proxy.ts +2 -2
- package/src/utility/transformer-proxy.ts +6 -5
- package/src/version.ts +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/character-set-proxy-BOW94WCe.d.cts +0 -473
- package/dist/character-set-proxy-BOW94WCe.d.ts +0 -473
- package/dist/chunk-22IRLVWO.js +0 -1
- package/dist/chunk-MR63TJ3B.js +0 -1
- package/dist/chunk-TWX7TPRC.js +0 -1
- package/dist/descriptor-D6tZH-vc.d.ts +0 -185
- package/dist/generator/index.cjs +0 -17
- package/dist/generator/index.d.cts +0 -240
- package/dist/gs1/index.cjs +0 -1
- package/dist/gs1/index.d.cts +0 -185
- package/dist/index.cjs +0 -17
|
@@ -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,10 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
2
|
+
import type { BigInteger } from "../app-extension-options.js";
|
|
3
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
4
|
+
import type { Matrix, MatrixResult } from "../type.js";
|
|
5
|
+
export declare class TransformerProxy extends LibProxy {
|
|
6
|
+
forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
|
|
7
|
+
forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
|
|
8
|
+
reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
|
|
9
|
+
}
|
|
10
|
+
//# 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;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoBvD,qBAIa,gBAAiB,SAAQ,QAAQ;IAM1C,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,UAAU,CAAC;IActI,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,UAAU,CAAC;IAa1I,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,UAAU,CAAC;CAOpJ"}
|
|
@@ -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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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,gBAAgB,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC"}
|
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.50-beta",
|
|
4
4
|
"description": "Application extension framework for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@aidc-toolkit/dev": "
|
|
37
|
+
"@aidc-toolkit/dev": "1.0.44-beta"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@aidc-toolkit/core": "
|
|
41
|
-
"@aidc-toolkit/gs1": "
|
|
42
|
-
"@aidc-toolkit/utility": "
|
|
40
|
+
"@aidc-toolkit/core": "1.0.45-beta",
|
|
41
|
+
"@aidc-toolkit/gs1": "1.0.47-beta",
|
|
42
|
+
"@aidc-toolkit/utility": "1.0.46-beta"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application extension options. Never instantiated; used only as extension point for custom application extension
|
|
3
|
+
* options to define types.
|
|
4
|
+
*/
|
|
5
|
+
export interface AppExtensionOptions {
|
|
6
|
+
/**
|
|
7
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
8
|
+
*/
|
|
9
|
+
ThrowError: boolean;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Application error.
|
|
13
|
+
*/
|
|
14
|
+
ApplicationError: object;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Invocation context.
|
|
18
|
+
*/
|
|
19
|
+
InvocationContext: unknown;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Streaming context.
|
|
23
|
+
*/
|
|
24
|
+
StreamingContext: unknown;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Big integer representation.
|
|
28
|
+
*/
|
|
29
|
+
BigInteger: number | bigint;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Custom application extension options.
|
|
34
|
+
*/
|
|
35
|
+
export interface CustomAppExtensionOptions extends AppExtensionOptions {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
40
|
+
*/
|
|
41
|
+
export type ThrowError = CustomAppExtensionOptions["ThrowError"];
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Application error type.
|
|
45
|
+
*/
|
|
46
|
+
export type ApplicationError = CustomAppExtensionOptions["ApplicationError"];
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Invocation context type.
|
|
50
|
+
*/
|
|
51
|
+
export type InvocationContext = CustomAppExtensionOptions["InvocationContext"];
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Streaming context type.
|
|
55
|
+
*/
|
|
56
|
+
export type StreamingContext = CustomAppExtensionOptions["StreamingContext"];
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Big integer representation type.
|
|
60
|
+
*/
|
|
61
|
+
export type BigInteger = CustomAppExtensionOptions["BigInteger"];
|
package/src/app-extension.ts
CHANGED
|
@@ -8,30 +8,22 @@ import {
|
|
|
8
8
|
type Promisable
|
|
9
9
|
} from "@aidc-toolkit/core";
|
|
10
10
|
import type { Logger } from "tslog";
|
|
11
|
+
import type {
|
|
12
|
+
ApplicationError,
|
|
13
|
+
BigInteger,
|
|
14
|
+
InvocationContext,
|
|
15
|
+
StreamingContext,
|
|
16
|
+
ThrowError
|
|
17
|
+
} from "./app-extension-options.js";
|
|
11
18
|
import type { LibProxy } from "./lib-proxy.js";
|
|
12
19
|
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
13
20
|
import type { StreamingCancelledCallback, StreamingConsumerCallback } from "./streaming.js";
|
|
14
|
-
import type {
|
|
21
|
+
import type { MatrixResult, SheetAddress, SheetRange, SingletonResult } from "./type.js";
|
|
15
22
|
|
|
16
23
|
/**
|
|
17
24
|
* Application extension.
|
|
18
|
-
*
|
|
19
|
-
* @template ThrowError
|
|
20
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
21
|
-
*
|
|
22
|
-
* @template TError
|
|
23
|
-
* Error type.
|
|
24
|
-
*
|
|
25
|
-
* @template TInvocationContext
|
|
26
|
-
* Application-specific invocation context type.
|
|
27
|
-
*
|
|
28
|
-
* @template TStreamingInvocationContext
|
|
29
|
-
* Application-specific streaming invocation context type.
|
|
30
|
-
*
|
|
31
|
-
* @template TBigInt
|
|
32
|
-
* Type to which big integer is mapped.
|
|
33
25
|
*/
|
|
34
|
-
export abstract class AppExtension
|
|
26
|
+
export abstract class AppExtension {
|
|
35
27
|
/**
|
|
36
28
|
* Application name.
|
|
37
29
|
*/
|
|
@@ -80,7 +72,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
80
72
|
/**
|
|
81
73
|
* Proxies map for lazy loading and memory management.
|
|
82
74
|
*/
|
|
83
|
-
readonly #proxiesMap = new WeakMap<object, LibProxy
|
|
75
|
+
readonly #proxiesMap = new WeakMap<object, LibProxy>();
|
|
84
76
|
|
|
85
77
|
/**
|
|
86
78
|
* Constructor.
|
|
@@ -171,7 +163,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
171
163
|
* @returns
|
|
172
164
|
* Proxy instance.
|
|
173
165
|
*/
|
|
174
|
-
getProxy<T extends LibProxy
|
|
166
|
+
getProxy<T extends LibProxy>(ProxyConstructor: new (appExtension: AppExtension) => T): T {
|
|
175
167
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type is managed in this method.
|
|
176
168
|
let proxy = this.#proxiesMap.get(ProxyConstructor) as T | undefined;
|
|
177
169
|
|
|
@@ -193,7 +185,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
193
185
|
* @returns
|
|
194
186
|
* Sheet address.
|
|
195
187
|
*/
|
|
196
|
-
abstract getSheetAddress(invocationContext:
|
|
188
|
+
abstract getSheetAddress(invocationContext: InvocationContext): Promisable<SheetAddress>;
|
|
197
189
|
|
|
198
190
|
/**
|
|
199
191
|
* Get a parameter range from an invocation context.
|
|
@@ -207,13 +199,13 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
207
199
|
* @returns
|
|
208
200
|
* Sheet range or null if parameter is not a range.
|
|
209
201
|
*/
|
|
210
|
-
abstract getParameterSheetRange(invocationContext:
|
|
202
|
+
abstract getParameterSheetRange(invocationContext: InvocationContext, parameterNumber: number): Promisable<SheetRange | null>;
|
|
211
203
|
|
|
212
204
|
/**
|
|
213
|
-
*
|
|
205
|
+
* Install a streaming function.
|
|
214
206
|
*
|
|
215
|
-
* @param
|
|
216
|
-
* Streaming
|
|
207
|
+
* @param streamingContext
|
|
208
|
+
* Streaming context.
|
|
217
209
|
*
|
|
218
210
|
* @param streamingCancelledCallback
|
|
219
211
|
* Streaming cancelled callback, called when streaming is cancelled.
|
|
@@ -221,7 +213,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
221
213
|
* @returns
|
|
222
214
|
* Streaming consumer callback, called when stream contents updated.
|
|
223
215
|
*/
|
|
224
|
-
abstract
|
|
216
|
+
abstract installStreaming<TResult>(streamingContext: StreamingContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult>;
|
|
225
217
|
|
|
226
218
|
/**
|
|
227
219
|
* Get a property stored within the active document.
|
|
@@ -286,7 +278,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
286
278
|
}
|
|
287
279
|
|
|
288
280
|
/**
|
|
289
|
-
* Map big integer to
|
|
281
|
+
* Map a big integer to its representation type.
|
|
290
282
|
*
|
|
291
283
|
* @param value
|
|
292
284
|
* Big integer value to map.
|
|
@@ -294,29 +286,27 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
294
286
|
* @returns
|
|
295
287
|
* Mapped big integer value.
|
|
296
288
|
*/
|
|
297
|
-
abstract mapBigInt(value: bigint): SingletonResult<
|
|
289
|
+
abstract mapBigInt(value: bigint): SingletonResult<BigInteger>;
|
|
298
290
|
|
|
299
291
|
/**
|
|
300
292
|
* Map hyperlink results to a form suitable for the application.
|
|
301
293
|
*
|
|
302
|
-
* @param invocationContext
|
|
303
|
-
* Invocation context.
|
|
304
|
-
*
|
|
305
294
|
* @param matrixHyperlinkResults
|
|
306
295
|
* Matrix of hyperlink results from function call.
|
|
307
296
|
*
|
|
308
297
|
* @returns
|
|
309
298
|
* Matrix of results in a form suitable for the application.
|
|
310
299
|
*/
|
|
311
|
-
abstract mapHyperlinkResults(
|
|
300
|
+
abstract mapHyperlinkResults(matrixHyperlinkResults: MatrixResult<Hyperlink>): Promisable<MatrixResult<unknown>>;
|
|
312
301
|
|
|
313
302
|
/**
|
|
314
303
|
* Map a range error (thrown by the library) to an application-specific error. If errors are reported through the
|
|
315
304
|
* throw/catch mechanism, the implementation may return the range error unmodified if that is supported.
|
|
316
305
|
*
|
|
317
306
|
* @param rangeError
|
|
307
|
+
* Range error.
|
|
318
308
|
*/
|
|
319
|
-
abstract mapRangeError(rangeError: RangeError):
|
|
309
|
+
abstract mapRangeError(rangeError: RangeError): ApplicationError;
|
|
320
310
|
|
|
321
311
|
/**
|
|
322
312
|
* Handle an error with a message; called when an exception occurs outside the control of the AIDC Toolkit library.
|
package/src/app-helper-proxy.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isNullish, type LogLevel, logLevelOf, type NonNullishable, type Nullishable } from "@aidc-toolkit/core";
|
|
2
|
+
import type { InvocationContext, StreamingContext } from "./app-extension-options.js";
|
|
2
3
|
import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "./descriptor.js";
|
|
3
4
|
import { LibProxy } from "./lib-proxy.js";
|
|
4
5
|
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
5
6
|
import { proxy } from "./proxy.js";
|
|
6
|
-
import type {
|
|
7
|
+
import type { Matrix, MatrixResult } from "./type.js";
|
|
7
8
|
|
|
8
9
|
const spillArrayParameterDescriptor: ParameterDescriptor = {
|
|
9
10
|
name: "spillArray",
|
|
@@ -54,27 +55,14 @@ interface MaximumDimensions {
|
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
|
-
* Application
|
|
58
|
-
*
|
|
59
|
-
* @template ThrowError
|
|
60
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
61
|
-
*
|
|
62
|
-
* @template TError
|
|
63
|
-
* Error type.
|
|
64
|
-
*
|
|
65
|
-
* @template TInvocationContext
|
|
66
|
-
* Application-specific invocation context type.
|
|
67
|
-
*
|
|
68
|
-
* @template TStreamingInvocationContext
|
|
69
|
-
* Application-specific streaming invocation context type.
|
|
70
|
-
*
|
|
71
|
-
* @template TBigInt
|
|
72
|
-
* Type to which big integer is mapped.
|
|
58
|
+
* Application helper.
|
|
73
59
|
*/
|
|
74
60
|
@proxy.describeClass(false, {
|
|
75
61
|
category: "helper"
|
|
76
62
|
})
|
|
77
|
-
export class AppHelperProxy
|
|
63
|
+
export class AppHelperProxy extends LibProxy {
|
|
64
|
+
static readonly #LOGGER_STREAM_NAME = "loggerStream";
|
|
65
|
+
|
|
78
66
|
/**
|
|
79
67
|
* Get the version.
|
|
80
68
|
*
|
|
@@ -102,7 +90,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
102
90
|
* @returns
|
|
103
91
|
* Array of maximum width and maximum height.
|
|
104
92
|
*/
|
|
105
|
-
async #defaultMaximums(maximumDimensions: MaximumDimensions, invocationContext: Nullishable<
|
|
93
|
+
async #defaultMaximums(maximumDimensions: MaximumDimensions, invocationContext: Nullishable<InvocationContext>): Promise<NonNullishable<MaximumDimensions>> {
|
|
106
94
|
if (isNullish(invocationContext)) {
|
|
107
95
|
// Application error; no localization necessary.
|
|
108
96
|
throw new Error("Invocation context not provided by application");
|
|
@@ -111,8 +99,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
111
99
|
const maximumWidth = maximumDimensions.width;
|
|
112
100
|
const maximumHeight = maximumDimensions.height;
|
|
113
101
|
|
|
114
|
-
let definedMaximumWidth
|
|
115
|
-
let definedMaximumHeight
|
|
102
|
+
let definedMaximumWidth;
|
|
103
|
+
let definedMaximumHeight;
|
|
116
104
|
|
|
117
105
|
// Skip any extra work if both values are provided.
|
|
118
106
|
if (isNullish(maximumWidth) || isNullish(maximumHeight)) {
|
|
@@ -156,8 +144,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
156
144
|
requiresContext: true,
|
|
157
145
|
parameterDescriptors: [spillArrayParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
|
|
158
146
|
})
|
|
159
|
-
async spill(arrayValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<
|
|
160
|
-
let result
|
|
147
|
+
async spill(arrayValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<InvocationContext>): Promise<MatrixResult<unknown>> {
|
|
148
|
+
let result;
|
|
161
149
|
|
|
162
150
|
// Assume matrix is uniformly two-dimensional.
|
|
163
151
|
const height = arrayValues.length;
|
|
@@ -279,7 +267,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
279
267
|
isHidden: true,
|
|
280
268
|
parameterDescriptors: [logLevelParameterDescriptor]
|
|
281
269
|
})
|
|
282
|
-
loggerMessages(logLevelString: Nullishable<string>): MatrixResult<string
|
|
270
|
+
loggerMessages(logLevelString: Nullishable<string>): MatrixResult<string> {
|
|
283
271
|
const appExtension = this.appExtension;
|
|
284
272
|
|
|
285
273
|
let logLevel: LogLevel | undefined = undefined;
|
|
@@ -306,8 +294,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
306
294
|
* @param logLevelString
|
|
307
295
|
* Log level as string.
|
|
308
296
|
*
|
|
309
|
-
* @param
|
|
310
|
-
* Streaming
|
|
297
|
+
* @param streamingContext
|
|
298
|
+
* Streaming context.
|
|
311
299
|
*/
|
|
312
300
|
@proxy.describeMethod({
|
|
313
301
|
type: Types.String,
|
|
@@ -316,10 +304,10 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
316
304
|
isStream: true,
|
|
317
305
|
parameterDescriptors: [logLevelParameterDescriptor]
|
|
318
306
|
})
|
|
319
|
-
loggerStream(logLevelString: Nullishable<string>,
|
|
320
|
-
if (isNullish(
|
|
307
|
+
loggerStream(logLevelString: Nullishable<string>, streamingContext: Nullishable<StreamingContext>): void {
|
|
308
|
+
if (isNullish(streamingContext)) {
|
|
321
309
|
// Application error; no localization necessary.
|
|
322
|
-
throw new Error("Streaming
|
|
310
|
+
throw new Error("Streaming context not provided by application");
|
|
323
311
|
}
|
|
324
312
|
|
|
325
313
|
const appExtension = this.appExtension;
|
|
@@ -327,9 +315,9 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
327
315
|
let notificationCallbackAdded = false;
|
|
328
316
|
let previousLogLevel: number | undefined = undefined;
|
|
329
317
|
|
|
330
|
-
const streamingConsumerCallback = appExtension.
|
|
318
|
+
const streamingConsumerCallback = appExtension.installStreaming<string>(streamingContext, () => {
|
|
331
319
|
if (notificationCallbackAdded) {
|
|
332
|
-
appExtension.memoryTransport.removeNotificationCallback(
|
|
320
|
+
appExtension.memoryTransport.removeNotificationCallback(AppHelperProxy.#LOGGER_STREAM_NAME);
|
|
333
321
|
}
|
|
334
322
|
|
|
335
323
|
if (previousLogLevel !== undefined) {
|
|
@@ -337,7 +325,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
337
325
|
}
|
|
338
326
|
});
|
|
339
327
|
|
|
340
|
-
if (appExtension.memoryTransport.addNotificationCallback(
|
|
328
|
+
if (appExtension.memoryTransport.addNotificationCallback(AppHelperProxy.#LOGGER_STREAM_NAME, (_message, messages) => {
|
|
341
329
|
streamingConsumerCallback(this.iterableResult(() => messages));
|
|
342
330
|
})) {
|
|
343
331
|
notificationCallbackAdded = true;
|
|
@@ -359,7 +347,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
359
347
|
}
|
|
360
348
|
} else {
|
|
361
349
|
// Diagnostic tool; localization not required.
|
|
362
|
-
streamingConsumerCallback([["Only one logger
|
|
350
|
+
streamingConsumerCallback([["Only one logger stream allowable per workbook"]]);
|
|
363
351
|
}
|
|
364
352
|
}
|
|
365
353
|
}
|
|
@@ -71,6 +71,11 @@ export abstract class FunctionsGenerator extends Generator {
|
|
|
71
71
|
[Types.Any]: "any"
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Dummy value passed to invocation context and streaming context parameters if context is not supported.
|
|
76
|
+
*/
|
|
77
|
+
static readonly #DUMMY_VALUE = "0";
|
|
78
|
+
|
|
74
79
|
protected static readonly BASE_IMPORTS = [
|
|
75
80
|
"import * as AppExtension from \"@aidc-toolkit/app-extension\";",
|
|
76
81
|
"import { appExtension } from \"./app-extension.js\";"
|
|
@@ -86,21 +91,6 @@ export abstract class FunctionsGenerator extends Generator {
|
|
|
86
91
|
*/
|
|
87
92
|
readonly #supportsContext: boolean;
|
|
88
93
|
|
|
89
|
-
/**
|
|
90
|
-
* Invocation context type name.
|
|
91
|
-
*/
|
|
92
|
-
readonly #invocationContextTypeName: string;
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* Streaming invocation context type name.
|
|
96
|
-
*/
|
|
97
|
-
readonly #streamingInvocationContextTypeName: string;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Template declaration for type alias.
|
|
101
|
-
*/
|
|
102
|
-
readonly #templateDeclaration: string;
|
|
103
|
-
|
|
104
94
|
/**
|
|
105
95
|
* Current class type alias.
|
|
106
96
|
*/
|
|
@@ -115,35 +105,14 @@ export abstract class FunctionsGenerator extends Generator {
|
|
|
115
105
|
* @param inline
|
|
116
106
|
* If true, functions are declared inline rather than using `function`.
|
|
117
107
|
*
|
|
118
|
-
* @param throwError
|
|
119
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
120
|
-
*
|
|
121
|
-
* @param errorTypeName
|
|
122
|
-
* Error type name.
|
|
123
|
-
*
|
|
124
108
|
* @param supportsContext
|
|
125
109
|
* If true, application extension supports context.
|
|
126
|
-
*
|
|
127
|
-
* Big integer type name.
|
|
128
|
-
* @param invocationContextTypeName
|
|
129
|
-
* Invocation context type name.
|
|
130
|
-
*
|
|
131
|
-
* @param streamingInvocationContextTypeName
|
|
132
|
-
* Streaming invocation context type name.
|
|
133
|
-
*
|
|
134
|
-
* @param bigIntTypeName
|
|
135
|
-
* Big integer type name.
|
|
136
110
|
*/
|
|
137
|
-
constructor(version: string, inline: boolean,
|
|
111
|
+
constructor(version: string, inline: boolean, supportsContext: boolean) {
|
|
138
112
|
super(version, true);
|
|
139
113
|
|
|
140
114
|
this.#inline = inline;
|
|
141
|
-
|
|
142
115
|
this.#supportsContext = supportsContext;
|
|
143
|
-
this.#invocationContextTypeName = invocationContextTypeName;
|
|
144
|
-
this.#streamingInvocationContextTypeName = streamingInvocationContextTypeName;
|
|
145
|
-
|
|
146
|
-
this.#templateDeclaration = `<${throwError}, ${errorTypeName}, ${invocationContextTypeName}, ${streamingInvocationContextTypeName}, ${bigIntTypeName}>`;
|
|
147
116
|
}
|
|
148
117
|
|
|
149
118
|
/**
|
|
@@ -173,7 +142,7 @@ export abstract class FunctionsGenerator extends Generator {
|
|
|
173
142
|
const classDescriptorNamespace = classDescriptor.namespace ?? "";
|
|
174
143
|
const name = `${classDescriptorNamespace}${classDescriptor.name}`;
|
|
175
144
|
const getter = `get${name}()`;
|
|
176
|
-
const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}
|
|
145
|
+
const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}`;
|
|
177
146
|
|
|
178
147
|
this.#classTypeAlias = {
|
|
179
148
|
name,
|
|
@@ -241,26 +210,26 @@ export abstract class FunctionsGenerator extends Generator {
|
|
|
241
210
|
parameterLocalizations.push({
|
|
242
211
|
name: "invocationContext",
|
|
243
212
|
description: "Invocation context.",
|
|
244
|
-
javaScriptType:
|
|
213
|
+
javaScriptType: "InvocationContext"
|
|
245
214
|
});
|
|
246
215
|
}
|
|
247
216
|
|
|
248
217
|
if (methodDescriptor.isStream === true) {
|
|
249
218
|
parameterLocalizations.push({
|
|
250
|
-
name: "
|
|
251
|
-
description: "Streaming
|
|
252
|
-
javaScriptType:
|
|
219
|
+
name: "streamingContext",
|
|
220
|
+
description: "Streaming context.",
|
|
221
|
+
javaScriptType: "StreamingContext"
|
|
253
222
|
});
|
|
254
223
|
}
|
|
255
224
|
} else {
|
|
256
225
|
if (methodDescriptor.requiresContext === true) {
|
|
257
226
|
// Invocation context type name represents a literal dummy value.
|
|
258
|
-
dummyParameters.push(
|
|
227
|
+
dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
|
|
259
228
|
}
|
|
260
229
|
|
|
261
230
|
if (methodDescriptor.isStream === true) {
|
|
262
|
-
// Streaming
|
|
263
|
-
dummyParameters.push(
|
|
231
|
+
// Streaming context type name represents a literal dummy value.
|
|
232
|
+
dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
|
|
264
233
|
}
|
|
265
234
|
}
|
|
266
235
|
|