@gandalan/weblibs 1.5.19 → 1.5.21
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 +46 -0
- package/README.md +42 -94
- package/api/IDAS.js +5 -3
- package/api/authUtils.js +2 -2
- package/api/business/anpassungApi.js +4 -4
- package/api/business/artikelApi.js +8 -8
- package/api/business/avApi.js +2 -2
- package/api/business/belegApi.js +1 -1
- package/api/business/farbeApi.js +5 -5
- package/api/business/fileApi.js +1 -1
- package/api/business/index.js +47 -49
- package/api/business/mandantApi.js +3 -3
- package/api/business/materialApi.js +4 -1
- package/api/business/settingsApi.js +3 -3
- package/api/business/systemApi.js +1 -1
- package/api/business/uiApi.js +3 -3
- package/api/dtos/belege.js +5 -9
- package/api/dtos/benutzer.js +1 -1
- package/api/dtos/druck.js +1 -2
- package/api/dtos/index.js +189 -458
- package/api/dtos/produktion.js +5 -65
- package/api/dtos/settings.js +1 -12
- package/api/dtos/ui.js +4 -8
- package/api/fluentApi.js +24 -10
- package/api/fluentAuthManager.js +7 -7
- package/api/fluentRestClient.js +10 -4
- package/api/idasFluentApi.js +3 -3
- package/index.d.ts +259 -0
- package/index.js +245 -29
- package/package.json +3 -2
- package/scripts/generate-root-dto-typedefs.mjs +489 -0
- package/ui/Grid.svelte.d.ts +3 -0
- package/ui/index.js +5 -2
package/JSDOC.md
CHANGED
|
@@ -243,6 +243,52 @@ Why:
|
|
|
243
243
|
- The JS language service resolves explicit file extensions more consistently.
|
|
244
244
|
|
|
245
245
|
|
|
246
|
+
## Rule 2a: Root DTO aliases must be generated, not hand-maintained
|
|
247
|
+
|
|
248
|
+
The package root cannot rely on:
|
|
249
|
+
|
|
250
|
+
```js
|
|
251
|
+
export * from "./api/dtos/index.js"
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
to make JSDoc typedef aliases available through:
|
|
255
|
+
|
|
256
|
+
```js
|
|
257
|
+
import("@gandalan/weblibs").VorgangDTO
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
Why:
|
|
261
|
+
|
|
262
|
+
- `export *` only forwards runtime exports.
|
|
263
|
+
- JSDoc `@typedef` aliases are not runtime exports.
|
|
264
|
+
- Root-level package imports therefore degrade to `any` unless the root module defines the aliases itself.
|
|
265
|
+
|
|
266
|
+
The required pattern is:
|
|
267
|
+
|
|
268
|
+
- keep `api/dtos/index.js` as the DTO alias source of truth
|
|
269
|
+
- generate matching root typedef aliases into `index.js`
|
|
270
|
+
- generate `index.d.ts` from the full package JSDoc source set for TypeScript consumers
|
|
271
|
+
|
|
272
|
+
Do not edit the generated root DTO block manually. Regenerate it with:
|
|
273
|
+
|
|
274
|
+
```bash
|
|
275
|
+
npm run generate:root-dto-typedefs
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
The generator has two separate responsibilities:
|
|
279
|
+
|
|
280
|
+
- `index.js`: generate the root DTO alias block for stable JSDoc imports from the package root
|
|
281
|
+
- `index.d.ts`: generate root type exports for all non-trivial JSDoc-defined package types discovered in `index.js`, `api/**/*.js`, and `ui/**/*.js`
|
|
282
|
+
|
|
283
|
+
For `index.d.ts`, simple local helper aliases like this are intentionally ignored:
|
|
284
|
+
|
|
285
|
+
```js
|
|
286
|
+
/** @typedef {import('../fluentApi.js').FluentApi} FluentApi */
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
because those are only local imports, not source type definitions. The declaration generator exports the canonical defining module instead.
|
|
290
|
+
|
|
291
|
+
|
|
246
292
|
## Rule 3: DTO files must import cross-file DTO dependencies locally
|
|
247
293
|
|
|
248
294
|
If a DTO property references a type from another DTO file, that dependency must be represented in the file itself.
|
package/README.md
CHANGED
|
@@ -3,122 +3,70 @@
|
|
|
3
3
|
## Deutsch
|
|
4
4
|
|
|
5
5
|
### Zweck
|
|
6
|
-
`@gandalan/weblibs` stellt
|
|
6
|
+
`@gandalan/weblibs` stellt Fluent-APIs fuer IDAS und lokale REST-Aufrufe sowie das passende Auth-Handling bereit.
|
|
7
|
+
|
|
8
|
+
- `fetchEnvConfig(...)` fuer Endpunktkonfiguration
|
|
9
|
+
- `fluentIdasAuthManager(...)` fuer Authentifizierung
|
|
10
|
+
- `idasFluentApi(...)` fuer IDAS-Business-APIs
|
|
11
|
+
- `fluentApi(...)` fuer eigene oder lokale REST-Endpunkte
|
|
7
12
|
|
|
8
13
|
### Referenz
|
|
9
14
|
- IDAS API (Swagger): https://api.dev.idas-cloudservices.net/swagger/
|
|
15
|
+
- JSDoc-Regeln und Typing-Konventionen: [JSDOC.md](./JSDOC.md)
|
|
10
16
|
|
|
11
17
|
### Voraussetzungen
|
|
12
|
-
- Browser-Umgebung
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- IDAS
|
|
16
|
-
- Falls die URL manuell gesetzt wird: mit abschließendem Slash (z. B. `https://api.dev.idas-cloudservices.net/api/`)
|
|
18
|
+
- Browser-Umgebung
|
|
19
|
+
- Gueltiger App-Token im UUID-Format
|
|
20
|
+
- Zugangsdaten/App-Token ueber dev-support@gandalan.de
|
|
21
|
+
- IDAS-Basis-URL vorzugsweise aus `fetchEnvConfig(...)`
|
|
17
22
|
|
|
18
23
|
### Installation
|
|
19
24
|
```bash
|
|
20
25
|
npm i @gandalan/weblibs
|
|
21
26
|
```
|
|
22
27
|
|
|
23
|
-
### Schnellstart
|
|
28
|
+
### Schnellstart
|
|
24
29
|
```js
|
|
25
|
-
import {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
import {
|
|
31
|
+
fetchEnvConfig,
|
|
32
|
+
fluentApi,
|
|
33
|
+
fluentIdasAuthManager,
|
|
34
|
+
idasFluentApi
|
|
35
|
+
} from "@gandalan/weblibs";
|
|
36
|
+
|
|
37
|
+
async function initializeApis() {
|
|
38
|
+
const appToken = "00000000-0000-0000-0000-000000000000";
|
|
39
|
+
const serviceName = "myService";
|
|
40
|
+
const envConfig = await fetchEnvConfig("dev");
|
|
31
41
|
|
|
32
42
|
let authManager;
|
|
33
|
-
try {
|
|
34
|
-
authManager = await fluentIdasAuthManager(appToken, envConfig.idas).init();
|
|
35
|
-
} catch {
|
|
36
|
-
// init() kann auf Login umleiten und dabei eine Exception werfen.
|
|
37
|
-
// In diesem Fall Seite verlassen / später erneut starten.
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const idas = fluentApi(envConfig.idas, authManager, serviceName);
|
|
42
|
-
const api = fluentApi('/api/', authManager, serviceName);
|
|
43
|
-
|
|
44
|
-
const mandanten = await idas.get('mandanten');
|
|
45
|
-
console.log(mandanten[0]?.Name);
|
|
46
|
-
|
|
47
|
-
const localResult = await api.get('some-endpoint');
|
|
48
|
-
console.log(localResult);
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Exportierte APIs (Kurzüberblick)
|
|
53
|
-
- `fetchEnvConfig(env)` lädt Endpunktkonfiguration (z. B. `dev`, `staging`, `produktiv`)
|
|
54
|
-
- `fluentIdasAuthManager(appToken, authBaseUrl)` erzeugt Auth-Manager
|
|
55
|
-
- `fluentApi(baseUrl, authManager, serviceName)` erzeugt API-Client mit `get/put/post/delete`
|
|
56
|
-
- `createAuthManager()`, `createApi()`, `restClient()` für manuelle Konfiguration
|
|
57
|
-
- Legacy zusätzlich vorhanden: `initIDAS`, `IDASFactory`, `RESTClient`
|
|
58
|
-
|
|
59
|
-
### Wichtige Hinweise
|
|
60
|
-
- `init()` gibt nicht immer nur `null` zurück, sondern kann beim Redirect eine Exception auslösen.
|
|
61
|
-
- Refresh-Token wird aus URL-Parameter `t` gelesen und in `localStorage` (`idas-refresh-token`) persistiert.
|
|
62
|
-
- Ohne gültigen Auth-Status werden Requests ggf. intern per `ensureAuthenticated()` nachgezogen.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## English
|
|
67
43
|
|
|
68
|
-
### Purpose
|
|
69
|
-
`@gandalan/weblibs` provides helpers for authentication and API communication with IDAS as well as local API calls.
|
|
70
|
-
|
|
71
|
-
### Reference
|
|
72
|
-
- IDAS API (Swagger): https://api.dev.idas-cloudservices.net/swagger/
|
|
73
|
-
|
|
74
|
-
### Requirements
|
|
75
|
-
- Browser environment (uses `window`, `localStorage`, URL redirects, and `fetch`)
|
|
76
|
-
- Valid app token in UUID format (issued by Gandalan on request)
|
|
77
|
-
- Contact for credentials/app token: dev-support@gandalan.de
|
|
78
|
-
- Prefer the IDAS/auth base URL from `fetchEnvConfig(...)` (for example `envConfig.idas`)
|
|
79
|
-
- If the URL is set manually, use a trailing slash (for example `https://api.dev.idas-cloudservices.net/api/`)
|
|
80
|
-
|
|
81
|
-
### Installation
|
|
82
|
-
```bash
|
|
83
|
-
npm i @gandalan/weblibs
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Quick start (Fluent API + auth)
|
|
87
|
-
```js
|
|
88
|
-
import { fetchEnvConfig, fluentApi, fluentIdasAuthManager } from '@gandalan/weblibs';
|
|
89
|
-
|
|
90
|
-
async function initializeAuthAndApi() {
|
|
91
|
-
const serviceName = 'myService';
|
|
92
|
-
const appToken = '00000000-0000-0000-0000-000000000000'; // UUID
|
|
93
|
-
const envConfig = await fetchEnvConfig('dev'); // envConfig.idas is provided by fetchEnvConfig(...)
|
|
94
|
-
|
|
95
|
-
let authManager;
|
|
96
44
|
try {
|
|
97
45
|
authManager = await fluentIdasAuthManager(appToken, envConfig.idas).init();
|
|
98
46
|
} catch {
|
|
99
|
-
|
|
100
|
-
return;
|
|
47
|
+
return null;
|
|
101
48
|
}
|
|
102
49
|
|
|
103
|
-
const idas =
|
|
104
|
-
const api = fluentApi(
|
|
105
|
-
|
|
106
|
-
const mandanten = await idas.get('mandanten');
|
|
107
|
-
console.log(mandanten[0]?.Name);
|
|
50
|
+
const idas = idasFluentApi(envConfig.idas, authManager, serviceName);
|
|
51
|
+
const api = fluentApi("/api/", authManager, serviceName);
|
|
108
52
|
|
|
109
|
-
|
|
110
|
-
console.log(localResult);
|
|
53
|
+
return { idas, api, authManager };
|
|
111
54
|
}
|
|
112
55
|
```
|
|
113
56
|
|
|
114
|
-
###
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
- `createAuthManager()`, `createApi()`, `restClient()` for manual composition
|
|
119
|
-
- Legacy exports still available: `initIDAS`, `IDASFactory`, `RESTClient`
|
|
57
|
+
### `init()`
|
|
58
|
+
- Liest Refresh-Token zuerst aus der URL, danach aus `localStorage`
|
|
59
|
+
- Versucht bei vorhandenem Refresh-Token ein JWT zu erneuern
|
|
60
|
+
- Kann bei fehlender gueltiger Session auf Login umleiten und dabei werfen
|
|
120
61
|
|
|
121
|
-
###
|
|
122
|
-
- `
|
|
123
|
-
-
|
|
124
|
-
-
|
|
62
|
+
### Wichtige Exporte
|
|
63
|
+
- `fetchEnvConfig(env)`
|
|
64
|
+
- `fluentIdasAuthManager(appToken, authBaseUrl)`
|
|
65
|
+
- `fluentApi(baseUrl, authManager, serviceName)`
|
|
66
|
+
- `idasFluentApi(baseUrl, authManager, serviceName)`
|
|
67
|
+
|
|
68
|
+
### Wichtige Hinweise
|
|
69
|
+
- `idasFluentApi(...)` fuer IDAS-Business-Routinen verwenden
|
|
70
|
+
- `fluentApi(...)` fuer generische REST-Endpunkte verwenden
|
|
71
|
+
- `authManager.userInfo` und `idas.userInfo` enthalten dekodierte JWT-Claims
|
|
72
|
+
- Fuer JSDoc- und DTO-Typing-Regeln siehe [JSDOC.md](./JSDOC.md)
|
package/api/IDAS.js
CHANGED
|
@@ -2,6 +2,8 @@ import { isInvalid, currentToken} from "./authUtils";
|
|
|
2
2
|
import { RESTClient } from "./RESTClient";
|
|
3
3
|
import { jwtDecode } from "jwt-decode";
|
|
4
4
|
|
|
5
|
+
/** @typedef {import("jwt-decode").JwtPayload & import("./fluentAuthManager.js").JwtUserInfo & { id?: string }} DecodedToken */
|
|
6
|
+
|
|
5
7
|
export function IDASFactory(settings)
|
|
6
8
|
{
|
|
7
9
|
if (!isInvalid(settings))
|
|
@@ -37,7 +39,7 @@ class IDAS
|
|
|
37
39
|
return [];
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
const decoded = jwtDecode(currentToken);
|
|
42
|
+
const decoded = /** @type {DecodedToken} */ (jwtDecode(currentToken));
|
|
41
43
|
if (!decoded.rights)
|
|
42
44
|
{
|
|
43
45
|
return [];
|
|
@@ -52,7 +54,7 @@ class IDAS
|
|
|
52
54
|
return [];
|
|
53
55
|
}
|
|
54
56
|
|
|
55
|
-
const decoded = jwtDecode(currentToken);
|
|
57
|
+
const decoded = /** @type {DecodedToken} */ (jwtDecode(currentToken));
|
|
56
58
|
if (!decoded.role)
|
|
57
59
|
{
|
|
58
60
|
return [];
|
|
@@ -75,7 +77,7 @@ class IDAS
|
|
|
75
77
|
return undefined;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
const decoded = jwtDecode(currentToken);
|
|
80
|
+
const decoded = /** @type {DecodedToken} */ (jwtDecode(currentToken));
|
|
79
81
|
return decoded.id;
|
|
80
82
|
},
|
|
81
83
|
};
|
package/api/authUtils.js
CHANGED
|
@@ -29,7 +29,7 @@ export let currentRefreshToken = undefined;
|
|
|
29
29
|
* @export
|
|
30
30
|
* @async
|
|
31
31
|
* @param {string} appToken, UUID v4 format
|
|
32
|
-
* @returns {Settings} settings object
|
|
32
|
+
* @returns {Promise<Settings|null>} settings object
|
|
33
33
|
*/
|
|
34
34
|
export async function initIDAS(appToken)
|
|
35
35
|
{
|
|
@@ -247,5 +247,5 @@ export function redirectToLogin(settings, authPath)
|
|
|
247
247
|
url.search = `?a=${settings.appToken}&r=${encodeURIComponent(authUrlCallback)}`;
|
|
248
248
|
let jwtUrl = url.toString();
|
|
249
249
|
|
|
250
|
-
window.location = jwtUrl;
|
|
250
|
+
window.location.href = jwtUrl;
|
|
251
251
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../fluentApi.js').FluentApi} FluentApi
|
|
3
|
-
* @typedef {
|
|
4
|
-
* @typedef {
|
|
3
|
+
* @typedef {Object & { AnpassungGuid?: string, anpassungGuid?: string }} AnpassungDTO
|
|
4
|
+
* @typedef {Object & { AnpassungVorlageGuid?: string, anpassungVorlageGuid?: string }} AnpassungVorlageDTO
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -22,7 +22,7 @@ export function createAnpassungApi(fluentApi) {
|
|
|
22
22
|
* @param {AnpassungDTO} dto
|
|
23
23
|
* @returns {Promise<void>}
|
|
24
24
|
*/
|
|
25
|
-
save: (dto) => fluentApi.put(`Anpassungen/${dto.anpassungGuid}`, dto),
|
|
25
|
+
save: (dto) => fluentApi.put(`Anpassungen/${dto.AnpassungGuid ?? dto.anpassungGuid ?? ""}`, dto),
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* Delete adjustment
|
|
@@ -57,7 +57,7 @@ export function createAnpassungApi(fluentApi) {
|
|
|
57
57
|
* @param {AnpassungVorlageDTO} dto
|
|
58
58
|
* @returns {Promise<void>}
|
|
59
59
|
*/
|
|
60
|
-
save: (dto) => fluentApi.put(`AnpassungVorlagen/${dto.anpassungVorlageGuid}`, dto),
|
|
60
|
+
save: (dto) => fluentApi.put(`AnpassungVorlagen/${dto.AnpassungVorlageGuid ?? dto.anpassungVorlageGuid ?? ""}`, dto),
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* Delete adjustment template
|
|
@@ -36,14 +36,14 @@ export function createArtikelApi(fluentApi) {
|
|
|
36
36
|
* @param {KatalogArtikelDTO} artikel
|
|
37
37
|
* @returns {Promise<KatalogArtikelDTO>}
|
|
38
38
|
*/
|
|
39
|
-
|
|
39
|
+
saveArtikel: (artikel) => fluentApi.put(`Artikel/${artikel.KatalogArtikelGuid}`, artikel),
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* Delete article
|
|
43
43
|
* @param {KatalogArtikelDTO} artikel
|
|
44
44
|
* @returns {Promise<void>}
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
deleteArtikel: (artikel) => fluentApi.delete(`Artikel/${artikel.KatalogArtikelGuid}`),
|
|
47
47
|
|
|
48
48
|
// ArtikelIndiDatenWebRoutinen
|
|
49
49
|
/**
|
|
@@ -63,14 +63,14 @@ export function createArtikelApi(fluentApi) {
|
|
|
63
63
|
* @param {KatalogArtikelIndiDatenDTO} daten
|
|
64
64
|
* @returns {Promise<void>}
|
|
65
65
|
*/
|
|
66
|
-
|
|
66
|
+
saveArtikelIndiDaten: (daten) => fluentApi.put(`ArtikelIndiDaten/${daten.KatalogArtikelGuid}`, daten),
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Delete article individual data
|
|
70
70
|
* @param {KatalogArtikelIndiDatenDTO} daten
|
|
71
71
|
* @returns {Promise<void>}
|
|
72
72
|
*/
|
|
73
|
-
|
|
73
|
+
deleteArtikelIndiDaten: (daten) => fluentApi.delete(`ArtikelIndiDaten/${daten.KatalogArtikelGuid}`),
|
|
74
74
|
|
|
75
75
|
// WarenGruppeWebRoutinen
|
|
76
76
|
/**
|
|
@@ -84,7 +84,7 @@ export function createArtikelApi(fluentApi) {
|
|
|
84
84
|
* @param {WarenGruppeDTO} dto
|
|
85
85
|
* @returns {Promise<void>}
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
saveWarenGruppe: (dto) => fluentApi.put(`WarenGruppe/${dto.WarenGruppeGuid}`, dto),
|
|
88
88
|
|
|
89
89
|
// ProduktGruppenWebRoutinen
|
|
90
90
|
/**
|
|
@@ -101,7 +101,7 @@ export function createArtikelApi(fluentApi) {
|
|
|
101
101
|
* @returns {Promise<ProduktGruppeDTO>}
|
|
102
102
|
*/
|
|
103
103
|
saveProduktGruppe: (produktGruppe) =>
|
|
104
|
-
fluentApi.put(`ProduktGruppe/${produktGruppe.
|
|
104
|
+
fluentApi.put(`ProduktGruppe/${produktGruppe.ProduktGruppeGuid}`, produktGruppe),
|
|
105
105
|
|
|
106
106
|
// ProduktFamilienWebRoutinen
|
|
107
107
|
/**
|
|
@@ -118,7 +118,7 @@ export function createArtikelApi(fluentApi) {
|
|
|
118
118
|
* @returns {Promise<ProduktFamilieDTO>}
|
|
119
119
|
*/
|
|
120
120
|
saveProduktFamilie: (produktFamilie) =>
|
|
121
|
-
fluentApi.put(`ProduktFamilie/${produktFamilie.
|
|
121
|
+
fluentApi.put(`ProduktFamilie/${produktFamilie.ProduktFamilieGuid}`, produktFamilie),
|
|
122
122
|
|
|
123
123
|
// KomponentenWebRoutinen
|
|
124
124
|
/**
|
|
@@ -174,7 +174,7 @@ export function createArtikelApi(fluentApi) {
|
|
|
174
174
|
* @param {VarianteDTO} variante
|
|
175
175
|
* @returns {Promise<VarianteDTO>}
|
|
176
176
|
*/
|
|
177
|
-
|
|
177
|
+
saveVariante: (variante) => fluentApi.put(`Variante/${variante.VarianteGuid}`, variante),
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* Trigger variant cache web job
|
package/api/business/avApi.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* @typedef {import('../dtos/produktion.js').ProduktionsDatenDTO} ProduktionsDatenDTO
|
|
7
7
|
* @typedef {import('../dtos/index.js').AVReserviertItemDTO} AVReserviertItemDTO
|
|
8
8
|
* @typedef {import('../dtos/belege.js').CalculationInfoDTO} CalculationInfoDTO
|
|
9
|
-
* @typedef {
|
|
10
|
-
* @typedef {
|
|
9
|
+
* @typedef {Object} AvReportVorgangRequestDto
|
|
10
|
+
* @typedef {Object} AvReportVorgangDto
|
|
11
11
|
* @typedef {import('../dtos/produktion.js').SaegeDatenHistorieDTO} SaegeDatenHistorieDTO
|
|
12
12
|
* @typedef {import('../dtos/produktion.js').SaegeDatenResultDTO} SaegeDatenResultDTO
|
|
13
13
|
* @typedef {import('../dtos/index.js').MaterialBearbeitungsMethodeDTO} MaterialBearbeitungsMethodeDTO
|
package/api/business/belegApi.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @typedef {import('../dtos/belege.js').VorgangHistorienDTO} VorgangHistorienDTO
|
|
11
11
|
* @typedef {import('../dtos/belege.js').BelegHistorienDTO} BelegHistorienDTO
|
|
12
12
|
* @typedef {import('../dtos/belege.js').BelegPositionHistorienDTO} BelegPositionHistorienDTO
|
|
13
|
-
* @typedef {import('../dtos/
|
|
13
|
+
* @typedef {import('../dtos/av.js').SerieHistorieDTO} SerieHistorieDTO
|
|
14
14
|
* @typedef {import('../dtos/belege.js').VorgangHistorieDTO} VorgangHistorieDTO
|
|
15
15
|
* @typedef {import('../dtos/belege.js').BelegHistorieDTO} BelegHistorieDTO
|
|
16
16
|
* @typedef {import('../dtos/belege.js').BelegPositionHistorieDTO} BelegPositionHistorieDTO
|
package/api/business/farbeApi.js
CHANGED
|
@@ -27,7 +27,7 @@ export function createFarbeApi(fluentApi) {
|
|
|
27
27
|
* @param {FarbeDTO} dto
|
|
28
28
|
* @returns {Promise<void>}
|
|
29
29
|
*/
|
|
30
|
-
saveFarbe: (dto) => fluentApi.put(`Farben/${dto.
|
|
30
|
+
saveFarbe: (dto) => fluentApi.put(`Farben/${dto.FarbItemGuid}`, dto),
|
|
31
31
|
|
|
32
32
|
// OberflaechenWebRoutinen
|
|
33
33
|
/**
|
|
@@ -41,7 +41,7 @@ export function createFarbeApi(fluentApi) {
|
|
|
41
41
|
* @param {OberflaecheDTO} dto
|
|
42
42
|
* @returns {Promise<void>}
|
|
43
43
|
*/
|
|
44
|
-
saveOberflaeche: (dto) => fluentApi.put(`Oberflaeche/${dto.
|
|
44
|
+
saveOberflaeche: (dto) => fluentApi.put(`Oberflaeche/${dto.OberflaecheGuid}`, dto),
|
|
45
45
|
|
|
46
46
|
// FarbGruppenWebRoutinen
|
|
47
47
|
/**
|
|
@@ -55,7 +55,7 @@ export function createFarbeApi(fluentApi) {
|
|
|
55
55
|
* @param {FarbGruppeDTO} dto
|
|
56
56
|
* @returns {Promise<void>}
|
|
57
57
|
*/
|
|
58
|
-
saveFarbGruppe: (dto) => fluentApi.put(`FarbGruppen/${dto.
|
|
58
|
+
saveFarbGruppe: (dto) => fluentApi.put(`FarbGruppen/${dto.FarbItemGroupGuid}`, dto),
|
|
59
59
|
|
|
60
60
|
// FarbKuerzelWebRoutinen
|
|
61
61
|
/**
|
|
@@ -69,7 +69,7 @@ export function createFarbeApi(fluentApi) {
|
|
|
69
69
|
* @param {FarbKuerzelDTO} dto
|
|
70
70
|
* @returns {Promise<void>}
|
|
71
71
|
*/
|
|
72
|
-
saveFarbKuerzel: (dto) => fluentApi.put(`FarbKuerzel/${dto.
|
|
72
|
+
saveFarbKuerzel: (dto) => fluentApi.put(`FarbKuerzel/${dto.FarbKuerzelGuid}`, dto),
|
|
73
73
|
|
|
74
74
|
// FarbKuerzelGruppenWebRoutinen
|
|
75
75
|
/**
|
|
@@ -112,7 +112,7 @@ export function createFarbeApi(fluentApi) {
|
|
|
112
112
|
* @returns {Promise<void>}
|
|
113
113
|
*/
|
|
114
114
|
saveProduzentenFarbGruppe: (dto) =>
|
|
115
|
-
fluentApi.put(`ProduzentenFarbGruppen/${dto.
|
|
115
|
+
fluentApi.put(`ProduzentenFarbGruppen/${dto.ProduzentenFarbGruppeGuid}`, dto),
|
|
116
116
|
|
|
117
117
|
/**
|
|
118
118
|
* Delete producer color group
|
package/api/business/fileApi.js
CHANGED
package/api/business/index.js
CHANGED
|
@@ -1,63 +1,61 @@
|
|
|
1
1
|
// Business Routines API Exports
|
|
2
|
-
// Auto-generated from
|
|
2
|
+
// Auto-generated from ./api/business leaf files
|
|
3
|
+
// Do not modify manually - changes will be overwritten
|
|
3
4
|
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export { createBelegPositionenApi } from "./belegPositionenApi.js";
|
|
7
|
-
export { createMaterialApi } from "./materialApi.js";
|
|
8
|
-
export { createSerienApi } from "./serienApi.js";
|
|
9
|
-
export { createBenutzerApi } from "./benutzerApi.js";
|
|
5
|
+
export { createAblageApi } from "./ablageApi.js";
|
|
6
|
+
export { createAnpassungApi } from "./anpassungApi.js";
|
|
10
7
|
export { createArtikelApi } from "./artikelApi.js";
|
|
8
|
+
export { createAuthApi } from "./authApi.js";
|
|
9
|
+
export { createAvApi } from "./avApi.js";
|
|
11
10
|
export { createBelegApi } from "./belegApi.js";
|
|
12
|
-
export {
|
|
11
|
+
export { createBelegPositionenApi } from "./belegPositionenApi.js";
|
|
12
|
+
export { createBenutzerApi } from "./benutzerApi.js";
|
|
13
13
|
export { createFakturaApi } from "./fakturaApi.js";
|
|
14
|
-
export { createSettingsApi } from "./settingsApi.js";
|
|
15
|
-
export { createUiApi } from "./uiApi.js";
|
|
16
|
-
export { createUtilityApi } from "./utilityApi.js";
|
|
17
|
-
|
|
18
|
-
// New API exports
|
|
19
|
-
export { createAblageApi } from "./ablageApi.js";
|
|
20
|
-
export { createAvApi } from "./avApi.js";
|
|
21
14
|
export { createFarbeApi } from "./farbeApi.js";
|
|
15
|
+
export { createFileApi } from "./fileApi.js";
|
|
16
|
+
export { createHistorieApi } from "./historieApi.js";
|
|
17
|
+
export { createKontaktApi } from "./kontaktApi.js";
|
|
22
18
|
export { createLagerApi } from "./lagerApi.js";
|
|
23
19
|
export { createLieferungApi } from "./lieferungApi.js";
|
|
20
|
+
export { createMailApi } from "./mailApi.js";
|
|
24
21
|
export { createMandantApi } from "./mandantApi.js";
|
|
22
|
+
export { createMaterialApi } from "./materialApi.js";
|
|
25
23
|
export { createPrintApi } from "./printApi.js";
|
|
26
|
-
export {
|
|
27
|
-
export { createSystemApi } from "./systemApi.js";
|
|
28
|
-
export { createFileApi } from "./fileApi.js";
|
|
29
|
-
export { createMailApi } from "./mailApi.js";
|
|
30
|
-
export { createAnpassungApi } from "./anpassungApi.js";
|
|
31
|
-
export { createAuthApi } from "./authApi.js";
|
|
24
|
+
export { createProduktionApi } from "./produktionApi.js";
|
|
32
25
|
export { createRechnungApi } from "./rechnungApi.js";
|
|
26
|
+
export { createSerienApi } from "./serienApi.js";
|
|
27
|
+
export { createSettingsApi } from "./settingsApi.js";
|
|
28
|
+
export { createSystemApi } from "./systemApi.js";
|
|
29
|
+
export { createUiApi } from "./uiApi.js";
|
|
30
|
+
export { createUtilityApi } from "./utilityApi.js";
|
|
31
|
+
export { createVorgangApi } from "./vorgangApi.js";
|
|
33
32
|
|
|
34
33
|
// Type exports for JSDoc
|
|
35
|
-
/** @typedef {import(
|
|
36
|
-
/** @typedef {import(
|
|
37
|
-
/** @typedef {import(
|
|
38
|
-
/** @typedef {import(
|
|
39
|
-
/** @typedef {import(
|
|
40
|
-
/** @typedef {import(
|
|
41
|
-
/** @typedef {import(
|
|
42
|
-
/** @typedef {import(
|
|
43
|
-
/** @typedef {import(
|
|
44
|
-
/** @typedef {import(
|
|
45
|
-
/** @typedef {import(
|
|
46
|
-
/** @typedef {import(
|
|
47
|
-
/** @typedef {import(
|
|
48
|
-
/** @typedef {import(
|
|
49
|
-
/** @typedef {import(
|
|
50
|
-
/** @typedef {import(
|
|
51
|
-
/** @typedef {import(
|
|
52
|
-
/** @typedef {import(
|
|
53
|
-
/** @typedef {import(
|
|
54
|
-
/** @typedef {import(
|
|
55
|
-
/** @typedef {import(
|
|
56
|
-
/** @typedef {import(
|
|
57
|
-
/** @typedef {import(
|
|
58
|
-
/** @typedef {import(
|
|
59
|
-
/** @typedef {import(
|
|
60
|
-
/** @typedef {import(
|
|
61
|
-
/** @typedef {import(
|
|
34
|
+
/** @typedef {import("./ablageApi.js").AblageApi} AblageApi */
|
|
35
|
+
/** @typedef {import("./anpassungApi.js").AnpassungApi} AnpassungApi */
|
|
36
|
+
/** @typedef {import("./artikelApi.js").ArtikelApi} ArtikelApi */
|
|
37
|
+
/** @typedef {import("./authApi.js").AuthApi} AuthApi */
|
|
38
|
+
/** @typedef {import("./avApi.js").AvApi} AvApi */
|
|
39
|
+
/** @typedef {import("./belegApi.js").BelegApi} BelegApi */
|
|
40
|
+
/** @typedef {import("./belegPositionenApi.js").BelegPositionenApi} BelegPositionenApi */
|
|
41
|
+
/** @typedef {import("./benutzerApi.js").BenutzerApi} BenutzerApi */
|
|
42
|
+
/** @typedef {import("./fakturaApi.js").FakturaApi} FakturaApi */
|
|
43
|
+
/** @typedef {import("./farbeApi.js").FarbeApi} FarbeApi */
|
|
44
|
+
/** @typedef {import("./fileApi.js").FileApi} FileApi */
|
|
45
|
+
/** @typedef {import("./historieApi.js").HistorieApi} HistorieApi */
|
|
46
|
+
/** @typedef {import("./kontaktApi.js").KontaktApi} KontaktApi */
|
|
47
|
+
/** @typedef {import("./lagerApi.js").LagerApi} LagerApi */
|
|
48
|
+
/** @typedef {import("./lieferungApi.js").LieferungApi} LieferungApi */
|
|
49
|
+
/** @typedef {import("./mailApi.js").MailApi} MailApi */
|
|
50
|
+
/** @typedef {import("./mandantApi.js").MandantApi} MandantApi */
|
|
51
|
+
/** @typedef {import("./materialApi.js").MaterialApi} MaterialApi */
|
|
52
|
+
/** @typedef {import("./printApi.js").PrintApi} PrintApi */
|
|
53
|
+
/** @typedef {import("./produktionApi.js").ProduktionApi} ProduktionApi */
|
|
54
|
+
/** @typedef {import("./rechnungApi.js").RechnungApi} RechnungApi */
|
|
55
|
+
/** @typedef {import("./serienApi.js").SerienApi} SerienApi */
|
|
56
|
+
/** @typedef {import("./settingsApi.js").SettingsApi} SettingsApi */
|
|
57
|
+
/** @typedef {import("./systemApi.js").SystemApi} SystemApi */
|
|
58
|
+
/** @typedef {import("./uiApi.js").UiApi} UiApi */
|
|
59
|
+
/** @typedef {import("./utilityApi.js").UtilityApi} UtilityApi */
|
|
60
|
+
/** @typedef {import("./vorgangApi.js").VorgangApi} VorgangApi */
|
|
62
61
|
|
|
63
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../fluentApi.js').FluentApi} FluentApi
|
|
3
|
-
* @typedef {import('../dtos/
|
|
3
|
+
* @typedef {import('../dtos/mandanten.js').MandantDTO} MandantDTO
|
|
4
4
|
* @typedef {import('../dtos/index.js').BenutzerDTO} BenutzerDTO
|
|
5
5
|
* @typedef {import('../dtos/index.js').AppActivationStatusDTO} AppActivationStatusDTO
|
|
6
6
|
*/
|
|
@@ -15,7 +15,7 @@ export function createMandantApi(fluentApi) {
|
|
|
15
15
|
/**
|
|
16
16
|
* Sync mandanten list
|
|
17
17
|
* @param {MandantDTO[]} list
|
|
18
|
-
* @returns {Promise<
|
|
18
|
+
* @returns {Promise<MandantDTO[]>}
|
|
19
19
|
*/
|
|
20
20
|
abgleichen: (list) =>
|
|
21
21
|
Promise.all(list.map(m => fluentApi.put("Mandanten", m))),
|
|
@@ -119,7 +119,7 @@ export function createMandantApi(fluentApi) {
|
|
|
119
119
|
* @returns {Promise<void>}
|
|
120
120
|
*/
|
|
121
121
|
deleteBenutzer: (kundeGuid, data) =>
|
|
122
|
-
fluentApi.delete(`AppBenutzer/?kundeGuid=${kundeGuid}&benutzerGuid=${data.
|
|
122
|
+
fluentApi.delete(`AppBenutzer/?kundeGuid=${kundeGuid}&benutzerGuid=${data.BenutzerGuid}`),
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Activate mandant
|
|
@@ -23,7 +23,10 @@
|
|
|
23
23
|
* @returns {MaterialApi}
|
|
24
24
|
*/
|
|
25
25
|
export function createMaterialApi(fluentApi) {
|
|
26
|
-
const api =
|
|
26
|
+
const api = {
|
|
27
|
+
get: (url) => fluentApi.get(`ModellDaten/${url}`),
|
|
28
|
+
put: (url, payload) => fluentApi.put(`ModellDaten/${url}`, payload)
|
|
29
|
+
};
|
|
27
30
|
|
|
28
31
|
return {
|
|
29
32
|
async getAll() {
|
|
@@ -81,7 +81,7 @@ export function createSettingsApi(fluentApi) {
|
|
|
81
81
|
* @param {WerteListeDTO} dto
|
|
82
82
|
* @returns {Promise<void>}
|
|
83
83
|
*/
|
|
84
|
-
|
|
84
|
+
saveWerteliste: (dto) => fluentApi.put(`WerteListe/${dto.WerteListeGuid}`, dto),
|
|
85
85
|
|
|
86
86
|
// ContractWebRoutinen
|
|
87
87
|
/**
|
|
@@ -102,7 +102,7 @@ export function createSettingsApi(fluentApi) {
|
|
|
102
102
|
* @param {ContractDTO} dto
|
|
103
103
|
* @returns {Promise<void>}
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
deleteContract: (dto) => fluentApi.delete(`Contracts/${dto.ContractGuid}`, dto),
|
|
106
106
|
|
|
107
107
|
// TemplateWebRoutinen
|
|
108
108
|
/**
|
|
@@ -123,7 +123,7 @@ export function createSettingsApi(fluentApi) {
|
|
|
123
123
|
* @param {TemplateDTO} dto
|
|
124
124
|
* @returns {Promise<void>}
|
|
125
125
|
*/
|
|
126
|
-
|
|
126
|
+
saveTemplate: (dto) => fluentApi.put(`Template/${dto.TemplateGuid}`, dto),
|
|
127
127
|
|
|
128
128
|
/**
|
|
129
129
|
* Delete template
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @typedef {import('../dtos/index.js').ChangeDTO} ChangeDTO
|
|
4
4
|
* @typedef {import('../dtos/index.js').TagInfoDTO} TagInfoDTO
|
|
5
5
|
* @typedef {import('../dtos/index.js').TagVorlageDTO} TagVorlageDTO
|
|
6
|
-
* @typedef {
|
|
6
|
+
* @typedef {Object} FilterItemDTO
|
|
7
7
|
* @typedef {import('../dtos/index.js').ChangeInfoDTO} ChangeInfoDTO
|
|
8
8
|
* @typedef {import('../dtos/index.js').UpdateInfoDTO} UpdateInfoDTO
|
|
9
9
|
*/
|