MCPcopy Index your code
hub / github.com/simstudioai/sim / test

Function test

apps/sim/lib/data-drains/destinations/gcs.ts:265–287  ·  view source on GitHub ↗
({ config, credentials, signal })

Source from the content-addressed store, hash-verified

263 credentialsSchema: gcsCredentialsSchema,
264
265 async test({ config, credentials, signal }) {
266 const account = parseServiceAccount(credentials.serviceAccountJson)
267 const jwt = buildJwt(account)
268 const probeName = `${normalizePrefix(config.prefix)}.sim-drain-write-probe/${generateShortId(12)}`
269 await uploadObject('test-put', {
270 bucket: config.bucket,
271 objectName: probeName,
272 body: Buffer.alloc(0),
273 contentType: 'application/octet-stream',
274 metadata: {},
275 signal,
276 jwt,
277 })
278 try {
279 await deleteObject({ bucket: config.bucket, objectName: probeName, jwt, signal })
280 } catch (cleanupError) {
281 logger.debug('GCS test write probe cleanup failed (non-fatal)', {
282 bucket: config.bucket,
283 objectName: probeName,
284 error: cleanupError,
285 })
286 }
287 },
288
289 openSession({ config, credentials }) {
290 const account = parseServiceAccount(credentials.serviceAccountJson)

Callers

nothing calls this directly

Calls 7

parseServiceAccountFunction · 0.90
normalizePrefixFunction · 0.90
generateShortIdFunction · 0.90
uploadObjectFunction · 0.85
deleteObjectFunction · 0.85
debugMethod · 0.80
buildJwtFunction · 0.70

Tested by

no test coverage detected