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