@anzusystems/common-admin 0.0.29 → 0.0.30

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.
@@ -1,5 +1,6 @@
1
1
  import type { AllowedComponentProps } from 'vue';
2
2
  import type { App } from 'vue';
3
+ import { AxiosError } from 'axios';
3
4
  import type { AxiosInstance } from 'axios';
4
5
  import type { AxiosRequestConfig } from 'axios';
5
6
  import type { ComponentCustomProps } from 'vue';
@@ -1901,19 +1902,22 @@ export declare const ALogLevelChip: DefineComponent<{
1901
1902
  };
1902
1903
  }>>, {}>;
1903
1904
 
1905
+ declare class AnzuApiForbiddenError extends Error {
1906
+ constructor(cause?: Error, message?: string);
1907
+ }
1908
+
1904
1909
  export declare class AnzuApiResponseCodeError extends Error {
1905
- private date;
1906
- constructor();
1910
+ code: number;
1911
+ constructor(code: number, cause?: Error, message?: string);
1907
1912
  }
1908
1913
 
1909
1914
  export declare class AnzuApiValidationError extends Error {
1910
- private date;
1911
- constructor();
1915
+ fields: ValidationError[];
1916
+ constructor(axiosError: AxiosError, system: string, entity: string, cause?: Error, message?: string);
1912
1917
  }
1913
1918
 
1914
1919
  export declare class AnzuFatalError extends Error {
1915
- private date;
1916
- constructor(message?: string);
1920
+ constructor(cause?: Error, message?: string);
1917
1921
  }
1918
1922
 
