@aidc-toolkit/app-extension 1.0.32-beta → 1.0.34-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.
Files changed (191) hide show
  1. package/README.md +1 -5
  2. package/dist/app-extension.d.ts +194 -0
  3. package/dist/app-extension.d.ts.map +1 -0
  4. package/dist/app-extension.js +133 -0
  5. package/dist/app-extension.js.map +1 -0
  6. package/dist/app-helper-proxy.d.ts +61 -0
  7. package/dist/app-helper-proxy.d.ts.map +1 -0
  8. package/dist/app-helper-proxy.js +332 -0
  9. package/dist/app-helper-proxy.js.map +1 -0
  10. package/dist/descriptor.d.ts +193 -0
  11. package/dist/descriptor.d.ts.map +1 -0
  12. package/dist/descriptor.js +44 -0
  13. package/dist/descriptor.js.map +1 -0
  14. package/dist/generator/generator.d.ts +114 -0
  15. package/dist/generator/generator.d.ts.map +1 -0
  16. package/dist/generator/generator.js +160 -0
  17. package/dist/generator/generator.js.map +1 -0
  18. package/dist/generator/index.d.ts +2 -0
  19. package/dist/generator/index.d.ts.map +1 -0
  20. package/dist/generator/index.js +2 -0
  21. package/dist/generator/index.js.map +1 -0
  22. package/dist/generator/locale-resources-generator.d.ts +2 -0
  23. package/dist/generator/locale-resources-generator.d.ts.map +1 -0
  24. package/dist/generator/locale-resources-generator.js +311 -0
  25. package/dist/generator/locale-resources-generator.js.map +1 -0
  26. package/dist/gs1/character-set-proxy.d.ts +13 -0
  27. package/dist/gs1/character-set-proxy.d.ts.map +1 -0
  28. package/dist/gs1/character-set-proxy.js +126 -0
  29. package/dist/gs1/character-set-proxy.js.map +1 -0
  30. package/dist/gs1/check-proxy.d.ts +11 -0
  31. package/dist/gs1/check-proxy.d.ts.map +1 -0
  32. package/dist/gs1/check-proxy.js +163 -0
  33. package/dist/gs1/check-proxy.js.map +1 -0
  34. package/dist/gs1/gtin-creator-proxy.d.ts +10 -0
  35. package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -0
  36. package/dist/gs1/gtin-creator-proxy.js +85 -0
  37. package/dist/gs1/gtin-creator-proxy.js.map +1 -0
  38. package/dist/gs1/gtin-descriptor.d.ts +3 -0
  39. package/dist/gs1/gtin-descriptor.d.ts.map +1 -0
  40. package/dist/gs1/gtin-descriptor.js +8 -0
  41. package/dist/gs1/gtin-descriptor.js.map +1 -0
  42. package/dist/gs1/gtin-validator-proxy.d.ts +26 -0
  43. package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -0
  44. package/dist/gs1/gtin-validator-proxy.js +256 -0
  45. package/dist/gs1/gtin-validator-proxy.js.map +1 -0
  46. package/dist/gs1/identifier-creator-proxy.d.ts +30 -0
  47. package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -0
  48. package/dist/gs1/identifier-creator-proxy.js +302 -0
  49. package/dist/gs1/identifier-creator-proxy.js.map +1 -0
  50. package/dist/gs1/identifier-descriptor.d.ts +4 -0
  51. package/dist/gs1/identifier-descriptor.d.ts.map +1 -0
  52. package/dist/gs1/identifier-descriptor.js +14 -0
  53. package/dist/gs1/identifier-descriptor.js.map +1 -0
  54. package/dist/gs1/identifier-type.d.ts +22 -0
  55. package/dist/gs1/identifier-type.d.ts.map +1 -0
  56. package/dist/gs1/identifier-type.js +34 -0
  57. package/dist/gs1/identifier-type.js.map +1 -0
  58. package/dist/gs1/identifier-validator-proxy.d.ts +29 -0
  59. package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -0
  60. package/dist/gs1/identifier-validator-proxy.js +212 -0
  61. package/dist/gs1/identifier-validator-proxy.js.map +1 -0
  62. package/dist/gs1/index.d.ts +10 -0
  63. package/dist/gs1/index.d.ts.map +1 -0
  64. package/dist/gs1/index.js +10 -0
  65. package/dist/gs1/index.js.map +1 -0
  66. package/dist/gs1/non-gtin-creator-proxy.d.ts +38 -0
  67. package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -0
  68. package/dist/gs1/non-gtin-creator-proxy.js +301 -0
  69. package/dist/gs1/non-gtin-creator-proxy.js.map +1 -0
  70. package/dist/gs1/non-gtin-validator-proxy.d.ts +37 -0
  71. package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -0
  72. package/dist/gs1/non-gtin-validator-proxy.js +302 -0
  73. package/dist/gs1/non-gtin-validator-proxy.js.map +1 -0
  74. package/dist/gs1/prefix-definition-descriptor.d.ts +4 -0
  75. package/dist/gs1/prefix-definition-descriptor.d.ts.map +1 -0
  76. package/dist/gs1/prefix-definition-descriptor.js +16 -0
  77. package/dist/gs1/prefix-definition-descriptor.js.map +1 -0
  78. package/dist/gs1/prefix-manager-proxy.d.ts +14 -0
  79. package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
  80. package/dist/gs1/prefix-manager-proxy.js +213 -0
  81. package/dist/gs1/prefix-manager-proxy.js.map +1 -0
  82. package/dist/gs1/service-proxy.d.ts +7 -0
  83. package/dist/gs1/service-proxy.d.ts.map +1 -0
  84. package/dist/gs1/service-proxy.js +105 -0
  85. package/dist/gs1/service-proxy.js.map +1 -0
  86. package/dist/gs1/variable-measure-proxy.d.ts +7 -0
  87. package/dist/gs1/variable-measure-proxy.d.ts.map +1 -0
  88. package/dist/gs1/variable-measure-proxy.js +114 -0
  89. package/dist/gs1/variable-measure-proxy.js.map +1 -0
  90. package/dist/index.d.ts +28 -1866
  91. package/dist/index.d.ts.map +1 -0
  92. package/dist/index.js +10 -6508
  93. package/dist/index.js.map +1 -1
  94. package/dist/lib-proxy.d.ts +135 -0
  95. package/dist/lib-proxy.d.ts.map +1 -0
  96. package/dist/lib-proxy.js +276 -0
  97. package/dist/lib-proxy.js.map +1 -0
  98. package/dist/locale/en/locale-resources.d.ts +752 -0
  99. package/dist/locale/en/locale-resources.d.ts.map +1 -0
  100. package/dist/locale/en/locale-resources.js +751 -0
  101. package/dist/locale/en/locale-resources.js.map +1 -0
  102. package/dist/locale/fr/locale-resources.d.ts +752 -0
  103. package/dist/locale/fr/locale-resources.d.ts.map +1 -0
  104. package/dist/locale/fr/locale-resources.js +751 -0
  105. package/dist/locale/fr/locale-resources.js.map +1 -0
  106. package/dist/locale/i18n.d.ts +27 -0
  107. package/dist/locale/i18n.d.ts.map +1 -0
  108. package/dist/locale/i18n.js +36 -0
  109. package/dist/locale/i18n.js.map +1 -0
  110. package/dist/proxy.d.ts +136 -0
  111. package/dist/proxy.d.ts.map +1 -0
  112. package/dist/proxy.js +319 -0
  113. package/dist/proxy.js.map +1 -0
  114. package/dist/streaming.d.ts +10 -0
  115. package/dist/streaming.d.ts.map +1 -0
  116. package/dist/streaming.js +2 -0
  117. package/dist/streaming.js.map +1 -0
  118. package/dist/type.d.ts +91 -0
  119. package/dist/type.d.ts.map +1 -0
  120. package/dist/type.js +2 -0
  121. package/dist/type.js.map +1 -0
  122. package/dist/utility/character-set-descriptor.d.ts +6 -0
  123. package/dist/utility/character-set-descriptor.d.ts.map +1 -0
  124. package/dist/utility/character-set-descriptor.js +28 -0
  125. package/dist/utility/character-set-descriptor.js.map +1 -0
  126. package/dist/utility/character-set-proxy.d.ts +31 -0
  127. package/dist/utility/character-set-proxy.d.ts.map +1 -0
  128. package/dist/utility/character-set-proxy.js +278 -0
  129. package/dist/utility/character-set-proxy.js.map +1 -0
  130. package/dist/utility/index.d.ts +4 -0
  131. package/dist/utility/index.d.ts.map +1 -0
  132. package/dist/utility/index.js +4 -0
  133. package/dist/utility/index.js.map +1 -0
  134. package/dist/utility/reg-exp-proxy.d.ts +8 -0
  135. package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
  136. package/dist/utility/reg-exp-proxy.js +103 -0
  137. package/dist/utility/reg-exp-proxy.js.map +1 -0
  138. package/dist/utility/string-descriptor.d.ts +4 -0
  139. package/dist/utility/string-descriptor.d.ts.map +1 -0
  140. package/dist/utility/string-descriptor.js +12 -0
  141. package/dist/utility/string-descriptor.js.map +1 -0
  142. package/dist/utility/string-proxy.d.ts +7 -0
  143. package/dist/utility/string-proxy.d.ts.map +1 -0
  144. package/dist/utility/string-proxy.js +63 -0
  145. package/dist/utility/string-proxy.js.map +1 -0
  146. package/dist/utility/transformer-descriptor.d.ts +6 -0
  147. package/dist/utility/transformer-descriptor.d.ts.map +1 -0
  148. package/dist/utility/transformer-descriptor.js +24 -0
  149. package/dist/utility/transformer-descriptor.js.map +1 -0
  150. package/dist/utility/transformer-proxy.d.ts +9 -0
  151. package/dist/utility/transformer-proxy.d.ts.map +1 -0
  152. package/dist/utility/transformer-proxy.js +111 -0
  153. package/dist/utility/transformer-proxy.js.map +1 -0
  154. package/package.json +13 -12
  155. package/src/app-extension.ts +26 -47
  156. package/src/{app-utility-proxy.ts → app-helper-proxy.ts} +21 -19
  157. package/src/descriptor.ts +43 -2
  158. package/src/generator/generator.ts +122 -95
  159. package/src/generator/locale-resources-generator.ts +26 -14
  160. package/src/gs1/check-proxy.ts +12 -11
  161. package/src/gs1/gtin-creator-proxy.ts +2 -3
  162. package/src/gs1/gtin-descriptor.ts +2 -2
  163. package/src/gs1/gtin-validator-proxy.ts +12 -14
  164. package/src/gs1/identifier-creator-proxy.ts +19 -21
  165. package/src/gs1/identifier-descriptor.ts +3 -3
  166. package/src/gs1/identifier-validator-proxy.ts +15 -16
  167. package/src/gs1/non-gtin-creator-proxy.ts +0 -11
  168. package/src/gs1/non-gtin-validator-proxy.ts +0 -11
  169. package/src/gs1/prefix-definition-descriptor.ts +2 -2
  170. package/src/gs1/prefix-manager-proxy.ts +80 -120
  171. package/src/gs1/service-proxy.ts +6 -5
  172. package/src/gs1/variable-measure-proxy.ts +9 -8
  173. package/src/index.ts +3 -3
  174. package/src/locale/en/locale-resources.ts +28 -15
  175. package/src/locale/fr/locale-resources.ts +28 -15
  176. package/src/locale/i18n.ts +10 -9
  177. package/src/locale/i18next.d.ts +2 -0
  178. package/src/proxy.ts +64 -40
  179. package/src/utility/character-set-descriptor.ts +2 -2
  180. package/src/utility/character-set-proxy.ts +7 -7
  181. package/src/utility/reg-exp-proxy.ts +5 -5
  182. package/src/utility/string-descriptor.ts +2 -2
  183. package/src/utility/string-proxy.ts +4 -0
  184. package/src/utility/transformer-descriptor.ts +5 -5
  185. package/src/utility/transformer-proxy.ts +6 -5
  186. package/tsconfig-src.json +7 -1
  187. package/tsconfig-src.tsbuildinfo +1 -0
  188. package/dist/index.cjs +0 -6544
  189. package/dist/index.cjs.map +0 -1
  190. package/dist/index.d.cts +0 -1866
  191. package/src/app-data.ts +0 -94
