@medplum/core 2.1.24 → 2.2.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.
@@ -86,6 +86,38 @@ export declare interface AddressFormatOptions {
86
86
  lineSeparator?: string;
87
87
  }
88
88
 
89
+ export declare interface AgentConnectRequest extends BaseAgentRequestMessage {
90
+ type: 'agent:connect:request';
91
+ agentId: string;
92
+ }
93
+
94
+ export declare interface AgentConnectResponse extends BaseAgentMessage {
95
+ type: 'agent:connect:response';
96
+ }
97
+
98
+ export declare interface AgentError extends BaseAgentMessage {
99
+ type: 'agent:error';
100
+ body: string;
101
+ }
102
+
103
+ export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentTransmitRequest | AgentTransmitResponse;
104
+
105
+ export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
106
+ type: 'agent:transmit:request';
107
+ channel?: string;
108
+ remote: string;
109
+ contentType: string;
110
+ body: string;
111
+ }
112
+
113
+ export declare interface AgentTransmitResponse extends BaseAgentMessage {
114
+ type: 'agent:transmit:response';
115
+ channel?: string;
116
+ remote: string;
117
+ contentType: string;
118
+ body: string;
119
+ }
120
+
89
121
  export declare const allOk: OperationOutcome;
90
122
 
91
123
  /**
@@ -148,6 +180,15 @@ export declare interface AtomContext {
148
180
 
149
181
  export declare function badRequest(details: string, expression?: string): OperationOutcome;
150
182
 
183
+ export declare interface BaseAgentMessage {
184
+ type: string;
185
+ callback?: string;
186
+ }
187
+
188
+ export declare interface BaseAgentRequestMessage extends BaseAgentMessage {
189
+ accessToken?: string;
190
+ }
191
+
151
192
  export declare interface BaseLoginRequest {
152
193
  readonly projectId?: string;
153
194
  readonly clientId?: string;
@@ -301,6 +342,7 @@ export declare class ContainsAtom extends BooleanInfixOperatorAtom {
301
342
  */
302
343
  export declare const ContentType: {
303
344
  readonly CSS: "text/css";
345
+ readonly DICOM: "application/dicom";
304
346
  readonly FAVICON: "image/vnd.microsoft.icon";
305
347
  readonly FHIR_JSON: "application/fhir+json";
306
348
  readonly FORM_URL_ENCODED: "application/x-www-form-urlencoded";
@@ -2972,10 +3014,11 @@ export declare class MedplumClient extends EventTarget_2 {
2972
3014
  * @param destination - The destination device.
2973
3015
  * @param body - The message body.
2974
3016
  * @param contentType - Optional message content type.
3017
+ * @param waitForResponse - Optional wait for response flag.
2975
3018
  * @param options - Optional fetch options.
2976
- * @returns Promise to the operation outcome.
3019
+ * @returns Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.
2977
3020
  */
2978
- pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, options?: RequestInit): Promise<OperationOutcome>;
3021
+ pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, waitForResponse?: boolean, options?: RequestInit): Promise<any>;
2979
3022
  /**
2980
3023
  * @category Authentication
2981
3024
  * @returns The Login State
@@ -3422,7 +3465,7 @@ export declare interface MedplumClientOptions {
3422
3465
  /**
3423
3466
  * The length of time in milliseconds to cache resources.
3424
3467
  *
3425
- * Default value is 10000 (10 seconds).
3468
+ * Default value is 60000 (60 seconds).
3426
3469
  *
3427
3470
  * Cache time of zero disables all caching.
3428
3471
  *
@@ -86,6 +86,38 @@ export declare interface AddressFormatOptions {
86
86
  lineSeparator?: string;
87
87
  }
88
88
 
89
+ export declare interface AgentConnectRequest extends BaseAgentRequestMessage {
90
+ type: 'agent:connect:request';
91
+ agentId: string;
92
+ }
93
+
94
+ export declare interface AgentConnectResponse extends BaseAgentMessage {
95
+ type: 'agent:connect:response';
96
+ }
97
+
98
+ export declare interface AgentError extends BaseAgentMessage {
99
+ type: 'agent:error';
100
+ body: string;
101
+ }
102
+
103
+ export declare type AgentMessage = AgentError | AgentConnectRequest | AgentConnectResponse | AgentTransmitRequest | AgentTransmitResponse;
104
+
105
+ export declare interface AgentTransmitRequest extends BaseAgentRequestMessage {
106
+ type: 'agent:transmit:request';
107
+ channel?: string;
108
+ remote: string;
109
+ contentType: string;
110
+ body: string;
111
+ }
112
+
113
+ export declare interface AgentTransmitResponse extends BaseAgentMessage {
114
+ type: 'agent:transmit:response';
115
+ channel?: string;
116
+ remote: string;
117
+ contentType: string;
118
+ body: string;
119
+ }
120
+
89
121
  export declare const allOk: OperationOutcome;
90
122
 
91
123
  /**
@@ -148,6 +180,15 @@ export declare interface AtomContext {
148
180
 
149
181
  export declare function badRequest(details: string, expression?: string): OperationOutcome;
150
182
 
183
+ export declare interface BaseAgentMessage {
184
+ type: string;
185
+ callback?: string;
186
+ }
187
+
188
+ export declare interface BaseAgentRequestMessage extends BaseAgentMessage {
189
+ accessToken?: string;
190
+ }
191
+
151
192
  export declare interface BaseLoginRequest {
152
193
  readonly projectId?: string;
153
194
  readonly clientId?: string;
@@ -301,6 +342,7 @@ export declare class ContainsAtom extends BooleanInfixOperatorAtom {
301
342
  */
302
343
  export declare const ContentType: {
303
344
  readonly CSS: "text/css";
345
+ readonly DICOM: "application/dicom";
304
346
  readonly FAVICON: "image/vnd.microsoft.icon";
305
347
  readonly FHIR_JSON: "application/fhir+json";
306
348
  readonly FORM_URL_ENCODED: "application/x-www-form-urlencoded";
@@ -2972,10 +3014,11 @@ export declare class MedplumClient extends EventTarget_2 {
2972
3014
  * @param destination - The destination device.
2973
3015
  * @param body - The message body.
2974
3016
  * @param contentType - Optional message content type.
3017
+ * @param waitForResponse - Optional wait for response flag.
2975
3018
  * @param options - Optional fetch options.
2976
- * @returns Promise to the operation outcome.
3019
+ * @returns Promise to the result. If waiting for response, the result is the response body. Otherwise, it is an operation outcome.
2977
3020
  */
2978
- pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, options?: RequestInit): Promise<OperationOutcome>;
3021
+ pushToAgent(agent: Agent | Reference<Agent>, destination: Device | Reference<Device>, body: any, contentType?: string, waitForResponse?: boolean, options?: RequestInit): Promise<any>;
2979
3022
  /**
2980
3023
  * @category Authentication
2981
3024
  * @returns The Login State
@@ -3422,7 +3465,7 @@ export declare interface MedplumClientOptions {
3422
3465
  /**
3423
3466
  * The length of time in milliseconds to cache resources.
3424
3467
  *
3425
- * Default value is 10000 (10 seconds).
3468
+ * Default value is 60000 (60 seconds).
3426
3469
  *
3427
3470
  * Cache time of zero disables all caching.
3428
3471
  *