@aidc-toolkit/app-extension 1.0.49 → 1.0.50-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 (210) hide show
  1. package/dist/app-extension-options.d.ts +52 -0
  2. package/dist/app-extension-options.d.ts.map +1 -0
  3. package/dist/app-extension-options.js +2 -0
  4. package/dist/app-extension-options.js.map +1 -0
  5. package/dist/app-extension.d.ts +194 -0
  6. package/dist/app-extension.d.ts.map +1 -0
  7. package/dist/app-extension.js +141 -0
  8. package/dist/app-extension.js.map +1 -0
  9. package/dist/app-helper-proxy.d.ts +57 -0
  10. package/dist/app-helper-proxy.d.ts.map +1 -0
  11. package/dist/app-helper-proxy.js +369 -0
  12. package/dist/app-helper-proxy.js.map +1 -0
  13. package/dist/{descriptor-D6tZH-vc.d.cts → descriptor.d.ts} +13 -13
  14. package/dist/descriptor.d.ts.map +1 -0
  15. package/dist/descriptor.js +44 -0
  16. package/dist/descriptor.js.map +1 -0
  17. package/dist/generator/functions-generator.d.ts +103 -0
  18. package/dist/generator/functions-generator.d.ts.map +1 -0
  19. package/dist/generator/functions-generator.js +179 -0
  20. package/dist/generator/functions-generator.js.map +1 -0
  21. package/dist/generator/generator.d.ts +121 -0
  22. package/dist/generator/generator.d.ts.map +1 -0
  23. package/dist/generator/generator.js +186 -0
  24. package/dist/generator/generator.js.map +1 -0
  25. package/dist/generator/index.d.ts +18 -239
  26. package/dist/generator/index.d.ts.map +1 -0
  27. package/dist/generator/index.js +3 -1
  28. package/dist/generator/index.js.map +1 -0
  29. package/dist/generator/locale-resources-generator.d.ts +2 -0
  30. package/dist/generator/locale-resources-generator.d.ts.map +1 -0
  31. package/dist/generator/locale-resources-generator.js +333 -0
  32. package/dist/generator/locale-resources-generator.js.map +1 -0
  33. package/dist/gs1/character-set-proxy.d.ts +12 -0
  34. package/dist/gs1/character-set-proxy.d.ts.map +1 -0
  35. package/dist/gs1/character-set-proxy.js +126 -0
  36. package/dist/gs1/character-set-proxy.js.map +1 -0
  37. package/dist/gs1/check-proxy.d.ts +11 -0
  38. package/dist/gs1/check-proxy.d.ts.map +1 -0
  39. package/dist/gs1/check-proxy.js +163 -0
  40. package/dist/gs1/check-proxy.js.map +1 -0
  41. package/dist/gs1/gcp-length-proxy.d.ts +11 -0
  42. package/dist/gs1/gcp-length-proxy.d.ts.map +1 -0
  43. package/dist/gs1/gcp-length-proxy.js +187 -0
  44. package/dist/gs1/gcp-length-proxy.js.map +1 -0
  45. package/dist/gs1/gtin-creator-proxy.d.ts +10 -0
  46. package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -0
  47. package/dist/gs1/gtin-creator-proxy.js +85 -0
  48. package/dist/gs1/gtin-creator-proxy.js.map +1 -0
  49. package/dist/gs1/gtin-descriptor.d.ts +3 -0
  50. package/dist/gs1/gtin-descriptor.d.ts.map +1 -0
  51. package/dist/gs1/gtin-descriptor.js +8 -0
  52. package/dist/gs1/gtin-descriptor.js.map +1 -0
  53. package/dist/gs1/gtin-validator-proxy.d.ts +26 -0
  54. package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -0
  55. package/dist/gs1/gtin-validator-proxy.js +256 -0
  56. package/dist/gs1/gtin-validator-proxy.js.map +1 -0
  57. package/dist/gs1/identifier-creator-proxy.d.ts +30 -0
  58. package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -0
  59. package/dist/gs1/identifier-creator-proxy.js +318 -0
  60. package/dist/gs1/identifier-creator-proxy.js.map +1 -0
  61. package/dist/gs1/identifier-descriptor.d.ts +4 -0
  62. package/dist/gs1/identifier-descriptor.d.ts.map +1 -0
  63. package/dist/gs1/identifier-descriptor.js +14 -0
  64. package/dist/gs1/identifier-descriptor.js.map +1 -0
  65. package/dist/gs1/identifier-type.d.ts +22 -0
  66. package/dist/gs1/identifier-type.d.ts.map +1 -0
  67. package/dist/gs1/identifier-type.js +34 -0
  68. package/dist/gs1/identifier-type.js.map +1 -0
  69. package/dist/gs1/identifier-validator-proxy.d.ts +29 -0
  70. package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -0
  71. package/dist/gs1/identifier-validator-proxy.js +212 -0
  72. package/dist/gs1/identifier-validator-proxy.js.map +1 -0
  73. package/dist/gs1/index.d.ts +11 -185
  74. package/dist/gs1/index.d.ts.map +1 -0
  75. package/dist/gs1/index.js +11 -1
  76. package/dist/gs1/index.js.map +1 -0
  77. package/dist/gs1/non-gtin-creator-proxy.d.ts +37 -0
  78. package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -0
  79. package/dist/gs1/non-gtin-creator-proxy.js +301 -0
  80. package/dist/gs1/non-gtin-creator-proxy.js.map +1 -0
  81. package/dist/gs1/non-gtin-validator-proxy.d.ts +36 -0
  82. package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -0
  83. package/dist/gs1/non-gtin-validator-proxy.js +302 -0
  84. package/dist/gs1/non-gtin-validator-proxy.js.map +1 -0
  85. package/dist/gs1/prefix-definition-descriptor.d.ts +4 -0
  86. package/dist/gs1/prefix-definition-descriptor.d.ts.map +1 -0
  87. package/dist/gs1/prefix-definition-descriptor.js +16 -0
  88. package/dist/gs1/prefix-definition-descriptor.js.map +1 -0
  89. package/dist/gs1/prefix-manager-proxy.d.ts +8 -0
  90. package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
  91. package/dist/gs1/prefix-manager-proxy.js +94 -0
  92. package/dist/gs1/prefix-manager-proxy.js.map +1 -0
  93. package/dist/gs1/variable-measure-proxy.d.ts +7 -0
  94. package/dist/gs1/variable-measure-proxy.d.ts.map +1 -0
  95. package/dist/gs1/variable-measure-proxy.js +114 -0
  96. package/dist/gs1/variable-measure-proxy.js.map +1 -0
  97. package/dist/gs1/verified-by-gs1-proxy.d.ts +7 -0
  98. package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -0
  99. package/dist/gs1/verified-by-gs1-proxy.js +100 -0
  100. package/dist/gs1/verified-by-gs1-proxy.js.map +1 -0
  101. package/dist/index.d.ts +22 -862
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +7 -1
  104. package/dist/index.js.map +1 -0
  105. package/dist/lib-proxy.d.ts +121 -0
  106. package/dist/lib-proxy.d.ts.map +1 -0
  107. package/dist/lib-proxy.js +259 -0
  108. package/dist/lib-proxy.js.map +1 -0
  109. package/dist/{index.d.cts → locale/en/locale-resources.d.ts} +2 -113
  110. package/dist/locale/en/locale-resources.d.ts.map +1 -0
  111. package/dist/locale/en/locale-resources.js +754 -0
  112. package/dist/locale/en/locale-resources.js.map +1 -0
  113. package/dist/locale/fr/locale-resources.d.ts +755 -0
  114. package/dist/locale/fr/locale-resources.d.ts.map +1 -0
  115. package/dist/locale/fr/locale-resources.js +754 -0
  116. package/dist/locale/fr/locale-resources.js.map +1 -0
  117. package/dist/locale/i18n.d.ts +27 -0
  118. package/dist/locale/i18n.d.ts.map +1 -0
  119. package/dist/locale/i18n.js +36 -0
  120. package/dist/locale/i18n.js.map +1 -0
  121. package/dist/proxy.d.ts +135 -0
  122. package/dist/proxy.d.ts.map +1 -0
  123. package/dist/proxy.js +291 -0
  124. package/dist/proxy.js.map +1 -0
  125. package/dist/streaming.d.ts +10 -0
  126. package/dist/streaming.d.ts.map +1 -0
  127. package/dist/streaming.js +2 -0
  128. package/dist/streaming.js.map +1 -0
  129. package/dist/type.d.ts +72 -0
  130. package/dist/type.d.ts.map +1 -0
  131. package/dist/type.js +2 -0
  132. package/dist/type.js.map +1 -0
  133. package/dist/utility/character-set-descriptor.d.ts +6 -0
  134. package/dist/utility/character-set-descriptor.d.ts.map +1 -0
  135. package/dist/utility/character-set-descriptor.js +28 -0
  136. package/dist/utility/character-set-descriptor.js.map +1 -0
  137. package/dist/utility/character-set-proxy.d.ts +32 -0
  138. package/dist/utility/character-set-proxy.d.ts.map +1 -0
  139. package/dist/utility/character-set-proxy.js +278 -0
  140. package/dist/utility/character-set-proxy.js.map +1 -0
  141. package/dist/utility/index.d.ts +4 -0
  142. package/dist/utility/index.d.ts.map +1 -0
  143. package/dist/utility/index.js +4 -0
  144. package/dist/utility/index.js.map +1 -0
  145. package/dist/utility/reg-exp-proxy.d.ts +8 -0
  146. package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
  147. package/dist/utility/reg-exp-proxy.js +103 -0
  148. package/dist/utility/reg-exp-proxy.js.map +1 -0
  149. package/dist/utility/string-descriptor.d.ts +4 -0
  150. package/dist/utility/string-descriptor.d.ts.map +1 -0
  151. package/dist/utility/string-descriptor.js +12 -0
  152. package/dist/utility/string-descriptor.js.map +1 -0
  153. package/dist/utility/string-proxy.d.ts +7 -0
  154. package/dist/utility/string-proxy.d.ts.map +1 -0
  155. package/dist/utility/string-proxy.js +63 -0
  156. package/dist/utility/string-proxy.js.map +1 -0
  157. package/dist/utility/transformer-descriptor.d.ts +6 -0
  158. package/dist/utility/transformer-descriptor.d.ts.map +1 -0
  159. package/dist/utility/transformer-descriptor.js +24 -0
  160. package/dist/utility/transformer-descriptor.js.map +1 -0
  161. package/dist/utility/transformer-proxy.d.ts +10 -0
  162. package/dist/utility/transformer-proxy.d.ts.map +1 -0
  163. package/dist/utility/transformer-proxy.js +111 -0
  164. package/dist/utility/transformer-proxy.js.map +1 -0
  165. package/dist/version.d.ts +5 -0
  166. package/dist/version.d.ts.map +1 -0
  167. package/dist/version.js +5 -0
  168. package/dist/version.js.map +1 -0
  169. package/package.json +5 -5
  170. package/src/app-extension-options.ts +61 -0
  171. package/src/app-extension.ts +22 -32
  172. package/src/app-helper-proxy.ts +21 -33
  173. package/src/generator/functions-generator.ts +14 -45
  174. package/src/generator/generator.ts +28 -18
  175. package/src/generator/locale-resources-generator.ts +79 -52
  176. package/src/gs1/character-set-proxy.ts +6 -7
  177. package/src/gs1/check-proxy.ts +8 -8
  178. package/src/gs1/gcp-length-proxy.ts +8 -8
  179. package/src/gs1/gtin-creator-proxy.ts +4 -4
  180. package/src/gs1/gtin-validator-proxy.ts +12 -12
  181. package/src/gs1/identifier-creator-proxy.ts +14 -14
  182. package/src/gs1/identifier-validator-proxy.ts +10 -10
  183. package/src/gs1/non-gtin-creator-proxy.ts +22 -23
  184. package/src/gs1/non-gtin-validator-proxy.ts +22 -23
  185. package/src/gs1/prefix-manager-proxy.ts +2 -2
  186. package/src/gs1/variable-measure-proxy.ts +4 -4
  187. package/src/gs1/verified-by-gs1-proxy.ts +5 -11
  188. package/src/index.ts +1 -0
  189. package/src/lib-proxy.ts +27 -43
  190. package/src/locale/en/locale-resources.ts +1 -1
  191. package/src/proxy.ts +12 -15
  192. package/src/streaming.ts +3 -3
  193. package/src/type.ts +3 -22
  194. package/src/utility/character-set-proxy.ts +17 -16
  195. package/src/utility/reg-exp-proxy.ts +2 -2
  196. package/src/utility/string-proxy.ts +2 -2
  197. package/src/utility/transformer-proxy.ts +6 -5
  198. package/src/version.ts +1 -1
  199. package/tsconfig-src.tsbuildinfo +1 -1
  200. package/dist/character-set-proxy-BOW94WCe.d.cts +0 -473
  201. package/dist/character-set-proxy-BOW94WCe.d.ts +0 -473
  202. package/dist/chunk-22IRLVWO.js +0 -1
  203. package/dist/chunk-MR63TJ3B.js +0 -1
  204. package/dist/chunk-TWX7TPRC.js +0 -1
  205. package/dist/descriptor-D6tZH-vc.d.ts +0 -185
  206. package/dist/generator/index.cjs +0 -17
  207. package/dist/generator/index.d.cts +0 -240
  208. package/dist/gs1/index.cjs +0 -1
  209. package/dist/gs1/index.d.cts +0 -185
  210. package/dist/index.cjs +0 -17
