@aidc-toolkit/app-extension 1.0.46-beta → 1.0.46
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/chunk-FAD3UX6B.js +1 -0
- package/dist/{descriptor.d.ts → descriptor-FJHoLlYK.d.cts} +13 -13
- package/dist/descriptor-FJHoLlYK.d.ts +197 -0
- package/dist/generator/index.cjs +17 -0
- package/dist/generator/{generator.d.ts → index.d.cts} +9 -7
- package/dist/generator/index.d.ts +125 -17
- package/dist/generator/index.js +1 -2
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +1557 -0
- package/dist/index.d.ts +1557 -26
- package/dist/index.js +1 -8
- package/package.json +1 -1
- package/tsconfig-src.tsbuildinfo +1 -1
- package/dist/app-extension.d.ts +0 -194
- package/dist/app-extension.d.ts.map +0 -1
- package/dist/app-extension.js +0 -133
- package/dist/app-extension.js.map +0 -1
- package/dist/app-helper-proxy.d.ts +0 -61
- package/dist/app-helper-proxy.d.ts.map +0 -1
- package/dist/app-helper-proxy.js +0 -333
- package/dist/app-helper-proxy.js.map +0 -1
- package/dist/descriptor.d.ts.map +0 -1
- package/dist/descriptor.js +0 -44
- package/dist/descriptor.js.map +0 -1
- package/dist/generator/generator.d.ts.map +0 -1
- package/dist/generator/generator.js +0 -190
- package/dist/generator/generator.js.map +0 -1
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js.map +0 -1
- package/dist/generator/locale-resources-generator.d.ts +0 -2
- package/dist/generator/locale-resources-generator.d.ts.map +0 -1
- package/dist/generator/locale-resources-generator.js +0 -312
- package/dist/generator/locale-resources-generator.js.map +0 -1
- package/dist/gs1/character-set-proxy.d.ts +0 -13
- package/dist/gs1/character-set-proxy.d.ts.map +0 -1
- package/dist/gs1/character-set-proxy.js +0 -126
- package/dist/gs1/character-set-proxy.js.map +0 -1
- package/dist/gs1/check-proxy.d.ts +0 -11
- package/dist/gs1/check-proxy.d.ts.map +0 -1
- package/dist/gs1/check-proxy.js +0 -163
- package/dist/gs1/check-proxy.js.map +0 -1
- package/dist/gs1/gcp-length-proxy.d.ts +0 -11
- package/dist/gs1/gcp-length-proxy.d.ts.map +0 -1
- package/dist/gs1/gcp-length-proxy.js +0 -190
- package/dist/gs1/gcp-length-proxy.js.map +0 -1
- package/dist/gs1/gtin-creator-proxy.d.ts +0 -10
- package/dist/gs1/gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-creator-proxy.js +0 -85
- package/dist/gs1/gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/gtin-descriptor.d.ts +0 -3
- package/dist/gs1/gtin-descriptor.d.ts.map +0 -1
- package/dist/gs1/gtin-descriptor.js +0 -8
- package/dist/gs1/gtin-descriptor.js.map +0 -1
- package/dist/gs1/gtin-validator-proxy.d.ts +0 -26
- package/dist/gs1/gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/gtin-validator-proxy.js +0 -256
- package/dist/gs1/gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/identifier-creator-proxy.d.ts +0 -30
- package/dist/gs1/identifier-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-creator-proxy.js +0 -302
- package/dist/gs1/identifier-creator-proxy.js.map +0 -1
- package/dist/gs1/identifier-descriptor.d.ts +0 -4
- package/dist/gs1/identifier-descriptor.d.ts.map +0 -1
- package/dist/gs1/identifier-descriptor.js +0 -14
- package/dist/gs1/identifier-descriptor.js.map +0 -1
- package/dist/gs1/identifier-type.d.ts +0 -22
- package/dist/gs1/identifier-type.d.ts.map +0 -1
- package/dist/gs1/identifier-type.js +0 -34
- package/dist/gs1/identifier-type.js.map +0 -1
- package/dist/gs1/identifier-validator-proxy.d.ts +0 -29
- package/dist/gs1/identifier-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/identifier-validator-proxy.js +0 -212
- package/dist/gs1/identifier-validator-proxy.js.map +0 -1
- package/dist/gs1/index.d.ts +0 -11
- package/dist/gs1/index.d.ts.map +0 -1
- package/dist/gs1/index.js +0 -11
- package/dist/gs1/index.js.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.d.ts +0 -38
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-creator-proxy.js +0 -301
- package/dist/gs1/non-gtin-creator-proxy.js.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.d.ts +0 -37
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +0 -1
- package/dist/gs1/non-gtin-validator-proxy.js +0 -302
- package/dist/gs1/non-gtin-validator-proxy.js.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.d.ts +0 -4
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +0 -1
- package/dist/gs1/prefix-definition-descriptor.js +0 -16
- package/dist/gs1/prefix-definition-descriptor.js.map +0 -1
- package/dist/gs1/prefix-manager-proxy.d.ts +0 -8
- package/dist/gs1/prefix-manager-proxy.d.ts.map +0 -1
- package/dist/gs1/prefix-manager-proxy.js +0 -94
- package/dist/gs1/prefix-manager-proxy.js.map +0 -1
- package/dist/gs1/variable-measure-proxy.d.ts +0 -7
- package/dist/gs1/variable-measure-proxy.d.ts.map +0 -1
- package/dist/gs1/variable-measure-proxy.js +0 -114
- package/dist/gs1/variable-measure-proxy.js.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.d.ts +0 -7
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +0 -1
- package/dist/gs1/verified-by-gs1-proxy.js +0 -106
- package/dist/gs1/verified-by-gs1-proxy.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib-proxy.d.ts +0 -135
- package/dist/lib-proxy.d.ts.map +0 -1
- package/dist/lib-proxy.js +0 -276
- package/dist/lib-proxy.js.map +0 -1
- package/dist/locale/en/locale-resources.d.ts +0 -752
- package/dist/locale/en/locale-resources.d.ts.map +0 -1
- package/dist/locale/en/locale-resources.js +0 -751
- package/dist/locale/en/locale-resources.js.map +0 -1
- package/dist/locale/fr/locale-resources.d.ts +0 -752
- package/dist/locale/fr/locale-resources.d.ts.map +0 -1
- package/dist/locale/fr/locale-resources.js +0 -751
- package/dist/locale/fr/locale-resources.js.map +0 -1
- package/dist/locale/i18n.d.ts +0 -27
- package/dist/locale/i18n.d.ts.map +0 -1
- package/dist/locale/i18n.js +0 -36
- package/dist/locale/i18n.js.map +0 -1
- package/dist/proxy.d.ts +0 -136
- package/dist/proxy.d.ts.map +0 -1
- package/dist/proxy.js +0 -295
- package/dist/proxy.js.map +0 -1
- package/dist/streaming.d.ts +0 -10
- package/dist/streaming.d.ts.map +0 -1
- package/dist/streaming.js +0 -2
- package/dist/streaming.js.map +0 -1
- package/dist/type.d.ts +0 -91
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -2
- package/dist/type.js.map +0 -1
- package/dist/utility/character-set-descriptor.d.ts +0 -6
- package/dist/utility/character-set-descriptor.d.ts.map +0 -1
- package/dist/utility/character-set-descriptor.js +0 -28
- package/dist/utility/character-set-descriptor.js.map +0 -1
- package/dist/utility/character-set-proxy.d.ts +0 -31
- package/dist/utility/character-set-proxy.d.ts.map +0 -1
- package/dist/utility/character-set-proxy.js +0 -278
- package/dist/utility/character-set-proxy.js.map +0 -1
- package/dist/utility/index.d.ts +0 -4
- package/dist/utility/index.d.ts.map +0 -1
- package/dist/utility/index.js +0 -4
- package/dist/utility/index.js.map +0 -1
- package/dist/utility/reg-exp-proxy.d.ts +0 -8
- package/dist/utility/reg-exp-proxy.d.ts.map +0 -1
- package/dist/utility/reg-exp-proxy.js +0 -103
- package/dist/utility/reg-exp-proxy.js.map +0 -1
- package/dist/utility/string-descriptor.d.ts +0 -4
- package/dist/utility/string-descriptor.d.ts.map +0 -1
- package/dist/utility/string-descriptor.js +0 -12
- package/dist/utility/string-descriptor.js.map +0 -1
- package/dist/utility/string-proxy.d.ts +0 -7
- package/dist/utility/string-proxy.d.ts.map +0 -1
- package/dist/utility/string-proxy.js +0 -63
- package/dist/utility/string-proxy.js.map +0 -1
- package/dist/utility/transformer-descriptor.d.ts +0 -6
- package/dist/utility/transformer-descriptor.d.ts.map +0 -1
- package/dist/utility/transformer-descriptor.js +0 -24
- package/dist/utility/transformer-descriptor.js.map +0 -1
- package/dist/utility/transformer-proxy.d.ts +0 -9
- package/dist/utility/transformer-proxy.d.ts.map +0 -1
- package/dist/utility/transformer-proxy.js +0 -111
- package/dist/utility/transformer-proxy.js.map +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
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 VerifiedByGS1Proxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
5
|
-
verifiedByGS1(identifierType: string, matrixIdentifiers: Matrix<string>, text: Nullishable<string>, details: Nullishable<string>, invocationContext: Nullishable<TInvocationContext>): Promise<MatrixResult<unknown, ThrowError, TError>>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=verified-by-gs1-proxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-by-gs1-proxy.d.ts","sourceRoot":"","sources":["../../src/gs1/verified-by-gs1-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAuBrE,qBAIa,kBAAkB,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;IAanP,aAAa,CAAC,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,WAAW,CAAC,kBAAkB,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;CAYlP"}
|
|
@@ -1,106 +0,0 @@
|
|
|
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 { isNullish } from "@aidc-toolkit/core";
|
|
36
|
-
import { verifiedByGS1 } from "@aidc-toolkit/gs1";
|
|
37
|
-
import { Multiplicities, Types } from "../descriptor.js";
|
|
38
|
-
import { LibProxy } from "../lib-proxy.js";
|
|
39
|
-
import { proxy } from "../proxy.js";
|
|
40
|
-
import { identifierParameterDescriptor, identifierTypeParameterDescriptor } from "./identifier-descriptor.js";
|
|
41
|
-
import { validateIdentifierType } from "./identifier-type.js";
|
|
42
|
-
const hyperlinkIdentifierParameterDescriptor = {
|
|
43
|
-
extendsDescriptor: identifierParameterDescriptor,
|
|
44
|
-
name: "hyperlinkIdentifier"
|
|
45
|
-
};
|
|
46
|
-
const hyperlinkTextParameterDescriptor = {
|
|
47
|
-
name: "hyperlinkText",
|
|
48
|
-
type: Types.String,
|
|
49
|
-
multiplicity: Multiplicities.Singleton,
|
|
50
|
-
isRequired: false
|
|
51
|
-
};
|
|
52
|
-
const hyperlinkDetailsParameterDescriptor = {
|
|
53
|
-
name: "hyperlinkDetails",
|
|
54
|
-
type: Types.String,
|
|
55
|
-
multiplicity: Multiplicities.Singleton,
|
|
56
|
-
isRequired: false
|
|
57
|
-
};
|
|
58
|
-
let VerifiedByGS1Proxy = (() => {
|
|
59
|
-
let _classDecorators = [proxy.describeClass(false, {
|
|
60
|
-
namespace: "GS1",
|
|
61
|
-
category: "service"
|
|
62
|
-
})];
|
|
63
|
-
let _classDescriptor;
|
|
64
|
-
let _classExtraInitializers = [];
|
|
65
|
-
let _classThis;
|
|
66
|
-
let _classSuper = LibProxy;
|
|
67
|
-
let _instanceExtraInitializers = [];
|
|
68
|
-
let _verifiedByGS1_decorators;
|
|
69
|
-
var VerifiedByGS1Proxy = class extends _classSuper {
|
|
70
|
-
static { _classThis = this; }
|
|
71
|
-
static {
|
|
72
|
-
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
73
|
-
_verifiedByGS1_decorators = [proxy.describeMethod({
|
|
74
|
-
type: Types.Any,
|
|
75
|
-
multiplicity: Multiplicities.Matrix,
|
|
76
|
-
isAsync: true,
|
|
77
|
-
requiresContext: true,
|
|
78
|
-
parameterDescriptors: [
|
|
79
|
-
identifierTypeParameterDescriptor,
|
|
80
|
-
hyperlinkIdentifierParameterDescriptor,
|
|
81
|
-
hyperlinkTextParameterDescriptor,
|
|
82
|
-
hyperlinkDetailsParameterDescriptor
|
|
83
|
-
]
|
|
84
|
-
})];
|
|
85
|
-
__esDecorate(this, null, _verifiedByGS1_decorators, { kind: "method", name: "verifiedByGS1", static: false, private: false, access: { has: obj => "verifiedByGS1" in obj, get: obj => obj.verifiedByGS1 }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
86
|
-
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
87
|
-
VerifiedByGS1Proxy = _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
|
-
async verifiedByGS1(identifierType, matrixIdentifiers, text, details, invocationContext) {
|
|
92
|
-
if (isNullish(invocationContext)) {
|
|
93
|
-
// Application error; no localization necessary.
|
|
94
|
-
throw new Error("Invocation context not provided by application");
|
|
95
|
-
}
|
|
96
|
-
return this.appExtension.mapHyperlinkResults(invocationContext, this.setUpMatrixResult(() => validateIdentifierType(identifierType), matrixIdentifiers, (validatedIdentifierType, identifier) => verifiedByGS1(validatedIdentifierType, identifier, text ?? undefined, details ?? undefined)));
|
|
97
|
-
}
|
|
98
|
-
constructor() {
|
|
99
|
-
super(...arguments);
|
|
100
|
-
__runInitializers(this, _instanceExtraInitializers);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
|
-
return VerifiedByGS1Proxy = _classThis;
|
|
104
|
-
})();
|
|
105
|
-
export { VerifiedByGS1Proxy };
|
|
106
|
-
//# sourceMappingURL=verified-by-gs1-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"verified-by-gs1-proxy.js","sourceRoot":"","sources":["../../src/gs1/verified-by-gs1-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAoB,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,OAAO,EAAE,6BAA6B,EAAE,iCAAiC,EAAE,MAAM,4BAA4B,CAAC;AAC9G,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,sCAAsC,GAA+B;IACvE,iBAAiB,EAAE,6BAA6B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AE,CAAC,uBAAuB,EAAE,UAAU,EAAE,EAAE,CACvD,aAAa,CAAC,uBAAuB,EAAE,UAAU,EAAE,IAAI,IAAI,SAAS,EAAE,OAAO,IAAI,SAAS,CAAC,CAC9F,CAAC,CAAC;QACP,CAAC;;;YAxBQ,mDAAkB;;;;;SAAlB,kBAAkB"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,kBAAkB,CAAC;AAEjC,mBAAmB,WAAW,CAAC;AAE/B,mBAAmB,gBAAgB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,cAAc,kBAAkB,CAAC;AAKjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAE/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC"}
|
package/dist/lib-proxy.d.ts
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import type { AppExtension } from "./app-extension.js";
|
|
2
|
-
import type { ErrorExtends, Matrix, MatrixResult, SingletonResult } from "./type.js";
|
|
3
|
-
/**
|
|
4
|
-
* Library proxy.
|
|
5
|
-
*
|
|
6
|
-
* @template ThrowError
|
|
7
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
8
|
-
*
|
|
9
|
-
* @template TError
|
|
10
|
-
* Error type.
|
|
11
|
-
*
|
|
12
|
-
* @template TInvocationContext
|
|
13
|
-
* Application-specific invocation context type.
|
|
14
|
-
*
|
|
15
|
-
* @template TStreamingInvocationContext
|
|
16
|
-
* Application-specific streaming invocation context type.
|
|
17
|
-
*
|
|
18
|
-
* @template TBigInt
|
|
19
|
-
* Type to which big integer is mapped.
|
|
20
|
-
*/
|
|
21
|
-
export declare abstract class LibProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
22
|
-
#private;
|
|
23
|
-
/**
|
|
24
|
-
* Constructor.
|
|
25
|
-
*
|
|
26
|
-
* @param appExtension
|
|
27
|
-
* Application extension.
|
|
28
|
-
*/
|
|
29
|
-
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>);
|
|
30
|
-
/**
|
|
31
|
-
* Get the application extension.
|
|
32
|
-
*/
|
|
33
|
-
get appExtension(): AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>;
|
|
34
|
-
/**
|
|
35
|
-
* Map big integer to another type if necessary.
|
|
36
|
-
*
|
|
37
|
-
* @param value
|
|
38
|
-
* Big integer value to map.
|
|
39
|
-
*
|
|
40
|
-
* @returns
|
|
41
|
-
* Mapped big integer value.
|
|
42
|
-
*/
|
|
43
|
-
mapBigInt(value: bigint): SingletonResult<TBigInt, ThrowError, TError>;
|
|
44
|
-
/**
|
|
45
|
-
* Call a singleton result function with error handling.
|
|
46
|
-
*
|
|
47
|
-
* @param callback
|
|
48
|
-
* Callback.
|
|
49
|
-
*
|
|
50
|
-
* @returns
|
|
51
|
-
* Callback return or error if errors are not thrown.
|
|
52
|
-
*/
|
|
53
|
-
singletonResult<TResult>(callback: () => SingletonResult<TResult, ThrowError, TError>): SingletonResult<TResult, ThrowError, TError>;
|
|
54
|
-
/**
|
|
55
|
-
* Call a matrix result function with error handling.
|
|
56
|
-
*
|
|
57
|
-
* @param matrixValues
|
|
58
|
-
* Matrix of values.
|
|
59
|
-
*
|
|
60
|
-
* @param valueCallback
|
|
61
|
-
* Callback to process value.
|
|
62
|
-
*
|
|
63
|
-
* @returns
|
|
64
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
65
|
-
*/
|
|
66
|
-
protected matrixResult<TValue, TResult>(matrixValues: Matrix<TValue>, valueCallback: (value: TValue) => SingletonResult<TResult, ThrowError, TError>): MatrixResult<TResult, ThrowError, TError>;
|
|
67
|
-
/**
|
|
68
|
-
* Map a matrix of validate string results to boolean. If the string is empty, the result is true, indicating that
|
|
69
|
-
* there is no error.
|
|
70
|
-
*
|
|
71
|
-
* @param matrixValidateResults
|
|
72
|
-
* Matrix of results from a call to a validate function.
|
|
73
|
-
*
|
|
74
|
-
* @returns
|
|
75
|
-
* Matrix of boolean values, true if corresponding string is empty.
|
|
76
|
-
*/
|
|
77
|
-
protected isValidString(matrixValidateResults: MatrixResult<string, ThrowError, TError>): Matrix<boolean>;
|
|
78
|
-
/**
|
|
79
|
-
* Set up a mapping and call a matrix result function with error handling.
|
|
80
|
-
*
|
|
81
|
-
* @param setUpCallback
|
|
82
|
-
* Callback to set up the mapping.
|
|
83
|
-
*
|
|
84
|
-
* @param matrixValues
|
|
85
|
-
* Matrix of values.
|
|
86
|
-
*
|
|
87
|
-
* @param valueCallback
|
|
88
|
-
* Callback to process value.
|
|
89
|
-
*
|
|
90
|
-
* @returns
|
|
91
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
92
|
-
*/
|
|
93
|
-
protected setUpMatrixResult<TSetup, TValue, TResult>(setUpCallback: () => TSetup, matrixValues: Matrix<TValue>, valueCallback: (setup: TSetup, value: TValue) => SingletonResult<TResult, ThrowError, TError>): MatrixResult<TResult, ThrowError, TError>;
|
|
94
|
-
/**
|
|
95
|
-
* Call an array result function with error handling and map to a matrix.
|
|
96
|
-
*
|
|
97
|
-
* @param matrixValues
|
|
98
|
-
* Matrix of values.
|
|
99
|
-
*
|
|
100
|
-
* @param callback
|
|
101
|
-
* Callback.
|
|
102
|
-
*
|
|
103
|
-
* @returns
|
|
104
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
105
|
-
*/
|
|
106
|
-
protected arrayResult<TValue, TResult>(matrixValues: Matrix<TValue>, callback: (value: TValue) => Array<SingletonResult<TResult, ThrowError, TError>>): MatrixResult<TResult, ThrowError, TError>;
|
|
107
|
-
/**
|
|
108
|
-
* Call a matrix result function with error handling and map a non-error result to an empty string and {@linkcode
|
|
109
|
-
* RangeError} to the string error message.
|
|
110
|
-
*
|
|
111
|
-
* @param matrixValues
|
|
112
|
-
* Matrix of values.
|
|
113
|
-
*
|
|
114
|
-
* @param callback
|
|
115
|
-
* Callback that either returns or throws an exception.
|
|
116
|
-
*
|
|
117
|
-
* @returns
|
|
118
|
-
* Matrix of strings.
|
|
119
|
-
*/
|
|
120
|
-
protected matrixErrorResult<TValue>(matrixValues: Matrix<TValue>, callback: (value: TValue) => void): Matrix<string>;
|
|
121
|
-
/**
|
|
122
|
-
* Call an iterable result function with error handling and map to a matrix. Although the natural approach would be
|
|
123
|
-
* to map to a single-element array containing an array of *N* results (i.e., [[r0, r1, r2, ..., r*N*]]), this is
|
|
124
|
-
* rendered visually as a single row. The more readable approach is as a single column, so the mapping is to an
|
|
125
|
-
* *N*-element array of single-element result arrays (i.e., [[r0], [r1], [r2], ..., [r*N*]]).
|
|
126
|
-
*
|
|
127
|
-
* @param iterableCallback
|
|
128
|
-
* Iterable callback.
|
|
129
|
-
*
|
|
130
|
-
* @returns
|
|
131
|
-
* Matrix of callback results.
|
|
132
|
-
*/
|
|
133
|
-
protected iterableResult<TResult>(iterableCallback: () => Iterable<SingletonResult<TResult, ThrowError, TError>>): MatrixResult<TResult, ThrowError, TError>;
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=lib-proxy.d.ts.map
|
package/dist/lib-proxy.d.ts.map
DELETED
|
@@ -1 +0,0 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nextAppExtension } from "./locale/i18n.js";
|
|
3
|
-
/**
|
|
4
|
-
* Library proxy.
|
|
5
|
-
*
|
|
6
|
-
* @template ThrowError
|
|
7
|
-
* If true, errors are reported through the throw/catch mechanism.
|
|
8
|
-
*
|
|
9
|
-
* @template TError
|
|
10
|
-
* Error type.
|
|
11
|
-
*
|
|
12
|
-
* @template TInvocationContext
|
|
13
|
-
* Application-specific invocation context type.
|
|
14
|
-
*
|
|
15
|
-
* @template TStreamingInvocationContext
|
|
16
|
-
* Application-specific streaming invocation context type.
|
|
17
|
-
*
|
|
18
|
-
* @template TBigInt
|
|
19
|
-
* Type to which big integer is mapped.
|
|
20
|
-
*/
|
|
21
|
-
export class LibProxy {
|
|
22
|
-
/**
|
|
23
|
-
* Application extension.
|
|
24
|
-
*/
|
|
25
|
-
#appExtension;
|
|
26
|
-
/**
|
|
27
|
-
* Constructor.
|
|
28
|
-
*
|
|
29
|
-
* @param appExtension
|
|
30
|
-
* Application extension.
|
|
31
|
-
*/
|
|
32
|
-
constructor(appExtension) {
|
|
33
|
-
this.#appExtension = appExtension;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Get the application extension.
|
|
37
|
-
*/
|
|
38
|
-
get appExtension() {
|
|
39
|
-
return this.#appExtension;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Map big integer to another type if necessary.
|
|
43
|
-
*
|
|
44
|
-
* @param value
|
|
45
|
-
* Big integer value to map.
|
|
46
|
-
*
|
|
47
|
-
* @returns
|
|
48
|
-
* Mapped big integer value.
|
|
49
|
-
*/
|
|
50
|
-
mapBigInt(value) {
|
|
51
|
-
return this.#appExtension.mapBigInt(value);
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Handle an error thrown by a function call. Return type is {@linkcode SingletonResult} to ensure assignment
|
|
55
|
-
* compatibility.
|
|
56
|
-
*
|
|
57
|
-
* @param e
|
|
58
|
-
* Error.
|
|
59
|
-
*
|
|
60
|
-
* @returns
|
|
61
|
-
* Error if errors are not thrown.
|
|
62
|
-
*/
|
|
63
|
-
#handleError(e) {
|
|
64
|
-
let result;
|
|
65
|
-
if (e instanceof RangeError) {
|
|
66
|
-
const error = this.#appExtension.mapRangeError(e);
|
|
67
|
-
if (this.#appExtension.throwError) {
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type is determined by application mapping.
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Won't get here if ThrowError is false so result is TError.
|
|
72
|
-
result = error;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// Unknown error; pass on to application extension.
|
|
76
|
-
result = this.appExtension.handleError(e instanceof Error ? e.message : String(e));
|
|
77
|
-
}
|
|
78
|
-
return result;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Call a singleton result function with error handling.
|
|
82
|
-
*
|
|
83
|
-
* @param callback
|
|
84
|
-
* Callback.
|
|
85
|
-
*
|
|
86
|
-
* @returns
|
|
87
|
-
* Callback return or error if errors are not thrown.
|
|
88
|
-
*/
|
|
89
|
-
singletonResult(callback) {
|
|
90
|
-
let result;
|
|
91
|
-
try {
|
|
92
|
-
result = callback();
|
|
93
|
-
}
|
|
94
|
-
catch (e) {
|
|
95
|
-
result = this.#handleError(e);
|
|
96
|
-
}
|
|
97
|
-
return result;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Call a matrix result function with error handling.
|
|
101
|
-
*
|
|
102
|
-
* @param matrixValues
|
|
103
|
-
* Matrix of values.
|
|
104
|
-
*
|
|
105
|
-
* @param valueCallback
|
|
106
|
-
* Callback to process value.
|
|
107
|
-
*
|
|
108
|
-
* @returns
|
|
109
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
110
|
-
*/
|
|
111
|
-
matrixResult(matrixValues, valueCallback) {
|
|
112
|
-
return matrixValues.map(rowValues => rowValues.map(value => this.singletonResult(() => valueCallback(value))));
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Map a matrix of validate string results to boolean. If the string is empty, the result is true, indicating that
|
|
116
|
-
* there is no error.
|
|
117
|
-
*
|
|
118
|
-
* @param matrixValidateResults
|
|
119
|
-
* Matrix of results from a call to a validate function.
|
|
120
|
-
*
|
|
121
|
-
* @returns
|
|
122
|
-
* Matrix of boolean values, true if corresponding string is empty.
|
|
123
|
-
*/
|
|
124
|
-
isValidString(matrixValidateResults) {
|
|
125
|
-
return matrixValidateResults.map(rowValues => rowValues.map(value => (validateResult => validateResult === "")(value)));
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Set up a mapping and call a matrix result function with error handling.
|
|
129
|
-
*
|
|
130
|
-
* @param setUpCallback
|
|
131
|
-
* Callback to set up the mapping.
|
|
132
|
-
*
|
|
133
|
-
* @param matrixValues
|
|
134
|
-
* Matrix of values.
|
|
135
|
-
*
|
|
136
|
-
* @param valueCallback
|
|
137
|
-
* Callback to process value.
|
|
138
|
-
*
|
|
139
|
-
* @returns
|
|
140
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
141
|
-
*/
|
|
142
|
-
setUpMatrixResult(setUpCallback, matrixValues, valueCallback) {
|
|
143
|
-
let result;
|
|
144
|
-
try {
|
|
145
|
-
result = matrixValues.map(rowValues => rowValues.map(value => this.singletonResult(() => valueCallback(setUpCallback(), value))));
|
|
146
|
-
}
|
|
147
|
-
catch (e) {
|
|
148
|
-
result = [[this.#handleError(e)]];
|
|
149
|
-
}
|
|
150
|
-
return result;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Do the callback for an array return.
|
|
154
|
-
*
|
|
155
|
-
* @param value
|
|
156
|
-
* Value.
|
|
157
|
-
*
|
|
158
|
-
* @param callback
|
|
159
|
-
* Callback.
|
|
160
|
-
*
|
|
161
|
-
* @returns
|
|
162
|
-
* Callback result or error as array if errors are not thrown.
|
|
163
|
-
*/
|
|
164
|
-
#arrayCallback(value, callback) {
|
|
165
|
-
const result = this.singletonResult(() => callback(value));
|
|
166
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- If result is not an array, it must be an error.
|
|
167
|
-
return result instanceof Array ? result : [result];
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Call an array result function with error handling and map to a matrix.
|
|
171
|
-
*
|
|
172
|
-
* @param matrixValues
|
|
173
|
-
* Matrix of values.
|
|
174
|
-
*
|
|
175
|
-
* @param callback
|
|
176
|
-
* Callback.
|
|
177
|
-
*
|
|
178
|
-
* @returns
|
|
179
|
-
* Matrix of callback results and errors if errors are not thrown.
|
|
180
|
-
*/
|
|
181
|
-
arrayResult(matrixValues, callback) {
|
|
182
|
-
let result;
|
|
183
|
-
if (matrixValues.length === 0) {
|
|
184
|
-
// Special case; unlikely to occur.
|
|
185
|
-
result = [[]];
|
|
186
|
-
}
|
|
187
|
-
else if (matrixValues.length === 1) {
|
|
188
|
-
result = [];
|
|
189
|
-
matrixValues[0].forEach((value, columnIndex) => {
|
|
190
|
-
const arrayResult = this.#arrayCallback(value, callback);
|
|
191
|
-
arrayResult.forEach((resultError, rowIndex) => {
|
|
192
|
-
// Append a row if necessary.
|
|
193
|
-
if (result.length <= rowIndex) {
|
|
194
|
-
result.push([]);
|
|
195
|
-
}
|
|
196
|
-
// Assignment will automatically expand row to the number of columns in the matrix.
|
|
197
|
-
result[rowIndex][columnIndex] = resultError;
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
result = matrixValues.map((rowValue) => {
|
|
203
|
-
let arrayResult;
|
|
204
|
-
if (rowValue.length === 0) {
|
|
205
|
-
// Special case; unlikely to occur.
|
|
206
|
-
arrayResult = [];
|
|
207
|
-
}
|
|
208
|
-
else if (rowValue.length === 1) {
|
|
209
|
-
arrayResult = this.#arrayCallback(rowValue[0], callback);
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
arrayResult = [this.#handleError(new RangeError(i18nextAppExtension.t("Proxy.matrixMustBeArray")))];
|
|
213
|
-
}
|
|
214
|
-
return arrayResult;
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
return result;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Call a matrix result function with error handling and map a non-error result to an empty string and {@linkcode
|
|
221
|
-
* RangeError} to the string error message.
|
|
222
|
-
*
|
|
223
|
-
* @param matrixValues
|
|
224
|
-
* Matrix of values.
|
|
225
|
-
*
|
|
226
|
-
* @param callback
|
|
227
|
-
* Callback that either returns or throws an exception.
|
|
228
|
-
*
|
|
229
|
-
* @returns
|
|
230
|
-
* Matrix of strings.
|
|
231
|
-
*/
|
|
232
|
-
matrixErrorResult(matrixValues, callback) {
|
|
233
|
-
return matrixValues.map(rowValues => rowValues.map((value) => {
|
|
234
|
-
let result;
|
|
235
|
-
try {
|
|
236
|
-
callback(value);
|
|
237
|
-
// No error; return empty string.
|
|
238
|
-
result = "";
|
|
239
|
-
}
|
|
240
|
-
catch (e) {
|
|
241
|
-
if (e instanceof RangeError) {
|
|
242
|
-
// Library error; return error message.
|
|
243
|
-
result = e.message;
|
|
244
|
-
}
|
|
245
|
-
else {
|
|
246
|
-
// Unknown error; pass up the stack.
|
|
247
|
-
throw e;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return result;
|
|
251
|
-
}));
|
|
252
|
-
}
|
|
253
|
-
/**
|
|
254
|
-
* Call an iterable result function with error handling and map to a matrix. Although the natural approach would be
|
|
255
|
-
* to map to a single-element array containing an array of *N* results (i.e., [[r0, r1, r2, ..., r*N*]]), this is
|
|
256
|
-
* rendered visually as a single row. The more readable approach is as a single column, so the mapping is to an
|
|
257
|
-
* *N*-element array of single-element result arrays (i.e., [[r0], [r1], [r2], ..., [r*N*]]).
|
|
258
|
-
*
|
|
259
|
-
* @param iterableCallback
|
|
260
|
-
* Iterable callback.
|
|
261
|
-
*
|
|
262
|
-
* @returns
|
|
263
|
-
* Matrix of callback results.
|
|
264
|
-
*/
|
|
265
|
-
iterableResult(iterableCallback) {
|
|
266
|
-
let result;
|
|
267
|
-
try {
|
|
268
|
-
result = Array.from(mapIterable(iterableCallback(), result => [result]));
|
|
269
|
-
}
|
|
270
|
-
catch (e) {
|
|
271
|
-
result = [[this.#handleError(e)]];
|
|
272
|
-
}
|
|
273
|
-
return result;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
//# sourceMappingURL=lib-proxy.js.map
|
package/dist/lib-proxy.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lib-proxy.js","sourceRoot":"","sources":["../src/lib-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,OAAgB,QAAQ;IAC1B;;OAEG;IACM,aAAa,CAA6F;IAEnH;;;;;OAKG;IACH,YAAY,YAAwG;QAChH,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,IAAI,YAAY;QACZ,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,KAAa;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;;;;;OASG;IACH,YAAY,CAAU,CAAU;QAC5B,IAAI,MAAoD,CAAC;QAEzD,IAAI,CAAC,YAAY,UAAU,EAAE,CAAC;YAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;YAElD,IAAI,IAAI,CAAC,aAAa,CAAC,UAAU,EAAE,CAAC;gBAChC,qHAAqH;gBACrH,MAAM,KAAc,CAAC;YACzB,CAAC;YAED,qIAAqI;YACrI,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