@tstdl/base 0.90.0 → 0.90.1

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.
@@ -12,7 +12,15 @@ import type { NotImplementedError } from './not-implemented.error.js';
12
12
  import type { NotSupportedError } from './not-supported.error.js';
13
13
  import type { TimeoutError } from './timeout.error.js';
14
14
  import type { UnauthorizedError } from './unauthorized.error.js';
15
- import type { UnsupportedMediaTypeError } from './unsupported-media-type.error.js';
15
+ export type ErrorsLocalizationEntries<T extends CustomErrorStatic[]> = {
16
+ [I in Extract<keyof T, number> as T[I]['errorName']]: {
17
+ header: LocalizeItem<InstanceType<T[I]>>;
18
+ message?: LocalizeItem<InstanceType<T[I]>>;
19
+ };
20
+ };
21
+ export type ErrorsLocalization<T extends CustomErrorStatic[] = CustomErrorStatic[]> = Localization<{
22
+ errors: ErrorsLocalizationEntries<T>;
23
+ }>;
16
24
  type TstdlErrors = [
17
25
  typeof ApiError,
18
26
  typeof BadRequestError,
@@ -25,20 +33,11 @@ type TstdlErrors = [
25
33
  typeof NotImplementedError,
26
34
  typeof NotSupportedError,
27
35
  typeof TimeoutError,
28
- typeof UnauthorizedError,
29
- typeof UnsupportedMediaTypeError
36
+ typeof UnauthorizedError
30
37
  ];
31
- export type ErrorsLocalizationEntries<T extends CustomErrorStatic[]> = {
32
- [I in Extract<keyof T, number> as TstdlErrors[I]['errorName']]: {
33
- header: LocalizeItem<InstanceType<T[I]>>;
34
- message?: LocalizeItem<InstanceType<T[I]>>;
35
- };
36
- };
37
- export type ErrorsLocalization<T extends CustomErrorStatic[] = CustomErrorStatic[]> = Localization<{
38
- errors: ErrorsLocalizationEntries<T>;
39
- }>;
40
38
  export declare const errorsLocalizationKeys: import("../text/localization.service.js").ProxyLocalizationKeys<{
41
39
  errors: ErrorsLocalizationEntries<CustomErrorStatic<import("./custom.error.js").CustomError>[]>;
42
40
  }>;
43
41
  export declare const germanTstdlErrorsLocalization: ErrorsLocalization<TstdlErrors>;
42
+ export declare const englishTstdlErrorsLocalization: ErrorsLocalization<TstdlErrors>;
44
43
  export {};
@@ -21,7 +21,7 @@ export const germanTstdlErrorsLocalization = {
21
21
  message: getErrorMessage
22
22
  },
23
23
  InvalidTokenError: {
24
- header: 'Anmeldung ungültig oder abgelaufen',
24
+ header: 'Anmeldung abgelaufen oder ungültig',
25
25
  message: getErrorMessage
26
26
  },
27
27
  MaxBytesExceededError: {
@@ -29,7 +29,7 @@ export const germanTstdlErrorsLocalization = {
29
29
  message: getErrorMessage
30
30
  },
31
31
  MethodNotAllowedError: {
32
- header: 'Ungültige Anfrage',
32
+ header: 'Anfrage nicht erlaubt',
33
33
  message: getErrorMessage
34
34
  },
35
35
  NotFoundError: {
@@ -51,9 +51,61 @@ export const germanTstdlErrorsLocalization = {
51
51
  UnauthorizedError: {
52
52
  header: 'Unautorisiert',
53
53
  message: getErrorMessage
54
+ }
55
+ }
56
+ },
57
+ enums: []
58
+ };
59
+ export const englishTstdlErrorsLocalization = {
60
+ language: { code: 'en', name: 'English' },
61
+ keys: {
62
+ errors: {
63
+ ApiError: {
64
+ header: 'API error',
65
+ message: getErrorMessage
54
66
  },
55
- UnsupportedMediaTypeError: {
56
- header: '',
67
+ BadRequestError: {
68
+ header: 'Bad Request',
69
+ message: getErrorMessage
70
+ },
71
+ ForbiddenError: {
72
+ header: 'Access forbidden',
73
+ message: getErrorMessage
74
+ },
75
+ InvalidCredentialsError: {
76
+ header: 'Invalid credentials',
77
+ message: getErrorMessage
78
+ },
79
+ InvalidTokenError: {
80
+ header: 'Login expired or invalid',
81
+ message: getErrorMessage
82
+ },
83
+ MaxBytesExceededError: {
84
+ header: 'Data larger than allowed',
85
+ message: getErrorMessage
86
+ },
87
+ MethodNotAllowedError: {
88
+ header: 'Request not allowed',
89
+ message: getErrorMessage
90
+ },
91
+ NotFoundError: {
92
+ header: 'Not found',
93
+ message: getErrorMessage
94
+ },
95
+ NotImplementedError: {
96
+ header: 'Function not implemented',
97
+ message: getErrorMessage
98
+ },
99
+ NotSupportedError: {
100
+ header: 'Not supported',
101
+ message: getErrorMessage
102
+ },
103
+ TimeoutError: {
104
+ header: 'Timeout',
105
+ message: getErrorMessage
106
+ },
107
+ UnauthorizedError: {
108
+ header: 'Unauthorized',
57
109
  message: getErrorMessage
58
110
  }
59
111
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.90.0",
3
+ "version": "0.90.1",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"