@toa.io/extensions.realtime 1.0.0-alpha.284 → 1.0.0-alpha.287
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -337
- package/components/realtime.streams/manifest.toa.yaml +4 -2
- package/components/realtime.streams/operations/create.js +1 -1
- package/components/realtime.streams/operations/lib/Stash.js +1 -1
- package/components/realtime.streams/operations/lib/Stream.js +1 -1
- package/components/realtime.streams/operations/push.js +1 -1
- package/components/realtime.streams/source/create.ts +7 -10
- package/components/realtime.streams/source/lib/Stash.ts +24 -26
- package/components/realtime.streams/source/lib/Stream.ts +9 -7
- package/components/realtime.streams/source/push.ts +5 -3
- package/components/realtime.streams/tsconfig.tsbuildinfo +1 -1
- package/context.toa.yaml +2 -2
- package/cucumber.mjs +3 -0
- package/features/steps/Components.ts +8 -7
- package/features/steps/Realtime.ts +4 -5
- package/features/steps/Streams.ts +9 -12
- package/features/steps/components/messages/manifest.toa.yaml +16 -18
- package/package.json +4 -4
- package/source/Composition.ts +5 -5
- package/source/Factory.ts +5 -4
- package/source/Realtime.ts +16 -11
- package/source/Receiver.ts +29 -20
- package/source/Routes.ts +10 -8
- package/source/extension.ts +20 -10
- package/transpiled/Composition.js.map +1 -1
- package/transpiled/Factory.d.ts +1 -1
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Realtime.js.map +1 -1
- package/transpiled/Receiver.d.ts +2 -1
- package/transpiled/Receiver.js +5 -3
- package/transpiled/Receiver.js.map +1 -1
- package/transpiled/Routes.js +1 -2
- package/transpiled/Routes.js.map +1 -1
- package/transpiled/extension.d.ts +3 -0
- package/transpiled/extension.js +10 -3
- package/transpiled/extension.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { type Context, type PushInput } from '../types/index.js'
|
|
2
2
|
|
|
3
|
-
export async function effect
|
|
3
|
+
export async function effect(
|
|
4
|
+
{ key, event, data }: PushInput,
|
|
5
|
+
context: Context
|
|
6
|
+
): Promise<void> {
|
|
4
7
|
context.state.streams.get(key)?.push({ event, data })
|
|
5
8
|
|
|
6
9
|
void context.state.stash.push(key, event, data).then((token) => {
|
|
7
10
|
if (token instanceof Error)
|
|
8
11
|
context.logs.error('Failed to push to stash', { key, error: token })
|
|
9
|
-
else
|
|
10
|
-
context.state.streams.get(key)?.push({ event: 'token', data: token })
|
|
12
|
+
else context.state.streams.get(key)?.push({ event: 'token', data: token })
|
|
11
13
|
})
|
|
12
14
|
}
|