@skillstew/common 1.0.31 → 1.0.33
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/build/events/EventMap.d.ts +5 -4
- package/build/events/EventMap.js +3 -1
- package/build/events/schemas/userConnectionEventSchemas.d.ts +6 -6
- package/build/events/schemas/userConnectionEventSchemas.js +1 -1
- package/package.json +1 -1
- package/src/events/EventMap.ts +6 -1
- package/src/events/schemas/userConnectionEventSchemas.ts +1 -1
|
@@ -4,19 +4,19 @@ export declare const EventSchemas: {
|
|
|
4
4
|
connectionId: z.ZodString;
|
|
5
5
|
fromUserId: z.ZodString;
|
|
6
6
|
toUserId: z.ZodString;
|
|
7
|
-
timestamp: z.
|
|
7
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
8
8
|
}, z.core.$strict>;
|
|
9
9
|
readonly "connection.accepted": z.ZodObject<{
|
|
10
10
|
connectionId: z.ZodString;
|
|
11
11
|
fromUserId: z.ZodString;
|
|
12
12
|
toUserId: z.ZodString;
|
|
13
|
-
timestamp: z.
|
|
13
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
14
14
|
}, z.core.$strict>;
|
|
15
15
|
readonly "connection.rejected": z.ZodObject<{
|
|
16
16
|
connectionId: z.ZodString;
|
|
17
17
|
fromUserId: z.ZodString;
|
|
18
18
|
toUserId: z.ZodString;
|
|
19
|
-
timestamp: z.
|
|
19
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
20
20
|
}, z.core.$strict>;
|
|
21
21
|
readonly "skill.created": z.ZodObject<{
|
|
22
22
|
id: z.ZodUUID;
|
|
@@ -66,5 +66,6 @@ export declare const EventSchemas: {
|
|
|
66
66
|
avatarKey: z.ZodOptional<z.ZodString>;
|
|
67
67
|
}, z.core.$strip>;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export declare const EventName: readonly (keyof typeof EventSchemas)[];
|
|
70
|
+
export type EventName = (typeof EventName)[number];
|
|
70
71
|
export type EventPayload<T extends EventName> = z.infer<(typeof EventSchemas)[T]>;
|
package/build/events/EventMap.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EventSchemas = void 0;
|
|
3
|
+
exports.EventName = exports.EventSchemas = void 0;
|
|
4
4
|
const userEventsSchema_1 = require("./schemas/userEventsSchema");
|
|
5
5
|
const skillsEventSchemas_1 = require("./schemas/skillsEventSchemas");
|
|
6
6
|
const userConnectionEventSchemas_1 = require("./schemas/userConnectionEventSchemas");
|
|
7
7
|
// Union of all app event schemas
|
|
8
8
|
exports.EventSchemas = Object.assign(Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas), userConnectionEventSchemas_1.ConnectionEventSchemas);
|
|
9
|
+
// Array of all event names
|
|
10
|
+
exports.EventName = Object.keys(exports.EventSchemas);
|
|
@@ -3,37 +3,37 @@ export declare const connectionRequestedSchema: z.ZodObject<{
|
|
|
3
3
|
connectionId: z.ZodString;
|
|
4
4
|
fromUserId: z.ZodString;
|
|
5
5
|
toUserId: z.ZodString;
|
|
6
|
-
timestamp: z.
|
|
6
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
7
7
|
}, z.core.$strict>;
|
|
8
8
|
export declare const connectionAcceptedSchema: z.ZodObject<{
|
|
9
9
|
connectionId: z.ZodString;
|
|
10
10
|
fromUserId: z.ZodString;
|
|
11
11
|
toUserId: z.ZodString;
|
|
12
|
-
timestamp: z.
|
|
12
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
13
13
|
}, z.core.$strict>;
|
|
14
14
|
export declare const connectionRejectedSchema: z.ZodObject<{
|
|
15
15
|
connectionId: z.ZodString;
|
|
16
16
|
fromUserId: z.ZodString;
|
|
17
17
|
toUserId: z.ZodString;
|
|
18
|
-
timestamp: z.
|
|
18
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
19
19
|
}, z.core.$strict>;
|
|
20
20
|
export declare const ConnectionEventSchemas: {
|
|
21
21
|
readonly "connection.requested": z.ZodObject<{
|
|
22
22
|
connectionId: z.ZodString;
|
|
23
23
|
fromUserId: z.ZodString;
|
|
24
24
|
toUserId: z.ZodString;
|
|
25
|
-
timestamp: z.
|
|
25
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
26
26
|
}, z.core.$strict>;
|
|
27
27
|
readonly "connection.accepted": z.ZodObject<{
|
|
28
28
|
connectionId: z.ZodString;
|
|
29
29
|
fromUserId: z.ZodString;
|
|
30
30
|
toUserId: z.ZodString;
|
|
31
|
-
timestamp: z.
|
|
31
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
32
32
|
}, z.core.$strict>;
|
|
33
33
|
readonly "connection.rejected": z.ZodObject<{
|
|
34
34
|
connectionId: z.ZodString;
|
|
35
35
|
fromUserId: z.ZodString;
|
|
36
36
|
toUserId: z.ZodString;
|
|
37
|
-
timestamp: z.
|
|
37
|
+
timestamp: z.ZodCoercedDate<unknown>;
|
|
38
38
|
}, z.core.$strict>;
|
|
39
39
|
};
|
|
@@ -10,7 +10,7 @@ exports.connectionRequestedSchema = zod_1.default
|
|
|
10
10
|
connectionId: zod_1.default.string(),
|
|
11
11
|
fromUserId: zod_1.default.string(),
|
|
12
12
|
toUserId: zod_1.default.string(),
|
|
13
|
-
timestamp: zod_1.default.date(),
|
|
13
|
+
timestamp: zod_1.default.coerce.date(),
|
|
14
14
|
})
|
|
15
15
|
.strict();
|
|
16
16
|
exports.connectionAcceptedSchema = exports.connectionRequestedSchema.extend({});
|
package/package.json
CHANGED
package/src/events/EventMap.ts
CHANGED
|
@@ -11,8 +11,13 @@ export const EventSchemas = {
|
|
|
11
11
|
...ConnectionEventSchemas,
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
|
+
// Array of all event names
|
|
15
|
+
export const EventName = Object.keys(
|
|
16
|
+
EventSchemas,
|
|
17
|
+
) as unknown as readonly (keyof typeof EventSchemas)[];
|
|
18
|
+
|
|
14
19
|
// Union of all app event names
|
|
15
|
-
export type EventName =
|
|
20
|
+
export type EventName = (typeof EventName)[number];
|
|
16
21
|
|
|
17
22
|
// Union of all app event payloads
|
|
18
23
|
export type EventPayload<T extends EventName> = z.infer<
|