@tstdl/base 0.91.19 → 0.91.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/errors/errors.localization.d.ts +6 -5
- package/errors/errors.localization.js +121 -117
- package/package.json +2 -1
- package/text/common-localization.d.ts +39 -0
- package/text/common-localization.js +48 -0
- package/text/index.d.ts +1 -0
- package/text/index.js +1 -0
- package/utils/date-time.d.ts +1 -2
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SecretRequirementsError } from '../authentication/index.js';
|
|
2
|
-
import type
|
|
3
|
-
import {
|
|
4
|
-
import type { Localization, LocalizeItem } from '../text/localization.service.js';
|
|
2
|
+
import { type HttpError, HttpErrorReason } from '../http/http.error.js';
|
|
3
|
+
import { type Localization, type LocalizeItem } from '../text/localization.service.js';
|
|
5
4
|
import type { Enumeration } from '../types.js';
|
|
6
5
|
import type { ApiError } from './api.error.js';
|
|
7
6
|
import type { BadRequestError } from './bad-request.error.js';
|
|
@@ -26,7 +25,9 @@ export type ErrorsLocalizationEntries<T extends CustomErrorStatic[]> = {
|
|
|
26
25
|
}>>>;
|
|
27
26
|
};
|
|
28
27
|
export type ErrorsLocalization<T extends CustomErrorStatic[] = CustomErrorStatic[], Enums extends Enumeration[] = Enumeration[]> = Localization<{
|
|
29
|
-
|
|
28
|
+
tstdl: {
|
|
29
|
+
errors: ErrorsLocalizationEntries<T>;
|
|
30
|
+
};
|
|
30
31
|
}, Enums>;
|
|
31
32
|
type TstdlErrors = [
|
|
32
33
|
typeof ApiError,
|
|
@@ -44,7 +45,7 @@ type TstdlErrors = [
|
|
|
44
45
|
typeof HttpError,
|
|
45
46
|
typeof SecretRequirementsError
|
|
46
47
|
];
|
|
47
|
-
export declare const
|
|
48
|
+
export declare const tstdlErrorsLocalizationKeys: import("../text/localization.service.js").ProxyLocalizationKeys<{
|
|
48
49
|
errors: ErrorsLocalizationEntries<CustomErrorStatic<CustomError>[]>;
|
|
49
50
|
}>;
|
|
50
51
|
export declare const germanTstdlErrorsLocalization: ErrorsLocalization<TstdlErrors, [typeof HttpErrorReason]>;
|
|
@@ -1,68 +1,70 @@
|
|
|
1
1
|
import { HttpErrorReason } from '../http/http.error.js';
|
|
2
2
|
import { enumerationLocalization, getLocalizationKeys } from '../text/localization.service.js';
|
|
3
3
|
import { isDefined, isNotNull } from '../utils/type-guards.js';
|
|
4
|
-
export const
|
|
4
|
+
export const tstdlErrorsLocalizationKeys = getLocalizationKeys().tstdl;
|
|
5
5
|
export const germanTstdlErrorsLocalization = {
|
|
6
6
|
language: { code: 'de', name: 'Deutsch' },
|
|
7
7
|
keys: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
8
|
+
tstdl: {
|
|
9
|
+
errors: {
|
|
10
|
+
ApiError: {
|
|
11
|
+
header: 'API Fehler',
|
|
12
|
+
message: 'Bitte versuchen Sie es später noch einmal.'
|
|
13
|
+
},
|
|
14
|
+
BadRequestError: {
|
|
15
|
+
header: 'Ungültige Anfrage',
|
|
16
|
+
message: getErrorMessage
|
|
17
|
+
},
|
|
18
|
+
ForbiddenError: {
|
|
19
|
+
header: 'Zugriff nicht erlaubt',
|
|
20
|
+
message: getErrorMessage
|
|
21
|
+
},
|
|
22
|
+
InvalidCredentialsError: {
|
|
23
|
+
header: 'Ungültige Zugangsdaten',
|
|
24
|
+
message: 'Überprüfen Sie Ihre Eingaben'
|
|
25
|
+
},
|
|
26
|
+
InvalidTokenError: {
|
|
27
|
+
header: 'Anmeldung abgelaufen oder ungültig',
|
|
28
|
+
message: 'Bitte melden Sie sich erneut an'
|
|
29
|
+
},
|
|
30
|
+
MaxBytesExceededError: {
|
|
31
|
+
header: 'Daten größer als erlaubt',
|
|
32
|
+
message: getErrorMessage
|
|
33
|
+
},
|
|
34
|
+
MethodNotAllowedError: {
|
|
35
|
+
header: 'Anfrage nicht erlaubt',
|
|
36
|
+
message: getErrorMessage
|
|
37
|
+
},
|
|
38
|
+
NotFoundError: {
|
|
39
|
+
header: 'Nicht gefunden',
|
|
40
|
+
message: getErrorMessage
|
|
41
|
+
},
|
|
42
|
+
NotImplementedError: {
|
|
43
|
+
header: 'Funktion nicht implementiert',
|
|
44
|
+
message: getErrorMessage
|
|
45
|
+
},
|
|
46
|
+
NotSupportedError: {
|
|
47
|
+
header: 'Nicht unterstützt',
|
|
48
|
+
message: getErrorMessage
|
|
49
|
+
},
|
|
50
|
+
TimeoutError: {
|
|
51
|
+
header: 'Zeitüberschreitung',
|
|
52
|
+
message: getErrorMessage
|
|
53
|
+
},
|
|
54
|
+
UnauthorizedError: {
|
|
55
|
+
header: 'Unautorisiert',
|
|
56
|
+
message: getErrorMessage
|
|
57
|
+
},
|
|
58
|
+
HttpError: {
|
|
59
|
+
header: (error) => ((isDefined(error.response) && error.response.statusCode != 0)
|
|
60
|
+
? `Http Fehler - ${error.response.statusCode.toString()}`
|
|
61
|
+
: 'Http Fehler'),
|
|
62
|
+
message: getHttpErrorMessage
|
|
63
|
+
},
|
|
64
|
+
SecretRequirementsError: {
|
|
65
|
+
header: 'Passwortanforderungen nicht erfüllt',
|
|
66
|
+
message: getErrorMessage
|
|
67
|
+
}
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
},
|
|
@@ -82,64 +84,66 @@ export const germanTstdlErrorsLocalization = {
|
|
|
82
84
|
export const englishTstdlErrorsLocalization = {
|
|
83
85
|
language: { code: 'en', name: 'English' },
|
|
84
86
|
keys: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
87
|
+
tstdl: {
|
|
88
|
+
errors: {
|
|
89
|
+
ApiError: {
|
|
90
|
+
header: 'API error',
|
|
91
|
+
message: 'Please try again later'
|
|
92
|
+
},
|
|
93
|
+
BadRequestError: {
|
|
94
|
+
header: 'Bad Request',
|
|
95
|
+
message: getErrorMessage
|
|
96
|
+
},
|
|
97
|
+
ForbiddenError: {
|
|
98
|
+
header: 'Access forbidden',
|
|
99
|
+
message: getErrorMessage
|
|
100
|
+
},
|
|
101
|
+
InvalidCredentialsError: {
|
|
102
|
+
header: 'Invalid credentials',
|
|
103
|
+
message: 'Check your inputs'
|
|
104
|
+
},
|
|
105
|
+
InvalidTokenError: {
|
|
106
|
+
header: 'Login expired or invalid',
|
|
107
|
+
message: 'Please log in again'
|
|
108
|
+
},
|
|
109
|
+
MaxBytesExceededError: {
|
|
110
|
+
header: 'Data larger than allowed',
|
|
111
|
+
message: getErrorMessage
|
|
112
|
+
},
|
|
113
|
+
MethodNotAllowedError: {
|
|
114
|
+
header: 'Request not allowed',
|
|
115
|
+
message: getErrorMessage
|
|
116
|
+
},
|
|
117
|
+
NotFoundError: {
|
|
118
|
+
header: 'Not found',
|
|
119
|
+
message: getErrorMessage
|
|
120
|
+
},
|
|
121
|
+
NotImplementedError: {
|
|
122
|
+
header: 'Function not implemented',
|
|
123
|
+
message: getErrorMessage
|
|
124
|
+
},
|
|
125
|
+
NotSupportedError: {
|
|
126
|
+
header: 'Not supported',
|
|
127
|
+
message: getErrorMessage
|
|
128
|
+
},
|
|
129
|
+
TimeoutError: {
|
|
130
|
+
header: 'Timeout',
|
|
131
|
+
message: getErrorMessage
|
|
132
|
+
},
|
|
133
|
+
UnauthorizedError: {
|
|
134
|
+
header: 'Unauthorized',
|
|
135
|
+
message: getErrorMessage
|
|
136
|
+
},
|
|
137
|
+
HttpError: {
|
|
138
|
+
header: (error) => ((isDefined(error.response) && error.response.statusCode != 0)
|
|
139
|
+
? `Http error - ${error.response.statusCode.toString()}`
|
|
140
|
+
: 'Http error'),
|
|
141
|
+
message: getHttpErrorMessage
|
|
142
|
+
},
|
|
143
|
+
SecretRequirementsError: {
|
|
144
|
+
header: 'Secret requirements not met',
|
|
145
|
+
message: getErrorMessage
|
|
146
|
+
}
|
|
143
147
|
}
|
|
144
148
|
}
|
|
145
149
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tstdl/base",
|
|
3
|
-
"version": "0.91.
|
|
3
|
+
"version": "0.91.21",
|
|
4
4
|
"author": "Patrick Hein",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"./tsconfig.json": "./tsconfig.json",
|
|
23
23
|
".": "./index.js",
|
|
24
24
|
"./environment": "./environment.js",
|
|
25
|
+
"./formats": "./formats.js",
|
|
25
26
|
"./interfaces": "./interfaces.js",
|
|
26
27
|
"./polyfills": "./polyfills.js",
|
|
27
28
|
"./process-shutdown": "./process-shutdown.js",
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Localization, type LocalizeItem } from './localization.service.js';
|
|
2
|
+
export type TstdlCommonLocalization = Localization<{
|
|
3
|
+
tstdl: {
|
|
4
|
+
firstName: LocalizeItem;
|
|
5
|
+
lastName: LocalizeItem;
|
|
6
|
+
mailAddress: LocalizeItem;
|
|
7
|
+
password: LocalizeItem;
|
|
8
|
+
confirmPassword: LocalizeItem;
|
|
9
|
+
notSpecified: LocalizeItem;
|
|
10
|
+
pleaseSelect: LocalizeItem;
|
|
11
|
+
yes: LocalizeItem;
|
|
12
|
+
no: LocalizeItem;
|
|
13
|
+
ok: LocalizeItem;
|
|
14
|
+
success: LocalizeItem;
|
|
15
|
+
cancel: LocalizeItem;
|
|
16
|
+
add: LocalizeItem;
|
|
17
|
+
save: LocalizeItem;
|
|
18
|
+
remove: LocalizeItem;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
export declare const tstdlCommonLocalizationKeys: import("./localization.service.js").ProxyLocalizationKeys<{
|
|
22
|
+
firstName: LocalizeItem;
|
|
23
|
+
lastName: LocalizeItem;
|
|
24
|
+
mailAddress: LocalizeItem;
|
|
25
|
+
password: LocalizeItem;
|
|
26
|
+
confirmPassword: LocalizeItem;
|
|
27
|
+
notSpecified: LocalizeItem;
|
|
28
|
+
pleaseSelect: LocalizeItem;
|
|
29
|
+
yes: LocalizeItem;
|
|
30
|
+
no: LocalizeItem;
|
|
31
|
+
ok: LocalizeItem;
|
|
32
|
+
success: LocalizeItem;
|
|
33
|
+
cancel: LocalizeItem;
|
|
34
|
+
add: LocalizeItem;
|
|
35
|
+
save: LocalizeItem;
|
|
36
|
+
remove: LocalizeItem;
|
|
37
|
+
}>;
|
|
38
|
+
export declare const germanTstdlCommonLocalization: TstdlCommonLocalization;
|
|
39
|
+
export declare const englishTstdlCommonLocalization: TstdlCommonLocalization;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getLocalizationKeys } from './localization.service.js';
|
|
2
|
+
export const tstdlCommonLocalizationKeys = getLocalizationKeys().tstdl;
|
|
3
|
+
export const germanTstdlCommonLocalization = {
|
|
4
|
+
language: { code: 'de', name: 'Deutsch' },
|
|
5
|
+
keys: {
|
|
6
|
+
tstdl: {
|
|
7
|
+
firstName: 'Vorname',
|
|
8
|
+
lastName: 'Nachname',
|
|
9
|
+
mailAddress: 'E-Mail Adresse',
|
|
10
|
+
password: 'Passwort',
|
|
11
|
+
confirmPassword: 'Passwort bestätigen',
|
|
12
|
+
notSpecified: 'Keine Angabe',
|
|
13
|
+
pleaseSelect: 'Bitte auswählen...',
|
|
14
|
+
yes: 'Ja',
|
|
15
|
+
no: 'Nein',
|
|
16
|
+
ok: 'Ok',
|
|
17
|
+
success: 'Erfolgreich',
|
|
18
|
+
cancel: 'Abbrechen',
|
|
19
|
+
add: 'Hinzufügen',
|
|
20
|
+
save: 'Speichern',
|
|
21
|
+
remove: 'Entfernen'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
enums: []
|
|
25
|
+
};
|
|
26
|
+
export const englishTstdlCommonLocalization = {
|
|
27
|
+
language: { code: 'en', name: 'English' },
|
|
28
|
+
keys: {
|
|
29
|
+
tstdl: {
|
|
30
|
+
firstName: 'First name',
|
|
31
|
+
lastName: 'Last name',
|
|
32
|
+
mailAddress: 'E-Mail address',
|
|
33
|
+
password: 'Password',
|
|
34
|
+
confirmPassword: 'Confirm password',
|
|
35
|
+
notSpecified: 'Not specified',
|
|
36
|
+
pleaseSelect: 'Please select...',
|
|
37
|
+
yes: 'Yes',
|
|
38
|
+
no: 'No',
|
|
39
|
+
ok: 'Ok',
|
|
40
|
+
success: 'Success',
|
|
41
|
+
cancel: 'Cancel',
|
|
42
|
+
add: 'Add',
|
|
43
|
+
save: 'Save',
|
|
44
|
+
remove: 'Remove'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
enums: []
|
|
48
|
+
};
|
package/text/index.d.ts
CHANGED
package/text/index.js
CHANGED
package/utils/date-time.d.ts
CHANGED