@makana-cl/portal-internal-client 1.2.3 → 1.3.0

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 (73) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.esm.js/index.d.ts +6 -0
  4. package/dist/index.esm.js/index.d.ts.map +1 -1
  5. package/dist/index.esm.js/index.esm.js.tmp/index.d.ts +6 -0
  6. package/dist/index.esm.js/index.esm.js.tmp/index.d.ts.map +1 -1
  7. package/dist/index.esm.js/index.esm.js.tmp/index.js +4 -0
  8. package/dist/index.esm.js/index.esm.js.tmp/index.js.map +1 -1
  9. package/dist/index.esm.js/index.esm.js.tmp/queries/attentions.d.ts +60 -0
  10. package/dist/index.esm.js/index.esm.js.tmp/queries/attentions.d.ts.map +1 -0
  11. package/dist/index.esm.js/index.esm.js.tmp/queries/attentions.js +114 -0
  12. package/dist/index.esm.js/index.esm.js.tmp/queries/attentions.js.map +1 -0
  13. package/dist/index.esm.js/index.esm.js.tmp/queries/attentionsLight.d.ts +60 -0
  14. package/dist/index.esm.js/index.esm.js.tmp/queries/attentionsLight.d.ts.map +1 -0
  15. package/dist/index.esm.js/index.esm.js.tmp/queries/attentionsLight.js +92 -0
  16. package/dist/index.esm.js/index.esm.js.tmp/queries/attentionsLight.js.map +1 -0
  17. package/dist/index.esm.js/index.esm.js.tmp/queries/index.d.ts +2 -0
  18. package/dist/index.esm.js/index.esm.js.tmp/queries/index.d.ts.map +1 -1
  19. package/dist/index.esm.js/index.esm.js.tmp/queries/index.js +2 -0
  20. package/dist/index.esm.js/index.esm.js.tmp/queries/index.js.map +1 -1
  21. package/dist/index.esm.js/index.esm.js.tmp/types/attention.d.ts +37 -0
  22. package/dist/index.esm.js/index.esm.js.tmp/types/attention.d.ts.map +1 -0
  23. package/dist/index.esm.js/index.esm.js.tmp/types/attention.js +2 -0
  24. package/dist/index.esm.js/index.esm.js.tmp/types/attention.js.map +1 -0
  25. package/dist/index.esm.js/index.esm.js.tmp/types/index.d.ts +1 -0
  26. package/dist/index.esm.js/index.esm.js.tmp/types/index.d.ts.map +1 -1
  27. package/dist/index.esm.js/index.esm.js.tmp/types/index.js +1 -0
  28. package/dist/index.esm.js/index.esm.js.tmp/types/index.js.map +1 -1
  29. package/dist/index.esm.js/index.js +4 -0
  30. package/dist/index.esm.js/index.js.map +1 -1
  31. package/dist/index.esm.js/queries/attentions.d.ts +60 -0
  32. package/dist/index.esm.js/queries/attentions.d.ts.map +1 -0
  33. package/dist/index.esm.js/queries/attentions.js +114 -0
  34. package/dist/index.esm.js/queries/attentions.js.map +1 -0
  35. package/dist/index.esm.js/queries/attentionsLight.d.ts +60 -0
  36. package/dist/index.esm.js/queries/attentionsLight.d.ts.map +1 -0
  37. package/dist/index.esm.js/queries/attentionsLight.js +92 -0
  38. package/dist/index.esm.js/queries/attentionsLight.js.map +1 -0
  39. package/dist/index.esm.js/queries/index.d.ts +2 -0
  40. package/dist/index.esm.js/queries/index.d.ts.map +1 -1
  41. package/dist/index.esm.js/queries/index.js +2 -0
  42. package/dist/index.esm.js/queries/index.js.map +1 -1
  43. package/dist/index.esm.js/types/attention.d.ts +37 -0
  44. package/dist/index.esm.js/types/attention.d.ts.map +1 -0
  45. package/dist/index.esm.js/types/attention.js +2 -0
  46. package/dist/index.esm.js/types/attention.js.map +1 -0
  47. package/dist/index.esm.js/types/index.d.ts +1 -0
  48. package/dist/index.esm.js/types/index.d.ts.map +1 -1
  49. package/dist/index.esm.js/types/index.js +1 -0
  50. package/dist/index.esm.js/types/index.js.map +1 -1
  51. package/dist/index.js +9 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/queries/attentions.d.ts +60 -0
  54. package/dist/queries/attentions.d.ts.map +1 -0
  55. package/dist/queries/attentions.js +118 -0
  56. package/dist/queries/attentions.js.map +1 -0
  57. package/dist/queries/attentionsLight.d.ts +60 -0
  58. package/dist/queries/attentionsLight.d.ts.map +1 -0
  59. package/dist/queries/attentionsLight.js +96 -0
  60. package/dist/queries/attentionsLight.js.map +1 -0
  61. package/dist/queries/index.d.ts +2 -0
  62. package/dist/queries/index.d.ts.map +1 -1
  63. package/dist/queries/index.js +2 -0
  64. package/dist/queries/index.js.map +1 -1
  65. package/dist/types/attention.d.ts +37 -0
  66. package/dist/types/attention.d.ts.map +1 -0
  67. package/dist/types/attention.js +3 -0
  68. package/dist/types/attention.js.map +1 -0
  69. package/dist/types/index.d.ts +1 -0
  70. package/dist/types/index.d.ts.map +1 -1
  71. package/dist/types/index.js +1 -0
  72. package/dist/types/index.js.map +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1,114 @@
1
+ import { gql, useQuery } from '@apollo/client';
2
+ export const GET_ATTENTIONS = gql `
3
+ query FetchAttentions(
4
+ $date: DateEnum
5
+ $filters: FilterInput
6
+ $sort: SortInput
7
+ $first: Int
8
+ $last: Int
9
+ $after: String
10
+ $before: String
11
+ ) {
12
+ fetchAttentions(
13
+ date: $date
14
+ filters: $filters
15
+ sort: $sort
16
+ first: $first
17
+ last: $last
18
+ after: $after
19
+ before: $before
20
+ ) {
21
+ totalCount
22
+ edges {
23
+ node {
24
+ id
25
+ protocol
26
+ registerInMetrics
27
+ registerOutMetrics
28
+ date
29
+ user {
30
+ id
31
+ name
32
+ firstName
33
+ lastName
34
+ rut
35
+ disease
36
+ currentPlan {
37
+ plan
38
+ stats
39
+ }
40
+ department {
41
+ id
42
+ name
43
+ colorTag
44
+ }
45
+ business {
46
+ id
47
+ name
48
+ parentGroup {
49
+ id
50
+ name
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ pageInfo {
57
+ hasNextPage
58
+ hasPreviousPage
59
+ startCursor
60
+ endCursor
61
+ }
62
+ }
63
+ }
64
+ `;
65
+ /**
66
+ * React hook to fetch attentions from Makana GraphQL API
67
+ *
68
+ * @param variables - Query variables (filters, pagination, date, etc.)
69
+ * @param options - Additional Apollo Client query options
70
+ * @returns Object containing attentions data, loading state, error, and refetch function
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * // Filter by date enum
75
+ * const { attentions, loading } = useGetAttentions({
76
+ * date: 'CURRENT_MONTH',
77
+ * filters: { businessId: '123' },
78
+ * first: 10
79
+ * });
80
+ *
81
+ * // Filter by date range
82
+ * const { attentions } = useGetAttentions({
83
+ * filters: {
84
+ * businessId: '123',
85
+ * dateRange: {
86
+ * startDate: '2024-01-01',
87
+ * endDate: '2024-12-31'
88
+ * }
89
+ * }
90
+ * });
91
+ * ```
92
+ */
93
+ export function useGetAttentions(variables = {}, options) {
94
+ const { skip, ...queryVariables } = variables;
95
+ const { loading, error, data, fetchMore, refetch } = useQuery(GET_ATTENTIONS, {
96
+ variables: queryVariables,
97
+ fetchPolicy: 'cache-first',
98
+ skip: skip === true,
99
+ ...options,
100
+ });
101
+ const attentions = data?.fetchAttentions?.edges.map((edge) => edge.node) || [];
102
+ const totalCount = data?.fetchAttentions?.totalCount || 0;
103
+ const pageInfo = data?.fetchAttentions?.pageInfo || null;
104
+ return {
105
+ attentions,
106
+ totalCount,
107
+ pageInfo,
108
+ loading,
109
+ error,
110
+ fetchMore,
111
+ refetch,
112
+ };
113
+ }
114
+ //# sourceMappingURL=attentions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentions.js","sourceRoot":"","sources":["../../../src/queries/attentions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAoB,MAAM,gBAAgB,CAAC;AAIjE,MAAM,CAAC,MAAM,cAAc,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DhC,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,gBAAgB,CAC9B,YAAsC,EAAE,EACxC,OAAgG;IAEhG,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC;IAE9C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,QAAQ,CAC3D,cAAc,EACd;QACE,SAAS,EAAE,cAAc;QACzB,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,IAAI,KAAK,IAAI;QACnB,GAAG,OAAO;KACX,CACF,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,UAAU,IAAI,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,EAAE,eAAe,EAAE,QAAQ,IAAI,IAAI,CAAC;IAEzD,OAAO;QACL,UAAU;QACV,UAAU;QACV,QAAQ;QACR,OAAO;QACP,KAAK;QACL,SAAS;QACT,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { QueryHookOptions } from '@apollo/client';
2
+ import { AttentionLight } from '../types/attention';
3
+ import { FilterInput, SortInput, DateEnum, Connection } from '../types/common';
4
+ export declare const GET_ATTENTIONS_LIGHT: import("@apollo/client").DocumentNode;
5
+ export interface FetchAttentionsLightVariables {
6
+ date?: DateEnum;
7
+ filters?: FilterInput;
8
+ sort?: SortInput;
9
+ first?: number;
10
+ last?: number;
11
+ after?: string | null;
12
+ before?: string | null;
13
+ skip?: boolean;
14
+ }
15
+ export interface FetchAttentionsLightResponse {
16
+ fetchAttentions: Connection<AttentionLight>;
17
+ }
18
+ /**
19
+ * React hook to fetch attentions with minimal data from Makana GraphQL API
20
+ * This is a lightweight query that only returns user id and business id
21
+ *
22
+ * @param variables - Query variables (filters, pagination, date, etc.)
23
+ * @param options - Additional Apollo Client query options
24
+ * @returns Object containing attentions data, loading state, error, and refetch function
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * // Filter by date enum
29
+ * const { attentions, loading } = useGetAttentionsLight({
30
+ * date: 'CURRENT_MONTH',
31
+ * first: 100
32
+ * });
33
+ *
34
+ * // Filter by date range
35
+ * const { attentions } = useGetAttentionsLight({
36
+ * filters: {
37
+ * businessId: '123',
38
+ * dateRange: {
39
+ * startDate: '2024-01-01',
40
+ * endDate: '2024-12-31'
41
+ * }
42
+ * }
43
+ * });
44
+ * ```
45
+ */
46
+ export declare function useGetAttentionsLight(variables?: FetchAttentionsLightVariables, options?: Omit<QueryHookOptions<FetchAttentionsLightResponse, FetchAttentionsLightVariables>, 'variables'>): {
47
+ attentions: AttentionLight[];
48
+ totalCount: number;
49
+ pageInfo: import("../types/common").PageInfo | null;
50
+ loading: boolean;
51
+ error: import("@apollo/client").ApolloError | undefined;
52
+ fetchMore: <TFetchData = FetchAttentionsLightResponse, TFetchVars extends import("@apollo/client").OperationVariables = FetchAttentionsLightVariables>(fetchMoreOptions: import("@apollo/client").FetchMoreQueryOptions<TFetchVars, TFetchData> & {
53
+ updateQuery?: ((previousQueryResult: FetchAttentionsLightResponse, options: {
54
+ fetchMoreResult: import("@apollo/client").Unmasked<TFetchData>;
55
+ variables: TFetchVars;
56
+ }) => FetchAttentionsLightResponse) | undefined;
57
+ }) => Promise<import("@apollo/client").ApolloQueryResult<TFetchData>>;
58
+ refetch: (variables?: Partial<FetchAttentionsLightVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<FetchAttentionsLightResponse>>;
59
+ };
60
+ //# sourceMappingURL=attentionsLight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentionsLight.d.ts","sourceRoot":"","sources":["../../../src/queries/attentionsLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE/E,eAAO,MAAM,oBAAoB,uCAwChC,CAAC;AAEF,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,4BAA4B;IAC3C,eAAe,EAAE,UAAU,CAAC,cAAc,CAAC,CAAC;CAC7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,6BAAkC,EAC7C,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,6BAA6B,CAAC,EAAE,WAAW,CAAC;;;;;;;;;;;;;EA2B3G"}
@@ -0,0 +1,92 @@
1
+ import { gql, useQuery } from '@apollo/client';
2
+ export const GET_ATTENTIONS_LIGHT = gql `
3
+ query FetchAttentions(
4
+ $date: DateEnum
5
+ $filters: FilterInput
6
+ $sort: SortInput
7
+ $first: Int
8
+ $last: Int
9
+ $after: String
10
+ $before: String
11
+ ) {
12
+ fetchAttentions(
13
+ date: $date
14
+ filters: $filters
15
+ sort: $sort
16
+ first: $first
17
+ last: $last
18
+ after: $after
19
+ before: $before
20
+ ) {
21
+ totalCount
22
+ edges {
23
+ node {
24
+ id
25
+ date
26
+ user {
27
+ id
28
+ business {
29
+ id
30
+ }
31
+ }
32
+ }
33
+ }
34
+ pageInfo {
35
+ hasNextPage
36
+ hasPreviousPage
37
+ startCursor
38
+ endCursor
39
+ }
40
+ }
41
+ }
42
+ `;
43
+ /**
44
+ * React hook to fetch attentions with minimal data from Makana GraphQL API
45
+ * This is a lightweight query that only returns user id and business id
46
+ *
47
+ * @param variables - Query variables (filters, pagination, date, etc.)
48
+ * @param options - Additional Apollo Client query options
49
+ * @returns Object containing attentions data, loading state, error, and refetch function
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * // Filter by date enum
54
+ * const { attentions, loading } = useGetAttentionsLight({
55
+ * date: 'CURRENT_MONTH',
56
+ * first: 100
57
+ * });
58
+ *
59
+ * // Filter by date range
60
+ * const { attentions } = useGetAttentionsLight({
61
+ * filters: {
62
+ * businessId: '123',
63
+ * dateRange: {
64
+ * startDate: '2024-01-01',
65
+ * endDate: '2024-12-31'
66
+ * }
67
+ * }
68
+ * });
69
+ * ```
70
+ */
71
+ export function useGetAttentionsLight(variables = {}, options) {
72
+ const { skip, ...queryVariables } = variables;
73
+ const { loading, error, data, fetchMore, refetch } = useQuery(GET_ATTENTIONS_LIGHT, {
74
+ variables: queryVariables,
75
+ fetchPolicy: 'cache-first',
76
+ skip: skip === true,
77
+ ...options,
78
+ });
79
+ const attentions = data?.fetchAttentions?.edges.map((edge) => edge.node) || [];
80
+ const totalCount = data?.fetchAttentions?.totalCount || 0;
81
+ const pageInfo = data?.fetchAttentions?.pageInfo || null;
82
+ return {
83
+ attentions,
84
+ totalCount,
85
+ pageInfo,
86
+ loading,
87
+ error,
88
+ fetchMore,
89
+ refetch,
90
+ };
91
+ }
92
+ //# sourceMappingURL=attentionsLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentionsLight.js","sourceRoot":"","sources":["../../../src/queries/attentionsLight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAoB,MAAM,gBAAgB,CAAC;AAIjE,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCtC,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,qBAAqB,CACnC,YAA2C,EAAE,EAC7C,OAA0G;IAE1G,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC;IAE9C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,QAAQ,CAC3D,oBAAoB,EACpB;QACE,SAAS,EAAE,cAAc;QACzB,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,IAAI,KAAK,IAAI;QACnB,GAAG,OAAO;KACX,CACF,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,UAAU,IAAI,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,EAAE,eAAe,EAAE,QAAQ,IAAI,IAAI,CAAC;IAEzD,OAAO;QACL,UAAU;QACV,UAAU;QACV,QAAQ;QACR,OAAO;QACP,KAAK;QACL,SAAS;QACT,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -2,4 +2,6 @@ export * from './users';
2
2
  export * from './usersLight';
3
3
  export * from './businesses';
4
4
  export * from './searchBusinesses';
5
+ export * from './attentions';
6
+ export * from './attentionsLight';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -2,4 +2,6 @@ export * from './users';
2
2
  export * from './usersLight';
3
3
  export * from './businesses';
4
4
  export * from './searchBusinesses';
5
+ export * from './attentions';
6
+ export * from './attentionsLight';
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { Department } from './department';
2
+ import { Business } from './business';
3
+ export interface AttentionUser {
4
+ id?: number;
5
+ name?: string;
6
+ firstName?: string;
7
+ lastName?: string;
8
+ rut?: string;
9
+ disease?: boolean;
10
+ currentPlan?: {
11
+ plan: string;
12
+ stats: string;
13
+ } | null;
14
+ department?: Department;
15
+ business?: Business;
16
+ }
17
+ export interface Attention {
18
+ id?: number;
19
+ protocol?: string;
20
+ registerInMetrics?: any;
21
+ registerOutMetrics?: any;
22
+ date?: string;
23
+ user?: AttentionUser;
24
+ }
25
+ export interface AttentionLightUser {
26
+ id?: number;
27
+ business?: {
28
+ id: number;
29
+ name?: string;
30
+ };
31
+ }
32
+ export interface AttentionLight {
33
+ id?: number;
34
+ date?: string;
35
+ user?: AttentionLightUser;
36
+ }
37
+ //# sourceMappingURL=attention.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention.d.ts","sourceRoot":"","sources":["../../../src/types/attention.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE;QACT,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,kBAAkB,CAAC;CAC3B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=attention.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attention.js","sourceRoot":"","sources":["../../../src/types/attention.ts"],"names":[],"mappings":""}
@@ -3,4 +3,5 @@ export * from './business';
3
3
  export * from './group';
4
4
  export * from './user';
5
5
  export * from './department';
6
+ export * from './attention';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
@@ -3,4 +3,5 @@ export * from './business';
3
3
  export * from './group';
4
4
  export * from './user';
5
5
  export * from './department';
6
+ export * from './attention';
6
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -20,7 +20,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
20
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
21
  };
