@skillstew/common 1.0.28 → 1.0.30
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 +19 -0
- package/build/events/EventMap.js +2 -1
- package/build/events/schemas/userConnectionEventSchemas.d.ts +39 -0
- package/build/events/schemas/userConnectionEventSchemas.js +22 -0
- package/build/events/schemas/userEventsSchema.d.ts +2 -0
- package/build/events/schemas/userEventsSchema.js +1 -0
- package/package.json +1 -1
- package/src/events/EventMap.ts +2 -0
- package/src/events/schemas/userConnectionEventSchemas.ts +20 -0
- package/src/events/schemas/userEventsSchema.ts +1 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
export declare const EventSchemas: {
|
|
3
|
+
readonly "connection.requested": z.ZodObject<{
|
|
4
|
+
connectionId: z.ZodString;
|
|
5
|
+
fromUserId: z.ZodString;
|
|
6
|
+
toUserId: z.ZodString;
|
|
7
|
+
timestamp: z.ZodDate;
|
|
8
|
+
}, z.core.$strict>;
|
|
9
|
+
readonly "connection.accepted": z.ZodObject<{
|
|
10
|
+
connectionId: z.ZodString;
|
|
11
|
+
fromUserId: z.ZodString;
|
|
12
|
+
toUserId: z.ZodString;
|
|
13
|
+
timestamp: z.ZodDate;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
readonly "connection.rejected": z.ZodObject<{
|
|
16
|
+
connectionId: z.ZodString;
|
|
17
|
+
fromUserId: z.ZodString;
|
|
18
|
+
toUserId: z.ZodString;
|
|
19
|
+
timestamp: z.ZodDate;
|
|
20
|
+
}, z.core.$strict>;
|
|
3
21
|
readonly "skill.created": z.ZodObject<{
|
|
4
22
|
id: z.ZodUUID;
|
|
5
23
|
name: z.ZodString;
|
|
@@ -45,6 +63,7 @@ export declare const EventSchemas: {
|
|
|
45
63
|
formattedAddress: z.ZodString;
|
|
46
64
|
}, z.core.$strip>>;
|
|
47
65
|
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
66
|
+
avatarKey: z.ZodOptional<z.ZodString>;
|
|
48
67
|
}, z.core.$strip>;
|
|
49
68
|
};
|
|
50
69
|
export type EventName = keyof typeof EventSchemas;
|
package/build/events/EventMap.js
CHANGED
|
@@ -3,5 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EventSchemas = void 0;
|
|
4
4
|
const userEventsSchema_1 = require("./schemas/userEventsSchema");
|
|
5
5
|
const skillsEventSchemas_1 = require("./schemas/skillsEventSchemas");
|
|
6
|
+
const userConnectionEventSchemas_1 = require("./schemas/userConnectionEventSchemas");
|
|
6
7
|
// Union of all app event schemas
|
|
7
|
-
exports.EventSchemas = Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas);
|
|
8
|
+
exports.EventSchemas = Object.assign(Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas), userConnectionEventSchemas_1.ConnectionEventSchemas);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const connectionRequestedSchema: z.ZodObject<{
|
|
3
|
+
connectionId: z.ZodString;
|
|
4
|
+
fromUserId: z.ZodString;
|
|
5
|
+
toUserId: z.ZodString;
|
|
6
|
+
timestamp: z.ZodDate;
|
|
7
|
+
}, z.core.$strict>;
|
|
8
|
+
export declare const connectionAcceptedSchema: z.ZodObject<{
|
|
9
|
+
connectionId: z.ZodString;
|
|
10
|
+
fromUserId: z.ZodString;
|
|
11
|
+
toUserId: z.ZodString;
|
|
12
|
+
timestamp: z.ZodDate;
|
|
13
|
+
}, z.core.$strict>;
|
|
14
|
+
export declare const connectionRejectedSchema: z.ZodObject<{
|
|
15
|
+
connectionId: z.ZodString;
|
|
16
|
+
fromUserId: z.ZodString;
|
|
17
|
+
toUserId: z.ZodString;
|
|
18
|
+
timestamp: z.ZodDate;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export declare const ConnectionEventSchemas: {
|
|
21
|
+
readonly "connection.requested": z.ZodObject<{
|
|
22
|
+
connectionId: z.ZodString;
|
|
23
|
+
fromUserId: z.ZodString;
|
|
24
|
+
toUserId: z.ZodString;
|
|
25
|
+
timestamp: z.ZodDate;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
readonly "connection.accepted": z.ZodObject<{
|
|
28
|
+
connectionId: z.ZodString;
|
|
29
|
+
fromUserId: z.ZodString;
|
|
30
|
+
toUserId: z.ZodString;
|
|
31
|
+
timestamp: z.ZodDate;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
readonly "connection.rejected": z.ZodObject<{
|
|
34
|
+
connectionId: z.ZodString;
|
|
35
|
+
fromUserId: z.ZodString;
|
|
36
|
+
toUserId: z.ZodString;
|
|
37
|
+
timestamp: z.ZodDate;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConnectionEventSchemas = exports.connectionRejectedSchema = exports.connectionAcceptedSchema = exports.connectionRequestedSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.connectionRequestedSchema = zod_1.default
|
|
9
|
+
.object({
|
|
10
|
+
connectionId: zod_1.default.string(),
|
|
11
|
+
fromUserId: zod_1.default.string(),
|
|
12
|
+
toUserId: zod_1.default.string(),
|
|
13
|
+
timestamp: zod_1.default.date(),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|
|
16
|
+
exports.connectionAcceptedSchema = exports.connectionRequestedSchema.extend({});
|
|
17
|
+
exports.connectionRejectedSchema = exports.connectionRequestedSchema.extend({});
|
|
18
|
+
exports.ConnectionEventSchemas = {
|
|
19
|
+
"connection.requested": exports.connectionRequestedSchema,
|
|
20
|
+
"connection.accepted": exports.connectionAcceptedSchema,
|
|
21
|
+
"connection.rejected": exports.connectionRejectedSchema,
|
|
22
|
+
};
|
|
@@ -16,6 +16,7 @@ export declare const userProfileUpdatedSchema: z.ZodObject<{
|
|
|
16
16
|
formattedAddress: z.ZodString;
|
|
17
17
|
}, z.core.$strip>>;
|
|
18
18
|
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
19
|
+
avatarKey: z.ZodOptional<z.ZodString>;
|
|
19
20
|
}, z.core.$strip>;
|
|
20
21
|
export declare const UserEventSchemas: {
|
|
21
22
|
readonly "user.registered": z.ZodObject<{
|
|
@@ -35,5 +36,6 @@ export declare const UserEventSchemas: {
|
|
|
35
36
|
formattedAddress: z.ZodString;
|
|
36
37
|
}, z.core.$strip>>;
|
|
37
38
|
languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
39
|
+
avatarKey: z.ZodOptional<z.ZodString>;
|
|
38
40
|
}, z.core.$strip>;
|
|
39
41
|
};
|
|
@@ -24,6 +24,7 @@ exports.userProfileUpdatedSchema = zod_1.default.object({
|
|
|
24
24
|
})
|
|
25
25
|
.optional(),
|
|
26
26
|
languages: zod_1.default.array(zod_1.default.string()).optional(),
|
|
27
|
+
avatarKey: zod_1.default.string().optional(),
|
|
27
28
|
});
|
|
28
29
|
exports.UserEventSchemas = {
|
|
29
30
|
"user.registered": exports.userRegisteredSchema,
|
package/package.json
CHANGED
package/src/events/EventMap.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
import { UserEventSchemas } from "./schemas/userEventsSchema";
|
|
3
3
|
import { SkillsEventSchemas } from "./schemas/skillsEventSchemas";
|
|
4
|
+
import { ConnectionEventSchemas } from "./schemas/userConnectionEventSchemas";
|
|
4
5
|
|
|
5
6
|
// Union of all app event schemas
|
|
6
7
|
|
|
7
8
|
export const EventSchemas = {
|
|
8
9
|
...UserEventSchemas,
|
|
9
10
|
...SkillsEventSchemas,
|
|
11
|
+
...ConnectionEventSchemas,
|
|
10
12
|
} as const;
|
|
11
13
|
|
|
12
14
|
// Union of all app event names
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const connectionRequestedSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
connectionId: z.string(),
|
|
6
|
+
fromUserId: z.string(),
|
|
7
|
+
toUserId: z.string(),
|
|
8
|
+
timestamp: z.date(),
|
|
9
|
+
})
|
|
10
|
+
.strict();
|
|
11
|
+
|
|
12
|
+
export const connectionAcceptedSchema = connectionRequestedSchema.extend({});
|
|
13
|
+
|
|
14
|
+
export const connectionRejectedSchema = connectionRequestedSchema.extend({});
|
|
15
|
+
|
|
16
|
+
export const ConnectionEventSchemas = {
|
|
17
|
+
"connection.requested": connectionRequestedSchema,
|
|
18
|
+
"connection.accepted": connectionAcceptedSchema,
|
|
19
|
+
"connection.rejected": connectionRejectedSchema,
|
|
20
|
+
} as const;
|