@aidc-toolkit/app-extension 1.0.46 → 1.0.48-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-extension.d.ts +198 -0
- package/dist/app-extension.d.ts.map +1 -0
- package/dist/app-extension.js +133 -0
- package/dist/app-extension.js.map +1 -0
- package/dist/app-helper-proxy.d.ts +61 -0
- package/dist/app-helper-proxy.d.ts.map +1 -0
- package/dist/app-helper-proxy.js +333 -0
- package/dist/app-helper-proxy.js.map +1 -0
- package/dist/{descriptor-FJHoLlYK.d.cts → descriptor.d.ts} +13 -25
- package/dist/descriptor.d.ts.map +1 -0
- package/dist/descriptor.js +44 -0
- package/dist/descriptor.js.map +1 -0
- package/dist/generator/{index.d.cts → generator.d.ts} +9 -11
- package/dist/generator/generator.d.ts.map +1 -0
- package/dist/generator/generator.js +198 -0
- package/dist/generator/generator.js.map +1 -0
- package/dist/generator/index.d.ts +17 -125
- package/dist/generator/index.d.ts.map +1 -0
- package/dist/generator/index.js +2 -1
- package/dist/generator/index.js.map +1 -0
- package/dist/generator/locale-resources-generator.d.ts +2 -0
- package/dist/generator/locale-resources-generator.d.ts.map +1 -0
- package/dist/generator/locale-resources-generator.js +312 -0
- package/dist/generator/locale-resources-generator.js.map +1 -0
- package/dist/gs1/character-set-proxy.d.ts +13 -0
- package/dist/gs1/character-set-proxy.d.ts.map +1 -0
- package/dist/gs1/character-set-proxy.js +126 -0
- package/dist/gs1/character-set-proxy.js.map +1 -0
- package/dist/gs1/check-proxy.d.ts +11 -0
- package/dist/gs1/check-proxy.d.ts.map +1 -0
- package/dist/gs1/check-proxy.js +163 -0
- package/dist/gs1/check-proxy.js.map +1 -0
- package/dist/gs1/gcp-length-proxy.d.ts +11 -0
- package/dist/gs1/gcp-length-proxy.d.ts.map +1 -0
- package/dist/gs1/gcp-length-proxy.js +187 -0
- package/dist/gs1/gcp-length-proxy.js.map +1 -0
- package/dist/gs1/gtin-creator-proxy.d.ts +10 -0
- package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/gtin-creator-proxy.js +85 -0
- package/dist/gs1/gtin-creator-proxy.js.map +1 -0
- package/dist/gs1/gtin-descriptor.d.ts +3 -0
- package/dist/gs1/gtin-descriptor.d.ts.map +1 -0
- package/dist/gs1/gtin-descriptor.js +8 -0
- package/dist/gs1/gtin-descriptor.js.map +1 -0
- package/dist/gs1/gtin-validator-proxy.d.ts +26 -0
- package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/gtin-validator-proxy.js +256 -0
- package/dist/gs1/gtin-validator-proxy.js.map +1 -0
- package/dist/gs1/identifier-creator-proxy.d.ts +30 -0
- package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/identifier-creator-proxy.js +318 -0
- package/dist/gs1/identifier-creator-proxy.js.map +1 -0
- package/dist/gs1/identifier-descriptor.d.ts +4 -0
- package/dist/gs1/identifier-descriptor.d.ts.map +1 -0
- package/dist/gs1/identifier-descriptor.js +14 -0
- package/dist/gs1/identifier-descriptor.js.map +1 -0
- package/dist/gs1/identifier-type.d.ts +22 -0
- package/dist/gs1/identifier-type.d.ts.map +1 -0
- package/dist/gs1/identifier-type.js +34 -0
- package/dist/gs1/identifier-type.js.map +1 -0
- package/dist/gs1/identifier-validator-proxy.d.ts +29 -0
- package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/identifier-validator-proxy.js +212 -0
- package/dist/gs1/identifier-validator-proxy.js.map +1 -0
- package/dist/gs1/index.d.ts +11 -0
- package/dist/gs1/index.d.ts.map +1 -0
- package/dist/gs1/index.js +11 -0
- package/dist/gs1/index.js.map +1 -0
- package/dist/gs1/non-gtin-creator-proxy.d.ts +38 -0
- package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -0
- package/dist/gs1/non-gtin-creator-proxy.js +301 -0
- package/dist/gs1/non-gtin-creator-proxy.js.map +1 -0
- package/dist/gs1/non-gtin-validator-proxy.d.ts +37 -0
- package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -0
- package/dist/gs1/non-gtin-validator-proxy.js +302 -0
- package/dist/gs1/non-gtin-validator-proxy.js.map +1 -0
- package/dist/gs1/prefix-definition-descriptor.d.ts +4 -0
- package/dist/gs1/prefix-definition-descriptor.d.ts.map +1 -0
- package/dist/gs1/prefix-definition-descriptor.js +16 -0
- package/dist/gs1/prefix-definition-descriptor.js.map +1 -0
- package/dist/gs1/prefix-manager-proxy.d.ts +8 -0
- package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
- package/dist/gs1/prefix-manager-proxy.js +94 -0
- package/dist/gs1/prefix-manager-proxy.js.map +1 -0
- package/dist/gs1/variable-measure-proxy.d.ts +7 -0
- package/dist/gs1/variable-measure-proxy.d.ts.map +1 -0
- package/dist/gs1/variable-measure-proxy.js +114 -0
- package/dist/gs1/variable-measure-proxy.js.map +1 -0
- package/dist/gs1/verified-by-gs1-proxy.d.ts +7 -0
- package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -0
- package/dist/gs1/verified-by-gs1-proxy.js +106 -0
- package/dist/gs1/verified-by-gs1-proxy.js.map +1 -0
- package/dist/index.d.ts +25 -1557
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -0
- package/dist/lib-proxy.d.ts +135 -0
- package/dist/lib-proxy.d.ts.map +1 -0
- package/dist/lib-proxy.js +276 -0
- package/dist/lib-proxy.js.map +1 -0
- package/dist/locale/en/locale-resources.d.ts +755 -0
- package/dist/locale/en/locale-resources.d.ts.map +1 -0
- package/dist/locale/en/locale-resources.js +754 -0
- package/dist/locale/en/locale-resources.js.map +1 -0
- package/dist/locale/fr/locale-resources.d.ts +755 -0
- package/dist/locale/fr/locale-resources.d.ts.map +1 -0
- package/dist/locale/fr/locale-resources.js +754 -0
- package/dist/locale/fr/locale-resources.js.map +1 -0
- package/dist/locale/i18n.d.ts +27 -0
- package/dist/locale/i18n.d.ts.map +1 -0
- package/dist/locale/i18n.js +36 -0
- package/dist/locale/i18n.js.map +1 -0
- package/dist/proxy.d.ts +136 -0
- package/dist/proxy.d.ts.map +1 -0
- package/dist/proxy.js +291 -0
- package/dist/proxy.js.map +1 -0
- package/dist/streaming.d.ts +10 -0
- package/dist/streaming.d.ts.map +1 -0
- package/dist/streaming.js +2 -0
- package/dist/streaming.js.map +1 -0
- package/dist/type.d.ts +91 -0
- package/dist/type.d.ts.map +1 -0
- package/dist/type.js +2 -0
- package/dist/type.js.map +1 -0
- package/dist/utility/character-set-descriptor.d.ts +6 -0
- package/dist/utility/character-set-descriptor.d.ts.map +1 -0
- package/dist/utility/character-set-descriptor.js +28 -0
- package/dist/utility/character-set-descriptor.js.map +1 -0
- package/dist/utility/character-set-proxy.d.ts +31 -0
- package/dist/utility/character-set-proxy.d.ts.map +1 -0
- package/dist/utility/character-set-proxy.js +278 -0
- package/dist/utility/character-set-proxy.js.map +1 -0
- package/dist/utility/index.d.ts +4 -0
- package/dist/utility/index.d.ts.map +1 -0
- package/dist/utility/index.js +4 -0
- package/dist/utility/index.js.map +1 -0
- package/dist/utility/reg-exp-proxy.d.ts +8 -0
- package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
- package/dist/utility/reg-exp-proxy.js +103 -0
- package/dist/utility/reg-exp-proxy.js.map +1 -0
- package/dist/utility/string-descriptor.d.ts +4 -0
- package/dist/utility/string-descriptor.d.ts.map +1 -0
- package/dist/utility/string-descriptor.js +12 -0
- package/dist/utility/string-descriptor.js.map +1 -0
- package/dist/utility/string-proxy.d.ts +7 -0
- package/dist/utility/string-proxy.d.ts.map +1 -0
- package/dist/utility/string-proxy.js +63 -0
- package/dist/utility/string-proxy.js.map +1 -0
- package/dist/utility/transformer-descriptor.d.ts +6 -0
- package/dist/utility/transformer-descriptor.d.ts.map +1 -0
- package/dist/utility/transformer-descriptor.js +24 -0
- package/dist/utility/transformer-descriptor.js.map +1 -0
- package/dist/utility/transformer-proxy.d.ts +9 -0
- package/dist/utility/transformer-proxy.d.ts.map +1 -0
- package/dist/utility/transformer-proxy.js +111 -0
- package/dist/utility/transformer-proxy.js.map +1 -0
- package/package.json +6 -5
- package/src/app-extension.ts +6 -0
- package/src/descriptor.ts +0 -15
- package/src/generator/generator.ts +28 -17
- package/src/gs1/gcp-length-proxy.ts +1 -4
- package/src/gs1/identifier-creator-proxy.ts +21 -2
- package/src/index.ts +0 -1
- package/src/locale/en/locale-resources.ts +3 -0
- package/src/locale/fr/locale-resources.ts +4 -1
- package/src/proxy.ts +5 -11
- package/tsconfig-src.tsbuildinfo +1 -1
- package/tsup.config.ts +1 -1
- package/dist/chunk-FAD3UX6B.js +0 -1
- package/dist/descriptor-FJHoLlYK.d.ts +0 -197
- package/dist/generator/index.cjs +0 -17
- package/dist/index.cjs +0 -17
- package/dist/index.d.cts +0 -1557
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
2
|
+
export const sParameterDescriptor = {
|
|
3
|
+
name: "s",
|
|
4
|
+
type: Types.String,
|
|
5
|
+
multiplicity: Multiplicities.Matrix,
|
|
6
|
+
isRequired: true
|
|
7
|
+
};
|
|
8
|
+
export const validateSParameterDescriptor = {
|
|
9
|
+
extendsDescriptor: sParameterDescriptor,
|
|
10
|
+
name: "validateS"
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=string-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-descriptor.js","sourceRoot":"","sources":["../../src/utility/string-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEpH,MAAM,CAAC,MAAM,oBAAoB,GAAwB;IACrD,IAAI,EAAE,GAAG;IACT,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,MAAM;IACnC,UAAU,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAA+B;IACpE,iBAAiB,EAAE,oBAAoB;IACvC,IAAI,EAAE,WAAW;CACpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StringValidation, StringValidator } from "@aidc-toolkit/utility";
|
|
2
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
3
|
+
import type { ErrorExtends, Matrix } from "../type.js";
|
|
4
|
+
export declare abstract class StringProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
5
|
+
protected validateString<TStringValidation extends StringValidation>(validator: StringValidator<TStringValidation>, matrixSs: Matrix<string>, validation?: TStringValidation): Matrix<string>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=string-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAEvD,8BAGsB,WAAW,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAE,SAAQ,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAC;IAC3P,SAAS,CAAC,cAAc,CAAC,iBAAiB,SAAS,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC;CAKhM"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
4
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
5
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
6
|
+
var _, done = false;
|
|
7
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
8
|
+
var context = {};
|
|
9
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
10
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
11
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
12
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
13
|
+
if (kind === "accessor") {
|
|
14
|
+
if (result === void 0) continue;
|
|
15
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
16
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
17
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
18
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
19
|
+
}
|
|
20
|
+
else if (_ = accept(result)) {
|
|
21
|
+
if (kind === "field") initializers.unshift(_);
|
|
22
|
+
else descriptor[key] = _;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
26
|
+
done = true;
|
|
27
|
+
};
|
|
28
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
29
|
+
var useValue = arguments.length > 2;
|
|
30
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
31
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
32
|
+
}
|
|
33
|
+
return useValue ? value : void 0;
|
|
34
|
+
};
|
|
35
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
36
|
+
import { proxy } from "../proxy.js";
|
|
37
|
+
let StringProxy = (() => {
|
|
38
|
+
let _classDecorators = [proxy.describeClass(true, {
|
|
39
|
+
category: "string"
|
|
40
|
+
})];
|
|
41
|
+
let _classDescriptor;
|
|
42
|
+
let _classExtraInitializers = [];
|
|
43
|
+
let _classThis;
|
|
44
|
+
let _classSuper = LibProxy;
|
|
45
|
+
var StringProxy = class extends _classSuper {
|
|
46
|
+
static { _classThis = this; }
|
|
47
|
+
static {
|
|
48
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
49
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
50
|
+
StringProxy = _classThis = _classDescriptor.value;
|
|
51
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
52
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
53
|
+
}
|
|
54
|
+
validateString(validator, matrixSs, validation) {
|
|
55
|
+
return this.matrixErrorResult(matrixSs, (s) => {
|
|
56
|
+
validator.validate(s, validation);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
return StringProxy = _classThis;
|
|
61
|
+
})();
|
|
62
|
+
export { StringProxy };
|
|
63
|
+
//# sourceMappingURL=string-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string-proxy.js","sourceRoot":"","sources":["../../src/utility/string-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;IAMd,WAAW;4BAHhC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE;YACvB,QAAQ,EAAE,QAAQ;SACrB,CAAC;;;;sBACuK,QAAQ;2BAAhB,SAAQ,WAAsF;;;;YAA/P,6KAMC;;;YANqB,uDAAW;;QACnB,cAAc,CAA6C,SAA6C,EAAE,QAAwB,EAAE,UAA8B;YACxK,OAAO,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBAC1C,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;YACtC,CAAC,CAAC,CAAC;QACP,CAAC;;;;SALiB,WAAW"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ExtendsParameterDescriptor, type ParameterDescriptor } from "../descriptor.js";
|
|
2
|
+
export declare const valueParameterDescriptor: ParameterDescriptor;
|
|
3
|
+
export declare const startValueParameterDescriptor: ExtendsParameterDescriptor;
|
|
4
|
+
export declare const countParameterDescriptor: ExtendsParameterDescriptor;
|
|
5
|
+
export declare const tweakParameterDescriptor: ParameterDescriptor;
|
|
6
|
+
//# sourceMappingURL=transformer-descriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-descriptor.d.ts","sourceRoot":"","sources":["../../src/utility/transformer-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,0BAA0B,EAAkB,KAAK,mBAAmB,EAAS,MAAM,kBAAkB,CAAC;AAEpH,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,0BAI3C,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,0BAItC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,mBAKtC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
2
|
+
export const valueParameterDescriptor = {
|
|
3
|
+
name: "value",
|
|
4
|
+
type: Types.Number,
|
|
5
|
+
multiplicity: Multiplicities.Matrix,
|
|
6
|
+
isRequired: true
|
|
7
|
+
};
|
|
8
|
+
export const startValueParameterDescriptor = {
|
|
9
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
10
|
+
name: "startValue",
|
|
11
|
+
multiplicity: Multiplicities.Singleton
|
|
12
|
+
};
|
|
13
|
+
export const countParameterDescriptor = {
|
|
14
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
15
|
+
name: "count",
|
|
16
|
+
multiplicity: Multiplicities.Singleton
|
|
17
|
+
};
|
|
18
|
+
export const tweakParameterDescriptor = {
|
|
19
|
+
name: "tweak",
|
|
20
|
+
type: Types.Number,
|
|
21
|
+
multiplicity: Multiplicities.Singleton,
|
|
22
|
+
isRequired: false
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=transformer-descriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-descriptor.js","sourceRoot":"","sources":["../../src/utility/transformer-descriptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEpH,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IACzD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,MAAM;IACnC,UAAU,EAAE,IAAI;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,6BAA6B,GAA+B;IACrE,iBAAiB,EAAE,wBAAwB;IAC3C,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,cAAc,CAAC,SAAS;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAA+B;IAChE,iBAAiB,EAAE,wBAAwB;IAC3C,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,cAAc,CAAC,SAAS;CACzC,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAwB;IACzD,IAAI,EAAE,OAAO;IACb,IAAI,EAAE,KAAK,CAAC,MAAM;IAClB,YAAY,EAAE,cAAc,CAAC,SAAS;IACtC,UAAU,EAAE,KAAK;CACpB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Nullishable } from "@aidc-toolkit/core";
|
|
2
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
3
|
+
import type { ErrorExtends, Matrix, MatrixResult } from "../type.js";
|
|
4
|
+
export declare class TransformerProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
|
|
5
|
+
forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
6
|
+
forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
7
|
+
reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<TBigInt, ThrowError, TError>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=transformer-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-proxy.d.ts","sourceRoot":"","sources":["../../src/utility/transformer-proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoBrE,qBAIa,gBAAgB,CAAC,UAAU,SAAS,OAAO,EAAE,MAAM,SAAS,YAAY,CAAC,UAAU,CAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAE,SAAQ,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,OAAO,CAAC;IAMvP,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IAcvJ,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;IAa3J,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,uBAAuB,EAAE,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,YAAY,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC;CAOrK"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
35
|
+
import { mapIterable, Sequence, Transformer } from "@aidc-toolkit/utility";
|
|
36
|
+
import { Multiplicities, Types } from "../descriptor.js";
|
|
37
|
+
import { LibProxy } from "../lib-proxy.js";
|
|
38
|
+
import { proxy } from "../proxy.js";
|
|
39
|
+
import { countParameterDescriptor, startValueParameterDescriptor, tweakParameterDescriptor, valueParameterDescriptor } from "./transformer-descriptor.js";
|
|
40
|
+
const domainParameterDescriptor = {
|
|
41
|
+
name: "domain",
|
|
42
|
+
type: Types.Number,
|
|
43
|
+
multiplicity: Multiplicities.Singleton,
|
|
44
|
+
isRequired: true
|
|
45
|
+
};
|
|
46
|
+
const transformedValueParameterDescriptor = {
|
|
47
|
+
extendsDescriptor: valueParameterDescriptor,
|
|
48
|
+
name: "transformedValue"
|
|
49
|
+
};
|
|
50
|
+
let TransformerProxy = (() => {
|
|
51
|
+
let _classDecorators = [proxy.describeClass(false, {
|
|
52
|
+
category: "transformation",
|
|
53
|
+
methodInfix: "Transform"
|
|
54
|
+
})];
|
|
55
|
+
let _classDescriptor;
|
|
56
|
+
let _classExtraInitializers = [];
|
|
57
|
+
let _classThis;
|
|
58
|
+
let _classSuper = LibProxy;
|
|
59
|
+
let _instanceExtraInitializers = [];
|
|
60
|
+
let _forward_decorators;
|
|
61
|
+
let _forwardSequence_decorators;
|
|
62
|
+
let _reverse_decorators;
|
|
63
|
+
var TransformerProxy = class extends _classSuper {
|
|
64
|
+
static { _classThis = this; }
|
|
65
|
+
static {
|
|
66
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
67
|
+
_forward_decorators = [proxy.describeMethod({
|
|
68
|
+
type: Types.Number,
|
|
69
|
+
multiplicity: Multiplicities.Matrix,
|
|
70
|
+
parameterDescriptors: [domainParameterDescriptor, valueParameterDescriptor, tweakParameterDescriptor]
|
|
71
|
+
})];
|
|
72
|
+
_forwardSequence_decorators = [proxy.describeMethod({
|
|
73
|
+
infixBefore: "Sequence",
|
|
74
|
+
type: Types.Number,
|
|
75
|
+
multiplicity: Multiplicities.Array,
|
|
76
|
+
parameterDescriptors: [domainParameterDescriptor, startValueParameterDescriptor, countParameterDescriptor, tweakParameterDescriptor]
|
|
77
|
+
})];
|
|
78
|
+
_reverse_decorators = [proxy.describeMethod({
|
|
79
|
+
type: Types.Number,
|
|
80
|
+
multiplicity: Multiplicities.Matrix,
|
|
81
|
+
parameterDescriptors: [domainParameterDescriptor, transformedValueParameterDescriptor, tweakParameterDescriptor]
|
|
82
|
+
})];
|
|
83
|
+
__esDecorate(this, null, _forward_decorators, { kind: "method", name: "forward", static: false, private: false, access: { has: obj => "forward" in obj, get: obj => obj.forward }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
84
|
+
__esDecorate(this, null, _forwardSequence_decorators, { kind: "method", name: "forwardSequence", static: false, private: false, access: { has: obj => "forwardSequence" in obj, get: obj => obj.forwardSequence }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
85
|
+
__esDecorate(this, null, _reverse_decorators, { kind: "method", name: "reverse", static: false, private: false, access: { has: obj => "reverse" in obj, get: obj => obj.reverse }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
86
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
87
|
+
TransformerProxy = _classThis = _classDescriptor.value;
|
|
88
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
89
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
90
|
+
}
|
|
91
|
+
forward(domain, matrixValues, tweak) {
|
|
92
|
+
return this.setUpMatrixResult(() => Transformer.get(domain, tweak ?? undefined), matrixValues, (transformer, value) => this.mapBigInt(transformer.forward(value)));
|
|
93
|
+
}
|
|
94
|
+
forwardSequence(domain, startValue, count, tweak) {
|
|
95
|
+
return this.iterableResult(() => {
|
|
96
|
+
this.appExtension.validateSequenceCount(count);
|
|
97
|
+
return mapIterable(Transformer.get(domain, tweak ?? undefined).forward(new Sequence(startValue, count)), value => this.mapBigInt(value));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
reverse(domain, matrixTransformedValues, tweak) {
|
|
101
|
+
return this.setUpMatrixResult(() => Transformer.get(domain, tweak ?? undefined), matrixTransformedValues, (transformer, transformedValue) => this.mapBigInt(transformer.reverse(transformedValue)));
|
|
102
|
+
}
|
|
103
|
+
constructor() {
|
|
104
|
+
super(...arguments);
|
|
105
|
+
__runInitializers(this, _instanceExtraInitializers);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
return TransformerProxy = _classThis;
|
|
109
|
+
})();
|
|
110
|
+
export { TransformerProxy };
|
|
111
|
+
//# sourceMappingURL=transformer-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transformer-proxy.js","sourceRoot":"","sources":["../../src/utility/transformer-proxy.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aidc-toolkit/app-extension",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48-beta",
|
|
4
4
|
"description": "Application extension framework for AIDC Toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": "./dist/index.js",
|
|
9
|
+
"./gs1": "./dist/gs1/index.js",
|
|
9
10
|
"./generator": "./dist/generator/index.js"
|
|
10
11
|
},
|
|
11
12
|
"homepage": "https://aidc-toolkit.com",
|
|
@@ -33,11 +34,11 @@
|
|
|
33
34
|
"generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@aidc-toolkit/dev": "
|
|
37
|
+
"@aidc-toolkit/dev": "1.0.42-beta"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"@aidc-toolkit/core": "
|
|
40
|
-
"@aidc-toolkit/gs1": "
|
|
41
|
-
"@aidc-toolkit/utility": "
|
|
40
|
+
"@aidc-toolkit/core": "1.0.43-beta",
|
|
41
|
+
"@aidc-toolkit/gs1": "1.0.45-beta",
|
|
42
|
+
"@aidc-toolkit/utility": "1.0.44-beta"
|
|
42
43
|
}
|
|
43
44
|
}
|
package/src/app-extension.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
type AppDataStorage,
|
|
3
3
|
getLogger,
|
|
4
|
+
type HTTPFetch,
|
|
4
5
|
type Hyperlink,
|
|
5
6
|
LogLevels,
|
|
6
7
|
MemoryTransport,
|
|
@@ -233,6 +234,11 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
|
|
|
233
234
|
*/
|
|
234
235
|
abstract get sharedAppDataStorage(): AppDataStorage<boolean>;
|
|
235
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Get HTTP fetch function.
|
|
239
|
+
*/
|
|
240
|
+
abstract get httpFetch(): HTTPFetch;
|
|
241
|
+
|
|
236
242
|
/**
|
|
237
243
|
* Validate a sequence count against the maximum supported by application.
|
|
238
244
|
*
|
package/src/descriptor.ts
CHANGED
|
@@ -163,11 +163,6 @@ export interface MethodDescriptor extends TypeDescriptor {
|
|
|
163
163
|
*/
|
|
164
164
|
readonly isStream?: true;
|
|
165
165
|
|
|
166
|
-
/**
|
|
167
|
-
* Number of characters to capitalize at the start of the method name for title case; defaults to 1.
|
|
168
|
-
*/
|
|
169
|
-
readonly titleCaseStart?: number;
|
|
170
|
-
|
|
171
166
|
/**
|
|
172
167
|
* If true, method infix is ignored.
|
|
173
168
|
*/
|
|
@@ -188,11 +183,6 @@ export interface MethodDescriptor extends TypeDescriptor {
|
|
|
188
183
|
* Function name with optional infix.
|
|
189
184
|
*/
|
|
190
185
|
readonly functionName: string;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* Function name in optional namespace with optional infix.
|
|
194
|
-
*/
|
|
195
|
-
readonly namespaceFunctionName: string;
|
|
196
186
|
}
|
|
197
187
|
|
|
198
188
|
/**
|
|
@@ -219,11 +209,6 @@ export interface ClassDescriptor extends Descriptor {
|
|
|
219
209
|
*/
|
|
220
210
|
readonly replacementParameterDescriptors?: ReplacementParameterDescriptor[];
|
|
221
211
|
|
|
222
|
-
/**
|
|
223
|
-
* Class name in optional namespace.
|
|
224
|
-
*/
|
|
225
|
-
readonly namespaceClassName: string;
|
|
226
|
-
|
|
227
212
|
/**
|
|
228
213
|
* Method descriptors.
|
|
229
214
|
*/
|
|
@@ -39,9 +39,9 @@ export interface Localization {
|
|
|
39
39
|
*/
|
|
40
40
|
export interface FunctionLocalization extends Localization {
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
42
|
+
* Name in title case.
|
|
43
43
|
*/
|
|
44
|
-
readonly
|
|
44
|
+
readonly titleCaseName: string;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Documentation URL.
|
|
@@ -205,14 +205,21 @@ export abstract class Generator {
|
|
|
205
205
|
* @returns
|
|
206
206
|
* Localization.
|
|
207
207
|
*/
|
|
208
|
-
static #generateLocalization<TLocalization extends Localization>(locale: string, key: string, localizationCallback: (locale: string, localization: Localization) => TLocalization): TLocalization {
|
|
208
|
+
static #generateLocalization<TLocalization extends Localization>(locale: string, key: string, localizationCallback: (locale: string, localization: Localization & Partial<TLocalization>) => TLocalization): TLocalization {
|
|
209
209
|
const lngReturnObjectsOption = {
|
|
210
210
|
lng: locale,
|
|
211
211
|
returnObjects: true
|
|
212
212
|
} as const;
|
|
213
213
|
|
|
214
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion --
|
|
215
|
-
|
|
214
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Assume localized key exists.
|
|
215
|
+
const parseKey = key as ParseKeys<DefaultNamespace, typeof lngReturnObjectsOption>;
|
|
216
|
+
|
|
217
|
+
if (!i18nextAppExtension.exists(parseKey, lngReturnObjectsOption)) {
|
|
218
|
+
throw new Error(`Missing localization for ${key} in ${locale}`);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Localized key exists and return type is Localization & Partial<TLocalization>.
|
|
222
|
+
return localizationCallback(locale, i18nextAppExtension.t(key as ParseKeys<DefaultNamespace, typeof lngReturnObjectsOption>, lngReturnObjectsOption) as Localization & Partial<TLocalization>);
|
|
216
223
|
}
|
|
217
224
|
|
|
218
225
|
/**
|
|
@@ -278,7 +285,7 @@ export abstract class Generator {
|
|
|
278
285
|
const namespaceClassNamesSet = new Set<string>();
|
|
279
286
|
|
|
280
287
|
for (const classDescriptor of classDescriptors) {
|
|
281
|
-
const namespaceClassName = classDescriptor.
|
|
288
|
+
const namespaceClassName = `${namespacePrefix}${classDescriptor.name}`;
|
|
282
289
|
|
|
283
290
|
if (namespaceClassNamesSet.has(namespaceClassName)) {
|
|
284
291
|
throw new Error(`Duplicate class ${namespaceClassName}`);
|
|
@@ -306,17 +313,21 @@ export abstract class Generator {
|
|
|
306
313
|
this.createProxyObject(`${objectNameGroups["namespaceFirstWord"].toLowerCase()}${objectNameGroups["namespaceRemaining"]}${objectNameGroups["className"]}`, classDescriptor);
|
|
307
314
|
|
|
308
315
|
for (const methodDescriptor of classDescriptor.methodDescriptors) {
|
|
309
|
-
const functionLocalizationsMap = new Map(
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
316
|
+
const functionLocalizationsMap = new Map(methodDescriptor.isHidden !== true ?
|
|
317
|
+
this.locales.map(locale =>
|
|
318
|
+
[locale, Generator.#generateLocalization<FunctionLocalization>(locale, `Functions.${namespacePrefix}${methodDescriptor.functionName}`, (locale, localization) => ({
|
|
319
|
+
...localization,
|
|
320
|
+
titleCaseName: localization.titleCaseName ?? `${localization.name.substring(0, 1).toUpperCase()}${localization.name.substring(1)}`,
|
|
321
|
+
documentationURL: `${documentationBaseURL}/${locale === this.defaultLocale ? "" : `${locale}/`}${Generator.#DOCUMENTATION_PATH}${namespacePath}${localization.name}.html`,
|
|
322
|
+
parametersMap: new Map(methodDescriptor.parameterDescriptors.map(parameterDescriptor =>
|
|
323
|
+
// eslint-disable-next-line max-nested-callbacks -- Callback is empty.
|
|
324
|
+
[parameterDescriptor.name, Generator.#generateLocalization(locale, `Parameters.${parameterDescriptor.name}`, (_locale, localization) => localization)]
|
|
325
|
+
))
|
|
326
|
+
}))]
|
|
327
|
+
) :
|
|
328
|
+
// Hidden methods are not localized.
|
|
329
|
+
[]
|
|
330
|
+
);
|
|
320
331
|
|
|
321
332
|
this.createProxyFunction(classDescriptor, methodDescriptor, functionLocalizationsMap);
|
|
322
333
|
}
|
|
@@ -29,7 +29,7 @@ class AppExtensionGCPLengthCache<ThrowError extends boolean, TError extends Erro
|
|
|
29
29
|
* Application extension.
|
|
30
30
|
*/
|
|
31
31
|
constructor(appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) {
|
|
32
|
-
super(appExtension.sharedAppDataStorage);
|
|
32
|
+
super(appExtension.sharedAppDataStorage, RemoteGCPLengthCache.DEFAULT_BASE_URL, appExtension.httpFetch);
|
|
33
33
|
|
|
34
34
|
this.#logger = appExtension.logger;
|
|
35
35
|
}
|
|
@@ -126,7 +126,6 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
126
126
|
type: Types.Number,
|
|
127
127
|
multiplicity: Multiplicities.Matrix,
|
|
128
128
|
isAsync: true,
|
|
129
|
-
titleCaseStart: 3,
|
|
130
129
|
parameterDescriptors: [identifierTypeParameterDescriptor, gcpLengthIdentifierParameterDescriptor]
|
|
131
130
|
})
|
|
132
131
|
async gcpLengthOf(identifierType: string, matrixIdentifiers: Matrix<string>): Promise<MatrixResult<number, ThrowError, TError>> {
|
|
@@ -141,7 +140,6 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
141
140
|
type: Types.String,
|
|
142
141
|
multiplicity: Multiplicities.Singleton,
|
|
143
142
|
isAsync: true,
|
|
144
|
-
titleCaseStart: 3,
|
|
145
143
|
parameterDescriptors: []
|
|
146
144
|
})
|
|
147
145
|
async gcpLengthDateTime(): Promise<SingletonResult<string, ThrowError, TError>> {
|
|
@@ -154,7 +152,6 @@ export class GCPLengthProxy<ThrowError extends boolean, TError extends ErrorExte
|
|
|
154
152
|
type: Types.String,
|
|
155
153
|
multiplicity: Multiplicities.Singleton,
|
|
156
154
|
isAsync: true,
|
|
157
|
-
titleCaseStart: 3,
|
|
158
155
|
parameterDescriptors: []
|
|
159
156
|
})
|
|
160
157
|
async gcpLengthDisclaimer(): Promise<SingletonResult<string, ThrowError, TError>> {
|
|
@@ -65,13 +65,32 @@ abstract class IdentifierCreatorProxy<ThrowError extends boolean, TError extends
|
|
|
65
65
|
if (reducedPrefixDefinition.length > 3) {
|
|
66
66
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixDefinitionMustHaveMaximumThreeElements"));
|
|
67
67
|
}
|
|
68
|
+
|
|
68
69
|
const prefix = reducedPrefixDefinition[0];
|
|
69
70
|
|
|
70
71
|
if (typeof prefix !== "string") {
|
|
71
72
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixMustBeString"));
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Get a prefix definition value if not nullish, not zero, and not an empty string.
|
|
77
|
+
*
|
|
78
|
+
* @param index
|
|
79
|
+
* Index into prefix definition.
|
|
80
|
+
*
|
|
81
|
+
* @param defaultValue
|
|
82
|
+
* Default value.
|
|
83
|
+
*
|
|
84
|
+
* @returns
|
|
85
|
+
* Prefix definition value.
|
|
86
|
+
*/
|
|
87
|
+
function getPrefixDefinitionValue(index: number, defaultValue: unknown): unknown {
|
|
88
|
+
const prefixDefinitionValue = reducedPrefixDefinition[index];
|
|
89
|
+
|
|
90
|
+
return !isNullish(prefixDefinitionValue) && prefixDefinitionValue !== 0 && prefixDefinitionValue !== "" ? prefixDefinitionValue : defaultValue;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const prefixTypeIndex = getPrefixDefinitionValue(1, 0);
|
|
75
94
|
|
|
76
95
|
if (typeof prefixTypeIndex !== "number" || prefixTypeIndex < 0 || prefixTypeIndex >= IdentifierCreatorProxy.#PREFIX_TYPES.length) {
|
|
77
96
|
throw new RangeError(i18nextAppExtension.t("IdentifierCreatorProxy.prefixTypeMustBeNumber", {
|
|
@@ -88,7 +107,7 @@ abstract class IdentifierCreatorProxy<ThrowError extends boolean, TError extends
|
|
|
88
107
|
|
|
89
108
|
const prefixManager = PrefixManager.get(prefixType, prefix);
|
|
90
109
|
|
|
91
|
-
const tweakFactor =
|
|
110
|
+
const tweakFactor = getPrefixDefinitionValue(2, null);
|
|
92
111
|
|
|
93
112
|
if (!isNullish(tweakFactor)) {
|
|
94
113
|
if (typeof tweakFactor !== "number") {
|
package/src/index.ts
CHANGED
|
@@ -735,14 +735,17 @@ export default {
|
|
|
735
735
|
},
|
|
736
736
|
gcpLengthOf: {
|
|
737
737
|
name: "gcpLengthOf",
|
|
738
|
+
titleCaseName: "GCPLengthOf",
|
|
738
739
|
description: "Get the length of a GS1 Company Prefix for an identifier."
|
|
739
740
|
},
|
|
740
741
|
gcpLengthDateTime: {
|
|
741
742
|
name: "gcpLengthDateTime",
|
|
743
|
+
titleCaseName: "GCPLengthDateTime",
|
|
742
744
|
description: "Get the date and time the GS1 Company Prefix length data was last updated."
|
|
743
745
|
},
|
|
744
746
|
gcpLengthDisclaimer: {
|
|
745
747
|
name: "gcpLengthDisclaimer",
|
|
748
|
+
titleCaseName: "GCPLengthDisclaimer",
|
|
746
749
|
description: "Get the disclaimer for the GS1 Company Prefix length data."
|
|
747
750
|
}
|
|
748
751
|
}
|
|
@@ -731,18 +731,21 @@ export default {
|
|
|
731
731
|
},
|
|
732
732
|
verifiedByGS1: {
|
|
733
733
|
name: "verifiedByGS1",
|
|
734
|
-
description: "Créer un lien hypertexte «
|
|
734
|
+
description: "Créer un lien hypertexte «Verified by GS1»."
|
|
735
735
|
},
|
|
736
736
|
gcpLengthOf: {
|
|
737
737
|
name: "longueurGCPDe",
|
|
738
|
+
titleCaseName: undefined,
|
|
738
739
|
description: "Obtenez la longueur du préfixe d'entreprise GS1 pour un identifiant."
|
|
739
740
|
},
|
|
740
741
|
gcpLengthDateTime: {
|
|
741
742
|
name: "dateHeureLongueurGCP",
|
|
743
|
+
titleCaseName: undefined,
|
|
742
744
|
description: "Obtenez la date et l'heure de la dernière mise à jour des données relatives à la longueur du préfixe d'entreprise GS1."
|
|
743
745
|
},
|
|
744
746
|
gcpLengthDisclaimer: {
|
|
745
747
|
name: "avertissementLongueurGCP",
|
|
748
|
+
titleCaseName: undefined,
|
|
746
749
|
description: "Obtenez l'avertissement relatif aux données sur la longueur des préfixes d'entreprise GS1."
|
|
747
750
|
}
|
|
748
751
|
}
|
package/src/proxy.ts
CHANGED
|
@@ -83,7 +83,7 @@ type ClassMethodDecorator<TThis, TArguments extends unknown[], TReturn> =
|
|
|
83
83
|
/**
|
|
84
84
|
* Subset of method descriptor used during decoration process.
|
|
85
85
|
*/
|
|
86
|
-
type InterimMethodDescriptor = Omit<MethodDescriptor, "functionName"
|
|
86
|
+
type InterimMethodDescriptor = Omit<MethodDescriptor, "functionName">;
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Subset of method descriptor used in call to decorator.
|
|
@@ -95,7 +95,7 @@ interface DecoratorMethodDescriptor extends Omit<InterimMethodDescriptor, "name"
|
|
|
95
95
|
/**
|
|
96
96
|
* Subset of class descriptor used during decoration process.
|
|
97
97
|
*/
|
|
98
|
-
interface InterimClassDescriptor extends Omit<ClassDescriptor, "name" | "category" | "
|
|
98
|
+
interface InterimClassDescriptor extends Omit<ClassDescriptor, "name" | "category" | "objectName" | "methodDescriptors"> {
|
|
99
99
|
readonly category?: string;
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -330,15 +330,10 @@ export class Proxy {
|
|
|
330
330
|
functionName = `${methodName.substring(0, insertIndex)}${methodInfix}${methodName.substring(insertIndex)}`;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const methodDescriptor = {
|
|
333
|
+
methodDescriptors.push({
|
|
336
334
|
...interimMethodDescriptor,
|
|
337
|
-
functionName
|
|
338
|
-
|
|
339
|
-
};
|
|
340
|
-
|
|
341
|
-
methodDescriptors.push(methodDescriptor);
|
|
335
|
+
functionName
|
|
336
|
+
});
|
|
342
337
|
}
|
|
343
338
|
|
|
344
339
|
const classDescriptor: ClassDescriptor = {
|
|
@@ -346,7 +341,6 @@ export class Proxy {
|
|
|
346
341
|
name: className,
|
|
347
342
|
namespace,
|
|
348
343
|
category,
|
|
349
|
-
namespaceClassName,
|
|
350
344
|
methodDescriptors
|
|
351
345
|
};
|
|
352
346
|
|