From 384667ece1f7989db1a2cedf516b12677b7c1a7e Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Fri, 16 Dec 2016 17:42:08 -0500 Subject: [PATCH] Added NOTICE.txt (#136) * Added NOTICE.txt * Add creators to intro sentence * Removed react-addons-pure-render-mixin from NOTICE.txt since it's part of react * Copied fbjs keymirror into utils * Renamed deepFreezeAndThrowOnMutation to deep_freeze * Fixed merge conflict --- NOTICE.txt | 537 ++++++++++++++++++ app/constants/navigation.js | 4 +- app/constants/storage.js | 4 +- app/constants/view.js | 4 +- package.json | 3 +- service/constants/channels.js | 4 +- service/constants/general.js | 4 +- service/constants/posts.js | 4 +- service/constants/preferences.js | 4 +- service/constants/teams.js | 4 +- service/constants/users.js | 4 +- service/store/configureStore.dev.js | 2 +- ...zeAndThrowOnMutation.js => deep_freeze.js} | 0 service/utils/key_mirror.js | 44 ++ 14 files changed, 601 insertions(+), 21 deletions(-) create mode 100644 NOTICE.txt rename service/utils/{deepFreezeAndThrowOnMutation.js => deep_freeze.js} (100%) create mode 100644 service/utils/key_mirror.js diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 000000000..2a9be1901 --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,537 @@ +Mattermost Mobile +© 2016 Mattermost, Inc. All Rights Reserved. See LICENSE.txt for license information. + +NOTICES: +-------- + +This document includes a list of open source components used in Mattermost Mobile, including those that have been modified. + +-------- + +This product contains a modified portion of 'fbjs', a collection of JavaScript utilities by Facebook, Inc. + +* HOMEPAGE: + * https://github.com/facebook/fbjs + +* LICENSE: + +BSD License + +For fbjs software + +Copyright (c) 2013-present, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## intl + +This product contains a modified portion of 'Intl.js', to bring long overdue localization methods to ECMAScript implementations by Andy Earnshaw. + +* HOMEPAGE: + * https://github.com/andyearnshaw/Intl.js + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2013 Andy Earnshaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +------------------------------------------------------------------------------ +Contents of the `locale-data` directory are a modified form of the Unicode CLDR +data found at http://www.unicode.org/cldr/data/. It comes with the following +license. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1991-2013 Unicode, Inc. All rights reserved. Distributed under +the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +the Unicode data files and any associated documentation (the "Data Files") or +Unicode software and any associated documentation (the "Software") to deal in +the Data Files or Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, and/or sell copies +of the Data Files or Software, and to permit persons to whom the Data Files or +Software are furnished to do so, provided that (a) the above copyright +notice(s) and this permission notice appear with all copies of the Data Files +or Software, (b) both the above copyright notice(s) and this permission notice +appear in associated documentation, and (c) there is clear notice in each +modified Data File or in the Software as well as in the documentation +associated with the Data File(s) or Software that the data or software has been +modified. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN +THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR +SOFTWARE. + +Except as contained in this notice, the name of a copyright holder shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +these Data Files or Software without prior written authorization of the +copyright holder. + +Unicode and the Unicode logo are trademarks of Unicode, Inc. in the United +States and other countries. All third party trademarks referenced herein are +the property of their respective owners. + +--- + +## isomorphic-fetch + +This product contains a modified portion of 'isomorphic-fetch', to provide the fetch function for node by Matt Andrews. + +* HOMEPAGE: + * https://github.com/matthew-andrews/isomorphic-fetch + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Matt Andrews + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## react + +This product contains a modified portion of 'react', a declarative, efficient, and +flexible JavaScript library for building user interfaces by Facebook, Inc. + +* HOMEPAGE: + * https://github.com/facebook/react + +* LICENSE: + +BSD License + +For React software + +Copyright (c) 2013-2015, Facebook, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## react-intl + +This product contains a modified portion of 'react-intl', a library that provides React components and an API to format dates, numbers, and string messages including pluralization by Yahoo Inc. + +* HOMEPAGE: + * https://github.com/yahoo/react-intl + +* LICENSE: + +Copyright 2014 Yahoo Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + * Neither the name of the Yahoo Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL YAHOO! INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## react-native + +This product contains a modified portion of 'react-native', a library for building native applications using Javascript and React by Facebook, Inc. + +* HOMEPAGE: + * https://github.com/facebook/react-native + +* LICENSE: + +BSD License + +For React Native software + +Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +--- + +## react-native-button + +This product contains a modified portion of 'react-native-button', a button for React apps by James Ide. + +* HOMEPAGE: + * https://github.com/ide/react-native-button + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 James Ide + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## react-native-drawer + +This product contains a modified portion of 'react-native-drawer', a drawer component for React Native by Zack Story. + +* HOMEPAGE: + * https://github.com/root-two/react-native-drawer + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015-present Zack Story + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- + +## react-native-keyboard-spacer + +This product contains a modified portion of 'react-native-keyboard-spacer', a keyboard spacer view for React Native by Andrew Hurst. + +* HOMEPAGE: + * https://github.com/Andr3wHur5t/react-native-keyboard-spacer + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Andrew Hurst + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## react-native-vector-icons + +This product contains a modified portion of 'react-native-vector-icons', a set of vector icons for use in React Native apps by Joel Arvidsson. + +* HOMEPAGE: + * https://github.com/oblador/react-native-vector-icons + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Joel Arvidsson + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## react-redux + +This product contains a modified portion of 'react-redux', a set of React bindings for Redux by Dan Abramov. + +* HOMEPAGE: + * https://github.com/reactjs/react-redux + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Dan Abramov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## redux + +This product contains a modified portion of 'redux', a predictable state container for JavaScript apps by Dan Abramov. + +* HOMEPAGE: + * https://github.com/reactjs/redux + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015-present Dan Abramov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## redux-batched-actions + +This product contains a modified portion of 'redux-batched-actions', a batching action creator and higher order reducer for Redux by Tim Shelburne. + +* HOMEPAGE: + * https://github.com/tshelburne/redux-batched-actions + +* LICENSE: + +MIT License + +Copyright (c) 2016 Tim Shelburne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +## redux-thunk + +This product contains a modified portion of 'redux-thunk', middleware to allow asynchronous actions in Redux by Dan Abramov. + +* HOMEPAGE: + * https://github.com/gaearon/redux-thunk + +* LICENSE: + +The MIT License (MIT) + +Copyright (c) 2015 Dan Abramov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- diff --git a/app/constants/navigation.js b/app/constants/navigation.js index 660a34548..0bbc7ec31 100644 --- a/app/constants/navigation.js +++ b/app/constants/navigation.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const NavigationTypes = keymirror({ +const NavigationTypes = keyMirror({ NAVIGATION_PUSH: null, NAVIGATION_POP: null, NAVIGATION_JUMP: null, diff --git a/app/constants/storage.js b/app/constants/storage.js index a3937ce92..9bbececb6 100644 --- a/app/constants/storage.js +++ b/app/constants/storage.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const StorageTypes = keymirror({ +const StorageTypes = keyMirror({ SAVE_TO_STORAGE: null, SAVE_TO_STORAGE_ERROR: null, LOAD_FROM_STORAGE: null, diff --git a/app/constants/view.js b/app/constants/view.js index b450fae19..bf1941991 100644 --- a/app/constants/view.js +++ b/app/constants/view.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const ViewTypes = keymirror({ +const ViewTypes = keyMirror({ SERVER_URL_CHANGED: null, LOGIN_ID_CHANGED: null, diff --git a/package.json b/package.json index 5d27086cf..753843248 100644 --- a/package.json +++ b/package.json @@ -3,10 +3,8 @@ "version": "0.0.1", "private": true, "dependencies": { - "babel-preset-es2015": "6.18.0", "intl": "1.2.5", "isomorphic-fetch": "2.2.1", - "keymirror": "0.1.1", "react": "15.3.2", "react-addons-pure-render-mixin": "15.3.2", "react-intl": "2.1.5", @@ -23,6 +21,7 @@ "devDependencies": { "babel-eslint": "7.0.0", "babel-plugin-resolver": "1.1.0", + "babel-preset-es2015": "6.18.0", "babel-preset-react-native": "1.9.0", "babel-register": "6.16.3", "deep-freeze": "0.0.1", diff --git a/service/constants/channels.js b/service/constants/channels.js index d538c8c83..01778e402 100644 --- a/service/constants/channels.js +++ b/service/constants/channels.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const ChannelTypes = keymirror({ +const ChannelTypes = keyMirror({ CHANNEL_REQUEST: null, CHANNEL_SUCCESS: null, CHANNEL_FAILURE: null, diff --git a/service/constants/general.js b/service/constants/general.js index e5efd3086..e60d1cec1 100644 --- a/service/constants/general.js +++ b/service/constants/general.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const GeneralTypes = keymirror({ +const GeneralTypes = keyMirror({ RECEIVED_APP_STATE: null, RECEIVED_APP_CREDENTIALS: null, REMOVED_APP_CREDENTIALS: null, diff --git a/service/constants/posts.js b/service/constants/posts.js index ea3851aaa..e8dcc832c 100644 --- a/service/constants/posts.js +++ b/service/constants/posts.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const PostsTypes = keymirror({ +const PostsTypes = keyMirror({ CREATE_POST_REQUEST: null, CREATE_POST_SUCCESS: null, CREATE_POST_FAILURE: null, diff --git a/service/constants/preferences.js b/service/constants/preferences.js index d5a95e12b..f99594597 100644 --- a/service/constants/preferences.js +++ b/service/constants/preferences.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -export default keymirror({ +export default keyMirror({ MY_PREFERENCES_REQUEST: null, MY_PREFERENCES_SUCCESS: null, MY_PREFERENCES_FAILURE: null, diff --git a/service/constants/teams.js b/service/constants/teams.js index 11eed7231..f9b0ca5ab 100644 --- a/service/constants/teams.js +++ b/service/constants/teams.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const TeamTypes = keymirror({ +const TeamTypes = keyMirror({ FETCH_TEAMS_REQUEST: null, FETCH_TEAMS_SUCCESS: null, FETCH_TEAMS_FAILURE: null, diff --git a/service/constants/users.js b/service/constants/users.js index 0de62d572..0bf8cbf0b 100644 --- a/service/constants/users.js +++ b/service/constants/users.js @@ -1,9 +1,9 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import keymirror from 'keymirror'; +import keyMirror from 'service/utils/key_mirror'; -const UserTypes = keymirror({ +const UserTypes = keyMirror({ LOGIN_REQUEST: null, LOGIN_SUCCESS: null, LOGIN_FAILURE: null, diff --git a/service/store/configureStore.dev.js b/service/store/configureStore.dev.js index 14bbe18f3..0df064ac4 100644 --- a/service/store/configureStore.dev.js +++ b/service/store/configureStore.dev.js @@ -7,7 +7,7 @@ import devTools from 'remote-redux-devtools'; import thunk from 'redux-thunk'; import serviceReducer from 'service/reducers'; -import deepFreezeAndThrowOnMutation from 'service/utils/deepFreezeAndThrowOnMutation'; +import deepFreezeAndThrowOnMutation from 'service/utils/deep_freeze'; export default function configureServiceStore(preloadedState, appReducer, getAppReducer) { const store = createStore( diff --git a/service/utils/deepFreezeAndThrowOnMutation.js b/service/utils/deep_freeze.js similarity index 100% rename from service/utils/deepFreezeAndThrowOnMutation.js rename to service/utils/deep_freeze.js diff --git a/service/utils/key_mirror.js b/service/utils/key_mirror.js new file mode 100644 index 000000000..4e3c1f9c9 --- /dev/null +++ b/service/utils/key_mirror.js @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2013-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ + +/** + * Constructs an enumeration with keys equal to their value. + * + * For example: + * + * var COLORS = keyMirror({blue: null, red: null}); + * var myColor = COLORS.blue; + * var isColorValid = !!COLORS[myColor]; + * + * The last line could not be performed if the values of the generated enum were + * not equal to their keys. + * + * Input: {key1: val1, key2: val2} + * Output: {key1: key1, key2: key2} + * + * @param {object} obj + * @return {object} + */ +export default function keyMirror(obj) { + if (!(obj instanceof Object && !Array.isArray(obj))) { + throw new Error('keyMirror(...): Argument must be an object.'); + } + + const ret = {}; + for (const key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + + ret[key] = key; + } + + return ret; +}