@cyklang/cli 0.14.18 → 0.15.0

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.
@@ -33,6 +33,7 @@ class UserAddCmd extends Cmd_1.Cmd {
33
33
  super(name);
34
34
  this.description(description)
35
35
  .requiredOption('-n --name <name>', 'user name')
36
+ .option('-c --company <company_id>', 'user company ID')
36
37
  .option('-e --email <email>', 'user email address')
37
38
  .option('-p --password <password>', 'initial password')
38
39
  .option('-a --access <acl>', 'access control list')
@@ -43,6 +44,7 @@ class UserAddCmd extends Cmd_1.Cmd {
43
44
  const dbUser = new core_1.DBUser();
44
45
  dbUser.name = options.name;
45
46
  dbUser.email = options.email;
47
+ dbUser.company = options.company;
46
48
  dbUser.password = options.password;
47
49
  dbUser.access = options.access;
48
50
  dbUser.appli = options.module;
@@ -83,7 +85,7 @@ class UserListCmd extends Cmd_1.Cmd {
83
85
  if (this.dbManager === undefined)
84
86
  throw 'dbManager undefined';
85
87
  const dbClient = new DBClient_1.DBClient(this.dbManager);
86
- dbClient.selectFromTable('List of users', 'cyk_user', { fields: 'user_id,user_name,user_email,user_access,user_appli,user_lang,user_disable', sort: options.sort || '1' });
88
+ dbClient.selectFromTable('List of users', 'cyk_user', { fields: 'user_id,user_name,user_email,user_company,user_access,user_appli,user_lang,user_disable', sort: options.sort || '1' });
87
89
  }
88
90
  catch (err) {
89
91
  logger.error(err);
@@ -96,6 +98,7 @@ class UserUpdateCmd extends Cmd_1.Cmd {
96
98
  this.description(description)
97
99
  .requiredOption('-i --id <id>', 'user ID')
98
100
  .option('-n --name <name>', 'user name')
101
+ .option('-c --company <company_id>', 'user company ID')
99
102
  .option('-e --email <email>', 'user email address')
100
103
  .option('-a --access <acl>', 'access control list')
101
104
  .option('-m --module <module_name>', 'module to launch by default')
@@ -106,6 +109,7 @@ class UserUpdateCmd extends Cmd_1.Cmd {
106
109
  dbUser.id = options.id;
107
110
  dbUser.name = options.name;
108
111
  dbUser.email = options.email;
112
+ dbUser.company = Number(options.company);
109
113
  dbUser.access = options.access;
110
114
  dbUser.appli = options.module;
111
115
  dbUser.lang = options.lang;
@@ -128,6 +132,8 @@ class UserUpdateCmd extends Cmd_1.Cmd {
128
132
  dbUser1.name = dbUser2.name;
129
133
  if (dbUser2.email !== undefined)
130
134
  dbUser1.email = dbUser2.email;
135
+ if (dbUser2.company !== undefined)
136
+ dbUser1.company = dbUser2.company;
131
137
  if (dbUser2.access !== undefined)
132
138
  dbUser1.access = dbUser2.access;
133
139
  if (dbUser2.appli !== undefined)
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.14.18');
185
+ .version('0.15.0');
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.14.18",
3
+ "version": "0.15.0",
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.18.0",
22
+ "@cyklang/core": "^0.20.0",
23
23
  "commander": "^9.4.0",
24
24
  "dotenv": "^16.0.1",
25
25
  "form-data": "^4.0.0",
@@ -26,6 +26,7 @@ export class UserCommand extends Command {
26
26
  interface Options {
27
27
  id: string | undefined
28
28
  name: string | undefined
29
+ company: number | undefined
29
30
  email: string | undefined
30
31
  access: string | undefined
31
32
  module: string | undefined
@@ -41,6 +42,7 @@ class UserAddCmd extends Cmd {
41
42
  super(name)
42
43
  this.description(description)
43
44
  .requiredOption('-n --name <name>', 'user name')
45
+ .option('-c --company <company_id>', 'user company ID')
44
46
  .option('-e --email <email>', 'user email address')
45
47
  .option('-p --password <password>', 'initial password')
46
48
  .option('-a --access <acl>', 'access control list')
@@ -51,6 +53,7 @@ class UserAddCmd extends Cmd {
51
53
  const dbUser = new DBUser()
52
54
  dbUser.name = options.name
53
55
  dbUser.email = options.email
56
+ dbUser.company = options.company
54
57
  dbUser.password = options.password
55
58
  dbUser.access = options.access
56
59
  dbUser.appli = options.module
@@ -92,7 +95,7 @@ class UserListCmd extends Cmd {
92
95
 
93
96
  const dbClient = new DBClient(this.dbManager)
94
97
  dbClient.selectFromTable('List of users', 'cyk_user',
95
- { fields: 'user_id,user_name,user_email,user_access,user_appli,user_lang,user_disable', sort: options.sort || '1' })
98
+ { fields: 'user_id,user_name,user_email,user_company,user_access,user_appli,user_lang,user_disable', sort: options.sort || '1' })
96
99
 
97
100
  }
98
101
  catch (err) {
@@ -108,6 +111,7 @@ class UserUpdateCmd extends Cmd {
108
111
  this.description(description)
109
112
  .requiredOption('-i --id <id>', 'user ID')
110
113
  .option('-n --name <name>', 'user name')
114
+ .option('-c --company <company_id>', 'user company ID')
111
115
  .option('-e --email <email>', 'user email address')
112
116
  .option('-a --access <acl>', 'access control list')
113
117
  .option('-m --module <module_name>', 'module to launch by default')
@@ -118,6 +122,7 @@ class UserUpdateCmd extends Cmd {
118
122
  dbUser.id = options.id
119
123
  dbUser.name = options.name
120
124
  dbUser.email = options.email
125
+ dbUser.company = Number(options.company)
121
126
  dbUser.access = options.access
122
127
  dbUser.appli = options.module
123
128
  dbUser.lang = options.lang
@@ -135,6 +140,7 @@ class UserUpdateCmd extends Cmd {
135
140
  // const dbUser1: DBUser = { id: user.user_id, name: user.user_name, email: user.user_email, password: user.user_password, access: user.user_access, appli: user.user_appli, disable: user.user_disable }
136
141
  if (dbUser2.name !== undefined) dbUser1.name = dbUser2.name
137
142
  if (dbUser2.email !== undefined) dbUser1.email = dbUser2.email
143
+ if (dbUser2.company !== undefined) dbUser1.company = dbUser2.company
138
144
  if (dbUser2.access !== undefined) dbUser1.access = dbUser2.access
139
145
  if (dbUser2.appli !== undefined) dbUser1.appli = dbUser2.appli
140
146
  if (dbUser2.lang !== undefined) dbUser1.lang = dbUser2.lang
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.14.18')
179
+ .version('0.15.0')
180
180
  program.addCommand(new StartCommand('start'))
181
181
  program.addCommand(new StopCommand('stop'))
182
182
  program.addCommand(new InstallCommand('install'))
package/test/t34.output CHANGED
@@ -14,3 +14,13 @@ dialog=<boolean name="__dirty__">false</boolean>
14
14
  dialog.grid.f1() = 50
15
15
  dialog.grid.boole = false
16
16
  dialog2.__dirty__ = false
17
+ result_matchre_1 = <string literal="">riode : 01/01/2023 - 31/12/2023&quot;</string>
18
+ <string literal="">01/01/2023</string>
19
+ <string literal="">31/12/2023</string>
20
+ text2 [ toto ] does not match /riode : (.*) - (.*)"/
21
+ split of text3 : <string literal="">&quot; 02/01/2023&quot;</string>
22
+ <string literal="">&quot; 02/01/2023&quot;</string>
23
+ <string literal="">&quot;CARTE 30/12/22 APPLE.COM/BILL CB*1998&quot;</string>
24
+ <string literal="">-00000000016,99</string>
25
+ <string literal="">&quot;EUR &quot;</string>
26
+ date_1: " 02/01/2023", date_2: " 02/01/2023"
package/test/t34.xml CHANGED
@@ -37,7 +37,7 @@
37
37
  <call object="buffer" method="push">
38
38
  <string><![CDATA[ "Contenu du Journal" ]]></string>
39
39
  </call>
40
-
40
+
41
41
  <!-- <call object="this" method="foreach">
42
42
  <function>
43
43
  <object name="journal"/>
@@ -106,5 +106,25 @@
106
106
  <object name="dialog2" type="TDialog"></object>
107
107
  <print>"dialog2.__dirty__ = " + dialog2.__dirty__</print>
108
108
 
109
+ <string name="text1" literal="">"*** PÈriode : 01/01/2023 - 31/12/2023"</string>
110
+ <string name="text2" literal="">toto</string>
111
+ <string name="regexp_1" literal="">riode : (.*) - (.*)"</string>
112
+ <object name="result_matchre_1">matchre(text1, regexp_1)</object>
113
+ <print>"result_matchre_1 = " + string(result_matchre_1)</print>
114
+
115
+ <object name="result_matchre_2">matchre(text2, regexp_1)</object>
116
+ <if>
117
+ <condition>result_matchre_2</condition>
118
+ <then>
119
+ <print>"result_matchre_2 = " + string(result_matchre_2)</print>
120
+ </then>
121
+ <else>
122
+ <print>format("text2 [ {0} ] does not match /{1}/", text2, regexp_1)</print>
123
+ </else>
124
+ </if>
109
125
 
126
+ <string name="text3" literal="">" 02/01/2023" " 02/01/2023" "CARTE 30/12/22 APPLE.COM/BILL CB*1998" -00000000016,99 "EUR "</string>
127
+ <object name="result_split">split(text3, "\t")</object>
128
+ <print>"split of text3 : " + string(result_split)</print>
129
+ <print>format("date_1: {0}, date_2: {1}", result_split.at(0), result_split.at(1))</print>
110
130
  </module>