@sorokchat-messenger/contracts 1.0.2 → 1.0.4
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.
- package/dist/authorization/controller.d.ts +9 -0
- package/dist/authorization/controller.d.ts.map +1 -0
- package/dist/authorization/controller.js +9 -0
- package/dist/authorization/controller.js.map +1 -0
- package/dist/authorization/index.d.ts +1 -0
- package/dist/authorization/index.d.ts.map +1 -1
- package/dist/authorization/index.js +1 -0
- package/dist/authorization/index.js.map +1 -1
- package/dist/users/new-user.schema.d.ts.map +1 -1
- package/dist/users/new-user.schema.js +19 -3
- package/dist/users/new-user.schema.js.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const AUTHORIZATION_CONTROLLER: {
|
|
2
|
+
readonly NAME: "authorization";
|
|
3
|
+
readonly REGISTER: "register";
|
|
4
|
+
readonly LOGIN: "login";
|
|
5
|
+
readonly LOGOUT: "logout";
|
|
6
|
+
readonly PROFILE: "profile";
|
|
7
|
+
readonly REFRESH_TOKENS: "refresh-tokens";
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/authorization/controller.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB;aACnC,IAAI,EAAE,eAAe;aACrB,QAAQ,EAAE,UAAU;aACpB,KAAK,EAAE,OAAO;aACd,MAAM,EAAE,QAAQ;aAChB,OAAO,EAAE,SAAS;aAClB,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/authorization/controller.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,eAAe;IACrB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new-user.schema.d.ts","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"new-user.schema.d.ts","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AACA,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,aAAa;;;;iBAiCxB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { UserCodes } from "./codes.js";
|
|
2
2
|
import z from "zod";
|
|
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: UserCodes.LOGIN.EMPTY })
|
|
7
|
-
.nonoptional({ message: UserCodes.LOGIN.UNDEFINED })
|
|
9
|
+
.nonoptional({ message: UserCodes.LOGIN.UNDEFINED })
|
|
10
|
+
.openapi({
|
|
11
|
+
description: "Унікальне ім'я користувача",
|
|
12
|
+
example: "sorokovsky_andrey",
|
|
13
|
+
}),
|
|
8
14
|
password: z
|
|
9
15
|
.string()
|
|
10
16
|
.min(UserCodes.PASSWORD.MIN_LENGTH.VALUE, {
|
|
@@ -14,10 +20,20 @@ export const NewUserSchema = z.object({
|
|
|
14
20
|
message: UserCodes.PASSWORD.MAX_LENGTH.CODE,
|
|
15
21
|
})
|
|
16
22
|
.nonempty({ message: UserCodes.PASSWORD.EMPTY })
|
|
17
|
-
.nonoptional({ message: UserCodes.PASSWORD.UNDEFINED })
|
|
23
|
+
.nonoptional({ message: UserCodes.PASSWORD.UNDEFINED })
|
|
24
|
+
.openapi({
|
|
25
|
+
description: "Пароль користувача",
|
|
26
|
+
example: "<PASSWORD>",
|
|
27
|
+
minLength: UserCodes.PASSWORD.MIN_LENGTH.VALUE,
|
|
28
|
+
maxLength: UserCodes.PASSWORD.MAX_LENGTH.VALUE,
|
|
29
|
+
}),
|
|
18
30
|
displayName: z
|
|
19
31
|
.string()
|
|
20
32
|
.nonempty({ message: UserCodes.DISPLAY_NAME.EMPTY })
|
|
21
|
-
.optional()
|
|
33
|
+
.optional()
|
|
34
|
+
.openapi({
|
|
35
|
+
description: "Видиме ім'я користувача",
|
|
36
|
+
example: "Сороковський Андрій",
|
|
37
|
+
}),
|
|
22
38
|
});
|
|
23
39
|
//# 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,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,CAAC,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"new-user.schema.js","sourceRoot":"","sources":["../../src/users/new-user.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAEtE,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAExB,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;SAC5C,WAAW,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;SACnD,OAAO,CAAC;QACP,WAAW,EAAE,4BAA4B;QACzC,OAAO,EAAE,mBAAmB;KAC7B,CAAC;IACJ,QAAQ,EAAE,CAAC;SACR,MAAM,EAAE;SACR,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE;QACxC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI;KAC5C,CAAC;SACD,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE;QACxC,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI;KAC5C,CAAC;SACD,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;SAC/C,WAAW,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;SACtD,OAAO,CAAC;QACP,WAAW,EAAE,oBAAoB;QACjC,OAAO,EAAE,YAAY;QACrB,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;QAC9C,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;KAC/C,CAAC;IACJ,WAAW,EAAE,CAAC;SACX,MAAM,EAAE;SACR,QAAQ,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;SACnD,QAAQ,EAAE;SACV,OAAO,CAAC;QACP,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,qBAAqB;KAC/B,CAAC;CACL,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorokchat-messenger/contracts",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Frontend and backend contracts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"frontend",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"build": "tsc"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
+
"@asteasolutions/zod-to-openapi": "^9.1.0",
|
|
40
41
|
"@sorokchat-messenger/core": "^1.0.0",
|
|
41
42
|
"prettier": "^3.9.6"
|
|
42
43
|
},
|