@sorokchat-messanger/contracts 2.0.1 → 2.0.2

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 +1 @@
1
- {"version":3,"file":"authorized.schema.d.ts","sourceRoot":"","sources":["../../src/authorization/authorized.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,eAAO,MAAM,gBAAgB;;iBAK3B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"authorized.schema.d.ts","sourceRoot":"","sources":["../../src/authorization/authorized.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAMpB,eAAO,MAAM,gBAAgB;;iBAS3B,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1,8 +1,14 @@
1
1
  import z from "zod";
2
+ import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
3
+ extendZodWithOpenApi(z);
2
4
  export const AuthorizedSchema = z.object({
3
5
  accessToken: z
4
6
  .string()
5
- .regex(/^Bearer [A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+$/)
6
- .nonoptional(),
7
+ .regex(/^[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+\.[A-Za-z0-9-_=]+$/)
8
+ .nonoptional()
9
+ .openapi({
10
+ description: "Access token",
11
+ example: "<TOKEN>",
12
+ }),
7
13
  });
8
14
  //# sourceMappingURL=authorized.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorized.schema.js","sourceRoot":"","sources":["../../src/authorization/authorized.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,KAAK,CAAC,4DAA4D,CAAC;SACnE,WAAW,EAAE;CACjB,CAAC,CAAC"}
1
+ {"version":3,"file":"authorized.schema.js","sourceRoot":"","sources":["../../src/authorization/authorized.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IACvC,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,KAAK,CAAC,qDAAqD,CAAC;SAC5D,WAAW,EAAE;SACb,OAAO,CAAC;QACP,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,SAAS;KACnB,CAAC;CACL,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"new-user.schema.d.ts","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAGpB,eAAO,MAAM,aAAa;;;;iBAaxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
1
+ {"version":3,"file":"new-user.schema.d.ts","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAMpB,eAAO,MAAM,aAAa;;;;iBAyBxB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
@@ -1,17 +1,31 @@
1
1
  import z from "zod";
2
2
  import { UsersCodes } from "./messages.code.js";
3
+ import { extendZodWithOpenApi } from "@asteasolutions/zod-to-openapi";
4
+ extendZodWithOpenApi(z);
3
5
  export const NewUserSchema = z.object({
4
6
  login: z
5
7
  .string()
6
8
  .nonempty({ message: UsersCodes.LOGIN.EMPTY })
7
- .nonoptional({ message: UsersCodes.LOGIN.UNDEFINED }),
9
+ .nonoptional({ message: UsersCodes.LOGIN.UNDEFINED })
10
+ .openapi({
11
+ description: "Login of user",
12
+ example: "sorokovsky_andrey",
13
+ }),
8
14
  password: z
9
15
  .string()
10
16
  .nonempty({ message: UsersCodes.PASSWORD.EMPTY })
11
- .nonoptional(UsersCodes.PASSWORD.UNDEFINED),
17
+ .nonoptional({ message: UsersCodes.PASSWORD.UNDEFINED })
18
+ .openapi({
19
+ description: "Password of user",
20
+ example: "<PASSWORD>",
21
+ }),
12
22
  displayName: z
13
23
  .string()
14
24
  .nonempty({ message: UsersCodes.DISPLAY_NAME.EMPTY })
15
- .optional(),
25
+ .optional()
26
+ .openapi({
27
+ description: "Display name of user",
28
+ example: "Сороковський Андрій",
29
+ }),
16
30
  });
17
31
  //# sourceMappingURL=new-user.schema.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"new-user.schema.js","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;SAC7C,WAAW,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;IACvD,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,QAAQ,CAAC,EAAE,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;SAChD,WAAW,CAAC,UAAU,CAAC,QAAQ,CAAC,SAAS,CAAC;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AE,qBAAqB;KAC/B,CAAC;CACL,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sorokchat-messanger/contracts",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Contracts for frontend and backend of sorokchat messanger",
5
5
  "keywords": [
6
6
  "sorokchat",
@@ -31,6 +31,7 @@
31
31
  "build": "tsc"
32
32
  },
33
33
  "dependencies": {
34
+ "@asteasolutions/zod-to-openapi": "^9.1.0",
34
35
  "zod": "^4.5.4"
35
36
  }
36
37
  }