pico-engine 1.1.1 → 1.3.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.
@@ -0,0 +1,78 @@
1
+ ruleset didtestdid {
2
+ meta {
3
+ name "didtestdid"
4
+ description
5
+ <<
6
+ A Test Ruleset Orchestrator for using DIDs with event:send() and wrangler:picoQuery()
7
+ >>
8
+ author "Josh Mann"
9
+ shares child1DidMap, child2DidMap
10
+ use module io.picolabs.wrangler alias wrangler
11
+ use module io.picolabs.did-o alias didx
12
+ }
13
+
14
+ global {
15
+ child1DidMap = function() {
16
+ wrangler:picoQuery(ent:child1, "io.picolabs.did-o", "didMap", {})
17
+ }
18
+
19
+ child2DidMap = function() {
20
+ wrangler:picoQuery(ent:child2, "io.picolabs.did-o", "didMap", {})
21
+ }
22
+ }
23
+
24
+ rule createChildren {
25
+ select when didtestdid createChildren
26
+ always {
27
+ raise wrangler event "new_child_request" attributes {"name": "child1", "backgroundColor": "#ae85fa"}
28
+ raise wrangler event "new_child_request" attributes {"name": "child2", "backgroundColor": "#fef1b4"}
29
+ }
30
+ }
31
+
32
+ rule createDIDRelationshipWithChildren {
33
+ select when didtestdid createDIDRelationshipWithChildren
34
+ foreach ctx:children setting(child)
35
+ pre {
36
+ invitation = didx:generate_invitation()
37
+ }
38
+ event:send({
39
+ "eci": child,
40
+ "domain": "dido",
41
+ "name": "receive_invite",
42
+ "attrs": {"invite": invitation}
43
+ })
44
+ }
45
+
46
+ rule saveChildDids {
47
+ select when didtestdid saveChildDids
48
+ always {
49
+ ent:child1 := didx:didMap().keys()[0]
50
+ ent:child2 := didx:didMap().keys()[1]
51
+ }
52
+ }
53
+
54
+ rule createDIDRelationship {
55
+ select when didtestdid createDIDRelationship
56
+ pre {
57
+ child1 = ent:child1.klog("Child1: ")
58
+ child2 = ent:child2.klog("Child2: ")
59
+ invitation = wrangler:picoQuery(child1, "io.picolabs.did-o", "generate_invitation", {}).klog("Invitation: ")
60
+ }
61
+ event:send({
62
+ "did": child2,
63
+ "domain": "dido",
64
+ "name": "receive_invite",
65
+ "attrs": {
66
+ "invite": invitation
67
+ }
68
+ })
69
+ }
70
+
71
+ rule deleteChildren {
72
+ select when didtestdid deleteChildren
73
+ foreach ctx:children setting(child)
74
+ always {
75
+ raise wrangler event "child_deletion_request" attributes {"eci": child}
76
+ }
77
+ }
78
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pico-engine",
3
- "version": "1.1.1",
3
+ "version": "1.3.0",
4
4
  "description": "An implementation of the pico-engine targeting node.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,8 +50,8 @@
50
50
  "express": "^4.16.4",
51
51
  "helmet": "^3.16.0",
52
52
  "home-dir": "^1.0.0",
53
- "krl-compiler": "^1.1.1",
54
- "krl-stdlib": "^1.0.6",
53
+ "krl-compiler": "^1.3.0",
54
+ "krl-stdlib": "^1.3.0",
55
55
  "level-json-coerce-null": "^1.0.1",
56
56
  "leveldown": "^5.0.2",
57
57
  "levelup": "^4.0.1",
@@ -59,7 +59,7 @@
59
59
  "make-dir": "^3.0.0",
60
60
  "memdown": "^5.1.0",
61
61
  "minimist": "^1.2.5",
62
- "pico-engine-core": "^1.1.1",
62
+ "pico-engine-core": "^1.3.0",
63
63
  "pico-framework": "^0.6.0",
64
64
  "rotating-file-stream": "^1.4.1",
65
65
  "split": "^1.0.1",
@@ -77,7 +77,7 @@
77
77
  "onchange": "^6.0.0",
78
78
  "scriptsp": "^1.1.1",
79
79
  "temp-dir": "^2.0.0",
80
- "ts-node": "^9.1.1",
80
+ "ts-node": "^10.4.0",
81
81
  "typescript": "^4.1.2"
82
82
  },
83
83
  "ava": {
@@ -89,5 +89,5 @@
89
89
  "ts-node/register"
90
90
  ]
91
91
  },
92
- "gitHead": "276e5c39f3749db848fadccc536509c137b43ca4"
92
+ "gitHead": "7eee32777be87b2a65398ae7054e16dca4f2ccdc"
93
93
  }