22
22
  Object.defineProperty(exports, "__esModule", { value: true });
23
- exports.SEARCH_BUSINESSES = exports.GET_BUSINESSES = exports.GET_USERS_LIGHT = exports.GET_USERS = exports.useSearchBusinesses = exports.useGetBusinesses = exports.useGetUsersLight = exports.useGetUsers = exports.createMakanaClient = void 0;
23
+ exports.GET_ATTENTIONS_LIGHT = exports.GET_ATTENTIONS = exports.SEARCH_BUSINESSES = exports.GET_BUSINESSES = exports.GET_USERS_LIGHT = exports.GET_USERS = exports.useGetAttentionsLight = exports.useGetAttentions = exports.useSearchBusinesses = exports.useGetBusinesses = exports.useGetUsersLight = exports.useGetUsers = exports.createMakanaClient = void 0;
24
24
  // Client setup
25
25
  var apollo_client_1 = require("./client/apollo-client");
26
26
  Object.defineProperty(exports, "createMakanaClient", { enumerable: true, get: function () { return apollo_client_1.createMakanaClient; } });
@@ -33,6 +33,10 @@ var businesses_1 = require("./queries/businesses");
33
33
  Object.defineProperty(exports, "useGetBusinesses", { enumerable: true, get: function () { return businesses_1.useGetBusinesses; } });
