@medplum/core 5.1.26 → 5.1.27

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.
@@ -137,6 +137,8 @@ export declare interface AddFavoriteParams {
137
137
  patientId: string;
138
138
  pharmacy: Organization;
139
139
  setAsPrimary: boolean;
140
+ /** Selected practice location for multi-practice deployments. */
141
+ organization?: Reference<Organization>;
140
142
  }
141
143
 
142
144
  export declare interface AddOperation {
@@ -442,6 +444,8 @@ export declare function assertOk<T>(outcome: OperationOutcome, resource: T | und
442
444
  */
443
445
  export declare function assertReleaseManifest(candidate: unknown): asserts candidate is ReleaseManifest;
444
446
 
447
+ export declare function assertValidMedplumSemver(version: string): asserts version is MedplumSemver;
448
+
445
449
  export declare interface AsyncCrawlerVisitor {
446
450
  onEnterObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
447
451
  onExitObject?: (path: string, value: TypedValueWithPath, schema: InternalTypeSchema) => Promise<void>;
@@ -870,6 +874,14 @@ export declare type CodeChallengeMethod = 'plain' | 'S256';
870
874
  */
871
875
  export declare function codingMatchesToken(coding: Coding, token: string): boolean;
872
876
 
877
+ /**
878
+ * Compares two Medplum semver version strings, ignoring any trailing commit-hash suffix.
879
+ * @param a - The first version to compare.
880
+ * @param b - The second version to compare.
881
+ * @returns A negative number if `a` is older than `b`, a positive number if `a` is newer than `b`, or `0` if they resolve to the same release.
882
+ */
883
+ export declare function compareVersions(a: MedplumSemver, b: MedplumSemver): number;
884
+
873
885
  export declare function compressElement(element: InternalSchemaElement): Partial<InternalSchemaElement>;
874
886
 
875
887
  export declare class ConcatAtom extends InfixOperatorAtom {
@@ -942,6 +954,7 @@ export declare function contentTooLarge(text: string): OperationOutcome;
942
954
  export declare const ContentType: {
943
955
  readonly CSS: "text/css";
944
956
  readonly DICOM: "application/dicom";
957
+ readonly EVENT_STREAM: "text/event-stream";
945
958
  readonly FAVICON: "image/vnd.microsoft.icon";
946
959
  readonly FHIR_JSON: "application/fhir+json";
947
960
  readonly FORM_URL_ENCODED: "application/x-www-form-urlencoded";
@@ -1617,12 +1630,20 @@ export declare const ExternalSecretSystems: {
1617
1630
  */
1618
1631
  export declare function extractAccountReferences(meta: Meta | undefined): Reference[] | undefined;
1619
1632
 
1633
+ /**
1634
+ * Fetches the version strings for all published Medplum releases.
1635
+ * @param appName - The name of the app to fetch the release list for.
1636
+ * @param params - An optional list of key-value pairs to be appended to the URL query string.
1637
+ * @returns An array of version strings (without the leading `v`), sorted from newest to oldest.
1638
+ */
1639
+ export declare function fetchAllVersionStrings(appName: string, params?: Record<string, string>): Promise<MedplumSemver[]>;
1640
+
1620
1641
  /**
1621
1642
  * Fetches the latest Medplum release version string.
1622
1643
  * @param appName - The name of the app to fetch the latest version for.
1623
1644
  * @returns A version string corresponding to the latest Medplum release version.
1624
1645
  */
1625
- export declare function fetchLatestVersionString(appName: string): Promise<string>;
1646
+ export declare function fetchLatestVersionString(appName: string): Promise<MedplumSemver>;
1626
1647
 
1627
1648
  export declare type FetchLike = (url: string, options?: any) => Promise<any>;
1628
1649
 
@@ -2585,6 +2606,8 @@ export declare function getSearchParameterDetails(resourceType: string, searchPa
2585
2606
  */
2586
2607
  export declare function getSearchParameters(resourceType: string): Record<string, SearchParameter> | undefined;
2587
2608
 
2609
+ export declare function getSearchResourceTypes(searchRequest: SearchRequest): ResourceType[];
2610
+
2588
2611
  export declare function getSmartHealthLinkId(manifestUrl: string): string | undefined;
2589
2612
 
2590
2613
  export declare function getStatus(outcome: OperationOutcome): number;
@@ -3224,6 +3247,18 @@ export declare function intersection(objects: ArrayLike<{
3224
3247
  [index: string]: any;
3225
3248
  }>): string[];
3226
3249
 
3250
+ /**
3251
+ * Stable error when a cart-management bot response does not match
3252
+ * {@link MedicationCartManageResponse}.
3253
+ */
3254
+ export declare const INVALID_MEDICATION_CART_RESPONSE = "Invalid response from cart-management bot";
3255
+
3256
+ /**
3257
+ * Stable error when a checkout-medications bot response does not match
3258
+ * {@link MedicationCheckoutResponse}.
3259
+ */
3260
+ export declare const INVALID_MEDICATION_CHECKOUT_RESPONSE = "Invalid response from checkout-medications bot";
3261
+
3227
3262
  /**
3228
3263
  * Stable error when a bot response does not match {@link MedicationOrderResponse}.
3229
3264
  */
@@ -3427,6 +3462,20 @@ export declare function isLowerCase(c: string): boolean;
3427
3462
  */
3428
3463
  export declare function isMedicationArray(value: unknown): value is Medication[];
3429
3464
 
3465
+ /**
3466
+ * Type guard: validates a cart-management bot response.
3467
+ * @param value - Unknown bot JSON payload.
3468
+ * @returns True when the value matches {@link MedicationCartManageResponse}.
3469
+ */
3470
+ export declare function isMedicationCartManageResponse(value: unknown): value is MedicationCartManageResponse;
3471
+
3472
+ /**
3473
+ * Type guard: validates a checkout-medications bot response.
3474
+ * @param value - Unknown bot JSON payload.
3475
+ * @returns True when the value matches {@link MedicationCheckoutResponse}.
3476
+ */
3477
+ export declare function isMedicationCheckoutResponse(value: unknown): value is MedicationCheckoutResponse;
3478
+
3430
3479
  /**
3431
3480
  * Type guard: validates an order-medication bot response.
3432
3481
  * @param value - Unknown bot JSON payload.
@@ -3648,7 +3697,7 @@ export declare function isValidHostname(input: string): boolean;
3648
3697
  * @param version - A version string that should be tested for valid semver semantics.
3649
3698
  * @returns `true` if `version` is a valid semver version that conforms to the Medplum versioning system, otherwise `false`.
3650
3699
  */
3651
- export declare function isValidMedplumSemver(version: string): boolean;
3700
+ export declare function isValidMedplumSemver(version: string): version is MedplumSemver;
3652
3701
 
3653
3702
  /**
3654
3703
  * Generic interface that an implementation of `WebSocket` must satisfy to be used with `ReconnectingWebSocket`.
@@ -4006,6 +4055,126 @@ export declare const MEDICATION_REQUEST_STATUS_REASON_RESPONSE_NOT_RECEIVED = "r
4006
4055
  */
4007
4056
  export declare const MEDICATION_REQUEST_STATUS_REASON_SYSTEM = "https://medplum.com/fhir/CodeSystem/medication-request-status-reason";
4008
4057
 
4058
+ /**
4059
+ * Vendor-neutral input to clear the patient's whole vendor cart (`$clear-cart`).
4060
+ */
4061
+ export declare interface MedicationCartClearRequest {
4062
+ readonly patientId: string;
4063
+ }
4064
+
4065
+ /**
4066
+ * Encodes a {@link MedicationCartClearRequest} as a FHIR `Parameters` body for
4067
+ * the `$clear-cart` custom operation. Emits the `action: 'clear'` discriminator.
4068
+ *
4069
+ * @param req - Clear request (vendor-neutral).
4070
+ * @returns A `Parameters` resource ready to POST.
4071
+ */
4072
+ export declare function medicationCartClearRequestToParameters(req: MedicationCartClearRequest): Parameters_2;
4073
+
4074
+ /**
4075
+ * Per-item outcome from a cart remove/clear. `removed` = the vendor cart item
4076
+ * was deleted; `not-in-cart` = the draft was not staged (nothing to remove);
4077
+ * `failed` = the vendor delete failed (see `error`).
4078
+ */
4079
+ export declare interface MedicationCartItemResult {
4080
+ readonly medicationRequestId?: string;
4081
+ /** Vendor cart-item reference that was removed (ScriptSure MedCart `rxId`), when known. */
4082
+ readonly vendorLineId?: string;
4083
+ readonly status: 'removed' | 'not-in-cart' | 'failed';
4084
+ readonly error?: string;
4085
+ }
4086
+
4087
+ /**
4088
+ * Vendor-neutral output from a cart remove/clear: the vendor patient id, the
4089
+ * number of cart items actually removed, and the per-line outcomes (one for a
4090
+ * remove, N for a clear).
4091
+ */
4092
+ export declare interface MedicationCartManageResponse {
4093
+ /** Vendor-side patient id (numeric in ScriptSure today). */
4094
+ readonly vendorPatientId: number;
4095
+ readonly removedCount: number;
4096
+ readonly items: MedicationCartItemResult[];
4097
+ }
4098
+
4099
+ /**
4100
+ * Vendor-neutral input to remove a single draft `MedicationRequest` from the
4101
+ * patient's vendor cart (`$remove-cart-medication`).
4102
+ */
4103
+ export declare interface MedicationCartRemoveRequest {
4104
+ readonly patientId: string;
4105
+ readonly medicationRequestId: string;
4106
+ }
4107
+
4108
+ /**
4109
+ * Encodes a {@link MedicationCartRemoveRequest} as a FHIR `Parameters` body for
4110
+ * the `$remove-cart-medication` custom operation. Emits the `action: 'remove'`
4111
+ * discriminator the shared cart-management bot dispatches on.
4112
+ *
4113
+ * @param req - Remove request (vendor-neutral).
4114
+ * @returns A `Parameters` resource ready to POST.
4115
+ */
4116
+ export declare function medicationCartRemoveRequestToParameters(req: MedicationCartRemoveRequest): Parameters_2;
4117
+
4118
+ /**
4119
+ * Per-line outcome from a cart checkout. A single bad line is reported here as
4120
+ * `failed` rather than rolling back the lines that already queued.
4121
+ */
4122
+ export declare interface MedicationCheckoutItemResult {
4123
+ readonly medicationRequestId: string;
4124
+ /**
4125
+ * Vendor per-line reference returned at checkout, for diagnostics/audit. The
4126
+ * concrete meaning is vendor-specific: a cart-item id for cart-based vendors
4127
+ * (ScriptSure MedCart `rxId`) or a per-prescription id for queue-based ones.
4128
+ * Optional because the vendor may not mint one at add time.
4129
+ */
4130
+ readonly vendorLineId?: string;
4131
+ readonly status: 'queued' | 'failed';
4132
+ /**
4133
+ * True when the line was **not** added because the same drug was already in
4134
+ * the vendor's cart (the vendor-recommended duplicate check matched). Reported
4135
+ * as `status: 'queued'` with this flag set so the caller can surface it.
4136
+ */
4137
+ readonly duplicate?: boolean;
4138
+ readonly error?: string;
4139
+ }
4140
+
4141
+ /**
4142
+ * Vendor-neutral input for a cart-checkout bot: submit a set of draft
4143
+ * `MedicationRequest`s (the cart) to the vendor's electronic approval queue.
4144
+ */
4145
+ export declare interface MedicationCheckoutRequest {
4146
+ readonly patientId: string;
4147
+ readonly medicationRequestIds: string[];
4148
+ readonly appId?: string;
4149
+ /** Selected practice location; omit for single-practice prescribers. */
4150
+ readonly organization?: Reference<Organization>;
4151
+ }
4152
+
4153
+ /**
4154
+ * Encodes a {@link MedicationCheckoutRequest} as a FHIR `Parameters` body for
4155
+ * the vendor-neutral `$checkout-medications` custom operation
4156
+ * (`POST /fhir/R4/MedicationRequest/$checkout-medications`).
4157
+ *
4158
+ * `medicationRequestIds` is emitted as one `parameter` entry per id so the
4159
+ * OperationDefinition's `max: '*'` cardinality round-trips. Optional fields are
4160
+ * omitted entirely.
4161
+ *
4162
+ * @param req - Cart checkout request (vendor-neutral).
4163
+ * @returns A `Parameters` resource ready to POST.
4164
+ */
4165
+ export declare function medicationCheckoutRequestToParameters(req: MedicationCheckoutRequest): Parameters_2;
4166
+
4167
+ /**
4168
+ * Vendor-neutral output from a cart-checkout bot: a single embeddable approval
4169
+ * widget URL (the vendor's batch sign-off surface) plus per-line results.
4170
+ */
4171
+ export declare interface MedicationCheckoutResponse {
4172
+ readonly approvalUrl: string;
4173
+ /** Vendor-side patient id (numeric in ScriptSure today). */
4174
+ readonly vendorPatientId: number;
4175
+ readonly items: MedicationCheckoutItemResult[];
4176
+ }
4177
+
4009
4178
  /**
4010
4179
  * Vendor-neutral drug line for {@link MedicationOrderRequest}.
4011
4180
  */
@@ -4029,6 +4198,14 @@ export declare interface MedicationOrderExtensions {
4029
4198
  readonly pendingOrderIdSystem: string;
4030
4199
  readonly pendingOrderStatusUrl: string;
4031
4200
  readonly iframeUrlExtension: string;
4201
+ /**
4202
+ * Identifier system for the vendor's per-prescription message id (SureScripts
4203
+ * `messageId` in ScriptSure). Stamped on a draft `MedicationRequest` by the
4204
+ * cart-checkout flow and used to reconcile the approval webhook back to the
4205
+ * draft. Optional so existing single-order consumers don't have to populate it.
4206
+ * Consumed by the paired `medplum-ee` cart-checkout / prescription-webhook bots.
4207
+ */
4208
+ readonly messageIdSystem?: string;
4032
4209
  }
4033
4210
 
4034
4211
  /**
@@ -4066,6 +4243,8 @@ export declare interface MedicationOrderRequest {
4066
4243
  /** Free-text patient instructions (additional sig); maps to dosageInstruction[0].patientInstruction when using MR path. */
4067
4244
  readonly patientInstruction?: string;
4068
4245
  readonly appId?: string;
4246
+ /** Selected practice location for multi-practice deployments. */
4247
+ readonly organization?: Reference<Organization>;
4069
4248
  }
4070
4249
 
4071
4250
  /**
@@ -4115,6 +4294,8 @@ export declare interface MedicationOrderSetRequest {
4115
4294
  */
4116
4295
  readonly vendorOrderSetId?: number | string;
4117
4296
  readonly appId?: string;
4297
+ /** Selected practice location for multi-practice deployments. */
4298
+ readonly organization?: Reference<Organization>;
4118
4299
  }
4119
4300
 
4120
4301
  /**
@@ -4181,6 +4362,8 @@ export declare const MEDPLUM_CLI_CLIENT_ID = "medplum-cli";
4181
4362
 
4182
4363
  export declare const MEDPLUM_RELEASES_URL = "https://meta.medplum.com/releases";
4183
4364
 
4365
+ export declare const MEDPLUM_SEMVER_REGEX: RegExp;
4366
+
4184
4367
  export declare const MEDPLUM_VERSION: string;
4185
4368
 
4186
4369
  /**
@@ -4379,6 +4562,28 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
4379
4562
  * @param resourceType - The resource type to invalidate.
4380
4563
  */
4381
4564
  invalidateSearches(resourceType: ResourceType): void;
4565
+ /**
4566
+ * Notifies listeners that a resource was modified outside of the standard CRUD methods,
4567
+ * and invalidates the relevant cached values.
4568
+ *
4569
+ * The client emits the `resourceModified` event automatically for `createResource`,
4570
+ * `updateResource`, `patchResource`, `deleteResource`, and related methods. Use this method
4571
+ * to announce modifications the client cannot classify itself, such as custom operations,
4572
+ * GraphQL mutations, or out-of-band changes:
4573
+ *
4574
+ * ```typescript
4575
+ * await medplum.post(medplum.fhirUrl('Appointment', '$book'), parameters);
4576
+ * medplum.notifyResourceModified({ resourceType: 'Appointment', operation: 'create' });
4577
+ * medplum.notifyResourceModified({ resourceType: 'Slot', operation: 'update' });
4578
+ * ```
4579
+ *
4580
+ * Cached searches for the resource type are invalidated. If `event.resource` is provided
4581
+ * for a non-delete operation, it becomes the cached read value; otherwise, if `event.id`
4582
+ * is provided, the cached read is invalidated.
4583
+ * @category Caching
4584
+ * @param event - The resource modification to announce.
4585
+ */
4586
+ notifyResourceModified(event: ResourceModifiedEvent): void;
4382
4587
  /**
4383
4588
  * Makes an HTTP GET request to the specified URL.
4384
4589
  *
@@ -5552,6 +5757,11 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5552
5757
  * @param key - The cache key to delete.
5553
5758
  */
5554
5759
  private deleteCacheEntry;
5760
+ /**
5761
+ * Dispatches a `resourceModified` event if there are any listeners.
5762
+ * @param payload - The event payload.
5763
+ */
5764
+ private dispatchResourceModified;
5555
5765
  /**
5556
5766
  * Makes an HTTP request.
5557
5767
  * @param url - The target URL.
@@ -5611,8 +5821,8 @@ export declare class MedplumClient extends TypedEventTarget<MedplumClientEventMa
5611
5821
  /**
5612
5822
  * Handles an unauthenticated (HTTP 401) response from the server.
5613
5823
  *
5614
- * Bounded and terminal: at most {@link MAX_AUTH_ATTEMPTS} attempts per request (1 initial
5615
- * + 1 recovery, tracked via {@link RequestState.authAttempt}). The recovery re-mints via a
5824
+ * Bounded and terminal: at most `MAX_AUTH_ATTEMPTS` attempts per request (1 initial
5825
+ * + 1 recovery, tracked via `RequestState.authAttempt`). The recovery re-mints via a
5616
5826
  * forced {@link MedplumClient.refresh} (bypassing the {@link MedplumClient.isAuthenticated}
5617
5827
  * short-circuit on the rejected token), single-flight so concurrent 401s share one re-mint.
5618
5828
  * A second 401 is terminal: clear auth, `onUnauthenticated`, reject — never recurse.
@@ -5962,6 +6172,10 @@ export declare type MedplumClientEventMap = {
5962
6172
  error: Error;
5963
6173
  };
5964
6174
  };
6175
+ resourceModified: {
6176
+ type: 'resourceModified';
6177
+ payload: ResourceModifiedEvent;
6178
+ };
5965
6179
  };
5966
6180
 
5967
6181
  /**
@@ -6454,6 +6668,8 @@ export declare interface MedplumRequestOptions extends RequestInit {
6454
6668
  duplex?: 'half';
6455
6669
  }
6456
6670
 
6671
+ export declare type MedplumSemver = `${number}.${number}.${number}` | `${number}.${number}.${number}-${string}`;
6672
+
6457
6673
  export declare interface MedplumSourceInfraConfig {
6458
6674
  name: ValueOrExternalSecret<string>;
6459
6675
  stackName: ValueOrExternalSecret<string>;
@@ -6998,11 +7214,66 @@ export declare class OrAtom extends InfixOperatorAtom {
6998
7214
  eval(context: AtomContext, input: TypedValue[]): TypedValue[];
6999
7215
  }
7000
7216
 
7217
+ /**
7218
+ * Vendor-neutral decoded response from the `$sync-orderset` custom operation
7219
+ * (`POST /fhir/R4/PlanDefinition/$sync-orderset`). `failedCount > 0` means the
7220
+ * synced vendor order set carries fewer meds than the `PlanDefinition`.
7221
+ */
7222
+ export declare interface OrderSetSyncResponse {
7223
+ readonly mode: 'created' | 'noop-already-synced';
7224
+ readonly planDefinitionId?: string;
7225
+ readonly scriptSureOrdersetId?: number;
7226
+ readonly syncedCount: number;
7227
+ readonly failedCount: number;
7228
+ readonly results: OrderSetSyncSequenceResult[];
7229
+ }
7230
+
7231
+ /**
7232
+ * Per-action outcome from the vendor-neutral `$sync-orderset` operation. A
7233
+ * `'failed'` row carries `error` and was NOT added to the vendor order set, so
7234
+ * a later apply/signing session would open with fewer meds than the
7235
+ * `PlanDefinition` requested — callers must surface these.
7236
+ */
7237
+ export declare interface OrderSetSyncSequenceResult {
7238
+ readonly actionTitle?: string;
7239
+ readonly activityDefinitionUrl?: string;
7240
+ readonly scriptSureSequenceId?: number;
7241
+ readonly scriptSureOrderId?: number;
7242
+ readonly status: 'synced' | 'failed';
7243
+ readonly error?: string;
7244
+ }
7245
+
7001
7246
  /**
7002
7247
  * SQL on FHIR output row.
7003
7248
  */
7004
7249
  export declare type OutputRow = Record<string, any>;
7005
7250
 
7251
+ /**
7252
+ * Decodes the `Parameters` response from the `$remove-cart-medication` /
7253
+ * `$clear-cart` custom operations into a typed {@link MedicationCartManageResponse}.
7254
+ * Throws {@link INVALID_MEDICATION_CART_RESPONSE} when required top-level fields
7255
+ * are missing.
7256
+ *
7257
+ * @param params - The `Parameters` resource returned by the operation.
7258
+ * @returns A vendor-neutral {@link MedicationCartManageResponse}.
7259
+ */
7260
+ export declare function parametersToMedicationCartManageResponse(params: Parameters_2): MedicationCartManageResponse;
7261
+
7262
+ /**
7263
+ * Decodes the `Parameters` response from the `$checkout-medications` custom
7264
+ * operation into a typed {@link MedicationCheckoutResponse}. Throws
7265
+ * `INVALID_MEDICATION_CHECKOUT_RESPONSE` when required top-level fields are
7266
+ * missing.
7267
+ *
7268
+ * The repeating `items` parameter is collected across every occurrence (each is
7269
+ * one queued/failed line); the scalar `approvalUrl` / `vendorPatientId` are read
7270
+ * once.
7271
+ *
7272
+ * @param params - The `Parameters` resource returned by the operation.
7273
+ * @returns A vendor-neutral {@link MedicationCheckoutResponse}.
7274
+ */
7275
+ export declare function parametersToMedicationCheckoutResponse(params: Parameters_2): MedicationCheckoutResponse;
7276
+
7006
7277
  /**
7007
7278
  * Decodes the `Parameters` response from the `$order-medication` custom
7008
7279
  * operation into a typed {@link MedicationOrderResponse}. Throws
@@ -7027,6 +7298,16 @@ export declare function parametersToMedicationOrderResponse(params: Parameters_2
7027
7298
  */
7028
7299
  export declare function parametersToMedicationOrderSetResponse(params: Parameters_2): MedicationOrderSetResponse;
7029
7300
 
7301
+ /**
7302
+ * Decodes the `Parameters` response from the `$sync-orderset` custom operation
7303
+ * into a typed {@link OrderSetSyncResponse}, including the repeating per-action
7304
+ * `results` rows the server previously dropped.
7305
+ *
7306
+ * @param params - The `Parameters` resource returned by the operation.
7307
+ * @returns A vendor-neutral {@link OrderSetSyncResponse}.
7308
+ */
7309
+ export declare function parametersToOrderSetSyncResponse(params: Parameters_2): OrderSetSyncResponse;
7310
+
7030
7311
  /**
7031
7312
  * Parses a FHIRPath expression into an AST.
7032
7313
  * The result can be used to evaluate the expression against a resource or other object.
@@ -7212,6 +7493,8 @@ export declare class ParserBuilder {
7212
7493
  address?: string;
7213
7494
  phoneOrFax?: string;
7214
7495
  ncpdpID?: string;
7496
+ /** Selected practice location for multi-practice deployments. */
7497
+ organization?: Reference<Organization>;
7215
7498
  }
7216
7499
 
7217
7500
  /**
@@ -7784,6 +8067,29 @@ export declare class ParserBuilder {
7784
8067
 
7785
8068
  export declare function resourceMatchesSubscriptionCriteria({ resource, subscription, context, getPreviousResource, logger, }: ResourceMatchesSubscriptionCriteria): Promise<boolean>;
7786
8069
 
8070
+ /**
8071
+ * Payload of the `resourceModified` event, emitted after this client instance successfully
8072
+ * creates, updates, patches, or deletes a FHIR resource.
8073
+ *
8074
+ * Emitted by `createResource`, `createResourceIfNoneExist`, `updateResource`, `upsertResource`,
8075
+ * `patchResource`, `deleteResource`, and by `notifyResourceModified`.
8076
+ * Conditional methods (`createResourceIfNoneExist`, `upsertResource`) emit
8077
+ * even when the server made no change, except on HTTP 304 "Not Modified".
8078
+ *
8079
+ * @template T - The type of the modified resource. Defaults to `Resource`; narrow it (e.g. via
8080
+ * `useResourceModified('Slot', ...)`) to get a typed `resource` payload without extra guards.
8081
+ */
8082
+ export declare interface ResourceModifiedEvent<T extends Resource = Resource> {
8083
+ /** The type of the modified resource. */
8084
+ resourceType: T['resourceType'];
8085
+ /** How the resource was modified. */
8086
+ operation: 'create' | 'update' | 'patch' | 'delete';
8087
+ /** The resource id, when known. */
8088
+ id?: string;
8089
+ /** The server-returned resource, when available. Undefined for deletes. */
8090
+ resource?: WithId<T>;
8091
+ }
8092
+
7787
8093
  export declare type ResourceWithCode = Resource & Code;
7788
8094
 
7789
8095
  export declare const ReturnAckCategory: {