@cyklang/cli 0.15.3 → 0.15.7

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/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.1');
185
+ .version('0.15.7');
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",
3
+ "version": "0.15.7",
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.23.0",
22
+ "@cyklang/core": "^0.25.0",
23
23
  "commander": "^9.4.0",
24
24
  "dotenv": "^16.0.1",
25
25
  "form-data": "^4.0.0",
@@ -26,7 +26,7 @@ const scanAssets = async (dbManager: DBManager | undefined, dest?: string): Prom
26
26
  dbReq.selectFromTable = 'cyk_asset'
27
27
  const pFields = dbReq.parameters.addVariable('fields', dbManager.scope.structure.stringDataType)
28
28
  pFields.data = new PrimitiveData(dbManager.scope.structure.stringDataType, "asset_id,asset_route,asset_last_update,asset_mimetype")
29
- const objResult = await dbManager.dbExecute(dbReq)
29
+ const objResult = await dbManager.dbExecute(dbReq) as ObjectData
30
30
  if (!objResult) throw 'objResult undefined'
31
31
  const rows = (objResult.variables.getData('resultset') as ObjectData).variables
32
32
  for (let ind = 0; ind < rows.length(); ind++) {
package/src/DBClient.ts CHANGED
@@ -79,7 +79,7 @@ export class DBClient {
79
79
  // })
80
80
  // }
81
81
 
82
- const objResult = await this.dbManager.dbExecute(request)
82
+ const objResult = await this.dbManager.dbExecute(request) as ObjectData
83
83
  if (!objResult) throw 'objResult undefined'
84
84
  const metaObject = (objResult.variables.getData('meta')) as ObjectData
85
85
  if (metaObject === undefined) throw 'objectMeta not found'
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.3')
179
+ .version('0.15.7')
180
180
  program.addCommand(new StartCommand('start'))
181
181
  program.addCommand(new StopCommand('stop'))
182
182
  program.addCommand(new InstallCommand('install'))
package/test/t27.output CHANGED
@@ -2,3 +2,14 @@
2
2
  {"user_id":1,"user_name":"cyk","user_email":"cyk@gmail.com","user_password":"$2b$10$Et1b0DodTNKxW/jvUFC8be8JrRXULHWC5RnwOjVhUXmVKv.CyfFW.","user_access":"admin","user_appli":null,"user_disable":false,"user_lang":null}
3
3
  Paris coordinates : <number name="lon">2.3488</number>
4
4
  <number name="lat">48.8534</number>
5
+ resp : <boolean name="ok">false</boolean>
6
+ <number name="status">404</number>
7
+ <string name="text" literal="">&lt;html&gt;
8
+ &lt;head&gt;&lt;title&gt;404 Not Found&lt;/title&gt;&lt;/head&gt;
9
+ &lt;body&gt;
10
+ &lt;center&gt;&lt;h1&gt;404 Not Found&lt;/h1&gt;&lt;/center&gt;
11
+ &lt;hr&gt;&lt;center&gt;openresty&lt;/center&gt;
12
+ &lt;/body&gt;
13
+ &lt;/html&gt;
14
+ </string>
15
+ status 404
package/test/t27.xml CHANGED
@@ -28,7 +28,33 @@
28
28
  <string name="APPID">env("OPENWEATHER_API_KEY")</string>
29
29
  </object>
30
30
  </fetch>
31
- <print>'Paris coordinates : ' + string(resp.json.coord)</print>
31
+ <if>
32
+ <condition>resp.ok</condition>
33
+ <then>
34
+ <print>'Paris coordinates : ' + string(resp.json.coord)</print>
35
+ </then>
36
+ </if>
37
+
38
+ <fetch method="get" returns="resp" >
39
+ <string name="origin">"https://api.openweathermap.org/notfound"</string>
40
+ <string name="pathname">"/data/2.5/weather"</string>
41
+ <object name="search">
42
+ <string name="q">"paris,fr"</string>
43
+ <string name="units">"metric"</string>
44
+ <string name="lang">"fr"</string>
45
+ <string name="APPID">env("OPENWEATHER_API_KEY")</string>
46
+ </object>
47
+ </fetch>
48
+ <print>"resp : " + string(resp)</print>
49
+ <if>
50
+ <condition>resp.ok</condition>
51
+ <then>
52
+ <print>'Paris coordinates : ' + string(resp.json.coord)</print>
53
+ </then>
54
+ <else>
55
+ <print>'status ' + string(resp.status)</print>
56
+ </else>
57
+ </if>
32
58
  <!--
33
59
  <print>"icon: " + resp.json.weather.at(0).icon
34
60
  + ", description: "
package/test/t35.xml ADDED
@@ -0,0 +1,16 @@
1
+ <?xml-model href="../../../../VueProjects/docs-vuepress/docs/.vuepress/public/cyklang.xsd" ?>
2
+ <module>
3
+ <datetime name="start">now()</datetime>
4
+ <timer>
5
+ <boolean name="repeat">false</boolean>
6
+ <number name="duration">500</number>
7
+ <function name="timeout">
8
+ <block>
9
+ <print>"function timeout done"</print>
10
+ </block>
11
+ </function>
12
+ </timer>
13
+ <sleep>1000</sleep>
14
+ <datetime name="end">now()</datetime>
15
+ <print>"duration : " + duration(start,end)</print>
16
+ </module>