{"_id":"@auriclabs/events-infra","_rev":"5-87d34f1ee6690c7c71e3e229b37e0b3c","name":"@auriclabs/events-infra","dist-tags":{"latest":"1.0.1"},"versions":{"0.1.0":{"name":"@auriclabs/events-infra","version":"0.1.0","keywords":[],"author":"","license":"ISC","_id":"@auriclabs/events-infra@0.1.0","maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"homepage":"https://github.com/auriclabs/packages#readme","bugs":{"url":"https://github.com/auriclabs/packages/issues"},"dist":{"shasum":"e0d01a83d3f6e219d0853a319399b95489905632","tarball":"https://registry.npmjs.org/@auriclabs/events-infra/-/events-infra-0.1.0.tgz","fileCount":16,"integrity":"sha512-x5Hwum9An5YegdikMkZrFRHt8iJIHR4ez7nw2y91IlClD2udBsBuWkj2xd/iIxaNa+gtj5VAAKtuzRFgNCF73Q==","signatures":[{"sig":"MEUCIGg/nZlfH/sNO0fhjN5PM+VwtHkb+GNSUE4OP8enLtdxAiEArH0JB8Qsiwi8Y0mdUWbQTqwZJFWwZrD2e6IrTXDdNwI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14756},"main":"dist/index.cjs","type":"module","_from":"file:auriclabs-events-infra-0.1.0.tgz","types":"dist/index.d.mts","module":"dist/index.mjs","exports":{".":{"types":"./dist/index.d.mts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"dev":"concurrently \"pnpm build --watch\" \"pnpm:y:watch\"","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsdown src/index.ts --format cjs,esm --dts --tsconfig tsconfig.build.json --no-hash","y:watch":"chokidar dist --initial --silent -c \"yalc publish --push\"","lint:fix":"eslint . --fix","typecheck":"ts-config-typecheck","test:watch":"vitest"},"_npmUser":{"name":"kevupton","email":"kevin@upton.tech"},"prettier":"@auriclabs/prettier-config","_resolved":"/tmp/96f2eab2e256cd9be0549b09eaea1693/auriclabs-events-infra-0.1.0.tgz","_integrity":"sha512-x5Hwum9An5YegdikMkZrFRHt8iJIHR4ez7nw2y91IlClD2udBsBuWkj2xd/iIxaNa+gtj5VAAKtuzRFgNCF73Q==","repository":{"url":"git+https://github.com/auriclabs/packages.git","type":"git","directory":"packages/events-infra"},"_npmVersion":"10.8.2","description":"SST infrastructure helpers for DynamoDB event stores","directories":{},"_nodeVersion":"20.20.1","dependencies":{},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"0.1.0"},"peerDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/events-infra_0.1.0_1774134513782_0.1780948292494795","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@auriclabs/events-infra","version":"0.2.0","keywords":[],"author":"","license":"ISC","_id":"@auriclabs/events-infra@0.2.0","maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"homepage":"https://github.com/auriclabs/packages#readme","bugs":{"url":"https://github.com/auriclabs/packages/issues"},"dist":{"shasum":"812eec9ef34f6539c4138138d6a47af950fc3c17","tarball":"https://registry.npmjs.org/@auriclabs/events-infra/-/events-infra-0.2.0.tgz","fileCount":18,"integrity":"sha512-293p9+ejhjahWe4/6jvBi3xymOYpv01wXRF9r22O8usEgUF7oTsNawCQufXSbYdLscLznTjbtlgblqJ1MeKjZw==","signatures":[{"sig":"MEUCIQDN6GX9HyZ2qsuLmudNp6nceKJQwZudX0t9euIQ5UZWPAIgPAGyYugY8ZnwmVNyW/A/0NYa2PlqFzeqtl+Rg6rRcGE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14948},"main":"src/index.ts","type":"module","_from":"file:auriclabs-events-infra-0.2.0.tgz","types":"src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"dev":"concurrently \"pnpm build --watch\" \"pnpm:y:watch\"","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsdown src/index.ts --format cjs,esm --dts --tsconfig tsconfig.build.json --no-hash","y:watch":"chokidar dist --initial --silent -c \"yalc publish --push\"","lint:fix":"eslint . --fix","typecheck":"ts-config-typecheck","test:watch":"vitest"},"_npmUser":{"name":"kevupton","email":"kevin@upton.tech"},"prettier":"@auriclabs/prettier-config","_resolved":"/tmp/dcdfa209c1eef093b16bb91758b7026e/auriclabs-events-infra-0.2.0.tgz","_integrity":"sha512-293p9+ejhjahWe4/6jvBi3xymOYpv01wXRF9r22O8usEgUF7oTsNawCQufXSbYdLscLznTjbtlgblqJ1MeKjZw==","repository":{"url":"git+https://github.com/auriclabs/packages.git","type":"git","directory":"packages/events-infra"},"_npmVersion":"10.8.2","description":"SST infrastructure helpers for DynamoDB event stores","directories":{},"_nodeVersion":"20.20.1","dependencies":{},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"0.1.0"},"peerDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/events-infra_0.2.0_1774290597775_0.625778009869276","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@auriclabs/events-infra","version":"0.3.0","keywords":[],"author":"","license":"ISC","_id":"@auriclabs/events-infra@0.3.0","maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"homepage":"https://github.com/auriclabs/packages#readme","bugs":{"url":"https://github.com/auriclabs/packages/issues"},"dist":{"shasum":"a18f8bcccecb4e9df741a29b561187777dabcb11","tarball":"https://registry.npmjs.org/@auriclabs/events-infra/-/events-infra-0.3.0.tgz","fileCount":18,"integrity":"sha512-H6lPDieP86pOykb/SX+wnoTRKxBxxy+pSs7KPnwuVl6oVSAhv3CmMvLKmIiqRVra2GT+qhsK1u0A/7QIdRKstw==","signatures":[{"sig":"MEQCIDAnvwYbF1UOEdJJOhCjgUcdBYbEYsBvD+iUY5qcrWXPAiBJVnc0vLsAPXm858wHXMbaLY9XkX4+Aq9lFT0i5YYTCg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15487},"main":"src/index.ts","type":"module","_from":"file:auriclabs-events-infra-0.3.0.tgz","types":"src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"dev":"concurrently \"pnpm build --watch\" \"pnpm:y:watch\"","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsdown src/index.ts --format cjs,esm --dts --tsconfig tsconfig.build.json --no-hash","y:watch":"chokidar dist --initial --silent -c \"yalc publish --push\"","lint:fix":"eslint . --fix","typecheck":"ts-config-typecheck","test:watch":"vitest"},"_npmUser":{"name":"kevupton","email":"kevin@upton.tech"},"prettier":"@auriclabs/prettier-config","_resolved":"/tmp/86e67ce5c7907850213311e37b6aba24/auriclabs-events-infra-0.3.0.tgz","_integrity":"sha512-H6lPDieP86pOykb/SX+wnoTRKxBxxy+pSs7KPnwuVl6oVSAhv3CmMvLKmIiqRVra2GT+qhsK1u0A/7QIdRKstw==","repository":{"url":"git+https://github.com/auriclabs/packages.git","type":"git","directory":"packages/events-infra"},"_npmVersion":"10.8.2","description":"SST infrastructure helpers for DynamoDB event stores","directories":{},"_nodeVersion":"20.20.1","dependencies":{},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"0.1.0"},"peerDependencies":{"sst":"^4.3.7","@auriclabs/sst-types":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/events-infra_0.3.0_1774384475429_0.7212942824275463","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@auriclabs/events-infra","version":"1.0.0","keywords":[],"author":"","license":"ISC","_id":"@auriclabs/events-infra@1.0.0","maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"homepage":"https://github.com/auriclabs/packages#readme","bugs":{"url":"https://github.com/auriclabs/packages/issues"},"dist":{"shasum":"7f87edde7253a6e552f6edd8aa7af6eca4ad4fb2","tarball":"https://registry.npmjs.org/@auriclabs/events-infra/-/events-infra-1.0.0.tgz","fileCount":19,"integrity":"sha512-qCSKMnsJ1/OVlgvORYgONXbqT+MeyZl7Y9LuKF23aMKD+B9qAvF6GSu+aGyt+unrF2D2tXkqGhpk0UcgVlXbuA==","signatures":[{"sig":"MEUCID9/fxbYUXLTEi0fGV1Eg3fsQDG/9TumD7JcPMQBm25oAiEA2jdi6b+6DI2hcGFit9z+DPHH0deL4WmrjeeTxdJsyns=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21586},"main":"src/index.ts","type":"module","_from":"file:auriclabs-events-infra-1.0.0.tgz","types":"src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"dev":"concurrently \"pnpm build --watch\" \"pnpm:y:watch\"","lint":"eslint .","test":"vitest run --passWithNoTests","build":"tsdown src/index.ts --format cjs,esm --dts --tsconfig tsconfig.build.json --no-hash","y:watch":"chokidar dist --initial --silent -c \"yalc publish --push\"","lint:fix":"eslint . --fix","typecheck":"ts-config-typecheck","test:watch":"vitest"},"_npmUser":{"name":"kevupton","email":"kevin@upton.tech"},"prettier":"@auriclabs/prettier-config","_resolved":"/tmp/2de44b19446ee0d2784ba612c964f219/auriclabs-events-infra-1.0.0.tgz","_integrity":"sha512-qCSKMnsJ1/OVlgvORYgONXbqT+MeyZl7Y9LuKF23aMKD+B9qAvF6GSu+aGyt+unrF2D2tXkqGhpk0UcgVlXbuA==","repository":{"url":"git+https://github.com/auriclabs/packages.git","type":"git","directory":"packages/events-infra"},"_npmVersion":"10.8.2","description":"SST infrastructure helpers for DynamoDB event stores","directories":{},"_nodeVersion":"20.20.1","dependencies":{},"publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"devDependencies":{"sst":"^4.3.7","@auriclabs/events":"0.4.0","@auriclabs/sst-types":"0.1.0"},"peerDependencies":{"sst":"^4.3.7","@auriclabs/events":"^0.4.0","@auriclabs/sst-types":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/events-infra_1.0.0_1774388669729_0.05403712918981629","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@auriclabs/events-infra","version":"1.0.1","description":"SST infrastructure helpers for DynamoDB event stores","prettier":"@auriclabs/prettier-config","main":"src/index.ts","types":"src/index.ts","exports":{".":{"types":"./src/index.ts","default":"./src/index.ts"}},"keywords":[],"author":"","type":"module","license":"ISC","dependencies":{},"devDependencies":{"sst":"^4.3.7","@auriclabs/events":"0.4.1","@auriclabs/sst-types":"0.1.0"},"peerDependencies":{"@auriclabs/events":"^0.4.1","@auriclabs/sst-types":"^0.1.0","sst":"^4.3.7"},"publishConfig":{"registry":"https://registry.npmjs.org/"},"repository":{"type":"git","url":"git+https://github.com/auriclabs/packages.git","directory":"packages/events-infra"},"scripts":{"build":"tsdown src/index.ts --format cjs,esm --dts --tsconfig tsconfig.build.json --no-hash","dev":"concurrently \"pnpm build --watch\" \"pnpm:y:watch\"","y:watch":"chokidar dist --initial --silent -c \"yalc publish --push\"","lint":"eslint .","lint:fix":"eslint . --fix","typecheck":"ts-config-typecheck","test":"vitest run --passWithNoTests","test:watch":"vitest"},"_id":"@auriclabs/events-infra@1.0.1","bugs":{"url":"https://github.com/auriclabs/packages/issues"},"homepage":"https://github.com/auriclabs/packages#readme","_integrity":"sha512-xjMZy6pRWv1YUAWnDcKqO+QAWuxbWp/I/dN5T/2ww92eS+HfGUMN+uasuW2VSfLRNP81F6n+NBv62+OyhIrp5g==","_resolved":"/tmp/dcce12875c44b278499037109e3bfeb8/auriclabs-events-infra-1.0.1.tgz","_from":"file:auriclabs-events-infra-1.0.1.tgz","_nodeVersion":"20.20.1","_npmVersion":"10.8.2","dist":{"integrity":"sha512-xjMZy6pRWv1YUAWnDcKqO+QAWuxbWp/I/dN5T/2ww92eS+HfGUMN+uasuW2VSfLRNP81F6n+NBv62+OyhIrp5g==","shasum":"196c7af01fb538f5afe2a380709a62c6ccb27c12","tarball":"https://registry.npmjs.org/@auriclabs/events-infra/-/events-infra-1.0.1.tgz","fileCount":19,"unpackedSize":21748,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDYF0M58k7Q00+VASNjytiny6D9rkAXtMAsWf0xhu4WCQIgYZyPmjWwABEW/2LOatWGSg8cYVJM3PQW6jpIxV/A+K4="}]},"_npmUser":{"name":"kevupton","email":"kevin@upton.tech"},"directories":{},"maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/events-infra_1.0.1_1774396093421_0.44701420185317264"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-21T23:08:33.660Z","modified":"2026-03-24T23:48:13.684Z","0.1.0":"2026-03-21T23:08:33.916Z","0.2.0":"2026-03-23T18:29:57.933Z","0.3.0":"2026-03-24T20:34:35.573Z","1.0.0":"2026-03-24T21:44:29.880Z","1.0.1":"2026-03-24T23:48:13.559Z"},"bugs":{"url":"https://github.com/auriclabs/packages/issues"},"license":"ISC","homepage":"https://github.com/auriclabs/packages#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/auriclabs/packages.git","directory":"packages/events-infra"},"description":"SST infrastructure helpers for DynamoDB event stores","maintainers":[{"name":"kevupton","email":"kevin@upton.tech"}],"readme":"# @auriclabs/events-infra\n\nSST infrastructure helpers for provisioning DynamoDB event stores, EventBridge buses, and DynamoDB stream subscriptions.\n\n## Setup\n\n```bash\npnpm add @auriclabs/events-infra\n```\n\n### Peer dependencies\n\n```bash\npnpm add sst @auriclabs/sst-types\n```\n\n## API Reference\n\n### `createEventStore(name, options?)`\n\nCreates a DynamoDB table configured for event sourcing with `pk`/`sk` keys, DynamoDB Streams enabled, and `STANDARD_INFREQUENT_ACCESS` storage class.\n\n```typescript\nimport { createEventStore } from '@auriclabs/events-infra';\n\nexport const table = createEventStore('EventStoreTable');\n```\n\nOptions:\n\n```typescript\ninterface CreateEventStoreOptions {\n  transform?: {\n    table?: Record<string, unknown>;  // Override default table transform\n  };\n}\n```\n\nReturns: `sst.aws.Dynamo`\n\n### `createEventBus(name)`\n\nCreates an EventBridge bus.\n\n```typescript\nimport { createEventBus } from '@auriclabs/events-infra';\n\nexport const bus = createEventBus('EventBus');\n```\n\nReturns: `sst.aws.Bus`\n\n### `subscribeEventStream(config)`\n\nSubscribes a Lambda handler to the DynamoDB event store stream. Filters for `itemType: 'event'` records only (skips HEAD updates). Links the EventBridge bus and all listener queues, and sets the `QUEUE_URL_LIST` environment variable.\n\n```typescript\nimport { subscribeEventStream } from '@auriclabs/events-infra';\n\nsubscribeEventStream({\n  table: eventTable,\n  bus: eventBus,\n  listenerQueues: [crawlerQueue, indexerQueue],\n  handlerPath: 'services/event/handlers/event-store-table-stream.handler',\n});\n```\n\nConfig:\n\n```typescript\ninterface SubscribeEventStreamConfig {\n  table: sst.aws.Dynamo;\n  bus: sst.aws.Bus;\n  listenerQueues: sst.aws.Queue[];\n  handlerPath: string;  // Lambda handler path\n}\n```\n\n## Full Example\n\n```typescript\n// infra/event.ts\nimport { createEventStore, createEventBus, subscribeEventStream } from '@auriclabs/events-infra';\nimport * as services from './services';\n\nexport const table = createEventStore('EventStoreTable');\nexport const bus = createEventBus('EventBus');\n\nsubscribeEventStream({\n  table,\n  bus,\n  listenerQueues: [\n    services.crawler.eventListenerQueue,\n    services.indexer.eventListenerQueue,\n  ],\n  handlerPath: 'services/event/handlers/event-store-table-stream.handler',\n});\n```\n\nThe stream handler should use `createStreamHandler()` from `@auriclabs/events`:\n\n```typescript\n// services/event/handlers/event-store-table-stream.ts\nimport { createStreamHandler } from '@auriclabs/events';\nimport { Resource } from 'sst';\n\nexport const handler = createStreamHandler({\n  busName: Resource.EventBus.name,\n  queueUrls: JSON.parse(process.env.QUEUE_URL_LIST ?? '[]'),\n});\n```\n","readmeFilename":"README.md"}