create-arkos 1.3.2-beta → 1.3.2-beta.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-arkos",
3
- "version": "1.3.2-beta",
3
+ "version": "1.3.2-beta.1",
4
4
  "type": "module",
5
5
  "description": "CLI for creating Arkos.js projects, see docs at www.arkosjs.com",
6
6
  "bin": {
@@ -9,7 +9,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
9
9
  // next();
10
10
  // }];
11
11
 
12
- // export const onGetMeError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
12
+ // export const onGetMeError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
13
13
  // next();
14
14
  // }];
15
15
 
@@ -21,7 +21,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
21
21
  // next();
22
22
  // }];
23
23
 
24
- // export const onLoginError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
24
+ // export const onLoginError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
25
25
  // next();
26
26
  // }];
27
27
 
@@ -33,7 +33,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
33
33
  // next();
34
34
  // }];
35
35
 
36
- // export const onLogoutError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
36
+ // export const onLogoutError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
37
37
  // next();
38
38
  // }];
39
39
 
@@ -45,7 +45,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
45
45
  // next();
46
46
  // }];
47
47
 
48
- // export const onSignupError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
48
+ // export const onSignupError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
49
49
  // next();
50
50
  // }];
51
51
 
@@ -57,10 +57,10 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
57
57
  // next();
58
58
  // }];
59
59
 
60
- // export const onUpdatePasswordError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
60
+ // export const onUpdatePasswordError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
61
61
  // next();
62
62
  // }];
63
-
63
+ {{else}}
64
64
  // export const beforeGetMe = [async (req, res, next) => {
65
65
  // next();
66
66
  // }];
@@ -69,7 +69,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
69
69
  // next();
70
70
  // }];
71
71
 
72
- // export const onGetMeError = [async (req, res, next) => {
72
+ // export const onGetMeError = [async (err, req, res, next) => {
73
73
  // next();
74
74
  // }];
75
75
 
@@ -81,7 +81,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
81
81
  // next();
82
82
  // }];
83
83
 
84
- // export const onLoginError = [async (req, res, next) => {
84
+ // export const onLoginError = [async (err, req, res, next) => {
85
85
  // next();
86
86
  // }];
87
87
 
@@ -93,7 +93,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
93
93
  // next();
94
94
  // }];
95
95
 
96
- // export const onLogoutError = [async (req, res, next) => {
96
+ // export const onLogoutError = [async (err, req, res, next) => {
97
97
  // next();
98
98
  // }];
99
99
 
@@ -105,7 +105,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
105
105
  // next();
106
106
  // }];
107
107
 
108
- // export const onSignupError = [async (req, res, next) => {
108
+ // export const onSignupError = [async (err, req, res, next) => {
109
109
  // next();
110
110
  // }];
111
111
 
@@ -117,6 +117,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
117
117
  // next();
118
118
  // }];
119
119
 
120
- // export const onUpdatePasswordError = [async (req, res, next) => {
120
+ // export const onUpdatePasswordError = [async (err, req, res, next) => {
121
121
  // next();
122
122
  // }];
123
+ {{/if}}
@@ -25,22 +25,30 @@ const authPermissionAuthConfigs = {
25
25
  {{#if (eq authentication.type "static")}}
26
26
  accessControl: {
27
27
  // Create: {
28
- // roles: [], // only when using static authentication
28
+ {{#if (eq authentication.type "static")}}
29
+ // roles: [],
30
+ {{/if}}
29
31
  // name: "Create New Auth Permission",
30
32
  // description: "Permission to create auth permission records"
31
33
  // },
32
34
  // Update: {
33
- // roles: [], // only when using static authentication
35
+ {{#if (eq authentication.type "static")}}
36
+ // roles: [],
37
+ {{/if}}
34
38
  // name: "Update Auth Permission",
35
39
  // description: "Permission to update auth permission records"
36
40
  // },
37
41
  // Delete: {
38
- // roles: [], // only when using static authentication
42
+ {{#if (eq authen.type "static")}}
43
+ // roles: [],
44
+ {{/if}}
39
45
  // name: "Delete Auth Permission",
40
46
  // description: "Permission to delete auth permission records"
41
47
  // },
42
48
  // View: {
43
- // roles: [], // only when using static authentication
49
+ {{#if (eq authen.type "static")}}
50
+ // roles: [],
51
+ {{/if}}
44
52
  // name: "View Auth Permission",
45
53
  // description: "Permission to update auth permission records"
46
54
  // },
@@ -25,22 +25,30 @@ const authRoleAuthConfigs = {
25
25
  {{#if (eq authentication.type "static")}}
26
26
  accessControl: {
27
27
  // Create: {
28
- // roles: [], // only when using static authentication
28
+ {{#if (eq authentication.type "static")}}
29
+ // roles: [],
30
+ {{/if}}
29
31
  // name: "Create New Auth Role",
30
32
  // description: "Permission to create auth role records"
31
33
  // },
32
34
  // Update: {
33
- // roles: [], // only when using static authentication
35
+ {{#if (eq authentication.type "static")}}
36
+ // roles: [],
37
+ {{/if}}
34
38
  // name: "Update Auth Role",
35
39
  // description: "Permission to update auth role records"
36
40
  // },
37
41
  // Delete: {
38
- // roles: [], // only when using static authentication
42
+ {{#if (eq authentication.type "static")}}
43
+ // roles: [],
44
+ {{/if}}
39
45
  // name: "Delete Auth Role",
40
46
  // description: "Permission to delete auth role records"
41
47
  // },
42
48
  // View: {
43
- // roles: [], // only when using static authentication
49
+ {{#if (eq authentication.type "static")}}
50
+ // roles: [],
51
+ {{/if}}
44
52
  // name: "View Auth Role",
45
53
  // description: "Permission to update auth role records"
46
54
  // },
@@ -14,10 +14,34 @@ const fileUplaodAuthConfigs = {
14
14
  },
15
15
  {{#if (eq authentication.type "static")}}
16
16
  accessControl: {
17
- // Create: ["Admin"],
18
- // Update: ["Admin", "Manager"],
19
- // Delete: ["Admin"],
20
- // View: ["User", "Admin", "Guest"],
17
+ // Create: {
18
+ {{#if (eq authentication.type "static")}}
19
+ // roles: [],
20
+ {{/if}}
21
+ // name: "Upload File",
22
+ // description: "Permission to upload file"
23
+ // },
24
+ // Update: {
25
+ {{#if (eq authentication.type "static")}}
26
+ // roles: [],
27
+ {{/if}}
28
+ // name: "Update File",
29
+ // description: "Permission to update file"
30
+ // },
31
+ // Delete: {
32
+ {{#if (eq authen.type "static")}}
33
+ // roles: [],
34
+ {{/if}}
35
+ // name: "Delete File",
36
+ // description: "Permission to delete file"
37
+ // },
38
+ // View: {
39
+ {{#if (eq authen.type "static")}}
40
+ // roles: [],
41
+ {{/if}}
42
+ // name: "View File",
43
+ // description: "Permission to view file"
44
+ // },
21
45
  },
22
46
  {{/if}}
23
47
  };
@@ -1,77 +1,83 @@
1
1
  {{#if typescript}}
2
2
  import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
3
3
 
4
- // export const beforeFindFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
5
- // // Your logic here
4
+ // export const beforeFindFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
6
5
  // next();
7
- // };
6
+ // }];
8
7
  //
9
- // // There is not afterFindFile: because the main handler is handled by express.static()
10
- //
11
- // export const beforeUploadFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
12
- // // Your logic here
8
+ // export const beforeUploadFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
13
9
  // next();
14
- // };
10
+ // }];
15
11
  //
16
- // export const afterUploadFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
17
- // // Your logic here
12
+ // export const afterUploadFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
13
+ // next();
14
+ // }];
15
+
16
+ // export const onUploadFileError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
18
17
  // next();
19
- // };
18
+ // }];
20
19
  //
21
- // export const beforeUpdateFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
22
- // // Your logic here
20
+ // export const beforeUpdateFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
23
21
  // next();
24
- // };
22
+ // }];
25
23
  //
26
- // export const afterUpdateFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
27
- // // Your logic here
24
+ // export const afterUpdateFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
28
25
  // next();
29
- // };
26
+ // }];
30
27
  //
31
- // export const beforeDeleteFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
32
- // // Your logic here
28
+ // export const onUpdateFileError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
33
29
  // next();
34
- // };
30
+ // }];
31
+
32
+ // export const beforeDeleteFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
33
+ // next();
34
+ // }];
35
35
  //
36
- // export const afterDeleteFile = async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
37
- // // Your logic here
36
+ // export const afterDeleteFile = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
37
+ // next();
38
+ // }];
39
+
40
+ // export const onDeleteFileError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
38
41
  // next();
39
- // };
42
+ // }];
40
43
  {{else}}
41
- // export const beforeFindFile = async (req, res, next) => {
42
- // // Your logic here
44
+ // export const beforeFindFile = [async (req, res, next) => {
43
45
  // next();
44
- // };
46
+ // }];
45
47
  //
46
- // // There is not afterFindFile: because the main handler is handled by express.static()
47
- //
48
- // export const beforeUploadFile = async (req, res, next) => {
49
- // // Your logic here
48
+ // export const beforeUploadFile = [async (req, res, next) => {
50
49
  // next();
51
- // };
50
+ // }];
52
51
  //
53
- // export const afterUploadFile = async (req, res, next) => {
54
- // // Your logic here
52
+ // export const afterUploadFile = [async (req, res, next) => {
55
53
  // next();
56
- // };
54
+ // }];
57
55
  //
58
- // export const beforeUpdateFile = async (req, res, next) => {
59
- // // Your logic here
56
+ // export const onUploadFileError = [async (err, req, res, next) => {
57
+ // next();
58
+ // }];
59
+
60
+ // export const beforeUpdateFile = [async (req, res, next) => {
60
61
  // next();
61
- // };
62
+ // }];
62
63
  //
63
- // export const afterUpdateFile = async (req, res, next) => {
64
- // // Your logic here
64
+ // export const afterUpdateFile = [async (req, res, next) => {
65
65
  // next();
66
- // };
66
+ // }];
67
67
  //
68
- // export const beforeDeleteFile = async (req, res, next) => {
69
- // // Your logic here
68
+ // export const onUpdateFileError = [async (err, req, res, next) => {
70
69
  // next();
71
- // };
70
+ // }];
71
+
72
+ // export const beforeDeleteFile = [async (req, res, next) => {
73
+ // next();
74
+ // }];
72
75
  //
73
- // export const afterDeleteFile = async (req, res, next) => {
74
- // // Your logic here
76
+ // export const afterDeleteFile = [async (req, res, next) => {
77
+ // next();
78
+ // }];
79
+
80
+ // export const onDeleteFileError = [async (err, req, res, next) => {
75
81
  // next();
76
- // };
82
+ // }];
77
83
  {{/if}}
@@ -25,22 +25,30 @@ const userAuthConfigs = {
25
25
  {{#if (eq authentication.type "static")}}
26
26
  accessControl: {
27
27
  // Create: {
28
- // roles: [], // only when using static authentication
28
+ {{#if (eq authentication.type "static")}}
29
+ // roles: [],
30
+ {{/if}}
29
31
  // name: "Create New User",
30
32
  // description: "Permission to create user records"
31
33
  // },
32
34
  // Update: {
33
- // roles: [], // only when using static authentication
35
+ {{#if (eq authentication.type "static")}}
36
+ // roles: [],
37
+ {{/if}}
34
38
  // name: "Update User",
35
39
  // description: "Permission to update user records"
36
40
  // },
37
41
  // Delete: {
38
- // roles: [], // only when using static authentication
42
+ {{#if (eq authentication.type "static")}}
43
+ // roles: [],
44
+ {{/if}}
39
45
  // name: "Delete User",
40
46
  // description: "Permission to delete user records"
41
47
  // },
42
48
  // View: {
43
- // roles: [], // only when using static authentication
49
+ {{#if (eq authentication.type "static")}}
50
+ // roles: [],
51
+ {{/if}}
44
52
  // name: "View User",
45
53
  // description: "Permission to update user records"
46
54
  // },
@@ -9,7 +9,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
9
9
  // next();
10
10
  // }];
11
11
 
12
- // export const onCreateOneError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
12
+ // export const onCreateOneError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
13
13
  // next();
14
14
  // }];
15
15
 
@@ -21,7 +21,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
21
21
  // next();
22
22
  // }];
23
23
 
24
- // export const onFindOneError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
24
+ // export const onFindOneError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
25
25
  // next();
26
26
  // }];
27
27
 
@@ -33,7 +33,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
33
33
  // next();
34
34
  // }];
35
35
 
36
- // export const onFindManyError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
36
+ // export const onFindManyError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
37
37
  // next();
38
38
  // }];
39
39
 
@@ -45,7 +45,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
45
45
  // next();
46
46
  // }];
47
47
 
48
- // export const onUpdateOneError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
48
+ // export const onUpdateOneError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
49
49
  // next();
50
50
  // }];
51
51
 
@@ -57,7 +57,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
57
57
  // next();
58
58
  // }];
59
59
 
60
- // export const onDeleteOneError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
60
+ // export const onDeleteOneError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
61
61
  // next();
62
62
  // }];
63
63
 
@@ -69,7 +69,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
69
69
  // next();
70
70
  // }];
71
71
 
72
- // export const onCreateManyError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
72
+ // export const onCreateManyError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
73
73
  // next();
74
74
  // }];
75
75
 
@@ -81,7 +81,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
81
81
  // next();
82
82
  // }];
83
83
 
84
- // export const onUpdateManyError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
84
+ // export const onUpdateManyError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
85
85
  // next();
86
86
  // }];
87
87
 
@@ -93,10 +93,10 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
93
93
  // next();
94
94
  // }];
95
95
 
96
- // export const onDeleteManyError = [async (req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
96
+ // export const onDeleteManyError = [async (err: any, req: ArkosRequest, res: ArkosResponse, next: ArkosNextFunction) => {
97
97
  // next();
98
98
  // }];
99
-
99
+ {{else}}
100
100
  // export const beforeCreateOne = [async (req, res, next) => {
101
101
  // next();
102
102
  // }];
@@ -105,7 +105,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
105
105
  // next();
106
106
  // }];
107
107
 
108
- // export const onCreateOneError = [async (req, res, next) => {
108
+ // export const onCreateOneError = [async (err, req, res, next) => {
109
109
  // next();
110
110
  // }];
111
111
 
@@ -117,7 +117,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
117
117
  // next();
118
118
  // }];
119
119
 
120
- // export const onFindOneError = [async (req, res, next) => {
120
+ // export const onFindOneError = [async (err, req, res, next) => {
121
121
  // next();
122
122
  // }];
123
123
 
@@ -129,7 +129,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
129
129
  // next();
130
130
  // }];
131
131
 
132
- // export const onFindManyError = [async (req, res, next) => {
132
+ // export const onFindManyError = [async (err, req, res, next) => {
133
133
  // next();
134
134
  // }];
135
135
 
@@ -141,7 +141,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
141
141
  // next();
142
142
  // }];
143
143
 
144
- // export const onUpdateOneError = [async (req, res, next) => {
144
+ // export const onUpdateOneError = [async (err, req, res, next) => {
145
145
  // next();
146
146
  // }];
147
147
 
@@ -153,7 +153,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
153
153
  // next();
154
154
  // }];
155
155
 
156
- // export const onDeleteOneError = [async (req, res, next) => {
156
+ // export const onDeleteOneError = [async (err, req, res, next) => {
157
157
  // next();
158
158
  // }];
159
159
 
@@ -165,7 +165,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
165
165
  // next();
166
166
  // }];
167
167
 
168
- // export const onCreateManyError = [async (req, res, next) => {
168
+ // export const onCreateManyError = [async (err, req, res, next) => {
169
169
  // next();
170
170
  // }];
171
171
 
@@ -177,7 +177,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
177
177
  // next();
178
178
  // }];
179
179
 
180
- // export const onUpdateManyError = [async (req, res, next) => {
180
+ // export const onUpdateManyError = [async (err, req, res, next) => {
181
181
  // next();
182
182
  // }];
183
183
 
@@ -189,6 +189,7 @@ import { ArkosRequest, ArkosResponse, ArkosNextFunction } from "arkos";
189
189
  // next();
190
190
  // }];
191
191
 
192
- // export const onDeleteManyError = [async (req, res, next) => {
192
+ // export const onDeleteManyError = [async (err, req, res, next) => {
193
193
  // next();
194
194
  // }];
195
+ {{/if}}