@medplum/core 5.1.4 → 5.1.6

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.
@@ -950,9 +950,7 @@ export declare interface CreateDocumentReferenceOptions extends CreateBinaryOpti
950
950
  * @param versionId - The current `versionId` of the anchor context. For example, in `DiagnosticReport-update`, it's the `versionId` of the `DiagnosticReport`.
951
951
  * @returns A serializable `FhircastMessagePayload`.
952
952
  */
953
- export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: never): FhircastMessagePayload<EventName>;
954
-
955
- export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId: string): FhircastMessagePayload<EventName>;
953
+ export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional | FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: string): FhircastMessagePayload<EventName>;
956
954
 
957
955
  export declare interface CreateMediaOptions extends CreateBinaryOptions {
958
956
  /**
@@ -1009,6 +1007,8 @@ export declare function createReference<T extends Resource>(resource: T): Refere
1009
1007
 
1010
1008
  export declare function createStructureIssue(expression: string, details: string): OperationOutcomeIssue;
1011
1009
 
1010
+ export declare type CriteriaState = 'idle' | 'connecting' | 'active' | 'refreshing' | 'removed';
1011
+
1012
1012
  export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = FhircastAnchorResourceType | ''> = T extends '' ? {
1013
1013
  'context.type': '';
1014
1014
  context: never[];
@@ -7145,20 +7145,30 @@ export declare class ParserBuilder {
7145
7145
  private currentProfile;
7146
7146
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
7147
7147
  private setupListeners;
7148
+ private sendBind;
7149
+ private sendUnbind;
7148
7150
  private emitError;
7149
7151
  private maybeEmitDisconnect;
7150
- private getTokenForCriteria;
7152
+ private isStale;
7151
7153
  private maybeGetCriteriaEntry;
7152
7154
  private getAllCriteriaEmitters;
7153
7155
  private addCriteriaEntry;
7154
7156
  private removeCriteriaEntry;
7155
7157
  private subscribeToCriteria;
7156
7158
  private refreshAllSubscriptions;
7157
- private isReconnecting;
7158
7159
  private rebindCriteriaEntry;
7159
7160
  private checkTokenExpirations;
7160
7161
  addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
7161
7162
  removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
7163
+ /**
7164
+ * Garbage-collects criteria entries whose refCount has been 0 for longer than the grace period.
7165
+ * For each such entry, emits a disconnect event and performs the full removal
7166
+ * (unbind-from-token, map cleanup).
7167
+ *
7168
+ * Called automatically on the ping and token-refresh timers.
7169
+ */
7170
+ private gcUnrefEntries;
7171
+ private isEntryGettingRemoved;
7162
7172
  getWebSocket(): IReconnectingWebSocket;
7163
7173
  closeWebSocket(): void;
7164
7174
  reconnectWebSocket(): void;
@@ -950,9 +950,7 @@ export declare interface CreateDocumentReferenceOptions extends CreateBinaryOpti
950
950
  * @param versionId - The current `versionId` of the anchor context. For example, in `DiagnosticReport-update`, it's the `versionId` of the `DiagnosticReport`.
951
951
  * @returns A serializable `FhircastMessagePayload`.
952
952
  */
953
- export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: never): FhircastMessagePayload<EventName>;
954
-
955
- export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId: string): FhircastMessagePayload<EventName>;
953
+ export declare function createFhircastMessagePayload<EventName extends FhircastEventVersionOptional | FhircastEventVersionRequired>(topic: string, event: EventName, context: FhircastEventContext<EventName> | FhircastEventContext<EventName>[], versionId?: string): FhircastMessagePayload<EventName>;
956
954
 
957
955
  export declare interface CreateMediaOptions extends CreateBinaryOptions {
958
956
  /**
@@ -1009,6 +1007,8 @@ export declare function createReference<T extends Resource>(resource: T): Refere
1009
1007
 
1010
1008
  export declare function createStructureIssue(expression: string, details: string): OperationOutcomeIssue;
1011
1009
 
1010
+ export declare type CriteriaState = 'idle' | 'connecting' | 'active' | 'refreshing' | 'removed';
1011
+
1012
1012
  export declare type CurrentContext<T extends FhircastAnchorResourceType | '' = FhircastAnchorResourceType | ''> = T extends '' ? {
1013
1013
  'context.type': '';
1014
1014
  context: never[];
@@ -7145,20 +7145,30 @@ export declare class ParserBuilder {
7145
7145
  private currentProfile;
7146
7146
  constructor(medplum: MedplumClient, wsUrl: URL | string, options?: SubManagerOptions);
7147
7147
  private setupListeners;
7148
+ private sendBind;
7149
+ private sendUnbind;
7148
7150
  private emitError;
7149
7151
  private maybeEmitDisconnect;
7150
- private getTokenForCriteria;
7152
+ private isStale;
7151
7153
  private maybeGetCriteriaEntry;
7152
7154
  private getAllCriteriaEmitters;
7153
7155
  private addCriteriaEntry;
7154
7156
  private removeCriteriaEntry;
7155
7157
  private subscribeToCriteria;
7156
7158
  private refreshAllSubscriptions;
7157
- private isReconnecting;
7158
7159
  private rebindCriteriaEntry;
7159
7160
  private checkTokenExpirations;
7160
7161
  addCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): SubscriptionEmitter;
7161
7162
  removeCriteria(criteria: string, subscriptionProps?: Partial<Subscription>): void;
7163
+ /**
7164
+ * Garbage-collects criteria entries whose refCount has been 0 for longer than the grace period.
7165
+ * For each such entry, emits a disconnect event and performs the full removal
7166
+ * (unbind-from-token, map cleanup).
7167
+ *
7168
+ * Called automatically on the ping and token-refresh timers.
7169
+ */
7170
+ private gcUnrefEntries;
7171
+ private isEntryGettingRemoved;
7162
7172
  getWebSocket(): IReconnectingWebSocket;
7163
7173
  closeWebSocket(): void;
7164
7174
  reconnectWebSocket(): void;