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