├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── package.json ├── bower.json ├── README.md ├── src └── Flow │ ├── UI.purs │ └── Api.purs ├── test ├── UIExample.purs └── ApiExample.purs └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | /bower_components/ 2 | /node_modules/ 3 | /.pulp-cache/ 4 | /output/ 5 | /generated-docs/ 6 | /.psc* 7 | /.purs* 8 | /.psa* 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | dist: trusty 3 | sudo: required 4 | node_js: stable 5 | install: 6 | - npm install -g bower purescript pulp 7 | - npm install 8 | - bower install --production 9 | script: 10 | - npm run -s clean 11 | - npm run -s build 12 | after_success: 13 | - >- 14 | echo $TRAVIS_TAG 15 | echo $GITHUB_TOKEN 16 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributing 2 | 3 | 0. Fork () 4 | 1. Create feature branch (`git checkout -b feature/foo-bar`) 5 | 2. For code styling, follow [purescript-style-guide](https://github.com/ianbollinger/purescript-style-guide/blob/master/purescript-style.md). 6 | 3. Commit your changes (`git commit -am 'Add some foo bar'`) 7 | 4. Push to the branch (`git push origin feature/foo-bar`) 8 | 5. Create a new Pull Request 9 | 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-flow", 3 | "version": "0.0.2", 4 | "description": "Typesafe UI and API Flows for Mobile and Web Apps.", 5 | "main": "index.js", 6 | "scripts": { 7 | "clean": "rm -rf output && rm -rf .pulp-cache", 8 | "build": "pulp build", 9 | "test": "pulp test" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://bitbucket.org/juspay/purescript-flow.git" 14 | }, 15 | "author": "JUSPAY Technologies Pvt. Ltd. ", 16 | "license": "AGPL", 17 | "homepage": "https://www.juspay.in", 18 | "devDependencies": { 19 | "pulp": "^11.0.0", 20 | "purescript": "^0.11.4" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "purescript-flow", 3 | "version": "0.0.1", 4 | "description": "Typesafe UI and API Flows for Mobile and Web Apps.", 5 | "license": "AGPL", 6 | "private": false, 7 | "ignore": [ 8 | "**/.*", 9 | "node_modules", 10 | "bower_components", 11 | "output" 12 | ], 13 | "dependencies": { 14 | "purescript-prelude": "^3.0.0", 15 | "purescript-console": "^3.0.0", 16 | "purescript-foreign-generic": "^4.1.0", 17 | "purescript-generics": "^4.0.0", 18 | "purescript-aff": "^3.1.0" 19 | }, 20 | "devDependencies": { 21 | "purescript-psci-support": "^3.0.0" 22 | }, 23 | "repository": { 24 | "type": "git", 25 | "url": "git@github.com:juspay/purescript-flow.git" 26 | }, 27 | "keywords": [ 28 | "flow", 29 | "typed UI", 30 | "typesafe flows" 31 | ], 32 | "authors": [ 33 | "JUSPAY Technologies Pvt. Ltd. " 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # purescript-flow 2 | > Generic typesafe UI and API flows for mobile and web apps. 3 | 4 | [![Bower](https://img.shields.io/bower/v/purescript-flow.svg)](https://github.com/juspay/purescript-flow/releases) [![Build Status](https://travis-ci.org/juspay/purescript-flow.svg?branch=master)](https://travis-ci.org/juspay/purescript-flow) 5 | 6 | ## Installation 7 | 8 | Install from bower or copy the source to your project's `bower_components`. 9 | 10 | ``` 11 | bower install purescript-flow --save 12 | ``` 13 | 14 | ## Examples 15 | 16 | Checkout the examples in [test](test). 17 | 18 | 19 | ## License 20 | 21 | This project is licensed under the AGPL License - see the [LICENSE](LICENSE) file for details. 22 | > Copyright (c) 2012-2017 [juspay.in](https://www.juspay.in) 23 | 24 | 25 | ## Contributing 26 | 27 | 0. Fork () 28 | 1. Create feature branch (`git checkout -b feature/foo-bar`) 29 | 2. For code styling, follow [purescript-style-guide](https://github.com/ianbollinger/purescript-style-guide/blob/master/purescript-style.md). 30 | 3. Commit your changes (`git commit -am 'Add some foo bar'`) 31 | 4. Push to the branch (`git push origin feature/foo-bar`) 32 | 5. Create a new Pull Request 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Flow/UI.purs: -------------------------------------------------------------------------------- 1 | {- 2 | Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | 5 | This file is part of JUSPAY Platform. 6 | 7 | JUSPAY Platform is free software: you can redistribute it and/or modify 8 | it for only educational purposes under the terms of the GNU Affero General 9 | Public License (GNU AGPL) as published by the Free Software Foundation, 10 | either version 3 of the License, or (at your option) any later version. 11 | For Enterprise/Commerical licenses, contact . 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | be liable for all damages without limitation, which is caused by the 17 | ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | The end user has NO right to claim any indemnification based on its use 20 | of Licensed Software. See the GNU Affero General Public License for more details. 21 | 22 | You should have received a copy of the GNU Affero General Public License 23 | along with this program. If not, see . 24 | 25 | 26 | -} 27 | 28 | module Flow.UI where 29 | 30 | import Prelude 31 | import Control.Monad.Aff (Aff) 32 | import Control.Monad.Eff (kind Effect) 33 | import Control.Monad.Eff.Exception (error) 34 | import Control.Monad.Except (runExcept, throwError) 35 | import Data.Either (Either(..)) 36 | import Data.Foreign (Foreign, F) 37 | import Data.Foreign.Class (class Decode, class Encode) 38 | import Data.Foreign.Generic (decodeJSON, defaultOptions, genericDecode, genericEncode) 39 | import Data.Foreign.Generic.Class (class GenericDecode, class GenericEncode) 40 | import Data.Generic.Rep (class Generic) 41 | 42 | foreign import data UI :: Effect 43 | 44 | class UIScreen a b where 45 | ui::forall e. Encode b => a -> Aff (ui::UI|e) b 46 | 47 | decodeAction :: forall a e. Decode a => String -> Aff e a 48 | decodeAction x = case (runExcept (decodeJSON x)) of 49 | Right y -> pure $ y 50 | Left err -> throwError (error (show err)) 51 | 52 | defaultDecode :: forall a b. Generic a b => GenericDecode b => Foreign -> F a 53 | defaultDecode x = genericDecode (defaultOptions {unwrapSingleConstructors=true}) x 54 | 55 | defaultEncode :: forall a b. Generic a b => GenericEncode b => a -> Foreign 56 | defaultEncode x = genericEncode (defaultOptions {unwrapSingleConstructors=true}) x 57 | -------------------------------------------------------------------------------- /test/UIExample.purs: -------------------------------------------------------------------------------- 1 | {- 2 | Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | 5 | This file is part of JUSPAY Platform. 6 | 7 | JUSPAY Platform is free software: you can redistribute it and/or modify 8 | it for only educational purposes under the terms of the GNU Affero General 9 | Public License (GNU AGPL) as published by the Free Software Foundation, 10 | either version 3 of the License, or (at your option) any later version. 11 | For Enterprise/Commerical licenses, contact . 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | be liable for all damages without limitation, which is caused by the 17 | ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | The end user has NO right to claim any indemnification based on its use 20 | of Licensed Software. See the GNU Affero General Public License for more details. 21 | 22 | You should have received a copy of the GNU Affero General Public License 23 | along with this program. If not, see . 24 | -} 25 | 26 | module UIExample where 27 | 28 | import Prelude 29 | import Control.Monad.Aff (Aff, launchAff, makeAff) 30 | import Control.Monad.Eff (Eff) 31 | import Control.Monad.Eff.Exception (EXCEPTION) 32 | import Data.Foreign.Class (class Decode, class Encode) 33 | import Data.Foreign.Generic (encodeJSON) 34 | import Data.Generic.Rep (class Generic) 35 | import Flow.UI (class UIScreen, UI, defaultDecode, defaultEncode, ui, decodeAction) 36 | 37 | 38 | data LoginScreen = LoginScreen String 39 | data LoginScreenAction = RequestOtp String | Abort 40 | 41 | instance loginScreen :: UIScreen LoginScreen LoginScreenAction where 42 | ui x = genericShowUI x 43 | 44 | derive instance genericLoginScreenAction :: Generic LoginScreenAction _ 45 | instance decodeLoginScreenAction :: Decode LoginScreenAction where decode = defaultDecode 46 | instance encodeLoginScreenAction :: Encode LoginScreenAction where encode = defaultEncode 47 | 48 | genericShowUI :: forall a b e. Encode b => Decode b => a -> Aff (ui::UI | e) b 49 | genericShowUI a = do 50 | res <- makeAff (\err sc -> sc (encodeJSON (RequestOtp "919999999999"))) 51 | decodeAction res 52 | 53 | appLoginFlow :: Aff(ui :: UI) String 54 | appLoginFlow = do 55 | action <- ui $ LoginScreen "Mary Jane" 56 | case action of 57 | RequestOtp mobileNumber -> pure $ "User requested otp" 58 | Abort -> pure $ "User aborted" 59 | 60 | main :: Eff (exception :: EXCEPTION, ui :: UI) Unit 61 | main = void $ launchAff $ appLoginFlow 62 | -------------------------------------------------------------------------------- /test/ApiExample.purs: -------------------------------------------------------------------------------- 1 | 2 | {- 3 | Copyright (c) 2012-2017 "JUSPAY Technologies" 4 | JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 5 | 6 | This file is part of JUSPAY Platform. 7 | 8 | JUSPAY Platform is free software: you can redistribute it and/or modify 9 | it for only educational purposes under the terms of the GNU Affero General 10 | Public License (GNU AGPL) as published by the Free Software Foundation, 11 | either version 3 of the License, or (at your option) any later version. 12 | For Enterprise/Commerical licenses, contact . 13 | 14 | This program is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 17 | be liable for all damages without limitation, which is caused by the 18 | ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 19 | damages, claims, cost, including reasonable attorney fee claimed on Juspay. 20 | The end user has NO right to claim any indemnification based on its use 21 | of Licensed Software. See the GNU Affero General Public License for more details. 22 | 23 | You should have received a copy of the GNU Affero General Public License 24 | along with this program. If not, see . 25 | -} 26 | 27 | module ApiExample where 28 | 29 | import Prelude 30 | import Flow.Api (class ApiRequest, class Requestable, class Responsdable, Request(Request) 31 | , Response, defaultPost, fromResponse, genericFromResponse, decodeAction, request) 32 | import Control.Monad.Aff (Aff, makeAff) 33 | import Data.Foreign.Class (class Decode, class Encode) 34 | import Data.Foreign.Generic (defaultOptions, encodeJSON, genericDecode, genericEncode) 35 | import Data.Generic.Rep (class Generic) 36 | 37 | baseUrl = "http://juspay.api" :: String 38 | 39 | newtype RequestOtp = RequestOtp {mobileNumber :: String} 40 | data RequestOtpResp = RequestOtpResp {status :: String} | FailureResp {error :: String, message :: String} 41 | 42 | requestOtpFlow :: forall e. Aff e String 43 | requestOtpFlow = do 44 | res <- request (RequestOtp {mobileNumber: "919999999999"}) 45 | case res of 46 | RequestOtpResp {status: s} -> pure $ "Verify Otp" 47 | FailureResp {message: msg} -> pure $ "Error " <> msg 48 | 49 | 50 | instance requestOtp :: Requestable RequestOtp where 51 | toRequest x = Request defaultPost {url = baseUrl <> "/api/v1/otp", content=(encodeJSON x)} 52 | 53 | instance requestOtpResp :: Responsdable RequestOtpResp where 54 | fromResponse = genericFromResponse 55 | 56 | instance requestOtpReq :: ApiRequest RequestOtp RequestOtpResp where 57 | request x = genericRequestHandler x >>= fromResponse 58 | 59 | 60 | genericRequestHandler :: forall a e. Requestable a => Encode a => a -> Aff e Response 61 | genericRequestHandler x = (makeAff (\err sc -> sc (encodeJSON (RequestOtpResp {status: "ok"})))) >>= decodeAction 62 | 63 | derive instance genericRequestOtp :: Generic RequestOtp _ 64 | instance encodeRequestOtp :: Encode RequestOtp where 65 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 66 | 67 | derive instance genericRequestOtpResp :: Generic RequestOtpResp _ 68 | instance encodeRequestOtpResp :: Encode RequestOtpResp where 69 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 70 | instance decodeRequestOtpResp :: Decode RequestOtpResp where 71 | decode x = genericDecode (defaultOptions { unwrapSingleConstructors = true }) x 72 | -------------------------------------------------------------------------------- /src/Flow/Api.purs: -------------------------------------------------------------------------------- 1 | {- 2 | Copyright (c) 2012-2017 "JUSPAY Technologies" 3 | JUSPAY Technologies Pvt. Ltd. [https://www.juspay.in] 4 | 5 | This file is part of JUSPAY Platform. 6 | 7 | JUSPAY Platform is free software: you can redistribute it and/or modify 8 | it for only educational purposes under the terms of the GNU Affero General 9 | Public License (GNU AGPL) as published by the Free Software Foundation, 10 | either version 3 of the License, or (at your option) any later version. 11 | For Enterprise/Commerical licenses, contact . 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The end user will 16 | be liable for all damages without limitation, which is caused by the 17 | ABUSE of the LICENSED SOFTWARE and shall INDEMNIFY JUSPAY for such 18 | damages, claims, cost, including reasonable attorney fee claimed on Juspay. 19 | The end user has NO right to claim any indemnification based on its use 20 | of Licensed Software. See the GNU Affero General Public License for more details. 21 | 22 | You should have received a copy of the GNU Affero General Public License 23 | along with this program. If not, see . 24 | -} 25 | 26 | module Flow.Api where 27 | 28 | import Prelude 29 | import Control.Monad.Aff (Aff) 30 | import Control.Monad.Eff.Exception (error) 31 | import Control.Monad.Except (runExcept, throwError) 32 | import Data.Either (Either(..)) 33 | import Data.Foreign.Class (class Decode, class Encode) 34 | import Data.Foreign.Generic (decodeJSON, defaultOptions, encodeJSON, genericDecode, genericEncode) 35 | import Data.Generic (class Generic) as G 36 | import Data.Generic.Rep (class Generic) 37 | 38 | data Header = Header String String 39 | data HttpVerb = GET | POST 40 | type StatusCode = Int 41 | 42 | newtype Request = Request { 43 | url :: String 44 | , method :: HttpVerb 45 | , headers :: Array Header 46 | , content :: String 47 | } 48 | 49 | newtype Response = Response { 50 | status :: StatusCode 51 | , headers :: Array Header 52 | , response :: String 53 | } 54 | 55 | class Requestable a where 56 | toRequest :: Encode a => a -> Request 57 | 58 | class Responsdable b where 59 | fromResponse :: forall e. Decode b => Response -> Aff e b 60 | 61 | class ApiRequest a b where 62 | request :: forall e. Requestable a => Responsdable b => a -> Aff e b 63 | 64 | 65 | getEncodedRequest :: forall a. Requestable a => Encode a => a -> String 66 | getEncodedRequest = encodeJSON <<< toRequest 67 | 68 | defaultPost :: { method :: HttpVerb 69 | , url :: String 70 | , content :: String 71 | , headers :: Array Header } 72 | 73 | defaultPost = { method: POST 74 | , url: "" 75 | , content: "" 76 | , headers: [Header "ContentType" "application/json"] } 77 | 78 | decodeAction :: forall a e. Decode a => String -> Aff e a 79 | decodeAction x = case (runExcept (decodeJSON x)) of 80 | Right y -> pure $ y 81 | Left err -> throwError (error (show err)) 82 | 83 | 84 | genericFromResponse :: forall e b. Decode b => Response -> Aff e b 85 | genericFromResponse (Response {status: s, response : r, headers : h}) = case 86 | (runExcept (decodeJSON r)) of 87 | Right resp -> pure $ resp 88 | Left err -> throwError (error $ (show err) <> " response: " <> r) 89 | 90 | derive instance genericHeader :: Generic Header _ 91 | derive instance gHeader :: G.Generic Header 92 | instance encodeHeader :: Encode Header where 93 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 94 | instance decodeHeader :: Decode Header where 95 | decode x = genericDecode (defaultOptions { unwrapSingleConstructors = true }) x 96 | 97 | derive instance genericHttpVerb :: Generic HttpVerb _ 98 | instance encodeHttpVerb :: Encode HttpVerb where 99 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 100 | 101 | derive instance genericRequest :: Generic Request _ 102 | instance encodeRequest :: Encode Request where 103 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 104 | 105 | derive instance genericResponse :: Generic Response _ 106 | derive instance gResponse :: G.Generic Response 107 | instance decodeResponse :: Decode Response where 108 | decode x = genericDecode (defaultOptions { unwrapSingleConstructors = true }) x 109 | instance encodeResponse :: Encode Response where 110 | encode x = genericEncode (defaultOptions { unwrapSingleConstructors = true }) x 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ABOUT JUSPAY LICENSES 2 | JUSPAY platform is an open source project, whose source and 3 | copyright is owned and maintained by JUSPAY Technology Private Limited. 4 | This page is intended to clarify the licenses and terms under 5 | which JUSPAY platform is made available. 6 | 7 | JUSPAY COMMERCIAL LICENSE 8 | Entities who desire to use JUSPAY source software applications for 9 | any commercial purpose shall use JUSPAY Enterprise Edition. You must 10 | obtain a commercial license from JUSPAY Technologies Private Limited, 11 | by contacting us at info@juspay.in. The Enterprise License or 12 | closed-source software applications requires a commercial license, 13 | offered under a separate license term. 14 | 15 | JUSPAY EDUCATION EDITION 16 | Education Edition Licenses are provided to “qualified institutions” like 17 | schools, colleges, training institutes and any other entity that shall use the 18 | code for educational purposes on a non-commercial basis. Non-commercial herein 19 | means not primarily intended for or directed towards commercial advantage or 20 | monetary compensation. The licensed software shall not be used by any 21 | entity making any commercial value of the platform. Only qualified institutions 22 | and private/career schools that use the platform for a non-commercial/internal 23 | educational use qualify to use the licensed platform. The education edition 24 | license by JUSPAY shall be governed by GNU AGPL V3. You should have received a 25 | copy of the GNU Affero General Public License along with this program. 26 | If not, see https://www.gnu.org/licenses/agpl.html. 27 | 28 | 29 | INDEMNIFICATION AND DISCLAIMER 30 | By using the Education Edition license JUSPAY makes no representations or 31 | warranties, expressed or implied. The Licensed Software is provided free of 32 | charge, and, therefore, on an "as is" basis, without warranty of any kind, 33 | explicitly or implicitly. By way of example, but not limitation, JUSPAY makes 34 | no representations or warranties of merchantability or fitness for the 35 | Licensed Software and any particular application or that the use of the 36 | Licensed Software or will not infringe any patents, copyrights or trademarks 37 | or other rights of third parties. The entire risk as to the quality and 38 | performance of the product is borne by the end user. JUSPAY shall not be 39 | liable for any liability or damages with respect to any claim by the end user 40 | or any third party on account of or arising from the license or use of the 41 | Software. The end user will be liable for all damages without limitation, 42 | which is caused by the abuse of the Licensed Software and shall indemnify 43 | JUSPAY for such damages, claims, cost, including reasonable attorney 44 | fee claimed on JUSPAY. The end user has no right to claim any indemnification 45 | based on its use of Licensed Software. 46 | 47 | 48 | 49 | 50 | 51 | GNU AFFERO GENERAL PUBLIC LICENSE 52 | Version 3, 19 November 2007 53 | 54 | Copyright (C) 2007 Free Software Foundation, Inc. 55 | Everyone is permitted to copy and distribute verbatim copies 56 | of this license document, but changing it is not allowed. 57 | 58 | Preamble 59 | 60 | The GNU Affero General Public License is a free, copyleft license for 61 | software and other kinds of works, specifically designed to ensure 62 | cooperation with the community in the case of network server software. 63 | 64 | The licenses for most software and other practical works are designed 65 | to take away your freedom to share and change the works. By contrast, 66 | our General Public Licenses are intended to guarantee your freedom to 67 | share and change all versions of a program--to make sure it remains free 68 | software for all its users. 69 | 70 | When we speak of free software, we are referring to freedom, not 71 | price. Our General Public Licenses are designed to make sure that you 72 | have the freedom to distribute copies of free software (and charge for 73 | them if you wish), that you receive source code or can get it if you 74 | want it, that you can change the software or use pieces of it in new 75 | free programs, and that you know you can do these things. 76 | 77 | Developers that use our General Public Licenses protect your rights 78 | with two steps: (1) assert copyright on the software, and (2) offer 79 | you this License which gives you legal permission to copy, distribute 80 | and/or modify the software. 81 | 82 | A secondary benefit of defending all users' freedom is that 83 | improvements made in alternate versions of the program, if they 84 | receive widespread use, become available for other developers to 85 | incorporate. Many developers of free software are heartened and 86 | encouraged by the resulting cooperation. However, in the case of 87 | software used on network servers, this result may fail to come about. 88 | The GNU General Public License permits making a modified version and 89 | letting the public access it on a server without ever releasing its 90 | source code to the public. 91 | 92 | The GNU Affero General Public License is designed specifically to 93 | ensure that, in such cases, the modified source code becomes available 94 | to the community. It requires the operator of a network server to 95 | provide the source code of the modified version running there to the 96 | users of that server. Therefore, public use of a modified version, on 97 | a publicly accessible server, gives the public access to the source 98 | code of the modified version. 99 | 100 | An older license, called the Affero General Public License and 101 | published by Affero, was designed to accomplish similar goals. This is 102 | a different license, not a version of the Affero GPL, but Affero has 103 | released a new version of the Affero GPL which permits relicensing under 104 | this license. 105 | 106 | The precise terms and conditions for copying, distribution and 107 | modification follow. 108 | 109 | TERMS AND CONDITIONS 110 | 111 | 0. Definitions. 112 | 113 | "This License" refers to version 3 of the GNU Affero General Public License. 114 | 115 | "Copyright" also means copyright-like laws that apply to other kinds of 116 | works, such as semiconductor masks. 117 | 118 | "The Program" refers to any copyrightable work licensed under this 119 | License. Each licensee is addressed as "you". "Licensees" and 120 | "recipients" may be individuals or organizations. 121 | 122 | To "modify" a work means to copy from or adapt all or part of the work 123 | in a fashion requiring copyright permission, other than the making of an 124 | exact copy. The resulting work is called a "modified version" of the 125 | earlier work or a work "based on" the earlier work. 126 | 127 | A "covered work" means either the unmodified Program or a work based 128 | on the Program. 129 | 130 | To "propagate" a work means to do anything with it that, without 131 | permission, would make you directly or secondarily liable for 132 | infringement under applicable copyright law, except executing it on a 133 | computer or modifying a private copy. Propagation includes copying, 134 | distribution (with or without modification), making available to the 135 | public, and in some countries other activities as well. 136 | 137 | To "convey" a work means any kind of propagation that enables other 138 | parties to make or receive copies. Mere interaction with a user through 139 | a computer network, with no transfer of a copy, is not conveying. 140 | 141 | An interactive user interface displays "Appropriate Legal Notices" 142 | to the extent that it includes a convenient and prominently visible 143 | feature that (1) displays an appropriate copyright notice, and (2) 144 | tells the user that there is no warranty for the work (except to the 145 | extent that warranties are provided), that licensees may convey the 146 | work under this License, and how to view a copy of this License. If 147 | the interface presents a list of user commands or options, such as a 148 | menu, a prominent item in the list meets this criterion. 149 | 150 | 1. Source Code. 151 | 152 | The "source code" for a work means the preferred form of the work 153 | for making modifications to it. "Object code" means any non-source 154 | form of a work. 155 | 156 | A "Standard Interface" means an interface that either is an official 157 | standard defined by a recognized standards body, or, in the case of 158 | interfaces specified for a particular programming language, one that 159 | is widely used among developers working in that language. 160 | 161 | The "System Libraries" of an executable work include anything, other 162 | than the work as a whole, that (a) is included in the normal form of 163 | packaging a Major Component, but which is not part of that Major 164 | Component, and (b) serves only to enable use of the work with that 165 | Major Component, or to implement a Standard Interface for which an 166 | implementation is available to the public in source code form. A 167 | "Major Component", in this context, means a major essential component 168 | (kernel, window system, and so on) of the specific operating system 169 | (if any) on which the executable work runs, or a compiler used to 170 | produce the work, or an object code interpreter used to run it. 171 | 172 | The "Corresponding Source" for a work in object code form means all 173 | the source code needed to generate, install, and (for an executable 174 | work) run the object code and to modify the work, including scripts to 175 | control those activities. However, it does not include the work's 176 | System Libraries, or general-purpose tools or generally available free 177 | programs which are used unmodified in performing those activities but 178 | which are not part of the work. For example, Corresponding Source 179 | includes interface definition files associated with source files for 180 | the work, and the source code for shared libraries and dynamically 181 | linked subprograms that the work is specifically designed to require, 182 | such as by intimate data communication or control flow between those 183 | subprograms and other parts of the work. 184 | 185 | The Corresponding Source need not include anything that users 186 | can regenerate automatically from other parts of the Corresponding 187 | Source. 188 | 189 | The Corresponding Source for a work in source code form is that 190 | same work. 191 | 192 | 2. Basic Permissions. 193 | 194 | All rights granted under this License are granted for the term of 195 | copyright on the Program, and are irrevocable provided the stated 196 | conditions are met. This License explicitly affirms your unlimited 197 | permission to run the unmodified Program. The output from running a 198 | covered work is covered by this License only if the output, given its 199 | content, constitutes a covered work. This License acknowledges your 200 | rights of fair use or other equivalent, as provided by copyright law. 201 | 202 | You may make, run and propagate covered works that you do not 203 | convey, without conditions so long as your license otherwise remains 204 | in force. You may convey covered works to others for the sole purpose 205 | of having them make modifications exclusively for you, or provide you 206 | with facilities for running those works, provided that you comply with 207 | the terms of this License in conveying all material for which you do 208 | not control copyright. Those thus making or running the covered works 209 | for you must do so exclusively on your behalf, under your direction 210 | and control, on terms that prohibit them from making any copies of 211 | your copyrighted material outside their relationship with you. 212 | 213 | Conveying under any other circumstances is permitted solely under 214 | the conditions stated below. Sublicensing is not allowed; section 10 215 | makes it unnecessary. 216 | 217 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 218 | 219 | No covered work shall be deemed part of an effective technological 220 | measure under any applicable law fulfilling obligations under article 221 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 222 | similar laws prohibiting or restricting circumvention of such 223 | measures. 224 | 225 | When you convey a covered work, you waive any legal power to forbid 226 | circumvention of technological measures to the extent such circumvention 227 | is effected by exercising rights under this License with respect to 228 | the covered work, and you disclaim any intention to limit operation or 229 | modification of the work as a means of enforcing, against the work's 230 | users, your or third parties' legal rights to forbid circumvention of 231 | technological measures. 232 | 233 | 4. Conveying Verbatim Copies. 234 | 235 | You may convey verbatim copies of the Program's source code as you 236 | receive it, in any medium, provided that you conspicuously and 237 | appropriately publish on each copy an appropriate copyright notice; 238 | keep intact all notices stating that this License and any 239 | non-permissive terms added in accord with section 7 apply to the code; 240 | keep intact all notices of the absence of any warranty; and give all 241 | recipients a copy of this License along with the Program. 242 | 243 | You may charge any price or no price for each copy that you convey, 244 | and you may offer support or warranty protection for a fee. 245 | 246 | 5. Conveying Modified Source Versions. 247 | 248 | You may convey a work based on the Program, or the modifications to 249 | produce it from the Program, in the form of source code under the 250 | terms of section 4, provided that you also meet all of these conditions: 251 | 252 | a) The work must carry prominent notices stating that you modified 253 | it, and giving a relevant date. 254 | 255 | b) The work must carry prominent notices stating that it is 256 | released under this License and any conditions added under section 257 | 7. This requirement modifies the requirement in section 4 to 258 | "keep intact all notices". 259 | 260 | c) You must license the entire work, as a whole, under this 261 | License to anyone who comes into possession of a copy. This 262 | License will therefore apply, along with any applicable section 7 263 | additional terms, to the whole of the work, and all its parts, 264 | regardless of how they are packaged. This License gives no 265 | permission to license the work in any other way, but it does not 266 | invalidate such permission if you have separately received it. 267 | 268 | d) If the work has interactive user interfaces, each must display 269 | Appropriate Legal Notices; however, if the Program has interactive 270 | interfaces that do not display Appropriate Legal Notices, your 271 | work need not make them do so. 272 | 273 | A compilation of a covered work with other separate and independent 274 | works, which are not by their nature extensions of the covered work, 275 | and which are not combined with it such as to form a larger program, 276 | in or on a volume of a storage or distribution medium, is called an 277 | "aggregate" if the compilation and its resulting copyright are not 278 | used to limit the access or legal rights of the compilation's users 279 | beyond what the individual works permit. Inclusion of a covered work 280 | in an aggregate does not cause this License to apply to the other 281 | parts of the aggregate. 282 | 283 | 6. Conveying Non-Source Forms. 284 | 285 | You may convey a covered work in object code form under the terms 286 | of sections 4 and 5, provided that you also convey the 287 | machine-readable Corresponding Source under the terms of this License, 288 | in one of these ways: 289 | 290 | a) Convey the object code in, or embodied in, a physical product 291 | (including a physical distribution medium), accompanied by the 292 | Corresponding Source fixed on a durable physical medium 293 | customarily used for software interchange. 294 | 295 | b) Convey the object code in, or embodied in, a physical product 296 | (including a physical distribution medium), accompanied by a 297 | written offer, valid for at least three years and valid for as 298 | long as you offer spare parts or customer support for that product 299 | model, to give anyone who possesses the object code either (1) a 300 | copy of the Corresponding Source for all the software in the 301 | product that is covered by this License, on a durable physical 302 | medium customarily used for software interchange, for a price no 303 | more than your reasonable cost of physically performing this 304 | conveying of source, or (2) access to copy the 305 | Corresponding Source from a network server at no charge. 306 | 307 | c) Convey individual copies of the object code with a copy of the 308 | written offer to provide the Corresponding Source. This 309 | alternative is allowed only occasionally and noncommercially, and 310 | only if you received the object code with such an offer, in accord 311 | with subsection 6b. 312 | 313 | d) Convey the object code by offering access from a designated 314 | place (gratis or for a charge), and offer equivalent access to the 315 | Corresponding Source in the same way through the same place at no 316 | further charge. You need not require recipients to copy the 317 | Corresponding Source along with the object code. If the place to 318 | copy the object code is a network server, the Corresponding Source 319 | may be on a different server (operated by you or a third party) 320 | that supports equivalent copying facilities, provided you maintain 321 | clear directions next to the object code saying where to find the 322 | Corresponding Source. Regardless of what server hosts the 323 | Corresponding Source, you remain obligated to ensure that it is 324 | available for as long as needed to satisfy these requirements. 325 | 326 | e) Convey the object code using peer-to-peer transmission, provided 327 | you inform other peers where the object code and Corresponding 328 | Source of the work are being offered to the general public at no 329 | charge under subsection 6d. 330 | 331 | A separable portion of the object code, whose source code is excluded 332 | from the Corresponding Source as a System Library, need not be 333 | included in conveying the object code work. 334 | 335 | A "User Product" is either (1) a "consumer product", which means any 336 | tangible personal property which is normally used for personal, family, 337 | or household purposes, or (2) anything designed or sold for incorporation 338 | into a dwelling. In determining whether a product is a consumer product, 339 | doubtful cases shall be resolved in favor of coverage. For a particular 340 | product received by a particular user, "normally used" refers to a 341 | typical or common use of that class of product, regardless of the status 342 | of the particular user or of the way in which the particular user 343 | actually uses, or expects or is expected to use, the product. A product 344 | is a consumer product regardless of whether the product has substantial 345 | commercial, industrial or non-consumer uses, unless such uses represent 346 | the only significant mode of use of the product. 347 | 348 | "Installation Information" for a User Product means any methods, 349 | procedures, authorization keys, or other information required to install 350 | and execute modified versions of a covered work in that User Product from 351 | a modified version of its Corresponding Source. The information must 352 | suffice to ensure that the continued functioning of the modified object 353 | code is in no case prevented or interfered with solely because 354 | modification has been made. 355 | 356 | If you convey an object code work under this section in, or with, or 357 | specifically for use in, a User Product, and the conveying occurs as 358 | part of a transaction in which the right of possession and use of the 359 | User Product is transferred to the recipient in perpetuity or for a 360 | fixed term (regardless of how the transaction is characterized), the 361 | Corresponding Source conveyed under this section must be accompanied 362 | by the Installation Information. But this requirement does not apply 363 | if neither you nor any third party retains the ability to install 364 | modified object code on the User Product (for example, the work has 365 | been installed in ROM). 366 | 367 | The requirement to provide Installation Information does not include a 368 | requirement to continue to provide support service, warranty, or updates 369 | for a work that has been modified or installed by the recipient, or for 370 | the User Product in which it has been modified or installed. Access to a 371 | network may be denied when the modification itself materially and 372 | adversely affects the operation of the network or violates the rules and 373 | protocols for communication across the network. 374 | 375 | Corresponding Source conveyed, and Installation Information provided, 376 | in accord with this section must be in a format that is publicly 377 | documented (and with an implementation available to the public in 378 | source code form), and must require no special password or key for 379 | unpacking, reading or copying. 380 | 381 | 7. Additional Terms. 382 | 383 | "Additional permissions" are terms that supplement the terms of this 384 | License by making exceptions from one or more of its conditions. 385 | Additional permissions that are applicable to the entire Program shall 386 | be treated as though they were included in this License, to the extent 387 | that they are valid under applicable law. If additional permissions 388 | apply only to part of the Program, that part may be used separately 389 | under those permissions, but the entire Program remains governed by 390 | this License without regard to the additional permissions. 391 | 392 | When you convey a copy of a covered work, you may at your option 393 | remove any additional permissions from that copy, or from any part of 394 | it. (Additional permissions may be written to require their own 395 | removal in certain cases when you modify the work.) You may place 396 | additional permissions on material, added by you to a covered work, 397 | for which you have or can give appropriate copyright permission. 398 | 399 | Notwithstanding any other provision of this License, for material you 400 | add to a covered work, you may (if authorized by the copyright holders of 401 | that material) supplement the terms of this License with terms: 402 | 403 | a) Disclaiming warranty or limiting liability differently from the 404 | terms of sections 15 and 16 of this License; or 405 | 406 | b) Requiring preservation of specified reasonable legal notices or 407 | author attributions in that material or in the Appropriate Legal 408 | Notices displayed by works containing it; or 409 | 410 | c) Prohibiting misrepresentation of the origin of that material, or 411 | requiring that modified versions of such material be marked in 412 | reasonable ways as different from the original version; or 413 | 414 | d) Limiting the use for publicity purposes of names of licensors or 415 | authors of the material; or 416 | 417 | e) Declining to grant rights under trademark law for use of some 418 | trade names, trademarks, or service marks; or 419 | 420 | f) Requiring indemnification of licensors and authors of that 421 | material by anyone who conveys the material (or modified versions of 422 | it) with contractual assumptions of liability to the recipient, for 423 | any liability that these contractual assumptions directly impose on 424 | those licensors and authors. 425 | 426 | All other non-permissive additional terms are considered "further 427 | restrictions" within the meaning of section 10. If the Program as you 428 | received it, or any part of it, contains a notice stating that it is 429 | governed by this License along with a term that is a further 430 | restriction, you may remove that term. If a license document contains 431 | a further restriction but permits relicensing or conveying under this 432 | License, you may add to a covered work material governed by the terms 433 | of that license document, provided that the further restriction does 434 | not survive such relicensing or conveying. 435 | 436 | If you add terms to a covered work in accord with this section, you 437 | must place, in the relevant source files, a statement of the 438 | additional terms that apply to those files, or a notice indicating 439 | where to find the applicable terms. 440 | 441 | Additional terms, permissive or non-permissive, may be stated in the 442 | form of a separately written license, or stated as exceptions; 443 | the above requirements apply either way. 444 | 445 | 8. Termination. 446 | 447 | You may not propagate or modify a covered work except as expressly 448 | provided under this License. Any attempt otherwise to propagate or 449 | modify it is void, and will automatically terminate your rights under 450 | this License (including any patent licenses granted under the third 451 | paragraph of section 11). 452 | 453 | However, if you cease all violation of this License, then your 454 | license from a particular copyright holder is reinstated (a) 455 | provisionally, unless and until the copyright holder explicitly and 456 | finally terminates your license, and (b) permanently, if the copyright 457 | holder fails to notify you of the violation by some reasonable means 458 | prior to 60 days after the cessation. 459 | 460 | Moreover, your license from a particular copyright holder is 461 | reinstated permanently if the copyright holder notifies you of the 462 | violation by some reasonable means, this is the first time you have 463 | received notice of violation of this License (for any work) from that 464 | copyright holder, and you cure the violation prior to 30 days after 465 | your receipt of the notice. 466 | 467 | Termination of your rights under this section does not terminate the 468 | licenses of parties who have received copies or rights from you under 469 | this License. If your rights have been terminated and not permanently 470 | reinstated, you do not qualify to receive new licenses for the same 471 | material under section 10. 472 | 473 | 9. Acceptance Not Required for Having Copies. 474 | 475 | You are not required to accept this License in order to receive or 476 | run a copy of the Program. Ancillary propagation of a covered work 477 | occurring solely as a consequence of using peer-to-peer transmission 478 | to receive a copy likewise does not require acceptance. However, 479 | nothing other than this License grants you permission to propagate or 480 | modify any covered work. These actions infringe copyright if you do 481 | not accept this License. Therefore, by modifying or propagating a 482 | covered work, you indicate your acceptance of this License to do so. 483 | 484 | 10. Automatic Licensing of Downstream Recipients. 485 | 486 | Each time you convey a covered work, the recipient automatically 487 | receives a license from the original licensors, to run, modify and 488 | propagate that work, subject to this License. You are not responsible 489 | for enforcing compliance by third parties with this License. 490 | 491 | An "entity transaction" is a transaction transferring control of an 492 | organization, or substantially all assets of one, or subdividing an 493 | organization, or merging organizations. If propagation of a covered 494 | work results from an entity transaction, each party to that 495 | transaction who receives a copy of the work also receives whatever 496 | licenses to the work the party's predecessor in interest had or could 497 | give under the previous paragraph, plus a right to possession of the 498 | Corresponding Source of the work from the predecessor in interest, if 499 | the predecessor has it or can get it with reasonable efforts. 500 | 501 | You may not impose any further restrictions on the exercise of the 502 | rights granted or affirmed under this License. For example, you may 503 | not impose a license fee, royalty, or other charge for exercise of 504 | rights granted under this License, and you may not initiate litigation 505 | (including a cross-claim or counterclaim in a lawsuit) alleging that 506 | any patent claim is infringed by making, using, selling, offering for 507 | sale, or importing the Program or any portion of it. 508 | 509 | 11. Patents. 510 | 511 | A "contributor" is a copyright holder who authorizes use under this 512 | License of the Program or a work on which the Program is based. The 513 | work thus licensed is called the contributor's "contributor version". 514 | 515 | A contributor's "essential patent claims" are all patent claims 516 | owned or controlled by the contributor, whether already acquired or 517 | hereafter acquired, that would be infringed by some manner, permitted 518 | by this License, of making, using, or selling its contributor version, 519 | but do not include claims that would be infringed only as a 520 | consequence of further modification of the contributor version. For 521 | purposes of this definition, "control" includes the right to grant 522 | patent sublicenses in a manner consistent with the requirements of 523 | this License. 524 | 525 | Each contributor grants you a non-exclusive, worldwide, royalty-free 526 | patent license under the contributor's essential patent claims, to 527 | make, use, sell, offer for sale, import and otherwise run, modify and 528 | propagate the contents of its contributor version. 529 | 530 | In the following three paragraphs, a "patent license" is any express 531 | agreement or commitment, however denominated, not to enforce a patent 532 | (such as an express permission to practice a patent or covenant not to 533 | sue for patent infringement). To "grant" such a patent license to a 534 | party means to make such an agreement or commitment not to enforce a 535 | patent against the party. 536 | 537 | If you convey a covered work, knowingly relying on a patent license, 538 | and the Corresponding Source of the work is not available for anyone 539 | to copy, free of charge and under the terms of this License, through a 540 | publicly available network server or other readily accessible means, 541 | then you must either (1) cause the Corresponding Source to be so 542 | available, or (2) arrange to deprive yourself of the benefit of the 543 | patent license for this particular work, or (3) arrange, in a manner 544 | consistent with the requirements of this License, to extend the patent 545 | license to downstream recipients. "Knowingly relying" means you have 546 | actual knowledge that, but for the patent license, your conveying the 547 | covered work in a country, or your recipient's use of the covered work 548 | in a country, would infringe one or more identifiable patents in that 549 | country that you have reason to believe are valid. 550 | 551 | If, pursuant to or in connection with a single transaction or 552 | arrangement, you convey, or propagate by procuring conveyance of, a 553 | covered work, and grant a patent license to some of the parties 554 | receiving the covered work authorizing them to use, propagate, modify 555 | or convey a specific copy of the covered work, then the patent license 556 | you grant is automatically extended to all recipients of the covered 557 | work and works based on it. 558 | 559 | A patent license is "discriminatory" if it does not include within 560 | the scope of its coverage, prohibits the exercise of, or is 561 | conditioned on the non-exercise of one or more of the rights that are 562 | specifically granted under this License. You may not convey a covered 563 | work if you are a party to an arrangement with a third party that is 564 | in the business of distributing software, under which you make payment 565 | to the third party based on the extent of your activity of conveying 566 | the work, and under which the third party grants, to any of the 567 | parties who would receive the covered work from you, a discriminatory 568 | patent license (a) in connection with copies of the covered work 569 | conveyed by you (or copies made from those copies), or (b) primarily 570 | for and in connection with specific products or compilations that 571 | contain the covered work, unless you entered into that arrangement, 572 | or that patent license was granted, prior to 28 March 2007. 573 | 574 | Nothing in this License shall be construed as excluding or limiting 575 | any implied license or other defenses to infringement that may 576 | otherwise be available to you under applicable patent law. 577 | 578 | 12. No Surrender of Others' Freedom. 579 | 580 | If conditions are imposed on you (whether by court order, agreement or 581 | otherwise) that contradict the conditions of this License, they do not 582 | excuse you from the conditions of this License. If you cannot convey a 583 | covered work so as to satisfy simultaneously your obligations under this 584 | License and any other pertinent obligations, then as a consequence you may 585 | not convey it at all. For example, if you agree to terms that obligate you 586 | to collect a royalty for further conveying from those to whom you convey 587 | the Program, the only way you could satisfy both those terms and this 588 | License would be to refrain entirely from conveying the Program. 589 | 590 | 13. Remote Network Interaction; Use with the GNU General Public License. 591 | 592 | Notwithstanding any other provision of this License, if you modify the 593 | Program, your modified version must prominently offer all users 594 | interacting with it remotely through a computer network (if your version 595 | supports such interaction) an opportunity to receive the Corresponding 596 | Source of your version by providing access to the Corresponding Source 597 | from a network server at no charge, through some standard or customary 598 | means of facilitating copying of software. This Corresponding Source 599 | shall include the Corresponding Source for any work covered by version 3 600 | of the GNU General Public License that is incorporated pursuant to the 601 | following paragraph. 602 | 603 | Notwithstanding any other provision of this License, you have 604 | permission to link or combine any covered work with a work licensed 605 | under version 3 of the GNU General Public License into a single 606 | combined work, and to convey the resulting work. The terms of this 607 | License will continue to apply to the part which is the covered work, 608 | but the work with which it is combined will remain governed by version 609 | 3 of the GNU General Public License. 610 | 611 | 14. Revised Versions of this License. 612 | 613 | The Free Software Foundation may publish revised and/or new versions of 614 | the GNU Affero General Public License from time to time. Such new versions 615 | will be similar in spirit to the present version, but may differ in detail to 616 | address new problems or concerns. 617 | 618 | Each version is given a distinguishing version number. If the 619 | Program specifies that a certain numbered version of the GNU Affero General 620 | Public License "or any later version" applies to it, you have the 621 | option of following the terms and conditions either of that numbered 622 | version or of any later version published by the Free Software 623 | Foundation. If the Program does not specify a version number of the 624 | GNU Affero General Public License, you may choose any version ever published 625 | by the Free Software Foundation. 626 | 627 | If the Program specifies that a proxy can decide which future 628 | versions of the GNU Affero General Public License can be used, that proxy's 629 | public statement of acceptance of a version permanently authorizes you 630 | to choose that version for the Program. 631 | 632 | Later license versions may give you additional or different 633 | permissions. However, no additional obligations are imposed on any 634 | author or copyright holder as a result of your choosing to follow a 635 | later version. 636 | 637 | 15. Disclaimer of Warranty. 638 | 639 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 640 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 641 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 642 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 643 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 644 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 645 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 646 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 647 | 648 | 16. Limitation of Liability. 649 | 650 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 651 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 652 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 653 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 654 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 655 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 656 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 657 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 658 | SUCH DAMAGES. 659 | 660 | 17. Interpretation of Sections 15 and 16. 661 | 662 | If the disclaimer of warranty and limitation of liability provided 663 | above cannot be given local legal effect according to their terms, 664 | reviewing courts shall apply local law that most closely approximates 665 | an absolute waiver of all civil liability in connection with the 666 | Program, unless a warranty or assumption of liability accompanies a 667 | copy of the Program in return for a fee. 668 | 669 | END OF TERMS AND CONDITIONS 670 | 671 | How to Apply These Terms to Your New Programs 672 | 673 | If you develop a new program, and you want it to be of the greatest 674 | possible use to the public, the best way to achieve this is to make it 675 | free software which everyone can redistribute and change under these terms. 676 | 677 | To do so, attach the following notices to the program. It is safest 678 | to attach them to the start of each source file to most effectively 679 | state the exclusion of warranty; and each file should have at least 680 | the "copyright" line and a pointer to where the full notice is found. 681 | 682 | 683 | Copyright (C) 684 | 685 | This program is free software: you can redistribute it and/or modify 686 | it under the terms of the GNU Affero General Public License as published by 687 | the Free Software Foundation, either version 3 of the License, or 688 | (at your option) any later version. 689 | 690 | This program is distributed in the hope that it will be useful, 691 | but WITHOUT ANY WARRANTY; without even the implied warranty of 692 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 693 | GNU Affero General Public License for more details. 694 | 695 | You should have received a copy of the GNU Affero General Public License 696 | along with this program. If not, see . 697 | 698 | Also add information on how to contact you by electronic and paper mail. 699 | 700 | If your software can interact with users remotely through a computer 701 | network, you should also make sure that it provides a way for users to 702 | get its source. For example, if your program is a web application, its 703 | interface could display a "Source" link that leads users to an archive 704 | of the code. There are many ways you could offer source, and different 705 | solutions will be better for different programs; see section 13 for the 706 | specific requirements. 707 | 708 | You should also get your employer (if you work as a programmer) or school, 709 | if any, to sign a "copyright disclaimer" for the program, if necessary. 710 | For more information on this, and how to apply and follow the GNU AGPL, see 711 | . --------------------------------------------------------------------------------