\r\nOnce signed, you will be automatically added to the NDA terms of use and notified by email. \r\n
",
- "agreed": false,
- "docusignTemplateId": "fake-template-id",
- "serverInformation": {
- "serverName": "TopCoder API",
- "apiVersion": "0.0.1",
- "requestDuration": 4,
- "currentTime": 1504891122158
- },
- "requesterInformation": {
- "id": "d9994de712597c11d1caad64996d9fa0d9b4aa2c-w2VCwwGwnN6EeyhK",
- "remoteIP": "12.34.56.789",
- "receivedParams": {
- "apiVersion": "v2",
- "termsOfUseId": "21153",
- "action": "getTermsOfUse"
- }
- }
-}
diff --git a/src/apps/earn/src/services/__mocks__/data/terms-noauth.json b/src/apps/earn/src/services/__mocks__/data/terms-noauth.json
deleted file mode 100644
index 66dfa2b96..000000000
--- a/src/apps/earn/src/services/__mocks__/data/terms-noauth.json
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- "terms": [
- {
- "termsOfUseId": 21193,
- "title": "Standard Terms for Topcoder Competitions v2.1",
- "url": "",
- "agreeabilityType": "Electronically-agreeable",
- "templateId": null
- },
- {
- "termsOfUseId": 21153,
- "title": "Appirio NDA v2.0",
- "url": "http://community.topcoder.com/tc?module=Terms&tuid=21153",
- "agreeabilityType": "DocuSignable",
- "templateId": "fake-template-id"
- }
- ],
- "serverInformation": {
- "serverName": "Topcoder API",
- "apiVersion": "0.0.1",
- "requestDuration": 11471,
- "currentTime": 1504879510947
- },
- "requesterInformation": {
- "id": "456f987dee6e9823179c8184fd3509ffdf9c613a-FyefLdEpb8UHgFQF",
- "remoteIP": "12.34.567.890",
- "receivedParams": {
- "role": "Submitter",
- "noauth": "true",
- "apiVersion": "v2",
- "challengeId": "30059255",
- "action": "getChallengeTerms"
- }
- }
-}
diff --git a/src/apps/earn/src/services/__mocks__/data/terms-reviewer-details.json b/src/apps/earn/src/services/__mocks__/data/terms-reviewer-details.json
deleted file mode 100644
index d2d38ba62..000000000
--- a/src/apps/earn/src/services/__mocks__/data/terms-reviewer-details.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "termsOfUseId": 20704,
- "title": "Standard Reviewer Terms v1.0",
- "url": "",
- "text": "THESE ARE THE TERMS AND CONDITIONS (\"TERMS\") UNDER WHICH YOU AGREE TO WORK UNDER AS A TOPCODER REVIEW BOARD MEMBER. THESE TERMS AND CONDITIONS AFFECT YOUR RIGHTS AND YOU SHOULD READ THEM CAREFULLY BEFORE AGREEING TO THEM. IN THESE TERMS AND CONDITIONS, \"WE,\" \"US,\" \"ITS\" AND \"OUR\" REFER TO TOPCODER, INC. AND \"YOU\" AND \"YOUR\" REFER TO YOU.
\r\n\r\nIt is understood that We need, and You have, expertise in evaluating and critiquing software designs and/or software development solutions. Furthermore, You agree that You are ready, willing, and able to undertake the performance of evaluating and critiquing such software designs and/or software development solutions submitted to Us, and You agree to assign and transfer your rights as a result of performing such services.
\r\n\r\nIn consideration of the premises and the mutual promises and covenants set forth herein, and for other good and valuable consideration, the receipt and sufficiency of which are hereby acknowledged, the parties agree as follows:
\r\n\r\nAs used in these Terms, the following capitalized terms shall have the following meanings unless otherwise indicated:
\r\n\r\n1.1.\t\"Development(s)\" shall mean any idea, design, concept, development, component, algorithm, process, method, formula, code, software, technique, technology, discovery or improvement, whether or not patentable, made, conceived, created, discovered, invented or reduced to practice by You in connection with the performance of services hereunder.
\r\n\r\n1.2.\t\"Intellectual Property Rights\" shall mean all intellectual property rights worldwide arising under statutory or common law or by contract and whether or not perfected, now existing or hereafter filed, issued or acquired, including all patent rights; all rights associated with works of authorship including copyrights and moral rights; rights relating to the protection of trade secrets and confidential information; and any right analogous to those set forth herein and any other proprietary rights relating to intangible property, other than Trademarks.
\r\n\r\n1.3.\t\"TopCoder Information\" shall mean TopCoder's and TopCoder Software's specifications, descriptions, architecture, plans, interfaces, and code for TopCoder's and TopCoder Software's hardware, software, and web site; TopCoder's competitions and competition operation procedures; TopCoder's and TopCoder Software's business and operational plans; and derivatives of the foregoing. The TopCoder Information shall be Confidential Information hereunder.
\r\n\r\n1.4.\t\"Software Component\" shall mean all software and related materials, technology and documentation (including without limitation design documents, source code and object code) to be evaluated and assessed by You for Us hereunder in accordance with our requirements, as set forth herein and in other documents provided by Us. The Software Component shall be Confidential Information hereunder.
\r\n\r\n2.1\tYou hereby agree to provide services relating to the evaluation and assessment of the Software Component. You agree to perform such services according to and in conformity with the following specifications, in addition to any specifications and/or scheduled provided by Us in our sole discretion (the \"Services\"):
\r\n\r\n2.2\tYou agree to commit sufficient time and resources to perform the Services according to the schedule set forth by Us. You shall promptly notify Us of any circumstances, as such circumstances arise, that may reasonably be anticipated to lead to a material deviation from the schedule.
\r\n\r\n2.3\tYou agree to keep Us updated, promptly upon our request, of any progress, problems, and/or developments of which You are aware regarding the Services. We shall have the right to require such updates in writing from You in a format specified by Us or acceptable to Us in our sole discretion. You shall conduct and conclude the Services in a professional manner.
\r\n\r\n3.1\tFee. In consideration for performance of the Services required by You, We shall pay You the fee set forth on TopCoder's website and/or in other correspondence from Us to You (the \"Fee\"). The Fee shall be in U.S. Dollars and may be paid in installments, as set forth on our website or in other correspondence from Us. The Fee shall be paid upon the conclusion of the review period, and once completed scorecards have been received, provided the completed scorecards are submitted to Us by the deadline as set forth on the website and/or in the correspondence from Us.
\r\n\r\n3.2\tRoyalty Payments.
\r\n \r\n(a)\tDefinitions. As used in this Section 3, the following capitalized terms shall have the following meanings unless otherwise indicated:
\r\n(b)\tIn consideration of Your evaluation of the Software Components and performance of Your obligations hereunder, We may pay to You a royalty (the \"Royalty Payment\"). The Royalty Payment to be paid shall be a portion of the Royalty Pool. The Royalty Pool shall be distributed as follows:
\r\n\r\n3.3\tTotal Payment. The sum of the Fee and the Royalty Payments shall be the total payment due to You. Any and all out-of-pocket expenses incurred by You in connection with performing the obligations hereunder are your sole responsibility. We will not reimburse You for any expenses incurred.
\r\n\r\n3.4\tYou shall not be entitled to receive any other compensation or any benefits from Us in connection with the Services. Except as otherwise required by law, We shall not withhold any sums or payments made to You for social security or other federal, state or local tax liabilities or contributions, and all withholdings, liabilities, and contributions shall be solely your responsibility. Further, You understand and agree that the Services are not covered under the unemployment compensation laws and are not intended to be covered by workers' compensation laws.
\r\n\r\n4.1\tYou hereby acknowledge and agree that We own, solely and exclusively, all right, title and interest, including all Intellectual Property Rights, in and to the TopCoder Information. In addition, You hereby irrevocably and unconditionally transfer and assign to Us all right, title and interest You had, have, may have or acquire in or to all Developments and Software Components, and You agree to execute and deliver such documents, certificates, assignments and other writings, and take such other actions as may be necessary or desirable to vest in Us the ownership rights granted to Us hereunder.
\r\n\r\n4.2\tYou further agree that any and all works of authorship created, authored or developed by You hereunder shall be deemed to be \"works made for hire\" within the meaning of the United States Copyright Law and, as such, all rights therein including copyright shall belong solely and exclusively to Us from the time of their creation. To the extent any such work of authorship may not be deemed to be a work made for hire, You agree to, and do hereby, irrevocably and unconditionally transfer and assign to Us all right, title and interest including copyright in and to such work.
\r\n\r\n4.3\tYou agree that if We are unable, because of your unavailability, or for any other reason, to secure your signature to apply for or to pursue any application for any United States or foreign patents, mask work, copyright or trademark registrations covering the assignments to Us above, then You hereby irrevocably designates and appoints Us and your duly authorized officers and agents as your agent and attorney in fact, to act for and in your behalf and stead to execute and file any such applications and to do all other lawfully permitted acts to further the prosecution and issuance of patents, copyright, mask work and trademark registrations thereon with the same legal force and effect as if executed by your authorized agent.
\r\n\r\n4.4\tAll Intellectual Property Rights owned by a party as of the date You agree to these Terms shall remain the property of such party and no licenses or other rights with respect to such intellectual property are granted to the other party except as expressly set forth herein.
\r\n\r\n4.5\tNothing in these terms shall be construed as granting You any right or license under any of our Intellectual Property Right (including any rights We may have in any patents, copyrights, trademarks, service marks or any trade secrets), by implication, estoppel or otherwise, except as expressly set forth herein.
\r\n\r\n5.1\t\"Confidential Information\" shall mean any information, in whatever form, provided by Us to You with obligation of confidentiality, or designated by Us in writing as confidential, proprietary or marked with words of like import when provided to You, and information orally conveyed if We state at the time of oral conveyance or promptly thereafter that such information is confidential. Notwithstanding anything to the contrary contained herein, information about or relating to our software, our system interfaces, our hardware and software architecture, our business, operational and marketing plans, our member lists and database, all information and technology provided by Us to You to enable You to perform your obligations hereunder, TopCoder Information, and any and all Developments shall be considered Confidential Information.
\r\n\r\n5.2\tConfidential Information shall not include information which (a) was in your possession without confidentiality restriction prior to disclosure by Us hereunder; (b) at or after the time of disclosure by Us becomes generally available to the public through no act or omission on our part; (c) is developed by You independently of and without reference to any Confidential Information You receive from Us; or (d) has come into your possession without confidentiality restriction from a third party and such third party is under no obligation to Us to maintain the confidentiality of such information.
\r\n\r\n5.3\tYou acknowledge the confidential and proprietary nature of Confidential Information and agree (i) to hold Confidential Information in confidence and to take all reasonable precautions to protect such Confidential Information (including, without limitation, all precautions You employ with respect to your own confidential materials), (ii) not to divulge any such Confidential Information to any third person; and (iii) not to make any use whatsoever of such Confidential Information except as expressly authorized herein.
\r\n\r\n5.4\tIn the event You are ordered to disclose Confidential Information pursuant to a judicial or government request, requirement or order, You shall promptly notify Us and upon our request, You shall, at our expense, take reasonable steps to assist Us in contesting such request, requirement or order or in otherwise protecting our rights prior to disclosure.
\r\n\r\n5.5\tYou agree not to reproduce or copy by any means Confidential Information, except as reasonably required to perform the Services. Upon termination of your performance of the Services as a review board member, your right to use Confidential Information shall immediately terminate. In addition, upon such termination, or upon demand by Us at any time, You shall return promptly to Us or destroy, at our option, all tangible materials and computer data that disclose or embody Confidential Information.
\r\n\r\n5.6\tYou agree that any breach of these terms by You could cause irreparable damage to Us. In view of the difficulties of placing a monetary value on the Confidential Information, We shall have, in addition to any and all remedies of law, the right to an injunction or other equitable relief, and may be entitled to a preliminary and final injunction without the necessity of posting any bond or undertaking in connection therewith to prevent any further breach or further unauthorized use of Confidential Information. This remedy is separate from any other remedy We may have.
\r\n\r\n7.1\tYou shall indemnify, hold harmless and defend Us and our customers from and against any and all suits, actions, damages, costs, losses, expenses (including settlement awards and reasonable attorneys' fees) and other liabilities arising from or in connection with any claim alleging that, to your knowledge, any Development and/or Software Component violates any trade secret right, or infringes any copyright, patent, trademark, or other intellectual property interest, in any country, and shall pay all costs and damages awarded. We shall promptly notify You of any such claim of which We are aware.
\r\n\r\n7.2\tYour obligations shall not extend to any claim for violation or infringement resulting solely from your compliance with any specific or direct written instructions from Us if such infringement would have been avoided but for such compliance.
\r\n\r\n8.1\tBoth parties expressly agree and understand that You are an independent contractor and nothing herein nor the services rendered hereunder is meant, or shall be construed in any way or manner, to create a relationship of employer and employee, principal and agent, partners or any other relationship other than that of independent parties contracting with each other solely for the purpose of carrying out the provisions of these Terms. Accordingly, You acknowledge and agree that You shall not be entitled to any benefits provided by Us to our employees. You shall be responsible for any and all out-of-pocket expenses incurred in connection with performing the Services. In addition, You shall have sole and exclusive responsibility for the payment of all federal, state and local income taxes, for all employment and disability insurance and for Social Security and other similar taxes with respect to any compensation provided by Us hereunder. You further agree that if We pay or become liable for such taxes or related civil penalties or interest as a result of your failure to pay taxes or report same, or due to our failure to withhold taxes, You shall indemnify and hold us harmless for any such liability. You shall assume and accept all responsibilities which are imposed on independent contractors by any statute, regulation, rule of law, or otherwise. You are not our agent and are not authorized and shall not have the power or authority to bind Us or incur any liability or obligation, or act on behalf of Us. At no time shall You represent that You are our agent, or that any of the views, advice, statements and/or information that may be provided while performing the Services are ours.
\r\n\r\n8.2\tWe are entitled to provide You with general guidance to assist You in completing the scope of work to our satisfaction, You are ultimately responsible for directing and controlling the performance of the task and the scope of work, in accordance with these Terms. You shall use your best efforts, energy and skill in your own name and in such manner as You see fit.
",
- "agreeabilityType": "Electronically-agreeable",
- "serverInformation": {
- "serverName": "Topcoder API",
- "apiVersion": "0.0.1",
- "requestDuration": 52,
- "currentTime": 1504892902498
- },
- "requesterInformation": {
- "id": "d8c441f8332161f71533f368c09aeead856e4366-K1RdFai7LCAgXVu5",
- "remoteIP": "12.34.56.78",
- "receivedParams": {
- "apiVersion": "v2",
- "termsOfUseId": "21193",
- "action": "getTermsOfUse"
- }
- }
-}
diff --git a/src/apps/earn/src/services/__mocks__/data/terms-reviewer.json b/src/apps/earn/src/services/__mocks__/data/terms-reviewer.json
deleted file mode 100644
index 744297d8a..000000000
--- a/src/apps/earn/src/services/__mocks__/data/terms-reviewer.json
+++ /dev/null
@@ -1,36 +0,0 @@
-{
- "terms": [
- {
- "termsOfUseId": 21153,
- "title": "Appirio NDA v2.0",
- "url": "http://community.topcoder.com/tc?module=Terms&tuid=21153",
- "agreeabilityType": "DocuSignable",
- "agreed": false,
- "templateId": "fake-template-id"
- },
- {
- "termsOfUseId": 20704,
- "title": "Standard Reviewer Terms v1.0",
- "url": "",
- "agreeabilityType": "Electronically-agreeable",
- "agreed": false,
- "templateId": null
- }
- ],
- "serverInformation": {
- "serverName": "Topcoder API",
- "apiVersion": "0.0.1",
- "requestDuration": 29,
- "currentTime": 1504878884618
- },
- "requesterInformation": {
- "id": "1b37607c519c318194ce6da08c519c0a3f7c9855-7FSFCyd6oSX2mV6Z",
- "remoteIP": "12.34.567.890",
- "receivedParams": {
- "role": "Submitter",
- "apiVersion": "v2",
- "challengeId": "30059255",
- "action": "getChallengeTerms"
- }
- }
-}
diff --git a/src/apps/earn/src/services/__mocks__/data/terms-topcoder-details.json b/src/apps/earn/src/services/__mocks__/data/terms-topcoder-details.json
deleted file mode 100644
index 5cc72e1f9..000000000
--- a/src/apps/earn/src/services/__mocks__/data/terms-topcoder-details.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "termsOfUseId": 21193,
- "title": "Standard Terms for Topcoder Competitions v2.1",
- "url": "",
- "agreeabilityType": "Electronically-agreeable",
- "text": "\r\n\r\n\r\n\r\n
Terms & Conditions of Use at topcoder
\r\n\r\n
Acceptance of Terms and Conditions
\r\n\r\nWelcome to topcoder.com (and related sub-domains (the \"Website\"). By using the Website, you are indicating your agreement to these Terms and Conditions of Use (\"Terms of Use\"), including, without limitation, our privacy policy. If you do not agree to these Terms of Use, please do not use the Website and exit now. \r\n\r\n\r\nThroughout these Terms of Use, the words \"we,\" \"us,\" \"our,\" and topcoder refer to Topcoder, Inc., Appirio Inc. and their parents, subsidiaries and affiliates collectively. The term \"Submissions\" shall refer to any entry, component of an entry, or contents of a posting onto the Website submitted in connection with Competitions. \"Competitions\" shall refer to challenges, matches, tournaments or other competitions that take place on the Website or in connection with the topcoder Open (\"TCO\"). You and any other user of this Website that enters any Submissions with respect to Competitions shall be referred to herein as a \"Contestant\" in such capacity.\r\n\r\n\r\n\r\nWe may revise these Terms of Use at any time without prior notice by updating this page and such revisions will be effective upon posting to this page. Please check this page periodically for any changes. Your continued use of this Website following the posting of any revisions to these Terms of Use will mean you accept those changes. We reserve the right to alter, suspend or discontinue any aspect of www.topcoder.com, including your access to it. Unless explicitly stated, any new features will be subject to these Terms of Use. \r\n\r\n\r\n
General Eligibility
\r\nOur Website is not intended for use by children under the age of 13. You must have your parents\" permission to use this Website if you have not reached the age of majority in your jurisdiction of primary residence and citizenship. You must be at least 18 years old and have reached the age of majority in your jurisdiction of primary residence and citizenship to participate in any Competitions. \r\n\r\n\r\nUnless otherwise stated in the rules of a Competition, you are not eligible to participate in such Competition if you are a resident of the Quebec province of Canada, Iran, Cuba, North Korea, Crimea Region of Ukraine, Sudan or Syria. In addition, you are not eligible to participate in any Competition if you are on the Specially Designated National list promulgated and amended, from time to time, by the United States Department of the Treasury.\r\n\r\n\r\nFor Competitions that offer a cash prize and/or to participate in TCO, additional eligibility requirements apply. Please see the \"Prize Payments\" and \"Additional TCO Terms\" sections of this Terms of Use for additional eligibility requirements.\r\n\r\n\r\nWe may assign, novate or subcontract any or all of our rights and obligations under these Terms of Use at any time. \r\n\r\n\r\nIf you have any questions regarding these Terms of Use, contact us at
support@topcoder.com.\r\n\r\n\r\n
Accounts; Passwords; Security
\r\nYou may need to set up an account in order to use some of the features of the Website. You may not use a third party\"s account without permission. When you are setting up your account, you must give us accurate and complete information. This means that you cannot set up an account using a name or contact information that does not apply to you, and you must provide accurate and current information on all registration forms that are part of the Website. You may only set up one account. You have complete responsibility for your account and everything that happens on your account. This means you need to be careful with your password. If you find out that someone is using your account without your permission, you must let us know immediately. You may not transfer your account to someone else. We are not liable for any damages or losses caused by someone using your account without your permission. However, if we (or anyone else) suffer any damage due to the unauthorized use of your account, you may be liable. \r\n\r\n\r\nBy registering for an account with us, you are also hereby registered to compete in the TCO. The TCO is a series of Competitions held in four (4) online periods (each, a \"Period\") throughout the year (which such periods are posted on the Website), and which leads up to an onsite tournament annually which will be held at a location and time to be determined by topcoder. Your registration and participation in the TCO constitutes agreement with any additional applicable TCO terms and conditions (the \"TCO Rules\") that topocder may impose at its sole discretion as well as these Terms of Use, including those available at: http://tco15.topcoder.com/overview/competition-rules/. NO PURCHASE NECESSARY TO ENTER OR WIN, A PURCHASE WILL NOT INCREASE YOUR CHANCE OF WINNING.\r\n\r\n\r\n
Competitions
\r\n\r\n\r\nIn addition to these Terms of Use, we may provide specific Official Rules and Regulations and other documentation for certain activities on this Website, including with respect to Competitions conducted by us and those in conjunction with third parties. These Terms of Use are incorporated by reference into the specific Official Rules and Regulations which appear in connection with information about a particular Competition. To the extent that any conflict exists between these Terms of Use and any specific Official Rules and Regulations, the Official Rules and Regulations for that Competition in which you choose to participate shall govern. \r\n\r\n
Ownership Rights of Submissions
\r\n
Winning Submissions
\r\n\r\nExcept with respect to \"Fun Challenges\", you hereby assign, grant and transfer and agree to assign, grant and transfer to us all right and title in and to any and all Submissions made by you in connection with a Competition for which you are paid a cash prize or other good and valuable compensation (or for which topcoder has in good faith made available for payment pending your completion of tocpoder\"s payment requirements) (any such Submission, a \"Winning Submission\"), along with any and all copyright, patent, trade secret, moral right, and other intellectual property rights, in and to any and all such Winning Submissions. To the extent any rights in a Winning Submission are not assignable, you hereby grant and agree to grant to topcoder under any and all such rights an irrevocable, paid-up, royalty free, perpetual, exclusive, sublicensable (directly or indirectly through multiple tiers), transferable, and worldwide license to use and permit others to use such Winning Submission in any manner desired by us (and/or our contest sponsors or customers) without restriction or accounting to you, including, without limitation, the right to make, have made, sell, offer for sale, use, rent, lease, import, copy, prepare derivative works, publicly display, publicly perform, and distribute all or any part of such Winning Submission and modifications and combinations thereof and to sublicense (directly or indirectly through multiple tiers) or transfer any and all such rights. Further, you hereby waive and agree to waive in favor of topcoder any moral right or other right or claim that is contrary to the intent of a complete transfer of rights to topcoder in each Winning Submission. You agree to promptly execute such documents and perform such acts as we may reasonably require to perfect our entire right, title, and interest in and to each and every Winning Submission, including a topcoder Competition Assignment Agreement if requested by topcoder and/or a sponsor of a Competition. \r\n\r\n\r\n
Other Submissions
\r\n\r\nExcept with respect to \"Fun Challenges\", the ownership rights in and to any Submission that is not a Winning Submission shall remain with the Contestant, except that to the extent you are required to enter into a Non-Disclosure Agreement in connection with a Competition (a \"Competition NDA\"), you understand and agree that the rights in and to any confidential information of the sponsor of a Competition shall remain the property of such Competition sponsor and you shall be bound by and the terms of such Competition NDA shall apply with respect to your rights in and to the Submission. The current version of the Competition NDA is posted in the \"direct tool\" available on the Website. In addition, by participating in a Competition and uploading a Submission, regardless of whether it is a Winning Submission or not, you consent to and you hereby grant Topcoder, other Topcoder members, Appirio, the Competition sponsor and their affiliates, employees, contractors and third parties engaged by them a license to review, revise, scan, comment on and/or update your Submission in connection with the Competition, without any payment to or further approval from you. You agree that this consent and license spans the length of the Competition and cannot be revoked.\r\n\r\n\r\n
Fun Challenges
\r\n\r\n\"Fun Challenges\" are Competitions that do not have any winners or prizes associated with them, and are intended purely for the fun of participating and collaborating with fellow topcoder members throughout the world. All Submissions in connection with Fun Challenges will be made publicly available and without any restrictions on use by anyone worldwide. By entering into a Fun Challenge and uploading a Submission in connection with a Fun Challenge, you hereby waive and release any and all ownership, copyright, patent, trade secret, moral right, and other intellectual property rights, in and to any and all such Submissions without the expectation of any payment or consideration of any kind.\r\n\r\n\r\n
Contest Materials
\r\n\r\nYou hereby further acknowledge and understand that Competition sponsors, topcoder and Appirio engage, has engaged and will in the future engage in the development, preparation, production, acquisition and dissemination of creative, educational, artistic and other material (collectively, the \"Materials\"), including without limitation Materials that may be similar or identical to your Submission. You also acknowledge that other persons, including our employees and employees of a Competition sponsor, may previously have originated and may hereafter originate Materials that are similar or identical to your Submission. You agree that you will not be entitled to any compensation because of the use by Sponsor of any such similar or identical material. Without limitation of the foregoing, we, our customers and any Competition sponsor may use, without any payment or other obligation whatsoever to you, any part of the Materials, and any idea or concept contained therein, that (a) is similar or identical to, or contains significant elements encompassed in, a concept that is under consideration or in development by us or the Competition sponsor before or at the time of your entry, (b) is not unique, novel, original, and concrete so as to be entitled to protection under applicable laws, (c) has been made public by anyone at the time of its submission to the Competition sponsor or us or otherwise is in the public domain, (d) would be freely usable by a third person if it had not been accepted as a Submission or the subject of any agreement, (e) is not protected by United States copyright law, or (f) is similar or identical to, or contains significant elements encompassed in, an idea, concept or material that is independently created by us, a Competition sponsor or any third party. You agree that our or a Competition sponsor\"s development, preparation, production, acquisition, dissemination and/or exploitation of Materials similar or identical to your Submission or containing features, ideas, material and/or elements similar to or identical with those contained in your Submission shall not entitle you to any compensation or other right or remedy. As an inducement to us or a Competition sponsor to accept your Submission for entry into the contest, you hereby waive any claim or right of action against us, the Competition sponsor\"s and their successors in connection with use of any Materials (or any portions thereof) whether or not such Materials are similar or identical to your Submission or contain any features, ideas, material and/or elements that are similar or identical to those contained in your Submission. Acceptance by us (or a Competition sponsor, as applicable) of a Submission is not an admission by us or a Competition sponsor of the novelty or originality of the Submission.\r\n\r\n\r\n\r\nUnless agreed otherwise in writing, the sponsor of a contest administered through the Website, topcoder or Appirio (as applicable) owns and will retain ownership (including all intellectual property rights) in and to any materials that are not Submissions, which materials may be tangible or intangible, that you develop that are a result of a contest administered through the Website (\"Contest Materials\"), and any modifications, improvements and derivative works thereto (including any such materials that incorporate any of Contestant\"s ideas, feedback or suggestions). \r\n\r\n\r\n
U.S. Federal Government Rights & Restrictions
\r\n\r\nFor any Competition sponsored by, on behalf of, or for the benefit of the U.S. Federal Government, Contestants may be subject to the Federal Acquisition Regulations and agree to comply with applicable provisions of the Federal Acquisition Regulations (\"FAR\") and all other laws and regulations applicable to providing goods and services to the U.S. Federal Government. In particular, Winning Submissions be considered \"Commercial Items\" and Contestants may be classified as \"Subcontractors\" according to the U.S. Federal Government, and by entering a Submission in connection with a Competition, the Contestant hereby agrees to be bound by all laws and regulations applicable to the sale of commercial items by subcontractors to the U.S. Federal Government including FAR 52.212-5(e) and FAR 52.244-6(c)(1).. \r\nUser Content\r\n\r\n\r\nYou are solely responsible for any User Content you post to the Website, and the consequences of posting or publishing it. By \"User Content\", we mean any Content you post to the Website. \"Content\" means information, data, text, software, music, sound, photos, graphics, videos, messages, tags, interactive features, or any other materials. When we say \"post\", we include posting, uploading, sharing, submitting or otherwise providing User Content in any manner in connection with the Website. For the avoidance of doubt, Submissions and Contest Materials are User Content.\r\n\r\n\r\nYou may not:\r\n\r\n
\r\n- Use our Website for any illegal purpose
\r\n- Submit User Content that you don\"t have the right to submit (including but not limited to material covered by someone else\"s copyright, patent, trade secret, privacy policy, publicity policy, or any other proprietary right)
\r\n- Disguise in any way the origin of any User Content you submit (including but not limited to forging headers)
\r\n- Submit any User Content that contains lies or misrepresentations that could damage Us or anyone else
\r\n- Submit User Content that is obscene, illegal, defamatory, libelous, threatening, pornographic, harassing, hateful, or encourages criminal conduct, give rise to civil liability, violate any law, or is otherwise inappropriate
\r\n- Transmit any advertising, promotional materials, junk mail, spam, chain letters, pyramid schemes or any other solicitation
\r\n- Impersonate anyone else or misrepresent your affiliation with any other person or entity
\r\n- Use meta tags or any other hidden text utilizing any of our or our suppliers\" names, products names, or trademarks
\r\n- Upload, launch, post email or transmit any material (including any bot, worm, spider, script, or virus) that may harm or corrupt this Website, or anyone else\"s computer systems or data
\r\n- Use our Website to harm minors in any way
\r\n- Collect or gather other people\"s personal information (including account information)
\r\n- Submit User Content that disparages us or our partners and affiliates
\r\n- Solicit any users of our Website for any commercial purpose
\r\n
\r\n\r\n\r\nWe have the sole right, but not necessarily the obligation, to delete at any time any User Content that violates these rules or that we believe to be inappropriate for any reason.\r\n\r\n\r\nIf you post User Content, you are making a guarantee to us that you either own all the Content you are posting, or you have the right to post the Content. Unless otherwise expressly permitted, you may not copy or include in any User Content any code from any third party, including \"open source\" code or other code that is or may be subject to license terms. Furthermore, you are guaranteeing that you have the right to allow us to make your User Content available for others to view and use as part of the Website without requiring that any such use be subject to additional obligations or terms. If you do not have these rights, do not post the Content. By posting your User Content, you do not lose any ownership rights you may have to it. However, unless otherwise governed by the Official Rules and Regulations governing a specific Competition, you do grant us a worldwide, irrevocable, non-exclusive, royalty-free, fully-paid, sublicenseable (through multiple tiers of distribution) and transferable license to use, reproduce, modify, distribute, prepare derivative works of, display, and perform your User Content in connection with the Website and our business, in any media formats or in tangible form and through any media channels now known or hereinafter developed. You also grant each user of the Website a non-exclusive royalty-free, fully-paid, sublicenseable and transferable license to access your User Content through the Website, and to use, reproduce, distribute, prepare derivative works of, display and perform your User Content as permitted through the functionality of the Website and under these Terms of Service.\r\n\r\n\r\nYou understand that once you post User Content, your content becomes public. We are not responsible for keeping any User Content confidential.\r\n\r\n\r\nWe generally do not review any of the User Content posted by our users. We do not endorse any User Content or support any views, opinions, recommendations, or advice that may be in user submissions. User Content comes from a variety of sources, and we make no promises about the reliability of any source or the accuracy, usefulness, safety, or intellectual property rights of any user submission. You may be offended by User Content that you see on the Website. You may find some of it to be inaccurate, offensive, indecent, or objectionable. However, you agree not to hold us responsible in any way for your use of our Website, including your exposure to User Content.\r\n\r\n\r\nWe reserve the right to remove any postings or other uploaded materials in response to complaints of infringement, obscenity or defamation or to otherwise review or edit such materials as appropriate, in our sole discretion and without notice.\r\n\r\n\r\nIn addition to the above terms governing User Content, as a condition of participating in the TCO, you agree to permit topcoder to describe, publicize, and link to any User Content submitted or posted in connection with TCO. You may not cheat; all ideas for Submissions submitted in connection with the TCO shall be solely yours; you may not collaborate on any Submissions entered in connection with the TCO unless otherwise set forth in the TCO Rules. IN ORDER TO BE ELIGIBLE FOR THE TCO, YOU WARRANT THAT YOUR SUBMISSION FOR EACH COMPETITION THAT IS PART OF THE TCO:\r\n\r\nDoes not include or anticipate the inclusion of any unsuitable or offensive content, including nudity, sexually explicit, disparaging, libelous or other inappropriate content;\r\n\r\n\r\nDoes not include or anticipate the inclusion of any content that is in violation of or infringes third party intellectual property rights including, but not limited to copyrights, including music copyrights, trademarks, and rights of publicity;\r\n\r\n\r\nHas not been entered in previous contests, or won previous awards;\r\n\r\n\r\nHas not been published or distributed previously in any media;\r\n\r\n\r\nIs suitable for a general audience; and\r\n\r\n\r\nDoes not contain any claims that are not and cannot be substantiated or that would be false and/or misleading to a reasonable consumer.\r\n\r\n
Copyright, Trademark and Other Intellectual Property
\r\n\r\n
Protection
\r\nExcept as otherwise indicated, this Website and its entire contents (including, but not limited to, the text, photographs, information, software, graphics, images, sound, and animation) are owned by us and are protected by domestic and international copyright, trademark, patent, and other intellectual property laws. All copyrightable text and graphics, the selection, arrangement, and presentation of all materials (including information in the public domain), and the overall design of this Website are \"2014 topcoder. All rights reserved. We hereby give you permission to download and print materials from this Website for the sole purposes of viewing, reading, and retaining for reference the materials for non-commercial use. Any other copying, distribution, retransmission, or modification of information or materials on this Website, whether in electronic or other form, without our express prior written permission is strictly prohibited. You further agree that you will not disassemble, decompile, reverse engineer or otherwise modify the material on this Website. Any unauthorized or prohibited use may subject the offender to civil liability and criminal prosecution under applicable laws. \r\n\r\n\r\n
Notice
\r\nAll trademarks, service marks, and trade names are proprietary to us or other respective owners that have granted us the right and license to use their marks. \r\n\r\n\r\n
Copyright Complaints
\r\nWe respect the intellectual property of others, and we ask you to do the same. We may, in appropriate circumstances and at our sole discretion, terminate the access of users who infringe the copyright rights of others. \r\nIf you believe that your work has been copied and is accessible at our Website in a way that constitutes copyright infringement, or that our Website contains links or other references to another online location that contains material or activity that infringes your copyright rights, you may notify us by providing our copyright agent the information required by the U.S. Online Copyright Infringement Liability Limitation Act of the U.S. Digital Millennium Copyright Act, 17 U.S.C. \"512. Our agent for notice of claims of copyright infringement on or regarding this Website can be reached as follows: \r\n\r\n\r\n
\r\n\r\n\r\nBY E-MAIL: | \r\nGC@appirio.com | \r\n
\r\n\r\nBY MAIL: | \r\nDan Lascell\r\n\r\nTopcoder, Inc.\r\n\r\n760 Market Street\r\n\r\nSan Francisco, CA 94102 | \r\n
\r\n\r\nBY PHONE: | \r\n(650) 268-9911 | \r\n
\r\n\r\n
\r\n\r\n\r\nRepeat infringers will be blocked from accessing the topcoder Website. \r\n\r\n\r\n
Marketing Materials
\r\n\r\n\r\nYou hereby authorize us and any Competition sponsors to publicize the results of any Competition, including your name and account name (handle). Contestant hereby grants to us and any Competition sponsors the absolute right and permission to use your name, address (city and state), testimonial statement (or statements in different words which have substantially the same meaning), voice, photograph and/or other likeness in any and all advertising and promotional materials, or to refrain from doing so, in any manner or media whatsoever, worldwide, for advertising and promotional purposes in conjunction with this and similar Competitions without notice to you and without further compensation. You shall have no right of approval, no claim to any compensation, and no claim arising out of the use, alteration, distortion or illusionary effect or use in any composite form of your name, address, testimonial statement, voice, photograph or likeness.\r\n\r\nYou understand that we own all photographs of you taken by us and we may copyright material containing such photographs.\r\n\r\n\r\n
Indemnification and Release
\r\nBy accessing our Website, you agree to indemnify us and any parent, subsidiary, sponsor or affiliated entities, our officers and employees, and officers and employees of any parent, subsidiary, sponsor or affiliated entities and hold them harmless from any and all claims and expenses, including attorney's fees, arising from your use of our Website including any material (including third-party material) that you post on our Website and any services or products available through our Website. In addition, you hereby release us and any parent, subsidiary, sponsor or affiliated entities, our officers and employees, and officers and employees of any parent, subsidiary, sponsor or affiliated entities from any and all claims, demands, debts, obligations, damages (actual or consequential), costs, and expenses of any kind or nature whatsoever, whether known or unknown, suspected or unsuspected, disclosed or undisclosed, that you may have against them arising out of or in any way related to such disputes and/or to any services or products available at our Website. You hereby agree to waive all laws that may limit the efficacy of such releases. \r\n\r\n\r\nBy registering and/or participating in the TCO or a Competition, you agree to release topcoder and any Competition sponsor(s), and its affiliates and agents, and the officers, employees, affiliates, advertising and promotions agencies, prize suppliers, and all of their employees, officers, directors, shareholder's and agents (collectively, the \"Releasees\") from any and all liability or any injuries, loss or damage of any kind arising from or in connection with the TCO or a Competition, the use of any Submission, or the acceptance or use of any prize won, except where prohibited by law. Releasees assume no responsibility for incomplete, misdirected, damaged or illegible entries nor for any delayed Submissions or those not received for whatever reason, including without limitation due to internet or e-mail server failure, telephone, human, or other higherror or for any technical or other malfunctions that may occur including any injury or damage to your or any other person's computer relating to or resulting from participation in the Tournament or a Competition or downloading any materials during or for the TCO or a Competition.\r\n\r\n\r\n
Disclaimer
\r\nTHE MATERIALS AND SERVICES ON OUR WEB SITE ARE PROVIDED \"AS IS\" AND WITHOUT WARRANTIES OF ANY KIND EITHER EXPRESS OR IMPLIED. TO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, WE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. WE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE MATERIALS WILL BE UNINTERRUPTED OR ERROR-FREE, THAT DEFECTS WILL BE CORRECTED, OR THAT THIS WEB SITE OR THE SERVER(S) THAT MAKES OUR WEB SITE AVAILABLE OR ANY ADVERTISED OR HYPERLINKED SITE ARE FREE OF VIRUSES OR OTHER HARMFUL COMPONENTS OR THAT OUR SITE, SERVER(S), ADVERTISED OR HYPERLINKED SITES WILL BE ACCESSIBLE AT ALL TIMES. WE DO NOT WARRANT THAT SUCH ERRORS, DEFECTS OR INTERRUPTIONS IN SERVICE WILL NOT AFFECT THE RESULTS OF OUR COMPETITIONS, AND WE DISCLAIM ANY RESPONSIBILITY FOR REDUCED PERFORMANCE IN COMPETITIONS DUE TO SUCH PROBLEMS. WE DO NOT WARRANT OR MAKE ANY REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF OUR WEB SITE WITH RESPECT TO CORRECTNESS, ACCURACY, RELIABILITY, GRAPHICS, LINKS OR OTHERWISE. YOU ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. TO THE EXTENT THAT APPLICABLE LAW MAY NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, THE ABOVE EXCLUSIONS MAY NOT APPLY TO YOU. \r\n\r\n\r\nDocuments, graphics and other materials appearing at our Website may include technical inaccuracies, typographical errors, and out-of-date information and use of such documents, graphics or other materials is at your own risk. \r\nYou represent and warrant that neither you nor any member of your immediate family, nor anyone living in your household, is an employee of topcoder or Competition sponsors, regardless of commitment date as sponsor, including any companies involved in the production (including prize suppliers), implementation and distribution of this tournament and their advertising or promotion agencies, parent companies, service providers, agents, officers, subsidiaries or affiliates, or any other persons or entities directly associated with the tournament, and that neither you nor any immediate family member nor anyone living in your household is connected with any of the above.\r\n\r\n\r\n
Limitation of Liability
\r\n\r\nTO THE FULLEST EXTENT PERMISSIBLE PURSUANT TO APPLICABLE LAW, TOPCODER] SHALL NOT BE LIABLE FOR ANY DAMAGES (INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES), WHETHER BASED ON WARRANTY, CONTRACT, TORT, OR ANY OTHER LEGAL THEORY, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR LOSS OF WINNINGS, DATA OR OTHER DAMAGE TO ANY OTHER INTANGIBLE PROPERTY, EVEN IF TOPCODER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, RESULTING FROM (i) THE USE OR INABILITY TO USE THIS WEB SITE, (ii) THE DISCLOSURE OF, UNAUTHORIZED ACCESS TO OR ALTERATION OF ANY TRANSMISSION OR DATA, (iii) THE STATEMENTS OR CONDUCT OF ANY THIRD PARTY OR (iv) ANY OTHER MATTER RELATING TO TOPCODER. \r\n\r\n\r\n
Prize Payment
\r\n\r\nYou understand that neither we, the Competition sponsors nor their parent corporations, subsidiaries, affiliates, agents, assigns, etc. or any entity connected with a Competition will be responsible for any costs (including, without limitation, any federal, state or local taxes) Contestant may incur in connection with any Contest or any prize Contestant may be awarded. However, Contestant understands that topcoder may make withholdings from any prize that Contestant may be awarded in order to comply with applicable tax laws. Contestant agrees to sign any applicable forms necessary to distribute the prize as required by tax authorities.\r\n\r\n\r\nAll cash prizes are listed and shall be awarded in USD. All prizes will be awarded in each Competition, provided a qualified number of Submissions are received and the requisite number of Contestants participate in a round of a Competition. A Competition sponsor may award prizes to more than one Submission with respect to any Competition. If a Contestant cannot or will not accept a prize, then the prize will be forfeited and may be awarded to the next highest scoring Submission. Unless otherwise provided herein, by participating in a Competition and/or the TCO, a Contestant acknowledges and agrees that if his/her Submission is selected as a winner, the Contestant will receive a cash award only upon verification of all applicable eligibility requirements. Cash prizes will be paid out by topcoder (or its designee) in the US in US dollars no later than 90 days following the conclusion of the Competition or the conclusion of the TCO (as applicable). Taxes, if any, are the sole responsibility of the winner(s). Prizes which remain unclaimed or undeliverable for a period of six (6) months will be forfeited. \r\n\r\n\r\nAs a condition of winning and redeeming a cash prize, Contestants will be required to submit a completed (i) Contestant Questionnaire and all post Competition surveys, (ii) if requested, an Affidavit of Eligibility and Liability and Publicity Release, unless a notarized copy is already on file with topcoder (iii) IRS Form W-9 or W-8BEN, as appropriate if one is not already on file with topcoder, (iv) with respect to the TCO, a topcoder Competition Assignment Agreement, if one is not already on file with topcoder, and (v) with respect to the TCO, a Travel form. In completing any requested Affidavit of Eligibility and Liability and Publicity Release, a Contestant who wins a cash prize (a) confirms his/her eligibility, (b) represents and warrants that he/she has not cheated, (c) verifies the accuracy of the demographic information submitted to, and contained in, the topcoder member database, (d) authorizes topcoder to publicize the results of the Competition and/or the TCO, (e) agrees to sign any applicable forms required by tax authorities, (f) grants topcoder a license to all information submitted during the Competition and/or the TCO, and (g) releases topcoder from liability arising out of any prize won. topcoder requires all Contestants to complete the Form W-9 or W-8BEN for tax reporting purposes. Providing false information in the registration process or in the required forms described in this paragraph will result in a forfeiture of a cash prize. If a winning Contestant (i) does not reply to a notification from topcoder or the notification is undeliverable, (ii) in the case of TCO, does not return a requested Affidavit of Eligibility/Liability/Publicity release completed and signed within ten (10) days of date of prize notification, or (iii) is not otherwise in compliance with these Rules or the rules of a Competition, the Contestant will be disqualified and forfeit any prize, and topcoder may, at our discretion, select and notify another Contestant. Participatory prizes and non-cash prizes will be mailed within one month following the conclusion of the Competition or the TCO (as applicable) to the address provided by the Contestant in their topcoder profile. Unclaimed or undeliverable participatory prizes will be forfeited. Contestants who do not submit the required information by the applicable deadlines forfeit their prizes. Please allow 6-12 weeks for delivery. If a Contestant\"s prize is returned, topcoder will resend that prize to a secondary address provided a request is made by the prizewinning Contestant. topcoder is not responsible for lost or stolen items and will not send additional prizes in the event a prize is not received. Each Contestant that participates in the Onsite portion of the TCO is eligible to receive only one (1) TCO T-shirt during the TCO, which may only be picked up by the Contestant at the TCO.\r\n\r\n\r\n
Links to Other Web Sites and Services
\r\n\r\nTo the extent that our Website contains links to other Websites and outside services and resources, we do not control the availability and content of those Websites, services or resources, nor do we necessarily review or endorse materials available at or through such other Websites. Viewing other Websites or utilizing outside services and resources is done at your own risk. We shall not be liable for any loss or damage caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource. \r\n\r\n\r\n
Other Restrictions on Conduct
\r\nWe are making the Website available to you for your information and personal use only. You may not (and you agree not to) use, copy, distribute, transmit, broadcast, sell, or do anything else with the Website for any other purpose.\r\n\r\n\r\nYou agree not to disrupt, modify or interfere with the functioning of our Website or any services provided on or through our Website or with any associated software, hardware or servers in any way and you agree not to impede or interfere with others' use of our Website. This includes your agreement that you will not cheat; that the idea for the code and/or challenge(s) submitted by you is yours alone. This also includes your agreement that you will not provide your topcoder information including, but not limited to, your topcoder handle and rating, to any third party for the purpose of pursuing employment opportunities without the written consent of topcoder. If you are contacted by a third-party regarding employment opportunities and/or media interest as a result in your participation in topcoder Competitions, you agree to promptly notify topcoder of such contact. You also agree not to alter or tamper with any information or materials on, or associated with our Website or services provided on or through our Website. \r\nWe do not necessarily endorse, support, sanction, encourage, verify or agree with the comments, opinions, or other statements made public at our Website by users through our Competitions, forums or other interactive services available at our Website. Any information or material sent by users to any forums, including advice and opinions, represents the views and is the responsibility of those users and does not necessarily represent our views. \r\n\r\n\r\nYou agree that no impediment exists to you joining the topcoder Website, and your participation in topcoder's Website and the Competitions it offers will not interfere with your performance of any other agreement or obligation which has been or will be made with any third party. \r\n\r\n\r\n
Provisions Applicable to Chinese Citizens and Expatriates Residing in China
\r\ntopcoder hereby incorporates into these Terms of Use and into our Privacy Policy the provisions of China's Decision on Safeguarding the Security of the Internet (the \"Decision\"). \r\n\r\n\r\nAccording to Section 1 of the Decision \"to ensure operational security of the Internet, the person or organization perpetrating any of the following acts in violation of the criminal law shall be penalized according to the criminal code:\r\n\r\n
\r\n- 1.\tUnauthorized penetration into the computer and information system of the state affair, national defense or high-tech departments of the state;
\r\n- 2.\tIntentional composition or dissemination of computer virus or other destructive programs, or attacking the computer system or telecommunication network and resulting in damage or destruction of such computer systems or telecommunication network;
\r\n- 3.\tUnauthorized disruption of operation of the computer network or telecommunication service and resulting in malfunction of such network or telecommunication systems in violation of the laws or regulations of the state.\"
\r\n
\r\n\r\nAccording to Section 2 of the Decision, \"to protect national security and social stability, the person or organization perpetrating any of the following acts in violation of the criminal law shall be penalized according to the criminal code:\r\n\r\n
\r\n- 1.\tDisseminating rumor or slander on the Internet, or publishing or diffusing maleficent information to instigate subversion of the state power or socialist system, advocate abruption of the country or harm unity of the country;
\r\n- 2.\tStealing or disclosing the national or military secrets on the Internet;
\r\n- 3.\tInstigating inter-ethnic enmity or prejudice, or disrupting ethnic unity on the Internet; and
\r\n- 4.\tEstablishing or organizing heresies on the Internet and impeding the implementation of laws and regulations of the state.\"
\r\n
\r\n\r\n\r\nSection 3 of the Decision also stipulates that \"to safeguard the order of the socialist market economy and social stability, the person or organization perpetrating any of the following acts in violation of the criminal law shall be penalized according to the criminal code:\r\n\r\n
\r\n- 1.\tSelling fake or shoddy goods on the Internet or making false or misleading propaganda of commodities on the Internet;
\r\n- 2.\tHurting others' commercial fame or reputation of products on the Internet;
\r\n- 3.\tInfringing upon others' intellectual property rights on the Internet;
\r\n- 4.\tCompiling and distributing false information on the Internet to affect securities or futures transactions or disrupt order of the financial markets; and
\r\n- 5.\tEstablishing pornographic web sites or web pages, providing links to pornographic web sites, or disseminating pornographic magazines, films, audio and videos materials or graphics on the Internet.\"
\r\n
\r\n\r\nSection 4 of the Decision stipulates that \"to protect the legal rights of personal safety and property of individuals, legal persons and other organizations, the person or organization perpetrating any of the following acts in violation of the criminal law shall be penalized according to the criminal code:\r\n\r\n
\r\n- 1.\tInsulting others or drawing up slanders against others on the Internet;
\r\n- 2.\tIllegally intercepting, modifying or deleting others' emails or other database materials and infringing rights of the citizen of freedom and secrets in communicating and letter transmitting; and
\r\n- 3.\tPerpetrating theft, fraud, or blackmailing on the Internet.\"
\r\n
\r\n\r\n
Choice of Law and Forum
\r\n\r\nThese Terms of Use are governed by the laws of the state of California. You hereby agree to submit to the exclusive jurisdiction of the courts of San Francisco County, California. To the extent that applicable laws have mandatory application to this agreement or give you the right to bring action in any other courts, the above limitations may not apply to you. Use of this Website is unauthorized in any jurisdiction that does not give full effect to all provisions of these Terms of Use. \r\n\r\n\r\n
Severability and Enforceability
\r\n\r\nIf any provision or portion of these Terms of Use is held illegal, invalid, or unenforceable, in whole or in part, it shall be modified to the minimum extent necessary to correct any deficiencies or replaced with a provision which is as close as is legally permissible to the provision found invalid or unenforceable and shall not affect the legality, validity or enforceability of any other provisions or portions of these Terms of Use. \r\n\r\n\r\n
Termination/Exclusion
\r\n\r\nWe reserve the right, in our sole discretion, to revoke any and all privileges associated with accessing and/or competing on our Website, and to take any other action we deem appropriate including but not limited to terminating or suspending your use of www.topcoder.com, for no reason or any reason whatsoever, including improper use of this Website or failure to comply with these Terms of Use. \r\n\r\n\r\n
Additional TCO Terms
\r\n\r\n
Eligibility
\r\nThe TCO and each Competition that is part of the TCO is open to all members of the topcoder Website who have agreed to these Terms of Use and who are at least 18 years of age at the time of registration and have attained the age of majority in their jurisdiction of primary residence and citizenship. In addition to the other terms and eligibility criteria set forth in these Terms and Use, to be eligible to participate in the TCO, you must be (i) a U.S. citizen, (ii) a lawful permanent resident of the U.S., (iii) a temporary resident, asylee, refugee of the U.S., or have a lawfully issued work authorization card permitting unrestricted employment in the U.S., or (iv) a non-U.S. resident authorized in the country in which the member resides while participating in the TCO to perform services as an independent contractor; or (v) with respect to any Competition designated by us as an \"Algorithm Competition\", be in the United States under a valid and current visa issued by the United States government which does not prohibit receiving a cash prize. \r\n\r\n\r\nViolation of these Terms of Use may result in disqualification from the TCO and/or further consequences as determined in our sole discretion. Current employees of topcoder and those involved in the development, production (including prize suppliers and sponsors), implementation and distribution of the TCO (including Competitions run as part of the TCO) and their advertising or promotion agencies, parent companies, service providers, agents, officers, subsidiaries or affiliates, or any other persons or entities directly associated with the TCO and members of their immediate families and/or persons living in the same household as such persons, are ineligible to enter the TCO and related Competitions. Current employees of any TCO sponsor (or Competition sponsor that is part of TCO) or their parent companies, subsidiaries or affiliates which such Competition sponsor or TCO Sponsor, as applicable, is involved in the preparation, administration or judging of the TCO (and any related Competitions) and members of their employees' immediate families and/or persons living in the same household as such employees, are ineligible to enter the TCO.\r\n\r\n\r\n
topcoder\"s Discretion regarding the TCO
\r\n\r\nAll decisions relating to the viability of Submissions, the ranking of Submissions and all other matters pertaining to the TCO are within the sole discretion of topcoder or its designee and shall be final and binding in all respects. By participating in the TCO and/or a Competition that is part of the TCO, a Contestant who wins a prize releases and agrees to hold harmless topcoder its affiliates, subsidiaries, sponsors, advertising and promotion agencies, and prize suppliers, and all of their respective directors, officers, employees, representatives and agents, from and against any and all liability for any loss, property damage or damage to person, including without limitation, death and injury, due in whole or in part, directly or indirectly, from or arising out of participation in the TCO, or participation in any TCO-related activity, or the receipt, use or misuse of a prize. topcoder reserves the right to limit the participation of any person in the TCO, amend or interpret these rules or official communications governing the TCO or cancel the TCO or any TCO-related Competition for any reason with prior notice. Notices for any such amendment, interpretation or cancellation will be deemed to have been given by posting on the Website and by virtue of a Contestant's continued participation in the TCO. A Contestant may terminate participation in the TCO upon written notice to topcoder.\r\n\r\n\r\n
TCO Logistics
\r\n\r\nAll Contestants who have advanced or won a trip to the onsite portion of the TCO (\"Onsite Contestants\") must arrive at the event no later than the date and time specified in the TCO Rules. All Onsite Contestants must confirm their attendance at the onsite event no later than the date specified in the TCO Rules. In order to confirm attendance, Onsite Contestants must have acquired any necessary travel visas and confirm their ability to travel to the United States no later than the date specified in the TCO Rules. If an Onsite Contestant is required to travel from outside the United States, the Onsite Contestant must show proof of a visa and/or passport by the date specified in the TCO Rules. Onsite Contestants may email a copy of their documents as instructed in the TCO Rules. Onsite Contestants who fail to meet this requirement may be replaced as an Onsite Contestant. Contestants who are otherwise eligible to compete in any or all of the Competitions will be permitted to participate in the online portions of any/all of them. However, in the event a Contestant advances to the onsite finals in more than one Competition and any of the times for the onsite rounds of the Competitions overlap, the Onsite Contestant may participate in either, but not both, Competitions. The Onsite Contestant must notify topcoder of the Competition in which she/he will participate as an Onsite Contestant no later than the date specified in the TCO Rules.\r\n\r\n\r\ntopcoderwill issue visa invitation letters (upon request) to international Contestants who require one to obtain a travel visa to enter the United States. All registered TCO Contestants may request a visa invitation letter in respect of the year of the upcoming TCO. Contestants must fill out the visa letter request form in its entirety before a visa letter will be mailed. Contestants have until the date and time specified in the TCO Rules to request a letter. Visas can take a significant amount of time to obtain in certain countries, so it is in a Contestant's best interests to request one well before the deadline. The cost of obtaining a visa is the sole responsibility of the Contestant. See more information about travel visas. The TCO involves a large number of visa applications by topcoder members. By applying for a visa to attend the TCO, Contestant understands that topcoder will cooperate with all requests by consulates, the Department of Homeland Security, and law enforcement in connection with such Contestant's visa, including information about the visa applicants' attendance at the TCO. Any abuse of the visa application process or any visa obtained for the TCO is considered a serious violation of US law and these Terms of Use, and, among other things, the Contestant will be subject to discipline by topcoder.\r\n\r\n\r\ntopcoder will provide air travel arrangements for each Onsite Contestant. The flight will be reserved and paid for by topcoder. Onsite Contestants will arrive on the date specified in the TCO Rules and depart the day after the final day of the Onsite portion of the TCO. At topcoder's sole discretion, topcoder will pay for each Onsite Contestant's airfare up to $1,500, but reserves the right to make exceptions to the maximum amount based on individual circumstances. If an Onsite Contestant wishes to take a flight other than the one provided by topcoder and/or wishes to stay at a hotel other than the one provided by topcoder, the Onsite Contestant shall be responsible for the entire cost of such deviation from the accommodations and travel arrangements provided by topcoder. In addition, the Onsite Contestant agrees to reimburse topcoder for any costs, penalties, fines or fees incurred by topcoder as a result of such deviation. Ground transportation to and from the airport will be provided for each Onsite Contestant by topcoder, as well as private hotel accommodations and certain meals. All other expenses are the responsibility of the Onsite Contestant. topcoder will not provide travel, lodging accommodations, or visa assistance for any guests of an Onsite Contestant. If an Onsite Contestant is eliminated or chooses not to utilize the travel accommodations provide by topcoder for any reason after he/she is confirmed as a finalist and travel accommodations have already been made for the Onsite Contestant by topcoder for the onsite finals, that Onsite Contestant may be held responsible for reimbursing topcoder for the cost of such accommodations. topcoder reserves the right to withhold any future cash prizes won by the Onsite Contestant until the cost of such accommodations has been fully reimbursed. Onsite Contestants must complete the following items and submit them to topcoder by the date specified in the TCO Rules (failure to submit these items will disqualify an Onsite Contestant from advancing to the onsite event):\r\n\r\n\r\nConfirmation of attendance/proof of travel documents \" Please confirm your attendance onsite as directed in the TCO Rules. If you require a passport and/or visa to visit the United States, you must show proof of your documents.\r\n\r\n\r\nPlease submit a member photo, if you have not already done so.\r\n\r\n\r\nPlease also submit a fun photo to be shared during your onsite introduction.\r\n\r\n\r\nPlease ensure the information listed in your topcoder profile is current. We may need to mail your plane tickets or contact you via telephone.\r\n\r\n\r\nComplete the Onsite Contestant Questionnaire - your responses may be published in the program for the TCO.\r\n\r\n\r\nTravel form - provide topcoder with the appropriate travel information for your trip to the onsite event.\r\n\r\n\r\nApplicable tax forms (unless one is already on file with topcoder).\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n",
- "agreed": false,
- "serverInformation": {
- "serverName": "Topcoder API",
- "apiVersion": "0.0.1",
- "requestDuration": 52,
- "currentTime": 1504892902498
- },
- "requesterInformation": {
- "id": "d8c441f8332161f71533f368c09aeead856e4366-K1RdFai7LCAgXVu5",
- "remoteIP": "12.34.56.78",
- "receivedParams": {
- "apiVersion": "v2",
- "termsOfUseId": "21193",
- "action": "getTermsOfUse"
- }
- }
-}
diff --git a/src/apps/earn/src/services/__mocks__/groups.js b/src/apps/earn/src/services/__mocks__/groups.js
deleted file mode 100644
index 8c049eea8..000000000
--- a/src/apps/earn/src/services/__mocks__/groups.js
+++ /dev/null
@@ -1,298 +0,0 @@
-/**
- * Service for communication with group-related part of Topcoder API.
- *
- * NOTE: Through this file, and in related contexts, by loading a user group,
- * or user groups data, we refer to loading the information about descendant
- * user groups; i.e. given some user group(s) we speak about loading the sub-
- * three of related child groups.
- *
- * By group maps we refer to the object having group IDs as the keys, and
- * group data objects as the values. Any group object included into a group map
- * has its "subGroups" array (if present) replaced by "subGroupIds", that lists
- * only the IDs of immediate child groups; actual child group objects from
- * "subGroups" are recursively added to the top level of the group map.
- * Also each group in the group map is timestamped to keep caching of
- * the loaded data.
- */
-
-import _ from "lodash";
-
-import config from "../../config";
-import logger from "../../utils/logger";
-
-import { getApi } from "./api";
-
-/* The value of USER_GROUP_MAXAGE constant converted to [ms]. */
-const USER_GROUP_MAXAGE = config.USER_GROUP_MAXAGE * 1000;
-
-/**
- * Given an array of IDs (or a single ID) of user groups, and a map of known
- * user groups, it returns the array including all specified user groups, and
- * all their known descendant groups.
- * @param {String|String[]} groupIds
- * @param {Object} knownGroups
- * @return {String[]}
- */
-export function addDescendantGroups(groupIds, knownGroups) {
- let res = _.isArray(groupIds) ? groupIds : [groupIds];
- const visitedGroupsIds = new Set();
- let pos = 0;
- while (pos < res.length) {
- const id = res[pos];
- if (!visitedGroupsIds.has(id)) {
- visitedGroupsIds.add(id);
- const g = knownGroups[id];
- if (g && g.subGroupIds) res = res.concat(g.subGroupIds);
- }
- pos += 1;
- }
- return _.uniq(res);
-}
-
-/**
- * Splits the given list of group IDs into the lists of groups being loaded,
- * loaded, and others.
- * @param {String|String[]} groupIds ID, or an array of IDs, of the group(s) we
- * are interested in.
- * @param {Object} knownGroups Optional. The map of already known groups (some
- * of them may be outdated, though). This should be of the same format as the
- * object on "groups.groups" path of the Redux store. Defaults to empty object.
- * @param {Object} loadingGroups Optional. Set of groups beign loaded now. This
- * should be of the same format as the object on "groups.loading" path of the
- * Redux store. Defaults to empty object.
- * @return {Object} Resulting object may hold four arrays with group IDs from
- * "groupIds" (empty arrays will not be included into the result object):
- * - "loaded" - the groups that are present in "knownGroups" and are not
- * outdated;
- * - "loading" - the groups that are not present in "knownGroups" (or present,
- * but outdated); but they are already being loaded;
- * - "missing" - the groups that are not present in "knownGroups"
- * (or outdated), and are not being loaded.
- * - "unknown" - the groups that are absent in "knownGroups" map.
- */
-export function checkGroupsStatus(
- groupIds,
- knownGroups = {},
- loadingGroups = {}
-) {
- const loaded = [];
- const loading = [];
- const missing = [];
- const unknown = [];
- const now = Date.now();
- const tested = new Set();
- const ids = _.isArray(groupIds) ? groupIds : [groupIds];
- ids.forEach((id) => {
- if (tested.has(id)) return;
- tested.add(id);
- const g = knownGroups[id];
- if (!g) unknown.push(id);
- if (g && (now - g.timestamp || 0) < USER_GROUP_MAXAGE) loaded.push(id);
- else if (loadingGroups[id]) loading.push(id);
- else missing.push(id);
- });
- return {
- loaded: loaded.length ? loaded : null,
- loading: loading.length ? loading : null,
- missing: missing.length ? missing : null,
- unknown: unknown.length ? unknown : null,
- };
-}
-
-/**
- * Returns "true" if "userGroups" arrays includes any group specified by
- * "groupIds", or any group descendant from a group specified by "groupIds".
- * The is the map of known groups
- * @param {String|String[]} groupIds
- * @param {Object[]|String[]} userGroups Array of user's groups or their IDs.
- * @param {Object} knownGroups Map of known groups.
- * @return {Boolean}
- */
-export function checkUserGroups(groupIds, userGroups, knownGroups) {
- const queue = _.isArray(groupIds) ? groupIds : [groupIds];
- if (!queue.length) return true;
- if (!userGroups.length) return false;
-
- /* Algorithmically, "knownGroups" stores, in compressed form, data on
- * known trees of user groups; and we want to check whether any of groups
- * from "userGroups" belong to sub-trees having groups from "groupIds" as
- * their roots. So, we do a breadth-frist search through the group trees. */
- const userGroupIds = new Set();
- const visitedGroupIds = new Set();
- userGroups.forEach((g) => userGroupIds.add(_.isObject(g) ? g.id : g));
- let pos = 0;
- while (pos < queue.length) {
- const id = queue[pos];
- if (userGroupIds.has(id)) return true;
- visitedGroupIds.add(id);
- const g = knownGroups[id];
- if (g && g.subGroupIds) {
- g.subGroupIds.forEach((sgId) =>
- !visitedGroupIds.has(sgId) ? queue.push(sgId) : null
- );
- }
- pos += 1;
- }
- return false;
-}
-
-/**
- * Private. Handles given response from the groups API.
- * @param {Object} response
- * @return {Promise} On success resolves to the data fetched from the API.
- */
-function handleApiResponse(response) {
- if (!response.ok) throw new Error(response.statusText);
- return response.json().then(({ result }) => {
- if (result.status !== 200) throw new Error(result.content);
- return result.content;
- });
-}
-
-/**
- * Private. Merges given user group (possibly a tree of user groups) into
- * groups map. This function intended only for internal use inside this module,
- * as it may mutate both arguments (hence, the corresponding ESLint rule is
- * disabled within this function), thus should be used only where it is safe.
- * For external use a similar function is provided by "../../utils/tc" module.
- * @param {Object} groups
- * @param {Object} group
- */
-function mergeGroup(groups, group) {
- /* eslint-disable no-param-reassign */
- const sg = group.subGroups;
- group.timestamp = Date.now();
- if (sg && sg.length) {
- group.subGroupIds = sg.map((g) => g.id);
- sg.forEach((g) => mergeGroup(groups, g));
- }
- delete group.subGroups;
- groups[group.id] = group;
- /* eslint-enable no-param-reassign */
-}
-
-class GroupService {
- /**
- * @param {String} tokenV3 Optional. Auth token for Topcoder API v3.
- */
- constructor(tokenV3) {
- this.private = {
- api: getApi("V3", tokenV3),
- tokenV3,
- };
- }
-
- /**
- * Adds new member to the group.
- * @param {String} groupId
- * @param {String} memberId
- * @param {String} membershipType
- * @return {Promise}
- */
- addMember(groupId, memberId, membershipType) {
- return this.private.api
- .postJson(`/groups/${groupId}/members`, {
- param: { memberId, membershipType },
- })
- .then(handleApiResponse);
- }
-
- /**
- * Gets detailed information about the group.
- *
- * Notice, when "withSubGroups" argument is true (default) this method returns
- * a tree of group data objects, connected via their "subGroups" fields.
- * getMap(..) method below wraps this functionality in a more practical way!
- *
- * @param {String} groupId
- * @param {Boolean} withSubGroups Optional. Defaults to true. Specifies,
- * whether the response should information about sub-groups, if any.
- * @return {Promise} On success resolves to the group data object.
- */
- getGroup(groupId, withSubGroups = true) {
- let url = `/groups/${groupId}`;
- if (withSubGroups) {
- url = `${url}/getSubGroups?includeSubGroups=true&oneLevel=false`;
- }
- return this.private.api.get(url).then(handleApiResponse);
- }
-
- /**
- * Gets detailed information about the specified user group(s) and their
- * descendant sub-groups.
- *
- * @param {String|String[]} groupIds Group ID, or an array of group IDs,
- * to query from Topcoder API.
- * @return {Promise} Resolves to the group map. That object will have group
- * IDs as the keys, and corresponding group data objects as the values. In
- * each group data object the "subGroups" field, if any, will be replaced by
- * "subGroupIds" (array of IDs of the immediate child groups), and the actual
- * data on the sub-groups will be moved to the root of the map object.
- * It also timestamps each fetched group.
- */
- getGroupMap(groupIds) {
- const res = {};
- const seen = new Set();
- const query = _.isArray(groupIds) ? groupIds : [groupIds];
- const promises = query.map((id) => {
- if (seen.has(id)) return null;
- seen.add(id);
- return this.getGroup(id)
- .then((group) => mergeGroup(res, group))
- .catch((err) => {
- /* In case we have failed to get some of the requested groups,
- * we just send error message to logs, and serve the result with
- * those groups that we managed to get. Otherwise it will be to
- * easy to break our code by minor mistakes in the group-related
- * configuration in the API and in the App. */
- logger.error(`Failed to get user group #${id}`, err);
-
- /* Empty group with timestamp is added to the result, as we still
- * want to cache the result, even if the result is that we cannot
- * load this group, at least for this visitor. */
- res[id] = { id, timestamp: Date.now() };
- });
- });
- return Promise.all(promises).then(() => res);
- }
-
- /**
- * Gets group members.
- * @param {String} groupId
- * @return {Promise} On sucess resolves to the array of member objects,
- * which include user IDs, membership time, and some bookkeeping data.
- */
- getMembers(groupId) {
- return this.private.api
- .get(`/groups/${groupId}/members`)
- .then(handleApiResponse);
- }
-
- /**
- * Gets the number of members in the group.
- * @param {Number|String} groupId ID of the group.
- * @param {Boolean} withSubGroups Optional. When this flag is set, the count
- * will include members of sub-groups of the specified group.
- * @return {Promise} Resolves to the members count.
- */
- async getMembersCount(groupId, withSubGroups) {
- _.noop(this);
- return withSubGroups ? 500 : 100;
- }
-}
-
-/**
- * Returns a new or existing instance of challenge service, which works with
- * the specified auth token.
- * @param {String} tokenV3 Optional. Topcoder API v3 auth token.
- * @return {GroupService} Instance of the service.
- */
-let lastInstance = null;
-export function getService(tokenV3) {
- if (!lastInstance || tokenV3 !== lastInstance.private.tokenV3) {
- lastInstance = new GroupService(tokenV3);
- }
- return lastInstance;
-}
-
-export default undefined;
diff --git a/src/apps/earn/src/services/__mocks__/terms.js b/src/apps/earn/src/services/__mocks__/terms.js
deleted file mode 100644
index 709591855..000000000
--- a/src/apps/earn/src/services/__mocks__/terms.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/**
- * Mock version of Terms service. To be used both for Jest testing, and for
- * manual testing inside the app (see MOCK_TERMS_SERVICE constant
- * in the app config).
- *
- * NOTE: At the moment this mock does not care much about authorization
- * (i.e. the presence of auth token), as the real backend api acts a bit
- * surprising and non-intuitive at the moment, so it is a bit difficult
- * to imitate it exactly.
- */
-
-import _ from "lodash";
-
-import termsAuth from "./data/terms-auth.json";
-import termsDocuSignDetails from "./data/terms-docu-sign-details.json";
-import termsNoAuth from "./data/terms-noauth.json";
-import termsReviewer from "./data/terms-reviewer.json";
-import termsReviewerDetails from "./data/terms-reviewer-details.json";
-import termsTopcoderDetails from "./data/terms-topcoder-details.json";
-
-let reviewTermsAgreed = false;
-
-class TermsService {
- /**
- * @param {String} tokenV2 Optional. Auth token for Topcoder API v2.
- */
- constructor(tokenV2) {
- this.private = {
- tokenV2,
- };
- }
-
- /**
- * Mock of getChallengeTerms(..) method.
- * The second argument is optional. If present, it should be an array of
- * boolean values, and it will override acceptance status of terms read
- * from the JSON data file.
- * @param {String} challengeId
- * @param {Array} agreed Optional.
- */
- getChallengeTerms(challengeId, agreed) {
- const res = _.clone(this.private.tokenV2 ? termsAuth : termsNoAuth);
- res.serverInformation.currentTime = Date.now();
- res.requesterInformation.receivedParams.challengeId = _.toString(
- challengeId
- );
- if (this.private.tokenV2 && _.isArray(agreed)) {
- for (let i = 0; i < Math.min(agreed.length, res.terms.length); i += 1) {
- res.terms[i].agreed = agreed[i];
- }
- }
- return Promise.resolve(res);
- }
-
- /**
- * Mock of getCommunityTerms(..) method.
- *
- * @param {String} communityId community id
- * @param {String} tokenV3 auth token V3
- * @param {Array} agreed Optional. If present, it should be an array of
- * boolean values, and it will override acceptance
- * status of terms read from the JSON data file.
- *
- * @return {Promise} resolves to the list of mocked terms
- */
- getCommunityTerms(challengeId, tokenV3, agreed) {
- const res = _.clone(this.private.tokenV2 ? termsAuth : termsNoAuth);
- res.serverInformation.currentTime = Date.now();
- if (this.private.tokenV2 && _.isArray(agreed)) {
- for (let i = 0; i < Math.min(agreed.length, res.terms.length); i += 1) {
- res.terms[i].agreed = agreed[i];
- delete res.terms[i].text;
- }
- }
- return Promise.resolve(res);
- }
-
- /**
- * Mock of getReviewOpportunityTerms(..) method.
- */
- /* eslint-disable class-methods-use-this */
- getReviewOpportunityTerms() {
- const res = _.clone(termsReviewer);
- res.terms[0].agreed = reviewTermsAgreed;
- res.terms[1].agreed = reviewTermsAgreed;
- return Promise.resolve(res);
- }
- /* eslint-enable class-methods-use-this */
-
- /**
- * Mock of getTermDetails(..) method.
- * In the case of Topcoder challenge terms there is "agreed" field in the
- * response. If the second argument is passed into this method, it will
- * override the value of this field from JSON file with mock data.
- * @param {Number} termId
- * @param {Boolean} agreed Optional.
- */
- getTermDetails(termId, agreed) {
- _.noop(this);
- let res;
- switch (termId) {
- case 20704:
- // eslint-disable-next-line
- agreed = reviewTermsAgreed;
- res = _.clone(termsReviewerDetails);
- break;
- case 21153:
- // eslint-disable-next-line
- if (reviewTermsAgreed) agreed = reviewTermsAgreed;
- res = _.clone(termsDocuSignDetails);
- break;
- case 21193:
- case 21194:
- res = _.clone(termsTopcoderDetails);
- break;
- default:
- throw new Error(`Unknown termId '${termId}'!`);
- }
- if (!_.isUndefined(agreed)) res.agreed = agreed;
- res.serverInformation.currentTime = Date.now();
- res.termsOfUseId = termId;
- res.requesterInformation.receivedParams.termsOfUseId = _.toString(termId);
- return Promise.resolve(res);
- }
-
- getDocuSignUrl(templateId, returnUrl) {
- _.noop(this);
-
- /* TODO: It has not been tracked explicitely, what is the response of
- * the real api here. It sure contains "recipientViewUrl", and this is
- * the only thing we need for our purposes now. However, it might also
- * have another useful datafields. This should be explored. */
- return Promise.resolve({
- recipientViewUrl: `/community-app-assets/api/mock/docu-sign?returnUrl=${returnUrl}`,
- });
- }
-
- agreeTerm(termId) {
- _.noop(termId, this);
-
- if (termId === 20704) {
- reviewTermsAgreed = true;
- }
-
- /* TODO: It has not been tracked explicitely, what is the response of
- * the real api here. It sure contains "success" field, and this is
- * the only thing we need for our purposes now. However, it might also
- * have another useful datafields. This should be explored. */
- return Promise.resolve({ success: true });
- }
-}
-
-/**
- * Returns a new or existing terms service.
- * @param {String} tokenV3 Optional. Auth token for Topcoder API v3.
- * @return {Object} Terms service object
- */
-let lastInstance = null;
-export function getService(tokenV2) {
- /* eslint-disable no-console */
- console.error(`WARNING:
- Mock version of DocuSign service is used! Should you see this message in
- production, contact support as soon as possible!`);
- /* eslint-enable no-console */
- if (!lastInstance || (tokenV2 && lastInstance.private.tokenV2 !== tokenV2)) {
- lastInstance = new TermsService(tokenV2);
- }
- return lastInstance;
-}
-
-/* Using default export would be confusing in this case. */
-export default undefined;
diff --git a/src/apps/earn/src/services/api.js b/src/apps/earn/src/services/api.js
deleted file mode 100644
index 4ea8599cd..000000000
--- a/src/apps/earn/src/services/api.js
+++ /dev/null
@@ -1,125 +0,0 @@
-import _, { keys } from "lodash";
-
-import { EnvironmentConfig } from "~/config";
-
-import { getAuthUserTokens } from "../utils/auth";
-import * as utils from "../utils";
-
-
-async function doFetch(endpoint, options = {}, v3, baseUrl) {
- const headers = options.headers ? { ...options.headers } : {};
- const token = await getAuthUserTokens();
- let url;
- if (baseUrl) {
- url = baseUrl;
- } else if (v3) {
- url = EnvironmentConfig.API.V3;
- } else {
- url = EnvironmentConfig.API.V5;
- }
-
- if (token) {
- headers.Authorization = `Bearer ${token.tokenV3}`;
- }
-
- return fetch(`${url}${endpoint}`, {
- ...options,
- headers,
- });
-}
-
-async function download(endpoint, baseUrl, cancellationSignal) {
- const options = {
- headers: { "Content-Type": "application/json" },
- signal: cancellationSignal,
- };
- const response = await doFetch(endpoint, options, undefined, baseUrl);
-
- return response;
-}
-
-async function get(endpoint, baseUrl, cancellationSignal) {
- const options = {
- headers: { "Content-Type": "application/json" },
- signal: cancellationSignal,
- };
- const response = await doFetch(endpoint, options, undefined, baseUrl);
- const meta = utils.pagination.getResponseHeaders(response);
- const result = await response.json();
- // only add pagination info if any field is filled
- if (keys(meta).some((key) => meta[key] !== 0)) result.meta = meta;
-
- return result;
-}
-
-async function post(endpoint, body, baseUrl) {
- const response = await doFetch(
- endpoint,
- {
- body,
- method: "POST",
- },
- undefined,
- baseUrl
- );
- // not all responses are json (example http code: 204), so returning just the response.
- return response;
-}
-
-async function put(endpoint, body) {
- const response = await doFetch(endpoint, {
- body,
- method: "PUT",
- });
- return response.json();
-}
-
-async function patch(endpoint, body) {
- const response = await doFetch(endpoint, {
- body,
- method: "PATCH",
- });
- return response.json();
-}
-
-/**
- * Upload with progress
- * @param {String} endpoint
- * @param {Object} body and headers
- * @param {Function} onProgress handler for update progress only works for client side for now
- * @return {Promise}
- */
-async function upload(endpoint, options, onProgress) {
- const base = EnvironmentConfig.API.V5;
- const { tokenV3 } = await getAuthUserTokens();
- const headers = options.headers ? _.clone(options.headers) : {};
- if (tokenV3) headers.Authorization = `Bearer ${tokenV3}`;
-
- return new Promise((res, rej) => {
- const xhr = new XMLHttpRequest(); //eslint-disable-line
- xhr.open(options.method, `${base}${endpoint}`);
- Object.keys(headers).forEach((key) => {
- if (headers[key] != null) {
- xhr.setRequestHeader(key, headers[key]);
- }
- });
- xhr.onload = (e) => res(e.target.responseText);
- xhr.onerror = rej;
- if (xhr.upload && onProgress) {
- xhr.upload.onprogress = (evt) => {
- if (evt.lengthComputable) onProgress(evt.loaded / evt.total);
- };
- }
- xhr.send(options.body);
- });
-}
-
-export default {
- doFetch,
- get,
- post,
- put,
- patch,
- upload,
- download,
-};
diff --git a/src/apps/earn/src/services/auth.js b/src/apps/earn/src/services/auth.js
deleted file mode 100644
index acba2411c..000000000
--- a/src/apps/earn/src/services/auth.js
+++ /dev/null
@@ -1,21 +0,0 @@
-import cookies from "browser-cookies";
-
-import { tokenGetAsync } from "~/libs/core";
-
-import store from '../store';
-import actions from '../actions';
-
-export const initAuth = async () => {
- const { auth } = store.getState();
- const { token: tokenV3 } = await tokenGetAsync();
- const tokenV2 = cookies.get("tcjwt");
-
- if (!auth.isInitialized) {
- store.dispatch(actions.auth.loadProfile(tokenV3 || null));
- store.dispatch(actions.auth.setTcTokenV3(tokenV3));
- store.dispatch(actions.auth.setTcTokenV2(tokenV2));
- store.dispatch(actions.auth.setAuthDone());
- }
-
- return { tokenV3, tokenV2 };
-}
diff --git a/src/apps/earn/src/services/challenge-api.js b/src/apps/earn/src/services/challenge-api.js
deleted file mode 100644
index 8acc81b91..000000000
--- a/src/apps/earn/src/services/challenge-api.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/**
- * @module "services.api"
- * @desc This module provides a service for conventient access to Topcoder APIs.
- */
-
-import _ from "lodash";
-import { EnvironmentConfig } from "~/config";
-
-import { delay } from "../utils/time";
-import { setErrorIcon, ERROR_ICON_TYPES } from "../utils/errors";
-
-/* The minimal delay [ms] between API calls. To avoid problems with the requests
- * rate limits configured in Topcoder APIs, we throttle requests rate at the
- * client side, and at server-side, in dev mode (which is meant to be used for
- * local development. */
-const MIN_API_CALL_DELAY = process.env.APPMODE === "development" ? 1000 : 200;
-
-let lastApiCallTimestamp = Date.now();
-
-/**
- * @static
- * @member default
- * @desc The default export from the module is
- * {@link module:services.api~Api} class.
- */
-
-/**
- * API service object. It is reused for both Topcoder API v2 and v3,
- * as in these cases we are fine with the same interface, and the only
- * thing we need to be different is the base URL and auth token to use.
- */
-class Api {
- /**
- * Creates a new Api object.
- * @param {String} base Base URL of the API.
- * @param {String} token Optional. Authorization token.
- */
- constructor(base, token) {
- this.private = {
- base,
- token,
- };
- }
-
- /**
- * Sends HTTP request to the specified API endpoint. This method is just
- * a convenient wrapper around isomorphic fetch(..):
- *
- * - If API service has auth token, Authorization header is automatically
- * added to the request;
- *
- * - If no Content-Type header set in options, it is automatically set to
- * "application/json". In case you want to avoid it, pass null into
- * Content-Type header option.
- *
- * For additional details see https://github.github.io/fetch/
- * @param {String} enpoint Should start with slash, like /endpoint.
- * @param {Object} options Optional. Fetch options.
- * @return {Promise} It resolves to the HTTP response object. To get the
- * actual data you probably want to call .json() method of that object.
- * Mind that this promise rejects only on network errors. In case of
- * HTTP errors (404, etc.) the promise will be resolved successfully,
- * and you should check .status or .ok fields of the response object
- * to find out the response status.
- */
- async fetch(endpoint, options = {}) {
- const { base, token } = this.private;
- const headers = options.headers ? _.clone(options.headers) : {};
- if (token) headers.Authorization = `Bearer ${token}`;
-
- switch (headers["Content-Type"]) {
- case null:
- delete headers["Content-Type"];
- break;
- case undefined:
- headers["Content-Type"] = "application/json";
- break;
- default:
- }
-
- const now = Date.now();
- lastApiCallTimestamp += MIN_API_CALL_DELAY;
- if (lastApiCallTimestamp > now) {
- await delay(lastApiCallTimestamp - now);
- } else lastApiCallTimestamp = now;
-
- return fetch(`${base}${endpoint}`, {
- ...options,
- headers,
- }).catch((e) => {
- setErrorIcon(ERROR_ICON_TYPES.NETWORK, `${base}${endpoint}`, e.message);
- throw e;
- });
- }
-
- /**
- * Sends DELETE request to the specified endpoint.
- * @param {String} endpoint
- * @param {Blob|BufferSource|FormData|String} body
- * @return {Promise}
- */
- delete(endpoint, body) {
- return this.fetch(endpoint, {
- body,
- method: "DELETE",
- });
- }
-
- /**
- * Sends GET request to the specified endpoint.
- * @param {String} endpoint
- * @return {Promise}
- */
- get(endpoint) {
- return this.fetch(endpoint);
- }
-
- /**
- * Sends POST request to the specified endpoint.
- * @param {String} endpoint
- * @param {Blob|BufferSource|FormData|String} body
- * @return {Promise}
- */
- post(endpoint, body) {
- return this.fetch(endpoint, {
- body,
- method: "POST",
- });
- }
-
- /**
- * Sends POST request to the specified endpoint, with JSON payload.
- * @param {String} endpoint
- * @param {JSON} json
- * @return {Promise}
- */
- postJson(endpoint, json) {
- return this.post(endpoint, JSON.stringify(json));
- }
-
- /**
- * Sends PUT request to the specified endpoint.
- * @param {String} endpoint
- * @param {Blob|BufferSource|FormData|String} body
- * @return {Promise}
- */
- put(endpoint, body) {
- return this.fetch(endpoint, {
- body,
- method: "PUT",
- });
- }
-
- /**
- * Sends PUT request to the specified endpoint.
- * @param {String} endpoint
- * @param {JSON} json
- * @return {Promise}
- */
- putJson(endpoint, json) {
- return this.put(endpoint, JSON.stringify(json));
- }
-
- /**
- * Sends PATCH request to the specified endpoint.
- * @param {String} endpoint
- * @param {Blob|BufferSource|FormData|String} body
- * @return {Promise}
- */
- patch(endpoint, body) {
- return this.fetch(endpoint, {
- body,
- method: "PATCH",
- });
- }
-
- /**
- * Sends PATCH request to the specified endpoint.
- * @param {String} endpoint
- * @param {JSON} json
- * @return {Promise}
- */
- patchJson(endpoint, json) {
- return this.patch(endpoint, JSON.stringify(json));
- }
-
- /**
- * Upload with progress
- * @param {String} endpoint
- * @param {Object} body and headers
- * @param {Function} callback handler for update progress only works for client side for now
- * @return {Promise}
- */
- // upload(endpoint, options, onProgress) {
- // const { base, token } = this.private;
- // const headers = options.headers ? _.clone(options.headers) : {};
- // if (token) headers.Authorization = `Bearer ${token}`;
- // if (isomorphy.isClientSide()) {
- // return new Promise((res, rej) => {
- // const xhr = new XMLHttpRequest(); //eslint-disable-line
- // xhr.open(options.method, `${base}${endpoint}`);
- // Object.keys(headers).forEach((key) => {
- // if (headers[key] != null) {
- // xhr.setRequestHeader(key, headers[key]);
- // }
- // });
- // xhr.onload = (e) => res(e.target.responseText);
- // xhr.onerror = rej;
- // if (xhr.upload && onProgress) {
- // xhr.upload.onprogress = (evt) => {
- // if (evt.lengthComputable) onProgress(evt.loaded / evt.total);
- // };
- // }
- // xhr.send(options.body);
- // });
- // }
- // return this.fetch(endpoint, options);
- // }
-}
-
-export default Api;
-
-/*
- * Topcoder API
- */
-const lastApiInstances = {};
-
-/**
- * Returns a new or existing Api object for Topcoder API.
- * @param {String} version The API version.
- * @param {String} token Optional. Auth token for Topcoder API.
- * @return {Api} API service object.
- */
-export function getApi(version, token) {
- if (!version || !EnvironmentConfig.API[version]) {
- throw new Error(`${version} is not a valid API version`);
- }
- if (
- !lastApiInstances[version] ||
- lastApiInstances[version].private.token !== token
- ) {
- lastApiInstances[version] = new Api(EnvironmentConfig.API[version], token);
- }
- return lastApiInstances[version];
-}
-
-/**
- * Keep the old API factories for backwards compatibility
- * DO NOT USE THEM FOR NEW IMPLEMENTATIONS.
- * USE THE getApi(version, token) FACTORY.
- */
-export const getApiV2 = (token) => getApi("V2", token);
-export const getApiV3 = (token) => getApi("V3", token);
-export const getApiV4 = (token) => getApi("V4", token);
-export const getApiV5 = (token) => getApi("V5", token);
diff --git a/src/apps/earn/src/services/challenge.js b/src/apps/earn/src/services/challenge.js
deleted file mode 100644
index 50d1603a9..000000000
--- a/src/apps/earn/src/services/challenge.js
+++ /dev/null
@@ -1,117 +0,0 @@
-import api from "./api";
-import { decodeToken, } from "tc-auth-lib";
-import qs from "qs";
-import _ from "lodash";
-import * as util from "../utils/api";
-import { getAuthUserTokens } from "../utils/auth";
-
-/**
- * @internal
- */
-async function getChallengeDetails(endpoint, legacyInfo) {
- let query = "";
- if (legacyInfo) {
- query = `legacyId=${legacyInfo.legacyId}`;
- }
-
- const url = `${endpoint}?${query}`;
- const result = await api.get(url).then(util.tryThrowError);
-
- return {
- challenge: legacyInfo ? result[0] : result,
- };
-}
-
-/**
- * Gets challenge registrants from Topcoder API.
- * @param {Number|String} challengeId
- * @return {Promise} Resolves to the challenge registrants array.
- * @internal
- */
-async function getChallengeRegistrants(challengeId) {
- /* If no token provided, resource will return Submitter role only */
- const roleId = (await isLoggedIn())
- ? await getRoleId("Submitter")
- : undefined;
- const params = {
- challengeId,
- roleId,
- };
-
- let registrants = await api
- .get(`/resources?${qs.stringify(params)}`)
- .then(util.tryThrowError);
-
- /* API will return all roles to currentUser, so need to filter in FE */
- if (roleId) {
- registrants = _.filter(registrants, (r) => r.roleId === roleId);
- }
-
- return registrants || [];
-}
-
-/**
- * @internal
- */
-async function isLoggedIn() {
- const { tokenV3 } = await getAuthUserTokens();
- return !!tokenV3;
-}
-
-/**
- * Get the Resource Role ID from provided Role Name
- * @param {String} roleName
- * @return {Promise}
- * @internal
- */
-async function getRoleId(roleName) {
- const params = {
- name: roleName,
- isActive: true,
- };
- const roles = await api
- .get(`/resource-roles?${qs.stringify(params)}`)
- .then(util.tryThrowError);
-
- if (_.isEmpty(roles)) {
- throw new Error("Resource Role not found!");
- }
-
- return roles[0].id;
-}
-
-async function getChallenge(challengeId) {
- let challenge = {};
- let isLegacyChallenge = false;
- let isRegistered = false;
- let registrants = [];
- const { tokenV3 } = await getAuthUserTokens();
- const memberId = tokenV3 ? decodeToken(tokenV3).userId : null;
- alert("In service getChallenge");
- if (/^[\d]{5,8}$/.test(challengeId)) {
- isLegacyChallenge = true;
- challenge = await getChallengeDetails("/challenges/", {
- legacyId: challengeId,
- }).then((res) => res.challenge);
- } else {
- challenge = await getChallengeDetails(`/challenges/${challengeId}`).then(
- (res) => res.challenge
- );
- }
-
- if (challenge) {
- registrants = await getChallengeRegistrants(challenge.id);
- isRegistered =
- memberId && _.some(registrants, (r) => `${r.memberId}` === `${memberId}`);
- }
-
- return {
- ...challenge,
- isRegistered,
- };
-}
-
-export default {
- getChallenge,
- getChallengeRegistrants,
-};
diff --git a/src/apps/earn/src/services/challenges.js b/src/apps/earn/src/services/challenges.js
deleted file mode 100644
index b7e5f2ba0..000000000
--- a/src/apps/earn/src/services/challenges.js
+++ /dev/null
@@ -1,898 +0,0 @@
-/**
- * @module "services.challenges"
- * @desc This module provides a service for convenient manipulation with
- * Topcoder challenges via TC API.
- */
-
-import _ from "lodash";
-import moment from "moment";
-import qs from "qs";
-
-import { EnvironmentConfig } from "~/config";
-
-import api from "./api";
-import { buildQueryString } from "../utils/url";
-import { decodeToken } from "../utils/token";
-import logger from "../utils/logger";
-import { setErrorIcon, ERROR_ICON_TYPES } from "../utils/errors";
-import { COMPETITION_TRACKS, getApiResponsePayload } from "../utils/tc";
-
-import { getApi } from "./lib/api";
-import { getService as getMembersService } from "./members";
-import { getService as getSubmissionsService } from "./submissions";
-
-/**
- * Search challenges
- *
- * @return {Array