34
34
  var searchBusinesses_1 = require("./queries/searchBusinesses");
35
35
  Object.defineProperty(exports, "useSearchBusinesses", { enumerable: true, get: function () { return searchBusinesses_1.useSearchBusinesses; } });
36
+ var attentions_1 = require("./queries/attentions");
37
+ Object.defineProperty(exports, "useGetAttentions", { enumerable: true, get: function () { return attentions_1.useGetAttentions; } });
38
+ var attentionsLight_1 = require("./queries/attentionsLight");
39
+ Object.defineProperty(exports, "useGetAttentionsLight", { enumerable: true, get: function () { return attentionsLight_1.useGetAttentionsLight; } });
36
40
  // GraphQL queries (for advanced usage)
37
41
  var users_2 = require("./queries/users");
38
42
  Object.defineProperty(exports, "GET_USERS", { enumerable: true, get: function () { return users_2.GET_USERS; } });
@@ -42,6 +46,10 @@ var businesses_2 = require("./queries/businesses");
42
46
  Object.defineProperty(exports, "GET_BUSINESSES", { enumerable: true, get: function () { return businesses_2.GET_BUSINESSES; } });
43
47
  var searchBusinesses_2 = require("./queries/searchBusinesses");
44
48
  Object.defineProperty(exports, "SEARCH_BUSINESSES", { enumerable: true, get: function () { return searchBusinesses_2.SEARCH_BUSINESSES; } });
