MCPcopy Index your code
hub / github.com/CapSoftware/Cap / withRecoveredDriveFile

Function withRecoveredDriveFile

packages/web-backend/src/Storage/index.ts:391–400  ·  view source on GitHub ↗
(
		key: string,
		object: typeof Db.storageObjects.$inferSelect,
		read: (fileId: string) => Effect.Effect<A, StorageDomain.StorageError>,
	)

Source from the content-addressed store, hash-verified

389 ),
390 );
391 const withRecoveredDriveFile = <A>(
392 key: string,
393 object: typeof Db.storageObjects.$inferSelect,
394 read: (fileId: string) => Effect.Effect<A, StorageDomain.StorageError>,
395 ) =>
396 read(object.providerObjectId).pipe(
397 Effect.catchTag("StorageError", () =>
398 recoverDriveFileId(key, object).pipe(Effect.flatMap(read)),
399 ),
400 );
401
402 const multipart: MultipartAccess = {
403 create: (

Callers 1

makeGoogleDriveAccessFunction · 0.85

Calls 2

readFunction · 0.85
recoverDriveFileIdFunction · 0.85

Tested by

no test coverage detected