zyket 1.2.11 → 1.2.12
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/.github/workflows/publish.yml +37 -37
- package/README.md +279 -279
- package/bin/cli.js +201 -201
- package/index.js +32 -32
- package/package.json +54 -50
- package/src/Middleware.js +3 -3
- package/src/extensions/Extension.js +10 -10
- package/src/extensions/bullboard/index.js +38 -38
- package/src/extensions/interactive-storage/index.js +162 -162
- package/src/extensions/interactive-storage/middlewares/MulterMiddleware.js +31 -31
- package/src/extensions/interactive-storage/routes/browse.js +31 -31
- package/src/extensions/interactive-storage/routes/create-folder.js +37 -37
- package/src/extensions/interactive-storage/routes/delete-folder.js +57 -57
- package/src/extensions/interactive-storage/routes/delete.js +41 -41
- package/src/extensions/interactive-storage/routes/download.js +47 -47
- package/src/extensions/interactive-storage/routes/info.js +37 -37
- package/src/extensions/interactive-storage/routes/upload.js +46 -46
- package/src/kernel/HTTPServer.js +31 -31
- package/src/kernel/index.js +78 -78
- package/src/services/Service.js +10 -10
- package/src/services/auth/auth.js +7 -7
- package/src/services/auth/index.js +199 -199
- package/src/services/bullmq/Worker.js +7 -7
- package/src/services/bullmq/index.js +92 -92
- package/src/services/cache/index.js +96 -96
- package/src/services/database/index.js +127 -127
- package/src/services/events/Event.js +6 -6
- package/src/services/events/index.js +59 -59
- package/src/services/express/Express.js +248 -248
- package/src/services/express/Middleware.js +7 -7
- package/src/services/express/RedirectResponse.js +8 -8
- package/src/services/express/Route.js +6 -6
- package/src/services/express/index.js +4 -4
- package/src/services/index.js +29 -29
- package/src/services/logger/index.js +80 -80
- package/src/services/s3/index.js +82 -82
- package/src/services/scheduler/Schedule.js +6 -6
- package/src/services/scheduler/index.js +47 -47
- package/src/services/socketio/Guard.js +10 -10
- package/src/services/socketio/Handler.js +10 -10
- package/src/services/socketio/SocketIO.js +159 -132
- package/src/services/socketio/index.js +4 -4
- package/src/services/template-manager/index.js +73 -73
- package/src/templates/default/config/cors.js +4 -4
- package/src/templates/default/config/swagger.js +15 -15
- package/src/templates/default/frontend/main.jsx +15 -15
- package/src/templates/default/frontend/src/hooks/useAuth.jsx +51 -51
- package/src/templates/default/frontend/src/hooks/useLayout.jsx +18 -18
- package/src/templates/default/frontend/src/layouts/auth/index.jsx +45 -45
- package/src/templates/default/frontend/src/layouts/auth/routes.js +17 -17
- package/src/templates/default/frontend/src/layouts/landing/index.jsx +61 -61
- package/src/templates/default/frontend/src/layouts/landing/routes.js +10 -10
- package/src/templates/default/frontend/src/layouts/panel/index.jsx +115 -115
- package/src/templates/default/frontend/src/layouts/panel/routes.js +10 -10
- package/src/templates/default/frontend/src/middlewares/LoggedMiddleware.jsx +21 -21
- package/src/templates/default/frontend/src/middlewares/NotLoggedMiddleware.jsx +14 -14
- package/src/templates/default/frontend/src/store/index.jsx +5 -5
- package/src/templates/default/frontend/src/store/storeAuth.jsx +14 -14
- package/src/templates/default/frontend/src/views/auth/index.jsx +4 -4
- package/src/templates/default/frontend/src/views/auth/register/index.jsx +4 -4
- package/src/templates/default/frontend/src/views/landing/index.jsx +4 -4
- package/src/templates/default/frontend/src/views/panel/dashboard/index.jsx +4 -4
- package/src/templates/default/frontend/styles.css +1 -1
- package/src/templates/default/src/guards/default.js +6 -6
- package/src/templates/default/src/handlers/connection.js +6 -6
- package/src/templates/default/src/handlers/message.js +8 -8
- package/src/templates/default/src/middlewares/default.js +7 -7
- package/src/templates/default/src/routes/[test]/message.js +26 -26
- package/src/templates/default/src/routes/index.js +22 -22
- package/src/templates/default/src/services/auth/auth.js +7 -7
- package/src/templates/default/src/services/auth/index.js +32 -32
- package/src/utils/EnvManager.js +65 -65
package/bin/cli.js
CHANGED
|
@@ -1,202 +1,202 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const prompts = require('prompts');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { spawn } = require('child_process');
|
|
6
|
-
const TemplateManager = require('../src/services/template-manager');
|
|
7
|
-
const EnvManager = require('../src/utils/EnvManager');
|
|
8
|
-
const templateManager = new TemplateManager();
|
|
9
|
-
|
|
10
|
-
(async () => {
|
|
11
|
-
process.stdout.write("\u001b[2J\u001b[0;0H");
|
|
12
|
-
await templateManager.boot();
|
|
13
|
-
|
|
14
|
-
// Check for direct command (e.g., npx zyket init)
|
|
15
|
-
const args = process.argv.slice(2);
|
|
16
|
-
const directCommand = args[0];
|
|
17
|
-
|
|
18
|
-
let actionToRun = null;
|
|
19
|
-
|
|
20
|
-
if (directCommand === 'init') {
|
|
21
|
-
actionToRun = 'init-project';
|
|
22
|
-
} else {
|
|
23
|
-
// Show interactive menu
|
|
24
|
-
const response = await prompts({
|
|
25
|
-
type: 'select',
|
|
26
|
-
name: 'value',
|
|
27
|
-
message: '[ZYKET] What do you want to do?',
|
|
28
|
-
choices: [
|
|
29
|
-
{ title: 'Initialize Project', value: 'init-project', description: 'Set up a new Zyket project', disabled: false },
|
|
30
|
-
{ title: 'Install Template', value: 'install-template', description: 'Install a new template', disabled: false },
|
|
31
|
-
/*{ title: 'Remove Template', value: 'remove-template', description: 'Remove an existing template', disabled: false },*/
|
|
32
|
-
],
|
|
33
|
-
initial: 0
|
|
34
|
-
});
|
|
35
|
-
actionToRun = response.value;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (!actionToRun) {
|
|
39
|
-
console.log('[ZYKET] No action selected. Exiting.');
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const actions = {
|
|
44
|
-
'init-project': async () => {
|
|
45
|
-
const indexPath = path.join(process.cwd(), 'index.js');
|
|
46
|
-
const envPath = path.join(process.cwd(), '.env');
|
|
47
|
-
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
48
|
-
|
|
49
|
-
// Check if index.js already exists
|
|
50
|
-
if (fs.existsSync(indexPath)) {
|
|
51
|
-
const overwrite = await prompts({
|
|
52
|
-
type: 'confirm',
|
|
53
|
-
name: 'value',
|
|
54
|
-
message: '[ZYKET] index.js already exists. Overwrite?',
|
|
55
|
-
initial: false
|
|
56
|
-
});
|
|
57
|
-
if (!overwrite.value) {
|
|
58
|
-
console.log('[ZYKET] Initialization cancelled.');
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Create .env file
|
|
64
|
-
console.log('[ZYKET] Creating .env file...');
|
|
65
|
-
EnvManager.createEnvFile(envPath);
|
|
66
|
-
|
|
67
|
-
// Install default backend template files (src and config)
|
|
68
|
-
console.log('[ZYKET] Installing default backend template files...');
|
|
69
|
-
const defaultTemplate = templateManager.getTemplate('default');
|
|
70
|
-
const backendFiles = defaultTemplate.filter(file => {
|
|
71
|
-
const route = file.route;
|
|
72
|
-
// Only install src and config files, not frontend
|
|
73
|
-
// Skip guards and handlers folders since socket is disabled by default
|
|
74
|
-
return (route.startsWith('default/src/') || route.startsWith('default/config/'))
|
|
75
|
-
&& !route.startsWith('default/src/guards/')
|
|
76
|
-
&& !route.startsWith('default/src/handlers/');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
for (const file of backendFiles) {
|
|
80
|
-
const fileName = file.route.split('/').slice(1).join('/');
|
|
81
|
-
const fileLocation = path.join(process.cwd(), fileName);
|
|
82
|
-
const folderLocation = path.dirname(fileLocation);
|
|
83
|
-
|
|
84
|
-
// Create directory if it doesn't exist
|
|
85
|
-
if (!fs.existsSync(folderLocation)) {
|
|
86
|
-
fs.mkdirSync(folderLocation, { recursive: true });
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Write file if it doesn't exist
|
|
90
|
-
if (!fs.existsSync(fileLocation)) {
|
|
91
|
-
fs.writeFileSync(fileLocation, file.content);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
console.log('[ZYKET] ✅ Backend template files installed');
|
|
95
|
-
|
|
96
|
-
// Create index.js with boilerplate code
|
|
97
|
-
console.log('[ZYKET] Creating index.js...');
|
|
98
|
-
const indexContent = `const { Kernel } = require('zyket');
|
|
99
|
-
|
|
100
|
-
const kernel = new Kernel({
|
|
101
|
-
services: [
|
|
102
|
-
['auth', require('./src/services/auth'), ["@service_container"]],
|
|
103
|
-
]
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
kernel.boot().then(() => {
|
|
107
|
-
console.log('Kernel booted successfully!');
|
|
108
|
-
}).catch((error) => {
|
|
109
|
-
console.error('Error booting kernel:', error);
|
|
110
|
-
});
|
|
111
|
-
`;
|
|
112
|
-
fs.writeFileSync(indexPath, indexContent);
|
|
113
|
-
|
|
114
|
-
// Create package.json if it doesn't exist
|
|
115
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
116
|
-
console.log('[ZYKET] Creating package.json...');
|
|
117
|
-
const packageJson = {
|
|
118
|
-
name: path.basename(process.cwd()),
|
|
119
|
-
version: "1.0.0",
|
|
120
|
-
description: "Zyket application",
|
|
121
|
-
main: "index.js",
|
|
122
|
-
scripts: {
|
|
123
|
-
dev: "node index.js"
|
|
124
|
-
},
|
|
125
|
-
keywords: [],
|
|
126
|
-
author: "",
|
|
127
|
-
license: "ISC",
|
|
128
|
-
dependencies: {
|
|
129
|
-
zyket: "^1.2.3"
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
console.log('\n[ZYKET] ✅ Project initialized successfully!');
|
|
136
|
-
|
|
137
|
-
// Install dependencies automatically
|
|
138
|
-
console.log('\n[ZYKET] Installing dependencies...');
|
|
139
|
-
await new Promise((resolve, reject) => {
|
|
140
|
-
const npmInstall = spawn('npm', ['install'], {
|
|
141
|
-
cwd: process.cwd(),
|
|
142
|
-
stdio: 'inherit',
|
|
143
|
-
shell: true
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
npmInstall.on('close', (code) => {
|
|
147
|
-
if (code === 0) {
|
|
148
|
-
console.log('\n[ZYKET] ✅ Dependencies installed successfully!');
|
|
149
|
-
resolve();
|
|
150
|
-
} else {
|
|
151
|
-
reject(new Error(`npm install exited with code ${code}`));
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
npmInstall.on('error', (error) => {
|
|
156
|
-
reject(error);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
// Start the project automatically
|
|
161
|
-
console.log('\n[ZYKET] Starting project...\n');
|
|
162
|
-
const nodeStart = spawn('node', ['index.js'], {
|
|
163
|
-
cwd: process.cwd(),
|
|
164
|
-
stdio: 'inherit',
|
|
165
|
-
shell: true
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
nodeStart.on('error', (error) => {
|
|
169
|
-
console.error('[ZYKET] Error starting project:', error);
|
|
170
|
-
});
|
|
171
|
-
},
|
|
172
|
-
'install-template': async () => {
|
|
173
|
-
const templates = templateManager.getTemplates();
|
|
174
|
-
const response = await prompts({
|
|
175
|
-
type: 'select',
|
|
176
|
-
name: 'templateToInstall',
|
|
177
|
-
message: '[ZYKET] What template would you like to install?',
|
|
178
|
-
choices: [
|
|
179
|
-
...templates.map((template) => ({ title: template.toUpperCase(), value: template, description: '', disabled: false })),
|
|
180
|
-
],
|
|
181
|
-
initial: 0
|
|
182
|
-
});
|
|
183
|
-
if(!templateManager.exists(response.templateToInstall)) throw new Error(`Template ${response.templateToInstall} not found`);
|
|
184
|
-
templateManager.installTemplate(response.templateToInstall);
|
|
185
|
-
},
|
|
186
|
-
/*'remove-template': async () => {
|
|
187
|
-
const response = await prompts({
|
|
188
|
-
type: 'select',
|
|
189
|
-
name: 'templateToRemove',
|
|
190
|
-
message: '[ZYKET] What template would you like to remove?',
|
|
191
|
-
choices: [
|
|
192
|
-
{ title: 'Auth', value: 'auth', description: 'Authentication template', disabled: false },
|
|
193
|
-
{ title: 'Chat', value: 'chat', description: 'Chat template', disabled: false },
|
|
194
|
-
],
|
|
195
|
-
initial: 0
|
|
196
|
-
});
|
|
197
|
-
console.log(`Removing template: ${response.templateToRemove}`);
|
|
198
|
-
}*/
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
await actions[actionToRun]();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const prompts = require('prompts');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { spawn } = require('child_process');
|
|
6
|
+
const TemplateManager = require('../src/services/template-manager');
|
|
7
|
+
const EnvManager = require('../src/utils/EnvManager');
|
|
8
|
+
const templateManager = new TemplateManager();
|
|
9
|
+
|
|
10
|
+
(async () => {
|
|
11
|
+
process.stdout.write("\u001b[2J\u001b[0;0H");
|
|
12
|
+
await templateManager.boot();
|
|
13
|
+
|
|
14
|
+
// Check for direct command (e.g., npx zyket init)
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const directCommand = args[0];
|
|
17
|
+
|
|
18
|
+
let actionToRun = null;
|
|
19
|
+
|
|
20
|
+
if (directCommand === 'init') {
|
|
21
|
+
actionToRun = 'init-project';
|
|
22
|
+
} else {
|
|
23
|
+
// Show interactive menu
|
|
24
|
+
const response = await prompts({
|
|
25
|
+
type: 'select',
|
|
26
|
+
name: 'value',
|
|
27
|
+
message: '[ZYKET] What do you want to do?',
|
|
28
|
+
choices: [
|
|
29
|
+
{ title: 'Initialize Project', value: 'init-project', description: 'Set up a new Zyket project', disabled: false },
|
|
30
|
+
{ title: 'Install Template', value: 'install-template', description: 'Install a new template', disabled: false },
|
|
31
|
+
/*{ title: 'Remove Template', value: 'remove-template', description: 'Remove an existing template', disabled: false },*/
|
|
32
|
+
],
|
|
33
|
+
initial: 0
|
|
34
|
+
});
|
|
35
|
+
actionToRun = response.value;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!actionToRun) {
|
|
39
|
+
console.log('[ZYKET] No action selected. Exiting.');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const actions = {
|
|
44
|
+
'init-project': async () => {
|
|
45
|
+
const indexPath = path.join(process.cwd(), 'index.js');
|
|
46
|
+
const envPath = path.join(process.cwd(), '.env');
|
|
47
|
+
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
48
|
+
|
|
49
|
+
// Check if index.js already exists
|
|
50
|
+
if (fs.existsSync(indexPath)) {
|
|
51
|
+
const overwrite = await prompts({
|
|
52
|
+
type: 'confirm',
|
|
53
|
+
name: 'value',
|
|
54
|
+
message: '[ZYKET] index.js already exists. Overwrite?',
|
|
55
|
+
initial: false
|
|
56
|
+
});
|
|
57
|
+
if (!overwrite.value) {
|
|
58
|
+
console.log('[ZYKET] Initialization cancelled.');
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Create .env file
|
|
64
|
+
console.log('[ZYKET] Creating .env file...');
|
|
65
|
+
EnvManager.createEnvFile(envPath);
|
|
66
|
+
|
|
67
|
+
// Install default backend template files (src and config)
|
|
68
|
+
console.log('[ZYKET] Installing default backend template files...');
|
|
69
|
+
const defaultTemplate = templateManager.getTemplate('default');
|
|
70
|
+
const backendFiles = defaultTemplate.filter(file => {
|
|
71
|
+
const route = file.route;
|
|
72
|
+
// Only install src and config files, not frontend
|
|
73
|
+
// Skip guards and handlers folders since socket is disabled by default
|
|
74
|
+
return (route.startsWith('default/src/') || route.startsWith('default/config/'))
|
|
75
|
+
&& !route.startsWith('default/src/guards/')
|
|
76
|
+
&& !route.startsWith('default/src/handlers/');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
for (const file of backendFiles) {
|
|
80
|
+
const fileName = file.route.split('/').slice(1).join('/');
|
|
81
|
+
const fileLocation = path.join(process.cwd(), fileName);
|
|
82
|
+
const folderLocation = path.dirname(fileLocation);
|
|
83
|
+
|
|
84
|
+
// Create directory if it doesn't exist
|
|
85
|
+
if (!fs.existsSync(folderLocation)) {
|
|
86
|
+
fs.mkdirSync(folderLocation, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Write file if it doesn't exist
|
|
90
|
+
if (!fs.existsSync(fileLocation)) {
|
|
91
|
+
fs.writeFileSync(fileLocation, file.content);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
console.log('[ZYKET] ✅ Backend template files installed');
|
|
95
|
+
|
|
96
|
+
// Create index.js with boilerplate code
|
|
97
|
+
console.log('[ZYKET] Creating index.js...');
|
|
98
|
+
const indexContent = `const { Kernel } = require('zyket');
|
|
99
|
+
|
|
100
|
+
const kernel = new Kernel({
|
|
101
|
+
services: [
|
|
102
|
+
['auth', require('./src/services/auth'), ["@service_container"]],
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
kernel.boot().then(() => {
|
|
107
|
+
console.log('Kernel booted successfully!');
|
|
108
|
+
}).catch((error) => {
|
|
109
|
+
console.error('Error booting kernel:', error);
|
|
110
|
+
});
|
|
111
|
+
`;
|
|
112
|
+
fs.writeFileSync(indexPath, indexContent);
|
|
113
|
+
|
|
114
|
+
// Create package.json if it doesn't exist
|
|
115
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
116
|
+
console.log('[ZYKET] Creating package.json...');
|
|
117
|
+
const packageJson = {
|
|
118
|
+
name: path.basename(process.cwd()),
|
|
119
|
+
version: "1.0.0",
|
|
120
|
+
description: "Zyket application",
|
|
121
|
+
main: "index.js",
|
|
122
|
+
scripts: {
|
|
123
|
+
dev: "node index.js"
|
|
124
|
+
},
|
|
125
|
+
keywords: [],
|
|
126
|
+
author: "",
|
|
127
|
+
license: "ISC",
|
|
128
|
+
dependencies: {
|
|
129
|
+
zyket: "^1.2.3"
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
console.log('\n[ZYKET] ✅ Project initialized successfully!');
|
|
136
|
+
|
|
137
|
+
// Install dependencies automatically
|
|
138
|
+
console.log('\n[ZYKET] Installing dependencies...');
|
|
139
|
+
await new Promise((resolve, reject) => {
|
|
140
|
+
const npmInstall = spawn('npm', ['install'], {
|
|
141
|
+
cwd: process.cwd(),
|
|
142
|
+
stdio: 'inherit',
|
|
143
|
+
shell: true
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
npmInstall.on('close', (code) => {
|
|
147
|
+
if (code === 0) {
|
|
148
|
+
console.log('\n[ZYKET] ✅ Dependencies installed successfully!');
|
|
149
|
+
resolve();
|
|
150
|
+
} else {
|
|
151
|
+
reject(new Error(`npm install exited with code ${code}`));
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
npmInstall.on('error', (error) => {
|
|
156
|
+
reject(error);
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Start the project automatically
|
|
161
|
+
console.log('\n[ZYKET] Starting project...\n');
|
|
162
|
+
const nodeStart = spawn('node', ['index.js'], {
|
|
163
|
+
cwd: process.cwd(),
|
|
164
|
+
stdio: 'inherit',
|
|
165
|
+
shell: true
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
nodeStart.on('error', (error) => {
|
|
169
|
+
console.error('[ZYKET] Error starting project:', error);
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
'install-template': async () => {
|
|
173
|
+
const templates = templateManager.getTemplates();
|
|
174
|
+
const response = await prompts({
|
|
175
|
+
type: 'select',
|
|
176
|
+
name: 'templateToInstall',
|
|
177
|
+
message: '[ZYKET] What template would you like to install?',
|
|
178
|
+
choices: [
|
|
179
|
+
...templates.map((template) => ({ title: template.toUpperCase(), value: template, description: '', disabled: false })),
|
|
180
|
+
],
|
|
181
|
+
initial: 0
|
|
182
|
+
});
|
|
183
|
+
if(!templateManager.exists(response.templateToInstall)) throw new Error(`Template ${response.templateToInstall} not found`);
|
|
184
|
+
templateManager.installTemplate(response.templateToInstall);
|
|
185
|
+
},
|
|
186
|
+
/*'remove-template': async () => {
|
|
187
|
+
const response = await prompts({
|
|
188
|
+
type: 'select',
|
|
189
|
+
name: 'templateToRemove',
|
|
190
|
+
message: '[ZYKET] What template would you like to remove?',
|
|
191
|
+
choices: [
|
|
192
|
+
{ title: 'Auth', value: 'auth', description: 'Authentication template', disabled: false },
|
|
193
|
+
{ title: 'Chat', value: 'chat', description: 'Chat template', disabled: false },
|
|
194
|
+
],
|
|
195
|
+
initial: 0
|
|
196
|
+
});
|
|
197
|
+
console.log(`Removing template: ${response.templateToRemove}`);
|
|
198
|
+
}*/
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
await actions[actionToRun]();
|
|
202
202
|
})();
|
package/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
const Kernel = require("./src/kernel");
|
|
2
|
-
const Service = require("./src/services/Service");
|
|
3
|
-
const EnvManager = require("./src/utils/EnvManager");
|
|
4
|
-
|
|
5
|
-
const {Route, Middleware, Express} = require("./src/services/express");
|
|
6
|
-
const { Handler, Guard } = require("./src/services/socketio");
|
|
7
|
-
const Schedule = require("./src/services/scheduler/Schedule");
|
|
8
|
-
const Event = require("./src/services/events/Event");
|
|
9
|
-
const Worker = require("./src/services/bullmq/Worker");
|
|
10
|
-
const BullBoardExtension = require("./src/extensions/bullboard");
|
|
11
|
-
const Extension = require("./src/extensions/Extension");
|
|
12
|
-
const InteractiveStorageExtension = require("./src/extensions/interactive-storage");
|
|
13
|
-
const AuthService = require("./src/services/auth");
|
|
14
|
-
const MulterMiddleware = require("./src/extensions/interactive-storage/middlewares/MulterMiddleware");
|
|
15
|
-
const RedirectResponse = require("./src/services/express/RedirectResponse");
|
|
16
|
-
const ViteService = require("./src/services/vite");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
module.exports = {
|
|
20
|
-
Express,
|
|
21
|
-
Kernel, Service,
|
|
22
|
-
Route, Middleware,
|
|
23
|
-
Handler, Guard,
|
|
24
|
-
Schedule, Event,
|
|
25
|
-
Worker,
|
|
26
|
-
EnvManager,
|
|
27
|
-
BullBoardExtension, InteractiveStorageExtension,
|
|
28
|
-
Extension,
|
|
29
|
-
AuthService,
|
|
30
|
-
MulterMiddleware,
|
|
31
|
-
RedirectResponse,
|
|
32
|
-
ViteService,
|
|
1
|
+
const Kernel = require("./src/kernel");
|
|
2
|
+
const Service = require("./src/services/Service");
|
|
3
|
+
const EnvManager = require("./src/utils/EnvManager");
|
|
4
|
+
|
|
5
|
+
const {Route, Middleware, Express} = require("./src/services/express");
|
|
6
|
+
const { Handler, Guard } = require("./src/services/socketio");
|
|
7
|
+
const Schedule = require("./src/services/scheduler/Schedule");
|
|
8
|
+
const Event = require("./src/services/events/Event");
|
|
9
|
+
const Worker = require("./src/services/bullmq/Worker");
|
|
10
|
+
const BullBoardExtension = require("./src/extensions/bullboard");
|
|
11
|
+
const Extension = require("./src/extensions/Extension");
|
|
12
|
+
const InteractiveStorageExtension = require("./src/extensions/interactive-storage");
|
|
13
|
+
const AuthService = require("./src/services/auth");
|
|
14
|
+
const MulterMiddleware = require("./src/extensions/interactive-storage/middlewares/MulterMiddleware");
|
|
15
|
+
const RedirectResponse = require("./src/services/express/RedirectResponse");
|
|
16
|
+
const ViteService = require("./src/services/vite");
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
module.exports = {
|
|
20
|
+
Express,
|
|
21
|
+
Kernel, Service,
|
|
22
|
+
Route, Middleware,
|
|
23
|
+
Handler, Guard,
|
|
24
|
+
Schedule, Event,
|
|
25
|
+
Worker,
|
|
26
|
+
EnvManager,
|
|
27
|
+
BullBoardExtension, InteractiveStorageExtension,
|
|
28
|
+
Extension,
|
|
29
|
+
AuthService,
|
|
30
|
+
MulterMiddleware,
|
|
31
|
+
RedirectResponse,
|
|
32
|
+
ViteService,
|
|
33
33
|
}
|
package/package.json
CHANGED
|
@@ -1,50 +1,54 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "zyket",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"main": "index.js",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
-
},
|
|
8
|
-
"bin": {
|
|
9
|
-
"zyket": "./bin/cli.js"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [],
|
|
12
|
-
"author": "",
|
|
13
|
-
"license": "ISC",
|
|
14
|
-
"description": "",
|
|
15
|
-
"dependencies": {
|
|
16
|
-
"@bull-board/express": "^6.20.6",
|
|
17
|
-
"@tailwindcss/vite": "^4.2.2",
|
|
18
|
-
"@vitejs/plugin-react": "^6.0.1",
|
|
19
|
-
"better-auth": "^1.5.6",
|
|
20
|
-
"better-sqlite3": "^12.8.0",
|
|
21
|
-
"bullmq": "^5.71.0",
|
|
22
|
-
"colors": "^1.4.0",
|
|
23
|
-
"cors": "^2.8.6",
|
|
24
|
-
"dotenv": "^17.3.1",
|
|
25
|
-
"express": "^5.2.1",
|
|
26
|
-
"express-basic-auth": "^1.2.1",
|
|
27
|
-
"fast-glob": "^3.3.3",
|
|
28
|
-
"mariadb": "^3.5.2",
|
|
29
|
-
"minio": "^8.0.7",
|
|
30
|
-
"multer": "^2.1.1",
|
|
31
|
-
"node-cron": "^4.2.1",
|
|
32
|
-
"node-dependency-injection": "^3.2.6",
|
|
33
|
-
"pg": "^8.20.0",
|
|
34
|
-
"prompts": "^2.4.2",
|
|
35
|
-
"prop-types": "^15.8.1",
|
|
36
|
-
"react": "^19.2.4",
|
|
37
|
-
"react-dom": "^19.2.4",
|
|
38
|
-
"react-router-dom": "^7.14.0",
|
|
39
|
-
"redis": "^5.11.0",
|
|
40
|
-
"sequelize": "^6.37.8",
|
|
41
|
-
"socket.io": "^4.8.3",
|
|
42
|
-
"sqlite3": "^6.0.1",
|
|
43
|
-
"swagger-jsdoc": "^6.2.8",
|
|
44
|
-
"swagger-ui-express": "^5.0.1",
|
|
45
|
-
"tailwindcss": "^4.2.2",
|
|
46
|
-
"umzug": "^3.8.2",
|
|
47
|
-
"vite": "^8.0.2",
|
|
48
|
-
"zustand": "^5.0.12"
|
|
49
|
-
}
|
|
50
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "zyket",
|
|
3
|
+
"version": "1.2.12",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
7
|
+
},
|
|
8
|
+
"bin": {
|
|
9
|
+
"zyket": "./bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "ISC",
|
|
14
|
+
"description": "",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@bull-board/express": "^6.20.6",
|
|
17
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
18
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
19
|
+
"better-auth": "^1.5.6",
|
|
20
|
+
"better-sqlite3": "^12.8.0",
|
|
21
|
+
"bullmq": "^5.71.0",
|
|
22
|
+
"colors": "^1.4.0",
|
|
23
|
+
"cors": "^2.8.6",
|
|
24
|
+
"dotenv": "^17.3.1",
|
|
25
|
+
"express": "^5.2.1",
|
|
26
|
+
"express-basic-auth": "^1.2.1",
|
|
27
|
+
"fast-glob": "^3.3.3",
|
|
28
|
+
"mariadb": "^3.5.2",
|
|
29
|
+
"minio": "^8.0.7",
|
|
30
|
+
"multer": "^2.1.1",
|
|
31
|
+
"node-cron": "^4.2.1",
|
|
32
|
+
"node-dependency-injection": "^3.2.6",
|
|
33
|
+
"pg": "^8.20.0",
|
|
34
|
+
"prompts": "^2.4.2",
|
|
35
|
+
"prop-types": "^15.8.1",
|
|
36
|
+
"react": "^19.2.4",
|
|
37
|
+
"react-dom": "^19.2.4",
|
|
38
|
+
"react-router-dom": "^7.14.0",
|
|
39
|
+
"redis": "^5.11.0",
|
|
40
|
+
"sequelize": "^6.37.8",
|
|
41
|
+
"socket.io": "^4.8.3",
|
|
42
|
+
"sqlite3": "^6.0.1",
|
|
43
|
+
"swagger-jsdoc": "^6.2.8",
|
|
44
|
+
"swagger-ui-express": "^5.0.1",
|
|
45
|
+
"tailwindcss": "^4.2.2",
|
|
46
|
+
"umzug": "^3.8.2",
|
|
47
|
+
"vite": "^8.0.2",
|
|
48
|
+
"zustand": "^5.0.12"
|
|
49
|
+
},
|
|
50
|
+
"optionalDependencies": {
|
|
51
|
+
"@socket.io/redis-adapter": "^8.3.0",
|
|
52
|
+
"ioredis": "^5.6.1"
|
|
53
|
+
}
|
|
54
|
+
}
|
package/src/Middleware.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
module.exports = class Middleware {
|
|
2
|
-
constructor() {
|
|
3
|
-
}
|
|
1
|
+
module.exports = class Middleware {
|
|
2
|
+
constructor() {
|
|
3
|
+
}
|
|
4
4
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
module.exports = class Extension {
|
|
2
|
-
name;
|
|
3
|
-
|
|
4
|
-
constructor(_Name) {
|
|
5
|
-
this.name = _Name;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
load(container) {
|
|
9
|
-
throw new Error("Load method not implemented");
|
|
10
|
-
}
|
|
1
|
+
module.exports = class Extension {
|
|
2
|
+
name;
|
|
3
|
+
|
|
4
|
+
constructor(_Name) {
|
|
5
|
+
this.name = _Name;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
load(container) {
|
|
9
|
+
throw new Error("Load method not implemented");
|
|
10
|
+
}
|
|
11
11
|
}
|