@@ -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,10 +1,10 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/app-extension",
3
- "version": "1.0.32-beta",
3
+ "version": "1.0.34-beta",
4
4
  "description": "Application extension framework for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
- "homepage": "https://aidc-toolkit.com/",
7
+ "homepage": "https://aidc-toolkit.com",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+https://github.com/aidc-toolkit/app-extension.git"
@@ -19,20 +19,21 @@
19
19
  "url": "https://www.linkedin.com/in/kdean"
20
20
  },
21
21
  "scripts": {
22
- "generate-locale-resources": "tsx src/generator/locale-resources-generator.ts",
23
22
  "lint": "eslint",
24
- "tsc:core": "tsc --project tsconfig-src.json",
25
- "build:dev": "npm run tsc:core -- --noEmit && tsup --define.mode=dev",
26
- "build:release": "npm run tsc:core -- --noEmit && tsup",
27
- "build:doc": "npm run build:dev"
23
+ "tsc-src": "tsc --project tsconfig-src.json",
24
+ "build:non-prod": "rimraf dist tsconfig-src.tsbuildinfo && npm run tsc-src -- --declarationMap --sourceMap",
25
+ "build:alpha": "npm run build:non-prod && tsc --project tsconfig-config.json --noEmit",
26
+ "build:beta": "npm run build:non-prod",
27
+ "build:prod": "npm run tsc-src -- --noEmit && tsup",
28
+ "build:doc": "npm run build:non-prod",
29
+ "generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
28
30
  },
