@cyklang/cli 0.19.1 → 0.20.2
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/build/Cmd.js +3 -1
- package/build/DBClient.js +14 -10
- package/build/InitCommand.js +5 -5
- package/build/RunCommand.js +1 -1
- package/build/TestCommand.js +1 -1
- package/build/console.js +3 -0
- package/build/index.js +1 -1
- package/package.json +3 -2
- package/src/Cmd.ts +1 -1
- package/src/RunCommand.ts +1 -1
- package/src/TestCommand.ts +1 -1
- package/src/index.ts +1 -1
- package/tsconfig.json +1 -1
package/build/Cmd.js
CHANGED
|
@@ -39,6 +39,8 @@ const fs = __importStar(require("fs"));
|
|
|
39
39
|
const logger = loglevel_1.default.getLogger('Cmd.ts');
|
|
40
40
|
logger.setLevel('debug');
|
|
41
41
|
class Cmd extends commander_1.Command {
|
|
42
|
+
dbManager;
|
|
43
|
+
dbRemote;
|
|
42
44
|
constructor(name) {
|
|
43
45
|
super(name);
|
|
44
46
|
this.option('--env <env>', 'path to the environment variables file');
|
|
@@ -60,7 +62,7 @@ class Cmd extends commander_1.Command {
|
|
|
60
62
|
logger.info('Cyk server: ' + process.env.DBREMOTE_URL);
|
|
61
63
|
const nodeCrypto = new NodeCrypto_1.NodeCrypto();
|
|
62
64
|
this.dbRemote = new core_1.DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto);
|
|
63
|
-
const login = await this.dbRemote.
|
|
65
|
+
const login = await this.dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined);
|
|
64
66
|
// logger.debug(`signinResponse : ${JSON.stringify(login)}`)
|
|
65
67
|
this.dbManager = new core_1.DBManager(structure.scope, this.dbRemote);
|
|
66
68
|
await this.dbManager.initialize();
|
package/build/DBClient.js
CHANGED
|
@@ -11,6 +11,7 @@ const logger = loglevel_1.default.getLogger('DBClient.ts');
|
|
|
11
11
|
logger.setLevel('debug');
|
|
12
12
|
// DBManager wrapper class
|
|
13
13
|
class DBClient {
|
|
14
|
+
dbManager;
|
|
14
15
|
constructor(dbManager) {
|
|
15
16
|
this.dbManager = dbManager;
|
|
16
17
|
}
|
|
@@ -145,13 +146,11 @@ class DBClient {
|
|
|
145
146
|
}
|
|
146
147
|
exports.DBClient = DBClient;
|
|
147
148
|
class List {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
this.currentLine = '';
|
|
154
|
-
}
|
|
149
|
+
width = "0";
|
|
150
|
+
columns = [];
|
|
151
|
+
rows = [];
|
|
152
|
+
lines = [];
|
|
153
|
+
currentLine = '';
|
|
155
154
|
addDBColumn(dbColumn) {
|
|
156
155
|
const col = new Column(dbColumn.name);
|
|
157
156
|
col.label = dbColumn.label || dbColumn.name;
|
|
@@ -293,14 +292,19 @@ class List {
|
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
294
|
class Column {
|
|
295
|
+
name;
|
|
296
|
+
label = '';
|
|
297
|
+
dbColumn;
|
|
298
|
+
type;
|
|
299
|
+
computed;
|
|
300
|
+
width = 0;
|
|
301
|
+
actualWidth = 0;
|
|
296
302
|
constructor(name) {
|
|
297
|
-
this.label = '';
|
|
298
|
-
this.width = 0;
|
|
299
|
-
this.actualWidth = 0;
|
|
300
303
|
this.name = name;
|
|
301
304
|
}
|
|
302
305
|
}
|
|
303
306
|
class Row {
|
|
307
|
+
cells;
|
|
304
308
|
constructor(cells) {
|
|
305
309
|
this.cells = cells;
|
|
306
310
|
}
|
package/build/InitCommand.js
CHANGED
|
@@ -34,13 +34,13 @@ const loglevel_1 = require("loglevel");
|
|
|
34
34
|
const logger = (0, loglevel_1.getLogger)('InitCommand.ts');
|
|
35
35
|
logger.setLevel('debug');
|
|
36
36
|
class InitCommand extends commander_1.Command {
|
|
37
|
+
PGPORT = "5432";
|
|
38
|
+
USER_NAME = "cyk";
|
|
39
|
+
USER_PASSWORD = "cyk";
|
|
40
|
+
USER_EMAIL = "my-email@my-domain";
|
|
41
|
+
CYK_PORT = "3000";
|
|
37
42
|
constructor(name) {
|
|
38
43
|
super(name);
|
|
39
|
-
this.PGPORT = "5432";
|
|
40
|
-
this.USER_NAME = "cyk";
|
|
41
|
-
this.USER_PASSWORD = "cyk";
|
|
42
|
-
this.USER_EMAIL = "my-email@my-domain";
|
|
43
|
-
this.CYK_PORT = "3000";
|
|
44
44
|
this.description('initialize a folder with files necessary for a cyklang project')
|
|
45
45
|
.action(async (options) => {
|
|
46
46
|
await this.commandInit(options);
|
package/build/RunCommand.js
CHANGED
|
@@ -82,7 +82,7 @@ async function runFile(filename) {
|
|
|
82
82
|
const structure = new core_1.Structure();
|
|
83
83
|
const nodeCrypto = new NodeCrypto_1.NodeCrypto();
|
|
84
84
|
const dbRemote = new core_1.DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto);
|
|
85
|
-
const login = await dbRemote.
|
|
85
|
+
const login = await dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined);
|
|
86
86
|
const dbManager = new core_1.DBManager(structure.scope, dbRemote);
|
|
87
87
|
await dbManager.initialize();
|
|
88
88
|
structure.scope.addInstructionType(new console_1.WriteFileInstructionType("write_file"));
|
package/build/TestCommand.js
CHANGED
|
@@ -81,7 +81,7 @@ async function testfile(filename) {
|
|
|
81
81
|
const structure = new core_1.Structure();
|
|
82
82
|
const nodeCrypto = new NodeCrypto_1.NodeCrypto();
|
|
83
83
|
const dbRemote = new core_1.DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto);
|
|
84
|
-
const login = await dbRemote.
|
|
84
|
+
const login = await dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined);
|
|
85
85
|
//const dbRemote = new DBRemote(structure, 'https://cyk-postgres.herokuapp.com')
|
|
86
86
|
const dbManager = new core_1.DBManager(structure.scope, dbRemote);
|
|
87
87
|
await dbManager.initialize();
|
package/build/console.js
CHANGED
|
@@ -68,6 +68,7 @@ class InputInstruction extends core_2.Instruction {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
class PrintInstructionType extends core_2.InstructionType {
|
|
71
|
+
logfilename;
|
|
71
72
|
constructor(logfilename) {
|
|
72
73
|
super("print");
|
|
73
74
|
this.logfilename = logfilename;
|
|
@@ -79,6 +80,8 @@ class PrintInstructionType extends core_2.InstructionType {
|
|
|
79
80
|
}
|
|
80
81
|
exports.PrintInstructionType = PrintInstructionType;
|
|
81
82
|
class PrintInstruction extends core_2.Instruction {
|
|
83
|
+
exprValue;
|
|
84
|
+
logfilename;
|
|
82
85
|
constructor(tag, logfilename) {
|
|
83
86
|
super(tag);
|
|
84
87
|
this.logfilename = logfilename;
|
package/build/index.js
CHANGED
|
@@ -182,7 +182,7 @@ class StopCommand extends commander_1.Command {
|
|
|
182
182
|
*/
|
|
183
183
|
const program = new commander_1.Command();
|
|
184
184
|
program.name('cyk').description('cyklang CLI')
|
|
185
|
-
.version('0.
|
|
185
|
+
.version('0.20.1');
|
|
186
186
|
program.addCommand(new StartCommand('start'));
|
|
187
187
|
program.addCommand(new StopCommand('stop'));
|
|
188
188
|
program.addCommand(new InstallCommand_1.InstallCommand('install'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cyklang/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.2",
|
|
4
4
|
"description": "cyklang CLI",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "",
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@cyklang/core": "^0.
|
|
22
|
+
"@cyklang/core": "^0.67.0",
|
|
23
23
|
"commander": "^9.4.0",
|
|
24
24
|
"dotenv": "^16.0.1",
|
|
25
25
|
"form-data": "^4.0.0",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/inquirer": "^8.2.4",
|
|
35
35
|
"@types/mime-types": "^2.1.1",
|
|
36
|
+
"@types/node": "^25.8.0",
|
|
36
37
|
"@types/pako": "^2.0.0",
|
|
37
38
|
"@types/sax": "^1.2.4",
|
|
38
39
|
"nodemon": "^2.0.16",
|
package/src/Cmd.ts
CHANGED
|
@@ -36,7 +36,7 @@ export class Cmd extends Command {
|
|
|
36
36
|
logger.info('Cyk server: ' + process.env.DBREMOTE_URL)
|
|
37
37
|
const nodeCrypto = new NodeCrypto()
|
|
38
38
|
this.dbRemote = new DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto)
|
|
39
|
-
const login = await this.dbRemote.
|
|
39
|
+
const login = await this.dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined)
|
|
40
40
|
// logger.debug(`signinResponse : ${JSON.stringify(login)}`)
|
|
41
41
|
|
|
42
42
|
this.dbManager = new DBManager(structure.scope, this.dbRemote)
|
package/src/RunCommand.ts
CHANGED
|
@@ -57,7 +57,7 @@ export async function runFile(filename: string): Promise<void> {
|
|
|
57
57
|
const structure = new Structure()
|
|
58
58
|
const nodeCrypto = new NodeCrypto()
|
|
59
59
|
const dbRemote = new DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto)
|
|
60
|
-
const login = await dbRemote.
|
|
60
|
+
const login = await dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined)
|
|
61
61
|
const dbManager = new DBManager(structure.scope, dbRemote)
|
|
62
62
|
await dbManager.initialize()
|
|
63
63
|
structure.scope.addInstructionType(new WriteFileInstructionType("write_file"))
|
package/src/TestCommand.ts
CHANGED
|
@@ -59,7 +59,7 @@ async function testfile(filename: string): Promise<boolean> {
|
|
|
59
59
|
const structure = new Structure()
|
|
60
60
|
const nodeCrypto = new NodeCrypto()
|
|
61
61
|
const dbRemote = new DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto)
|
|
62
|
-
const login = await dbRemote.
|
|
62
|
+
const login = await dbRemote.signin_username(process.env.USER_NAME, undefined, process.env.USER_PASSWORD, undefined)
|
|
63
63
|
//const dbRemote = new DBRemote(structure, 'https://cyk-postgres.herokuapp.com')
|
|
64
64
|
const dbManager = new DBManager(structure.scope, dbRemote)
|
|
65
65
|
await dbManager.initialize()
|
package/src/index.ts
CHANGED
|
@@ -176,7 +176,7 @@ class StopCommand extends Command {
|
|
|
176
176
|
*/
|
|
177
177
|
const program = new Command()
|
|
178
178
|
program.name('cyk').description('cyklang CLI')
|
|
179
|
-
.version('0.
|
|
179
|
+
.version('0.20.2')
|
|
180
180
|
program.addCommand(new StartCommand('start'))
|
|
181
181
|
program.addCommand(new StopCommand('stop'))
|
|
182
182
|
program.addCommand(new InstallCommand('install'))
|