-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathorigin_example.html
214 lines (157 loc) · 5.98 KB
/
origin_example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en">
<head>
<title>Origin Matrix</title>
<base href="" target="_blank">
<meta charset="utf-8">
<style>
body{
background-color:#111133;
color:white;
}
</style>
</head>
<body>
<div style="font-size:160px; color:#99CCFF;">Org Mtrx</div>
<script type="module">
import KeyCache from '/keycache/keycache.js';
import fabric from './fabric.js';
import * as util from './drivers/util.js'
//import { auth } from "./drivers/vehicle_generic_esm.mjs"
import { OriginMatrix } from '/x_modules/frame/originmatrix.js'
var om = new OriginMatrix();
window.addEventListener( 'load' , async function(){
// SIGNING CREDENTIALS PROVIDER
var creds = new KeyCache();
await creds.loginAndLoad(
[ ...String(window.location) ][37] ,
[ ...String(window.location) ][37] );
var ncr = creds.get('neo')
var k = 3;
var followed_up = false;
fabric.addEventListener( 'fabricEvent' , function( e ){
var data=e.detail;
console.log('onFabricEvent: ',e.detail.method , ' UUID:', e.detail.uuid , ' payload:', e.detail.payload )
console.log('|' )
var i=0;
// will there ever be a situation where nodes of different types are added ?
// Add Key from KeyCache
// Add MAP from KeyCache
// Add list from NEO4J
// Add All Artifacts from keyCache safely
// Add git-Repos from GIT list
var test_map = {
nodes:[
{
nid:0,
title:'zero'
},
{
nid:1,
title:'one'
}
],
links:[
{
nid:99,
nidStart:0,
nidEnd:1
}
],
meta:{
origin:'test',
foreign_id:'nid',
foreign_a:'nidStart',
foreign_b:'nidEnd'
}
}
om.mergeMap( test_map );
om.mergeMap( e.detail.payload )
if ( ! followed_up ){
fabric.mergeIntent( {
uuid:'neo_origin_test',
brand:'neo',
module:'neo',
method:'query',
pattern:'()--(:Satellite)',
payload:{ uuid:'4:18de4a64-650a-4f3d-9657-0526a5183d76:955' , a:'rtr' , b:'f4f4' }
} );
followed_up=true;
}else{
om.printInventory();
}
})
var obj_N = creds.mergeArtifacts( {
uuid:'neo_origin_test',
brand:'neo',
module:'neo',
method:'query',
pattern:'(:Star)--(:Moon)',
payload:{ uuid:'4:18de4a64-650a-4f3d-9657-0526a5183d76:955' , a:'rtr' , b:'f4f4' }
});
obj_N.uuid = 'neo_origin_test'; // this is override hack cause merge Artifacts is clobbering uuid
fabric.mergeIntent( obj_N );
//await util.sleep(3000);
});
</script>
<!-- Generated by the server -->
<script id="datax" type="application/json">{"userId":1234,"userName":"John Doe","memberSince":"2000-01-01T00:00:00.000Z"}
</script>
<!-- Static -->
<script>
const userInfo = JSON.parse( document.getElementById("datax").text );
//console.log("User information: %o", userInfo);
// DESIRED RETURNS:
// Entity.domain new Adderss and priv-key
// Entity.domain existing-price-cluster
// Entity.domain.xclass / cluster time-series
//fabric.mergeIntent( { domain:'crabauto', driver:'crabauto', fn:'fetchTicker' , uuid:'0x1c2c2c22' } );
//fabric.mergeIntent( { domain:'crabauto', driver:'crabauto', fn:'fetchTicker' , uuid:'0x1c2c2c22' } );
//fabric.postMessage ?
// whats better
// workers[ driver ][ carrier ] = {}
// workers[ uuid ] = {}
//fabric.mergeIntent( { driver:'ethers', domain:'ethereum', fn:'init' , symbol:'ETH/USD' } );
//fabric.mergeIntent( { driver:'ccxt', domain:'binanceus', fn:'init' , symbol:'BTC/USD' } );
//fabric.publishIntent( { domain:['ccxt','coinbase','BTC/USD','init'] } );
//fabric.publishIntent( { domain:'ccxt.coinbase.btc.close' } );
//fabric.echoFunction( { seek:nodeIDparamDomain[ domain, symbol ]( x,y,z*,s,t ) . demand:priceVector })
//fabric.spawnRequest( { domain:symbol:xclass } )
//fabric.publishIntent( { domain:'x', symbol:'XYZ', xclass:'priceTelemetryObject' } );
//fabric.addEventListener( 'domain.event' , function( e ){ } )
/*
fabric.addEventListener( 'message' , function( e ){
var object_vector = e.data.domain + '.' +e.data.xclass;
isoModel.pushUpdate( object_vector , e.data.tick );
}); */
// 3 WAY RESOLUTION STYLE
// API.getRes( userIn )
// .then( (obj) => { } )
// .catch( err => console.log )
// .finally( () => console.log )
// var domain=data.domain;
// var symbol=data.symbol;
// var xclass=data.xclass;
// loginAndLoad( return_pair() )
// loginAndLoad( hash_param_1 <<< *3, hash_param_2 >>> *3 )
// loginAndLoad( hash_param_1 <<< *3, hash_param_2 >>> *3 )
// SHould not pass creds ref ( keycache )
// fabric.signer( creds )
// fabric.singer( vault )
// await fabric.mergeIntent( { dom:'binanceus' , carrier:'binanceus', driver:'ccxt', method:'init' , uuid:'0x1c2c2c22' } );
// init / launch of each worker should happen automatically based on existence of intent:
// await fabric.mergeIntent( { brand:'ethereum' , uuid:'0x1c2c2c22' , symbol:'ETH/USDT' } )
// fabric.facilitate
// fabric.support( )
// fabric.mergeIntent( )
// await fabric.mergeIntent( creds.mergeCredential( {
// await fabric.mergeIntent( { ...creds.keySelect( 'dom' )[0]
// driver:'github_esm',
// method:'smallList' } ) )
// function mergeCredentialsAndSpawn( obj ){
//
// fabric.mergeIntent( { ...creds.keySelect( 'dom' , obj.dom )[0] } , ...obj )
// }
</script>
</body>
</html>