@hamak/event-channel 0.5.3 → 0.9.1

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.
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Redux action types and creators for the event channel.
3
3
  */
4
- import type { ConnectionInfo } from '../types/connection-types';
5
- import type { EventChannelEvent, RemoteAction } from '../types/event-types';
4
+ import type { ConnectionInfo } from '../types/connection-types.js';
5
+ import type { EventChannelEvent, RemoteAction } from '../types/event-types.js';
6
6
  export declare const EventChannelActionTypes: {
7
7
  readonly CONNECTION_STATUS_CHANGED: "eventChannel/connectionStatusChanged";
8
8
  readonly EVENT_RECEIVED: "eventChannel/eventReceived";
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Public types, interfaces, tokens, and action creators.
5
5
  */
6
- export type { ConnectionStatus, ConnectionInfo, } from './types/connection-types';
7
- export type { EventChannelEvent, RemoteAction, IEventChannel, } from './types/event-types';
8
- export { EVENT_CHANNEL_TOKEN, EVENT_CHANNEL_CONFIG_TOKEN, } from './tokens/service-tokens';
9
- export { EventChannelActionTypes, eventChannelActions, type EventChannelAction, type ConnectionStatusChangedAction, type EventReceivedAction, type RemoteActionReceivedAction, type ConnectAction, type DisconnectAction, } from './actions/event-channel-actions';
6
+ export type { ConnectionStatus, ConnectionInfo, } from './types/connection-types.js';
7
+ export type { EventChannelEvent, RemoteAction, IEventChannel, } from './types/event-types.js';
8
+ export { EVENT_CHANNEL_TOKEN, EVENT_CHANNEL_CONFIG_TOKEN, } from './tokens/service-tokens.js';
9
+ export { EventChannelActionTypes, eventChannelActions, type EventChannelAction, type ConnectionStatusChangedAction, type EventReceivedAction, type RemoteActionReceivedAction, type ConnectAction, type DisconnectAction, } from './actions/event-channel-actions.js';
10
10
  //# sourceMappingURL=index.d.ts.map
package/dist/api/index.js CHANGED
@@ -4,6 +4,6 @@
4
4
  * Public types, interfaces, tokens, and action creators.
5
5
  */
6
6
  // Tokens
7
- export { EVENT_CHANNEL_TOKEN, EVENT_CHANNEL_CONFIG_TOKEN, } from './tokens/service-tokens';
7
+ export { EVENT_CHANNEL_TOKEN, EVENT_CHANNEL_CONFIG_TOKEN, } from './tokens/service-tokens.js';
8
8
  // Actions
9
- export { EventChannelActionTypes, eventChannelActions, } from './actions/event-channel-actions';
9
+ export { EventChannelActionTypes, eventChannelActions, } from './actions/event-channel-actions.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Core event channel types.
3
3
  */
4
- import type { ConnectionStatus } from './connection-types';
4
+ import type { ConnectionStatus } from './connection-types.js';
5
5
  /**
6
6
  * A typed event from the event channel.
7
7
  */
@@ -4,9 +4,9 @@
4
4
  * Manages the event stream connection with auto-reconnect
5
5
  * and typed event subscriptions.
6
6
  */
7
- import type { EventChannelEvent, ConnectionStatus, IEventChannel } from '../../api';
8
- import type { IEventTransport } from '../../spi/transport/i-event-transport';
9
- import type { EventChannelPluginConfig } from '../../spi/config/event-channel-plugin-config';
7
+ import type { EventChannelEvent, ConnectionStatus, IEventChannel } from '../../api/index.js';
8
+ import type { IEventTransport } from '../../spi/transport/i-event-transport.js';
9
+ import type { EventChannelPluginConfig } from '../../spi/config/event-channel-plugin-config.js';
10
10
  export declare class EventChannel implements IEventChannel {
11
11
  private transport;
12
12
  private config;
@@ -3,14 +3,14 @@
3
3
  *
4
4
  * Re-exports API + SPI + concrete implementations.
5
5
  */
6
- export * from '../api';
7
- export type { IEventTransport } from '../spi/transport/i-event-transport';
8
- export type { IRemoteActionFilter } from '../spi/security/i-action-filter';
9
- export type { EventChannelPluginConfig } from '../spi/config/event-channel-plugin-config';
10
- export { SseTransport } from './transport/sse-transport';
11
- export { EventChannel } from './core/event-channel';
12
- export { ActionWhitelistFilter } from './security/action-whitelist-filter';
13
- export { eventChannelReducer, type EventChannelState } from './store/event-channel-reducer';
14
- export { createEventChannelMiddleware, type EventChannelMiddlewareConfig } from './middleware/event-channel-middleware';
15
- export { createEventChannelPlugin } from './plugin/event-channel-plugin-factory';
6
+ export * from '../api/index.js';
7
+ export type { IEventTransport } from '../spi/transport/i-event-transport.js';
8
+ export type { IRemoteActionFilter } from '../spi/security/i-action-filter.js';
9
+ export type { EventChannelPluginConfig } from '../spi/config/event-channel-plugin-config.js';
10
+ export { SseTransport } from './transport/sse-transport.js';
11
+ export { EventChannel } from './core/event-channel.js';
12
+ export { ActionWhitelistFilter } from './security/action-whitelist-filter.js';
13
+ export { eventChannelReducer, type EventChannelState } from './store/event-channel-reducer.js';
14
+ export { createEventChannelMiddleware, type EventChannelMiddlewareConfig } from './middleware/event-channel-middleware.js';
15
+ export { createEventChannelPlugin } from './plugin/event-channel-plugin-factory.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -4,16 +4,16 @@
4
4
  * Re-exports API + SPI + concrete implementations.
5
5
  */
6
6
  // Re-export API and SPI
7
- export * from '../api';
7
+ export * from '../api/index.js';
8
8
  // Transport
9
- export { SseTransport } from './transport/sse-transport';
9
+ export { SseTransport } from './transport/sse-transport.js';
10
10
  // Core
11
- export { EventChannel } from './core/event-channel';
11
+ export { EventChannel } from './core/event-channel.js';
12
12
  // Security
13
- export { ActionWhitelistFilter } from './security/action-whitelist-filter';
13
+ export { ActionWhitelistFilter } from './security/action-whitelist-filter.js';
14
14
  // Store
15
- export { eventChannelReducer } from './store/event-channel-reducer';
15
+ export { eventChannelReducer } from './store/event-channel-reducer.js';
16
16
  // Middleware
17
- export { createEventChannelMiddleware } from './middleware/event-channel-middleware';
17
+ export { createEventChannelMiddleware } from './middleware/event-channel-middleware.js';
18
18
  // Plugin
19
- export { createEventChannelPlugin } from './plugin/event-channel-plugin-factory';
19
+ export { createEventChannelPlugin } from './plugin/event-channel-plugin-factory.js';
@@ -5,7 +5,7 @@
5
5
  * the actual Redux action after checking the security filter.
6
6
  */
7
7
  import type { Middleware } from '@reduxjs/toolkit';
8
- import type { IRemoteActionFilter } from '../../spi/security/i-action-filter';
8
+ import type { IRemoteActionFilter } from '../../spi/security/i-action-filter.js';
9
9
  export interface EventChannelMiddlewareConfig {
10
10
  actionFilter: IRemoteActionFilter;
11
11
  debug?: boolean;
@@ -4,7 +4,7 @@
4
4
  * Intercepts REMOTE_ACTION_RECEIVED events and dispatches
5
5
  * the actual Redux action after checking the security filter.
6
6
  */
7
- import { EventChannelActionTypes } from '../../api/actions/event-channel-actions';
7
+ import { EventChannelActionTypes } from '../../api/actions/event-channel-actions.js';
8
8
  export function createEventChannelMiddleware(config) {
9
9
  return (store) => (next) => (action) => {
10
10
  const result = next(action);
@@ -4,7 +4,7 @@
4
4
  * Creates a microkernel plugin for the event channel.
5
5
  */
6
6
  import type { PluginModule } from '@hamak/microkernel-spi';
7
- import type { EventChannelPluginConfig } from '../../spi/config/event-channel-plugin-config';
7
+ import type { EventChannelPluginConfig } from '../../spi/config/event-channel-plugin-config.js';
8
8
  /**
9
9
  * Create an event channel plugin for the microkernel.
10
10
  *
@@ -3,13 +3,13 @@
3
3
  *
4
4
  * Creates a microkernel plugin for the event channel.
5
5
  */
6
- import { EVENT_CHANNEL_TOKEN } from '../../api/tokens/service-tokens';
7
- import { eventChannelActions } from '../../api/actions/event-channel-actions';
8
- import { SseTransport } from '../transport/sse-transport';
9
- import { EventChannel } from '../core/event-channel';
10
- import { ActionWhitelistFilter } from '../security/action-whitelist-filter';
11
- import { eventChannelReducer } from '../store/event-channel-reducer';
12
- import { createEventChannelMiddleware } from '../middleware/event-channel-middleware';
6
+ import { EVENT_CHANNEL_TOKEN } from '../../api/tokens/service-tokens.js';
7
+ import { eventChannelActions } from '../../api/actions/event-channel-actions.js';
8
+ import { SseTransport } from '../transport/sse-transport.js';
9
+ import { EventChannel } from '../core/event-channel.js';
10
+ import { ActionWhitelistFilter } from '../security/action-whitelist-filter.js';
11
+ import { eventChannelReducer } from '../store/event-channel-reducer.js';
12
+ import { createEventChannelMiddleware } from '../middleware/event-channel-middleware.js';
13
13
  /**
14
14
  * Create an event channel plugin for the microkernel.
15
15
  *
@@ -4,8 +4,8 @@
4
4
  * Filters remote actions based on a whitelist of allowed action type patterns.
5
5
  * Supports exact match and simple glob patterns (e.g., 'todos/*').
6
6
  */
7
- import type { RemoteAction } from '../../api';
8
- import type { IRemoteActionFilter } from '../../spi/security/i-action-filter';
7
+ import type { RemoteAction } from '../../api/index.js';
8
+ import type { IRemoteActionFilter } from '../../spi/security/i-action-filter.js';
9
9
  export declare class ActionWhitelistFilter implements IRemoteActionFilter {
10
10
  private readonly patterns;
11
11
  constructor(allowedPatterns: string[]);
@@ -3,9 +3,9 @@
3
3
  *
4
4
  * Manages connection state and recent events in the Redux store.
5
5
  */
6
- import type { ConnectionInfo } from '../../api/types/connection-types';
7
- import type { EventChannelEvent } from '../../api/types/event-types';
8
- import { type EventChannelAction } from '../../api/actions/event-channel-actions';
6
+ import type { ConnectionInfo } from '../../api/types/connection-types.js';
7
+ import type { EventChannelEvent } from '../../api/types/event-types.js';
8
+ import { type EventChannelAction } from '../../api/actions/event-channel-actions.js';
9
9
  export interface EventChannelState {
10
10
  connection: ConnectionInfo;
11
11
  recentEvents: EventChannelEvent[];
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Manages connection state and recent events in the Redux store.
5
5
  */
6
- import { EventChannelActionTypes } from '../../api/actions/event-channel-actions';
6
+ import { EventChannelActionTypes } from '../../api/actions/event-channel-actions.js';
7
7
  const MAX_RECENT_EVENTS = 50;
8
8
  const initialState = {
9
9
  connection: {
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Browser EventSource-based transport for the event channel.
5
5
  */
6
- import type { EventChannelEvent, ConnectionStatus } from '../../api';
7
- import type { IEventTransport } from '../../spi';
6
+ import type { EventChannelEvent, ConnectionStatus } from '../../api/index.js';
7
+ import type { IEventTransport } from '../../spi/index.js';
8
8
  export declare class SseTransport implements IEventTransport {
9
9
  private eventSource;
10
10
  private status;
package/dist/index.d.ts CHANGED
@@ -2,5 +2,5 @@
2
2
  * @hamak/event-channel
3
3
  * Reactive event channel with SSE transport and remote action dispatch
4
4
  */
5
- export * from './impl';
5
+ export * from './impl/index.js';
6
6
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  * @hamak/event-channel
3
3
  * Reactive event channel with SSE transport and remote action dispatch
4
4
  */
5
- export * from './impl';
5
+ export * from './impl/index.js';
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Configuration for the event channel plugin.
3
3
  */
4
- import type { IEventTransport } from '../transport/i-event-transport';
5
- import type { IRemoteActionFilter } from '../security/i-action-filter';
4
+ import type { IEventTransport } from '../transport/i-event-transport.js';
5
+ import type { IRemoteActionFilter } from '../security/i-action-filter.js';
6
6
  export interface EventChannelPluginConfig {
7
7
  /**
8
8
  * URL of the SSE endpoint.
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * Extension points and provider interfaces.
5
5
  */
6
- export * from '../api';
7
- export type { IEventTransport } from './transport/i-event-transport';
8
- export type { IRemoteActionFilter } from './security/i-action-filter';
9
- export type { EventChannelPluginConfig } from './config/event-channel-plugin-config';
6
+ export * from '../api/index.js';
7
+ export type { IEventTransport } from './transport/i-event-transport.js';
8
+ export type { IRemoteActionFilter } from './security/i-action-filter.js';
9
+ export type { EventChannelPluginConfig } from './config/event-channel-plugin-config.js';
10
10
  //# sourceMappingURL=index.d.ts.map
package/dist/spi/index.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * Extension points and provider interfaces.
5
5
  */
6
6
  // Re-export API
7
- export * from '../api';
7
+ export * from '../api/index.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Security filter for remote actions.
3
3
  */
4
- import type { RemoteAction } from '../../api';
4
+ import type { RemoteAction } from '../../api/index.js';
5
5
  /**
6
6
  * Determines which action types the backend is allowed to dispatch.
7
7
  */
@@ -2,7 +2,7 @@
2
2
  * Transport abstraction for the event channel.
3
3
  * SSE for Phase 1, WebSocket for Phase 2.
4
4
  */
5
- import type { EventChannelEvent, ConnectionStatus } from '../../api';
5
+ import type { EventChannelEvent, ConnectionStatus } from '../../api/index.js';
6
6
  export interface IEventTransport {
7
7
  /** Open the transport connection */
8
8
  connect(url: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hamak/event-channel",
3
- "version": "0.5.3",
3
+ "version": "0.9.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Reactive event channel with SSE transport and remote action dispatch for microkernel-based applications",
@@ -19,7 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "scripts": {
22
- "build": "tsc -p tsconfig.lib.json",
22
+ "build": "tsc -p tsconfig.lib.json && node ../../scripts/fix-esm-extensions.mjs ./dist",
23
23
  "clean": "rm -rf dist",
24
24
  "test": "vitest run",
25
25
  "test:watch": "vitest"