@pluv/types 0.37.7 → 0.38.0

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/types@0.37.7 build /home/runner/work/pluv/pluv/packages/types
2
+ > @pluv/types@0.38.0 build /home/runner/work/pluv/pluv/packages/types
3
3
  > tsup src/index.ts --format esm,cjs --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -9,10 +9,10 @@
9
9
  ESM Build start
10
10
  CJS Build start
11
11
  ESM dist/index.mjs 0 B
12
- ESM ⚡️ Build success in 32ms
12
+ ESM ⚡️ Build success in 29ms
13
13
  CJS dist/index.js 758.00 B
14
- CJS ⚡️ Build success in 33ms
14
+ CJS ⚡️ Build success in 29ms
15
15
  DTS Build start
16
- DTS ⚡️ Build success in 747ms
17
- DTS dist/index.d.mts 7.10 KB
18
- DTS dist/index.d.ts 7.10 KB
16
+ DTS ⚡️ Build success in 811ms
17
+ DTS dist/index.d.mts 7.09 KB
18
+ DTS dist/index.d.ts 7.09 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @pluv/types
2
2
 
3
+ ## 0.38.0
4
+
5
+ ### Minor Changes
6
+
7
+ - f4ceca3: Updated internal event names to follow a new naming convention.
8
+
3
9
  ## 0.37.7
4
10
 
5
11
  ## 0.37.6
package/dist/index.d.mts CHANGED
@@ -44,23 +44,23 @@ type BaseUser = {
44
44
  id: string;
45
45
  };
