@anzusystems/common-admin 0.0.29 → 0.0.31

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
  /**
@@ -2063,6 +2062,16 @@ export declare const apiFetchList: <T, R = T>(client: () => AxiosInstance, urlTe
2063
2062
  */
2064
2063
  export declare const apiFetchOne: <R>(client: () => AxiosInstance, urlTemplate: string, urlParams: UrlParams | undefined, system: string, entity: string, options?: AxiosRequestConfig) => Promise<R>;
2065
2064
 
2065
+ export declare interface ApiInfiniteResponseList<T> {
2066
+ hasNextPage: boolean;
2067
+ data: T;
2068
+ }
2069
+
2070
+ export declare interface ApiResponseList<T> {
2071
+ totalCount: number;
2072
+ data: T;
2073
+ }
2074
+
2066
2075
  /**
2067
2076
  * @template T Type used for request payload, by default same as Response type
2068
2077
  * @template R Response type override, optional
@@ -2451,6 +2460,17 @@ export declare const browserHistoryReplaceUrlByString: (path: string) => void;
2451
2460
  */
2452
2461
  export declare const cloneDeep: <T>(object: T) => T;
2453
2462
 
2463
+ export declare const COMMON_CONFIG: Immutable<typeof commonConfig>;
2464
+
2465
+ declare const commonConfig: {
2466
+ CHIP: {
2467
+ ICON: {
2468
+ LINK: string;
2469
+ LINK_EXTERNAL: string;
2470
+ };
2471
+ };
2472
+ };
2473
+
2454
2474
  export declare interface CreatedByAware {
2455
2475
  createdBy: IntegerIdNullable;
2456
2476
  }
@@ -2499,14 +2519,6 @@ export declare type DocId = string;
2499
2519
 
2500
2520
  export declare type DocIdNullable = string | null;
2501
2521
 
2502
- declare interface Error_2 {
2503
- response?: {
2504
- data?: {
2505
- error?: string;
2506
- };
2507
- };
2508
- }
2509
-
2510
2522
  export declare const eventClickBlur: (event?: Event) => void;
2511
2523
 
2512
2524
  declare type FetchItemsByIdsType = ((ids: IntegerId[]) => Promise<ValueObjectOption<IntegerId>[]>) | ((ids: DocId[]) => Promise<ValueObjectOption<DocId>[]>);
@@ -2552,6 +2564,8 @@ export declare const HTTP_STATUS_BAD_REQUEST = 400;
2552
2564
 
2553
2565
  export declare const HTTP_STATUS_CREATED = 201;
2554
2566
 
2567
+ export declare const HTTP_STATUS_FORBIDDEN = 403;
2568
+
2555
2569
  export declare const HTTP_STATUS_NO_CONTENT = 204;
2556
2570
 
2557
2571
  export declare const HTTP_STATUS_OK = 200;
@@ -2562,13 +2576,6 @@ export declare const HTTP_STATUS_UNPROCESSABLE_ENTITY = 422;
2562
2576
 
2563
2577
  export declare const i18n: I18n<{}, {}, {}, string, true>;
2564
2578
 
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
2579
  export declare type Immutable<T> = {
2573
2580
  readonly [K in keyof T]: Immutable<T[K]>;
2574
2581
  };
