create-arkos 1.6.5-beta → 1.6.6-beta
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/package.json +1 -1
- package/templates/basic/package.json.hbs +1 -1
- package/templates/basic/prisma/schema/auth-permission.prisma.hbs +0 -14
- package/templates/basic/src/modules/auth-permission/dtos/create-auth-permission.dto.ts.hbs +4 -15
- package/templates/basic/src/modules/auth-permission/dtos/update-auth-permission.dto.ts.hbs +3 -14
- package/templates/basic/src/modules/auth-permission/schemas/create-auth-permission.schema.ts.hbs +1 -13
- package/templates/basic/src/modules/auth-permission/schemas/update-auth-permission.schema.ts.hbs +1 -13
- package/templates/basic/src/modules/auth-role/dtos/create-auth-role.dto.ts.hbs +3 -14
- package/templates/basic/src/modules/auth-role/dtos/update-auth-role.dto.ts.hbs +6 -15
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{{/if}}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"arkos": "1.6.
|
|
27
|
+
"arkos": "1.6.6-beta",
|
|
28
28
|
"express": "4.22.1",
|
|
29
29
|
"@scalar/express-api-reference": "0.10.2",
|
|
30
30
|
"@scalar/api-reference": "1.55.3"{{#if (or (neq prisma.provider "none") validation.type)}},{{/if}}
|
|
@@ -1,21 +1,7 @@
|
|
|
1
|
-
{{#if (neq prisma.provider "sqlite")}}
|
|
2
|
-
enum AuthPermissionAction {
|
|
3
|
-
View
|
|
4
|
-
Create
|
|
5
|
-
Update
|
|
6
|
-
Delete
|
|
7
|
-
// Add more custom actions
|
|
8
|
-
}
|
|
9
|
-
{{/if}}
|
|
10
|
-
|
|
11
1
|
model AuthPermission {
|
|
12
2
|
id String {{{prisma.idDatabaseType}}}
|
|
13
3
|
resource String
|
|
14
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
15
4
|
action String @default("View")
|
|
16
|
-
{{else}}
|
|
17
|
-
action AuthPermissionAction @default(View)
|
|
18
|
-
{{/if}}
|
|
19
5
|
roleId String {{#if (eq prisma.provider "mongodb")}}@db.ObjectId{{/if}}
|
|
20
6
|
role AuthRole @relation(fields: [roleId], references: [id])
|
|
21
7
|
createdAt DateTime @default(now())
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { IsString, IsNotEmpty, IsOptional, IsEnum, ValidateNested } from 'class-validator';
|
|
2
2
|
import { Type, Transform } from 'class-transformer';
|
|
3
3
|
import 'reflect-metadata'
|
|
4
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
5
|
-
|
|
6
|
-
export enum AuthPermissionAction {
|
|
7
|
-
View = 'View',
|
|
8
|
-
Create = 'Create',
|
|
9
|
-
Update = 'Update',
|
|
10
|
-
Delete = 'Delete'
|
|
11
|
-
}
|
|
12
|
-
{{else}}
|
|
13
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
14
|
-
{{/if}}
|
|
15
4
|
|
|
16
5
|
class RoleConnectDto {
|
|
17
6
|
@IsString()
|
|
@@ -24,9 +13,9 @@ export default class CreateAuthPermissionDto {
|
|
|
24
13
|
@IsNotEmpty({ message: 'Resource is required' })
|
|
25
14
|
resource!: string;
|
|
26
15
|
|
|
27
|
-
@
|
|
28
|
-
@Transform(({ value }) => value
|
|
29
|
-
action
|
|
16
|
+
@IsString()
|
|
17
|
+
@Transform(({ value }) => String(value))
|
|
18
|
+
action!: string;
|
|
30
19
|
|
|
31
20
|
@ValidateNested()
|
|
32
21
|
@Type(() => RoleConnectDto)
|
|
@@ -34,6 +23,6 @@ export default class CreateAuthPermissionDto {
|
|
|
34
23
|
|
|
35
24
|
@IsOptional()
|
|
36
25
|
@IsString()
|
|
37
|
-
@Transform(({ value }) => value)
|
|
26
|
+
@Transform(({ value }) => String(value))
|
|
38
27
|
description?: string;
|
|
39
28
|
}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { IsString, IsOptional, IsEnum } from 'class-validator';
|
|
2
2
|
import { Transform } from 'class-transformer';
|
|
3
3
|
import 'reflect-metadata'
|
|
4
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
5
|
-
|
|
6
|
-
export enum AuthPermissionAction {
|
|
7
|
-
View = 'View',
|
|
8
|
-
Create = 'Create',
|
|
9
|
-
Update = 'Update',
|
|
10
|
-
Delete = 'Delete'
|
|
11
|
-
}
|
|
12
|
-
{{else}}
|
|
13
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
14
|
-
{{/if}}
|
|
15
4
|
|
|
16
5
|
export default class UpdateAuthPermissionDto {
|
|
17
6
|
@IsOptional()
|
|
@@ -19,9 +8,9 @@ export default class UpdateAuthPermissionDto {
|
|
|
19
8
|
resource?: string;
|
|
20
9
|
|
|
21
10
|
@IsOptional()
|
|
22
|
-
@
|
|
23
|
-
@Transform(({ value }) => value)
|
|
24
|
-
action?:
|
|
11
|
+
@IsString()
|
|
12
|
+
@Transform(({ value }) => String(value))
|
|
13
|
+
action?: string
|
|
25
14
|
|
|
26
15
|
@IsOptional()
|
|
27
16
|
@IsString()
|
package/templates/basic/src/modules/auth-permission/schemas/create-auth-permission.schema.ts.hbs
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
3
|
-
|
|
4
|
-
export const AuthPermissionActionEnum = z.enum([
|
|
5
|
-
'View',
|
|
6
|
-
'Create',
|
|
7
|
-
'Update',
|
|
8
|
-
'Delete'
|
|
9
|
-
]);
|
|
10
|
-
{{else}}
|
|
11
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
12
|
-
export const AuthPermissionActionEnum = z.nativeEnum(AuthPermissionAction);
|
|
13
|
-
{{/if}}
|
|
14
2
|
|
|
15
3
|
const CreateAuthPermissionSchema = z.object({
|
|
16
4
|
resource: z.string().min(1, 'Resource is required'),
|
|
17
|
-
action:
|
|
5
|
+
action: z.string().min(1),
|
|
18
6
|
role: z.object({
|
|
19
7
|
id: z.string().min(1, 'Role ID is required'),
|
|
20
8
|
}),
|
package/templates/basic/src/modules/auth-permission/schemas/update-auth-permission.schema.ts.hbs
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
3
|
-
|
|
4
|
-
export const AuthPermissionActionEnum = z.enum([
|
|
5
|
-
'View',
|
|
6
|
-
'Create',
|
|
7
|
-
'Update',
|
|
8
|
-
'Delete'
|
|
9
|
-
]);
|
|
10
|
-
{{else}}
|
|
11
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
12
|
-
export const AuthPermissionActionEnum = z.nativeEnum(AuthPermissionAction);
|
|
13
|
-
{{/if}}
|
|
14
2
|
|
|
15
3
|
const UpdateAuthPermissionSchema = z.object({
|
|
16
4
|
resource: z.string().optional(),
|
|
17
|
-
action:
|
|
5
|
+
action: z.string().min(1).optional(),
|
|
18
6
|
description: z.string().optional(),
|
|
19
7
|
});
|
|
20
8
|
|
|
@@ -1,26 +1,15 @@
|
|
|
1
1
|
import { IsString, IsNotEmpty, IsOptional, IsArray, ValidateNested, IsEnum } from 'class-validator';
|
|
2
2
|
import { Type, Transform } from 'class-transformer';
|
|
3
3
|
import 'reflect-metadata'
|
|
4
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
5
|
-
|
|
6
|
-
export enum AuthPermissionAction {
|
|
7
|
-
View = 'View',
|
|
8
|
-
Create = 'Create',
|
|
9
|
-
Update = 'Update',
|
|
10
|
-
Delete = 'Delete'
|
|
11
|
-
}
|
|
12
|
-
{{else}}
|
|
13
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
14
|
-
{{/if}}
|
|
15
4
|
|
|
16
5
|
class CreatePermissionForRoleDto {
|
|
17
6
|
@IsString()
|
|
18
7
|
@IsNotEmpty({ message: 'Resource is required' })
|
|
19
8
|
resource!: string;
|
|
20
9
|
|
|
21
|
-
@
|
|
22
|
-
@Transform(({ value }) => value
|
|
23
|
-
action
|
|
10
|
+
@IsString()
|
|
11
|
+
@Transform(({ value }) => String(value))
|
|
12
|
+
action!: string;
|
|
24
13
|
|
|
25
14
|
@IsOptional()
|
|
26
15
|
@IsString()
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import { IsString, IsNotEmpty, IsOptional, IsArray, ValidateNested, IsEnum } from 'class-validator';
|
|
2
2
|
import { Type, Transform } from 'class-transformer';
|
|
3
3
|
import 'reflect-metadata'
|
|
4
|
-
{{#if (eq prisma.provider "sqlite")}}
|
|
5
|
-
|
|
6
|
-
export enum AuthPermissionAction {
|
|
7
|
-
View = 'View',
|
|
8
|
-
Create = 'Create',
|
|
9
|
-
Update = 'Update',
|
|
10
|
-
Delete = 'Delete'
|
|
11
|
-
}
|
|
12
|
-
{{else}}
|
|
13
|
-
import { AuthPermissionAction } from "@prisma/client"
|
|
14
|
-
{{/if}}
|
|
15
4
|
|
|
16
5
|
export enum ApiAction {
|
|
17
6
|
connect = 'connect',
|
|
@@ -25,11 +14,13 @@ class UpdatePermissionForRoleDto {
|
|
|
25
14
|
|
|
26
15
|
@IsString()
|
|
27
16
|
@IsNotEmpty({ message: 'Resource is required' })
|
|
28
|
-
|
|
17
|
+
@IsOptional()
|
|
18
|
+
resource?: string;
|
|
29
19
|
|
|
30
|
-
@
|
|
31
|
-
@
|
|
32
|
-
|
|
20
|
+
@IsOptional()
|
|
21
|
+
@IsString()
|
|
22
|
+
@Transform(({ value }) => String(value))
|
|
23
|
+
action?: string
|
|
33
24
|
|
|
34
25
|
@IsOptional()
|
|
35
26
|
@IsString()
|