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.
Files changed (53) hide show
  1. package/package.json +114 -122
  2. package/src/auth/dto/login.dto.ts +22 -0
  3. package/src/auth/dto/register.dto.ts +16 -0
  4. package/src/cuenta/dto/cuenta.dto.ts +28 -0
  5. package/{dist/types/dto.d.ts → types/dto.ts} +1 -1
  6. package/types/index.d.ts +2 -0
  7. package/types/prisma-schema/default.d.ts +1 -0
  8. package/types/prisma-schema/default.js +1 -0
  9. package/types/prisma-schema/edge.d.ts +1 -0
  10. package/types/prisma-schema/edge.js +306 -0
  11. package/types/prisma-schema/index-browser.js +298 -0
  12. package/types/prisma-schema/index.d.ts +16638 -0
  13. package/types/prisma-schema/index.js +327 -0
  14. package/types/prisma-schema/package.json +84 -0
  15. package/types/prisma-schema/query_engine-windows.dll.node +0 -0
  16. package/types/prisma-schema/runtime/edge-esm.js +28 -0
  17. package/types/prisma-schema/runtime/edge.js +28 -0
  18. package/types/prisma-schema/runtime/index-browser.d.ts +365 -0
  19. package/types/prisma-schema/runtime/index-browser.js +13 -0
  20. package/types/prisma-schema/runtime/library.d.ts +3193 -0
  21. package/types/prisma-schema/runtime/library.js +140 -0
  22. package/types/prisma-schema/runtime/react-native.js +77 -0
  23. package/types/prisma-schema/runtime/wasm.js +29 -0
  24. package/types/prisma-schema/schema.prisma +170 -0
  25. package/types/prisma-schema/wasm.d.ts +1 -0
  26. package/types/prisma-schema/wasm.js +298 -0
  27. package/{dist/types → types}/schema.d.ts +15 -0
  28. package/dist/src/auth/dto/login.dto.d.ts +0 -170
  29. package/dist/src/auth/dto/login.dto.js +0 -29
  30. package/dist/src/auth/dto/login.dto.js.map +0 -1
  31. package/dist/src/auth/dto/register.dto.d.ts +0 -73
  32. package/dist/src/auth/dto/register.dto.js +0 -20
  33. package/dist/src/auth/dto/register.dto.js.map +0 -1
  34. package/dist/src/auth/exports.d.ts +0 -2
  35. package/dist/src/auth/exports.js +0 -19
  36. package/dist/src/auth/exports.js.map +0 -1
  37. package/dist/src/cuenta/dto/cuenta.dto.d.ts +0 -60
  38. package/dist/src/cuenta/dto/cuenta.dto.js +0 -31
  39. package/dist/src/cuenta/dto/cuenta.dto.js.map +0 -1
  40. package/dist/src/cuenta/exports.d.ts +0 -1
  41. package/dist/src/cuenta/exports.js +0 -18
  42. package/dist/src/cuenta/exports.js.map +0 -1
  43. package/dist/src/exports.d.ts +0 -2
  44. package/dist/src/exports.js +0 -19
  45. package/dist/src/exports.js.map +0 -1
  46. package/dist/types/dto.js +0 -18
  47. package/dist/types/dto.js.map +0 -1
  48. package/dist/types/index.d.ts +0 -2
  49. package/dist/types/index.js +0 -19
  50. package/dist/types/index.js.map +0 -1
  51. package/dist/types/schema.js +0 -3
  52. package/dist/types/schema.js.map +0 -1
  53. package/tsconfig.json +0 -27