@@ -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,10 @@
1
+ import type { Nullishable } from "@aidc-toolkit/core";
2
+ import type { BigInteger } from "../app-extension-options.js";
3
+ import { LibProxy } from "../lib-proxy.js";
4
+ import type { Matrix, MatrixResult } from "../type.js";
5
+ export declare class TransformerProxy extends LibProxy {
6
+ forward(domain: number | bigint, matrixValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
7
+ forwardSequence(domain: number | bigint, startValue: number, count: number, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
8
+ reverse(domain: number | bigint, matrixTransformedValues: Matrix<number | bigint>, tweak: Nullishable<number | bigint>): MatrixResult<BigInteger>;
9
+ }
10
+ //# 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;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAoBvD,qBAIa,gBAAiB,SAAQ,QAAQ;IAM1C,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,UAAU,CAAC;IActI,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,UAAU,CAAC;IAa1I,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,UAAU,CAAC;CAOpJ"}
@@ -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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"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Repository version, updated automatically during publication.
3
+ */
4
+ export declare const VERSION = "1.0.50-beta";
5
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,gBAAgB,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Repository version, updated automatically during publication.
3
+ */
4
+ export const VERSION = "1.0.50-beta";
5
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aidc-toolkit/app-extension",
3
- "version": "1.0.49",
3
+ "version": "1.0.50-beta",
4
4
  "description": "Application extension framework for AIDC Toolkit",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,11 +34,11 @@
34
34
  "generate-locale-resources": "tsx src/generator/locale-resources-generator.ts"
35
35
  },
36
36
  "devDependencies": {
37
- "@aidc-toolkit/dev": "^1.0.43"
37
+ "@aidc-toolkit/dev": "1.0.44-beta"
38
38
  },
39
39
  "dependencies": {
40
- "@aidc-toolkit/core": "^1.0.44",
41
- "@aidc-toolkit/gs1": "^1.0.46",
42
- "@aidc-toolkit/utility": "^1.0.45"
40
+ "@aidc-toolkit/core": "1.0.45-beta",
41
+ "@aidc-toolkit/gs1": "1.0.47-beta",
42
+ "@aidc-toolkit/utility": "1.0.46-beta"
43
43
  }
44
44
  }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Application extension options. Never instantiated; used only as extension point for custom application extension
