@aidc-toolkit/app-extension 1.0.52 → 1.0.53-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 (182) 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 +354 -0
  12. package/dist/app-helper-proxy.js.map +1 -0
  13. package/dist/{descriptor-Df-lif4q.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 -223
  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 -847
  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 -98
  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/version.ts +1 -1
  171. package/tsconfig-src.tsbuildinfo +1 -1
  172. package/dist/character-set-proxy-CQCOcqR3.d.cts +0 -473
  173. package/dist/character-set-proxy-CQCOcqR3.d.ts +0 -473
  174. package/dist/chunk-4BTJEN4N.js +0 -1
  175. package/dist/chunk-G5IU2ZOV.js +0 -1
  176. package/dist/chunk-WLXID4YR.js +0 -1
  177. package/dist/descriptor-Df-lif4q.d.ts +0 -185
  178. package/dist/generator/index.cjs +0 -17
  179. package/dist/generator/index.d.cts +0 -224
  180. package/dist/gs1/index.cjs +0 -1
  181. package/dist/gs1/index.d.cts +0 -185
  182. package/dist/index.cjs +0 -17
@@ -0,0 +1,179 @@
1
+ import { Types } from "../descriptor.js";
2
+ import { Generator } from "./generator.js";
3
+ /**
4
+ * Generator with helpers for writing TypeScript functions file.
5
+ */
6
+ export class FunctionsGenerator extends Generator {
7
+ /**
8
+ * Mapping of descriptor types to JavaScript types.
9
+ */
10
+ static #DESCRIPTOR_TYPE_STRINGS = {
11
+ [Types.String]: "string",
12
+ [Types.Number]: "number",
13
+ [Types.Boolean]: "boolean",
14
+ [Types.Any]: "any"
15
+ };
16
+ /**
17
+ * Dummy value passed to invocation context and streaming context parameters if context is not supported.
18
+ */
19
+ static #DUMMY_VALUE = "0";
20
+ static BASE_IMPORTS = [
21
+ "import * as AppExtension from \"@aidc-toolkit/app-extension\";",
22
+ "import { appExtension } from \"./app-extension.js\";"
23
+ ];
24
+ /**
25
+ * If true, functions are declared inline rather than using `function`.
26
+ */
27
+ #inline;
28
+ /**
29
+ * If true, application extension supports context.
30
+ */
31
+ #supportsContext;
32
+ /**
33
+ * Current class type alias.
34
+ */
35
+ #classTypeAlias;
36
+ /**
37
+ * Constructor.
38
+ *
39
+ * @param version
40
+ * Package version.
41
+ *
42
+ * @param inline
43
+ * If true, functions are declared inline rather than using `function`.
44
+ *
45
+ * @param supportsContext
46
+ * If true, application extension supports context.
47
+ */
48
+ constructor(version, inline, supportsContext) {
49
+ super(version, true);
50
+ this.#inline = inline;
51
+ this.#supportsContext = supportsContext;
52
+ }
53
+ /**
54
+ * Get the class type alias.
55
+ */
56
+ get classTypeAlias() {
57
+ return this.#classTypeAlias;
58
+ }
59
+ /**
60
+ * Get the import statement for a namespace.
61
+ *
62
+ * @param namespace
63
+ * Namespace.
64
+ *
65
+ * @returns
66
+ * Import statement.
67
+ */
68
+ getNamespaceImport(namespace) {
69
+ return `import * as AppExtension${namespace} from "@aidc-toolkit/app-extension/${namespace.toLowerCase()}";`;
70
+ }
71
+ /**
72
+ * @inheritDoc
73
+ */
74
+ createClassProxy(classDescriptor) {
75
+ const classDescriptorNamespace = classDescriptor.namespace ?? "";
76
+ const name = `${classDescriptorNamespace}${classDescriptor.name}`;
77
+ const getter = `get${name}()`;
78
+ const implementation = `AppExtension${classDescriptorNamespace}.${classDescriptor.name}`;
79
+ this.#classTypeAlias = {
80
+ name,
81
+ getter,
82
+ declaration: [
83
+ "",
84
+ "/**",
85
+ " * Class type alias name.",
86
+ " */",
87
+ `type ${name} = ${implementation};`,
88
+ "",
89
+ "/**",
90
+ " * Getter function to get an instance of the class.",
91
+ " *",
92
+ " * @returns",
93
+ " * Class instance.",
94
+ " */",
95
+ `function ${getter}: ${name} {`,
96
+ ` return appExtension.getProxy(${implementation});`,
97
+ "}"
98
+ ]
99
+ };
100
+ }
101
+ /**
102
+ * Get a function implementation.
103
+ *
104
+ * @param methodDescriptor
105
+ * Method descriptor.
106
+ *
107
+ * @param functionNamePrefix
108
+ * Function name prefix.
109
+ *
110
+ * @param functionLocalization
111
+ * Function localization. May be undefined for hidden functions, in which case generated
112
+ *
113
+ * @param parameterCallback
114
+ * Callback to modify parameter in implementation function call.
115
+ *
116
+ * @returns
117
+ * Function implementation.
118
+ */
119
+ getFunctionImplementation(methodDescriptor, functionNamePrefix, functionLocalization, parameterCallback) {
120
+ const methodType = `${this.classTypeAlias.name}["${methodDescriptor.name}"]`;
121
+ const parameterDescriptors = methodDescriptor.parameterDescriptors;
122
+ const parameterLocalizations = parameterDescriptors.map((parameterDescriptor) => {
123
+ const parameterLocalization = functionLocalization?.parametersMap.get(parameterDescriptor.name) ?? {
124
+ name: parameterDescriptor.name,
125
+ description: "*** NO LOCALIZATION ***"
126
+ };
127
+ return {
128
+ ...parameterLocalization,
129
+ javaScriptType: FunctionsGenerator.#DESCRIPTOR_TYPE_STRINGS[parameterDescriptor.type],
130
+ parameterDescriptor
131
+ };
132
+ });
133
+ const dummyParameters = [];
134
+ if (this.#supportsContext) {
135
+ if (methodDescriptor.requiresContext === true) {
136
+ parameterLocalizations.push({
137
+ name: "invocationContext",
138
+ description: "Invocation context.",
139
+ javaScriptType: "InvocationContext"
140
+ });
141
+ }
142
+ if (methodDescriptor.isStream === true) {
143
+ parameterLocalizations.push({
144
+ name: "streamingContext",
145
+ description: "Streaming context.",
146
+ javaScriptType: "StreamingContext"
147
+ });
148
+ }
149
+ }
150
+ else {
151
+ if (methodDescriptor.requiresContext === true) {
152
+ // Invocation context type name represents a literal dummy value.
153
+ dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
154
+ }
155
+ if (methodDescriptor.isStream === true) {
156
+ // Streaming context type name represents a literal dummy value.
157
+ dummyParameters.push(FunctionsGenerator.#DUMMY_VALUE);
158
+ }
159
+ }
160
+ const asyncQualifier = methodDescriptor.isAsync === true ? "async " : "";
161
+ const functionName = functionNamePrefix === "" ?
162
+ functionLocalization?.name ?? methodDescriptor.name :
163
+ `${functionNamePrefix}${functionLocalization?.titleCaseName ?? methodDescriptor.name.replace(/^[a-z]/u, c => c.toUpperCase())}`;
164
+ return {
165
+ functionName,
166
+ parameterLocalizations,
167
+ declaration: [
168
+ `${!this.#inline ?
169
+ `export ${asyncQualifier}function ${functionName}` :
170
+ asyncQualifier}(${parameterLocalizations.map((parameterLocalization, index) => `${parameterLocalization.name}: Parameters<${methodType}>[${index}]`).join(", ")}): ReturnType<${methodType}> ${!this.#inline ? "{" : "=>"}`,
171
+ ` ${!this.#inline ? "return " : ""}${(this.classTypeAlias.getter)}.${methodDescriptor.name}(${[...parameterLocalizations.map(parameterLocalization => parameterCallback === undefined || parameterLocalization.parameterDescriptor === undefined ?
172
+ parameterLocalization.name :
173
+ parameterCallback(parameterLocalization.name, parameterLocalization.parameterDescriptor)), ...dummyParameters].join(", ")})${(!this.#inline ? ";" : "")}`,
174
+ ...!this.#inline ? ["}"] : []
175
+ ]
176
+ };
177
+ }
178
+ }
179
+ //# sourceMappingURL=functions-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions-generator.js","sourceRoot":"","sources":["../../src/generator/functions-generator.ts"],"names":[],"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CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACX,UAAU,cAAc,YAAY,YAAY,EAAE,CAAC,CAAC;oBACpD,cACR,IAAI,sBAAsB,CAAC,GAAG,CAAC,CAAC,qBAAqB,EAAE,KAAK,EAAE,EAAE,CAC5D,GAAG,qBAAqB,CAAC,IAAI,gBAAgB,UAAU,KAAK,KAAK,GAAG,CACvE,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,UAAU,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE;gBACxE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,gBAAgB,CAAC,IAAI,IAAI,CAAC,GAAG,sBAAsB,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CACpJ,iBAAiB,KAAK,SAAS,IAAI,qBAAqB,CAAC,mBAAmB,KAAK,SAAS,CAAC,CAAC;wBACxF,qBAAqB,CAAC,IAAI,CAAC,CAAC;wBAC5B,iBAAiB,CAAC,qBAAqB,CAAC,IAAI,EAAE,qBAAqB,CAAC,mBAAmB,CAAC,CAC/F,EAAE,GAAG,eAAe,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;gBACjE,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE;aAChC;SACJ,CAAC;IACN,CAAC"}
@@ -0,0 +1,121 @@
1
+ import { type Promisable } from "@aidc-toolkit/core";
2
+ import type { Logger } from "tslog";
3
+ import type { ClassDescriptor, MethodDescriptor } from "../descriptor.js";
4
+ /**
5
+ * Localization.
6
+ */
7
+ export interface Localization {
8
+ /**
9
+ * Name.
10
+ */
11
+ readonly name: string;
12
+ /**
13
+ * Description.
14
+ */
15
+ readonly description: string;
16
+ }
17
+ /**
18
+ * Function localization.
19
+ */
20
+ export interface FunctionLocalization extends Localization {
21
+ /**
22
+ * Name in title case.
23
+ */
24
+ readonly titleCaseName: string;
25
+ /**
26
+ * Documentation URL.
27
+ */
28
+ readonly documentationURL: string;
29
+ /**
30
+ * Parameters map.
31
+ */
32
+ readonly parametersMap: ReadonlyMap<string, Localization>;
33
+ }
34
+ /**
35
+ * Abstract generator.
36
+ */
37
+ export declare abstract class Generator {
38
+ #private;
39
+ /**
40
+ * Constructor.
41
+ *
42
+ * @param version
43
+ * Package version.
44
+ *
45
+ * @param includeLocalizations
46
+ * Include localizations if true.
47
+ */
48
+ constructor(version: string, includeLocalizations?: boolean);
49
+ /**
50
+ * Get the logger.
51
+ */
52
+ get logger(): Logger<object>;
53
+ /**
54
+ * Get the package version.
55
+ */
56
+ get version(): string;
57
+ /**
58
+ * Get the locales.
59
+ */
60
+ protected get locales(): readonly string[];
61
+ /**
62
+ * Get the default locale.
63
+ */
64
+ protected get defaultLocale(): string;
65
+ /**
66
+ * Initialize the generation of the output.
67
+ */
68
+ protected abstract initialize(): Promisable<void>;
69
+ /**
70
+ * Create a namespace.
71
+ *
72
+ * @param namespace
73
+ * Namespace.
74
+ */
75
+ protected abstract createNamespace(namespace: string | undefined): void;
76
+ /**
77
+ * Create a category.
78
+ *
79
+ * @param namespace
80
+ * Namespace.
81
+ *
82
+ * @param category
83
+ * Category.
84
+ *
85
+ * @param categoryLocalizationsMap
86
+ * Category localizations map.
87
+ */
88
+ protected abstract createCategory(namespace: string | undefined, category: string, categoryLocalizationsMap: ReadonlyMap<string, string>): void;
89
+ /**
90
+ * Create a proxy for a class.
91
+ *
92
+ * @param classDescriptor
93
+ * Class descriptor.
94
+ */
95
+ protected abstract createClassProxy(classDescriptor: ClassDescriptor): void;
96
+ /**
97
+ * Create a proxy for a method.
98
+ *
99
+ * @param classDescriptor
100
+ * Class descriptor.
101
+ *
102
+ * @param methodDescriptor
103
+ * Method descriptor.
104
+ *
105
+ * @param functionLocalizationsMap
106
+ * Function localizations map.
107
+ */
108
+ protected abstract createMethodProxy(classDescriptor: ClassDescriptor, methodDescriptor: MethodDescriptor, functionLocalizationsMap: ReadonlyMap<string, FunctionLocalization>): void;
109
+ /**
110
+ * Finalize the generation of the output.
111
+ *
112
+ * @param success
113
+ * True if successful.
114
+ */
115
+ protected abstract finalize(success: boolean): Promisable<void>;
116
+ /**
117
+ * Generate by processing individual imports.
118
+ */
119
+ generate(): Promise<void>;
120
+ }
121
+ //# sourceMappingURL=generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,UAAU,EAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAiB1E;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACtD;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,WAAW,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CAC7D;AAED;;GAEG;AACH,8BAAsB,SAAS;;IA0B3B;;;;;;;;OAQG;gBACS,OAAO,EAAE,MAAM,EAAE,oBAAoB,UAAO;IAOxD;;OAEG;IACH,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,CAAC,CAE3B;IAED;;OAEG;IACH,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED;;OAEG;IACH,SAAS,KAAK,OAAO,IAAI,SAAS,MAAM,EAAE,CAEzC;IAED;;OAEG;IACH,SAAS,KAAK,aAAa,IAAI,MAAM,CAEpC;IAED;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,CAAC;IAEjD;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAEvE;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,wBAAwB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI;IAE/I;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;IAE3E;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,QAAQ,CAAC,iBAAiB,CAAC,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,WAAW,CAAC,MAAM,EAAE,oBAAoB,CAAC,GAAG,IAAI;IAErL;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC;IAkC/D;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAyGlC"}
@@ -0,0 +1,186 @@
1
+ import { ALPHA_URL, getLogger, I18nLanguageDetectors, isI18nParseKey, websiteURL } from "@aidc-toolkit/core";
2
+ import { AppHelperProxy } from "../app-helper-proxy.js";
3
+ import * as GS1 from "../gs1/index.js";
4
+ import { appExtensionResourceBundle, i18nAppExtensionInit, i18nextAppExtension } from "../locale/i18n.js";
5
+ import { proxy } from "../proxy.js";
6
+ import * as Utility from "../utility/index.js";
7
+ /**
8
+ * Dummy method to force proxies to register their decorators.
9
+ *
10
+ * @param _proxies
11
+ * Proxies.
12
+ */
13
+ function registerProxies(..._proxies) {
14
+ }
15
+ registerProxies(AppHelperProxy, Utility, GS1);
16
+ /**
17
+ * Abstract generator.
18
+ */
19
+ export class Generator {
20
+ /**
21
+ * Documentation path, optionally preceded by locale.
22
+ */
23
+ static #DOCUMENTATION_PATH = "app-extension/";
24
+ /**
25
+ * Logger.
26
+ */
27
+ #logger = getLogger();
28
+ /**
29
+ * Package version.
30
+ */
31
+ #version;
32
+ /**
33
+ * Locales.
34
+ */
35
+ #locales;
36
+ /**
37
+ * Default locale.
38
+ */
39
+ #defaultLocale;
40
+ /**
41
+ * Constructor.
42
+ *
43
+ * @param version
44
+ * Package version.
45
+ *
46
+ * @param includeLocalizations
47
+ * Include localizations if true.
48
+ */
49
+ constructor(version, includeLocalizations = true) {
50
+ this.#version = version;
51
+ this.#locales = includeLocalizations ? Object.keys(appExtensionResourceBundle) : [];
52
+ this.#defaultLocale = this.#locales[0] ?? "";
53
+ }
54
+ /**
55
+ * Get the logger.
56
+ */
57
+ get logger() {
58
+ return this.#logger;
59
+ }
60
+ /**
61
+ * Get the package version.
62
+ */
63
+ get version() {
64
+ return this.#version;
65
+ }
66
+ /**
67
+ * Get the locales.
68
+ */
69
+ get locales() {
70
+ return this.#locales;
71
+ }
72
+ /**
73
+ * Get the default locale.
74
+ */
75
+ get defaultLocale() {
76
+ return this.#defaultLocale;
77
+ }
78
+ /**
79
+ * Get a localization.
80
+ *
81
+ * @template TLocalization
82
+ * Localization type.
83
+ *
84
+ * @param locale
85
+ * Locale.
86
+ *
87
+ * @param key
88
+ * Key.
89
+ *
90
+ * @param localizationCallback
91
+ * Callback to finalize localization.
92
+ *
93
+ * @returns
94
+ * Localization.
95
+ */
96
+ static #getLocalization(locale, key, localizationCallback) {
97
+ const lngReturnObjectsOption = {
98
+ lng: locale,
99
+ returnObjects: true
100
+ };
101
+ if (!isI18nParseKey(i18nextAppExtension, key, lngReturnObjectsOption)) {
102
+ throw new Error(`Missing localization for ${key} in ${locale}`);
103
+ }
104
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- Return type is Localization & Partial<TLocalization>.
105
+ return localizationCallback(locale, i18nextAppExtension.t(key, lngReturnObjectsOption));
106
+ }
107
+ /**
108
+ * Generate by processing individual imports.
109
+ */
110
+ async generate() {
111
+ let success = false;
112
+ await i18nAppExtensionInit(I18nLanguageDetectors.CLI);
113
+ const documentationBaseURL = websiteURL(this.version, true, await ALPHA_URL);
114
+ await this.initialize();
115
+ const namespaceHierarchy = new Map();
116
+ // Organize class descriptors by namespace and category.
117
+ for (const classDescriptor of proxy.classDescriptors) {
118
+ const namespace = classDescriptor.namespace;
119
+ const category = classDescriptor.category;
120
+ let categoryHierarchy = namespaceHierarchy.get(namespace);
121
+ if (categoryHierarchy === undefined) {
122
+ categoryHierarchy = new Map();
123
+ namespaceHierarchy.set(namespace, categoryHierarchy);
124
+ }
125
+ let classDescriptors = categoryHierarchy.get(category);
126
+ if (classDescriptors === undefined) {
127
+ classDescriptors = [];
128
+ categoryHierarchy.set(category, classDescriptors);
129
+ }
130
+ classDescriptors.push(classDescriptor);
131
+ }
132
+ try {
133
+ for (const [namespace, categoryHierarchy] of namespaceHierarchy) {
134
+ const namespacePrefix = namespace === undefined ? "" : `${namespace}.`;
135
+ const namespacePath = namespace === undefined ? "" : `${namespace}/`;
136
+ this.createNamespace(namespace);
137
+ for (const [category, classDescriptors] of categoryHierarchy) {
138
+ const categoryKey = `Categories.${category}`;
139
+ const namespaceCategoryKey = `Categories.${namespacePrefix}${category}`;
140
+ const categoryLocalizationsMap = new Map(this.locales.map((locale) => {
141
+ const lngOption = {
142
+ lng: locale
143
+ };
144
+ let key = namespaceCategoryKey;
145
+ if (!isI18nParseKey(i18nextAppExtension, key)) {
146
+ key = categoryKey;
147
+ if (!isI18nParseKey(i18nextAppExtension, key, lngOption)) {
148
+ throw new Error(`Missing localization for ${key} in ${locale}`);
149
+ }
150
+ }
151
+ return [locale, i18nextAppExtension.t(key, lngOption)];
152
+ }));
153
+ this.createCategory(namespace, category, categoryLocalizationsMap);
154
+ const namespaceClassNamesSet = new Set();
155
+ for (const classDescriptor of classDescriptors) {
156
+ const namespaceClassName = `${namespacePrefix}${classDescriptor.name}`;
157
+ if (namespaceClassNamesSet.has(namespaceClassName)) {
158
+ throw new Error(`Duplicate class ${namespaceClassName}`);
159
+ }
160
+ namespaceClassNamesSet.add(namespaceClassName);
161
+ this.createClassProxy(classDescriptor);
162
+ for (const methodDescriptor of classDescriptor.methodDescriptors) {
163
+ const functionLocalizationsMap = new Map(methodDescriptor.isHidden !== true ?
164
+ this.locales.map(locale => [locale, Generator.#getLocalization(locale, `Functions.${namespacePrefix}${methodDescriptor.functionName}`, (locale, localization) => ({
165
+ ...localization,
166
+ titleCaseName: localization.titleCaseName ?? localization.name.replace(/^[a-z]/u, c => c.toUpperCase()),
167
+ documentationURL: `${documentationBaseURL}/${locale === this.defaultLocale ? "" : `${locale}/`}${Generator.#DOCUMENTATION_PATH}${namespacePath}${localization.name}.html`,
168
+ parametersMap: new Map(methodDescriptor.parameterDescriptors.map(parameterDescriptor =>
169
+ // eslint-disable-next-line max-nested-callbacks -- Callback is empty.
170
+ [parameterDescriptor.name, Generator.#getLocalization(locale, `Parameters.${parameterDescriptor.name}`, (_locale, localization) => localization)]))
171
+ }))]) :
172
+ // Hidden methods are not localized.
173
+ []);
174
+ this.createMethodProxy(classDescriptor, methodDescriptor, functionLocalizationsMap);
175
+ }
176
+ }
177
+ }
178
+ }
179
+ success = true;
180
+ }
181
+ finally {
182
+ await this.finalize(success);
183
+ }
184
+ }
185
+ }
186
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/generator/generator.ts"],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