ocpp-ws-io 2.2.1 → 2.2.2-beta.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,4 +1,4 @@
1
- import { O as OCPPPlugin } from './types-BHIHsj__.mjs';
1
+ import { j as OCPPPlugin } from './types-xFfIgIuS.mjs';
2
2
  import 'ws';
3
3
  import 'node:https';
4
4
  import 'node:http';
package/dist/plugins.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as OCPPPlugin } from './types-BHIHsj__.js';
1
+ import { j as OCPPPlugin } from './types-xFfIgIuS.js';
2
2
  import 'ws';
3
3
  import 'node:https';
4
4
  import 'node:http';
@@ -5979,7 +5979,7 @@ interface BaseConnectionContext {
5979
5979
  reject: (code?: number, message?: string) => never;
5980
5980
  }
5981
5981
  interface ConnectionContext extends BaseConnectionContext {
5982
- /** Triggers the next middleware in the execution chain, optionally merging a payload into ctx.state */
5982
+ /** Triggers the next middleware in the execution chain, optionally merging a payload into ctx.state and then client.session in the chain*/
5983
5983
  next: (payload?: Record<string, unknown>) => Promise<void>;
5984
5984
  }
5985
5985
  interface AuthContext<TSession = Record<string, unknown>> extends BaseConnectionContext {
@@ -5990,4 +5990,4 @@ interface AuthContext<TSession = Record<string, unknown>> extends BaseConnection
5990
5990
  }
5991
5991
  type ConnectionMiddleware = (ctx: ConnectionContext) => Promise<void> | void;
5992
5992
 
5993
- export { type ServerOptions as $, type AuthCallback as A, type OCPPCallError as B, type ConnectionMiddleware as C, type OCPPCallResult as D, type EventAdapterInterface as E, OCPPClient as F, type OCPPMessage as G, type HandlerContext as H, type OCPPMethodMap as I, type OCPPProtocol as J, type OCPPProtocolKey as K, type LoggerLike as L, type MiddlewareFunction as M, NOREPLY as N, type OCPPPlugin as O, type OCPPRequestType as P, type OCPPResponseType as Q, OCPPRouter as R, OCPPServer as S, OCPPServerClient as T, type OCPPServerStats as U, Validator as V, type RateLimitOptions as W, type RouterConfig as X, type SecurityEvent as Y, SecurityProfile as Z, type ServerEvents as _, type LoggingConfig as a, type SessionData as a0, type TLSOptions as a1, type TelemetryConfig as a2, type TypedEventEmitter as a3, type WildcardHandler as a4, createRouter as a5, createValidator as a6, type MiddlewareContext as b, type AllMethodNames as c, type AnyOCPPProtocol as d, type AuthAccept as e, type CORSOptions as f, type CallHandler as g, type CallOptions as h, type ClientEvents as i, type ClientOptions as j, type CloseOptions as k, type CompressionOptions as l, type ConnectionContext as m, ConnectionState as n, type HandshakeInfo as o, type ListenOptions as p, type MessageDirection as q, type MessageEventContext as r, type MessageEventPayload as s, MessageType as t, type MiddlewareNext as u, MiddlewareStack as v, type OCPP16Methods as w, type OCPP201Methods as x, type OCPP21Methods as y, type OCPPCall as z };
5993
+ export { type ServerEvents as $, type AllMethodNames as A, MessageType as B, type CallOptions as C, type MiddlewareNext as D, type EventAdapterInterface as E, MiddlewareStack as F, type OCPP16Methods as G, type HandlerContext as H, type OCPP201Methods as I, type OCPP21Methods as J, type OCPPCall as K, type LoggerLike as L, type MiddlewareFunction as M, NOREPLY as N, OCPPServer as O, type OCPPCallError as P, type OCPPCallResult as Q, OCPPClient as R, type OCPPMessage as S, type OCPPMethodMap as T, type OCPPProtocolKey as U, Validator as V, OCPPRouter as W, type RateLimitOptions as X, type RouterConfig as Y, type SecurityEvent as Z, SecurityProfile as _, OCPPServerClient as a, type ServerOptions as a0, type SessionData as a1, type TLSOptions as a2, type TelemetryConfig as a3, type TypedEventEmitter as a4, type WildcardHandler as a5, createRouter as a6, createValidator as a7, type OCPPServerStats as b, type OCPPProtocol as c, type OCPPRequestType as d, type OCPPResponseType as e, type CloseOptions as f, type AuthCallback as g, type LoggingConfig as h, type MiddlewareContext as i, type OCPPPlugin as j, type ConnectionMiddleware as k, type AnyOCPPProtocol as l, type AuthAccept as m, type AuthContext as n, type CORSOptions as o, type CallHandler as p, type ClientEvents as q, type ClientOptions as r, type CompressionOptions as s, type ConnectionContext as t, ConnectionState as u, type HandshakeInfo as v, type ListenOptions as w, type MessageDirection as x, type MessageEventContext as y, type MessageEventPayload as z };
@@ -5979,7 +5979,7 @@ interface BaseConnectionContext {
5979
5979
  reject: (code?: number, message?: string) => never;
5980
5980
  }
