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

Function requireDriveObject

packages/web-backend/src/Storage/index.ts:120–137  ·  view source on GitHub ↗
(
	repo: StorageRepo,
	integrationId: StorageDomain.StorageIntegrationId,
	key: string,
)

Source from the content-addressed store, hash-verified

118};
119
120const 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
139const createDriveObjectUrl = (key: string, ttlSeconds = 3600) =>
140 parseVideoIdFromObjectKey(key).pipe(

Callers 1

getObjectRecordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected