@sito/dashboard-app 0.0.20 → 0.0.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/dist/dashboard-app.cjs +1 -1
- package/dist/dashboard-app.js +1185 -1109
- package/dist/lib/errors.d.ts +15 -0
- package/dist/lib/index.d.ts +2 -3
- package/package.json +1 -1
- package/dist/lib/ServiceError.d.ts +0 -4
- package/dist/lib/ValidationError.d.ts +0 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ServiceError = {
|
|
2
|
+
key: string;
|
|
3
|
+
message: string;
|
|
4
|
+
};
|
|
5
|
+
export type FieldErrorTuple = [key: string, code: string];
|
|
6
|
+
export interface ValidationError extends Error {
|
|
7
|
+
errors: FieldErrorTuple[];
|
|
8
|
+
}
|
|
9
|
+
export interface HttpError extends Error {
|
|
10
|
+
status: number;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function isValidationError(error: unknown): error is ValidationError;
|
|
14
|
+
export declare function isHttpError(error: unknown): error is HttpError;
|
|
15
|
+
export declare function mapValidationErrors(error: ValidationError, map: (field: string, code: string) => string): string[];
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ServiceError } from './ServiceError';
|
|
2
|
-
import { ValidationError } from './ValidationError';
|
|
3
1
|
import { NotificationType, NotificationEnumType } from './Notification';
|
|
4
2
|
export { NotificationEnumType };
|
|
5
|
-
export type {
|
|
3
|
+
export type { NotificationType };
|
|
6
4
|
export * from './entities';
|
|
7
5
|
export * from './api';
|
|
8
6
|
export * from './utils';
|
|
7
|
+
export * from './errors';
|
package/package.json
CHANGED