@pluv/platform-cloudflare 0.35.0 → 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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @pluv/platform-cloudflare@0.35.0 build /home/runner/work/pluv/pluv/packages/platform-cloudflare
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
  CLI Building entry: src/index.ts
@@ -8,11 +8,11 @@
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
- ESM dist/index.mjs 12.07 KB
12
- ESM ⚡️ Build success in 58ms
13
11
  CJS dist/index.js 13.18 KB
14
- CJS ⚡️ Build success in 66ms
12
+ CJS ⚡️ Build success in 83ms
13
+ ESM dist/index.mjs 12.07 KB
14
+ ESM ⚡️ Build success in 84ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 801ms
17
- DTS dist/index.d.mts 5.31 KB
18
- DTS dist/index.d.ts 5.31 KB
16
+ DTS ⚡️ Build success in 1081ms
17
+ DTS dist/index.d.mts 5.33 KB
18
+ DTS dist/index.d.ts 5.33 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @pluv/platform-cloudflare
2
2
 
3
+ ## 0.35.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [81cb692]
8
+ - @pluv/types@0.35.2
9
+ - @pluv/io@0.35.2
10
+ - @pluv/persistence-cloudflare-transactional-storage@0.35.2
11
+
12
+ ## 0.35.1
13
+
14
+ ### Patch Changes
15
+
16
+ - @pluv/io@0.35.1
17
+ - @pluv/persistence-cloudflare-transactional-storage@0.35.1
18
+ - @pluv/types@0.35.1
19
+
3
20
  ## 0.35.0
4
21
 
5
22
  ### Patch Changes
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<CloudflarePlatform, any, any, any>, TEnv extends Record<string, any>> = {
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> extends null ? {
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<CloudflarePlatform, any, any, any>, TEnv extends Record<string, any>> = {
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> extends null ? {
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.0",
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.0",
22
- "@pluv/persistence-cloudflare-transactional-storage": "^0.35.0",
23
- "@pluv/types": "^0.35.0"
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
- "@cloudflare/workers-types": "^4.20241230.0",
26
+ "@cloudflare/workers-types": "^4.20250121.0",
27
27
  "eslint": "^8.57.1",
28
28
  "tsup": "^8.3.5",
29
- "typescript": "^5.7.2",
30
- "@pluv/tsconfig": "^0.35.0",
31
- "eslint-config-pluv": "^0.35.0"
29
+ "typescript": "^5.7.3",
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",
@@ -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<CloudflarePlatform, any, any, any>,
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> extends null
22
- ? { authorize?: undefined }
23
- : { authorize: AuthorizeFunction<TPluvServer> });
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,