@aidc-toolkit/app-extension 1.0.46 → 1.0.48-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.d.ts +198 -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 +333 -0
- package/dist/app-helper-proxy.js.map +1 -0
- package/dist/{descriptor-FJHoLlYK.d.cts → descriptor.d.ts} +13 -25
- package/dist/descriptor.d.ts.map +1 -0
- package/dist/descriptor.js +44 -0
- package/dist/descriptor.js.map +1 -0
- package/dist/generator/{index.d.cts → generator.d.ts} +9 -11
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +198 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/index.d.ts +17 -125
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +2 -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 +312 -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/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 -0
- package/dist/gs1/index.d.ts.map +1 -0
- package/dist/gs1/index.js +11 -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 +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 +106 -0
- package/dist/gs1/verified-by-gs1-proxy.js.map +1 -0
- package/dist/index.d.ts +25 -1557
- 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 +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 +755 -0
- 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 +136 -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 +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 +6 -5
- package/src/app-extension.ts +6 -0
- package/src/descriptor.ts +0 -15
- package/src/generator/generator.ts +28 -17
- package/src/gs1/gcp-length-proxy.ts +1 -4
- package/src/gs1/identifier-creator-proxy.ts +21 -2
- package/src/index.ts +0 -1
- package/src/locale/en/locale-resources.ts +3 -0
- package/src/locale/fr/locale-resources.ts +4 -1
- package/src/proxy.ts +5 -11
- package/tsconfig-src.tsbuildinfo +1 -1
- package/tsup.config.ts +1 -1
- package/dist/chunk-FAD3UX6B.js +0 -1
- package/dist/descriptor-FJHoLlYK.d.ts +0 -197
- package/dist/generator/index.cjs +0 -17
- package/dist/index.cjs +0 -17
- package/dist/index.d.cts +0 -1557
|
@@ -0,0 +1,333 @@
|
|
|
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, logLevelOf } from "@aidc-toolkit/core";
|
|
36
|
+
import { Multiplicities, Types } from "./descriptor.js";
|
|
37
|
+
import { LibProxy } from "./lib-proxy.js";
|
|
38
|
+
import { i18nextAppExtension } from "./locale/i18n.js";
|
|
39
|
+
import { proxy } from "./proxy.js";
|
|
40
|
+
const spillArrayParameterDescriptor = {
|
|
41
|
+
name: "spillArray",
|
|
42
|
+
type: Types.Any,
|
|
43
|
+
multiplicity: Multiplicities.Array,
|
|
44
|
+
isRequired: true
|
|
45
|
+
};
|
|
46
|
+
const spillMaximumParameterDescriptor = {
|
|
47
|
+
name: "spillMaximum",
|
|
48
|
+
type: Types.Number,
|
|
49
|
+
multiplicity: Multiplicities.Singleton,
|
|
50
|
+
isRequired: false
|
|
51
|
+
};
|
|
52
|
+
const spillMaximumWidthParameterDescriptor = {
|
|
53
|
+
extendsDescriptor: spillMaximumParameterDescriptor,
|
|
54
|
+
sortOrder: 0,
|
|
55
|
+
name: "spillMaximumWidth"
|
|
56
|
+
};
|
|
57
|
+
const spillMaximumHeightParameterDescriptor = {
|
|
58
|
+
extendsDescriptor: spillMaximumParameterDescriptor,
|
|
59
|
+
sortOrder: 1,
|
|
60
|
+
name: "spillMaximumHeight"
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Application utilities.
|
|
64
|
+
*
|
|
65
|
+
* @template ThrowError
|
|
66
|
+
* If true, errors are reported through the throw/catch mechanism.
|
|
67
|
+
*
|
|
68
|
+
* @template TError
|
|
69
|
+
* Error type.
|
|
70
|
+
*
|
|
71
|
+
* @template TInvocationContext
|
|
72
|
+
* Application-specific invocation context type.
|
|
73
|
+
*
|
|
74
|
+
* @template TStreamingInvocationContext
|
|
75
|
+
* Application-specific streaming invocation context type.
|
|
76
|
+
*
|
|
77
|
+
* @template TBigInt
|
|
78
|
+
* Type to which big integer is mapped.
|
|
79
|
+
*/
|
|
80
|
+
let AppHelperProxy = (() => {
|
|
81
|
+
let _classDecorators = [proxy.describeClass(false, {
|
|
82
|
+
category: "helper"
|
|
83
|
+
})];
|
|
84
|
+
let _classDescriptor;
|
|
85
|
+
let _classExtraInitializers = [];
|
|
86
|
+
let _classThis;
|
|
87
|
+
let _classSuper = LibProxy;
|
|
88
|
+
let _instanceExtraInitializers = [];
|
|
89
|
+
let _version_decorators;
|
|
90
|
+
let _spill_decorators;
|
|
91
|
+
let _loggerMessages_decorators;
|
|
92
|
+
var AppHelperProxy = class extends _classSuper {
|
|
93
|
+
static { _classThis = this; }
|
|
94
|
+
static {
|
|
95
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
96
|
+
_version_decorators = [proxy.describeMethod({
|
|
97
|
+
type: Types.String,
|
|
98
|
+
multiplicity: Multiplicities.Singleton,
|
|
99
|
+
parameterDescriptors: []
|
|
100
|
+
})];
|
|
101
|
+
_spill_decorators = [proxy.describeMethod({
|
|
102
|
+
type: Types.Any,
|
|
103
|
+
multiplicity: Multiplicities.Matrix,
|
|
104
|
+
isAsync: true,
|
|
105
|
+
requiresContext: true,
|
|
106
|
+
parameterDescriptors: [spillArrayParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
|
|
107
|
+
})];
|
|
108
|
+
_loggerMessages_decorators = [proxy.describeMethod({
|
|
109
|
+
type: Types.String,
|
|
110
|
+
multiplicity: Multiplicities.Array,
|
|
111
|
+
isHidden: true,
|
|
112
|
+
isStream: true,
|
|
113
|
+
parameterDescriptors: [{
|
|
114
|
+
name: "logLevel",
|
|
115
|
+
type: Types.String,
|
|
116
|
+
multiplicity: Multiplicities.Singleton,
|
|
117
|
+
isRequired: false
|
|
118
|
+
}]
|
|
119
|
+
})];
|
|
120
|
+
__esDecorate(this, null, _version_decorators, { kind: "method", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
121
|
+
__esDecorate(this, null, _spill_decorators, { kind: "method", name: "spill", static: false, private: false, access: { has: obj => "spill" in obj, get: obj => obj.spill }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
122
|
+
__esDecorate(this, null, _loggerMessages_decorators, { kind: "method", name: "loggerMessages", static: false, private: false, access: { has: obj => "loggerMessages" in obj, get: obj => obj.loggerMessages }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
123
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
124
|
+
AppHelperProxy = _classThis = _classDescriptor.value;
|
|
125
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
126
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Get the version.
|
|
130
|
+
*
|
|
131
|
+
* @returns
|
|
132
|
+
* Version.
|
|
133
|
+
*/
|
|
134
|
+
version() {
|
|
135
|
+
return this.appExtension.version;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Provide default values for maximum width and height if required.
|
|
139
|
+
*
|
|
140
|
+
* @param maximumDimensions
|
|
141
|
+
* Maximum dimensions provided to function.
|
|
142
|
+
*
|
|
143
|
+
* @param invocationContext
|
|
144
|
+
* Invocation context.
|
|
145
|
+
*
|
|
146
|
+
* @returns
|
|
147
|
+
* Array of maximum width and maximum height.
|
|
148
|
+
*/
|
|
149
|
+
async #defaultMaximums(maximumDimensions, invocationContext) {
|
|
150
|
+
if (isNullish(invocationContext)) {
|
|
151
|
+
// Application error; no localization necessary.
|
|
152
|
+
throw new Error("Invocation context not provided by application");
|
|
153
|
+
}
|
|
154
|
+
const maximumWidth = maximumDimensions.width;
|
|
155
|
+
const maximumHeight = maximumDimensions.height;
|
|
156
|
+
let definedMaximumWidth;
|
|
157
|
+
let definedMaximumHeight;
|
|
158
|
+
// Skip any extra work if both values are provided.
|
|
159
|
+
if (isNullish(maximumWidth) || isNullish(maximumHeight)) {
|
|
160
|
+
const sheetAddress = await this.appExtension.getSheetAddress(invocationContext);
|
|
161
|
+
definedMaximumWidth = maximumWidth ?? this.appExtension.maximumWidth - sheetAddress.columnIndex;
|
|
162
|
+
definedMaximumHeight = maximumHeight ?? this.appExtension.maximumHeight - sheetAddress.rowIndex;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
definedMaximumWidth = maximumWidth;
|
|
166
|
+
definedMaximumHeight = maximumHeight;
|
|
167
|
+
}
|
|
168
|
+
return {
|
|
169
|
+
width: definedMaximumWidth,
|
|
170
|
+
height: definedMaximumHeight
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Spill a one-dimensional matrix to fit a rectangle within a given maximum height and width.
|
|
175
|
+
*
|
|
176
|
+
* @param arrayValues
|
|
177
|
+
* Matrix values. Matrix is length 1 or contains arrays of length 1 with the values.
|
|
178
|
+
*
|
|
179
|
+
* @param maximumHeight
|
|
180
|
+
* Maximum height.
|
|
181
|
+
*
|
|
182
|
+
* @param maximumWidth
|
|
183
|
+
* Maximum width.
|
|
184
|
+
*
|
|
185
|
+
* @param invocationContext
|
|
186
|
+
* Invocation context.
|
|
187
|
+
*
|
|
188
|
+
* @returns
|
|
189
|
+
* Matrix spilled within maximum height and maximum width.
|
|
190
|
+
*/
|
|
191
|
+
async spill(arrayValues, maximumHeight, maximumWidth, invocationContext) {
|
|
192
|
+
let result;
|
|
193
|
+
// Assume matrix is uniformly two-dimensional.
|
|
194
|
+
const height = arrayValues.length;
|
|
195
|
+
const width = height !== 0 ? arrayValues[0].length : 0;
|
|
196
|
+
const isArrayOrError = this.singletonResult(() => {
|
|
197
|
+
if (height > 1 && width > 1) {
|
|
198
|
+
throw new RangeError(i18nextAppExtension.t("Proxy.matrixMustBeArray"));
|
|
199
|
+
}
|
|
200
|
+
return true;
|
|
201
|
+
});
|
|
202
|
+
if (isArrayOrError === true) {
|
|
203
|
+
const maximumDimensions = await this.#defaultMaximums({
|
|
204
|
+
width: maximumWidth,
|
|
205
|
+
height: maximumHeight
|
|
206
|
+
}, invocationContext);
|
|
207
|
+
const isHorizontal = height === 1;
|
|
208
|
+
const length = isHorizontal ? width : height;
|
|
209
|
+
const maximumParallel = isHorizontal ? maximumDimensions.width : maximumDimensions.height;
|
|
210
|
+
const maximumPerpendicular = isHorizontal ? maximumDimensions.height : maximumDimensions.width;
|
|
211
|
+
const maximumArea = maximumParallel * maximumPerpendicular;
|
|
212
|
+
// Lengths 0 and 1 are valid and require no special processing.
|
|
213
|
+
if (length > 1 && length <= maximumArea) {
|
|
214
|
+
const lengthSquareRoot = Math.sqrt(length);
|
|
215
|
+
let spillParallel = undefined;
|
|
216
|
+
// Array that has a length of a power of 10 is treated specially.
|
|
217
|
+
if (Number.isInteger(Math.log10(length))) {
|
|
218
|
+
// Try spill that is a power of 10, favouring the parallel direction.
|
|
219
|
+
let spillParallel10 = 10 ** Math.ceil(Math.log10(lengthSquareRoot));
|
|
220
|
+
// Favour the perpendicular direction if not enough parallel space.
|
|
221
|
+
if (spillParallel10 > maximumParallel) {
|
|
222
|
+
spillParallel10 /= 10;
|
|
223
|
+
}
|
|
224
|
+
// Take result as the spill parallel if it fits.
|
|
225
|
+
if (spillParallel10 <= maximumParallel && length / spillParallel10 <= maximumPerpendicular) {
|
|
226
|
+
spillParallel = spillParallel10;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// Make spill as square as possible, favouring the parallel direction.
|
|
230
|
+
spillParallel ??= Math.max(Math.min(Math.ceil(lengthSquareRoot), maximumParallel), Math.floor(length / maximumPerpendicular));
|
|
231
|
+
const spillPerpendicular = Math.ceil(length / spillParallel);
|
|
232
|
+
result = [];
|
|
233
|
+
if (isHorizontal) {
|
|
234
|
+
let startIndex = 0;
|
|
235
|
+
do {
|
|
236
|
+
const endIndex = startIndex + spillParallel;
|
|
237
|
+
// Each row is a slice of the original single row.
|
|
238
|
+
const row = arrayValues[0].slice(startIndex, endIndex);
|
|
239
|
+
// Row length will be anywhere from 1 to spillParallel.
|
|
240
|
+
if (row.length < spillParallel) {
|
|
241
|
+
const rowLength = row.length;
|
|
242
|
+
row.length = spillParallel;
|
|
243
|
+
// Fill empty cells with empty string.
|
|
244
|
+
row.fill("", rowLength, spillParallel);
|
|
245
|
+
}
|
|
246
|
+
result.push(row);
|
|
247
|
+
startIndex = endIndex;
|
|
248
|
+
} while (startIndex < length);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
for (let rowIndex = 0; rowIndex < spillParallel; rowIndex++) {
|
|
252
|
+
const row = [];
|
|
253
|
+
// Each column is a slice of the original single column.
|
|
254
|
+
for (let valueIndex = rowIndex; valueIndex < length; valueIndex += spillParallel) {
|
|
255
|
+
row.push(arrayValues[valueIndex][0]);
|
|
256
|
+
}
|
|
257
|
+
// Row length will always be spillPerpendicular or spillPerpendicular - 1.
|
|
258
|
+
if (row.length < spillPerpendicular) {
|
|
259
|
+
row[spillPerpendicular - 1] = "";
|
|
260
|
+
}
|
|
261
|
+
result.push(row);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
else {
|
|
266
|
+
// Return matrix unmodified and let application handle spill error if any.
|
|
267
|
+
result = arrayValues;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
else {
|
|
271
|
+
// Return error as only element in matrix.
|
|
272
|
+
result = [[isArrayOrError]];
|
|
273
|
+
}
|
|
274
|
+
return result;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Get the logger messages as a stream.
|
|
278
|
+
*
|
|
279
|
+
* @param logLevelString
|
|
280
|
+
* Log level as string.
|
|
281
|
+
*
|
|
282
|
+
* @param streamingInvocationContext
|
|
283
|
+
* Streaming invocation context.
|
|
284
|
+
*/
|
|
285
|
+
loggerMessages(logLevelString, streamingInvocationContext) {
|
|
286
|
+
if (isNullish(streamingInvocationContext)) {
|
|
287
|
+
// Application error; no localization necessary.
|
|
288
|
+
throw new Error("Streaming invocation context not provided by application");
|
|
289
|
+
}
|
|
290
|
+
const appExtension = this.appExtension;
|
|
291
|
+
let notificationCallbackAdded = false;
|
|
292
|
+
let previousLogLevel = undefined;
|
|
293
|
+
const streamingConsumerCallback = appExtension.setUpStreaming(streamingInvocationContext, () => {
|
|
294
|
+
if (notificationCallbackAdded) {
|
|
295
|
+
appExtension.memoryTransport.removeNotificationCallback("loggerMessages");
|
|
296
|
+
}
|
|
297
|
+
if (previousLogLevel !== undefined) {
|
|
298
|
+
appExtension.logger.settings.minLevel = previousLogLevel;
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
if (appExtension.memoryTransport.addNotificationCallback("loggerMessages", (_message, messages) => {
|
|
302
|
+
streamingConsumerCallback(this.iterableResult(() => messages));
|
|
303
|
+
})) {
|
|
304
|
+
notificationCallbackAdded = true;
|
|
305
|
+
let logLevel = undefined;
|
|
306
|
+
if (!isNullish(logLevelString)) {
|
|
307
|
+
try {
|
|
308
|
+
logLevel = logLevelOf(logLevelString);
|
|
309
|
+
}
|
|
310
|
+
catch {
|
|
311
|
+
// Ignore error.
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// Set log level if required.
|
|
315
|
+
if (logLevel !== undefined) {
|
|
316
|
+
previousLogLevel = appExtension.logger.settings.minLevel;
|
|
317
|
+
appExtension.logger.settings.minLevel = logLevel;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
// Diagnostic tool; localization not required.
|
|
322
|
+
streamingConsumerCallback([["Only one logger messages call allowable per workbook"]]);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
constructor() {
|
|
326
|
+
super(...arguments);
|
|
327
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
return AppHelperProxy = _classThis;
|
|
331
|
+
})();
|
|
332
|
+
export { AppHelperProxy };
|
|
333
|
+
//# sourceMappingURL=app-helper-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-helper-proxy.js","sourceRoot":"","sources":["../src/app-helper-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAiB,UAAU,EAAyC,MAAM,oBAAoB,CAAC;AACjH,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,MAAM,6BAA6B,GAAwB;IACvD,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,KAAK,CAAC,GAAG;IACf,Y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B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;oBACzB,gBAAgB,GAAG,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBACzD,YAAY,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBACrD,CAAC;YACL,CAAC;iBAAM,CAAC;gBACJ,8CAA8C;gBAC9C,yBAAyB,CAAC,CAAC,CAAC,sDAAsD,CAAC,CAAC,CAAC,CAAC;YAC1F,CAAC;QACL,CAAC;;;YAhQQ,mDAAc;;;;;SAAd,cAAc"}
|
|
@@ -10,7 +10,7 @@ interface Descriptor {
|
|
|
10
10
|
/**
|
|
11
11
|
* Types supported by proxy methods.
|
|
12
12
|
*/
|
|
13
|
-
declare const Types: {
|
|
13
|
+
export declare const Types: {
|
|
14
14
|
/**
|
|
15
15
|
* String.
|
|
16
16
|
*/
|
|
@@ -31,15 +31,15 @@ declare const Types: {
|
|
|
31
31
|
/**
|
|
32
32
|
* Type key.
|
|
33
33
|
*/
|
|
34
|
-
type TypeKey = keyof typeof Types;
|
|
34
|
+
export type TypeKey = keyof typeof Types;
|
|
35
35
|
/**
|
|
36
36
|
* Type.
|
|
37
37
|
*/
|
|
38
|
-
type Type = typeof Types[TypeKey];
|
|
38
|
+
export type Type = typeof Types[TypeKey];
|
|
39
39
|
/**
|
|
40
40
|
* Multiplicities supported by proxy methods.
|
|
41
41
|
*/
|
|
42
|
-
declare const Multiplicities: {
|
|
42
|
+
export declare const Multiplicities: {
|
|
43
43
|
/**
|
|
44
44
|
* Parameter or return value is a singleton.
|
|
45
45
|
*/
|
|
@@ -61,11 +61,11 @@ declare const Multiplicities: {
|
|
|
61
61
|
/**
|
|
62
62
|
* Multiplicity key.
|
|
63
63
|
*/
|
|
64
|
-
type MultiplicityKey = keyof typeof Multiplicities;
|
|
64
|
+
export type MultiplicityKey = keyof typeof Multiplicities;
|
|
65
65
|
/**
|
|
66
66
|
* Multiplicity.
|
|
67
67
|
*/
|
|
68
|
-
type Multiplicity = typeof Multiplicities[MultiplicityKey];
|
|
68
|
+
export type Multiplicity = typeof Multiplicities[MultiplicityKey];
|
|
69
69
|
/**
|
|
70
70
|
* Type descriptor.
|
|
71
71
|
*/
|
|
@@ -82,7 +82,7 @@ interface TypeDescriptor extends Descriptor {
|
|
|
82
82
|
/**
|
|
83
83
|
* Parameter descriptor.
|
|
84
84
|
*/
|
|
85
|
-
interface ParameterDescriptor extends TypeDescriptor {
|
|
85
|
+
export interface ParameterDescriptor extends TypeDescriptor {
|
|
86
86
|
/**
|
|
87
87
|
* True if required.
|
|
88
88
|
*/
|
|
@@ -91,7 +91,7 @@ interface ParameterDescriptor extends TypeDescriptor {
|
|
|
91
91
|
/**
|
|
92
92
|
* Extends parameter descriptor.
|
|
93
93
|
*/
|
|
94
|
-
interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
|
|
94
|
+
export interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
|
|
95
95
|
/**
|
|
96
96
|
* Parameter descriptor that this one extends.
|
|
97
97
|
*/
|
|
@@ -104,7 +104,7 @@ interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
|
|
|
104
104
|
/**
|
|
105
105
|
* Replacement parameter descriptor.
|
|
106
106
|
*/
|
|
107
|
-
interface ReplacementParameterDescriptor {
|
|
107
|
+
export interface ReplacementParameterDescriptor {
|
|
108
108
|
/**
|
|
109
109
|
* Name to replace.
|
|
110
110
|
*/
|
|
@@ -117,7 +117,7 @@ interface ReplacementParameterDescriptor {
|
|
|
117
117
|
/**
|
|
118
118
|
* Method descriptor.
|
|
119
119
|
*/
|
|
120
|
-
interface MethodDescriptor extends TypeDescriptor {
|
|
120
|
+
export interface MethodDescriptor extends TypeDescriptor {
|
|
121
121
|
/**
|
|
122
122
|
* If true, method is asynchronous.
|
|
123
123
|
*/
|
|
@@ -138,10 +138,6 @@ interface MethodDescriptor extends TypeDescriptor {
|
|
|
138
138
|
* If true, function opens a stream that updates asynchronously.
|
|
139
139
|
*/
|
|
140
140
|
readonly isStream?: true;
|
|
141
|
-
/**
|
|
142
|
-
* Number of characters to capitalize at the start of the method name for title case; defaults to 1.
|
|
143
|
-
*/
|
|
144
|
-
readonly titleCaseStart?: number;
|
|
145
141
|
/**
|
|
146
142
|
* If true, method infix is ignored.
|
|
147
143
|
*/
|
|
@@ -159,15 +155,11 @@ interface MethodDescriptor extends TypeDescriptor {
|
|
|
159
155
|
* Function name with optional infix.
|
|
160
156
|
*/
|
|
161
157
|
readonly functionName: string;
|
|
162
|
-
/**
|
|
163
|
-
* Function name in optional namespace with optional infix.
|
|
164
|
-
*/
|
|
165
|
-
readonly namespaceFunctionName: string;
|
|
166
158
|
}
|
|
167
159
|
/**
|
|
168
160
|
* Class descriptor.
|
|
169
161
|
*/
|
|
170
|
-
interface ClassDescriptor extends Descriptor {
|
|
162
|
+
export interface ClassDescriptor extends Descriptor {
|
|
171
163
|
/**
|
|
172
164
|
* Class namespace. If not provided, class is at the top level.
|
|
173
165
|
*/
|
|
@@ -184,14 +176,10 @@ interface ClassDescriptor extends Descriptor {
|
|
|
184
176
|
* Replacement parameter descriptors for class hierarchies where parameter types can narrow
|
|
185
177
|
*/
|
|
186
178
|
readonly replacementParameterDescriptors?: ReplacementParameterDescriptor[];
|
|
187
|
-
/**
|
|
188
|
-
* Class name in optional namespace.
|
|
189
|
-
*/
|
|
190
|
-
readonly namespaceClassName: string;
|
|
191
179
|
/**
|
|
192
180
|
* Method descriptors.
|
|
193
181
|
*/
|
|
194
182
|
readonly methodDescriptors: readonly MethodDescriptor[];
|
|
195
183
|
}
|
|
196
|
-
|
|
197
|
-
|
|
184
|
+
export {};
|
|
185
|
+
//# sourceMappingURL=descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,UAAU,UAAU;IAChB;;OAEG;IACH,QAA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
|
+
Number: 1,
|
|
13
|
+
/**
|
|
14
|
+
* Boolean.
|
|
15
|
+
*/
|
|
16
|
+
Boolean: 2,
|
|
17
|
+
/**
|
|
18
|
+
* Any.
|
|
19
|
+
*/
|
|
20
|
+
Any: 3
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Multiplicities supported by proxy methods.
|
|
24
|
+
*/
|
|
25
|
+
export const Multiplicities = {
|
|
26
|
+
/**
|
|
27
|
+
* Parameter or return value is a singleton.
|
|
28
|
+
*/
|
|
29
|
+
Singleton: 0,
|
|
30
|
+
/**
|
|
31
|
+
* Parameter or return value is a singleton or an array.
|
|
32
|
+
*/
|
|
33
|
+
Array: 1,
|
|
34
|
+
/**
|
|
35
|
+
* Parameter or return value is a singleton, an array, or a matrix.
|
|
36
|
+
*/
|
|
37
|
+
Matrix: 2,
|
|
38
|
+
/**
|
|
39
|
+
* Parameter value is a singleton or array but is treated as a singleton internally and doesn't drive multiplicity
|
|
40
|
+
* of the return value. Return value is an array for use as a singleton array parameter.
|
|
41
|
+
*/
|
|
42
|
+
SingletonArray: 3
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,GAAG,EAAE,CAAC;CACA,CAAC;AAYX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B;;OAEG;IACH,SAAS,EAAE,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,CAAC;IAER;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;;OAGG;IACH,cAAc,EAAE,CAAC;CACX,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { Promisable } from
|
|
2
|
-
import { Logger } from
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { type Promisable } from "@aidc-toolkit/core";
|
|
2
|
+
import type { Logger } from "tslog";
|
|
3
|
+
import type { ClassDescriptor, MethodDescriptor } from "../descriptor.js";
|
|
5
4
|
/**
|
|
6
5
|
* Localization.
|
|
7
6
|
*/
|
|
8
|
-
interface Localization {
|
|
7
|
+
export interface Localization {
|
|
9
8
|
/**
|
|
10
9
|
* Name.
|
|
11
10
|
*/
|
|
@@ -18,11 +17,11 @@ interface Localization {
|
|
|
18
17
|
/**
|
|
19
18
|
* Function localization.
|
|
20
19
|
*/
|
|
21
|
-
interface FunctionLocalization extends Localization {
|
|
20
|
+
export interface FunctionLocalization extends Localization {
|
|
22
21
|
/**
|
|
23
|
-
*
|
|
22
|
+
* Name in title case.
|
|
24
23
|
*/
|
|
25
|
-
readonly
|
|
24
|
+
readonly titleCaseName: string;
|
|
26
25
|
/**
|
|
27
26
|
* Documentation URL.
|
|
28
27
|
*/
|
|
@@ -35,7 +34,7 @@ interface FunctionLocalization extends Localization {
|
|
|
35
34
|
/**
|
|
36
35
|
* Abstract generator.
|
|
37
36
|
*/
|
|
38
|
-
declare abstract class Generator {
|
|
37
|
+
export declare abstract class Generator {
|
|
39
38
|
#private;
|
|
40
39
|
/**
|
|
41
40
|
* Constructor.
|
|
@@ -122,5 +121,4 @@ declare abstract class Generator {
|
|
|
122
121
|
*/
|
|
123
122
|
generate(): Promise<void>;
|
|
124
123
|
}
|
|
125
|
-
|
|
126
|
-
export { type FunctionLocalization, Generator, type Localization };
|
|
124
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,KAAK,UAAU,EAAc,MAAM,oBAAoB,CA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