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

Function deleteObject

apps/sim/lib/data-drains/destinations/gcs.ts:235–257  ·  view source on GitHub ↗
(input: {
  bucket: string
  objectName: string
  jwt: JWT
  signal: AbortSignal
})

Source from the content-addressed store, hash-verified

233}
234
235async function deleteObject(input: {
236 bucket: string
237 objectName: string
238 jwt: JWT
239 signal: AbortSignal
240}): Promise<void> {
241 const url = `${GCS_HOST}/storage/v1/b/${encodeURIComponent(input.bucket)}/o/${encodeURIComponent(input.objectName)}`
242 await fetchWithRetry({
243 action: 'delete-object',
244 bucket: input.bucket,
245 url,
246 method: 'DELETE',
247 buildHeaders: async () => {
248 const token = await getAccessToken(input.jwt)
249 return {
250 Authorization: `Bearer ${token}`,
251 'User-Agent': USER_AGENT,
252 }
253 },
254 signal: input.signal,
255 successStatuses: [404],
256 })
257}
258
259export const gcsDestination: DrainDestination<GCSDestinationConfig, GCSDestinationCredentials> = {
260 type: 'gcs',

Callers 1

testFunction · 0.85

Calls 2

fetchWithRetryFunction · 0.70
getAccessTokenFunction · 0.70

Tested by 1

testFunction · 0.68