| 218 | } |
| 219 | |
| 220 | const storageNotification = <R extends Rpc.Any>(message: Message.Outgoing<R>): ServiceBusMessage => { |
| 221 | const envelope = message.envelope |
| 222 | const envelopeId = envelope._tag === "Request" ? envelope.requestId : envelope.id |
| 223 | const body: StorageNotification = { |
| 224 | _tag: "EffectClusterStorageNotification", |
| 225 | envelopeId: String(envelopeId), |
| 226 | requestId: String(envelope.requestId), |
| 227 | shardId: envelope.address.shardId.toString(), |
| 228 | entityType: envelope.address.entityType, |
| 229 | entityId: envelope.address.entityId |
| 230 | } |
| 231 | return { |
| 232 | body, |
| 233 | contentType: "application/json", |
| 234 | correlationId: body.requestId, |
| 235 | messageId: body.envelopeId, |
| 236 | subject: body._tag |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | class ServiceBusPublishError extends Data.TaggedError("ServiceBusPublishError")<{ |
| 241 | readonly cause: unknown |