|
144 | 144 | "result": "boolean" |
145 | 145 | } |
146 | 146 | }, |
147 | | - "MonocoChannelEvent": { |
148 | | - "_id": "MonocoChannelEvent", |
149 | | - "_name": "MonocoChannelEvent", |
150 | | - "_schema": "MonocoChannelEventSchema", |
151 | | - "_inherit": [ |
152 | | - "MonocoComponent" |
153 | | - ], |
154 | | - "_core": true, |
155 | | - "name": { |
156 | | - "type": "string", |
157 | | - "readOnly": false, |
158 | | - "mandatory": true, |
159 | | - "default": "" |
160 | | - }, |
161 | | - "type": { |
162 | | - "type": "string", |
163 | | - "readOnly": false, |
164 | | - "mandatory": true, |
165 | | - "default": "" |
166 | | - } |
167 | | - }, |
168 | | - "MonocoChannelEventSchema": { |
169 | | - "_id": "MonocoChannelEventSchema", |
170 | | - "_name": "MonocoChannelEventSchema", |
171 | | - "_inherit": [ |
172 | | - "MonocoComponentSchema" |
173 | | - ], |
174 | | - "_core": true, |
175 | | - "name": "property", |
176 | | - "type": "property" |
177 | | - }, |
178 | 147 | "MonocoChannelSchema": { |
179 | 148 | "_id": "MonocoChannelSchema", |
180 | 149 | "_name": "MonocoChannelSchema", |
|
679 | 648 | }, |
680 | 649 | "from": { |
681 | 650 | "type": "string", |
682 | | - "mandatory": true |
| 651 | + "mandatory": false |
683 | 652 | }, |
684 | 653 | "data": { |
685 | 654 | "type": "object", |
|
768 | 737 | "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]; this.load(system.href, false); } } }", |
769 | 738 | "core": true |
770 | 739 | }, |
771 | | - "17191121311a9a3": { |
772 | | - "_id": "17191121311a9a3", |
| 740 | + "1c7ed181d8143d6": { |
| 741 | + "_id": "1c7ed181d8143d6", |
773 | 742 | "component": "Monoco", |
774 | 743 | "state": "error", |
775 | 744 | "action": "function error(data) { console.error('monoco: ' + data.message, data.error); }", |
776 | 745 | "core": true |
777 | 746 | }, |
778 | | - "12ee01122f1000f": { |
779 | | - "_id": "12ee01122f1000f", |
| 747 | + "151b21611113189": { |
| 748 | + "_id": "151b21611113189", |
780 | 749 | "component": "Monoco", |
781 | 750 | "state": "find", |
782 | 751 | "action": "function find(Class, query) { return $component.find(Class, query);}", |
783 | 752 | "core": true, |
784 | 753 | "useCoreAPI": true |
785 | 754 | }, |
786 | | - "1c8af1afa310ea9": { |
787 | | - "_id": "1c8af1afa310ea9", |
| 755 | + "13e60108ce18975": { |
| 756 | + "_id": "13e60108ce18975", |
788 | 757 | "component": "Monoco", |
789 | 758 | "state": "system", |
790 | 759 | "action": "function system(name) { var System = null, system = {}, result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = monoco.require('MonocoSystem'); system = new System(conf); } else { result = monoco.find('MonocoSystem', {'master': true}); if (result.length) { system = result[0]; } } return system; }", |
791 | 760 | "core": true |
792 | 761 | }, |
793 | | - "192581bed6169eb": { |
794 | | - "_id": "192581bed6169eb", |
| 762 | + "134a9123381129a": { |
| 763 | + "_id": "134a9123381129a", |
795 | 764 | "component": "Monoco", |
796 | 765 | "state": "warning", |
797 | 766 | "action": "function warning(message) { console.warn('monoco: ' + message); }", |
798 | 767 | "core": true |
799 | 768 | }, |
800 | | - "13897187c4115ab": { |
801 | | - "_id": "13897187c4115ab", |
| 769 | + "1d25a184391f0ce": { |
| 770 | + "_id": "1d25a184391f0ce", |
802 | 771 | "component": "MonocoChannel", |
803 | 772 | "state": "listen", |
804 | | - "action": "function listen(event, action) { $behavior.add('db', 'insert', function channel_insert(collectionName, document) { if (collectionName === 'MonocoMessage') { if (document.event === event) { action(document); } } }, true, true); }", |
| 773 | + "action": "function listen(event, action) { $channel.listen(event, action); }", |
805 | 774 | "core": true, |
806 | 775 | "useCoreAPI": true |
807 | 776 | }, |
808 | | - "139e610dbf1d372": { |
809 | | - "_id": "139e610dbf1d372", |
| 777 | + "14803180b012cf2": { |
| 778 | + "_id": "14803180b012cf2", |
810 | 779 | "component": "MonocoChannel", |
811 | 780 | "state": "send", |
812 | | - "action": "function send(message) {var messages = [], events = [], result = true; events = $db.MonocoChannelEvent.find({'name': message.event}); if (events.length && $metamodel.isValidType(message.data, events[0].type)) { messages = $db.MonocoMessage.insert({'from': message.from, 'event': message.event, 'data': message.data}); if (!messages.length) { result = false; } } else { result = false; $log.invalidChannelEvent(message.data, message.event, events[0].type); } return result;}", |
| 781 | + "action": "function send(message) { return $channel.send(message); }", |
813 | 782 | "core": true, |
814 | 783 | "useCoreAPI": true |
815 | 784 | }, |
816 | | - "1dc581addc1dd83": { |
817 | | - "_id": "1dc581addc1dd83", |
| 785 | + "1a8fb16c5912eec": { |
| 786 | + "_id": "1a8fb16c5912eec", |
818 | 787 | "component": "MonocoClassInfo", |
819 | 788 | "state": "event", |
820 | 789 | "action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }", |
821 | 790 | "core": true |
822 | 791 | }, |
823 | | - "1ddfc1846b161e7": { |
824 | | - "_id": "1ddfc1846b161e7", |
| 792 | + "147cc1bf3f13c84": { |
| 793 | + "_id": "147cc1bf3f13c84", |
825 | 794 | "component": "MonocoClassInfo", |
826 | 795 | "state": "events", |
827 | 796 | "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; }", |
828 | 797 | "core": true |
829 | 798 | }, |
830 | | - "1c7141a36f1ccf6": { |
831 | | - "_id": "1c7141a36f1ccf6", |
| 799 | + "1fb0f1b2921db7b": { |
| 800 | + "_id": "1fb0f1b2921db7b", |
832 | 801 | "component": "MonocoClassInfo", |
833 | 802 | "state": "method", |
834 | 803 | "action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }", |
835 | 804 | "core": true |
836 | 805 | }, |
837 | | - "12d1a1687b1b5b8": { |
838 | | - "_id": "12d1a1687b1b5b8", |
| 806 | + "105f619be61bd34": { |
| 807 | + "_id": "105f619be61bd34", |
839 | 808 | "component": "MonocoClassInfo", |
840 | 809 | "state": "methods", |
841 | 810 | "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; }", |
842 | 811 | "core": true |
843 | 812 | }, |
844 | | - "1df401828d10f7a": { |
845 | | - "_id": "1df401828d10f7a", |
| 813 | + "1b655199ad147cb": { |
| 814 | + "_id": "1b655199ad147cb", |
846 | 815 | "component": "MonocoClassInfo", |
847 | 816 | "state": "properties", |
848 | 817 | "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; }", |
849 | 818 | "core": true |
850 | 819 | }, |
851 | | - "113561d8b01481a": { |
852 | | - "_id": "113561d8b01481a", |
| 820 | + "1a77b1860619237": { |
| 821 | + "_id": "1a77b1860619237", |
853 | 822 | "component": "MonocoClassInfo", |
854 | 823 | "state": "property", |
855 | 824 | "action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }", |
856 | 825 | "core": true |
857 | 826 | }, |
858 | | - "1e3ad199d617b96": { |
859 | | - "_id": "1e3ad199d617b96", |
| 827 | + "1e2261cd081fc04": { |
| 828 | + "_id": "1e2261cd081fc04", |
860 | 829 | "component": "MonocoComponent", |
861 | 830 | "state": "destroy", |
862 | 831 | "action": "function destroy() { $component.destroy(this.id()); }", |
863 | 832 | "core": true, |
864 | 833 | "useCoreAPI": true |
865 | 834 | }, |
866 | | - "1eda9107201c9b9": { |
867 | | - "_id": "1eda9107201c9b9", |
| 835 | + "1dd271944b11a7b": { |
| 836 | + "_id": "1dd271944b11a7b", |
868 | 837 | "component": "MonocoComponent", |
869 | 838 | "state": "off", |
870 | | - "action": "function off(state, behaviorId) { var args = [], i = 0, length = 0; length = arguments.length; for (i = 0; i < length - 6; 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(\"invoke 'off' method of component '\" + this.id() + \"' with an invalid state '\" + state + \"'\"); } } }", |
| 839 | + "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 + \"'\"}); } } }", |
871 | 840 | "core": true, |
872 | 841 | "useCoreAPI": true |
873 | 842 | }, |
874 | | - "1b8b61591115818": { |
875 | | - "_id": "1b8b61591115818", |
| 843 | + "1e3e214e06163b0": { |
| 844 | + "_id": "1e3e214e06163b0", |
876 | 845 | "component": "MonocoComponent", |
877 | 846 | "state": "require", |
878 | 847 | "action": "function require(id) { return $component.get(id); }", |
879 | 848 | "core": true, |
880 | 849 | "useCoreAPI": true |
881 | 850 | }, |
882 | | - "1f3c917ce81c7e8": { |
883 | | - "_id": "1f3c917ce81c7e8", |
| 851 | + "183781de2013941": { |
| 852 | + "_id": "183781de2013941", |
884 | 853 | "component": "MonocoDatabase", |
885 | 854 | "state": "subsystem", |
886 | 855 | "action": "function subsystem(params) { return $db.subsystem(params); }", |
887 | 856 | "core": true, |
888 | 857 | "useCoreAPI": true |
889 | 858 | }, |
890 | | - "17fe816d6d1e287": { |
891 | | - "_id": "17fe816d6d1e287", |
| 859 | + "10e951c5bd1e93e": { |
| 860 | + "_id": "10e951c5bd1e93e", |
892 | 861 | "component": "MonocoDatabase", |
893 | 862 | "state": "system", |
894 | 863 | "action": "function system(system) { return $db.system(system); }", |
895 | 864 | "core": true, |
896 | 865 | "useCoreAPI": true |
897 | 866 | }, |
898 | | - "1bcb0137b51715a": { |
899 | | - "_id": "1bcb0137b51715a", |
| 867 | + "10fcd19bcc1d955": { |
| 868 | + "_id": "10fcd19bcc1d955", |
900 | 869 | "component": "MonocoMetamodel", |
901 | 870 | "state": "create", |
902 | 871 | "action": "function create() { $metamodel.create(); }", |
903 | 872 | "core": true, |
904 | 873 | "useCoreAPI": true |
905 | 874 | }, |
906 | | - "13bbb1da2e1c444": { |
907 | | - "_id": "13bbb1da2e1c444", |
| 875 | + "181841b92c13d7d": { |
| 876 | + "_id": "181841b92c13d7d", |
908 | 877 | "component": "MonocoMetamodel", |
909 | 878 | "state": "schema", |
910 | 879 | "action": "function schema(schema) { $metamodel.schema(schema); }", |
911 | 880 | "core": true, |
912 | 881 | "useCoreAPI": true |
913 | 882 | }, |
914 | | - "1bcc71aad813af7": { |
915 | | - "_id": "1bcc71aad813af7", |
| 883 | + "119251ed051b49e": { |
| 884 | + "_id": "119251ed051b49e", |
916 | 885 | "component": "MonocoMetamodel", |
917 | 886 | "state": "type", |
918 | 887 | "action": "function type(type) { $metamodel.type(type); }", |
919 | 888 | "core": true, |
920 | 889 | "useCoreAPI": true |
921 | 890 | }, |
922 | | - "19d281ed3818ea8": { |
923 | | - "_id": "19d281ed3818ea8", |
| 891 | + "1870c15bc812a9c": { |
| 892 | + "_id": "1870c15bc812a9c", |
924 | 893 | "component": "MonocoSystem", |
925 | 894 | "state": "sync", |
926 | 895 | "action": "function sync() { var dump = $db.dump(); this.schemas(dump.schemas); this.types(dump.types); this.behaviors(dump.behaviors); this.components(dump.components); }", |
927 | 896 | "core": true, |
928 | 897 | "useCoreAPI": true |
929 | 898 | }, |
930 | | - "1441c144dd14dc2": { |
931 | | - "_id": "1441c144dd14dc2", |
| 899 | + "13b5210e6e1fe8f": { |
| 900 | + "_id": "13b5210e6e1fe8f", |
932 | 901 | "component": "e89c617b6b15d24", |
933 | 902 | "state": "main", |
934 | 903 | "action": "function main() { var monoco = $component.get('monoco'); monoco.ready(); }", |
|
0 commit comments