expo-backend-types 0.0.40 → 0.0.42
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +114 -122
- package/src/auth/dto/login.dto.ts +22 -0
- package/src/auth/dto/register.dto.ts +16 -0
- package/src/cuenta/dto/cuenta.dto.ts +28 -0
- package/{dist/types/dto.d.ts → types/dto.ts} +1 -1
- package/types/index.d.ts +2 -0
- package/types/prisma-schema/default.d.ts +1 -0
- package/types/prisma-schema/default.js +1 -0
- package/types/prisma-schema/edge.d.ts +1 -0
- package/types/prisma-schema/edge.js +306 -0
- package/types/prisma-schema/index-browser.js +298 -0
- package/types/prisma-schema/index.d.ts +16638 -0
- package/types/prisma-schema/index.js +327 -0
- package/types/prisma-schema/package.json +84 -0
- package/types/prisma-schema/query_engine-windows.dll.node +0 -0
- package/types/prisma-schema/runtime/edge-esm.js +28 -0
- package/types/prisma-schema/runtime/edge.js +28 -0
- package/types/prisma-schema/runtime/index-browser.d.ts +365 -0
- package/types/prisma-schema/runtime/index-browser.js +13 -0
- package/types/prisma-schema/runtime/library.d.ts +3193 -0
- package/types/prisma-schema/runtime/library.js +140 -0
- package/types/prisma-schema/runtime/react-native.js +77 -0
- package/types/prisma-schema/runtime/wasm.js +29 -0
- package/types/prisma-schema/schema.prisma +170 -0
- package/types/prisma-schema/wasm.d.ts +1 -0
- package/types/prisma-schema/wasm.js +298 -0
- package/{dist/types → types}/schema.d.ts +15 -0
- package/dist/src/auth/dto/login.dto.d.ts +0 -170
- package/dist/src/auth/dto/login.dto.js +0 -29
- package/dist/src/auth/dto/login.dto.js.map +0 -1
- package/dist/src/auth/dto/register.dto.d.ts +0 -73
- package/dist/src/auth/dto/register.dto.js +0 -20
- package/dist/src/auth/dto/register.dto.js.map +0 -1
- package/dist/src/auth/exports.d.ts +0 -2
- package/dist/src/auth/exports.js +0 -19
- package/dist/src/auth/exports.js.map +0 -1
- package/dist/src/cuenta/dto/cuenta.dto.d.ts +0 -60
- package/dist/src/cuenta/dto/cuenta.dto.js +0 -31
- package/dist/src/cuenta/dto/cuenta.dto.js.map +0 -1
- package/dist/src/cuenta/exports.d.ts +0 -1
- package/dist/src/cuenta/exports.js +0 -18
- package/dist/src/cuenta/exports.js.map +0 -1
- package/dist/src/exports.d.ts +0 -2
- package/dist/src/exports.js +0 -19
- package/dist/src/exports.js.map +0 -1
- package/dist/types/dto.js +0 -18
- package/dist/types/dto.js.map +0 -1
- package/dist/types/index.d.ts +0 -2
- package/dist/types/index.js +0 -19
- package/dist/types/index.js.map +0 -1
- package/dist/types/schema.js +0 -3
- package/dist/types/schema.js.map +0 -1
- package/tsconfig.json +0 -27
package/package.json
CHANGED
@@ -1,123 +1,115 @@
|
|
1
|
-
{
|
2
|
-
"name": "expo-backend-types",
|
3
|
-
"version": "0.0.
|
4
|
-
"description": "",
|
5
|
-
"author": "Expo",
|
6
|
-
"private": false,
|
7
|
-
"license": "UNLICENSED",
|
8
|
-
"files": [
|
9
|
-
"
|
10
|
-
"
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
|
17
|
-
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"start": "
|
25
|
-
"
|
26
|
-
"
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"test": "jest",
|
30
|
-
"test:
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
34
|
-
|
35
|
-
|
36
|
-
"
|
37
|
-
|
38
|
-
|
39
|
-
"@
|
40
|
-
"@
|
41
|
-
"@nestjs/
|
42
|
-
"@nestjs/
|
43
|
-
"@nestjs/
|
44
|
-
"@
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
|
52
|
-
|
53
|
-
"
|
54
|
-
|
55
|
-
|
56
|
-
"@
|
57
|
-
"@
|
58
|
-
"@
|
59
|
-
"@
|
60
|
-
"@
|
61
|
-
"@
|
62
|
-
"@types/
|
63
|
-
"@types/
|
64
|
-
"@types/
|
65
|
-
"@
|
66
|
-
"@
|
67
|
-
"
|
68
|
-
"
|
69
|
-
"
|
70
|
-
"eslint": "^
|
71
|
-
"
|
72
|
-
"
|
73
|
-
"
|
74
|
-
"
|
75
|
-
"
|
76
|
-
"
|
77
|
-
"
|
78
|
-
"
|
79
|
-
"
|
80
|
-
"
|
81
|
-
"
|
82
|
-
"
|
83
|
-
"
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
"
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
}
|
96
|
-
|
97
|
-
"
|
98
|
-
"
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
"
|
104
|
-
"
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
"git add"
|
113
|
-
]
|
114
|
-
|
115
|
-
"prettier --write",
|
116
|
-
"git add"
|
117
|
-
],
|
118
|
-
"packages/prisma/schema.prisma": [
|
119
|
-
"prisma format",
|
120
|
-
"git add"
|
121
|
-
]
|
122
|
-
}
|
1
|
+
{
|
2
|
+
"name": "expo-backend-types",
|
3
|
+
"version": "0.0.42",
|
4
|
+
"description": "",
|
5
|
+
"author": "Expo",
|
6
|
+
"private": false,
|
7
|
+
"license": "UNLICENSED",
|
8
|
+
"files": [
|
9
|
+
"types",
|
10
|
+
"src/**/*.dto.ts",
|
11
|
+
"src/**/export.ts"
|
12
|
+
],
|
13
|
+
"scripts": {
|
14
|
+
"ci": "npm run build && npm run generate-ts-schema && npm run format && npm run lint && npm run check-exports",
|
15
|
+
"build": "nest build",
|
16
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
17
|
+
"check-format": "prettier --check \"src/**/*.ts\"",
|
18
|
+
"check-exports": "attw --pack .",
|
19
|
+
"local-release": "changeset version && changeset publish",
|
20
|
+
"commit-schema": "git add ./types/schema.d.ts swagger.yaml && git commit -m \"Update schema\"",
|
21
|
+
"start": "nest start",
|
22
|
+
"dev": "nest start --watch",
|
23
|
+
"start:debug": "nest start --debug --watch",
|
24
|
+
"start:prod": "node dist/main",
|
25
|
+
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
|
26
|
+
"test": "jest",
|
27
|
+
"test:watch": "jest --watch",
|
28
|
+
"test:cov": "jest --coverage",
|
29
|
+
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
|
30
|
+
"test:e2e": "jest --config ./test/jest-e2e.json",
|
31
|
+
"generate-ts-schema": "node ./dist/src/main.swagger.js && openapi-typescript ./swagger.yaml -o ./types/schema.d.ts",
|
32
|
+
"prepare": "husky",
|
33
|
+
"prepublishOnly": "npm run ci"
|
34
|
+
},
|
35
|
+
"dependencies": {
|
36
|
+
"@anatine/zod-nestjs": "^2.0.9",
|
37
|
+
"@anatine/zod-openapi": "^2.2.6",
|
38
|
+
"@nestjs/common": "^10.0.0",
|
39
|
+
"@nestjs/config": "^3.2.3",
|
40
|
+
"@nestjs/core": "^10.0.0",
|
41
|
+
"@nestjs/jwt": "^10.2.0",
|
42
|
+
"@nestjs/platform-express": "^10.0.0",
|
43
|
+
"@nestjs/swagger": "^7.3.1",
|
44
|
+
"@prisma/client": "^5.14.0",
|
45
|
+
"bcrypt": "^5.1.1",
|
46
|
+
"json-to-pretty-yaml": "^1.2.2",
|
47
|
+
"openapi3-ts": "^4.4.0",
|
48
|
+
"reflect-metadata": "^0.2.0",
|
49
|
+
"rxjs": "^7.8.1",
|
50
|
+
"zod": "^3.23.8"
|
51
|
+
},
|
52
|
+
"devDependencies": {
|
53
|
+
"@arethetypeswrong/cli": "^0.15.4",
|
54
|
+
"@changesets/cli": "^2.27.7",
|
55
|
+
"@nestjs/cli": "^10.0.0",
|
56
|
+
"@nestjs/schematics": "^10.0.0",
|
57
|
+
"@nestjs/testing": "^10.0.0",
|
58
|
+
"@openapitools/openapi-generator-cli": "^2.13.4",
|
59
|
+
"@types/bcrypt": "^5.0.2",
|
60
|
+
"@types/express": "^4.17.17",
|
61
|
+
"@types/jest": "^29.5.2",
|
62
|
+
"@types/json-to-pretty-yaml": "^1.2.1",
|
63
|
+
"@types/node": "^20.3.1",
|
64
|
+
"@types/supertest": "^6.0.0",
|
65
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
66
|
+
"@typescript-eslint/parser": "^6.0.0",
|
67
|
+
"eslint": "^8.42.0",
|
68
|
+
"eslint-config-prettier": "^9.0.0",
|
69
|
+
"eslint-plugin-prettier": "^5.0.0",
|
70
|
+
"eslint-plugin-unused-imports": "^3.2.0",
|
71
|
+
"husky": "^9.0.11",
|
72
|
+
"jest": "^29.5.0",
|
73
|
+
"lint-staged": "^15.2.5",
|
74
|
+
"openapi-typescript": "^7.0.0-rc.0",
|
75
|
+
"prettier": "^3.0.0",
|
76
|
+
"prisma": "^5.14.0",
|
77
|
+
"source-map-support": "^0.5.21",
|
78
|
+
"supertest": "^6.3.3",
|
79
|
+
"ts-jest": "^29.1.0",
|
80
|
+
"ts-loader": "^9.4.3",
|
81
|
+
"ts-node": "^10.9.1",
|
82
|
+
"tsconfig-paths": "^4.2.0",
|
83
|
+
"typescript": "^5.4.5"
|
84
|
+
},
|
85
|
+
"main": "types/index.d.ts",
|
86
|
+
"exports": {
|
87
|
+
".": {
|
88
|
+
"import": "./types/index.d.ts",
|
89
|
+
"require": "./types/index.d.ts",
|
90
|
+
"default": "./types/index.d.ts",
|
91
|
+
"types": "./types/index.d.ts"
|
92
|
+
}
|
93
|
+
},
|
94
|
+
"lint-staged": {
|
95
|
+
"**/*.{js,ts,jsx,tsx}": [
|
96
|
+
"prettier --write",
|
97
|
+
"eslint --fix",
|
98
|
+
"git add"
|
99
|
+
],
|
100
|
+
"swagger.yaml": [
|
101
|
+
"git add"
|
102
|
+
],
|
103
|
+
"types/schema.d.ts": [
|
104
|
+
"git add"
|
105
|
+
],
|
106
|
+
"*.json": [
|
107
|
+
"prettier --write",
|
108
|
+
"git add"
|
109
|
+
],
|
110
|
+
"packages/prisma/schema.prisma": [
|
111
|
+
"prisma format",
|
112
|
+
"git add"
|
113
|
+
]
|
114
|
+
}
|
123
115
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { createZodDto } from '@anatine/zod-nestjs';
|
2
|
+
import { cuentaSchema } from 'src/cuenta/dto/cuenta.dto';
|
3
|
+
import z from 'zod';
|
4
|
+
|
5
|
+
export const loginSchema = cuentaSchema.pick({
|
6
|
+
username: true,
|
7
|
+
password: true,
|
8
|
+
});
|
9
|
+
|
10
|
+
export class LoginDto extends createZodDto(loginSchema) {}
|
11
|
+
|
12
|
+
export const loginResponseSchema = z.object({
|
13
|
+
user: cuentaSchema.omit({
|
14
|
+
password: true,
|
15
|
+
}),
|
16
|
+
backendTokens: z.object({
|
17
|
+
accessToken: z.string(),
|
18
|
+
refreshToken: z.string(),
|
19
|
+
}),
|
20
|
+
});
|
21
|
+
|
22
|
+
export class LoginResponseDto extends createZodDto(loginResponseSchema) {}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { createZodDto } from '@anatine/zod-nestjs';
|
2
|
+
import { cuentaSchema } from 'src/cuenta/dto/cuenta.dto';
|
3
|
+
|
4
|
+
export const registerSchema = cuentaSchema.pick({
|
5
|
+
username: true,
|
6
|
+
password: true,
|
7
|
+
isAdmin: true,
|
8
|
+
});
|
9
|
+
|
10
|
+
export class RegisterDto extends createZodDto(registerSchema) {}
|
11
|
+
|
12
|
+
export const registerResponseSchema = registerSchema.omit({
|
13
|
+
password: true,
|
14
|
+
});
|
15
|
+
|
16
|
+
export class RegisterResponseDto extends createZodDto(registerResponseSchema) {}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { createZodDto } from '@anatine/zod-nestjs';
|
2
|
+
import { z } from 'zod';
|
3
|
+
|
4
|
+
export const cuentaSchema = z.object({
|
5
|
+
id: z
|
6
|
+
.string({
|
7
|
+
required_error: 'El id es requerido',
|
8
|
+
})
|
9
|
+
.uuid({
|
10
|
+
message: 'El id debe ser un UUID',
|
11
|
+
}),
|
12
|
+
username: z.string({
|
13
|
+
required_error: 'El nombre de usuario es requerido',
|
14
|
+
}),
|
15
|
+
password: z
|
16
|
+
.string({
|
17
|
+
required_error: 'La contraseña es requerida',
|
18
|
+
})
|
19
|
+
.min(6, 'La contraseña debe tener al menos 6 caracteres'),
|
20
|
+
isAdmin: z.boolean().default(false),
|
21
|
+
created_at: z.string().datetime(),
|
22
|
+
updated_at: z.string().datetime(),
|
23
|
+
// filtroBase: z.array(EtiquetaSchema),
|
24
|
+
filtroBaseActivo: z.boolean().default(false),
|
25
|
+
fcmToken: z.array(z.string()).default([]),
|
26
|
+
});
|
27
|
+
|
28
|
+
export class CuentaDto extends createZodDto(cuentaSchema) {}
|
@@ -1 +1 @@
|
|
1
|
-
export * from '../src/exports';
|
1
|
+
export * from '../src/exports';
|
package/types/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export * from './index'
|
@@ -0,0 +1 @@
|
|
1
|
+
module.exports = { ...require('.') }
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './default'
|