Skip to content

Commit 4a4cb09

Browse files
Erwan CarriouErwan Carriou
authored andcommitted
- add 'send' event to MonocoChannel
- clean MonocoChannelSchema
1 parent b980a3c commit 4a4cb09

19 files changed

+301
-303
lines changed

build/monoco-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.js

Lines changed: 70 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.json

Lines changed: 45 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -126,26 +126,13 @@
126126
"MonocoChannelEvent"
127127
],
128128
"_core": true,
129-
"listen": {
130-
"params": [
131-
{
132-
"name": "event",
133-
"type": "string"
134-
},
135-
{
136-
"name": "callback",
137-
"type": "function"
138-
}
139-
]
140-
},
141129
"send": {
142130
"params": [
143131
{
144132
"name": "message",
145-
"type": "message"
133+
"type": "object"
146134
}
147-
],
148-
"result": "boolean"
135+
]
149136
}
150137
},
151138
"MonocoChannelEvent": {
@@ -165,8 +152,7 @@
165152
"MonocoChannelEventSchema"
166153
],
167154
"_core": true,
168-
"listen": "method",
169-
"send": "method"
155+
"send": "event"
170156
},
171157
"MonocoClassInfo": {
172158
"_id": "MonocoClassInfo",
@@ -778,158 +764,158 @@
778764
"core": true,
779765
"useCoreAPI": true
780766
},
781-
"1068e1129917ccd": {
782-
"_id": "1068e1129917ccd",
767+
"197751e3551e06f": {
768+
"_id": "197751e3551e06f",
783769
"component": "Monoco",
784770
"state": "error",
785771
"action": "function error(data) { console.error('monoco: ' + data.message, data.error); }",
786772
"core": true
787773
},
788-
"129dc10328155d4": {
789-
"_id": "129dc10328155d4",
774+
"112711926518069": {
775+
"_id": "112711926518069",
790776
"component": "Monoco",
791777
"state": "system",
792778
"action": "function system(name) { var System = null, system = {}, systemId = '', result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = this.require('MonocoSystem'); system = new System(conf); } else { result = $db.MonocoSystem.find({ 'master': true }); if (result.length) { systemId = result[0]._id; system = $component.get(systemId); } } return system;}",
793779
"core": true,
794780
"useCoreAPI": true
795781
},
796-
"152351f10313e0e": {
797-
"_id": "152351f10313e0e",
782+
"1ef9a1a3271e595": {
783+
"_id": "1ef9a1a3271e595",
798784
"component": "Monoco",
799785
"state": "warning",
800786
"action": "function warning(message) { console.warn('monoco: ' + message); }",
801787
"core": true
802788
},
803-
"1a8811b12e11369": {
804-
"_id": "1a8811b12e11369",
789+
"17df2116b51f0b3": {
790+
"_id": "17df2116b51f0b3",
805791
"component": "MonocoClassInfo",
806792
"state": "collection",
807793
"action": "function collection(name) { var result = {}; if (this.metamodel()[name] === 'collection') { result = this.model()[name]; } return result; }",
808794
"core": true
809795
},
810-
"1ab30132991cab4": {
811-
"_id": "1ab30132991cab4",
796+
"1df271a1e318a3b": {
797+
"_id": "1df271a1e318a3b",
812798
"component": "MonocoClassInfo",
813799
"state": "collections",
814800
"action": "function collections() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'collection') { result.push(item); } } return result; }",
815801
"core": true
816802
},
817-
"1c84f107731ef6d": {
818-
"_id": "1c84f107731ef6d",
803+
"1ea7e1f248106a9": {
804+
"_id": "1ea7e1f248106a9",
819805
"component": "MonocoClassInfo",
820806
"state": "event",
821807
"action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }",
822808
"core": true
823809
},
824-
"1f5601dc211d3eb": {
825-
"_id": "1f5601dc211d3eb",
810+
"1a8971c412177d3": {
811+
"_id": "1a8971c412177d3",
826812
"component": "MonocoClassInfo",
827813
"state": "events",
828814
"action": "function events() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'event') { result.push(item); } } return result; }",
829815
"core": true
830816
},
831-
"1b66b106a115cde": {
832-
"_id": "1b66b106a115cde",
817+
"1229e111471468e": {
818+
"_id": "1229e111471468e",
833819
"component": "MonocoClassInfo",
834820
"state": "method",
835821
"action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }",
836822
"core": true
837823
},
838-
"1c3f71db7b17d3e": {
839-
"_id": "1c3f71db7b17d3e",
824+
"1229f14aeb199b2": {
825+
"_id": "1229f14aeb199b2",
840826
"component": "MonocoClassInfo",
841827
"state": "methods",
842828
"action": "function methods() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'method') { result.push(item); } } return result; }",
843829
"core": true
844830
},
845-
"1e3b01389b1af37": {
846-
"_id": "1e3b01389b1af37",
831+
"1af5512d0f16c92": {
832+
"_id": "1af5512d0f16c92",
847833
"component": "MonocoClassInfo",
848834
"state": "properties",
849835
"action": "function properties() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'property') { result.push(item); } } return result; }",
850836
"core": true
851837
},
852-
"1b49f1ba191a4d5": {
853-
"_id": "1b49f1ba191a4d5",
838+
"1ade21aee718702": {
839+
"_id": "1ade21aee718702",
854840
"component": "MonocoClassInfo",
855841
"state": "property",
856842
"action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }",
857843
"core": true
858844
},
859-
"1bb9816a8d1aebb": {
860-
"_id": "1bb9816a8d1aebb",
845+
"1e6861a86a17670": {
846+
"_id": "1e6861a86a17670",
861847
"component": "MonocoComponent",
862848
"state": "destroy",
863849
"action": "function destroy() { $component.destroy(this.id()); }",
864850
"core": true,
865851
"useCoreAPI": true
866852
},
867-
"12f90126481868b": {
868-
"_id": "12f90126481868b",
853+
"11f651094b15b2c": {
854+
"_id": "11f651094b15b2c",
869855
"component": "MonocoComponent",
870856
"state": "off",
871857
"action": "function off(state, behaviorId) { var args = [], i = 0, length = 0; length = arguments.length; for (i = 0; i < length - 7; i++) { args.push(arguments[i]); } if ($workflow.checkParams({\"component\": this, \"methodName\": \"off\", \"args\": args})) { if ($metamodel.isValidState(state, this.constructor.name)) {$behavior.remove({\"behaviorId\": behaviorId, \"componentId\": this.id(), \"state\": state}); } else { $helper.getMonoco().warning({ \"message\":\"invoke 'off' method of component '\" + this.id() + \"' with an invalid state '\" + state + \"'\"}); } } }",
872858
"core": true,
873859
"useCoreAPI": true
874860
},
875-
"192571b97a14607": {
876-
"_id": "192571b97a14607",
861+
"1c243149ce14f38": {
862+
"_id": "1c243149ce14f38",
877863
"component": "MonocoComponent",
878864
"state": "require",
879865
"action": "function require(id) { return $component.get(id); }",
880866
"core": true,
881867
"useCoreAPI": true
882868
},
883-
"1ad5e1d62414ffa": {
884-
"_id": "1ad5e1d62414ffa",
869+
"1a0cc197621b6f7": {
870+
"_id": "1a0cc197621b6f7",
885871
"component": "MonocoDatabase",
886872
"state": "collections",
887873
"action": "function collections() { var result = {}, collectionName = ''; for (collectionName in $db.store) { if ($db.store.hasOwnProperty(collectionName) && collectionName.indexOf('Monoco') !== 0) { result[collectionName] = $db[collectionName]; } } return result;}",
888874
"core": true,
889875
"useCoreAPI": true
890876
},
891-
"1df6f1885b125c7": {
892-
"_id": "1df6f1885b125c7",
877+
"1fecc1524f15ffa": {
878+
"_id": "1fecc1524f15ffa",
893879
"component": "MonocoDatabase",
894880
"state": "subsystem",
895881
"action": "function subsystem(params) { return $db.subsystem(params); }",
896882
"core": true,
897883
"useCoreAPI": true
898884
},
899-
"1a76c16e74134a2": {
900-
"_id": "1a76c16e74134a2",
885+
"1caad1e14f18071": {
886+
"_id": "1caad1e14f18071",
901887
"component": "MonocoDatabase",
902888
"state": "system",
903889
"action": "function system(system) { return $db.system(system); }",
904890
"core": true,
905891
"useCoreAPI": true
906892
},
907-
"1fe2e1201a1a6b9": {
908-
"_id": "1fe2e1201a1a6b9",
893+
"140a31d693124b8": {
894+
"_id": "140a31d693124b8",
909895
"component": "MonocoMetamodel",
910896
"state": "create",
911897
"action": "function create() { $metamodel.create(); }",
912898
"core": true,
913899
"useCoreAPI": true
914900
},
915-
"1840c18b0810ad9": {
916-
"_id": "1840c18b0810ad9",
901+
"12d8c120491875c": {
902+
"_id": "12d8c120491875c",
917903
"component": "MonocoMetamodel",
918904
"state": "schema",
919905
"action": "function schema(schema) { $metamodel.schema(schema); }",
920906
"core": true,
921907
"useCoreAPI": true
922908
},
923-
"171fd15ee3108cb": {
924-
"_id": "171fd15ee3108cb",
909+
"1d6dc193191e761": {
910+
"_id": "1d6dc193191e761",
925911
"component": "MonocoMetamodel",
926912
"state": "type",
927913
"action": "function type(type) { $metamodel.type(type); }",
928914
"core": true,
929915
"useCoreAPI": true
930916
},
931-
"1bc60102d31cb79": {
932-
"_id": "1bc60102d31cb79",
917+
"1bbc41c1c71d1c1": {
918+
"_id": "1bbc41c1c71d1c1",
933919
"component": "MonocoSystem",
934920
"state": "sync",
935921
"action": "function sync() { var system = JSON.parse($db.system()); this.schemas(system.schemas); this.types(system.types); this.behaviors(system.behaviors); this.components(system.components); }",

0 commit comments

Comments
 (0)