@tstdl/base 0.92.160 → 0.92.161
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.
|
@@ -325,7 +325,7 @@ let AuthenticationService = class AuthenticationService {
|
|
|
325
325
|
async changeSecret(subject, currentSecret, newSecret) {
|
|
326
326
|
const authenticationResult = await this.authenticate(subject, currentSecret);
|
|
327
327
|
if (!authenticationResult.success) {
|
|
328
|
-
throw new
|
|
328
|
+
throw new InvalidCredentialsError();
|
|
329
329
|
}
|
|
330
330
|
await this.hooks.beforeChangeSecret.trigger({ subject });
|
|
331
331
|
await this.setCredentials(subject, newSecret);
|
|
@@ -8,65 +8,65 @@ export const germanTstdlErrorsLocalization = {
|
|
|
8
8
|
tstdl: {
|
|
9
9
|
errors: {
|
|
10
10
|
ApiError: {
|
|
11
|
-
header: '
|
|
12
|
-
message: 'Bitte versuchen Sie es
|
|
11
|
+
header: 'Ein Serverfehler ist aufgetreten',
|
|
12
|
+
message: 'Bitte versuchen Sie es in einem Moment erneut. Sollte das Problem weiterhin bestehen, kontaktieren Sie bitte den Support.',
|
|
13
13
|
},
|
|
14
14
|
BadRequestError: {
|
|
15
|
-
header: 'Ungültige
|
|
16
|
-
message:
|
|
15
|
+
header: 'Ungültige Eingabe',
|
|
16
|
+
message: 'Bitte überprüfen Sie die eingegebenen Daten und versuchen Sie es erneut.',
|
|
17
17
|
},
|
|
18
18
|
ForbiddenError: {
|
|
19
|
-
header: 'Zugriff
|
|
20
|
-
message:
|
|
19
|
+
header: 'Zugriff verweigert',
|
|
20
|
+
message: 'Sie haben nicht die erforderlichen Berechtigungen, um diese Aktion auszuführen.',
|
|
21
21
|
},
|
|
22
22
|
InvalidCredentialsError: {
|
|
23
23
|
header: 'Ungültige Zugangsdaten',
|
|
24
|
-
message: '
|
|
24
|
+
message: 'Der Benutzername oder das Passwort ist falsch. Bitte überprüfen Sie Ihre Eingaben.',
|
|
25
25
|
},
|
|
26
26
|
InvalidTokenError: {
|
|
27
|
-
header: '
|
|
28
|
-
message: 'Bitte melden Sie sich erneut an'
|
|
27
|
+
header: 'Sitzung abgelaufen',
|
|
28
|
+
message: 'Ihre Sitzung ist abgelaufen oder ungültig. Bitte melden Sie sich erneut an.',
|
|
29
29
|
},
|
|
30
30
|
MaxBytesExceededError: {
|
|
31
|
-
header: '
|
|
32
|
-
message:
|
|
31
|
+
header: 'Datei zu groß',
|
|
32
|
+
message: 'Die ausgewählte Datei überschreitet die maximal zulässige Größe.',
|
|
33
33
|
},
|
|
34
34
|
MethodNotAllowedError: {
|
|
35
|
-
header: '
|
|
36
|
-
message:
|
|
35
|
+
header: 'Unerwarteter Fehler',
|
|
36
|
+
message: 'Ein interner Fehler ist aufgetreten. Bitte versuchen Sie es später erneut.',
|
|
37
37
|
},
|
|
38
38
|
NotFoundError: {
|
|
39
39
|
header: 'Nicht gefunden',
|
|
40
|
-
message:
|
|
40
|
+
message: 'Das gesuchte Element konnte nicht gefunden werden. Möglicherweise wurde es verschoben oder gelöscht.',
|
|
41
41
|
},
|
|
42
42
|
NotImplementedError: {
|
|
43
|
-
header: 'Funktion nicht
|
|
44
|
-
message:
|
|
43
|
+
header: 'Funktion nicht verfügbar',
|
|
44
|
+
message: 'Diese Funktion ist noch nicht verfügbar. Bitte versuchen Sie es zu einem späteren Zeitpunkt erneut.',
|
|
45
45
|
},
|
|
46
46
|
NotSupportedError: {
|
|
47
|
-
header: '
|
|
48
|
-
message:
|
|
47
|
+
header: 'Aktion nicht unterstützt',
|
|
48
|
+
message: 'Die angeforderte Aktion wird nicht unterstützt.',
|
|
49
49
|
},
|
|
50
50
|
TimeoutError: {
|
|
51
|
-
header: 'Zeitüberschreitung',
|
|
52
|
-
message:
|
|
51
|
+
header: 'Zeitüberschreitung der Anfrage',
|
|
52
|
+
message: 'Der Server hat zu lange für eine Antwort gebraucht. Bitte überprüfen Sie Ihre Internetverbindung und versuchen Sie es erneut.',
|
|
53
53
|
},
|
|
54
54
|
UnauthorizedError: {
|
|
55
|
-
header: '
|
|
56
|
-
message:
|
|
55
|
+
header: 'Anmeldung erforderlich',
|
|
56
|
+
message: 'Sie müssen angemeldet sein, um diese Aktion auszuführen. Bitte melden Sie sich an.',
|
|
57
57
|
},
|
|
58
58
|
HttpError: {
|
|
59
59
|
header: (error) => ((isDefined(error.response) && error.response.statusCode != 0)
|
|
60
|
-
? `
|
|
61
|
-
: '
|
|
62
|
-
message: getHttpErrorMessage
|
|
60
|
+
? `Fehler ${error.response.statusCode.toString()}`
|
|
61
|
+
: 'Verbindungsfehler'),
|
|
62
|
+
message: getHttpErrorMessage,
|
|
63
63
|
},
|
|
64
64
|
SecretRequirementsError: {
|
|
65
|
-
header: '
|
|
66
|
-
message: getErrorMessage
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
65
|
+
header: 'Passwort zu schwach',
|
|
66
|
+
message: getErrorMessage,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
70
|
},
|
|
71
71
|
enums: [
|
|
72
72
|
enumerationLocalization(HttpErrorReason, {
|
|
@@ -77,9 +77,9 @@ export const germanTstdlErrorsLocalization = {
|
|
|
77
77
|
[HttpErrorReason.StatusCode]: 'Antwort enthielt einen Fehler',
|
|
78
78
|
[HttpErrorReason.ErrorResponse]: 'Antwort enthielt einen Fehler',
|
|
79
79
|
[HttpErrorReason.ResponseError]: 'Fehler beim Empfang der Antwort',
|
|
80
|
-
[HttpErrorReason.Timeout]: 'Zeitüberschreitung'
|
|
81
|
-
})
|
|
82
|
-
]
|
|
80
|
+
[HttpErrorReason.Timeout]: 'Zeitüberschreitung',
|
|
81
|
+
}),
|
|
82
|
+
],
|
|
83
83
|
};
|
|
84
84
|
export const englishTstdlErrorsLocalization = {
|
|
85
85
|
language: { code: 'en', name: 'English' },
|
|
@@ -87,65 +87,65 @@ export const englishTstdlErrorsLocalization = {
|
|
|
87
87
|
tstdl: {
|
|
88
88
|
errors: {
|
|
89
89
|
ApiError: {
|
|
90
|
-
header: '
|
|
91
|
-
message: 'Please try again
|
|
90
|
+
header: 'A Server Error Occurred',
|
|
91
|
+
message: 'Please try again in a moment. If the problem persists, please contact support.',
|
|
92
92
|
},
|
|
93
93
|
BadRequestError: {
|
|
94
|
-
header: '
|
|
95
|
-
message:
|
|
94
|
+
header: 'Invalid Information',
|
|
95
|
+
message: 'Please check the information you entered and try again.',
|
|
96
96
|
},
|
|
97
97
|
ForbiddenError: {
|
|
98
|
-
header: '
|
|
99
|
-
message:
|
|
98
|
+
header: 'Permission Denied',
|
|
99
|
+
message: 'You do not have the necessary permissions to perform this action.',
|
|
100
100
|
},
|
|
101
101
|
InvalidCredentialsError: {
|
|
102
|
-
header: 'Invalid
|
|
103
|
-
message: '
|
|
102
|
+
header: 'Invalid Credentials',
|
|
103
|
+
message: 'The username or password you entered is incorrect. Please check your details.',
|
|
104
104
|
},
|
|
105
105
|
InvalidTokenError: {
|
|
106
|
-
header: '
|
|
107
|
-
message: 'Please log in again'
|
|
106
|
+
header: 'Session Expired',
|
|
107
|
+
message: 'Your session has expired or is invalid. Please log in again.',
|
|
108
108
|
},
|
|
109
109
|
MaxBytesExceededError: {
|
|
110
|
-
header: '
|
|
111
|
-
message:
|
|
110
|
+
header: 'File Too Large',
|
|
111
|
+
message: 'The selected file exceeds the maximum allowed size.',
|
|
112
112
|
},
|
|
113
113
|
MethodNotAllowedError: {
|
|
114
|
-
header: '
|
|
115
|
-
message:
|
|
114
|
+
header: 'Unexpected Error',
|
|
115
|
+
message: 'An internal error occurred. Please try again later.',
|
|
116
116
|
},
|
|
117
117
|
NotFoundError: {
|
|
118
|
-
header: 'Not
|
|
119
|
-
message:
|
|
118
|
+
header: 'Not Found',
|
|
119
|
+
message: 'The item you are looking for could not be found. It may have been moved or deleted.',
|
|
120
120
|
},
|
|
121
121
|
NotImplementedError: {
|
|
122
|
-
header: '
|
|
123
|
-
message:
|
|
122
|
+
header: 'Feature Not Available',
|
|
123
|
+
message: 'This feature is not yet available. Please check back later.',
|
|
124
124
|
},
|
|
125
125
|
NotSupportedError: {
|
|
126
|
-
header: '
|
|
127
|
-
message:
|
|
126
|
+
header: 'Unsupported Action',
|
|
127
|
+
message: 'The requested action is not supported.',
|
|
128
128
|
},
|
|
129
129
|
TimeoutError: {
|
|
130
|
-
header: '
|
|
131
|
-
message:
|
|
130
|
+
header: 'Request Timed Out',
|
|
131
|
+
message: 'The server took too long to respond. Please check your internet connection and try again.',
|
|
132
132
|
},
|
|
133
133
|
UnauthorizedError: {
|
|
134
|
-
header: '
|
|
135
|
-
message:
|
|
134
|
+
header: 'Authentication Required',
|
|
135
|
+
message: 'You must be logged in to perform this action. Please log in.',
|
|
136
136
|
},
|
|
137
137
|
HttpError: {
|
|
138
138
|
header: (error) => ((isDefined(error.response) && error.response.statusCode != 0)
|
|
139
|
-
? `
|
|
140
|
-
: '
|
|
141
|
-
message: getHttpErrorMessage
|
|
139
|
+
? `Error ${error.response.statusCode.toString()}`
|
|
140
|
+
: 'Connection Error'),
|
|
141
|
+
message: getHttpErrorMessage,
|
|
142
142
|
},
|
|
143
143
|
SecretRequirementsError: {
|
|
144
|
-
header: '
|
|
145
|
-
message: getErrorMessage
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
144
|
+
header: 'Password Is Too Weak',
|
|
145
|
+
message: getErrorMessage,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
149
|
},
|
|
150
150
|
enums: [
|
|
151
151
|
enumerationLocalization(HttpErrorReason, {
|
|
@@ -156,14 +156,15 @@ export const englishTstdlErrorsLocalization = {
|
|
|
156
156
|
[HttpErrorReason.StatusCode]: 'Response contained an error',
|
|
157
157
|
[HttpErrorReason.ErrorResponse]: 'Response contained an error',
|
|
158
158
|
[HttpErrorReason.ResponseError]: 'Error while receiving the response',
|
|
159
|
-
[HttpErrorReason.Timeout]: '
|
|
160
|
-
})
|
|
161
|
-
]
|
|
159
|
+
[HttpErrorReason.Timeout]: 'Timeout',
|
|
160
|
+
}),
|
|
161
|
+
],
|
|
162
162
|
};
|
|
163
163
|
function getHttpErrorMessage(error, context) {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
if (isDefined(error.response) && isNotNull(error.response.statusMessage)) {
|
|
165
|
+
return error.response.statusMessage;
|
|
166
|
+
}
|
|
167
|
+
return context.localizationService.localizeOnce({ enum: HttpErrorReason, value: error.reason });
|
|
167
168
|
}
|
|
168
169
|
function getErrorMessage(error) {
|
|
169
170
|
return error.message.replace(/\.$/u, '');
|
|
@@ -145,7 +145,7 @@ function writeHeaders(response, httpResponse) {
|
|
|
145
145
|
}
|
|
146
146
|
async function writeResponseBody(response, httpResponse) {
|
|
147
147
|
const simpleData = match(response.body)
|
|
148
|
-
.with({ json: P.select(P.
|
|
148
|
+
.with({ json: P.select(P.when(isDefined)) }, (json) => JSON.stringify(json))
|
|
149
149
|
.with({ text: P.select(P.nonNullable) }, (text) => text)
|
|
150
150
|
.with({ buffer: P.select(P.nonNullable) }, (buffer) => buffer)
|
|
151
151
|
.otherwise(() => undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.92.
|
|
3
|
+
"version": "0.92.161",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -165,9 +165,9 @@
|
|
|
165
165
|
"mongodb": "^6.18",
|
|
166
166
|
"nodemailer": "^7.0",
|
|
167
167
|
"pg": "^8.16",
|
|
168
|
-
"playwright": "^1.
|
|
168
|
+
"playwright": "^1.55",
|
|
169
169
|
"preact": "^10.27",
|
|
170
|
-
"preact-render-to-string": "^6.
|
|
170
|
+
"preact-render-to-string": "^6.6",
|
|
171
171
|
"sharp": "^0.34",
|
|
172
172
|
"undici": "^7.14",
|
|
173
173
|
"urlpattern-polyfill": "^10.1"
|