5981
5981
  interface ConnectionContext extends BaseConnectionContext {
5982
- /** Triggers the next middleware in the execution chain, optionally merging a payload into ctx.state */
5982
+ /** Triggers the next middleware in the execution chain, optionally merging a payload into ctx.state and then client.session in the chain*/
5983
5983
  next: (payload?: Record<string, unknown>) => Promise<void>;
5984
5984
  }
5985
5985
  interface AuthContext<TSession = Record<string, unknown>> extends BaseConnectionContext {
@@ -5990,4 +5990,4 @@ interface AuthContext<TSession = Record<string, unknown>> extends BaseConnection
5990
5990
  }
5991
5991
  type ConnectionMiddleware = (ctx: ConnectionContext) => Promise<void> | void;
5992
5992
 
5993
- export { type ServerOptions as $, type AuthCallback as A, type OCPPCallError as B, type ConnectionMiddleware as C, type OCPPCallResult as D, type EventAdapterInterface as E, OCPPClient as F, type OCPPMessage as G, type HandlerContext as H, type OCPPMethodMap as I, type OCPPProtocol as J, type OCPPProtocolKey as K, type LoggerLike as L, type MiddlewareFunction as M, NOREPLY as N, type OCPPPlugin as O, type OCPPRequestType as P, type OCPPResponseType as Q, OCPPRouter as R, OCPPServer as S, OCPPServerClient as T, type OCPPServerStats as U, Validator as V, type RateLimitOptions as W, type RouterConfig as X, type SecurityEvent as Y, SecurityProfile as Z, type ServerEvents as _, type LoggingConfig as a, type SessionData as a0, type TLSOptions as a1, type TelemetryConfig as a2, type TypedEventEmitter as a3, type WildcardHandler as a4, createRouter as a5, createValidator as a6, type MiddlewareContext as b, type AllMethodNames as c, type AnyOCPPProtocol as d, type AuthAccept as e, type CORSOptions as f, type CallHandler as g, type CallOptions as h, type ClientEvents as i, type ClientOptions as j, type CloseOptions as k, type CompressionOptions as l, type ConnectionContext as m, ConnectionState as n, type HandshakeInfo as o, type ListenOptions as p, type MessageDirection as q, type MessageEventContext as r, type MessageEventPayload as s, MessageType as t, type MiddlewareNext as u, MiddlewareStack as v, type OCPP16Methods as w, type OCPP201Methods as x, type OCPP21Methods as y, type OCPPCall as z };
5993
+ export { type ServerEvents as $, type AllMethodNames as A, MessageType as B, type CallOptions as C, type MiddlewareNext as D, type EventAdapterInterface as E, MiddlewareStack as F, type OCPP16Methods as G, type HandlerContext as H, type OCPP201Methods as I, type OCPP21Methods as J, type OCPPCall as K, type LoggerLike as L, type MiddlewareFunction as M, NOREPLY as N, OCPPServer as O, type OCPPCallError as P, type OCPPCallResult as Q, OCPPClient as R, type OCPPMessage as S, type OCPPMethodMap as T, type OCPPProtocolKey as U, Validator as V, OCPPRouter as W, type RateLimitOptions as X, type RouterConfig as Y, type SecurityEvent as Z, SecurityProfile as _, OCPPServerClient as a, type ServerOptions as a0, type SessionData as a1, type TLSOptions as a2, type TelemetryConfig as a3, type TypedEventEmitter as a4, type WildcardHandler as a5, createRouter as a6, createValidator as a7, type OCPPServerStats as b, type OCPPProtocol as c, type OCPPRequestType as d, type OCPPResponseType as e, type CloseOptions as f, type AuthCallback as g, type LoggingConfig as h, type MiddlewareContext as i, type OCPPPlugin as j, type ConnectionMiddleware as k, type AnyOCPPProtocol as l, type AuthAccept as m, type AuthContext as n, type CORSOptions as o, type CallHandler as p, type ClientEvents as q, type ClientOptions as r, type CompressionOptions as s, type ConnectionContext as t, ConnectionState as u, type HandshakeInfo as v, type ListenOptions as w, type MessageDirection as x, type MessageEventContext as y, type MessageEventPayload as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocpp-ws-io",
3
- "version": "2.2.1",
3
+ "version": "2.2.2-beta.1",
4
4
  "description": "OCPP RPC WebSocket client and server for OCPP 1.6J, 2.0.1, and 2.1. Type-safe TypeScript toolkit for EV charging, CSMS backends, Redis scaling, and protocol validation.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -34,6 +34,26 @@
34
34
  "types": "./dist/plugins.d.ts",
35
35
  "import": "./dist/plugins.mjs",
36
36
  "require": "./dist/plugins.js"
37
+ },
38
+ "./express": {
39
+ "types": "./dist/express.d.ts",
40
+ "import": "./dist/express.mjs",
41
+ "require": "./dist/express.js"
42
+ },
43
+ "./nestjs": {
44
+ "types": "./dist/nestjs.d.ts",
45
+ "import": "./dist/nestjs.mjs",
46
+ "require": "./dist/nestjs.js"
47
+ },
48
+ "./fastify": {
49
+ "types": "./dist/fastify.d.ts",
50
+ "import": "./dist/fastify.mjs",
51
+ "require": "./dist/fastify.js"
52
+ },
53
+ "./hono": {
54
+ "types": "./dist/hono.d.ts",
55
+ "import": "./dist/hono.mjs",
56
+ "require": "./dist/hono.js"
37
57
  }
