servcraft 0.4.2 → 0.4.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/ROADMAP.md +3 -1
- package/dist/cli/index.cjs +31 -20
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.js +12 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +31 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/modules/user/user.repository.ts +18 -1
- package/tsup.config.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "servcraft",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.4",
|
|
4
4
|
"description": "A modular, production-ready Node.js backend framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"lint:fix": "eslint src --ext .ts --fix",
|
|
18
18
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
19
19
|
"prepare": "husky",
|
|
20
|
+
"postinstall": "prisma generate --schema=./prisma/schema.prisma || true",
|
|
20
21
|
"typecheck": "tsc --noEmit",
|
|
21
22
|
"db:generate": "prisma generate",
|
|
22
23
|
"db:migrate": "prisma migrate dev",
|
|
@@ -2,7 +2,24 @@ import { prisma } from '../../database/prisma.js';
|
|
|
2
2
|
import type { PaginatedResult, PaginationParams } from '../../types/index.js';
|
|
3
3
|
import { createPaginatedResult, getSkip } from '../../utils/pagination.js';
|
|
4
4
|
import type { User, CreateUserData, UpdateUserData, UserFilters } from './types.js';
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
// Use string literal enums for ESM/CommonJS compatibility
|
|
7
|
+
const UserRole = {
|
|
8
|
+
USER: 'USER',
|
|
9
|
+
MODERATOR: 'MODERATOR',
|
|
10
|
+
ADMIN: 'ADMIN',
|
|
11
|
+
SUPER_ADMIN: 'SUPER_ADMIN',
|
|
12
|
+
} as const;
|
|
13
|
+
|
|
14
|
+
const UserStatus = {
|
|
15
|
+
ACTIVE: 'ACTIVE',
|
|
16
|
+
INACTIVE: 'INACTIVE',
|
|
17
|
+
SUSPENDED: 'SUSPENDED',
|
|
18
|
+
BANNED: 'BANNED',
|
|
19
|
+
} as const;
|
|
20
|
+
|
|
21
|
+
type UserRole = (typeof UserRole)[keyof typeof UserRole];
|
|
22
|
+
type UserStatus = (typeof UserStatus)[keyof typeof UserStatus];
|
|
6
23
|
|
|
7
24
|
/**
|
|
8
25
|
* User Repository - Prisma Implementation
|