@cyklang/cli 0.15.7 → 0.15.9
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 +25 -19
- package/build/index.js +1 -1
- package/package.json +2 -2
- package/src/Cmd.ts +25 -20
- package/src/index.ts +1 -1
- package/test/t34.xml +4 -4
- package/test/t35.output +3 -0
- package/test/t35.xml +5 -0
package/build/Cmd.js
CHANGED
|
@@ -44,26 +44,32 @@ class Cmd extends commander_1.Command {
|
|
|
44
44
|
this.option('--env <env>', 'path to the environment variables file');
|
|
45
45
|
}
|
|
46
46
|
async prologue(options) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
try {
|
|
48
|
+
if (options.env || fs.existsSync('.env')) {
|
|
49
|
+
const dotenvOutput = dotenv_1.default.config({ path: options.env });
|
|
50
|
+
if (dotenvOutput.error !== undefined)
|
|
51
|
+
throw dotenvOutput.error;
|
|
52
|
+
}
|
|
53
|
+
const structure = new core_1.Structure();
|
|
54
|
+
if (!process.env.DBREMOTE_URL)
|
|
55
|
+
throw 'DBREMOTE_URL environment variable undefined';
|
|
56
|
+
if (!process.env.USER_NAME)
|
|
57
|
+
throw 'USER_NAME environment variable undefined';
|
|
58
|
+
if (!process.env.USER_PASSWORD)
|
|
59
|
+
throw 'USER_PASSWORD environment variable undefined';
|
|
60
|
+
logger.info('Cyk server: ' + process.env.DBREMOTE_URL);
|
|
61
|
+
const nodeCrypto = new NodeCrypto_1.NodeCrypto();
|
|
62
|
+
this.dbRemote = new core_1.DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto);
|
|
63
|
+
const login = await this.dbRemote.signin(process.env.USER_NAME, undefined, process.env.USER_PASSWORD);
|
|
64
|
+
// logger.debug(`signinResponse : ${JSON.stringify(login)}`)
|
|
65
|
+
this.dbManager = new core_1.DBManager(structure.scope, this.dbRemote);
|
|
66
|
+
await this.dbManager.initialize();
|
|
67
|
+
return login;
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
logger.error(err);
|
|
71
|
+
throw err;
|
|
51
72
|
}
|
|
52
|
-
const structure = new core_1.Structure();
|
|
53
|
-
if (!process.env.DBREMOTE_URL)
|
|
54
|
-
throw 'DBREMOTE_URL environment variable undefined';
|
|
55
|
-
if (!process.env.USER_NAME)
|
|
56
|
-
throw 'USER_NAME environment variable undefined';
|
|
57
|
-
if (!process.env.USER_PASSWORD)
|
|
58
|
-
throw 'USER_PASSWORD environment variable undefined';
|
|
59
|
-
logger.info('Cyk server: ' + process.env.DBREMOTE_URL);
|
|
60
|
-
const nodeCrypto = new NodeCrypto_1.NodeCrypto();
|
|
61
|
-
this.dbRemote = new core_1.DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto);
|
|
62
|
-
const login = await this.dbRemote.signin(process.env.USER_NAME, undefined, process.env.USER_PASSWORD);
|
|
63
|
-
// logger.debug(login)
|
|
64
|
-
this.dbManager = new core_1.DBManager(structure.scope, this.dbRemote);
|
|
65
|
-
await this.dbManager.initialize();
|
|
66
|
-
return login;
|
|
67
73
|
}
|
|
68
74
|
/**
|
|
69
75
|
* method updateAuthAccess
|
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.15.
|
|
185
|
+
.version('0.15.9');
|
|
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.15.
|
|
3
|
+
"version": "0.15.9",
|
|
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.25.
|
|
22
|
+
"@cyklang/core": "^0.25.2",
|
|
23
23
|
"commander": "^9.4.0",
|
|
24
24
|
"dotenv": "^16.0.1",
|
|
25
25
|
"form-data": "^4.0.0",
|
package/src/Cmd.ts
CHANGED
|
@@ -22,27 +22,32 @@ export class Cmd extends Command {
|
|
|
22
22
|
|
|
23
23
|
async prologue(options: any): Promise<SigninResponse> {
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
try {
|
|
26
|
+
if (options.env || fs.existsSync('.env')) {
|
|
27
|
+
const dotenvOutput = dotenv.config({ path: options.env })
|
|
28
|
+
if (dotenvOutput.error !== undefined) throw dotenvOutput.error
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const structure = new Structure()
|
|
32
|
+
if (! process.env.DBREMOTE_URL) throw 'DBREMOTE_URL environment variable undefined'
|
|
33
|
+
if (! process.env.USER_NAME) throw 'USER_NAME environment variable undefined'
|
|
34
|
+
if (! process.env.USER_PASSWORD) throw 'USER_PASSWORD environment variable undefined'
|
|
35
|
+
|
|
36
|
+
logger.info('Cyk server: ' + process.env.DBREMOTE_URL)
|
|
37
|
+
const nodeCrypto = new NodeCrypto()
|
|
38
|
+
this.dbRemote = new DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto)
|
|
39
|
+
const login = await this.dbRemote.signin(process.env.USER_NAME, undefined, process.env.USER_PASSWORD)
|
|
40
|
+
// logger.debug(`signinResponse : ${JSON.stringify(login)}`)
|
|
41
|
+
|
|
42
|
+
this.dbManager = new DBManager(structure.scope, this.dbRemote)
|
|
43
|
+
await this.dbManager.initialize()
|
|
44
|
+
|
|
45
|
+
return login
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
logger.error(err)
|
|
49
|
+
throw err
|
|
28
50
|
}
|
|
29
|
-
|
|
30
|
-
const structure = new Structure()
|
|
31
|
-
if (! process.env.DBREMOTE_URL) throw 'DBREMOTE_URL environment variable undefined'
|
|
32
|
-
if (! process.env.USER_NAME) throw 'USER_NAME environment variable undefined'
|
|
33
|
-
if (! process.env.USER_PASSWORD) throw 'USER_PASSWORD environment variable undefined'
|
|
34
|
-
|
|
35
|
-
logger.info('Cyk server: ' + process.env.DBREMOTE_URL)
|
|
36
|
-
const nodeCrypto = new NodeCrypto()
|
|
37
|
-
this.dbRemote = new DBRemote(structure.scope, process.env.DBREMOTE_URL, nodeCrypto)
|
|
38
|
-
const login = await this.dbRemote.signin(process.env.USER_NAME, undefined, process.env.USER_PASSWORD)
|
|
39
|
-
// logger.debug(login)
|
|
40
|
-
|
|
41
|
-
this.dbManager = new DBManager(structure.scope, this.dbRemote)
|
|
42
|
-
await this.dbManager.initialize()
|
|
43
|
-
|
|
44
|
-
return login
|
|
45
|
-
|
|
46
51
|
|
|
47
52
|
}
|
|
48
53
|
|
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.15.
|
|
179
|
+
.version('0.15.9')
|
|
180
180
|
program.addCommand(new StartCommand('start'))
|
|
181
181
|
program.addCommand(new StopCommand('stop'))
|
|
182
182
|
program.addCommand(new InstallCommand('install'))
|
package/test/t34.xml
CHANGED
|
@@ -130,12 +130,12 @@
|
|
|
130
130
|
<object name="result_sendmail"/>
|
|
131
131
|
<sendmail returns="result_sendmail">
|
|
132
132
|
<string name="to">"philippe.cyk@gmail.com"</string>
|
|
133
|
-
<string name="subject">"test
|
|
133
|
+
<string name="subject">"email de test"</string>
|
|
134
134
|
<string name="text">"Contenu de test t34.xml"</string>
|
|
135
|
-
<string name="html" literal=""><![CDATA[ <h1>
|
|
136
|
-
<p><b>
|
|
135
|
+
<!-- <string name="html" literal=""><![CDATA[ <h1>EMAIL DE TEST </h1>
|
|
136
|
+
<p><b>HTML</b>
|
|
137
137
|
</p>
|
|
138
|
-
]]></string>
|
|
138
|
+
]]></string> -->
|
|
139
139
|
</sendmail>
|
|
140
140
|
<print>"result_sendmail.accepted : " + string(result_sendmail.accepted)</print>
|
|
141
141
|
|
package/test/t35.output
ADDED
package/test/t35.xml
CHANGED
|
@@ -13,4 +13,9 @@
|
|
|
13
13
|
<sleep>1000</sleep>
|
|
14
14
|
<datetime name="end">now()</datetime>
|
|
15
15
|
<print>"duration : " + duration(start,end)</print>
|
|
16
|
+
<object name="params">
|
|
17
|
+
<number name="first">15</number>
|
|
18
|
+
<number name="last">15</number>
|
|
19
|
+
</object>
|
|
20
|
+
<print>query("select * from generate_series({{ first }}::integer, {{ last }}::integer)", params)</print>
|
|
16
21
|
</module>
|