@pluv/platform-cloudflare 0.32.4 → 0.32.5
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/CloudflarePlatform.ts +4 -7
- package/src/platformCloudflare.ts +2 -5
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @pluv/platform-cloudflare@0.32.
|
|
2
|
+
> @pluv/platform-cloudflare@0.32.5 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
|
[32mESM[39m [1mdist/index.mjs [22m[32m11.70 KB[39m
|
|
12
|
-
[32mESM[39m ⚡️ Build success in
|
|
12
|
+
[32mESM[39m ⚡️ Build success in 62ms
|
|
13
13
|
[32mCJS[39m [1mdist/index.js [22m[32m12.80 KB[39m
|
|
14
|
-
[32mCJS[39m ⚡️ Build success in
|
|
14
|
+
[32mCJS[39m ⚡️ Build success in 66ms
|
|
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 935ms
|
|
17
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m4.67 KB[39m
|
|
18
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m4.67 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @pluv/platform-cloudflare
|
|
2
2
|
|
|
3
|
+
## 0.32.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 98d7585: Update `meta` type on platform contexts to allow for nested json types.
|
|
8
|
+
- @pluv/io@0.32.5
|
|
9
|
+
- @pluv/persistence-cloudflare-transactional-storage@0.32.5
|
|
10
|
+
- @pluv/types@0.32.5
|
|
11
|
+
|
|
3
12
|
## 0.32.4
|
|
4
13
|
|
|
5
14
|
### 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,
|
|
2
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired, Id } from '@pluv/types';
|
|
3
3
|
|
|
4
4
|
type CloudflareWebSocketConfig = AbstractWebSocketConfig;
|
|
5
5
|
declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
@@ -15,7 +15,7 @@ declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
|
15
15
|
terminate(): void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta extends Record<string,
|
|
18
|
+
type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta extends Record<string, Json>> = {
|
|
19
19
|
env: TEnv;
|
|
20
20
|
state: DurableObjectState;
|
|
21
21
|
} & (keyof TMeta extends never ? {
|
|
@@ -23,10 +23,10 @@ type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta exten
|
|
|
23
23
|
} : {
|
|
24
24
|
meta: TMeta;
|
|
25
25
|
});
|
|
26
|
-
type CloudflarePlatformConfig<TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
26
|
+
type CloudflarePlatformConfig<TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}> = AbstractPlatformConfig<CloudflarePlatformRoomContext<TEnv, TMeta>> & {
|
|
27
27
|
mode?: WebSocketRegistrationMode;
|
|
28
28
|
};
|
|
29
|
-
declare class CloudflarePlatform<TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
29
|
+
declare class CloudflarePlatform<TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}> extends AbstractPlatform<CloudflareWebSocket, {
|
|
30
30
|
env: TEnv;
|
|
31
31
|
request: Request;
|
|
32
32
|
}, CloudflarePlatformRoomContext<TEnv, TMeta>> {
|
|
@@ -70,6 +70,6 @@ interface CreatePluvHandlerResult<TEnv extends Record<string, any> = {}> {
|
|
|
70
70
|
type InferCloudflarePluvHandlerEnv<TPluvServer extends PluvServer<CloudflarePlatform, any, any, any>> = TPluvServer extends PluvServer<CloudflarePlatform<infer IEnv>, any, any, any> ? IEnv : {};
|
|
71
71
|
declare const createPluvHandler: <TPluvServer extends PluvServer<CloudflarePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer, Id<InferCloudflarePluvHandlerEnv<TPluvServer>>>) => CreatePluvHandlerResult<Id<InferCloudflarePluvHandlerEnv<TPluvServer>>>;
|
|
72
72
|
|
|
73
|
-
declare const platformCloudflare: <TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
73
|
+
declare const platformCloudflare: <TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}>(config?: CloudflarePlatformConfig<TEnv, TMeta>) => CloudflarePlatform<TEnv, TMeta>;
|
|
74
74
|
|
|
75
75
|
export { type AuthorizeFunction, type AuthorizeFunctionContext, CloudflarePlatform, type CloudflarePlatformConfig, type CreatePluvHandlerConfig, type CreatePluvHandlerResult, type PluvHandlerFetch, createPluvHandler, platformCloudflare };
|
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,
|
|
2
|
+
import { JsonObject, Json, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired, Id } from '@pluv/types';
|
|
3
3
|
|
|
4
4
|
type CloudflareWebSocketConfig = AbstractWebSocketConfig;
|
|
5
5
|
declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
@@ -15,7 +15,7 @@ declare class CloudflareWebSocket extends AbstractWebSocket<WebSocket> {
|
|
|
15
15
|
terminate(): void;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta extends Record<string,
|
|
18
|
+
type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta extends Record<string, Json>> = {
|
|
19
19
|
env: TEnv;
|
|
20
20
|
state: DurableObjectState;
|
|
21
21
|
} & (keyof TMeta extends never ? {
|
|
@@ -23,10 +23,10 @@ type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta exten
|
|
|
23
23
|
} : {
|
|
24
24
|
meta: TMeta;
|
|
25
25
|
});
|
|
26
|
-
type CloudflarePlatformConfig<TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
26
|
+
type CloudflarePlatformConfig<TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}> = AbstractPlatformConfig<CloudflarePlatformRoomContext<TEnv, TMeta>> & {
|
|
27
27
|
mode?: WebSocketRegistrationMode;
|
|
28
28
|
};
|
|
29
|
-
declare class CloudflarePlatform<TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
29
|
+
declare class CloudflarePlatform<TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}> extends AbstractPlatform<CloudflareWebSocket, {
|
|
30
30
|
env: TEnv;
|
|
31
31
|
request: Request;
|
|
32
32
|
}, CloudflarePlatformRoomContext<TEnv, TMeta>> {
|
|
@@ -70,6 +70,6 @@ interface CreatePluvHandlerResult<TEnv extends Record<string, any> = {}> {
|
|
|
70
70
|
type InferCloudflarePluvHandlerEnv<TPluvServer extends PluvServer<CloudflarePlatform, any, any, any>> = TPluvServer extends PluvServer<CloudflarePlatform<infer IEnv>, any, any, any> ? IEnv : {};
|
|
71
71
|
declare const createPluvHandler: <TPluvServer extends PluvServer<CloudflarePlatform, any, any, any>>(config: CreatePluvHandlerConfig<TPluvServer, Id<InferCloudflarePluvHandlerEnv<TPluvServer>>>) => CreatePluvHandlerResult<Id<InferCloudflarePluvHandlerEnv<TPluvServer>>>;
|
|
72
72
|
|
|
73
|
-
declare const platformCloudflare: <TEnv extends Record<string, any> = {}, TMeta extends Record<string,
|
|
73
|
+
declare const platformCloudflare: <TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}>(config?: CloudflarePlatformConfig<TEnv, TMeta>) => CloudflarePlatform<TEnv, TMeta>;
|
|
74
74
|
|
|
75
75
|
export { type AuthorizeFunction, type AuthorizeFunctionContext, CloudflarePlatform, type CloudflarePlatformConfig, type CreatePluvHandlerConfig, type CreatePluvHandlerResult, type PluvHandlerFetch, createPluvHandler, platformCloudflare };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pluv/platform-cloudflare",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.5",
|
|
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.32.
|
|
22
|
-
"@pluv/persistence-cloudflare-transactional-storage": "^0.32.
|
|
23
|
-
"@pluv/types": "^0.32.
|
|
21
|
+
"@pluv/io": "^0.32.5",
|
|
22
|
+
"@pluv/persistence-cloudflare-transactional-storage": "^0.32.5",
|
|
23
|
+
"@pluv/types": "^0.32.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@cloudflare/workers-types": "^4.20241018.0",
|
|
27
27
|
"eslint": "^8.57.0",
|
|
28
28
|
"tsup": "^8.3.0",
|
|
29
29
|
"typescript": "^5.6.3",
|
|
30
|
-
"@pluv/tsconfig": "^0.32.
|
|
31
|
-
"eslint-config-pluv": "^0.32.
|
|
30
|
+
"@pluv/tsconfig": "^0.32.5",
|
|
31
|
+
"eslint-config-pluv": "^0.32.5"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsup src/index.ts --format esm,cjs --dts",
|
|
@@ -6,26 +6,23 @@ import type {
|
|
|
6
6
|
} from "@pluv/io";
|
|
7
7
|
import { AbstractPlatform } from "@pluv/io";
|
|
8
8
|
import { PersistenceCloudflareTransactionalStorage } from "@pluv/persistence-cloudflare-transactional-storage";
|
|
9
|
-
import type {
|
|
9
|
+
import type { Json } from "@pluv/types";
|
|
10
10
|
import { CloudflareWebSocket } from "./CloudflareWebSocket";
|
|
11
11
|
import { DEFAULT_REGISTRATION_MODE } from "./constants";
|
|
12
12
|
|
|
13
|
-
export type CloudflarePlatformRoomContext<
|
|
14
|
-
TEnv extends Record<string, any>,
|
|
15
|
-
TMeta extends Record<string, JsonPrimitive>,
|
|
16
|
-
> = {
|
|
13
|
+
export type CloudflarePlatformRoomContext<TEnv extends Record<string, any>, TMeta extends Record<string, Json>> = {
|
|
17
14
|
env: TEnv;
|
|
18
15
|
state: DurableObjectState;
|
|
19
16
|
} & (keyof TMeta extends never ? { meta?: undefined } : { meta: TMeta });
|
|
20
17
|
|
|
21
18
|
export type CloudflarePlatformConfig<
|
|
22
19
|
TEnv extends Record<string, any> = {},
|
|
23
|
-
TMeta extends Record<string,
|
|
20
|
+
TMeta extends Record<string, Json> = {},
|
|
24
21
|
> = AbstractPlatformConfig<CloudflarePlatformRoomContext<TEnv, TMeta>> & { mode?: WebSocketRegistrationMode };
|
|
25
22
|
|
|
26
23
|
export class CloudflarePlatform<
|
|
27
24
|
TEnv extends Record<string, any> = {},
|
|
28
|
-
TMeta extends Record<string,
|
|
25
|
+
TMeta extends Record<string, Json> = {},
|
|
29
26
|
> extends AbstractPlatform<
|
|
30
27
|
CloudflareWebSocket,
|
|
31
28
|
{ env: TEnv; request: Request },
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Json } from "@pluv/types";
|
|
2
2
|
import type { CloudflarePlatformConfig } from "./CloudflarePlatform";
|
|
3
3
|
import { CloudflarePlatform } from "./CloudflarePlatform";
|
|
4
4
|
|
|
5
|
-
export const platformCloudflare = <
|
|
6
|
-
TEnv extends Record<string, any> = {},
|
|
7
|
-
TMeta extends Record<string, JsonPrimitive> = {},
|
|
8
|
-
>(
|
|
5
|
+
export const platformCloudflare = <TEnv extends Record<string, any> = {}, TMeta extends Record<string, Json> = {}>(
|
|
9
6
|
config: CloudflarePlatformConfig<TEnv, TMeta> = {},
|
|
10
7
|
): CloudflarePlatform<TEnv, TMeta> => {
|
|
11
8
|
return new CloudflarePlatform<TEnv, TMeta>(config);
|