3
+ * options to define types.
4
+ */
5
+ export interface AppExtensionOptions {
6
+ /**
7
+ * If true, errors are reported through the throw/catch mechanism.
8
+ */
9
+ ThrowError: boolean;
10
+
11
+ /**
12
+ * Application error.
13
+ */
14
+ ApplicationError: object;
15
+
16
+ /**
17
+ * Invocation context.
18
+ */
19
+ InvocationContext: unknown;
20
+
21
+ /**
22
+ * Streaming context.
23
+ */
24
+ StreamingContext: unknown;
25
+
26
+ /**
27
+ * Big integer representation.
28
+ */
29
+ BigInteger: number | bigint;
30
+ }
31
+
32
+ /**
33
+ * Custom application extension options.
34
+ */
35
+ export interface CustomAppExtensionOptions extends AppExtensionOptions {
36
+ }
37
+
38
+ /**
39
+ * If true, errors are reported through the throw/catch mechanism.
40
+ */
41
+ export type ThrowError = CustomAppExtensionOptions["ThrowError"];
42
+
43
+ /**
44
+ * Application error type.
45
+ */
46
+ export type ApplicationError = CustomAppExtensionOptions["ApplicationError"];
47
+
48
+ /**
49
+ * Invocation context type.
50
+ */
51
+ export type InvocationContext = CustomAppExtensionOptions["InvocationContext"];
52
+
53
+ /**
54
+ * Streaming context type.
55
+ */
56
+ export type StreamingContext = CustomAppExtensionOptions["StreamingContext"];
57
+
58
+ /**
59
+ * Big integer representation type.
60
+ */
61
+ export type BigInteger = CustomAppExtensionOptions["BigInteger"];
@@ -8,30 +8,22 @@ import {
8
8
  type Promisable
9
9
  } from "@aidc-toolkit/core";
