expo-backend-types 0.0.32 → 0.0.34

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/package.json +12 -4
  2. package/types/schema.d.ts +68 -60
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-backend-types",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "",
5
5
  "author": "Expo",
6
6
  "private": false,
@@ -9,7 +9,7 @@
9
9
  "types"
10
10
  ],
11
11
  "scripts": {
12
- "ci": "npm run generate-ts-schema && npm run build && npm run check-format && npm run lint && npm run check-exports",
12
+ "ci": "npm run build && npm run generate-ts-schema && npm run check-format && npm run lint && npm run check-exports",
13
13
  "build": "nest build",
14
14
  "format": "prettier --write \"src/**/*.ts\"",
15
15
  "check-format": "prettier --check \"src/**/*.ts\"",
@@ -26,19 +26,26 @@
26
26
  "test:cov": "jest --coverage",
27
27
  "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
28
28
  "test:e2e": "jest --config ./test/jest-e2e.json",
29
- "generate-ts-schema": "ts-node src/main.swagger.ts && openapi-typescript ./swagger.yaml -o ./types/schema.d.ts",
29
+ "generate-ts-schema": "node ./dist/main.swagger.js && openapi-typescript ./swagger.yaml -o ./types/schema.d.ts",
30
30
  "prepare": "husky",
31
31
  "prepublishOnly": "npm run ci"
32
32
  },
33
33
  "dependencies": {
34
+ "@anatine/zod-nestjs": "^2.0.9",
35
+ "@anatine/zod-openapi": "^2.2.6",
34
36
  "@nestjs/common": "^10.0.0",
37
+ "@nestjs/config": "^3.2.3",
35
38
  "@nestjs/core": "^10.0.0",
39
+ "@nestjs/jwt": "^10.2.0",
36
40
  "@nestjs/platform-express": "^10.0.0",
37
41
  "@nestjs/swagger": "^7.3.1",
38
42
  "@prisma/client": "^5.14.0",
43
+ "bcrypt": "^5.1.1",
39
44
  "json-to-pretty-yaml": "^1.2.2",
45
+ "openapi3-ts": "^4.4.0",
40
46
  "reflect-metadata": "^0.2.0",
41
- "rxjs": "^7.8.1"
47
+ "rxjs": "^7.8.1",
48
+ "zod": "^3.23.8"
42
49
  },