29
31
  "devDependencies": {
30
- "@aidc-toolkit/dev": "1.0.32-beta"
32
+ "@aidc-toolkit/dev": "1.0.34-beta"
31
33
  },
32
34
  "dependencies": {
33
- "@aidc-toolkit/core": "1.0.32-beta",
34
- "@aidc-toolkit/gs1": "1.0.32-beta",
35
- "@aidc-toolkit/utility": "1.0.32-beta",
36
- "base64-js": "^1.5.1"
35
+ "@aidc-toolkit/core": "1.0.34-beta",
36
+ "@aidc-toolkit/gs1": "1.0.34-beta",
37
+ "@aidc-toolkit/utility": "1.0.34-beta"
37
38
  }
38
39
  }
@@ -1,6 +1,12 @@
1
- import { getLogger, type Hyperlink, LogLevels, MemoryTransport, type Promisable } from "@aidc-toolkit/core";
1
+ import {
2
+ type AppDataStorage,
3
+ getLogger,
4
+ type Hyperlink,
5
+ LogLevels,
6
+ MemoryTransport,
7
+ type Promisable
8
+ } from "@aidc-toolkit/core";
2
9
  import type { Logger } from "tslog";
3
- import type { AppData } from "./app-data.js";
4
10
  import { i18nextAppExtension } from "./locale/i18n.js";