49
+ var attentions_2 = require("./queries/attentions");
50
+ Object.defineProperty(exports, "GET_ATTENTIONS", { enumerable: true, get: function () { return attentions_2.GET_ATTENTIONS; } });
51
+ var attentionsLight_2 = require("./queries/attentionsLight");
52
+ Object.defineProperty(exports, "GET_ATTENTIONS_LIGHT", { enumerable: true, get: function () { return attentionsLight_2.GET_ATTENTIONS_LIGHT; } });
45
53
  // Types
46
54
  __exportStar(require("./types"), exports);
47
55
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,eAAe;AACf,wDAA4D;AAAnD,mHAAA,kBAAkB,OAAA;AAG3B,cAAc;AACd,yCAA8C;AAArC,oGAAA,WAAW,OAAA;AAGpB,mDAAwD;AAA/C,8GAAA,gBAAgB,OAAA;AAGzB,mDAAwD;AAA/C,8GAAA,gBAAgB,OAAA;AAGzB,+DAAiE;AAAxD,uHAAA,mBAAmB,OAAA;AAG5B,uCAAuC;AACvC,yCAA4C;AAAnC,kGAAA,SAAS,OAAA;AAClB,mDAAuD;AAA9C,6GAAA,eAAe,OAAA;AACxB,mDAAsD;AAA7C,4GAAA,cAAc,OAAA;AACvB,+DAA+D;AAAtD,qHAAA,iBAAiB,OAAA;AAE1B,QAAQ;AACR,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;AAEH,eAAe;AACf,wDAA4D;AAAnD,mHAAA,kBAAkB,OAAA;AAG3B,cAAc;AACd,yCAA8C;AAArC,oGAAA,WAAW,OAAA;AAGpB,mDAAwD;AAA/C,8GAAA,gBAAgB,OAAA;AAGzB,mDAAwD;AAA/C,8GAAA,gBAAgB,OAAA;AAGzB,+DAAiE;AAAxD,uHAAA,mBAAmB,OAAA;AAG5B,mDAAwD;AAA/C,8GAAA,gBAAgB,OAAA;AAGzB,6DAAkE;AAAzD,wHAAA,qBAAqB,OAAA;AAG9B,uCAAuC;AACvC,yCAA4C;AAAnC,kGAAA,SAAS,OAAA;AAClB,mDAAuD;AAA9C,6GAAA,eAAe,OAAA;AACxB,mDAAsD;AAA7C,4GAAA,cAAc,OAAA;AACvB,+DAA+D;AAAtD,qHAAA,iBAAiB,OAAA;AAC1B,mDAAsD;AAA7C,4GAAA,cAAc,OAAA;AACvB,6DAAiE;AAAxD,uHAAA,oBAAoB,OAAA;AAE7B,QAAQ;AACR,0CAAwB"}
@@ -0,0 +1,60 @@
1
+ import { QueryHookOptions } from '@apollo/client';
2
+ import { Attention } from '../types/attention';
3
+ import { FilterInput, SortInput, DateEnum, Connection } from '../types/common';
4
+ export declare const GET_ATTENTIONS: import("@apollo/client").DocumentNode;
5
+ export interface FetchAttentionsVariables {
6
+ date?: DateEnum;
7
+ filters?: FilterInput;
8
+ sort?: SortInput;
9
+ first?: number;
10
+ last?: number;
11
+ after?: string | null;
12
+ before?: string | null;
13
+ skip?: boolean;
14
+ }
15
+ export interface FetchAttentionsResponse {
16
+ fetchAttentions: Connection<Attention>;
17
+ }
18
+ /**
19
+ * React hook to fetch attentions from Makana GraphQL API
20
+ *
21
+ * @param variables - Query variables (filters, pagination, date, etc.)
22
+ * @param options - Additional Apollo Client query options
23
+ * @returns Object containing attentions data, loading state, error, and refetch function
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * // Filter by date enum
28
+ * const { attentions, loading } = useGetAttentions({
29
+ * date: 'CURRENT_MONTH',
30
+ * filters: { businessId: '123' },
31
+ * first: 10
32
+ * });
33
+ *
34
+ * // Filter by date range
35
+ * const { attentions } = useGetAttentions({
36
+ * filters: {
37
+ * businessId: '123',
38
+ * dateRange: {
39
+ * startDate: '2024-01-01',
40
+ * endDate: '2024-12-31'
41
+ * }
42
+ * }
43
+ * });
44
+ * ```
45
+ */
46
+ export declare function useGetAttentions(variables?: FetchAttentionsVariables, options?: Omit<QueryHookOptions<FetchAttentionsResponse, FetchAttentionsVariables>, 'variables'>): {
47
+ attentions: Attention[];
48
+ totalCount: number;
49
+ pageInfo: import("../types/common").PageInfo | null;
50
+ loading: boolean;
51
+ error: import("@apollo/client").ApolloError | undefined;
52
+ fetchMore: <TFetchData = FetchAttentionsResponse, TFetchVars extends import("@apollo/client").OperationVariables = FetchAttentionsVariables>(fetchMoreOptions: import("@apollo/client").FetchMoreQueryOptions<TFetchVars, TFetchData> & {
53
+ updateQuery?: ((previousQueryResult: FetchAttentionsResponse, options: {
54
+ fetchMoreResult: import("@apollo/client").Unmasked<TFetchData>;
55
+ variables: TFetchVars;
56
+ }) => FetchAttentionsResponse) | undefined;
57
+ }) => Promise<import("@apollo/client").ApolloQueryResult<TFetchData>>;
58
+ refetch: (variables?: Partial<FetchAttentionsVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<FetchAttentionsResponse>>;
59
+ };
60
+ //# sourceMappingURL=attentions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentions.d.ts","sourceRoot":"","sources":["../../src/queries/attentions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE/E,eAAO,MAAM,cAAc,uCA8D1B,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,uBAAuB;IACtC,eAAe,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,gBAAgB,CAC9B,SAAS,GAAE,wBAA6B,EACxC,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,CAAC,uBAAuB,EAAE,wBAAwB,CAAC,EAAE,WAAW,CAAC;;;;;;;;;;;;;EA2BjG"}
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_ATTENTIONS = void 0;
4
+ exports.useGetAttentions = useGetAttentions;
5
+ const client_1 = require("@apollo/client");
6
+ exports.GET_ATTENTIONS = (0, client_1.gql) `
7
+ query FetchAttentions(
8
+ $date: DateEnum
9
+ $filters: FilterInput
10
+ $sort: SortInput
11
+ $first: Int
12
+ $last: Int
13
+ $after: String
14
+ $before: String
15
+ ) {
16
+ fetchAttentions(
17
+ date: $date
18
+ filters: $filters
19
+ sort: $sort
20
+ first: $first
21
+ last: $last
22
+ after: $after
23
+ before: $before
24
+ ) {
25
+ totalCount
26
+ edges {
27
+ node {
28
+ id
29
+ protocol
30
+ registerInMetrics
31
+ registerOutMetrics
32
+ date
33
+ user {
34
+ id
35
+ name
36
+ firstName
37
+ lastName
38
+ rut
39
+ disease
40
+ currentPlan {
41
+ plan
42
+ stats
43
+ }
44
+ department {
45
+ id
46
+ name
47
+ colorTag
48
+ }
49
+ business {
50
+ id
51
+ name
52
+ parentGroup {
53
+ id
54
+ name
55
+ }
56
+ }
57
+ }
58
+ }
59
+ }
60
+ pageInfo {
61
+ hasNextPage
62
+ hasPreviousPage
63
+ startCursor
64
+ endCursor
65
+ }
66
+ }
67
+ }
68
+ `;
69
+ /**
70
+ * React hook to fetch attentions from Makana GraphQL API
71
+ *
72
+ * @param variables - Query variables (filters, pagination, date, etc.)
73
+ * @param options - Additional Apollo Client query options
74
+ * @returns Object containing attentions data, loading state, error, and refetch function
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * // Filter by date enum
79
+ * const { attentions, loading } = useGetAttentions({
80
+ * date: 'CURRENT_MONTH',
81
+ * filters: { businessId: '123' },
82
+ * first: 10
83
+ * });
84
+ *
85
+ * // Filter by date range
86
+ * const { attentions } = useGetAttentions({
87
+ * filters: {
88
+ * businessId: '123',
89
+ * dateRange: {
90
+ * startDate: '2024-01-01',
91
+ * endDate: '2024-12-31'
92
+ * }
93
+ * }
94
+ * });
95
+ * ```
96
+ */
97
+ function useGetAttentions(variables = {}, options) {
98
+ const { skip, ...queryVariables } = variables;
99
+ const { loading, error, data, fetchMore, refetch } = (0, client_1.useQuery)(exports.GET_ATTENTIONS, {
100
+ variables: queryVariables,
101
+ fetchPolicy: 'cache-first',
102
+ skip: skip === true,
103
+ ...options,
104
+ });
105
+ const attentions = data?.fetchAttentions?.edges.map((edge) => edge.node) || [];
106
+ const totalCount = data?.fetchAttentions?.totalCount || 0;
107
+ const pageInfo = data?.fetchAttentions?.pageInfo || null;
108
+ return {
109
+ attentions,
110
+ totalCount,
111
+ pageInfo,
112
+ loading,
113
+ error,
114
+ fetchMore,
115
+ refetch,
116
+ };
117
+ }
118
+ //# sourceMappingURL=attentions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentions.js","sourceRoot":"","sources":["../../src/queries/attentions.ts"],"names":[],"mappings":";;;AA+GA,4CA6BC;AA5ID,2CAAiE;AAIpD,QAAA,cAAc,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DhC,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,gBAAgB,CAC9B,YAAsC,EAAE,EACxC,OAAgG;IAEhG,MAAM,EAAE,IAAI,EAAE,GAAG,cAAc,EAAE,GAAG,SAAS,CAAC;IAE9C,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,IAAA,iBAAQ,EAC3D,sBAAc,EACd;QACE,SAAS,EAAE,cAAc;QACzB,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,IAAI,KAAK,IAAI;QACnB,GAAG,OAAO;KACX,CACF,CAAC;IAEF,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/E,MAAM,UAAU,GAAG,IAAI,EAAE,eAAe,EAAE,UAAU,IAAI,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,IAAI,EAAE,eAAe,EAAE,QAAQ,IAAI,IAAI,CAAC;IAEzD,OAAO;QACL,UAAU;QACV,UAAU;QACV,QAAQ;QACR,OAAO;QACP,KAAK;QACL,SAAS;QACT,OAAO;KACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,60 @@
1
+ import { QueryHookOptions } from '@apollo/client';
2
+ import { AttentionLight } from '../types/attention';
3
+ import { FilterInput, SortInput, DateEnum, Connection } from '../types/common';
4
+ export declare const GET_ATTENTIONS_LIGHT: import("@apollo/client").DocumentNode;
5
+ export interface FetchAttentionsLightVariables {
6
+ date?: DateEnum;
7
+ filters?: FilterInput;
8
+ sort?: SortInput;
9
+ first?: number;
10
+ last?: number;
11
+ after?: string | null;
12
+ before?: string | null;
13
+ skip?: boolean;
14
+ }
15
+ export interface FetchAttentionsLightResponse {
16
+ fetchAttentions: Connection<AttentionLight>;
17
+ }
18
+ /**
19
+ * React hook to fetch attentions with minimal data from Makana GraphQL API
20
+ * This is a lightweight query that only returns user id and business id
21
+ *
22
+ * @param variables - Query variables (filters, pagination, date, etc.)
23
+ * @param options - Additional Apollo Client query options
24
+ * @returns Object containing attentions data, loading state, error, and refetch function
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * // Filter by date enum
29
+ * const { attentions, loading } = useGetAttentionsLight({
30
+ * date: 'CURRENT_MONTH',
31
+ * first: 100
32
+ * });
33
+ *
34
+ * // Filter by date range
35
+ * const { attentions } = useGetAttentionsLight({
36
+ * filters: {
37
+ * businessId: '123',
38
+ * dateRange: {
39
+ * startDate: '2024-01-01',
40
+ * endDate: '2024-12-31'
41
+ * }
42
+ * }
43
+ * });
44
+ * ```
45
+ */
46
+ export declare function useGetAttentionsLight(variables?: FetchAttentionsLightVariables, options?: Omit<QueryHookOptions<FetchAttentionsLightResponse, FetchAttentionsLightVariables>, 'variables'>): {
47
+ attentions: AttentionLight[];
48
+ totalCount: number;
49
+ pageInfo: import("../types/common").PageInfo | null;
50
+ loading: boolean;
51
+ error: import("@apollo/client").ApolloError | undefined;
52
+ fetchMore: <TFetchData = FetchAttentionsLightResponse, TFetchVars extends import("@apollo/client").OperationVariables = FetchAttentionsLightVariables>(fetchMoreOptions: import("@apollo/client").FetchMoreQueryOptions<TFetchVars, TFetchData> & {
53
+ updateQuery?: ((previousQueryResult: FetchAttentionsLightResponse, options: {
54
+ fetchMoreResult: import("@apollo/client").Unmasked<TFetchData>;
55
+ variables: TFetchVars;
56
+ }) => FetchAttentionsLightResponse) | undefined;
57
+ }) => Promise<import("@apollo/client").ApolloQueryResult<TFetchData>>;
58
+ refetch: (variables?: Partial<FetchAttentionsLightVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<FetchAttentionsLightResponse>>;
59
+ };
60
+ //# sourceMappingURL=attentionsLight.d.ts.map