{"_id":"@askdepth/audience-connector","_rev":"4-0d7c6680d7e2fa15d34ed4815bca35a6","name":"@askdepth/audience-connector","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@askdepth/audience-connector","version":"0.1.0","license":"MIT","_id":"@askdepth/audience-connector@0.1.0","maintainers":[{"name":"pepsi_cherry","email":"androsovich.artyom@gmail.com"},{"name":"artem_askdepth","email":"artem@askdepth.com"}],"homepage":"https://github.com/askdepth/audience-connector/tree/main/packages/connector#readme","bugs":{"url":"https://github.com/askdepth/audience-connector/issues"},"dist":{"shasum":"57082a36fa97ddbb7a888f5d2160d0bc3663984f","tarball":"https://registry.npmjs.org/@askdepth/audience-connector/-/audience-connector-0.1.0.tgz","fileCount":31,"integrity":"sha512-Y6ug1X35DIdTh0T7OirR65mMP9gVk/XSTCJQsOu2rs1ncIlwuyA4qxNIFmia7ORFRVqll7YvGRSo2kcKF4/OJw==","signatures":[{"sig":"MEUCIQDdgLyaChfVpE+S1o5qLau+R0gtkWXAZLb3sPi7mRKHQQIgBwXRjz45u5IReqVq6vqKtE7kgH35UuhTqXfFD3tnm18=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@askdepth%2faudience-connector@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":300330},"main":"./dist/index.cjs","type":"module","_from":"file:askdepth-audience-connector-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./lambda":{"types":"./dist/shims/lambda.d.ts","import":"./dist/shims/lambda.js","require":"./dist/shims/lambda.cjs"},"./express":{"types":"./dist/shims/express.d.ts","import":"./dist/shims/express.js","require":"./dist/shims/express.cjs"},"./fastify":{"types":"./dist/shims/fastify.d.ts","import":"./dist/shims/fastify.js","require":"./dist/shims/fastify.cjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsup","test:node":"node ./node_modules/vitest/vitest.mjs run","typecheck":"tsc --noEmit","build:node":"node ./node_modules/tsup/dist/cli-node.js","typecheck:node":"node ./node_modules/typescript/bin/tsc --noEmit","test:node:watch":"node ./node_modules/vitest/vitest.mjs"},"_npmUser":{"name":"artem_askdepth","email":"artem@askdepth.com"},"_resolved":"/tmp/b169c9048c9abe587cc5b6f06df7a7c1/askdepth-audience-connector-0.1.0.tgz","_integrity":"sha512-Y6ug1X35DIdTh0T7OirR65mMP9gVk/XSTCJQsOu2rs1ncIlwuyA4qxNIFmia7ORFRVqll7YvGRSo2kcKF4/OJw==","repository":{"url":"git+https://github.com/askdepth/audience-connector.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.9.8","description":"The Askdepth Audience SDK connector — a Web-standard Request → Response handler a client deploys inside their own perimeter. Zero runtime dependencies in core; postgres and rest adapters; Express/Fastify/Lambda shims.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@askdepth/audience-contract":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.13.1","tsup":"^8.3.5","vitest":"^4.1.9","express":"^5.0.1","fastify":"^5.1.0","@types/pg":"^8.11.10","typescript":"^5.9.3","@types/node":"^22.10.2","@types/express":"^5.0.0"},"peerDependencies":{"pg":">=8","express":">=4","fastify":">=4"},"peerDependenciesMeta":{"pg":{"optional":true},"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/audience-connector_0.1.0_1788491987317_0.4791909853226264","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@askdepth/audience-connector","version":"0.1.1","license":"MIT","_id":"@askdepth/audience-connector@0.1.1","maintainers":[{"name":"algurin","email":"alex@askdepth.com"},{"name":"pepsi_cherry","email":"androsovich.artyom@gmail.com"},{"name":"artem_askdepth","email":"artem@askdepth.com"}],"homepage":"https://github.com/askdepth/audience-connector/tree/main/packages/connector#readme","bugs":{"url":"https://github.com/askdepth/audience-connector/issues"},"bin":{"audience-connector":"dist/bin/conformance.js"},"dist":{"shasum":"dd5f62ac249f7a069b45c58c2f925b0073bf5385","tarball":"https://registry.npmjs.org/@askdepth/audience-connector/-/audience-connector-0.1.1.tgz","fileCount":34,"integrity":"sha512-ltea4NQXcsNds4LIEbfMdD8vEnzzVhFcaH+i3HQZboyuobmXBJH/e51n06wCf30m8hzMOxbYYirbrcKI/Pfp8Q==","signatures":[{"sig":"MEUCIEKxY+re1CbPxscYpHrKSAAPNZdKQ8spTmvUxCj86a4NAiEA+2A3+qBedQ5haEvfZWsU/uZAJrnIDuA6A4Bhf1NE3Lo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCWCX+Q5uubzh35zqmHOk6xC10WBBYBM++pd7tvHgvsAgIgGIjrqxi9XlJUCQW8xkKikN7WZSteUTM4WLHO9uslGgM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@askdepth%2faudience-connector@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":579976},"main":"./dist/index.cjs","type":"module","_from":"file:askdepth-audience-connector-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./lambda":{"types":"./dist/shims/lambda.d.ts","import":"./dist/shims/lambda.js","require":"./dist/shims/lambda.cjs"},"./express":{"types":"./dist/shims/express.d.ts","import":"./dist/shims/express.js","require":"./dist/shims/express.cjs"},"./fastify":{"types":"./dist/shims/fastify.d.ts","import":"./dist/shims/fastify.js","require":"./dist/shims/fastify.cjs"},"./package.json":"./package.json"},"scripts":{"test":"vitest run","build":"tsup","test:node":"node ./node_modules/vitest/vitest.mjs run","typecheck":"tsc --noEmit","build:node":"node ./node_modules/tsup/dist/cli-node.js","typecheck:node":"node ./node_modules/typescript/bin/tsc --noEmit","test:node:watch":"node ./node_modules/vitest/vitest.mjs"},"_npmUser":{"name":"artem_askdepth","email":"artem@askdepth.com"},"_resolved":"/tmp/a8be21bbe3fa500bd78fa1ddbf928095/askdepth-audience-connector-0.1.1.tgz","_integrity":"sha512-ltea4NQXcsNds4LIEbfMdD8vEnzzVhFcaH+i3HQZboyuobmXBJH/e51n06wCf30m8hzMOxbYYirbrcKI/Pfp8Q==","repository":{"url":"git+https://github.com/askdepth/audience-connector.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.9.8","description":"The Askdepth Audience SDK connector — a Web-standard Request → Response handler a client deploys inside their own perimeter. Zero runtime dependencies in core; postgres and rest adapters; Express/Fastify/Lambda shims.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@askdepth/audience-contract":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.13.1","tsup":"^8.3.5","vitest":"^4.1.9","express":"^5.0.1","fastify":"^5.1.0","@types/pg":"^8.11.10","typescript":"^5.9.3","@types/node":"^22.10.2","@types/express":"^5.0.0"},"peerDependencies":{"pg":">=8","express":">=4","fastify":">=4"},"peerDependenciesMeta":{"pg":{"optional":true},"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/audience-connector_0.1.1_1788816105482_0.8538628901413379","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"@askdepth/audience-connector@0.1.2","bin":{"audience-connector":"dist/bin/conformance.js"},"bugs":{"url":"https://github.com/askdepth/audience-connector/issues"},"dist":{"shasum":"61324479a3e594683d2b481a588ea2b84eae039f","tarball":"https://registry.npmjs.org/@askdepth/audience-connector/-/audience-connector-0.1.2.tgz","fileCount":34,"integrity":"sha512-GupW/kUFc1o85UNmKlPFhHk9LX72kzJaMADAci0QCBZIhHF5bI+I98gWQ9kwqfxmefPFV8WGhd55gRcvBt7WXQ==","signatures":[{"sig":"MEUCIBLuwyiSAtMAwCy8lYjQoX8q98z3yctNd399M7wm0W9cAiEAk41D9cEXJwNXJ1e0ct6ZdhWCao/e9tH8l1qehNkmrhk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwHX1zfD7proKIU0MKZsHflDxZOZ2E+xgVeRdNbW7S+gIgbGthxeQct1BQMPcfIS1xPXW/WD7jaOv+E761kNeo+ko="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@askdepth%2faudience-connector@0.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":578670},"main":"./dist/index.cjs","name":"@askdepth/audience-connector","type":"module","_from":"file:askdepth-audience-connector-0.1.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./lambda":{"types":"./dist/shims/lambda.d.ts","import":"./dist/shims/lambda.js","require":"./dist/shims/lambda.cjs"},"./express":{"types":"./dist/shims/express.d.ts","import":"./dist/shims/express.js","require":"./dist/shims/express.cjs"},"./fastify":{"types":"./dist/shims/fastify.d.ts","import":"./dist/shims/fastify.js","require":"./dist/shims/fastify.cjs"},"./package.json":"./package.json"},"license":"MIT","scripts":{"test":"vitest run","build":"tsup","test:node":"node ./node_modules/vitest/vitest.mjs run","typecheck":"tsc --noEmit","build:node":"node ./node_modules/tsup/dist/cli-node.js","typecheck:node":"node ./node_modules/typescript/bin/tsc --noEmit","test:node:watch":"node ./node_modules/vitest/vitest.mjs"},"version":"0.1.2","_npmUser":{"name":"artem_askdepth","email":"artem@askdepth.com"},"homepage":"https://github.com/askdepth/audience-connector/tree/main/packages/connector#readme","_resolved":"/tmp/1052cc0f8cc320662f8f507499004313/askdepth-audience-connector-0.1.2.tgz","_integrity":"sha512-GupW/kUFc1o85UNmKlPFhHk9LX72kzJaMADAci0QCBZIhHF5bI+I98gWQ9kwqfxmefPFV8WGhd55gRcvBt7WXQ==","repository":{"url":"git+https://github.com/askdepth/audience-connector.git","type":"git","directory":"packages/connector"},"_npmVersion":"10.9.8","description":"The Askdepth Audience SDK connector — a Web-standard Request → Response handler a client deploys inside their own perimeter. Zero runtime dependencies in core; postgres and rest adapters; Express/Fastify/Lambda shims.","directories":{},"maintainers":[{"name":"algurin","email":"alex@askdepth.com"},{"name":"pepsi_cherry","email":"androsovich.artyom@gmail.com"},{"name":"artem_askdepth","email":"artem@askdepth.com"}],"sideEffects":false,"_nodeVersion":"22.23.2","dependencies":{"@askdepth/audience-contract":"0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"pg":"^8.13.1","tsup":"^8.3.5","vitest":"^4.1.9","express":"^5.0.1","fastify":"^5.1.0","@types/pg":"^8.11.10","typescript":"^5.9.3","@types/node":"^22.10.2","@types/express":"^5.0.0"},"peerDependencies":{"pg":">=8","express":">=4","fastify":">=4"},"peerDependenciesMeta":{"pg":{"optional":true},"express":{"optional":true},"fastify":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/audience-connector_0.1.2_1788934637089_0.8655951094932608"}}},"time":{"created":"2026-09-04T03:19:47.129Z","modified":"2026-09-09T06:17:17.518Z","0.1.0":"2026-09-04T03:19:47.481Z","0.1.1":"2026-09-07T21:21:45.568Z","0.1.2":"2026-09-09T06:17:17.178Z"},"bugs":{"url":"https://github.com/askdepth/audience-connector/issues"},"license":"MIT","homepage":"https://github.com/askdepth/audience-connector/tree/main/packages/connector#readme","repository":{"url":"git+https://github.com/askdepth/audience-connector.git","type":"git","directory":"packages/connector"},"description":"The Askdepth Audience SDK connector — a Web-standard Request → Response handler a client deploys inside their own perimeter. Zero runtime dependencies in core; postgres and rest adapters; Express/Fastify/Lambda shims.","maintainers":[{"name":"algurin","email":"alex@askdepth.com"},{"name":"pepsi_cherry","email":"androsovich.artyom@gmail.com"},{"name":"artem_askdepth","email":"artem@askdepth.com"}],"readme":"# @askdepth/audience-connector\n\nThe client-side connector for Askdepth's audience layer. A research on the\nAskdepth platform sends this connector a signed criteria query; it runs inside\n**your** infrastructure, against **your** database, and answers with counts and\na capped, column-mapped, read-only result set. Your raw data and your database\ncredentials never leave your perimeter.\n\n- Web-standard `Request → Response` handler; framework shims are thin wrappers.\n- **Zero runtime dependencies** in core. `pg` is an optional peer.\n- Mandatory HMAC-SHA256 verification — no local-testing bypass.\n- Dual ESM/CJS.\n\nFull deployment guide: [`docs/deployment.md`](../../docs/deployment.md).\nRuntime matrix: [`docs/runtime-support.md`](../../docs/runtime-support.md).\n\n## Public API\n\n```ts\nimport {\n  createConnector,\n  postgresAdapter,\n  restAdapter,\n  CONTRACT_VERSION,\n} from '@askdepth/audience-connector';\n\nimport { expressHandler } from '@askdepth/audience-connector/express';\nimport { fastifyPlugin } from '@askdepth/audience-connector/fastify';\nimport { lambdaHandler } from '@askdepth/audience-connector/lambda';\n```\n\n### `createConnector(config): { fetch(request: Request): Promise<Response> }`\n\n| config field | | |\n|---|---|---|\n| `secret` | `string \\| Buffer` | signing secret issued by Askdepth |\n| `previousSecret?` | `string \\| Buffer` | accepted during a rotation overlap |\n| `adapter` | `Adapter` | `postgresAdapter(…)` or `restAdapter(…)` |\n| `fieldMapping` | `Partial<Record<CanonicalField, string>>` | canonical field → your column. The whitelist. |\n| `attributes?` | `{ filterable: string[]; returnable?: string[] }` | `attr.*` fields; ≤10 filterable; filter-only unless returnable |\n| `capabilities?` | `Partial<Record<CapabilityFlag, boolean>>` | narrows the adapter's advertised set (cannot widen) |\n| `basePath?` | `string` | default `/askdepth/v1` |\n| `timeouts?` | `{ interactiveMs?: number; backgroundMs?: number }` | default 5 000 / 30 000 |\n\n### `postgresAdapter(opts): Adapter`\n\n`{ pool: pg.Pool, table: string, schema?: string, externalIdColumn?: string, maxStatementTimeoutMs?: number }`\n\nCompiles the criteria DSL to parameterised, read-only `SELECT` over mapped\ncolumns only. You pass your own `pg.Pool`; this package never constructs one\nor sees a connection string.\n\n### `restAdapter(opts): Adapter`\n\n`{ fetchCandidates, declaredSchema, fetchCount?, capabilities? }`\n\nFor non-Postgres backends. You supply the function that talks to your system;\nthe adapter re-enforces every invariant on its output (strip unmapped keys,\n1 000-row cap, per-row canonical-schema validation, abort over partial).\n\n### Shims\n\n| import | returns |\n|---|---|\n| `@askdepth/audience-connector/express` → `expressHandler(connector)` | Express `RequestHandler` — mount behind `express.raw({ type: 'application/json' })` |\n| `@askdepth/audience-connector/fastify` → `fastifyPlugin(connector)` | `FastifyPluginAsync` — installs a raw-buffer content-type parser |\n| `@askdepth/audience-connector/lambda` → `lambdaHandler(connector)` | API Gateway HTTP API v2 handler; honours `isBase64Encoded` |\n\n## Endpoints\n\n`GET /health` · `GET /schema` · `POST /candidates/count` ·\n`POST /candidates/search` — all under `basePath`, all requiring a valid\nsignature. Deterministic cursor pagination, hard 1 000-row cap, random\nsubsample only.\n","readmeFilename":"README.md"}