5
11
  import type { StreamingCancelledCallback, StreamingConsumerCallback } from "./streaming.js";
6
12
  import type { ErrorExtends, MatrixResult, SheetAddress, SheetRange, SingletonResult } from "./type.js";
@@ -25,14 +31,14 @@ import type { ErrorExtends, MatrixResult, SheetAddress, SheetRange, SingletonRes
25
31
  */
26
32
  export abstract class AppExtension<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> {
27
33
  /**
28
- * Application name prefix for properties and application data.
34
+ * Application name.
29
35
  */
30
- static readonly APPLICATION_NAME_PREFIX = "AIDCToolkit.";
36
+ static readonly APPLICATION_NAME = "AIDCToolkit";
31
37
 
32
38
  /**
33
39
  * Version property name.
34
40
  */
35
- static readonly VERSION_NAME = `${AppExtension.APPLICATION_NAME_PREFIX}version`;
41
+ static readonly VERSION_NAME = `${AppExtension.APPLICATION_NAME}.version`;
36
42
 
37
43
  /**
38
44
  * Maximum logger messages length.
@@ -90,8 +96,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
90
96
  const isProduction = !version.includes("-");
91
97
 
92
98
  this.#logger = getLogger(isProduction ? LogLevels.Info : LogLevels.Debug, {
93
- type: isProduction ? "hidden" : "pretty",
94
- hideLogPositionForProduction: isProduction
99
+ type: isProduction ? "hidden" : "pretty"
95
100
  });
96
101
 
97
102
  this.#memoryTransport = new MemoryTransport(this.#logger, AppExtension.#MAXIMUM_LOGGER_MESSAGES_LENGTH, AppExtension.#TRUNCATE_LOGGER_MESSAGES_LENGTH);
@@ -101,10 +106,10 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
101
106
  * Initialize the application extension.
102
107
  */
103
108
  async initialize(): Promise<void> {
104
- const fileVersion = await this.getFileProperty(AppExtension.VERSION_NAME);
109
+ const fileVersion = await this.getDocumentProperty(AppExtension.VERSION_NAME);
105
110
 
106
111
  if (fileVersion !== this.#version) {
107
- await this.setFileProperty(AppExtension.VERSION_NAME, this.#version);
112
+ await this.setDocumentProperty(AppExtension.VERSION_NAME, this.#version);
108
113
  }
109
114
  }
110
115
 
@@ -189,7 +194,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
189
194
  abstract setUpStreaming<TResult>(streamingInvocationContext: TStreamingInvocationContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult, ThrowError, TError>;
190
195
 
191
196
  /**
192
- * Get a property stored within the active file.
197
+ * Get a property stored within the active document.
193
198
  *
194
199
  * @param name
195
200
  * Property name.
@@ -197,62 +202,36 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
197
202
  * @returns
198
203
  * Property value or undefined if no value is stored under the given name.
199
204
  */
200
- abstract getFileProperty(name: string): Promisable<string | undefined>;
205
+ abstract getDocumentProperty(name: string): Promisable<string | undefined>;
201
206
 
202
207
  /**
203
- * Set a property to be stored within the active file.
208
+ * Set a property to be stored within the active document.
204
209
  *
205
210
  * @param name
206
211
  * Property name.
207
212
  *
208
213
  * @param value
209
- * Property value or null to remove.
214
+ * Property value.
210
215
  */
211
- abstract setFileProperty(name: string, value: string | null): Promisable<void>;
216
+ abstract setDocumentProperty(name: string, value: string): Promisable<void>;
212
217
 
213
218
  /**
214
- * Get application data stored within the active file.
219
+ * Delete a property from the active document.
215
220
  *
216
221
  * @param name
217
- * Name under which data is stored.
218
- *
219
- * @returns
220
- * Application data or undefined if no data is stored under the given name.
221
- */
222
- abstract getFileData(name: string): Promisable<AppData | undefined>;
223
-
224
- /**
225
- * Set application data to be stored within the active file.
226
- *
227
- * @param name
228
- * Name under which to store data.
229
- *
230
- * @param appData
231
- * Application data or null to remove.
222
+ * Property name.
232
223
  */
233
- abstract setFileData(name: string, appData: AppData | null): Promisable<void>;
224
+ abstract deleteDocumentProperty(name: string): Promisable<void>;
234
225
 
235
226
  /**
236
- * Get application data stored and shared across multiple files.
237
- *
238
- * @param name
239
- * Name under which data is stored.
240
- *
241
- * @returns
242
- * Application ata or undefined if no data is stored under the given name.
227
+ * Get application data storage for the current document.
243
228
  */
244
- abstract getSharedData(name: string): Promisable<AppData | undefined>;
229
+ abstract get documentAppDataStorage(): AppDataStorage<boolean>;
245
230
 
246
231
  /**
247
- * Set application data to be stored and shared across multiple files.
248
- *
249
- * @param name
250
- * Name under which to store data.
251
- *
252
- * @param appData
253
- * Application data or null to remove.
232
+ * Get application data storage shared across multiple documents.
254
233
  */
255
- abstract setSharedData(name: string, appData: AppData | null): Promisable<void>;
234
+ abstract get sharedAppDataStorage(): AppDataStorage<boolean>;
256
235
 
257
236
  /**
258
237
  * Validate a sequence count against the maximum supported by application.
@@ -1,21 +1,21 @@
1
1
  import { isNullish, type LogLevel, logLevelOf, type NonNullishable, type Nullishable } from "@aidc-toolkit/core";
2
- import { type ExtendsParameterDescriptor, type ParameterDescriptor, Types } from "./descriptor.js";
2
+ import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "./descriptor.js";
3
3
  import { LibProxy } from "./lib-proxy.js";
4
4
  import { i18nextAppExtension } from "./locale/i18n.js";
5
5
  import { proxy } from "./proxy.js";
6
6
  import type { ErrorExtends, Matrix, MatrixResult } from "./type.js";
7
7
 
8
- const spillMatrixParameterDescriptor: ParameterDescriptor = {
9
- name: "spillMatrix",
8
+ const spillArrayParameterDescriptor: ParameterDescriptor = {
9
+ name: "spillArray",
10
10
  type: Types.Any,
11
- isMatrix: true,
11
+ multiplicity: Multiplicities.Array,
12
12
  isRequired: true
13
13
  };
14
14
 
15
15
  const spillMaximumParameterDescriptor: ParameterDescriptor = {
16
16
  name: "spillMaximum",
17
17
  type: Types.Number,
18
- isMatrix: false,
18
+ multiplicity: Multiplicities.Singleton,
19
19
  isRequired: false
20
20
  };
21
21
 
@@ -64,8 +64,10 @@ interface MaximumDimensions {
64
64
  * @template TBigInt
65
65
  * Type to which big integer is mapped.
66
66
  */
67
- @proxy.describeClass(false)
68
- export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
67
+ @proxy.describeClass(false, {
68
+ category: "helper"
69
+ })
70
+ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
69
71
  /**
70
72
  * Get the version.
71
73
  *
@@ -74,7 +76,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
74
76
  */
75
77
  @proxy.describeMethod({
76
78
  type: Types.String,
77
- isMatrix: false,
79
+ multiplicity: Multiplicities.Singleton,
78
80
  parameterDescriptors: []
79
81
  })
80
82
  version(): string {
@@ -125,7 +127,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
125
127
  /**
126
128
  * Spill a one-dimensional matrix to fit a rectangle within a given maximum height and width.
127
129
  *
128
- * @param matrixValues
130
+ * @param arrayValues
129
131
  * Matrix values. Matrix is length 1 or contains arrays of length 1 with the values.
130
132
  *
131
133
  * @param maximumHeight
@@ -143,15 +145,15 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
143
145
  @proxy.describeMethod({
144
146
  requiresContext: true,
145
147
  type: Types.Any,
146
- isMatrix: true,
147
- parameterDescriptors: [spillMatrixParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
148
+ multiplicity: Multiplicities.Matrix,
149
+ parameterDescriptors: [spillArrayParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
148
150
  })
149
- async spill(matrixValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<TInvocationContext>): Promise<MatrixResult<unknown, ThrowError, TError>> {
151
+ async spill(arrayValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<TInvocationContext>): Promise<MatrixResult<unknown, ThrowError, TError>> {
150
152
  let result: MatrixResult<unknown, ThrowError, TError>;
151
153
 
152
154
  // Assume matrix is uniformly two-dimensional.
153
- const height = matrixValues.length;
154
- const width = height !== 0 ? matrixValues[0].length : 0;
155
+ const height = arrayValues.length;
156
+ const width = height !== 0 ? arrayValues[0].length : 0;
155
157
 
156
158
  const isArrayOrError = this.singletonResult(() => {
157
159
  if (height > 1 && width > 1) {
@@ -209,7 +211,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
209
211
  const endIndex = startIndex + spillParallel;
210
212
 
211
213
  // Each row is a slice of the original single row.
212
- const row = matrixValues[0].slice(startIndex, endIndex);
214
+ const row = arrayValues[0].slice(startIndex, endIndex);
213
215
 
214
216
  // Row length will be anywhere from 1 to spillParallel.
215
217
  if (row.length < spillParallel) {
@@ -231,7 +233,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
231
233
 
232
234
  // Each column is a slice of the original single column.
233
235
  for (let valueIndex = rowIndex; valueIndex < length; valueIndex += spillParallel) {
234
- row.push(matrixValues[valueIndex][0]);
236
+ row.push(arrayValues[valueIndex][0]);
235
237
  }
236
238
 
237
239
  // Row length will always be spillPerpendicular or spillPerpendicular - 1.
@@ -244,7 +246,7 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
244
246
  }
245
247
  } else {
246
248
  // Return matrix unmodified and let application handle spill error if any.
247
- result = matrixValues;
249
+ result = arrayValues;
248
250
  }
249
251
  } else {
250
252
  // Return error as only element in matrix.
@@ -267,11 +269,11 @@ export class AppUtilityProxy<ThrowError extends boolean, TError extends ErrorExt
267
269
  type: Types.String,
268
270
  isHidden: true,
269
271
  isStream: true,
270
- isMatrix: true,
272
+ multiplicity: Multiplicities.Array,
271
273
  parameterDescriptors: [{
272
274
  name: "logLevel",
273
275
  type: Types.String,
274
- isMatrix: false,
276
+ multiplicity: Multiplicities.Singleton,
275
277
  isRequired: false
276
278
  }]
277
279
  })
package/src/descriptor.ts CHANGED
@@ -43,6 +43,42 @@ export type TypeKey = keyof typeof Types;
43
43
  */
44
44
  export type Type = typeof Types[TypeKey];
45
45
 
46
+ /**
47
+ * Multiplicities supported by proxy methods.
48
+ */
49
+ export const Multiplicities = {
50
+ /**
51
+ * Parameter or return value is a singleton.
52
+ */
53
+ Singleton: 0,
54
+
55
+ /**
56
+ * Parameter or return value is a singleton or an array.
57
+ */
58
+ Array: 1,
59
+
60
+ /**
61
+ * Parameter or return value is a singleton, an array, or a matrix.
62
+ */
63
+ Matrix: 2,
64
+
65
+ /**
66
+ * Parameter value is a singleton or array but is treated as a singleton internally and doesn't drive multiplicity
67
+ * of the return value. Return value is an array for use as a singleton array parameter.
68
+ */
69
+ SingletonArray: 3
70
+ } as const;
71
+
72
+ /**
73
+ * Multiplicity key.
74
+ */
75
+ export type MultiplicityKey = keyof typeof Multiplicities;
76
+
77
+ /**
78
+ * Multiplicity.
79
+ */
80
+ export type Multiplicity = typeof Multiplicities[MultiplicityKey];
81
+
46
82
  /**
47
83
  * Type descriptor.
48
84
  */
@@ -53,9 +89,9 @@ interface TypeDescriptor extends Descriptor {
53
89
  readonly type: Type;
54
90
 
55
91
  /**
56
- * True if type is a matrix (method accepts or returns, or parameter is, a two-dimensional array).
92
+ * Multiplicity.
57
93
  */
58
- readonly isMatrix: boolean;
94
+ readonly multiplicity: Multiplicity;
59
95
  }
60
96
 
61
97
  /**
@@ -158,6 +194,11 @@ export interface ClassDescriptor extends Descriptor {
158
194
  */
159
195
  readonly namespace?: string | undefined;
160
196
 
197
+ /**
198
+ * Category.
199
+ */
200
+ readonly category: string;
201
+
161
202
  /**
162
203
  * Method infix. If undefined, method name is generated verbatim.
163
204
  */