@zyacreatives/shared 1.4.9 → 1.5.0

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.
@@ -6,3 +6,4 @@ export * from "./project";
6
6
  export * from "./investor";
7
7
  export * from "./discipline";
8
8
  export * from "./file";
9
+ export * from "./username";
@@ -22,3 +22,4 @@ __exportStar(require("./project"), exports);
22
22
  __exportStar(require("./investor"), exports);
23
23
  __exportStar(require("./discipline"), exports);
24
24
  __exportStar(require("./file"), exports);
25
+ __exportStar(require("./username"), exports);
@@ -1 +1,4 @@
1
- export {};
1
+ import { z } from "@hono/zod-openapi";
2
+ export declare const UsernameSchema: z.ZodObject<{
3
+ username: z.ZodString;
4
+ }, z.core.$strip>;
@@ -1,2 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UsernameSchema = void 0;
4
+ const zod_openapi_1 = require("@hono/zod-openapi");
5
+ exports.UsernameSchema = zod_openapi_1.z.object({
6
+ username: zod_openapi_1.z
7
+ .string()
8
+ .max(32, { message: "Username must be at most 32 characters" })
9
+ .regex(/^[a-zA-Z0-9_]+$/, {
10
+ message: "Username may only contain letters, numbers, and underscores",
11
+ }),
12
+ });
@@ -6,3 +6,4 @@ export * from "./file";
6
6
  export * from "./investor";
7
7
  export * from "./project";
8
8
  export * from "./user";
9
+ export * from "./username";
@@ -22,3 +22,4 @@ __exportStar(require("./file"), exports);
22
22
  __exportStar(require("./investor"), exports);
23
23
  __exportStar(require("./project"), exports);
24
24
  __exportStar(require("./user"), exports);
25
+ __exportStar(require("./username"), exports);
@@ -0,0 +1,3 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ import { UsernameSchema } from "../schemas";
3
+ export type UsernameInput = z.infer<typeof UsernameSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyacreatives/shared",
3
- "version": "1.4.9",
3
+ "version": "1.5.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,3 +6,4 @@ export * from "./project";
6
6
  export * from "./investor";
7
7
  export * from "./discipline";
8
8
  export * from "./file";
9
+ export * from "./username";
@@ -1,6 +1,7 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  import { CLIENT_TYPES, ROLES } from "../constants";
3
3
  import { CreateFileInputSchema, FileEntitySchema } from "./file";
4
+
4
5
  export const ProjectEntitySchema = z
5
6
  .object({
6
7
  description: z.string().optional().openapi({
@@ -0,0 +1,10 @@
1
+ import { z } from "@hono/zod-openapi";
2
+
3
+ export const UsernameSchema = z.object({
4
+ username: z
5
+ .string()
6
+ .max(32, { message: "Username must be at most 32 characters" })
7
+ .regex(/^[a-zA-Z0-9_]+$/, {
8
+ message: "Username may only contain letters, numbers, and underscores",
9
+ }),
10
+ });
@@ -6,3 +6,4 @@ export * from "./file";
6
6
  export * from "./investor";
7
7
  export * from "./project";
8
8
  export * from "./user";
9
+ export * from "./username";
@@ -0,0 +1,4 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ import { UsernameSchema } from "../schemas";
3
+
4
+ export type UsernameInput = z.infer<typeof UsernameSchema>;