@gandalan/weblibs 1.5.28 → 1.5.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/JSDOC.md +170 -528
- package/api/neherApp3Types.js +1 -0
- package/index.d.ts +1 -0
- package/index.js +4 -23
- package/package.json +2 -2
- package/scripts/{generate-root-dto-typedefs.mjs → generate-dts.mjs} +1 -286
- package/api/neherApp3Types.d.ts +0 -85
package/api/neherApp3Types.js
CHANGED
|
@@ -102,6 +102,7 @@
|
|
|
102
102
|
* @property {(message: string, type?: NeherApp3NotifyType, cb?: function) => void} notify - Shows a notification. Type defaults to 0 (info). Callback is optional.
|
|
103
103
|
* @property {NeherApp3ApiCollection} api
|
|
104
104
|
* @property {NeherApp3CacheCollection} cache
|
|
105
|
+
* @property {boolean} isEmbedded - Indicates if the app is embedded inside i3
|
|
105
106
|
*/
|
|
106
107
|
|
|
107
108
|
export {};
|
package/index.d.ts
CHANGED
|
@@ -1961,6 +1961,7 @@ export type NeherApp3 = {
|
|
|
1961
1961
|
notify: (message: string, type?: NeherApp3NotifyType, cb?: Function) => void;
|
|
1962
1962
|
api: NeherApp3ApiCollection;
|
|
1963
1963
|
cache: NeherApp3CacheCollection;
|
|
1964
|
+
isEmbedded: boolean;
|
|
1964
1965
|
};
|
|
1965
1966
|
|
|
1966
1967
|
export type NeherApp3ApiCollection = {
|
package/index.js
CHANGED
|
@@ -18,7 +18,7 @@ export * from "./api/dtos/index.js";
|
|
|
18
18
|
|
|
19
19
|
// BEGIN GENERATED ROOT DTO TYPEDEFS
|
|
20
20
|
// DTO Type Definitions - copied to the package root for stable JSDoc imports
|
|
21
|
-
// This block is generated by scripts/generate-
|
|
21
|
+
// This block is generated by scripts/generate-dts.mjs from ./api/dtos/index.js
|
|
22
22
|
/** @typedef {import("./api/dtos/index.js").ApiVersionDTO} ApiVersionDTO */
|
|
23
23
|
/** @typedef {import("./api/dtos/index.js").ChangeDTO} ChangeDTO */
|
|
24
24
|
/** @typedef {import("./api/dtos/index.js").ChangeInfoDTO} ChangeInfoDTO */
|
|
@@ -232,7 +232,7 @@ export * from "./ui/index.js";
|
|
|
232
232
|
|
|
233
233
|
// BEGIN GENERATED ROOT BUSINESS TYPEDEFS
|
|
234
234
|
// Business API Type Definitions - copied to the package root for stable JSDoc imports
|
|
235
|
-
// This block is generated by scripts/generate-
|
|
235
|
+
// This block is generated by scripts/generate-dts.mjs from ./api/business/index.js
|
|
236
236
|
/** @typedef {import("./api/business/index.js").AblageApi} AblageApi */
|
|
237
237
|
/** @typedef {import("./api/business/index.js").AnpassungApi} AnpassungApi */
|
|
238
238
|
/** @typedef {import("./api/business/index.js").ArtikelApi} ArtikelApi */
|
|
@@ -262,29 +262,10 @@ export * from "./ui/index.js";
|
|
|
262
262
|
/** @typedef {import("./api/business/index.js").VorgangApi} VorgangApi */
|
|
263
263
|
// END GENERATED ROOT BUSINESS TYPEDEFS
|
|
264
264
|
|
|
265
|
-
/**
|
|
266
|
-
* @typedef {import("./api/fluentApi").FluentApi} FluentApi
|
|
267
|
-
* @typedef {import("./api/idasFluentApi").IDASFluentApi} IDASFluentApi
|
|
268
|
-
* @typedef {import("./api/fluentAuthManager").FluentAuthManager} FluentAuthManager
|
|
269
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3NotifyType} NeherApp3NotifyType
|
|
270
|
-
* @typedef {import("./api/neherApp3Types.js").ArtikelstammEintrag} ArtikelstammEintrag
|
|
271
|
-
* @typedef {import("./api/neherApp3Types.js").Variante} Variante
|
|
272
|
-
* @typedef {import("./api/neherApp3Types.js").Werteliste} Werteliste
|
|
273
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3ArtikelstammCache} NeherApp3ArtikelstammCache
|
|
274
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3ErfassungCache} NeherApp3ErfassungCache
|
|
275
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3Props} NeherApp3Props
|
|
276
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3MenuItem} NeherApp3MenuItem
|
|
277
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3SetupContext} NeherApp3SetupContext
|
|
278
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3Module} NeherApp3Module
|
|
279
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3ApiCollection} NeherApp3ApiCollection
|
|
280
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3CacheCollection} NeherApp3CacheCollection
|
|
281
|
-
* @typedef {import("./api/neherApp3Types.js").NeherApp3} NeherApp3
|
|
282
|
-
*/
|
|
283
|
-
|
|
284
265
|
/**
|
|
285
266
|
* Global NeherApp3 instance
|
|
286
|
-
* @type {NeherApp3}
|
|
267
|
+
* @type {import("./api/neherApp3Types.js").NeherApp3}
|
|
287
268
|
* @global
|
|
288
269
|
*/
|
|
289
|
-
globalThis.neherapp3 = /** @type {NeherApp3} */ (globalThis.neherapp3 || {});
|
|
270
|
+
globalThis.neherapp3 = /** @type {import("./api/neherApp3Types.js").NeherApp3} */ (globalThis.neherapp3 || {});
|
|
290
271
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gandalan/weblibs",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.29",
|
|
4
4
|
"description": "WebLibs for Gandalan JS/TS projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"gandalan"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"typings": "index.d.ts",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"scripts": {
|
|
18
|
-
"generate:
|
|
18
|
+
"generate:dts": "node ./scripts/generate-dts.mjs",
|
|
19
19
|
"lint": "eslint .",
|
|
20
20
|
"lint:prod": "eslint .",
|
|
21
21
|
"lint:fix": "eslint . --fix"
|
|
@@ -11,8 +11,6 @@ const rootDtsPath = path.join(rootDir, "index.d.ts");
|
|
|
11
11
|
const dtoIndexPath = path.join(rootDir, "api", "dtos", "index.js");
|
|
12
12
|
const businessIndexPath = path.join(rootDir, "api", "business", "index.js");
|
|
13
13
|
const uiIndexPath = path.join(rootDir, "ui", "index.js");
|
|
14
|
-
const neherApp3TypesJsPath = path.join(rootDir, "api", "neherApp3Types.js");
|
|
15
|
-
const neherApp3TypesDtsPath = path.join(rootDir, "api", "neherApp3Types.d.ts");
|
|
16
14
|
|
|
17
15
|
const dtoLeafDirectory = path.join(rootDir, "api", "dtos");
|
|
18
16
|
const businessLeafDirectory = path.join(rootDir, "api", "business");
|
|
@@ -43,193 +41,6 @@ const rootFunctionDeclarationStatements = [
|
|
|
43
41
|
const simpleImportTypePattern = /^import\((?:"|').+(?:"|')\)\.[A-Za-z0-9_$]+$/;
|
|
44
42
|
const returnTypeOfCreateApiPattern = /^ReturnType<\s*typeof\s+(create[A-Za-z0-9_$]+Api)\s*>$/;
|
|
45
43
|
|
|
46
|
-
const rawType = (js, ts = js) => ({ kind: "raw", js, ts });
|
|
47
|
-
const refType = (name) => rawType(name);
|
|
48
|
-
const importType = (importPath, name) => rawType(`import("${importPath}").${name}`);
|
|
49
|
-
const arrayType = (elementType) => ({ kind: "array", elementType });
|
|
50
|
-
const promiseType = (valueType) => ({ kind: "promise", valueType });
|
|
51
|
-
const unionType = (...types) => ({ kind: "union", types });
|
|
52
|
-
const intersectionType = (...types) => ({ kind: "intersection", types });
|
|
53
|
-
const functionType = (params, returnType) => ({ kind: "function", params, returnType });
|
|
54
|
-
const objectLiteralType = (properties) => ({ kind: "objectLiteral", properties });
|
|
55
|
-
|
|
56
|
-
const stringType = refType("string");
|
|
57
|
-
const booleanType = refType("boolean");
|
|
58
|
-
const voidType = refType("void");
|
|
59
|
-
const jsObjectType = rawType("Object", "object");
|
|
60
|
-
const jsFunctionType = rawType("function", "Function");
|
|
61
|
-
|
|
62
|
-
const neherApp3JsImports = [
|
|
63
|
-
{ importPath: "./fluentApi.js", name: "FluentApi" },
|
|
64
|
-
{ importPath: "./idasFluentApi.js", name: "IDASFluentApi" },
|
|
65
|
-
{ importPath: "./fluentAuthManager.js", name: "FluentAuthManager" }
|
|
66
|
-
];
|
|
67
|
-
|
|
68
|
-
const neherApp3TypeDefinitions = [
|
|
69
|
-
{
|
|
70
|
-
kind: "alias",
|
|
71
|
-
name: "NeherApp3NotifyType",
|
|
72
|
-
type: unionType(rawType("0"), rawType("1"), rawType("2"))
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
kind: "object",
|
|
76
|
-
name: "ArtikelstammEintrag",
|
|
77
|
-
properties: [
|
|
78
|
-
{ name: "KatalogArtikelGuid", type: stringType, optional: true },
|
|
79
|
-
{ name: "KatalogNummer", type: stringType, optional: true },
|
|
80
|
-
{ name: "Katalognummer", type: stringType, optional: true },
|
|
81
|
-
{ name: "Nummer", type: stringType, optional: true }
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
kind: "object",
|
|
86
|
-
name: "Variante",
|
|
87
|
-
properties: [
|
|
88
|
-
{ name: "VarianteGuid", type: stringType, optional: true },
|
|
89
|
-
{ name: "Name", type: stringType, optional: true },
|
|
90
|
-
{ name: "Kuerzel", type: stringType, optional: true }
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
kind: "object",
|
|
95
|
-
name: "Werteliste",
|
|
96
|
-
properties: [
|
|
97
|
-
{ name: "WerteListeGuid", type: stringType, optional: true },
|
|
98
|
-
{ name: "Name", type: stringType, optional: true }
|
|
99
|
-
]
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
kind: "object",
|
|
103
|
-
name: "NeherApp3ArtikelstammCache",
|
|
104
|
-
properties: [
|
|
105
|
-
{ name: "getArtikelStamm", type: functionType([], promiseType(arrayType(refType("ArtikelstammEintrag")))) },
|
|
106
|
-
{ name: "getWarenGruppen", type: functionType([], promiseType(arrayType(jsObjectType))) },
|
|
107
|
-
{
|
|
108
|
-
name: "getArtikelByGuid",
|
|
109
|
-
type: functionType([{ name: "guid", type: stringType }], promiseType(unionType(refType("ArtikelstammEintrag"), rawType("undefined"))))
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "getArtikelByKatalognummer",
|
|
113
|
-
type: functionType([{ name: "nummer", type: stringType }], promiseType(unionType(refType("ArtikelstammEintrag"), rawType("undefined"))))
|
|
114
|
-
}
|
|
115
|
-
]
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
kind: "object",
|
|
119
|
-
name: "NeherApp3ErfassungCache",
|
|
120
|
-
properties: [
|
|
121
|
-
{ name: "getVarianten", type: functionType([], promiseType(arrayType(refType("Variante")))) },
|
|
122
|
-
{
|
|
123
|
-
name: "getVariante",
|
|
124
|
-
type: functionType([{ name: "variantenNameOderKuerzel", type: stringType }], promiseType(unionType(refType("Variante"), rawType("undefined"))))
|
|
125
|
-
},
|
|
126
|
-
{ name: "getWertelisten", type: functionType([], promiseType(arrayType(refType("Werteliste")))) },
|
|
127
|
-
{
|
|
128
|
-
name: "getWerteliste",
|
|
129
|
-
type: functionType([{ name: "name", type: stringType }], promiseType(unionType(refType("Werteliste"), rawType("undefined"))))
|
|
130
|
-
},
|
|
131
|
-
{ name: "getScripts", type: functionType([], promiseType(arrayType(jsObjectType))) },
|
|
132
|
-
{ name: "createUIMachine", type: functionType([{ name: "v", type: refType("Variante") }], voidType) }
|
|
133
|
-
]
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
kind: "object",
|
|
137
|
-
name: "NeherApp3Props",
|
|
138
|
-
properties: [
|
|
139
|
-
{ name: "api", type: importType("./fluentApi.js", "FluentApi") },
|
|
140
|
-
{ name: "authManager", type: importType("./fluentAuthManager.js", "FluentAuthManager"), optional: true },
|
|
141
|
-
{ name: "idas", type: importType("./idasFluentApi.js", "IDASFluentApi") },
|
|
142
|
-
{ name: "mainCssPath", type: stringType, optional: true }
|
|
143
|
-
]
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
kind: "object",
|
|
147
|
-
name: "NeherApp3MenuItem",
|
|
148
|
-
properties: [
|
|
149
|
-
{ name: "id", type: stringType, optional: true, description: "Unique identifier for the menu item (auto-generated if not provided)" },
|
|
150
|
-
{ name: "selected", type: booleanType, optional: true, description: "Indicates if the menu item is currently selected (managed by the menu system)" },
|
|
151
|
-
{ name: "icon", type: stringType, optional: true, description: "URL to an icon" },
|
|
152
|
-
{ name: "url", type: unionType(stringType, rawType("null")), optional: true, description: "Relative URL to use for routes" },
|
|
153
|
-
{ name: "text", type: stringType, description: "Display text" },
|
|
154
|
-
{ name: "parent", type: unionType(stringType, rawType("null")), optional: true, description: "Parent menu item (optional). If not set, the item will be added to the top level menu." },
|
|
155
|
-
{ name: "hidden", type: booleanType, optional: true, description: "If true, the menu item will not be displayed" }
|
|
156
|
-
]
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
kind: "alias",
|
|
160
|
-
name: "NeherApp3SetupContext",
|
|
161
|
-
type: intersectionType(
|
|
162
|
-
refType("NeherApp3Props"),
|
|
163
|
-
objectLiteralType([{ name: "neherapp3", type: refType("NeherApp3") }])
|
|
164
|
-
)
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
kind: "object",
|
|
168
|
-
name: "NeherApp3Module",
|
|
169
|
-
properties: [
|
|
170
|
-
{ name: "moduleName", type: stringType },
|
|
171
|
-
{
|
|
172
|
-
name: "setup",
|
|
173
|
-
type: functionType([{ name: "context", type: refType("NeherApp3SetupContext") }], unionType(voidType, promiseType(voidType))),
|
|
174
|
-
optional: true
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "mount",
|
|
178
|
-
type: functionType(
|
|
179
|
-
[
|
|
180
|
-
{ name: "node", type: refType("HTMLElement") },
|
|
181
|
-
{ name: "props", type: refType("NeherApp3SetupContext") }
|
|
182
|
-
],
|
|
183
|
-
unionType(voidType, jsFunctionType)
|
|
184
|
-
),
|
|
185
|
-
optional: true,
|
|
186
|
-
description: "Must return an optional unmount function"
|
|
187
|
-
},
|
|
188
|
-
{ name: "embedUrl", type: stringType, optional: true },
|
|
189
|
-
{ name: "extraCSS", type: arrayType(stringType), optional: true },
|
|
190
|
-
{ name: "useShadowDom", type: booleanType, optional: true, description: "If true, the app will be embedded in a shadow DOM. This is required for CSS isolation." }
|
|
191
|
-
]
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
kind: "object",
|
|
195
|
-
name: "NeherApp3ApiCollection",
|
|
196
|
-
properties: [
|
|
197
|
-
{ name: "idas", type: importType("./idasFluentApi.js", "IDASFluentApi"), optional: true },
|
|
198
|
-
{ name: "hostingEnvironment", type: importType("./fluentApi.js", "FluentApi"), optional: true }
|
|
199
|
-
]
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
kind: "object",
|
|
203
|
-
name: "NeherApp3CacheCollection",
|
|
204
|
-
properties: [
|
|
205
|
-
{ name: "artikelstamm", type: refType("NeherApp3ArtikelstammCache") },
|
|
206
|
-
{ name: "erfassung", type: refType("NeherApp3ErfassungCache") }
|
|
207
|
-
]
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
kind: "object",
|
|
211
|
-
name: "NeherApp3",
|
|
212
|
-
properties: [
|
|
213
|
-
{ name: "addMenuItem", type: functionType([{ name: "menuItem", type: refType("NeherApp3MenuItem") }], voidType) },
|
|
214
|
-
{ name: "addApp", type: functionType([{ name: "appModule", type: unionType(refType("NeherApp3Module"), stringType) }], promiseType(voidType)) },
|
|
215
|
-
{
|
|
216
|
-
name: "notify",
|
|
217
|
-
type: functionType(
|
|
218
|
-
[
|
|
219
|
-
{ name: "message", type: stringType },
|
|
220
|
-
{ name: "type", type: refType("NeherApp3NotifyType"), optional: true },
|
|
221
|
-
{ name: "cb", type: jsFunctionType, optional: true }
|
|
222
|
-
],
|
|
223
|
-
voidType
|
|
224
|
-
),
|
|
225
|
-
description: "Shows a notification. Type defaults to 0 (info). Callback is optional."
|
|
226
|
-
},
|
|
227
|
-
{ name: "api", type: refType("NeherApp3ApiCollection") },
|
|
228
|
-
{ name: "cache", type: refType("NeherApp3CacheCollection") }
|
|
229
|
-
]
|
|
230
|
-
}
|
|
231
|
-
];
|
|
232
|
-
|
|
233
44
|
async function collectFiles(directoryPath, allowedExtensions) {
|
|
234
45
|
const entries = await readdir(directoryPath, { withFileTypes: true });
|
|
235
46
|
const files = [];
|
|
@@ -263,95 +74,6 @@ function getJSDocBlocks(source) {
|
|
|
263
74
|
return source.match(/\/\*\*[\s\S]*?\*\//g) ?? [];
|
|
264
75
|
}
|
|
265
76
|
|
|
266
|
-
function renderTypeExpression(typeExpression, format) {
|
|
267
|
-
switch (typeExpression.kind) {
|
|
268
|
-
case "raw":
|
|
269
|
-
return format === "js" ? typeExpression.js : typeExpression.ts;
|
|
270
|
-
case "array":
|
|
271
|
-
return `${renderTypeExpression(typeExpression.elementType, format)}[]`;
|
|
272
|
-
case "promise":
|
|
273
|
-
return `Promise<${renderTypeExpression(typeExpression.valueType, format)}>`;
|
|
274
|
-
case "union":
|
|
275
|
-
return typeExpression.types.map((type) => renderTypeExpression(type, format)).join(" | ");
|
|
276
|
-
case "intersection":
|
|
277
|
-
return typeExpression.types.map((type) => renderTypeExpression(type, format)).join(" & ");
|
|
278
|
-
case "function":
|
|
279
|
-
return `(${typeExpression.params.map((param) => `${param.name}${param.optional ? "?" : ""}: ${renderTypeExpression(param.type, format)}`).join(", ")}) => ${renderTypeExpression(typeExpression.returnType, format)}`;
|
|
280
|
-
case "objectLiteral":
|
|
281
|
-
return `{ ${typeExpression.properties.map((property) => `${property.name}${property.optional ? "?" : ""}: ${renderTypeExpression(property.type, format)}`).join("; ")} }`;
|
|
282
|
-
default:
|
|
283
|
-
throw new Error(`Unsupported type expression kind: ${typeExpression.kind}`);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
function buildNeherApp3TypesJsSource() {
|
|
288
|
-
const lines = [
|
|
289
|
-
"/**",
|
|
290
|
-
" * Auto-generated NeherApp3 root type definitions.",
|
|
291
|
-
" * Do not modify manually - changes will be overwritten by scripts/generate-root-dto-typedefs.mjs",
|
|
292
|
-
" */",
|
|
293
|
-
""
|
|
294
|
-
];
|
|
295
|
-
|
|
296
|
-
for (const jsImport of neherApp3JsImports) {
|
|
297
|
-
lines.push(`/** @typedef {import("${jsImport.importPath}").${jsImport.name}} ${jsImport.name} */`);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
lines.push("");
|
|
301
|
-
|
|
302
|
-
for (const definition of neherApp3TypeDefinitions) {
|
|
303
|
-
if (definition.kind === "alias") {
|
|
304
|
-
lines.push("/**");
|
|
305
|
-
lines.push(` * @typedef {${renderTypeExpression(definition.type, "js")}} ${definition.name}`);
|
|
306
|
-
lines.push(" */");
|
|
307
|
-
lines.push("");
|
|
308
|
-
continue;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
lines.push("/**");
|
|
312
|
-
lines.push(` * @typedef {Object} ${definition.name}`);
|
|
313
|
-
|
|
314
|
-
for (const property of definition.properties) {
|
|
315
|
-
const propertyName = property.optional ? `[${property.name}]` : property.name;
|
|
316
|
-
const propertyLine = ` * @property {${renderTypeExpression(property.type, "js")}} ${propertyName}`;
|
|
317
|
-
lines.push(property.description ? `${propertyLine} - ${property.description}` : propertyLine);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
lines.push(" */");
|
|
321
|
-
lines.push("");
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
lines.push("export {};");
|
|
325
|
-
return `${lines.join("\n")}\n`;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function buildNeherApp3TypesDtsSource() {
|
|
329
|
-
const lines = [
|
|
330
|
-
"// Auto-generated NeherApp3 root type definitions.",
|
|
331
|
-
"// Do not modify manually - changes will be overwritten by scripts/generate-root-dto-typedefs.mjs",
|
|
332
|
-
""
|
|
333
|
-
];
|
|
334
|
-
|
|
335
|
-
for (const definition of neherApp3TypeDefinitions) {
|
|
336
|
-
if (definition.kind === "alias") {
|
|
337
|
-
lines.push(`export type ${definition.name} = ${renderTypeExpression(definition.type, "ts")};`);
|
|
338
|
-
lines.push("");
|
|
339
|
-
continue;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
lines.push(`export type ${definition.name} = {`);
|
|
343
|
-
|
|
344
|
-
for (const property of definition.properties) {
|
|
345
|
-
lines.push(` ${property.name}${property.optional ? "?" : ""}: ${renderTypeExpression(property.type, "ts")};`);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
lines.push("};");
|
|
349
|
-
lines.push("");
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
return `${lines.join("\n")}\n`;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
77
|
function normalizeJSDocBlock(block) {
|
|
356
78
|
return block
|
|
357
79
|
.replace(/^\/\*\*/, "")
|
|
@@ -1479,7 +1201,7 @@ function buildRootAliasBlock(startMarker, endMarker, description, aliases, impor
|
|
|
1479
1201
|
const lines = [
|
|
1480
1202
|
startMarker,
|
|
1481
1203
|
description,
|
|
1482
|
-
`// This block is generated by scripts/generate-
|
|
1204
|
+
`// This block is generated by scripts/generate-dts.mjs from ${importPath}`,
|
|
1483
1205
|
...aliases.map((alias) => {
|
|
1484
1206
|
const name = nameSelector(alias);
|
|
1485
1207
|
return `/** @typedef {import("${importPath}").${name}} ${name} */`;
|
|
@@ -1552,19 +1274,14 @@ const publicTypeEntries = [
|
|
|
1552
1274
|
const generatedDtoIndexSource = buildDtoIndexSource(dtoAliases);
|
|
1553
1275
|
const generatedBusinessIndexSource = buildBusinessIndexSource(businessAliases);
|
|
1554
1276
|
const generatedUiIndexSource = buildUiIndexSource(uiLeafFiles, sourceByFilePath);
|
|
1555
|
-
const generatedNeherApp3TypesJsSource = buildNeherApp3TypesJsSource();
|
|
1556
|
-
const generatedNeherApp3TypesDtsSource = buildNeherApp3TypesDtsSource();
|
|
1557
1277
|
|
|
1558
1278
|
await writeFile(dtoIndexPath, generatedDtoIndexSource);
|
|
1559
1279
|
await writeFile(businessIndexPath, generatedBusinessIndexSource);
|
|
1560
1280
|
await writeFile(uiIndexPath, generatedUiIndexSource);
|
|
1561
|
-
await writeFile(neherApp3TypesJsPath, generatedNeherApp3TypesJsSource);
|
|
1562
|
-
await writeFile(neherApp3TypesDtsPath, generatedNeherApp3TypesDtsSource);
|
|
1563
1281
|
|
|
1564
1282
|
sourceByFilePath.set(dtoIndexPath, generatedDtoIndexSource);
|
|
1565
1283
|
sourceByFilePath.set(businessIndexPath, generatedBusinessIndexSource);
|
|
1566
1284
|
sourceByFilePath.set(uiIndexPath, generatedUiIndexSource);
|
|
1567
|
-
sourceByFilePath.set(neherApp3TypesJsPath, generatedNeherApp3TypesJsSource);
|
|
1568
1285
|
|
|
1569
1286
|
const dtoRootBlock = buildRootAliasBlock(
|
|
1570
1287
|
dtoRootMarkerStart,
|
|
@@ -1597,7 +1314,5 @@ await writeFile(rootDtsPath, generatedRootDts);
|
|
|
1597
1314
|
console.log(`Updated ${toPosixRelativePath(dtoIndexPath)} with ${dtoAliases.length} generated DTO aliases.`);
|
|
1598
1315
|
console.log(`Updated ${toPosixRelativePath(businessIndexPath)} with ${businessAliases.length} generated business API exports.`);
|
|
1599
1316
|
console.log(`Updated ${toPosixRelativePath(uiIndexPath)} with ${uiLeafFiles.length} generated UI exports.`);
|
|
1600
|
-
console.log(`Updated ${toPosixRelativePath(neherApp3TypesJsPath)} generated NeherApp3 JSDoc type exports.`);
|
|
1601
|
-
console.log(`Updated ${toPosixRelativePath(neherApp3TypesDtsPath)} generated NeherApp3 declaration exports.`);
|
|
1602
1317
|
console.log(`Updated ${toPosixRelativePath(rootIndexPath)} generated JSDoc alias blocks.`);
|
|
1603
1318
|
console.log(`Wrote ${toPosixRelativePath(rootDtsPath)} with full package type exports.`);
|
package/api/neherApp3Types.d.ts
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
// Auto-generated NeherApp3 root type definitions.
|
|
2
|
-
// Do not modify manually - changes will be overwritten by scripts/generate-root-dto-typedefs.mjs
|
|
3
|
-
|
|
4
|
-
export type NeherApp3NotifyType = 0 | 1 | 2;
|
|
5
|
-
|
|
6
|
-
export type ArtikelstammEintrag = {
|
|
7
|
-
KatalogArtikelGuid?: string;
|
|
8
|
-
KatalogNummer?: string;
|
|
9
|
-
Katalognummer?: string;
|
|
10
|
-
Nummer?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type Variante = {
|
|
14
|
-
VarianteGuid?: string;
|
|
15
|
-
Name?: string;
|
|
16
|
-
Kuerzel?: string;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type Werteliste = {
|
|
20
|
-
WerteListeGuid?: string;
|
|
21
|
-
Name?: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type NeherApp3ArtikelstammCache = {
|
|
25
|
-
getArtikelStamm: () => Promise<ArtikelstammEintrag[]>;
|
|
26
|
-
getWarenGruppen: () => Promise<object[]>;
|
|
27
|
-
getArtikelByGuid: (guid: string) => Promise<ArtikelstammEintrag | undefined>;
|
|
28
|
-
getArtikelByKatalognummer: (nummer: string) => Promise<ArtikelstammEintrag | undefined>;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type NeherApp3ErfassungCache = {
|
|
32
|
-
getVarianten: () => Promise<Variante[]>;
|
|
33
|
-
getVariante: (variantenNameOderKuerzel: string) => Promise<Variante | undefined>;
|
|
34
|
-
getWertelisten: () => Promise<Werteliste[]>;
|
|
35
|
-
getWerteliste: (name: string) => Promise<Werteliste | undefined>;
|
|
36
|
-
getScripts: () => Promise<object[]>;
|
|
37
|
-
createUIMachine: (v: Variante) => void;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type NeherApp3Props = {
|
|
41
|
-
api: import("./fluentApi.js").FluentApi;
|
|
42
|
-
authManager?: import("./fluentAuthManager.js").FluentAuthManager;
|
|
43
|
-
idas: import("./idasFluentApi.js").IDASFluentApi;
|
|
44
|
-
mainCssPath?: string;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export type NeherApp3MenuItem = {
|
|
48
|
-
id?: string;
|
|
49
|
-
selected?: boolean;
|
|
50
|
-
icon?: string;
|
|
51
|
-
url?: string | null;
|
|
52
|
-
text: string;
|
|
53
|
-
parent?: string | null;
|
|
54
|
-
hidden?: boolean;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export type NeherApp3SetupContext = NeherApp3Props & { neherapp3: NeherApp3 };
|
|
58
|
-
|
|
59
|
-
export type NeherApp3Module = {
|
|
60
|
-
moduleName: string;
|
|
61
|
-
setup?: (context: NeherApp3SetupContext) => void | Promise<void>;
|
|
62
|
-
mount?: (node: HTMLElement, props: NeherApp3SetupContext) => void | Function;
|
|
63
|
-
embedUrl?: string;
|
|
64
|
-
extraCSS?: string[];
|
|
65
|
-
useShadowDom?: boolean;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export type NeherApp3ApiCollection = {
|
|
69
|
-
idas?: import("./idasFluentApi.js").IDASFluentApi;
|
|
70
|
-
hostingEnvironment?: import("./fluentApi.js").FluentApi;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export type NeherApp3CacheCollection = {
|
|
74
|
-
artikelstamm: NeherApp3ArtikelstammCache;
|
|
75
|
-
erfassung: NeherApp3ErfassungCache;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export type NeherApp3 = {
|
|
79
|
-
addMenuItem: (menuItem: NeherApp3MenuItem) => void;
|
|
80
|
-
addApp: (appModule: NeherApp3Module | string) => Promise<void>;
|
|
81
|
-
notify: (message: string, type?: NeherApp3NotifyType, cb?: Function) => void;
|
|
82
|
-
api: NeherApp3ApiCollection;
|
|
83
|
-
cache: NeherApp3CacheCollection;
|
|
84
|
-
};
|
|
85
|
-
|