@availity/hooks 5.2.0 → 6.0.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/index.d.ts +58 -0
  3. package/dist/index.js +158 -0
  4. package/package.json +25 -15
  5. package/project.json +14 -6
  6. package/src/index.ts +20 -0
  7. package/src/types.ts +4 -0
  8. package/src/useCurrentRegion.ts +23 -0
  9. package/src/useCurrentUser.ts +13 -0
  10. package/src/useEffectAsync.ts +9 -0
  11. package/src/useMount.ts +6 -0
  12. package/src/useOrganizations.ts +22 -0
  13. package/src/usePermissions.ts +15 -0
  14. package/src/useProviders.ts +20 -0
  15. package/src/useStash.ts +21 -0
  16. package/src/{useTimeout.js → useTimeout.ts} +1 -1
  17. package/src/{useToggle.js → useToggle.ts} +2 -2
  18. package/src/{useUpdateNav.js → useUpdateNav.ts} +1 -1
  19. package/src/{useWindowDimensions.js → useWindowDimensions.ts} +9 -9
  20. package/stories/ResourceComponent.tsx +12 -10
  21. package/tests/useCurrentRegion.test.tsx +49 -0
  22. package/tests/useCurrentUser.test.tsx +52 -0
  23. package/tests/useEffectAsync.test.tsx +30 -0
  24. package/tests/useMount.test.tsx +23 -0
  25. package/tests/useOrganizations.test.tsx +49 -0
  26. package/tests/usePermissions.test.tsx +52 -0
  27. package/tests/useProviders.test.tsx +49 -0
  28. package/tests/useStash.test.tsx +58 -0
  29. package/tests/useTimeout.test.tsx +33 -0
  30. package/tests/useToggle.test.tsx +41 -0
  31. package/tests/useUpdateNav.test.tsx +46 -0
  32. package/tests/useWindowDimensions.test.tsx +37 -0
  33. package/tests/util.tsx +7 -0
  34. package/vitest.config.ts +17 -0
  35. package/index.d.ts +0 -12
  36. package/index.js +0 -12
  37. package/jest.config.js +0 -7
  38. package/src/useCurrentRegion.js +0 -15
  39. package/src/useCurrentUser.js +0 -8
  40. package/src/useEffectAsync.js +0 -8
  41. package/src/useMount.js +0 -6
  42. package/src/useOrganizations.js +0 -8
  43. package/src/usePermissions.js +0 -8
  44. package/src/useProviders.js +0 -8
  45. package/src/useStash.js +0 -14
  46. package/tests/util.js +0 -8
  47. package/tsconfig.spec.json +0 -10
  48. package/types/aries.d.ts +0 -12
  49. package/types/useCurrentRegion.d.ts +0 -12
  50. package/types/useCurrentUser.d.ts +0 -21
  51. package/types/useEffectAsync.d.ts +0 -3
  52. package/types/useMount.d.ts +0 -5
  53. package/types/useOrganizations.d.ts +0 -75
  54. package/types/usePermissions.d.ts +0 -22
  55. package/types/useProviders.d.ts +0 -50
  56. package/types/useStash.d.ts +0 -10
  57. package/types/useTimeout.d.ts +0 -3
  58. package/types/useToggle.d.ts +0 -3
  59. package/types/useUpdateNav.d.ts +0 -3
  60. package/types/useWindowDimensions.d.ts +0 -8
