{"_id":"@aspected/ts-sdk","_rev":"5-51b7b1a7f9fb169541b67f212d2e6174","name":"@aspected/ts-sdk","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@aspected/ts-sdk","version":"0.2.0","license":"MIT","_id":"@aspected/ts-sdk@0.2.0","maintainers":[{"name":"xillio-service","email":"develop.tools@xillio.com"},{"name":"jornverhoeven","email":"bornojj@hotmail.com"}],"dist":{"shasum":"053e4c8dc039d14df98192d8e7f27dba19fe572f","tarball":"https://registry.npmjs.org/@aspected/ts-sdk/-/ts-sdk-0.2.0.tgz","fileCount":166,"integrity":"sha512-l8bROFxZEyEia0cmaPwZDeC+dY6Nb2UkEREckRk76SzRQuz2yKsKgJhunt2JE19U9ZH51/jxb48qB39Q3l3z5Q==","signatures":[{"sig":"MEYCIQCw8vjKSn4pTxbzKKNvaqYIjbzqXbqWms+qr5CYZ7v2ZAIhAKcWZtBX57eAFdLJ20IjxZnNVLHxhwK2v/5a0hRkb+sI","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307068},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"6577559c80c93c04b26077916aebbc03b21c9b77","private":false,"scripts":{"build":"tsc","generate":"openapi-generator-cli generate -i openapi.json -g typescript-fetch -o src/generated --additional-properties=supportsES6=true,typescriptThreePlus=true","prepublishOnly":"npm run build"},"_npmUser":{"name":"jornverhoeven","email":"bornojj@hotmail.com"},"_npmVersion":"11.9.0","description":"TypeScript SDK for the Aspects.dev vector index API","directories":{},"_nodeVersion":"23.11.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@openapitools/openapi-generator-cli":"^2.34.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-sdk_0.2.0_1780482924762_0.9639518051106037","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aspected/ts-sdk","version":"0.2.1","license":"MIT","_id":"@aspected/ts-sdk@0.2.1","maintainers":[{"name":"xillio-service","email":"develop.tools@xillio.com"},{"name":"jornverhoeven","email":"bornojj@hotmail.com"}],"dist":{"shasum":"81653d4142fca852f4fc248cde032cbef3e42bb6","tarball":"https://registry.npmjs.org/@aspected/ts-sdk/-/ts-sdk-0.2.1.tgz","fileCount":166,"integrity":"sha512-xWSNdzUM4sSeiGpZ+r6bgSsJm3nmSfFS1GJ+94NW45q2Z8kp+MlE4ZgimKWGNi4UqBCDSKd8UlZp4GJeJ289WQ==","signatures":[{"sig":"MEUCIHFJ2Dd1OUq4HwI7hnEWX1NjqG4II2q1Adqmc5ZkC72wAiEApxfIhzSu9RoJbR9KaxKT1aKC2Szj9gcr+uXdVc7S6k4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307942},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"9c9336fa4d361bdca8204c541c11f01ddfddd770","private":false,"scripts":{"build":"tsc","generate":"openapi-generator-cli generate -i openapi.json -g typescript-fetch -o src/generated --additional-properties=supportsES6=true,typescriptThreePlus=true,useSingleRequestParameter=false","prepublishOnly":"npm run build"},"_npmUser":{"name":"jornverhoeven","email":"bornojj@hotmail.com"},"_npmVersion":"11.9.0","description":"TypeScript SDK for the Aspects.dev vector index API","directories":{},"_nodeVersion":"23.11.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@openapitools/openapi-generator-cli":"^2.34.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-sdk_0.2.1_1780488072729_0.13406347954358178","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@aspected/ts-sdk","version":"0.2.2","license":"MIT","_id":"@aspected/ts-sdk@0.2.2","maintainers":[{"name":"xillio-service","email":"develop.tools@xillio.com"},{"name":"jornverhoeven","email":"bornojj@hotmail.com"}],"dist":{"shasum":"7b6bc706f416a84073b73e00d61179a018ce427d","tarball":"https://registry.npmjs.org/@aspected/ts-sdk/-/ts-sdk-0.2.2.tgz","fileCount":166,"integrity":"sha512-EnI8hef4AawhGHaP5oZmX0xunTazsY25Are8wj6n+l4OXqfwGzPdTHNwoKah3M5HykAIZ++cYJyYfB7jqqCI8Q==","signatures":[{"sig":"MEUCIHq5oleTGzA4GFI3SAI4Sia5gq4SeuWjm914/bfiUCE7AiEAtIK/esbC2p062pOlFkwP0mDpgej+LxS9I9JMLJyEfhI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":307942},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"16e5c35eb800eec14a391f2491799228978a4000","private":false,"scripts":{"build":"tsc","generate":"openapi-generator-cli generate -i openapi.json -g typescript-fetch -o src/generated --additional-properties=supportsES6=true,typescriptThreePlus=true,useSingleRequestParameter=false","prepublishOnly":"npm run build"},"_npmUser":{"name":"jornverhoeven","email":"bornojj@hotmail.com"},"_npmVersion":"11.9.0","description":"TypeScript SDK for the Aspects.dev vector index API","directories":{},"_nodeVersion":"23.11.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@openapitools/openapi-generator-cli":"^2.34.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-sdk_0.2.2_1782835415989_0.7979863828592539","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@aspected/ts-sdk","version":"0.3.0","keywords":["aspected","vector","vector-database","sdk","typescript","fetch"],"license":"MIT","_id":"@aspected/ts-sdk@0.3.0","maintainers":[{"name":"xillio-service","email":"develop.tools@xillio.com"},{"name":"jornverhoeven","email":"bornojj@hotmail.com"}],"homepage":"https://github.com/xillio/aspects.dev-ts-sdk#readme","bugs":{"url":"https://github.com/xillio/aspects.dev-ts-sdk/issues"},"dist":{"shasum":"5ef8ceefd353ca67ed97079379e5b8f6297fbabe","tarball":"https://registry.npmjs.org/@aspected/ts-sdk/-/ts-sdk-0.3.0.tgz","fileCount":13,"integrity":"sha512-7OZYOe0JNtEtLU5dPKibmpsCbeLiFMlrpeDacSWtI7utqraCuUW3qTGgMatgrzisraalPPNjPo+jSLBf9/1DvQ==","signatures":[{"sig":"MEQCICti2qPW9AIEvjhTe6A1zcnKttDLIHNIN4Fyc45IlOwSAiAxQ1vHvJOGY9AAawf6IHX7O7LqNy/l+RdQMsRMozHlqQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73897},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.mjs","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","browser":"./dist/index.js","default":"./dist/index.mjs","require":"./dist/index.js"}},"gitHead":"9f7866be840cfce9f3b7a51b6fabf9fac4ea94f8","scripts":{"build":"bun run generate && bun run compile","format":"prettier --write .","compile":"tsup && tsc -p tsconfig.build.json","generate":"bun run build.ts"},"_npmUser":{"name":"xillio-service","email":"develop.tools@xillio.com"},"repository":{"url":"git+https://github.com/xillio/aspects.dev-ts-sdk.git","type":"git"},"_npmVersion":"11.9.0","description":"TypeScript SDK for the Aspects.dev vector index API","directories":{},"sideEffects":false,"_nodeVersion":"23.11.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","nunjucks":"^3.2.4","prettier":"^3.9.6","typescript":"^7.0.2","@types/nunjucks":"^3.2.6","json-schema-to-typescript":"^15.0.4","@openapi-contrib/openapi-schema-to-json-schema":"^5.1.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-sdk_0.3.0_1787897735721_0.7340156222856984","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-03T10:35:24.587Z","modified":"2026-09-17T13:18:34.444Z","0.2.0":"2026-06-03T10:35:24.927Z","0.2.1":"2026-06-03T12:01:12.870Z","0.2.2":"2026-06-30T16:03:36.143Z","0.3.0":"2026-08-28T06:15:35.867Z"},"bugs":{"url":"https://github.com/xillio/aspects.dev-ts-sdk/issues"},"license":"MIT","homepage":"https://github.com/xillio/aspects.dev-ts-sdk#readme","keywords":["aspected","vector","vector-database","sdk","typescript","fetch"],"repository":{"url":"git+https://github.com/xillio/aspects.dev-ts-sdk.git","type":"git"},"description":"TypeScript SDK for the Aspects.dev vector index API","maintainers":[{"email":"info@aspected.com","name":"aspected-team"},{"email":"develop.tools@xillio.com","name":"xillio-service"},{"email":"bornojj@hotmail.com","name":"jornverhoeven"}],"readme":"# @xillio/aspected\n\nTypeScript SDK for the [Aspected](https://docs.aspected.com) vector index API — a database that supports sparse vector\nqueries where some dimensions of the search vector may be left undefined.\n\n## Installation\n\n```bash\nnpm install @xillio/aspected\n```\n\n## Quick Start\n\n```typescript\nimport { AspectedClient, AspectedError } from \"@xillio/aspected\";\n\nconst client = new AspectedClient(\"http://localhost:8080\", {\n    headers: { Authorization: \"Bearer your-api-key\" },\n});\n```\n\n## Usage\n\nAll API methods are available directly on the client — no need for sub-namespaces.\n\n### Indexes\n\n```typescript\n// List all indexes\nconst { data } = await client.listIndexes();\n\n// Create an index\nawait client.createIndex(\"my-index\", {\n    idSize: 36,\n    schema: [\n        {\n            name: \"color\",\n            type: \"enum\",\n            path: \"$.color\",\n            settings: { values: [\"red\", \"green\", \"blue\"] },\n            multiplier: 1.0,\n        },\n        {\n            name: \"size\",\n            type: \"enum\",\n            path: \"$.size\",\n            settings: { values: [\"small\", \"medium\", \"large\"] },\n            multiplier: 1.0,\n        },\n    ],\n    hnsw: { M: 16, efConstruction: 200 },\n});\n\n// Get index details\nconst index = await client.getIndex(\"my-index\");\n\n// Search an index\nconst results = await client.searchIndex(\"my-index\", {\n    k: 10,\n    query: { color: \"red\" },\n});\n\n// Delete an index\nawait client.deleteIndex(\"my-index\");\n```\n\n### Documents\n\n```typescript\n// Upload documents\nawait client.uploadDocs(\"my-index\", {\n    data: [\n        { id: \"doc-1\", doc: { color: \"red\", size: \"small\" } },\n        { id: \"doc-2\", doc: { color: \"blue\", size: \"large\" } },\n    ],\n});\n\n// Get a single document\nconst doc = await client.getDoc(\"my-index\", \"doc-1\");\n\n// List documents\nconst docs = await client.getDocs(\"my-index\");\n```\n\n### Raw vector queries\n\nIf you have pre-computed vectors you can pass them directly using the `$raw` syntax:\n\n```typescript\nconst results = await client.searchIndex(\"my-index\", {\n    k: 5,\n    query: { color: { $raw: [0.1, 0.9, 0.3] } },\n});\n```\n\n## Error Handling\n\nHTTP errors are automatically parsed and thrown as `AspectedError` with the server's error message:\n\n```typescript\nimport { AspectedError } from \"@xillio/aspected\";\n\ntry {\n    await client.getIndex(\"nonexistent\");\n} catch (err) {\n    if (err instanceof AspectedError) {\n        console.error(err.message); // Formatted message, e.g. \"404 Not Found: ...\"\n        console.error(err.status); // HTTP status code (e.g. 404)\n        console.error(err.statusText); // HTTP status text (e.g. \"Not Found\")\n        console.error(err.error); // Server error string, if provided\n    }\n}\n```\n\n## Configuration\n\nThe client constructor accepts a base URL and an optional standard `RequestInit` object:\n\n```typescript\nconst client = new AspectedClient(\n    \"http://localhost:8080\", // API base URL\n    {\n        headers: {\n            Authorization: \"Bearer your-api-key\", // Authentication header\n            \"X-Custom\": \"value\", // Any additional headers\n        },\n    },\n);\n```\n\n## Development\n\n### Regenerate the SDK from the OpenAPI spec\n\n```bash\nbun run generate\n```\n\n### Build\n\n```bash\nbun run build\n```\n\n### Publishing\n\nIn order to publish a new version of the SDK, there are a few steps to follow:\n\n1. Update the version number in `package.json` according to semver rules.\n2. Build the SDK using `bun run build`.\n3. Ensure you have an npm account and are logged in via the command line (`bun login`), or are using the `.npmrc` file\n   with the correct auth token.\n4. Publish the package to npm using `bun publish`.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}