@skillstew/common 1.0.39 → 1.0.41
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/AppEvent.d.ts +0 -2
- package/build/events/EventMap.d.ts +9 -1
- package/build/events/EventMap.js +2 -1
- package/build/events/schemas/authEventSchemas.d.ts +11 -0
- package/build/events/schemas/authEventSchemas.js +14 -0
- package/build/events/schemas/expertEventsSchema.d.ts +8 -2
- package/build/events/schemas/expertEventsSchema.js +6 -2
- 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/AppEvent.ts +0 -3
- package/src/events/EventMap.ts +2 -0
- package/src/events/schemas/authEventSchemas.ts +10 -0
- package/src/events/schemas/expertEventsSchema.ts +6 -1
- package/src/events/schemas/userEventsSchema.ts +1 -0
|
@@ -7,6 +7,4 @@ export interface AppEvent<T extends EventName> {
|
|
|
7
7
|
data: EventPayload<T>;
|
|
8
8
|
traceId?: string;
|
|
9
9
|
}
|
|
10
|
-
export type UserRegisteredEvent = AppEvent<"user.registered">;
|
|
11
|
-
export type UserVerifiedEvent = AppEvent<"user.verified">;
|
|
12
10
|
export type AnyAppEvent = AppEvent<EventName>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
2
|
export declare const EventSchemas: {
|
|
3
|
+
readonly "resendVerificationLink.requested": z.ZodObject<{
|
|
4
|
+
email: z.ZodEmail;
|
|
5
|
+
token: z.ZodString;
|
|
6
|
+
}, z.core.$strip>;
|
|
3
7
|
readonly "expert.registered": z.ZodObject<{
|
|
4
8
|
id: z.ZodUUID;
|
|
5
9
|
email: z.ZodEmail;
|
|
6
|
-
token: z.ZodString
|
|
10
|
+
token: z.ZodOptional<z.ZodString>;
|
|
7
11
|
}, z.core.$strip>;
|
|
8
12
|
readonly "expert.onboarded": z.ZodObject<{
|
|
9
13
|
expertId: z.ZodUUID;
|
|
@@ -15,6 +19,9 @@ export declare const EventSchemas: {
|
|
|
15
19
|
hasTeachingExperience: z.ZodBoolean;
|
|
16
20
|
teachingExperienceDesc: z.ZodString;
|
|
17
21
|
}, z.core.$strip>;
|
|
22
|
+
readonly "expert.verified": z.ZodObject<{
|
|
23
|
+
id: z.ZodUUID;
|
|
24
|
+
}, z.core.$strip>;
|
|
18
25
|
readonly "connection.requested": z.ZodObject<{
|
|
19
26
|
connectionId: z.ZodString;
|
|
20
27
|
requesterId: z.ZodString;
|
|
@@ -70,6 +77,7 @@ export declare const EventSchemas: {
|
|
|
70
77
|
readonly "user.registered": z.ZodObject<{
|
|
71
78
|
id: z.ZodUUID;
|
|
72
79
|
email: z.ZodEmail;
|
|
80
|
+
token: z.ZodOptional<z.ZodString>;
|
|
73
81
|
}, z.core.$strip>;
|
|
74
82
|
readonly "user.verified": z.ZodObject<{
|
|
75
83
|
id: z.ZodUUID;
|
package/build/events/EventMap.js
CHANGED
|
@@ -5,7 +5,8 @@ const userEventsSchema_1 = require("./schemas/userEventsSchema");
|
|
|
5
5
|
const skillsEventSchemas_1 = require("./schemas/skillsEventSchemas");
|
|
6
6
|
const userConnectionEventSchemas_1 = require("./schemas/userConnectionEventSchemas");
|
|
7
7
|
const expertEventsSchema_1 = require("./schemas/expertEventsSchema");
|
|
8
|
+
const authEventSchemas_1 = require("./schemas/authEventSchemas");
|
|
8
9
|
// Union of all app event schemas
|
|
9
|
-
exports.EventSchemas = Object.assign(Object.assign(Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas), userConnectionEventSchemas_1.ConnectionEventSchemas), expertEventsSchema_1.ExpertEventSchemas);
|
|
10
|
+
exports.EventSchemas = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas), userConnectionEventSchemas_1.ConnectionEventSchemas), expertEventsSchema_1.ExpertEventSchemas), authEventSchemas_1.AuthEventSchemas);
|
|
10
11
|
// Array of all event names
|
|
11
12
|
exports.EventName = Object.keys(exports.EventSchemas);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
export declare const resendVerificationLinkRequestedSchema: z.ZodObject<{
|
|
3
|
+
email: z.ZodEmail;
|
|
4
|
+
token: z.ZodString;
|
|
5
|
+
}, z.core.$strip>;
|
|
6
|
+
export declare const AuthEventSchemas: {
|
|
7
|
+
readonly "resendVerificationLink.requested": z.ZodObject<{
|
|
8
|
+
email: z.ZodEmail;
|
|
9
|
+
token: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
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.AuthEventSchemas = exports.resendVerificationLinkRequestedSchema = void 0;
|
|
7
|
+
const zod_1 = __importDefault(require("zod"));
|
|
8
|
+
exports.resendVerificationLinkRequestedSchema = zod_1.default.object({
|
|
9
|
+
email: zod_1.default.email(),
|
|
10
|
+
token: zod_1.default.string(),
|
|
11
|
+
});
|
|
12
|
+
exports.AuthEventSchemas = {
|
|
13
|
+
"resendVerificationLink.requested": exports.resendVerificationLinkRequestedSchema,
|
|
14
|
+
};
|
|
@@ -2,7 +2,7 @@ import z from "zod";
|
|
|
2
2
|
export declare const expertRegisteredSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodUUID;
|
|
4
4
|
email: z.ZodEmail;
|
|
5
|
-
token: z.ZodString
|
|
5
|
+
token: z.ZodOptional<z.ZodString>;
|
|
6
6
|
}, z.core.$strip>;
|
|
7
7
|
export declare const newExpertOnboardedSchema: z.ZodObject<{
|
|
8
8
|
expertId: z.ZodUUID;
|
|
@@ -14,11 +14,14 @@ export declare const newExpertOnboardedSchema: z.ZodObject<{
|
|
|
14
14
|
hasTeachingExperience: z.ZodBoolean;
|
|
15
15
|
teachingExperienceDesc: z.ZodString;
|
|
16
16
|
}, z.core.$strip>;
|
|
17
|
+
export declare const expertVerifiedSchema: z.ZodObject<{
|
|
18
|
+
id: z.ZodUUID;
|
|
19
|
+
}, z.core.$strip>;
|
|
17
20
|
export declare const ExpertEventSchemas: {
|
|
18
21
|
readonly "expert.registered": z.ZodObject<{
|
|
19
22
|
id: z.ZodUUID;
|
|
20
23
|
email: z.ZodEmail;
|
|
21
|
-
token: z.ZodString
|
|
24
|
+
token: z.ZodOptional<z.ZodString>;
|
|
22
25
|
}, z.core.$strip>;
|
|
23
26
|
readonly "expert.onboarded": z.ZodObject<{
|
|
24
27
|
expertId: z.ZodUUID;
|
|
@@ -30,4 +33,7 @@ export declare const ExpertEventSchemas: {
|
|
|
30
33
|
hasTeachingExperience: z.ZodBoolean;
|
|
31
34
|
teachingExperienceDesc: z.ZodString;
|
|
32
35
|
}, z.core.$strip>;
|
|
36
|
+
readonly "expert.verified": z.ZodObject<{
|
|
37
|
+
id: z.ZodUUID;
|
|
38
|
+
}, z.core.$strip>;
|
|
33
39
|
};
|
|
@@ -3,12 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ExpertEventSchemas = exports.newExpertOnboardedSchema = exports.expertRegisteredSchema = void 0;
|
|
6
|
+
exports.ExpertEventSchemas = exports.expertVerifiedSchema = exports.newExpertOnboardedSchema = exports.expertRegisteredSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
exports.expertRegisteredSchema = zod_1.default.object({
|
|
9
9
|
id: zod_1.default.uuid(),
|
|
10
10
|
email: zod_1.default.email(),
|
|
11
|
-
token: zod_1.default.string(),
|
|
11
|
+
token: zod_1.default.string().optional(),
|
|
12
12
|
});
|
|
13
13
|
exports.newExpertOnboardedSchema = zod_1.default.object({
|
|
14
14
|
expertId: zod_1.default.uuid(),
|
|
@@ -20,7 +20,11 @@ exports.newExpertOnboardedSchema = zod_1.default.object({
|
|
|
20
20
|
hasTeachingExperience: zod_1.default.boolean(),
|
|
21
21
|
teachingExperienceDesc: zod_1.default.string(),
|
|
22
22
|
});
|
|
23
|
+
exports.expertVerifiedSchema = zod_1.default.object({
|
|
24
|
+
id: zod_1.default.uuid(),
|
|
25
|
+
});
|
|
23
26
|
exports.ExpertEventSchemas = {
|
|
24
27
|
"expert.registered": exports.expertRegisteredSchema,
|
|
25
28
|
"expert.onboarded": exports.newExpertOnboardedSchema,
|
|
29
|
+
"expert.verified": exports.expertVerifiedSchema,
|
|
26
30
|
};
|
|
@@ -2,6 +2,7 @@ import z from "zod";
|
|
|
2
2
|
export declare const userRegisteredSchema: z.ZodObject<{
|
|
3
3
|
id: z.ZodUUID;
|
|
4
4
|
email: z.ZodEmail;
|
|
5
|
+
token: z.ZodOptional<z.ZodString>;
|
|
5
6
|
}, z.core.$strip>;
|
|
6
7
|
export declare const userVerifiedSchema: z.ZodObject<{
|
|
7
8
|
id: z.ZodUUID;
|
|
@@ -22,6 +23,7 @@ export declare const UserEventSchemas: {
|
|
|
22
23
|
readonly "user.registered": z.ZodObject<{
|
|
23
24
|
id: z.ZodUUID;
|
|
24
25
|
email: z.ZodEmail;
|
|
26
|
+
token: z.ZodOptional<z.ZodString>;
|
|
25
27
|
}, z.core.$strip>;
|
|
26
28
|
readonly "user.verified": z.ZodObject<{
|
|
27
29
|
id: z.ZodUUID;
|
|
@@ -8,6 +8,7 @@ const zod_1 = __importDefault(require("zod"));
|
|
|
8
8
|
exports.userRegisteredSchema = zod_1.default.object({
|
|
9
9
|
id: zod_1.default.uuid(),
|
|
10
10
|
email: zod_1.default.email(),
|
|
11
|
+
token: zod_1.default.string().optional(),
|
|
11
12
|
});
|
|
12
13
|
exports.userVerifiedSchema = zod_1.default.object({
|
|
13
14
|
id: zod_1.default.uuid(),
|
package/package.json
CHANGED
package/src/events/AppEvent.ts
CHANGED
package/src/events/EventMap.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { UserEventSchemas } from "./schemas/userEventsSchema";
|
|
|
3
3
|
import { SkillsEventSchemas } from "./schemas/skillsEventSchemas";
|
|
4
4
|
import { ConnectionEventSchemas } from "./schemas/userConnectionEventSchemas";
|
|
5
5
|
import { ExpertEventSchemas } from "./schemas/expertEventsSchema";
|
|
6
|
+
import { AuthEventSchemas } from "./schemas/authEventSchemas";
|
|
6
7
|
|
|
7
8
|
// Union of all app event schemas
|
|
8
9
|
|
|
@@ -11,6 +12,7 @@ export const EventSchemas = {
|
|
|
11
12
|
...SkillsEventSchemas,
|
|
12
13
|
...ConnectionEventSchemas,
|
|
13
14
|
...ExpertEventSchemas,
|
|
15
|
+
...AuthEventSchemas,
|
|
14
16
|
} as const;
|
|
15
17
|
|
|
16
18
|
// Array of all event names
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
|
|
3
|
+
export const resendVerificationLinkRequestedSchema = z.object({
|
|
4
|
+
email: z.email(),
|
|
5
|
+
token: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const AuthEventSchemas = {
|
|
9
|
+
"resendVerificationLink.requested": resendVerificationLinkRequestedSchema,
|
|
10
|
+
} as const;
|
|
@@ -3,7 +3,7 @@ import z from "zod";
|
|
|
3
3
|
export const expertRegisteredSchema = z.object({
|
|
4
4
|
id: z.uuid(),
|
|
5
5
|
email: z.email(),
|
|
6
|
-
token: z.string(),
|
|
6
|
+
token: z.string().optional(),
|
|
7
7
|
});
|
|
8
8
|
|
|
9
9
|
export const newExpertOnboardedSchema = z.object({
|
|
@@ -17,7 +17,12 @@ export const newExpertOnboardedSchema = z.object({
|
|
|
17
17
|
teachingExperienceDesc: z.string(),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
export const expertVerifiedSchema = z.object({
|
|
21
|
+
id: z.uuid(),
|
|
22
|
+
});
|
|
23
|
+
|
|
20
24
|
export const ExpertEventSchemas = {
|
|
21
25
|
"expert.registered": expertRegisteredSchema,
|
|
22
26
|
"expert.onboarded": newExpertOnboardedSchema,
|
|
27
|
+
"expert.verified": expertVerifiedSchema,
|
|
23
28
|
} as const;
|