@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 @@
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,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GET_ATTENTIONS_LIGHT = void 0;
4
+ exports.useGetAttentionsLight = useGetAttentionsLight;
5
+ const client_1 = require("@apollo/client");
6
+ exports.GET_ATTENTIONS_LIGHT = (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
+ date
30
+ user {
31
+ id
32
+ business {
33
+ id
34
+ }
35
+ }
36
+ }
37
+ }
38
+ pageInfo {
39
+ hasNextPage
40
+ hasPreviousPage
41
+ startCursor
42
+ endCursor
43
+ }
44
+ }
45
+ }
46
+ `;
47
+ /**
48
+ * React hook to fetch attentions with minimal data from Makana GraphQL API
49
+ * This is a lightweight query that only returns user id and business id
50
+ *
51
+ * @param variables - Query variables (filters, pagination, date, etc.)
52
+ * @param options - Additional Apollo Client query options
53
+ * @returns Object containing attentions data, loading state, error, and refetch function
54
+ *
55
+ * @example
56
+ * ```typescript
57
+ * // Filter by date enum
58
+ * const { attentions, loading } = useGetAttentionsLight({
59
+ * date: 'CURRENT_MONTH',
60
+ * first: 100
61
+ * });
62
+ *
63
+ * // Filter by date range
64
+ * const { attentions } = useGetAttentionsLight({
65
+ * filters: {
66
+ * businessId: '123',
67
+ * dateRange: {
68
+ * startDate: '2024-01-01',
69
+ * endDate: '2024-12-31'
70
+ * }
71
+ * }
72
+ * });
73
+ * ```
74
+ */
75
+ function useGetAttentionsLight(variables = {}, options) {
76
+ const { skip, ...queryVariables } = variables;
77
+ const { loading, error, data, fetchMore, refetch } = (0, client_1.useQuery)(exports.GET_ATTENTIONS_LIGHT, {
78
+ variables: queryVariables,
79
+ fetchPolicy: 'cache-first',
80
+ skip: skip === true,
81
+ ...options,
82
+ });
83
+ const attentions = data?.fetchAttentions?.edges.map((edge) => edge.node) || [];
84
+ const totalCount = data?.fetchAttentions?.totalCount || 0;
85
+ const pageInfo = data?.fetchAttentions?.pageInfo || null;
86
+ return {
87
+ attentions,
88
+ totalCount,
89
+ pageInfo,
90
+ loading,
91
+ error,
92
+ fetchMore,
93
+ refetch,
94
+ };
95
+ }
96
+ //# sourceMappingURL=attentionsLight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attentionsLight.js","sourceRoot":"","sources":["../../src/queries/attentionsLight.ts"],"names":[],"mappings":";;;AAyFA,sDA6BC;AAtHD,2CAAiE;AAIpD,QAAA,oBAAoB,GAAG,IAAA,YAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCtC,CAAC;AAiBF;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,SAAgB,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,IAAA,iBAAQ,EAC3D,4BAAoB,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"}
@@ -18,4 +18,6 @@ __exportStar(require("./users"), exports);
18
18
  __exportStar(require("./usersLight"), exports);
19
19
  __exportStar(require("./businesses"), exports);
20
20
  __exportStar(require("./searchBusinesses"), exports);
21
+ __exportStar(require("./attentions"), exports);
22
+ __exportStar(require("./attentionsLight"), exports);
21
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B;AAC7B,+CAA6B;AAC7B,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/queries/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AACxB,+CAA6B;AAC7B,+CAA6B;AAC7B,qDAAmC;AACnC,+CAA6B;AAC7B,oDAAkC"}
@@ -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,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# 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"}
@@ -19,4 +19,5 @@ __exportStar(require("./business"), exports);
19
19
  __exportStar(require("./group"), exports);
20
20
  __exportStar(require("./user"), exports);
21
21
  __exportStar(require("./department"), exports);
22
+ __exportStar(require("./attention"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,yCAAuB;AACvB,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6CAA2B;AAC3B,0CAAwB;AACxB,yCAAuB;AACvB,+CAA6B;AAC7B,8CAA4B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makana-cl/portal-internal-client",
3
- "version": "1.2.3",
3
+ "version": "1.3.0",
4
4
  "description": "GraphQL client library for Makana Portal internal applications",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",