MCPcopy Index your code
hub / github.com/TanStack/ai / setUrlAuth

Method setUrlAuth

packages/ai-sandbox-sprites/src/client.ts:232–245  ·  view source on GitHub ↗
(
    name: string,
    auth: SpriteUrlAuth,
    signal?: AbortSignal,
  )

Source from the content-addressed store, hash-verified

230 }
231
232 async setUrlAuth(
233 name: string,
234 auth: SpriteUrlAuth,
235 signal?: AbortSignal,
236 ): Promise<void> {
237 const response = await fetch(this.spritePath(name), {
238 method: 'PUT',
239 headers: this.headers({ 'content-type': 'application/json' }),
240 body: JSON.stringify({ url_settings: { auth } }),
241 ...(signal ? { signal } : {}),
242 })
243 if (!response.ok) await this.fail('PUT', this.spritePath(name), response)
244 await response.body?.cancel()
245 }
246
247 async fsRead(name: string, path: string): Promise<Uint8Array> {
248 const url = this.spritePath(

Callers 1

createMethod · 0.80

Calls 5

spritePathMethod · 0.95
headersMethod · 0.95
failMethod · 0.95
cancelMethod · 0.65
fetchFunction · 0.50

Tested by

no test coverage detected