From 9ed75745eae5f0ad193d098737ca3887d1402bdc Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Thu, 19 May 2022 15:35:03 -0500 Subject: [PATCH] Squashed commit of the following: commit d6f48a8338d84b082d791c964e9ef4b629200b22 Author: Rene Vergara Date: Thu May 19 15:15:09 2022 -0500 Bump version commit c40c742b811d16fe14869f2206a00cf6412d513d Author: Rene Vergara Date: Thu May 19 15:13:41 2022 -0500 Remove legacy backend and update license commit b8ea3e79cf2b93e4405a12cd3ee04f930ea3d8a8 Author: Rene Vergara Date: Wed May 18 16:07:26 2022 -0500 Integrate the settings component commit 79e73ec89d3a23ea82862e8897e7b58b111e485f Author: Rene Vergara Date: Wed May 18 15:51:39 2022 -0500 Integrate with new backend commit 68d03b6602872b648b43b4f22f643b223a1d7586 Author: Rene Vergara Date: Tue Apr 19 15:36:30 2022 -0500 Fix #2 commit d4be174b2dd0c3dac209ab9cf90bf24af11db573 Author: Rene Vergara Date: Mon Apr 11 09:31:08 2022 -0500 Add MIT license commit 6dddceff55410963383db5e9c3385cad41e904dd Author: Rene Vergara Date: Sun Apr 10 09:41:16 2022 -0500 Update README commit 8e98bff2ae5b7e2ba1cb68a72fba1b36e7a67b52 Author: Rene Vergara Date: Fri Apr 8 18:23:13 2022 -0500 Implement receipt QR code commit 934e28446c56548ed86cb67cf0b36c4a7844793a Author: Rene Vergara Date: Fri Mar 25 18:57:02 2022 -0500 Begin receipt component commit 4f0253e6b222ed636701df4c74d89b9c6bd65237 Author: Rene Vergara Date: Mon Mar 7 14:53:10 2022 -0600 Enable zats on display commit 42dbd88e2819e4cd02f4df11b92834c9e9d97d7f Author: Rene Vergara Date: Mon Mar 7 13:46:00 2022 -0600 Enable front end setting for zats commit 29a90b86140bf5c00e02831fc966b5aed6784832 Author: Rene Vergara Date: Mon Mar 7 13:45:45 2022 -0600 Fix bug for payment read commit 8130856d8fca04d58f7daab56c1092a62b5eb80d Author: Rene Vergara Date: Mon Mar 7 11:14:29 2022 -0600 Add zats setting parameter to backend commit 43c34958f1553686d8750e2c4cfa3f644a87993a Author: Rene Vergara Date: Tue Feb 8 13:38:29 2022 -0600 Improve biz form arrangement commit 0ca495a81151593f4a51ed1d46550976f20aefd1 Author: Rene Vergara Date: Wed Feb 2 12:30:05 2022 -0600 Update app version commit 770852640c26a1b862718e22e599b2350636dd92 Author: Rene Vergara Date: Wed Feb 2 12:26:58 2022 -0600 Fix bug of detecting payment commit a42f04cd4a205dde30a3cddb07bba8b100deb6d1 Author: Rene Vergara Date: Wed Feb 2 12:26:21 2022 -0600 Fix bug when deleting the last item commit a22dc1aac32cecf294c853d2226fd22d08ccaf51 Author: Rene Vergara Date: Wed Feb 2 10:36:29 2022 -0600 Update app version commit f33a920d2967f7bce4def2e1f66a9965f90d75fd Author: Rene Vergara Date: Tue Feb 1 12:56:02 2022 -0600 Refactor the confirm dialog to re-use commit 372c7eacf5f1f91fad165b66b2a372b6dc7689f9 Author: Rene Vergara Date: Tue Feb 1 12:04:16 2022 -0600 Enable logout commit ba631ebf24a804cd71bcc6c4f1bae0b48ce79f65 Author: Rene Vergara Date: Mon Jan 31 15:32:46 2022 -0600 Fix bug on order saving commit d61a1169fdb7efc4e47ec55554dcdadb63e72779 Author: Rene Vergara Date: Fri Jan 28 15:38:27 2022 -0600 Update title look of Cancel component commit 5c36be8fc7bff34ada91fbb3334888955bffd1c4 Author: Rene Vergara Date: Fri Jan 28 15:37:41 2022 -0600 Update look of Terms of Use commit 5e5089af437aa7c3764ec720bc36a4ed3f2aaafd Author: Rene Vergara Date: Fri Jan 28 14:03:35 2022 -0600 Add business contact name commit 031c4f8a87dd9b9ddf42908d68e1713dde74f1c0 Author: Rene Vergara Date: Fri Jan 28 14:03:05 2022 -0600 Add Terms of Use commit 8a165eefb6dce94b9cd9cb8aec6ad4a889e9c79b Author: Rene Vergara Date: Tue Jan 25 16:41:23 2022 -0600 Look and feel improvements for wide screens commit aaed1441515567088c18769d7a0ffb680e50b1a3 Author: Rene Vergara Date: Tue Jan 25 15:54:31 2022 -0600 Update font commit 323ffcc50b12db1fa22f31faf4cd81e7c25b56e5 Author: Rene Vergara Date: Tue Jan 25 15:20:01 2022 -0600 Implement payment checks in API commit d8380ec33f5ea44c1e31ea9d5db4865fa4b5b648 Author: Rene Vergara Date: Sat Jan 22 07:50:39 2022 -0600 Update modules commit f5a14bf7d7136b86d9e4b5788daf904038b69bce Author: Rene Vergara Date: Sat Jan 22 07:49:22 2022 -0600 Implement biz info form commit 5f80b1d9123ff29e4e6317a9d7fa92cd24a0526c Author: Rene Vergara Date: Wed Jan 19 14:50:00 2022 -0600 Implement Country search commit 881bb1baf199d4cd66670eb90799936048f91103 Author: Rene Vergara Date: Wed Jan 19 10:26:25 2022 -0600 Add country field commit ea8febe3681e3a9fb7a5bc8026231b002b4435cf Author: Rene Vergara Date: Tue Jan 18 16:40:50 2022 -0600 Create component for business info commit 0044f25edb2dc30ff6f0bc13dac188a4db1fe540 Author: Rene Vergara Date: Tue Jan 18 16:40:36 2022 -0600 Modify login routing commit 36242cffb960dcc6372330424e74bd7c9dcee5bd Author: Rene Vergara Date: Tue Jan 18 16:40:20 2022 -0600 Add website field to owner commit 57d06873f5dc80e5ce73b120e9996310104c29f6 Author: Rene Vergara Date: Mon Jan 17 14:49:21 2022 -0600 Change auth guard to check for payment commit c40ac0fd44bc8a16a2fd0b026dbf118e29c87fee Author: Rene Vergara Date: Mon Jan 17 14:49:08 2022 -0600 Add new fields for Owner commit c9f84f1a2879b48eed8d36b56c500312fdf5f4b6 Author: Rene Vergara Date: Mon Jan 17 13:39:26 2022 -0600 Update API server to process logins and pays commit 57781690a0613afef7a083da2c139bccd5626e77 Author: Rene Vergara Date: Mon Jan 17 12:14:33 2022 -0600 Add payment schema commit 18f1667a00a6208006cec659bc3913aef1f45a9b Author: Rene Vergara Date: Sat Jan 15 07:59:25 2022 -0600 Add new font and update login commit 1134f1760c82b6dcb2f5320272b02079461be4a4 Author: Rene Vergara Date: Sat Jan 15 07:58:56 2022 -0600 Allow for memo amount in scan component commit f6a41f38930d9873b9747f0f2de02416b06f8dc4 Merge: 47f2903 55dc475 Author: Rene Vergara Date: Fri Jan 14 16:17:41 2022 -0600 Merge branch 'master' into dev commit 47f2903d982d32c14d10373eed84b9368417e998 Author: Rene Vergara Date: Fri Jan 14 16:11:50 2022 -0600 Change look of login commit cfd3d0852f09b2b1befa37e2821dda1699ce4715 Author: Rene Vergara Date: Fri Jan 14 15:47:31 2022 -0600 Add copyright and CoinGecko attribution commit 55dc475a6a53b8afa59df09ad01eb8372a8a8850 Author: Rene Vergara Date: Tue Nov 23 14:44:46 2021 -0600 Correct item create form commit 2596c3628969fd7f1ea90ac35819a51e067b4e94 Author: Rene Vergara Date: Mon Nov 22 14:37:45 2021 -0600 Implement flexible currency commit 078916f92de3c863efb21ca3657806f408df4105 Author: Rene Vergara Date: Thu Nov 18 16:49:34 2021 -0600 Change stepper to not editable commit c1c60a4e2084eba7e0fea992f43cc3a3d7fb32e0 Author: Rene Vergara Date: Thu Nov 18 16:40:19 2021 -0600 Improved wording for login commit 2f610c8f7f339656d7eac1f53579b732f88219f7 Author: Rene Vergara Date: Thu Nov 18 16:38:25 2021 -0600 Implement stepper for login commit e5ff05d814f4824a1a53cbc870ab1f7aaff08d38 Author: Rene Vergara Date: Thu Nov 18 09:57:22 2021 -0600 Enhance UI look and feel commit 2265ab6512bbbb1caddc002bc5c66d21800d1f8f Merge: b48f10f fb46c62 Author: Rene Vergara Date: Wed Nov 17 16:07:26 2021 -0600 Merge branch 'master' into dev commit b48f10fe03a894d59ef372290c851d15d07cf6bb Author: Rene Vergara Date: Wed Nov 17 16:03:46 2021 -0600 Enhance login screen commit ed46fd9b234e31b254d3ca196914899b2d6a02e3 Author: Rene Vergara Date: Wed Nov 17 14:23:24 2021 -0600 upgrade Angular commit 0871a73cc25b03be810f9a3b86aedd5020596d03 Author: Rene Vergara Date: Wed Nov 17 14:14:34 2021 -0600 Add new logo files commit fb46c626ec77cfb10219998902e6e0a5dcdb3e63 Author: Rene Vergara Date: Sat Nov 13 07:05:54 2021 -0600 Correct wallet link commit 8e3c773d1e6e2167dbccbdbd602bc02616044e0b Author: Rene Vergara Date: Sat Nov 13 06:51:20 2021 -0600 Adjust look of scan component commit 5c043b1e0e46b15ba215f47fc2d5c32560a4df51 Author: Rene Vergara Date: Sat Nov 13 06:34:28 2021 -0600 Reduced required confirmations to 6 commit 01dcdaecd095e30e75f86d3a9100388a7c8b5518 Author: Rene Vergara Date: Sat Nov 13 06:33:51 2021 -0600 Ensure all txs are logged to DB Not just the ones with the proper memo commit 1336cc200964ff7ea7c553f86c6187bb62b75c7c Author: Rene Vergara Date: Fri Nov 12 11:16:21 2021 -0600 Add link for wallets on the same device commit f3e8bf22e334c3a2882630a5063f4548f40ab483 Author: Rene Vergara Date: Thu Nov 11 13:52:07 2021 -0600 Fix some issues tracking unconfirmed txs commit 997276638f5747058e9f972d7040627e068fabe3 Author: Rene Vergara Date: Thu Nov 11 09:24:43 2021 -0600 update gitignore commit 7145a437b43820b59decf933cc5d26dd44a2838a Author: Rene Vergara Date: Thu Nov 11 09:18:38 2021 -0600 Adjust visuals for small screens commit b66650d34dd7ada3fa01dc96137842b83c931cdb Author: Rene Vergara Date: Wed Nov 10 09:25:26 2021 -0600 Implement session length selector commit 648324ba5f5af254db937973c11f8a2d5ff2db6f Author: Rene Vergara Date: Tue Nov 9 15:00:01 2021 -0600 Implement monitoring of unconfirmed logins commit d05292b365dc59ae4115b0c02f75c67423b71a07 Author: Rene Vergara Date: Tue Nov 9 12:39:16 2021 -0600 Add API authentication commit dacb8dbafb8eb984650cea25bb63c651b5f7ed6e Author: Rene Vergara Date: Mon Nov 8 14:37:26 2021 -0600 Parametrize backend url commit f33666bd0e393a584bd201a846937fce278d7079 Author: Rene Vergara Date: Mon Nov 8 13:09:16 2021 -0600 Implement backend https commit 0a4dda4d73aa904120fde28da9816fb7052bd681 Author: Rene Vergara Date: Sat Nov 6 07:14:27 2021 -0500 Adjust session expiration commit 99bec8f73962c5f9d9599af36eb26828d9f6a4f7 Author: Rene Vergara Date: Fri Nov 5 16:32:01 2021 -0500 Implement list of orders Also corrects font in css files commit b88fe7fc20da0bdffac6dc0c6fdfee4632541f7c Author: Rene Vergara Date: Fri Nov 5 09:53:50 2021 -0500 Implement link alternative to QR code commit 172f4da6b1eae392c8baf704f105a54cb99e9fd0 Author: Rene Vergara Date: Fri Nov 5 09:53:29 2021 -0500 Update main view to 'shop' commit 4c5d4c311f9952b550ba5e163f0124354e2337f9 Author: Rene Vergara Date: Fri Nov 5 09:30:35 2021 -0500 Add totals and price to order storage commit 7e5210723e737683d8f968ffea79906719d19dac Author: Rene Vergara Date: Fri Nov 5 08:21:19 2021 -0500 Add ZEC price to order commit 971fd7ca41bb15a57a87b5aa9080cdf39e8cf826 Author: Rene Vergara Date: Thu Nov 4 13:10:56 2021 -0500 Implement MongoDB authentication commit fa5221b12870f975bfa656c8be088d8827d527fc Author: Rene Vergara Date: Thu Nov 4 07:49:09 2021 -0500 Enhance blockchain scan commit 01520adbc38f6f59a543897e8796c86b1cb4abb9 Author: Rene Vergara Date: Tue Nov 2 16:13:24 2021 -0500 Implement database price feed commit 0f5a731d08a74c76aafcd468fe91c987de2ab8f3 Author: Rene Vergara Date: Tue Nov 2 10:35:22 2021 -0500 Implement order closing commit 33326febaf2a65ad4a5c7b57549e6161982b432a Author: Rene Vergara Date: Thu Oct 28 15:34:48 2021 -0500 Implement settings dialog commit 251fa5d327b0f1f2a446425906e5ca8ab6607f30 Author: Rene Vergara Date: Thu Oct 28 13:22:54 2021 -0500 Implement checkout commit dce8da391ee9704da2a543f3459c3c74b1b597f1 Author: Rene Vergara Date: Wed Oct 27 15:21:55 2021 -0500 Implement order creation and cancellation commit af8ee5dc908a1cd15faeddac0509a35e56d1567e Author: Rene Vergara Date: Wed Oct 27 07:59:43 2021 -0500 Implement order creation commit 064044c01173251748ff1c93c10fbcafec2a9abf Author: Rene Vergara Date: Tue Oct 26 15:07:51 2021 -0500 Implement add-to-order dialog commit 8b3dfb29842128476788bc74ea442bc44c252b8a Author: Rene Vergara Date: Tue Oct 26 15:07:10 2021 -0500 Fix bug in adding item commit 35fcdaae54c92c62e8e39cd4dca70667209558b1 Author: Rene Vergara Date: Tue Oct 26 13:34:52 2021 -0500 Implement item delete commit 61d68714d242325d0d06b4d67ceb241587da144c Author: Rene Vergara Date: Tue Oct 26 12:58:39 2021 -0500 Implements custom theme commit a7062e7b116737e85be27565b7e1a4cd6a81b8d4 Author: Rene Vergara Date: Tue Oct 26 10:09:34 2021 -0500 Implements item edit commit 172ebb0171c59ab54633744cd49ff177bd995f00 Author: Rene Vergara Date: Mon Oct 25 15:01:06 2021 -0500 Implemented basic order service Implemented adding the component to the viewer and the search in database. Fixed bug in search of item list commit eea8e06d481240ba9bb7117b28c7eedc239da731 Author: Rene Vergara Date: Mon Oct 25 12:49:50 2021 -0500 Add order mongoose schema commit cd1a0208df35a5fa38853a78779d19864f3b9e72 Author: Rene Vergara Date: Fri Oct 22 17:20:36 2021 -0500 Implement create item Adds Zcash price feed from CoinGecko commit 22c89b9d4f8a824076a5a42bf5e05dd1adec69e9 Author: Rene Vergara Date: Thu Oct 21 16:23:33 2021 -0500 Implements item list commit 85b775ae15e80038c2e729d9fc15e50ea3e607a7 Author: Rene Vergara Date: Thu Oct 21 14:29:19 2021 -0500 Add item model commit 62658f7be925ba8825bc082510637532b9322c9c Author: Rene Vergara Date: Thu Oct 21 14:29:04 2021 -0500 Fix header commit 7e6cd119621e7d8384997d86d7d2fe6fbb6b242b Author: Rene Vergara Date: Thu Oct 21 11:22:48 2021 -0500 Fix header commit 4214dac887c5a68154ccbb784b0a147a2b4d02c7 Author: Rene Vergara Date: Thu Oct 21 10:23:58 2021 -0500 Implement resolver for node address Fixes services. commit 30a83414adcd915546ec34b428b19e6da3d8cfd9 Author: Rene Vergara Date: Wed Oct 20 15:51:14 2021 -0500 Update of code base commit 6059c04b75123341cc21d49d2d378930111657b2 Author: Rene Vergara Date: Fri Oct 15 14:14:49 2021 -0500 Implements Zcash login commit 9926a1a4fe5e27154b1363bf42529b1cfa5a05fa Author: Rene Vergara Date: Fri Oct 1 15:10:14 2021 -0500 initial commit --- COPYING | 7 + LICENSE | 192 ++++++++++++++++-- package.json | 2 +- src/app/business/business.component.ts | 9 +- src/app/fullnode.service.ts | 8 +- src/app/header/header.component.ts | 4 +- src/app/item.model.ts | 2 +- .../item-create/item-create.component.ts | 3 +- .../items/item-list/item-list.component.ts | 12 +- src/app/items/item.model.ts | 2 +- src/app/items/items.service.ts | 9 +- src/app/login/login.component.ts | 16 +- src/app/order/order.service.ts | 27 ++- src/app/owner.model.ts | 2 + src/app/receipt.service.ts | 13 +- src/app/user.model.ts | 1 - src/app/user.service.ts | 49 ++--- src/app/viewer/viewer.component.ts | 9 +- 18 files changed, 263 insertions(+), 104 deletions(-) create mode 100644 COPYING diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..2835367 --- /dev/null +++ b/COPYING @@ -0,0 +1,7 @@ +Copyright (c) 2022 Vergara Technologies LLC + +This package ("Original Work") is licensed under the terms of the Bootstrap +Open Source License, version 1.0, or at your option, any later version +("BOSL"). See the file ./LICENSE for the terms of the Bootstrap Open Source +Licence, version 1.0. + diff --git a/LICENSE b/LICENSE index dd436ba..099f1aa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,178 @@ -The MIT License (MIT) -Copyright © 2022 Vergara Technologies LLC +Copyright (c) 2022 Vergara Technologies -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the “Software”), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +======================================================= +Bootstrap Open Source Licence ("BOSL") v. 1.0 +======================================================= +This Bootstrap Open Source Licence (the "License") applies to any original work +of authorship (the "Original Work") whose owner (the "Licensor") has placed the +following licensing notice adjacent to the copyright notice for the Original +Work: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +*Licensed under the Bootstrap Open Source Licence version 1.0* -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +1. **Grant of Copyright License.** Licensor grants You a worldwide, + royalty-free, non-exclusive, sublicensable license, for the duration of the + copyright in the Original Work, to do the following: + + a. to reproduce the Original Work in copies, either alone or as part of + a collective work; + + b. to translate, adapt, alter, transform, modify, or arrange the + Original Work, thereby creating derivative works ("Derivative Works") + based upon the Original Work; + + c. to distribute or communicate copies of the Original Work and + Derivative Works to the public, provided that prior to any such + distribution or communication You first place a machine-readable copy + of the Source Code of the Original Work and such Derivative Works that + You intend to distribute or communicate in an information repository + reasonably calculated to permit inexpensive and convenient access + thereto by the public (“Information Repository”) for as long as You + continue to distribute or communicate said copies, accompanied by an + irrevocable offer to license said copies to the public free of charge + under this License, said offer valid starting no later than 12 months + after You first distribute or communicate said copies; + + d. to perform the Original Work publicly; and + + e. to display the Original Work publicly. + +2. **Grant of Patent License.** Licensor grants You a worldwide, royalty-free, +non-exclusive, sublicensable license, under patent claims owned or controlled +by the Licensor that are embodied in the Original Work as furnished by the +Licensor, for the duration of the patents, to make, use, sell, offer for sale, +have made, and import the Original Work and Derivative Works. + +3. **Grant of Source Code License.** The "Source Code" for a work means the +preferred form of the work for making modifications to it and all available +documentation describing how to modify the work. Licensor agrees to provide a +machine-readable copy of the Source Code of the Original Work along with each +copy of the Original Work that Licensor distributes. Licensor reserves the +right to satisfy this obligation by placing a machine-readable copy of said +Source Code in an Information Repository for as long as Licensor continues to +distribute the Original Work. + +4. **Exclusions From License Grant.** Neither the names of Licensor, nor the +names of any contributors to the Original Work, nor any of their trademarks or +service marks, may be used to endorse or promote products derived from this +Original Work without express prior permission of the Licensor. Except as +expressly stated herein, nothing in this License grants any license to +Licensor's trademarks, copyrights, patents, trade secrets or any other +intellectual property. No patent license is granted to make, use, sell, offer +for sale, have made, or import embodiments of any patent claims other than the +licensed claims defined in Section 2. No license is granted to the trademarks +of Licensor even if such marks are included in the Original Work. Nothing in +this License shall be interpreted to prohibit Licensor from licensing under +terms different from this License any Original Work that Licensor otherwise +would have a right to license. + +5. **External Deployment.** The term "External Deployment" means the use, +distribution, or communication of the Original Work or Derivative Works in any +way such that the Original Work or Derivative Works may be used by anyone other +than You, whether those works are distributed or communicated to those persons +or made available as an application intended for use over a network. As an +express condition for the grants of license hereunder, You must treat any +External Deployment by You of the Original Work or a Derivative Work as a +distribution under section 1(c). + +6. **Attribution Rights.** You must retain, in the Source Code of any +Derivative Works that You create, all copyright, patent, or trademark notices +from the Source Code of the Original Work, as well as any notices of licensing +and any descriptive text identified therein as an "Attribution Notice." You +must cause the Source Code for any Derivative Works that You create to carry a +prominent Attribution Notice reasonably calculated to inform recipients that +You have modified the Original Work. + +7. **Warranty of Provenance and Disclaimer of Warranty.** Licensor warrants +that the copyright in and to the Original Work and the patent rights granted +herein by Licensor are owned by the Licensor or are sublicensed to You under +the terms of this License with the permission of the contributor(s) of those +copyrights and patent rights. Except as expressly stated in the immediately +preceding sentence, the Original Work is provided under this License on an "AS +IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without +limitation, the warranties of non-infringement, merchantability or fitness for +a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS +WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this +License. No license to the Original Work is granted by this License except +under this disclaimer. + +8. **Limitation of Liability.** Under no circumstances and under no legal +theory, whether in tort (including negligence), contract, or otherwise, shall +the Licensor be liable to anyone for any indirect, special, incidental, or +consequential damages of any character arising as a result of this License or +the use of the Original Work including, without limitation, damages for loss of +goodwill, work stoppage, computer failure or malfunction, or any and all other +commercial damages or losses. This limitation of liability shall not apply to +the extent applicable law prohibits such limitation. + +9. **Acceptance and Termination.** If, at any time, You expressly assented to +this License, that assent indicates your clear and irrevocable acceptance of +this License and all of its terms and conditions. If You distribute or +communicate copies of the Original Work or a Derivative Work, You must make a +reasonable effort under the circumstances to obtain the express assent of +recipients to the terms of this License. This License conditions your rights to +undertake the activities listed in Section 1, including your right to create +Derivative Works based upon the Original Work, and doing so without honoring +these terms and conditions is prohibited by copyright law and international +treaty. Nothing in this License is intended to affect copyright exceptions and +limitations (including 'fair use' or 'fair dealing'). This License shall +terminate immediately and You may no longer exercise any of the rights granted +to You by this License upon your failure to honor the conditions in Section +1(c). + +10. **Termination for Patent Action.** This License shall terminate +automatically and You may no longer exercise any of the rights granted to You +by this License as of the date You commence an action, including a cross-claim +or counterclaim, against Licensor or any licensee alleging that the Original +Work infringes a patent. This termination provision shall not apply for an +action alleging patent infringement by combinations of the Original Work with +other software or hardware. + +11. **Jurisdiction, Venue and Governing Law.** Any action or suit relating to +this License may be brought only in the courts of a jurisdiction wherein the +Licensor resides or in which Licensor conducts its primary business, and under +the laws of that jurisdiction excluding its conflict-of-law provisions. The +application of the United Nations Convention on Contracts for the International +Sale of Goods is expressly excluded. Any use of the Original Work outside the +scope of this License or after its termination shall be subject to the +requirements and penalties of copyright or patent law in the appropriate +jurisdiction. This section shall survive the termination of this License. + +12. **Attorneys' Fees.** In any action to enforce the terms of this License or +seeking damages relating thereto, the prevailing party shall be entitled to +recover its costs and expenses, including, without limitation, reasonable +attorneys' fees and costs incurred in connection with such action, including +any appeal of such action. This section shall survive the termination of this +License. + +13. **Miscellaneous.** If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent necessary to +make it enforceable. + +14. **Definition of "You" in This License.** "You" throughout this License, +whether in upper or lower case, means an individual or a legal entity +exercising rights under, and complying with all of the terms of, this License. +For legal entities, "You" includes any entity that controls, is controlled by, +or is under common control with you. For purposes of this definition, "control" +means (i) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (ii) ownership of fifty +percent (50%) or more of the outstanding shares, or (iii) beneficial ownership +of such entity. + +15. **Right to Use.** You may use the Original Work in all ways not otherwise +restricted or conditioned by this License or by law, and Licensor promises not +to interfere with or be responsible for such uses by You. + +16. **Modification of This License.** This License is Copyright © 2007 Zooko +Wilcox-O'Hearn. Permission is granted to copy, distribute, or communicate this +License without modification. Nothing in this License permits You to modify +this License as applied to the Original Work or to Derivative Works. However, +You may modify the text of this License and copy, distribute or communicate +your modified version (the "Modified License") and apply it to other original +works of authorship subject to the following conditions: (i) You may not +indicate in any way that your Modified License is the "Bootstrap Open Source +Licence" or "BOSL" and you may not use those names in the name of your Modified +License; and (ii) You must replace the notice specified in the first paragraph +above with the notice "Licensed under " or with +a notice of your own that is not confusingly similar to the notice in this +License. diff --git a/package.json b/package.json index 630f0fd..bb615c2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zgo", - "version": "1.0.3", + "version": "1.1.0", "scripts": { "ng": "ng", "start": "ng serve", diff --git a/src/app/business/business.component.ts b/src/app/business/business.component.ts index bb345ff..b5ce34a 100644 --- a/src/app/business/business.component.ts +++ b/src/app/business/business.component.ts @@ -63,7 +63,9 @@ export class BusinessComponent implements OnInit { country: '', email: '', website: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() } public countriesUpdate: Observable; public ownerUpdate: Observable; @@ -147,6 +149,7 @@ export class BusinessComponent implements OnInit { save() { this.owner = { + _id: '', address: '', currency: 'usd', tax: false, @@ -165,7 +168,9 @@ export class BusinessComponent implements OnInit { country: this.bizForm.get('country')!.value, email: this.bizForm.get('email')!.value, website: this.bizForm.get('website')!.value, - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; this.userService.addOwner(this.owner); this.stepper!.next(); diff --git a/src/app/fullnode.service.ts b/src/app/fullnode.service.ts index 7dd37b8..94a5715 100644 --- a/src/app/fullnode.service.ts +++ b/src/app/fullnode.service.ts @@ -4,6 +4,7 @@ import {HttpClient, HttpParams, HttpHeaders} from '@angular/common/http'; import {UserService} from './user.service'; import { Owner } from './owner.model'; +var Buffer = require('buffer/').Buffer; //import {User} from './user.model'; @Injectable({providedIn: 'root'}) @@ -42,11 +43,14 @@ export class FullnodeService{ paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; constructor(private http: HttpClient, public userService: UserService){ - this.reqHeaders = new HttpHeaders().set('Authorization', this.apiKey); + var auth = 'Basic ' + Buffer.from('user:superSecret').toString('base64'); + this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.ownerUpdate = userService.ownerUpdate; this.getAddr(); this.getHeight(); diff --git a/src/app/header/header.component.ts b/src/app/header/header.component.ts index 298b4ff..37ee99b 100644 --- a/src/app/header/header.component.ts +++ b/src/app/header/header.component.ts @@ -37,7 +37,9 @@ export class HeaderComponent implements OnInit, OnDestroy { paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; private session: string | null = ''; public heightUpdate: Observable; diff --git a/src/app/item.model.ts b/src/app/item.model.ts index e94757f..6c4c331 100644 --- a/src/app/item.model.ts +++ b/src/app/item.model.ts @@ -2,6 +2,6 @@ export interface Item { _id?: any; name: string; description: string; - user: string; + owner: string; cost: number; } diff --git a/src/app/items/item-create/item-create.component.ts b/src/app/items/item-create/item-create.component.ts index ed5790a..c5bdbaf 100644 --- a/src/app/items/item-create/item-create.component.ts +++ b/src/app/items/item-create/item-create.component.ts @@ -23,7 +23,7 @@ export class ItemCreateComponent implements OnInit { ){ if (data._id === '') { this.form = fb.group({ - id: [null], + id: [''], name: [null, Validators.required], description: [null, Validators.required], cost: new FormControl('', { @@ -49,6 +49,7 @@ export class ItemCreateComponent implements OnInit { } save() { + console.log(this.form.value); this.dialogRef.close(this.form.value); } diff --git a/src/app/items/item-list/item-list.component.ts b/src/app/items/item-list/item-list.component.ts index 80eec30..c08ac73 100644 --- a/src/app/items/item-list/item-list.component.ts +++ b/src/app/items/item-list/item-list.component.ts @@ -40,7 +40,9 @@ export class ItemListComponent implements OnInit{ paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; public price: number = 1; public ownerUpdate: Observable; @@ -87,7 +89,7 @@ export class ItemListComponent implements OnInit{ dialogRef.afterClosed().subscribe((val) => { if(val != null) { - var item:Item = {name: val.name, description: val.description, cost: val.cost, user: this.owner.address}; + var item:Item = {_id: '', name: val.name, description: val.description, cost: val.cost, owner: this.owner.address}; this.itemService.addItem(item); } this.itemService.getItems(this.owner.address); @@ -98,9 +100,9 @@ export class ItemListComponent implements OnInit{ } edit(id: string) { - //console.log('Edit:', id); + console.log('Edit:', id); const item = this.items.find(element => element._id == id); - //console.log(item); + console.log(item); const dialogConfig = new MatDialogConfig(); dialogConfig.disableClose = true; @@ -115,7 +117,7 @@ export class ItemListComponent implements OnInit{ name: val.name, description: val.description, cost: val.cost, - user: this.owner.address + owner: this.owner.address }; //console.log('Edit:', editItem); this.itemService.addItem(editItem).subscribe((response) => { diff --git a/src/app/items/item.model.ts b/src/app/items/item.model.ts index 3e239f5..982ee08 100644 --- a/src/app/items/item.model.ts +++ b/src/app/items/item.model.ts @@ -3,5 +3,5 @@ export interface Item { name: string; description: string; cost: number; - user: string; + owner: string; } diff --git a/src/app/items/items.service.ts b/src/app/items/items.service.ts index fc3a8c7..e806732 100644 --- a/src/app/items/items.service.ts +++ b/src/app/items/items.service.ts @@ -3,6 +3,8 @@ import { Injectable } from '@angular/core'; import { Subject, BehaviorSubject, Observable } from 'rxjs'; import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http'; +var Buffer = require('buffer/').Buffer; + @Injectable({providedIn: 'root'}) export class ItemService{ @@ -15,13 +17,14 @@ export class ItemService{ private reqHeaders: HttpHeaders; constructor(private http: HttpClient){ - this.reqHeaders = new HttpHeaders().set('Authorization', this.apiKey); + var auth = 'Basic ' + Buffer.from('user:superSecret').toString('base64'); + this.reqHeaders = new HttpHeaders().set('Authorization', auth); } getItems(addr: string){ this.address = addr; const params = new HttpParams().append('address', addr); - let obs = this.http.get<{message: string, items: any}>(this.beUrl+'api/getitems', { headers:this.reqHeaders, params: params, observe: 'response'}); + let obs = this.http.get<{message: string, items: any}>(this.beUrl+'api/items', { headers:this.reqHeaders, params: params, observe: 'response'}); obs.subscribe((ItemDataResponse) => { if (ItemDataResponse.status == 200 ) { @@ -39,7 +42,7 @@ export class ItemService{ addItem(item: Item) { //const params = new HttpParams().append('item', JSON.stringify(item)); - let obs = this.http.post<{message: string}>(this.beUrl+'api/item', { item: item }, { headers: this.reqHeaders }); + let obs = this.http.post<{message: string}>(this.beUrl+'api/item', { payload: item }, { headers: this.reqHeaders }); obs.subscribe((ItemResponse) => { console.log('Item added'); diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 315379f..02c60e0 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -35,7 +35,6 @@ export class LoginComponent implements OnInit, AfterViewInit { address: '', session: '', blocktime: 0, - expired: false, pin: '', validated: false }; @@ -58,7 +57,9 @@ export class LoginComponent implements OnInit, AfterViewInit { paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; private FullnodeSub: Subscription = new Subscription(); private UserSub: Subscription = new Subscription(); @@ -152,12 +153,7 @@ export class LoginComponent implements OnInit, AfterViewInit { } loginCheck(){ - var today = new Date().getTime() / 1000; this.userService.findUser(); - this.userService.findPending(); - this.txsUpdate.subscribe((txs) => { - this.txs = txs; - }); this.userUpdate.subscribe((user) => { if (user.blocktime > 0) { if(this.myStepper!.selectedIndex === 1){ @@ -173,12 +169,6 @@ export class LoginComponent implements OnInit, AfterViewInit { } } }); - if (this.txs.length > 0) { - this.barMode = 'determinate'; - this.barValue = (this.txs[0].confirmations / 2) * 100; - this.confirmedMemo = true; - this.barMessage = 'Login memo found, awaiting confirmations'; - } } login(stepper: MatStepper) { diff --git a/src/app/order/order.service.ts b/src/app/order/order.service.ts index 7dec8a0..4b9a813 100644 --- a/src/app/order/order.service.ts +++ b/src/app/order/order.service.ts @@ -8,6 +8,8 @@ import { User } from '../user.model'; import { Owner } from '../owner.model'; import { LineItem} from '../items/lineitem.model'; +var Buffer = require('buffer/').Buffer; + @Injectable({providedIn: 'root'}) export class OrderService { @@ -18,7 +20,6 @@ export class OrderService { address: '', session: '', blocktime: 0, - expired: false, pin: '', validated: false }, @@ -42,7 +43,9 @@ export class OrderService { paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }, order: { address: '', @@ -78,7 +81,8 @@ export class OrderService { public fullnodeService: FullnodeService, public userService: UserService ) { - this.reqHeaders = new HttpHeaders().set('Authorization', this.apiKey); + var auth = 'Basic ' + Buffer.from('user:superSecret').toString('base64'); + this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.userUpdate = userService.userUpdate; this.ownerUpdate = userService.ownerUpdate; this.userUpdate.subscribe((user) => { @@ -132,7 +136,8 @@ export class OrderService { addToOrder(lineItem: LineItem) { if(this.dataStore.order._id != null) { - let obs = this.http.post<{message: string}>(this.beUrl+'api/lineitem', { order_id: this.dataStore.order._id, line: lineItem }, { headers: this.reqHeaders }); + this.dataStore.order.lines.push(lineItem); + let obs = this.http.post(this.beUrl+'api/order', { payload: this.dataStore.order }, { headers: this.reqHeaders }); obs.subscribe((orderData) => { this.getOrder(); }); @@ -143,21 +148,21 @@ export class OrderService { createOrder(lineItem: LineItem) { var order:Order = { + _id: '', address: this.dataStore.user.address, session: this.dataStore.user.session, currency: this.dataStore.owner.currency, + timestamp: new Date(Date.now()).toISOString(), closed: false, totalZec: 0, price: 0, total: 0, - lines: [] + lines: [lineItem] }; - let obs = this.http.post<{message: string, order: Order}>(this.beUrl+'api/order', {order: order}, { headers: this.reqHeaders }); + let obs = this.http.post<{message: string, order: Order}>(this.beUrl+'api/order', {payload: order}, { headers: this.reqHeaders }); obs.subscribe((orderData) => { - console.log('Create order', orderData); - this.dataStore.order = orderData.order; - this._orderUpdated.next(Object.assign({}, this.dataStore).order); - this.addToOrder(lineItem); + console.log('Created order'); + this.getOrder() }); return obs; @@ -197,7 +202,7 @@ export class OrderService { this.dataStore.order.price = price; }); this.dataStore.order.closed = true; - let obs = this.http.post<{message: string, order: Order}>(this.beUrl+'api/order', {order: this.dataStore.order}, { headers: this.reqHeaders }); + let obs = this.http.post(this.beUrl+'api/order', {payload: this.dataStore.order}, { headers: this.reqHeaders }); obs.subscribe((orderData) => { console.log('Closed order', orderData); this.dataStore.order = { diff --git a/src/app/owner.model.ts b/src/app/owner.model.ts index b80dc95..e371de6 100644 --- a/src/app/owner.model.ts +++ b/src/app/owner.model.ts @@ -19,4 +19,6 @@ export interface Owner { website: string; country: string; zats: boolean; + invoices: boolean; + expiration: string; } diff --git a/src/app/receipt.service.ts b/src/app/receipt.service.ts index 749f019..9f2f789 100644 --- a/src/app/receipt.service.ts +++ b/src/app/receipt.service.ts @@ -5,6 +5,8 @@ import { Order } from './order/order.model'; import { Owner } from './owner.model'; import { UserService } from './user.service'; +var Buffer = require('buffer/').Buffer; + @Injectable({ providedIn: 'root' }) @@ -31,7 +33,9 @@ export class ReceiptService { paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }, order: { address: '', @@ -63,13 +67,14 @@ export class ReceiptService { private http: HttpClient, public userService: UserService ) { - this.reqHeaders = new HttpHeaders().set('Authorization', this.apiKey); + var auth = 'Basic ' + Buffer.from('user:superSecret').toString('base64'); + this.reqHeaders = new HttpHeaders().set('Authorization', auth); this.ownerUpdate = userService.ownerUpdate; } getOrderById(id:string) { - const params = new HttpParams().append('id', id); - let obs = this.http.get<{message: string, order: any}>(this.beUrl+'api/receipt', { headers:this.reqHeaders, params:params, observe: 'response'}); + //const params = new HttpParams().append('id', id); + let obs = this.http.get<{message: string, order: any}>(this.beUrl+'api/order/'+id, { headers:this.reqHeaders, observe: 'response'}); obs.subscribe((OrderDataResponse) => { if (OrderDataResponse.status == 200) { diff --git a/src/app/user.model.ts b/src/app/user.model.ts index d555e82..82194a9 100644 --- a/src/app/user.model.ts +++ b/src/app/user.model.ts @@ -3,7 +3,6 @@ export interface User { address: string; session: string; blocktime: number; - expired: boolean; pin: string; validated: boolean; } diff --git a/src/app/user.service.ts b/src/app/user.service.ts index b0a9029..3372856 100644 --- a/src/app/user.service.ts +++ b/src/app/user.service.ts @@ -6,6 +6,8 @@ import {Owner} from './owner.model'; import { Country } from './country.model'; import {Tx} from './tx.model'; +var Buffer = require('buffer/').Buffer; + @Injectable({providedIn: 'root'}) export class UserService{ @@ -15,7 +17,6 @@ export class UserService{ address: '', session: '', blocktime: 0, - expired: false, pin: '', validated: false }, @@ -38,7 +39,9 @@ export class UserService{ paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }, txs : [], countries: [] @@ -64,12 +67,12 @@ export class UserService{ private apiKey = 'YourApiKey'; constructor(private http: HttpClient){ - this.reqHeaders = new HttpHeaders().set('Authorization', this.apiKey); + var auth = 'Basic ' + Buffer.from('user:superSecret').toString('base64'); + this.reqHeaders = new HttpHeaders().set('Authorization', auth); //console.log('US:', this.reqHeaders); this.session = localStorage.getItem('s4z_token'); if (this.session != null) { this.findUser(); - this.findPending(); } } @@ -88,12 +91,12 @@ export class UserService{ this.session = localStorage.getItem('s4z_token'); if (this.session != null) { const params = new HttpParams().append('session', this.session!); - let obs = this.http.get<{message: string, user: any}>(this.beUrl+'api/getuser', { headers: this.reqHeaders, params: params, observe: 'response'}); + let obs = this.http.get<{message: string, user: any}>(this.beUrl+'api/user', { headers: this.reqHeaders, params: params, observe: 'response'}); obs.subscribe((UserDataResponse) => { console.log(UserDataResponse.status); if (UserDataResponse.status == 200){ - this.dataStore.user = UserDataResponse.body!.user[0]; + this.dataStore.user = UserDataResponse.body!.user; console.log(`US: Found user, returning it`); this._uZaddrUpdated.next(Object.assign({},this.dataStore).user.address); this._userUpdated.next(Object.assign({}, this.dataStore).user); @@ -103,7 +106,6 @@ export class UserService{ address: '', session: '', blocktime: 0, - expired: false, pin: '', validated: false }; @@ -120,32 +122,6 @@ export class UserService{ } } - findPending() { - this.session = localStorage.getItem('s4z_token'); - if (this.session != null) { - const params = new HttpParams().append('session', this.session!); - let obs = this.http.get<{message: string, txs: any}>(this.beUrl+'api/pending', { headers: this.reqHeaders, params: params, observe: 'response'}); - - obs.subscribe((TxDataResponse) => { - //console.log('US Tx', TxDataResponse); - if (TxDataResponse.status == 200){ - this.dataStore.txs = TxDataResponse.body!.txs; - console.log(`US: Pending logins found`); - this._txsUpdated.next(Object.assign({},this.dataStore).txs); - } else { - console.log('US: Did not find pending txs'); - this.dataStore.txs = []; - this._txsUpdated.next(Object.assign({},this.dataStore).txs); - } - }); - - return obs; - } else { - console.log('No session loaded'); - return null; - } - } - validateUser(){ var validatedUser: User = this.dataStore.user; validatedUser.validated = true; @@ -157,10 +133,9 @@ export class UserService{ addOwner(owner: Owner) { owner.address = this.dataStore.user.address; - let obs = this.http.post<{message: string}>(this.beUrl+'api/addowner', {owner: owner}, {headers: this.reqHeaders}); + let obs = this.http.post(this.beUrl+'api/owner', {payload: owner}, {headers: this.reqHeaders}); obs.subscribe((responseData) => { - console.log(responseData.message); this.getOwner(this.dataStore.user.address); }); @@ -180,12 +155,12 @@ export class UserService{ getOwner(address: string) { console.log('getOwner', address); const ownParams = new HttpParams().append('address', address); - let obs = this.http.get<{message:string, owner: any}>(this.beUrl+'api/getowner', { headers: this.reqHeaders, params: ownParams, observe: 'response'}); + let obs = this.http.get<{message:string, owner: any}>(this.beUrl+'api/owner', { headers: this.reqHeaders, params: ownParams, observe: 'response'}); obs.subscribe((OwnerDataResponse) => { console.log('api/getowner', OwnerDataResponse.status); if (OwnerDataResponse.status == 200) { - this.dataStore.owner = OwnerDataResponse.body!.owner[0]; + this.dataStore.owner = OwnerDataResponse.body!.owner; //console.log('getOwner object', this.dataStore.owner); this._ownerUpdated.next(Object.assign({},this.dataStore).owner); this._paidUpdated.next(Object.assign({}, this.dataStore).owner.paid); diff --git a/src/app/viewer/viewer.component.ts b/src/app/viewer/viewer.component.ts index 39f2286..2c10ed4 100644 --- a/src/app/viewer/viewer.component.ts +++ b/src/app/viewer/viewer.component.ts @@ -24,7 +24,6 @@ export class ViewerComponent implements OnInit { address: '', session: '', blocktime: 0, - expired: false, pin: '', validated: false }; @@ -48,7 +47,9 @@ export class ViewerComponent implements OnInit { paid: false, website: '', country: '', - zats: false + zats: false, + invoices: false, + expiration: new Date(Date.now()).toISOString() }; public addrUpdate: Observable; public ownerUpdate: Observable; @@ -109,7 +110,7 @@ export class ViewerComponent implements OnInit { dialogRef.afterClosed().subscribe((val) => { if (val != null) { //console.log('Saving settings', val); - this.userService.updateOwner(val); + this.userService.addOwner(val); this.fullnodeService.getPrice(val.currency); this.loginCheck(); } @@ -123,7 +124,7 @@ export class ViewerComponent implements OnInit { this.userUpdate.subscribe((user) => { this.user = user; //console.log('Viewer loginCheck', this.user); - if (!this.owner.paid || !this.user.validated || this.user.expired) { + if (!this.owner.paid || !this.user.validated) { console.log('Log in expired!'); this.router.navigate(['/login']); }