Skip to content

Commit af9679d

Browse files
author
Erwan Carriou
committed
- fix error on unit test,
- add validation of 'action' signature when invoking 'on' method and - fix error when invoking action that uses monoco core APIs (useCoreApi = true on 'on' method)
1 parent 998bf60 commit af9679d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+905
-395
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "A Model and a NoSQL Database for Componentsk",
55
"license": "GPLv3",
66
"homepage": "https://github.com/monocojs/monoco.git",

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: 159 additions & 62 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.json

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.5.1",
3+
"version": "0.5.2",
44
"description": "A Model and a NoSQL Database for Components",
55
"_id": "e89c617b6b15d24",
66
"schemas": {
@@ -773,181 +773,181 @@
773773
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; if (system.getAttribute('async') === 'true') { this.load(system.href, true); } else { this.load(system.href, false); } } }}",
774774
"core": true
775775
},
776-
"1ab6c1120813cd4": {
777-
"_id": "1ab6c1120813cd4",
776+
"165d7138981b5fd": {
777+
"_id": "165d7138981b5fd",
778778
"component": "Monoco",
779779
"state": "error",
780780
"action": "function error(data) { console.error('monoco: ' + data.message, data.error); }",
781781
"core": true
782782
},
783-
"1dd5b12d7018528": {
784-
"_id": "1dd5b12d7018528",
783+
"12fa41bbe21ebea": {
784+
"_id": "12fa41bbe21ebea",
785785
"component": "Monoco",
786786
"state": "find",
787787
"action": "function find(Class, query) { return $component.find(Class, query);}",
788788
"core": true,
789789
"useCoreAPI": true
790790
},
791-
"198d3192131c8cf": {
792-
"_id": "198d3192131c8cf",
791+
"17e0c1585319f98": {
792+
"_id": "17e0c1585319f98",
793793
"component": "Monoco",
794794
"state": "system",
795795
"action": "function system(name) { var System = null, system = {}, result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = this.require('MonocoSystem'); system = new System(conf); } else { result = this.find('MonocoSystem', {'master': true}); if (result.length) { system = result[0]; } } return system; }",
796796
"core": true
797797
},
798-
"1a82914e86119a9": {
799-
"_id": "1a82914e86119a9",
798+
"1b9381e2b71dbfb": {
799+
"_id": "1b9381e2b71dbfb",
800800
"component": "Monoco",
801801
"state": "warning",
802802
"action": "function warning(message) { console.warn('monoco: ' + message); }",
803803
"core": true
804804
},
805-
"1adee1f0551d3b3": {
806-
"_id": "1adee1f0551d3b3",
805+
"13651149071abcc": {
806+
"_id": "13651149071abcc",
807807
"component": "MonocoChannel",
808808
"state": "listen",
809809
"action": "function listen(event, action) { $channel.listen(event, action); }",
810810
"core": true,
811811
"useCoreAPI": true
812812
},
813-
"11ed51fcbc1efd4": {
814-
"_id": "11ed51fcbc1efd4",
813+
"1c0a81c78e13485": {
814+
"_id": "1c0a81c78e13485",
815815
"component": "MonocoChannel",
816816
"state": "send",
817817
"action": "function send(message) { return $channel.send(message); }",
818818
"core": true,
819819
"useCoreAPI": true
820820
},
821-
"1f1cb12dc915b94": {
822-
"_id": "1f1cb12dc915b94",
821+
"101091f20e19997": {
822+
"_id": "101091f20e19997",
823823
"component": "MonocoClassInfo",
824824
"state": "collection",
825825
"action": "function collection(name) { var result = {}; if (this.metamodel()[name] === 'collection') { result = this.model()[name]; } return result; }",
826826
"core": true
827827
},
828-
"1cbd813e6017b36": {
829-
"_id": "1cbd813e6017b36",
828+
"156b41f10715cd3": {
829+
"_id": "156b41f10715cd3",
830830
"component": "MonocoClassInfo",
831831
"state": "collections",
832832
"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; }",
833833
"core": true
834834
},
835-
"1bada164f41208d": {
836-
"_id": "1bada164f41208d",
835+
"1f42716da8168bb": {
836+
"_id": "1f42716da8168bb",
837837
"component": "MonocoClassInfo",
838838
"state": "event",
839839
"action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }",
840840
"core": true
841841
},
842-
"18c93111c61cd38": {
843-
"_id": "18c93111c61cd38",
842+
"1aa6e132e11ddc6": {
843+
"_id": "1aa6e132e11ddc6",
844844
"component": "MonocoClassInfo",
845845
"state": "events",
846846
"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; }",
847847
"core": true
848848
},
849-
"14f2c16ce419477": {
850-
"_id": "14f2c16ce419477",
849+
"10035104eb10a1a": {
850+
"_id": "10035104eb10a1a",
851851
"component": "MonocoClassInfo",
852852
"state": "method",
853853
"action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }",
854854
"core": true
855855
},
856-
"16073199f8139dc": {
857-
"_id": "16073199f8139dc",
856+
"10b391126a1634b": {
857+
"_id": "10b391126a1634b",
858858
"component": "MonocoClassInfo",
859859
"state": "methods",
860860
"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; }",
861861
"core": true
862862
},
863-
"11b4a1ed2c11947": {
864-
"_id": "11b4a1ed2c11947",
863+
"1718d13d1c10b45": {
864+
"_id": "1718d13d1c10b45",
865865
"component": "MonocoClassInfo",
866866
"state": "properties",
867867
"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; }",
868868
"core": true
869869
},
870-
"18708169141823a": {
871-
"_id": "18708169141823a",
870+
"1792f1f6f3118dc": {
871+
"_id": "1792f1f6f3118dc",
872872
"component": "MonocoClassInfo",
873873
"state": "property",
874874
"action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }",
875875
"core": true
876876
},
877-
"18b46153d51fd8a": {
878-
"_id": "18b46153d51fd8a",
877+
"1b437190c51afe4": {
878+
"_id": "1b437190c51afe4",
879879
"component": "MonocoComponent",
880880
"state": "destroy",
881881
"action": "function destroy() { $component.destroy(this.id()); }",
882882
"core": true,
883883
"useCoreAPI": true
884884
},
885-
"16ea9113ba12e55": {
886-
"_id": "16ea9113ba12e55",
885+
"109c116a2c17164": {
886+
"_id": "109c116a2c17164",
887887
"component": "MonocoComponent",
888888
"state": "off",
889889
"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 + \"'\"}); } } }",
890890
"core": true,
891891
"useCoreAPI": true
892892
},
893-
"126b51ea801654a": {
894-
"_id": "126b51ea801654a",
893+
"1d07e1115b10a9d": {
894+
"_id": "1d07e1115b10a9d",
895895
"component": "MonocoComponent",
896896
"state": "require",
897897
"action": "function require(id) { return $component.get(id); }",
898898
"core": true,
899899
"useCoreAPI": true
900900
},
901-
"1286c1612a1822f": {
902-
"_id": "1286c1612a1822f",
901+
"195541e3c9137cb": {
902+
"_id": "195541e3c9137cb",
903903
"component": "MonocoDatabase",
904904
"state": "subsystem",
905905
"action": "function subsystem(params) { return $db.subsystem(params); }",
906906
"core": true,
907907
"useCoreAPI": true
908908
},
909-
"177e615c721c6a0": {
910-
"_id": "177e615c721c6a0",
909+
"1b06e16b3c176ed": {
910+
"_id": "1b06e16b3c176ed",
911911
"component": "MonocoDatabase",
912912
"state": "system",
913913
"action": "function system(system) { return $db.system(system); }",
914914
"core": true,
915915
"useCoreAPI": true
916916
},
917-
"1bc661e40718c2e": {
918-
"_id": "1bc661e40718c2e",
917+
"1e8b31f1fb18dfc": {
918+
"_id": "1e8b31f1fb18dfc",
919919
"component": "MonocoMetamodel",
920920
"state": "create",
921921
"action": "function create() { $metamodel.create(); }",
922922
"core": true,
923923
"useCoreAPI": true
924924
},
925-
"11f02174d81367d": {
926-
"_id": "11f02174d81367d",
925+
"1f3f41430a170cf": {
926+
"_id": "1f3f41430a170cf",
927927
"component": "MonocoMetamodel",
928928
"state": "schema",
929929
"action": "function schema(schema) { $metamodel.schema(schema); }",
930930
"core": true,
931931
"useCoreAPI": true
932932
},
933-
"170f11b18216fbf": {
934-
"_id": "170f11b18216fbf",
933+
"13a201059413949": {
934+
"_id": "13a201059413949",
935935
"component": "MonocoMetamodel",
936936
"state": "type",
937937
"action": "function type(type) { $metamodel.type(type); }",
938938
"core": true,
939939
"useCoreAPI": true
940940
},
941-
"181dd19ee51dbfa": {
942-
"_id": "181dd19ee51dbfa",
941+
"1f53713acf1f5ce": {
942+
"_id": "1f53713acf1f5ce",
943943
"component": "MonocoSystem",
944944
"state": "sync",
945945
"action": "function sync() { var dump = $db.dump(); this.schemas(dump.schemas); this.types(dump.types); this.behaviors(dump.behaviors); this.components(dump.components); }",
946946
"core": true,
947947
"useCoreAPI": true
948948
},
949-
"1dc0718cfc18cd5": {
950-
"_id": "1dc0718cfc18cd5",
949+
"1557318a1c1306f": {
950+
"_id": "1557318a1c1306f",
951951
"component": "e89c617b6b15d24",
952952
"state": "main",
953953
"action": "function main() { var monoco = $component.get('monoco'); monoco.ready(); }",
@@ -959,7 +959,7 @@
959959
"Monoco": {
960960
"monoco": {
961961
"_id": "monoco",
962-
"version": "0.5.1"
962+
"version": "0.5.2"
963963
}
964964
},
965965
"MonocoChannel": {

0 commit comments

Comments
 (0)