@amigo-ai/platform-sdk 0.26.0 → 0.27.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 (101) hide show
  1. package/README.md +62 -0
  2. package/api.md +166 -0
  3. package/dist/index.cjs +1063 -0
  4. package/dist/index.cjs.map +4 -4
  5. package/dist/index.js +68 -0
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +1063 -0
  8. package/dist/index.mjs.map +4 -4
  9. package/dist/resources/analytics.js +20 -0
  10. package/dist/resources/analytics.js.map +1 -1
  11. package/dist/resources/briefs.js +34 -0
  12. package/dist/resources/briefs.js.map +1 -0
  13. package/dist/resources/calls.js +22 -0
  14. package/dist/resources/calls.js.map +1 -1
  15. package/dist/resources/command-center.js +17 -0
  16. package/dist/resources/command-center.js.map +1 -0
  17. package/dist/resources/crm.js +52 -0
  18. package/dist/resources/crm.js.map +1 -0
  19. package/dist/resources/data-query.js +22 -0
  20. package/dist/resources/data-query.js.map +1 -0
  21. package/dist/resources/desktop-sessions.js +43 -0
  22. package/dist/resources/desktop-sessions.js.map +1 -0
  23. package/dist/resources/fhir.js +130 -0
  24. package/dist/resources/fhir.js.map +1 -0
  25. package/dist/resources/insights.js +53 -0
  26. package/dist/resources/insights.js.map +1 -0
  27. package/dist/resources/intake.js +42 -0
  28. package/dist/resources/intake.js.map +1 -0
  29. package/dist/resources/monitor-concepts.js +47 -0
  30. package/dist/resources/monitor-concepts.js.map +1 -0
  31. package/dist/resources/network.js +17 -0
  32. package/dist/resources/network.js.map +1 -0
  33. package/dist/resources/pipeline.js +69 -0
  34. package/dist/resources/pipeline.js.map +1 -0
  35. package/dist/resources/sensorium.js +25 -0
  36. package/dist/resources/sensorium.js.map +1 -0
  37. package/dist/resources/sessions.js +29 -0
  38. package/dist/resources/sessions.js.map +1 -0
  39. package/dist/resources/settings.js +17 -0
  40. package/dist/resources/settings.js.map +1 -1
  41. package/dist/resources/simulations.js +75 -0
  42. package/dist/resources/simulations.js.map +1 -1
  43. package/dist/resources/surfaces.js +85 -0
  44. package/dist/resources/surfaces.js.map +1 -0
  45. package/dist/resources/tasks.js +23 -0
  46. package/dist/resources/tasks.js.map +1 -0
  47. package/dist/resources/tools.js +24 -0
  48. package/dist/resources/tools.js.map +1 -0
  49. package/dist/resources/unification-rules.js +46 -0
  50. package/dist/resources/unification-rules.js.map +1 -0
  51. package/dist/resources/workspaces.js +25 -0
  52. package/dist/resources/workspaces.js.map +1 -1
  53. package/dist/types/index.d.cts +51 -0
  54. package/dist/types/index.d.cts.map +1 -1
  55. package/dist/types/index.d.ts +51 -0
  56. package/dist/types/index.d.ts.map +1 -1
  57. package/dist/types/resources/analytics.d.ts +26 -0
  58. package/dist/types/resources/analytics.d.ts.map +1 -1
  59. package/dist/types/resources/briefs.d.ts +79 -0
  60. package/dist/types/resources/briefs.d.ts.map +1 -0
  61. package/dist/types/resources/calls.d.ts +77 -0
  62. package/dist/types/resources/calls.d.ts.map +1 -1
  63. package/dist/types/resources/command-center.d.ts +55 -0
  64. package/dist/types/resources/command-center.d.ts.map +1 -0
  65. package/dist/types/resources/crm.d.ts +207 -0
  66. package/dist/types/resources/crm.d.ts.map +1 -0
  67. package/dist/types/resources/data-query.d.ts +23 -0
  68. package/dist/types/resources/data-query.d.ts.map +1 -0
  69. package/dist/types/resources/desktop-sessions.d.ts +38 -0
  70. package/dist/types/resources/desktop-sessions.d.ts.map +1 -0
  71. package/dist/types/resources/fhir.d.ts +350 -0
  72. package/dist/types/resources/fhir.d.ts.map +1 -0
  73. package/dist/types/resources/insights.d.ts +56 -0
  74. package/dist/types/resources/insights.d.ts.map +1 -0
  75. package/dist/types/resources/intake.d.ts +59 -0
  76. package/dist/types/resources/intake.d.ts.map +1 -0
  77. package/dist/types/resources/monitor-concepts.d.ts +115 -0
  78. package/dist/types/resources/monitor-concepts.d.ts.map +1 -0
  79. package/dist/types/resources/network.d.ts +17 -0
  80. package/dist/types/resources/network.d.ts.map +1 -0
  81. package/dist/types/resources/pipeline.d.ts +183 -0
  82. package/dist/types/resources/pipeline.d.ts.map +1 -0
  83. package/dist/types/resources/sensorium.d.ts +40 -0
  84. package/dist/types/resources/sensorium.d.ts.map +1 -0
  85. package/dist/types/resources/sessions.d.ts +33 -0
  86. package/dist/types/resources/sessions.d.ts.map +1 -0
  87. package/dist/types/resources/settings.d.ts +16 -0
  88. package/dist/types/resources/settings.d.ts.map +1 -1
  89. package/dist/types/resources/simulations.d.ts +186 -3
  90. package/dist/types/resources/simulations.d.ts.map +1 -1
  91. package/dist/types/resources/surfaces.d.ts +240 -0
  92. package/dist/types/resources/surfaces.d.ts.map +1 -0
  93. package/dist/types/resources/tasks.d.ts +55 -0
  94. package/dist/types/resources/tasks.d.ts.map +1 -0
  95. package/dist/types/resources/tools.d.ts +53 -0
  96. package/dist/types/resources/tools.d.ts.map +1 -0
  97. package/dist/types/resources/unification-rules.d.ts +129 -0
  98. package/dist/types/resources/unification-rules.d.ts.map +1 -0
  99. package/dist/types/resources/workspaces.d.ts +24 -0
  100. package/dist/types/resources/workspaces.d.ts.map +1 -1
  101. package/package.json +1 -1
