@aidc-toolkit/app-extension 1.0.26-beta → 1.0.28-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1205 -967
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +134 -312
- package/dist/index.d.ts +134 -312
- package/dist/index.js +1207 -964
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/app-extension.ts +33 -24
- package/src/app-utility-proxy.ts +33 -27
- package/src/descriptor.ts +29 -199
- package/src/generator/generator.ts +102 -145
- package/src/generator/index.ts +0 -1
- package/src/generator/locale-resources-generator.ts +67 -42
- package/src/gs1/character-set-proxy.ts +5 -5
- package/src/gs1/check-proxy.ts +35 -42
- package/src/gs1/gtin-creator-proxy.ts +58 -0
- package/src/gs1/gtin-descriptor.ts +29 -0
- package/src/gs1/gtin-validator-proxy.ts +161 -0
- package/src/gs1/identifier-creator-proxy.ts +227 -0
- package/src/gs1/identifier-validator-proxy.ts +87 -0
- package/src/gs1/index.ts +5 -1
- package/src/gs1/non-gtin-creator-proxy.ts +119 -0
- package/src/gs1/non-gtin-validator-proxy.ts +119 -0
- package/src/gs1/prefix-definition-descriptor.ts +18 -0
- package/src/gs1/prefix-manager-proxy.ts +42 -0
- package/src/index.ts +1 -0
- package/src/lib-proxy.ts +22 -19
- package/src/proxy.ts +509 -0
- package/src/utility/character-set-descriptor.ts +5 -5
- package/src/utility/character-set-proxy.ts +39 -55
- package/src/utility/reg-exp-proxy.ts +11 -15
- package/src/utility/string-descriptor.ts +2 -2
- package/src/utility/transformer-descriptor.ts +3 -3
- package/src/utility/transformer-proxy.ts +16 -26
- package/tsconfig-src.json +1 -4
- package/src/generator/descriptor.ts +0 -122
- package/src/gs1/identifier-proxy.ts +0 -825
package/dist/index.cjs
CHANGED
|
@@ -5,6 +5,12 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name);
|
|
9
|
+
var __typeError = (msg) => {
|
|
10
|
+
throw TypeError(msg);
|
|
11
|
+
};
|
|
12
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
14
|
var __export = (target, all) => {
|
|
9
15
|
for (var name in all)
|
|
10
16
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -26,15 +32,45 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
32
|
mod
|
|
27
33
|
));
|
|
28
34
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)];
|
|
36
|
+
var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"];
|
|
37
|
+
var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn;
|
|
38
|
+
var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) });
|
|
39
|
+
var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]);
|
|
40
|
+
var __runInitializers = (array, flags, self, value) => {
|
|
41
|
+
for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value);
|
|
42
|
+
return value;
|
|
43
|
+
};
|
|
44
|
+
var __decorateElement = (array, flags, name, decorators, target, extra) => {
|
|
45
|
+
var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16);
|
|
46
|
+
var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5];
|
|
47
|
+
var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []);
|
|
48
|
+
var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() {
|
|
49
|
+
return __privateGet(this, extra);
|
|
50
|
+
}, set [name](x) {
|
|
51
|
+
return __privateSet(this, extra, x);
|
|
52
|
+
} }, name));
|
|
53
|
+
k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name);
|
|
54
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
55
|
+
ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers);
|
|
56
|
+
if (k) {
|
|
57
|
+
ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x };
|
|
58
|
+
if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name];
|
|
59
|
+
if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y;
|
|
60
|
+
}
|
|
61
|
+
it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1;
|
|
62
|
+
if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it);
|
|
63
|
+
else if (typeof it !== "object" || it === null) __typeError("Object expected");
|
|
64
|
+
else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn);
|
|
65
|
+
}
|
|
66
|
+
return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target;
|
|
67
|
+
};
|
|
68
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
69
|
+
var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj);
|
|
70
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
71
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
72
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
73
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
38
74
|
|
|
39
75
|
// src/index.ts
|
|
40
76
|
var index_exports = {};
|
|
@@ -50,16 +86,12 @@ __export(index_exports, {
|
|
|
50
86
|
HexadecimalProxy: () => HexadecimalProxy,
|
|
51
87
|
LibProxy: () => LibProxy,
|
|
52
88
|
NumericProxy: () => NumericProxy,
|
|
53
|
-
ProxyClass: () => ProxyClass,
|
|
54
|
-
ProxyMethod: () => ProxyMethod,
|
|
55
|
-
ProxyParameter: () => ProxyParameter,
|
|
56
89
|
RegExpProxy: () => RegExpProxy,
|
|
57
90
|
TransformerProxy: () => TransformerProxy,
|
|
58
91
|
Types: () => Types,
|
|
59
92
|
appExtensionNS: () => appExtensionNS,
|
|
60
93
|
appExtensionResources: () => appExtensionResources,
|
|
61
94
|
expandParameterDescriptor: () => expandParameterDescriptor,
|
|
62
|
-
getClassDescriptorsMap: () => getClassDescriptorsMap,
|
|
63
95
|
i18nAppExtensionInit: () => i18nAppExtensionInit,
|
|
64
96
|
i18nextAppExtension: () => i18nextAppExtension
|
|
65
97
|
});
|
|
@@ -1345,23 +1377,23 @@ var AppExtension = class {
|
|
|
1345
1377
|
/**
|
|
1346
1378
|
* Application version.
|
|
1347
1379
|
*/
|
|
1348
|
-
|
|
1380
|
+
#version;
|
|
1349
1381
|
/**
|
|
1350
1382
|
* Maximum sequence count supported by application.
|
|
1351
1383
|
*/
|
|
1352
|
-
|
|
1384
|
+
#maximumSequenceCount;
|
|
1353
1385
|
/**
|
|
1354
1386
|
* If true, errors are reported through the throw/catch mechanism.
|
|
1355
1387
|
*/
|
|
1356
|
-
|
|
1388
|
+
#throwError;
|
|
1357
1389
|
/**
|
|
1358
1390
|
* Maximum width supported by application.
|
|
1359
1391
|
*/
|
|
1360
|
-
|
|
1392
|
+
#maximumWidth;
|
|
1361
1393
|
/**
|
|
1362
1394
|
* Maximum height supported by application.
|
|
1363
1395
|
*/
|
|
1364
|
-
|
|
1396
|
+
#maximumHeight;
|
|
1365
1397
|
/**
|
|
1366
1398
|
* Constructor.
|
|
1367
1399
|
*
|
|
@@ -1375,9 +1407,9 @@ var AppExtension = class {
|
|
|
1375
1407
|
* If true, errors are reported through the throw/catch mechanism.
|
|
1376
1408
|
*/
|
|
1377
1409
|
constructor(version, maximumSequenceCount, throwError) {
|
|
1378
|
-
this
|
|
1379
|
-
this
|
|
1380
|
-
this
|
|
1410
|
+
this.#version = version;
|
|
1411
|
+
this.#maximumSequenceCount = maximumSequenceCount;
|
|
1412
|
+
this.#throwError = throwError;
|
|
1381
1413
|
}
|
|
1382
1414
|
/**
|
|
1383
1415
|
* Get the version.
|
|
@@ -1386,13 +1418,13 @@ var AppExtension = class {
|
|
|
1386
1418
|
* Version.
|
|
1387
1419
|
*/
|
|
1388
1420
|
get version() {
|
|
1389
|
-
return this
|
|
1421
|
+
return this.#version;
|
|
1390
1422
|
}
|
|
1391
1423
|
/**
|
|
1392
1424
|
* Determine if errors are reported through the throw/catch mechanism.
|
|
1393
1425
|
*/
|
|
1394
1426
|
get throwError() {
|
|
1395
|
-
return this
|
|
1427
|
+
return this.#throwError;
|
|
1396
1428
|
}
|
|
1397
1429
|
/**
|
|
1398
1430
|
* Get the maximum width supported by the application.
|
|
@@ -1401,8 +1433,8 @@ var AppExtension = class {
|
|
|
1401
1433
|
* Maximum width supported by the application.
|
|
1402
1434
|
*/
|
|
1403
1435
|
async maximumWidth() {
|
|
1404
|
-
this
|
|
1405
|
-
return this
|
|
1436
|
+
this.#maximumWidth ??= await this.getMaximumWidth();
|
|
1437
|
+
return this.#maximumWidth;
|
|
1406
1438
|
}
|
|
1407
1439
|
/**
|
|
1408
1440
|
* Get the maximum height supported by the application.
|
|
@@ -1411,8 +1443,8 @@ var AppExtension = class {
|
|
|
1411
1443
|
* Maximum height supported by the application.
|
|
1412
1444
|
*/
|
|
1413
1445
|
async maximumHeight() {
|
|
1414
|
-
this
|
|
1415
|
-
return this
|
|
1446
|
+
this.#maximumHeight ??= await this.getMaximumHeight();
|
|
1447
|
+
return this.#maximumHeight;
|
|
1416
1448
|
}
|
|
1417
1449
|
/**
|
|
1418
1450
|
* Validate a sequence count against the maximum supported by application.
|
|
@@ -1422,16 +1454,19 @@ var AppExtension = class {
|
|
|
1422
1454
|
*/
|
|
1423
1455
|
validateSequenceCount(sequenceCount) {
|
|
1424
1456
|
const absoluteSequenceCount = Math.abs(sequenceCount);
|
|
1425
|
-
if (absoluteSequenceCount > this
|
|
1457
|
+
if (absoluteSequenceCount > this.#maximumSequenceCount) {
|
|
1426
1458
|
throw new RangeError(i18nextAppExtension.t("AppExtension.sequenceCountMustBeLessThanOrEqualTo", {
|
|
1427
1459
|
sequenceCount: absoluteSequenceCount,
|
|
1428
|
-
maximumSequenceCount: this
|
|
1460
|
+
maximumSequenceCount: this.#maximumSequenceCount
|
|
1429
1461
|
}));
|
|
1430
1462
|
}
|
|
1431
1463
|
}
|
|
1432
1464
|
/**
|
|
1433
1465
|
* Bind a synchronous method and wrap it in a try/catch for comprehensive error handling.
|
|
1434
1466
|
*
|
|
1467
|
+
* @template TMethod
|
|
1468
|
+
* Method type.
|
|
1469
|
+
*
|
|
1435
1470
|
* @param thisArg
|
|
1436
1471
|
* The value to be passed as the `this` parameter to the method.
|
|
1437
1472
|
*
|
|
@@ -1455,6 +1490,9 @@ var AppExtension = class {
|
|
|
1455
1490
|
/**
|
|
1456
1491
|
* Bind an asynchronous method and wrap it in a try/catch for comprehensive error handling.
|
|
1457
1492
|
*
|
|
1493
|
+
* @template TMethod
|
|
1494
|
+
* Method type.
|
|
1495
|
+
*
|
|
1458
1496
|
* @param thisArg
|
|
1459
1497
|
* The value to be passed as the `this` parameter to the method.
|
|
1460
1498
|
*
|
|
@@ -1479,7 +1517,7 @@ var LibProxy = class {
|
|
|
1479
1517
|
/**
|
|
1480
1518
|
* Application extension.
|
|
1481
1519
|
*/
|
|
1482
|
-
|
|
1520
|
+
#appExtension;
|
|
1483
1521
|
/**
|
|
1484
1522
|
* Constructor.
|
|
1485
1523
|
*
|
|
@@ -1487,13 +1525,13 @@ var LibProxy = class {
|
|
|
1487
1525
|
* Application extension.
|
|
1488
1526
|
*/
|
|
1489
1527
|
constructor(appExtension) {
|
|
1490
|
-
this
|
|
1528
|
+
this.#appExtension = appExtension;
|
|
1491
1529
|
}
|
|
1492
1530
|
/**
|
|
1493
1531
|
* Get the application extension.
|
|
1494
1532
|
*/
|
|
1495
1533
|
get appExtension() {
|
|
1496
|
-
return this
|
|
1534
|
+
return this.#appExtension;
|
|
1497
1535
|
}
|
|
1498
1536
|
/**
|
|
1499
1537
|
* Map big integer to another type if necessary.
|
|
@@ -1505,7 +1543,7 @@ var LibProxy = class {
|
|
|
1505
1543
|
* Mapped big integer value.
|
|
1506
1544
|
*/
|
|
1507
1545
|
mapBigInt(value) {
|
|
1508
|
-
return this.
|
|
1546
|
+
return this.#appExtension.mapBigInt(value);
|
|
1509
1547
|
}
|
|
1510
1548
|
/**
|
|
1511
1549
|
* Handle an error thrown by a function call.
|
|
@@ -1516,11 +1554,11 @@ var LibProxy = class {
|
|
|
1516
1554
|
* @returns
|
|
1517
1555
|
* Error if errors are not thrown.
|
|
1518
1556
|
*/
|
|
1519
|
-
handleError(e) {
|
|
1557
|
+
#handleError(e) {
|
|
1520
1558
|
let result;
|
|
1521
1559
|
if (e instanceof RangeError) {
|
|
1522
|
-
const error = this.
|
|
1523
|
-
if (this.
|
|
1560
|
+
const error = this.#appExtension.mapRangeError(e);
|
|
1561
|
+
if (this.#appExtension.throwError) {
|
|
1524
1562
|
throw error;
|
|
1525
1563
|
}
|
|
1526
1564
|
result = error;
|
|
@@ -1541,12 +1579,12 @@ var LibProxy = class {
|
|
|
1541
1579
|
* @returns
|
|
1542
1580
|
* Callback result or error if errors are not thrown.
|
|
1543
1581
|
*/
|
|
1544
|
-
doCallback(value, callback) {
|
|
1582
|
+
#doCallback(value, callback) {
|
|
1545
1583
|
let result;
|
|
1546
1584
|
try {
|
|
1547
1585
|
result = callback(value);
|
|
1548
1586
|
} catch (e) {
|
|
1549
|
-
result = this
|
|
1587
|
+
result = this.#handleError(e);
|
|
1550
1588
|
}
|
|
1551
1589
|
return result;
|
|
1552
1590
|
}
|
|
@@ -1563,7 +1601,7 @@ var LibProxy = class {
|
|
|
1563
1601
|
* Matrix of callback results and errors if errors are not thrown.
|
|
1564
1602
|
*/
|
|
1565
1603
|
mapMatrix(matrixValues, callback) {
|
|
1566
|
-
return matrixValues.map((rowValues) => rowValues.map((value) => this
|
|
1604
|
+
return matrixValues.map((rowValues) => rowValues.map((value) => this.#doCallback(value, callback)));
|
|
1567
1605
|
}
|
|
1568
1606
|
/**
|
|
1569
1607
|
* Do the callback for an array return.
|
|
@@ -1577,8 +1615,8 @@ var LibProxy = class {
|
|
|
1577
1615
|
* @returns
|
|
1578
1616
|
* Callback result or error as array if errors are not thrown.
|
|
1579
1617
|
*/
|
|
1580
|
-
doArrayCallback(value, callback) {
|
|
1581
|
-
const result = this
|
|
1618
|
+
#doArrayCallback(value, callback) {
|
|
1619
|
+
const result = this.#doCallback(value, callback);
|
|
1582
1620
|
return result instanceof Array ? result : [result];
|
|
1583
1621
|
}
|
|
1584
1622
|
/**
|
|
@@ -1600,7 +1638,7 @@ var LibProxy = class {
|
|
|
1600
1638
|
} else if (matrixValues.length === 1) {
|
|
1601
1639
|
matrixResultError = [];
|
|
1602
1640
|
matrixValues[0].forEach((value, columnIndex) => {
|
|
1603
|
-
const arrayResultError = this
|
|
1641
|
+
const arrayResultError = this.#doArrayCallback(value, callback);
|
|
1604
1642
|
arrayResultError.forEach((resultError, rowIndex) => {
|
|
1605
1643
|
if (matrixResultError.length <= rowIndex) {
|
|
1606
1644
|
matrixResultError.push([]);
|
|
@@ -1614,9 +1652,9 @@ var LibProxy = class {
|
|
|
1614
1652
|
if (rowValue.length === 0) {
|
|
1615
1653
|
arrayResultError = [];
|
|
1616
1654
|
} else if (rowValue.length === 1) {
|
|
1617
|
-
arrayResultError = this
|
|
1655
|
+
arrayResultError = this.#doArrayCallback(rowValue[0], callback);
|
|
1618
1656
|
} else {
|
|
1619
|
-
arrayResultError = [this
|
|
1657
|
+
arrayResultError = [this.#handleError(new RangeError(i18nextAppExtension.t("Proxy.matrixMustBeArray")))];
|
|
1620
1658
|
}
|
|
1621
1659
|
return arrayResultError;
|
|
1622
1660
|
});
|
|
@@ -1694,91 +1732,266 @@ var Types = {
|
|
|
1694
1732
|
*/
|
|
1695
1733
|
Any: 3
|
|
1696
1734
|
};
|
|
1735
|
+
|
|
1736
|
+
// src/app-utility-proxy.ts
|
|
1737
|
+
var import_core3 = require("@aidc-toolkit/core");
|
|
1738
|
+
|
|
1739
|
+
// src/proxy.ts
|
|
1740
|
+
var import_core2 = require("@aidc-toolkit/core");
|
|
1697
1741
|
function expandParameterDescriptor(parameterDescriptor) {
|
|
1698
1742
|
return !("extendsDescriptor" in parameterDescriptor) ? parameterDescriptor : {
|
|
1699
1743
|
...expandParameterDescriptor(parameterDescriptor.extendsDescriptor),
|
|
1700
1744
|
...parameterDescriptor
|
|
1701
1745
|
};
|
|
1702
1746
|
}
|
|
1703
|
-
var
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1747
|
+
var Proxy2 = class _Proxy {
|
|
1748
|
+
/**
|
|
1749
|
+
* Logger.
|
|
1750
|
+
*/
|
|
1751
|
+
#logger = (0, import_core2.getLogger)(import_core2.LogLevels.Info);
|
|
1752
|
+
/**
|
|
1753
|
+
* Abstract class descriptors map, keyed on declaration class name. Abstract classes are not used directly by target
|
|
1754
|
+
* applications.
|
|
1755
|
+
*/
|
|
1756
|
+
#abstractClassDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1757
|
+
/**
|
|
1758
|
+
* Concrete class descriptors map, keyed on declaration class name.
|
|
1759
|
+
*/
|
|
1760
|
+
#concreteClassDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1761
|
+
/**
|
|
1762
|
+
* Interim object.
|
|
1763
|
+
*/
|
|
1764
|
+
#interim = void 0;
|
|
1765
|
+
/**
|
|
1766
|
+
* Get the proper JSON representation of a value.
|
|
1767
|
+
*
|
|
1768
|
+
* @param value
|
|
1769
|
+
* Value.
|
|
1770
|
+
*
|
|
1771
|
+
* @returns
|
|
1772
|
+
* Replacement value.
|
|
1773
|
+
*/
|
|
1774
|
+
static #jsonValue(value) {
|
|
1775
|
+
let replacementValue;
|
|
1776
|
+
switch (typeof value) {
|
|
1777
|
+
case "string":
|
|
1778
|
+
case "number":
|
|
1779
|
+
case "boolean":
|
|
1780
|
+
case "undefined":
|
|
1781
|
+
replacementValue = value;
|
|
1782
|
+
break;
|
|
1783
|
+
case "bigint":
|
|
1784
|
+
replacementValue = value >= Number.MIN_SAFE_INTEGER && value <= Number.MAX_SAFE_INTEGER ? Number(value) : value.toString(10);
|
|
1785
|
+
break;
|
|
1786
|
+
case "object":
|
|
1787
|
+
if (value === null) {
|
|
1788
|
+
replacementValue = value;
|
|
1789
|
+
} else if (Array.isArray(value)) {
|
|
1790
|
+
replacementValue = value.map((entry) => _Proxy.#jsonValue(entry));
|
|
1791
|
+
} else {
|
|
1792
|
+
replacementValue = Object.fromEntries(Object.entries(value).map(([k, v]) => [k, _Proxy.#jsonValue(v)]));
|
|
1793
|
+
}
|
|
1794
|
+
break;
|
|
1795
|
+
case "symbol":
|
|
1796
|
+
case "function":
|
|
1797
|
+
throw new Error(`Unsupported ${typeof value} value type`);
|
|
1716
1798
|
}
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1799
|
+
return replacementValue;
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Describe a proxy class.
|
|
1803
|
+
*
|
|
1804
|
+
* @template T
|
|
1805
|
+
* Proxy class type.
|
|
1806
|
+
*
|
|
1807
|
+
* @template IsAbstract
|
|
1808
|
+
* True if the proxy class is abstract.
|
|
1809
|
+
*
|
|
1810
|
+
* @template TConstructor
|
|
1811
|
+
* Proxy class constructor type.
|
|
1812
|
+
*
|
|
1813
|
+
* @template TProxyClassConstructor
|
|
1814
|
+
* Narrowed proxy class constructor type.
|
|
1815
|
+
*
|
|
1816
|
+
* @param isAbstract
|
|
1817
|
+
* True if class is abstract.
|
|
1818
|
+
*
|
|
1819
|
+
* @param decoratorClassDescriptor
|
|
1820
|
+
* Class descriptor.
|
|
1821
|
+
*
|
|
1822
|
+
* @returns
|
|
1823
|
+
* Function with which to decorate the class.
|
|
1824
|
+
*/
|
|
1825
|
+
describeClass(isAbstract, decoratorClassDescriptor = {}) {
|
|
1826
|
+
const interimClassDescriptor = decoratorClassDescriptor.replaceParameterDescriptors === void 0 ? (0, import_core2.omit)(decoratorClassDescriptor, "replaceParameterDescriptors") : {
|
|
1827
|
+
...decoratorClassDescriptor,
|
|
1828
|
+
replaceParameterDescriptors: decoratorClassDescriptor.replaceParameterDescriptors.map((replaceParameterDescriptor) => ({
|
|
1829
|
+
...replaceParameterDescriptor,
|
|
1830
|
+
replacement: expandParameterDescriptor(replaceParameterDescriptor.replacement)
|
|
1831
|
+
}))
|
|
1832
|
+
};
|
|
1833
|
+
const interim = {
|
|
1834
|
+
classDescriptor: interimClassDescriptor,
|
|
1835
|
+
methodDescriptors: []
|
|
1836
|
+
};
|
|
1837
|
+
this.#interim = interim;
|
|
1838
|
+
return (Target, context) => {
|
|
1839
|
+
const name = context.name;
|
|
1840
|
+
if (typeof name !== "string") {
|
|
1841
|
+
throw new Error(`${String(name)} has an invalid name`);
|
|
1723
1842
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1843
|
+
const namespacePrefix = decoratorClassDescriptor.namespace === void 0 ? "" : `${decoratorClassDescriptor.namespace}.`;
|
|
1844
|
+
const namespaceClassName = `${namespacePrefix}${name}`;
|
|
1845
|
+
const abstractClassDescriptorsMap = this.#abstractClassDescriptorsMap;
|
|
1846
|
+
const concreteClassDescriptorsMap = this.#concreteClassDescriptorsMap;
|
|
1847
|
+
if (abstractClassDescriptorsMap.has(namespaceClassName) || concreteClassDescriptorsMap.has(namespaceClassName)) {
|
|
1848
|
+
throw new Error(`Duplicate class ${namespaceClassName}`);
|
|
1728
1849
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1850
|
+
let baseClassType = Target;
|
|
1851
|
+
let baseClassDescriptor;
|
|
1852
|
+
do {
|
|
1853
|
+
baseClassType = Object.getPrototypeOf(baseClassType);
|
|
1854
|
+
const namespaceBaseClassName = `${namespacePrefix}${baseClassType.name}`;
|
|
1855
|
+
baseClassDescriptor = abstractClassDescriptorsMap.get(namespaceBaseClassName) ?? abstractClassDescriptorsMap.get(baseClassType.name) ?? concreteClassDescriptorsMap.get(namespaceBaseClassName) ?? concreteClassDescriptorsMap.get(baseClassType.name);
|
|
1856
|
+
} while (baseClassType !== LibProxy && baseClassDescriptor === void 0);
|
|
1857
|
+
let interimMethodDescriptors;
|
|
1858
|
+
if (baseClassDescriptor !== void 0) {
|
|
1859
|
+
const baseClassMethodDescriptors = baseClassDescriptor.methodDescriptors;
|
|
1860
|
+
const replaceParameterDescriptors = decoratorClassDescriptor.replaceParameterDescriptors;
|
|
1861
|
+
if (replaceParameterDescriptors !== void 0) {
|
|
1862
|
+
const replacementParameterDescriptorsMap = new Map(replaceParameterDescriptors.map((replaceParameterDescriptor) => [replaceParameterDescriptor.name, expandParameterDescriptor(replaceParameterDescriptor.replacement)]));
|
|
1863
|
+
interimMethodDescriptors = baseClassMethodDescriptors.map((baseClassMethodDescriptor) => ({
|
|
1864
|
+
...baseClassMethodDescriptor,
|
|
1865
|
+
parameterDescriptors: baseClassMethodDescriptor.parameterDescriptors.map((parameterDescriptor) => replacementParameterDescriptorsMap.get(parameterDescriptor.name) ?? parameterDescriptor)
|
|
1866
|
+
}));
|
|
1867
|
+
} else {
|
|
1868
|
+
interimMethodDescriptors = baseClassMethodDescriptors.slice();
|
|
1869
|
+
}
|
|
1870
|
+
} else {
|
|
1871
|
+
interimMethodDescriptors = [];
|
|
1750
1872
|
}
|
|
1751
|
-
const
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1873
|
+
for (const classInterimMethodDescriptor of interim.methodDescriptors) {
|
|
1874
|
+
const existingIndex = interimMethodDescriptors.findIndex((interimMethodDescriptor) => interimMethodDescriptor.name === classInterimMethodDescriptor.name);
|
|
1875
|
+
if (existingIndex !== -1) {
|
|
1876
|
+
interimMethodDescriptors[existingIndex] = classInterimMethodDescriptor;
|
|
1877
|
+
} else {
|
|
1878
|
+
interimMethodDescriptors.push(classInterimMethodDescriptor);
|
|
1755
1879
|
}
|
|
1756
1880
|
}
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1881
|
+
const methodDescriptors = [];
|
|
1882
|
+
const methodInfix = decoratorClassDescriptor.methodInfix;
|
|
1883
|
+
for (const interimMethodDescriptor of interimMethodDescriptors) {
|
|
1884
|
+
const methodName = interimMethodDescriptor.name;
|
|
1885
|
+
const infixBefore = interimMethodDescriptor.infixBefore;
|
|
1886
|
+
let functionName;
|
|
1887
|
+
if (methodInfix === void 0 || interimMethodDescriptor.ignoreInfix === true) {
|
|
1888
|
+
functionName = methodName;
|
|
1889
|
+
} else if (infixBefore === void 0) {
|
|
1890
|
+
functionName = `${methodName}${methodInfix}`;
|
|
1891
|
+
} else {
|
|
1892
|
+
const insertIndex = methodName.indexOf(infixBefore);
|
|
1893
|
+
if (insertIndex === -1) {
|
|
1894
|
+
throw new Error(`Cannot find "${infixBefore}" in method ${methodName}`);
|
|
1895
|
+
}
|
|
1896
|
+
functionName = `${methodName.substring(0, insertIndex)}${methodInfix}${methodName.substring(insertIndex)}`;
|
|
1897
|
+
}
|
|
1898
|
+
const namespaceFunctionName = `${namespacePrefix}${functionName}`;
|
|
1899
|
+
const methodDescriptor = {
|
|
1900
|
+
...interimMethodDescriptor,
|
|
1901
|
+
functionName,
|
|
1902
|
+
namespaceFunctionName
|
|
1903
|
+
};
|
|
1904
|
+
methodDescriptors.push(methodDescriptor);
|
|
1905
|
+
}
|
|
1906
|
+
const objectNameGroups = /^(?<namespaceFirstWord>[A-Z]+[0-9]*|[A-Z][^A-Z.]*)(?<namespaceRemaining>[A-Z][^.]*|)\.?(?<className>[A-Z].*|)$/.exec(namespaceClassName)?.groups;
|
|
1907
|
+
if (objectNameGroups === void 0) {
|
|
1908
|
+
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
1909
|
+
}
|
|
1910
|
+
const classDescriptor = {
|
|
1911
|
+
name,
|
|
1912
|
+
...interimClassDescriptor,
|
|
1913
|
+
namespaceClassName,
|
|
1914
|
+
objectName: `${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`,
|
|
1915
|
+
methodDescriptors
|
|
1916
|
+
};
|
|
1917
|
+
(isAbstract ? abstractClassDescriptorsMap : concreteClassDescriptorsMap).set(namespaceClassName, classDescriptor);
|
|
1918
|
+
const methodDescriptorsMap = /* @__PURE__ */ new Map();
|
|
1919
|
+
for (const methodDescriptor of methodDescriptors) {
|
|
1920
|
+
methodDescriptorsMap.set(methodDescriptor.name, methodDescriptor);
|
|
1921
|
+
}
|
|
1922
|
+
this.#interim = void 0;
|
|
1923
|
+
const logger = this.#logger;
|
|
1924
|
+
return class extends Target {
|
|
1925
|
+
/**
|
|
1926
|
+
* @inheritDoc
|
|
1927
|
+
*/
|
|
1928
|
+
log(methodName, args, result) {
|
|
1929
|
+
const methodDescriptor = methodDescriptorsMap.get(methodName);
|
|
1930
|
+
logger.info(JSON.stringify({
|
|
1931
|
+
namespace: decoratorClassDescriptor.namespace,
|
|
1932
|
+
className: name,
|
|
1933
|
+
methodName,
|
|
1934
|
+
functionName: methodDescriptor.functionName,
|
|
1935
|
+
parameters: methodDescriptor.parameterDescriptors.map((parameterDescriptor, index) => ({
|
|
1936
|
+
name: parameterDescriptor.name,
|
|
1937
|
+
value: args[index]
|
|
1938
|
+
})),
|
|
1939
|
+
result: _Proxy.#jsonValue(result)
|
|
1940
|
+
}, null, 2));
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
};
|
|
1944
|
+
}
|
|
1945
|
+
/**
|
|
1946
|
+
* Describe a proxy method.
|
|
1947
|
+
*
|
|
1948
|
+
* @template TFunction
|
|
1949
|
+
* Function type.
|
|
1950
|
+
*
|
|
1951
|
+
* @param decoratorMethodDescriptor
|
|
1952
|
+
* Method descriptor.
|
|
1953
|
+
*
|
|
1954
|
+
* @returns
|
|
1955
|
+
* Function with which to decorate the method.
|
|
1956
|
+
*/
|
|
1957
|
+
describeMethod(decoratorMethodDescriptor) {
|
|
1958
|
+
return (target, context) => {
|
|
1959
|
+
const name = context.name;
|
|
1960
|
+
if (this.#interim === void 0 || typeof name !== "string" || context.static || context.private) {
|
|
1961
|
+
throw new Error(`${String(name)} is not defined within a supported class, has an invalid name, is static, or is private`);
|
|
1962
|
+
}
|
|
1963
|
+
let anyOptional = false;
|
|
1964
|
+
const parameterDescriptors = decoratorMethodDescriptor.parameterDescriptors.map((decoratorParameterDescriptor) => {
|
|
1965
|
+
const parameterDescriptor = expandParameterDescriptor(decoratorParameterDescriptor);
|
|
1966
|
+
if (!parameterDescriptor.isRequired) {
|
|
1967
|
+
anyOptional = true;
|
|
1968
|
+
} else if (anyOptional) {
|
|
1969
|
+
throw new Error(`Parameter ${parameterDescriptor.name} descriptor of method ${name} is required but prior parameter descriptor is optional`);
|
|
1970
|
+
}
|
|
1971
|
+
return parameterDescriptor;
|
|
1972
|
+
});
|
|
1973
|
+
this.#interim.methodDescriptors.push({
|
|
1974
|
+
name,
|
|
1975
|
+
...decoratorMethodDescriptor,
|
|
1976
|
+
parameterDescriptors
|
|
1977
|
+
});
|
|
1978
|
+
return function methodProxy(...args) {
|
|
1979
|
+
const result = target.call(this, ...args);
|
|
1980
|
+
this.log(name, args, result);
|
|
1981
|
+
return result;
|
|
1982
|
+
};
|
|
1983
|
+
};
|
|
1984
|
+
}
|
|
1985
|
+
/**
|
|
1986
|
+
* Get the class descriptors map.
|
|
1987
|
+
*/
|
|
1988
|
+
get classDescriptorsMap() {
|
|
1989
|
+
return this.#concreteClassDescriptorsMap;
|
|
1990
|
+
}
|
|
1991
|
+
};
|
|
1992
|
+
var proxy = new Proxy2();
|
|
1779
1993
|
|
|
1780
1994
|
// src/app-utility-proxy.ts
|
|
1781
|
-
var import_core2 = require("@aidc-toolkit/core");
|
|
1782
1995
|
var spillMatrix = {
|
|
1783
1996
|
name: "spillMatrix",
|
|
1784
1997
|
type: Types.Any,
|
|
@@ -1801,49 +2014,37 @@ var spillMaximumHeightParameterDescriptor = {
|
|
|
1801
2014
|
sortOrder: 1,
|
|
1802
2015
|
name: "spillMaximumHeight"
|
|
1803
2016
|
};
|
|
1804
|
-
var
|
|
2017
|
+
var _hSpill_dec, _vSpill_dec, _version_dec, _a, _AppUtilityProxy_decorators, _init, _AppUtilityProxy_instances, defaultMaximums_fn;
|
|
2018
|
+
_AppUtilityProxy_decorators = [proxy.describeClass(false)];
|
|
2019
|
+
var AppUtilityProxy = class extends (_a = LibProxy, _version_dec = [proxy.describeMethod({
|
|
2020
|
+
type: Types.String,
|
|
2021
|
+
isMatrix: false,
|
|
2022
|
+
parameterDescriptors: []
|
|
2023
|
+
})], _vSpill_dec = [proxy.describeMethod({
|
|
2024
|
+
requiresContext: true,
|
|
2025
|
+
type: Types.Any,
|
|
2026
|
+
isMatrix: true,
|
|
2027
|
+
parameterDescriptors: [spillMatrix, spillMaximumWidthParameterDescriptor, spillMaximumHeightParameterDescriptor]
|
|
2028
|
+
})], _hSpill_dec = [proxy.describeMethod({
|
|
2029
|
+
requiresContext: true,
|
|
2030
|
+
type: Types.Any,
|
|
2031
|
+
isMatrix: true,
|
|
2032
|
+
parameterDescriptors: [spillMatrix, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
|
|
2033
|
+
})], _a) {
|
|
2034
|
+
constructor() {
|
|
2035
|
+
super(...arguments);
|
|
2036
|
+
__runInitializers(_init, 5, this);
|
|
2037
|
+
__privateAdd(this, _AppUtilityProxy_instances);
|
|
2038
|
+
}
|
|
1805
2039
|
version() {
|
|
1806
2040
|
return this.appExtension.version;
|
|
1807
2041
|
}
|
|
1808
|
-
/**
|
|
1809
|
-
* Provide default values for maximum width and height if required.
|
|
1810
|
-
*
|
|
1811
|
-
* @param maximumDimensions
|
|
1812
|
-
* Maximum dimensions provided to function.
|
|
1813
|
-
*
|
|
1814
|
-
* @param invocationContext
|
|
1815
|
-
* Invocation context.
|
|
1816
|
-
*
|
|
1817
|
-
* @returns
|
|
1818
|
-
* Array of maximum width and maximum height.
|
|
1819
|
-
*/
|
|
1820
|
-
async defaultMaximums(maximumDimensions, invocationContext) {
|
|
1821
|
-
if ((0, import_core2.isNullish)(invocationContext)) {
|
|
1822
|
-
throw new Error("Invocation context not provided by application");
|
|
1823
|
-
}
|
|
1824
|
-
const maximumWidth = maximumDimensions.width;
|
|
1825
|
-
const maximumHeight = maximumDimensions.height;
|
|
1826
|
-
let definedMaximumWidth;
|
|
1827
|
-
let definedMaximumHeight;
|
|
1828
|
-
if ((0, import_core2.isNullish)(maximumWidth) || (0, import_core2.isNullish)(maximumHeight)) {
|
|
1829
|
-
const sheetAddress = await this.appExtension.getSheetAddress(invocationContext);
|
|
1830
|
-
definedMaximumWidth = maximumWidth ?? await this.appExtension.maximumWidth() - sheetAddress.columnIndex;
|
|
1831
|
-
definedMaximumHeight = maximumHeight ?? await this.appExtension.maximumHeight() - sheetAddress.rowIndex;
|
|
1832
|
-
} else {
|
|
1833
|
-
definedMaximumWidth = maximumWidth;
|
|
1834
|
-
definedMaximumHeight = maximumHeight;
|
|
1835
|
-
}
|
|
1836
|
-
return {
|
|
1837
|
-
width: definedMaximumWidth,
|
|
1838
|
-
height: definedMaximumHeight
|
|
1839
|
-
};
|
|
1840
|
-
}
|
|
1841
2042
|
async vSpill(hMatrixValues, maximumWidth, maximumHeight, invocationContext) {
|
|
1842
2043
|
let result;
|
|
1843
2044
|
if (hMatrixValues.length !== 1) {
|
|
1844
2045
|
throw new RangeError(i18nextAppExtension.t("Proxy.vSpillMustBeHorizontalArray"));
|
|
1845
2046
|
}
|
|
1846
|
-
const maximumDimensions = await this.
|
|
2047
|
+
const maximumDimensions = await __privateMethod(this, _AppUtilityProxy_instances, defaultMaximums_fn).call(this, {
|
|
1847
2048
|
width: maximumWidth,
|
|
1848
2049
|
height: maximumHeight
|
|
1849
2050
|
}, invocationContext);
|
|
@@ -1853,7 +2054,7 @@ var AppUtilityProxy = class extends LibProxy {
|
|
|
1853
2054
|
if (hLength > 1 && hLength <= maximumArea) {
|
|
1854
2055
|
let spillWidth = Math.min(Math.ceil(Math.sqrt(maximumArea)), maximumDimensions.width);
|
|
1855
2056
|
if (Number.isInteger(Math.log10(hLength))) {
|
|
1856
|
-
const spillWidth10 =
|
|
2057
|
+
const spillWidth10 = 10 ** Math.floor(Math.log10(spillWidth));
|
|
1857
2058
|
if (hLength / spillWidth10 <= maximumDimensions.height) {
|
|
1858
2059
|
spillWidth = spillWidth10;
|
|
1859
2060
|
}
|
|
@@ -1877,7 +2078,7 @@ var AppUtilityProxy = class extends LibProxy {
|
|
|
1877
2078
|
throw new RangeError(i18nextAppExtension.t("Proxy.hSpillMustBeVerticalArray"));
|
|
1878
2079
|
}
|
|
1879
2080
|
}
|
|
1880
|
-
const maximumDimensions = await this.
|
|
2081
|
+
const maximumDimensions = await __privateMethod(this, _AppUtilityProxy_instances, defaultMaximums_fn).call(this, {
|
|
1881
2082
|
width: maximumWidth,
|
|
1882
2083
|
height: maximumHeight
|
|
1883
2084
|
}, invocationContext);
|
|
@@ -1886,7 +2087,7 @@ var AppUtilityProxy = class extends LibProxy {
|
|
|
1886
2087
|
if (vLength > 1 && vLength <= maximumArea) {
|
|
1887
2088
|
let spillHeight = Math.min(Math.ceil(Math.sqrt(maximumArea)), maximumDimensions.height);
|
|
1888
2089
|
if (Number.isInteger(Math.log10(vLength))) {
|
|
1889
|
-
const spillHeight10 =
|
|
2090
|
+
const spillHeight10 = 10 ** Math.floor(Math.log10(spillHeight));
|
|
1890
2091
|
if (vLength / spillHeight10 <= maximumDimensions.width) {
|
|
1891
2092
|
spillHeight = spillHeight10;
|
|
1892
2093
|
}
|
|
@@ -1905,35 +2106,34 @@ var AppUtilityProxy = class extends LibProxy {
|
|
|
1905
2106
|
return result;
|
|
1906
2107
|
}
|
|
1907
2108
|
};
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
AppUtilityProxy =
|
|
1935
|
-
|
|
1936
|
-
], AppUtilityProxy);
|
|
2109
|
+
_init = __decoratorStart(_a);
|
|
2110
|
+
_AppUtilityProxy_instances = new WeakSet();
|
|
2111
|
+
defaultMaximums_fn = async function(maximumDimensions, invocationContext) {
|
|
2112
|
+
if ((0, import_core3.isNullish)(invocationContext)) {
|
|
2113
|
+
throw new Error("Invocation context not provided by application");
|
|
2114
|
+
}
|
|
2115
|
+
const maximumWidth = maximumDimensions.width;
|
|
2116
|
+
const maximumHeight = maximumDimensions.height;
|
|
2117
|
+
let definedMaximumWidth;
|
|
2118
|
+
let definedMaximumHeight;
|
|
2119
|
+
if ((0, import_core3.isNullish)(maximumWidth) || (0, import_core3.isNullish)(maximumHeight)) {
|
|
2120
|
+
const sheetAddress = await this.appExtension.getSheetAddress(invocationContext);
|
|
2121
|
+
definedMaximumWidth = maximumWidth ?? await this.appExtension.maximumWidth() - sheetAddress.columnIndex;
|
|
2122
|
+
definedMaximumHeight = maximumHeight ?? await this.appExtension.maximumHeight() - sheetAddress.rowIndex;
|
|
2123
|
+
} else {
|
|
2124
|
+
definedMaximumWidth = maximumWidth;
|
|
2125
|
+
definedMaximumHeight = maximumHeight;
|
|
2126
|
+
}
|
|
2127
|
+
return {
|
|
2128
|
+
width: definedMaximumWidth,
|
|
2129
|
+
height: definedMaximumHeight
|
|
2130
|
+
};
|
|
2131
|
+
};
|
|
2132
|
+
__decorateElement(_init, 1, "version", _version_dec, AppUtilityProxy);
|
|
2133
|
+
__decorateElement(_init, 1, "vSpill", _vSpill_dec, AppUtilityProxy);
|
|
2134
|
+
__decorateElement(_init, 1, "hSpill", _hSpill_dec, AppUtilityProxy);
|
|
2135
|
+
AppUtilityProxy = __decorateElement(_init, 0, "AppUtilityProxy", _AppUtilityProxy_decorators, AppUtilityProxy);
|
|
2136
|
+
__runInitializers(_init, 1, AppUtilityProxy);
|
|
1937
2137
|
|
|
1938
2138
|
// src/utility/index.ts
|
|
1939
2139
|
var utility_exports = {};
|
|
@@ -1986,7 +2186,28 @@ var transformedValueParameterDescriptor = {
|
|
|
1986
2186
|
extendsDescriptor: valueParameterDescriptor,
|
|
1987
2187
|
name: "transformedValue"
|
|
1988
2188
|
};
|
|
1989
|
-
var
|
|
2189
|
+
var _reverse_dec, _forwardSequence_dec, _forward_dec, _a2, _TransformerProxy_decorators, _init2;
|
|
2190
|
+
_TransformerProxy_decorators = [proxy.describeClass(false, {
|
|
2191
|
+
methodInfix: "Transform"
|
|
2192
|
+
})];
|
|
2193
|
+
var TransformerProxy = class extends (_a2 = LibProxy, _forward_dec = [proxy.describeMethod({
|
|
2194
|
+
type: Types.Number,
|
|
2195
|
+
isMatrix: true,
|
|
2196
|
+
parameterDescriptors: [domainParameterDescriptor, valueParameterDescriptor, tweakParameterDescriptor]
|
|
2197
|
+
})], _forwardSequence_dec = [proxy.describeMethod({
|
|
2198
|
+
infixBefore: "Sequence",
|
|
2199
|
+
type: Types.Number,
|
|
2200
|
+
isMatrix: true,
|
|
2201
|
+
parameterDescriptors: [domainParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, tweakParameterDescriptor]
|
|
2202
|
+
})], _reverse_dec = [proxy.describeMethod({
|
|
2203
|
+
type: Types.Number,
|
|
2204
|
+
isMatrix: true,
|
|
2205
|
+
parameterDescriptors: [domainParameterDescriptor, transformedValueParameterDescriptor, tweakParameterDescriptor]
|
|
2206
|
+
})], _a2) {
|
|
2207
|
+
constructor() {
|
|
2208
|
+
super(...arguments);
|
|
2209
|
+
__runInitializers(_init2, 5, this);
|
|
2210
|
+
}
|
|
1990
2211
|
forward(domain, matrixValues, tweak) {
|
|
1991
2212
|
const transformer = import_utility3.Transformer.get(domain, tweak ?? void 0);
|
|
1992
2213
|
return this.mapMatrix(matrixValues, (value) => this.mapBigInt(transformer.forward(value)));
|
|
@@ -2000,40 +2221,12 @@ var TransformerProxy = class extends LibProxy {
|
|
|
2000
2221
|
return this.mapMatrix(matrixTransformedValues, (transformedValue) => this.mapBigInt(transformer.reverse(transformedValue)));
|
|
2001
2222
|
}
|
|
2002
2223
|
};
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
__decorateParam(1, ProxyParameter(valueParameterDescriptor)),
|
|
2010
|
-
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
2011
|
-
], TransformerProxy.prototype, "forward", 1);
|
|
2012
|
-
__decorateClass([
|
|
2013
|
-
ProxyMethod({
|
|
2014
|
-
infixBefore: "Sequence",
|
|
2015
|
-
type: Types.Number,
|
|
2016
|
-
isMatrix: true
|
|
2017
|
-
}),
|
|
2018
|
-
__decorateParam(0, ProxyParameter(domainParameterDescriptor)),
|
|
2019
|
-
__decorateParam(1, ProxyParameter(startValueParameterDescriptor)),
|
|
2020
|
-
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
2021
|
-
__decorateParam(3, ProxyParameter(tweakParameterDescriptor))
|
|
2022
|
-
], TransformerProxy.prototype, "forwardSequence", 1);
|
|
2023
|
-
__decorateClass([
|
|
2024
|
-
ProxyMethod({
|
|
2025
|
-
type: Types.Number,
|
|
2026
|
-
isMatrix: true
|
|
2027
|
-
}),
|
|
2028
|
-
__decorateParam(0, ProxyParameter(domainParameterDescriptor)),
|
|
2029
|
-
__decorateParam(1, ProxyParameter(transformedValueParameterDescriptor)),
|
|
2030
|
-
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
2031
|
-
], TransformerProxy.prototype, "reverse", 1);
|
|
2032
|
-
TransformerProxy = __decorateClass([
|
|
2033
|
-
ProxyClass({
|
|
2034
|
-
methodInfix: "Transform"
|
|
2035
|
-
})
|
|
2036
|
-
], TransformerProxy);
|
|
2224
|
+
_init2 = __decoratorStart(_a2);
|
|
2225
|
+
__decorateElement(_init2, 1, "forward", _forward_dec, TransformerProxy);
|
|
2226
|
+
__decorateElement(_init2, 1, "forwardSequence", _forwardSequence_dec, TransformerProxy);
|
|
2227
|
+
__decorateElement(_init2, 1, "reverse", _reverse_dec, TransformerProxy);
|
|
2228
|
+
TransformerProxy = __decorateElement(_init2, 0, "TransformerProxy", _TransformerProxy_decorators, TransformerProxy);
|
|
2229
|
+
__runInitializers(_init2, 1, TransformerProxy);
|
|
2037
2230
|
|
|
2038
2231
|
// src/utility/reg-exp-proxy.ts
|
|
2039
2232
|
var import_utility4 = require("@aidc-toolkit/utility");
|
|
@@ -2075,7 +2268,23 @@ var errorMessageParameterDescriptor = {
|
|
|
2075
2268
|
isMatrix: false,
|
|
2076
2269
|
isRequired: false
|
|
2077
2270
|
};
|
|
2078
|
-
var
|
|
2271
|
+
var _isValid_dec, _validate_dec, _a3, _RegExpProxy_decorators, _init3;
|
|
2272
|
+
_RegExpProxy_decorators = [proxy.describeClass(false, {
|
|
2273
|
+
methodInfix: "RegExp"
|
|
2274
|
+
})];
|
|
2275
|
+
var RegExpProxy = class extends (_a3 = StringProxy, _validate_dec = [proxy.describeMethod({
|
|
2276
|
+
type: Types.String,
|
|
2277
|
+
isMatrix: true,
|
|
2278
|
+
parameterDescriptors: [regExpParameterDescriptor, validateSParameterDescriptor, errorMessageParameterDescriptor]
|
|
2279
|
+
})], _isValid_dec = [proxy.describeMethod({
|
|
2280
|
+
type: Types.Boolean,
|
|
2281
|
+
isMatrix: true,
|
|
2282
|
+
parameterDescriptors: [regExpParameterDescriptor, validateSParameterDescriptor]
|
|
2283
|
+
})], _a3) {
|
|
2284
|
+
constructor() {
|
|
2285
|
+
super(...arguments);
|
|
2286
|
+
__runInitializers(_init3, 5, this);
|
|
2287
|
+
}
|
|
2079
2288
|
validate(regExp, matrixSs, errorMessage) {
|
|
2080
2289
|
return this.validateString(new class extends import_utility4.RegExpValidator {
|
|
2081
2290
|
createErrorMessage(s) {
|
|
@@ -2087,28 +2296,11 @@ var RegExpProxy = class extends StringProxy {
|
|
|
2087
2296
|
return this.isValidString(this.validate(regExp, matrixSs, void 0));
|
|
2088
2297
|
}
|
|
2089
2298
|
};
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
__decorateParam(0, ProxyParameter(regExpParameterDescriptor)),
|
|
2096
|
-
__decorateParam(1, ProxyParameter(validateSParameterDescriptor)),
|
|
2097
|
-
__decorateParam(2, ProxyParameter(errorMessageParameterDescriptor))
|
|
2098
|
-
], RegExpProxy.prototype, "validate", 1);
|
|
2099
|
-
__decorateClass([
|
|
2100
|
-
ProxyMethod({
|
|
2101
|
-
type: Types.Boolean,
|
|
2102
|
-
isMatrix: true
|
|
2103
|
-
}),
|
|
2104
|
-
__decorateParam(0, ProxyParameter(regExpParameterDescriptor)),
|
|
2105
|
-
__decorateParam(1, ProxyParameter(validateSParameterDescriptor))
|
|
2106
|
-
], RegExpProxy.prototype, "isValid", 1);
|
|
2107
|
-
RegExpProxy = __decorateClass([
|
|
2108
|
-
ProxyClass({
|
|
2109
|
-
methodInfix: "RegExp"
|
|
2110
|
-
})
|
|
2111
|
-
], RegExpProxy);
|
|
2299
|
+
_init3 = __decoratorStart(_a3);
|
|
2300
|
+
__decorateElement(_init3, 1, "validate", _validate_dec, RegExpProxy);
|
|
2301
|
+
__decorateElement(_init3, 1, "isValid", _isValid_dec, RegExpProxy);
|
|
2302
|
+
RegExpProxy = __decorateElement(_init3, 0, "RegExpProxy", _RegExpProxy_decorators, RegExpProxy);
|
|
2303
|
+
__runInitializers(_init3, 1, RegExpProxy);
|
|
2112
2304
|
|
|
2113
2305
|
// src/utility/character-set-proxy.ts
|
|
2114
2306
|
var import_utility5 = require("@aidc-toolkit/utility");
|
|
@@ -2152,14 +2344,25 @@ var valueForSParameterDescriptor = {
|
|
|
2152
2344
|
extendsDescriptor: sParameterDescriptor,
|
|
2153
2345
|
name: "valueForS"
|
|
2154
2346
|
};
|
|
2155
|
-
var
|
|
2156
|
-
|
|
2347
|
+
var _isValid_dec2, _validate_dec2, _a4, _CharacterSetValidatorProxy_decorators, _characterSetValidator, _init4;
|
|
2348
|
+
_CharacterSetValidatorProxy_decorators = [proxy.describeClass(true)];
|
|
2349
|
+
var CharacterSetValidatorProxy = class extends (_a4 = StringProxy, _validate_dec2 = [proxy.describeMethod({
|
|
2350
|
+
type: Types.String,
|
|
2351
|
+
isMatrix: true,
|
|
2352
|
+
parameterDescriptors: [validateSParameterDescriptor, exclusionNoneParameterDescriptor]
|
|
2353
|
+
})], _isValid_dec2 = [proxy.describeMethod({
|
|
2354
|
+
type: Types.Boolean,
|
|
2355
|
+
isMatrix: true,
|
|
2356
|
+
parameterDescriptors: [validateSParameterDescriptor, exclusionNoneParameterDescriptor]
|
|
2357
|
+
})], _a4) {
|
|
2157
2358
|
constructor(appExtension, characterSetValidator) {
|
|
2158
2359
|
super(appExtension);
|
|
2159
|
-
|
|
2360
|
+
__runInitializers(_init4, 5, this);
|
|
2361
|
+
__privateAdd(this, _characterSetValidator);
|
|
2362
|
+
__privateSet(this, _characterSetValidator, characterSetValidator);
|
|
2160
2363
|
}
|
|
2161
2364
|
validate(matrixSs, exclusion) {
|
|
2162
|
-
return this.validateString(this
|
|
2365
|
+
return this.validateString(__privateGet(this, _characterSetValidator), matrixSs, {
|
|
2163
2366
|
exclusion: exclusion ?? void 0
|
|
2164
2367
|
});
|
|
2165
2368
|
}
|
|
@@ -2167,134 +2370,124 @@ var CharacterSetValidatorProxy = class extends StringProxy {
|
|
|
2167
2370
|
return this.isValidString(this.validate(matrixSs, exclusion));
|
|
2168
2371
|
}
|
|
2169
2372
|
};
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2373
|
+
_init4 = __decoratorStart(_a4);
|
|
2374
|
+
_characterSetValidator = new WeakMap();
|
|
2375
|
+
__decorateElement(_init4, 1, "validate", _validate_dec2, CharacterSetValidatorProxy);
|
|
2376
|
+
__decorateElement(_init4, 1, "isValid", _isValid_dec2, CharacterSetValidatorProxy);
|
|
2377
|
+
CharacterSetValidatorProxy = __decorateElement(_init4, 0, "CharacterSetValidatorProxy", _CharacterSetValidatorProxy_decorators, CharacterSetValidatorProxy);
|
|
2378
|
+
__runInitializers(_init4, 1, CharacterSetValidatorProxy);
|
|
2379
|
+
var _valueFor_dec, _createSequence_dec, _create_dec, _a5, _CharacterSetCreatorProxy_decorators, _characterSetCreator, _init5;
|
|
2380
|
+
_CharacterSetCreatorProxy_decorators = [proxy.describeClass(true)];
|
|
2381
|
+
var CharacterSetCreatorProxy = class extends (_a5 = CharacterSetValidatorProxy, _create_dec = [proxy.describeMethod({
|
|
2382
|
+
type: Types.String,
|
|
2383
|
+
isMatrix: true,
|
|
2384
|
+
parameterDescriptors: [lengthParameterDescriptor, valueParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
2385
|
+
})], _createSequence_dec = [proxy.describeMethod({
|
|
2386
|
+
infixBefore: "Sequence",
|
|
2387
|
+
type: Types.String,
|
|
2388
|
+
isMatrix: true,
|
|
2389
|
+
parameterDescriptors: [lengthParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
2390
|
+
})], _valueFor_dec = [proxy.describeMethod({
|
|
2391
|
+
type: Types.Number,
|
|
2392
|
+
isMatrix: true,
|
|
2393
|
+
parameterDescriptors: [valueForSParameterDescriptor, exclusionNoneParameterDescriptor, tweakParameterDescriptor]
|
|
2394
|
+
})], _a5) {
|
|
2188
2395
|
constructor(appExtension, characterSetCreator) {
|
|
2189
2396
|
super(appExtension, characterSetCreator);
|
|
2190
|
-
|
|
2397
|
+
__runInitializers(_init5, 5, this);
|
|
2398
|
+
__privateAdd(this, _characterSetCreator);
|
|
2399
|
+
__privateSet(this, _characterSetCreator, characterSetCreator);
|
|
2191
2400
|
}
|
|
2192
2401
|
create(length, matrixValues, exclusion, tweak) {
|
|
2193
2402
|
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2194
2403
|
const tweakOrUndefined = tweak ?? void 0;
|
|
2195
|
-
return this.mapMatrix(matrixValues, (value) => this
|
|
2404
|
+
return this.mapMatrix(matrixValues, (value) => __privateGet(this, _characterSetCreator).create(length, value, exclusionOrUndefined, tweakOrUndefined));
|
|
2196
2405
|
}
|
|
2197
2406
|
createSequence(length, startValue, count, exclusion, tweak) {
|
|
2198
2407
|
this.appExtension.validateSequenceCount(count);
|
|
2199
2408
|
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2200
2409
|
const tweakOrUndefined = tweak ?? void 0;
|
|
2201
|
-
return LibProxy.matrixResult(this
|
|
2410
|
+
return LibProxy.matrixResult(__privateGet(this, _characterSetCreator).create(length, new import_utility5.Sequence(startValue, count), exclusionOrUndefined, tweakOrUndefined));
|
|
2202
2411
|
}
|
|
2203
2412
|
valueFor(matrixSs, exclusion, tweak) {
|
|
2204
2413
|
const exclusionOrUndefined = exclusion ?? void 0;
|
|
2205
2414
|
const tweakOrUndefined = tweak ?? void 0;
|
|
2206
|
-
return this.mapMatrix(matrixSs, (s) => this.mapBigInt(this
|
|
2207
|
-
}
|
|
2208
|
-
};
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
2228
|
-
__decorateParam(3, ProxyParameter(exclusionNoneParameterDescriptor)),
|
|
2229
|
-
__decorateParam(4, ProxyParameter(tweakParameterDescriptor))
|
|
2230
|
-
], CharacterSetCreatorProxy.prototype, "createSequence", 1);
|
|
2231
|
-
__decorateClass([
|
|
2232
|
-
ProxyMethod({
|
|
2233
|
-
type: Types.Number,
|
|
2234
|
-
isMatrix: true
|
|
2235
|
-
}),
|
|
2236
|
-
__decorateParam(0, ProxyParameter(valueForSParameterDescriptor)),
|
|
2237
|
-
__decorateParam(1, ProxyParameter(exclusionNoneParameterDescriptor)),
|
|
2238
|
-
__decorateParam(2, ProxyParameter(tweakParameterDescriptor))
|
|
2239
|
-
], CharacterSetCreatorProxy.prototype, "valueFor", 1);
|
|
2240
|
-
var NumericProxy = class extends CharacterSetCreatorProxy {
|
|
2415
|
+
return this.mapMatrix(matrixSs, (s) => this.mapBigInt(__privateGet(this, _characterSetCreator).valueFor(s, exclusionOrUndefined, tweakOrUndefined)));
|
|
2416
|
+
}
|
|
2417
|
+
};
|
|
2418
|
+
_init5 = __decoratorStart(_a5);
|
|
2419
|
+
_characterSetCreator = new WeakMap();
|
|
2420
|
+
__decorateElement(_init5, 1, "create", _create_dec, CharacterSetCreatorProxy);
|
|
2421
|
+
__decorateElement(_init5, 1, "createSequence", _createSequence_dec, CharacterSetCreatorProxy);
|
|
2422
|
+
__decorateElement(_init5, 1, "valueFor", _valueFor_dec, CharacterSetCreatorProxy);
|
|
2423
|
+
CharacterSetCreatorProxy = __decorateElement(_init5, 0, "CharacterSetCreatorProxy", _CharacterSetCreatorProxy_decorators, CharacterSetCreatorProxy);
|
|
2424
|
+
__runInitializers(_init5, 1, CharacterSetCreatorProxy);
|
|
2425
|
+
var _NumericProxy_decorators, _init6, _a6;
|
|
2426
|
+
_NumericProxy_decorators = [proxy.describeClass(false, {
|
|
2427
|
+
methodInfix: "Numeric",
|
|
2428
|
+
replaceParameterDescriptors: [
|
|
2429
|
+
{
|
|
2430
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2431
|
+
replacement: exclusionFirstZeroParameterDescriptor
|
|
2432
|
+
}
|
|
2433
|
+
]
|
|
2434
|
+
})];
|
|
2435
|
+
var NumericProxy = class extends (_a6 = CharacterSetCreatorProxy) {
|
|
2241
2436
|
constructor(appExtension) {
|
|
2242
2437
|
super(appExtension, import_utility5.NUMERIC_CREATOR);
|
|
2243
2438
|
}
|
|
2244
2439
|
};
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2440
|
+
_init6 = __decoratorStart(_a6);
|
|
2441
|
+
NumericProxy = __decorateElement(_init6, 0, "NumericProxy", _NumericProxy_decorators, NumericProxy);
|
|
2442
|
+
__runInitializers(_init6, 1, NumericProxy);
|
|
2443
|
+
var _HexadecimalProxy_decorators, _init7, _a7;
|
|
2444
|
+
_HexadecimalProxy_decorators = [proxy.describeClass(false, {
|
|
2445
|
+
methodInfix: "Hexadecimal",
|
|
2446
|
+
replaceParameterDescriptors: [
|
|
2447
|
+
{
|
|
2448
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2449
|
+
replacement: exclusionAnyParameterDescriptor
|
|
2450
|
+
}
|
|
2451
|
+
]
|
|
2452
|
+
})];
|
|
2453
|
+
var HexadecimalProxy = class extends (_a7 = CharacterSetCreatorProxy) {
|
|
2257
2454
|
constructor(appExtension) {
|
|
2258
2455
|
super(appExtension, import_utility5.HEXADECIMAL_CREATOR);
|
|
2259
2456
|
}
|
|
2260
2457
|
};
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
]
|
|
2270
|
-
})
|
|
2271
|
-
], HexadecimalProxy);
|
|
2272
|
-
var AlphabeticProxy = class extends CharacterSetCreatorProxy {
|
|
2458
|
+
_init7 = __decoratorStart(_a7);
|
|
2459
|
+
HexadecimalProxy = __decorateElement(_init7, 0, "HexadecimalProxy", _HexadecimalProxy_decorators, HexadecimalProxy);
|
|
2460
|
+
__runInitializers(_init7, 1, HexadecimalProxy);
|
|
2461
|
+
var _AlphabeticProxy_decorators, _init8, _a8;
|
|
2462
|
+
_AlphabeticProxy_decorators = [proxy.describeClass(false, {
|
|
2463
|
+
methodInfix: "Alphabetic"
|
|
2464
|
+
})];
|
|
2465
|
+
var AlphabeticProxy = class extends (_a8 = CharacterSetCreatorProxy) {
|
|
2273
2466
|
constructor(appExtension) {
|
|
2274
2467
|
super(appExtension, import_utility5.ALPHABETIC_CREATOR);
|
|
2275
2468
|
}
|
|
2276
2469
|
};
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2470
|
+
_init8 = __decoratorStart(_a8);
|
|
2471
|
+
AlphabeticProxy = __decorateElement(_init8, 0, "AlphabeticProxy", _AlphabeticProxy_decorators, AlphabeticProxy);
|
|
2472
|
+
__runInitializers(_init8, 1, AlphabeticProxy);
|
|
2473
|
+
var _AlphanumericProxy_decorators, _init9, _a9;
|
|
2474
|
+
_AlphanumericProxy_decorators = [proxy.describeClass(false, {
|
|
2475
|
+
methodInfix: "Alphanumeric",
|
|
2476
|
+
replaceParameterDescriptors: [
|
|
2477
|
+
{
|
|
2478
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2479
|
+
replacement: exclusionAnyParameterDescriptor
|
|
2480
|
+
}
|
|
2481
|
+
]
|
|
2482
|
+
})];
|
|
2483
|
+
var AlphanumericProxy = class extends (_a9 = CharacterSetCreatorProxy) {
|
|
2283
2484
|
constructor(appExtension) {
|
|
2284
2485
|
super(appExtension, import_utility5.ALPHANUMERIC_CREATOR);
|
|
2285
2486
|
}
|
|
2286
2487
|
};
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
replaceParameterDescriptors: [
|
|
2291
|
-
{
|
|
2292
|
-
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2293
|
-
replacement: exclusionAnyParameterDescriptor
|
|
2294
|
-
}
|
|
2295
|
-
]
|
|
2296
|
-
})
|
|
2297
|
-
], AlphanumericProxy);
|
|
2488
|
+
_init9 = __decoratorStart(_a9);
|
|
2489
|
+
AlphanumericProxy = __decorateElement(_init9, 0, "AlphanumericProxy", _AlphanumericProxy_decorators, AlphanumericProxy);
|
|
2490
|
+
__runInitializers(_init9, 1, AlphanumericProxy);
|
|
2298
2491
|
|
|
2299
2492
|
// src/gs1/index.ts
|
|
2300
2493
|
var gs1_exports = {};
|
|
@@ -2335,51 +2528,57 @@ __export(gs1_exports, {
|
|
|
2335
2528
|
|
|
2336
2529
|
// src/gs1/character-set-proxy.ts
|
|
2337
2530
|
var import_gs12 = require("@aidc-toolkit/gs1");
|
|
2338
|
-
var
|
|
2531
|
+
var _AI82Proxy_decorators, _init10, _a10;
|
|
2532
|
+
_AI82Proxy_decorators = [proxy.describeClass(false, {
|
|
2533
|
+
namespace: "GS1",
|
|
2534
|
+
methodInfix: "AI82",
|
|
2535
|
+
replaceParameterDescriptors: [
|
|
2536
|
+
{
|
|
2537
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2538
|
+
replacement: exclusionAllNumericParameterDescriptor
|
|
2539
|
+
}
|
|
2540
|
+
]
|
|
2541
|
+
})];
|
|
2542
|
+
var AI82Proxy = class extends (_a10 = CharacterSetCreatorProxy) {
|
|
2339
2543
|
constructor(appExtension) {
|
|
2340
2544
|
super(appExtension, import_gs12.AI82_CREATOR);
|
|
2341
2545
|
}
|
|
2342
2546
|
};
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2547
|
+
_init10 = __decoratorStart(_a10);
|
|
2548
|
+
AI82Proxy = __decorateElement(_init10, 0, "AI82Proxy", _AI82Proxy_decorators, AI82Proxy);
|
|
2549
|
+
__runInitializers(_init10, 1, AI82Proxy);
|
|
2550
|
+
var _AI39Proxy_decorators, _init11, _a11;
|
|
2551
|
+
_AI39Proxy_decorators = [proxy.describeClass(false, {
|
|
2552
|
+
namespace: "GS1",
|
|
2553
|
+
methodInfix: "AI39",
|
|
2554
|
+
replaceParameterDescriptors: [
|
|
2555
|
+
{
|
|
2556
|
+
name: expandParameterDescriptor(exclusionNoneParameterDescriptor).name,
|
|
2557
|
+
replacement: exclusionAllNumericParameterDescriptor
|
|
2558
|
+
}
|
|
2559
|
+
]
|
|
2560
|
+
})];
|
|
2561
|
+
var AI39Proxy = class extends (_a11 = CharacterSetCreatorProxy) {
|
|
2356
2562
|
constructor(appExtension) {
|
|
2357
2563
|
super(appExtension, import_gs12.AI39_CREATOR);
|
|
2358
2564
|
}
|
|
2359
2565
|
};
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
]
|
|
2370
|
-
})
|
|
2371
|
-
], AI39Proxy);
|
|
2372
|
-
var AI64Proxy = class extends CharacterSetValidatorProxy {
|
|
2566
|
+
_init11 = __decoratorStart(_a11);
|
|
2567
|
+
AI39Proxy = __decorateElement(_init11, 0, "AI39Proxy", _AI39Proxy_decorators, AI39Proxy);
|
|
2568
|
+
__runInitializers(_init11, 1, AI39Proxy);
|
|
2569
|
+
var _AI64Proxy_decorators, _init12, _a12;
|
|
2570
|
+
_AI64Proxy_decorators = [proxy.describeClass(false, {
|
|
2571
|
+
namespace: "GS1",
|
|
2572
|
+
methodInfix: "AI64"
|
|
2573
|
+
})];
|
|
2574
|
+
var AI64Proxy = class extends (_a12 = CharacterSetValidatorProxy) {
|
|
2373
2575
|
constructor(appExtension) {
|
|
2374
2576
|
super(appExtension, import_gs12.AI64_VALIDATOR);
|
|
2375
2577
|
}
|
|
2376
2578
|
};
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
methodInfix: "AI64"
|
|
2381
|
-
})
|
|
2382
|
-
], AI64Proxy);
|
|
2579
|
+
_init12 = __decoratorStart(_a12);
|
|
2580
|
+
AI64Proxy = __decorateElement(_init12, 0, "AI64Proxy", _AI64Proxy_decorators, AI64Proxy);
|
|
2581
|
+
__runInitializers(_init12, 1, AI64Proxy);
|
|
2383
2582
|
|
|
2384
2583
|
// src/gs1/check-proxy.ts
|
|
2385
2584
|
var import_gs13 = require("@aidc-toolkit/gs1");
|
|
@@ -2417,7 +2616,42 @@ var ai82SWithCheckCharacterPairParameterDescriptor = {
|
|
|
2417
2616
|
extendsDescriptor: ai82SParameterDescriptor,
|
|
2418
2617
|
name: "ai82SWithCheckCharacterPair"
|
|
2419
2618
|
};
|
|
2420
|
-
var
|
|
2619
|
+
var _hasValidCheckCharacterPair_dec, _checkCharacterPair_dec, _isValidPriceOrWeightCheckDigit_dec, _priceOrWeightCheckDigit_dec, _hasValidCheckDigit_dec, _checkDigit_dec, _a13, _CheckProxy_decorators, _init13;
|
|
2620
|
+
_CheckProxy_decorators = [proxy.describeClass(false, {
|
|
2621
|
+
namespace: "GS1"
|
|
2622
|
+
})];
|
|
2623
|
+
var CheckProxy = class extends (_a13 = LibProxy, _checkDigit_dec = [proxy.describeMethod({
|
|
2624
|
+
type: Types.String,
|
|
2625
|
+
isMatrix: true,
|
|
2626
|
+
parameterDescriptors: [numericSParameterDescriptor]
|
|
2627
|
+
})], _hasValidCheckDigit_dec = [proxy.describeMethod({
|
|
2628
|
+
type: Types.String,
|
|
2629
|
+
isMatrix: true,
|
|
2630
|
+
parameterDescriptors: [numericSWithCheckDigitParameterDescriptor]
|
|
2631
|
+
})], _priceOrWeightCheckDigit_dec = [proxy.describeMethod({
|
|
2632
|
+
type: Types.String,
|
|
2633
|
+
isMatrix: true,
|
|
2634
|
+
parameterDescriptors: [numericSFourOrFiveDigitsParameterDescriptor]
|
|
2635
|
+
})], _isValidPriceOrWeightCheckDigit_dec = [proxy.describeMethod({
|
|
2636
|
+
type: Types.String,
|
|
2637
|
+
isMatrix: false,
|
|
2638
|
+
parameterDescriptors: [{
|
|
2639
|
+
...numericSFourOrFiveDigitsParameterDescriptor,
|
|
2640
|
+
isMatrix: false
|
|
2641
|
+
}, checkDigitParameterDescriptor]
|
|
2642
|
+
})], _checkCharacterPair_dec = [proxy.describeMethod({
|
|
2643
|
+
type: Types.String,
|
|
2644
|
+
isMatrix: true,
|
|
2645
|
+
parameterDescriptors: [ai82SParameterDescriptor]
|
|
2646
|
+
})], _hasValidCheckCharacterPair_dec = [proxy.describeMethod({
|
|
2647
|
+
type: Types.String,
|
|
2648
|
+
isMatrix: true,
|
|
2649
|
+
parameterDescriptors: [ai82SWithCheckCharacterPairParameterDescriptor]
|
|
2650
|
+
})], _a13) {
|
|
2651
|
+
constructor() {
|
|
2652
|
+
super(...arguments);
|
|
2653
|
+
__runInitializers(_init13, 5, this);
|
|
2654
|
+
}
|
|
2421
2655
|
checkDigit(matrixSs) {
|
|
2422
2656
|
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.checkDigit)(s));
|
|
2423
2657
|
}
|
|
@@ -2437,62 +2671,46 @@ var CheckProxy = class extends LibProxy {
|
|
|
2437
2671
|
return this.mapMatrix(matrixSs, (s) => (0, import_gs13.hasValidCheckCharacterPair)(s));
|
|
2438
2672
|
}
|
|
2439
2673
|
};
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
type: Types.String,
|
|
2450
|
-
isMatrix: true
|
|
2451
|
-
}),
|
|
2452
|
-
__decorateParam(0, ProxyParameter(numericSWithCheckDigitParameterDescriptor))
|
|
2453
|
-
], CheckProxy.prototype, "hasValidCheckDigit", 1);
|
|
2454
|
-
__decorateClass([
|
|
2455
|
-
ProxyMethod({
|
|
2456
|
-
type: Types.String,
|
|
2457
|
-
isMatrix: true
|
|
2458
|
-
}),
|
|
2459
|
-
__decorateParam(0, ProxyParameter(numericSFourOrFiveDigitsParameterDescriptor))
|
|
2460
|
-
], CheckProxy.prototype, "priceOrWeightCheckDigit", 1);
|
|
2461
|
-
__decorateClass([
|
|
2462
|
-
ProxyMethod({
|
|
2463
|
-
type: Types.String,
|
|
2464
|
-
isMatrix: false
|
|
2465
|
-
}),
|
|
2466
|
-
__decorateParam(0, ProxyParameter({
|
|
2467
|
-
...numericSFourOrFiveDigitsParameterDescriptor,
|
|
2468
|
-
isMatrix: false
|
|
2469
|
-
})),
|
|
2470
|
-
__decorateParam(1, ProxyParameter(checkDigitParameterDescriptor))
|
|
2471
|
-
], CheckProxy.prototype, "isValidPriceOrWeightCheckDigit", 1);
|
|
2472
|
-
__decorateClass([
|
|
2473
|
-
ProxyMethod({
|
|
2474
|
-
type: Types.String,
|
|
2475
|
-
isMatrix: true
|
|
2476
|
-
}),
|
|
2477
|
-
__decorateParam(0, ProxyParameter(ai82SParameterDescriptor))
|
|
2478
|
-
], CheckProxy.prototype, "checkCharacterPair", 1);
|
|
2479
|
-
__decorateClass([
|
|
2480
|
-
ProxyMethod({
|
|
2481
|
-
type: Types.String,
|
|
2482
|
-
isMatrix: true
|
|
2483
|
-
}),
|
|
2484
|
-
__decorateParam(0, ProxyParameter(ai82SWithCheckCharacterPairParameterDescriptor))
|
|
2485
|
-
], CheckProxy.prototype, "hasValidCheckCharacterPair", 1);
|
|
2486
|
-
CheckProxy = __decorateClass([
|
|
2487
|
-
ProxyClass({
|
|
2488
|
-
namespace: "GS1"
|
|
2489
|
-
})
|
|
2490
|
-
], CheckProxy);
|
|
2674
|
+
_init13 = __decoratorStart(_a13);
|
|
2675
|
+
__decorateElement(_init13, 1, "checkDigit", _checkDigit_dec, CheckProxy);
|
|
2676
|
+
__decorateElement(_init13, 1, "hasValidCheckDigit", _hasValidCheckDigit_dec, CheckProxy);
|
|
2677
|
+
__decorateElement(_init13, 1, "priceOrWeightCheckDigit", _priceOrWeightCheckDigit_dec, CheckProxy);
|
|
2678
|
+
__decorateElement(_init13, 1, "isValidPriceOrWeightCheckDigit", _isValidPriceOrWeightCheckDigit_dec, CheckProxy);
|
|
2679
|
+
__decorateElement(_init13, 1, "checkCharacterPair", _checkCharacterPair_dec, CheckProxy);
|
|
2680
|
+
__decorateElement(_init13, 1, "hasValidCheckCharacterPair", _hasValidCheckCharacterPair_dec, CheckProxy);
|
|
2681
|
+
CheckProxy = __decorateElement(_init13, 0, "CheckProxy", _CheckProxy_decorators, CheckProxy);
|
|
2682
|
+
__runInitializers(_init13, 1, CheckProxy);
|
|
2491
2683
|
|
|
2492
|
-
// src/gs1/
|
|
2493
|
-
var import_core3 = require("@aidc-toolkit/core");
|
|
2684
|
+
// src/gs1/gtin-validator-proxy.ts
|
|
2494
2685
|
var import_gs14 = require("@aidc-toolkit/gs1");
|
|
2495
|
-
|
|
2686
|
+
|
|
2687
|
+
// src/gs1/gtin-descriptor.ts
|
|
2688
|
+
var indicatorDigitParameterDescriptor = {
|
|
2689
|
+
name: "indicatorDigit",
|
|
2690
|
+
type: Types.String,
|
|
2691
|
+
isMatrix: false,
|
|
2692
|
+
isRequired: true
|
|
2693
|
+
};
|
|
2694
|
+
var rcnFormatParameterDescriptor = {
|
|
2695
|
+
name: "rcnFormat",
|
|
2696
|
+
type: Types.String,
|
|
2697
|
+
isMatrix: false,
|
|
2698
|
+
isRequired: true
|
|
2699
|
+
};
|
|
2700
|
+
var rcnItemReferenceParameterDescriptor = {
|
|
2701
|
+
name: "rcnItemReference",
|
|
2702
|
+
type: Types.Number,
|
|
2703
|
+
isMatrix: false,
|
|
2704
|
+
isRequired: true
|
|
2705
|
+
};
|
|
2706
|
+
var rcnPriceOrWeightParameterDescriptor = {
|
|
2707
|
+
name: "rcnPriceOrWeight",
|
|
2708
|
+
type: Types.Number,
|
|
2709
|
+
isMatrix: true,
|
|
2710
|
+
isRequired: true
|
|
2711
|
+
};
|
|
2712
|
+
|
|
2713
|
+
// src/gs1/identifier-validator-proxy.ts
|
|
2496
2714
|
var identifierParameterDescriptor = {
|
|
2497
2715
|
name: "identifier",
|
|
2498
2716
|
type: Types.String,
|
|
@@ -2505,81 +2723,108 @@ var validateIdentifierParameterDescriptor = {
|
|
|
2505
2723
|
name: "validateIdentifier"
|
|
2506
2724
|
};
|
|
2507
2725
|
var IdentifierValidatorProxy = class extends StringProxy {
|
|
2508
|
-
|
|
2726
|
+
#validator;
|
|
2509
2727
|
constructor(appExtension, validator) {
|
|
2510
2728
|
super(appExtension);
|
|
2511
|
-
this
|
|
2729
|
+
this.#validator = validator;
|
|
2512
2730
|
}
|
|
2513
2731
|
get validator() {
|
|
2514
|
-
return this
|
|
2732
|
+
return this.#validator;
|
|
2515
2733
|
}
|
|
2516
2734
|
};
|
|
2517
|
-
var
|
|
2735
|
+
var _validate_dec3, _a14, _NumericIdentifierValidatorProxy_decorators, _init14;
|
|
2736
|
+
_NumericIdentifierValidatorProxy_decorators = [proxy.describeClass(true, {
|
|
2737
|
+
namespace: "GS1"
|
|
2738
|
+
})];
|
|
2739
|
+
var NumericIdentifierValidatorProxy = class extends (_a14 = IdentifierValidatorProxy, _validate_dec3 = [proxy.describeMethod({
|
|
2740
|
+
type: Types.String,
|
|
2741
|
+
isMatrix: true,
|
|
2742
|
+
parameterDescriptors: [validateIdentifierParameterDescriptor]
|
|
2743
|
+
})], _a14) {
|
|
2744
|
+
constructor() {
|
|
2745
|
+
super(...arguments);
|
|
2746
|
+
__runInitializers(_init14, 5, this);
|
|
2747
|
+
}
|
|
2518
2748
|
validate(matrixIdentifiers) {
|
|
2519
2749
|
return this.validateString(this.validator, matrixIdentifiers);
|
|
2520
2750
|
}
|
|
2521
2751
|
};
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
}),
|
|
2527
|
-
__decorateParam(0, ProxyParameter(validateIdentifierParameterDescriptor))
|
|
2528
|
-
], NumericIdentifierValidatorProxy.prototype, "validate", 1);
|
|
2752
|
+
_init14 = __decoratorStart(_a14);
|
|
2753
|
+
__decorateElement(_init14, 1, "validate", _validate_dec3, NumericIdentifierValidatorProxy);
|
|
2754
|
+
NumericIdentifierValidatorProxy = __decorateElement(_init14, 0, "NumericIdentifierValidatorProxy", _NumericIdentifierValidatorProxy_decorators, NumericIdentifierValidatorProxy);
|
|
2755
|
+
__runInitializers(_init14, 1, NumericIdentifierValidatorProxy);
|
|
2529
2756
|
var GTINValidatorProxy = class extends NumericIdentifierValidatorProxy {
|
|
2530
2757
|
};
|
|
2531
2758
|
var NonGTINNumericIdentifierValidatorProxy = class extends NumericIdentifierValidatorProxy {
|
|
2532
2759
|
};
|
|
2760
|
+
var NonSerializableNumericIdentifierValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2761
|
+
};
|
|
2533
2762
|
var SerializableNumericIdentifierValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2534
2763
|
};
|
|
2535
|
-
var
|
|
2764
|
+
var _validate_dec4, _a15, _NonNumericIdentifierValidatorProxy_decorators, _init15;
|
|
2765
|
+
_NonNumericIdentifierValidatorProxy_decorators = [proxy.describeClass(true, {
|
|
2766
|
+
namespace: "GS1"
|
|
2767
|
+
})];
|
|
2768
|
+
var NonNumericIdentifierValidatorProxy = class extends (_a15 = IdentifierValidatorProxy, _validate_dec4 = [proxy.describeMethod({
|
|
2769
|
+
type: Types.String,
|
|
2770
|
+
isMatrix: true,
|
|
2771
|
+
parameterDescriptors: [validateIdentifierParameterDescriptor, exclusionAllNumericParameterDescriptor]
|
|
2772
|
+
})], _a15) {
|
|
2773
|
+
constructor() {
|
|
2774
|
+
super(...arguments);
|
|
2775
|
+
__runInitializers(_init15, 5, this);
|
|
2776
|
+
}
|
|
2536
2777
|
validate(matrixIdentifiers, exclusion) {
|
|
2537
2778
|
return this.validateString(this.validator, matrixIdentifiers, {
|
|
2538
2779
|
exclusion: exclusion ?? void 0
|
|
2539
2780
|
});
|
|
2540
2781
|
}
|
|
2541
2782
|
};
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2783
|
+
_init15 = __decoratorStart(_a15);
|
|
2784
|
+
__decorateElement(_init15, 1, "validate", _validate_dec4, NonNumericIdentifierValidatorProxy);
|
|
2785
|
+
NonNumericIdentifierValidatorProxy = __decorateElement(_init15, 0, "NonNumericIdentifierValidatorProxy", _NonNumericIdentifierValidatorProxy_decorators, NonNumericIdentifierValidatorProxy);
|
|
2786
|
+
__runInitializers(_init15, 1, NonNumericIdentifierValidatorProxy);
|
|
2787
|
+
|
|
2788
|
+
// src/gs1/gtin-validator-proxy.ts
|
|
2789
|
+
var _GTIN13ValidatorProxy_decorators, _init16, _a16;
|
|
2790
|
+
_GTIN13ValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2791
|
+
namespace: "GS1",
|
|
2792
|
+
methodInfix: "GTIN13"
|
|
2793
|
+
})];
|
|
2794
|
+
var GTIN13ValidatorProxy = class extends (_a16 = GTINValidatorProxy) {
|
|
2551
2795
|
constructor(appExtension) {
|
|
2552
|
-
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.
|
|
2553
|
-
}
|
|
2554
|
-
};
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2796
|
+
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.GTINLengths.GTIN13]);
|
|
2797
|
+
}
|
|
2798
|
+
};
|
|
2799
|
+
_init16 = __decoratorStart(_a16);
|
|
2800
|
+
GTIN13ValidatorProxy = __decorateElement(_init16, 0, "GTIN13ValidatorProxy", _GTIN13ValidatorProxy_decorators, GTIN13ValidatorProxy);
|
|
2801
|
+
__runInitializers(_init16, 1, GTIN13ValidatorProxy);
|
|
2802
|
+
var _GTIN12ValidatorProxy_decorators, _init17, _a17;
|
|
2803
|
+
_GTIN12ValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2804
|
+
namespace: "GS1",
|
|
2805
|
+
methodInfix: "GTIN12"
|
|
2806
|
+
})];
|
|
2807
|
+
var GTIN12ValidatorProxy = class extends (_a17 = GTINValidatorProxy) {
|
|
2562
2808
|
constructor(appExtension) {
|
|
2563
|
-
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.
|
|
2564
|
-
}
|
|
2565
|
-
};
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2809
|
+
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.GTINLengths.GTIN12]);
|
|
2810
|
+
}
|
|
2811
|
+
};
|
|
2812
|
+
_init17 = __decoratorStart(_a17);
|
|
2813
|
+
GTIN12ValidatorProxy = __decorateElement(_init17, 0, "GTIN12ValidatorProxy", _GTIN12ValidatorProxy_decorators, GTIN12ValidatorProxy);
|
|
2814
|
+
__runInitializers(_init17, 1, GTIN12ValidatorProxy);
|
|
2815
|
+
var _GTIN8ValidatorProxy_decorators, _init18, _a18;
|
|
2816
|
+
_GTIN8ValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2817
|
+
namespace: "GS1",
|
|
2818
|
+
methodInfix: "GTIN8"
|
|
2819
|
+
})];
|
|
2820
|
+
var GTIN8ValidatorProxy = class extends (_a18 = GTINValidatorProxy) {
|
|
2573
2821
|
constructor(appExtension) {
|
|
2574
|
-
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.
|
|
2822
|
+
super(appExtension, import_gs14.IdentifierValidators.GTIN[import_gs14.GTINLengths.GTIN8]);
|
|
2575
2823
|
}
|
|
2576
2824
|
};
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
methodInfix: "GTIN8"
|
|
2581
|
-
})
|
|
2582
|
-
], GTIN8ValidatorProxy);
|
|
2825
|
+
_init18 = __decoratorStart(_a18);
|
|
2826
|
+
GTIN8ValidatorProxy = __decorateElement(_init18, 0, "GTIN8ValidatorProxy", _GTIN8ValidatorProxy_decorators, GTIN8ValidatorProxy);
|
|
2827
|
+
__runInitializers(_init18, 1, GTIN8ValidatorProxy);
|
|
2583
2828
|
var zeroSuppressibleGTIN12ParameterDescriptor = {
|
|
2584
2829
|
extendsDescriptor: identifierParameterDescriptor,
|
|
2585
2830
|
name: "zeroSuppressibleGTIN12"
|
|
@@ -2588,12 +2833,6 @@ var zeroSuppressedGTIN12ParameterDescriptor = {
|
|
|
2588
2833
|
extendsDescriptor: identifierParameterDescriptor,
|
|
2589
2834
|
name: "zeroSuppressedGTIN12"
|
|
2590
2835
|
};
|
|
2591
|
-
var indicatorDigitParameterDescriptor = {
|
|
2592
|
-
name: "indicatorDigit",
|
|
2593
|
-
type: Types.String,
|
|
2594
|
-
isMatrix: false,
|
|
2595
|
-
isRequired: true
|
|
2596
|
-
};
|
|
2597
2836
|
var convertGTINParameterDescriptor = {
|
|
2598
2837
|
extendsDescriptor: identifierParameterDescriptor,
|
|
2599
2838
|
name: "convertGTIN"
|
|
@@ -2616,31 +2855,49 @@ var validateGTIN14ParameterDescriptor = {
|
|
|
2616
2855
|
extendsDescriptor: identifierParameterDescriptor,
|
|
2617
2856
|
name: "validateGTIN14"
|
|
2618
2857
|
};
|
|
2619
|
-
var rcnFormatParameterDescriptor = {
|
|
2620
|
-
name: "rcnFormat",
|
|
2621
|
-
type: Types.String,
|
|
2622
|
-
isMatrix: false,
|
|
2623
|
-
isRequired: true
|
|
2624
|
-
};
|
|
2625
2858
|
var rcnParameterDescriptor = {
|
|
2626
2859
|
name: "rcn",
|
|
2627
2860
|
type: Types.String,
|
|
2628
2861
|
isMatrix: true,
|
|
2629
2862
|
isRequired: true
|
|
2630
2863
|
};
|
|
2631
|
-
var
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2864
|
+
var _parseVariableMeasureRCN_dec, _validateGTIN14_dec, _validateGTIN_dec, _normalizeGTIN_dec, _convertToGTIN14_dec, _zeroExpandGTIN12_dec, _zeroSuppressGTIN12_dec, _a19, _GTINValidatorStaticProxy_decorators, _init19;
|
|
2865
|
+
_GTINValidatorStaticProxy_decorators = [proxy.describeClass(false, {
|
|
2866
|
+
namespace: "GS1"
|
|
2867
|
+
})];
|
|
2868
|
+
var GTINValidatorStaticProxy = class extends (_a19 = LibProxy, _zeroSuppressGTIN12_dec = [proxy.describeMethod({
|
|
2869
|
+
type: Types.String,
|
|
2870
|
+
isMatrix: true,
|
|
2871
|
+
parameterDescriptors: [zeroSuppressibleGTIN12ParameterDescriptor]
|
|
2872
|
+
})], _zeroExpandGTIN12_dec = [proxy.describeMethod({
|
|
2873
|
+
type: Types.String,
|
|
2874
|
+
isMatrix: true,
|
|
2875
|
+
parameterDescriptors: [zeroSuppressedGTIN12ParameterDescriptor]
|
|
2876
|
+
})], _convertToGTIN14_dec = [proxy.describeMethod({
|
|
2877
|
+
type: Types.String,
|
|
2878
|
+
isMatrix: true,
|
|
2879
|
+
parameterDescriptors: [indicatorDigitParameterDescriptor, convertGTINParameterDescriptor]
|
|
2880
|
+
})], _normalizeGTIN_dec = [proxy.describeMethod({
|
|
2881
|
+
type: Types.String,
|
|
2882
|
+
isMatrix: true,
|
|
2883
|
+
parameterDescriptors: [normalizeGTINParameterDescriptor]
|
|
2884
|
+
})], _validateGTIN_dec = [proxy.describeMethod({
|
|
2885
|
+
type: Types.String,
|
|
2886
|
+
isMatrix: true,
|
|
2887
|
+
parameterDescriptors: [validateGTINParameterDescriptor, gtinLevelParameterDescriptor]
|
|
2888
|
+
})], _validateGTIN14_dec = [proxy.describeMethod({
|
|
2889
|
+
type: Types.String,
|
|
2890
|
+
isMatrix: true,
|
|
2891
|
+
parameterDescriptors: [validateGTIN14ParameterDescriptor]
|
|
2892
|
+
})], _parseVariableMeasureRCN_dec = [proxy.describeMethod({
|
|
2639
2893
|
type: Types.Number,
|
|
2640
2894
|
isMatrix: true,
|
|
2641
|
-
|
|
2642
|
-
}
|
|
2643
|
-
|
|
2895
|
+
parameterDescriptors: [rcnFormatParameterDescriptor, rcnParameterDescriptor]
|
|
2896
|
+
})], _a19) {
|
|
2897
|
+
constructor() {
|
|
2898
|
+
super(...arguments);
|
|
2899
|
+
__runInitializers(_init19, 5, this);
|
|
2900
|
+
}
|
|
2644
2901
|
zeroSuppressGTIN12(matrixGTIN12s) {
|
|
2645
2902
|
return this.mapMatrix(matrixGTIN12s, (gtin12) => import_gs14.GTINValidator.zeroSuppress(gtin12));
|
|
2646
2903
|
}
|
|
@@ -2671,184 +2928,164 @@ var GTINValidatorStaticProxy = class extends LibProxy {
|
|
|
2671
2928
|
});
|
|
2672
2929
|
}
|
|
2673
2930
|
};
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
__decorateParam(0, ProxyParameter(indicatorDigitParameterDescriptor)),
|
|
2694
|
-
__decorateParam(1, ProxyParameter(convertGTINParameterDescriptor))
|
|
2695
|
-
], GTINValidatorStaticProxy.prototype, "convertToGTIN14", 1);
|
|
2696
|
-
__decorateClass([
|
|
2697
|
-
ProxyMethod({
|
|
2698
|
-
type: Types.String,
|
|
2699
|
-
isMatrix: true
|
|
2700
|
-
}),
|
|
2701
|
-
__decorateParam(0, ProxyParameter(normalizeGTINParameterDescriptor))
|
|
2702
|
-
], GTINValidatorStaticProxy.prototype, "normalizeGTIN", 1);
|
|
2703
|
-
__decorateClass([
|
|
2704
|
-
ProxyMethod({
|
|
2705
|
-
type: Types.String,
|
|
2706
|
-
isMatrix: true
|
|
2707
|
-
}),
|
|
2708
|
-
__decorateParam(0, ProxyParameter(validateGTINParameterDescriptor)),
|
|
2709
|
-
__decorateParam(1, ProxyParameter(gtinLevelParameterDescriptor))
|
|
2710
|
-
], GTINValidatorStaticProxy.prototype, "validateGTIN", 1);
|
|
2711
|
-
__decorateClass([
|
|
2712
|
-
ProxyMethod({
|
|
2713
|
-
type: Types.String,
|
|
2714
|
-
isMatrix: true
|
|
2715
|
-
}),
|
|
2716
|
-
__decorateParam(0, ProxyParameter(validateGTIN14ParameterDescriptor))
|
|
2717
|
-
], GTINValidatorStaticProxy.prototype, "validateGTIN14", 1);
|
|
2718
|
-
__decorateClass([
|
|
2719
|
-
ProxyMethod({
|
|
2720
|
-
type: Types.Number,
|
|
2721
|
-
isMatrix: true
|
|
2722
|
-
}),
|
|
2723
|
-
__decorateParam(0, ProxyParameter(rcnFormatParameterDescriptor)),
|
|
2724
|
-
__decorateParam(1, ProxyParameter(rcnParameterDescriptor))
|
|
2725
|
-
], GTINValidatorStaticProxy.prototype, "parseVariableMeasureRCN", 1);
|
|
2726
|
-
GTINValidatorStaticProxy = __decorateClass([
|
|
2727
|
-
ProxyClass({
|
|
2728
|
-
namespace: "GS1"
|
|
2729
|
-
})
|
|
2730
|
-
], GTINValidatorStaticProxy);
|
|
2731
|
-
var GLNValidatorProxy = class extends NonGTINNumericIdentifierValidatorProxy {
|
|
2931
|
+
_init19 = __decoratorStart(_a19);
|
|
2932
|
+
__decorateElement(_init19, 1, "zeroSuppressGTIN12", _zeroSuppressGTIN12_dec, GTINValidatorStaticProxy);
|
|
2933
|
+
__decorateElement(_init19, 1, "zeroExpandGTIN12", _zeroExpandGTIN12_dec, GTINValidatorStaticProxy);
|
|
2934
|
+
__decorateElement(_init19, 1, "convertToGTIN14", _convertToGTIN14_dec, GTINValidatorStaticProxy);
|
|
2935
|
+
__decorateElement(_init19, 1, "normalizeGTIN", _normalizeGTIN_dec, GTINValidatorStaticProxy);
|
|
2936
|
+
__decorateElement(_init19, 1, "validateGTIN", _validateGTIN_dec, GTINValidatorStaticProxy);
|
|
2937
|
+
__decorateElement(_init19, 1, "validateGTIN14", _validateGTIN14_dec, GTINValidatorStaticProxy);
|
|
2938
|
+
__decorateElement(_init19, 1, "parseVariableMeasureRCN", _parseVariableMeasureRCN_dec, GTINValidatorStaticProxy);
|
|
2939
|
+
GTINValidatorStaticProxy = __decorateElement(_init19, 0, "GTINValidatorStaticProxy", _GTINValidatorStaticProxy_decorators, GTINValidatorStaticProxy);
|
|
2940
|
+
__runInitializers(_init19, 1, GTINValidatorStaticProxy);
|
|
2941
|
+
|
|
2942
|
+
// src/gs1/non-gtin-validator-proxy.ts
|
|
2943
|
+
var import_gs15 = require("@aidc-toolkit/gs1");
|
|
2944
|
+
var _GLNValidatorProxy_decorators, _init20, _a20;
|
|
2945
|
+
_GLNValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2946
|
+
namespace: "GS1",
|
|
2947
|
+
methodInfix: "GLN"
|
|
2948
|
+
})];
|
|
2949
|
+
var GLNValidatorProxy = class extends (_a20 = NonSerializableNumericIdentifierValidatorProxy) {
|
|
2732
2950
|
constructor(appExtension) {
|
|
2733
|
-
super(appExtension,
|
|
2734
|
-
}
|
|
2735
|
-
};
|
|
2736
|
-
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2951
|
+
super(appExtension, import_gs15.IdentifierValidators.GLN);
|
|
2952
|
+
}
|
|
2953
|
+
};
|
|
2954
|
+
_init20 = __decoratorStart(_a20);
|
|
2955
|
+
GLNValidatorProxy = __decorateElement(_init20, 0, "GLNValidatorProxy", _GLNValidatorProxy_decorators, GLNValidatorProxy);
|
|
2956
|
+
__runInitializers(_init20, 1, GLNValidatorProxy);
|
|
2957
|
+
var _SSCCValidatorProxy_decorators, _init21, _a21;
|
|
2958
|
+
_SSCCValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2959
|
+
namespace: "GS1",
|
|
2960
|
+
methodInfix: "SSCC"
|
|
2961
|
+
})];
|
|
2962
|
+
var SSCCValidatorProxy = class extends (_a21 = NonSerializableNumericIdentifierValidatorProxy) {
|
|
2743
2963
|
constructor(appExtension) {
|
|
2744
|
-
super(appExtension,
|
|
2745
|
-
}
|
|
2746
|
-
};
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2964
|
+
super(appExtension, import_gs15.IdentifierValidators.SSCC);
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2967
|
+
_init21 = __decoratorStart(_a21);
|
|
2968
|
+
SSCCValidatorProxy = __decorateElement(_init21, 0, "SSCCValidatorProxy", _SSCCValidatorProxy_decorators, SSCCValidatorProxy);
|
|
2969
|
+
__runInitializers(_init21, 1, SSCCValidatorProxy);
|
|
2970
|
+
var _GRAIValidatorProxy_decorators, _init22, _a22;
|
|
2971
|
+
_GRAIValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2972
|
+
namespace: "GS1",
|
|
2973
|
+
methodInfix: "GRAI"
|
|
2974
|
+
})];
|
|
2975
|
+
var GRAIValidatorProxy = class extends (_a22 = SerializableNumericIdentifierValidatorProxy) {
|
|
2754
2976
|
constructor(appExtension) {
|
|
2755
|
-
super(appExtension,
|
|
2756
|
-
}
|
|
2757
|
-
};
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2977
|
+
super(appExtension, import_gs15.IdentifierValidators.GRAI);
|
|
2978
|
+
}
|
|
2979
|
+
};
|
|
2980
|
+
_init22 = __decoratorStart(_a22);
|
|
2981
|
+
GRAIValidatorProxy = __decorateElement(_init22, 0, "GRAIValidatorProxy", _GRAIValidatorProxy_decorators, GRAIValidatorProxy);
|
|
2982
|
+
__runInitializers(_init22, 1, GRAIValidatorProxy);
|
|
2983
|
+
var _GIAIValidatorProxy_decorators, _init23, _a23;
|
|
2984
|
+
_GIAIValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2985
|
+
namespace: "GS1",
|
|
2986
|
+
methodInfix: "GIAI"
|
|
2987
|
+
})];
|
|
2988
|
+
var GIAIValidatorProxy = class extends (_a23 = NonNumericIdentifierValidatorProxy) {
|
|
2765
2989
|
constructor(appExtension) {
|
|
2766
|
-
super(appExtension,
|
|
2767
|
-
}
|
|
2768
|
-
};
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2990
|
+
super(appExtension, import_gs15.IdentifierValidators.GIAI);
|
|
2991
|
+
}
|
|
2992
|
+
};
|
|
2993
|
+
_init23 = __decoratorStart(_a23);
|
|
2994
|
+
GIAIValidatorProxy = __decorateElement(_init23, 0, "GIAIValidatorProxy", _GIAIValidatorProxy_decorators, GIAIValidatorProxy);
|
|
2995
|
+
__runInitializers(_init23, 1, GIAIValidatorProxy);
|
|
2996
|
+
var _GSRNValidatorProxy_decorators, _init24, _a24;
|
|
2997
|
+
_GSRNValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
2998
|
+
namespace: "GS1",
|
|
2999
|
+
methodInfix: "GSRN"
|
|
3000
|
+
})];
|
|
3001
|
+
var GSRNValidatorProxy = class extends (_a24 = NonSerializableNumericIdentifierValidatorProxy) {
|
|
2776
3002
|
constructor(appExtension) {
|
|
2777
|
-
super(appExtension,
|
|
2778
|
-
}
|
|
2779
|
-
};
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
3003
|
+
super(appExtension, import_gs15.IdentifierValidators.GSRN);
|
|
3004
|
+
}
|
|
3005
|
+
};
|
|
3006
|
+
_init24 = __decoratorStart(_a24);
|
|
3007
|
+
GSRNValidatorProxy = __decorateElement(_init24, 0, "GSRNValidatorProxy", _GSRNValidatorProxy_decorators, GSRNValidatorProxy);
|
|
3008
|
+
__runInitializers(_init24, 1, GSRNValidatorProxy);
|
|
3009
|
+
var _GDTIValidatorProxy_decorators, _init25, _a25;
|
|
3010
|
+
_GDTIValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3011
|
+
namespace: "GS1",
|
|
3012
|
+
methodInfix: "GDTI"
|
|
3013
|
+
})];
|
|
3014
|
+
var GDTIValidatorProxy = class extends (_a25 = SerializableNumericIdentifierValidatorProxy) {
|
|
2787
3015
|
constructor(appExtension) {
|
|
2788
|
-
super(appExtension,
|
|
2789
|
-
}
|
|
2790
|
-
};
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
3016
|
+
super(appExtension, import_gs15.IdentifierValidators.GDTI);
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
3019
|
+
_init25 = __decoratorStart(_a25);
|
|
3020
|
+
GDTIValidatorProxy = __decorateElement(_init25, 0, "GDTIValidatorProxy", _GDTIValidatorProxy_decorators, GDTIValidatorProxy);
|
|
3021
|
+
__runInitializers(_init25, 1, GDTIValidatorProxy);
|
|
3022
|
+
var _GINCValidatorProxy_decorators, _init26, _a26;
|
|
3023
|
+
_GINCValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3024
|
+
namespace: "GS1",
|
|
3025
|
+
methodInfix: "GINC"
|
|
3026
|
+
})];
|
|
3027
|
+
var GINCValidatorProxy = class extends (_a26 = NonNumericIdentifierValidatorProxy) {
|
|
2798
3028
|
constructor(appExtension) {
|
|
2799
|
-
super(appExtension,
|
|
2800
|
-
}
|
|
2801
|
-
};
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
3029
|
+
super(appExtension, import_gs15.IdentifierValidators.GINC);
|
|
3030
|
+
}
|
|
3031
|
+
};
|
|
3032
|
+
_init26 = __decoratorStart(_a26);
|
|
3033
|
+
GINCValidatorProxy = __decorateElement(_init26, 0, "GINCValidatorProxy", _GINCValidatorProxy_decorators, GINCValidatorProxy);
|
|
3034
|
+
__runInitializers(_init26, 1, GINCValidatorProxy);
|
|
3035
|
+
var _GSINValidatorProxy_decorators, _init27, _a27;
|
|
3036
|
+
_GSINValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3037
|
+
namespace: "GS1",
|
|
3038
|
+
methodInfix: "GSIN"
|
|
3039
|
+
})];
|
|
3040
|
+
var GSINValidatorProxy = class extends (_a27 = NonSerializableNumericIdentifierValidatorProxy) {
|
|
2809
3041
|
constructor(appExtension) {
|
|
2810
|
-
super(appExtension,
|
|
2811
|
-
}
|
|
2812
|
-
};
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
3042
|
+
super(appExtension, import_gs15.IdentifierValidators.GSIN);
|
|
3043
|
+
}
|
|
3044
|
+
};
|
|
3045
|
+
_init27 = __decoratorStart(_a27);
|
|
3046
|
+
GSINValidatorProxy = __decorateElement(_init27, 0, "GSINValidatorProxy", _GSINValidatorProxy_decorators, GSINValidatorProxy);
|
|
3047
|
+
__runInitializers(_init27, 1, GSINValidatorProxy);
|
|
3048
|
+
var _GCNValidatorProxy_decorators, _init28, _a28;
|
|
3049
|
+
_GCNValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3050
|
+
namespace: "GS1",
|
|
3051
|
+
methodInfix: "GCN"
|
|
3052
|
+
})];
|
|
3053
|
+
var GCNValidatorProxy = class extends (_a28 = SerializableNumericIdentifierValidatorProxy) {
|
|
2820
3054
|
constructor(appExtension) {
|
|
2821
|
-
super(appExtension,
|
|
2822
|
-
}
|
|
2823
|
-
};
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
3055
|
+
super(appExtension, import_gs15.IdentifierValidators.GCN);
|
|
3056
|
+
}
|
|
3057
|
+
};
|
|
3058
|
+
_init28 = __decoratorStart(_a28);
|
|
3059
|
+
GCNValidatorProxy = __decorateElement(_init28, 0, "GCNValidatorProxy", _GCNValidatorProxy_decorators, GCNValidatorProxy);
|
|
3060
|
+
__runInitializers(_init28, 1, GCNValidatorProxy);
|
|
3061
|
+
var _CPIDValidatorProxy_decorators, _init29, _a29;
|
|
3062
|
+
_CPIDValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3063
|
+
namespace: "GS1",
|
|
3064
|
+
methodInfix: "CPID"
|
|
3065
|
+
})];
|
|
3066
|
+
var CPIDValidatorProxy = class extends (_a29 = NonNumericIdentifierValidatorProxy) {
|
|
2831
3067
|
constructor(appExtension) {
|
|
2832
|
-
super(appExtension,
|
|
2833
|
-
}
|
|
2834
|
-
};
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
3068
|
+
super(appExtension, import_gs15.IdentifierValidators.CPID);
|
|
3069
|
+
}
|
|
3070
|
+
};
|
|
3071
|
+
_init29 = __decoratorStart(_a29);
|
|
3072
|
+
CPIDValidatorProxy = __decorateElement(_init29, 0, "CPIDValidatorProxy", _CPIDValidatorProxy_decorators, CPIDValidatorProxy);
|
|
3073
|
+
__runInitializers(_init29, 1, CPIDValidatorProxy);
|
|
3074
|
+
var _GMNValidatorProxy_decorators, _init30, _a30;
|
|
3075
|
+
_GMNValidatorProxy_decorators = [proxy.describeClass(false, {
|
|
3076
|
+
namespace: "GS1",
|
|
3077
|
+
methodInfix: "GMN"
|
|
3078
|
+
})];
|
|
3079
|
+
var GMNValidatorProxy = class extends (_a30 = NonNumericIdentifierValidatorProxy) {
|
|
2842
3080
|
constructor(appExtension) {
|
|
2843
|
-
super(appExtension,
|
|
3081
|
+
super(appExtension, import_gs15.IdentifierValidators.GMN);
|
|
2844
3082
|
}
|
|
2845
3083
|
};
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
], GMNValidatorProxy);
|
|
3084
|
+
_init30 = __decoratorStart(_a30);
|
|
3085
|
+
GMNValidatorProxy = __decorateElement(_init30, 0, "GMNValidatorProxy", _GMNValidatorProxy_decorators, GMNValidatorProxy);
|
|
3086
|
+
__runInitializers(_init30, 1, GMNValidatorProxy);
|
|
3087
|
+
|
|
3088
|
+
// src/gs1/prefix-manager-proxy.ts
|
|
2852
3089
|
var prefixParameterDescriptor = {
|
|
2853
3090
|
name: "prefix",
|
|
2854
3091
|
type: Types.String,
|
|
@@ -2867,6 +3104,37 @@ var tweakFactorParameterDescriptor = {
|
|
|
2867
3104
|
isMatrix: false,
|
|
2868
3105
|
isRequired: false
|
|
2869
3106
|
};
|
|
3107
|
+
var _definePrefix_dec, _a31, _PrefixManagerProxy_decorators, _init31;
|
|
3108
|
+
_PrefixManagerProxy_decorators = [proxy.describeClass(false, {
|
|
3109
|
+
namespace: "GS1"
|
|
3110
|
+
})];
|
|
3111
|
+
var PrefixManagerProxy = class extends (_a31 = LibProxy, _definePrefix_dec = [proxy.describeMethod({
|
|
3112
|
+
type: Types.Any,
|
|
3113
|
+
isMatrix: true,
|
|
3114
|
+
parameterDescriptors: [prefixParameterDescriptor, prefixTypeParameterDescriptor, tweakFactorParameterDescriptor]
|
|
3115
|
+
})], _a31) {
|
|
3116
|
+
constructor() {
|
|
3117
|
+
super(...arguments);
|
|
3118
|
+
__runInitializers(_init31, 5, this);
|
|
3119
|
+
}
|
|
3120
|
+
definePrefix(prefix, prefixType, tweakFactor) {
|
|
3121
|
+
return [[prefix, prefixType, tweakFactor]];
|
|
3122
|
+
}
|
|
3123
|
+
};
|
|
3124
|
+
_init31 = __decoratorStart(_a31);
|
|
3125
|
+
__decorateElement(_init31, 1, "definePrefix", _definePrefix_dec, PrefixManagerProxy);
|
|
3126
|
+
PrefixManagerProxy = __decorateElement(_init31, 0, "PrefixManagerProxy", _PrefixManagerProxy_decorators, PrefixManagerProxy);
|
|
3127
|
+
__runInitializers(_init31, 1, PrefixManagerProxy);
|
|
3128
|
+
|
|
3129
|
+
// src/gs1/gtin-creator-proxy.ts
|
|
3130
|
+
var import_gs17 = require("@aidc-toolkit/gs1");
|
|
3131
|
+
|
|
3132
|
+
// src/gs1/identifier-creator-proxy.ts
|
|
3133
|
+
var import_core4 = require("@aidc-toolkit/core");
|
|
3134
|
+
var import_gs16 = require("@aidc-toolkit/gs1");
|
|
3135
|
+
var import_utility7 = require("@aidc-toolkit/utility");
|
|
3136
|
+
|
|
3137
|
+
// src/gs1/prefix-definition-descriptor.ts
|
|
2870
3138
|
var prefixDefinitionParameterDescriptor = {
|
|
2871
3139
|
name: "prefixDefinition",
|
|
2872
3140
|
type: Types.Any,
|
|
@@ -2881,31 +3149,14 @@ var prefixDefinitionAnyParameterDescriptor = {
|
|
|
2881
3149
|
extendsDescriptor: prefixDefinitionParameterDescriptor,
|
|
2882
3150
|
name: "prefixDefinitionAny"
|
|
2883
3151
|
};
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
return [[prefix, prefixType, tweakFactor]];
|
|
2887
|
-
}
|
|
2888
|
-
};
|
|
2889
|
-
__decorateClass([
|
|
2890
|
-
ProxyMethod({
|
|
2891
|
-
type: Types.Any,
|
|
2892
|
-
isMatrix: true
|
|
2893
|
-
}),
|
|
2894
|
-
__decorateParam(0, ProxyParameter(prefixParameterDescriptor)),
|
|
2895
|
-
__decorateParam(1, ProxyParameter(prefixTypeParameterDescriptor)),
|
|
2896
|
-
__decorateParam(2, ProxyParameter(tweakFactorParameterDescriptor))
|
|
2897
|
-
], PrefixManagerProxy.prototype, "definePrefix", 1);
|
|
2898
|
-
PrefixManagerProxy = __decorateClass([
|
|
2899
|
-
ProxyClass({
|
|
2900
|
-
namespace: "GS1"
|
|
2901
|
-
})
|
|
2902
|
-
], PrefixManagerProxy);
|
|
3152
|
+
|
|
3153
|
+
// src/gs1/identifier-creator-proxy.ts
|
|
2903
3154
|
var IdentifierCreatorProxy = class _IdentifierCreatorProxy extends LibProxy {
|
|
2904
|
-
static PREFIX_TYPES = [
|
|
2905
|
-
|
|
3155
|
+
static #PREFIX_TYPES = [import_gs16.PrefixTypes.GS1CompanyPrefix, import_gs16.PrefixTypes.UPCCompanyPrefix, import_gs16.PrefixTypes.GS18Prefix];
|
|
3156
|
+
#getCreator;
|
|
2906
3157
|
constructor(appExtension, getCreator) {
|
|
2907
3158
|
super(appExtension);
|
|
2908
|
-
this
|
|
3159
|
+
this.#getCreator = getCreator;
|
|
2909
3160
|
}
|
|
2910
3161
|
getCreator(prefixDefinition) {
|
|
2911
3162
|
const reducedPrefixDefinition = prefixDefinition.length === 1 ? (
|
|
@@ -2928,18 +3179,18 @@ var IdentifierCreatorProxy = class _IdentifierCreatorProxy extends LibProxy {
|
|
|
2928
3179
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixMustBeString"));
|
|
2929
3180
|
}
|
|
2930
3181
|
const prefixTypeIndex = reducedPrefixDefinition[1] ?? 0;
|
|
2931
|
-
if (typeof prefixTypeIndex !== "number" || prefixTypeIndex < 0 || prefixTypeIndex >= _IdentifierCreatorProxy
|
|
3182
|
+
if (typeof prefixTypeIndex !== "number" || prefixTypeIndex < 0 || prefixTypeIndex >= _IdentifierCreatorProxy.#PREFIX_TYPES.length) {
|
|
2932
3183
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixTypeMustBeNumber", {
|
|
2933
|
-
maximumPrefixType: _IdentifierCreatorProxy
|
|
3184
|
+
maximumPrefixType: _IdentifierCreatorProxy.#PREFIX_TYPES.length - 1
|
|
2934
3185
|
}));
|
|
2935
3186
|
}
|
|
2936
|
-
const prefixType = _IdentifierCreatorProxy
|
|
3187
|
+
const prefixType = _IdentifierCreatorProxy.#PREFIX_TYPES[prefixTypeIndex];
|
|
2937
3188
|
if (prefixType === void 0) {
|
|
2938
3189
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.invalidPrefixType"));
|
|
2939
3190
|
}
|
|
2940
|
-
const prefixManager =
|
|
3191
|
+
const prefixManager = import_gs16.PrefixManager.get(prefixType, prefix);
|
|
2941
3192
|
const tweakFactor = reducedPrefixDefinition[2];
|
|
2942
|
-
if (!(0,
|
|
3193
|
+
if (!(0, import_core4.isNullish)(tweakFactor)) {
|
|
2943
3194
|
if (typeof tweakFactor !== "number") {
|
|
2944
3195
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.tweakFactorMustBeNumber"));
|
|
2945
3196
|
}
|
|
@@ -2947,7 +3198,7 @@ var IdentifierCreatorProxy = class _IdentifierCreatorProxy extends LibProxy {
|
|
|
2947
3198
|
} else {
|
|
2948
3199
|
prefixManager.resetTweakFactor();
|
|
2949
3200
|
}
|
|
2950
|
-
return this
|
|
3201
|
+
return this.#getCreator(prefixManager);
|
|
2951
3202
|
}
|
|
2952
3203
|
};
|
|
2953
3204
|
var sparseParameterDescriptor = {
|
|
@@ -2956,7 +3207,28 @@ var sparseParameterDescriptor = {
|
|
|
2956
3207
|
isMatrix: false,
|
|
2957
3208
|
isRequired: false
|
|
2958
3209
|
};
|
|
2959
|
-
var
|
|
3210
|
+
var _createAll_dec, _createSequence_dec2, _create_dec2, _a32, _NumericIdentifierCreatorProxy_decorators, _init32;
|
|
3211
|
+
_NumericIdentifierCreatorProxy_decorators = [proxy.describeClass(true, {
|
|
3212
|
+
namespace: "GS1"
|
|
3213
|
+
})];
|
|
3214
|
+
var NumericIdentifierCreatorProxy = class extends (_a32 = IdentifierCreatorProxy, _create_dec2 = [proxy.describeMethod({
|
|
3215
|
+
type: Types.String,
|
|
3216
|
+
isMatrix: true,
|
|
3217
|
+
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, valueParameterDescriptor, sparseParameterDescriptor]
|
|
3218
|
+
})], _createSequence_dec2 = [proxy.describeMethod({
|
|
3219
|
+
infixBefore: "Sequence",
|
|
3220
|
+
type: Types.String,
|
|
3221
|
+
isMatrix: true,
|
|
3222
|
+
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, sparseParameterDescriptor]
|
|
3223
|
+
})], _createAll_dec = [proxy.describeMethod({
|
|
3224
|
+
type: Types.String,
|
|
3225
|
+
isMatrix: true,
|
|
3226
|
+
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor]
|
|
3227
|
+
})], _a32) {
|
|
3228
|
+
constructor() {
|
|
3229
|
+
super(...arguments);
|
|
3230
|
+
__runInitializers(_init32, 5, this);
|
|
3231
|
+
}
|
|
2960
3232
|
create(prefixDefinition, matrixValues, sparse) {
|
|
2961
3233
|
const creator = this.getCreator(prefixDefinition);
|
|
2962
3234
|
const sparseOrUndefined = sparse ?? void 0;
|
|
@@ -2972,35 +3244,16 @@ var NumericIdentifierCreatorProxy = class extends IdentifierCreatorProxy {
|
|
|
2972
3244
|
return LibProxy.matrixResult(creator.createAll());
|
|
2973
3245
|
}
|
|
2974
3246
|
};
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
__decorateParam(1, ProxyParameter(valueParameterDescriptor)),
|
|
2982
|
-
__decorateParam(2, ProxyParameter(sparseParameterDescriptor))
|
|
2983
|
-
], NumericIdentifierCreatorProxy.prototype, "create", 1);
|
|
2984
|
-
__decorateClass([
|
|
2985
|
-
ProxyMethod({
|
|
2986
|
-
infixBefore: "Sequence",
|
|
2987
|
-
type: Types.String,
|
|
2988
|
-
isMatrix: true
|
|
2989
|
-
}),
|
|
2990
|
-
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
2991
|
-
__decorateParam(1, ProxyParameter(startValueParameterDescriptor)),
|
|
2992
|
-
__decorateParam(2, ProxyParameter(countParameterDescriptor)),
|
|
2993
|
-
__decorateParam(3, ProxyParameter(sparseParameterDescriptor))
|
|
2994
|
-
], NumericIdentifierCreatorProxy.prototype, "createSequence", 1);
|
|
2995
|
-
__decorateClass([
|
|
2996
|
-
ProxyMethod({
|
|
2997
|
-
type: Types.String,
|
|
2998
|
-
isMatrix: true
|
|
2999
|
-
}),
|
|
3000
|
-
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor))
|
|
3001
|
-
], NumericIdentifierCreatorProxy.prototype, "createAll", 1);
|
|
3247
|
+
_init32 = __decoratorStart(_a32);
|
|
3248
|
+
__decorateElement(_init32, 1, "create", _create_dec2, NumericIdentifierCreatorProxy);
|
|
3249
|
+
__decorateElement(_init32, 1, "createSequence", _createSequence_dec2, NumericIdentifierCreatorProxy);
|
|
3250
|
+
__decorateElement(_init32, 1, "createAll", _createAll_dec, NumericIdentifierCreatorProxy);
|
|
3251
|
+
NumericIdentifierCreatorProxy = __decorateElement(_init32, 0, "NumericIdentifierCreatorProxy", _NumericIdentifierCreatorProxy_decorators, NumericIdentifierCreatorProxy);
|
|
3252
|
+
__runInitializers(_init32, 1, NumericIdentifierCreatorProxy);
|
|
3002
3253
|
var NonGTINNumericIdentifierCreatorProxy = class extends NumericIdentifierCreatorProxy {
|
|
3003
3254
|
};
|
|
3255
|
+
var NonSerializableNumericIdentifierCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3256
|
+
};
|
|
3004
3257
|
var singleValueParameterDescriptor = {
|
|
3005
3258
|
extendsDescriptor: valueParameterDescriptor,
|
|
3006
3259
|
isMatrix: false
|
|
@@ -3016,58 +3269,93 @@ var serialComponentParameterDescriptor = {
|
|
|
3016
3269
|
isMatrix: true,
|
|
3017
3270
|
isRequired: true
|
|
3018
3271
|
};
|
|
3019
|
-
var
|
|
3272
|
+
var _concatenate_dec, _createSerialized_dec, _a33, _SerializableNumericIdentifierCreatorProxy_decorators, _init33;
|
|
3273
|
+
_SerializableNumericIdentifierCreatorProxy_decorators = [proxy.describeClass(true, {
|
|
3274
|
+
namespace: "GS1"
|
|
3275
|
+
})];
|
|
3276
|
+
var SerializableNumericIdentifierCreatorProxy = class extends (_a33 = NonGTINNumericIdentifierCreatorProxy, _createSerialized_dec = [proxy.describeMethod({
|
|
3277
|
+
type: Types.String,
|
|
3278
|
+
isMatrix: true,
|
|
3279
|
+
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, singleValueParameterDescriptor, serialComponentParameterDescriptor, sparseParameterDescriptor]
|
|
3280
|
+
})], _concatenate_dec = [proxy.describeMethod({
|
|
3281
|
+
type: Types.String,
|
|
3282
|
+
isMatrix: true,
|
|
3283
|
+
parameterDescriptors: [baseIdentifierParameterDescriptor, serialComponentParameterDescriptor]
|
|
3284
|
+
})], _a33) {
|
|
3285
|
+
constructor() {
|
|
3286
|
+
super(...arguments);
|
|
3287
|
+
__runInitializers(_init33, 5, this);
|
|
3288
|
+
}
|
|
3020
3289
|
createSerialized(prefixDefinition, value, matrixSerialComponents, sparse) {
|
|
3021
3290
|
const creator = this.getCreator(prefixDefinition);
|
|
3022
3291
|
const sparseOrUndefined = sparse ?? void 0;
|
|
3023
3292
|
return this.mapMatrix(matrixSerialComponents, (serialComponent) => creator.createSerialized(value, serialComponent, sparseOrUndefined));
|
|
3024
3293
|
}
|
|
3025
3294
|
concatenate(baseIdentifier, matrixSerialComponents) {
|
|
3026
|
-
const creator = this.getCreator([[baseIdentifier.substring(0, !baseIdentifier.startsWith("0") ?
|
|
3295
|
+
const creator = this.getCreator([[baseIdentifier.substring(0, !baseIdentifier.startsWith("0") ? import_gs16.PrefixValidator.GS1_COMPANY_PREFIX_MINIMUM_LENGTH : import_gs16.PrefixValidator.UPC_COMPANY_PREFIX_MINIMUM_LENGTH + 1), import_gs16.PrefixTypes.GS1CompanyPrefix]]);
|
|
3027
3296
|
return this.mapMatrix(matrixSerialComponents, (serialComponent) => creator.concatenate(baseIdentifier, serialComponent));
|
|
3028
3297
|
}
|
|
3029
3298
|
};
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
__decorateParam(0, ProxyParameter(prefixDefinitionGS1UPCParameterDescriptor)),
|
|
3036
|
-
__decorateParam(1, ProxyParameter(singleValueParameterDescriptor)),
|
|
3037
|
-
__decorateParam(2, ProxyParameter(serialComponentParameterDescriptor)),
|
|
3038
|
-
__decorateParam(3, ProxyParameter(sparseParameterDescriptor))
|
|
3039
|
-
], SerializableNumericIdentifierCreatorProxy.prototype, "createSerialized", 1);
|
|
3040
|
-
__decorateClass([
|
|
3041
|
-
ProxyMethod({
|
|
3042
|
-
type: Types.String,
|
|
3043
|
-
isMatrix: true
|
|
3044
|
-
}),
|
|
3045
|
-
__decorateParam(0, ProxyParameter(baseIdentifierParameterDescriptor)),
|
|
3046
|
-
__decorateParam(1, ProxyParameter(serialComponentParameterDescriptor))
|
|
3047
|
-
], SerializableNumericIdentifierCreatorProxy.prototype, "concatenate", 1);
|
|
3299
|
+
_init33 = __decoratorStart(_a33);
|
|
3300
|
+
__decorateElement(_init33, 1, "createSerialized", _createSerialized_dec, SerializableNumericIdentifierCreatorProxy);
|
|
3301
|
+
__decorateElement(_init33, 1, "concatenate", _concatenate_dec, SerializableNumericIdentifierCreatorProxy);
|
|
3302
|
+
SerializableNumericIdentifierCreatorProxy = __decorateElement(_init33, 0, "SerializableNumericIdentifierCreatorProxy", _SerializableNumericIdentifierCreatorProxy_decorators, SerializableNumericIdentifierCreatorProxy);
|
|
3303
|
+
__runInitializers(_init33, 1, SerializableNumericIdentifierCreatorProxy);
|
|
3048
3304
|
var referenceParameterDescriptor = {
|
|
3049
3305
|
name: "reference",
|
|
3050
3306
|
type: Types.String,
|
|
3051
3307
|
isMatrix: true,
|
|
3052
3308
|
isRequired: true
|
|
3053
3309
|
};
|
|
3054
|
-
var
|
|
3310
|
+
var _create_dec3, _a34, _NonNumericIdentifierCreatorProxy_decorators, _init34;
|
|
3311
|
+
_NonNumericIdentifierCreatorProxy_decorators = [proxy.describeClass(true, {
|
|
3312
|
+
namespace: "GS1"
|
|
3313
|
+
})];
|
|
3314
|
+
var NonNumericIdentifierCreatorProxy = class extends (_a34 = IdentifierCreatorProxy, _create_dec3 = [proxy.describeMethod({
|
|
3315
|
+
type: Types.String,
|
|
3316
|
+
isMatrix: true,
|
|
3317
|
+
parameterDescriptors: [prefixDefinitionGS1UPCParameterDescriptor, referenceParameterDescriptor]
|
|
3318
|
+
})], _a34) {
|
|
3319
|
+
constructor() {
|
|
3320
|
+
super(...arguments);
|
|
3321
|
+
__runInitializers(_init34, 5, this);
|
|
3322
|
+
}
|
|
3055
3323
|
create(prefixDefinition, matrixReferences) {
|
|
3056
3324
|
const creator = this.getCreator(prefixDefinition);
|
|
3057
3325
|
return this.mapMatrix(matrixReferences, (reference) => creator.create(reference));
|
|
3058
3326
|
}
|
|
3059
3327
|
};
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3328
|
+
_init34 = __decoratorStart(_a34);
|
|
3329
|
+
__decorateElement(_init34, 1, "create", _create_dec3, NonNumericIdentifierCreatorProxy);
|
|
3330
|
+
NonNumericIdentifierCreatorProxy = __decorateElement(_init34, 0, "NonNumericIdentifierCreatorProxy", _NonNumericIdentifierCreatorProxy_decorators, NonNumericIdentifierCreatorProxy);
|
|
3331
|
+
__runInitializers(_init34, 1, NonNumericIdentifierCreatorProxy);
|
|
3332
|
+
|
|
3333
|
+
// src/gs1/gtin-creator-proxy.ts
|
|
3334
|
+
var _createVariableMeasureRCN_dec, _createGTIN14_dec, _a35, _GTINCreatorProxy_decorators, _init35;
|
|
3335
|
+
_GTINCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3336
|
+
namespace: "GS1",
|
|
3337
|
+
methodInfix: "GTIN",
|
|
3338
|
+
replaceParameterDescriptors: [
|
|
3339
|
+
{
|
|
3340
|
+
name: expandParameterDescriptor(prefixDefinitionGS1UPCParameterDescriptor).name,
|
|
3341
|
+
replacement: prefixDefinitionAnyParameterDescriptor
|
|
3342
|
+
}
|
|
3343
|
+
]
|
|
3344
|
+
})];
|
|
3345
|
+
var GTINCreatorProxy = class extends (_a35 = NumericIdentifierCreatorProxy, _createGTIN14_dec = [proxy.describeMethod({
|
|
3346
|
+
type: Types.String,
|
|
3347
|
+
isMatrix: true,
|
|
3348
|
+
ignoreInfix: true,
|
|
3349
|
+
parameterDescriptors: [indicatorDigitParameterDescriptor, prefixDefinitionAnyParameterDescriptor, valueParameterDescriptor, sparseParameterDescriptor]
|
|
3350
|
+
})], _createVariableMeasureRCN_dec = [proxy.describeMethod({
|
|
3351
|
+
type: Types.String,
|
|
3352
|
+
isMatrix: true,
|
|
3353
|
+
ignoreInfix: true,
|
|
3354
|
+
parameterDescriptors: [rcnFormatParameterDescriptor, rcnItemReferenceParameterDescriptor, rcnPriceOrWeightParameterDescriptor]
|
|
3355
|
+
})], _a35) {
|
|
3069
3356
|
constructor(appExtension) {
|
|
3070
3357
|
super(appExtension, (prefixManager) => prefixManager.gtinCreator);
|
|
3358
|
+
__runInitializers(_init35, 5, this);
|
|
3071
3359
|
}
|
|
3072
3360
|
createGTIN14(indicatorDigit, prefixDefinition, matrixValues, sparse) {
|
|
3073
3361
|
const creator = this.getCreator(prefixDefinition);
|
|
@@ -3075,166 +3363,162 @@ var GTINCreatorProxy = class extends NumericIdentifierCreatorProxy {
|
|
|
3075
3363
|
return this.mapMatrix(matrixValues, (value) => creator.createGTIN14(indicatorDigit, value, sparseOrUndefined));
|
|
3076
3364
|
}
|
|
3077
3365
|
createVariableMeasureRCN(format, itemReference, matrixPricesOrWeights) {
|
|
3078
|
-
return this.mapMatrix(matrixPricesOrWeights, (priceOrWeight) =>
|
|
3079
|
-
}
|
|
3080
|
-
};
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
type: Types.String,
|
|
3095
|
-
isMatrix: true,
|
|
3096
|
-
ignoreInfix: true
|
|
3097
|
-
}),
|
|
3098
|
-
__decorateParam(0, ProxyParameter(rcnFormatParameterDescriptor)),
|
|
3099
|
-
__decorateParam(1, ProxyParameter(rcnItemReferenceParameterDescriptor)),
|
|
3100
|
-
__decorateParam(2, ProxyParameter(rcnPriceOrWeightParameterDescriptor))
|
|
3101
|
-
], GTINCreatorProxy.prototype, "createVariableMeasureRCN", 1);
|
|
3102
|
-
GTINCreatorProxy = __decorateClass([
|
|
3103
|
-
ProxyClass({
|
|
3104
|
-
namespace: "GS1",
|
|
3105
|
-
methodInfix: "GTIN",
|
|
3106
|
-
replaceParameterDescriptors: [
|
|
3107
|
-
{
|
|
3108
|
-
name: expandParameterDescriptor(prefixDefinitionGS1UPCParameterDescriptor).name,
|
|
3109
|
-
replacement: prefixDefinitionAnyParameterDescriptor
|
|
3110
|
-
}
|
|
3111
|
-
]
|
|
3112
|
-
})
|
|
3113
|
-
], GTINCreatorProxy);
|
|
3114
|
-
var GLNCreatorProxy = class extends NonGTINNumericIdentifierCreatorProxy {
|
|
3366
|
+
return this.mapMatrix(matrixPricesOrWeights, (priceOrWeight) => import_gs17.GTINCreator.createVariableMeasureRCN(format, itemReference, priceOrWeight));
|
|
3367
|
+
}
|
|
3368
|
+
};
|
|
3369
|
+
_init35 = __decoratorStart(_a35);
|
|
3370
|
+
__decorateElement(_init35, 1, "createGTIN14", _createGTIN14_dec, GTINCreatorProxy);
|
|
3371
|
+
__decorateElement(_init35, 1, "createVariableMeasureRCN", _createVariableMeasureRCN_dec, GTINCreatorProxy);
|
|
3372
|
+
GTINCreatorProxy = __decorateElement(_init35, 0, "GTINCreatorProxy", _GTINCreatorProxy_decorators, GTINCreatorProxy);
|
|
3373
|
+
__runInitializers(_init35, 1, GTINCreatorProxy);
|
|
3374
|
+
|
|
3375
|
+
// src/gs1/non-gtin-creator-proxy.ts
|
|
3376
|
+
var _GLNCreatorProxy_decorators, _init36, _a36;
|
|
3377
|
+
_GLNCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3378
|
+
namespace: "GS1",
|
|
3379
|
+
methodInfix: "GLN"
|
|
3380
|
+
})];
|
|
3381
|
+
var GLNCreatorProxy = class extends (_a36 = NonSerializableNumericIdentifierCreatorProxy) {
|
|
3115
3382
|
constructor(appExtension) {
|
|
3116
3383
|
super(appExtension, (prefixManager) => prefixManager.glnCreator);
|
|
3117
3384
|
}
|
|
3118
3385
|
};
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3386
|
+
_init36 = __decoratorStart(_a36);
|
|
3387
|
+
GLNCreatorProxy = __decorateElement(_init36, 0, "GLNCreatorProxy", _GLNCreatorProxy_decorators, GLNCreatorProxy);
|
|
3388
|
+
__runInitializers(_init36, 1, GLNCreatorProxy);
|
|
3389
|
+
var _SSCCCreatorProxy_decorators, _init37, _a37;
|
|
3390
|
+
_SSCCCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3391
|
+
namespace: "GS1",
|
|
3392
|
+
methodInfix: "SSCC"
|
|
3393
|
+
})];
|
|
3394
|
+
var SSCCCreatorProxy = class extends (_a37 = NonSerializableNumericIdentifierCreatorProxy) {
|
|
3126
3395
|
constructor(appExtension) {
|
|
3127
3396
|
super(appExtension, (prefixManager) => prefixManager.ssccCreator);
|
|
3128
3397
|
}
|
|
3129
3398
|
};
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3399
|
+
_init37 = __decoratorStart(_a37);
|
|
3400
|
+
SSCCCreatorProxy = __decorateElement(_init37, 0, "SSCCCreatorProxy", _SSCCCreatorProxy_decorators, SSCCCreatorProxy);
|
|
3401
|
+
__runInitializers(_init37, 1, SSCCCreatorProxy);
|
|
3402
|
+
var _GRAICreatorProxy_decorators, _init38, _a38;
|
|
3403
|
+
_GRAICreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3404
|
+
namespace: "GS1",
|
|
3405
|
+
methodInfix: "GRAI"
|
|
3406
|
+
})];
|
|
3407
|
+
var GRAICreatorProxy = class extends (_a38 = SerializableNumericIdentifierCreatorProxy) {
|
|
3137
3408
|
constructor(appExtension) {
|
|
3138
3409
|
super(appExtension, (prefixManager) => prefixManager.graiCreator);
|
|
3139
3410
|
}
|
|
3140
3411
|
};
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3412
|
+
_init38 = __decoratorStart(_a38);
|
|
3413
|
+
GRAICreatorProxy = __decorateElement(_init38, 0, "GRAICreatorProxy", _GRAICreatorProxy_decorators, GRAICreatorProxy);
|
|
3414
|
+
__runInitializers(_init38, 1, GRAICreatorProxy);
|
|
3415
|
+
var _GIAICreatorProxy_decorators, _init39, _a39;
|
|
3416
|
+
_GIAICreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3417
|
+
namespace: "GS1",
|
|
3418
|
+
methodInfix: "GIAI"
|
|
3419
|
+
})];
|
|
3420
|
+
var GIAICreatorProxy = class extends (_a39 = NonNumericIdentifierCreatorProxy) {
|
|
3148
3421
|
constructor(appExtension) {
|
|
3149
3422
|
super(appExtension, (prefixManager) => prefixManager.giaiCreator);
|
|
3150
3423
|
}
|
|
3151
3424
|
};
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3425
|
+
_init39 = __decoratorStart(_a39);
|
|
3426
|
+
GIAICreatorProxy = __decorateElement(_init39, 0, "GIAICreatorProxy", _GIAICreatorProxy_decorators, GIAICreatorProxy);
|
|
3427
|
+
__runInitializers(_init39, 1, GIAICreatorProxy);
|
|
3428
|
+
var _GSRNCreatorProxy_decorators, _init40, _a40;
|
|
3429
|
+
_GSRNCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3430
|
+
namespace: "GS1",
|
|
3431
|
+
methodInfix: "GSRN"
|
|
3432
|
+
})];
|
|
3433
|
+
var GSRNCreatorProxy = class extends (_a40 = NonSerializableNumericIdentifierCreatorProxy) {
|
|
3159
3434
|
constructor(appExtension) {
|
|
3160
3435
|
super(appExtension, (prefixManager) => prefixManager.gsrnCreator);
|
|
3161
3436
|
}
|
|
3162
3437
|
};
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3438
|
+
_init40 = __decoratorStart(_a40);
|
|
3439
|
+
GSRNCreatorProxy = __decorateElement(_init40, 0, "GSRNCreatorProxy", _GSRNCreatorProxy_decorators, GSRNCreatorProxy);
|
|
3440
|
+
__runInitializers(_init40, 1, GSRNCreatorProxy);
|
|
3441
|
+
var _GDTICreatorProxy_decorators, _init41, _a41;
|
|
3442
|
+
_GDTICreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3443
|
+
namespace: "GS1",
|
|
3444
|
+
methodInfix: "GDTI"
|
|
3445
|
+
})];
|
|
3446
|
+
var GDTICreatorProxy = class extends (_a41 = SerializableNumericIdentifierCreatorProxy) {
|
|
3170
3447
|
constructor(appExtension) {
|
|
3171
3448
|
super(appExtension, (prefixManager) => prefixManager.gdtiCreator);
|
|
3172
3449
|
}
|
|
3173
3450
|
};
|
|
3174
|
-
|
|
3175
|
-
|
|
3176
|
-
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
|
|
3451
|
+
_init41 = __decoratorStart(_a41);
|
|
3452
|
+
GDTICreatorProxy = __decorateElement(_init41, 0, "GDTICreatorProxy", _GDTICreatorProxy_decorators, GDTICreatorProxy);
|
|
3453
|
+
__runInitializers(_init41, 1, GDTICreatorProxy);
|
|
3454
|
+
var _GINCCreatorProxy_decorators, _init42, _a42;
|
|
3455
|
+
_GINCCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3456
|
+
namespace: "GS1",
|
|
3457
|
+
methodInfix: "GINC"
|
|
3458
|
+
})];
|
|
3459
|
+
var GINCCreatorProxy = class extends (_a42 = NonNumericIdentifierCreatorProxy) {
|
|
3181
3460
|
constructor(appExtension) {
|
|
3182
3461
|
super(appExtension, (prefixManager) => prefixManager.gincCreator);
|
|
3183
3462
|
}
|
|
3184
3463
|
};
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3464
|
+
_init42 = __decoratorStart(_a42);
|
|
3465
|
+
GINCCreatorProxy = __decorateElement(_init42, 0, "GINCCreatorProxy", _GINCCreatorProxy_decorators, GINCCreatorProxy);
|
|
3466
|
+
__runInitializers(_init42, 1, GINCCreatorProxy);
|
|
3467
|
+
var _GSINCreatorProxy_decorators, _init43, _a43;
|
|
3468
|
+
_GSINCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3469
|
+
namespace: "GS1",
|
|
3470
|
+
methodInfix: "GSIN"
|
|
3471
|
+
})];
|
|
3472
|
+
var GSINCreatorProxy = class extends (_a43 = NonSerializableNumericIdentifierCreatorProxy) {
|
|
3192
3473
|
constructor(appExtension) {
|
|
3193
3474
|
super(appExtension, (prefixManager) => prefixManager.gsinCreator);
|
|
3194
3475
|
}
|
|
3195
3476
|
};
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3202
|
-
|
|
3477
|
+
_init43 = __decoratorStart(_a43);
|
|
3478
|
+
GSINCreatorProxy = __decorateElement(_init43, 0, "GSINCreatorProxy", _GSINCreatorProxy_decorators, GSINCreatorProxy);
|
|
3479
|
+
__runInitializers(_init43, 1, GSINCreatorProxy);
|
|
3480
|
+
var _GCNCreatorProxy_decorators, _init44, _a44;
|
|
3481
|
+
_GCNCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3482
|
+
namespace: "GS1",
|
|
3483
|
+
methodInfix: "GCN"
|
|
3484
|
+
})];
|
|
3485
|
+
var GCNCreatorProxy = class extends (_a44 = SerializableNumericIdentifierCreatorProxy) {
|
|
3203
3486
|
constructor(appExtension) {
|
|
3204
3487
|
super(appExtension, (prefixManager) => prefixManager.gcnCreator);
|
|
3205
3488
|
}
|
|
3206
3489
|
};
|
|
3207
|
-
|
|
3208
|
-
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3490
|
+
_init44 = __decoratorStart(_a44);
|
|
3491
|
+
GCNCreatorProxy = __decorateElement(_init44, 0, "GCNCreatorProxy", _GCNCreatorProxy_decorators, GCNCreatorProxy);
|
|
3492
|
+
__runInitializers(_init44, 1, GCNCreatorProxy);
|
|
3493
|
+
var _CPIDCreatorProxy_decorators, _init45, _a45;
|
|
3494
|
+
_CPIDCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3495
|
+
namespace: "GS1",
|
|
3496
|
+
methodInfix: "CPID"
|
|
3497
|
+
})];
|
|
3498
|
+
var CPIDCreatorProxy = class extends (_a45 = NonNumericIdentifierCreatorProxy) {
|
|
3214
3499
|
constructor(appExtension) {
|
|
3215
3500
|
super(appExtension, (prefixManager) => prefixManager.cpidCreator);
|
|
3216
3501
|
}
|
|
3217
3502
|
};
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
|
|
3221
|
-
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3503
|
+
_init45 = __decoratorStart(_a45);
|
|
3504
|
+
CPIDCreatorProxy = __decorateElement(_init45, 0, "CPIDCreatorProxy", _CPIDCreatorProxy_decorators, CPIDCreatorProxy);
|
|
3505
|
+
__runInitializers(_init45, 1, CPIDCreatorProxy);
|
|
3506
|
+
var _GMNCreatorProxy_decorators, _init46, _a46;
|
|
3507
|
+
_GMNCreatorProxy_decorators = [proxy.describeClass(false, {
|
|
3508
|
+
namespace: "GS1",
|
|
3509
|
+
methodInfix: "GMN"
|
|
3510
|
+
})];
|
|
3511
|
+
var GMNCreatorProxy = class extends (_a46 = NonNumericIdentifierCreatorProxy) {
|
|
3225
3512
|
constructor(appExtension) {
|
|
3226
3513
|
super(appExtension, (prefixManager) => prefixManager.gmnCreator);
|
|
3227
3514
|
}
|
|
3228
3515
|
};
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
methodInfix: "GMN"
|
|
3233
|
-
})
|
|
3234
|
-
], GMNCreatorProxy);
|
|
3516
|
+
_init46 = __decoratorStart(_a46);
|
|
3517
|
+
GMNCreatorProxy = __decorateElement(_init46, 0, "GMNCreatorProxy", _GMNCreatorProxy_decorators, GMNCreatorProxy);
|
|
3518
|
+
__runInitializers(_init46, 1, GMNCreatorProxy);
|
|
3235
3519
|
|
|
3236
3520
|
// src/generator/generator.ts
|
|
3237
|
-
var
|
|
3521
|
+
var import_core5 = require("@aidc-toolkit/core");
|
|
3238
3522
|
function registerProxies(..._proxies) {
|
|
3239
3523
|
}
|
|
3240
3524
|
registerProxies(AppUtilityProxy, utility_exports, gs1_exports);
|
|
@@ -3242,30 +3526,23 @@ var Generator = class _Generator {
|
|
|
3242
3526
|
/**
|
|
3243
3527
|
* Documentation base URL.
|
|
3244
3528
|
*/
|
|
3245
|
-
static DOCUMENTATION_BASE_URL = "https://aidc-toolkit.com/";
|
|
3529
|
+
static #DOCUMENTATION_BASE_URL = "https://aidc-toolkit.com/";
|
|
3246
3530
|
/**
|
|
3247
3531
|
* Documentation path, optionally preceded by locale.
|
|
3248
3532
|
*/
|
|
3249
|
-
static DOCUMENTATION_PATH = "app-extension/";
|
|
3533
|
+
static #DOCUMENTATION_PATH = "app-extension/";
|
|
3250
3534
|
/**
|
|
3251
3535
|
* Locales.
|
|
3252
3536
|
*/
|
|
3253
|
-
|
|
3537
|
+
#locales;
|
|
3254
3538
|
/**
|
|
3255
3539
|
* Default locale.
|
|
3256
3540
|
*/
|
|
3257
|
-
|
|
3541
|
+
#defaultLocale;
|
|
3258
3542
|
/**
|
|
3259
3543
|
* Map of function localizations maps by namespace function name.
|
|
3260
3544
|
*/
|
|
3261
|
-
|
|
3262
|
-
/**
|
|
3263
|
-
* Map of parameter localizations maps by namespace function parameter name.
|
|
3264
|
-
*/
|
|
3265
|
-
_parameterLocalizationsMapsMap = /* @__PURE__ */ new Map();
|
|
3266
|
-
/**
|
|
3267
|
-
*
|
|
3268
|
-
*/
|
|
3545
|
+
#functionLocalizationsMapsMap = /* @__PURE__ */ new Map();
|
|
3269
3546
|
/**
|
|
3270
3547
|
* Constructor.
|
|
3271
3548
|
*
|
|
@@ -3273,35 +3550,35 @@ var Generator = class _Generator {
|
|
|
3273
3550
|
* Include localizations if true.
|
|
3274
3551
|
*/
|
|
3275
3552
|
constructor(includeLocalizations = true) {
|
|
3276
|
-
this
|
|
3277
|
-
this
|
|
3553
|
+
this.#locales = includeLocalizations ? Object.keys(appExtensionResources) : [];
|
|
3554
|
+
this.#defaultLocale = this.#locales[0] ?? "";
|
|
3278
3555
|
}
|
|
3279
3556
|
/**
|
|
3280
3557
|
* Get the locales.
|
|
3281
3558
|
*/
|
|
3282
3559
|
get locales() {
|
|
3283
|
-
return this
|
|
3560
|
+
return this.#locales;
|
|
3284
3561
|
}
|
|
3285
3562
|
/**
|
|
3286
3563
|
* Get the default locale.
|
|
3287
3564
|
*/
|
|
3288
3565
|
get defaultLocale() {
|
|
3289
|
-
return this
|
|
3566
|
+
return this.#defaultLocale;
|
|
3290
3567
|
}
|
|
3291
3568
|
/**
|
|
3292
3569
|
* Get function localization.
|
|
3293
3570
|
*
|
|
3294
|
-
* @param namespaceFunctionName
|
|
3295
|
-
* Namespace function name.
|
|
3296
|
-
*
|
|
3297
3571
|
* @param locale
|
|
3298
3572
|
* Locale.
|
|
3299
3573
|
*
|
|
3574
|
+
* @param namespaceFunctionName
|
|
3575
|
+
* Namespace function name.
|
|
3576
|
+
*
|
|
3300
3577
|
* @returns
|
|
3301
3578
|
* Function localization.
|
|
3302
3579
|
*/
|
|
3303
|
-
getFunctionLocalization(
|
|
3304
|
-
const functionLocalization = this.
|
|
3580
|
+
getFunctionLocalization(locale, namespaceFunctionName) {
|
|
3581
|
+
const functionLocalization = this.#functionLocalizationsMapsMap.get(namespaceFunctionName)?.get(locale);
|
|
3305
3582
|
if (functionLocalization === void 0) {
|
|
3306
3583
|
throw new Error(`${locale} localization for function ${namespaceFunctionName} not found`);
|
|
3307
3584
|
}
|
|
@@ -3310,27 +3587,33 @@ var Generator = class _Generator {
|
|
|
3310
3587
|
/**
|
|
3311
3588
|
* Get parameter localization.
|
|
3312
3589
|
*
|
|
3590
|
+
* @param locale
|
|
3591
|
+
* Locale.
|
|
3592
|
+
*
|
|
3313
3593
|
* @param namespaceFunctionName
|
|
3314
3594
|
* Namespace function name.
|
|
3315
3595
|
*
|
|
3316
3596
|
* @param parameterName
|
|
3317
3597
|
* Parameter name.
|
|
3318
3598
|
*
|
|
3319
|
-
* @param locale
|
|
3320
|
-
* Locale.
|
|
3321
|
-
*
|
|
3322
3599
|
* @returns
|
|
3323
|
-
*
|
|
3600
|
+
* Parameter localization.
|
|
3324
3601
|
*/
|
|
3325
|
-
getParameterLocalization(namespaceFunctionName, parameterName
|
|
3326
|
-
const parameterLocalization = this.
|
|
3602
|
+
getParameterLocalization(locale, namespaceFunctionName, parameterName) {
|
|
3603
|
+
const parameterLocalization = this.getFunctionLocalization(locale, namespaceFunctionName).parametersMap.get(parameterName);
|
|
3327
3604
|
if (parameterLocalization === void 0) {
|
|
3328
3605
|
throw new Error(`${locale} localization for function ${namespaceFunctionName} parameter ${parameterName} not found`);
|
|
3329
3606
|
}
|
|
3330
3607
|
return parameterLocalization;
|
|
3331
3608
|
}
|
|
3332
3609
|
/**
|
|
3333
|
-
* Generate
|
|
3610
|
+
* Generate a localization.
|
|
3611
|
+
*
|
|
3612
|
+
* @template TLocalization
|
|
3613
|
+
* Localization type.
|
|
3614
|
+
*
|
|
3615
|
+
* @param locale
|
|
3616
|
+
* Locale.
|
|
3334
3617
|
*
|
|
3335
3618
|
* @param localizedKeyPrefix
|
|
3336
3619
|
* Localized key prefix.
|
|
@@ -3339,87 +3622,46 @@ var Generator = class _Generator {
|
|
|
3339
3622
|
* Callback to finalize localization.
|
|
3340
3623
|
*
|
|
3341
3624
|
* @returns
|
|
3342
|
-
* Localization
|
|
3625
|
+
* Localization.
|
|
3343
3626
|
*/
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
})];
|
|
3355
|
-
}));
|
|
3627
|
+
#generateLocalization(locale, localizedKeyPrefix, localizationCallback) {
|
|
3628
|
+
const lngOption = {
|
|
3629
|
+
lng: locale
|
|
3630
|
+
};
|
|
3631
|
+
return localizationCallback(locale, {
|
|
3632
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
3633
|
+
name: i18nextAppExtension.t(`${localizedKeyPrefix}name`, lngOption),
|
|
3634
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists.
|
|
3635
|
+
description: i18nextAppExtension.t(`${localizedKeyPrefix}description`, lngOption)
|
|
3636
|
+
});
|
|
3356
3637
|
}
|
|
3357
3638
|
/**
|
|
3358
3639
|
* Generate by processing individual imports.
|
|
3359
3640
|
*/
|
|
3360
3641
|
async generate() {
|
|
3361
3642
|
let success = false;
|
|
3362
|
-
await i18nAppExtensionInit(
|
|
3643
|
+
await i18nAppExtensionInit(import_core5.I18nEnvironments.CLI);
|
|
3363
3644
|
this.initialize();
|
|
3364
3645
|
try {
|
|
3365
|
-
for (const classDescriptor of
|
|
3646
|
+
for (const [_namespaceClassName, classDescriptor] of proxy.classDescriptorsMap.entries()) {
|
|
3366
3647
|
const namespace = classDescriptor.namespace;
|
|
3367
|
-
|
|
3368
|
-
const className = classDescriptor.name;
|
|
3369
|
-
const methodInfix = classDescriptor.methodInfix;
|
|
3370
|
-
const namespaceClassName = `${namespacePrefix}${className}`;
|
|
3371
|
-
const classNameMatch = /^([A-Z]+[0-9]*|[A-Z][^A-Z.]*)([A-Z][^.]*|)\.?([A-Z].*|)$/.exec(namespaceClassName);
|
|
3372
|
-
if (classNameMatch === null) {
|
|
3373
|
-
throw new Error(`${namespaceClassName} is not a valid namespace-qualified class name`);
|
|
3374
|
-
}
|
|
3375
|
-
const proxyObjectDescriptor = {
|
|
3376
|
-
namespace,
|
|
3377
|
-
className,
|
|
3378
|
-
namespaceClassName,
|
|
3379
|
-
classDescriptor,
|
|
3380
|
-
objectName: `${classNameMatch[1].toLowerCase()}${classNameMatch[2]}${classNameMatch[3]}`
|
|
3381
|
-
};
|
|
3382
|
-
this.createProxyObject(proxyObjectDescriptor);
|
|
3648
|
+
this.createProxyObject(classDescriptor);
|
|
3383
3649
|
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
3384
|
-
const
|
|
3385
|
-
const
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
}
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
const functionLocalizationsMap = this.generateLocalizationsMap(`Functions.${namespaceFunctionName}.`, (locale, localization) => ({
|
|
3400
|
-
...localization,
|
|
3401
|
-
documentationURL: `${_Generator.DOCUMENTATION_BASE_URL}${locale === this.defaultLocale ? "" : `${locale}/`}${_Generator.DOCUMENTATION_PATH}${namespace === void 0 ? "" : `${namespace}/`}${localization.name}.html`
|
|
3402
|
-
}));
|
|
3403
|
-
this._functionLocalizationsMapsMap.set(namespaceFunctionName, functionLocalizationsMap);
|
|
3404
|
-
this.createProxyFunction({
|
|
3405
|
-
...proxyObjectDescriptor,
|
|
3406
|
-
functionName,
|
|
3407
|
-
namespaceFunctionName,
|
|
3408
|
-
localizationsMap: functionLocalizationsMap,
|
|
3409
|
-
proxyParameterDescriptors: methodDescriptor.parameterDescriptors.map((parameterDescriptor) => {
|
|
3410
|
-
const expandedParameterDescriptor = expandParameterDescriptor(parameterDescriptor);
|
|
3411
|
-
const parameterName = expandedParameterDescriptor.name;
|
|
3412
|
-
const parameterLocalizationsMap = this.generateLocalizationsMap(`Parameters.${parameterName}.`, (_locale, localization) => localization);
|
|
3413
|
-
this._parameterLocalizationsMapsMap.set(`${namespaceFunctionName}.${parameterName}`, parameterLocalizationsMap);
|
|
3414
|
-
return {
|
|
3415
|
-
namespace,
|
|
3416
|
-
parameterName,
|
|
3417
|
-
localizationsMap: parameterLocalizationsMap,
|
|
3418
|
-
parameterDescriptor: expandedParameterDescriptor
|
|
3419
|
-
};
|
|
3420
|
-
}),
|
|
3421
|
-
methodDescriptor
|
|
3422
|
-
});
|
|
3650
|
+
const namespaceFunctionName = methodDescriptor.namespaceFunctionName;
|
|
3651
|
+
const functionLocalizationsMap = new Map(this.#locales.map(
|
|
3652
|
+
(locale) => [locale, this.#generateLocalization(locale, `Functions.${namespaceFunctionName}.`, (locale2, localization) => ({
|
|
3653
|
+
...localization,
|
|
3654
|
+
documentationURL: `${_Generator.#DOCUMENTATION_BASE_URL}${locale2 === this.defaultLocale ? "" : `${locale2}/`}${_Generator.#DOCUMENTATION_PATH}${namespace === void 0 ? "" : `${namespace}/`}${localization.name}.html`,
|
|
3655
|
+
parametersMap: new Map(methodDescriptor.parameterDescriptors.map(
|
|
3656
|
+
(parameterDescriptor) => (
|
|
3657
|
+
// eslint-disable-next-line max-nested-callbacks -- Callback is empty.
|
|
3658
|
+
[parameterDescriptor.name, this.#generateLocalization(locale2, `Parameters.${parameterDescriptor.name}.`, (_locale, localization2) => localization2)]
|
|
3659
|
+
)
|
|
3660
|
+
))
|
|
3661
|
+
}))]
|
|
3662
|
+
));
|
|
3663
|
+
this.#functionLocalizationsMapsMap.set(namespaceFunctionName, functionLocalizationsMap);
|
|
3664
|
+
this.createProxyFunction(classDescriptor, methodDescriptor, functionLocalizationsMap);
|
|
3423
3665
|
}
|
|
3424
3666
|
}
|
|
3425
3667
|
success = true;
|
|
@@ -3441,16 +3683,12 @@ var Generator = class _Generator {
|
|
|
3441
3683
|
HexadecimalProxy,
|
|
3442
3684
|
LibProxy,
|
|
3443
3685
|
NumericProxy,
|
|
3444
|
-
ProxyClass,
|
|
3445
|
-
ProxyMethod,
|
|
3446
|
-
ProxyParameter,
|
|
3447
3686
|
RegExpProxy,
|
|
3448
3687
|
TransformerProxy,
|
|
3449
3688
|
Types,
|
|
3450
3689
|
appExtensionNS,
|
|
3451
3690
|
appExtensionResources,
|
|
3452
3691
|
expandParameterDescriptor,
|
|
3453
|
-
getClassDescriptorsMap,
|
|
3454
3692
|
i18nAppExtensionInit,
|
|
3455
3693
|
i18nextAppExtension
|
|
3456
3694
|
});
|