10
10
  import type { Logger } from "tslog";
11
+ import type {
12
+ ApplicationError,
13
+ BigInteger,
14
+ InvocationContext,
15
+ StreamingContext,
16
+ ThrowError
17
+ } from "./app-extension-options.js";
11
18
  import type { LibProxy } from "./lib-proxy.js";
12
19
  import { i18nextAppExtension } from "./locale/i18n.js";
13
20
  import type { StreamingCancelledCallback, StreamingConsumerCallback } from "./streaming.js";
14
- import type { ErrorExtends, MatrixResult, SheetAddress, SheetRange, SingletonResult } from "./type.js";
21
+ import type { MatrixResult, SheetAddress, SheetRange, SingletonResult } from "./type.js";
15
22
 
16
23
  /**
17
24
  * Application extension.
18
- *
19
- * @template ThrowError
20
- * If true, errors are reported through the throw/catch mechanism.
21
- *
22
- * @template TError
23
- * Error type.
24
- *
25
- * @template TInvocationContext
26
- * Application-specific invocation context type.
27
- *
28
- * @template TStreamingInvocationContext
29
- * Application-specific streaming invocation context type.
30
- *
31
- * @template TBigInt
32
- * Type to which big integer is mapped.
33
25
  */
34
- export abstract class AppExtension<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> {
26
+ export abstract class AppExtension {
35
27
  /**
36
28
  * Application name.
37
29
  */
@@ -80,7 +72,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
80
72
  /**
81
73
  * Proxies map for lazy loading and memory management.
82
74
  */
83
- readonly #proxiesMap = new WeakMap<object, LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>>();
75
+ readonly #proxiesMap = new WeakMap<object, LibProxy>();
84
76
 
85
77
  /**
86
78
  * Constructor.
@@ -171,7 +163,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
171
163
  * @returns
172
164
  * Proxy instance.
173
165
  */
174
- getProxy<T extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>>(ProxyConstructor: new (appExtension: AppExtension<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt>) => T): T {
166
+ getProxy<T extends LibProxy>(ProxyConstructor: new (appExtension: AppExtension) => T): T {
175
167
  // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Type is managed in this method.
176
168
  let proxy = this.#proxiesMap.get(ProxyConstructor) as T | undefined;
177
169
 
@@ -193,7 +185,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
193
185
  * @returns
194
186
  * Sheet address.
195
187
  */
196
- abstract getSheetAddress(invocationContext: TInvocationContext): Promisable<SheetAddress>;
188
+ abstract getSheetAddress(invocationContext: InvocationContext): Promisable<SheetAddress>;
197
189
 
198
190
  /**
199
191
  * Get a parameter range from an invocation context.
@@ -207,13 +199,13 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
207
199
  * @returns
208
200
  * Sheet range or null if parameter is not a range.
209
201
  */
210
- abstract getParameterSheetRange(invocationContext: TInvocationContext, parameterNumber: number): Promisable<SheetRange | null>;
202
+ abstract getParameterSheetRange(invocationContext: InvocationContext, parameterNumber: number): Promisable<SheetRange | null>;
211
203
 
212
204
  /**
213
- * Set up streaming for a streaming function.
205
+ * Install a streaming function.
214
206
  *
215
- * @param streamingInvocationContext
216
- * Streaming invocation context.
207
+ * @param streamingContext
208
+ * Streaming context.
217
209
  *
218
210
  * @param streamingCancelledCallback
219
211
  * Streaming cancelled callback, called when streaming is cancelled.
@@ -221,7 +213,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
221
213
  * @returns
222
214
  * Streaming consumer callback, called when stream contents updated.
223
215
  */
224
- abstract setUpStreaming<TResult>(streamingInvocationContext: TStreamingInvocationContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult, ThrowError, TError>;
216
+ abstract installStreaming<TResult>(streamingContext: StreamingContext, streamingCancelledCallback: StreamingCancelledCallback): StreamingConsumerCallback<TResult>;
225
217
 
226
218
  /**
227
219
  * Get a property stored within the active document.
@@ -286,7 +278,7 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
286
278
  }
287
279
 
288
280
  /**
289
- * Map big integer to another type if necessary.
281
+ * Map a big integer to its representation type.
290
282
  *
291
283
  * @param value
292
284
  * Big integer value to map.
@@ -294,29 +286,27 @@ export abstract class AppExtension<ThrowError extends boolean, TError extends Er
294
286
  * @returns
295
287
  * Mapped big integer value.
296
288
  */
297
- abstract mapBigInt(value: bigint): SingletonResult<TBigInt, ThrowError, TError>;
289
+ abstract mapBigInt(value: bigint): SingletonResult<BigInteger>;
298
290
 
299
291
  /**
300
292
  * Map hyperlink results to a form suitable for the application.
301
293
  *
302
- * @param invocationContext
303
- * Invocation context.
304
- *
305
294
  * @param matrixHyperlinkResults
306
295
  * Matrix of hyperlink results from function call.
307
296
  *
308
297
  * @returns
309
298
  * Matrix of results in a form suitable for the application.
310
299
  */
311
- abstract mapHyperlinkResults(invocationContext: TInvocationContext, matrixHyperlinkResults: MatrixResult<Hyperlink, ThrowError, TError>): Promisable<MatrixResult<unknown, ThrowError, TError>>;
300
+ abstract mapHyperlinkResults(matrixHyperlinkResults: MatrixResult<Hyperlink>): Promisable<MatrixResult<unknown>>;
312
301
 
313
302
  /**
314
303
  * Map a range error (thrown by the library) to an application-specific error. If errors are reported through the
315
304
  * throw/catch mechanism, the implementation may return the range error unmodified if that is supported.
316
305
  *
317
306
  * @param rangeError
307
+ * Range error.
318
308
  */
319
- abstract mapRangeError(rangeError: RangeError): TError;
309
+ abstract mapRangeError(rangeError: RangeError): ApplicationError;
320
310
 
321
311
  /**
322
312
  * Handle an error with a message; called when an exception occurs outside the control of the AIDC Toolkit library.
@@ -1,9 +1,10 @@
1
1
  import { isNullish, type LogLevel, logLevelOf, type NonNullishable, type Nullishable } from "@aidc-toolkit/core";
2
+ import type { InvocationContext, StreamingContext } from "./app-extension-options.js";
2
3
  import { type ExtendsParameterDescriptor, Multiplicities, type ParameterDescriptor, Types } from "./descriptor.js";
3
4
  import { LibProxy } from "./lib-proxy.js";
4
5
  import { i18nextAppExtension } from "./locale/i18n.js";
5
6
  import { proxy } from "./proxy.js";
6
- import type { ErrorExtends, Matrix, MatrixResult } from "./type.js";
7
+ import type { Matrix, MatrixResult } from "./type.js";
7
8
 
8
9
  const spillArrayParameterDescriptor: ParameterDescriptor = {
9
10
  name: "spillArray",
@@ -54,27 +55,14 @@ interface MaximumDimensions {
54
55
  }
55
56
 
56
57
  /**
57
- * Application utilities.
58
- *
59
- * @template ThrowError
60
- * If true, errors are reported through the throw/catch mechanism.
61
- *
62
- * @template TError
63
- * Error type.
64
- *
65
- * @template TInvocationContext
66
- * Application-specific invocation context type.
67
- *
68
- * @template TStreamingInvocationContext
69
- * Application-specific streaming invocation context type.
70
- *
71
- * @template TBigInt
72
- * Type to which big integer is mapped.
58
+ * Application helper.
73
59
  */
74
60
  @proxy.describeClass(false, {
75
61
  category: "helper"
76
62
  })
77
- export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExtends<ThrowError>, TInvocationContext, TStreamingInvocationContext, TBigInt> extends LibProxy<ThrowError, TError, TInvocationContext, TStreamingInvocationContext, TBigInt> {
63
+ export class AppHelperProxy extends LibProxy {
64
+ static readonly #LOGGER_STREAM_NAME = "loggerStream";
65
+
78
66
  /**
79
67
  * Get the version.
80
68
  *
@@ -102,7 +90,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
102
90
  * @returns
103
91
  * Array of maximum width and maximum height.
104
92
  */
105
- async #defaultMaximums(maximumDimensions: MaximumDimensions, invocationContext: Nullishable<TInvocationContext>): Promise<NonNullishable<MaximumDimensions>> {
93
+ async #defaultMaximums(maximumDimensions: MaximumDimensions, invocationContext: Nullishable<InvocationContext>): Promise<NonNullishable<MaximumDimensions>> {
106
94
  if (isNullish(invocationContext)) {
107
95
  // Application error; no localization necessary.
108
96
  throw new Error("Invocation context not provided by application");
@@ -111,8 +99,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
111
99
  const maximumWidth = maximumDimensions.width;
112
100
  const maximumHeight = maximumDimensions.height;
113
101
 
114
- let definedMaximumWidth: number;
115
- let definedMaximumHeight: number;
102
+ let definedMaximumWidth;
103
+ let definedMaximumHeight;
116
104
 
117
105
  // Skip any extra work if both values are provided.
118
106
  if (isNullish(maximumWidth) || isNullish(maximumHeight)) {
@@ -156,8 +144,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
156
144
  requiresContext: true,
157
145
  parameterDescriptors: [spillArrayParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
158
146
  })
159
- async spill(arrayValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<TInvocationContext>): Promise<MatrixResult<unknown, ThrowError, TError>> {
160
- let result: MatrixResult<unknown, ThrowError, TError>;
147
+ async spill(arrayValues: Matrix<unknown>, maximumHeight: Nullishable<number>, maximumWidth: Nullishable<number>, invocationContext: Nullishable<InvocationContext>): Promise<MatrixResult<unknown>> {
148
+ let result;
161
149
 
162
150
  // Assume matrix is uniformly two-dimensional.
163
151
  const height = arrayValues.length;
@@ -279,7 +267,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
279
267
  isHidden: true,
280
268
  parameterDescriptors: [logLevelParameterDescriptor]
281
269
  })
282
- loggerMessages(logLevelString: Nullishable<string>): MatrixResult<string, ThrowError, TError> {
270
+ loggerMessages(logLevelString: Nullishable<string>): MatrixResult<string> {
283
271
  const appExtension = this.appExtension;
284
272
 
285
273
  let logLevel: LogLevel | undefined = undefined;
@@ -306,8 +294,8 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
306
294
  * @param logLevelString
307
295
  * Log level as string.
308
296
  *
309
- * @param streamingInvocationContext
310
- * Streaming invocation context.
297
+ * @param streamingContext
298
+ * Streaming context.
311
299
  */
312
300
  @proxy.describeMethod({
313
301
  type: Types.String,
@@ -316,10 +304,10 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
316
304
  isStream: true,
317
305
  parameterDescriptors: [logLevelParameterDescriptor]
318
306
  })
319
- loggerStream(logLevelString: Nullishable<string>, streamingInvocationContext: Nullishable<TStreamingInvocationContext>): void {
320
- if (isNullish(streamingInvocationContext)) {
307
+ loggerStream(logLevelString: Nullishable<string>, streamingContext: Nullishable<StreamingContext>): void {
308
+ if (isNullish(streamingContext)) {
321
309
  // Application error; no localization necessary.
322
- throw new Error("Streaming invocation context not provided by application");
310
+ throw new Error("Streaming context not provided by application");
323
311
  }
324
312
 
325
313
  const appExtension = this.appExtension;
@@ -327,9 +315,9 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
327
315
  let notificationCallbackAdded = false;
328
316
  let previousLogLevel: number | undefined = undefined;
329
317
 
330
- const streamingConsumerCallback = appExtension.setUpStreaming<string>(streamingInvocationContext, () => {
318
+ const streamingConsumerCallback = appExtension.installStreaming<string>(streamingContext, () => {
331
319
  if (notificationCallbackAdded) {
332
- appExtension.memoryTransport.removeNotificationCallback("loggerMessages");
320
+ appExtension.memoryTransport.removeNotificationCallback(AppHelperProxy.#LOGGER_STREAM_NAME);
333
321
  }
334
322
 
335
323
  if (previousLogLevel !== undefined) {
@@ -337,7 +325,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
337
325
  }
338
326
  });
339
327
 
340
- if (appExtension.memoryTransport.addNotificationCallback("loggerMessages", (_message, messages) => {
328
+ if (appExtension.memoryTransport.addNotificationCallback(AppHelperProxy.#LOGGER_STREAM_NAME, (_message, messages) => {
341
329
  streamingConsumerCallback(this.iterableResult(() => messages));
342
330
  })) {
343
331
  notificationCallbackAdded = true;
@@ -359,7 +347,7 @@ export class AppHelperProxy<ThrowError extends boolean, TError extends ErrorExte
359
347
  }
360
348
  } else {
361
349
  // Diagnostic tool; localization not required.
362
- streamingConsumerCallback([["Only one logger messages call allowable per workbook"]]);
350
+ streamingConsumerCallback([["Only one logger stream allowable per workbook"]]);
363
351
  }
364
352
  }
365
353
  }
@@ -71,6 +71,11 @@ export abstract class FunctionsGenerator extends Generator {
71
71
  [Types.Any]: "any"
72
72
  };
73
73
 
74
+ /**
75
+ * Dummy value passed to invocation context and streaming context parameters if context is not supported.
76
+ */
77
+ static readonly #DUMMY_VALUE = "0";
78
+
74
79
  protected static readonly BASE_IMPORTS = [
75
80
  "import * as AppExtension from \"@aidc-toolkit/app-extension\";",
76
81
  "import { appExtension } from \"./app-extension.js\";"
@@ -86,21 +91,6 @@ export abstract class FunctionsGenerator extends Generator {
86
91
  */
87
92
  readonly #supportsContext: boolean;
88
93
 
89
- /**
90
- * Invocation context type name.
91
- */
92
- readonly #invocationContextTypeName: string;
93
-
94
- /**
95
- * Streaming invocation context type name.
96
- */
97
- readonly #streamingInvocationContextTypeName: string;
98
-
99
- /**
100
- * Template declaration for type alias.
101
- */
102
- readonly #templateDeclaration: string;
103
-
104
94
  /**
105
95
  * Current class type alias.
106
96
  */
@@ -115,35 +105,14 @@ export abstract class FunctionsGenerator extends Generator {
115
105
  * @param inline
116
106
  * If true, functions are declared inline rather than using `function`.
117
107
  *
118
- * @param throwError
119
- * If true, errors are reported through the throw/catch mechanism.
120
- *
121
- * @param errorTypeName
122
- * Error type name.
123
- *
124
108
  * @param supportsContext
125
109
  * If true, application extension supports context.
126
- *
127
- * Big integer type name.
128
- * @param invocationContextTypeName
129
- * Invocation context type name.
130
- *
131
- * @param streamingInvocationContextTypeName
132
- * Streaming invocation context type name.
133
- *
134
- * @param bigIntTypeName
135
- * Big integer type name.
136
110
  */
137
- constructor(version: string, inline: boolean, throwError: boolean, errorTypeName: string, supportsContext: boolean, invocationContextTypeName: string, streamingInvocationContextTypeName: string, bigIntTypeName: string) {
111
+ constructor(version: string, inline: boolean, supportsContext: boolean) {
138
112
  super(version, true);
139
113
 
140
114
  this.#inline = inline;
141
-
142
115
  this.#supportsContext = supportsContext;
143
- this.#invocationContextTypeName = invocationContextTypeName;
144
- this.#streamingInvocationContextTypeName = streamingInvocationContextTypeName;
145
-
146
- this.#templateDeclaration = `<${throwError}, ${errorTypeName}, ${invocationContextTypeName}, ${streamingInvocationContextTypeName}, ${bigIntTypeName}>`;
147
116
  }
148
117
 
149
118
  /**
@@ -173,7 +142,7 @@ export abstract class FunctionsGenerator extends Generator {
173
142
  const classDescriptorNamespace = classDescriptor.namespace ?? "";
174
143
  const name = `${classDescriptorNamespace}${classDescriptor.name}`;
175
144
  const getter = `get${name}()`;
176
- const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}${this.#templateDeclaration}`;
145
+ const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}`;
177
146
 
178
147
  this.#classTypeAlias = {
179
148
  name,
@@ -241,26 +210,26 @@ export abstract class FunctionsGenerator extends Generator {
241
210
  parameterLocalizations.push({
242
211
  name: "invocationContext",
243
212
  description: "Invocation context.",
244
- javaScriptType: this.#invocationContextTypeName
213
+ javaScriptType: "InvocationContext"
245
214
  });
246
215
  }
247
216
 
248
217
  if (methodDescriptor.isStream === true) {
249
218
  parameterLocalizations.push({
250
- name: "streamingInvocationContext",
251
- description: "Streaming invocation context.",
252
- javaScriptType: this.#streamingInvocationContextTypeName
219
+ name: "streamingContext",
220
+ description: "Streaming context.",
221
+ javaScriptType: "StreamingContext"
253
222
  });
254
223
  }
255
224
  } else {
256
225
  if (methodDescriptor.requiresContext === true) {
257
226
  // Invocation context type name represents a literal dummy value.
258
- dummyParameters.push(this.#invocationContextTypeName);
227
+ dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
259
228
  }
260
229
 
261
230
  if (methodDescriptor.isStream === true) {
262
- // Streaming invocation context type name represents a literal dummy value.
263
- dummyParameters.push(this.#streamingInvocationContextTypeName);
231
+ // Streaming context type name represents a literal dummy value.
232
+ dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
264
233
  }
265
234
  }
266
235