@pluv/platform-cloudflare 0.35.1 → 0.35.2
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 +6 -6
- package/CHANGELOG.md +9 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/package.json +6 -6
- package/src/createPluvHandler.ts +5 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-cloudflare@0.35.
|
|
2
|
+
> @pluv/platform-cloudflare@0.35.2 build /home/runner/work/pluv/pluv/packages/platform-cloudflare
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --dts
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
[34mESM[39m Build start
|
|
10
10
|
[34mCJS[39m Build start
|
|
11
11
|
[32mCJS[39m [1mdist/index.js [22m[32m13.18 KB[39m
|
|
12
|
-
[32mCJS[39m ⚡️ Build success in
|
|
12
|
+
[32mCJS[39m ⚡️ Build success in 83ms
|
|
13
13
|
[32mESM[39m [1mdist/index.mjs [22m[32m12.07 KB[39m
|
|
14
|
-
[32mESM[39m ⚡️ Build success in
|
|
14
|
+
[32mESM[39m ⚡️ Build success in 84ms
|
|
15
15
|
[34mDTS[39m Build start
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
17
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.
|
|
18
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 1081ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m5.33 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m5.33 KB[39m
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, AbstractPlatformConfig, WebSocketRegistrationMode, AbstractPlatform, ConvertWebSocketConfig, PluvServer, InferInitContextType } from '@pluv/io';
|
|
2
|
-
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, Id } from '@pluv/types';
|
|
2
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, BaseUser, Id } from '@pluv/types';
|
|
3
3
|
|
|
4
4
|
type CloudflareWebSocketConfig = AbstractWebSocketConfig;
|
|
5
5
|
declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
@@ -78,15 +78,15 @@ type AuthorizeFunctionContext<TPluvServer extends PluvServer<any, any, any, any>
|
|
|
78
78
|
room: string;
|
|
79
79
|
} & InferInitContextType<TPluvServer extends PluvServer<infer IPlatform, any, any, any> ? IPlatform : never>;
|
|
80
80
|
type AuthorizeFunction<TPluvServer extends PluvServer<any, any, any, any>> = (ctx: AuthorizeFunctionContext<TPluvServer>) => MaybePromise<Maybe<InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>>>>;
|
|
81
|
-
type CreatePluvHandlerConfig<TPluvServer extends PluvServer<
|
|
81
|
+
type CreatePluvHandlerConfig<TPluvServer extends PluvServer<any, any, any, any>, TEnv extends Record<string, any>> = {
|
|
82
82
|
binding: string;
|
|
83
83
|
endpoint?: string;
|
|
84
84
|
modify?: (request: Request, response: Response, env: TEnv) => MaybePromise<Response>;
|
|
85
85
|
io: TPluvServer;
|
|
86
|
-
} & (InferIOAuthorize<TPluvServer
|
|
87
|
-
authorize?: undefined;
|
|
88
|
-
} : {
|
|
86
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>> extends BaseUser ? {
|
|
89
87
|
authorize: AuthorizeFunction<TPluvServer>;
|
|
88
|
+
} : {
|
|
89
|
+
authorize?: undefined;
|
|
90
90
|
});
|
|
91
91
|
type PluvHandlerFetch<TEnv extends Record<string, any> = {}> = (request: Request, env: TEnv) => Promise<Response | null>;
|
|
92
92
|
interface CreatePluvHandlerResult<TEnv extends Record<string, any> = {}> {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AbstractWebSocket, WebSocketSerializedState, AbstractEventMap, AbstractListener, AbstractWebSocketConfig, AbstractPlatformConfig, WebSocketRegistrationMode, AbstractPlatform, ConvertWebSocketConfig, PluvServer, InferInitContextType } from '@pluv/io';
|
|
2
|
-
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, Id } from '@pluv/types';
|
|
2
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, BaseUser, Id } from '@pluv/types';
|
|
3
3
|
|
|
4
4
|
type CloudflareWebSocketConfig = AbstractWebSocketConfig;
|
|
5
5
|
declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
@@ -78,15 +78,15 @@ type AuthorizeFunctionContext<TPluvServer extends PluvServer<any, any, any, any>
|
|
|
78
78
|
room: string;
|
|
79
79
|
} & InferInitContextType<TPluvServer extends PluvServer<infer IPlatform, any, any, any> ? IPlatform : never>;
|
|
80
80
|
type AuthorizeFunction<TPluvServer extends PluvServer<any, any, any, any>> = (ctx: AuthorizeFunctionContext<TPluvServer>) => MaybePromise<Maybe<InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>>>>;
|
|
81
|
-
type CreatePluvHandlerConfig<TPluvServer extends PluvServer<
|
|
81
|
+
type CreatePluvHandlerConfig<TPluvServer extends PluvServer<any, any, any, any>, TEnv extends Record<string, any>> = {
|
|
82
82
|
binding: string;
|
|
83
83
|
endpoint?: string;
|
|
84
84
|
modify?: (request: Request, response: Response, env: TEnv) => MaybePromise<Response>;
|
|
85
85
|
io: TPluvServer;
|
|
86
|
-
} & (InferIOAuthorize<TPluvServer
|
|
87
|
-
authorize?: undefined;
|
|
88
|
-
} : {
|
|
86
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>> extends BaseUser ? {
|
|
89
87
|
authorize: AuthorizeFunction<TPluvServer>;
|
|
88
|
+
} : {
|
|
89
|
+
authorize?: undefined;
|
|
90
90
|
});
|
|
91
91
|
type PluvHandlerFetch<TEnv extends Record<string, any> = {}> = (request: Request, env: TEnv) => Promise<Response | null>;
|
|
92
92
|
interface CreatePluvHandlerResult<TEnv extends Record<string, any> = {}> {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-cloudflare",
|
|
3
|
-
"version": "0.35.
|
|
3
|
+
"version": "0.35.2",
|
|
4
4
|
"description": "@pluv/io adapter for cloudflare workers",
|
|
5
5
|
"author": "leedavidcs",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"path-to-regexp": "^8.2.0",
|
|
21
|
-
"@pluv/io": "^0.35.
|
|
22
|
-
"@pluv/persistence-cloudflare-transactional-storage": "^0.35.
|
|
23
|
-
"@pluv/types": "^0.35.
|
|
21
|
+
"@pluv/io": "^0.35.2",
|
|
22
|
+
"@pluv/persistence-cloudflare-transactional-storage": "^0.35.2",
|
|
23
|
+
"@pluv/types": "^0.35.2"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@cloudflare/workers-types": "^4.20250121.0",
|
|
27
27
|
"eslint": "^8.57.1",
|
|
28
28
|
"tsup": "^8.3.5",
|
|
29
29
|
"typescript": "^5.7.3",
|
|
30
|
-
"@pluv/tsconfig": "^0.35.
|
|
31
|
-
"eslint-config-pluv": "^0.35.
|
|
30
|
+
"@pluv/tsconfig": "^0.35.2",
|
|
31
|
+
"eslint-config-pluv": "^0.35.2"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
package/src/createPluvHandler.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InferInitContextType, IORoom, PluvServer } from "@pluv/io";
|
|
2
|
-
import type { Id, InferIOAuthorize, InferIOAuthorizeUser, Maybe, MaybePromise } from "@pluv/types";
|
|
2
|
+
import type { BaseUser, Id, InferIOAuthorize, InferIOAuthorizeUser, Maybe, MaybePromise } from "@pluv/types";
|
|
3
3
|
import { match } from "path-to-regexp";
|
|
4
4
|
import { CloudflarePlatform } from "./CloudflarePlatform";
|
|
5
5
|
|
|
@@ -11,16 +11,16 @@ export type AuthorizeFunction<TPluvServer extends PluvServer<any, any, any, any>
|
|
|
11
11
|
) => MaybePromise<Maybe<InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>>>>;
|
|
12
12
|
|
|
13
13
|
export type CreatePluvHandlerConfig<
|
|
14
|
-
TPluvServer extends PluvServer<
|
|
14
|
+
TPluvServer extends PluvServer<any, any, any, any>,
|
|
15
15
|
TEnv extends Record<string, any>,
|
|
16
16
|
> = {
|
|
17
17
|
binding: string;
|
|
18
18
|
endpoint?: string;
|
|
19
19
|
modify?: (request: Request, response: Response, env: TEnv) => MaybePromise<Response>;
|
|
20
20
|
io: TPluvServer;
|
|
21
|
-
} & (InferIOAuthorize<TPluvServer
|
|
22
|
-
? { authorize
|
|
23
|
-
: { authorize
|
|
21
|
+
} & (InferIOAuthorizeUser<InferIOAuthorize<TPluvServer>> extends BaseUser
|
|
22
|
+
? { authorize: AuthorizeFunction<TPluvServer> }
|
|
23
|
+
: { authorize?: undefined });
|
|
24
24
|
|
|
25
25
|
export type PluvHandlerFetch<TEnv extends Record<string, any> = {}> = (
|
|
26
26
|
request: Request,
|