1919
1923
  export declare const AnzuSystemsCommonAdmin: {
@@ -2045,11 +2049,6 @@ export declare const apiCreateOne: <T, R = T>(client: () => AxiosInstance, objec
2045
2049
  */
2046
2050
  export declare const apiDeleteOne: <T, R = T>(client: () => AxiosInstance, urlTemplate: string, urlParams: UrlParams | undefined, system: string, entity: string, options?: AxiosRequestConfig) => Promise<R>;
2047
2051
 
2048
- export declare interface ApiErrors {
2049
- field: string;
2050
- errors: string[];
2051
- }
2052
-
2053
2052
  export declare const apiFetchByIds: <T, R = T>(client: () => AxiosInstance, ids: string[] | number[], urlTemplate: string, urlParams: UrlParams | undefined, system: string, entity: string, options?: AxiosRequestConfig, isSearchApi?: boolean) => Promise<R>;
2054
2053
 
2055
2054
  /**
@@ -2451,6 +2450,17 @@ export declare const browserHistoryReplaceUrlByString: (path: string) => void;
2451
2450
  */
2452
2451
  export declare const cloneDeep: <T>(object: T) => T;
2453
2452
 
2453
+ export declare const COMMON_CONFIG: Immutable<typeof commonConfig>;
2454
+
2455
+ declare const commonConfig: {
2456
+ CHIP: {
2457
+ ICON: {
2458
+ LINK: string;
2459
+ LINK_EXTERNAL: string;
2460
+ };
2461
+ };
2462
+ };
2463
+
2454
2464
  export declare interface CreatedByAware {
2455
2465
  createdBy: IntegerIdNullable;
2456
2466
  }
@@ -2499,14 +2509,6 @@ export declare type DocId = string;
2499
2509
 
2500
2510
  export declare type DocIdNullable = string | null;
2501
2511
 
2502
- declare interface Error_2 {
2503
- response?: {
2504
- data?: {
2505
- error?: string;
2506
- };
2507
- };
2508
- }
2509
-
2510
2512
  export declare const eventClickBlur: (event?: Event) => void;
2511
2513
 
2512
2514
  declare type FetchItemsByIdsType = ((ids: IntegerId[]) => Promise<ValueObjectOption<IntegerId>[]>) | ((ids: DocId[]) => Promise<ValueObjectOption<DocId>[]>);
@@ -2552,6 +2554,8 @@ export declare const HTTP_STATUS_BAD_REQUEST = 400;
2552
2554
 
2553
2555
  export declare const HTTP_STATUS_CREATED = 201;
2554
2556
 
2557
+ export declare const HTTP_STATUS_FORBIDDEN = 403;
2558
+
2555
2559
  export declare const HTTP_STATUS_NO_CONTENT = 204;
2556
2560
 
2557
2561
  export declare const HTTP_STATUS_OK = 200;
@@ -2562,13 +2566,6 @@ export declare const HTTP_STATUS_UNPROCESSABLE_ENTITY = 422;
2562
2566
 
2563
2567
  export declare const i18n: I18n<{}, {}, {}, string, true>;
2564
2568
 
2565
- export declare const ICON: Immutable<typeof icons>;
2566
-
2567
- declare const icons: {
2568
- CHIP_LINK: string;
2569
- CHIP_LINK_EXTERNAL: string;
2570
- };
2571
-
2572
2569
  export declare type Immutable<T> = {
2573
2570
  readonly [K in keyof T]: Immutable<T[K]>;
2574
2571
  };
@@ -2708,6 +2705,7 @@ export declare const messagesEn: {
2708
2705
  common: {
2709
2706
  alert: {
2710
2707
  unknownError: string;
2708
+ forbiddenError: string;
2711
2709
  fixValidationErrors: string;
2712
2710
  fixApiValidationErrors: string;
2713
2711
  recordWas: {
@@ -3050,6 +3048,7 @@ export declare const messagesSk: {
3050
3048
  common: {
3051
3049
  alert: {
3052
3050
  unknownError: string;
3051
+ forbiddenError: string;
3053
3052
  fixValidationErrors: string;
3054
3053
  fixApiValidationErrors: string;
3055
3054
  recordWas: {
@@ -3561,8 +3560,10 @@ export declare function useAlerts(): {
3561
3560
  showWarningT: (translation: string, duration?: number) => void;
3562
3561
  showValidationError: (duration?: number) => void;
3563
3562
  showRecordWas: (variant: RecordWasType, duration?: number) => void;
3564
- showApiError: (errors: ApiErrors[], duration?: number, fieldIsTranslated?: boolean) => void;
3563
+ showApiError: (errors: ValidationError[], duration?: number, fieldIsTranslated?: boolean) => void;
3565
3564
  showUnknownError: (duration?: number) => void;
3565
+ showForbiddenError: (duration?: number) => void;
3566
+ showErrorsDefault: (error: any) => void;
3566
3567
  };
3567
3568
 
3568
3569
  export declare function useAnzuUserFactory(system?: string, resourceName?: string): {
@@ -3584,10 +3585,11 @@ export declare function useApiQueryBuilder(): {
3584
3585
 
3585
3586
  export declare function useDatatableColumns(config: DatatableColumnConfig[]): UseTableColumns;
3586
3587
 
3587
- export declare function useErrorHandler(): {
3588
- handleError: (error: unknown) => void;
3589
- handleValidationError: (error: Error_2, system?: string, entity?: string) => void;
3590
- isValidationError: (error: Error_2 | any) => boolean;
3588
+ export declare function useErrors(): {
3589
+ isAnzuFatalError: (error: any) => error is AnzuFatalError;
3590
+ isAnzuApiForbiddenError: (error: any) => error is AnzuApiForbiddenError;
3591
+ isAnzuApiValidationError: (error: any) => error is AnzuApiValidationError;
3592
+ isAnzuApiResponseCodeError: (error: any) => error is AnzuApiResponseCodeError;
3591
3593
  };
3592
3594
 
3593
3595
  export declare function useFilterHelpers(): {
@@ -3764,14 +3766,9 @@ export declare function useValidateStringArrayItemLength(): (min: number, max: n
3764
3766
 
3765
3767
  export declare function useValidateUrl(): ValidationRuleWithoutParams<any>;
3766
3768
 
3767
- export declare interface ValidationResponseData {
3768
- contextId: string;
3769
- error: string;
3770
- fields: ValidationResponseDataFields;
3771
- }
3772
-
3773
- declare interface ValidationResponseDataFields {
3774
- [key: string]: string[];
3769
+ declare interface ValidationError {
3770
+ field: string;
3771
+ errors: string[];
3775
3772
  }
3776
3773
 
3777
3774
  export declare type ValidationScope = string | number | boolean | symbol | undefined;