43
50
  "devDependencies": {
44
51
  "@arethetypeswrong/cli": "^0.15.4",
@@ -47,6 +54,7 @@
47
54
  "@nestjs/schematics": "^10.0.0",
48
55
  "@nestjs/testing": "^10.0.0",
49
56
  "@openapitools/openapi-generator-cli": "^2.13.4",
57
+ "@types/bcrypt": "^5.0.2",
50
58
  "@types/express": "^4.17.17",
51
59
  "@types/jest": "^29.5.2",
52
60
  "@types/json-to-pretty-yaml": "^1.2.1",
package/types/schema.d.ts CHANGED
@@ -4,39 +4,39 @@
4
4
  */
5
5
 
6
6
  export interface paths {
7
- "/": {
7
+ "/auth/register": {
8
8
  parameters: {
9
9
  query?: never;
10
10
  header?: never;
11
11
  path?: never;
12
12
  cookie?: never;
13
13
  };
14
- get: operations["AppController_getHello"];
14
+ get?: never;
15
15
  put?: never;
16
- post?: never;
16
+ post: operations["AuthController_registerUser"];
17
17
  delete?: never;
18
18
  options?: never;
19
19
  head?: never;
20
20
  patch?: never;
21
21
  trace?: never;
22
22
  };
23
- "/test/{id}": {
23
+ "/auth/login": {
24
24
  parameters: {
25
25
  query?: never;
26
26
  header?: never;
27
27
  path?: never;
28
28
  cookie?: never;
29
29
  };
30
- get: operations["AppController_test"];
31
- put: operations["AppController_testPut"];
32
- post: operations["AppController_testPost"];
30
+ get?: never;
31
+ put?: never;
32
+ post: operations["AuthController_loginUser"];
33
33
  delete?: never;
34
34
  options?: never;
35
35
  head?: never;
36
36
  patch?: never;
37
37
  trace?: never;
38
38
  };
39
- "/otraRuta/{id1}/{id2}": {
39
+ "/auth/refresh": {
40
40
  parameters: {
41
41
  query?: never;
42
42
  header?: never;
@@ -45,7 +45,7 @@ export interface paths {
45
45
  };
46
46
  get?: never;
47
47
  put?: never;
48
- post: operations["AppController_otraRuta"];
48
+ post: operations["AuthController_refreshToken"];
49
49
  delete?: never;
50
50
  options?: never;
51
51
  head?: never;
@@ -55,7 +55,44 @@ export interface paths {
55
55
  }
56
56
  export type webhooks = Record<string, never>;
57
57
  export interface components {
58
- schemas: never;
58
+ schemas: {
59
+ RegisterDto: {
60
+ username: string;
61
+ password: string;
62
+ /** @default false */
63
+ isAdmin: boolean;
64
+ };
65
+ RegisterResponseDto: {
66
+ username: string;
67
+ /** @default false */
68
+ isAdmin: boolean;
69
+ };
70
+ LoginDto: {
71
+ username: string;
72
+ password: string;
73
+ };
74
+ LoginResponseDto: {
75
+ user: {
76
+ /** Format: uuid */
77
+ id?: string;
78
+ username?: string;
79
+ /** @default false */
80
+ isAdmin: boolean;
81
+ /** Format: date-time */
82
+ created_at?: string;
83
+ /** Format: date-time */
84
+ updated_at?: string;
85
+ /** @default false */
86
+ filtroBaseActivo: boolean;
87
+ /** @default [] */
88
+ fcmToken: string[];
89
+ };
90
+ backendTokens: {
91
+ accessToken?: string;
92
+ refreshToken?: string;
93
+ };
94
+ };
95
+ };
59
96
  responses: never;
60
97
  parameters: never;
61
98
  requestBodies: never;
@@ -64,88 +101,59 @@ export interface components {
64
101
  }
65
102
  export type $defs = Record<string, never>;
66
103
  export interface operations {
67
- AppController_getHello: {
104
+ AuthController_registerUser: {
68
105
  parameters: {
69
106
  query?: never;
70
107
  header?: never;
71
108
  path?: never;
72
109
  cookie?: never;
73
110
  };
74
- requestBody?: never;
75
- responses: {
76
- 200: {
77
- headers: {
78
- [name: string]: unknown;
79
- };
80
- content?: never;
81
- };
82
- };
83
- };
84
- AppController_test: {
85
- parameters: {
86
- query?: never;
87
- header?: never;
88
- path: {
89
- id: string;
111
+ requestBody: {
112
+ content: {
113
+ "application/json": components["schemas"]["RegisterDto"];
90
114
  };
91
- cookie?: never;
92
115
  };
93
- requestBody?: never;
94
116
  responses: {
95
- 200: {
117
+ /** @description Cuenta creada */
118
+ 201: {
96
119
  headers: {
97
120
  [name: string]: unknown;
98
121
  };
99
- content?: never;
122
+ content: {
123
+ "application/json": components["schemas"]["RegisterResponseDto"];
124
+ };
100
125
  };
101
126
  };
102
127
  };
103
- AppController_testPut: {
128
+ AuthController_loginUser: {
104
129
  parameters: {
105
130
  query?: never;
106
131
  header?: never;
107
- path: {
108
- id: string;
109
- };
132
+ path?: never;
110
133
  cookie?: never;
111
134
  };
112
- requestBody?: never;
113
- responses: {
114
- 200: {
115
- headers: {
116
- [name: string]: unknown;
117
- };
118
- content?: never;
119
- };
120
- };
121
- };
122
- AppController_testPost: {
123
- parameters: {
124
- query?: never;
125
- header?: never;
126
- path: {
127
- id: string;
135
+ requestBody: {
136
+ content: {
137
+ "application/json": components["schemas"]["LoginDto"];
128
138
  };
129
- cookie?: never;
130
139
  };
131
- requestBody?: never;
132
140
  responses: {
133
- 201: {
141
+ /** @description Cuenta creada */
142
+ 200: {
134
143
  headers: {
135
144
  [name: string]: unknown;
136
145
  };
137
- content?: never;
146
+ content: {
147
+ "application/json": components["schemas"]["LoginResponseDto"];
148
+ };
138
149
  };
139
150
  };
140
151
  };
141
- AppController_otraRuta: {
152
+ AuthController_refreshToken: {
142
153
  parameters: {
143
154
  query?: never;
144
155
  header?: never;
145
- path: {
146
- id1: string;
147
- id2: string;
148
- };
156
+ path?: never;
149
157
  cookie?: never;
150
158
  };
151
159
  requestBody?: never;