@skillstew/common 1.0.31 → 1.0.32

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.
@@ -66,5 +66,6 @@ export declare const EventSchemas: {
66
66
  avatarKey: z.ZodOptional<z.ZodString>;
67
67
  }, z.core.$strip>;
68
68
  };
69
- export type EventName = keyof typeof EventSchemas;
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]>;
@@ -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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skillstew/common",
3
- "version": "1.0.31",
3
+ "version": "1.0.32",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "scripts": {
@@ -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 = keyof typeof EventSchemas;
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<