{"_id":"@apiquest/plugin-sse","_rev":"6-aadc5be7733bb5d43bd94c06d3018576","name":"@apiquest/plugin-sse","dist-tags":{"latest":"1.0.9"},"versions":{"1.0.2":{"name":"@apiquest/plugin-sse","version":"1.0.2","keywords":["api","http","quest","plugin"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","_id":"@apiquest/plugin-sse@1.0.2","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"dist":{"shasum":"18812a4bb4a0c38d7df85d4738853daf864cb616","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.2.tgz","fileCount":15,"integrity":"sha512-LWVqKY3Wf31OJ4r0Hyfv6/HpBYkwscgSOFzZ8OiSG56yNwhg3RRLg91x7ROu+O9Vcx0cZ/o35/SefqiFo8jtyw==","signatures":[{"sig":"MEUCIQDA1gQBNCkJH5OhlgtDYYGw4cQ8/EQy00hbvseG6Cg1QQIgbx9xZcH3VJ96D2Q0buRyb89DljU2PpoROapCJHXyZdU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":85068},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"fd7e8be20c49d671763ff09ac7ecfc919d55026d","scripts":{"dev":"rollup -c --watch","test":"vitest","build":"rollup -c && tsc --emitDeclarationOnly"},"_npmUser":{"name":"lto-dev","email":"lto-dev@humanhub.io"},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"],"strictAuthList":false}}},"_npmVersion":"11.7.0","description":"SSE protocol plugin for Quest","directories":{},"_nodeVersion":"22.16.0","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.0.0","vitest":"^4.0.18","typescript":"^5.3.3","@types/node":"^20.10.6","@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^25.0.0","@rollup/plugin-typescript":"^11.0.0","@rollup/plugin-node-resolve":"^15.0.0"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-sse_1.0.2_1770937515627_0.559022217319334","host":"s3://npm-registry-packages-npm-production"}},"1.0.4":{"name":"@apiquest/plugin-sse","version":"1.0.4","keywords":["api","http","quest","plugin"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","_id":"@apiquest/plugin-sse@1.0.4","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"homepage":"https://github.com/hh-apiquest/fracture#readme","bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"dist":{"shasum":"487ff805edfe033172322dc75007679edfa84ac1","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.4.tgz","fileCount":13,"integrity":"sha512-5+1WTtwqmQxfoaRwe+X0U5yp1nHqJO4jFQMrAZ9d53LBY7ovu/KXlawgDJd7jarJtpVZNnB3Z5Tw36KAHCO1HQ==","signatures":[{"sig":"MEUCIEI7kZac4tagp334pS1lbDUWchpCLXoJvWFEewB+18szAiEAvCL9/1dV5mSiBAk6YAv7JixkxI2KMyxhw5BzBnMATsc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiquest%2fplugin-sse@1.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":86205},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"ecfa17ec870189bdf66edeb5e5f937152303601b","scripts":{"dev":"rollup -c --watch","test":"vitest","build":"rollup -c && tsc --emitDeclarationOnly"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc780415-e9c4-4877-94d7-8c0de37a385d"}},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"],"strictAuthList":false}}},"repository":{"url":"git+https://github.com/hh-apiquest/fracture.git","type":"git","directory":"packages/plugin-sse"},"_npmVersion":"11.10.0","description":"SSE protocol plugin for ApiQuest","directories":{},"_nodeVersion":"20.20.0","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.57.1","vitest":"^4.0.18","typescript":"^5.3.3","@types/node":"^25.2.3","@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^12.3.0","@rollup/plugin-node-resolve":"^16.0.3"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-sse_1.0.4_1770955811120_0.8935623823833156","host":"s3://npm-registry-packages-npm-production"}},"1.0.5":{"name":"@apiquest/plugin-sse","version":"1.0.5","keywords":["api","http","quest","plugin"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","_id":"@apiquest/plugin-sse@1.0.5","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"homepage":"https://github.com/hh-apiquest/fracture#readme","bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"dist":{"shasum":"2195da4cbb9278e6e80e0ececa9f9070a3ff3631","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.5.tgz","fileCount":12,"integrity":"sha512-Det+wkL8efN114Jzit9OZge4xvFdorKAd1vgnokQMxdtmVIGNTQ238IYLG5zOy6wu27Q2bp8udALI+Jmc2Kp/g==","signatures":[{"sig":"MEUCIBnJfSNnlXFLo3YmAA0aLLsAowhnmfWRvbNVrbpDvns2AiEAh0fSpSY4uXLgOxOsTHXBUWDOf7NeTKAYZphocDy3fbE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiquest%2fplugin-sse@1.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":71091},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"368dd13b898628c3c57b06cc4bf60d16668811e1","scripts":{"dev":"rollup -c --watch","test":"vitest","build":"rollup -c && tsc --emitDeclarationOnly"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc780415-e9c4-4877-94d7-8c0de37a385d"}},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"]}}},"repository":{"url":"git+https://github.com/hh-apiquest/fracture.git","type":"git","directory":"packages/plugin-sse"},"_npmVersion":"11.10.0","description":"SSE protocol plugin for ApiQuest","directories":{},"_nodeVersion":"20.20.0","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.57.1","vitest":"^4.0.18","typescript":"^5.3.3","@types/node":"^25.2.3","@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^12.3.0","@rollup/plugin-node-resolve":"^16.0.3"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-sse_1.0.5_1771032921771_0.7499984825394599","host":"s3://npm-registry-packages-npm-production"}},"1.0.6":{"name":"@apiquest/plugin-sse","version":"1.0.6","keywords":["api","http","quest","plugin"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","_id":"@apiquest/plugin-sse@1.0.6","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"homepage":"https://github.com/hh-apiquest/fracture#readme","bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"dist":{"shasum":"883401c5bb625dd045bc6815ec107254258b0eae","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.6.tgz","fileCount":12,"integrity":"sha512-SCqt1d5soDNsGoHsjan6B+o0SmJgb+D8hww/3uphZOmLhxovRS37Zie6dIbg7+M+U3fwfjRFVQmWXfGNApnbzw==","signatures":[{"sig":"MEQCIHSGha1WQ0m62FxK9wZyDLWdq/DCWlzjnCjR+AWNkpyIAiApcWZuhraV2Wb+ydLXuBbaSQD9Hj8qyOuRgM8cyNM8PA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiquest%2fplugin-sse@1.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":79495},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"17e6fe16873a66ae8ff3565d1f064752ef3b2f81","scripts":{"dev":"rollup -c --watch","test":"vitest","build":"rollup -c && tsc --emitDeclarationOnly"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc780415-e9c4-4877-94d7-8c0de37a385d"}},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"]}}},"repository":{"url":"git+https://github.com/hh-apiquest/fracture.git","type":"git","directory":"packages/plugin-sse"},"_npmVersion":"11.10.0","description":"SSE protocol plugin for ApiQuest","directories":{},"_nodeVersion":"20.20.0","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.57.1","vitest":"^4.0.18","typescript":"^5.3.3","@types/node":"^25.2.3","@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^12.3.0","@rollup/plugin-node-resolve":"^16.0.3"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-sse_1.0.6_1771210869811_0.5986389724646191","host":"s3://npm-registry-packages-npm-production"}},"1.0.8":{"name":"@apiquest/plugin-sse","version":"1.0.8","keywords":["api","http","quest","plugin"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","_id":"@apiquest/plugin-sse@1.0.8","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"homepage":"https://github.com/hh-apiquest/fracture#readme","bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"dist":{"shasum":"426f9286ce7b99d5fac972d8d11106c7035636a0","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.8.tgz","fileCount":12,"integrity":"sha512-npFbn33zQpnfgio7ktwKmSKq7vkMh62xflRzOqowIH86/tzSNpP3fLt/1nXrV6dMzsJVAEO0KNs9mf1vLxmW5g==","signatures":[{"sig":"MEUCIE49VQRtEOfEHjvC6nH52Oyg1ONfM3oH89Twuj46y9JAAiEAt9U7GFXr2awv1Gv21x2b3peXufROM+6Jr+TiAqxKjo0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiquest%2fplugin-sse@1.0.8","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":79520},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","gitHead":"3437c3f8ec14a804ffc2a2dd072fe694b9287907","scripts":{"dev":"rollup -c --watch","test":"vitest","build":"rollup -c && tsc --emitDeclarationOnly"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc780415-e9c4-4877-94d7-8c0de37a385d"}},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"]}}},"repository":{"url":"git+https://github.com/hh-apiquest/fracture.git","type":"git","directory":"packages/plugin-sse"},"_npmVersion":"11.11.0","description":"SSE protocol plugin for ApiQuest","directories":{},"_nodeVersion":"20.20.0","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"_hasShrinkwrap":false,"devDependencies":{"rollup":"^4.57.1","vitest":"^4.0.18","typescript":"^5.3.3","@types/node":"^25.2.3","@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-typescript":"^12.3.0","@rollup/plugin-node-resolve":"^16.0.3"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/plugin-sse_1.0.8_1772561832691_0.45348844008671274","host":"s3://npm-registry-packages-npm-production"}},"1.0.9":{"name":"@apiquest/plugin-sse","version":"1.0.9","description":"SSE protocol plugin for ApiQuest","main":"dist/index.js","types":"dist/index.d.ts","type":"module","repository":{"type":"git","url":"git+https://github.com/hh-apiquest/fracture.git","directory":"packages/plugin-sse"},"scripts":{"build":"rollup -c && tsc --emitDeclarationOnly","dev":"rollup -c --watch","test":"vitest"},"keywords":["apiquest","sse","server-sent-events","plugin","fracture"],"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","dependencies":{"got":"^14.6.6","hpagent":"^1.2.0"},"devDependencies":{"@apiquest/types":"workspace:*","@rollup/plugin-commonjs":"^29.0.0","@rollup/plugin-node-resolve":"^16.0.3","@rollup/plugin-typescript":"^12.3.0","@types/node":"^25.2.3","rollup":"^4.57.1","typescript":"^5.3.3","vitest":"^4.0.18"},"peerDependencies":{"@apiquest/types":"^1.0.0"},"apiquest":{"type":"protocol","runtime":["fracture"],"capabilities":{"provides":{"protocols":["sse"]},"supports":{"authTypes":["bearer","basic","oauth2","apikey","digest","ntlm"]}}},"gitHead":"f8a7595a8b6f65c9388c6a394fda2b23db45c850","_id":"@apiquest/plugin-sse@1.0.9","bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"homepage":"https://github.com/hh-apiquest/fracture#readme","_nodeVersion":"20.20.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-/3MYFcuiBB3Mr9EkPmnpoH7xz+PObqlhRDOTWTf6BmhU4LyvaHERwxsAU3cRh9BjuskrqvTj+t8nUtQKWJ5Cng==","shasum":"eab8df602a558323e2c381e83b67dd0a3dc2bf43","tarball":"https://registry.npmjs.org/@apiquest/plugin-sse/-/plugin-sse-1.0.9.tgz","fileCount":12,"unpackedSize":79553,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apiquest%2fplugin-sse@1.0.9","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDyDSVBIUI8p9TS/+DoY+teHtNocDWpyEH+zklXZZS9QQIgbEpHlLN3Pp5/2DIeGLkWlGYSt5XgmPMtfGu2nomz/ps="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc780415-e9c4-4877-94d7-8c0de37a385d"}},"directories":{},"maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-sse_1.0.9_1772591658038_0.3543224524767017"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-12T23:05:15.535Z","modified":"2026-03-04T02:34:18.474Z","1.0.2":"2026-02-12T23:05:15.765Z","1.0.4":"2026-02-13T04:10:11.277Z","1.0.5":"2026-02-14T01:35:21.937Z","1.0.6":"2026-02-16T03:01:09.954Z","1.0.8":"2026-03-03T18:17:12.851Z","1.0.9":"2026-03-04T02:34:18.210Z"},"bugs":{"url":"https://github.com/hh-apiquest/fracture/issues"},"author":{"name":"ApiQuest"},"license":"AGPL-3.0-or-later","homepage":"https://github.com/hh-apiquest/fracture#readme","keywords":["apiquest","sse","server-sent-events","plugin","fracture"],"repository":{"type":"git","url":"git+https://github.com/hh-apiquest/fracture.git","directory":"packages/plugin-sse"},"description":"SSE protocol plugin for ApiQuest","maintainers":[{"name":"lto-dev","email":"lto-dev@humanhub.io"}],"readme":"# @apiquest/plugin-sse\n\nServer-Sent Events (SSE) protocol plugin for ApiQuest. Provides support for testing SSE endpoints with event streaming and message validation.\n\n## Installation\n\n```bash\n# Using npm\nnpm install -g @apiquest/plugin-sse\n\n# Or using fracture CLI\nfracture plugin install sse\n```\n\n## Features\n\n- SSE connection management\n- Event streaming with named events\n- Message data validation\n- Event counting and assertions\n- Custom headers support\n- Authentication integration (via `@apiquest/plugin-auth`)\n- Timeout configuration\n\n## Usage\n\nSet the collection protocol to `sse`:\n\n```json\n{\n  \"$schema\": \"https://apiquest.net/schemas/collection-v1.0.json\",\n  \"protocol\": \"sse\",\n  \"items\": [\n    {\n      \"type\": \"request\",\n      \"id\": \"stream-events\",\n      \"name\": \"Stream Server Events\",\n      \"data\": {\n        \"url\": \"https://api.example.com/events\",\n        \"timeout\": 30000,\n        \"scripts\": [\n          {\n            \"event\": \"onMessage\",\n            \"script\": \"quest.test('Message received', () => {\\n  const msg = quest.message;\\n  expect(msg.data).to.be.a('string');\\n});\"\n          },\n          {\n            \"event\": \"onComplete\",\n            \"script\": \"quest.test('Stream completed', () => {\\n  expect(quest.messages.length).to.be.greaterThan(0);\\n});\"\n          }\n        ]\n      }\n    }\n  ]\n}\n```\n\n### With Custom Headers\n\n```json\n{\n  \"data\": {\n    \"url\": \"https://api.example.com/stream\",\n    \"headers\": {\n      \"Accept\": \"text/event-stream\",\n      \"x-stream-id\": \"{{streamId}}\"\n    },\n    \"timeout\": 60000\n  }\n}\n```\n\n### Event Scripts\n\nSSE requests support event-based scripts:\n\n- **onMessage** - Runs for each received message\n- **onError** - Runs when an error occurs\n- **onComplete** - Runs when the stream completes\n\n```json\n{\n  \"data\": {\n    \"scripts\": [\n      {\n        \"event\": \"onMessage\",\n        \"script\": \"const data = JSON.parse(quest.message.data);\\nquest.variables.set('lastEventId', data.id);\\n\\nquest.test('Valid event data', () => {\\n  expect(data).to.have.property('timestamp');\\n});\"\n      },\n      {\n        \"event\": \"onError\",\n        \"script\": \"console.error('Stream error:', quest.error);\"\n      },\n      {\n        \"event\": \"onComplete\",\n        \"script\": \"quest.test('Received messages', () => {\\n  expect(quest.messages.length).to.equal(10);\\n});\"\n      }\n    ]\n  }\n}\n```\n\n### Message Counting\n\nUse `quest.expectMessages()` in the preRequestScript to enable deterministic test counting:\n\n```json\n{\n  \"type\": \"request\",\n  \"id\": \"stream-events\",\n  \"name\": \"Stream Server Events\",\n  \"preRequestScript\": \"quest.expectMessages(5, 10000);\",\n  \"data\": {\n    \"url\": \"https://api.example.com/events\",\n    \"scripts\": [\n      {\n        \"event\": \"onMessage\",\n        \"script\": \"quest.test('Message received', () => {\\n  expect(quest.message.data).to.exist;\\n});\"\n      }\n    ]\n  }\n}\n```\n\nThis informs the runner to expect 5 messages, enabling accurate test count reporting (5 messages × tests per message).\n\n## Response Handling\n\nAccess SSE data in scripts:\n\n```javascript\n// In onMessage script\nquest.test('Event has data', () => {\n  expect(quest.message.data).to.be.a('string');\n});\n\nquest.test('Event type is update', () => {\n  expect(quest.message.event).to.equal('update');\n});\n\n// In onComplete script\nquest.test('Received all messages', () => {\n  expect(quest.messages.length).to.equal(5);\n});\n\nquest.test('All messages valid', () => {\n  quest.messages.forEach(msg => {\n    const data = JSON.parse(msg.data);\n    expect(data).to.have.property('id');\n  });\n});\n```\n\n## Compatibility\n\n- **Authentication:** Works with `@apiquest/plugin-auth` for Bearer, Basic, API Key\n- **Node.js:** Requires Node.js 20+\n\n## Documentation\n\n- [Fracture Documentation](https://apiquest.net/docs/fracture)\n- [Schema Reference](https://apiquest.net/schemas/collection-v1.0.json)\n\n## License\n\nDual-licensed under AGPL-3.0-or-later and commercial license. See LICENSE for details.\n","readmeFilename":"README.md"}