|
1 | 1 | { |
2 | 2 | "name": "monoco", |
3 | | - "version": "0.7.1", |
| 3 | + "version": "0.7.2", |
4 | 4 | "description": "A Model and a NoSQL Database for Components", |
5 | 5 | "_id": "e89c617b6b15d24", |
6 | 6 | "schemas": { |
|
352 | 352 | ], |
353 | 353 | "result": "string" |
354 | 354 | }, |
| 355 | + "collections": { |
| 356 | + "result": "object" |
| 357 | + }, |
355 | 358 | "insert": { |
356 | 359 | "params": [ |
357 | 360 | { |
|
406 | 409 | "_core": true, |
407 | 410 | "system": "method", |
408 | 411 | "subsystem": "method", |
| 412 | + "collections": "method", |
409 | 413 | "insert": "event", |
410 | 414 | "update": "event", |
411 | 415 | "remove": "event" |
|
751 | 755 | "_id": "1aaee1e6311ff39", |
752 | 756 | "component": "monoco", |
753 | 757 | "state": "load", |
754 | | - "action": "function load(url, async) { var xhr = null, callbackLoad = null; xhr = new XMLHttpRequest(); callbackLoad = function callbackLoad(system) { var sysId = $db.system(system), sys = $component.get(sysId), systems = document.querySelectorAll('link[rel=system]'), nbSubsystem = $db.MonocoSystem.find({ 'subsystem': true }); if (sys) { sys.main(); } if (systems.length + 1 + nbSubsystem.length === $db.MonocoSystem.count()) { $component.get('monoco').ready(); } }; if (async) { xhr.open('GET', url, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { callbackLoad(JSON.parse(xhr.response)); } } }; xhr.send(null); } else { xhr.open('GET', url, false); xhr.send(null); if (xhr.status === 200) { callbackLoad(JSON.parse(xhr.response)); } }}", |
| 758 | + "action": "function load(url, async) { var xhr = null, callbackLoad = null; xhr = new XMLHttpRequest(); callbackLoad = function callbackLoad(system) { var sysId = $db.system(system), sys = $component.get(sysId), systems = document.querySelectorAll('link[rel=system]'), nbSubsystem = $db.MonocoSystem.find({ 'subsystem': true }); if (sys) { sys.main(); } if (systems.length + 1 + nbSubsystem.length === $db.MonocoSystem.count()) { $component.get('monoco').ready(); } }; if (async) { xhr.open('GET', url, true); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { callbackLoad(JSON.parse(xhr.response)); } } }; xhr.send(null); } else { xhr.open('GET', url, false); xhr.send(null); if (xhr.status === 200) { callbackLoad(JSON.parse(xhr.response)); } }}", |
755 | 759 | "core": true, |
756 | 760 | "useCoreAPI": true |
757 | 761 | }, |
758 | 762 | "1f6001773a18791": { |
759 | 763 | "_id": "1f6001773a18791", |
760 | 764 | "component": "e89c617b6b15d24", |
761 | 765 | "state": "main", |
762 | | - "action": "function main() { var subsystems = [], systems = [], system = null, i = 0, length = 0; subsystems = $db.MonocoSystem.find({ 'subsystem': true }); subsystems.forEach(function (subsystem) { var subsystemId = subsystem._id; this.require(subsystemId).main(); }, this); 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') === 'false') { this.require('monoco').load(system.href, false); } else { this.require('monoco').load(system.href, true); } } if (length === 0) { this.require('monoco').ready(); } }}", |
763 | | - "core": true |
| 766 | + "action": "function main() { var subsystems = [], systems = [], system = null, i = 0, length = 0; subsystems = $db.MonocoSystem.find({ 'subsystem': true }); subsystems.forEach(function (subsystem) { var subsystemId = subsystem._id; this.require(subsystemId).main(); }, this); 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') === 'false') { this.require('monoco').load(system.href, false); } else { this.require('monoco').load(system.href, true); } } if (length === 0) { this.require('monoco').ready(); } }}", |
| 767 | + "core": true, |
| 768 | + "useCoreAPI": true |
764 | 769 | }, |
765 | | - "1882e182f0152e8": { |
766 | | - "_id": "1882e182f0152e8", |
| 770 | + "1302e13eed1a03c": { |
| 771 | + "_id": "1302e13eed1a03c", |
767 | 772 | "component": "Monoco", |
768 | 773 | "state": "error", |
769 | 774 | "action": "function error(data) { console.error('monoco: ' + data.message, data.error); }", |
770 | 775 | "core": true |
771 | 776 | }, |
772 | | - "1e66a1cb471f725": { |
773 | | - "_id": "1e66a1cb471f725", |
| 777 | + "16c471e4941c644": { |
| 778 | + "_id": "16c471e4941c644", |
774 | 779 | "component": "Monoco", |
775 | 780 | "state": "system", |
776 | 781 | "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;}", |
777 | 782 | "core": true, |
778 | 783 | "useCoreAPI": true |
779 | 784 | }, |
780 | | - "120b21065b1ae99": { |
781 | | - "_id": "120b21065b1ae99", |
| 785 | + "13b7f1fb671e39d": { |
| 786 | + "_id": "13b7f1fb671e39d", |
782 | 787 | "component": "Monoco", |
783 | 788 | "state": "warning", |
784 | 789 | "action": "function warning(message) { console.warn('monoco: ' + message); }", |
785 | 790 | "core": true |
786 | 791 | }, |
787 | | - "198be1c2ac1a1c2": { |
788 | | - "_id": "198be1c2ac1a1c2", |
| 792 | + "10f95179ec1aac4": { |
| 793 | + "_id": "10f95179ec1aac4", |
789 | 794 | "component": "MonocoChannel", |
790 | 795 | "state": "listen", |
791 | 796 | "action": "function listen(event, action) { $channel.listen(event, action); }", |
792 | 797 | "core": true, |
793 | 798 | "useCoreAPI": true |
794 | 799 | }, |
795 | | - "14ec91c6431ca5a": { |
796 | | - "_id": "14ec91c6431ca5a", |
| 800 | + "132421889f1eb42": { |
| 801 | + "_id": "132421889f1eb42", |
797 | 802 | "component": "MonocoChannel", |
798 | 803 | "state": "send", |
799 | 804 | "action": "function send(message) { return $channel.send(message); }", |
800 | 805 | "core": true, |
801 | 806 | "useCoreAPI": true |
802 | 807 | }, |
803 | | - "1d96117d2c1de48": { |
804 | | - "_id": "1d96117d2c1de48", |
| 808 | + "198191d211179d9": { |
| 809 | + "_id": "198191d211179d9", |
805 | 810 | "component": "MonocoClassInfo", |
806 | 811 | "state": "collection", |
807 | 812 | "action": "function collection(name) { var result = {}; if (this.metamodel()[name] === 'collection') { result = this.model()[name]; } return result; }", |
808 | 813 | "core": true |
809 | 814 | }, |
810 | | - "1542e1e5681dbe0": { |
811 | | - "_id": "1542e1e5681dbe0", |
| 815 | + "194cb1cfe412ae0": { |
| 816 | + "_id": "194cb1cfe412ae0", |
812 | 817 | "component": "MonocoClassInfo", |
813 | 818 | "state": "collections", |
814 | 819 | "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; }", |
815 | 820 | "core": true |
816 | 821 | }, |
817 | | - "1afd6137641e9eb": { |
818 | | - "_id": "1afd6137641e9eb", |
| 822 | + "198d71966b1d628": { |
| 823 | + "_id": "198d71966b1d628", |
819 | 824 | "component": "MonocoClassInfo", |
820 | 825 | "state": "event", |
821 | 826 | "action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }", |
822 | 827 | "core": true |
823 | 828 | }, |
824 | | - "1de7c1f23416fbc": { |
825 | | - "_id": "1de7c1f23416fbc", |
| 829 | + "167181f3ce19fcc": { |
| 830 | + "_id": "167181f3ce19fcc", |
826 | 831 | "component": "MonocoClassInfo", |
827 | 832 | "state": "events", |
828 | 833 | "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; }", |
829 | 834 | "core": true |
830 | 835 | }, |
831 | | - "1bdc41626b12c74": { |
832 | | - "_id": "1bdc41626b12c74", |
| 836 | + "164461951412489": { |
| 837 | + "_id": "164461951412489", |
833 | 838 | "component": "MonocoClassInfo", |
834 | 839 | "state": "method", |
835 | 840 | "action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }", |
836 | 841 | "core": true |
837 | 842 | }, |
838 | | - "11f651f4aa1e32a": { |
839 | | - "_id": "11f651f4aa1e32a", |
| 843 | + "1007a10e6a1dc4c": { |
| 844 | + "_id": "1007a10e6a1dc4c", |
840 | 845 | "component": "MonocoClassInfo", |
841 | 846 | "state": "methods", |
842 | 847 | "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; }", |
843 | 848 | "core": true |
844 | 849 | }, |
845 | | - "1fd2114fd71280b": { |
846 | | - "_id": "1fd2114fd71280b", |
| 850 | + "190d01cc3c12f1c": { |
| 851 | + "_id": "190d01cc3c12f1c", |
847 | 852 | "component": "MonocoClassInfo", |
848 | 853 | "state": "properties", |
849 | 854 | "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; }", |
850 | 855 | "core": true |
851 | 856 | }, |
852 | | - "14f6e1a5d81d4fd": { |
853 | | - "_id": "14f6e1a5d81d4fd", |
| 857 | + "1d68e1baf01a0c2": { |
| 858 | + "_id": "1d68e1baf01a0c2", |
854 | 859 | "component": "MonocoClassInfo", |
855 | 860 | "state": "property", |
856 | 861 | "action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }", |
857 | 862 | "core": true |
858 | 863 | }, |
859 | | - "10d1a1683d16dc4": { |
860 | | - "_id": "10d1a1683d16dc4", |
| 864 | + "1eba111bd3151a6": { |
| 865 | + "_id": "1eba111bd3151a6", |
861 | 866 | "component": "MonocoComponent", |
862 | 867 | "state": "destroy", |
863 | 868 | "action": "function destroy() { $component.destroy(this.id()); }", |
864 | 869 | "core": true, |
865 | 870 | "useCoreAPI": true |
866 | 871 | }, |
867 | | - "1105419a6f1519c": { |
868 | | - "_id": "1105419a6f1519c", |
| 872 | + "101a814f6c10c62": { |
| 873 | + "_id": "101a814f6c10c62", |
869 | 874 | "component": "MonocoComponent", |
870 | 875 | "state": "off", |
871 | 876 | "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 + \"'\"}); } } }", |
872 | 877 | "core": true, |
873 | 878 | "useCoreAPI": true |
874 | 879 | }, |
875 | | - "15b2b18f0c1a0f7": { |
876 | | - "_id": "15b2b18f0c1a0f7", |
| 880 | + "1f5471a45a1807d": { |
| 881 | + "_id": "1f5471a45a1807d", |
877 | 882 | "component": "MonocoComponent", |
878 | 883 | "state": "require", |
879 | 884 | "action": "function require(id) { return $component.get(id); }", |
880 | 885 | "core": true, |
881 | 886 | "useCoreAPI": true |
882 | 887 | }, |
883 | | - "1a6791cfba179e4": { |
884 | | - "_id": "1a6791cfba179e4", |
| 888 | + "1883010e0314a1c": { |
| 889 | + "_id": "1883010e0314a1c", |
| 890 | + "component": "MonocoDatabase", |
| 891 | + "state": "collections", |
| 892 | + "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;}", |
| 893 | + "core": true, |
| 894 | + "useCoreAPI": true |
| 895 | + }, |
| 896 | + "1dc8413ead1f809": { |
| 897 | + "_id": "1dc8413ead1f809", |
885 | 898 | "component": "MonocoDatabase", |
886 | 899 | "state": "subsystem", |
887 | 900 | "action": "function subsystem(params) { return $db.subsystem(params); }", |
888 | 901 | "core": true, |
889 | 902 | "useCoreAPI": true |
890 | 903 | }, |
891 | | - "1a54f1adeb14122": { |
892 | | - "_id": "1a54f1adeb14122", |
| 904 | + "18be21f3ca18c8a": { |
| 905 | + "_id": "18be21f3ca18c8a", |
893 | 906 | "component": "MonocoDatabase", |
894 | 907 | "state": "system", |
895 | 908 | "action": "function system(system) { return $db.system(system); }", |
896 | 909 | "core": true, |
897 | 910 | "useCoreAPI": true |
898 | 911 | }, |
899 | | - "14c601a2891aa34": { |
900 | | - "_id": "14c601a2891aa34", |
| 912 | + "1ca4315f921ecb7": { |
| 913 | + "_id": "1ca4315f921ecb7", |
901 | 914 | "component": "MonocoMetamodel", |
902 | 915 | "state": "create", |
903 | 916 | "action": "function create() { $metamodel.create(); }", |
904 | 917 | "core": true, |
905 | 918 | "useCoreAPI": true |
906 | 919 | }, |
907 | | - "1170514b5a18985": { |
908 | | - "_id": "1170514b5a18985", |
| 920 | + "18cfc1917c1ab4b": { |
| 921 | + "_id": "18cfc1917c1ab4b", |
909 | 922 | "component": "MonocoMetamodel", |
910 | 923 | "state": "schema", |
911 | 924 | "action": "function schema(schema) { $metamodel.schema(schema); }", |
912 | 925 | "core": true, |
913 | 926 | "useCoreAPI": true |
914 | 927 | }, |
915 | | - "113671115f1f368": { |
916 | | - "_id": "113671115f1f368", |
| 928 | + "1dcfb187dd1035a": { |
| 929 | + "_id": "1dcfb187dd1035a", |
917 | 930 | "component": "MonocoMetamodel", |
918 | 931 | "state": "type", |
919 | 932 | "action": "function type(type) { $metamodel.type(type); }", |
920 | 933 | "core": true, |
921 | 934 | "useCoreAPI": true |
922 | 935 | }, |
923 | | - "1173f18bbd16418": { |
924 | | - "_id": "1173f18bbd16418", |
| 936 | + "160fc1a46b11495": { |
| 937 | + "_id": "160fc1a46b11495", |
925 | 938 | "component": "MonocoSystem", |
926 | 939 | "state": "sync", |
927 | 940 | "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); }", |
|
933 | 946 | "Monoco": { |
934 | 947 | "monoco": { |
935 | 948 | "_id": "monoco", |
936 | | - "version": "0.7.1" |
| 949 | + "version": "0.7.2" |
937 | 950 | } |
938 | 951 | }, |
939 | 952 | "MonocoChannel": { |
|
0 commit comments