@@ -2708,6 +2715,7 @@ export declare const messagesEn: {
2708
2715
  common: {
2709
2716
  alert: {
2710
2717
  unknownError: string;
2718
+ forbiddenError: string;
2711
2719
  fixValidationErrors: string;
2712
2720
  fixApiValidationErrors: string;
2713
2721
  recordWas: {
@@ -3031,10 +3039,19 @@ export declare const messagesEn: {
3031
3039
  };
3032
3040
  validations: {
3033
3041
  api: {
3042
+ validation_failed: string;
3043
+ error_id_mismatch: string;
3044
+ error_field_empty: string;
3034
3045
  error_field_length_min: string;
3035
3046
  error_field_length_max: string;
3047
+ error_field_invalid: string;
3036
3048
  error_field_not_unique: string;
3037
- error_compromised_password: string;
3049
+ error_field_value_not_found: string;
3050
+ error_field_range_min: string;
3051
+ error_field_range_max: string;
3052
+ error_field_regex: string;
3053
+ error_field_url: string;
3054
+ error_already_exists: string;
3038
3055
  };
3039
3056
  js: {
3040
3057
  required: string;
@@ -3050,6 +3067,7 @@ export declare const messagesSk: {
3050
3067
  common: {
3051
3068
  alert: {
3052
3069
  unknownError: string;
3070
+ forbiddenError: string;
3053
3071
  fixValidationErrors: string;
3054
3072
  fixApiValidationErrors: string;
3055
3073
  recordWas: {
@@ -3372,10 +3390,19 @@ export declare const messagesSk: {
3372
3390
  };
3373
3391
  validations: {
3374
3392
  api: {
3393
+ validation_failed: string;
3394
+ error_id_mismatch: string;
3395
+ error_field_empty: string;
3375
3396
  error_field_length_min: string;
3376
3397
  error_field_length_max: string;
3398
+ error_field_invalid: string;
3377
3399
  error_field_not_unique: string;
3378
- error_compromised_password: string;
3400
+ error_field_value_not_found: string;
3401
+ error_field_range_min: string;
3402
+ error_field_range_max: string;
3403
+ error_field_regex: string;
3404
+ error_field_url: string;
3405
+ error_already_exists: string;
3379
3406
  };
3380
3407
  js: {
3381
3408
  required: string;
@@ -3561,8 +3588,10 @@ export declare function useAlerts(): {
3561
3588
  showWarningT: (translation: string, duration?: number) => void;
3562
3589
  showValidationError: (duration?: number) => void;
3563
3590
  showRecordWas: (variant: RecordWasType, duration?: number) => void;
3564
- showApiError: (errors: ApiErrors[], duration?: number, fieldIsTranslated?: boolean) => void;
3591
+ showApiError: (errors: ValidationError[], duration?: number, fieldIsTranslated?: boolean) => void;
3565
3592
  showUnknownError: (duration?: number) => void;
3593
+ showForbiddenError: (duration?: number) => void;
3594
+ showErrorsDefault: (error: any) => void;
3566
3595
  };
3567
3596
 
3568
3597
  export declare function useAnzuUserFactory(system?: string, resourceName?: string): {
@@ -3584,10 +3613,11 @@ export declare function useApiQueryBuilder(): {
3584
3613
 
3585
3614
  export declare function useDatatableColumns(config: DatatableColumnConfig[]): UseTableColumns;
3586
3615
 
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;
3616
+ export declare function useErrors(): {
3617
+ isAnzuFatalError: (error: any) => error is AnzuFatalError;
3618
+ isAnzuApiForbiddenError: (error: any) => error is AnzuApiForbiddenError;
3619
+ isAnzuApiValidationError: (error: any) => error is AnzuApiValidationError;
3620
+ isAnzuApiResponseCodeError: (error: any) => error is AnzuApiResponseCodeError;
3591
3621
  };
3592
3622
 
3593
3623
  export declare function useFilterHelpers(): {
@@ -3704,12 +3734,27 @@ export declare function useTheme(): {
3704
3734
  setThemeLight: () => void;
3705
3735
  };
3706
3736
 
3707
- export declare function useValidateBetween(): (min: number | Ref_2<number>, max: number | Ref_2<number>) => ValidationRuleWithParams<{
3737
+ export declare function useValidate(): {
3738
+ required: typeof useValidateRequired;
3739
+ requiredIf: typeof useValidateRequiredIf;
3740
+ minLength: typeof useValidateMinLength;
3741
+ maxLength: typeof useValidateMaxLength;
3742
+ minValue: typeof useValidateMinValue;
3743
+ maxValue: typeof useValidateMaxValue;
3744
+ between: typeof useValidateBetween;
3745
+ email: typeof useValidateEmail;
3746
+ numeric: typeof useValidateNumeric;
3747
+ slug: typeof useValidateSlug;
3748
+ url: typeof useValidateUrl;
3749
+ stringArrayItemLength: typeof useValidateStringArrayItemLength;
3750
+ };
3751
+
3752
+ declare function useValidateBetween(): (min: number | Ref_2<number>, max: number | Ref_2<number>) => ValidationRuleWithParams<{
3708
3753
  min: number;
3709
3754
  max: number;
3710
3755
  }, any>;
3711
3756
 
3712
- export declare function useValidateEmail(): ValidationRuleWithoutParams<any>;
3757
+ declare function useValidateEmail(): ValidationRuleWithoutParams<any>;
3713
3758
 
3714
3759
  export declare function useValidateLatitude(): any;
3715
3760
 
@@ -3727,33 +3772,33 @@ export declare function useValidateLongitudeNotZeroAsLatitude(): (value: string,
3727
3772
  required: boolean;
3728
3773
  }) => boolean;
3729
3774
 
3730
- export declare function useValidateMaxLength(): (max: number | Ref_2<number>) => ValidationRuleWithParams<{
3775
+ declare function useValidateMaxLength(): (max: number | Ref_2<number>) => ValidationRuleWithParams<{
3731
3776
  max: number;
3732
3777
  }, any>;
3733
3778
 
3734
- export declare function useValidateMaxValue(): (max: string | number | Ref_2<number> | Ref_2<string>) => ValidationRuleWithParams<{
3779
+ declare function useValidateMaxValue(): (max: string | number | Ref_2<number> | Ref_2<string>) => ValidationRuleWithParams<{
3735
3780
  max: number;
3736
3781
  }, any>;
3737
3782
 
3738
- export declare function useValidateMinLength(): (min: number | Ref_2<number>) => ValidationRuleWithParams<{
3783
+ declare function useValidateMinLength(): (min: number | Ref_2<number>) => ValidationRuleWithParams<{
3739
3784
  min: number;
3740
3785
  }, any>;
3741
3786
 
3742
- export declare function useValidateMinValue(): (min: string | number | Ref_2<number> | Ref_2<string>) => ValidationRuleWithParams<{
3787
+ declare function useValidateMinValue(): (min: string | number | Ref_2<number> | Ref_2<string>) => ValidationRuleWithParams<{
3743
3788
  min: number;
3744
3789
  }, any>;
3745
3790
 
3746
- export declare function useValidateNumeric(): ValidationRuleWithoutParams<any>;
3791
+ declare function useValidateNumeric(): ValidationRuleWithoutParams<any>;
3747
3792
 
3748
- export declare function useValidatePhoneNumber(): any;
3793
+ declare function useValidateRequired(): ValidationRuleWithoutParams<any>;
3749
3794
 
3750
- export declare function useValidateRequired(): ValidationRuleWithoutParams<any>;
3795
+ declare function useValidateRequiredIf(): (prop: string | boolean | Ref_2<boolean> | (() => boolean | Promise<boolean>)) => ValidationRuleWithoutParams<any>;
3751
3796
 
3752
- export declare function useValidateRequiredIf(): (prop: string | boolean | Ref_2<boolean> | (() => boolean | Promise<boolean>)) => ValidationRuleWithoutParams<any>;
3797
+ export declare function useValidateSlovakPhoneNumber(): any;
3753
3798
 
3754
- export declare function useValidateSlug(): any;
3799
+ declare function useValidateSlug(): any;
3755
3800
 
3756
- export declare function useValidateStringArrayItemLength(): (min: number, max: number) => {
3801
+ declare function useValidateStringArrayItemLength(): (min: number, max: number) => {
3757
3802
  $validator: (value: string[]) => boolean;
3758
3803
  $params: {
3759
3804
  min: number;
@@ -3762,16 +3807,11 @@ export declare function useValidateStringArrayItemLength(): (min: number, max: n
3762
3807
  };
3763
3808
  };
3764
3809
 
3765
- export declare function useValidateUrl(): ValidationRuleWithoutParams<any>;
3810
+ declare function useValidateUrl(): ValidationRuleWithoutParams<any>;
3766
3811
 
3767
- export declare interface ValidationResponseData {
3768
- contextId: string;
3769
- error: string;
3770
- fields: ValidationResponseDataFields;
3771
- }
3772
-
3773
- declare interface ValidationResponseDataFields {
3774
- [key: string]: string[];
3812
+ declare interface ValidationError {
3813
+ field: string;
3814
+ errors: string[];
3775
3815
  }
3776
3816
 
3777
3817
  export declare type ValidationScope = string | number | boolean | symbol | undefined;