{"_id":"@aiql.io/sdk","name":"@aiql.io/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aiql.io/sdk","version":"0.1.0","description":"TypeScript SDK for the AiQL API","license":"MIT","author":{"name":"AiQL","url":"https://aiql.io"},"homepage":"https://docs.aiql.io","repository":{"type":"git","url":"git+https://github.com/AiQL-io/aiql-typescript.git"},"bugs":{"url":"https://github.com/AiQL-io/aiql-typescript/issues"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"keywords":["aiql","sdk","typescript","api","knowledge graph","rag"],"type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"scripts":{"build":"tsup","dev":"tsup --watch","typecheck":"tsc --noEmit","prepublishOnly":"npm run typecheck && npm run build"},"devDependencies":{"@types/node":"^22.10.5","tsup":"^8.3.5","typescript":"^5.7.3"},"engines":{"node":">=18"},"_id":"@aiql.io/sdk@0.1.0","gitHead":"4f32979145d14c5fb814e4d6f3881d32e1adca71","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-nx3dpiLj/Hzi/h2s0uqUw1ZmmnRM2IO+oQ8IhBrBCZLwW/oLwLsoxmvOe1R5JEXE35WGP5/GtQmfaWThdBEmFA==","shasum":"c354b79e46ff9e1ca7a528c33a33d7300fbd5585","tarball":"https://registry.npmjs.org/@aiql.io/sdk/-/sdk-0.1.0.tgz","fileCount":8,"unpackedSize":172177,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIB41A8hwilyldoGCab5o4n/sv4UWPckx/OeKvhaL6hg9AiEA8ksExgPHE9omcXcTeX4os/7NCUTKEoRHYf7Q7yVVojQ="}]},"_npmUser":{"name":"aiql-io","email":"maxim@aiql.io"},"directories":{},"maintainers":[{"name":"aiql-io","email":"maxim@aiql.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1784723945787_0.13246944994468635"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-22T12:39:05.681Z","0.1.0":"2026-07-22T12:39:06.010Z","modified":"2026-07-22T12:39:06.262Z"},"maintainers":[{"name":"aiql-io","email":"maxim@aiql.io"}],"description":"TypeScript SDK for the AiQL API","homepage":"https://docs.aiql.io","keywords":["aiql","sdk","typescript","api","knowledge graph","rag"],"repository":{"type":"git","url":"git+https://github.com/AiQL-io/aiql-typescript.git"},"author":{"name":"AiQL","url":"https://aiql.io"},"bugs":{"url":"https://github.com/AiQL-io/aiql-typescript/issues"},"license":"MIT","readme":"<p align=\"center\">\n  <picture>\n    <source media=\"(prefers-color-scheme: dark)\" srcset=\"./assets/logo-dark.svg\" />\n    <img src=\"./assets/logo.svg\" alt=\"AiQL\" width=\"180\" />\n  </picture>\n</p>\n\n# AiQL TypeScript SDK\n\nThe [AiQL TypeScript SDK](https://docs.aiql.io) (`@aiql.io/sdk`) is a typed client for the AiQL API. Use it from Node.js or the browser to manage workspaces, ingest documents, run queries, and call convert/split/shape/extract tools.\n\nTo learn more, check out the [Documentation](https://docs.aiql.io).\n\n## Installation\n\nYou will need Node.js 18+ and npm (or another package manager) installed on your local development machine.\n\n```shell\nnpm install @aiql.io/sdk\n```\n\n## Quickstart\n\n```ts\nimport { AiQL } from \"@aiql.io/sdk\";\n\nconst client = new AiQL({\n  apiKey: process.env.AIQL_API_KEY,\n  workspaceId: process.env.AIQL_WORKSPACE_ID,\n});\n\nconst workspaces = await client.workspaces.list();\n\nconst ingestion = await client.ingestions.create({\n  workspaceId: \"ws_3a1b\",\n  url: \"https://example.com/report.pdf\",\n  metadata: { customerId: \"abc\" },\n});\n\nconst query = await client.queries.create({\n  workspaceId: \"ws_3a1b\",\n  content: \"count events grouped by day\",\n});\n```\n\n`apiKey` defaults to `process.env.AIQL_API_KEY`. `baseUrl` defaults to `https://api.aiql.io`. Pass `workspaceId` on the client or per call; workspace-scoped routes send it as the `AiQL-Workspace` header.\n\n## Resources\n\n| Resource | Methods |\n|----------|---------|\n| `workspaces` | `list`, `create`, `get`, `update`, `delete` |\n| `ingestions` | `list`, `create`, `get`, `delete`, `cancel`, `retry` |\n| `queries` | `list`, `create`, `get`, `delete`, `sources` |\n| `sources` | `list`, `get`, `chunks`, `pages`, `graph`, `chunkElements` |\n| `canvases` | `list`, `create`, `get`, `update`, `delete` |\n| `dashboards` | `list`, `create`, `get`, `update`, `delete` |\n| `requests` | `list`, `mine`, `create`, `get`, `update`, `transition`, `delete` |\n| `requests.changes` | `create`, `delete` |\n| `requests.reviews` | `list`, `create`, `update`, `submit` |\n| `requests.reviews.comments` | `create` |\n| `tools` | `convert`, `split`, `shape`, `extract` |\n| `health` | `check` |\n\nList methods return `{ data, next_cursor, has_more }` and accept `{ limit?, cursor? }`.\n\n## File uploads\n\n`ingestions.create` accepts either a `url` or a `file` (`Blob`, `File`, `Uint8Array`, or `ArrayBuffer`):\n\n```ts\nconst uploaded = await client.ingestions.create({\n  workspaceId: \"ws_3a1b\",\n  file: await fs.openAsBlob(\"report.pdf\"),\n  metadata: { customerId: \"abc\" },\n});\n```\n\nNode readable streams (for example `fs.createReadStream`) are not passed through directly. Buffer the file first, or use `fs.openAsBlob` on Node 20+.\n\n## Errors\n\nFailed responses throw `AiqlError` with `status` and `detail` from the API body.\n\n```ts\nimport { AiQL, AiqlError } from \"@aiql.io/sdk\";\n\ntry {\n  await client.workspaces.get(\"missing\");\n} catch (error) {\n  if (error instanceof AiqlError) {\n    console.error(error.status, error.detail);\n  }\n}\n```\n\n## Authors\n\nThis library is created by [AiQL](https://aiql.io), with contributions from the [open source community](https://github.com/AiQL-io/aiql-typescript/graphs/contributors).\n","readmeFilename":"README.md","_rev":"1-fd23092a974d04fffecb7b876503f19c"}