MCPcopy Create free account
hub / github.com/effect-app/libs / readMessage

Function readMessage

packages/infra/src/ClusterCosmos.ts:371–376  ·  view source on GitHub ↗
(id: string, partitionKey: string)

Source from the content-addressed store, hash-verified

369 annotateDb({ operation, system: "cosmosdb", collection: containerId, entity: "cluster-message-storage" })
370
371 const readMessage = (id: string, partitionKey: string) =>
372 Effect.tryPromise(() => container.item(id, partitionKey).read<MessageDoc>()).pipe(
373 Effect.tap(annotateItem),
374 Effect.map((resp) => Option.fromNullishOr(resp.resource)),
375 Effect.catchIf(isNotFound, () => Effect.succeed(Option.none()))
376 )
377
378 const queryMessages = (query: string, parameters: ReadonlyArray<CosmosParameter>) =>
379 Effect

Callers 1

ClusterCosmos.tsFile · 0.85

Calls 5

readMethod · 0.80
itemMethod · 0.80
pipeMethod · 0.65
mapMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…