38
58
  },
39
59
  "scripts": {
@@ -97,6 +117,38 @@
97
117
  "dist"
98
118
  ],
99
119
  "license": "MIT",
120
+ "peerDependencies": {
121
+ "@nestjs/common": "^10.0.0 || ^11.0.0",
122
+ "@nestjs/core": "^10.0.0 || ^11.0.0",
123
+ "express": "^4.18.0 || ^5.0.0",
124
+ "fastify": "^4.0.0 || ^5.0.0",
125
+ "fastify-plugin": "^4.0.0 || ^5.0.0",
126
+ "hono": "^4.0.0",
127
+ "reflect-metadata": "^0.2.2"
128
+ },
129
+ "peerDependenciesMeta": {
130
+ "@nestjs/common": {
131
+ "optional": true
132
+ },
133
+ "@nestjs/core": {
134
+ "optional": true
135
+ },
136
+ "express": {
137
+ "optional": true
138
+ },
139
+ "fastify": {
140
+ "optional": true
141
+ },
142
+ "fastify-plugin": {
143
+ "optional": true
144
+ },
145
+ "hono": {
146
+ "optional": true
147
+ },
148
+ "reflect-metadata": {
149
+ "optional": true
150
+ }
151
+ },
100
152
  "dependencies": {
101
153
  "ajv": "^8.18.0",
102
154
  "ajv-formats": "^3.0.1",
@@ -104,10 +156,19 @@
104
156
  "ws": "^8.19.0"
105
157
  },
106
158
  "devDependencies": {
159
+ "@hono/node-server": "^2.0.0",
160
+ "@nestjs/common": "^11.0.0",
161
+ "@nestjs/core": "^11.0.0",
162
+ "@nestjs/testing": "^11.1.19",
107
163
  "@types/node": "^22.19.11",
108
164
  "@types/ws": "^8.18.1",
109
165
  "@vitest/coverage-v8": "^3.2.4",
166
+ "express": "^5.2.1",
167
+ "fastify": "^5.2.1",
168
+ "fastify-plugin": "^5.0.1",
169
+ "hono": "^4.12.15",
110
170
  "ioredis-mock": "^8.13.1",
171
+ "reflect-metadata": "^0.2.2",
111
172
  "tsup": "^8.5.1",
112
173
  "typescript": "^5.9.3",
113
174
  "vitest": "^3.2.4"