46
46
  interface BaseClientEventRecord {
47
- $GET_OTHERS: {};
48
- $INITIALIZE_SESSION: {
47
+ $getOthers: {};
48
+ $initializeSession: {
49
49
  presence: JsonObject;
50
50
  update: string | null;
51
51
  };
52
- $PING: {};
53
- $UPDATE_PRESENCE: {
52
+ $ping: {};
53
+ $updatePresence: {
54
54
  presence: JsonObject;
55
55
  };
56
- $UPDATE_STORAGE: {
56
+ $updateStorage: {
57
57
  origin: string | null;
58
58
  update: string;
59
59
  };
60
60
  }
61
61
  type BaseClientMessage = InferEventMessage<BaseClientEventRecord>;
62
62
  interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any, any>> {
63
- $OTHERS_RECEIVED: {
63
+ $othersReceived: {
64
64
  others: {
65
65
  [connectionId: string]: {
66
66
  connectionId: string;
@@ -70,31 +70,31 @@ interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any, any>> {
70
70
  };
71
71
  };
72
72
  };
73
- $USER_JOINED: {
73
+ $userJoined: {
74
74
  connectionId: string;
75
75
  user: NonNullable<Id<InferIOAuthorizeUser<TAuthorize>>>;
76
76
  presence: JsonObject;
77
77
  };
78
78
  }
79
79
  type BaseIOEventRecord<TAuthorize extends IOAuthorize<any, any>> = BaseIOAuthorizeEventRecord<TAuthorize> & {
80
- $ERROR: {
80
+ $error: {
81
81
  message: string;
82
82
  stack?: string | null;
83
83
  };
84
- $EXIT: {
84
+ $exit: {
85
85
  sessionId: string;
86
86
  };
87
- $PONG: {};
88
- $PRESENCE_UPDATED: {
87
+ $pong: {};
88
+ $presenceUpdated: {
89
89
  presence: JsonObject;
90
90
  };
91
- $REGISTERED: {
91
+ $registered: {
92
92
  sessionId: string;
93
93
  };
94
- $STORAGE_RECEIVED: {
94
+ $storageReceived: {
95
95
  state: string;
96
96
  };
97
- $STORAGE_UPDATED: {
97
+ $storageUpdated: {
98
98
  state: string;
99
99
  };
100
100
  };
@@ -156,6 +156,6 @@ type InferEventMessage<TEvents = EventRecord<string, any>, TEvent extends keyof
156
156
  }[TEvent] : never;
157
157
  type IOEventMessage<TIO extends IOLike<any>, TEvent extends keyof InferIOOutput<TIO> = keyof InferIOOutput<TIO>> = Id<{
158
158
  room: string;
159
- } & InferEventMessage<InferIOOutput<TIO>, TEvent> & (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$ERROR" ? Partial<IOAuthorizeEventMessage<TIO>> : IOAuthorizeEventMessage<TIO>)>;
159
+ } & InferEventMessage<InferIOOutput<TIO>, TEvent> & (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$error" ? Partial<IOAuthorizeEventMessage<TIO>> : IOAuthorizeEventMessage<TIO>)>;
160
160
 
161
161
  export type { BaseClientEventRecord, BaseClientMessage, BaseIOAuthorizeEventRecord, BaseIOEventRecord, BaseUser, Constructable, DeepPartial, DeepWriteable, EventMessage, EventRecord, GetEventMessage, IOAuthorize, IOAuthorizeEventMessage, IOEventMessage, IOLike, IORouterLike, Id, InferEventMessage, InferEventsInput, InferEventsOutput, InferIOAuthorize, InferIOAuthorizeUser, InferIOInput, InferIOOutput, InputZodLike, Json, JsonObject, JsonPrimitive, Maybe, MaybePromise, MaybeReadonlyArray, NonNilProps, OptionalProps, ProcedureLike, Spread, SpreadProperties, UndefinedProps };
package/dist/index.d.ts CHANGED
@@ -44,23 +44,23 @@ type BaseUser = {
44
44
  id: string;
45
45
  };
46
46
  interface BaseClientEventRecord {
47
- $GET_OTHERS: {};
48
- $INITIALIZE_SESSION: {
47
+ $getOthers: {};
48
+ $initializeSession: {
49
49
  presence: JsonObject;
50
50
  update: string | null;
51
51
  };
52
- $PING: {};
53
- $UPDATE_PRESENCE: {
52
+ $ping: {};
53
+ $updatePresence: {
54
54
  presence: JsonObject;
55
55
  };
56
- $UPDATE_STORAGE: {
56
+ $updateStorage: {
57
57
  origin: string | null;
58
58
  update: string;
59
59
  };
60
60
  }
61
61
  type BaseClientMessage = InferEventMessage<BaseClientEventRecord>;
62
62
  interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any, any>> {
63
- $OTHERS_RECEIVED: {
63
+ $othersReceived: {
64
64
  others: {
65
65
  [connectionId: string]: {
66
66
  connectionId: string;
@@ -70,31 +70,31 @@ interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any, any>> {
70
70
  };
71
71
  };
72
72
  };
73
- $USER_JOINED: {
73
+ $userJoined: {
74
74
  connectionId: string;
75
75
  user: NonNullable<Id<InferIOAuthorizeUser<TAuthorize>>>;
76
76
  presence: JsonObject;
77
77
  };
78
78
  }
79
79
  type BaseIOEventRecord<TAuthorize extends IOAuthorize<any, any>> = BaseIOAuthorizeEventRecord<TAuthorize> & {
80
- $ERROR: {
80
+ $error: {
81
81
  message: string;
82
82
  stack?: string | null;
83
83
  };
84
- $EXIT: {
84
+ $exit: {
85
85
  sessionId: string;
86
86
  };
87
- $PONG: {};
88
- $PRESENCE_UPDATED: {
87
+ $pong: {};
88
+ $presenceUpdated: {
89
89
  presence: JsonObject;
90
90
  };
91
- $REGISTERED: {
91
+ $registered: {
92
92
  sessionId: string;
93
93
  };
94
- $STORAGE_RECEIVED: {
94
+ $storageReceived: {
95
95
  state: string;
96
96
  };
97
- $STORAGE_UPDATED: {
97
+ $storageUpdated: {
98
98
  state: string;
99
99
  };
100
100
  };
@@ -156,6 +156,6 @@ type InferEventMessage<TEvents = EventRecord<string, any>, TEvent extends keyof
156
156
  }[TEvent] : never;
157
157
  type IOEventMessage<TIO extends IOLike<any>, TEvent extends keyof InferIOOutput<TIO> = keyof InferIOOutput<TIO>> = Id<{
158
158
  room: string;
159
- } & InferEventMessage<InferIOOutput<TIO>, TEvent> & (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$ERROR" ? Partial<IOAuthorizeEventMessage<TIO>> : IOAuthorizeEventMessage<TIO>)>;
159
+ } & InferEventMessage<InferIOOutput<TIO>, TEvent> & (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$error" ? Partial<IOAuthorizeEventMessage<TIO>> : IOAuthorizeEventMessage<TIO>)>;
160
160
 
161
161
  export type { BaseClientEventRecord, BaseClientMessage, BaseIOAuthorizeEventRecord, BaseIOEventRecord, BaseUser, Constructable, DeepPartial, DeepWriteable, EventMessage, EventRecord, GetEventMessage, IOAuthorize, IOAuthorizeEventMessage, IOEventMessage, IOLike, IORouterLike, Id, InferEventMessage, InferEventsInput, InferEventsOutput, InferIOAuthorize, InferIOAuthorizeUser, InferIOInput, InferIOOutput, InputZodLike, Json, JsonObject, JsonPrimitive, Maybe, MaybePromise, MaybeReadonlyArray, NonNilProps, OptionalProps, ProcedureLike, Spread, SpreadProperties, UndefinedProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pluv/types",
3
- "version": "0.37.7",
3
+ "version": "0.38.0",
4
4
  "description": "@pluv/io shared types",
5
5
  "author": "leedavidcs",
6
6
  "license": "MIT",
@@ -19,8 +19,8 @@
19
19
  "eslint": "^8.57.1",
20
20
  "tsup": "^8.4.0",
21
21
  "typescript": "^5.8.2",
22
- "@pluv/tsconfig": "^0.37.7",
23
- "eslint-config-pluv": "^0.37.7"
22
+ "@pluv/tsconfig": "^0.38.0",
23
+ "eslint-config-pluv": "^0.38.0"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsup src/index.ts --format esm,cjs --dts",
package/src/pluv.ts CHANGED
@@ -5,16 +5,16 @@ export type BaseUser = {
5
5
  };
6
6
 
7
7
  export interface BaseClientEventRecord {
8
- $GET_OTHERS: {};
9
- $INITIALIZE_SESSION: {
8
+ $getOthers: {};
9
+ $initializeSession: {
10
10
  presence: JsonObject;
11
11
  update: string | null;
12
12
  };
13
- $PING: {};
14
- $UPDATE_PRESENCE: {
13
+ $ping: {};
14
+ $updatePresence: {
15
15
  presence: JsonObject;
16
16
  };
17
- $UPDATE_STORAGE: {
17
+ $updateStorage: {
18
18
  origin: string | null;
19
19
  update: string;
20
20
  };
@@ -23,7 +23,7 @@ export interface BaseClientEventRecord {
23
23
  export type BaseClientMessage = InferEventMessage<BaseClientEventRecord>;
24
24
 
25
25
  export interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any, any>> {
26
- $OTHERS_RECEIVED: {
26
+ $othersReceived: {
27
27
  others: {
28
28
  [connectionId: string]: {
29
29
  connectionId: string;
@@ -33,7 +33,7 @@ export interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any,
33
33
  };
34
34
  };
35
35
  };
36
- $USER_JOINED: {
36
+ $userJoined: {
37
37
  connectionId: string;
38
38
  user: NonNullable<Id<InferIOAuthorizeUser<TAuthorize>>>;
39
39
  presence: JsonObject;
@@ -41,24 +41,24 @@ export interface BaseIOAuthorizeEventRecord<TAuthorize extends IOAuthorize<any,
41
41
  }
42
42
 
43
43
  export type BaseIOEventRecord<TAuthorize extends IOAuthorize<any, any>> = BaseIOAuthorizeEventRecord<TAuthorize> & {
44
- $ERROR: {
44
+ $error: {
45
45
  message: string;
46
46
  stack?: string | null;
47
47
  };
48
- $EXIT: {
48
+ $exit: {
49
49
  sessionId: string;
50
50
  };
51
- $PONG: {};
52
- $PRESENCE_UPDATED: {
51
+ $pong: {};
52
+ $presenceUpdated: {
53
53
  presence: JsonObject;
54
54
  };
55
- $REGISTERED: {
55
+ $registered: {
56
56
  sessionId: string;
57
57
  };
58
- $STORAGE_RECEIVED: {
58
+ $storageReceived: {
59
59
  state: string;
60
60
  };
61
- $STORAGE_UPDATED: {
61
+ $storageUpdated: {
62
62
  state: string;
63
63
  };
64
64
  };
@@ -157,7 +157,7 @@ export type IOEventMessage<
157
157
  TEvent extends keyof InferIOOutput<TIO> = keyof InferIOOutput<TIO>,
158
158
  > = Id<
159
159
  { room: string } & InferEventMessage<InferIOOutput<TIO>, TEvent> &
160
- (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$ERROR"
160
+ (InferEventMessage<InferIOOutput<TIO>, TEvent>["type"] extends "$error"
161
161
  ? Partial<IOAuthorizeEventMessage<TIO>>
162
162
  : IOAuthorizeEventMessage<TIO>)
163
163
  >;