pinokiod 1.2.19 → 1.2.21

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.
@@ -527,6 +527,7 @@ class Api {
527
527
  // replace {{{ }}} with {{ }}
528
528
  rpc = this.kernel.template.flatten(rpc)
529
529
 
530
+
530
531
  // 6. rpc must have method names
531
532
  if (rpc.method) {
532
533
 
@@ -723,8 +724,42 @@ class Api {
723
724
 
724
725
  } else {
725
726
  // still going
726
- let next_rpc = script.run[rpc.next]
727
- return { request, rawrpc: next_rpc, input: result, step: rpc.next, total: script.run.length }
727
+ //let next_rpc = script.run[rpc.next]
728
+ for(let i=rpc.next; i<script.run.length; i++) {
729
+ let next_rpc = script.run[i]
730
+ console.log("NEXT RPC", next_rpc)
731
+ if (next_rpc) {
732
+ return { request, rawrpc: next_rpc, input: result, step: i, total: script.run.length }
733
+ }
734
+ }
735
+
736
+ // if all the steps are null, end.
737
+ if (script.daemon) {
738
+ this.ondata({
739
+ id: request.path,
740
+ type: "start",
741
+ data: {
742
+ title: "Started",
743
+ description: "All scripts finished running. Running in daemon mode..."
744
+ }
745
+ })
746
+ } else {
747
+ // no next rpc to execute. Finish
748
+ this.kernel.memory.local[request.path] = {}
749
+ this.ondata({
750
+ id: request.path,
751
+ type: "event",
752
+ data: "stop",
753
+ rpc,
754
+ rawrpc
755
+ })
756
+ await this.stop({
757
+ params: {
758
+ uri: request.path
759
+ }
760
+ })
761
+ }
762
+ //return { request, rawrpc: next_rpc, input: result, step: rpc.next, total: script.run.length }
728
763
  }
729
764
 
730
765
  } catch (e) {
@@ -809,9 +844,6 @@ class Api {
809
844
  let concurrency = (rawrpc.queue ? 1 : 10);
810
845
 
811
846
  // queue_id
812
- if (rawrpc.queue) {
813
- } else {
814
- }
815
847
 
816
848
  let queue_id
817
849
  if (rawrpc.uri) {
package/kernel/index.js CHANGED
@@ -28,7 +28,7 @@ const VARS = {
28
28
  //const memwatch = require('@airbnb/node-memwatch');
29
29
  class Kernel {
30
30
  //schema = ">=1.0.0"
31
- schema = "<=1.3.0"
31
+ schema = "<=1.4.0"
32
32
  constructor(store) {
33
33
  this.fetch = fetch
34
34
  this.store = store
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "1.2.19",
3
+ "version": "1.2.21",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {