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

Function postInsertAll

apps/sim/lib/data-drains/destinations/bigquery.ts:105–131  ·  view source on GitHub ↗
(
  input: InsertAllInput,
  url: string,
  body: string,
  forceRefresh = false
)

Source from the content-addressed store, hash-verified

103}
104
105async function postInsertAll(
106 input: InsertAllInput,
107 url: string,
108 body: string,
109 forceRefresh = false
110): Promise<Response> {
111 const token = await getAccessToken(input.jwt, forceRefresh)
112 const perAttempt = AbortSignal.any([input.signal, AbortSignal.timeout(PER_ATTEMPT_TIMEOUT_MS)])
113 try {
114 return await fetch(url, {
115 method: 'POST',
116 headers: {
117 Authorization: `Bearer ${token}`,
118 'Content-Type': 'application/json',
119 'User-Agent': USER_AGENT,
120 },
121 body,
122 signal: perAttempt,
123 })
124 } catch (error) {
125 logger.warn('BigQuery request failed', {
126 table: `${input.config.projectId}.${input.config.datasetId}.${input.config.tableId}`,
127 error: toError(error).message,
128 })
129 throw error
130 }
131}
132
133/**
134 * Builds a stable `insertId` for best-effort dedup (~60s window). Prefixed

Callers 1

insertAllFunction · 0.85

Calls 3

toErrorFunction · 0.90
getAccessTokenFunction · 0.70
warnMethod · 0.65

Tested by

no test coverage detected