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

Function deliver

apps/sim/lib/data-drains/destinations/gcs.ts:293–316  ·  view source on GitHub ↗
({ body, contentType, metadata, signal })

Source from the content-addressed store, hash-verified

291 const jwt = buildJwt(account)
292 return {
293 async deliver({ body, contentType, metadata, signal }) {
294 const objectName = buildObjectKey(config.prefix, metadata)
295 await uploadObject('put-object', {
296 bucket: config.bucket,
297 objectName,
298 body,
299 contentType,
300 metadata: {
301 'sim-drain-id': metadata.drainId,
302 'sim-run-id': metadata.runId,
303 'sim-source': metadata.source,
304 'sim-sequence': metadata.sequence.toString(),
305 'sim-row-count': metadata.rowCount.toString(),
306 },
307 signal,
308 jwt,
309 })
310 logger.debug('GCS chunk delivered', {
311 bucket: config.bucket,
312 objectName,
313 bytes: body.byteLength,
314 })
315 return { locator: `gs://${config.bucket}/${objectName}` }
316 },
317 async close() {},
318 }
319 },

Callers

nothing calls this directly

Calls 4

buildObjectKeyFunction · 0.90
uploadObjectFunction · 0.85
debugMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected