@pluv/platform-node 0.32.4 → 0.32.6
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +16 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/package.json +7 -7
- package/src/NodePlatform.ts +4 -4
- package/src/platformNode.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-node@0.32.
|
|
2
|
+
> @pluv/platform-node@0.32.6 build /home/runner/work/pluv/pluv/packages/platform-node
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
|
-
[34mCLI[39m tsup v8.3.
|
|
7
|
+
[34mCLI[39m tsup v8.3.5
|
|
8
8
|
[34mCLI[39m Target: es6
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mESM[39m [1mdist/index.mjs [22m[32m8.13 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 86ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m9.89 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 86ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 5825ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.17 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.17 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @pluv/platform-node
|
|
2
2
|
|
|
3
|
+
## 0.32.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [c0956e7]
|
|
8
|
+
- @pluv/io@0.32.6
|
|
9
|
+
- @pluv/types@0.32.6
|
|
10
|
+
|
|
11
|
+
## 0.32.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 98d7585: Update `meta` type on platform contexts to allow for nested json types.
|
|
16
|
+
- @pluv/io@0.32.5
|
|
17
|
+
- @pluv/types@0.32.5
|
|
18
|
+
|
|
3
19
|
## 0.32.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebSocket, Server as Server$1 } from 'ws';
|
|
2
2
|
export { WebSocket } from 'ws';
|
|
3
3
|
import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer, InferInitContextType } from '@pluv/io';
|
|
4
|
-
import { JsonObject,
|
|
4
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
|
|
5
5
|
import { IncomingMessage, Server, ServerResponse } from 'node:http';
|
|
6
6
|
|
|
7
7
|
type NodeWebSocketConfig = AbstractWebSocketConfig;
|
|
@@ -20,12 +20,12 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
|
|
|
20
20
|
terminate(): void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type NodePlatformRoomContext<TMeta extends Record<string,
|
|
23
|
+
type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never ? {
|
|
24
24
|
meta?: undefined;
|
|
25
25
|
} : {
|
|
26
26
|
meta: TMeta;
|
|
27
27
|
};
|
|
28
|
-
type NodePlatformConfig<TMeta extends Record<string,
|
|
28
|
+
type NodePlatformConfig<TMeta extends Record<string, Json>> = {
|
|
29
29
|
mode?: WebSocketRegistrationMode;
|
|
30
30
|
} & ({
|
|
31
31
|
persistence?: undefined;
|
|
@@ -36,7 +36,7 @@ type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
|
|
|
36
36
|
}) & {
|
|
37
37
|
context?: NodePlatformRoomContext<TMeta>;
|
|
38
38
|
};
|
|
39
|
-
declare class NodePlatform<TMeta extends Record<string,
|
|
39
|
+
declare class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<NodeWebSocket, {
|
|
40
40
|
req: IncomingMessage;
|
|
41
41
|
}, NodePlatformRoomContext<TMeta>> {
|
|
42
42
|
readonly _registrationMode: WebSocketRegistrationMode;
|
|
@@ -78,6 +78,6 @@ interface CreatePluvHandlerResult {
|
|
|
78
78
|
}
|
|
79
79
|
declare const createPluvHandler: <TPluvServer extends PluvServer<NodePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer>) => CreatePluvHandlerResult;
|
|
80
80
|
|
|
81
|
-
declare const platformNode: <TMeta extends Record<string,
|
|
81
|
+
declare const platformNode: <TMeta extends Record<string, Json> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
|
|
82
82
|
|
|
83
83
|
export { type AuthorizeFunction, type AuthorizeFunctionContext, type CreatePluvHandlerConfig, NodePlatform, type NodePlatformConfig, createPluvHandler, platformNode };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebSocket, Server as Server$1 } from 'ws';
|
|
2
2
|
export { WebSocket } from 'ws';
|
|
3
3
|
import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, WebSocketRegistrationMode, AbstractPersistence, AbstractPubSub, AbstractPlatform, ConvertWebSocketConfig, AbstractPlatformConfig, PluvServer, InferInitContextType } from '@pluv/io';
|
|
4
|
-
import { JsonObject,
|
|
4
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired } from '@pluv/types';
|
|
5
5
|
import { IncomingMessage, Server, ServerResponse } from 'node:http';
|
|
6
6
|
|
|
7
7
|
type NodeWebSocketConfig = AbstractWebSocketConfig;
|
|
@@ -20,12 +20,12 @@ declare class NodeWebSocket extends AbstractWebSocket<WebSocket> {
|
|
|
20
20
|
terminate(): void;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
type NodePlatformRoomContext<TMeta extends Record<string,
|
|
23
|
+
type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never ? {
|
|
24
24
|
meta?: undefined;
|
|
25
25
|
} : {
|
|
26
26
|
meta: TMeta;
|
|
27
27
|
};
|
|
28
|
-
type NodePlatformConfig<TMeta extends Record<string,
|
|
28
|
+
type NodePlatformConfig<TMeta extends Record<string, Json>> = {
|
|
29
29
|
mode?: WebSocketRegistrationMode;
|
|
30
30
|
} & ({
|
|
31
31
|
persistence?: undefined;
|
|
@@ -36,7 +36,7 @@ type NodePlatformConfig<TMeta extends Record<string, JsonPrimitive>> = {
|
|
|
36
36
|
}) & {
|
|
37
37
|
context?: NodePlatformRoomContext<TMeta>;
|
|
38
38
|
};
|
|
39
|
-
declare class NodePlatform<TMeta extends Record<string,
|
|
39
|
+
declare class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<NodeWebSocket, {
|
|
40
40
|
req: IncomingMessage;
|
|
41
41
|
}, NodePlatformRoomContext<TMeta>> {
|
|
42
42
|
readonly _registrationMode: WebSocketRegistrationMode;
|
|
@@ -78,6 +78,6 @@ interface CreatePluvHandlerResult {
|
|
|
78
78
|
}
|
|
79
79
|
declare const createPluvHandler: <TPluvServer extends PluvServer<NodePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer>) => CreatePluvHandlerResult;
|
|
80
80
|
|
|
81
|
-
declare const platformNode: <TMeta extends Record<string,
|
|
81
|
+
declare const platformNode: <TMeta extends Record<string, Json> = {}>(config?: NodePlatformConfig<TMeta>) => NodePlatform<TMeta>;
|
|
82
82
|
|
|
83
83
|
export { type AuthorizeFunction, type AuthorizeFunctionContext, type CreatePluvHandlerConfig, NodePlatform, type NodePlatformConfig, createPluvHandler, platformNode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-node",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.6",
|
|
4
4
|
"description": "@pluv/io adapter for node.js",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"access": "public"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@types/node": "^22.
|
|
20
|
+
"@types/node": "^22.8.1",
|
|
21
21
|
"@types/ws": "^8.5.12",
|
|
22
22
|
"path-to-regexp": "^8.2.0",
|
|
23
|
-
"@pluv/io": "^0.32.
|
|
24
|
-
"@pluv/types": "^0.32.
|
|
23
|
+
"@pluv/io": "^0.32.6",
|
|
24
|
+
"@pluv/types": "^0.32.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"eslint": "^8.57.0",
|
|
28
|
-
"tsup": "^8.3.
|
|
28
|
+
"tsup": "^8.3.5",
|
|
29
29
|
"typescript": "^5.6.3",
|
|
30
30
|
"ws": "^8.18.0",
|
|
31
|
-
"@pluv/tsconfig": "^0.32.
|
|
32
|
-
"eslint-config-pluv": "^0.32.
|
|
31
|
+
"@pluv/tsconfig": "^0.32.6",
|
|
32
|
+
"eslint-config-pluv": "^0.32.6"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"ws": "^8.0.0"
|
package/src/NodePlatform.ts
CHANGED
|
@@ -7,23 +7,23 @@ import type {
|
|
|
7
7
|
WebSocketSerializedState,
|
|
8
8
|
} from "@pluv/io";
|
|
9
9
|
import { AbstractPlatform } from "@pluv/io";
|
|
10
|
-
import type {
|
|
10
|
+
import type { Json } from "@pluv/types";
|
|
11
11
|
import crypto from "node:crypto";
|
|
12
12
|
import type { IncomingMessage } from "node:http";
|
|
13
13
|
import { TextDecoder } from "node:util";
|
|
14
14
|
import type { WebSocket } from "ws";
|
|
15
15
|
import { NodeWebSocket } from "./NodeWebSocket";
|
|
16
16
|
|
|
17
|
-
export type NodePlatformRoomContext<TMeta extends Record<string,
|
|
17
|
+
export type NodePlatformRoomContext<TMeta extends Record<string, Json>> = keyof TMeta extends never
|
|
18
18
|
? { meta?: undefined }
|
|
19
19
|
: { meta: TMeta };
|
|
20
20
|
|
|
21
|
-
export type NodePlatformConfig<TMeta extends Record<string,
|
|
21
|
+
export type NodePlatformConfig<TMeta extends Record<string, Json>> = { mode?: WebSocketRegistrationMode } & (
|
|
22
22
|
| { persistence?: undefined; pubSub?: undefined }
|
|
23
23
|
| { persistence: AbstractPersistence; pubSub: AbstractPubSub }
|
|
24
24
|
) & { context?: NodePlatformRoomContext<TMeta> };
|
|
25
25
|
|
|
26
|
-
export class NodePlatform<TMeta extends Record<string,
|
|
26
|
+
export class NodePlatform<TMeta extends Record<string, Json> = {}> extends AbstractPlatform<
|
|
27
27
|
NodeWebSocket,
|
|
28
28
|
{ req: IncomingMessage },
|
|
29
29
|
NodePlatformRoomContext<TMeta>
|
package/src/platformNode.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Json } from "@pluv/types";
|
|
2
2
|
import type { NodePlatformConfig } from "./NodePlatform";
|
|
3
3
|
import { NodePlatform } from "./NodePlatform";
|
|
4
4
|
|
|
5
|
-
export const platformNode = <TMeta extends Record<string,
|
|
5
|
+
export const platformNode = <TMeta extends Record<string, Json> = {}>(
|
|
6
6
|
config: NodePlatformConfig<TMeta> = {},
|
|
7
7
|
): NodePlatform<TMeta> => {
|
|
8
8
|
return new NodePlatform<TMeta>(config);
|