@skillstew/common 1.0.22 → 1.0.24

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,27 @@
1
1
  import z from "zod";
2
2
  export declare const EventSchemas: {
3
+ readonly "skill.created": z.ZodObject<{
4
+ id: z.ZodUUID;
5
+ name: z.ZodString;
6
+ normalizedName: z.ZodString;
7
+ alternateNames: z.ZodArray<z.ZodString>;
8
+ status: z.ZodString;
9
+ }, z.core.$strip>;
10
+ readonly "skill.profileUpdated": z.ZodObject<{
11
+ userId: z.ZodUUID;
12
+ offered: z.ZodArray<z.ZodString>;
13
+ wanted: z.ZodArray<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ readonly "skill.updated": z.ZodObject<{
16
+ id: z.ZodUUID;
17
+ name: z.ZodString;
18
+ normalizedName: z.ZodString;
19
+ alternateNames: z.ZodArray<z.ZodString>;
20
+ status: z.ZodString;
21
+ }, z.core.$strip>;
22
+ readonly "skill.deleted": z.ZodObject<{
23
+ id: z.ZodUUID;
24
+ }, z.core.$strip>;
3
25
  readonly "user.registered": z.ZodObject<{
4
26
  id: z.ZodUUID;
5
27
  email: z.ZodEmail;
@@ -7,6 +29,16 @@ export declare const EventSchemas: {
7
29
  readonly "user.verified": z.ZodObject<{
8
30
  id: z.ZodUUID;
9
31
  }, z.core.$strip>;
32
+ readonly "user.profileUpdated": z.ZodObject<{
33
+ id: z.ZodUUID;
34
+ name: z.ZodString;
35
+ username: z.ZodString;
36
+ location: z.ZodObject<{
37
+ latitude: z.ZodNumber;
38
+ longitude: z.ZodNumber;
39
+ }, z.core.$strip>;
40
+ languages: z.ZodArray<z.ZodString>;
41
+ }, z.core.$strip>;
10
42
  };
11
43
  export type EventName = keyof typeof EventSchemas;
12
44
  export type EventPayload<T extends EventName> = z.infer<(typeof EventSchemas)[T]>;
@@ -2,5 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventSchemas = void 0;
4
4
  const userEventsSchema_1 = require("./schemas/userEventsSchema");
5
+ const skillsEventSchemas_1 = require("./schemas/skillsEventSchemas");
5
6
  // Union of all app event schemas
6
- exports.EventSchemas = Object.assign({}, userEventsSchema_1.UserEventSchemas);
7
+ exports.EventSchemas = Object.assign(Object.assign({}, userEventsSchema_1.UserEventSchemas), skillsEventSchemas_1.SkillsEventSchemas);
@@ -0,0 +1,47 @@
1
+ import z from "zod";
2
+ export declare const skillCreatedSchema: z.ZodObject<{
3
+ id: z.ZodUUID;
4
+ name: z.ZodString;
5
+ normalizedName: z.ZodString;
6
+ alternateNames: z.ZodArray<z.ZodString>;
7
+ status: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const skillUpdatedSchema: z.ZodObject<{
10
+ id: z.ZodUUID;
11
+ name: z.ZodString;
12
+ normalizedName: z.ZodString;
13
+ alternateNames: z.ZodArray<z.ZodString>;
14
+ status: z.ZodString;
15
+ }, z.core.$strip>;
16
+ export declare const skillDeletedSchema: z.ZodObject<{
17
+ id: z.ZodUUID;
18
+ }, z.core.$strip>;
19
+ export declare const skillProfileUpdatedSchema: z.ZodObject<{
20
+ userId: z.ZodUUID;
21
+ offered: z.ZodArray<z.ZodString>;
22
+ wanted: z.ZodArray<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ export declare const SkillsEventSchemas: {
25
+ readonly "skill.created": z.ZodObject<{
26
+ id: z.ZodUUID;
27
+ name: z.ZodString;
28
+ normalizedName: z.ZodString;
29
+ alternateNames: z.ZodArray<z.ZodString>;
30
+ status: z.ZodString;
31
+ }, z.core.$strip>;
32
+ readonly "skill.profileUpdated": z.ZodObject<{
33
+ userId: z.ZodUUID;
34
+ offered: z.ZodArray<z.ZodString>;
35
+ wanted: z.ZodArray<z.ZodString>;
36
+ }, z.core.$strip>;
37
+ readonly "skill.updated": z.ZodObject<{
38
+ id: z.ZodUUID;
39
+ name: z.ZodString;
40
+ normalizedName: z.ZodString;
41
+ alternateNames: z.ZodArray<z.ZodString>;
42
+ status: z.ZodString;
43
+ }, z.core.$strip>;
44
+ readonly "skill.deleted": z.ZodObject<{
45
+ id: z.ZodUUID;
46
+ }, z.core.$strip>;
47
+ };
@@ -0,0 +1,27 @@
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.SkillsEventSchemas = exports.skillProfileUpdatedSchema = exports.skillDeletedSchema = exports.skillUpdatedSchema = exports.skillCreatedSchema = void 0;
7
+ const zod_1 = __importDefault(require("zod"));
8
+ exports.skillCreatedSchema = zod_1.default.object({
9
+ id: zod_1.default.uuid(),
10
+ name: zod_1.default.string(),
11
+ normalizedName: zod_1.default.string(),
12
+ alternateNames: zod_1.default.array(zod_1.default.string()),
13
+ status: zod_1.default.string(),
14
+ });
15
+ exports.skillUpdatedSchema = exports.skillCreatedSchema;
16
+ exports.skillDeletedSchema = zod_1.default.object({ id: zod_1.default.uuid() });
17
+ exports.skillProfileUpdatedSchema = zod_1.default.object({
18
+ userId: zod_1.default.uuid(),
19
+ offered: zod_1.default.array(zod_1.default.string()),
20
+ wanted: zod_1.default.array(zod_1.default.string()),
21
+ });
22
+ exports.SkillsEventSchemas = {
23
+ "skill.created": exports.skillCreatedSchema,
24
+ "skill.profileUpdated": exports.skillProfileUpdatedSchema,
25
+ "skill.updated": exports.skillUpdatedSchema,
26
+ "skill.deleted": exports.skillDeletedSchema,
27
+ };
@@ -6,6 +6,16 @@ export declare const userRegisteredSchema: z.ZodObject<{
6
6
  export declare const userVerifiedSchema: z.ZodObject<{
7
7
  id: z.ZodUUID;
8
8
  }, z.core.$strip>;
9
+ export declare const userProfileUpdatedSchema: z.ZodObject<{
10
+ id: z.ZodUUID;
11
+ name: z.ZodString;
12
+ username: z.ZodString;
13
+ location: z.ZodObject<{
14
+ latitude: z.ZodNumber;
15
+ longitude: z.ZodNumber;
16
+ }, z.core.$strip>;
17
+ languages: z.ZodArray<z.ZodString>;
18
+ }, z.core.$strip>;
9
19
  export declare const UserEventSchemas: {
10
20
  readonly "user.registered": z.ZodObject<{
11
21
  id: z.ZodUUID;
@@ -14,4 +24,14 @@ export declare const UserEventSchemas: {
14
24
  readonly "user.verified": z.ZodObject<{
15
25
  id: z.ZodUUID;
16
26
  }, z.core.$strip>;
27
+ readonly "user.profileUpdated": z.ZodObject<{
28
+ id: z.ZodUUID;
29
+ name: z.ZodString;
30
+ username: z.ZodString;
31
+ location: z.ZodObject<{
32
+ latitude: z.ZodNumber;
33
+ longitude: z.ZodNumber;
34
+ }, z.core.$strip>;
35
+ languages: z.ZodArray<z.ZodString>;
36
+ }, z.core.$strip>;
17
37
  };
@@ -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.UserEventSchemas = exports.userVerifiedSchema = exports.userRegisteredSchema = void 0;
6
+ exports.UserEventSchemas = exports.userProfileUpdatedSchema = exports.userVerifiedSchema = exports.userRegisteredSchema = void 0;
7
7
  const zod_1 = __importDefault(require("zod"));
8
8
  exports.userRegisteredSchema = zod_1.default.object({
9
9
  id: zod_1.default.uuid(),
@@ -12,7 +12,15 @@ exports.userRegisteredSchema = zod_1.default.object({
12
12
  exports.userVerifiedSchema = zod_1.default.object({
13
13
  id: zod_1.default.uuid(),
14
14
  });
15
+ exports.userProfileUpdatedSchema = zod_1.default.object({
16
+ id: zod_1.default.uuid(),
17
+ name: zod_1.default.string(),
18
+ username: zod_1.default.string(),
19
+ location: zod_1.default.object({ latitude: zod_1.default.number(), longitude: zod_1.default.number() }),
20
+ languages: zod_1.default.array(zod_1.default.string()),
21
+ });
15
22
  exports.UserEventSchemas = {
16
23
  "user.registered": exports.userRegisteredSchema,
17
24
  "user.verified": exports.userVerifiedSchema,
25
+ "user.profileUpdated": exports.userProfileUpdatedSchema,
18
26
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstew/common",
3
- "version": "1.0.22",
3
+ "version": "1.0.24",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "scripts": {
package/publish.sh CHANGED
@@ -18,7 +18,7 @@ git add .
18
18
  # Step 4: Prompt for a commit message
19
19
  echo "Enter commit message:"
20
20
  read COMMIT_MESSAGE
21
- git commit -m "[common] $COMMIT_MESSAGE"
21
+ git commit -m "$COMMIT_MESSAGE"
22
22
 
23
23
  # Step 5: Push to GitHub
24
24
  git push
@@ -1,10 +1,12 @@
1
1
  import z from "zod";
2
2
  import { UserEventSchemas } from "./schemas/userEventsSchema";
3
+ import { SkillsEventSchemas } from "./schemas/skillsEventSchemas";
3
4
 
4
5
  // Union of all app event schemas
5
6
 
6
7
  export const EventSchemas = {
7
8
  ...UserEventSchemas,
9
+ ...SkillsEventSchemas,
8
10
  } as const;
9
11
 
10
12
  // Union of all app event names
@@ -0,0 +1,26 @@
1
+ import z from "zod";
2
+
3
+ export const skillCreatedSchema = z.object({
4
+ id: z.uuid(),
5
+ name: z.string(),
6
+ normalizedName: z.string(),
7
+ alternateNames: z.array(z.string()),
8
+ status: z.string(),
9
+ });
10
+
11
+ export const skillUpdatedSchema = skillCreatedSchema;
12
+
13
+ export const skillDeletedSchema = z.object({ id: z.uuid() });
14
+
15
+ export const skillProfileUpdatedSchema = z.object({
16
+ userId: z.uuid(),
17
+ offered: z.array(z.string()),
18
+ wanted: z.array(z.string()),
19
+ });
20
+
21
+ export const SkillsEventSchemas = {
22
+ "skill.created": skillCreatedSchema,
23
+ "skill.profileUpdated": skillProfileUpdatedSchema,
24
+ "skill.updated": skillUpdatedSchema,
25
+ "skill.deleted": skillDeletedSchema,
26
+ } as const;
@@ -9,7 +9,16 @@ export const userVerifiedSchema = z.object({
9
9
  id: z.uuid(),
10
10
  });
11
11
 
12
+ export const userProfileUpdatedSchema = z.object({
13
+ id: z.uuid(),
14
+ name: z.string(),
15
+ username: z.string(),
16
+ location: z.object({ latitude: z.number(), longitude: z.number() }),
17
+ languages: z.array(z.string()),
18
+ });
19
+
12
20
  export const UserEventSchemas = {
13
21
  "user.registered": userRegisteredSchema,
14
22
  "user.verified": userVerifiedSchema,
23
+ "user.profileUpdated": userProfileUpdatedSchema,
15
24
  } as const;