@pluv/platform-cloudflare 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.
@@ -1,18 +1,18 @@
1
1
 
2
- > @pluv/platform-cloudflare@0.32.4 build /home/runner/work/pluv/pluv/packages/platform-cloudflare
2
+ > @pluv/platform-cloudflare@0.32.6 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
6
6
  CLI Using tsconfig: tsconfig.json
7
- CLI tsup v8.3.0
7
+ CLI tsup v8.3.5
8
8
  CLI Target: es6
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  ESM dist/index.mjs 11.70 KB
12
- ESM ⚡️ Build success in 81ms
12
+ ESM ⚡️ Build success in 35ms
13
13
  CJS dist/index.js 12.80 KB
14
- CJS ⚡️ Build success in 83ms
14
+ CJS ⚡️ Build success in 36ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 918ms
17
- DTS dist/index.d.mts 4.71 KB
18
- DTS dist/index.d.ts 4.71 KB
16
+ DTS ⚡️ Build success in 822ms
17
+ DTS dist/index.d.mts 4.67 KB
18
+ DTS dist/index.d.ts 4.67 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @pluv/platform-cloudflare
2
2
 
3
+ ## 0.32.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c0956e7]
8
+ - @pluv/io@0.32.6
9
+ - @pluv/persistence-cloudflare-transactional-storage@0.32.6
10
+ - @pluv/types@0.32.6
11
+
12
+ ## 0.32.5
13
+
14
+ ### Patch Changes
15
+
16
+ - 98d7585: Update `meta` type on platform contexts to allow for nested json types.
17
+ - @pluv/io@0.32.5
18
+ - @pluv/persistence-cloudflare-transactional-storage@0.32.5
19
+ - @pluv/types@0.32.5
20
+
3
21
  ## 0.32.4
4
22
 
5
23
  ### 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, JsonPrimitive, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired, Id } from '@pluv/types';
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, JsonPrimitive>> = {
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, JsonPrimitive> = {}> = AbstractPlatformConfig<CloudflarePlatformRoomContext<TEnv, TMeta>> & {
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, JsonPrimitive> = {}> extends AbstractPlatform<CloudflareWebSocket, {
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, JsonPrimitive> = {}>(config?: CloudflarePlatformConfig<TEnv, TMeta>) => CloudflarePlatform<TEnv, TMeta>;
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, JsonPrimitive, MaybePromise, Maybe, InferIOAuthorizeUser, InferIOAuthorize, InferIOAuthorizeRequired, Id } from '@pluv/types';
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, JsonPrimitive>> = {
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, JsonPrimitive> = {}> = AbstractPlatformConfig<CloudflarePlatformRoomContext<TEnv, TMeta>> & {
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, JsonPrimitive> = {}> extends AbstractPlatform<CloudflareWebSocket, {
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, JsonPrimitive> = {}>(config?: CloudflarePlatformConfig<TEnv, TMeta>) => CloudflarePlatform<TEnv, TMeta>;
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.4",
3
+ "version": "0.32.6",
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.4",
22
- "@pluv/persistence-cloudflare-transactional-storage": "^0.32.4",
23
- "@pluv/types": "^0.32.4"
21
+ "@pluv/io": "^0.32.6",
22
+ "@pluv/persistence-cloudflare-transactional-storage": "^0.32.6",
23
+ "@pluv/types": "^0.32.6"
24
24
  },
25
25
  "devDependencies": {
26
- "@cloudflare/workers-types": "^4.20241018.0",
26
+ "@cloudflare/workers-types": "^4.20241022.0",
27
27
  "eslint": "^8.57.0",
28
- "tsup": "^8.3.0",
28
+ "tsup": "^8.3.5",
29
29
  "typescript": "^5.6.3",
30
- "@pluv/tsconfig": "^0.32.4",
31
- "eslint-config-pluv": "^0.32.4"
30
+ "@pluv/tsconfig": "^0.32.6",
31
+ "eslint-config-pluv": "^0.32.6"
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 { JsonPrimitive } from "@pluv/types";
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, JsonPrimitive> = {},
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, JsonPrimitive> = {},
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 { JsonPrimitive } from "@pluv/types";
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);