{"_id":"@abstraks-dev/event-types","_rev":"8-04698326dbe38eeea1eb8f0b3c86a105","name":"@abstraks-dev/event-types","dist-tags":{"latest":"2.5.0"},"versions":{"1.0.0":{"name":"@abstraks-dev/event-types","version":"1.0.0","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@1.0.0","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"aa2f10a5d93ba96a2ffa4610a40cf55fea708327","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-1.0.0.tgz","fileCount":8,"integrity":"sha512-c0GyYObjOqMSQ0/xnbBYyM+0s3wIESOBYYpV8P51+g3IhzIeldsKH7pCiGUUiuxGw8kDFuWXtnGRVImnPf5GxA==","signatures":[{"sig":"MEUCIQD1nb1HFkU+JN2gl3lEXHrzprye/dYdmJ6XRbG6eSeazgIgO94FN6n2/UkMe4ZBo/MY4l5mylKfg1UkbldM7VMo/B4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11903},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"b937c33da23a8ab00abf04f2e1296e15caf7ed54","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"11.5.1","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"24.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_1.0.0_1784142745809_0.22611523947457624","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@abstraks-dev/event-types","version":"1.0.1","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@1.0.1","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"cff96af40d17b0b5522bf2251a4c688f93be9a1f","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-1.0.1.tgz","fileCount":8,"integrity":"sha512-oimyS1YNqhahHSgNN7OBuEX+73A8+jmH4OuQZUKcKBZRmmXBvjE2axktBd77Jp3jG1cc7FlQLZJa8B7ns/Nepg==","signatures":[{"sig":"MEUCIQDTkOXV1BdDBTB5VtEl1fqCONcv55sZu1y9itqtZxAzoAIgfhd/tb6PXdMCxDacMkMmjyP9oCVZvACD/0q/r2oziu0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13213},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"c0ab6def4804bd223e869468f74d7fdbda2abca9","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"11.5.1","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"24.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_1.0.1_1784328049678_0.211062764589105","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@abstraks-dev/event-types","version":"2.0.0","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@2.0.0","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"75d447a43afd9c598c6e8116b7ad21ef70b424a1","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.0.0.tgz","fileCount":8,"integrity":"sha512-5Ojp8AmRJBcmAeqhphMCekJXyF+JNgAEBOGfHXNNsd75W0w6kDx2EOxyebN2J2gJxiZF06Ux6CpqM9hwVsVVLQ==","signatures":[{"sig":"MEQCIEKusVRIVk1SU0x+XcBMu41hXQyP3cZWIRsIsFW6vfP7AiBvvk1b3mXumz6FgK8V8atHJDtSHn3NG746/swoPFi19A==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13417},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"8f203da4d0978ad4b30a0006f79c6aa7f3446e7d","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"11.5.1","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"24.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_2.0.0_1784567762713_0.34898527025562087","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@abstraks-dev/event-types","version":"2.1.0","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@2.1.0","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"f146db860e7bcb7e21ba43a86064466db11fb7ca","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.1.0.tgz","fileCount":10,"integrity":"sha512-eg49Z9rOf3sVrinGUBR/bq5QNEDTPQoLLEC/jWMQ94iTcG+OdVoTlIyBzNLv/q213pL4PKe8sCqRre3jGlmfCQ==","signatures":[{"sig":"MEYCIQDS5bFHP9P/sBYo8eIRMwBe85BVyPHvpfiHGWHIW6EUYAIhAPzSRKJlaY7BuZJaer8VEHkVGeXohmqlENAqUjqzZQxD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36524},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"d9583b5ea804b3a70c9d6cd07b63793588f66be8","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"11.5.1","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"24.5.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_2.1.0_1785791541080_0.9377536349863564","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@abstraks-dev/event-types","version":"2.2.0","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@2.2.0","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"f594a6cac2dd46849670a545655881d32651c073","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.2.0.tgz","fileCount":10,"integrity":"sha512-wnkW3hekTFFy8MwUMr7kTW9IfKiTLFHGfyaWmYZv8F4vgXY8S15nf/mQQ79Bw83QktjkoCuKkgAHFncis7HpJA==","signatures":[{"sig":"MEUCIGmQYWXV5eUNx5msam8sinRQAQxqc7tLEifJcLt8dHkiAiEAi/y45YdozkMnRvrx7ewoez3oy1CeQ9lp3g07V21vkYc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":64977},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"66a207a3a90c936e0f8be82c4ae314aedf237ad7","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"10.8.2","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_2.2.0_1786569704059_0.7386725051204002","host":"s3://npm-registry-packages-npm-production"}},"2.3.1":{"name":"@abstraks-dev/event-types","version":"2.3.1","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@2.3.1","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"4c83a22d798e768583317cbce9531eb8073464c0","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.3.1.tgz","fileCount":12,"integrity":"sha512-8EjOwiJjz86CMwo0uRplky+p+1i5PM5Kjtf+cMTlFlwuyLG7b/s6PJUGYPlj/EVXNNcyNFfAmnECvnEoMk1rOg==","signatures":[{"sig":"MEYCIQCgdpTMf4kQSVT5xQL0RsO1p9bo4qKUvYazfp2tO7XVQAIhAK0FWagM5LhA6xF6jeQjzQ8f7XF5r3xx9aSVdIvR9WHB","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":105621},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"1492564baeca8dcfbb61b3591402d93f99e7f536","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"10.8.2","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_2.3.1_1787078824774_0.6535075330149998","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@abstraks-dev/event-types","version":"2.4.0","keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","_id":"@abstraks-dev/event-types@2.4.0","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"homepage":"https://github.com/Abstraks-co/shared-modules#readme","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"dist":{"shasum":"e5025198a39faa9bce942305805dd30bce954688","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.4.0.tgz","fileCount":12,"integrity":"sha512-rToja5CAq3zwx7afgei4fV2D/o31TtBwmp0kO/ypSATEJyv3vizw3SFu+OlMmAMP1k46fuLXKXR8U9MgZP0YHg==","signatures":[{"sig":"MEUCIQC/161SRal3fPeGaA0yLNu1uzKUL8tFbP/JEfVUUQRcwQIgfYQN4Sk235cKXyJbsDIZ8WFrbUMmux5/pBiETqO4mcM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":121467},"main":"src/index.js","type":"module","exports":{".":"./src/index.js"},"gitHead":"9ae12ea49f487614eeca8867a55b8dbb6896e0c8","scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"repository":{"url":"git+https://github.com/Abstraks-co/shared-modules.git","type":"git","directory":"packages/event-types"},"_npmVersion":"10.8.2","description":"Shared event type constants for Abstraks microservices","directories":{},"_nodeVersion":"20.20.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/event-types_2.4.0_1787183155874_0.6201040370824904","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"name":"@abstraks-dev/event-types","version":"2.5.0","description":"Shared event type constants for Abstraks microservices","type":"module","main":"src/index.js","exports":{".":"./src/index.js"},"scripts":{"test":"NODE_OPTIONS=--experimental-vm-modules jest"},"keywords":["event-types","event-sourcing","microservices","abstraks"],"author":{"name":"Abstraks"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Abstraks-co/shared-modules.git","directory":"packages/event-types"},"_id":"@abstraks-dev/event-types@2.5.0","gitHead":"1fee0cb22bc05d162a177173672e79267071bdcf","bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"homepage":"https://github.com/Abstraks-co/shared-modules#readme","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-BbSJSU7jpFISxUM6D7022OJbxuQuUHtiKZORwVKOlqBPyKm1yud0zMiSAxUogkwTvlBl67y3PsJ8Ap0RmvUskw==","shasum":"43211958367d3e2451713291ff69d3e0ec0e30f5","tarball":"https://registry.npmjs.org/@abstraks-dev/event-types/-/event-types-2.5.0.tgz","fileCount":12,"unpackedSize":127837,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCa2FbDVpVhlLlvLGZkiG+F+MH4ZHe3fkZ6hLF3y32d8AIhALwxpDPqbnFXE6Vf3pz1bLvrOj43qu60QqDaFWAd6LKZ"}]},"_npmUser":{"name":"abstraks-dev","email":"contactabstraks@gmail.com"},"directories":{},"maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/event-types_2.5.0_1787869156235_0.10250379365755036"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-15T19:12:25.640Z","modified":"2026-08-27T22:19:16.547Z","1.0.0":"2026-07-15T19:12:25.951Z","1.0.1":"2026-07-17T22:40:49.849Z","2.0.0":"2026-07-20T17:16:02.833Z","2.1.0":"2026-08-03T21:12:21.237Z","2.2.0":"2026-08-12T21:21:44.247Z","2.3.1":"2026-08-18T18:47:04.931Z","2.4.0":"2026-08-19T23:45:56.028Z","2.5.0":"2026-08-27T22:19:16.393Z"},"bugs":{"url":"https://github.com/Abstraks-co/shared-modules/issues"},"author":{"name":"Abstraks"},"license":"MIT","homepage":"https://github.com/Abstraks-co/shared-modules#readme","keywords":["event-types","event-sourcing","microservices","abstraks"],"repository":{"type":"git","url":"git+https://github.com/Abstraks-co/shared-modules.git","directory":"packages/event-types"},"description":"Shared event type constants for Abstraks microservices","maintainers":[{"name":"abstraks-dev","email":"contactabstraks@gmail.com"}],"readme":"# @abstraks-dev/event-types\n\nShared event type constants for Abstraks microservices. Replaces raw string literals across all services with a single source of truth, preventing typos and routing mismatches.\n\n## Installation\n\n```bash\nnpm install @abstraks-dev/event-types\n```\n\n## Usage\n\n```js\nimport { AUTH_EVENTS, SOCIAL_EVENTS, USER_EVENTS, MEDIA_EVENTS } from '@abstraks-dev/event-types';\n\n// Publishing\nawait publishToEventBus({ type: AUTH_EVENTS.USER_SIGNUP, data: { ... } });\n\n// Consuming\nswitch (event.type) {\n    case SOCIAL_EVENTS.POST_CREATED:\n        // handle post created\n        break;\n    case USER_EVENTS.USER_DELETED:\n        // handle user deleted\n        break;\n}\n\n// Guard unknown event types at service boundaries\nimport { isEventType } from '@abstraks-dev/event-types';\nif (!isEventType(event.type)) {\n    throw new Error(`Unknown event type: ${event.type}`);\n}\n```\n\n## Exports\n\n| Export | Description |\n| --- | --- |\n| `AUTH_EVENTS` | Auth service events (camelCase — see convention note) |\n| `SOCIAL_EVENTS` | Social service events (kebab-case) |\n| `USER_EVENTS` | Cross-service user lifecycle events (kebab-case) |\n| `MEDIA_EVENTS` | Media service events (kebab-case) |\n| `EVENT_TYPES` | All canonical values merged into one flat frozen object |\n| `ALL_EVENT_TYPES` | Frozen array of all canonical value strings |\n| `QUERY_LEGACY_ALIASES` | PascalCase aliases accepted by Query Service for backward compatibility |\n| `isEventType(value)` | Returns `true` if `value` is a canonical wire event type |\n\n## Naming convention\n\n**New event types use lowercase kebab-case**: `'post-created'`, `'user-deleted'`, etc.\n\n**Auth events are an exception** — they use camelCase (`'userSignup'`, `'googleLogin'`, etc.) because these values are already deployed on the wire across all services. Changing them would break all consumers. When the Auth Service is eventually migrated, the constants here will be updated and the old values removed.\n\nDo not introduce new camelCase event types.\n\n## Adding a new event type\n\n1. Add the constant to the appropriate domain file (`src/auth-events.js`, `src/social-events.js`, etc.) using kebab-case.\n2. Run `npm test` in this package — the uniqueness test will catch collisions.\n3. Bump the package version and publish.\n4. Update the consuming service's `package.json` to the new version.\n\n## Query legacy aliases\n\n`QUERY_LEGACY_ALIASES` holds the PascalCase event type strings that some producers historically published before canonical names were established. The Query Service accepts both the canonical and legacy values so that historical events in DynamoDB still replay correctly.\n\nKeys are SCREAMING_CASE so switch cases stay readable alongside canonical constants:\n\n```js\nimport { SOCIAL_EVENTS, QUERY_LEGACY_ALIASES } from '@abstraks-dev/event-types';\n\ncase SOCIAL_EVENTS.POST_CREATED:          // canonical: 'post-created'\ncase QUERY_LEGACY_ALIASES.POST_CREATED:   // legacy:    'PostCreated'\n    await handlePostCreated(data);\n    break;\n```\n\n**Do not add new aliases.** New publishers must use the canonical kebab-case constants. The legacy aliases exist only for backward compatibility with historical event data.\n\n## Versioning\n\nThis package follows semantic versioning:\n\n- **Patch** (`1.0.x`): Non-breaking fixes — typo corrections in constant names that have no consumers yet, test/doc updates.\n- **Minor** (`1.x.0`): Additive changes — new constants or exports that do not remove or rename existing ones.\n- **Major** (`x.0.0`): Breaking changes — removing or renaming any exported constant.\n\n**Wire values must never change without a coordinated producer/consumer migration.** A constant's serialized string value is part of the public API. Renaming a constant property (e.g. `REPLY_EDITED` → `COMMENT_REPLY_EDITED`) is a minor release only when no consumers have shipped against the old property name. Any change to the actual string value (e.g. `'reply-edited'` → `'comment-reply-edited'`) requires a major release and a coordinated deploy of all producers and consumers.\n","readmeFilename":"README.md"}