@@ -0,0 +1,207 @@
1
+ import type { paths } from '../generated/api.js';
2
+ import { WorkspaceScopedResource } from './base.js';
3
+ export type CrmContactSearchParams = NonNullable<paths['/v1/{workspace_id}/crm/contacts']['get']['parameters']['query']>;
4
+ export type CrmCompanySearchParams = NonNullable<paths['/v1/{workspace_id}/crm/companies']['get']['parameters']['query']>;
5
+ export type CrmDealSearchParams = NonNullable<paths['/v1/{workspace_id}/crm/deals']['get']['parameters']['query']>;
6
+ /**
7
+ * CRM — read-mostly view of contacts, companies, deals, and pipeline state
8
+ * sourced from the connected CRM integration (HubSpot/Salesforce/etc.).
9
+ *
10
+ * The platform refreshes this view in the background; the SDK exposes search
11
+ * + detail endpoints plus a per-contact activity timeline. Writes happen
12
+ * upstream in the CRM itself, not here.
13
+ *
14
+ * @beta New in this release; surface may evolve.
15
+ */
16
+ export declare class CrmResource extends WorkspaceScopedResource {
17
+ /** Health/status of the workspace's CRM integration sync */
18
+ getStatus(): Promise<{
19
+ company_count?: number | undefined;
20
+ configured: boolean;
21
+ connector_type?: string | null | undefined;
22
+ contact_count?: number | undefined;
23
+ data_source_id?: string | null | undefined;
24
+ deal_count?: number | undefined;
25
+ last_sync_at?: string | null | undefined;
26
+ last_sync_status?: ("success" | "error") | null | undefined;
27
+ sync_failure_count?: number | undefined;
28
+ sync_healthy?: boolean | null | undefined;
29
+ } & import("../index.js").ResponseMetadata>;
30
+ readonly contacts: {
31
+ list: (params?: CrmContactSearchParams) => Promise<{
32
+ contacts: {
33
+ address?: {
34
+ [x: string]: unknown;
35
+ } | null | undefined;
36
+ birth_date?: string | null | undefined;
37
+ company?: string | null | undefined;
38
+ confidence?: number | undefined;
39
+ created_at?: string | null | undefined;
40
+ email?: string | null | undefined;
41
+ entity_id: string;
42
+ event_count?: number | undefined;
43
+ first_name?: string | null | undefined;
44
+ gender?: string | null | undefined;
45
+ hubspot_id?: string | null | undefined;
46
+ last_activity_at?: string | null | undefined;
47
+ last_name?: string | null | undefined;
48
+ lifecycle_stage?: string | null | undefined;
49
+ mrn?: string | null | undefined;
50
+ name?: string | null | undefined;
51
+ phone?: string | null | undefined;
52
+ source_system?: string | null | undefined;
53
+ }[];
54
+ has_more?: boolean | undefined;
55
+ next_offset?: number | null | undefined;
56
+ total: number;
57
+ } & import("../index.js").ResponseMetadata>;
58
+ get: (contactId: string) => Promise<{
59
+ address?: {
60
+ [x: string]: unknown;
61
+ } | null | undefined;
62
+ birth_date?: string | null | undefined;
63
+ canonical_id?: string | null | undefined;
64
+ clinical?: {
65
+ [x: string]: unknown;
66
+ } | undefined;
67
+ company?: string | null | undefined;
68
+ confidence?: number | undefined;
69
+ created_at?: string | null | undefined;
70
+ email?: string | null | undefined;
71
+ entity_id: string;
72
+ event_count?: number | undefined;
73
+ external_ids?: {
74
+ [x: string]: unknown;
75
+ } | undefined;
76
+ first_name?: string | null | undefined;
77
+ gender?: string | null | undefined;
78
+ hubspot_id?: string | null | undefined;
79
+ last_activity_at?: string | null | undefined;
80
+ last_name?: string | null | undefined;
81
+ lifecycle_stage?: string | null | undefined;
82
+ merged_with?: {
83
+ address?: {
84
+ [x: string]: unknown;
85
+ } | null | undefined;
86
+ birth_date?: string | null | undefined;
87
+ company?: string | null | undefined;
88
+ confidence?: number | undefined;
89
+ created_at?: string | null | undefined;
90
+ email?: string | null | undefined;
91
+ entity_id: string;
92
+ event_count?: number | undefined;
93
+ first_name?: string | null | undefined;
94
+ gender?: string | null | undefined;
95
+ hubspot_id?: string | null | undefined;
96
+ last_activity_at?: string | null | undefined;
97
+ last_name?: string | null | undefined;
98
+ lifecycle_stage?: string | null | undefined;
99
+ mrn?: string | null | undefined;
100
+ name?: string | null | undefined;
101
+ phone?: string | null | undefined;
102
+ source_system?: string | null | undefined;
103
+ }[] | undefined;
104
+ mrn?: string | null | undefined;
105
+ name?: string | null | undefined;
106
+ operational?: {
107
+ [x: string]: unknown;
108
+ } | undefined;
109
+ phone?: string | null | undefined;
110
+ source_system?: string | null | undefined;
111
+ } & import("../index.js").ResponseMetadata>;
112
+ /** Per-contact activity timeline (calls, emails, deal events) */
113
+ getTimeline: (contactId: string) => Promise<{
114
+ activities: {
115
+ activity_type: string;
116
+ confidence?: number | undefined;
117
+ data?: {
118
+ [x: string]: unknown;
119
+ } | undefined;
120
+ description?: string | null | undefined;
121
+ direction?: string | null | undefined;
122
+ id: string;
123
+ occurred_at?: string | null | undefined;
124
+ source?: string | undefined;
125
+ source_system?: string | null | undefined;
126
+ }[];
127
+ entity_id: string;
128
+ has_more?: boolean | undefined;
129
+ total: number;
130
+ } & import("../index.js").ResponseMetadata>;
131
+ };
132
+ readonly companies: {
133
+ list: (params?: CrmCompanySearchParams) => Promise<{
134
+ companies: {
135
+ address?: {
136
+ [x: string]: unknown;
137
+ } | null | undefined;
138
+ created_at?: string | null | undefined;
139
+ domain?: string | null | undefined;
140
+ entity_id: string;
141
+ event_count?: number | undefined;
142
+ hubspot_id?: string | null | undefined;
143
+ industry?: string | null | undefined;
144
+ last_activity_at?: string | null | undefined;
145
+ name?: string | null | undefined;
146
+ phone?: string | null | undefined;
147
+ source_system?: string | null | undefined;
148
+ }[];
149
+ has_more?: boolean | undefined;
150
+ next_offset?: number | null | undefined;
151
+ total: number;
152
+ } & import("../index.js").ResponseMetadata>;
153
+ get: (companyId: string) => Promise<{
154
+ address?: {
155
+ [x: string]: unknown;
156
+ } | null | undefined;
157
+ created_at?: string | null | undefined;
158
+ domain?: string | null | undefined;
159
+ entity_id: string;
160
+ event_count?: number | undefined;
161
+ hubspot_id?: string | null | undefined;
162
+ industry?: string | null | undefined;
163
+ last_activity_at?: string | null | undefined;
164
+ name?: string | null | undefined;
165
+ phone?: string | null | undefined;
166
+ source_system?: string | null | undefined;
167
+ } & import("../index.js").ResponseMetadata>;
168
+ };
169
+ readonly deals: {
170
+ list: (params?: CrmDealSearchParams) => Promise<{
171
+ deals: {
172
+ amount?: number | null | undefined;
173
+ close_date?: string | null | undefined;
174
+ created_at?: string | null | undefined;
175
+ deal_type?: string | null | undefined;
176
+ entity_id: string;
177
+ event_count?: number | undefined;
178
+ hubspot_id?: string | null | undefined;
179
+ last_activity_at?: string | null | undefined;
180
+ name?: string | null | undefined;
181
+ pipeline?: string | null | undefined;
182
+ stage?: string | null | undefined;
183
+ }[];
184
+ has_more?: boolean | undefined;
185
+ next_offset?: number | null | undefined;
186
+ total: number;
187
+ } & import("../index.js").ResponseMetadata>;
188
+ get: (dealId: string) => Promise<{
189
+ amount?: number | null | undefined;
190
+ close_date?: string | null | undefined;
191
+ created_at?: string | null | undefined;
192
+ deal_type?: string | null | undefined;
193
+ entity_id: string;
194
+ event_count?: number | undefined;
195
+ hubspot_id?: string | null | undefined;
196
+ last_activity_at?: string | null | undefined;
197
+ name?: string | null | undefined;
198
+ pipeline?: string | null | undefined;
199
+ stage?: string | null | undefined;
200
+ } & import("../index.js").ResponseMetadata>;
201
+ /** Aggregated pipeline view: deals grouped by stage with rolled-up totals */
202
+ getPipeline: () => Promise<{
203
+ [x: string]: unknown;
204
+ } & import("../index.js").ResponseMetadata>;
205
+ };
206
+ }
207
+ //# sourceMappingURL=crm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/resources/crm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAEhE,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC9C,KAAK,CAAC,iCAAiC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACvE,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAC9C,KAAK,CAAC,kCAAkC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACxE,CAAA;AACD,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAC3C,KAAK,CAAC,8BAA8B,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACpE,CAAA;AAED;;;;;;;;;GASG;AACH,qBAAa,WAAY,SAAQ,uBAAuB;IACtD,4DAA4D;IACtD,SAAS;;;;;;;;;;;;IAQf,QAAQ,CAAC,QAAQ;wBACO,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAOrB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAO7B,iEAAiE;iCAClC,MAAM;;;;;;;;;;;;;;;;;;MAMtC;IAED,QAAQ,CAAC,SAAS;wBACM,sBAAsB;;;;;;;;;;;;;;;;;;;;yBAOrB,MAAM;;;;;;;;;;;;;;;MAM9B;IAED,QAAQ,CAAC,KAAK;wBACU,mBAAmB;;;;;;;;;;;;;;;;;;sBAOrB,MAAM;;;;;;;;;;;;;QAO1B,6EAA6E;;;;MAO9E;CACF"}
@@ -0,0 +1,23 @@
1
+ import type { paths } from '../generated/api.js';
2
+ import { WorkspaceScopedResource } from './base.js';
3
+ export type DataQueryParams = NonNullable<paths['/v1/{workspace_id}/query/{schema}/{table}']['get']['parameters']['query']>;
4
+ /**
5
+ * Generic typed data query — read rows from any whitelisted schema/table the
6
+ * workspace exposes. Backed by the platform's catalog of analytics-grade
7
+ * datasets; the schema and table are validated server-side.
8
+ *
9
+ * Used by the developer console's data-explorer surface.
10
+ *
11
+ * @beta New in this release; surface may evolve.
12
+ */
13
+ export declare class DataQueryResource extends WorkspaceScopedResource {
14
+ /** Run a tabular query against a workspace dataset */
15
+ run(schema: string, table: string, params?: DataQueryParams): Promise<{
16
+ count: number;
17
+ has_more: boolean;
18
+ items: {
19
+ [x: string]: unknown;
20
+ }[];
21
+ } & import("../index.js").ResponseMetadata>;
22
+ }
23
+ //# sourceMappingURL=data-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-query.d.ts","sourceRoot":"","sources":["../../../src/resources/data-query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAEhE,MAAM,MAAM,eAAe,GAAG,WAAW,CACvC,KAAK,CAAC,2CAA2C,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CACjF,CAAA;AAED;;;;;;;;GAQG;AACH,qBAAa,iBAAkB,SAAQ,uBAAuB;IAC5D,sDAAsD;IAChD,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,eAAe;;;;;;;CAUlE"}
@@ -0,0 +1,38 @@
1
+ import type { components } from '../generated/api.js';
2
+ import { WorkspaceScopedResource } from './base.js';
3
+ type CreateDesktopSessionRequest = components['schemas']['src__routes__desktop_sessions__CreateSessionRequest'];
4
+ /**
5
+ * Desktop sessions — remote-controlled desktop instances the agent can use
6
+ * to drive third-party apps (EHRs, CRMs) that lack APIs. Created on demand
7
+ * and torn down when the agent finishes the workflow.
8
+ *
9
+ * @beta New in this release; surface may evolve.
10
+ */
11
+ export declare class DesktopSessionsResource extends WorkspaceScopedResource {
12
+ /** Spin up a new desktop session */
13
+ create(body: CreateDesktopSessionRequest): Promise<{
14
+ connected: boolean;
15
+ display_size: number[];
16
+ session_id: string;
17
+ } & import("../index.js").ResponseMetadata>;
18
+ /** Disconnect / tear down a desktop session */
19
+ disconnect(sessionId: string): Promise<{
20
+ ok: boolean;
21
+ } & import("../index.js").ResponseMetadata>;
22
+ /** Drive a click / type / scroll action against the session */
23
+ sendAction(sessionId: string, body: components['schemas']['ActionRequest']): Promise<{
24
+ ok: boolean;
25
+ } & import("../index.js").ResponseMetadata>;
26
+ /** Get the latest screenshot for a session */
27
+ getScreenshot(sessionId: string): Promise<unknown>;
28
+ /** Get the session's current connection + activity status */
29
+ getStatus(sessionId: string): Promise<{
30
+ connected: boolean;
31
+ created_at: number;
32
+ healthy: boolean;
33
+ idle_seconds: number;
34
+ session_id: string;
35
+ } & import("../index.js").ResponseMetadata>;
36
+ }
37
+ export {};
38
+ //# sourceMappingURL=desktop-sessions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"desktop-sessions.d.ts","sourceRoot":"","sources":["../../../src/resources/desktop-sessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAUhE,KAAK,2BAA2B,GAC9B,UAAU,CAAC,SAAS,CAAC,CAAC,qDAAqD,CAAC,CAAA;AAE9E;;;;;;GAMG;AACH,qBAAa,uBAAwB,SAAQ,uBAAuB;IAClE,oCAAoC;IAC9B,MAAM,CAAC,IAAI,EAAE,2BAA2B;;;;;IAS9C,+CAA+C;IACzC,UAAU,CAAC,SAAS,EAAE,MAAM;;;IAQlC,+DAA+D;IACzD,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,eAAe,CAAC;;;IAShF,8CAA8C;IACxC,aAAa,CAAC,SAAS,EAAE,MAAM;IAQrC,6DAA6D;IACvD,SAAS,CAAC,SAAS,EAAE,MAAM;;;;;;;CAOlC"}
@@ -0,0 +1,350 @@
1
+ import type { components, paths } from '../generated/api.js';
2
+ import { WorkspaceScopedResource } from './base.js';
3
+ type Q<P extends keyof paths> = NonNullable<paths[P] extends {
4
+ get: {
5
+ parameters: {
6
+ query?: infer Query;
7
+ };
8
+ };
9
+ } ? Query : never>;
10
+ export type PatientSearchParams = Q<'/v1/{workspace_id}/fhir/patients'>;
11
+ /** Spec-defined query params for `/fhir/resources/{resource_type}` (FHIR-style search). */
12
+ export type FhirSearchParams = Q<'/v1/{workspace_id}/fhir/resources/{resource_type}'>;
13
+ export type SyncFailuresParams = Q<'/v1/{workspace_id}/fhir/sync-failures'>;
14
+ export type FhirPatientsViewParams = Q<'/v1/{workspace_id}/fhir/views/patients'>;
15
+ export type FhirAppointmentsViewParams = Q<'/v1/{workspace_id}/fhir/views/appointments'>;
16
+ export type FhirPractitionersViewParams = Q<'/v1/{workspace_id}/fhir/views/practitioners'>;
17
+ export type FhirOrganizationsViewParams = Q<'/v1/{workspace_id}/fhir/views/organizations'>;
18
+ export type FhirLocationsViewParams = Q<'/v1/{workspace_id}/fhir/views/locations'>;
19
+ export type FhirSlotsViewParams = Q<'/v1/{workspace_id}/fhir/views/slots'>;
20
+ /**
21
+ * FHIR — healthcare data interop surface for connected EHR integrations.
22
+ *
23
+ * @beta New in this release; surface may evolve as the EHR adapters stabilize.
24
+ *
25
+ * Provides:
26
+ * - Sync status + failure visibility (`status`, `syncFailures`)
27
+ * - Bulk imports (`import`)
28
+ * - FHIR-shaped CRUD on resources (`resources.*`)
29
+ * - Patient-centric views (`patients`, `patientSummary`, `patientTimeline`)
30
+ * - Pre-aggregated typed views per resource type (`views.*`)
31
+ *
32
+ * All operations are workspace-scoped; the FHIR server identity is determined
33
+ * by the workspace's connected EHR integration.
34
+ */
35
+ export declare class FhirResource extends WorkspaceScopedResource {
36
+ /** Get current FHIR sync status (server identity, last sync, counts) */
37
+ getStatus(): Promise<{
38
+ configured: boolean;
39
+ connector_type?: string | null | undefined;
40
+ entity_count: number;
41
+ entity_type_counts?: {
42
+ [x: string]: number;
43
+ } | undefined;
44
+ event_count: number;
45
+ last_change_at?: string | null | undefined;
46
+ last_poll_at?: string | null | undefined;
47
+ resource_type_counts?: {
48
+ [x: string]: number;
49
+ } | undefined;
50
+ sync_failure_count?: number | undefined;
51
+ sync_healthy?: boolean | null | undefined;
52
+ } & import("../index.js").ResponseMetadata>;
53
+ /** List recent FHIR sync failures (for triage) */
54
+ getSyncFailures(params?: SyncFailuresParams): Promise<{
55
+ failures: {
56
+ created_at?: string | null | undefined;
57
+ data?: {
58
+ [x: string]: unknown;
59
+ } | undefined;
60
+ entity_id?: string | null | undefined;
61
+ event_id: string;
62
+ event_type: string;
63
+ fhir_resource_id?: string | null | undefined;
64
+ fhir_resource_type?: string | null | undefined;
65
+ sync_error: string;
66
+ synced_at?: string | null | undefined;
67
+ }[];
68
+ total: number;
69
+ } & import("../index.js").ResponseMetadata>;
70
+ /** Trigger a FHIR import (full or partial, depending on request) */
71
+ import(body: components['schemas']['FhirImportRequest']): Promise<{
72
+ entities_created: number;
73
+ entities_updated: number;
74
+ errors?: string[] | undefined;
75
+ events_created: number;
76
+ events_skipped?: number | undefined;
77
+ events_updated?: number | undefined;
78
+ } & import("../index.js").ResponseMetadata>;
79
+ /** Search patients by demographics or identifiers */
80
+ searchPatients(params?: PatientSearchParams): Promise<{
81
+ has_more?: boolean | undefined;
82
+ next_offset?: number | null | undefined;
83
+ patients: {
84
+ birth_date?: string | null | undefined;
85
+ email?: string | null | undefined;
86
+ entity_id: string;
87
+ event_count?: number | undefined;
88
+ gender?: string | null | undefined;
89
+ last_event_at?: string | null | undefined;
90
+ mrn?: string | null | undefined;
91
+ name?: string | null | undefined;
92
+ phone?: string | null | undefined;
93
+ }[];
94
+ total: number;
95
+ } & import("../index.js").ResponseMetadata>;
96
+ /** Get a patient summary (canonical demographics + active conditions/meds) */
97
+ getPatientSummary(patientId: string): Promise<{
98
+ birth_date?: string | null | undefined;
99
+ display_name: string | null;
100
+ email?: string | null | undefined;
101
+ entity_id: string;
102
+ entity_type: string;
103
+ event_count: number;
104
+ gender?: string | null | undefined;
105
+ last_event_at: string | null;
106
+ mrn?: string | null | undefined;
107
+ name?: string | null | undefined;
108
+ phone?: string | null | undefined;
109
+ state?: {
110
+ [x: string]: unknown;
111
+ } | undefined;
112
+ } & import("../index.js").ResponseMetadata>;
113
+ /** Get a patient's longitudinal clinical timeline */
114
+ getPatientTimeline(patientId: string): Promise<{
115
+ entity_id: string;
116
+ events: {
117
+ [x: string]: unknown;
118
+ }[];
119
+ total: number;
120
+ } & import("../index.js").ResponseMetadata>;
121
+ readonly resources: {
122
+ /** Search FHIR resources of a given type (passes search params through to FHIR) */
123
+ search: (resourceType: string, params?: FhirSearchParams) => Promise<{
124
+ entries: {
125
+ [x: string]: unknown;
126
+ }[];
127
+ next_url?: string | null | undefined;
128
+ resource_type: string;
129
+ total: number | null;
130
+ } & import("../index.js").ResponseMetadata>;
131
+ /** Create a FHIR resource of the given type */
132
+ create: (resourceType: string, body: components["schemas"]["FhirWriteRequest"]) => Promise<{
133
+ data: {
134
+ [x: string]: unknown;
135
+ };
136
+ entity_id?: string | null | undefined;
137
+ resource_id: string;
138
+ resource_type: string;
139
+ } & import("../index.js").ResponseMetadata>;
140
+ /** Get a single FHIR resource by type + id */
141
+ get: (resourceType: string, resourceId: string) => Promise<{
142
+ data: {
143
+ [x: string]: unknown;
144
+ };
145
+ entity_id?: string | null | undefined;
146
+ resource_id: string;
147
+ resource_type: string;
148
+ } & import("../index.js").ResponseMetadata>;
149
+ /** Update a FHIR resource by type + id */
150
+ update: (resourceType: string, resourceId: string, body: components["schemas"]["FhirWriteRequest"]) => Promise<{
151
+ data: {
152
+ [x: string]: unknown;
153
+ };
154
+ entity_id?: string | null | undefined;
155
+ resource_id: string;
156
+ resource_type: string;
157
+ } & import("../index.js").ResponseMetadata>;
158
+ /** Get the version history for a FHIR resource */
159
+ getHistory: (resourceType: string, resourceId: string) => Promise<{
160
+ entries: {
161
+ confidence?: number | null | undefined;
162
+ created_at?: string | null | undefined;
163
+ data?: {
164
+ [x: string]: unknown;
165
+ } | undefined;
166
+ data_source_id?: string | null | undefined;
167
+ effective_at?: string | null | undefined;
168
+ entity_id?: string | null | undefined;
169
+ event_id: string;
170
+ event_type: string;
171
+ fields_affected?: string[] | undefined;
172
+ is_current: boolean;
173
+ source?: string | null | undefined;
174
+ source_system?: string | null | undefined;
175
+ sync_error?: string | null | undefined;
176
+ synced_at?: string | null | undefined;
177
+ }[];
178
+ has_more?: boolean | undefined;
179
+ next_offset?: number | null | undefined;
180
+ resource_id: string;
181
+ resource_type: string;
182
+ total: number;
183
+ } & import("../index.js").ResponseMetadata>;
184
+ };
185
+ readonly views: {
186
+ /** List patients (typed view with computed display fields) */
187
+ patients: (params?: FhirPatientsViewParams) => Promise<{
188
+ has_more?: boolean | undefined;
189
+ next_offset?: number | null | undefined;
190
+ patients: {
191
+ active_conditions?: string[] | undefined;
192
+ active_medications?: string[] | undefined;
193
+ address?: {
194
+ [x: string]: unknown;
195
+ } | null | undefined;
196
+ address_city?: string | null | undefined;
197
+ address_postal_code?: string | null | undefined;
198
+ address_state?: string | null | undefined;
199
+ allergies?: string[] | undefined;
200
+ birth_date?: string | null | undefined;
201
+ canonical_id?: string | null | undefined;
202
+ confidence?: number | undefined;
203
+ created_at?: string | null | undefined;
204
+ email?: string | null | undefined;
205
+ entity_id: string;
206
+ event_count?: number | undefined;
207
+ first_name?: string | null | undefined;
208
+ gender?: string | null | undefined;
209
+ insurance?: {
210
+ [x: string]: unknown;
211
+ }[] | undefined;
212
+ last_event_at?: string | null | undefined;
213
+ last_name?: string | null | undefined;
214
+ member_id?: string | null | undefined;
215
+ mrn?: string | null | undefined;
216
+ name?: string | null | undefined;
217
+ phone?: string | null | undefined;
218
+ policyholder_dob?: string | null | undefined;
219
+ policyholder_name?: string | null | undefined;
220
+ policyholder_relationship?: string | null | undefined;
221
+ practice_payer_id?: string | null | undefined;
222
+ primary_payer_name?: string | null | undefined;
223
+ source_system?: string | null | undefined;
224
+ }[];
225
+ total: number;
226
+ } & import("../index.js").ResponseMetadata>;
227
+ /** List appointments */
228
+ appointments: (params?: FhirAppointmentsViewParams) => Promise<{
229
+ appointments: {
230
+ appointment_type?: string | null | undefined;
231
+ cancel_reason?: string | null | undefined;
232
+ canonical_id?: string | null | undefined;
233
+ duration_minutes?: number | null | undefined;
234
+ end?: string | null | undefined;
235
+ entity_id: string;
236
+ event_count?: number | undefined;
237
+ last_event_at?: string | null | undefined;
238
+ location_name?: string | null | undefined;
239
+ modality?: string | null | undefined;
240
+ patient_name?: string | null | undefined;
241
+ practitioner_name?: string | null | undefined;
242
+ reason?: string | null | undefined;
243
+ source_system?: string | null | undefined;
244
+ start?: string | null | undefined;
245
+ status?: string | null | undefined;
246
+ }[];
247
+ has_more?: boolean | undefined;
248
+ next_offset?: number | null | undefined;
249
+ total: number;
250
+ } & import("../index.js").ResponseMetadata>;
251
+ /** List practitioners */
252
+ practitioners: (params?: FhirPractitionersViewParams) => Promise<{
253
+ has_more?: boolean | undefined;
254
+ next_offset?: number | null | undefined;
255
+ practitioners: {
256
+ canonical_id?: string | null | undefined;
257
+ email?: string | null | undefined;
258
+ entity_id: string;
259
+ event_count?: number | undefined;
260
+ last_event_at?: string | null | undefined;
261
+ member_id?: string | null | undefined;
262
+ name?: string | null | undefined;
263
+ npi?: string | null | undefined;
264
+ phone?: string | null | undefined;
265
+ scheduling_eligible?: boolean | null | undefined;
266
+ source_system?: string | null | undefined;
267
+ specialty?: string | null | undefined;
268
+ }[];
269
+ total: number;
270
+ } & import("../index.js").ResponseMetadata>;
271
+ /** List organizations */
272
+ organizations: (params?: FhirOrganizationsViewParams) => Promise<{
273
+ has_more?: boolean | undefined;
274
+ next_offset?: number | null | undefined;
275
+ organizations: {
276
+ address?: {
277
+ [x: string]: unknown;
278
+ } | null | undefined;
279
+ canonical_id?: string | null | undefined;
280
+ domain?: string | null | undefined;
281
+ entity_id: string;
282
+ event_count?: number | undefined;
283
+ industry?: string | null | undefined;
284
+ last_event_at?: string | null | undefined;
285
+ name?: string | null | undefined;
286
+ phone?: string | null | undefined;
287
+ source_system?: string | null | undefined;
288
+ }[];
289
+ total: number;
290
+ } & import("../index.js").ResponseMetadata>;
291
+ /** List locations */
292
+ locations: (params?: FhirLocationsViewParams) => Promise<{
293
+ has_more?: boolean | undefined;
294
+ locations: {
295
+ address?: {
296
+ [x: string]: unknown;
297
+ } | null | undefined;
298
+ address_line?: string | null | undefined;
299
+ canonical_id?: string | null | undefined;
300
+ city?: string | null | undefined;
301
+ country?: string | null | undefined;
302
+ entity_id: string;
303
+ event_count?: number | undefined;
304
+ facility_id?: string | null | undefined;
305
+ hours?: {
306
+ [x: string]: unknown;
307
+ } | null | undefined;
308
+ last_event_at?: string | null | undefined;
309
+ latitude?: number | null | undefined;
310
+ longitude?: number | null | undefined;
311
+ name?: string | null | undefined;
312
+ phone?: string | null | undefined;
313
+ postal_code?: string | null | undefined;
314
+ source_system?: string | null | undefined;
315
+ state?: string | null | undefined;
316
+ timezone?: string | null | undefined;
317
+ }[];
318
+ next_offset?: number | null | undefined;
319
+ total: number;
320
+ } & import("../index.js").ResponseMetadata>;
321
+ /**
322
+ * List schedule slots — supports richer filtering than the other views
323
+ * (status, date window, provider, specialty, service_type, facility_id).
324
+ */
325
+ slots: (params?: FhirSlotsViewParams) => Promise<{
326
+ has_more?: boolean | undefined;
327
+ next_offset?: number | null | undefined;
328
+ slots: {
329
+ canonical_id?: string | null | undefined;
330
+ end?: string | null | undefined;
331
+ entity_id: string;
332
+ event_count?: number | undefined;
333
+ facility_id?: string | null | undefined;
334
+ last_event_at?: string | null | undefined;
335
+ provider_id?: string | null | undefined;
336
+ provider_name?: string | null | undefined;
337
+ schedule_ref?: string | null | undefined;
338
+ source_system?: string | null | undefined;
339
+ specialty?: string | null | undefined;
340
+ start?: string | null | undefined;
341
+ status?: string | null | undefined;
342
+ visit_type_ids?: string | null | undefined;
343
+ visit_type_names?: string | null | undefined;
344
+ }[];
345
+ total: number;
346
+ } & import("../index.js").ResponseMetadata>;
347
+ };
348
+ }
349
+ export {};
350
+ //# sourceMappingURL=fhir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fhir.d.ts","sourceRoot":"","sources":["../../../src/resources/fhir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,uBAAuB,EAAe,MAAM,WAAW,CAAA;AAEhE,KAAK,CAAC,CAAC,CAAC,SAAS,MAAM,KAAK,IAAI,WAAW,CACzC,KAAK,CAAC,CAAC,CAAC,SAAS;IAAE,GAAG,EAAE;QAAE,UAAU,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,KAAK,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,GAAG,KAAK,GAAG,KAAK,CAClF,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,kCAAkC,CAAC,CAAA;AACvE,2FAA2F;AAC3F,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,mDAAmD,CAAC,CAAA;AACrF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,uCAAuC,CAAC,CAAA;AAM3E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,wCAAwC,CAAC,CAAA;AAChF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,4CAA4C,CAAC,CAAA;AACxF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,6CAA6C,CAAC,CAAA;AAC1F,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,6CAA6C,CAAC,CAAA;AAC1F,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,yCAAyC,CAAC,CAAA;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,qCAAqC,CAAC,CAAA;AAE1E;;;;;;;;;;;;;;GAcG;AACH,qBAAa,YAAa,SAAQ,uBAAuB;IACvD,wEAAwE;IAClE,SAAS;;;;;;;;;;;;;;;;IAQf,kDAAkD;IAC5C,eAAe,CAAC,MAAM,CAAC,EAAE,kBAAkB;;;;;;;;;;;;;;;;IAQjD,oEAAoE;IAC9D,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,mBAAmB,CAAC;;;;;;;;IAS7D,qDAAqD;IAC/C,cAAc,CAAC,MAAM,CAAC,EAAE,mBAAmB;;;;;;;;;;;;;;;;IAQjD,8EAA8E;IACxE,iBAAiB,CAAC,SAAS,EAAE,MAAM;;;;;;;;;;;;;;;;IAQzC,qDAAqD;IAC/C,kBAAkB,CAAC,SAAS,EAAE,MAAM;;;;;;;IAQ1C,QAAQ,CAAC,SAAS;QAChB,mFAAmF;+BACtD,MAAM,WAAW,gBAAgB;;;;;;;;QAU9D,+CAA+C;+BAClB,MAAM,QAAQ,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC;;;;;;;;QAQpF,8CAA8C;4BACpB,MAAM,cAAc,MAAM;;;;;;;;QAgBpD,0CAA0C;+BAE1B,MAAM,cACR,MAAM,QACZ,UAAU,CAAC,SAAS,CAAC,CAAC,kBAAkB,CAAC;;;;;;;;QAkBjD,kDAAkD;mCACjB,MAAM,cAAc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;MAe5D;IAED,QAAQ,CAAC,KAAK;QACZ,8DAA8D;4BACpC,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOhD,wBAAwB;gCACM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;QAOxD,yBAAyB;iCACM,2BAA2B;;;;;;;;;;;;;;;;;;;QAO1D,yBAAyB;iCACM,2BAA2B;;;;;;;;;;;;;;;;;;;QAO1D,qBAAqB;6BACM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAOlD;;;WAGG;yBACoB,mBAAmB;;;;;;;;;;;;;;;;;;;;;;MAM3C;CACF"}