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

Function getGoogleDriveObjectText

packages/web-backend/src/Storage/GoogleDrive.ts:1148–1167  ·  view source on GitHub ↗
(
	config: GoogleDriveIntegrationConfig,
	fileId: string,
	tokenStore?: GoogleDriveTokenStore,
)

Source from the content-addressed store, hash-verified

1146};
1147
1148export const getGoogleDriveObjectText = (
1149 config: GoogleDriveIntegrationConfig,
1150 fileId: string,
1151 tokenStore?: GoogleDriveTokenStore,
1152) =>
1153 driveFetch(
1154 config,
1155 appendSharedDriveCreateParams(
1156 `${DRIVE_API_BASE}/files/${encodeURIComponent(fileId)}?alt=media`,
1157 ),
1158 undefined,
1159 tokenStore,
1160 ).pipe(
1161 Effect.flatMap((response) =>
1162 Effect.tryPromise({
1163 try: () => response.text(),
1164 catch: (cause) => new Storage.StorageError({ cause }),
1165 }),
1166 ),
1167 );
1168
1169export const getGoogleDriveObjectResponse = (
1170 config: GoogleDriveIntegrationConfig,

Callers 1

makeGoogleDriveAccessFunction · 0.90

Calls 2

driveFetchFunction · 0.85

Tested by

no test coverage detected