forked from magnetar-io/ecs_ifc_structures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathifc5-test.ts
62 lines (51 loc) · 1.4 KB
/
ifc5-test.ts
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
import { CommitProposal, Component, Filter, FilteredCommit, Ledger, Rights } from "./ifc5-ui/src/ifc5";
// SETUP
let main = new Ledger("main");
function commitLogger(name: string)
{
return (c: FilteredCommit) => {
console.log(`${name} ${c.commit.initiator}::${c.commit.ID}::${c.commit.data.message}`);
}
}
main.Listen("listener_main", new Rights().all(), commitLogger("[MAIN]"));
let arc_mesh = new Ledger("arc");
arc_mesh.Mirror("arc::*::*", main);
arc_mesh.Listen("listener_arc", new Rights().all(), commitLogger("[ARC] "));
let arc_mep = new Ledger("mep");
arc_mep.Mirror("mep::*::*", main);
arc_mep.Listen("listener_mep", new Rights().all(), commitLogger("[MEP] "));
{
main.Mirror(new Rights().all(), arc_mesh);
main.Mirror(new Rights().all(), arc_mep);
}
// COMMIT
{
let proposal = new CommitProposal();
proposal.message = "new commit to arc";
proposal.paths = [
{
path: "arc",
added: [
new Component()
],
updated: [],
removed: []
}
]
main.CommitProposal(proposal);
}
{
let proposal = new CommitProposal();
proposal.message = "new commit to mep";
proposal.paths = [
{
path: "mep",
added: [
new Component()
],
updated: [],
removed: []
}
]
main.CommitProposal(proposal);
}