Function
requireDriveObject
(
repo: StorageRepo,
integrationId: StorageDomain.StorageIntegrationId,
key: string,
)
Source from the content-addressed store, hash-verified
| 118 | }; |
| 119 | |
| 120 | const requireDriveObject = ( |
| 121 | repo: StorageRepo, |
| 122 | integrationId: StorageDomain.StorageIntegrationId, |
| 123 | key: string, |
| 124 | ) => |
| 125 | repo.getObjectByKey(integrationId, key).pipe( |
| 126 | Effect.flatMap( |
| 127 | Option.match({ |
| 128 | onNone: () => |
| 129 | Effect.fail( |
| 130 | new StorageDomain.StorageError({ |
| 131 | cause: new Error(`Storage object not found: ${key}`), |
| 132 | }), |
| 133 | ), |
| 134 | onSome: Effect.succeed, |
| 135 | }), |
| 136 | ), |
| 137 | ); |
| 138 | |
| 139 | const createDriveObjectUrl = (key: string, ttlSeconds = 3600) => |
| 140 | parseVideoIdFromObjectKey(key).pipe( |
Tested by
no test coverage detected