@skillstew/common 1.0.41 → 1.0.43

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.
@@ -4,6 +4,17 @@ export declare const EventSchemas: {
4
4
  email: z.ZodEmail;
5
5
  token: z.ZodString;
6
6
  }, z.core.$strip>;
7
+ readonly "auth.providerLinked": z.ZodObject<{
8
+ userId: z.ZodUUID;
9
+ email: z.ZodEmail;
10
+ role: z.ZodEnum<{
11
+ USER: "USER";
12
+ EXPERT: "EXPERT";
13
+ EXPERT_APPLICANT: "EXPERT_APPLICANT";
14
+ ADMIN: "ADMIN";
15
+ }>;
16
+ provider: z.ZodLiteral<"google">;
17
+ }, z.core.$strip>;
7
18
  readonly "expert.registered": z.ZodObject<{
8
19
  id: z.ZodUUID;
9
20
  email: z.ZodEmail;
@@ -22,6 +33,12 @@ export declare const EventSchemas: {
22
33
  readonly "expert.verified": z.ZodObject<{
23
34
  id: z.ZodUUID;
24
35
  }, z.core.$strip>;
36
+ readonly "expert.application.rejected": z.ZodObject<{
37
+ expertId: z.ZodUUID;
38
+ email: z.ZodEmail;
39
+ rejectedReason: z.ZodOptional<z.ZodString>;
40
+ rejectedAt: z.ZodDate;
41
+ }, z.core.$strip>;
25
42
  readonly "connection.requested": z.ZodObject<{
26
43
  connectionId: z.ZodString;
27
44
  requesterId: z.ZodString;
@@ -3,9 +3,31 @@ export declare const resendVerificationLinkRequestedSchema: z.ZodObject<{
3
3
  email: z.ZodEmail;
4
4
  token: z.ZodString;
5
5
  }, z.core.$strip>;
6
+ export declare const authProviderLinkedSchema: z.ZodObject<{
7
+ userId: z.ZodUUID;
8
+ email: z.ZodEmail;
9
+ role: z.ZodEnum<{
10
+ USER: "USER";
11
+ EXPERT: "EXPERT";
12
+ EXPERT_APPLICANT: "EXPERT_APPLICANT";
13
+ ADMIN: "ADMIN";
14
+ }>;
15
+ provider: z.ZodLiteral<"google">;
16
+ }, z.core.$strip>;
6
17
  export declare const AuthEventSchemas: {
7
18
  readonly "resendVerificationLink.requested": z.ZodObject<{
8
19
  email: z.ZodEmail;
9
20
  token: z.ZodString;
10
21
  }, z.core.$strip>;
22
+ readonly "auth.providerLinked": z.ZodObject<{
23
+ userId: z.ZodUUID;
24
+ email: z.ZodEmail;
25
+ role: z.ZodEnum<{
26
+ USER: "USER";
27
+ EXPERT: "EXPERT";
28
+ EXPERT_APPLICANT: "EXPERT_APPLICANT";
29
+ ADMIN: "ADMIN";
30
+ }>;
31
+ provider: z.ZodLiteral<"google">;
32
+ }, z.core.$strip>;
11
33
  };
@@ -3,12 +3,19 @@ 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.AuthEventSchemas = exports.resendVerificationLinkRequestedSchema = void 0;
6
+ exports.AuthEventSchemas = exports.authProviderLinkedSchema = exports.resendVerificationLinkRequestedSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  exports.resendVerificationLinkRequestedSchema = zod_1.default.object({
9
9
  email: zod_1.default.email(),
10
10
  token: zod_1.default.string(),
11
11
  });
12
+ exports.authProviderLinkedSchema = zod_1.default.object({
13
+ userId: zod_1.default.uuid(),
14
+ email: zod_1.default.email(),
15
+ role: zod_1.default.enum(["USER", "EXPERT", "EXPERT_APPLICANT", "ADMIN"]),
16
+ provider: zod_1.default.literal("google"),
17
+ });
12
18
  exports.AuthEventSchemas = {
13
19
  "resendVerificationLink.requested": exports.resendVerificationLinkRequestedSchema,
20
+ "auth.providerLinked": exports.authProviderLinkedSchema,
14
21
  };
@@ -17,6 +17,12 @@ export declare const newExpertOnboardedSchema: z.ZodObject<{
17
17
  export declare const expertVerifiedSchema: z.ZodObject<{
18
18
  id: z.ZodUUID;
19
19
  }, z.core.$strip>;
20
+ export declare const expertApplicationRejectedSchema: z.ZodObject<{
21
+ expertId: z.ZodUUID;
22
+ email: z.ZodEmail;
23
+ rejectedReason: z.ZodOptional<z.ZodString>;
24
+ rejectedAt: z.ZodDate;
25
+ }, z.core.$strip>;
20
26
  export declare const ExpertEventSchemas: {
21
27
  readonly "expert.registered": z.ZodObject<{
22
28
  id: z.ZodUUID;
@@ -36,4 +42,10 @@ export declare const ExpertEventSchemas: {
36
42
  readonly "expert.verified": z.ZodObject<{
37
43
  id: z.ZodUUID;
38
44
  }, z.core.$strip>;
45
+ readonly "expert.application.rejected": z.ZodObject<{
46
+ expertId: z.ZodUUID;
47
+ email: z.ZodEmail;
48
+ rejectedReason: z.ZodOptional<z.ZodString>;
49
+ rejectedAt: z.ZodDate;
50
+ }, z.core.$strip>;
39
51
  };
@@ -3,7 +3,7 @@ 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.expertVerifiedSchema = exports.newExpertOnboardedSchema = exports.expertRegisteredSchema = void 0;
6
+ exports.ExpertEventSchemas = exports.expertApplicationRejectedSchema = 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(),
@@ -23,8 +23,15 @@ exports.newExpertOnboardedSchema = zod_1.default.object({
23
23
  exports.expertVerifiedSchema = zod_1.default.object({
24
24
  id: zod_1.default.uuid(),
25
25
  });
26
+ exports.expertApplicationRejectedSchema = zod_1.default.object({
27
+ expertId: zod_1.default.uuid(),
28
+ email: zod_1.default.email(),
29
+ rejectedReason: zod_1.default.string().optional(),
30
+ rejectedAt: zod_1.default.date(),
31
+ });
26
32
  exports.ExpertEventSchemas = {
27
33
  "expert.registered": exports.expertRegisteredSchema,
28
34
  "expert.onboarded": exports.newExpertOnboardedSchema,
29
35
  "expert.verified": exports.expertVerifiedSchema,
36
+ "expert.application.rejected": exports.expertApplicationRejectedSchema,
30
37
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstew/common",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "scripts": {
@@ -5,6 +5,14 @@ export const resendVerificationLinkRequestedSchema = z.object({
5
5
  token: z.string(),
6
6
  });
7
7
 
8
+ export const authProviderLinkedSchema = z.object({
9
+ userId: z.uuid(),
10
+ email: z.email(),
11
+ role: z.enum(["USER", "EXPERT", "EXPERT_APPLICANT", "ADMIN"]),
12
+ provider: z.literal("google"),
13
+ });
14
+
8
15
  export const AuthEventSchemas = {
9
16
  "resendVerificationLink.requested": resendVerificationLinkRequestedSchema,
17
+ "auth.providerLinked": authProviderLinkedSchema,
10
18
  } as const;
@@ -21,8 +21,16 @@ export const expertVerifiedSchema = z.object({
21
21
  id: z.uuid(),
22
22
  });
23
23
 
24
+ export const expertApplicationRejectedSchema = z.object({
25
+ expertId: z.uuid(),
26
+ email: z.email(),
27
+ rejectedReason: z.string().optional(),
28
+ rejectedAt: z.date(),
29
+ });
30
+
24
31
  export const ExpertEventSchemas = {
25
32
  "expert.registered": expertRegisteredSchema,
26
33
  "expert.onboarded": newExpertOnboardedSchema,
27
34
  "expert.verified": expertVerifiedSchema,
35
+ "expert.application.rejected": expertApplicationRejectedSchema,
28
36
  } as const;