INNER CODE UNIT · TypeScript

body

stablyai/orca · cloud/apps/relay/src/app.ts:533

    const body = CellHeartbeatSchema.safeParse(await context.req.json().catch(() => null))
    if (!body.success) return context.json({ error: 'invalid_request' }, 400)
    try {
      await operations.assignments.recordCellHeartbeat(body.data)
      return context.json({ ok: true })
    } catch (error) {
      return context.json({ error: operationError(error) }, 409)
    }
  })
  app.post('/v1/admin/cell-rehome-status', async (context) => {
    if (config.role !== 'director') return context.json({ error: 'director_only' }, 404)
    const bearer = readBearer(context.req.header('authorization'))
    if (!bearer || !(await verifyRuntimeToken(bearer))) {
      return context.json({ error: 'invalid_token' }, 401)
    }
    if (requestTooLarge(context.req.header('content-length'))) {
      return context.json({ error: 'request_too_large' }, 413)
    }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…