@@ -1,12 +0,0 @@
1
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
-
3
- export type CurrentRegion = {
4
- code: string;
5
- value: string;
6
- };
7
-
8
- declare function useCurrentRegion(
9
- options?: UseQueryOptions<CurrentRegion, unknown>
10
- ): UseQueryResult<CurrentRegion, unknown>;
11
-
12
- export default useCurrentRegion;
@@ -1,21 +0,0 @@
1
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
-
3
- export type CurrentUser = {
4
- akaname: string;
5
- createDate: string;
6
- currentRegion: string;
7
- email: string;
8
- firstName: string;
9
- lastName: string;
10
- id: string;
11
- jobTitle: string;
12
- userHasSecurityException: boolean;
13
- userId: string;
14
- userValidated: boolean;
15
- };
16
-
17
- declare function useCurrentUser(
18
- options?: UseQueryOptions<CurrentUser, unknown>
19
- ): UseQueryResult<CurrentUser, unknown>;
20
-
21
- export default useCurrentUser;
@@ -1,3 +0,0 @@
1
- import { useEffect } from 'react';
2
-
3
- export default useEffect;
@@ -1,5 +0,0 @@
1
- import { EffectCallback } from 'react';
2
-
3
- declare function useMount(effect: EffectCallback): void;
4
-
5
- export default useMount;
@@ -1,75 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
3
- import { AriesHookBase } from './aries';
4
-
5
- interface OrganizationsBase {
6
- data: {
7
- organizations: [
8
- {
9
- links: {
10
- permissions: { href: string };
11
- patients: { href: string };
12
- self: { href: string };
13
- admin: { href: string };
14
- businessArrangements: { href: string };
15
- users: { href: string };
16
- };
17
- id: string;
18
- customerId: string;
19
- name: string;
20
- status: string;
21
- statusCode: string;
22
- types: [{ code: string; value: string }];
23
-
24
- primaryControllingAuthority: {
25
- lastName: string;
26
- firstName: string;
27
- primaryPhone: string;
28
- email: string;
29
- };
30
-
31
- physicalAddress: {
32
- line1: string;
33
- city: string;
34
- state: string;
35
- stateCode: string;
36
- zipCode: string;
37
- };
38
- mailingAddress: {
39
- line1: string;
40
- city: string;
41
- state: string;
42
- stateCode: string;
43
- zipCode: string;
44
- };
45
- billingAddress: {
46
- line1: string;
47
- city: string;
48
- state: string;
49
- stateCode: string;
50
- zipCode: string;
51
- };
52
- regions: { code: string; value: string }[];
53
- npis: { number: string }[];
54
- taxIds: { number: string; type: string }[];
55
-
56
- phoneNumber: {
57
- areaCode: string;
58
- exchange: string;
59
- phoneNumber: string;
60
- };
61
- numberOfLicensedPhysicians: string;
62
- numberOfLicensedClinicians: string;
63
- }
64
- ];
65
- };
66
- }
67
-
68
- type Organizations = AriesHookBase & OrganizationsBase;
69
-
70
- export declare function useOrganizations(
71
- config: AxiosRequestConfig,
72
- options?: UseQueryOptions<Organizations, unknown>
73
- ): UseQueryResult<Organizations, unknown>;
74
-
75
- export default useOrganizations;
@@ -1,22 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
3
- import { AriesHookBase } from './aries';
4
-
5
- export interface PermissionsBase {
6
- data: {
7
- permissions: {
8
- id: string;
9
- description: string;
10
- links: { self: { href: string } };
11
- }[];
12
- };
13
- }
14
-
15
- type Permissions = AriesHookBase & PermissionsBase;
16
-
17
- declare function usePermissions(
18
- config: AxiosRequestConfig,
19
- options?: UseQueryOptions<Permissions, unknown>
20
- ): UseQueryResult<Permissions, unknown>;
21
-
22
- export default usePermissions;
@@ -1,50 +0,0 @@
1
- import { AxiosRequestConfig } from 'axios';
2
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
3
- import { AriesHookBase } from './aries';
4
-
5
- interface ProvidersBase {
6
- data: {
7
- providers: [
8
- {
9
- id: string;
10
- lastName: string;
11
- firstName: string;
12
- middleName: string;
13
- uiDisplayName: string;
14
- atypical: boolean;
15
- npi: string;
16
- customerIds: [string];
17
- roles: [{ code: string; value: string }];
18
-
19
- primarySpecialty: {
20
- code: string;
21
- value: string;
22
- };
23
- primaryFax: {
24
- internationalCellularCode: string;
25
- areaCode: string;
26
- phoneNumber: string;
27
- };
28
- primaryAddress: {
29
- line1: string;
30
- line2: string;
31
- city: string;
32
- state: string;
33
- stateCode: string;
34
- zip: { code: string; addon: string };
35
- };
36
- }
37
- ];
38
- };
39
- }
40
-
41
- type Providers = AriesHookBase & ProvidersBase;
42
-
43
- type AvConfig = { customerId: number } & AxiosRequestConfig;
44
-
45
- declare function useProviders(
46
- config: AvConfig,
47
- options?: UseQueryOptions<Providers, unknown>
48
- ): UseQueryResult<Providers, unknown>;
49
-
50
- export default useProviders;
@@ -1,10 +0,0 @@
1
- import { UseQueryOptions, UseQueryResult } from '@tanstack/react-query';
2
-
3
- export type StashData = Record<string, unknown>;
4
-
5
- declare function useStash(
6
- sessionId: string,
7
- options?: UseQueryOptions<StashData, unknown>
8
- ): UseQueryResult<StashData, unknown>;
9
-
10
- export default useStash;
@@ -1,3 +0,0 @@
1
- declare function useTimeout(ms?: number | 0): boolean;
2
-
3
- export default useTimeout;
@@ -1,3 +0,0 @@
1
- declare const useToggle: (initialValue?: boolean) => [isToggled: boolean, toggle: (state?: boolean) => void];
2
-
3
- export default useToggle;
@@ -1,3 +0,0 @@
1
- declare const useUpdateNav: () => void;
2
-
3
- export default useUpdateNav;
@@ -1,8 +0,0 @@
1
- export type Dimensions = {
2
- width: number;
3
- height: number;
4
- };
5
-
6
- declare function useWindowDimensions(): Dimensions;
7
-
8
- export default useWindowDimensions;