package/package.json CHANGED
@@ -1,123 +1,115 @@
1
- {
2
- "name": "expo-backend-types",
3
- "version": "0.0.40",
4
- "description": "",
5
- "author": "Expo",
6
- "private": false,
7
- "license": "UNLICENSED",
8
- "files": [
9
- "dist/types",
10
- "./tsconfig.json",
11
- "dist/src/**/*.dto.*",
12
- "dist/src/**/exports.*"
13
- ],
14
- "engines": {
15
- "node": ">=14.17.0"
16
- },
17
- "scripts": {
18
- "ci": "npx prisma generate && npm run build && npm run generate-ts-schema && npm run check-format && npm run lint && npm run check-exports",
19
- "build": "nest build",
20
- "format": "prettier --write \"src/**/*.ts\"",
21
- "check-format": "prettier --check \"src/**/*.ts\"",
22
- "check-exports": "attw --ignore-rules \"no-resolution\" --pack .",
23
- "local-release": "changeset version && changeset publish",
24
- "start": "nest start",
25
- "dev": "nest start --watch",
26
- "start:debug": "nest start --debug --watch",
27
- "start:prod": "node dist/main",
28
- "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
29
- "test": "jest",
30
- "test:watch": "jest --watch",
31
- "test:cov": "jest --coverage",
32
- "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
33
- "test:e2e": "jest --config ./test/jest-e2e.json",
34
- "generate-ts-schema": "node ./dist/src/main.swagger.js && openapi-typescript ./swagger.yaml -o ./types/schema.ts",
35
- "prepare": "husky",
36
- "prepublishOnly": "npm run ci"
37
- },
38
- "dependencies": {
39
- "@anatine/zod-nestjs": "^2.0.9",
40
- "@anatine/zod-openapi": "^2.2.6",
41
- "@nestjs/common": "^10.0.0",
42
- "@nestjs/config": "^3.2.3",
43
- "@nestjs/core": "^10.0.0",
44
- "@nestjs/jwt": "^10.2.0",
45
- "@nestjs/platform-express": "^10.0.0",
46
- "@nestjs/swagger": "^7.3.1",
47
- "@prisma/client": "^5.14.0",
48
- "bcrypt": "^5.1.1",
49
- "json-to-pretty-yaml": "^1.2.2",
50
- "openapi3-ts": "^4.4.0",
51
- "reflect-metadata": "^0.2.0",
52
- "rxjs": "^7.8.1",
53
- "zod": "^3.23.8"
54
- },
55
- "devDependencies": {
56
- "@arethetypeswrong/cli": "^0.15.4",
57
- "@changesets/cli": "^2.27.7",
58
- "@nestjs/cli": "^10.0.0",
59
- "@nestjs/schematics": "^10.0.0",
60
- "@nestjs/testing": "^10.0.0",
61
- "@openapitools/openapi-generator-cli": "^2.13.4",
62
- "@types/bcrypt": "^5.0.2",
63
- "@types/express": "^4.17.17",
64
- "@types/jest": "^29.5.2",
65
- "@types/json-to-pretty-yaml": "^1.2.1",
66
- "@types/node": "^20.3.1",
67
- "@types/supertest": "^6.0.0",
68
- "@typescript-eslint/eslint-plugin": "^6.0.0",
69
- "@typescript-eslint/parser": "^6.0.0",
70
- "eslint": "^8.42.0",
71
- "eslint-config-prettier": "^9.0.0",
72
- "eslint-plugin-prettier": "^5.0.0",
73
- "eslint-plugin-unused-imports": "^3.2.0",
74
- "husky": "^9.0.11",
75
- "jest": "^29.5.0",
76
- "lint-staged": "^15.2.5",
77
- "openapi-typescript": "^7.0.0-rc.0",
78
- "prettier": "^3.0.0",
79
- "prisma": "^5.14.0",
80
- "source-map-support": "^0.5.21",
81
- "supertest": "^6.3.3",
82
- "ts-jest": "^29.1.0",
83
- "ts-loader": "^9.4.3",
84
- "ts-node": "^10.9.1",
85
- "tsconfig-paths": "^4.2.0",
86
- "typescript": "^5.4.5"
87
- },
88
- "main": "dist/types/index.js",
89
- "exports": {
90
- ".": {
91
- "import": "./dist/types/index.d.ts",
92
- "require": "./dist/types/index.d.ts",
93
- "default": "./dist/types/index.d.ts",
94
- "types": "./dist/types/index.d.ts"
95
- },
96
- "./dto": {
97
- "import": "./dist/types/dto.js",
98
- "default": "./dist/types/dto.js",
99
- "types": "./dist/types/dto.d.ts"
100
- }
101
- },
102
- "lint-staged": {
103
- "**/*.{js,ts,jsx,tsx}": [
104
- "prettier --write",
105
- "eslint --fix",
106
- "git add"
107
- ],
108
- "swagger.yaml": [
109
- "git add"
110
- ],
111
- "types/schema.d.ts": [
112
- "git add"
113
- ],
114
- "*.json": [
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';
@@ -0,0 +1,2 @@
1
+ export * from './schema';
2
+ export * from './prisma-schema/index.d';
@@ -0,0 +1 @@
1
+ export * from './index'
@@ -0,0 +1 @@
1
+ module.exports = { ...require('.') }
@@ -0,0 +1 @@
1
+ export * from './default'