Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
RBAC: role-based access for employees, customers, and suppliers (#11)
Brad Barbinf4d41d47657d
diff --git a/LICENSE.md b/LICENSE.mdnew file mode 100644index 0000000000..fec45ad499--- /dev/null+++ b/LICENSE.md@@ -0,0 +1,661 @@+ GNU AFFERO GENERAL PUBLIC LICENSE+ Version 3, 19 November 2007++Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>+Everyone is permitted to copy and distribute verbatim copies+of this license document, but changing it is not allowed.++ Preamble++The GNU Affero General Public License is a free, copyleft license for+software and other kinds of works, specifically designed to ensure+cooperation with the community in the case of network server software.++The licenses for most software and other practical works are designed+to take away your freedom to share and change the works. By contrast,+our General Public Licenses are intended to guarantee your freedom to+share and change all versions of a program--to make sure it remains free+software for all its users.++When we speak of free software, we are referring to freedom, not+price. Our General Public Licenses are designed to make sure that you+have the freedom to distribute copies of free software (and charge for+them if you wish), that you receive source code or can get it if you+want it, that you can change the software or use pieces of it in new+free programs, and that you know you can do these things.++Developers that use our General Public Licenses protect your rights+with two steps: (1) assert copyright on the software, and (2) offer+you this License which gives you legal permission to copy, distribute+and/or modify the software.++A secondary benefit of defending all users' freedom is that+improvements made in alternate versions of the program, if they+receive widespread use, become available for other developers to+incorporate. Many developers of free software are heartened and+encouraged by the resulting cooperation. However, in the case of+software used on network servers, this result may fail to come about.+The GNU General Public License permits making a modified version and+letting the public access it on a server without ever releasing its+source code to the public.++The GNU Affero General Public License is designed specifically to+ensure that, in such cases, the modified source code becomes available+to the community. It requires the operator of a network server to+provide the source code of the modified version running there to the+users of that server. Therefore, public use of a modified version, on+a publicly accessible server, gives the public access to the source+code of the modified version.++An older license, called the Affero General Public License and+published by Affero, was designed to accomplish similar goals. This is+a different license, not a version of the Affero GPL, but Affero has+released a new version of the Affero GPL which permits relicensing under+this license.++The precise terms and conditions for copying, distribution and+modification follow.++ TERMS AND CONDITIONS++0. Definitions.++"This License" refers to version 3 of the GNU Affero General Public License.++"Copyright" also means copyright-like laws that apply to other kinds of+works, such as semiconductor masks.++"The Program" refers to any copyrightable work licensed under this+License. Each licensee is addressed as "you". "Licensees" and+"recipients" may be individuals or organizations.++To "modify" a work means to copy from or adapt all or part of the work+in a fashion requiring copyright permission, other than the making of an+exact copy. The resulting work is called a "modified version" of the+earlier work or a work "based on" the earlier work.++A "covered work" means either the unmodified Program or a work based+on the Program.++To "propagate" a work means to do anything with it that, without+permission, would make you directly or secondarily liable for+infringement under applicable copyright law, except executing it on a+computer or modifying a private copy. Propagation includes copying,+distribution (with or without modification), making available to the+public, and in some countries other activities as well.++To "convey" a work means any kind of propagation that enables other+parties to make or receive copies. Mere interaction with a user through+a computer network, with no transfer of a copy, is not conveying.++An interactive user interface displays "Appropriate Legal Notices"+to the extent that it includes a convenient and prominently visible+feature that (1) displays an appropriate copyright notice, and (2)+tells the user that there is no warranty for the work (except to the+extent that warranties are provided), that licensees may convey the+work under this License, and how to view a copy of this License. If+the interface presents a list of user commands or options, such as a+menu, a prominent item in the list meets this criterion.++1. Source Code.++The "source code" for a work means the preferred form of the work+for making modifications to it. "Object code" means any non-source+form of a work.++A "Standard Interface" means an interface that either is an official+standard defined by a recognized standards body, or, in the case of+interfaces specified for a particular programming language, one that+is widely used among developers working in that language.++The "System Libraries" of an executable work include anything, other+than the work as a whole, that (a) is included in the normal form of+packaging a Major Component, but which is not part of that Major+Component, and (b) serves only to enable use of the work with that+Major Component, or to implement a Standard Interface for which an+implementation is available to the public in source code form. A+"Major Component", in this context, means a major essential component+(kernel, window system, and so on) of the specific operating system+(if any) on which the executable work runs, or a compiler used to+produce the work, or an object code interpreter used to run it.++The "Corresponding Source" for a work in object code form means all+the source code needed to generate, install, and (for an executable+work) run the object code and to modify the work, including scripts to+control those activities. However, it does not include the work's+System Libraries, or general-purpose tools or generally available free+programs which are used unmodified in performing those activities but+which are not part of the work. For example, Corresponding Source+includes interface definition files associated with source files for+the work, and the source code for shared libraries and dynamically+linked subprograms that the work is specifically designed to require,+such as by intimate data communication or control flow between those+subprograms and other parts of the work.++The Corresponding Source need not include anything that users+can regenerate automatically from other parts of the Corresponding+Source.++The Corresponding Source for a work in source code form is that+same work.++2. Basic Permissions.++All rights granted under this License are granted for the term of+copyright on the Program, and are irrevocable provided the stated+conditions are met. This License explicitly affirms your unlimited+permission to run the unmodified Program. The output from running a+covered work is covered by this License only if the output, given its+content, constitutes a covered work. This License acknowledges your+rights of fair use or other equivalent, as provided by copyright law.++You may make, run and propagate covered works that you do not+convey, without conditions so long as your license otherwise remains+in force. You may convey covered works to others for the sole purpose+of having them make modifications exclusively for you, or provide you+with facilities for running those works, provided that you comply with+the terms of this License in conveying all material for which you do+not control copyright. Those thus making or running the covered works+for you must do so exclusively on your behalf, under your direction+and control, on terms that prohibit them from making any copies of+your copyrighted material outside their relationship with you.++Conveying under any other circumstances is permitted solely under+the conditions stated below. Sublicensing is not allowed; section 10+makes it unnecessary.++3. Protecting Users' Legal Rights From Anti-Circumvention Law.++No covered work shall be deemed part of an effective technological+measure under any applicable law fulfilling obligations under article+11 of the WIPO copyright treaty adopted on 20 December 1996, or+similar laws prohibiting or restricting circumvention of such+measures.++When you convey a covered work, you waive any legal power to forbid+circumvention of technological measures to the extent such circumvention+is effected by exercising rights under this License with respect to+the covered work, and you disclaim any intention to limit operation or+modification of the work as a means of enforcing, against the work's+users, your or third parties' legal rights to forbid circumvention of+technological measures.++4. Conveying Verbatim Copies.++You may convey verbatim copies of the Program's source code as you+receive it, in any medium, provided that you conspicuously and+appropriately publish on each copy an appropriate copyright notice;+keep intact all notices stating that this License and any+non-permissive terms added in accord with section 7 apply to the code;+keep intact all notices of the absence of any warranty; and give all+recipients a copy of this License along with the Program.++You may charge any price or no price for each copy that you convey,+and you may offer support or warranty protection for a fee.++5. Conveying Modified Source Versions.++You may convey a work based on the Program, or the modifications to+produce it from the Program, in the form of source code under the+terms of section 4, provided that you also meet all of these conditions:++ a) The work must carry prominent notices stating that you modified+ it, and giving a relevant date.++ b) The work must carry prominent notices stating that it is+ released under this License and any conditions added under section+ 7. This requirement modifies the requirement in section 4 to+ "keep intact all notices".++ c) You must license the entire work, as a whole, under this+ License to anyone who comes into possession of a copy. This+ License will therefore apply, along with any applicable section 7+ additional terms, to the whole of the work, and all its parts,+ regardless of how they are packaged. This License gives no+ permission to license the work in any other way, but it does not+ invalidate such permission if you have separately received it.++ d) If the work has interactive user interfaces, each must display+ Appropriate Legal Notices; however, if the Program has interactive+ interfaces that do not display Appropriate Legal Notices, your+ work need not make them do so.++A compilation of a covered work with other separate and independent+works, which are not by their nature extensions of the covered work,+and which are not combined with it such as to form a larger program,+in or on a volume of a storage or distribution medium, is called an+"aggregate" if the compilation and its resulting copyright are not+used to limit the access or legal rights of the compilation's users+beyond what the individual works permit. Inclusion of a covered work+in an aggregate does not cause this License to apply to the other+parts of the aggregate.++6. Conveying Non-Source Forms.++You may convey a covered work in object code form under the terms+of sections 4 and 5, provided that you also convey the+machine-readable Corresponding Source under the terms of this License,+in one of these ways:++ a) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by the+ Corresponding Source fixed on a durable physical medium+ customarily used for software interchange.++ b) Convey the object code in, or embodied in, a physical product+ (including a physical distribution medium), accompanied by a+ written offer, valid for at least three years and valid for as+ long as you offer spare parts or customer support for that product+ model, to give anyone who possesses the object code either (1) a+ copy of the Corresponding Source for all the software in the+ product that is covered by this License, on a durable physical+ medium customarily used for software interchange, for a price no+ more than your reasonable cost of physically performing this+ conveying of source, or (2) access to copy the+ Corresponding Source from a network server at no charge.++ c) Convey individual copies of the object code with a copy of the+ written offer to provide the Corresponding Source. This+ alternative is allowed only occasionally and noncommercially, and+ only if you received the object code with such an offer, in accord+ with subsection 6b.++ d) Convey the object code by offering access from a designated+ place (gratis or for a charge), and offer equivalent access to the+ Corresponding Source in the same way through the same place at no+ further charge. You need not require recipients to copy the+ Corresponding Source along with the object code. If the place to+ copy the object code is a network server, the Corresponding Source+ may be on a different server (operated by you or a third party)+ that supports equivalent copying facilities, provided you maintain+ clear directions next to the object code saying where to find the+ Corresponding Source. Regardless of what server hosts the+ Corresponding Source, you remain obligated to ensure that it is+ available for as long as needed to satisfy these requirements.++ e) Convey the object code using peer-to-peer transmission, provided+ you inform other peers where the object code and Corresponding+ Source of the work are being offered to the general public at no+ charge under subsection 6d.++A separable portion of the object code, whose source code is excluded+from the Corresponding Source as a System Library, need not be+included in conveying the object code work.++A "User Product" is either (1) a "consumer product", which means any+tangible personal property which is normally used for personal, family,+or household purposes, or (2) anything designed or sold for incorporation+into a dwelling. In determining whether a product is a consumer product,+doubtful cases shall be resolved in favor of coverage. For a particular+product received by a particular user, "normally used" refers to a+typical or common use of that class of product, regardless of the status+of the particular user or of the way in which the particular user+actually uses, or expects or is expected to use, the product. A product+is a consumer product regardless of whether the product has substantial+commercial, industrial or non-consumer uses, unless such uses represent+the only significant mode of use of the product.++"Installation Information" for a User Product means any methods,+procedures, authorization keys, or other information required to install+and execute modified versions of a covered work in that User Product from+a modified version of its Corresponding Source. The information must+suffice to ensure that the continued functioning of the modified object+code is in no case prevented or interfered with solely because+modification has been made.++If you convey an object code work under this section in, or with, or+specifically for use in, a User Product, and the conveying occurs as+part of a transaction in which the right of possession and use of the+User Product is transferred to the recipient in perpetuity or for a+fixed term (regardless of how the transaction is characterized), the+Corresponding Source conveyed under this section must be accompanied+by the Installation Information. But this requirement does not apply+if neither you nor any third party retains the ability to install+modified object code on the User Product (for example, the work has+been installed in ROM).++The requirement to provide Installation Information does not include a+requirement to continue to provide support service, warranty, or updates+for a work that has been modified or installed by the recipient, or for+the User Product in which it has been modified or installed. Access to a+network may be denied when the modification itself materially and+adversely affects the operation of the network or violates the rules and+protocols for communication across the network.++Corresponding Source conveyed, and Installation Information provided,+in accord with this section must be in a format that is publicly+documented (and with an implementation available to the public in+source code form), and must require no special password or key for+unpacking, reading or copying.++7. Additional Terms.++"Additional permissions" are terms that supplement the terms of this+License by making exceptions from one or more of its conditions.+Additional permissions that are applicable to the entire Program shall+be treated as though they were included in this License, to the extent+that they are valid under applicable law. If additional permissions+apply only to part of the Program, that part may be used separately+under those permissions, but the entire Program remains governed by+this License without regard to the additional permissions.++When you convey a copy of a covered work, you may at your option+remove any additional permissions from that copy, or from any part of+it. (Additional permissions may be written to require their own+removal in certain cases when you modify the work.) You may place+additional permissions on material, added by you to a covered work,+for which you have or can give appropriate copyright permission.++Notwithstanding any other provision of this License, for material you+add to a covered work, you may (if authorized by the copyright holders of+that material) supplement the terms of this License with terms:++ a) Disclaiming warranty or limiting liability differently from the+ terms of sections 15 and 16 of this License; or++ b) Requiring preservation of specified reasonable legal notices or+ author attributions in that material or in the Appropriate Legal+ Notices displayed by works containing it; or++ c) Prohibiting misrepresentation of the origin of that material, or+ requiring that modified versions of such material be marked in+ reasonable ways as different from the original version; or++ d) Limiting the use for publicity purposes of names of licensors or+ authors of the material; or++ e) Declining to grant rights under trademark law for use of some+ trade names, trademarks, or service marks; or++ f) Requiring indemnification of licensors and authors of that+ material by anyone who conveys the material (or modified versions of+ it) with contractual assumptions of liability to the recipient, for+ any liability that these contractual assumptions directly impose on+ those licensors and authors.++All other non-permissive additional terms are considered "further+restrictions" within the meaning of section 10. If the Program as you+received it, or any part of it, contains a notice stating that it is+governed by this License along with a term that is a further+restriction, you may remove that term. If a license document contains+a further restriction but permits relicensing or conveying under this+License, you may add to a covered work material governed by the terms+of that license document, provided that the further restriction does+not survive such relicensing or conveying.++If you add terms to a covered work in accord with this section, you+must place, in the relevant source files, a statement of the+additional terms that apply to those files, or a notice indicating+where to find the applicable terms.++Additional terms, permissive or non-permissive, may be stated in the+form of a separately written license, or stated as exceptions;+the above requirements apply either way.++8. Termination.++You may not propagate or modify a covered work except as expressly+provided under this License. Any attempt otherwise to propagate or+modify it is void, and will automatically terminate your rights under+this License (including any patent licenses granted under the third+paragraph of section 11).++However, if you cease all violation of this License, then your+license from a particular copyright holder is reinstated (a)+provisionally, unless and until the copyright holder explicitly and+finally terminates your license, and (b) permanently, if the copyright+holder fails to notify you of the violation by some reasonable means+prior to 60 days after the cessation.++Moreover, your license from a particular copyright holder is+reinstated permanently if the copyright holder notifies you of the+violation by some reasonable means, this is the first time you have+received notice of violation of this License (for any work) from that+copyright holder, and you cure the violation prior to 30 days after+your receipt of the notice.++Termination of your rights under this section does not terminate the+licenses of parties who have received copies or rights from you under+this License. If your rights have been terminated and not permanently+reinstated, you do not qualify to receive new licenses for the same+material under section 10.++9. Acceptance Not Required for Having Copies.++You are not required to accept this License in order to receive or+run a copy of the Program. Ancillary propagation of a covered work+occurring solely as a consequence of using peer-to-peer transmission+to receive a copy likewise does not require acceptance. However,+nothing other than this License grants you permission to propagate or+modify any covered work. These actions infringe copyright if you do+not accept this License. Therefore, by modifying or propagating a+covered work, you indicate your acceptance of this License to do so.++10. Automatic Licensing of Downstream Recipients.++Each time you convey a covered work, the recipient automatically+receives a license from the original licensors, to run, modify and+propagate that work, subject to this License. You are not responsible+for enforcing compliance by third parties with this License.++An "entity transaction" is a transaction transferring control of an+organization, or substantially all assets of one, or subdividing an+organization, or merging organizations. If propagation of a covered+work results from an entity transaction, each party to that+transaction who receives a copy of the work also receives whatever+licenses to the work the party's predecessor in interest had or could+give under the previous paragraph, plus a right to possession of the+Corresponding Source of the work from the predecessor in interest, if+the predecessor has it or can get it with reasonable efforts.++You may not impose any further restrictions on the exercise of the+rights granted or affirmed under this License. For example, you may+not impose a license fee, royalty, or other charge for exercise of+rights granted under this License, and you may not initiate litigation+(including a cross-claim or counterclaim in a lawsuit) alleging that+any patent claim is infringed by making, using, selling, offering for+sale, or importing the Program or any portion of it.++11. Patents.++A "contributor" is a copyright holder who authorizes use under this+License of the Program or a work on which the Program is based. The+work thus licensed is called the contributor's "contributor version".++A contributor's "essential patent claims" are all patent claims+owned or controlled by the contributor, whether already acquired or+hereafter acquired, that would be infringed by some manner, permitted+by this License, of making, using, or selling its contributor version,+but do not include claims that would be infringed only as a+consequence of further modification of the contributor version. For+purposes of this definition, "control" includes the right to grant+patent sublicenses in a manner consistent with the requirements of+this License.++Each contributor grants you a non-exclusive, worldwide, royalty-free+patent license under the contributor's essential patent claims, to+make, use, sell, offer for sale, import and otherwise run, modify and+propagate the contents of its contributor version.++In the following three paragraphs, a "patent license" is any express+agreement or commitment, however denominated, not to enforce a patent+(such as an express permission to practice a patent or covenant not to+sue for patent infringement). To "grant" such a patent license to a+party means to make such an agreement or commitment not to enforce a+patent against the party.++If you convey a covered work, knowingly relying on a patent license,+and the Corresponding Source of the work is not available for anyone+to copy, free of charge and under the terms of this License, through a+publicly available network server or other readily accessible means,+then you must either (1) cause the Corresponding Source to be so+available, or (2) arrange to deprive yourself of the benefit of the+patent license for this particular work, or (3) arrange, in a manner+consistent with the requirements of this License, to extend the patent+license to downstream recipients. "Knowingly relying" means you have+actual knowledge that, but for the patent license, your conveying the+covered work in a country, or your recipient's use of the covered work+in a country, would infringe one or more identifiable patents in that+country that you have reason to believe are valid.++If, pursuant to or in connection with a single transaction or+arrangement, you convey, or propagate by procuring conveyance of, a+covered work, and grant a patent license to some of the parties+receiving the covered work authorizing them to use, propagate, modify+or convey a specific copy of the covered work, then the patent license+you grant is automatically extended to all recipients of the covered+work and works based on it.++A patent license is "discriminatory" if it does not include within+the scope of its coverage, prohibits the exercise of, or is+conditioned on the non-exercise of one or more of the rights that are+specifically granted under this License. You may not convey a covered+work if you are a party to an arrangement with a third party that is+in the business of distributing software, under which you make payment+to the third party based on the extent of your activity of conveying+the work, and under which the third party grants, to any of the+parties who would receive the covered work from you, a discriminatory+patent license (a) in connection with copies of the covered work+conveyed by you (or copies made from those copies), or (b) primarily+for and in connection with specific products or compilations that+contain the covered work, unless you entered into that arrangement,+or that patent license was granted, prior to 28 March 2007.++Nothing in this License shall be construed as excluding or limiting+any implied license or other defenses to infringement that may+otherwise be available to you under applicable patent law.++12. No Surrender of Others' Freedom.++If conditions are imposed on you (whether by court order, agreement or+otherwise) that contradict the conditions of this License, they do not+excuse you from the conditions of this License. If you cannot convey a+covered work so as to satisfy simultaneously your obligations under this+License and any other pertinent obligations, then as a consequence you may+not convey it at all. For example, if you agree to terms that obligate you+to collect a royalty for further conveying from those to whom you convey+the Program, the only way you could satisfy both those terms and this+License would be to refrain entirely from conveying the Program.++13. Remote Network Interaction; Use with the GNU General Public License.++Notwithstanding any other provision of this License, if you modify the+Program, your modified version must prominently offer all users+interacting with it remotely through a computer network (if your version+supports such interaction) an opportunity to receive the Corresponding+Source of your version by providing access to the Corresponding Source+from a network server at no charge, through some standard or customary+means of facilitating copying of software. This Corresponding Source+shall include the Corresponding Source for any work covered by version 3+of the GNU General Public License that is incorporated pursuant to the+following paragraph.++Notwithstanding any other provision of this License, you have+permission to link or combine any covered work with a work licensed+under version 3 of the GNU General Public License into a single+combined work, and to convey the resulting work. The terms of this+License will continue to apply to the part which is the covered work,+but the work with which it is combined will remain governed by version+3 of the GNU General Public License.++14. Revised Versions of this License.++The Free Software Foundation may publish revised and/or new versions of+the GNU Affero General Public License from time to time. Such new versions+will be similar in spirit to the present version, but may differ in detail to+address new problems or concerns.++Each version is given a distinguishing version number. If the+Program specifies that a certain numbered version of the GNU Affero General+Public License "or any later version" applies to it, you have the+option of following the terms and conditions either of that numbered+version or of any later version published by the Free Software+Foundation. If the Program does not specify a version number of the+GNU Affero General Public License, you may choose any version ever published+by the Free Software Foundation.++If the Program specifies that a proxy can decide which future+versions of the GNU Affero General Public License can be used, that proxy's+public statement of acceptance of a version permanently authorizes you+to choose that version for the Program.++Later license versions may give you additional or different+permissions. However, no additional obligations are imposed on any+author or copyright holder as a result of your choosing to follow a+later version.++15. Disclaimer of Warranty.++THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.++16. Limitation of Liability.++IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF+SUCH DAMAGES.++17. Interpretation of Sections 15 and 16.++If the disclaimer of warranty and limitation of liability provided+above cannot be given local legal effect according to their terms,+reviewing courts shall apply local law that most closely approximates+an absolute waiver of all civil liability in connection with the+Program, unless a warranty or assumption of liability accompanies a+copy of the Program in return for a fee.++ END OF TERMS AND CONDITIONS++ How to Apply These Terms to Your New Programs++If you develop a new program, and you want it to be of the greatest+possible use to the public, the best way to achieve this is to make it+free software which everyone can redistribute and change under these terms.++To do so, attach the following notices to the program. It is safest+to attach them to the start of each source file to most effectively+state the exclusion of warranty; and each file should have at least+the "copyright" line and a pointer to where the full notice is found.++ <one line to give the program's name and a brief idea of what it does.>+ Copyright (C) <year> <name of author>++ This program is free software: you can redistribute it and/or modify+ it under the terms of the GNU Affero General Public License as published+ by the Free Software Foundation, either version 3 of the License, or+ (at your option) any later version.++ This program is distributed in the hope that it will be useful,+ but WITHOUT ANY WARRANTY; without even the implied warranty of+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+ GNU Affero General Public License for more details.++ You should have received a copy of the GNU Affero General Public License+ along with this program. If not, see <https://www.gnu.org/licenses/>.++Also add information on how to contact you by electronic and paper mail.++If your software can interact with users remotely through a computer+network, you should also make sure that it provides a way for users to+get its source. For example, if your program is a web application, its+interface could display a "Source" link that leads users to an archive+of the code. There are many ways you could offer source, and different+solutions will be better for different programs; see section 13 for the+specific requirements.++You should also get your employer (if you work as a programmer) or school,+if any, to sign a "copyright disclaimer" for the program, if necessary.+For more information on this, and how to apply and follow the GNU AGPL, see+<https://www.gnu.org/licenses/>.diff --git a/apps/carbon/app/components/Form/CustomerContact.tsx b/apps/carbon/app/components/Form/CustomerContact.tsxindex 937e1e6edf..be821c9060 100644--- a/apps/carbon/app/components/Form/CustomerContact.tsx+++ b/apps/carbon/app/components/Form/CustomerContact.tsx@@ -117,13 +117,7 @@ const CustomerContact = ({) : (<Box>{label && <FormLabel>{label}</FormLabel>}- <Select- isDisabled- isLoading={isLoading}- options={[]}- //@ts-ignore- w="full"- />+ <Select isDisabled isLoading={isLoading} options={[]} /></Box>);};diff --git a/apps/carbon/app/components/Form/SupplierContact.tsx b/apps/carbon/app/components/Form/SupplierContact.tsxindex 383cff6dda..4b22bdfbac 100644--- a/apps/carbon/app/components/Form/SupplierContact.tsx+++ b/apps/carbon/app/components/Form/SupplierContact.tsx@@ -74,7 +74,6 @@ const SupplierContact = ({const contact = supplierContactFetcher.data?.data?.find((c) => c.id === newValue);-onChange(contact);}};@@ -106,7 +105,6 @@ const SupplierContact = ({placeholder={placeholder}// @ts-ignoreonChange={handleChange}- w="full"/>{error ? (<FormErrorMessage>{error}</FormErrorMessage>@@ -122,7 +120,6 @@ const SupplierContact = ({isLoading={isLoading}options={[]}//@ts-ignore- w="full"/></Box>);diff --git a/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsxindex 42014b5b14..f1c9addd83 100644--- a/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/ContentSidebar.tsx@@ -33,6 +33,9 @@ const ContentSidebar = ({ links }: { links: Route[] }) => {as={Link}to={route.to}variant={isActive ? "solid" : "ghost"}+ borderColor={isActive ? borderColor : "transparent"}+ borderStyle="solid"+ borderWidth={1}fontWeight={isActive ? "bold" : "normal"}justifyContent="start"w="full"diff --git a/apps/carbon/app/components/Layout/Sidebar/GroupContentSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/GroupContentSidebar.tsxindex ab558397bf..bbf12b7b37 100644--- a/apps/carbon/app/components/Layout/Sidebar/GroupContentSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/GroupContentSidebar.tsx@@ -1,14 +1,10 @@import { useColor } from "@carbon/react";import { Box, Button, Text, VStack } from "@chakra-ui/react";import { Link, useMatches } from "@remix-run/react";-import type { Route } from "~/types";+import type { RouteGroup } from "~/types";import { CollapsibleSidebar } from "./CollapsibleSidebar";-const GroupedContentSidebar = ({- links,-}: {- links: Record<string, Route[]>[];-}) => {+const GroupedContentSidebar = ({ groups }: { groups: RouteGroup[] }) => {const matches = useMatches();const borderColor = useColor("gray.200");const labelColor = useColor("gray.500");@@ -18,43 +14,44 @@ const GroupedContentSidebar = ({<VStack h="full" alignItems="start"><Box overflowY="auto" w="full" h="full" pb={8}><VStack spacing={2}>- {links.map((groups) =>- Object.entries(groups).map(([group, routes]) => (- <VStack- key={group}- spacing={1}- alignItems="start"- borderBottomStyle={"solid"}- borderBottomWidth={1}- borderBottomColor={borderColor}- px={2}- py={4}- w="full"- >- <Text color={labelColor} fontSize="sm" pl={3} py={1}>- {group}- </Text>- {routes.map((route) => {- const isActive = matches.some((match) =>- match.pathname.includes(route.to)- );- return (- <Button- key={route.name}- as={Link}- to={route.to}- variant={isActive ? "solid" : "ghost"}- fontWeight={isActive ? "bold" : "normal"}- justifyContent="start"- w="full"- >- {route.name}- </Button>- );- })}- </VStack>- ))- )}+ {groups.map((group) => (+ <VStack+ key={group.name}+ spacing={1}+ alignItems="start"+ borderBottomStyle={"solid"}+ borderBottomWidth={1}+ borderBottomColor={borderColor}+ px={2}+ py={4}+ w="full"+ >+ <Text color={labelColor} fontSize="sm" pl={3} py={1}>+ {group.name}+ </Text>+ {group.routes.map((route) => {+ const isActive = matches.some((match) =>+ match.pathname.includes(route.to)+ );+ return (+ <Button+ key={route.name}+ as={Link}+ to={route.to}+ variant={isActive ? "solid" : "ghost"}+ borderColor={isActive ? borderColor : "transparent"}+ borderStyle="solid"+ borderWidth={1}+ fontWeight={isActive ? "bold" : "normal"}+ justifyContent="start"+ w="full"+ >+ {route.name}+ </Button>+ );+ })}+ </VStack>+ ))}</VStack></Box></VStack>diff --git a/apps/carbon/app/components/Layout/Sidebar/IconSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/IconSidebar.tsxindex 831cb0a78a..895281b34d 100644--- a/apps/carbon/app/components/Layout/Sidebar/IconSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/IconSidebar.tsx@@ -24,10 +24,10 @@ const IconSidebar = () => {as={Link}to={link.to}variant={isActive ? "solid" : "outline"}- colorScheme={isActive ? "blackAlpha" : "gray"}size="lg"borderRadius={0}- border="none"+ borderWidth={1}+ borderColor={isActive ? "gray.200" : "transparent"}aria-label={link.name}icon={link.icon}/>diff --git a/apps/carbon/app/components/Layout/Sidebar/useSidebar.tsx b/apps/carbon/app/components/Layout/Sidebar/useSidebar.tsxindex 1e16d3cb7f..b4fa97145d 100644--- a/apps/carbon/app/components/Layout/Sidebar/useSidebar.tsx+++ b/apps/carbon/app/components/Layout/Sidebar/useSidebar.tsx@@ -17,78 +17,78 @@ const sidebarItems: Authenticated<NavItem>[] = [{permission: "parts",name: "Parts",- to: "/app/parts",+ to: "/x/parts",icon: <AiOutlinePartition />,},{permission: "jobs",name: "Jobs",- to: "/app/jobs",+ to: "/x/jobs",icon: <BiListCheck />,},{permission: "inventory",name: "Inventory",- to: "/app/inventory",+ to: "/x/inventory",icon: <HiOutlineCube />,},{permission: "scheduling",name: "Scheduling",- to: "/app/scheduling",+ to: "/x/scheduling",icon: <BsCalendar2Week />,},{permission: "timecards",name: "Timecards",- to: "/app/timecards",+ to: "/x/timecards",icon: <AiOutlineFieldTime />,},{permission: "sales",name: "Sales",- to: "/app/sales",+ to: "/x/sales",icon: <BsCartPlus />,},{permission: "purchasing",name: "Purchasing",- to: "/app/purchasing",+ to: "/x/purchasing",icon: <BsCartDash />,},{permission: "documents",name: "Documents",- to: "/app/documents",+ to: "/x/documents",icon: <HiOutlineDocumentDuplicate />,},{permission: "messages",name: "Messaging",- to: "/app/messaging",+ to: "/x/messaging",icon: <BiMessage />,},{permission: "people",name: "People",- to: "/app/people",+ to: "/x/people",icon: <BsPeopleFill />,},{permission: "users",name: "Users",- to: "/app/users",+ to: "/x/users",icon: <BsShieldLock />,},{permission: "settings",name: "Settings",- to: "/app/settings",+ to: "/x/settings",icon: <GoSettings />,},{name: "My Account",- to: "/app/account",+ to: "/x/account",icon: <CgProfile />,},];diff --git a/apps/carbon/app/components/Layout/Topbar/AvatarMenu.tsx b/apps/carbon/app/components/Layout/Topbar/AvatarMenu.tsxindex f3a5828a6c..ca2de3f769 100644--- a/apps/carbon/app/components/Layout/Topbar/AvatarMenu.tsx+++ b/apps/carbon/app/components/Layout/Topbar/AvatarMenu.tsx@@ -29,7 +29,7 @@ const AvatarMenu = () => {<MenuList fontSize="sm" boxShadow="xl" minW={48}><MenuItem>Signed in as {name}</MenuItem><MenuDivider />- <MenuItem as={Link} to="/app/account/profile" icon={<CgProfile />}>+ <MenuItem as={Link} to="/x/account/profile" icon={<CgProfile />}>My Profile</MenuItem><Form method="post" action="/logout">diff --git a/apps/carbon/app/components/Layout/Topbar/Logo.tsx b/apps/carbon/app/components/Layout/Topbar/Logo.tsxindex 8c68d83084..7ead60defe 100644--- a/apps/carbon/app/components/Layout/Topbar/Logo.tsx+++ b/apps/carbon/app/components/Layout/Topbar/Logo.tsx@@ -19,7 +19,7 @@ const Logo = () => {border="none"aria-label="Carbon"icon={<AiOutlineCodeSandbox />}- to="/app"+ to="/x"/></Box>);diff --git a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx b/apps/carbon/app/components/Layout/Topbar/Topbar.tsxindex 0ec3ea2cfa..402d1ae7ba 100644--- a/apps/carbon/app/components/Layout/Topbar/Topbar.tsx+++ b/apps/carbon/app/components/Layout/Topbar/Topbar.tsx@@ -2,7 +2,7 @@ import { useColor } from "@carbon/react";import { Button, GridItem, HStack } from "@chakra-ui/react";import { BiHelpCircle } from "react-icons/bi";import { BsChatSquare } from "react-icons/bs";-import { SearchButton } from "~/components/Search";+import { Search } from "~/components/Search";import AvatarMenu from "./AvatarMenu";import Breadcrumbs from "./Breadcrumbs";import useBreadcrumbs from "./useBreadcrumbs";@@ -13,43 +13,53 @@ const Topbar = () => {return (<GridItem- display="grid"- gap={4}- gridTemplateColumns="1fr auto 1fr"- // backdropFilter="auto"- // backdropBlur="8px"bg={useColor("white")}borderBottom={1}borderBottomColor={borderColor}borderBottomStyle="solid"+ display="grid"+ gap={4}+ gridTemplateColumns="1fr auto 1fr"position="sticky"px={4}top={0}zIndex={1}><Breadcrumbs links={breadcrumbLinks} />- <SearchButton />+ <Search /><HStack py={2} justifyContent="end">- <Button- colorScheme="gray"- leftIcon={<BiHelpCircle />}- variant="solid"- border={1}- borderColor={borderColor}- borderStyle="solid"+ <a+ target="_blank"+ href="https://github.com/barbinbrad/carbon/issues/new/choose"+ rel="noreferrer">- Help- </Button>- <Button- colorScheme="gray"- leftIcon={<BsChatSquare />}- variant="solid"- border={1}- borderColor={borderColor}- borderStyle="solid"+ <Button+ colorScheme="gray"+ leftIcon={<BiHelpCircle />}+ variant="solid"+ border={1}+ borderColor={borderColor}+ borderStyle="solid"+ >+ Help+ </Button>+ </a>+ <a+ target="_blank"+ href="https://github.com/barbinbrad/carbon/discussions/new/choose"+ rel="noreferrer">- Feedback- </Button>+ <Button+ colorScheme="gray"+ leftIcon={<BsChatSquare />}+ variant="solid"+ border={1}+ borderColor={borderColor}+ borderStyle="solid"+ >+ Feedback+ </Button>+ </a><AvatarMenu /></HStack></GridItem>diff --git a/apps/carbon/app/components/Layout/Topbar/useBreadcrumbs.tsx b/apps/carbon/app/components/Layout/Topbar/useBreadcrumbs.tsxindex 2a2acbea59..bd1f32b874 100644--- a/apps/carbon/app/components/Layout/Topbar/useBreadcrumbs.tsx+++ b/apps/carbon/app/components/Layout/Topbar/useBreadcrumbs.tsx@@ -8,128 +8,128 @@ export default function useBreadcrumbs(): Route[] {const result = matches.reduce<Route[]>((acc, match) => {switch (match.id) {case "root":- return acc.concat({ to: "/app", name: "Home", icon: <IoHomeSharp /> });- case "routes/app.account":+ return acc.concat({ to: "/x", name: "Home", icon: <IoHomeSharp /> });+ case "routes/x.account":return acc.concat({name: "Account",to: match.pathname,});- case "routes/app.account.profile":+ case "routes/x.account.profile":return acc.concat({name: "Profile",to: match.pathname,});- case "routes/app.account.personal":+ case "routes/x.account.personal":return acc.concat({name: "Personal",to: match.pathname,});- case "routes/app.account.password":+ case "routes/x.account.password":return acc.concat({name: "Password",to: match.pathname,});- case "routes/app.account.notifications":+ case "routes/x.account.notifications":return acc.concat({name: "Notifications",to: match.pathname,});- case "routes/app.account.security":+ case "routes/x.account.security":return acc.concat({name: "Security",to: match.pathname,});- case "routes/app.account.settings":+ case "routes/x.account.settings":return acc.concat({name: "Settings",to: match.pathname,});- case "routes/app.parts":+ case "routes/x.parts":return acc.concat({name: "Parts",to: match.pathname,});- case "routes/app.people":+ case "routes/x.people":return acc.concat({name: "People",to: match.pathname,});- case "routes/app.people.attributes":+ case "routes/x.people.attributes":return acc.concat({name: "Attributes",to: match.pathname,});- case "routes/app.purchasing":+ case "routes/x.purchasing":return acc.concat({name: "Purchasing",to: match.pathname,});- case "routes/app.purchasing.suppliers":+ case "routes/x.purchasing.suppliers":return acc.concat({name: "Suppliers",to: match.pathname,});- case "routes/app.purchasing.supplier-types":+ case "routes/x.purchasing.supplier-types":return acc.concat({name: "Supplier Types",to: match.pathname,});- case "routes/app.sales":+ case "routes/x.sales":return acc.concat({name: "Sales",to: match.pathname,});- case "routes/app.sales.customers":+ case "routes/x.sales.customers":return acc.concat({name: "Customers",to: match.pathname,});- case "routes/app.sales.customer-types":+ case "routes/x.sales.customer-types":return acc.concat({name: "Customer Types",to: match.pathname,});- case "routes/app.users":+ case "routes/x.users":return acc.concat({name: "Users",to: match.pathname,});- case "routes/app.users.attributes":+ case "routes/x.users.attributes":return acc.concat({name: "Attributes",to: match.pathname,});- case "routes/app.users.employees":+ case "routes/x.users.employees":return acc.concat({name: "Employees",to: match.pathname,});- case "routes/app.users.employee-types":+ case "routes/x.users.employee-types":return acc.concat({name: "Employee Types",to: match.pathname,});- case "routes/app.users.customers":+ case "routes/x.users.customers":return acc.concat({name: "Customers",to: match.pathname,});- case "routes/app.users.suppliers":+ case "routes/x.users.suppliers":return acc.concat({name: "Suppliers",to: match.pathname,});- case "routes/app.users.groups":+ case "routes/x.users.groups":return acc.concat({name: "Groups",to: match.pathname,});- case "routes/app.users.$personId":+ case "routes/x.users.$personId":return acc.concat({name: match.params.personId!,to: `app.users.${match.params.personId}`,});- case "routes/app.users.new":+ case "routes/x.users.new":return acc.concat({name: "New",to: match.pathname,diff --git a/apps/carbon/app/components/Layout/index.ts b/apps/carbon/app/components/Layout/index.tsindex b3ebba6025..05171b1b2c 100644--- a/apps/carbon/app/components/Layout/index.ts+++ b/apps/carbon/app/components/Layout/index.ts@@ -1,4 +1,4 @@-import { IconSidebar, ContentSidebar } from "./Sidebar";+import { ContentSidebar, IconSidebar } from "./Sidebar";import PageTitle from "./PageTitle";import SectionTitle from "./SectionTitle";import Topbar from "./Topbar";diff --git a/apps/carbon/app/components/Search/SearchButton/SearchButton.tsx b/apps/carbon/app/components/Search/Search/Search.tsxsimilarity index 91%rename from apps/carbon/app/components/Search/SearchButton/SearchButton.tsxrename to apps/carbon/app/components/Search/Search/Search.tsxindex 84e66b9473..7e1abb0e80 100644--- a/apps/carbon/app/components/Search/SearchButton/SearchButton.tsx+++ b/apps/carbon/app/components/Search/Search/Search.tsx@@ -101,12 +101,33 @@ const SearchModal = ({(event: React.KeyboardEvent<HTMLInputElement>) => {const results =debouncedQuery.length === 0 ? defaultResults : searchResults;++ const scrollToListItem = (index: number) => {+ const listbox = listboxRef.current;+ if (listbox) {+ const listItem = listbox.children[index] as HTMLLIElement;+ if (listItem) {+ listItem.scrollIntoView({+ block: "nearest",+ });+ }+ }+ };+switch (event.code) {case "ArrowDown":- setSelectedIndex((prev) => clip(prev + 1, 0, results.length - 1));+ setSelectedIndex((prev) => {+ const newIndex = clip(prev + 1, 0, results.length - 1);+ scrollToListItem(newIndex);+ return newIndex;+ });break;case "ArrowUp":- setSelectedIndex((prev) => clip(prev - 1, 0, results.length - 1));+ setSelectedIndex((prev) => {+ const newIndex = clip(prev - 1, 0, results.length - 1);+ scrollToListItem(newIndex);+ return newIndex;+ });break;case "Enter":const selectedResult = results[selectedIndex];@@ -127,17 +148,6 @@ const SearchModal = ({[debouncedQuery.length, navigate, searchResults, selectedIndex]);- useEffect(() => {- if (listboxRef.current) {- const listbox = listboxRef.current;- const listboxItems = listbox.querySelectorAll("li");- const activeItem = listboxItems[selectedIndex];- if (activeItem) {- activeItem.scrollIntoView({ block: "nearest" });- }- }- }, [searchResults, selectedIndex]);-useEffect(() => {setSelectedIndex(0);if (debouncedQuery) {@@ -274,11 +284,7 @@ function Result({mt={2}px={4}py={2}- onMouseOver={onHover}- _hover={{- bg: "gray.900",- color: "white",- }}+ onMouseEnter={onHover}><ResultIcon entity={result.entity} /><VStack alignItems="start" flexGrow={1} spacing={0} w="full">@@ -317,11 +323,7 @@ function Module({mt={2}px={4}py={2}- onMouseOver={onHover}- _hover={{- bg: "gray.900",- color: "white",- }}+ onMouseEnter={onHover}>{/* {item.icon && ( // @ts-expect-error<Icon as={item.icon} {...resultIconProps} />@@ -340,12 +342,9 @@ function Module({const SearchButton = (props: ButtonProps) => {const searchModal = useDisclosure();- useKeyboardShortcuts(- {- "/": searchModal.onOpen,- },- ["INPUT", "TEXTAREA", "SELECT"]- );+ useKeyboardShortcuts({+ "/": searchModal.onOpen,+ });return (<>diff --git a/apps/carbon/app/components/Search/Search/index.ts b/apps/carbon/app/components/Search/Search/index.tsnew file mode 100644index 0000000000..c00d9e1f6d--- /dev/null+++ b/apps/carbon/app/components/Search/Search/index.ts@@ -0,0 +1,3 @@+import Search from "./Search";++export default Search;diff --git a/apps/carbon/app/components/Search/SearchButton/index.ts b/apps/carbon/app/components/Search/SearchButton/index.tsdeleted file mode 100644index a8a26d771f..0000000000--- a/apps/carbon/app/components/Search/SearchButton/index.ts+++ /dev/null@@ -1,3 +0,0 @@-import SearchButton from "./SearchButton";--export default SearchButton;diff --git a/apps/carbon/app/components/Search/index.ts b/apps/carbon/app/components/Search/index.tsindex bd7892bdff..8bbc11da43 100644--- a/apps/carbon/app/components/Search/index.ts+++ b/apps/carbon/app/components/Search/index.ts@@ -1,4 +1,4 @@import DebouncedInput from "./DebouncedInput";-import SearchButton from "./SearchButton";+import Search from "./Search";-export { DebouncedInput, SearchButton };+export { DebouncedInput, Search };diff --git a/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx b/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsxindex b6a776e147..80062dc1c0 100644--- a/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx+++ b/apps/carbon/app/components/Selectors/SupplierSelect/SupplierSelect.tsx@@ -39,7 +39,6 @@ const SupplierSelect = ({ value, onChange }: SupplierSelectProps) => {isMulti={false}placeholder="Select supplier"onChange={onChange ? (newValue) => onChange(newValue) : undefined}- w="full"/>);};diff --git a/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx b/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsxindex fdb29d1b37..8aee3d43eb 100644--- a/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx+++ b/apps/carbon/app/components/Selectors/UserSelect/UserSelect.tsx@@ -20,13 +20,19 @@ import TreeSelect from "./components/TreeSelect";import type { UserSelectProps } from "./types";import { UserSelectContext } from "./provider";import useUserSelect from "./useUserSelect";+import { usePermissions } from "~/hooks";+import { Select } from "@carbon/react";export default function Component(props: UserSelectProps) {- const state = useUserSelect(props);- return <UserSelect {...state} />;+ const permissions = usePermissions();++ if (!permissions.is("employee"))+ return <Select options={[]} isDisabled placeholder="Select..." />;+ return <UserSelect {...props} />;}-const UserSelect = (state: ReturnType<typeof useUserSelect>) => {+const UserSelect = (props: UserSelectProps) => {+ const state = useUserSelect(props);const {dropdown,innerProps: { hideSelections, isMulti, label, readOnly, testID, width },diff --git a/apps/carbon/app/config/env.ts b/apps/carbon/app/config/env.tsindex 1ec0531312..40b92f073a 100644--- a/apps/carbon/app/config/env.ts+++ b/apps/carbon/app/config/env.ts@@ -19,8 +19,8 @@ declare global {SESSION_SECRET: string;SESSION_KEY: string;SESSION_ERROR_KEY: string;- SESSION_MAX_AGE: number;- REFRESH_ACCESS_TOKEN_THRESHOLD: number;+ // SESSION_MAX_AGE: number;+ // REFRESH_ACCESS_TOKEN_THRESHOLD: number;}}}diff --git a/apps/carbon/app/hooks/usePermissions.tsx b/apps/carbon/app/hooks/usePermissions.tsxindex 3e50dd119b..f5c66a7c76 100644--- a/apps/carbon/app/hooks/usePermissions.tsx+++ b/apps/carbon/app/hooks/usePermissions.tsx@@ -1,11 +1,12 @@import { useCallback } from "react";import type { Permission } from "~/interfaces/Users/types";+import type { Role } from "~/types";import { useRouteData } from "./useRouteData";export function usePermissions() {- const data = useRouteData<{ permissions: unknown }>("/app");+ const data = useRouteData<{ permissions: unknown; role: unknown }>("/x");- if (!isPermissions(data?.permissions)) {+ if (!isPermissions(data?.permissions) || !isRole(data?.role)) {// TODO: force logout -- the likely cause is development changesthrow new Error("usePermissions must be used within an authenticated route. If you are seeing this error, you are likely in development and have changed the session variables. Try deleting the cookies."@@ -23,12 +24,20 @@ export function usePermissions() {[data?.permissions]);+ const is = useCallback(+ (role: Role) => {+ return data?.role === role;+ },+ [data?.role]+ );+return {can,+ is,};}-function isPermissions(value: any): value is Record<string, Permission> {+function isPermissions(value: unknown): value is Record<string, Permission> {if (typeof value === "object" &&Array.isArray(value) === false &&@@ -45,3 +54,7 @@ function isPermissions(value: any): value is Record<string, Permission> {return false;}}++function isRole(value: unknown): value is Role {+ return value === "employee" || value === "customer" || value === "supplier";+}diff --git a/apps/carbon/app/hooks/useUser.tsx b/apps/carbon/app/hooks/useUser.tsxindex b1744aeeb7..7d99ef5fa9 100644--- a/apps/carbon/app/hooks/useUser.tsx+++ b/apps/carbon/app/hooks/useUser.tsx@@ -9,7 +9,7 @@ type User = {};export function useUser() {- const data = useRouteData<{ user: unknown }>("/app");+ const data = useRouteData<{ user: unknown }>("/x");if (data?.user && isUser(data.user)) {return data.user;}diff --git a/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsx b/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsxindex 6e267909e2..75d7457e14 100644--- a/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsx+++ b/apps/carbon/app/interfaces/Account/Password/PasswordForm/PasswordForm.tsx@@ -23,7 +23,7 @@ const PasswordForm = () => {<Box w="full"><ValidatedFormmethod="post"- action="/app/account/password"+ action="/x/account/password"validator={accountPasswordValidator}><VStack spacing={4} my={4} w="full" alignItems="start" maxW={440}>diff --git a/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsx b/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsxindex e16042d755..aa3e88c19a 100644--- a/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsx+++ b/apps/carbon/app/interfaces/Account/Personal/PersonalDataForm/PersonalDataForm.tsx@@ -13,7 +13,7 @@ const PersonalDataForm = ({ personalData }: PersonalDataFormProps) => {<Box w="full"><ValidatedFormmethod="post"- action="/app/account/personal"+ action="/x/account/personal"validator={accountPersonalDataValidator}defaultValues={personalData}>diff --git a/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsx b/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsxindex 0d4d7a991a..bf334b5aba 100644--- a/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsx+++ b/apps/carbon/app/interfaces/Account/Profile/ProfileForm/ProfileForm.tsx@@ -15,7 +15,7 @@ const ProfileForm = ({ user }: ProfileFormProps) => {<SectionTitle title="Basic Information" /><ValidatedFormmethod="post"- action="/app/account/profile"+ action="/x/account/profile"validator={accountProfileValidator}defaultValues={user}>diff --git a/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx b/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsxindex 279a5993e3..ab98c828f3 100644--- a/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx+++ b/apps/carbon/app/interfaces/Account/Profile/ProfilePhotoForm/ProfilePhotoForm.tsx@@ -61,7 +61,7 @@ const ProfilePhotoForm = ({ user }: ProfilePhotoFormProps) => {if (path) formData.append("path", path);submit(formData, {method: "post",- action: "/app/account/profile",+ action: "/x/account/profile",});};diff --git a/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsx b/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsxindex 7f2bcaa6d9..778151398a 100644--- a/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsx+++ b/apps/carbon/app/interfaces/Account/UserAttributes/UserAttributesForm.tsx@@ -44,7 +44,7 @@ const UserAttributesForm = ({ attributeCategory }: UserAttributesFormProps) => {const user = useUser();const updateFetcher = useFetcher<{}>();const [optimisticUpdates, setOptimisticUpdates] = useState<- Record<number, boolean | string | number>+ Record<string, boolean | string | number>>({});if (@@ -89,7 +89,7 @@ const UserAttributesForm = ({ attributeCategory }: UserAttributesFormProps) => {type GenericAttributeRowProps = {attribute: {- id: number | null;+ id: string | null;name: string | null;canSelfManage: boolean | null;listOptions: string[] | null;@@ -97,8 +97,8 @@ type GenericAttributeRowProps = {displayValue: string | number | boolean;type: DataType;updateFetcher: ReturnType<typeof useFetcher>;- userAttributeId: number;- userAttributeValueId?: number;+ userAttributeId: string;+ userAttributeValueId?: string;userId: string;value: Date | string | number | boolean | null;setOptimisticUpdate: (value: boolean | string | number) => void;@@ -142,7 +142,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeBooleanValidator}defaultValues={{userAttributeId,@@ -184,7 +184,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeTextValidator}defaultValues={{userAttributeId,@@ -226,7 +226,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeTextValidator}defaultValues={{userAttributeId,@@ -276,7 +276,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeNumericValidator}defaultValues={{userAttributeId,@@ -318,7 +318,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeTextValidator}defaultValues={{userAttributeId,@@ -360,7 +360,7 @@ function renderTypedForm({return (<ValidatedFormmethod="post"- action={`/app/account/${userId}/attribute`}+ action={`/x/account/${userId}/attribute`}validator={attributeUserValidator}defaultValues={{userAttributeId,@@ -624,8 +624,8 @@ function UpdateRemoveButtons({canUpdate: boolean;updateFetcher: ReturnType<typeof useFetcher>;userId: string;- userAttributeId: number;- userAttributeValueId?: number;+ userAttributeId: string;+ userAttributeValueId?: string;onOpen: () => void;}) {return (@@ -633,7 +633,7 @@ function UpdateRemoveButtons({{userAttributeValueId && (<ValidatedFormmethod="post"- action={`/app/account/${userId}/delete/attribute`}+ action={`/x/account/${userId}/delete/attribute`}validator={deleteUserAttributeValueValidator}defaultValues={{userAttributeId,diff --git a/apps/carbon/app/interfaces/Account/useAccountSidebar.tsx b/apps/carbon/app/interfaces/Account/useAccountSidebar.tsxindex 0ac560ce57..b25e392f24 100644--- a/apps/carbon/app/interfaces/Account/useAccountSidebar.tsx+++ b/apps/carbon/app/interfaces/Account/useAccountSidebar.tsx@@ -3,27 +3,27 @@ import type { Route } from "~/types";const accountRoutes: Route[] = [{name: "Profile",- to: "/app/account/profile",+ to: "/x/account/profile",},{name: "Personal",- to: "/app/account/personal",+ to: "/x/account/personal",},{name: "Password",- to: "/app/account/password",+ to: "/x/account/password",},// {// name: "Notifications",- // to: "/app/account/notifications",+ // to: "/x/account/notifications",// },// {// name: "Security",- // to: "/app/account/security",+ // to: "/x/account/security",// },// {// name: "Settings",- // to: "/app/account/settings",+ // to: "/x/account/settings",// },];diff --git a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsxindex cfe2289068..e79caaac84 100644--- a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx+++ b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoriesTable/AttributesCategoriesTable.tsx@@ -18,7 +18,7 @@ import { IoMdTrash } from "react-icons/io";import { Table } from "~/components";import { ConfirmDelete } from "~/components/Modals";import { usePermissions, useUrlParams } from "~/hooks";-import type { AttributeCategory } from "~/interfaces/Users/types";+import type { AttributeCategory } from "~/interfaces/People/types";type AttributeCategoriesTableProps = {data: AttributeCategory[];@@ -59,7 +59,7 @@ const AttributeCategoriesTable = memo(<ButtononClick={() => {navigate(- `/app/people/attributes/list/${+ `/x/people/attributes/list/${row.original.id}?${params.toString()}`);@@ -75,7 +75,7 @@ const AttributeCategoriesTable = memo(icon={<BsPlus />}onClick={() => {navigate(- `/app/people/attributes/list/${+ `/x/people/attributes/list/${row.original.id}/new?${params.toString()}`);@@ -111,7 +111,7 @@ const AttributeCategoriesTable = memo(icon={<BiAddToQueue />}onClick={() => {navigate(- `/app/people/attributes/list/${+ `/x/people/attributes/list/${row.original.id}/new?${params.toString()}`);@@ -123,7 +123,7 @@ const AttributeCategoriesTable = memo(icon={<BsListUl />}onClick={() => {navigate(- `/app/people/attributes/list/${+ `/x/people/attributes/list/${row.original.id}?${params.toString()}`);@@ -134,7 +134,7 @@ const AttributeCategoriesTable = memo(<MenuItemicon={<BsPencilSquare />}onClick={() => {- navigate(`/app/people/attributes/${row.original.id}`);+ navigate(`/x/people/attributes/${row.original.id}`);}}>Edit Attribute Category@@ -166,7 +166,7 @@ const AttributeCategoriesTable = memo(/><ConfirmDelete- action={`/app/people/attributes/delete/${selectedCategory?.id}`}+ action={`/x/people/attributes/delete/${selectedCategory?.id}`}name={selectedCategory?.name ?? ""}text={`Are you sure you want to deactivate the ${selectedCategory?.name} attribute category?`}isOpen={deleteModal.isOpen}diff --git a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsxindex 3f13e13e10..ff38e91398 100644--- a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx+++ b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryDetail/AttributeCategoryDetail.tsx@@ -29,7 +29,7 @@ import { ConfirmDelete } from "~/components/Modals";import type {Attribute,AttributeCategoryDetail as AttributeCategoryDetailType,-} from "~/interfaces/Users/types";+} from "~/interfaces/People/types";import { useUrlParams } from "~/hooks";type AttributeCategoryDetailProps = {@@ -67,8 +67,8 @@ const AttributeCategoryDetail = ({: []);- const onReorder = (newOrder: number[]) => {- let updates: Record<number, number> = {};+ const onReorder = (newOrder: string[]) => {+ let updates: Record<string, number> = {};newOrder.forEach((id, index) => {if (id !== sortOrder[index]) {updates[id] = index + 1;@@ -78,7 +78,7 @@ const AttributeCategoryDetail = ({updateSortOrder(updates);};- const updateSortOrder = (updates: Record<number, number>) => {+ const updateSortOrder = (updates: Record<string, number>) => {let formData = new FormData();formData.append("updates", JSON.stringify(updates));sortOrderFetcher.submit(formData, { method: "post" });@@ -202,7 +202,7 @@ const AttributeCategoryDetail = ({</Drawer><ConfirmDeleteisOpen={deleteModal.isOpen}- action={`/app/people/attribute/delete/${selectedAttribute?.id}`}+ action={`/x/people/attribute/delete/${selectedAttribute?.id}`}name={selectedAttribute?.name ?? ""}text={`Are you sure you want to deactivate the ${selectedAttribute?.name} attribute?`}onCancel={onDeleteCancel}diff --git a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsxindex e3ef3e3210..dcbc14cb55 100644--- a/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx+++ b/apps/carbon/app/interfaces/People/Attributes/AttributeCategoryForm/AttributeCategoryForm.tsx@@ -12,11 +12,12 @@ import {} from "@chakra-ui/react";import { ValidatedForm } from "remix-validated-form";import { Boolean, Input, Hidden, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import { attributeCategoryValidator } from "~/services/people";type AttributeCategoryFormProps = {initialValues: {- id?: number;+ id?: string;name: string;isPublic: boolean;};@@ -27,7 +28,11 @@ const AttributeCategoryForm = ({initialValues,onClose,}: AttributeCategoryFormProps) => {+ const permissions = usePermissions();const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "users")+ : !permissions.can("create", "users");return (<Drawer onClose={onClose} isOpen={true} size="sm">@@ -36,8 +41,8 @@ const AttributeCategoryForm = ({method="post"action={isEditing- ? `/app/people/attributes/${initialValues.id}`- : "/app/people/attributes/new"+ ? `/x/people/attributes/${initialValues.id}`+ : "/x/people/attributes/new"}defaultValues={initialValues}>@@ -60,7 +65,7 @@ const AttributeCategoryForm = ({</DrawerBody><DrawerFooter><HStack spacing={2} mt={8}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/People/Attributes/AttributeForm/AttributeForm.tsx b/apps/carbon/app/interfaces/People/Attributes/AttributeForm/AttributeForm.tsxindex d2bc491b3e..2e27023a84 100644--- a/apps/carbon/app/interfaces/People/Attributes/AttributeForm/AttributeForm.tsx+++ b/apps/carbon/app/interfaces/People/Attributes/AttributeForm/AttributeForm.tsx@@ -20,15 +20,16 @@ import {Submit,Select,} from "~/components/Form";+import { usePermissions } from "~/hooks";import { DataType } from "~/interfaces/Users/types";import { attributeValidator } from "~/services/people";import { mapRowsToOptions } from "~/utils/form";type AttributeFormProps = {initialValues: {- id?: number;+ id?: string;name: string;- userAttributeCategoryId: number;+ userAttributeCategoryId: string;attributeDataTypeId?: number;listOptions?: string[];canSelfManage: boolean;@@ -50,12 +51,17 @@ const AttributeForm = ({dataTypes,onClose,}: AttributeFormProps) => {+ const permissions = usePermissions();const options = mapRowsToOptions({data: dataTypes,value: "id",label: "label",});const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "users")+ : !permissions.can("create", "users");+const [isList, setIsList] = useState(initialValues.attributeDataTypeId === DataType.List);@@ -74,8 +80,8 @@ const AttributeForm = ({method="post"action={isEditing- ? `/app/people/attribute/${initialValues.id}`- : "/app/people/attribute/new"+ ? `/x/people/attribute/${initialValues.id}`+ : "/x/people/attribute/new"}defaultValues={initialValues}>@@ -109,7 +115,7 @@ const AttributeForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/People/usePeopleSidebar.tsx b/apps/carbon/app/interfaces/People/usePeopleSidebar.tsxindex 131db9df90..732f8768db 100644--- a/apps/carbon/app/interfaces/People/usePeopleSidebar.tsx+++ b/apps/carbon/app/interfaces/People/usePeopleSidebar.tsx@@ -1,20 +1,21 @@-import type { Route } from "~/types";+import type { RouteGroup } from "~/types";-const usersRoutes: Record<string, Route[]>[] = [+const usersRoutes: RouteGroup[] = [{- Configuration: [+ name: "Configuration",+ routes: [{name: "Attributes",- to: "/app/people/attributes",+ to: "/x/people/attributes",},{name: "Skills",- to: "/app/people/skills",+ to: "/x/people/skills",},],},];export default function usePeopleSidebar() {- return { links: usersRoutes };+ return { groups: usersRoutes };}diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsxindex aad292bf89..3743d7571b 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx+++ b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypeForm/SupplierTypeForm.tsx@@ -13,6 +13,7 @@ import {import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import { supplierTypeValidator } from "~/services/purchasing";type SupplierTypeFormProps = {@@ -24,10 +25,14 @@ type SupplierTypeFormProps = {};const SupplierTypeForm = ({ initialValues }: SupplierTypeFormProps) => {+ const permissions = usePermissions();const navigate = useNavigate();const onClose = () => navigate(-1);const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");return (<Drawer onClose={onClose} isOpen={true} size="sm">@@ -36,8 +41,8 @@ const SupplierTypeForm = ({ initialValues }: SupplierTypeFormProps) => {method="post"action={isEditing- ? `/app/purchasing/supplier-types/${initialValues.id}`- : "/app/purchasing/supplier-types/new"+ ? `/x/purchasing/supplier-types/${initialValues.id}`+ : "/x/purchasing/supplier-types/new"}defaultValues={initialValues}>@@ -56,7 +61,7 @@ const SupplierTypeForm = ({ initialValues }: SupplierTypeFormProps) => {</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsxindex 24d1973acc..afde4a9c89 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx+++ b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTable/SupplierTypesTable.tsx@@ -49,7 +49,7 @@ const SupplierTypesTable = memo(({ data, count }: SupplierTypesTableProps) => {<MenuItemicon={<BsPeopleFill />}onClick={() => {- navigate(`/app/purchasing/suppliers?type=${row.original.id}`);+ navigate(`/x/purchasing/suppliers?type=${row.original.id}`);}}>View Suppliers@@ -62,7 +62,7 @@ const SupplierTypesTable = memo(({ data, count }: SupplierTypesTableProps) => {icon={<BsPencilSquare />}onClick={() => {navigate(- `/app/purchasing/supplier-types/${+ `/x/purchasing/supplier-types/${row.original.id}?${params.toString()}`);@@ -78,7 +78,7 @@ const SupplierTypesTable = memo(({ data, count }: SupplierTypesTableProps) => {icon={<IoMdTrash />}onClick={() => {navigate(- `/app/purchasing/supplier-types/delete/${+ `/x/purchasing/supplier-types/delete/${row.original.id}?${params.toString()}`);diff --git a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsxindex 164df8bc04..0060e46a5a 100644--- a/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx+++ b/apps/carbon/app/interfaces/Purchasing/SupplierTypes/SupplierTypesTableFilters/SupplierTypesTableFilters.tsx@@ -28,7 +28,7 @@ const SupplierTypesTableFilters = () => {/></HStack><HStack spacing={2}>- {permissions.can("create", "users") && (+ {permissions.can("create", "purchasing") && (<Buttonas={Link}to={`new?${params.toString()}`}diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsxindex ec2f3e0070..69f0b8d515 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/SupplierForm.tsx@@ -30,7 +30,7 @@ import type {SupplierType,} from "~/interfaces/Purchasing/types";import { mapRowsToOptions } from "~/utils/form";-import { useRouteData } from "~/hooks";+import { usePermissions, useRouteData } from "~/hooks";import { SupplierContacts, SupplierLocations } from "./components";type SupplierFormProps = {@@ -40,7 +40,7 @@ type SupplierFormProps = {description?: string;accountManagerId?: string;supplierTypeId?: string;- supplierStatusId?: number;+ supplierStatusId?: string;taxId?: string;};contacts?: SupplierContact[];@@ -52,13 +52,14 @@ const SupplierForm = ({contacts,locations,}: SupplierFormProps) => {+ const permissions = usePermissions();const navigate = useNavigate();- const onClose = () => navigate("/app/purchasing/suppliers");+ const onClose = () => navigate("/x/purchasing/suppliers");const routeData = useRouteData<{supplierTypes: { data: SupplierType[] };supplierStatuses: { data: SupplierStatus[] };- }>("/app/purchasing/suppliers");+ }>("/x/purchasing/suppliers");const supplierTypeOptions = routeData?.supplierTypes? mapRowsToOptions({@@ -77,6 +78,9 @@ const SupplierForm = ({: [];const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");return (<Drawer onClose={onClose} isOpen size="full">@@ -84,8 +88,8 @@ const SupplierForm = ({method="post"action={isEditing- ? `/app/purchasing/suppliers/${initialValues.id}`- : "/app/purchasing/suppliers/new"+ ? `/x/purchasing/suppliers/${initialValues.id}`+ : "/x/purchasing/suppliers/new"}validator={supplierValidator}defaultValues={initialValues}@@ -151,7 +155,7 @@ const SupplierForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsxindex ce9f402ede..57d8b5c368 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContacts.tsx@@ -40,8 +40,6 @@ const SupplierContacts = ({undefined);- const canCreateAccount = permissions.can("create", "users");-const contactDrawer = useDisclosure();const deleteContactModal = useDisclosure();@@ -52,15 +50,17 @@ const SupplierContacts = ({<VStack alignItems="start" w="full" spacing={4} mb={4}><HStack w="full" justifyContent="space-between"><Heading size="md">Contacts</Heading>- <IconButton- icon={<IoMdAdd />}- aria-label="Add contact"- variant="outline"- onClick={() => {- setContact(undefined);- contactDrawer.onOpen();- }}- />+ {permissions.can("create", "purchasing") && (+ <IconButton+ icon={<IoMdAdd />}+ aria-label="Add contact"+ variant="outline"+ onClick={() => {+ setContact(undefined);+ contactDrawer.onOpen();+ }}+ />+ )}</HStack>{isEmpty && (<Text color="gray.500" fontSize="sm">@@ -77,19 +77,28 @@ const SupplierContacts = ({<Contactcontact={contact.contact}user={contact.user}- onDelete={() => {- setContact(contact);- deleteContactModal.onOpen();- }}- onEdit={() => {- setContact(contact);- contactDrawer.onOpen();- }}+ onDelete={+ permissions.can("delete", "purchasing")+ ? () => {+ setContact(contact);+ deleteContactModal.onOpen();+ }+ : undefined+ }+ onEdit={+ permissions.can("update", "purchasing")+ ? () => {+ setContact(contact);+ contactDrawer.onOpen();+ }+ : undefined+ }onCreateAccount={- canCreateAccount && contact.user === null+ permissions.can("create", "users") &&+ contact.user === null? () =>navigate(- `/app/users/suppliers/new?id=${contact.id}&supplier=${supplierId}`+ `/x/users/suppliers/new?id=${contact.id}&supplier=${supplierId}`): undefined}@@ -99,7 +108,7 @@ const SupplierContacts = ({))}</List>)}- {isEmpty && (+ {isEmpty && permissions.can("create", "purchasing") && (<ButtonleftIcon={<IoMdAdd />}colorScheme="brand"@@ -122,7 +131,7 @@ const SupplierContacts = ({)}{deleteContactModal.isOpen && (<ConfirmDelete- action={`/app/purchasing/suppliers/${supplierId}/contact/delete/${contact?.id}`}+ action={`/x/purchasing/suppliers/${supplierId}/contact/delete/${contact?.id}`}// @ts-ignorename={`${contact?.contact.firstName} ${contact?.contact.lastName}`}text="Are you sure you want to delete this contact?"diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsxindex 9cd18e24d5..5653187b77 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierContactsForm.tsx@@ -20,6 +20,7 @@ import {Submit,TextArea,} from "~/components/Form";+import { usePermissions } from "~/hooks";import type {SupplierContact,SupplierLocation,@@ -38,7 +39,12 @@ const SupplierContactForm = ({onClose,}: SupplierContactFormProps) => {const { supplierId } = useParams();+ const permissions = usePermissions();const isEditing = !!contact?.id;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");+if (Array.isArray(contact?.contact))throw new Error("contact.contact is an array");@@ -49,8 +55,8 @@ const SupplierContactForm = ({method="post"action={isEditing- ? `/app/purchasing/suppliers/${supplierId}/contact/${contact?.id}`- : `/app/purchasing/suppliers/${supplierId}/contact/new`+ ? `/x/purchasing/suppliers/${supplierId}/contact/${contact?.id}`+ : `/x/purchasing/suppliers/${supplierId}/contact/new`}defaultValues={{id: contact?.id ?? undefined,@@ -100,7 +106,7 @@ const SupplierContactForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsxindex f0c67eacbe..47b5a43340 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocationForm.tsx@@ -13,6 +13,7 @@ import {import { useParams } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import type { SupplierLocation } from "~/interfaces/Purchasing/types";import { supplierLocationValidator } from "~/services/purchasing";@@ -26,7 +27,12 @@ const SupplierLocationForm = ({onClose,}: SupplierLocationFormProps) => {const { supplierId } = useParams();+ const permissions = usePermissions();const isEditing = !!location?.id;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");+if (Array.isArray(location?.address))throw new Error("location.address is an array");@@ -37,8 +43,8 @@ const SupplierLocationForm = ({method="post"action={isEditing- ? `/app/purchasing/suppliers/${supplierId}/location/${location?.id}`- : `/app/purchasing/suppliers/${supplierId}/location/new`+ ? `/x/purchasing/suppliers/${supplierId}/location/${location?.id}`+ : `/x/purchasing/suppliers/${supplierId}/location/new`}defaultValues={{id: location?.id ?? undefined,@@ -70,7 +76,7 @@ const SupplierLocationForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsxindex b4596fa80f..6a12568928 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SupplierForm/components/SupplierLocations.tsx@@ -14,6 +14,7 @@ import { useState } from "react";import { IoMdAdd } from "react-icons/io";import { Address } from "~/components";import { ConfirmDelete } from "~/components/Modals";+import { usePermissions } from "~/hooks";import type { SupplierLocation } from "~/interfaces/Purchasing/types";import SupplierLocationForm from "./SupplierLocationForm";@@ -26,6 +27,7 @@ const SupplierLocations = ({locations = [],isEditing = false,}: SupplierLocationProps) => {+ const permissions = usePermissions();const locationDrawer = useDisclosure();const deleteContactModal = useDisclosure();@@ -42,15 +44,17 @@ const SupplierLocations = ({<VStack alignItems="start" w="full" spacing={4} mb={4}><HStack w="full" justifyContent="space-between"><Heading size="md">Locations</Heading>- <IconButton- icon={<IoMdAdd />}- aria-label="Add location"- variant="outline"- onClick={() => {- setLocation(undefined);- locationDrawer.onOpen();- }}- />+ {permissions.can("create", "purchasing") && (+ <IconButton+ icon={<IoMdAdd />}+ aria-label="Add location"+ variant="outline"+ onClick={() => {+ setLocation(undefined);+ locationDrawer.onOpen();+ }}+ />+ )}</HStack>{isEmpty && (<Text color="gray.500" fontSize="sm">@@ -64,21 +68,29 @@ const SupplierLocations = ({{location.address && !Array.isArray(location.address) ? (<Addressaddress={location.address}- onDelete={() => {- setLocation(location);- deleteContactModal.onOpen();- }}- onEdit={() => {- setLocation(location);- locationDrawer.onOpen();- }}+ onDelete={+ permissions.can("delete", "purchasing")+ ? () => {+ setLocation(location);+ deleteContactModal.onOpen();+ }+ : undefined+ }+ onEdit={+ permissions.can("update", "purchasing")+ ? () => {+ setLocation(location);+ locationDrawer.onOpen();+ }+ : undefined+ }/>) : null}</ListItem>))}</List>)}- {isEmpty && (+ {isEmpty && permissions.can("create", "purchasing") && (<ButtonleftIcon={<IoMdAdd />}colorScheme="brand"@@ -100,7 +112,7 @@ const SupplierLocations = ({)}{deleteContactModal.isOpen && (<ConfirmDelete- action={`/app/purchasing/suppliers/${supplierId}/location/delete/${location?.id}`}+ action={`/x/purchasing/suppliers/${supplierId}/location/delete/${location?.id}`}// @ts-ignorename={location?.address?.city ?? ""}text="Are you sure you want to delete this location?"diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsxindex a336561132..b838c78d98 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTable/SuppliersTable.tsx@@ -107,7 +107,7 @@ const SuppliersTable = memo(({ data, count }: SuppliersTableProps) => {data={data}withPaginationonRowClick={(row) =>- navigate(`/app/purchasing/suppliers/${row.id}?${params.toString()}`)+ navigate(`/x/purchasing/suppliers/${row.id}?${params.toString()}`)}/></>diff --git a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx b/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsxindex de11167292..4c6167e33b 100644--- a/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx+++ b/apps/carbon/app/interfaces/Purchasing/Suppliers/SuppliersTableFilters/SuppliersTableFilters.tsx@@ -88,7 +88,7 @@ const SuppliersTableFilters = ({)}</HStack><HStack spacing={2}>- {permissions.can("create", "users") && (+ {permissions.can("create", "purchasing") && (<Buttonas={Link}to={`new?${params.toString()}`}diff --git a/apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsx b/apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsxindex 1510254900..1a0bef6aff 100644--- a/apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsx+++ b/apps/carbon/app/interfaces/Purchasing/usePurchasingSidebar.tsx@@ -1,20 +1,52 @@-import type { Route } from "~/types";+import { usePermissions } from "~/hooks";+import type { AuthenticatedRouteGroup } from "~/types";-const purchasingRoutes: Record<string, Route[]>[] = [+const purchasingRoutes: AuthenticatedRouteGroup[] = [{- Configuration: [+ name: "Manage",+ routes: [{name: "Suppliers",- to: "/app/purchasing/suppliers",+ to: "/x/purchasing/suppliers",},+ ],+ },+ {+ name: "Configuration",+ routes: [{name: "Supplier Types",- to: "/app/purchasing/supplier-types",+ to: "/x/purchasing/supplier-types",+ role: "employee",},],},];-export default function useSalesSidebar() {- return { links: purchasingRoutes };+export default function usePurchasingSidebar() {+ const permissions = usePermissions();+ return {+ groups: purchasingRoutes+ .filter((group) => {+ const filteredRoutes = group.routes.filter((route) => {+ if (route.role) {+ return permissions.is(route.role);+ } else {+ return true;+ }+ });++ return filteredRoutes.length > 0;+ })+ .map((group) => ({+ ...group,+ routes: group.routes.filter((route) => {+ if (route.role) {+ return permissions.is(route.role);+ } else {+ return true;+ }+ }),+ })),+ };}diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsxindex 61cbeeb744..3ead099f05 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx+++ b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypeForm/CustomerTypeForm.tsx@@ -13,6 +13,7 @@ import {import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import { customerTypeValidator } from "~/services/sales";type CustomerTypeFormProps = {@@ -24,10 +25,14 @@ type CustomerTypeFormProps = {};const CustomerTypeForm = ({ initialValues }: CustomerTypeFormProps) => {+ const permissions = usePermissions();const navigate = useNavigate();const onClose = () => navigate(-1);const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");return (<Drawer onClose={onClose} isOpen={true} size="sm">@@ -36,8 +41,8 @@ const CustomerTypeForm = ({ initialValues }: CustomerTypeFormProps) => {method="post"action={isEditing- ? `/app/sales/customer-types/${initialValues.id}`- : "/app/sales/customer-types/new"+ ? `/x/sales/customer-types/${initialValues.id}`+ : "/x/sales/customer-types/new"}defaultValues={initialValues}>@@ -56,7 +61,7 @@ const CustomerTypeForm = ({ initialValues }: CustomerTypeFormProps) => {</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsxindex e13535618b..7230f661ef 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx+++ b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTable/CustomerTypesTable.tsx@@ -49,7 +49,7 @@ const CustomerTypesTable = memo(({ data, count }: CustomerTypesTableProps) => {<MenuItemicon={<BsPeopleFill />}onClick={() => {- navigate(`/app/sales/customers?type=${row.original.id}`);+ navigate(`/x/sales/customers?type=${row.original.id}`);}}>View Customers@@ -61,7 +61,7 @@ const CustomerTypesTable = memo(({ data, count }: CustomerTypesTableProps) => {icon={<BsPencilSquare />}onClick={() => {navigate(- `/app/sales/customer-types/${+ `/x/sales/customer-types/${row.original.id}?${params.toString()}`);@@ -76,7 +76,7 @@ const CustomerTypesTable = memo(({ data, count }: CustomerTypesTableProps) => {icon={<IoMdTrash />}onClick={() => {navigate(- `/app/sales/customer-types/delete/${+ `/x/sales/customer-types/delete/${row.original.id}?${params.toString()}`);diff --git a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsxindex 4017e48867..b1b46721bf 100644--- a/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx+++ b/apps/carbon/app/interfaces/Sales/CustomerTypes/CustomerTypesTableFilters/CustomerTypesTableFilters.tsx@@ -28,7 +28,7 @@ const CustomerTypesTableFilters = () => {/></HStack><HStack spacing={2}>- {permissions.can("create", "users") && (+ {permissions.can("create", "sales") && (<Buttonas={Link}to={`new?${params.toString()}`}diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsxindex ef85e21b74..1a26cb7d80 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/CustomerForm.tsx@@ -30,7 +30,7 @@ import type {CustomerType,} from "~/interfaces/Sales/types";import { mapRowsToOptions } from "~/utils/form";-import { useRouteData } from "~/hooks";+import { usePermissions, useRouteData } from "~/hooks";import { CustomerContacts, CustomerLocations } from "./components";type CustomerFormProps = {@@ -40,7 +40,7 @@ type CustomerFormProps = {description?: string;accountManagerId?: string;customerTypeId?: string;- customerStatusId?: number;+ customerStatusId?: string;taxId?: string;};contacts?: CustomerContact[];@@ -52,13 +52,14 @@ const CustomerForm = ({contacts,locations,}: CustomerFormProps) => {+ const permissions = usePermissions();const navigate = useNavigate();- const onClose = () => navigate("/app/sales/customers");+ const onClose = () => navigate("/x/sales/customers");const routeData = useRouteData<{customerTypes: { data: CustomerType[] };customerStatuses: { data: CustomerStatus[] };- }>("/app/sales/customers");+ }>("/x/sales/customers");const customerTypeOptions = routeData?.customerTypes? mapRowsToOptions({@@ -77,6 +78,9 @@ const CustomerForm = ({: [];const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");return (<Drawer onClose={onClose} isOpen size="full">@@ -84,8 +88,8 @@ const CustomerForm = ({method="post"action={isEditing- ? `/app/sales/customers/${initialValues.id}`- : "/app/sales/customers/new"+ ? `/x/sales/customers/${initialValues.id}`+ : "/x/sales/customers/new"}validator={customerValidator}defaultValues={initialValues}@@ -151,7 +155,7 @@ const CustomerForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsxindex 1ab5fbc053..472b96b97b 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContacts.tsx@@ -36,8 +36,6 @@ const CustomerContacts = ({const navigate = useNavigate();const permissions = usePermissions();- const canCreateAccount = permissions.can("create", "users");-const [contact, setContact] = useState<CustomerContact | undefined>(undefined);@@ -52,15 +50,17 @@ const CustomerContacts = ({<VStack alignItems="start" w="full" spacing={4} mb={4}><HStack w="full" justifyContent="space-between"><Heading size="md">Contacts</Heading>- <IconButton- icon={<IoMdAdd />}- aria-label="Add contact"- variant="outline"- onClick={() => {- setContact(undefined);- contactDrawer.onOpen();- }}- />+ {permissions.can("create", "sales") && (+ <IconButton+ icon={<IoMdAdd />}+ aria-label="Add contact"+ variant="outline"+ onClick={() => {+ setContact(undefined);+ contactDrawer.onOpen();+ }}+ />+ )}</HStack>{isEmpty && (<Text color="gray.500" fontSize="sm">@@ -77,19 +77,28 @@ const CustomerContacts = ({<Contactcontact={contact.contact}user={contact.user}- onDelete={() => {- setContact(contact);- deleteContactModal.onOpen();- }}- onEdit={() => {- setContact(contact);- contactDrawer.onOpen();- }}+ onDelete={+ permissions.can("delete", "sales")+ ? () => {+ setContact(contact);+ deleteContactModal.onOpen();+ }+ : undefined+ }+ onEdit={+ permissions.can("update", "sales")+ ? () => {+ setContact(contact);+ contactDrawer.onOpen();+ }+ : undefined+ }onCreateAccount={- canCreateAccount && contact.user === null+ permissions.can("create", "users") &&+ contact.user === null? () =>navigate(- `/app/users/customers/new?id=${contact.id}&customer=${customerId}`+ `/x/users/customers/new?id=${contact.id}&customer=${customerId}`): undefined}@@ -99,7 +108,7 @@ const CustomerContacts = ({))}</List>)}- {isEmpty && (+ {isEmpty && permissions.can("create", "sales") && (<ButtonleftIcon={<IoMdAdd />}colorScheme="brand"@@ -122,7 +131,7 @@ const CustomerContacts = ({)}{deleteContactModal.isOpen && (<ConfirmDelete- action={`/app/sales/customers/${customerId}/contact/delete/${contact?.id}`}+ action={`/x/sales/customers/${customerId}/contact/delete/${contact?.id}`}// @ts-ignorename={`${contact?.contact.firstName} ${contact?.contact.lastName}`}text="Are you sure you want to delete this contact?"diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsxindex 09afc29f28..d64b145cd2 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerContactsForm.tsx@@ -20,6 +20,7 @@ import {Submit,TextArea,} from "~/components/Form";+import { usePermissions } from "~/hooks";import type {CustomerContact,CustomerLocation,@@ -34,11 +35,15 @@ type CustomerContactFormProps = {const CustomerContactForm = ({contact,- locations = [],onClose,}: CustomerContactFormProps) => {const { customerId } = useParams();+ const permissions = usePermissions();const isEditing = !!contact?.id;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");+if (Array.isArray(contact?.contact))throw new Error("contact.contact is an array");@@ -49,8 +54,8 @@ const CustomerContactForm = ({method="post"action={isEditing- ? `/app/sales/customers/${customerId}/contact/${contact?.id}`- : `/app/sales/customers/${customerId}/contact/new`+ ? `/x/sales/customers/${customerId}/contact/${contact?.id}`+ : `/x/sales/customers/${customerId}/contact/new`}defaultValues={{id: contact?.id ?? undefined,@@ -100,7 +105,7 @@ const CustomerContactForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsxindex 2a168a30a0..a61dbf4a8e 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocationForm.tsx@@ -13,6 +13,7 @@ import {import { useParams } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import type { CustomerLocation } from "~/interfaces/Sales/types";import { customerLocationValidator } from "~/services/sales";@@ -26,7 +27,12 @@ const CustomerLocationForm = ({onClose,}: CustomerLocationFormProps) => {const { customerId } = useParams();+ const permissions = usePermissions();const isEditing = !!location?.id;+ const isDisabled = isEditing+ ? !permissions.can("update", "sales")+ : !permissions.can("create", "sales");+if (Array.isArray(location?.address))throw new Error("location.address is an array");@@ -37,8 +43,8 @@ const CustomerLocationForm = ({method="post"action={isEditing- ? `/app/sales/customers/${customerId}/location/${location?.id}`- : `/app/sales/customers/${customerId}/location/new`+ ? `/x/sales/customers/${customerId}/location/${location?.id}`+ : `/x/sales/customers/${customerId}/location/new`}defaultValues={{id: location?.id ?? undefined,@@ -70,7 +76,7 @@ const CustomerLocationForm = ({</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsxindex a63375a499..96fa4cc82c 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomerForm/components/CustomerLocations.tsx@@ -14,6 +14,7 @@ import { useState } from "react";import { IoMdAdd } from "react-icons/io";import { Address } from "~/components";import { ConfirmDelete } from "~/components/Modals";+import { usePermissions } from "~/hooks";import type { CustomerLocation } from "~/interfaces/Sales/types";import CustomerLocationForm from "./CustomerLocationForm";@@ -26,6 +27,7 @@ const CustomerLocations = ({locations = [],isEditing = false,}: CustomerLocationProps) => {+ const permissions = usePermissions();const locationDrawer = useDisclosure();const deleteContactModal = useDisclosure();@@ -42,15 +44,17 @@ const CustomerLocations = ({<VStack alignItems="start" w="full" spacing={4} mb={4}><HStack w="full" justifyContent="space-between"><Heading size="md">Locations</Heading>- <IconButton- icon={<IoMdAdd />}- aria-label="Add location"- variant="outline"- onClick={() => {- setLocation(undefined);- locationDrawer.onOpen();- }}- />+ {permissions.can("create", "sales") && (+ <IconButton+ icon={<IoMdAdd />}+ aria-label="Add location"+ variant="outline"+ onClick={() => {+ setLocation(undefined);+ locationDrawer.onOpen();+ }}+ />+ )}</HStack>{isEmpty && (<Text color="gray.500" fontSize="sm">@@ -64,21 +68,29 @@ const CustomerLocations = ({{location.address && !Array.isArray(location.address) ? (<Addressaddress={location.address}- onDelete={() => {- setLocation(location);- deleteContactModal.onOpen();- }}- onEdit={() => {- setLocation(location);- locationDrawer.onOpen();- }}+ onDelete={+ permissions.can("delete", "sales")+ ? () => {+ setLocation(location);+ deleteContactModal.onOpen();+ }+ : undefined+ }+ onEdit={+ permissions.can("update", "sales")+ ? () => {+ setLocation(location);+ locationDrawer.onOpen();+ }+ : undefined+ }/>) : null}</ListItem>))}</List>)}- {isEmpty && (+ {isEmpty && permissions.can("create", "sales") && (<ButtonleftIcon={<IoMdAdd />}colorScheme="brand"@@ -100,7 +112,7 @@ const CustomerLocations = ({)}{deleteContactModal.isOpen && (<ConfirmDelete- action={`/app/sales/customers/${customerId}/location/delete/${location?.id}`}+ action={`/x/sales/customers/${customerId}/location/delete/${location?.id}`}// @ts-ignorename={location?.address?.city ?? ""}text="Are you sure you want to delete this location?"diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsxindex e536a3453f..479291fa0b 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomersTable/CustomersTable.tsx@@ -87,7 +87,7 @@ const CustomersTable = memo(({ data, count }: CustomersTableProps) => {accessorKey: "id",cell: (item) => (<Flex justifyContent="end">- {permissions.can("update", "users") && (+ {permissions.can("update", "sales") && (<ActionMenu><MenuItem icon={<BsPencilSquare />}>Edit Customer</MenuItem></ActionMenu>@@ -107,7 +107,7 @@ const CustomersTable = memo(({ data, count }: CustomersTableProps) => {data={data}withPaginationonRowClick={(row) =>- navigate(`/app/sales/customers/${row.id}?${params.toString()}`)+ navigate(`/x/sales/customers/${row.id}?${params.toString()}`)}/></>diff --git a/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsx b/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsxindex c12f6591b1..251eff5343 100644--- a/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsx+++ b/apps/carbon/app/interfaces/Sales/Customers/CustomersTableFilters/CustomersTableFilters.tsx@@ -85,7 +85,7 @@ const CustomersTableFilters = ({)}</HStack><HStack spacing={2}>- {permissions.can("create", "users") && (+ {permissions.can("create", "sales") && (<Buttonas={Link}to={`new?${params.toString()}`}diff --git a/apps/carbon/app/interfaces/Sales/useSalesSidebar.tsx b/apps/carbon/app/interfaces/Sales/useSalesSidebar.tsxindex 77e482952b..bf4a59cf26 100644--- a/apps/carbon/app/interfaces/Sales/useSalesSidebar.tsx+++ b/apps/carbon/app/interfaces/Sales/useSalesSidebar.tsx@@ -1,20 +1,52 @@-import type { Route } from "~/types";+import { usePermissions } from "~/hooks";+import type { AuthenticatedRouteGroup } from "~/types";-const salesRoutes: Record<string, Route[]>[] = [+const salesRoutes: AuthenticatedRouteGroup[] = [{- Configuration: [+ name: "Manage",+ routes: [{name: "Customers",- to: "/app/sales/customers",+ to: "/x/sales/customers",},+ ],+ },+ {+ name: "Configuration",+ routes: [{name: "Customer Types",- to: "/app/sales/customer-types",+ to: "/x/sales/customer-types",+ role: "employee",},],},];export default function useSalesSidebar() {- return { links: salesRoutes };+ const permissions = usePermissions();+ return {+ groups: salesRoutes+ .filter((group) => {+ const filteredRoutes = group.routes.filter((route) => {+ if (route.role) {+ return permissions.is(route.role);+ } else {+ return true;+ }+ });++ return filteredRoutes.length > 0;+ })+ .map((group) => ({+ ...group,+ routes: group.routes.filter((route) => {+ if (route.role) {+ return permissions.is(route.role);+ } else {+ return true;+ }+ }),+ })),+ };}diff --git a/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsx b/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsxindex 4e56c5414b..0bb26bda19 100644--- a/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsx+++ b/apps/carbon/app/interfaces/Users/Customers/CreateCustomerModal/CreateCustomerModal.tsx@@ -17,7 +17,7 @@ import { useRef, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Customer, Submit, CustomerContact } from "~/components/Form";import { useUrlParams } from "~/hooks";-import { createCustomerValidator } from "~/services/users";+import { createCustomerAccountValidator } from "~/services/users";import type { Result } from "~/types";const CreateCustomerModal = () => {@@ -50,8 +50,8 @@ const CreateCustomerModal = () => {<ModalBody pb={6}><ValidatedFormmethod="post"- action="/app/users/customers/new"- validator={createCustomerValidator}+ action="/x/users/customers/new"+ validator={createCustomerAccountValidator}defaultValues={{id: params.get("id") ?? "",customer: params.get("customer") ?? "",diff --git a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx b/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsxindex bef52d3efa..48076b6b0d 100644--- a/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx+++ b/apps/carbon/app/interfaces/Users/Customers/CustomerAccountsTable/CustomerAccountsTable.tsx@@ -9,7 +9,7 @@ import {import { useNavigate } from "@remix-run/react";import type { ColumnDef } from "@tanstack/react-table";import { memo, useMemo, useState } from "react";-import { BsEnvelope, BsPencilSquare } from "react-icons/bs";+import { BsEnvelope } from "react-icons/bs";import { IoMdTrash } from "react-icons/io";import { Avatar, Table } from "~/components";import { usePermissions, useUrlParams } from "~/hooks";@@ -116,18 +116,6 @@ const CustomerAccountsTable = memo(<Flex justifyContent="end">{permissions.can("update", "users") && (<ActionMenu>- <MenuItem- icon={<BsPencilSquare />}- onClick={() =>- navigate(- `/app/users/customers/${- item.getValue() as string- }?${params.toString()}`- )- }- >- Edit Customer- </MenuItem><MenuItemicon={<BsEnvelope />}onClick={() => {@@ -224,7 +212,7 @@ const CustomerAccountsTable = memo(<DeactivateUsersModaluserIds={selectedUserIds}isOpen={deactivateCustomerModal.isOpen}- redirectTo="/app/users/suppliers"+ redirectTo="/x/users/suppliers"onClose={deactivateCustomerModal.onClose}/>)}diff --git a/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsx b/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsxindex 0c50b7f133..fa8c58f5af 100644--- a/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsx+++ b/apps/carbon/app/interfaces/Users/DeactivateUsersModal/DeactivateUsersModal.tsx@@ -24,7 +24,7 @@ type DeactivateUsersModalProps = {const DeactivateUsersModal = ({userIds,isOpen,- redirectTo = "/app/users/employees",+ redirectTo = "/x/users/employees",onClose,}: DeactivateUsersModalProps) => {const isSingleUser = userIds.length === 1;@@ -51,7 +51,7 @@ const DeactivateUsersModal = ({</Button><ValidatedFormmethod="post"- action="/app/users/deactivate"+ action="/x/users/deactivate"validator={deactivateUsersValidator}onSubmit={onClose}>diff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx b/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsxindex f016ca6e41..933fbd87d3 100644--- a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx+++ b/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypeForm/EmployeeTypeForm.tsx@@ -16,6 +16,7 @@ import { useNavigate } from "@remix-run/react";import { useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Color, Hidden, Input, Submit } from "~/components/Form";+import { usePermissions } from "~/hooks";import PermissionCheckboxes from "~/interfaces/Users/components/Permission";import type { Permission } from "~/interfaces/Users/types";import { employeeTypeValidator } from "~/services/users";@@ -36,6 +37,7 @@ type EmployeeTypeFormProps = {};const EmployeeTypeForm = ({ initialValues }: EmployeeTypeFormProps) => {+ const userPermissions = usePermissions();const navigate = useNavigate();const onClose = () => navigate(-1);@@ -51,6 +53,9 @@ const EmployeeTypeForm = ({ initialValues }: EmployeeTypeFormProps) => {};const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !userPermissions.can("update", "users")+ : !userPermissions.can("create", "users");return (<Drawer onClose={onClose} isOpen={true} size="sm">@@ -59,8 +64,8 @@ const EmployeeTypeForm = ({ initialValues }: EmployeeTypeFormProps) => {method="post"action={isEditing- ? `/app/users/employee-types/${initialValues.id}`- : "/app/users/employee-types/new"+ ? `/x/users/employee-types/${initialValues.id}`+ : "/x/users/employee-types/new"}defaultValues={initialValues}>@@ -97,7 +102,7 @@ const EmployeeTypeForm = ({ initialValues }: EmployeeTypeFormProps) => {</DrawerBody><DrawerFooter><HStack spacing={2}>- <Submit>Save</Submit>+ <Submit disabled={isDisabled}>Save</Submit><Buttonsize="md"colorScheme="gray"diff --git a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx b/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsxindex 52a1a63bb7..8ab3461fcf 100644--- a/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx+++ b/apps/carbon/app/interfaces/Users/EmployeeTypes/EmployeeTypesTable/EmployeeTypesTable.tsx@@ -49,7 +49,7 @@ const EmployeeTypesTable = memo(({ data, count }: EmployeeTypesTableProps) => {<MenuItemicon={<BsPeopleFill />}onClick={() => {- navigate(`/app/users/employees?type=${row.original.id}`);+ navigate(`/x/users/employees?type=${row.original.id}`);}}>View Employees@@ -61,7 +61,7 @@ const EmployeeTypesTable = memo(({ data, count }: EmployeeTypesTableProps) => {icon={<BsPencilSquare />}onClick={() => {navigate(- `/app/users/employee-types/${+ `/x/users/employee-types/${row.original.id}?${params.toString()}`);@@ -76,7 +76,7 @@ const EmployeeTypesTable = memo(({ data, count }: EmployeeTypesTableProps) => {icon={<IoMdTrash />}onClick={() => {navigate(- `/app/users/employee-types/delete/${+ `/x/users/employee-types/delete/${row.original.id}?${params.toString()}`);diff --git a/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx b/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsxindex 83b108b96c..7db2d5a4ea 100644--- a/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx+++ b/apps/carbon/app/interfaces/Users/Employees/BulkEditPermissionsForm/BulkEditPermissionsForm.tsx@@ -80,7 +80,7 @@ const BulkEditPermissions = ({<ValidatedFormvalidator={bulkPermissionsValidator}method="post"- action="/app/users/bulk-edit-permissions"+ action="/x/users/bulk-edit-permissions"onSubmit={onClose}defaultValues={{ userIds }}>diff --git a/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx b/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsxindex 29b4858fc2..a8f610018c 100644--- a/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx+++ b/apps/carbon/app/interfaces/Users/Employees/CreateEmployeeModal/CreateEmployeeModal.tsx@@ -50,7 +50,7 @@ const CreateEmployeeModal = () => {<ModalBody pb={6}><ValidatedFormmethod="post"- action="/app/users/employees/new"+ action="/x/users/employees/new"validator={createEmployeeValidator}// @ts-ignorefetcher={formFetcher}diff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx b/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsxindex 3b2ecf3c2a..839c7a08ce 100644--- a/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx+++ b/apps/carbon/app/interfaces/Users/Employees/EmployeePermissionsForm/EmployeePermissionsForm.tsx@@ -65,7 +65,7 @@ const EmployeePermissionsForm = ({<ValidatedFormvalidator={employeeValidator}method="post"- action={`/app/users/employees/${initialValues.id}`}+ action={`/x/users/employees/${initialValues.id}`}defaultValues={initialValues}><DrawerOverlay />diff --git a/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsx b/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsxindex f4574ade33..5070c830f8 100644--- a/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsx+++ b/apps/carbon/app/interfaces/Users/Employees/EmployeesTable/EmployeesTable.tsx@@ -114,7 +114,7 @@ const EmployeesTable = memo(icon={<BsPencilSquare />}onClick={() =>navigate(- `/app/users/employees/${+ `/x/users/employees/${item.getValue() as string}?${params.toString()}`)diff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsx b/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsxindex 75feca47ce..b40745d8ab 100644--- a/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsx+++ b/apps/carbon/app/interfaces/Users/Groups/GroupsForm/GroupsForm.tsx@@ -13,6 +13,7 @@ import {import { useNavigate } from "@remix-run/react";import { ValidatedForm } from "remix-validated-form";import { Hidden, Input, Submit, Users } from "~/components/Form";+import { usePermissions } from "~/hooks";import { groupValidator } from "~/services/users";type GroupFormProps = {@@ -24,10 +25,14 @@ type GroupFormProps = {};const GroupForm = ({ initialValues }: GroupFormProps) => {+ const permissions = usePermissions();const navigate = useNavigate();const onClose = () => navigate(-1);const isEditing = initialValues.id !== undefined;+ const isDisabled = isEditing+ ? !permissions.can("update", "purchasing")+ : !permissions.can("create", "purchasing");return (<Drawer onClose={onClose} isOpen={true} size="sm">@@ -36,8 +41,8 @@ const GroupForm = ({ initialValues }: GroupFormProps) => {method="post"action={isEditing- ? `/app/users/groups/${initialValues.id}`- : "/app/users/groups/new"+ ? `/x/users/groups/${initialValues.id}`+ : "/x/users/groups/new"}defaultValues={initialValues}>diff --git a/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsx b/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsxindex 77735c8b72..70794d7fa0 100644--- a/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsx+++ b/apps/carbon/app/interfaces/Users/Groups/GroupsTable/GroupsTable.tsx@@ -78,7 +78,7 @@ const GroupsTable = memo(({ data, count }: GroupsTableProps) => {}icon={<BsPencilSquare />}onClick={() => {- navigate(`/app/users/groups/${row.original.id}`);+ navigate(`/x/users/groups/${row.original.id}`);}}>Edit Group@@ -92,7 +92,7 @@ const GroupsTable = memo(({ data, count }: GroupsTableProps) => {}icon={<IoMdTrash />}onClick={() => {- navigate(`/app/users/groups/delete/${row.original.id}`);+ navigate(`/x/users/groups/delete/${row.original.id}`);}}>Delete Groupdiff --git a/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsx b/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsxindex 0b0d5d4bc9..bb167ac000 100644--- a/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsx+++ b/apps/carbon/app/interfaces/Users/ResendInviteModal/ResendInviteModal.tsx@@ -51,7 +51,7 @@ const ResendInviteModal = ({</Button><ValidatedFormmethod="post"- action="/app/users/resend-invite"+ action="/x/users/resend-invite"validator={resendInviteValidator}onSubmit={onClose}fetcher={fetcher}diff --git a/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx b/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsxindex dc94af69a0..5ddde7298e 100644--- a/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx+++ b/apps/carbon/app/interfaces/Users/Suppliers/CreateSupplierModal/CreateSupplierModal.tsx@@ -17,7 +17,7 @@ import { useRef, useState } from "react";import { ValidatedForm } from "remix-validated-form";import { Supplier, Submit, SupplierContact } from "~/components/Form";import { useUrlParams } from "~/hooks";-import { createSupplierValidator } from "~/services/users";+import { createSupplierAccountValidator } from "~/services/users";import type { Result } from "~/types";const CreateSupplierModal = () => {@@ -50,8 +50,8 @@ const CreateSupplierModal = () => {<ModalBody pb={6}><ValidatedFormmethod="post"- action="/app/users/suppliers/new"- validator={createSupplierValidator}+ action="/x/users/suppliers/new"+ validator={createSupplierAccountValidator}defaultValues={{id: params.get("id") ?? "",supplier: params.get("supplier") ?? "",diff --git a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx b/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsxindex ad1a306820..f31d41b45d 100644--- a/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx+++ b/apps/carbon/app/interfaces/Users/Suppliers/SupplierAccountsTable/SuppliersAccountsTable.tsx@@ -116,18 +116,6 @@ const SupplierAccountsTable = memo(<Flex justifyContent="end">{permissions.can("update", "users") && (<ActionMenu>- <MenuItem- icon={<BsPencilSquare />}- onClick={() =>- navigate(- `/app/users/suppliers/${- item.getValue() as string- }?${params.toString()}`- )- }- >- Edit Supplier- </MenuItem><MenuItemicon={<BsEnvelope />}onClick={() => {@@ -224,7 +212,7 @@ const SupplierAccountsTable = memo(<DeactivateUsersModaluserIds={selectedUserIds}isOpen={deactivateSupplierModal.isOpen}- redirectTo="/app/users/suppliers"+ redirectTo="/x/users/suppliers"onClose={deactivateSupplierModal.onClose}/>)}diff --git a/apps/carbon/app/interfaces/Users/useUsersSidebar.tsx b/apps/carbon/app/interfaces/Users/useUsersSidebar.tsxindex fd20993b6f..11ac404070 100644--- a/apps/carbon/app/interfaces/Users/useUsersSidebar.tsx+++ b/apps/carbon/app/interfaces/Users/useUsersSidebar.tsx@@ -1,36 +1,38 @@-import type { Route } from "~/types";+import type { Route, RouteGroup } from "~/types";-const usersRoutes: Record<string, Route[]>[] = [+const usersRoutes: RouteGroup[] = [{- Manage: [+ name: "Manage",+ routes: [{name: "Employees",- to: "/app/users/employees",+ to: "/x/users/employees",},{name: "Customers",- to: "/app/users/customers",+ to: "/x/users/customers",},{name: "Suppliers",- to: "/app/users/suppliers",+ to: "/x/users/suppliers",},{name: "Groups",- to: "/app/users/groups",+ to: "/x/users/groups",},],},{- Configuration: [+ name: "Configuration",+ routes: [{name: "Employee Types",- to: "/app/users/employee-types",+ to: "/x/users/employee-types",},],},];export default function useUsersSidebar() {- return { links: usersRoutes };+ return { groups: usersRoutes };}diff --git a/apps/carbon/app/lib/supabase/client.ts b/apps/carbon/app/lib/supabase/client.tsindex f9bffff74d..9f73f7d1e8 100644--- a/apps/carbon/app/lib/supabase/client.ts+++ b/apps/carbon/app/lib/supabase/client.ts@@ -38,13 +38,13 @@ export const getSupabase = (accessToken?: string) => {/*** Provides a Supabase Admin Client with full admin privileges*- * It's a per request scoped client, to prevent access token leaking if you don't use it like `getSupabaseAdmin().auth.api`.+ * It's a per request scoped client, to prevent access token leaking`.**/-export const getSupabaseAdmin = () => {+export const getSupabaseServiceRole = () => {if (isBrowser)throw new Error(- "getSupabaseAdmin is not available in browser and should NOT be used in insecure environments"+ "getSupabaseServiceRole is not available in browser and should NOT be used in insecure environments");return getSupabaseClient(SUPABASE_SERVICE_ROLE);diff --git a/apps/carbon/app/lib/supabase/index.ts b/apps/carbon/app/lib/supabase/index.tsindex 10569aef36..26a0fa6c27 100644--- a/apps/carbon/app/lib/supabase/index.ts+++ b/apps/carbon/app/lib/supabase/index.ts@@ -1,4 +1,4 @@-import { getSupabase, getSupabaseAdmin } from "./client";+import { getSupabase, getSupabaseServiceRole } from "./client";import { SupabaseProvider, useSupabase } from "./provider";-export { SupabaseProvider, getSupabase, getSupabaseAdmin, useSupabase };+export { SupabaseProvider, getSupabase, getSupabaseServiceRole, useSupabase };diff --git a/apps/carbon/app/queues/bulk-permissions.queue.server.ts b/apps/carbon/app/queues/bulk-permissions.queue.server.tsindex 85bcf61c66..1e7ceae9a0 100644--- a/apps/carbon/app/queues/bulk-permissions.queue.server.ts+++ b/apps/carbon/app/queues/bulk-permissions.queue.server.ts@@ -1,5 +1,5 @@import { Queue } from "~/lib/bullmq";-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";import type { Permission } from "~/interfaces/Users/types";import { updatePermissions } from "~/services/users";@@ -9,7 +9,7 @@ export type BulkPermissionsQueueData = {addOnly: boolean;};-const client = getSupabaseAdmin();+const client = getSupabaseServiceRole();export const bulkPermissionsQueue = Queue<BulkPermissionsQueueData>("editBulkPermissions:v1",diff --git a/apps/carbon/app/queues/deactivate-users.queue.server.ts b/apps/carbon/app/queues/deactivate-users.queue.server.tsindex 9b711e4e9e..96704ea79e 100644--- a/apps/carbon/app/queues/deactivate-users.queue.server.ts+++ b/apps/carbon/app/queues/deactivate-users.queue.server.ts@@ -1,12 +1,12 @@import { Queue } from "~/lib/bullmq";-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";import { deactivateUser } from "~/services/users";export type DeactivateUserQueueData = {id: string;};-const client = getSupabaseAdmin();+const client = getSupabaseServiceRole();export const deactivateUsersQueue = Queue<DeactivateUserQueueData>("deactivateUsers:v1",diff --git a/apps/carbon/app/queues/resend-invites.queue.server.ts b/apps/carbon/app/queues/resend-invites.queue.server.tsindex 30a98f4ea4..ed8af6880f 100644--- a/apps/carbon/app/queues/resend-invites.queue.server.ts+++ b/apps/carbon/app/queues/resend-invites.queue.server.ts@@ -1,12 +1,12 @@import { Queue } from "~/lib/bullmq";-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";import { resendInvite } from "~/services/users";export type ResendInvitesQueueData = {id: string;};-const client = getSupabaseAdmin();+const client = getSupabaseServiceRole();export const resendInvitesQueue = Queue<ResendInvitesQueueData>("resendInvites:v1",diff --git a/apps/carbon/app/routes/_public+/callback.tsx b/apps/carbon/app/routes/_public+/callback.tsxindex 574fbe4f70..466406f3e4 100644--- a/apps/carbon/app/routes/_public+/callback.tsx+++ b/apps/carbon/app/routes/_public+/callback.tsx@@ -20,7 +20,7 @@ import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {const authSession = await getAuthSession(request);- if (authSession) await destroyAuthSession(request, false);+ if (authSession) await destroyAuthSession(request);return json({});}diff --git a/apps/carbon/app/routes/_public+/forgot-password.tsx b/apps/carbon/app/routes/_public+/forgot-password.tsxindex a6871f1f1a..4744b7e6dc 100644--- a/apps/carbon/app/routes/_public+/forgot-password.tsx+++ b/apps/carbon/app/routes/_public+/forgot-password.tsx@@ -29,7 +29,7 @@ export const meta: MetaFunction = () => ({export async function loader({ request }: LoaderArgs) {const authSession = await getAuthSession(request);- if (authSession) return redirect("/app");+ if (authSession) return redirect("/x");return null;}@@ -68,54 +68,55 @@ export default function ForgotPasswordRoute() {const boxBackground = useColor("white");return (- <Box minW="100vw" minH="100vh" bg={useColor("gray.50")}>- <VStack spacing={8} mx="auto" maxW="lg" pt={24} px={6}>- <Image- src={useColorModeValue("/logo-dark.png", "/logo-light.png")}- alt="Carbon Logo"- maxW={100}- marginBottom={3}- />- {actionData?.success ? (- <Alert- status="success"- variant="subtle"- flexDirection="column"- alignItems="center"- justifyContent="center"- textAlign="center"- height="240px"- p={8}- >- <AlertIcon boxSize="40px" mr={0} />- <AlertTitle mt={4} mb={1} fontSize="lg">- Success- </AlertTitle>- <AlertDescription maxWidth="sm">- If you have an account, you should receive an email shortly with a- link to log in.- </AlertDescription>- </Alert>- ) : (- <Box rounded="lg" bg={boxBackground} boxShadow="lg" w={380} p={8}>- <ValidatedForm validator={forgotPasswordValidator} method="post">- <VStack spacing={4} alignItems="start">- <Text>- Please enter your email address to search for your account.- </Text>- {actionData?.success === false && (- <Alert status="error">- <AlertIcon />- <AlertTitle>{actionData?.message}</AlertTitle>- </Alert>- )}- <Input name="email" label="Email" />- <Submit w="full">Search</Submit>- </VStack>- </ValidatedForm>- </Box>+ <>+ <Image+ src={useColorModeValue(+ "/carbon-logo-dark.png",+ "/carbon-logo-light.png")}- </VStack>- </Box>+ alt="Carbon Logo"+ maxW={100}+ marginBottom={3}+ />+ {actionData?.success ? (+ <Alert+ status="success"+ variant="subtle"+ flexDirection="column"+ alignItems="center"+ justifyContent="center"+ textAlign="center"+ height="240px"+ p={8}+ >+ <AlertIcon boxSize="40px" mr={0} />+ <AlertTitle mt={4} mb={1} fontSize="lg">+ Success+ </AlertTitle>+ <AlertDescription maxWidth="sm">+ If you have an account, you should receive an email shortly with a+ link to log in.+ </AlertDescription>+ </Alert>+ ) : (+ <Box rounded="lg" bg={boxBackground} boxShadow="lg" w={380} p={8}>+ <ValidatedForm validator={forgotPasswordValidator} method="post">+ <VStack spacing={4} alignItems="start">+ <Text>+ Please enter your email address to search for your account.+ </Text>+ {actionData?.success === false && (+ <Alert status="error">+ <AlertIcon />+ <AlertTitle>{actionData?.message}</AlertTitle>+ </Alert>+ )}+ <Input name="email" label="Email" />+ <Submit w="full">Search</Submit>+ </VStack>+ </ValidatedForm>+ </Box>+ )}+ </>);}diff --git a/apps/carbon/app/routes/_public+/healthcheck.tsx b/apps/carbon/app/routes/_public+/healthcheck.tsxindex bdc10c02b2..5bc46729d8 100644--- a/apps/carbon/app/routes/_public+/healthcheck.tsx+++ b/apps/carbon/app/routes/_public+/healthcheck.tsx@@ -1,8 +1,8 @@-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";export async function loader() {try {- const test = await getSupabaseAdmin()+ const test = await getSupabaseServiceRole().from("users").select("id", { head: true }).single();diff --git a/apps/carbon/app/routes/_public+/login.tsx b/apps/carbon/app/routes/_public+/login.tsxindex 8500dc3256..0da15d5da1 100644--- a/apps/carbon/app/routes/_public+/login.tsx+++ b/apps/carbon/app/routes/_public+/login.tsx@@ -32,7 +32,7 @@ export const meta: MetaFunction = () => ({export async function loader({ request }: LoaderArgs) {const authSession = await getAuthSession(request);if (authSession && (await verifyAuthSession(authSession))) {- if (authSession) return redirect("/app");+ if (authSession) return redirect("/x");}return null;@@ -61,7 +61,7 @@ export async function action({ request }: ActionArgs): FormActionData {return createAuthSession({request,authSession,- redirectTo: redirectTo || "/app",+ redirectTo: redirectTo || "/x",});}@@ -71,39 +71,40 @@ export default function LoginRoute() {const redirectTo = searchParams.get("redirectTo") ?? undefined;return (- <Flex minW="100vw" minH="100vh" bg={useColor("gray.50")}>- <VStack spacing={8} mx="auto" maxW="lg" pt={24} px={6}>- <Image- src={useColorModeValue("/logo-dark.png", "/logo-light.png")}- alt="Carbon Logo"- maxW={100}- marginBottom={3}- />+ <>+ <Image+ src={useColorModeValue(+ "/carbon-logo-dark.png",+ "/carbon-logo-light.png"+ )}+ alt="Carbon Logo"+ maxW={100}+ marginBottom={3}+ />- <Box rounded="lg" bg={useColor("white")} boxShadow="lg" w={380} p={8}>- <ValidatedForm- validator={loginValidator}- defaultValues={{ redirectTo }}- method="post"- >- <VStack spacing={4} alignItems="start">- {result && result?.message && (- <Alert status="error">- <AlertIcon />- <AlertTitle>{result?.message}</AlertTitle>- </Alert>- )}- <Input name="email" label="Email" />- <Password name="password" label="Password" type="password" />- <Input name="redirectTo" value={redirectTo} type="hidden" />- <Submit w="full">Sign in</Submit>- <Link to="/forgot-password" color={useColor("black")}>- Forgot password?- </Link>- </VStack>- </ValidatedForm>- </Box>- </VStack>- </Flex>+ <Box rounded="lg" bg={useColor("white")} boxShadow="lg" w={380} p={8}>+ <ValidatedForm+ validator={loginValidator}+ defaultValues={{ redirectTo }}+ method="post"+ >+ <VStack spacing={4} alignItems="start">+ {result && result?.message && (+ <Alert status="error">+ <AlertIcon />+ <AlertTitle>{result?.message}</AlertTitle>+ </Alert>+ )}+ <Input name="email" label="Email" />+ <Password name="password" label="Password" type="password" />+ <Input name="redirectTo" value={redirectTo} type="hidden" />+ <Submit w="full">Sign in</Submit>+ <Link to="/forgot-password" color={useColor("black")}>+ Forgot password?+ </Link>+ </VStack>+ </ValidatedForm>+ </Box>+ </>);}diff --git a/apps/carbon/app/routes/_public+/refresh-session.tsx b/apps/carbon/app/routes/_public+/refresh-session.tsxindex b2a88161a8..65ab41671f 100644--- a/apps/carbon/app/routes/_public+/refresh-session.tsx+++ b/apps/carbon/app/routes/_public+/refresh-session.tsx@@ -25,6 +25,6 @@ export async function action({ request }: ActionArgs) {export function ErrorBoundary() {const navigate = useNavigate();- navigate("/app");+ navigate("/x");return null;}diff --git a/apps/carbon/app/routes/_public+/reset-password.tsx b/apps/carbon/app/routes/_public+/reset-password.tsxindex f378848313..df8c7beab0 100644--- a/apps/carbon/app/routes/_public+/reset-password.tsx+++ b/apps/carbon/app/routes/_public+/reset-password.tsx@@ -50,7 +50,7 @@ export async function action({ request }: ActionArgs) {);}- return redirect("/app", await flash(request, success("Password updated")));+ return redirect("/x", await flash(request, success("Password updated")));}export default function ResetPasswordRoute() {@@ -58,35 +58,36 @@ export default function ResetPasswordRoute() {const navigate = useNavigate();return (- <Box minW="100vw" minH="100vh" bg={useColor("gray.50")}>- <VStack spacing={8} mx="auto" maxW="lg" pt={24} px={6}>- <Image- src={useColorModeValue("/logo-dark.png", "/logo-light.png")}- alt="Carbon Logo"- maxW={100}- marginBottom={3}- />+ <>+ <Image+ src={useColorModeValue(+ "/carbon-logo-dark.png",+ "/carbon-logo-light.png"+ )}+ alt="Carbon Logo"+ maxW={100}+ marginBottom={3}+ />- <Box rounded="lg" bg={boxBackground} boxShadow="lg" w={380} p={8}>- <ValidatedForm- method="post"- action="/reset-password"- validator={resetPasswordValidator}- >- <VStack spacing={4} alignItems="start">- <Text>Please select a new password.</Text>+ <Box rounded="lg" bg={boxBackground} boxShadow="lg" w={380} p={8}>+ <ValidatedForm+ method="post"+ action="/reset-password"+ validator={resetPasswordValidator}+ >+ <VStack spacing={4} alignItems="start">+ <Text>Please select a new password.</Text>- <Password name="password" label="New Password" />- <HStack spacing={4}>- <Submit w="full">Reset Password</Submit>- <Button size="md" onClick={() => navigate("/app")}>- Skip- </Button>- </HStack>- </VStack>- </ValidatedForm>- </Box>- </VStack>- </Box>+ <Password name="password" label="New Password" />+ <HStack spacing={4}>+ <Submit w="full">Reset Password</Submit>+ <Button size="md" onClick={() => navigate("/x")}>+ Skip+ </Button>+ </HStack>+ </VStack>+ </ValidatedForm>+ </Box>+ </>);}diff --git a/apps/carbon/app/routes/_public.tsx b/apps/carbon/app/routes/_public.tsxindex 48cf1b14d7..2feb114340 100644--- a/apps/carbon/app/routes/_public.tsx+++ b/apps/carbon/app/routes/_public.tsx@@ -1,5 +1,26 @@+import { Flex, VStack } from "@chakra-ui/react";import { Outlet } from "@remix-run/react";+import background from "~/styles/background.css";++export function links() {+ return [{ rel: "stylesheet", href: background }];+}export default function PublicRoute() {- return <Outlet />;+ return (+ <Flex minW="100vw" minH="100vh">+ <VStack spacing={8} mx="auto" maxW="lg" pt={24} px={6} zIndex={3}>+ <Outlet />+ </VStack>+ <Background />+ </Flex>+ );+}++function Background() {+ return (+ <div className="background">+ <div className="gradient" />+ </div>+ );}diff --git a/apps/carbon/app/routes/app+/index.tsx b/apps/carbon/app/routes/app+/index.tsxdeleted file mode 100644index 6a2ca53b91..0000000000--- a/apps/carbon/app/routes/app+/index.tsx+++ /dev/null@@ -1,15 +0,0 @@-import { Box } from "@chakra-ui/react";-import { UserSelect } from "~/components/Selectors";--export default function AppRoute() {- return (- <Box maxW={400} p={4}>- <UserSelect- isMulti- placeholder="Select users"- selectionsMaxHeight={"calc(100vh - 120px)"}- value={"00000000-0000-0000-0000-000000000000"}- />- </Box>- );-}diff --git a/apps/carbon/app/routes/index.tsx b/apps/carbon/app/routes/index.tsxindex 36d3b2ba07..72debcceb7 100644--- a/apps/carbon/app/routes/index.tsx+++ b/apps/carbon/app/routes/index.tsx@@ -4,7 +4,7 @@ import { requireAuthSession } from "~/services/session";export async function loader({ request }: LoaderArgs) {await requireAuthSession(request);- return redirect("/app");+ return redirect("/x");}export default function IndexRoute() {diff --git a/apps/carbon/app/routes/resource+/purchasing.supplier-contacts.tsx b/apps/carbon/app/routes/resource+/purchasing.supplier-contacts.tsxindex f29c9e4fe2..552482fc5f 100644--- a/apps/carbon/app/routes/resource+/purchasing.supplier-contacts.tsx+++ b/apps/carbon/app/routes/resource+/purchasing.supplier-contacts.tsx@@ -1,15 +1,14 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { getSupplierContacts } from "~/services/purchasing";import { flash } from "~/services/session";import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "purchasing",});- if (!authorized) return json({ data: [] });const url = new URL(request.url);const searchParams = new URLSearchParams(url.search);diff --git a/apps/carbon/app/routes/resource+/purchasing.suppliers.tsx b/apps/carbon/app/routes/resource+/purchasing.suppliers.tsxindex 45432f7209..22ca60dd4e 100644--- a/apps/carbon/app/routes/resource+/purchasing.suppliers.tsx+++ b/apps/carbon/app/routes/resource+/purchasing.suppliers.tsx@@ -1,13 +1,12 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { getSuppliersList } from "~/services/purchasing";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "purchasing",});- if (!authorized) return json({ data: [] });return json(await getSuppliersList(authorized.client));}diff --git a/apps/carbon/app/routes/resource+/sales.customer-contacts.tsx b/apps/carbon/app/routes/resource+/sales.customer-contacts.tsxindex 5260e2077a..d45eef1baf 100644--- a/apps/carbon/app/routes/resource+/sales.customer-contacts.tsx+++ b/apps/carbon/app/routes/resource+/sales.customer-contacts.tsx@@ -1,15 +1,14 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { getCustomerContacts } from "~/services/sales";import { flash } from "~/services/session";import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "sales",});- if (!authorized) return json({ data: [] });const url = new URL(request.url);const searchParams = new URLSearchParams(url.search);diff --git a/apps/carbon/app/routes/resource+/sales.customers.tsx b/apps/carbon/app/routes/resource+/sales.customers.tsxindex eda12911db..566d5bd505 100644--- a/apps/carbon/app/routes/resource+/sales.customers.tsx+++ b/apps/carbon/app/routes/resource+/sales.customers.tsx@@ -1,13 +1,12 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { getCustomersList } from "~/services/sales";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "sales",});- if (!authorized) return json({ data: [] });return json(await getCustomersList(authorized.client));}diff --git a/apps/carbon/app/routes/resource+/users.employee-types.tsx b/apps/carbon/app/routes/resource+/users.employee-types.tsxindex 0b93b8319b..e1a02c7d11 100644--- a/apps/carbon/app/routes/resource+/users.employee-types.tsx+++ b/apps/carbon/app/routes/resource+/users.employee-types.tsx@@ -1,13 +1,13 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { getEmployeeTypes } from "~/services/users";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "users",+ role: "employee",});- if (!authorized) return json({ data: [] });return json(await getEmployeeTypes(authorized.client));}diff --git a/apps/carbon/app/routes/resource+/users.empty-permissions.tsx b/apps/carbon/app/routes/resource+/users.empty-permissions.tsxindex 60484dd1c7..d238790bdc 100644--- a/apps/carbon/app/routes/resource+/users.empty-permissions.tsx+++ b/apps/carbon/app/routes/resource+/users.empty-permissions.tsx@@ -1,6 +1,6 @@import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/router";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {getFeatures,@@ -9,10 +9,10 @@ import {import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {+ const authorized = await requirePermissions(request, {view: "users",+ role: "employee",});- if (!authorized) return json({ permissions: [] });const features = await getFeatures(authorized.client);if (features.error || features.data === null) {diff --git a/apps/carbon/app/routes/resource+/users.groups.tsx b/apps/carbon/app/routes/resource+/users.groups.tsxindex 6c1f3ecfc7..7cd9682e6c 100644--- a/apps/carbon/app/routes/resource+/users.groups.tsx+++ b/apps/carbon/app/routes/resource+/users.groups.tsx@@ -2,13 +2,14 @@ import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";import { arrayToTree } from "performant-array-to-tree";import type { Group } from "~/interfaces/Users/types";-import { requireResourcePermissions } from "~/services/auth";+import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {- const authorized = await requireResourcePermissions(request, {});- if (!authorized) return json({ groups: [] });+ const authorized = await requirePermissions(request, {+ role: "employee",+ });const groups = await authorized.client.from("groups_view").select("*");if (groups.error) {diff --git a/apps/carbon/app/routes/app+/account.$userId.attribute.tsx b/apps/carbon/app/routes/x+/account.$userId.attribute.tsxsimilarity index 88%rename from apps/carbon/app/routes/app+/account.$userId.attribute.tsxrename to apps/carbon/app/routes/x+/account.$userId.attribute.tsxindex dfbef1d5d3..29b2ccda1e 100644--- a/apps/carbon/app/routes/app+/account.$userId.attribute.tsx+++ b/apps/carbon/app/routes/x+/account.$userId.attribute.tsx@@ -11,7 +11,7 @@ import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { upsertUserAttributeValue } from "~/services/account";import { getAttribute } from "~/services/people";-import { getPermissions } from "~/services/users";+import { getUserClaims } from "~/services/users";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";@@ -28,11 +28,10 @@ export async function action({ request, params }: ActionArgs) {const formData = await request.formData();const attributeId = formData.get("userAttributeId") as string;- if (!attributeId || Number.isNaN(Number(attributeId)))- throw new Error("No attribute id provided");+ if (!attributeId) throw new Error("No attribute id provided");- const clientPermissions = await getPermissions(request, client);- const canUpdateAnyUser = clientPermissions["users"]?.update === true;+ const clientClaims = await getUserClaims(request, client);+ const canUpdateAnyUser = clientClaims.permissions["users"]?.update === true;if (!canUpdateAnyUser && userId !== targetUserId) {return json(@@ -43,7 +42,7 @@ export async function action({ request, params }: ActionArgs) {if (!canUpdateAnyUser && userId === targetUserId) {// check if this is a self managed attribute- const attribute = await getAttribute(client, Number(attributeId));+ const attribute = await getAttribute(client, attributeId);if (attribute.error) {return json(null,diff --git a/apps/carbon/app/routes/app+/account.$userId.delete.attribute.tsx b/apps/carbon/app/routes/x+/account.$userId.delete.attribute.tsxsimilarity index 76%rename from apps/carbon/app/routes/app+/account.$userId.delete.attribute.tsxrename to apps/carbon/app/routes/x+/account.$userId.delete.attribute.tsxindex d23539db89..c1b6817279 100644--- a/apps/carbon/app/routes/app+/account.$userId.delete.attribute.tsx+++ b/apps/carbon/app/routes/x+/account.$userId.delete.attribute.tsx@@ -4,7 +4,7 @@ import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import { deleteUserAttributeValue } from "~/services/account";import { getAttribute } from "~/services/people";-import { getPermissions } from "~/services/users";+import { getUserClaims } from "~/services/users";import { assertIsPost } from "~/utils/http";import { error, success } from "~/utils/result";@@ -21,15 +21,13 @@ export async function action({ request, params }: ActionArgs) {const formData = await request.formData();const userAttributeId = formData.get("userAttributeId") as string;- if (!userAttributeId || Number.isNaN(Number(userAttributeId)))- throw new Error("No attribute id provided");+ if (!userAttributeId) throw new Error("No attribute id provided");const userAttributeValueId = formData.get("userAttributeValueId") as string;- if (!userAttributeValueId || Number.isNaN(Number(userAttributeValueId)))- throw new Error("No attribute value id provided");+ if (!userAttributeValueId) throw new Error("No attribute value id provided");- const clientPermissions = await getPermissions(request, client);- const canUpdateAnyUser = clientPermissions["users"]?.update === true;+ const clientClaims = await getUserClaims(request, client);+ const canUpdateAnyUser = clientClaims.permissions["users"]?.update === true;if (!canUpdateAnyUser && userId !== targetUserId) {return json(@@ -40,7 +38,7 @@ export async function action({ request, params }: ActionArgs) {if (!canUpdateAnyUser && userId === targetUserId) {// check if this is a self managed attribute- const attribute = await getAttribute(client, Number(userAttributeId));+ const attribute = await getAttribute(client, userAttributeId);if (attribute.error) {return json(null,@@ -62,8 +60,8 @@ export async function action({ request, params }: ActionArgs) {const removeAttributeValue = await deleteUserAttributeValue(client, {userId,- userAttributeId: Number(userAttributeId),- userAttributeValueId: Number(userAttributeValueId),+ userAttributeId: userAttributeId,+ userAttributeValueId: userAttributeValueId,});if (removeAttributeValue.error) {return json(diff --git a/apps/carbon/app/routes/app+/account.index.tsx b/apps/carbon/app/routes/x+/account.index.tsxsimilarity index 65%rename from apps/carbon/app/routes/app+/account.index.tsxrename to apps/carbon/app/routes/x+/account.index.tsxindex ca6facd967..f678b66790 100644--- a/apps/carbon/app/routes/app+/account.index.tsx+++ b/apps/carbon/app/routes/x+/account.index.tsx@@ -1,5 +1,5 @@import { redirect } from "@remix-run/node";export async function loader() {- return redirect("/app/account/profile");+ return redirect("/x/account/profile");}diff --git a/apps/carbon/app/routes/app+/account.notifications.tsx b/apps/carbon/app/routes/x+/account.notifications.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/account.notifications.tsxrename to apps/carbon/app/routes/x+/account.notifications.tsxdiff --git a/apps/carbon/app/routes/app+/account.password.tsx b/apps/carbon/app/routes/x+/account.password.tsxsimilarity index 79%rename from apps/carbon/app/routes/app+/account.password.tsxrename to apps/carbon/app/routes/x+/account.password.tsxindex 1676909949..90739e4667 100644--- a/apps/carbon/app/routes/app+/account.password.tsx+++ b/apps/carbon/app/routes/x+/account.password.tsx@@ -2,7 +2,7 @@ import type { ActionArgs } from "@remix-run/node";import { json, redirect } from "@remix-run/router";import { validationError } from "remix-validated-form";import { PageTitle } from "~/components/Layout";-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";import { PasswordForm } from "~/interfaces/Account/Password";import { accountPasswordValidator } from "~/services/account";import { requirePermissions } from "~/services/auth";@@ -24,10 +24,11 @@ export async function action({ request }: ActionArgs) {const { currentPassword, password } = validation.data;- const confirmPassword = await getSupabaseAdmin().auth.signInWithPassword({- email,- password: currentPassword,- });+ const confirmPassword =+ await getSupabaseServiceRole().auth.signInWithPassword({+ email,+ password: currentPassword,+ });if (confirmPassword.error || !("user" in confirmPassword.data)) {return json(@@ -36,12 +37,10 @@ export async function action({ request }: ActionArgs) {);}- const updatePassword = await getSupabaseAdmin().auth.admin.updateUserById(- userId,- {+ const updatePassword =+ await getSupabaseServiceRole().auth.admin.updateUserById(userId, {password,- }- );+ });if (updatePassword.error) {return json(@@ -53,7 +52,7 @@ export async function action({ request }: ActionArgs) {);}- return redirect("/app", await flash(request, success("Updated password")));+ return redirect("/x", await flash(request, success("Updated password")));}export default function AccountPassword() {diff --git a/apps/carbon/app/routes/app+/account.personal.tsx b/apps/carbon/app/routes/x+/account.personal.tsxsimilarity index 99%rename from apps/carbon/app/routes/app+/account.personal.tsxrename to apps/carbon/app/routes/x+/account.personal.tsxindex 064141f7a1..56f7ec09c4 100644--- a/apps/carbon/app/routes/app+/account.personal.tsx+++ b/apps/carbon/app/routes/x+/account.personal.tsx@@ -19,7 +19,7 @@ export async function loader({ request }: LoaderArgs) {if (privateAttributes.error) {return redirect(- "/app",+ "/x",await flash(request,error(privateAttributes.error, "Failed to get user attributes")diff --git a/apps/carbon/app/routes/app+/account.profile.tsx b/apps/carbon/app/routes/x+/account.profile.tsxsimilarity index 96%rename from apps/carbon/app/routes/app+/account.profile.tsxrename to apps/carbon/app/routes/x+/account.profile.tsxindex 3042e6a787..c8635383c8 100644--- a/apps/carbon/app/routes/app+/account.profile.tsx+++ b/apps/carbon/app/routes/x+/account.profile.tsx@@ -30,14 +30,14 @@ export async function loader({ request }: LoaderArgs) {if (user.error || !user.data) {return redirect(- "/app",+ "/x",await flash(request, error(user.error, "Failed to get user")));}if (publicAttributes.error) {return redirect(- "/app",+ "/x",await flash(request,error(publicAttributes.error, "Failed to get user attributes")@@ -86,7 +86,7 @@ export async function action({ request }: ActionArgs) {const avatarUpdate = await updateAvatar(client, userId, path);if (avatarUpdate.error) {return redirect(- "/app/account/profile",+ "/x/account/profile",await flash(request,error(avatarUpdate.error, "Failed to update avatar")@@ -95,12 +95,12 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/account/profile",+ "/x/account/profile",await flash(request, success("Updated avatar")));} else {return redirect(- "/app/account/profile",+ "/x/account/profile",await flash(request, error(null, "Invalid avatar path")));}diff --git a/apps/carbon/app/routes/app+/account.security.tsx b/apps/carbon/app/routes/x+/account.security.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/account.security.tsxrename to apps/carbon/app/routes/x+/account.security.tsxdiff --git a/apps/carbon/app/routes/app+/account.settings.tsx b/apps/carbon/app/routes/x+/account.settings.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/account.settings.tsxrename to apps/carbon/app/routes/x+/account.settings.tsxdiff --git a/apps/carbon/app/routes/app+/account.tsx b/apps/carbon/app/routes/x+/account.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/account.tsxrename to apps/carbon/app/routes/x+/account.tsxdiff --git a/apps/carbon/app/routes/x+/index.tsx b/apps/carbon/app/routes/x+/index.tsxnew file mode 100644index 0000000000..6862f18103--- /dev/null+++ b/apps/carbon/app/routes/x+/index.tsx@@ -0,0 +1,3 @@+export default function AppIndexRoute() {+ return null;+}diff --git a/apps/carbon/app/routes/app+/parts.tsx b/apps/carbon/app/routes/x+/parts.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/parts.tsxrename to apps/carbon/app/routes/x+/parts.tsxdiff --git a/apps/carbon/app/routes/app+/people.attribute.$attributeId.tsx b/apps/carbon/app/routes/x+/people.attribute.$attributeId.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/people.attribute.$attributeId.tsxrename to apps/carbon/app/routes/x+/people.attribute.$attributeId.tsxindex 9a3298219b..4b52e7b0c6 100644--- a/apps/carbon/app/routes/app+/people.attribute.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/people.attribute.$attributeId.tsx@@ -27,12 +27,12 @@ export async function action({ request, params }: ActionArgs) {});if (update.error)redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, error(update.error, "Failed to update attribute")));return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, success("Successfully updated attribtue")));}diff --git a/apps/carbon/app/routes/app+/people.attribute.delete.$attributeId.tsx b/apps/carbon/app/routes/x+/people.attribute.delete.$attributeId.tsxsimilarity index 91%rename from apps/carbon/app/routes/app+/people.attribute.delete.$attributeId.tsxrename to apps/carbon/app/routes/x+/people.attribute.delete.$attributeId.tsxindex 5a3812ce5b..caa59b5fdd 100644--- a/apps/carbon/app/routes/app+/people.attribute.delete.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/people.attribute.delete.$attributeId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: LoaderArgs) {const { attributeId } = params;if (!attributeId) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, error(params, "Failed to get an attribute id")));}@@ -21,7 +21,7 @@ export async function action({ request, params }: LoaderArgs) {const deactivateAttribute = await deleteAttribute(client, attributeId);if (deactivateAttribute.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(deactivateAttribute.error, "Failed to deactivate attribute")@@ -30,7 +30,7 @@ export async function action({ request, params }: LoaderArgs) {}return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, success("Successfully deactivated attribute")));}diff --git a/apps/carbon/app/routes/app+/people.attribute.new.tsx b/apps/carbon/app/routes/x+/people.attribute.new.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/people.attribute.new.tsxrename to apps/carbon/app/routes/x+/people.attribute.new.tsxindex ba2a086d8a..197346270d 100644--- a/apps/carbon/app/routes/app+/people.attribute.new.tsx+++ b/apps/carbon/app/routes/x+/people.attribute.new.tsx@@ -32,7 +32,7 @@ export async function action({ request }: ActionArgs) {const createAttribute = await insertAttribute(client, {name,- attributeDataTypeId,+ attributeDataTypeId: Number(attributeDataTypeId),userAttributeCategoryId,listOptions,canSelfManage,@@ -49,7 +49,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- `/app/people/attributes`,+ `/x/people/attributes`,await flash(request, success("Created attribute")));}diff --git a/apps/carbon/app/routes/app+/people.attributes.$categoryId.tsx b/apps/carbon/app/routes/x+/people.attributes.$categoryId.tsxsimilarity index 86%rename from apps/carbon/app/routes/app+/people.attributes.$categoryId.tsxrename to apps/carbon/app/routes/x+/people.attributes.$categoryId.tsxindex aff9cb234a..b2070177c3 100644--- a/apps/carbon/app/routes/app+/people.attributes.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.$categoryId.tsx@@ -16,19 +16,16 @@ import { error, success } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "people",+ role: "employee",});const { categoryId } = params;- if (!categoryId || Number.isNaN(Number(categoryId)))- throw notFound("Invalid categoryId");+ if (!categoryId) throw notFound("Invalid categoryId");- const attributeCategory = await getAttributeCategory(- client,- Number(categoryId)- );+ const attributeCategory = await getAttributeCategory(client, categoryId);if (attributeCategory.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(attributeCategory.error, "Failed to fetch attribute category")@@ -64,7 +61,7 @@ export async function action({ request }: ActionArgs) {});if (updateCategory.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(updateCategory.error, "Failed to update attribute category")@@ -73,7 +70,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, success("Updated attribute category ")));}@@ -81,7 +78,7 @@ export async function action({ request }: ActionArgs) {export default function EditAttributeCategoryRoute() {const { attributeCategory } = useLoaderData<typeof loader>();const navigate = useNavigate();- const onClose = () => navigate("/app/people/attributes/");+ const onClose = () => navigate("/x/people/attributes/");const initialValues = {id: attributeCategory?.id,diff --git a/apps/carbon/app/routes/app+/people.attributes.delete.$categoryId.tsx b/apps/carbon/app/routes/x+/people.attributes.delete.$categoryId.tsxsimilarity index 91%rename from apps/carbon/app/routes/app+/people.attributes.delete.$categoryId.tsxrename to apps/carbon/app/routes/x+/people.attributes.delete.$categoryId.tsxindex a1950058ec..624a25f5d3 100644--- a/apps/carbon/app/routes/app+/people.attributes.delete.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.delete.$categoryId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: LoaderArgs) {const { categoryId } = params;if (!categoryId) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, error(params, "Failed to get a category id")));}@@ -21,7 +21,7 @@ export async function action({ request, params }: LoaderArgs) {const deactivateAttribute = await deleteAttributeCategory(client, categoryId);if (deactivateAttribute.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(@@ -33,7 +33,7 @@ export async function action({ request, params }: LoaderArgs) {}return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, success("Successfully deactivated attribute category")));}diff --git a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.$attributeId.tsx b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.$attributeId.tsxsimilarity index 84%rename from apps/carbon/app/routes/app+/people.attributes.list.$categoryId.$attributeId.tsxrename to apps/carbon/app/routes/x+/people.attributes.list.$categoryId.$attributeId.tsxindex 9b01966021..b8914979c0 100644--- a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.$attributeId.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.$attributeId.tsx@@ -14,16 +14,16 @@ import { error } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "people",+ role: "employee",});const { categoryId, attributeId } = params;- if (!attributeId || Number.isNaN(Number(attributeId)))- throw notFound("attributeId not found");+ if (!attributeId) throw notFound("attributeId not found");- const attribute = await getAttribute(client, Number(attributeId));+ const attribute = await getAttribute(client, attributeId);if (attribute.error) {return redirect(- `/app/people/attributes/list/${categoryId}`,+ `/x/people/attributes/list/${categoryId}`,await flash(request, error(attribute.error, "Failed to fetch attribute")));}@@ -39,12 +39,12 @@ export default function EditAttributeRoute() {if (Number.isNaN(categoryId)) throw new Error("categoryId is not a number");const navigate = useNavigate();- const onClose = () => navigate(`/app/people/attributes/list/${categoryId}`);+ const onClose = () => navigate(`/x/people/attributes/list/${categoryId}`);const attributesRouteData = useRouteData<{dataTypes: {data: AttributeDataType[] | null;};- }>("/app/people/attributes");+ }>("/x/people/attributes");return (<AttributeFormdiff --git a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.new.tsx b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.new.tsxsimilarity index 81%rename from apps/carbon/app/routes/app+/people.attributes.list.$categoryId.new.tsxrename to apps/carbon/app/routes/x+/people.attributes.list.$categoryId.new.tsxindex b8ac345f51..f63467b08b 100644--- a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.new.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.new.tsx@@ -5,7 +5,7 @@ import type { AttributeDataType } from "~/interfaces/People/types";export default function NewAttributeRoute() {const { categoryId } = useParams();- if (Number.isNaN(categoryId)) throw new Error("categoryId is not a number");+ if (!categoryId) throw new Error("categoryId is not found");const navigate = useNavigate();const onClose = () => navigate(-1);@@ -13,14 +13,14 @@ export default function NewAttributeRoute() {dataTypes: {data: AttributeDataType[] | null;};- }>("/app/people/attributes");+ }>("/x/people/attributes");return (<AttributeForminitialValues={{name: "",attributeDataTypeId: undefined,- userAttributeCategoryId: Number(categoryId),+ userAttributeCategoryId: categoryId,canSelfManage: true,}}dataTypes={attributesRouteData?.dataTypes?.data ?? []}diff --git a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.tsx b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.tsxsimilarity index 85%rename from apps/carbon/app/routes/app+/people.attributes.list.$categoryId.tsxrename to apps/carbon/app/routes/x+/people.attributes.list.$categoryId.tsxindex 0075ddd556..7e19526590 100644--- a/apps/carbon/app/routes/app+/people.attributes.list.$categoryId.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.list.$categoryId.tsx@@ -15,19 +15,16 @@ import { error } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "people",+ role: "employee",});const { categoryId } = params;- if (!categoryId || Number.isNaN(Number(categoryId)))- throw notFound("Invalid categoryId");+ if (!categoryId) throw notFound("Invalid categoryId");- const attributeCategory = await getAttributeCategory(- client,- Number(categoryId)- );+ const attributeCategory = await getAttributeCategory(client, categoryId);if (attributeCategory.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(attributeCategory.error, "Failed to fetch attribute category")@@ -53,8 +50,8 @@ export async function action({ request }: ActionArgs) {}const updates = Object.entries(JSON.parse(updateMap)).map(- ([idString, sortOrderString]) => ({- id: Number(idString),+ ([id, sortOrderString]) => ({+ id,sortOrder: Number(sortOrderString),updatedBy: userId,})@@ -77,7 +74,7 @@ export default function AttributeCategoryListRoute() {const { attributeCategory } = useLoaderData<typeof loader>();const [params] = useUrlParams();const navigate = useNavigate();- const onClose = () => navigate(`/app/people/attributes?${params.toString()}`);+ const onClose = () => navigate(`/x/people/attributes?${params.toString()}`);return (<>diff --git a/apps/carbon/app/routes/app+/people.attributes.new.tsx b/apps/carbon/app/routes/x+/people.attributes.new.tsxsimilarity index 93%rename from apps/carbon/app/routes/app+/people.attributes.new.tsxrename to apps/carbon/app/routes/x+/people.attributes.new.tsxindex 1944e9fc06..6bf83c0ba0 100644--- a/apps/carbon/app/routes/app+/people.attributes.new.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.new.tsx@@ -35,7 +35,7 @@ export async function action({ request }: ActionArgs) {});if (createAttributeCategory.error) {return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request,error(@@ -47,14 +47,14 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/people/attributes",+ "/x/people/attributes",await flash(request, success("Created attribute category ")));}export default function NewAttributeCategoryRoute() {const navigate = useNavigate();- const onClose = () => navigate("/app/people/attributes");+ const onClose = () => navigate("/x/people/attributes");const initialValues = {name: "",diff --git a/apps/carbon/app/routes/app+/people.attributes.tsx b/apps/carbon/app/routes/x+/people.attributes.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/people.attributes.tsxrename to apps/carbon/app/routes/x+/people.attributes.tsxindex 612a38a51d..e2153ac063 100644--- a/apps/carbon/app/routes/app+/people.attributes.tsx+++ b/apps/carbon/app/routes/x+/people.attributes.tsx@@ -16,6 +16,7 @@ import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "people",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/people.tsx b/apps/carbon/app/routes/x+/people.tsxsimilarity index 86%rename from apps/carbon/app/routes/app+/people.tsxrename to apps/carbon/app/routes/x+/people.tsxindex 7f883d7844..c0b512d376 100644--- a/apps/carbon/app/routes/app+/people.tsx+++ b/apps/carbon/app/routes/x+/people.tsx@@ -9,11 +9,11 @@ export const meta: MetaFunction = () => ({});export default function PeopleRoute() {- const { links } = usePeopleSidebar();+ const { groups } = usePeopleSidebar();return (<Grid w="full" h="full" templateColumns="auto 1fr" overflow="auto">- <GroupedContentSidebar links={links} />+ <GroupedContentSidebar groups={groups} /><VStack w="full" h="full" spacing={0}><Outlet /></VStack>diff --git a/apps/carbon/app/routes/app+/purchasing.index.tsx b/apps/carbon/app/routes/x+/purchasing.index.tsxsimilarity index 62%rename from apps/carbon/app/routes/app+/purchasing.index.tsxrename to apps/carbon/app/routes/x+/purchasing.index.tsxindex c1d170d6cb..4332709353 100644--- a/apps/carbon/app/routes/app+/purchasing.index.tsx+++ b/apps/carbon/app/routes/x+/purchasing.index.tsx@@ -1,5 +1,5 @@import { redirect } from "@remix-run/node";export async function loader() {- return redirect("/app/purchasing/suppliers");+ return redirect("/x/purchasing/suppliers");}diff --git a/apps/carbon/app/routes/app+/purchasing.supplier-types.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing.supplier-types.$supplierTypeId.tsxsimilarity index 95%rename from apps/carbon/app/routes/app+/purchasing.supplier-types.$supplierTypeId.tsxrename to apps/carbon/app/routes/x+/purchasing.supplier-types.$supplierTypeId.tsxindex f4ff90591c..903e310bb4 100644--- a/apps/carbon/app/routes/app+/purchasing.supplier-types.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.supplier-types.$supplierTypeId.tsx@@ -17,6 +17,7 @@ import { error, success } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "purchasing",+ role: "employee",});const { supplierTypeId } = params;@@ -26,7 +27,7 @@ export async function loader({ request, params }: LoaderArgs) {if (supplierType?.data?.protected) {return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request, error(null, "Cannot edit a protected supplier type")));}@@ -69,7 +70,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request, success("Updated supplier type")));}diff --git a/apps/carbon/app/routes/app+/purchasing.supplier-types.delete.$supplierTypeId.tsx b/apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsxsimilarity index 87%rename from apps/carbon/app/routes/app+/purchasing.supplier-types.delete.$supplierTypeId.tsxrename to apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsxindex 83c5fcc064..30125e971c 100644--- a/apps/carbon/app/routes/app+/purchasing.supplier-types.delete.$supplierTypeId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.supplier-types.delete.$supplierTypeId.tsx@@ -11,6 +11,7 @@ import { notFound } from "~/utils/http";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "purchasing",+ role: "employee",});const { supplierTypeId } = params;if (!supplierTypeId) throw notFound("supplierTypeId not found");@@ -18,7 +19,7 @@ export async function loader({ request, params }: LoaderArgs) {const supplierType = await getSupplierType(client, supplierTypeId);if (supplierType.error) {return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request,error(supplierType.error, "Failed to get supplier type")@@ -37,7 +38,7 @@ export async function action({ request, params }: ActionArgs) {const { supplierTypeId } = params;if (!supplierTypeId) {return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request, error(params, "Failed to get an supplier type id")));}@@ -48,7 +49,7 @@ export async function action({ request, params }: ActionArgs) {);if (deleteTypeError) {return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request,error(deleteTypeError, "Failed to delete supplier type")@@ -57,7 +58,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request, success("Successfully deleted supplier type")));}@@ -69,10 +70,10 @@ export default function DeleteSupplierTypeRoute() {if (!supplierTypeId || !data) return null; // TODO - handle this better (404?)- const onCancel = () => navigate("/app/purchasing/supplier-types");+ const onCancel = () => navigate("/x/purchasing/supplier-types");return (<ConfirmDelete- action={`/app/purchasing/supplier-types/delete/${supplierTypeId}`}+ action={`/x/purchasing/supplier-types/delete/${supplierTypeId}`}name={data.name}text={`Are you sure you want to delete the supplier type: ${data.name}? This cannot be undone.`}onCancel={onCancel}diff --git a/apps/carbon/app/routes/app+/purchasing.supplier-types.new.tsx b/apps/carbon/app/routes/x+/purchasing.supplier-types.new.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/purchasing.supplier-types.new.tsxrename to apps/carbon/app/routes/x+/purchasing.supplier-types.new.tsxindex 30b5c577eb..025a6b2e54 100644--- a/apps/carbon/app/routes/app+/purchasing.supplier-types.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing.supplier-types.new.tsx@@ -62,7 +62,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/purchasing/supplier-types",+ "/x/purchasing/supplier-types",await flash(request, success("Supplier type created")));}diff --git a/apps/carbon/app/routes/app+/purchasing.supplier-types.tsx b/apps/carbon/app/routes/x+/purchasing.supplier-types.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/purchasing.supplier-types.tsxrename to apps/carbon/app/routes/x+/purchasing.supplier-types.tsxindex 02a012597a..53afe252f5 100644--- a/apps/carbon/app/routes/app+/purchasing.supplier-types.tsx+++ b/apps/carbon/app/routes/x+/purchasing.supplier-types.tsx@@ -13,6 +13,7 @@ import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "purchasing",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsxsimilarity index 89%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsxindex cbb04b8862..807ea598b5 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.$supplierContactId.tsx@@ -12,9 +12,7 @@ import { error, success } from "~/utils/result";export async function action({ request, params }: ActionArgs) {assertIsPost(request);- const { client } = await requirePermissions(request, {- update: "purchasing",- });+ const { client } = await requirePermissions(request, {});const { supplierId, supplierContactId } = params;if (!supplierId) throw notFound("supplierId not found");@@ -40,9 +38,10 @@ export async function action({ request, params }: ActionArgs) {contactId,contact,});+ console.log(update);if (update.error) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(update.error, "Failed to update supplier contact")@@ -51,7 +50,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Supplier contact updated")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsxsimilarity index 89%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsxindex d93e5bd775..1ab1c4d8a9 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.delete.$supplierContactId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: ActionArgs) {const { supplierId, supplierContactId } = params;if (!supplierId || !supplierContactId) {return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request, error(params, "Failed to get a supplier contact id")));}@@ -25,7 +25,7 @@ export async function action({ request, params }: ActionArgs) {);if (deleteSupplierContactError) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(deleteSupplierContactError, "Failed to delete supplier contact")@@ -34,7 +34,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Successfully deleted supplier contact")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.new.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.new.tsxsimilarity index 93%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.new.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.new.tsxindex 14d7b8f478..95160b63c4 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.contact.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.contact.new.tsx@@ -35,7 +35,7 @@ export async function action({ request, params }: ActionArgs) {});if (createSupplierContact.error) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(createSupplierContact.error, "Failed to create supplier contact")@@ -44,7 +44,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Supplier contact created")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsxsimilarity index 83%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsxindex 6ed4491a78..fa99cedb45 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.$supplierLocationId.tsx@@ -30,11 +30,8 @@ export async function action({ request, params }: ActionArgs) {const { id, addressId, ...address } = validation.data;- if (id !== Number(supplierLocationId))- throw badRequest("supplierLocationId does not match id from form data");-if (addressId === undefined)- throw badRequest("addressId is undefined from form data");+ throw badRequest("addressId is undefined in form data");const update = await updateSupplierLocation(client, {addressId,@@ -42,7 +39,7 @@ export async function action({ request, params }: ActionArgs) {});if (update.error) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(update.error, "Failed to update supplier address")@@ -51,7 +48,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Supplier address updated")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsxsimilarity index 87%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsxindex d9f7b91467..3914251892 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.delete.$supplierLocationId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: ActionArgs) {const { supplierId, supplierLocationId } = params;if (!supplierId || !supplierLocationId) {return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request,error(params, "Failed to get a supplier location id")@@ -24,11 +24,11 @@ export async function action({ request, params }: ActionArgs) {const { error: deleteSupplierLocationError } = await deleteSupplierLocation(client,supplierId,- Number(supplierLocationId)+ supplierLocationId);if (deleteSupplierLocationError) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(deleteSupplierLocationError, "Failed to delete supplier location")@@ -37,7 +37,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Successfully deleted supplier location")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.new.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.new.tsxsimilarity index 93%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.new.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.new.tsxindex eea7080274..2b4c9b6157 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.location.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.location.new.tsx@@ -35,7 +35,7 @@ export async function action({ request, params }: ActionArgs) {});if (createSupplierLocation.error) {return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request,error(@@ -47,7 +47,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Supplier location created")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.tsxindex ff33fba46f..021a812564 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.$supplierId.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.$supplierId.tsx@@ -31,13 +31,13 @@ export async function loader({ request, params }: LoaderArgs) {]);if (supplier.error)return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request, error(supplier.error, "Failed to get supplier")));if (contacts.error)return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request,error(contacts.error, "Failed to get supplier contacts")@@ -46,7 +46,7 @@ export async function loader({ request, params }: LoaderArgs) {if (locations.error)return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request,error(locations.error, "Failed to get supplier locations")@@ -84,7 +84,7 @@ export async function action({ request }: ActionArgs) {if (!id) {return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request, error(null, "Failed to update supplier")));}@@ -101,7 +101,7 @@ export async function action({ request }: ActionArgs) {});if (update.error) {return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request, error(update.error, "Failed to update supplier")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.new.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.new.tsxsimilarity index 95%rename from apps/carbon/app/routes/app+/purchasing.suppliers.new.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.new.tsxindex 3801ad18f9..24f097baef 100644--- a/apps/carbon/app/routes/app+/purchasing.suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/purchasing.suppliers.new.tsx@@ -40,7 +40,7 @@ export async function action({ request }: ActionArgs) {});if (createSupplier.error) {return redirect(- "/app/purchasing/suppliers",+ "/x/purchasing/suppliers",await flash(request,error(createSupplier.error, "Failed to insert supplier")@@ -51,7 +51,7 @@ export async function action({ request }: ActionArgs) {const supplierId = createSupplier.data[0]?.id;return redirect(- `/app/purchasing/suppliers/${supplierId}`,+ `/x/purchasing/suppliers/${supplierId}`,await flash(request, success("Created supplier")));}diff --git a/apps/carbon/app/routes/app+/purchasing.suppliers.tsx b/apps/carbon/app/routes/x+/purchasing.suppliers.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/purchasing.suppliers.tsxrename to apps/carbon/app/routes/x+/purchasing.suppliers.tsxdiff --git a/apps/carbon/app/routes/app+/purchasing.tsx b/apps/carbon/app/routes/x+/purchasing.tsxsimilarity index 86%rename from apps/carbon/app/routes/app+/purchasing.tsxrename to apps/carbon/app/routes/x+/purchasing.tsxindex d63c347c68..6386ca85d2 100644--- a/apps/carbon/app/routes/app+/purchasing.tsx+++ b/apps/carbon/app/routes/x+/purchasing.tsx@@ -9,11 +9,11 @@ export const meta: MetaFunction = () => ({});export default function UsersRoute() {- const { links } = usePurchasingSidebar();+ const { groups } = usePurchasingSidebar();return (<Grid w="full" h="full" templateColumns="auto 1fr" overflow="auto">- <GroupedContentSidebar links={links} />+ <GroupedContentSidebar groups={groups} /><VStack w="full" h="full" spacing={0}><Outlet /></VStack>diff --git a/apps/carbon/app/routes/app+/sales.customer-types.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales.customer-types.$customerTypeId.tsxsimilarity index 96%rename from apps/carbon/app/routes/app+/sales.customer-types.$customerTypeId.tsxrename to apps/carbon/app/routes/x+/sales.customer-types.$customerTypeId.tsxindex dc61814cd4..87e879c0bc 100644--- a/apps/carbon/app/routes/app+/sales.customer-types.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales.customer-types.$customerTypeId.tsx@@ -17,6 +17,7 @@ import { error, success } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "sales",+ role: "employee",});const { customerTypeId } = params;@@ -26,7 +27,7 @@ export async function loader({ request, params }: LoaderArgs) {if (customerType?.data?.protected) {return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request, error(null, "Cannot edit a protected customer type")));}@@ -69,7 +70,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request, success("Updated customer type")));}diff --git a/apps/carbon/app/routes/app+/sales.customer-types.delete.$customerTypeId.tsx b/apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsxsimilarity index 88%rename from apps/carbon/app/routes/app+/sales.customer-types.delete.$customerTypeId.tsxrename to apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsxindex 2b7acdc31f..f142ba3add 100644--- a/apps/carbon/app/routes/app+/sales.customer-types.delete.$customerTypeId.tsx+++ b/apps/carbon/app/routes/x+/sales.customer-types.delete.$customerTypeId.tsx@@ -18,7 +18,7 @@ export async function loader({ request, params }: LoaderArgs) {const customerType = await getCustomerType(client, customerTypeId);if (customerType.error) {return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request,error(customerType.error, "Failed to get customer type")@@ -37,7 +37,7 @@ export async function action({ request, params }: ActionArgs) {const { customerTypeId } = params;if (!customerTypeId) {return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request, error(params, "Failed to get an customer type id")));}@@ -48,7 +48,7 @@ export async function action({ request, params }: ActionArgs) {);if (deleteTypeError) {return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request,error(deleteTypeError, "Failed to delete customer type")@@ -57,7 +57,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request, success("Successfully deleted customer type")));}@@ -69,11 +69,11 @@ export default function DeleteCustomerTypeRoute() {if (!customerTypeId || !data) return null; // TODO - handle this better (404?)- const onCancel = () => navigate("/app/sales/customer-types");+ const onCancel = () => navigate("/x/sales/customer-types");return (<ConfirmDelete- action={`/app/sales/customer-types/delete/${customerTypeId}`}+ action={`/x/sales/customer-types/delete/${customerTypeId}`}name={data.name}text={`Are you sure you want to delete the customer type: ${data.name}? This cannot be undone.`}onCancel={onCancel}diff --git a/apps/carbon/app/routes/app+/sales.customer-types.new.tsx b/apps/carbon/app/routes/x+/sales.customer-types.new.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/sales.customer-types.new.tsxrename to apps/carbon/app/routes/x+/sales.customer-types.new.tsxindex c8912cfa9a..b34e225eef 100644--- a/apps/carbon/app/routes/app+/sales.customer-types.new.tsx+++ b/apps/carbon/app/routes/x+/sales.customer-types.new.tsx@@ -59,7 +59,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/sales/customer-types",+ "/x/sales/customer-types",await flash(request, success("Customer type created")));}diff --git a/apps/carbon/app/routes/app+/sales.customer-types.tsx b/apps/carbon/app/routes/x+/sales.customer-types.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/sales.customer-types.tsxrename to apps/carbon/app/routes/x+/sales.customer-types.tsxindex a33058134a..c674aff003 100644--- a/apps/carbon/app/routes/app+/sales.customer-types.tsx+++ b/apps/carbon/app/routes/x+/sales.customer-types.tsx@@ -13,6 +13,7 @@ import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "sales",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.$customerContactId.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.contact.$customerContactId.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.contact.$customerContactId.tsxindex c3d3059a1f..8a850eb203 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.$customerContactId.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.$customerContactId.tsx@@ -42,7 +42,7 @@ export async function action({ request, params }: ActionArgs) {});if (update.error) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(update.error, "Failed to update customer contact")@@ -51,7 +51,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Customer contact updated")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.delete.$customerContactId.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.delete.$customerContactId.tsxsimilarity index 90%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.contact.delete.$customerContactId.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.contact.delete.$customerContactId.tsxindex 24d5668f4c..af2b616eef 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.delete.$customerContactId.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.delete.$customerContactId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: ActionArgs) {const { customerId, customerContactId } = params;if (!customerId || !customerContactId) {return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request, error(params, "Failed to get a customer contact id")));}@@ -25,7 +25,7 @@ export async function action({ request, params }: ActionArgs) {);if (deleteCustomerContactError) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(deleteCustomerContactError, "Failed to delete customer contact")@@ -34,7 +34,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Successfully deleted customer contact")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.new.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.new.tsxsimilarity index 93%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.contact.new.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.contact.new.tsxindex 0fd4337aa3..08c93069a1 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.contact.new.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.contact.new.tsx@@ -35,7 +35,7 @@ export async function action({ request, params }: ActionArgs) {});if (createCustomerContact.error) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(createCustomerContact.error, "Failed to create customer contact")@@ -44,7 +44,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Customer contact created")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.$customerLocationId.tsxsimilarity index 82%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.location.$customerLocationId.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.location.$customerLocationId.tsxindex 6342a31ae3..578cb4ece1 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.$customerLocationId.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.$customerLocationId.tsx@@ -30,11 +30,7 @@ export async function action({ request, params }: ActionArgs) {const { id, addressId, ...address } = validation.data;- if (id !== Number(customerLocationId))- throw badRequest("customerLocationId does not match id from form data");-- if (addressId === undefined)- throw badRequest("addressId is undefined from form data");+ if (!addressId) throw badRequest("addressId is undefined in form data");const update = await updateCustomerLocation(client, {addressId,@@ -42,7 +38,7 @@ export async function action({ request, params }: ActionArgs) {});if (update.error) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(update.error, "Failed to update customer address")@@ -51,7 +47,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Customer address updated")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.delete.$customerLocationId.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.delete.$customerLocationId.tsxsimilarity index 88%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.location.delete.$customerLocationId.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.location.delete.$customerLocationId.tsxindex 4b396f0138..6143ce5aa9 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.delete.$customerLocationId.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.delete.$customerLocationId.tsx@@ -13,7 +13,7 @@ export async function action({ request, params }: ActionArgs) {const { customerId, customerLocationId } = params;if (!customerId || !customerLocationId) {return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request,error(params, "Failed to get a customer location id")@@ -24,11 +24,11 @@ export async function action({ request, params }: ActionArgs) {const { error: deleteCustomerLocationError } = await deleteCustomerLocation(client,customerId,- Number(customerLocationId)+ customerLocationId);if (deleteCustomerLocationError) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(deleteCustomerLocationError, "Failed to delete customer location")@@ -37,7 +37,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Successfully deleted customer location")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.new.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.new.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.location.new.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.location.new.tsxindex a6e0f48800..ecf1e9c9f1 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.location.new.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.location.new.tsx@@ -35,7 +35,7 @@ export async function action({ request, params }: ActionArgs) {});if (createCustomerLocation.error) {return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request,error(@@ -47,7 +47,7 @@ export async function action({ request, params }: ActionArgs) {}return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Customer location created")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.$customerId.tsx b/apps/carbon/app/routes/x+/sales.customers.$customerId.tsxsimilarity index 95%rename from apps/carbon/app/routes/app+/sales.customers.$customerId.tsxrename to apps/carbon/app/routes/x+/sales.customers.$customerId.tsxindex 9bd82a2867..e1feef8a97 100644--- a/apps/carbon/app/routes/app+/sales.customers.$customerId.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.$customerId.tsx@@ -31,13 +31,13 @@ export async function loader({ request, params }: LoaderArgs) {]);if (customer.error)return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request, error(customer.error, "Failed to get customer")));if (contacts.error)return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request,error(contacts.error, "Failed to get customer contacts")@@ -46,7 +46,7 @@ export async function loader({ request, params }: LoaderArgs) {if (locations.error)return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request,error(locations.error, "Failed to get customer locations")@@ -84,7 +84,7 @@ export async function action({ request }: ActionArgs) {if (!id) {return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request, error(null, "Failed to update customer")));}@@ -101,7 +101,7 @@ export async function action({ request }: ActionArgs) {});if (update.error) {return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request, error(update.error, "Failed to update customer")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.new.tsx b/apps/carbon/app/routes/x+/sales.customers.new.tsxsimilarity index 95%rename from apps/carbon/app/routes/app+/sales.customers.new.tsxrename to apps/carbon/app/routes/x+/sales.customers.new.tsxindex ab4e78264a..3f421eacd1 100644--- a/apps/carbon/app/routes/app+/sales.customers.new.tsx+++ b/apps/carbon/app/routes/x+/sales.customers.new.tsx@@ -40,7 +40,7 @@ export async function action({ request }: ActionArgs) {});if (createCustomer.error) {return redirect(- "/app/sales/customers",+ "/x/sales/customers",await flash(request,error(createCustomer.error, "Failed to insert customer")@@ -51,7 +51,7 @@ export async function action({ request }: ActionArgs) {const customerId = createCustomer.data[0]?.id;return redirect(- `/app/sales/customers/${customerId}`,+ `/x/sales/customers/${customerId}`,await flash(request, success("Created customer")));}diff --git a/apps/carbon/app/routes/app+/sales.customers.tsx b/apps/carbon/app/routes/x+/sales.customers.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/sales.customers.tsxrename to apps/carbon/app/routes/x+/sales.customers.tsxdiff --git a/apps/carbon/app/routes/app+/sales.index.tsx b/apps/carbon/app/routes/x+/sales.index.tsxsimilarity index 65%rename from apps/carbon/app/routes/app+/sales.index.tsxrename to apps/carbon/app/routes/x+/sales.index.tsxindex 3d5963fe56..268dff87ff 100644--- a/apps/carbon/app/routes/app+/sales.index.tsx+++ b/apps/carbon/app/routes/x+/sales.index.tsx@@ -1,5 +1,5 @@import { redirect } from "@remix-run/node";export async function loader() {- return redirect("/app/sales/customers");+ return redirect("/x/sales/customers");}diff --git a/apps/carbon/app/routes/app+/sales.tsx b/apps/carbon/app/routes/x+/sales.tsxsimilarity index 86%rename from apps/carbon/app/routes/app+/sales.tsxrename to apps/carbon/app/routes/x+/sales.tsxindex 291d4cbe96..1471b73239 100644--- a/apps/carbon/app/routes/app+/sales.tsx+++ b/apps/carbon/app/routes/x+/sales.tsx@@ -9,11 +9,11 @@ export const meta: MetaFunction = () => ({});export default function UsersRoute() {- const { links } = useSalesSidebar();+ const { groups } = useSalesSidebar();return (<Grid w="full" h="full" templateColumns="auto 1fr" overflow="auto">- <GroupedContentSidebar links={links} />+ <GroupedContentSidebar groups={groups} /><VStack w="full" h="full" spacing={0}><Outlet /></VStack>diff --git a/apps/carbon/app/routes/app+/users.bulk-edit-permissions.tsx b/apps/carbon/app/routes/x+/users.bulk-edit-permissions.tsxsimilarity index 96%rename from apps/carbon/app/routes/app+/users.bulk-edit-permissions.tsxrename to apps/carbon/app/routes/x+/users.bulk-edit-permissions.tsxindex 3c05b336ff..2037cf5e30 100644--- a/apps/carbon/app/routes/app+/users.bulk-edit-permissions.tsx+++ b/apps/carbon/app/routes/x+/users.bulk-edit-permissions.tsx@@ -37,7 +37,7 @@ export async function action({ request }: ActionArgs) {)) {return redirect(- "/app/users/employees",+ "/x/users/employees",await flash(request, error(permissions, "Failed to parse permissions")));}@@ -56,7 +56,7 @@ export async function action({ request }: ActionArgs) {await bulkPermissionsQueue.addBulk(jobs);return redirect(- "/app/users/employees",+ "/x/users/employees",await flash(request, success("Updating user permissions")));}diff --git a/apps/carbon/app/routes/app+/users.customers.new.tsx b/apps/carbon/app/routes/x+/users.customers.new.tsxsimilarity index 80%rename from apps/carbon/app/routes/app+/users.customers.new.tsxrename to apps/carbon/app/routes/x+/users.customers.new.tsxindex c1071e2486..69075be420 100644--- a/apps/carbon/app/routes/app+/users.customers.new.tsx+++ b/apps/carbon/app/routes/x+/users.customers.new.tsx@@ -5,7 +5,7 @@ import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {createCustomerAccount,- createCustomerValidator,+ createCustomerAccountValidator,} from "~/services/users";import { assertIsPost } from "~/utils/http";import { CreateCustomerModal } from "~/interfaces/Users/Customers";@@ -13,10 +13,11 @@ import { CreateCustomerModal } from "~/interfaces/Users/Customers";export async function action({ request }: ActionArgs) {assertIsPost(request);const { client } = await requirePermissions(request, {- view: "users",+ view: "sales",+ update: "users",});- const validation = await createCustomerValidator.validate(+ const validation = await createCustomerAccountValidator.validate(await request.formData());@@ -30,7 +31,7 @@ export async function action({ request }: ActionArgs) {customerId: customer,});- return redirect("/app/users/customers", await flash(request, result));+ return redirect("/x/users/customers", await flash(request, result));}export default function () {diff --git a/apps/carbon/app/routes/app+/users.customers.tsx b/apps/carbon/app/routes/x+/users.customers.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/users.customers.tsxrename to apps/carbon/app/routes/x+/users.customers.tsxdiff --git a/apps/carbon/app/routes/app+/users.deactivate.tsx b/apps/carbon/app/routes/x+/users.deactivate.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/users.deactivate.tsxrename to apps/carbon/app/routes/x+/users.deactivate.tsxdiff --git a/apps/carbon/app/routes/app+/users.employee-types.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users.employee-types.$employeeTypeId.tsxsimilarity index 97%rename from apps/carbon/app/routes/app+/users.employee-types.$employeeTypeId.tsxrename to apps/carbon/app/routes/x+/users.employee-types.$employeeTypeId.tsxindex 30d2ccb289..94b2a9432d 100644--- a/apps/carbon/app/routes/app+/users.employee-types.$employeeTypeId.tsx+++ b/apps/carbon/app/routes/x+/users.employee-types.$employeeTypeId.tsx@@ -21,6 +21,7 @@ import { error, success } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const { employeeTypeId } = params;@@ -33,7 +34,7 @@ export async function loader({ request, params }: LoaderArgs) {if (employeeType?.data?.protected) {return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, error(null, "Cannot edit a protected employee type")));}@@ -111,7 +112,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, success("Updated employee type")));}diff --git a/apps/carbon/app/routes/app+/users.employee-types.delete.$employeeTypeId.tsx b/apps/carbon/app/routes/x+/users.employee-types.delete.$employeeTypeId.tsxsimilarity index 88%rename from apps/carbon/app/routes/app+/users.employee-types.delete.$employeeTypeId.tsxrename to apps/carbon/app/routes/x+/users.employee-types.delete.$employeeTypeId.tsxindex 0b703fccc7..faf4797dd6 100644--- a/apps/carbon/app/routes/app+/users.employee-types.delete.$employeeTypeId.tsx+++ b/apps/carbon/app/routes/x+/users.employee-types.delete.$employeeTypeId.tsx@@ -11,6 +11,7 @@ import { notFound } from "~/utils/http";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const { employeeTypeId } = params;if (!employeeTypeId) throw notFound("EmployeeTypeId not found");@@ -18,7 +19,7 @@ export async function loader({ request, params }: LoaderArgs) {const employeeType = await getEmployeeType(client, employeeTypeId);if (employeeType.error) {return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request,error(employeeType.error, "Failed to get employee type")@@ -37,7 +38,7 @@ export async function action({ request, params }: ActionArgs) {const { employeeTypeId } = params;if (!employeeTypeId) {return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, error(params, "Failed to get an employee type id")));}@@ -48,7 +49,7 @@ export async function action({ request, params }: ActionArgs) {);if (deleteTypeError) {return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request,error(deleteTypeError, "Failed to delete employee type")@@ -59,7 +60,7 @@ export async function action({ request, params }: ActionArgs) {// TODO - delete employeeType groupreturn redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, success("Successfully deleted employee type")));}@@ -71,11 +72,11 @@ export default function DeleteEmployeeTypeRoute() {if (!employeeTypeId || !data) return null; // TODO - handle this better (404?)- const onCancel = () => navigate("/app/users/employee-types");+ const onCancel = () => navigate("/x/users/employee-types");return (<ConfirmDelete- action={`/app/users/employee-types/delete/${employeeTypeId}`}+ action={`/x/users/employee-types/delete/${employeeTypeId}`}name={data.name}text={`Are you sure you want to delete the employee type: ${data.name}? This cannot be undone.`}onCancel={onCancel}diff --git a/apps/carbon/app/routes/app+/users.employee-types.new.tsx b/apps/carbon/app/routes/x+/users.employee-types.new.tsxsimilarity index 97%rename from apps/carbon/app/routes/app+/users.employee-types.new.tsxrename to apps/carbon/app/routes/x+/users.employee-types.new.tsxindex 1870c5055c..ee203e1ca7 100644--- a/apps/carbon/app/routes/app+/users.employee-types.new.tsx+++ b/apps/carbon/app/routes/x+/users.employee-types.new.tsx@@ -25,7 +25,7 @@ export async function loader({ request }: LoaderArgs) {const features = await getFeatures(client);if (features.error || features.data === null) {return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, error(features.error, "Failed to get features")));}@@ -108,7 +108,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/users/employee-types",+ "/x/users/employee-types",await flash(request, success("Employee type created")));}diff --git a/apps/carbon/app/routes/app+/users.employee-types.tsx b/apps/carbon/app/routes/x+/users.employee-types.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/users.employee-types.tsxrename to apps/carbon/app/routes/x+/users.employee-types.tsxindex a2e918c535..0d19d721c0 100644--- a/apps/carbon/app/routes/app+/users.employee-types.tsx+++ b/apps/carbon/app/routes/x+/users.employee-types.tsx@@ -13,6 +13,7 @@ import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/users.employees.$employeeId.tsx b/apps/carbon/app/routes/x+/users.employees.$employeeId.tsxsimilarity index 82%rename from apps/carbon/app/routes/app+/users.employees.$employeeId.tsxrename to apps/carbon/app/routes/x+/users.employees.$employeeId.tsxindex c0c4931ae2..fd774795d0 100644--- a/apps/carbon/app/routes/app+/users.employees.$employeeId.tsx+++ b/apps/carbon/app/routes/x+/users.employees.$employeeId.tsx@@ -20,39 +20,40 @@ import { error } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const { employeeId } = params;if (!employeeId) throw notFound("EmployeeId was not found");- const [claims, employee] = await Promise.all([+ const [rawClaims, employee] = await Promise.all([getClaims(client, employeeId),getEmployee(client, employeeId),]);- if (claims.error || employee.error || claims.data === null) {+ if (rawClaims.error || employee.error || rawClaims.data === null) {redirect(- "/app/users/employees",+ "/x/users/employees",await flash(request,error(- { claims: claims.error, employee: employee.error },+ { rawClaims: rawClaims.error, employee: employee.error },"Failed to load employee")));}- const permissions = makePermissionsFromClaims(claims?.data);- if (permissions === null) {+ const claims = makePermissionsFromClaims(rawClaims?.data);+ if (claims === null) {redirect(- "/app/users/employees",- await flash(request, error(claims.data, "Failed to parse claims"))+ "/x/users/employees",+ await flash(request, error(null, "Failed to parse claims")));}return json({- permissions,+ permissions: claims?.permissions,employee: employee.data,});}@@ -88,7 +89,7 @@ export async function action({ request }: ActionArgs) {permissions,});- return redirect("/app/users/employees", await flash(request, result));+ return redirect("/x/users/employees", await flash(request, result));}export default function UsersEmployeeRoute() {diff --git a/apps/carbon/app/routes/app+/users.employees.new.tsx b/apps/carbon/app/routes/x+/users.employees.new.tsxsimilarity index 91%rename from apps/carbon/app/routes/app+/users.employees.new.tsxrename to apps/carbon/app/routes/x+/users.employees.new.tsxindex b586be95c6..e35ef3054b 100644--- a/apps/carbon/app/routes/app+/users.employees.new.tsx+++ b/apps/carbon/app/routes/x+/users.employees.new.tsx@@ -13,7 +13,7 @@ import { CreateEmployeeModal } from "~/interfaces/Users/Employees";export async function action({ request }: ActionArgs) {assertIsPost(request);const { client } = await requirePermissions(request, {- view: "users",+ create: "users",});const validation = await createEmployeeValidator.validate(@@ -32,7 +32,7 @@ export async function action({ request }: ActionArgs) {employeeType,});- return redirect("/app/users/employees", await flash(request, result));+ return redirect("/x/users/employees", await flash(request, result));}export default function () {diff --git a/apps/carbon/app/routes/app+/users.employees.tsx b/apps/carbon/app/routes/x+/users.employees.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/users.employees.tsxrename to apps/carbon/app/routes/x+/users.employees.tsxindex 3f407b03bc..872e13b001 100644--- a/apps/carbon/app/routes/app+/users.employees.tsx+++ b/apps/carbon/app/routes/x+/users.employees.tsx@@ -14,6 +14,7 @@ import { getGenericQueryFilters } from "~/utils/query";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/users.groups.$groupId.tsx b/apps/carbon/app/routes/x+/users.groups.$groupId.tsxsimilarity index 94%rename from apps/carbon/app/routes/app+/users.groups.$groupId.tsxrename to apps/carbon/app/routes/x+/users.groups.$groupId.tsxindex 2198e65211..1f85468393 100644--- a/apps/carbon/app/routes/app+/users.groups.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users.groups.$groupId.tsx@@ -18,6 +18,7 @@ import { error, success } from "~/utils/result";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const { groupId } = params;@@ -27,7 +28,7 @@ export async function loader({ request, params }: LoaderArgs) {if (groupWithMembers.error) {redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request,error(groupWithMembers.error, "Failed to load group")@@ -38,7 +39,7 @@ export async function loader({ request, params }: LoaderArgs) {const groupName = groupWithMembers.data?.[0].name;if (!groupName)return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, error(groupWithMembers, "Group not found")));@@ -77,13 +78,13 @@ export async function action({ request }: ActionArgs) {if (updateGroup.error)redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, error(updateGroup.error, "Failed to update group")));if (updateGroupMembers.error)redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request,error(updateGroupMembers.error, "Failed to update group members")@@ -91,7 +92,7 @@ export async function action({ request }: ActionArgs) {);return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, success("Group updated successfully")));}diff --git a/apps/carbon/app/routes/app+/users.groups.delete.$groupId.tsx b/apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsxsimilarity index 89%rename from apps/carbon/app/routes/app+/users.groups.delete.$groupId.tsxrename to apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsxindex d33f51f6f8..f1ad912fc9 100644--- a/apps/carbon/app/routes/app+/users.groups.delete.$groupId.tsx+++ b/apps/carbon/app/routes/x+/users.groups.delete.$groupId.tsx@@ -11,14 +11,16 @@ import { notFound } from "~/utils/http";export async function loader({ request, params }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});+const { groupId } = params;if (!groupId) throw notFound("groupId not found");const group = await getGroup(client, groupId);if (group.error) {return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, error(group.error, "Failed to get group")));}@@ -34,7 +36,7 @@ export async function action({ request, params }: ActionArgs) {const { groupId } = params;if (!groupId) {return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, error(params, "Failed to get an group id")));}@@ -42,13 +44,13 @@ export async function action({ request, params }: ActionArgs) {const { error: deleteGroupError } = await deleteGroup(client, groupId);if (deleteGroupError) {return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, error(deleteGroupError, "Failed to delete group")));}return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, success("Successfully deleted group")));}@@ -60,11 +62,11 @@ export default function DeleteEmployeeTypeRoute() {if (!groupId || !data) return null; // TODO - handle this better (404?)- const onCancel = () => navigate("/app/users/groups");+ const onCancel = () => navigate("/x/users/groups");return (<ConfirmDelete- action={`/app/users/groups/delete/${groupId}`}+ action={`/x/users/groups/delete/${groupId}`}name={data.name}text={`Are you sure you want to delete the group: ${data.name}? This cannot be undone.`}onCancel={onCancel}diff --git a/apps/carbon/app/routes/app+/users.groups.new.tsx b/apps/carbon/app/routes/x+/users.groups.new.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/users.groups.new.tsxrename to apps/carbon/app/routes/x+/users.groups.new.tsxindex 46e0512a07..4017d8f866 100644--- a/apps/carbon/app/routes/app+/users.groups.new.tsx+++ b/apps/carbon/app/routes/x+/users.groups.new.tsx@@ -62,7 +62,7 @@ export async function action({ request }: ActionArgs) {}return redirect(- "/app/users/groups",+ "/x/users/groups",await flash(request, success("Group created")));}diff --git a/apps/carbon/app/routes/app+/users.groups.tsx b/apps/carbon/app/routes/x+/users.groups.tsxsimilarity index 98%rename from apps/carbon/app/routes/app+/users.groups.tsxrename to apps/carbon/app/routes/x+/users.groups.tsxindex 68a66323dc..3669f9b6ec 100644--- a/apps/carbon/app/routes/app+/users.groups.tsx+++ b/apps/carbon/app/routes/x+/users.groups.tsx@@ -14,6 +14,7 @@ import { error } from "~/utils/result";export async function loader({ request }: LoaderArgs) {const { client } = await requirePermissions(request, {view: "users",+ role: "employee",});const url = new URL(request.url);diff --git a/apps/carbon/app/routes/app+/users.index.tsx b/apps/carbon/app/routes/x+/users.index.tsxsimilarity index 71%rename from apps/carbon/app/routes/app+/users.index.tsxrename to apps/carbon/app/routes/x+/users.index.tsxindex 53202c0a83..3882708219 100644--- a/apps/carbon/app/routes/app+/users.index.tsx+++ b/apps/carbon/app/routes/x+/users.index.tsx@@ -3,8 +3,8 @@ import { redirect } from "@remix-run/node";export async function loader({ request }: LoaderArgs) {const url = new URL(request.url);- if (url.pathname === "/app/users") {- return redirect("/app/users/employees");+ if (url.pathname === "/x/users") {+ return redirect("/x/users/employees");}return null;}diff --git a/apps/carbon/app/routes/app+/users.resend-invite.tsx b/apps/carbon/app/routes/x+/users.resend-invite.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/users.resend-invite.tsxrename to apps/carbon/app/routes/x+/users.resend-invite.tsxdiff --git a/apps/carbon/app/routes/app+/users.suppliers.new.tsx b/apps/carbon/app/routes/x+/users.suppliers.new.tsxsimilarity index 83%rename from apps/carbon/app/routes/app+/users.suppliers.new.tsxrename to apps/carbon/app/routes/x+/users.suppliers.new.tsxindex d00ee87bd2..85537b22af 100644--- a/apps/carbon/app/routes/app+/users.suppliers.new.tsx+++ b/apps/carbon/app/routes/x+/users.suppliers.new.tsx@@ -5,7 +5,7 @@ import { requirePermissions } from "~/services/auth";import { flash } from "~/services/session";import {createSupplierAccount,- createSupplierValidator,+ createSupplierAccountValidator,} from "~/services/users";import { assertIsPost } from "~/utils/http";import { CreateSupplierModal } from "~/interfaces/Users/Suppliers";@@ -16,7 +16,7 @@ export async function action({ request }: ActionArgs) {view: "users",});- const validation = await createSupplierValidator.validate(+ const validation = await createSupplierAccountValidator.validate(await request.formData());@@ -30,7 +30,7 @@ export async function action({ request }: ActionArgs) {supplierId: supplier,});- return redirect("/app/users/suppliers", await flash(request, result));+ return redirect("/x/users/suppliers", await flash(request, result));}export default function () {diff --git a/apps/carbon/app/routes/app+/users.suppliers.tsx b/apps/carbon/app/routes/x+/users.suppliers.tsxsimilarity index 100%rename from apps/carbon/app/routes/app+/users.suppliers.tsxrename to apps/carbon/app/routes/x+/users.suppliers.tsxdiff --git a/apps/carbon/app/routes/app+/users.tsx b/apps/carbon/app/routes/x+/users.tsxsimilarity index 86%rename from apps/carbon/app/routes/app+/users.tsxrename to apps/carbon/app/routes/x+/users.tsxindex e31629ef89..105c0d230d 100644--- a/apps/carbon/app/routes/app+/users.tsx+++ b/apps/carbon/app/routes/x+/users.tsx@@ -9,11 +9,11 @@ export const meta: MetaFunction = () => ({});export default function UsersRoute() {- const { links } = useUsersSidebar();+ const { groups } = useUsersSidebar();return (<Grid w="full" h="full" templateColumns="auto 1fr" overflow="auto">- <GroupedContentSidebar links={links} />+ <GroupedContentSidebar groups={groups} /><VStack w="full" h="full" spacing={0}><Outlet /></VStack>diff --git a/apps/carbon/app/routes/app.tsx b/apps/carbon/app/routes/x.tsxsimilarity index 77%rename from apps/carbon/app/routes/app.tsxrename to apps/carbon/app/routes/x.tsxindex af32b93675..a998cc6500 100644--- a/apps/carbon/app/routes/app.tsx+++ b/apps/carbon/app/routes/x.tsx@@ -1,5 +1,5 @@import { useNotification } from "@carbon/react";-import { Box, Grid, GridItem } from "@chakra-ui/react";+import { Flex, Grid, GridItem, VStack } from "@chakra-ui/react";import { SkipNavContent } from "@chakra-ui/skip-nav";import type { LoaderArgs } from "@remix-run/node";import { json } from "@remix-run/node";@@ -7,7 +7,7 @@ import { Outlet, useLoaderData } from "@remix-run/react";import { useEffect } from "react";import { IconSidebar, Topbar } from "~/components/Layout";import { getSupabase, SupabaseProvider } from "~/lib/supabase";-import { getPermissions, getCurrentUser } from "~/services/users";+import { getUserClaims, getCurrentUser } from "~/services/users";import {destroyAuthSession,getSessionFlash,@@ -24,13 +24,13 @@ export async function loader({ request }: LoaderArgs) {const client = getSupabase(accessToken);// parallelize the requests- const [sessionFlash, permissions, user] = await Promise.all([+ const [sessionFlash, claims, user] = await Promise.all([getSessionFlash(request),- getPermissions(request, client),+ getUserClaims(request, client),getCurrentUser(request, client),]);- if (!permissions || !user) {+ if (!claims || !user) {await destroyAuthSession(request);}@@ -43,7 +43,8 @@ export async function loader({ request }: LoaderArgs) {},user,- permissions,+ permissions: claims?.permissions,+ role: claims?.role,result: sessionFlash?.result,},{@@ -52,7 +53,7 @@ export async function loader({ request }: LoaderArgs) {);}-export default function AppRoute() {+export default function AuthenticatedRoute() {const { session, result } = useLoaderData<typeof loader>();const notify = useNotification();@@ -71,10 +72,12 @@ export default function AppRoute() {<GridItem w="full" h="full"><Grid templateColumns="auto 1fr" h="full" w="full"><IconSidebar />- <Box w="full" h="full">+ <Flex w="full" h="full"><SkipNavContent />- <Outlet />- </Box>+ <VStack spacing={0} w="full">+ <Outlet />+ </VStack>+ </Flex></Grid></GridItem></Grid>diff --git a/apps/carbon/app/services/account/account.form.ts b/apps/carbon/app/services/account/account.form.tsindex daa26cbf7e..b217f55f07 100644--- a/apps/carbon/app/services/account/account.form.ts+++ b/apps/carbon/app/services/account/account.form.ts@@ -35,8 +35,8 @@ export const accountPersonalDataValidator = withZod(z.object({}));const attributeDefaults = {type: z.string().min(1, { message: "Type is required" }),- userAttributeId: zfd.numeric(),- userAttributeValueId: zfd.numeric(z.number().optional()),+ userAttributeId: z.string().min(20),+ userAttributeValueId: zfd.text(z.string().optional()),};export const attributeBooleanValidator = withZod(@@ -69,7 +69,7 @@ export const attributeUserValidator = withZod(export const deleteUserAttributeValueValidator = withZod(z.object({- userAttributeId: zfd.numeric(),- userAttributeValueId: zfd.numeric(),+ userAttributeId: z.string().min(20),+ userAttributeValueId: z.string().min(20),}));diff --git a/apps/carbon/app/services/account/account.server.ts b/apps/carbon/app/services/account/account.server.tsindex 5d004b64dd..835d2a7d38 100644--- a/apps/carbon/app/services/account/account.server.ts+++ b/apps/carbon/app/services/account/account.server.ts@@ -5,8 +5,8 @@ export async function deleteUserAttributeValue(client: SupabaseClient<Database>,args: {userId: string;- userAttributeId: number;- userAttributeValueId: number;+ userAttributeId: string;+ userAttributeValueId: string;}) {return client@@ -94,8 +94,8 @@ export async function updatePublicAccount(export async function upsertUserAttributeValue(client: SupabaseClient<Database>,update: {- userAttributeValueId?: number | undefined;- userAttributeId: number;+ userAttributeValueId?: string | undefined;+ userAttributeId: string;value: boolean | string | number;type: string;userId: string;diff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.tsindex 961de87830..517c34fabc 100644--- a/apps/carbon/app/services/auth/auth.server.ts+++ b/apps/carbon/app/services/auth/auth.server.ts@@ -6,9 +6,9 @@ import type {} from "@supabase/supabase-js";import { SERVER_URL } from "~/config/env";import { REFRESH_ACCESS_TOKEN_THRESHOLD } from "~/config/env";-import { getSupabase, getSupabaseAdmin } from "~/lib/supabase";+import { getSupabase, getSupabaseServiceRole } from "~/lib/supabase";import { requireAuthSession, flash, getAuthSession } from "~/services/session";-import { getPermissions } from "~/services/users";+import { getUserClaims } from "~/services/users";import { error } from "~/utils/result";import type { AuthSession } from "./types";@@ -17,7 +17,7 @@ export async function createEmailAuthAccount(password: string,meta?: Record<string, unknown>) {- const { data, error } = await getSupabaseAdmin().auth.admin.createUser({+ const { data, error } = await getSupabaseServiceRole().auth.admin.createUser({email,password,email_confirm: true,@@ -32,7 +32,9 @@ export async function createEmailAuthAccount(}export async function deleteAuthAccount(userId: string) {- const { error } = await getSupabaseAdmin().auth.admin.deleteUser(userId);+ const { error } = await getSupabaseServiceRole().auth.admin.deleteUser(+ userId+ );if (error) return null;@@ -40,7 +42,9 @@ export async function deleteAuthAccount(userId: string) {}export async function getAuthAccountByAccessToken(accessToken: string) {- const { data, error } = await getSupabaseAdmin().auth.getUser(accessToken);+ const { data, error } = await getSupabaseServiceRole().auth.getUser(+ accessToken+ );if (!data.user || error) return null;@@ -76,6 +80,7 @@ export async function requirePermissions(create?: string | string[];update?: string | string[];delete?: string | string[];+ role?: string;}): Promise<{client: SupabaseClient<Database>;@@ -89,17 +94,20 @@ export async function requirePermissions(if (Object.keys(requiredPermissions).length === 0)return { client, email, userId };- const myPermissions = await getPermissions(request, client);+ const myClaims = await getUserClaims(request, client);const hasRequiredPermissions = Object.entries(requiredPermissions).every(([action, permission]) => {if (typeof permission === "string") {- return myPermissions![permission][+ if (action === "role") {+ return myClaims.role === permission;+ }+ return myClaims.permissions![permission][action as "view" | "create" | "update" | "delete"];} else if (Array.isArray(permission)) {return permission.every((p) => {- return !myPermissions![p][+ return myClaims.permissions![p][action as "view" | "create" | "update" | "delete"];});@@ -111,10 +119,10 @@ export async function requirePermissions(if (!hasRequiredPermissions) {throw redirect(- "/app",+ "/x",await flash(request,- error({ myPermissions, requirePermissions }, "Access Denied")+ error({ myClaims, requirePermissions }, "Access Denied")));}@@ -122,62 +130,6 @@ export async function requirePermissions(return { client, email, userId };}-// When we redirect to login from resources (fetched with useFetcher)-// we get a loop, so we have this function that does the same check-// without redirecting -- it just returns null-// TODO: find a better way to do this-export async function requireResourcePermissions(- request: Request,- requiredPermissions: {- view?: string | string[];- create?: string | string[];- update?: string | string[];- delete?: string | string[];- }-): Promise<{- client: SupabaseClient<Database>;- email: string;- userId: string;-} | null> {- const authSession = await getAuthSession(request);- if (!authSession) {- return null;- }-- const { accessToken, email, userId } = authSession;-- const client = getSupabase(accessToken);- // early exit if no requiredPermissions are required- if (Object.keys(requiredPermissions).length === 0)- return { client, email, userId };-- const myPermissions = await getPermissions(request, client);-- const hasRequiredPermissions = Object.entries(requiredPermissions).every(- ([action, permission]) => {- if (typeof permission === "string") {- return myPermissions![permission][- action as "view" | "create" | "update" | "delete"- ];- } else if (Array.isArray(permission)) {- return permission.every((p) => {- return !myPermissions![p][- action as "view" | "create" | "update" | "delete"- ];- });- } else {- return false;- }- }- );-- if (!hasRequiredPermissions) {- return null;- }-- return { client, email, userId };-}-export async function resetPassword(accessToken: string, password: string) {const { error } = await getSupabase(accessToken).auth.updateUser({password,@@ -192,14 +144,14 @@ export async function sendInviteByEmail(email: string,data?: Record<string, unknown>) {- return getSupabaseAdmin().auth.admin.inviteUserByEmail(email, {+ return getSupabaseServiceRole().auth.admin.inviteUserByEmail(email, {redirectTo: `${SERVER_URL}/callback`,data,});}export async function sendMagicLink(email: string) {- return getSupabaseAdmin().auth.signInWithOtp({+ return getSupabaseServiceRole().auth.signInWithOtp({email,options: {emailRedirectTo: `${SERVER_URL}/callback`,@@ -208,10 +160,11 @@ export async function sendMagicLink(email: string) {}export async function signInWithEmail(email: string, password: string) {- const { data, error } = await getSupabaseAdmin().auth.signInWithPassword({- email,- password,- });+ const { data, error } =+ await getSupabaseServiceRole().auth.signInWithPassword({+ email,+ password,+ });if (!data.session || error) return null;@@ -223,7 +176,7 @@ export async function refreshAccessToken(): Promise<AuthSession | null> {if (!refreshToken) return null;- const { data, error } = await getSupabaseAdmin().auth.refreshSession({+ const { data, error } = await getSupabaseServiceRole().auth.refreshSession({refresh_token: refreshToken,});diff --git a/apps/carbon/app/services/people/people.form.ts b/apps/carbon/app/services/people/people.form.tsindex 2f32caabc5..0b7ff86414 100644--- a/apps/carbon/app/services/people/people.form.ts+++ b/apps/carbon/app/services/people/people.form.ts@@ -6,9 +6,9 @@ import { DataType } from "~/interfaces/Users/types";export const attributeValidator = withZod(z.object({- id: zfd.numeric(z.number().optional()),+ id: zfd.text(z.string().optional()),name: z.string().min(1, { message: "Name is required" }),- userAttributeCategoryId: zfd.numeric(),+ userAttributeCategoryId: z.string().min(20),attributeDataTypeId: zfd.numeric(),listOptions: z.string().min(1).array().optional(),canSelfManage: zfd.checkbox(),@@ -29,7 +29,7 @@ export const attributeValidator = withZod(export const attributeCategoryValidator = withZod(z.object({- id: zfd.numeric(z.number().optional()),+ id: zfd.text(z.string().optional()),name: z.string().min(1, { message: "Name is required" }),isPublic: zfd.checkbox(),})diff --git a/apps/carbon/app/services/people/people.server.ts b/apps/carbon/app/services/people/people.server.tsindex 459a58a572..83be55b2fa 100644--- a/apps/carbon/app/services/people/people.server.ts+++ b/apps/carbon/app/services/people/people.server.ts@@ -25,7 +25,7 @@ export async function deleteAttributeCategory(export async function getAttribute(client: SupabaseClient<Database>,- attributeId: number+ attributeId: string) {return client.from("userAttribute")@@ -62,7 +62,7 @@ export async function getAttributeCategories(export async function getAttributeCategory(client: SupabaseClient<Database>,- id: number+ id: string) {return client.from("userAttributeCategory")@@ -91,7 +91,7 @@ export async function insertAttribute(attribute: {name: string;attributeDataTypeId: number;- userAttributeCategoryId: number;+ userAttributeCategoryId: string;listOptions?: string[];canSelfManage: boolean;createdBy: string;@@ -131,7 +131,7 @@ export async function insertAttributeCategory(export async function updateAttribute(client: SupabaseClient<Database>,attribute: {- id?: number;+ id?: string;name: string;listOptions?: string[];canSelfManage: boolean;@@ -153,7 +153,7 @@ export async function updateAttribute(export async function updateAttributeCategory(client: SupabaseClient<Database>,attributeCategory: {- id: number;+ id: string;name: string;public: boolean;updatedBy: string;@@ -166,7 +166,7 @@ export async function updateAttributeCategory(export async function updateAttributeSortOrder(client: SupabaseClient<Database>,updates: {- id: number;+ id: string;sortOrder: number;updatedBy: string;}[]diff --git a/apps/carbon/app/services/purchasing/purchasing.form.ts b/apps/carbon/app/services/purchasing/purchasing.form.tsindex 83f0a689ae..2bd91ec4a1 100644--- a/apps/carbon/app/services/purchasing/purchasing.form.ts+++ b/apps/carbon/app/services/purchasing/purchasing.form.ts@@ -9,7 +9,7 @@ export const supplierValidator = withZod(name: z.string().min(1, { message: "Name is required" }),description: zfd.text(z.string().optional()),supplierTypeId: zfd.text(z.string().optional()),- supplierStatusId: zfd.numeric(z.number().optional()),+ supplierStatusId: zfd.text(z.string().optional()),taxId: zfd.text(z.string().optional()),accountManagerId: zfd.text(z.string().optional()),})@@ -19,13 +19,13 @@ export const supplierContactValidator = withZod(z.object({id: zfd.text(z.string().optional()),...contact,- supplierLocationId: zfd.numeric(z.number().optional()),+ supplierLocationId: zfd.text(z.string().optional()),}));export const supplierLocationValidator = withZod(z.object({- id: zfd.numeric(z.number().optional()),+ id: zfd.text(z.string().optional()),...address,}));diff --git a/apps/carbon/app/services/purchasing/purchasing.server.ts b/apps/carbon/app/services/purchasing/purchasing.server.tsindex d74c67432d..8ff0f9f204 100644--- a/apps/carbon/app/services/purchasing/purchasing.server.ts+++ b/apps/carbon/app/services/purchasing/purchasing.server.ts@@ -1,5 +1,6 @@import type { Database } from "@carbon/database";import type { SupabaseClient } from "@supabase/supabase-js";+import { getSupabaseServiceRole } from "~/lib/supabase";import type { GenericQueryFilters } from "~/utils/query";import { setGenericQueryFilters } from "~/utils/query";@@ -18,7 +19,7 @@ export async function deleteSupplierContact(export async function deleteSupplierLocation(client: SupabaseClient<Database>,supplierId: string,- supplierLocationId: number+ supplierLocationId: string) {return client.from("supplierLocation")@@ -107,7 +108,7 @@ export async function getSuppliers(}if (args.status) {- query = query.eq("supplierStatusId", Number(args.status));+ query = query.eq("supplierStatusId", args.status);}query = setGenericQueryFilters(query, args, "name");@@ -172,7 +173,7 @@ export async function insertSupplier(supplier: {name: string;supplierTypeId?: string;- supplierStatusId?: number;+ supplierStatusId?: string;taxId?: string;accountManagerId?: string;description?: string;@@ -206,7 +207,9 @@ export async function insertSupplierContact(};}) {- const insertContact = await client+ // Need to use service role here because it violates RLS+ // to select a contact that does not belong to any supplier+ const insertContact = await getSupabaseServiceRole().from("contact").insert([supplierContact.contact]).select("id");@@ -274,7 +277,7 @@ export async function updateSupplier(id: string;name: string;supplierTypeId?: string;- supplierStatusId?: number;+ supplierStatusId?: string;taxId?: string;accountManagerId?: string;description?: string;@@ -322,7 +325,7 @@ export async function updateSupplierContact(export async function updateSupplierLocation(client: SupabaseClient<Database>,supplierLocation: {- addressId: number;+ addressId: string;address: {addressLine1?: string;addressLine2?: string;diff --git a/apps/carbon/app/services/sales/sales.form.ts b/apps/carbon/app/services/sales/sales.form.tsindex 7bc988f25b..9b74eeef14 100644--- a/apps/carbon/app/services/sales/sales.form.ts+++ b/apps/carbon/app/services/sales/sales.form.ts@@ -9,7 +9,7 @@ export const customerValidator = withZod(name: z.string().min(1, { message: "Name is required" }),description: zfd.text(z.string().optional()),customerTypeId: zfd.text(z.string().optional()),- customerStatusId: zfd.numeric(z.number().optional()),+ customerStatusId: zfd.text(z.string().optional()),taxId: zfd.text(z.string().optional()),accountManagerId: zfd.text(z.string().optional()),})@@ -19,13 +19,13 @@ export const customerContactValidator = withZod(z.object({id: zfd.text(z.string().optional()),...contact,- customerLocationId: zfd.numeric(z.number().optional()),+ customerLocationId: zfd.text(z.string().optional()),}));export const customerLocationValidator = withZod(z.object({- id: zfd.numeric(z.number().optional()),+ id: zfd.text(z.string().optional()),...address,}));diff --git a/apps/carbon/app/services/sales/sales.server.ts b/apps/carbon/app/services/sales/sales.server.tsindex 39ed580301..b3ec82f00a 100644--- a/apps/carbon/app/services/sales/sales.server.ts+++ b/apps/carbon/app/services/sales/sales.server.ts@@ -1,5 +1,6 @@import type { Database } from "@carbon/database";import type { SupabaseClient } from "@supabase/supabase-js";+import { getSupabaseServiceRole } from "~/lib/supabase";import type { GenericQueryFilters } from "~/utils/query";import { setGenericQueryFilters } from "~/utils/query";@@ -18,7 +19,7 @@ export async function deleteCustomerContact(export async function deleteCustomerLocation(client: SupabaseClient<Database>,customerId: string,- customerLocationId: number+ customerLocationId: string) {return client.from("customerLocation")@@ -107,7 +108,7 @@ export async function getCustomers(}if (args.status) {- query = query.eq("customerStatusId", Number(args.status));+ query = query.eq("customerStatusId", args.status);}query = setGenericQueryFilters(query, args, "name");@@ -172,7 +173,7 @@ export async function insertCustomer(customer: {name: string;customerTypeId?: string;- customerStatusId?: number;+ customerStatusId?: string;taxId?: string;accountManagerId?: string;description?: string;@@ -206,7 +207,9 @@ export async function insertCustomerContact(};}) {- const insertContact = await client+ // Need to use service role here because it violates RLS+ // to select a contact that does not belong to any supplier+ const insertContact = await getSupabaseServiceRole().from("contact").insert([customerContact.contact]).select("id");@@ -274,7 +277,7 @@ export async function updateCustomer(id: string;name: string;customerTypeId?: string;- customerStatusId?: number;+ customerStatusId?: string;taxId?: string;accountManagerId?: string;description?: string;@@ -322,7 +325,7 @@ export async function updateCustomerContact(export async function updateCustomerLocation(client: SupabaseClient<Database>,customerLocation: {- addressId: number;+ addressId: string;address: {addressLine1?: string;addressLine2?: string;diff --git a/apps/carbon/app/services/users/users.form.ts b/apps/carbon/app/services/users/users.form.tsindex 8574757faf..96a5a88aa8 100644--- a/apps/carbon/app/services/users/users.form.ts+++ b/apps/carbon/app/services/users/users.form.ts@@ -14,9 +14,9 @@ export const bulkPermissionsValidator = withZod(}));-export const createCustomerValidator = withZod(+export const createCustomerAccountValidator = withZod(z.object({- id: z.string().min(36, "Customer contact is required"),+ id: z.string().min(20, "Customer contact is required"),customer: z.string().min(36, { message: "Customer is required" }),}));@@ -29,13 +29,13 @@ export const createEmployeeValidator = withZod(.email("Must be a valid email"),firstName: z.string().min(1, { message: "First name is required" }),lastName: z.string().min(1, { message: "Last name is required" }),- employeeType: z.string().min(36, { message: "Employee type is required" }),+ employeeType: z.string().min(20, { message: "Employee type is required" }),}));-export const createSupplierValidator = withZod(+export const createSupplierAccountValidator = withZod(z.object({- id: z.string().min(36, "Supplier contact is required"),+ id: z.string().min(20, "Supplier contact is required"),supplier: z.string().min(36, { message: "Supplier is required" }),}));@@ -76,7 +76,7 @@ export const employeeTypePermissionsValidator = z.array(export const employeeValidator = withZod(z.object({id: z.string(),- employeeType: z.string().min(36, { message: "Employee type is required" }),+ employeeType: z.string().min(20, { message: "Employee type is required" }),data: z.string().startsWith("{", { message: "Invalid JSON" })diff --git a/apps/carbon/app/services/users/users.server.ts b/apps/carbon/app/services/users/users.server.tsindex 8924966062..bf9821ffd9 100644--- a/apps/carbon/app/services/users/users.server.ts+++ b/apps/carbon/app/services/users/users.server.ts@@ -2,7 +2,7 @@ import type { Database, Json } from "@carbon/database";import { redis } from "@carbon/redis";import { redirect } from "@remix-run/node";import type { SupabaseClient } from "@supabase/supabase-js";-import { getSupabaseAdmin } from "~/lib/supabase";+import { getSupabaseServiceRole } from "~/lib/supabase";import type {EmployeeRow,EmployeeTypePermission,@@ -10,7 +10,11 @@ import type {Permission,User,} from "~/interfaces/Users/types";-import { deleteAuthAccount, sendInviteByEmail } from "~/services/auth";+import {+ deleteAuthAccount,+ sendInviteByEmail,+ sendMagicLink,+} from "~/services/auth";import { getSupplierContact } from "~/services/purchasing";import { getCustomerContact } from "~/services/sales";import { requireAuthSession, flash } from "~/services/session";@@ -192,7 +196,7 @@ export async function createSupplierAccount(const claims = makeSupplierClaims();const claimsUpdate = await setUserClaims(userId, {- role: "customer",+ role: "supplier",...claims,});if (claimsUpdate.error) {@@ -295,7 +299,7 @@ export async function getCurrentUser(const user = await getUserById(client, userId);if (user?.error || user?.data === null) {throw redirect(- "/app",+ "/x",await flash(request, error(user.error, "Failed to get user")));}@@ -457,49 +461,6 @@ function getPermissionCacheKey(userId: string) {return `permissions:${userId}`;}-export async function getPermissions(- request: Request,- client: SupabaseClient<Database>-) {- const { userId } = await requireAuthSession(request);-- let permissions: Record<string, Permission> | null = null;-- try {- permissions = JSON.parse(- (await redis.get(getPermissionCacheKey(userId))) || "null"- );- } finally {- // if we don't have permissions from redis, get them from the database- if (!permissions) {- const claims = await getClaims(client, userId);- if (claims.error || claims.data === null) {- throw redirect(- "/app",- await flash(request, error(claims.error, "Failed to get claims"))- );- }- // convert claims to permissions- permissions = makePermissionsFromClaims(claims.data);- // store permissions in redis-- await redis.set(- getPermissionCacheKey(userId),- JSON.stringify(permissions)- );-- if (!permissions) {- throw redirect(- "/app",- await flash(request, error(claims, "Failed to parse claims"))- );- }- }-- return permissions;- }-}-export async function getSuppliers(client: SupabaseClient<Database>,args: GenericQueryFilters & {@@ -543,13 +504,59 @@ export async function getUserById(}export async function getUserByEmail(email: string) {- return getSupabaseAdmin()+ return getSupabaseServiceRole().from("user").select("*").eq("email", email).single();}+export async function getUserClaims(+ request: Request,+ client: SupabaseClient<Database>+) {+ const { userId } = await requireAuthSession(request);++ let claims: {+ permissions: Record<string, Permission>;+ role: string | null;+ } | null = null;++ try {+ claims = JSON.parse(+ (await redis.get(getPermissionCacheKey(userId))) || "null"+ );+ } finally {+ // if we don't have permissions from redis, get them from the database+ if (!claims) {+ const rawClaims = await getClaims(client, userId);+ if (rawClaims.error || rawClaims.data === null) {+ throw redirect(+ "/x",+ await flash(+ request,+ error(rawClaims.error, "Failed to get rawClaims")+ )+ );+ }+ // convert rawClaims to permissions+ claims = makePermissionsFromClaims(rawClaims.data);++ // store claims in redis+ await redis.set(getPermissionCacheKey(userId), JSON.stringify(claims));++ if (!claims) {+ throw redirect(+ "/x",+ await flash(request, error(rawClaims, "Failed to parse claims"))+ );+ }+ }++ return claims;+ }+}+export async function getUsers(client: SupabaseClient<Database>) {return client.from("user")@@ -685,6 +692,7 @@ export function makeEmptyPermissionsFromFeatures(data: Feature[]) {export function makePermissionsFromClaims(claims: Json[] | null) {if (typeof claims !== "object" || claims === null) return null;let permissions: Record<string, Permission> = {};+ let role: string | null = null;Object.entries(claims).forEach(([key, value]) => {if (isClaimPermission(key, value)) {@@ -700,18 +708,26 @@ export function makePermissionsFromClaims(claims: Json[] | null) {switch (action) {case "view":- permissions[module].view = value as boolean;+ permissions[module]["view"] = value as boolean;+ break;case "create":- permissions[module].create = value as boolean;+ permissions[module]["create"] = value as boolean;+ break;case "update":- permissions[module].update = value as boolean;+ permissions[module]["update"] = value as boolean;+ break;case "delete":- permissions[module].delete = value as boolean;+ permissions[module]["delete"] = value as boolean;+ break;}}});- return permissions;+ if ("role" in claims) {+ role = claims["role"] as string;+ }++ return { permissions, role };}export function makePermissionsFromEmployeeType(@@ -765,7 +781,7 @@ export async function resendInvite(return error(user.error, "Failed to get user");}- const invite = await sendInviteByEmail(user.data.email);+ const invite = await sendMagicLink(user.data.email);if (invite.error) {return error(invite.error, "Failed to send invite");}@@ -774,7 +790,7 @@ export async function resendInvite(}export async function resetPassword(userId: string, password: string) {- return getSupabaseAdmin().auth.admin.updateUserById(userId, {+ return getSupabaseServiceRole().auth.admin.updateUserById(userId, {password,});}@@ -783,7 +799,7 @@ async function setUserClaims(userId: string,claims: Record<string, boolean | string>) {- return getSupabaseAdmin().auth.admin.updateUserById(userId, {+ return getSupabaseServiceRole().auth.admin.updateUserById(userId, {app_metadata: claims,});}diff --git a/apps/carbon/app/styles/background.css b/apps/carbon/app/styles/background.cssnew file mode 100644index 0000000000..c73eec8210--- /dev/null+++ b/apps/carbon/app/styles/background.css@@ -0,0 +1,74 @@+/* Credit: https://cmdk.paco.me/ */++.background {+ width: 100vw;+ min-height: 100vh;+ position: fixed;+ display: flex;+ justify-content: center;+ padding: 120px 24px 160px 24px;+ pointer-events: none;+}++.background:before {+ background: radial-gradient(circle, rgba(2, 0, 36, 0) 0, #fafafa 100%);+ position: absolute;+ content: "";+ z-index: 2;+ width: 100%;+ height: 100%;+ top: 0;+}++[data-theme="dark"] .background:before {+ background: radial-gradient(circle, rgba(2, 0, 36, 0) 0, #161616 100%);+ position: absolute;+ content: "";+ z-index: 2;+ width: 100%;+ height: 100%;+ top: 0;+}++.background:after {+ content: "";+ background-image: url("/static/grid.svg");+ z-index: 1;+ position: absolute;+ width: 100%;+ height: 100%;+ top: 0;+ opacity: 0.4;+ filter: invert(1);+}++.gradient {+ height: fit-content;+ z-index: 3;+ width: 100%;+ max-width: 640px;+ background-image: radial-gradient(+ at 27% 37%,+ hsla(215, 98%, 61%, 1) 0px,+ transparent 0%+ ),+ radial-gradient(at 97% 21%, hsla(125, 60%, 72%, 1) 0px, transparent 55%),+ radial-gradient(at 52% 99%, hsla(354, 40%, 61%, 1) 0px, transparent 55%),+ radial-gradient(at 10% 29%, hsla(256, 50%, 67%, 1) 0px, transparent 55%),+ radial-gradient(at 97% 96%, hsla(38, 40%, 74%, 1) 0px, transparent 55%),+ radial-gradient(at 33% 50%, hsla(222, 60%, 73%, 1) 0px, transparent 55%),+ radial-gradient(at 79% 53%, hsla(343, 20%, 79%, 1) 0px, transparent 55%);+ position: absolute;+ content: "";+ width: 100%;+ height: 100%;+ filter: blur(100px) saturate(150%);+ top: 80px;+ opacity: 0.15;+}++@media screen and (max-width: 640px) {+ .content {+ display: none;+ }+}diff --git a/apps/carbon/app/types/index.ts b/apps/carbon/app/types/index.tsindex cbe182edde..49201fb6d4 100644--- a/apps/carbon/app/types/index.ts+++ b/apps/carbon/app/types/index.ts@@ -4,8 +4,14 @@ import type { ReactElement } from "react";import type { ValidationErrorResponseData } from "remix-validated-form";export type Authenticated<T> = T & {+ role?: Role;permission?: string;- action?: "view" | "create" | "update" | "delete";+};++export type AuthenticatedRouteGroup = {+ name: string;+ icon?: any;+ routes: Authenticated<Route>[];};export type FormActionData = Promise<@@ -21,12 +27,20 @@ export type Result = {message?: string;};+export type Role = "employee" | "customer" | "supplier";+export type Route = {name: string;to: string;icon?: any;};+export type RouteGroup = {+ name: string;+ icon?: any;+ routes: Route[];+};+export interface SelectOption extends OptionBase {label: string;value: string;diff --git a/apps/carbon/app/types/validators.ts b/apps/carbon/app/types/validators.tsindex a16cd2a335..1ec0703868 100644--- a/apps/carbon/app/types/validators.ts+++ b/apps/carbon/app/types/validators.ts@@ -2,7 +2,7 @@ import { z } from "zod";import { zfd } from "zod-form-data";export const address = {- addressId: zfd.numeric(z.number().optional()),+ addressId: zfd.text(z.string().optional()),addressLine1: zfd.text(z.string().optional()),addressLine2: zfd.text(z.string().optional()),city: zfd.text(z.string().optional()),diff --git a/apps/carbon/app/utils/http.ts b/apps/carbon/app/utils/http.tsindex e700411d9a..33e2299dea 100644--- a/apps/carbon/app/utils/http.ts+++ b/apps/carbon/app/utils/http.ts@@ -5,11 +5,11 @@ export function getCurrentPath(request: Request) {export function makeRedirectToFromHere(request: Request) {const currentPath = getCurrentPath(request);return new URLSearchParams([- ["redirectTo", currentPath.includes("resource") ? "/app" : currentPath],+ ["redirectTo", currentPath.includes("resource") ? "/x" : currentPath],]);}-export function getRedirectTo(request: Request, defaultRedirectTo = "/app") {+export function getRedirectTo(request: Request, defaultRedirectTo = "/x") {const url = new URL(request.url);return safeRedirect(url.searchParams.get("redirectTo"), defaultRedirectTo);}@@ -75,7 +75,7 @@ export function assertIsDelete(*/export function safeRedirect(to: FormDataEntryValue | string | null | undefined,- defaultRedirect = "/app"+ defaultRedirect = "/x") {if (!to ||diff --git a/apps/carbon/package.json b/apps/carbon/package.jsonindex 34bb7365da..0e80e97832 100644--- a/apps/carbon/package.json+++ b/apps/carbon/package.json@@ -21,12 +21,12 @@"@emotion/server": "^11.10.0","@emotion/styled": "^11.10.4","@internationalized/date": "^3.0.2",- "@remix-run/eslint-config": "^1.11.1",- "@remix-run/node": "^1.11.1",- "@remix-run/react": "^1.11.1",- "@remix-run/vercel": "^1.11.1",+ "@remix-run/eslint-config": "1.9.0",+ "@remix-run/node": "1.9.0",+ "@remix-run/react": "1.9.0",+ "@remix-run/vercel": "1.9.0","@remix-validated-form/with-zod": "^2.0.5",- "@supabase/supabase-js": "^2.4.1",+ "@supabase/supabase-js": "^2.2.1","@tanstack/react-table": "^8.7.3","@vercel/node": "^2.8.0","bullmq": "~3.5.1",@@ -46,8 +46,8 @@},"devDependencies": {"@carbon/tsconfig": "*",- "@remix-run/dev": "^1.11.1",- "@remix-run/serve": "^1.11.1",+ "@remix-run/dev": "1.9.0",+ "@remix-run/serve": "1.9.0","@types/react": "^18.0.21","@types/react-dom": "^18.0.6","typescript": "^4.9.3"diff --git a/apps/carbon/public/android-chrome-192x192.png b/apps/carbon/public/android-chrome-192x192.pngnew file mode 100644index 0000000000..777cc381efBinary files /dev/null and b/apps/carbon/public/android-chrome-192x192.png differdiff --git a/apps/carbon/public/android-chrome-512x512.png b/apps/carbon/public/android-chrome-512x512.pngnew file mode 100644index 0000000000..bd3fb48e59Binary files /dev/null and b/apps/carbon/public/android-chrome-512x512.png differdiff --git a/apps/carbon/public/apple-touch-icon.png b/apps/carbon/public/apple-touch-icon.pngnew file mode 100644index 0000000000..4f8712f2c1Binary files /dev/null and b/apps/carbon/public/apple-touch-icon.png differdiff --git a/apps/carbon/public/carbon-logo-dark.png b/apps/carbon/public/carbon-logo-dark.pngnew file mode 100644index 0000000000..75399c8d11Binary files /dev/null and b/apps/carbon/public/carbon-logo-dark.png differdiff --git a/apps/carbon/public/carbon-logo-light.png b/apps/carbon/public/carbon-logo-light.pngnew file mode 100644index 0000000000..c0f93e6fe2Binary files /dev/null and b/apps/carbon/public/carbon-logo-light.png differdiff --git a/apps/carbon/public/favicon-16x16.png b/apps/carbon/public/favicon-16x16.pngnew file mode 100644index 0000000000..eb216e453fBinary files /dev/null and b/apps/carbon/public/favicon-16x16.png differdiff --git a/apps/carbon/public/favicon-32x32.png b/apps/carbon/public/favicon-32x32.pngnew file mode 100644index 0000000000..a7064d2122Binary files /dev/null and b/apps/carbon/public/favicon-32x32.png differdiff --git a/apps/carbon/public/favicon.ico b/apps/carbon/public/favicon.icoindex 8830cf6821..ce92de6710 100644Binary files a/apps/carbon/public/favicon.ico and b/apps/carbon/public/favicon.ico differdiff --git a/apps/carbon/public/logo-dark.png b/apps/carbon/public/logo-dark.pngdeleted file mode 100644index eaac87c93b..0000000000Binary files a/apps/carbon/public/logo-dark.png and /dev/null differdiff --git a/apps/carbon/public/logo-light.png b/apps/carbon/public/logo-light.pngdeleted file mode 100644index 5ca81faf2f..0000000000Binary files a/apps/carbon/public/logo-light.png and /dev/null differdiff --git a/apps/carbon/public/site.webmanifest b/apps/carbon/public/site.webmanifestnew file mode 100644index 0000000000..4e209ea8a1--- /dev/null+++ b/apps/carbon/public/site.webmanifest@@ -0,0 +1,19 @@+{+ "name": "Carbon",+ "short_name": "Carbon",+ "icons": [+ {+ "src": "/android-chrome-192x192.png",+ "sizes": "192x192",+ "type": "image/png"+ },+ {+ "src": "/android-chrome-512x512.png",+ "sizes": "512x512",+ "type": "image/png"+ }+ ],+ "theme_color": "#ffffff",+ "background_color": "#ffffff",+ "display": "standalone"+}diff --git a/apps/carbon/public/static/grid.svg b/apps/carbon/public/static/grid.svgnew file mode 100644index 0000000000..76e3b29f0d--- /dev/null+++ b/apps/carbon/public/static/grid.svg@@ -0,0 +1,5 @@++<svg id="download" xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">+ <path id="Path_3" data-name="Path 3" d="M96,95h4v1H96v4H95V96H86v4H85V96H76v4H75V96H66v4H65V96H56v4H55V96H46v4H45V96H36v4H35V96H26v4H25V96H16v4H15V96H0V95H15V86H0V85H15V76H0V75H15V66H0V65H15V56H0V55H15V46H0V45H15V36H0V35H15V26H0V25H15V16H0V15H15V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h9V0h1V15h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96v9h4v1H96Zm-1,0V86H86v9ZM85,95V86H76v9ZM75,95V86H66v9ZM65,95V86H56v9ZM55,95V86H46v9ZM45,95V86H36v9ZM35,95V86H26v9ZM25,95V86H16v9ZM16,85h9V76H16Zm10,0h9V76H26Zm10,0h9V76H36Zm10,0h9V76H46Zm10,0h9V76H56Zm10,0h9V76H66Zm10,0h9V76H76Zm10,0h9V76H86Zm9-10V66H86v9ZM85,75V66H76v9ZM75,75V66H66v9ZM65,75V66H56v9ZM55,75V66H46v9ZM45,75V66H36v9ZM35,75V66H26v9ZM25,75V66H16v9ZM16,65h9V56H16Zm10,0h9V56H26Zm10,0h9V56H36Zm10,0h9V56H46Zm10,0h9V56H56Zm10,0h9V56H66Zm10,0h9V56H76Zm10,0h9V56H86Zm9-10V46H86v9ZM85,55V46H76v9ZM75,55V46H66v9ZM65,55V46H56v9ZM55,55V46H46v9ZM45,55V46H36v9ZM35,55V46H26v9ZM25,55V46H16v9ZM16,45h9V36H16Zm10,0h9V36H26Zm10,0h9V36H36Zm10,0h9V36H46Zm10,0h9V36H56Zm10,0h9V36H66Zm10,0h9V36H76Zm10,0h9V36H86Zm9-10V26H86v9ZM85,35V26H76v9ZM75,35V26H66v9ZM65,35V26H56v9ZM55,35V26H46v9ZM45,35V26H36v9ZM35,35V26H26v9ZM25,35V26H16v9ZM16,25h9V16H16Zm10,0h9V16H26Zm10,0h9V16H36Zm10,0h9V16H46Zm10,0h9V16H56Zm10,0h9V16H66Zm10,0h9V16H76Zm10,0h9V16H86Z" fill="rgba(255,255,255,0.1)" fill-rule="evenodd" opacity="0.5"/>+ <path id="Path_4" data-name="Path 4" d="M6,5V0H5V5H0V6H5v94H6V6h94V5Z" fill="rgba(255,255,255,0.1)" fill-rule="evenodd"/>+</svg>diff --git a/packages/carbon-database/src/seed/admin.ts b/packages/carbon-database/src/seed/admin.tsindex cbccc1409c..f7234e89f1 100644--- a/packages/carbon-database/src/seed/admin.ts+++ b/packages/carbon-database/src/seed/admin.ts@@ -7,7 +7,9 @@ const admin = {lastName: "Admin",};-const claims: Record<string, boolean> = {};+const claims: Record<string, boolean | string> = {+ role: "employee",+};possibleFeatures.forEach((name) => {const moduleName = name.toLowerCase();diff --git a/packages/carbon-database/src/types.ts b/packages/carbon-database/src/types.tsindex 31381bac58..15f35f9e90 100644--- a/packages/carbon-database/src/types.ts+++ b/packages/carbon-database/src/types.ts@@ -11,7 +11,7 @@ export interface Database {Tables: {address: {Row: {- id: number+ id: stringaddressLine1: string | nulladdressLine2: string | nullcity: string | null@@ -22,7 +22,7 @@ export interface Database {fax: string | null}Insert: {- id?: number+ id?: stringaddressLine1?: string | nulladdressLine2?: string | nullcity?: string | null@@ -33,7 +33,7 @@ export interface Database {fax?: string | null}Update: {- id?: number+ id?: stringaddressLine1?: string | nulladdressLine2?: string | nullcity?: string | null@@ -158,7 +158,7 @@ export interface Database {name: stringdescription: string | nullcustomerTypeId: string | null- customerStatusId: number | null+ customerStatusId: string | nulltaxId: string | nullaccountManagerId: string | nulllogo: string | null@@ -172,7 +172,7 @@ export interface Database {name: stringdescription?: string | nullcustomerTypeId?: string | null- customerStatusId?: number | null+ customerStatusId?: string | nulltaxId?: string | nullaccountManagerId?: string | nulllogo?: string | null@@ -186,7 +186,7 @@ export interface Database {name?: stringdescription?: string | nullcustomerTypeId?: string | null- customerStatusId?: number | null+ customerStatusId?: string | nulltaxId?: string | nullaccountManagerId?: string | nulllogo?: string | null@@ -215,56 +215,56 @@ export interface Database {id: stringcustomerId: stringcontactId: string- customerLocationId: number | null+ customerLocationId: string | nulluserId: string | null}Insert: {id?: stringcustomerId: stringcontactId: string- customerLocationId?: number | null+ customerLocationId?: string | nulluserId?: string | null}Update: {id?: stringcustomerId?: stringcontactId?: string- customerLocationId?: number | null+ customerLocationId?: string | nulluserId?: string | null}}customerLocation: {Row: {- id: number+ id: stringcustomerId: string- addressId: number+ addressId: string}Insert: {- id?: number+ id?: stringcustomerId: string- addressId: number+ addressId: string}Update: {- id?: number+ id?: stringcustomerId?: string- addressId?: number+ addressId?: string}}customerStatus: {Row: {- id: number+ id: stringname: stringcreatedAt: stringupdatedAt: string | null}Insert: {- id?: number+ id?: stringname: stringcreatedAt?: stringupdatedAt?: string | null}Update: {- id?: number+ id?: stringname?: stringcreatedAt?: stringupdatedAt?: string | null@@ -481,7 +481,7 @@ export interface Database {name: stringdescription: string | nullsupplierTypeId: string | null- supplierStatusId: number | null+ supplierStatusId: string | nulltaxId: string | nullaccountManagerId: string | nulllogo: string | null@@ -495,7 +495,7 @@ export interface Database {name: stringdescription?: string | nullsupplierTypeId?: string | null- supplierStatusId?: number | null+ supplierStatusId?: string | nulltaxId?: string | nullaccountManagerId?: string | nulllogo?: string | null@@ -509,7 +509,7 @@ export interface Database {name?: stringdescription?: string | nullsupplierTypeId?: string | null- supplierStatusId?: number | null+ supplierStatusId?: string | nulltaxId?: string | nullaccountManagerId?: string | nulllogo?: string | null@@ -538,56 +538,56 @@ export interface Database {id: stringsupplierId: stringcontactId: string- supplierLocationId: number | null+ supplierLocationId: string | nulluserId: string | null}Insert: {id?: stringsupplierId: stringcontactId: string- supplierLocationId?: number | null+ supplierLocationId?: string | nulluserId?: string | null}Update: {id?: stringsupplierId?: stringcontactId?: string- supplierLocationId?: number | null+ supplierLocationId?: string | nulluserId?: string | null}}supplierLocation: {Row: {- id: number+ id: stringsupplierId: string- addressId: number+ addressId: string}Insert: {- id?: number+ id?: stringsupplierId: string- addressId: number+ addressId: string}Update: {- id?: number+ id?: stringsupplierId?: string- addressId?: number+ addressId?: string}}supplierStatus: {Row: {- id: number+ id: stringname: stringcreatedAt: stringupdatedAt: string | null}Insert: {- id?: number+ id?: stringname: stringcreatedAt?: stringupdatedAt?: string | null}Update: {- id?: number+ id?: stringname?: stringcreatedAt?: stringupdatedAt?: string | null@@ -662,10 +662,10 @@ export interface Database {}userAttribute: {Row: {- id: number+ id: stringname: stringsortOrder: number- userAttributeCategoryId: number+ userAttributeCategoryId: stringattributeDataTypeId: numberlistOptions: string[] | nullcanSelfManage: boolean | null@@ -676,10 +676,10 @@ export interface Database {updatedBy: string | null}Insert: {- id?: number+ id?: stringname: stringsortOrder?: number- userAttributeCategoryId: number+ userAttributeCategoryId: stringattributeDataTypeId: numberlistOptions?: string[] | nullcanSelfManage?: boolean | null@@ -690,10 +690,10 @@ export interface Database {updatedBy?: string | null}Update: {- id?: number+ id?: stringname?: stringsortOrder?: number- userAttributeCategoryId?: number+ userAttributeCategoryId?: stringattributeDataTypeId?: numberlistOptions?: string[] | nullcanSelfManage?: boolean | null@@ -706,7 +706,7 @@ export interface Database {}userAttributeCategory: {Row: {- id: number+ id: stringname: stringpublic: boolean | nullprotected: boolean | null@@ -717,7 +717,7 @@ export interface Database {updatedBy: string | null}Insert: {- id?: number+ id?: stringname: stringpublic?: boolean | nullprotected?: boolean | null@@ -728,7 +728,7 @@ export interface Database {updatedBy?: string | null}Update: {- id?: number+ id?: stringname?: stringpublic?: boolean | nullprotected?: boolean | null@@ -741,8 +741,8 @@ export interface Database {}userAttributeValue: {Row: {- id: number- userAttributeId: number+ id: string+ userAttributeId: stringuserId: stringvalueBoolean: boolean | nullvalueDate: string | null@@ -755,8 +755,8 @@ export interface Database {updatedBy: string | null}Insert: {- id?: number- userAttributeId: number+ id?: string+ userAttributeId: stringuserId: stringvalueBoolean?: boolean | nullvalueDate?: string | null@@ -769,8 +769,8 @@ export interface Database {updatedBy?: string | null}Update: {- id?: number- userAttributeId?: number+ id?: string+ userAttributeId?: stringuserId?: stringvalueBoolean?: boolean | nullvalueDate?: string | nulldiff --git a/packages/carbon-database/supabase/migrations/20230123004316_users.sql b/packages/carbon-database/supabase/migrations/20230123004316_users.sqlindex 06a495702c..9eb17a597f 100644--- a/packages/carbon-database/supabase/migrations/20230123004316_users.sql+++ b/packages/carbon-database/supabase/migrations/20230123004316_users.sql@@ -21,4 +21,4 @@ ALTER TABLE "user" ENABLE ROW LEVEL SECURITY;CREATE POLICY "Claims admin can view/modify users" ON "user" FOR ALL USING (is_claims_admin());CREATE POLICY "Users can modify themselves" ON "user" FOR UPDATE WITH CHECK (auth.uid() = id::uuid);-CREATE POLICY "Anyone that's authenticated can view users" ON "user" FOR SELECT USING (auth.role() = 'authenticated');\ No newline at end of file+CREATE POLICY "Anyone that's authenticated can view users" ON "user" FOR SELECT USING (auth.role() = 'authenticated');diff --git a/packages/carbon-database/supabase/migrations/20230123004514_buckets.sql b/packages/carbon-database/supabase/migrations/20230123004514_buckets.sqlindex aa09a17589..fb99ff265c 100644--- a/packages/carbon-database/supabase/migrations/20230123004514_buckets.sql+++ b/packages/carbon-database/supabase/migrations/20230123004514_buckets.sql@@ -13,20 +13,20 @@ CREATE POLICY "Users can delete their own avatars"ON storage.objects FOR DELETE USING (bucket_id = 'avatars'and (auth.role() = 'authenticated')- and storage.filename(name) like concat(auth.uid()::text, '%')+ and storage.filename(name) LIKE concat(auth.uid()::text, '%'));CREATE POLICY "Users can update their own avatars"ON storage.objects FOR UPDATE USING (bucket_id = 'avatars'and (auth.role() = 'authenticated')- and storage.filename(name) like concat(auth.uid()::text, '%')+ and storage.filename(name) LIKE concat(auth.uid()::text, '%'));CREATE POLICY "Users can insert their own avatars"-ON storage.objects FOR INSERT with check (+ON storage.objects FOR INSERT WITH CHECK (bucket_id = 'avatars'and (auth.role() = 'authenticated')- and storage.filename(name) like concat(auth.uid()::text, '%')+ and storage.filename(name) LIKE concat(auth.uid()::text, '%'));diff --git a/packages/carbon-database/supabase/migrations/20230123004536_attributes.sql b/packages/carbon-database/supabase/migrations/20230123004536_attributes.sqlindex b50ba51833..41537b18ef 100644--- a/packages/carbon-database/supabase/migrations/20230123004536_attributes.sql+++ b/packages/carbon-database/supabase/migrations/20230123004536_attributes.sql@@ -1,6 +1,6 @@CREATE TABLE "userAttributeCategory" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"name" TEXT NOT NULL,"public" BOOLEAN DEFAULT FALSE,"protected" BOOLEAN DEFAULT FALSE,@@ -10,6 +10,7 @@ CREATE TABLE "userAttributeCategory" ("updatedAt" TIMESTAMP(3),"updatedBy" TEXT,+ CONSTRAINT "userAttributeCategory_pkey" PRIMARY KEY ("id"),CONSTRAINT "userAttributeCategory_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id"),CONSTRAINT "userAttributeCategory_updatedBy_fkey" FOREIGN KEY ("updatedBy") REFERENCES "user"("id"));@@ -92,10 +93,10 @@ VALUES-- ALTER TABLE "attributeDataType" ENABLE ROW LEVEL SECURITY;CREATE TABLE "userAttribute" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"name" TEXT NOT NULL,"sortOrder" INTEGER NOT NULL DEFAULT 1,- "userAttributeCategoryId" INTEGER NOT NULL,+ "userAttributeCategoryId" TEXT NOT NULL,"attributeDataTypeId" INTEGER NOT NULL,"listOptions" TEXT ARRAY,"canSelfManage" BOOLEAN DEFAULT FALSE,@@ -105,6 +106,7 @@ CREATE TABLE "userAttribute" ("updatedAt" TIMESTAMP(3),"updatedBy" TEXT,+ CONSTRAINT "userAttribute_pkey" PRIMARY KEY ("id"),CONSTRAINT "userAttribute_userAttributeCategoryId_fkey" FOREIGN KEY ("userAttributeCategoryId") REFERENCES "userAttributeCategory"("id") ON DELETE CASCADE ON UPDATE CASCADE,CONSTRAINT "userAttribute_attributeDataTypeId_fkey" FOREIGN KEY ("attributeDataTypeId") REFERENCES "attributeDataType"("id") ON DELETE CASCADE ON UPDATE CASCADE,CONSTRAINT "userAttribute_createdBy_fkey" FOREIGN KEY ("createdBy") REFERENCES "user"("id"),@@ -115,8 +117,8 @@ CREATE TABLE "userAttribute" (-- ALTER TABLE "userAttribute" ENABLE ROW LEVEL SECURITY;CREATE TABLE "userAttributeValue" (- "id" SERIAL PRIMARY KEY,- "userAttributeId" INTEGER NOT NULL,+ "id" TEXT NOT NULL DEFAULT xid(),+ "userAttributeId" TEXT NOT NULL,"userId" TEXT NOT NULL,"valueBoolean" BOOLEAN,"valueDate" DATE,@@ -192,7 +194,7 @@ CREATE POLICY "Users can view other users attributes if the category is public");-- CREATE TABLE employee_personal_data (--- id SERIAL PRIMARY KEY,+-- "id" TEXT NOT NULL DEFAULT xid(),-- bank_account_number TEXT,-- bank_routing_number TEXT,-- drivers_license_number TEXT,diff --git a/packages/carbon-database/supabase/migrations/20230123004612_suppliers-and-customers.sql b/packages/carbon-database/supabase/migrations/20230123004612_suppliers-and-customers.sqlindex 04dd7f0860..8b9f10c833 100644--- a/packages/carbon-database/supabase/migrations/20230123004612_suppliers-and-customers.sql+++ b/packages/carbon-database/supabase/migrations/20230123004612_suppliers-and-customers.sql@@ -5,7 +5,7 @@ CREATE TABLE "country" ();CREATE TABLE "contact" (- "id" TEXT NOT NULL DEFAULT uuid_generate_v4(),+ "id" TEXT NOT NULL DEFAULT xid(),"firstName" TEXT NOT NULL,"lastName" TEXT NOT NULL,"email" TEXT NOT NULL,@@ -29,7 +29,7 @@ CREATE TABLE "contact" (CREATE TABLE "address" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"addressLine1" TEXT,"addressLine2" TEXT,"city" TEXT,@@ -39,14 +39,17 @@ CREATE TABLE "address" ("phone" TEXT,"fax" TEXT,+ CONSTRAINT "address_pkey" PRIMARY KEY ("id"),CONSTRAINT "address_countryId_fkey" FOREIGN KEY ("countryId") REFERENCES "country"("id") ON DELETE SET NULL ON UPDATE CASCADE);CREATE TABLE "supplierStatus" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"name" TEXT NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,- "updatedAt" TIMESTAMP(3)+ "updatedAt" TIMESTAMP(3),++ CONSTRAINT "supplierStatus_pkey" PRIMARY KEY ("id"));INSERT INTO "supplierStatus" ("name") VALUES ('Active'), ('Inactive'), ('Pending'), ('Rejected');@@ -68,7 +71,7 @@ CREATE TABLE "supplier" ("name" TEXT NOT NULL,"description" TEXT,"supplierTypeId" TEXT,- "supplierStatusId" INTEGER,+ "supplierStatusId" TEXT,"taxId" TEXT,"accountManagerId" TEXT,"logo" TEXT,@@ -87,19 +90,20 @@ CREATE TABLE "supplier" ();CREATE TABLE "supplierLocation" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"supplierId" TEXT NOT NULL,- "addressId" INTEGER NOT NULL,+ "addressId" TEXT NOT NULL,+ CONSTRAINT "supplierLocation_pkey" PRIMARY KEY ("id"),CONSTRAINT "supplierLocation_supplierId_fkey" FOREIGN KEY ("supplierId") REFERENCES "supplier"("id") ON UPDATE CASCADE ON DELETE CASCADE,CONSTRAINT "supplierLocation_addressId_fkey" FOREIGN KEY ("addressId") REFERENCES "address"("id") ON UPDATE CASCADE ON DELETE CASCADE);CREATE TABLE "supplierContact" (- "id" TEXT NOT NULL DEFAULT uuid_generate_v4(),+ "id" TEXT NOT NULL DEFAULT xid(),"supplierId" TEXT NOT NULL,"contactId" TEXT NOT NULL,- "supplierLocationId" INTEGER,+ "supplierLocationId" TEXT,"userId" TEXT,CONSTRAINT "supplierContact_pkey" PRIMARY KEY ("id"),@@ -119,10 +123,12 @@ CREATE TABLE "supplierAccount" ();CREATE TABLE "customerStatus" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"name" TEXT NOT NULL,"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,- "updatedAt" TIMESTAMP(3)+ "updatedAt" TIMESTAMP(3),++ CONSTRAINT "customerStatus_pkey" PRIMARY KEY ("id"));INSERT INTO "customerStatus" ("name") VALUES ('Active'), ('Inactive'), ('Prospect'), ('Lead'), ('On Hold'), ('Cancelled'), ('Archived');@@ -144,7 +150,7 @@ CREATE TABLE "customer" ("name" TEXT NOT NULL,"description" TEXT,"customerTypeId" TEXT,- "customerStatusId" INTEGER,+ "customerStatusId" TEXT,"taxId" TEXT,"accountManagerId" TEXT,"logo" TEXT,@@ -163,19 +169,20 @@ CREATE TABLE "customer" ();CREATE TABLE "customerLocation" (- "id" SERIAL PRIMARY KEY,+ "id" TEXT NOT NULL DEFAULT xid(),"customerId" TEXT NOT NULL,- "addressId" INTEGER NOT NULL,+ "addressId" TEXT NOT NULL,+ CONSTRAINT "customerLocation_pkey" PRIMARY KEY ("id"),CONSTRAINT "customerLocation_customerId_fkey" FOREIGN KEY ("customerId") REFERENCES "customer"("id") ON UPDATE CASCADE ON DELETE CASCADE,CONSTRAINT "customerLocation_addressId_fkey" FOREIGN KEY ("addressId") REFERENCES "address"("id") ON UPDATE CASCADE ON DELETE CASCADE);CREATE TABLE "customerContact" (- "id" TEXT NOT NULL DEFAULT uuid_generate_v4(),+ "id" TEXT NOT NULL DEFAULT xid(),"customerId" TEXT NOT NULL,"contactId" TEXT NOT NULL,- "customerLocationId" INTEGER,+ "customerLocationId" TEXT,"userId" TEXT,CONSTRAINT "customerContact_pkey" PRIMARY KEY ("id"),diff --git a/packages/carbon-database/supabase/migrations/20230123004632_groups.sql b/packages/carbon-database/supabase/migrations/20230123004632_groups.sqlindex cd6ef6da23..3a18247fe8 100644--- a/packages/carbon-database/supabase/migrations/20230123004632_groups.sql+++ b/packages/carbon-database/supabase/migrations/20230123004632_groups.sql@@ -228,7 +228,7 @@ RETURNS TABLE ("isSupplierOrgGroup" BOOLEAN,"isSupplierTypeGroup" BOOLEAN,"users" JSONB-) LANGUAGE "plpgsql" SECURITY DEFINER SET search_path = public+) LANGUAGE "plpgsql" SECURITY INVOKER SET search_path = publicAS $$BEGINRETURN QUERYdiff --git a/packages/carbon-database/supabase/migrations/20230123212853_search.sql b/packages/carbon-database/supabase/migrations/20230123212853_search.sqlindex 02e67242d9..90cba7a94d 100644--- a/packages/carbon-database/supabase/migrations/20230123212853_search.sql+++ b/packages/carbon-database/supabase/migrations/20230123212853_search.sql@@ -25,7 +25,7 @@ DECLAREBEGINemployee := (SELECT u."fullName" FROM public.user u WHERE u.id = new.id);INSERT INTO public.search(name, entity, uuid, link)- VALUES (employee, 'People', new.id, '/app/people/' || new.id);+ VALUES (employee, 'People', new.id, '/x/people/' || new.id);RETURN new;END;$$ LANGUAGE plpgsql SECURITY DEFINER;@@ -43,7 +43,7 @@ BEGINRETURN new;END IF;IF (old."fullName" <> new."fullName") THEN- UPDATE public.search SET name = new."fullName", link = '/app/people/' || new.id+ UPDATE public.search SET name = new."fullName", link = '/x/people/' || new.idWHERE entity = 'People' AND uuid = new.id;END IF;RETURN new;@@ -58,7 +58,7 @@ CREATE FUNCTION public.create_customer_search_result()RETURNS TRIGGER AS $$BEGININSERT INTO public.search(name, entity, uuid, link)- VALUES (new.name, 'Customer', new.id, '/app/sales/customers/' || new.id);+ VALUES (new.name, 'Customer', new.id, '/x/sales/customers/' || new.id);RETURN new;END;$$ LANGUAGE plpgsql SECURITY DEFINER;@@ -86,7 +86,7 @@ CREATE FUNCTION public.create_supplier_search_result()RETURNS TRIGGER AS $$BEGININSERT INTO public.search(name, entity, uuid, link)- VALUES (new.name, 'Supplier', new.id, '/app/purchasing/suppliers/' || new.id);+ VALUES (new.name, 'Supplier', new.id, '/x/purchasing/suppliers/' || new.id);RETURN new;END;$$ LANGUAGE plpgsql SECURITY DEFINER;@@ -112,27 +112,35 @@ CREATE TRIGGER update_supplier_search_resultALTER TABLE "search" ENABLE ROW LEVEL SECURITY;-CREATE POLICY "Users with sales_view can search for customers and sales orders" ON "search"+CREATE POLICY "Employees with sales_view can search for customers and sales orders" ON "search"FOR SELECT- USING (coalesce(get_my_claim('sales_view')::boolean, false) = true AND entity IN ('Customer', 'Sales Order'));+ USING (coalesce(get_my_claim('sales_view')::boolean, false) = true AND entity IN ('Customer', 'Sales Order') AND (get_my_claim('role'::text)) = '"employee"'::jsonb);-CREATE POLICY "Users with purchasing_view can search for suppliers and purchase orders" ON "search"+-- TODO: customers should be able to search for their sales orders++CREATE POLICY "Employees with purchasing_view can search for suppliers and purchase orders" ON "search"FOR SELECT- USING (coalesce(get_my_claim('purchasing_view')::boolean, false) = true AND entity IN ('Supplier', 'Purchase Order'));+ USING (coalesce(get_my_claim('purchasing_view')::boolean, false) = true AND entity IN ('Supplier', 'Purchase Order') AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- TODO: suppliers should be able to search for their purchase orders-CREATE POLICY "Users with people_view can search for people" ON "search"+CREATE POLICY "Employees with people_view can search for people" ON "search"FOR SELECTUSING (coalesce(get_my_claim('people_view')::boolean, false) = true AND entity = 'People');--- TODO: documents will probably need some additional filtering-CREATE POLICY "Users with document_view can search for documents" ON "search"+-- TODO: documents should be filtered based on visibility+CREATE POLICY "Employees with document_view can search for documents" ON "search"FOR SELECT- USING (coalesce(get_my_claim('document_view')::boolean, false) = true AND entity = 'Document');+ USING (coalesce(get_my_claim('document_view')::boolean, false) = true AND entity = 'Document' AND (get_my_claim('role'::text)) = '"employee"'::jsonb);-CREATE POLICY "Users with parts_view can search for parts" ON "search"+CREATE POLICY "Employees with parts_view can search for parts" ON "search"FOR SELECT- USING (coalesce(get_my_claim('parts_view')::boolean, false) = true AND entity = 'Part');+ USING (coalesce(get_my_claim('parts_view')::boolean, false) = true AND entity = 'Part' AND (get_my_claim('role'::text)) = '"employee"'::jsonb);-CREATE POLICY "Users with jobs_view can search for jobs" ON "search"+-- TODO: suppliers should be able to search for parts that they supply++CREATE POLICY "Employees with jobs_view can search for jobs" ON "search"FOR SELECT- USING (coalesce(get_my_claim('jobs_view')::boolean, false) = true AND entity = 'Job');+ USING (coalesce(get_my_claim('jobs_view')::boolean, false) = true AND entity = 'Job' AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- TODO: customers should be able to search for their jobs\ No newline at end of filediff --git a/packages/carbon-database/supabase/migrations/20230126050441_rbac.sql b/packages/carbon-database/supabase/migrations/20230126050441_rbac.sqlnew file mode 100644index 0000000000..c4f5be86cd--- /dev/null+++ b/packages/carbon-database/supabase/migrations/20230126050441_rbac.sql@@ -0,0 +1,402 @@+-- contact++ALTER TABLE "contact" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with purchasing_view can view contacts that are suppliers" ON "contact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('purchasing_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "supplierContact"+ )+ );++CREATE POLICY "Employees with sales_view can view contacts that are customer" ON "contact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('sales_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "customerContact"+ )+ );++CREATE POLICY "Suppliers with purchasing_view can view contacts from their organization" ON "contact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('purchasing_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "supplierContact" WHERE "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Customers with sales_view can view contacts from their organization" ON "contact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('sales_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "customerContact" WHERE "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Many employees can create contact" ON "contact"+ FOR INSERT+ WITH CHECK (+ (+ coalesce(get_my_claim('purchasing_create')::boolean,false) OR+ coalesce(get_my_claim('sales_create')::boolean,false) OR+ coalesce(get_my_claim('users_create')::boolean,false)+ ) AND (get_my_claim('role'::text)) = '"employee"'::jsonb+);++CREATE POLICY "Suppliers with purchasing_update can create contacts from their organization" ON "contact"+ FOR INSERT+ WITH CHECK (+ coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "supplierContact" WHERE "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Customers with sales_update can create contacts from their organization" ON "contact"+ FOR INSERT+ WITH CHECK (+ coalesce(get_my_claim('sales_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "customerContact" WHERE "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Employees with purchasing_update can update supplier contacts" ON "contact"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "supplierContact"+ )+ );++CREATE POLICY "Suppliers with purchasing_update can update contacts from their organization" ON "contact"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "supplierContact" WHERE "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Employees with sales_update can update customer contacts" ON "contact"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "customerContact"+ )+ );++CREATE POLICY "Customers with sales_update can update contacts from their organization" ON "contact"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('sales_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "customerContact" WHERE "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Employees with purchasing_delete can delete supplier contacts" ON "contact"+ FOR DELETE+ USING (+ coalesce(get_my_claim('purchasing_delete')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "supplierContact"+ )+ );++CREATE POLICY "Suppliers with purchasing_delete can delete contacts from their organization" ON "contact"+ FOR DELETE+ USING (+ coalesce(get_my_claim('purchasing_delete')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "supplierContact" WHERE "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++CREATE POLICY "Employees with sales_delete can delete customer contacts" ON "contact"+ FOR DELETE+ USING (+ coalesce(get_my_claim('sales_delete')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"employee"'::jsonb+ AND id IN (+ SELECT "contactId" FROM "customerContact"+ )+ );++CREATE POLICY "Customers with sales_delete can delete contacts from their organization" ON "contact"+ FOR DELETE+ USING (+ coalesce(get_my_claim('sales_delete')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND (+ id IN (+ SELECT "contactId" FROM "customerContact" WHERE "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ )+ )+ );++-- customerType++ALTER TABLE "customerType" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with sales_view can view customer types" ON "customerType"+ FOR SELECT+ USING (coalesce(get_my_claim('sales_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with sales_create can create customer types" ON "customerType"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('sales_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with sales_update can update customer types" ON "customerType"+ FOR UPDATE+ USING (coalesce(get_my_claim('sales_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with sales_delete can delete customer types" ON "customerType"+ FOR DELETE+ USING (coalesce(get_my_claim('sales_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- customer++ALTER TABLE "customer" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with sales_view can view customer" ON "customer"+ FOR SELECT+ USING (coalesce(get_my_claim('sales_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Customers with sales_view can their own organization" ON "customer"+ FOR SELECT+ USING (+ coalesce(get_my_claim('sales_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND id IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with sales_create can create customers" ON "customer"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('sales_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with sales_update can update customers" ON "customer"+ FOR UPDATE+ USING (coalesce(get_my_claim('sales_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Customers with sales_update can their own organization" ON "customer"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('sales_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND id IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with sales_delete can delete customers" ON "customer"+ FOR DELETE+ USING (coalesce(get_my_claim('sales_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- customerContact++ALTER TABLE "customerContact" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with sales_view can view customer contact" ON "customerContact"+ FOR SELECT+ USING (coalesce(get_my_claim('sales_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Customers with sales_view can their own customer contacts" ON "customerContact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('sales_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with sales_create can create customer contacts" ON "customerContact"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('sales_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Customers with sales_create can create customer contacts" ON "customerContact"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('sales_create')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with sales_update can update customer contacts" ON "customerContact"+ FOR UPDATE+ USING (coalesce(get_my_claim('sales_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Customers with sales_update can update their customer contacts" ON "customerContact"+ FOR UPDATE+ USING (coalesce(get_my_claim('sales_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"customer"'::jsonb+ AND "customerId" IN (+ SELECT "customerId" FROM "customerAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with sales_delete can delete customer contacts" ON "customerContact"+ FOR DELETE+ USING (coalesce(get_my_claim('sales_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);+++-- supplierType++ALTER TABLE "supplierType" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with purchasing_view can view supplier types" ON "supplierType"+ FOR SELECT+ USING (coalesce(get_my_claim('purchasing_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with purchasing_create can create supplier types" ON "supplierType"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('purchasing_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with purchasing_update can update supplier types" ON "supplierType"+ FOR UPDATE+ USING (coalesce(get_my_claim('purchasing_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with purchasing_delete can delete supplier types" ON "supplierType"+ FOR DELETE+ USING (coalesce(get_my_claim('purchasing_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- supplier++ALTER TABLE "supplier" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with purchasing_view can view supplier" ON "supplier"+ FOR SELECT+ USING (coalesce(get_my_claim('purchasing_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Suppliers with purchasing_view can their own organization" ON "supplier"+ FOR SELECT+ USING (+ coalesce(get_my_claim('purchasing_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND id IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with purchasing_create can create suppliers" ON "supplier"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('purchasing_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Employees with purchasing_update can update suppliers" ON "supplier"+ FOR UPDATE+ USING (coalesce(get_my_claim('purchasing_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Suppliers with purchasing_update can their own organization" ON "supplier"+ FOR UPDATE+ USING (+ coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND id IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with purchasing_delete can delete suppliers" ON "supplier"+ FOR DELETE+ USING (coalesce(get_my_claim('purchasing_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++-- supplierContact++ALTER TABLE "supplierContact" ENABLE ROW LEVEL SECURITY;++CREATE POLICY "Employees with purchasing_view can view supplier contact" ON "supplierContact"+ FOR SELECT+ USING (coalesce(get_my_claim('purchasing_view')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Suppliers with purchasing_view can their own supplier contacts" ON "supplierContact"+ FOR SELECT+ USING (+ coalesce(get_my_claim('purchasing_view')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with purchasing_create can create supplier contacts" ON "supplierContact"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('purchasing_create')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Suppliers with purchasing_create can create supplier contacts" ON "supplierContact"+ FOR INSERT+ WITH CHECK (coalesce(get_my_claim('purchasing_create')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with purchasing_update can update supplier contacts" ON "supplierContact"+ FOR UPDATE+ USING (coalesce(get_my_claim('purchasing_update')::boolean,false) AND (get_my_claim('role'::text)) = '"employee"'::jsonb);++CREATE POLICY "Suppliers with purchasing_update can update their supplier contacts" ON "supplierContact"+ FOR UPDATE+ USING (coalesce(get_my_claim('purchasing_update')::boolean, false) = true+ AND (get_my_claim('role'::text)) = '"supplier"'::jsonb+ AND "supplierId" IN (+ SELECT "supplierId" FROM "supplierAccount" WHERE id::uuid = auth.uid()+ )+ );++CREATE POLICY "Employees with purchasing_delete can delete supplier contacts" ON "supplierContact"+ FOR DELETE+ USING (coalesce(get_my_claim('purchasing_delete')::boolean, false) = true AND (get_my_claim('role'::text)) = '"employee"'::jsonb);diff --git a/packages/carbon-react/src/Message/useNotification.tsx b/packages/carbon-react/src/Message/useNotification.tsxindex d8144c5baf..13d0d7f1e6 100644--- a/packages/carbon-react/src/Message/useNotification.tsx+++ b/packages/carbon-react/src/Message/useNotification.tsx@@ -14,7 +14,7 @@ import { ClientOnly } from "../SSR";const defaultOptions: UseToastOptions = {isClosable: true,- position: "bottom-left",+ position: "top",};export default function useNotification() {diff --git a/packages/carbon-react/src/hooks/useKeyboardShortcuts.ts b/packages/carbon-react/src/hooks/useKeyboardShortcuts.tsindex eee442d43d..d5f1e3dee6 100644--- a/packages/carbon-react/src/hooks/useKeyboardShortcuts.ts+++ b/packages/carbon-react/src/hooks/useKeyboardShortcuts.ts@@ -4,28 +4,15 @@ function includes(array: string[], element: string) {return array.indexOf(element) >= 0;}-/**- * Hook for listening on key events.- *- * @param {Object|Map} keyMap Key names mapped to event handlers. If a key name exists, its- * default behavior will be suppressed.- * @param {Array} whitelistNodes If target element is in the whitelist nodes array, will not- * trigger shortcut event- * @param {Array} whitelistClasses If target class is in the whitelist classes array, will not- * trigger shortcut event- */-export default function useKeyboardShortcuts(- keyMap: { [id: string]: (event: KeyboardEvent) => void },- whitelistNodes: string[] = [],- whitelistClasses: string[] = []-) {+export default function useKeyboardShortcuts(keyMap: {+ [id: string]: (event: KeyboardEvent) => void;+}) {const [lastKeydown, setLastKeydown] = useState<string | null>();const handleKeydown = (event: any) => {if (!keyMap ||- includes(whitelistNodes, event.target.nodeName) ||- includes(whitelistClasses, event.target.className)+ includes(["INPUT", "TEXTAREA", "SELECT"], event.target.nodeName)) {return;}diff --git a/yarn.lock b/yarn.lockindex 13b0f6b6da..080a057393 100644--- a/yarn.lock+++ b/yarn.lock@@ -29,11 +29,6 @@resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.19.4.tgz#95c86de137bf0317f3a570e1b6e996b427299747"integrity sha512-CHIGpJcUQ5lU9KrPHTjBMhVwQG6CQjxfg36fGXl3qk/Gik1WwWachaXFuo0uCWJT/mStOKtcbFJCaVLihC1CMw==-"@babel/compat-data@^7.20.5":- version "7.20.10"- resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec"- integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg==-"@babel/core@^7.1.0", "@babel/core@^7.12.3", "@babel/core@^7.13.16", "@babel/core@^7.18.6", "@babel/core@^7.19.1", "@babel/core@^7.7.5":version "7.19.6"resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.19.6.tgz#7122ae4f5c5a37c0946c066149abd8e75f81540f"@@ -55,27 +50,6 @@json5 "^2.2.1"semver "^6.3.0"-"@babel/core@^7.20.7":- version "7.20.12"- resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d"- integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==- dependencies:- "@ampproject/remapping" "^2.1.0"- "@babel/code-frame" "^7.18.6"- "@babel/generator" "^7.20.7"- "@babel/helper-compilation-targets" "^7.20.7"- "@babel/helper-module-transforms" "^7.20.11"- "@babel/helpers" "^7.20.7"- "@babel/parser" "^7.20.7"- "@babel/template" "^7.20.7"- "@babel/traverse" "^7.20.12"- "@babel/types" "^7.20.7"- convert-source-map "^1.7.0"- debug "^4.1.0"- gensync "^1.0.0-beta.2"- json5 "^2.2.2"- semver "^6.3.0"-"@babel/eslint-parser@^7.19.1":version "7.19.1"resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4"@@ -85,15 +59,6 @@eslint-visitor-keys "^2.1.0"semver "^6.3.0"-"@babel/generator@^7.18.6", "@babel/generator@^7.20.7":- version "7.20.7"- resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a"- integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw==- dependencies:- "@babel/types" "^7.20.7"- "@jridgewell/gen-mapping" "^0.3.2"- jsesc "^2.5.1"-"@babel/generator@^7.19.6":version "7.19.6"resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.6.tgz#9e481a3fe9ca6261c972645ae3904ec0f9b34a1d"@@ -128,17 +93,6 @@browserslist "^4.21.3"semver "^6.3.0"-"@babel/helper-compilation-targets@^7.20.7":- version "7.20.7"- resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb"- integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==- dependencies:- "@babel/compat-data" "^7.20.5"- "@babel/helper-validator-option" "^7.18.6"- browserslist "^4.21.3"- lru-cache "^5.1.1"- semver "^6.3.0"-"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.19.0":version "7.19.0"resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.19.0.tgz#bfd6904620df4e46470bae4850d66be1054c404b"@@ -227,20 +181,6 @@"@babel/traverse" "^7.19.6""@babel/types" "^7.19.4"-"@babel/helper-module-transforms@^7.20.11":- version "7.20.11"- resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0"- integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==- dependencies:- "@babel/helper-environment-visitor" "^7.18.9"- "@babel/helper-module-imports" "^7.18.6"- "@babel/helper-simple-access" "^7.20.2"- "@babel/helper-split-export-declaration" "^7.18.6"- "@babel/helper-validator-identifier" "^7.19.1"- "@babel/template" "^7.20.7"- "@babel/traverse" "^7.20.10"- "@babel/types" "^7.20.7"-"@babel/helper-optimise-call-expression@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe"@@ -281,13 +221,6 @@dependencies:"@babel/types" "^7.19.4"-"@babel/helper-simple-access@^7.20.2":- version "7.20.2"- resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9"- integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==- dependencies:- "@babel/types" "^7.20.2"-"@babel/helper-skip-transparent-expression-wrappers@^7.18.9":version "7.18.9"resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818"@@ -336,15 +269,6 @@"@babel/traverse" "^7.19.4""@babel/types" "^7.19.4"-"@babel/helpers@^7.20.7":- version "7.20.13"- resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2"- integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==- dependencies:- "@babel/template" "^7.20.7"- "@babel/traverse" "^7.20.13"- "@babel/types" "^7.20.7"-"@babel/highlight@^7.10.4", "@babel/highlight@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf"@@ -359,11 +283,6 @@resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.19.6.tgz#b923430cb94f58a7eae8facbffa9efd19130e7f8"integrity sha512-h1IUp81s2JYJ3mRkdxJgs4UvmSsRvDrx5ICSJbPvtWYv5i1nTBGcBpnog+89rAFMwvvru6E5NUHdBe01UeSzYA==-"@babel/parser@^7.18.6", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7":- version "7.20.13"- resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.13.tgz#ddf1eb5a813588d2fb1692b70c6fce75b945c088"- integrity sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw==-"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6":version "7.18.6"resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2"@@ -1113,15 +1032,6 @@"@babel/parser" "^7.18.10""@babel/types" "^7.18.10"-"@babel/template@^7.20.7":- version "7.20.7"- resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8"- integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==- dependencies:- "@babel/code-frame" "^7.18.6"- "@babel/parser" "^7.20.7"- "@babel/types" "^7.20.7"-"@babel/traverse@^7.1.0", "@babel/traverse@^7.19.0", "@babel/traverse@^7.19.1", "@babel/traverse@^7.19.4", "@babel/traverse@^7.19.6":version "7.19.6"resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.19.6.tgz#7b4c865611df6d99cb131eec2e8ac71656a490dc"@@ -1138,22 +1048,6 @@debug "^4.1.0"globals "^11.1.0"-"@babel/traverse@^7.18.6", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13":- version "7.20.13"- resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473"- integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ==- dependencies:- "@babel/code-frame" "^7.18.6"- "@babel/generator" "^7.20.7"- "@babel/helper-environment-visitor" "^7.18.9"- "@babel/helper-function-name" "^7.19.0"- "@babel/helper-hoist-variables" "^7.18.6"- "@babel/helper-split-export-declaration" "^7.18.6"- "@babel/parser" "^7.20.13"- "@babel/types" "^7.20.7"- debug "^4.1.0"- globals "^11.1.0"-"@babel/types@^7.0.0", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4":version "7.19.4"resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.4.tgz#0dd5c91c573a202d600490a35b33246fed8a41c7"@@ -1172,15 +1066,6 @@"@babel/helper-validator-identifier" "^7.19.1"to-fast-properties "^2.0.0"-"@babel/types@^7.20.7":- version "7.20.7"- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f"- integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg==- dependencies:- "@babel/helper-string-parser" "^7.19.4"- "@babel/helper-validator-identifier" "^7.19.1"- to-fast-properties "^2.0.0"-"@bcoe/v8-coverage@^0.2.3":version "0.2.3"resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"@@ -2131,11 +2016,6 @@escape-string-regexp "^4.0.0"rollup-plugin-node-polyfills "^0.2.1"-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz#cf91e86df127aa3d141744edafcba0abdc577d23"- integrity sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.16.3.tgz#6af6d16be6d534d776a51fc215bfd81a68906d2c"@@ -2151,91 +2031,46 @@resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.15.tgz#35b3cc0f9e69cb53932d44f60b99dd440335d2f0"integrity sha512-JJjZjJi2eBL01QJuWjfCdZxcIgot+VoK6Fq7eKF9w4YHm9hwl7nhBR1o2Wnt/WcANk5l9SkpvrldW1PLuXxcbw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.16.17.tgz#025b6246d3f68b7bbaa97069144fb5fb70f2fff2"- integrity sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.16.3.tgz#2a091222f3b1928e3246fb3c5202eaca88baab67"integrity sha512-mueuEoh+s1eRbSJqq9KNBQwI4QhQV6sRXIfTyLXSHGMpyew61rOK4qY21uKbXl1iBoMb0AdL1deWFCQVlN2qHA==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.16.17.tgz#c820e0fef982f99a85c4b8bfdd582835f04cd96e"- integrity sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.16.3.tgz#a6d749c58b022d371dc40d50ac1bb4aebd1eb953"integrity sha512-SFpTUcIT1bIJuCCBMCQWq1bL2gPTjWoLZdjmIhjdcQHaUfV41OQfho6Ici5uvvkMmZRXIUGpM3GxysP/EU7ifQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz#edef4487af6b21afabba7be5132c26d22379b220"- integrity sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.16.3.tgz#92d1826ed2f21dcac5830b70d7215c6afbb744e2"integrity sha512-DO8WykMyB+N9mIDfI/Hug70Dk1KipavlGAecxS3jDUwAbTpDXj0Lcwzw9svkhxfpCagDmpaTMgxWK8/C/XcXvw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz#42829168730071c41ef0d028d8319eea0e2904b4"- integrity sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.16.3.tgz#7fc3570c2b16e9ff4fc178593a0a4adb1ae8ea57"integrity sha512-uEqZQ2omc6BvWqdCiyZ5+XmxuHEi1SPzpVxXCSSV2+Sh7sbXbpeNhHIeFrIpRjAs0lI1FmA1iIOxFozKBhKgRQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz#1f4af488bfc7e9ced04207034d398e793b570a27"- integrity sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.3.tgz#16735ce16f8c9a4e7289e9e259aa01a8d9874307"integrity sha512-nJansp3sSXakNkOD5i5mIz2Is/HjzIhFs49b1tjrPrpCmwgBmH9SSzhC/Z1UqlkivqMYkhfPwMw1dGFUuwmXhw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz#636306f19e9bc981e06aa1d777302dad8fddaf72"- integrity sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.16.3.tgz#f4edd1464cb072799ed6b8ab5178478e71c13459"integrity sha512-TfoDzLw+QHfc4a8aKtGSQ96Wa+6eimljjkq9HKR0rHlU83vw8aldMOUSJTUDxbcUdcgnJzPaX8/vGWm7vyV7ug==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz#a003f7ff237c501e095d4f3a09e58fc7b25a4aca"- integrity sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.16.3.tgz#4b7ae6fe3618d9a40d6ca39c6edc991ac1447203"integrity sha512-7I3RlsnxEFCHVZNBLb2w7unamgZ5sVwO0/ikE2GaYvYuUQs9Qte/w7TqWcXHtCwxvZx/2+F97ndiUQAWs47ZfQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz#b591e6a59d9c4fe0eeadd4874b157ab78cf5f196"- integrity sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.16.3.tgz#4b3e9f849822e16a76a70844c4db68075b259a58"integrity sha512-VwswmSYwVAAq6LysV59Fyqk3UIjbhuc6wb3vEcJ7HEJUtFuLK9uXWuFoH1lulEbE4+5GjtHi3MHX+w1gNHdOWQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz#24333a11027ef46a18f57019450a5188918e2a54"- integrity sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.16.3.tgz#2ff3936b91bfff62f9ecf7f6411ef399b29ed22d"@@ -2251,121 +2086,61 @@resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.15.tgz#32c65517a09320b62530867345222fde7794fbe1"integrity sha512-lhz6UNPMDXUhtXSulw8XlFAtSYO26WmHQnCi2Lg2p+/TMiJKNLtZCYUxV4wG6rZMzXmr8InGpNwk+DLT2Hm0PA==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz#d5ad459d41ed42bbd4d005256b31882ec52227d8"- integrity sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.16.3.tgz#ff8aa59f49d9ccbc1ff952ba1f5cd01a534562df"integrity sha512-hIbeejCOyO0X9ujfIIOKjBjNAs9XD/YdJ9JXAy1lHA+8UXuOqbFe4ErMCqMr8dhlMGBuvcQYGF7+kO7waj2KHw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz#4e5967a665c38360b0a8205594377d4dcf9c3726"- integrity sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.16.3.tgz#5dd5e118071c3912df69beedbfd11fb117f0fe5e"integrity sha512-znFRzICT/V8VZQMt6rjb21MtAVJv/3dmKRMlohlShrbVXdBuOdDrGb+C2cZGQAR8RFyRe7HS6klmHq103WpmVw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz#206443a02eb568f9fdf0b438fbd47d26e735afc8"- integrity sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.16.3.tgz#36c62e24eae7fa3f0d921506da8fc1e6098a1364"integrity sha512-EV7LuEybxhXrVTDpbqWF2yehYRNz5e5p+u3oQUS2+ZFpknyi1NXxr8URk4ykR8Efm7iu04//4sBg249yNOwy5Q==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz#c351e433d009bf256e798ad048152c8d76da2fc9"- integrity sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.16.3.tgz#f0fec8e7affb5bcc817fefc61a21cbb95539e393"integrity sha512-uDxqFOcLzFIJ+r/pkTTSE9lsCEaV/Y6rMlQjUI9BkzASEChYL/aSQjZjchtEmdnVxDKETnUAmsaZ4pqK1eE5BQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz#661f271e5d59615b84b6801d1c2123ad13d9bd87"- integrity sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.16.3.tgz#22e10edd6e91f53c2e1f60e46abd453d7794409b"integrity sha512-NbeREhzSxYwFhnCAQOQZmajsPYtX71Ufej3IQ8W2Gxskfz9DK58ENEju4SbpIj48VenktRASC52N5Fhyf/aliQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz#e4ba18e8b149a89c982351443a377c723762b85f"- integrity sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.16.3.tgz#38388b73fd9eebe45b073d7d8099b9c2e54f7139"integrity sha512-SDiG0nCixYO9JgpehoKgScwic7vXXndfasjnD5DLbp1xltANzqZ425l7LSdHynt19UWOcDjG9wJJzSElsPvk0w==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz#7d4f4041e30c5c07dd24ffa295c73f06038ec775"- integrity sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.16.3.tgz#e0270569567f1530b8dbe6d11d5b4930b9cc71ae"integrity sha512-AzbsJqiHEq1I/tUvOfAzCY15h4/7Ivp3ff/o1GpP16n48JMNAtbW0qui2WCgoIZArEHD0SUQ95gvR0oSO7ZbdA==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz#970fa7f8470681f3e6b1db0cc421a4af8060ec35"- integrity sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.16.3.tgz#3b16642d443848bca605f33ee3978a1890911e6d"integrity sha512-gSABi8qHl8k3Cbi/4toAzHiykuBuWLZs43JomTcXkjMZVkp0gj3gg9mO+9HJW/8GB5H89RX/V0QP4JGL7YEEVg==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz#abc60e7c4abf8b89fb7a4fe69a1484132238022c"- integrity sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.16.3.tgz#a838f247867380f0ae25ce1936dc5ab6f57b7734"integrity sha512-SF9Kch5Ete4reovvRO6yNjMxrvlfT0F0Flm+NPoUw5Z4Q3r1d23LFTgaLwm3Cp0iGbrU/MoUI+ZqwCv5XJijCw==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz#7b0ff9e8c3265537a7a7b1fd9a24e7bd39fcd87a"- integrity sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.16.3.tgz#bedd9bef5fb41f89ce2599f1761973cf6d6a67b6"integrity sha512-u5aBonZIyGopAZyOnoPAA6fGsDeHByZ9CnEzyML9NqntK6D/xl5jteZUKm/p6nD09+v3pTM6TuUIqSPcChk5gg==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz#e90fe5267d71a7b7567afdc403dfd198c292eb09"- integrity sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.16.3.tgz#49800aa812d8cc35ceef61e8d3b01224684cc0b1"integrity sha512-GlgVq1WpvOEhNioh74TKelwla9KDuAaLZrdxuuUgsP2vayxeLgVc+rbpIv0IYF4+tlIzq2vRhofV+KGLD+37EQ==-"@esbuild/[email protected]":- version "0.16.17"- resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz#c5a1a4bfe1b57f0c3e61b29883525c6da3e5c091"- integrity sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==-"@esbuild/[email protected]":version "0.16.3"resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.16.3.tgz#94047dae921949cfb308117d993c4b941291ae10"@@ -3197,24 +2972,20 @@classcat "^5.0.3"zustand "^4.3.1"-"@remix-run/dev@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/dev/-/dev-1.11.1.tgz#02111353abcffd71956faf5f7e30b2b1f189b138"- integrity sha512-8N7TRbJtNXKhU4pQwDGdEMDlOIJ1SqQdG1zZoIzU7Q7YfkdAI8/AOtXT7i2X6y5urjijtFUZEY6x8IVNhGAjbg==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/dev/-/dev-1.9.0.tgz#2e594d143d47afc29e4bbdee02291649b0766dc6"+ integrity sha512-4EEctL2lo7eLPbVkzVBuRW+TX1B9yNdR9Ug7z7PYwFvJF0Oy9PovGx7ooVIypNiWLGOztKgN+K3c9jdffsrYYQ==dependencies:"@babel/core" "^7.18.6"- "@babel/generator" "^7.18.6"- "@babel/parser" "^7.18.6""@babel/plugin-syntax-jsx" "^7.18.6""@babel/plugin-syntax-typescript" "^7.20.0""@babel/preset-env" "^7.18.6""@babel/preset-typescript" "^7.18.6"- "@babel/traverse" "^7.18.6""@babel/types" "^7.20.2""@esbuild-plugins/node-modules-polyfill" "^0.1.4""@npmcli/package-json" "^2.0.0"- "@remix-run/server-runtime" "1.11.1"- "@vanilla-extract/integration" "^6.0.1"+ "@remix-run/server-runtime" "1.9.0"arg "^5.0.1"cacache "^15.0.5"chalk "^4.1.2"@@ -3234,13 +3005,9 @@json5 "^2.2.1"lodash "^4.17.21"lodash.debounce "^4.0.8"- lru-cache "^7.14.1"minimatch "^3.0.4"node-fetch "^2.6.7"ora "^5.4.1"- postcss "^8.4.19"- postcss-discard-duplicates "^5.1.0"- postcss-modules "^6.0.0"prettier "2.7.1"pretty-ms "^7.0.1"proxy-agent "^5.0.0"@@ -3254,10 +3021,10 @@ws "^7.4.5"xdm "^2.0.0"-"@remix-run/eslint-config@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/eslint-config/-/eslint-config-1.11.1.tgz#aea5ae752a87b5ad8a776329d7f26ff6b7cf6125"- integrity sha512-mpisTkWBKYklmuIuDhwdy8BAUV5+EJ3Q3cxlSGBXZ+SaddK8WgBZu5C44o/0YZvktFm53rWBH3Afeq0A03yUkQ==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/eslint-config/-/eslint-config-1.9.0.tgz#9a7e35c61f703165657dd3126bc1cb2424989fc6"+ integrity sha512-SPEY+FqvYrlpqYpvPPKd/2dlKzd9Vlxa2HkvKqIHtaiBFUGX9GWnKRro6b5KQ6IU0K5wupCJXG4/bw1CYd8pFg==dependencies:"@babel/core" "^7.19.1""@babel/eslint-parser" "^7.19.1"@@ -3276,19 +3043,19 @@eslint-plugin-react-hooks "^4.6.0"eslint-plugin-testing-library "^5.6.4"-"@remix-run/[email protected]":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/express/-/express-1.11.1.tgz#48d9c60356a2ff0de41c72ded6cbb38552b8c7c7"- integrity sha512-riT5ooTXWeX52bSTaL5ovCApKRU/W6NjdowfESH4Ur3MSM3FP1/z9K0HBV+mVsAW7zYSOk/vaPX+kJnVZsuhCw==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/express/-/express-1.9.0.tgz#6f1c1027cccf72717acd2bec5eaa93bcf9e77546"+ integrity sha512-kWLINQNx4D2ypBzfgUiTwEvsM/GFTtpnjK1aHBKH/PCN1JH0yDpbr6VGlUbj0Mmnfy9Qg2yPlwTlgHNox++a4g==dependencies:- "@remix-run/node" "1.11.1"+ "@remix-run/node" "1.9.0"-"@remix-run/[email protected]", "@remix-run/node@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/node/-/node-1.11.1.tgz#f0ea577650cf67aa9a1725a1f1d6d280e6ba1b11"- integrity sha512-Lc2mI7Qm26kIB0cyjPC56XTZskfufX1uTTpHsAAYvBooyahhKoBHDLa0skl56cT20mz7dSy+ocYoPel6Eavr2A==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/node/-/node-1.9.0.tgz#afed6996305e1fb4b524569797214362d8d46955"+ integrity sha512-LKbzMieBEE1oxeEoR3qyAFd29o/dQvRZvxQyB0LLy1IdAfrMTrADCRK8YZ7xVtJeUzWnNpn9abslotQN82Oz7g==dependencies:- "@remix-run/server-runtime" "1.11.1"+ "@remix-run/server-runtime" "1.9.0""@remix-run/web-fetch" "^4.3.2""@remix-run/web-file" "^3.0.2""@remix-run/web-stream" "^1.0.3"@@ -3298,48 +3065,47 @@source-map-support "^0.5.21"stream-slice "^0.1.2"-"@remix-run/react@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/react/-/react-1.11.1.tgz#78e9fe5042cf82380b2dd3bc4637c8dd436490c4"- integrity sha512-8D+55ygREmGLWuCfqU7DntMgD8EN/5Lk8feO0oF09eFR9tZ5frjjiB3xTiH+4wkyY3vz+cdFxVI/8p9Iyrwd6Q==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/react/-/react-1.9.0.tgz#e072f2b26df4ecc5b593633e18777bae936a600a"+ integrity sha512-Rtm6qqdKMD0AMsJuzCFwpz40/o6LXQq20smHyyvH8EMHJRPrms44By28uMW0kmc+M9q0wa0gBfMzWFfZnCSFwg==dependencies:- "@remix-run/router" "1.3.0"- react-router-dom "6.7.0"- use-sync-external-store "1.2.0"+ "@remix-run/router" "1.1.0"+ react-router-dom "6.5.0"-"@remix-run/[email protected]":- version "1.3.0"- resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.3.0.tgz#b6ee542c7f087b73b3d8215b9bf799f648be71cb"- integrity sha512-nwQoYb3m4DDpHTeOwpJEuDt8lWVcujhYYSFGLluC+9es2PyLjm+jjq3IeRBQbwBtPLJE/lkuHuGHr8uQLgmJRA==+"@remix-run/[email protected]":+ version "1.1.0"+ resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.1.0.tgz#b48db8148c8a888e50580a8152b6f68161c49406"+ integrity sha512-rGl+jH/7x1KBCQScz9p54p0dtPLNeKGb3e0wD2H5/oZj41bwQUnXdzbj2TbUAFhvD7cp9EyEQA4dEgpUFa1O7Q==-"@remix-run/serve@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/serve/-/serve-1.11.1.tgz#8934c2838ddf765b3aeec82998dd5eb601066485"- integrity sha512-a39vG0DhKIQfjlK9yHX17VOjBw+MyPYtHG7/tJtsE204s93pahZZMM7nBjsUrdx6zjwht8v6uoF4lZTEzzrSwg==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/serve/-/serve-1.9.0.tgz#b415ddb3006715bbe92788267e5768b71ca726a7"+ integrity sha512-dERDi06Qqd5VIHvtHx++Wna4NX+lrtUFFuMdPyDmn3ii8RVhh0yED7yJBe3t0k3Syk5IysMc3V49k6pOGtEsdQ==dependencies:- "@remix-run/express" "1.11.1"+ "@remix-run/express" "1.9.0"compression "^1.7.4"express "^4.17.1"morgan "^1.10.0"-"@remix-run/[email protected]":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/server-runtime/-/server-runtime-1.11.1.tgz#58f9509ddccdafb21ad6480ee7e9cf2248d5f06a"- integrity sha512-D0jTiaUSMK0q29CTVL7Bn4SlE6fd4bnp18vxObjSXlA6VYrzDAK3pQ/1baDawPdxBDIQPqImXOQ6g4aAYImfCA==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/server-runtime/-/server-runtime-1.9.0.tgz#b0e1b0431fcd91daa6058691290f8ebb9519d922"+ integrity sha512-HNJGAzdp4JZqBtDqhi9tEtTxWztuQYruuMPyTlJmSWQhK3MdaOs7F9DJtfFKAhy8LBOqniwpE5w27dkCx7trOg==dependencies:- "@remix-run/router" "1.3.0"+ "@remix-run/router" "1.1.0""@types/cookie" "^0.4.0""@web3-storage/multipart-parser" "^1.0.0"cookie "^0.4.1"set-cookie-parser "^2.4.8"source-map "^0.7.3"-"@remix-run/vercel@^1.11.1":- version "1.11.1"- resolved "https://registry.yarnpkg.com/@remix-run/vercel/-/vercel-1.11.1.tgz#1098fb16ea5cfb43a28ebf2a2b7697b3036cbab1"- integrity sha512-eh7LDHcPGEDZ6lv1ES+dMz7Xdz0RnG3sYBxhhF+fSL/u6A5wUpHJeTmAGMTzKyrVliX31qV62ehb2KR0Zpn+mg==+"@remix-run/[email protected]":+ version "1.9.0"+ resolved "https://registry.yarnpkg.com/@remix-run/vercel/-/vercel-1.9.0.tgz#359af372590f44020897b28a66881a372587f983"+ integrity sha512-pNtVUH6T5gJXgGk7UluK9iOwB+5QmB+UXDGMzyPic5ZGxqxWDTetIwqwLXgxV6xZvAfAClFE8Jf1kZXCUfE1HQ==dependencies:- "@remix-run/node" "1.11.1"+ "@remix-run/node" "1.9.0""@remix-run/web-blob@^3.0.3", "@remix-run/web-blob@^3.0.4":version "3.0.4"@@ -3434,13 +3200,6 @@dependencies:cross-fetch "^3.1.5"-"@supabase/gotrue-js@^2.7.2":- version "2.10.0"- resolved "https://registry.yarnpkg.com/@supabase/gotrue-js/-/gotrue-js-2.10.0.tgz#f92ca76e41dc7bf06374b73159bd3d3affa734eb"- integrity sha512-3k9zg+TN4rJFVbAWoX1KnOpKthb21HxYu87mBG8ccCXSl3fxnFBJNs898+pksj4fw5E6aM/dVtHHHAfV3MwVRQ==- dependencies:- cross-fetch "^3.1.5"-"@supabase/postgrest-js@^1.1.1":version "1.1.1"resolved "https://registry.yarnpkg.com/@supabase/postgrest-js/-/postgrest-js-1.1.1.tgz#2fa8d2bd14d443c82c5e20947f98d23b73f62ddc"@@ -3456,14 +3215,6 @@"@types/phoenix" "^1.5.4"websocket "^1.0.34"-"@supabase/realtime-js@^2.3.1":- version "2.3.1"- resolved "https://registry.yarnpkg.com/@supabase/realtime-js/-/realtime-js-2.3.1.tgz#b567441073e0b86c9be59bf8eccdc03df3e810fd"- integrity sha512-AX4pzZozVPvHAWfPcKl0UWj19pqwogD9TnCEHq1x/6oQjVoqA3n6H+1Ea2of9MheSroajHguaQMen3xLEoWrug==- dependencies:- "@types/phoenix" "^1.5.4"- websocket "^1.0.34"-"@supabase/storage-js@^2.1.0":version "2.1.0"resolved "https://registry.yarnpkg.com/@supabase/storage-js/-/storage-js-2.1.0.tgz#b855558ff5c2eaa5633b89193c8ec61aff53d59b"@@ -3483,18 +3234,6 @@"@supabase/storage-js" "^2.1.0"cross-fetch "^3.1.5"-"@supabase/supabase-js@^2.4.1":- version "2.4.1"- resolved "https://registry.yarnpkg.com/@supabase/supabase-js/-/supabase-js-2.4.1.tgz#ac5e52ea2a267e62588fec399a9083a8df1e5d39"- integrity sha512-nFePO2yKVip3VI+OyfUOxhv0IyMmZDeieFJS39y84evPOM9zuZomEmkhwnmEWrLFI7hSr+o2QvY4P+q3c2MbGQ==- dependencies:- "@supabase/functions-js" "^2.0.0"- "@supabase/gotrue-js" "^2.7.2"- "@supabase/postgrest-js" "^1.1.1"- "@supabase/realtime-js" "^2.3.1"- "@supabase/storage-js" "^2.1.0"- cross-fetch "^3.1.5"-"@swc/helpers@^0.4.14":version "0.4.14"resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.14.tgz#1352ac6d95e3617ccb7c1498ff019654f1e12a74"@@ -4152,51 +3891,6 @@"@typescript-eslint/types" "5.40.1"eslint-visitor-keys "^3.3.0"-"@vanilla-extract/babel-plugin-debug-ids@^1.0.1":- version "1.0.1"- resolved "https://registry.yarnpkg.com/@vanilla-extract/babel-plugin-debug-ids/-/babel-plugin-debug-ids-1.0.1.tgz#d20bd0c9ec867ca892fcf665dca171110aa2a1e1"- integrity sha512-ynyKqsJiMzM1/yiIJ6QdqpWKlK4IMJJWREpPtaemZrE1xG1B4E/Nfa6YazuDWjDkCJC1tRIpEGnVs+pMIjUxyw==- dependencies:- "@babel/core" "^7.20.7"--"@vanilla-extract/css@^1.9.3":- version "1.9.3"- resolved "https://registry.yarnpkg.com/@vanilla-extract/css/-/css-1.9.3.tgz#59cd445e9ffa9676c4faf7f213ddf6538404c92c"- integrity sha512-vitcD8usEOTWDLAnbtnZ46YbHADAp3Es+3xyHsMDMZOEWk03FhD+PbR58kdwtGpr258+hMryCYtQPeFh5lWFbA==- dependencies:- "@emotion/hash" "^0.9.0"- "@vanilla-extract/private" "^1.0.3"- ahocorasick "1.0.2"- chalk "^4.1.1"- css-what "^5.0.1"- cssesc "^3.0.0"- csstype "^3.0.7"- deep-object-diff "^1.1.0"- deepmerge "^4.2.2"- media-query-parser "^2.0.2"- outdent "^0.8.0"--"@vanilla-extract/integration@^6.0.1":- version "6.0.2"- resolved "https://registry.yarnpkg.com/@vanilla-extract/integration/-/integration-6.0.2.tgz#ff9f03ef0d1d0fedc681f15f450af2dc52b0e60f"- integrity sha512-LwfXlh0THeNvVXdA3iWFYvJs1mvEP1PkfQD/7S6Purry7L8iDizDV/87FgWBJ79FnTmYIvMrc7BOQsUajNj9VQ==- dependencies:- "@babel/core" "^7.20.7"- "@babel/plugin-syntax-typescript" "^7.20.0"- "@vanilla-extract/babel-plugin-debug-ids" "^1.0.1"- "@vanilla-extract/css" "^1.9.3"- esbuild "^0.16.3"- eval "0.1.6"- find-up "^5.0.0"- javascript-stringify "^2.0.1"- lodash "^4.17.21"- outdent "^0.8.0"--"@vanilla-extract/private@^1.0.3":- version "1.0.3"- resolved "https://registry.yarnpkg.com/@vanilla-extract/private/-/private-1.0.3.tgz#7ec72bc2ff6fe51f9d650f962e8d1989b073690f"- integrity sha512-17kVyLq3ePTKOkveHxXuIJZtGYs+cSoev7BlP+Lf4916qfDhk/HBjvlYDe8egrea7LNPHKwSZJK/bzZC+Q6AwQ==-"@vercel/[email protected]":version "5.7.0"resolved "https://registry.yarnpkg.com/@vercel/build-utils/-/build-utils-5.7.0.tgz#73f5b66ee970a2712cfea62a19e04f6869c589f5"@@ -4321,11 +4015,6 @@ aggregate-error@^3.0.0:clean-stack "^2.0.0"indent-string "^4.0.0"- version "1.0.2"- resolved "https://registry.yarnpkg.com/ahocorasick/-/ahocorasick-1.0.2.tgz#9eee93aef9d02bfb476d9b648d9b7a40ef2fd500"- integrity sha512-hCOfMzbFx5IDutmWLAt6MZwOUjIfSM9G9FyVxytmE4Rs/5YDPWQrD/+IR1w+FweD9H2oOZEnv36TmkjhNURBVA==-version "8.6.3"resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.6.3.tgz#11a66527761dc3e9a3845ea775d2d3c0414e8764"@@ -5395,16 +5084,6 @@ [email protected]:dependencies:tiny-invariant "^1.0.6"-css-what@^5.0.1:- version "5.1.0"- resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe"- integrity sha512-arSMRWIIFY0hV8pIxZMEfmMI47Wj3R/aWpZDDxWYCPEiOMv6tfOrnpDtgxBYPEQD4V0Y/958+1TdC3iWTFcUPw==--cssesc@^3.0.0:- version "3.0.0"- resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"- integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==-cssom@^0.4.4:version "0.4.4"resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10"@@ -5422,7 +5101,7 @@ cssstyle@^2.3.0:dependencies:cssom "~0.3.6"-csstype@^3.0.11, csstype@^3.0.2, csstype@^3.0.7:+csstype@^3.0.11, csstype@^3.0.2:version "3.1.1"resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==@@ -5584,11 +5263,6 @@ deep-is@^0.1.3, deep-is@~0.1.3:resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==-deep-object-diff@^1.1.0:- version "1.1.9"- resolved "https://registry.yarnpkg.com/deep-object-diff/-/deep-object-diff-1.1.9.tgz#6df7ef035ad6a0caa44479c536ed7b02570f4595"- integrity sha512-Rn+RuwkmkDwCi2/oXOFS9Gsr5lJZu/yTGpK7wAaAIE75CC+LCGEZHpY6VQJa/RoJcrmaA/docWJZvYohlNkWPA==-deepmerge@^4.2.2:version "4.2.2"resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"@@ -6302,34 +5976,6 @@ esbuild@^0.15.1:esbuild-windows-64 "0.15.12"esbuild-windows-arm64 "0.15.12"-esbuild@^0.16.3:- version "0.16.17"- resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.16.17.tgz#fc2c3914c57ee750635fee71b89f615f25065259"- integrity sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==- optionalDependencies:- "@esbuild/android-arm" "0.16.17"- "@esbuild/android-arm64" "0.16.17"- "@esbuild/android-x64" "0.16.17"- "@esbuild/darwin-arm64" "0.16.17"- "@esbuild/darwin-x64" "0.16.17"- "@esbuild/freebsd-arm64" "0.16.17"- "@esbuild/freebsd-x64" "0.16.17"- "@esbuild/linux-arm" "0.16.17"- "@esbuild/linux-arm64" "0.16.17"- "@esbuild/linux-ia32" "0.16.17"- "@esbuild/linux-loong64" "0.16.17"- "@esbuild/linux-mips64el" "0.16.17"- "@esbuild/linux-ppc64" "0.16.17"- "@esbuild/linux-riscv64" "0.16.17"- "@esbuild/linux-s390x" "0.16.17"- "@esbuild/linux-x64" "0.16.17"- "@esbuild/netbsd-x64" "0.16.17"- "@esbuild/openbsd-x64" "0.16.17"- "@esbuild/sunos-x64" "0.16.17"- "@esbuild/win32-arm64" "0.16.17"- "@esbuild/win32-ia32" "0.16.17"- "@esbuild/win32-x64" "0.16.17"-esbuild@~0.15.10:version "0.15.15"resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.15.tgz#503b70bdc18d72d8fc2962ed3ab9219249e58bbe"@@ -6795,13 +6441,6 @@ etag@~1.8.1:resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887"integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==- version "0.1.6"- resolved "https://registry.yarnpkg.com/eval/-/eval-0.1.6.tgz#9620d7d8c85515e97e6b47c5814f46ae381cb3cc"- integrity sha512-o0XUw+5OGkXw4pJZzQoXUk+H87DHuC+7ZE//oSrRGtatTmr12oTnLfg6QOq9DyTt0c/p4TwzgmkKrBzWTSizyQ==- dependencies:- require-like ">= 0.1.1"-event-target-shim@^5.0.0:version "5.0.1"resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"@@ -7300,13 +6939,6 @@ functions-have-names@^1.2.2:resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834"integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==-generic-names@^4.0.0:- version "4.0.0"- resolved "https://registry.yarnpkg.com/generic-names/-/generic-names-4.0.0.tgz#0bd8a2fd23fe8ea16cbd0a279acd69c06933d9a3"- integrity sha512-ySFolZQfw9FoDb3ed9d80Cm9f0+r7qj+HJkWjeD9RBfpxEVTlVhol+gvaQB/78WbwYfbnNh8nWHHBSlg072y6A==- dependencies:- loader-utils "^3.2.0"-gensync@^1.0.0-beta.2:version "1.0.0-beta.2"resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0"@@ -7748,11 +7380,6 @@ [email protected], iconv-lite@^0.4.24:dependencies:safer-buffer ">= 2.1.2 < 3"-icss-utils@^5.0.0, icss-utils@^5.1.0:- version "5.1.0"- resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae"- integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==-ieee754@^1.1.13:version "1.2.1"resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"@@ -8321,11 +7948,6 @@ istanbul-reports@^3.0.2:html-escaper "^2.0.0"istanbul-lib-report "^3.0.0"-javascript-stringify@^2.0.1:- version "2.1.0"- resolved "https://registry.yarnpkg.com/javascript-stringify/-/javascript-stringify-2.1.0.tgz#27c76539be14d8bd128219a2d731b09337904e79"- integrity sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==-jest-changed-files@^26.6.2:version "26.6.2"resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0"@@ -8852,11 +8474,6 @@ json5@^1.0.1:dependencies:minimist "^1.2.0"-json5@^2.2.2:- version "2.2.3"- resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283"- integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==-jsonfile@^4.0.0:version "4.0.0"resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"@@ -8989,11 +8606,6 @@ loader-utils@^2.0.0:emojis-list "^3.0.0"json5 "^2.1.2"-loader-utils@^3.2.0:- version "3.2.1"- resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-3.2.1.tgz#4fb104b599daafd82ef3e1a41fb9265f87e1f576"- integrity sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==-locate-path@^3.0.0:version "3.0.0"resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"@@ -9016,11 +8628,6 @@ locate-path@^6.0.0:dependencies:p-locate "^5.0.0"-lodash.camelcase@^4.3.0:- version "4.3.0"- resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6"- integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==-lodash.debounce@^4.0.8:version "4.0.8"resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"@@ -9105,11 +8712,6 @@ lru-cache@^6.0.0:dependencies:yallist "^4.0.0"-lru-cache@^7.14.1:- version "7.14.1"- resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.14.1.tgz#8da8d2f5f59827edb388e63e459ac23d6d408fea"- integrity sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA==-luxon@^3.1.0:version "3.1.1"resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.1.1.tgz#b492c645b2474fb86f3bd3283213846b99c32c1e"@@ -9288,13 +8890,6 @@ mdurl@^1.0.0:resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e"integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==-media-query-parser@^2.0.2:- version "2.0.2"- resolved "https://registry.yarnpkg.com/media-query-parser/-/media-query-parser-2.0.2.tgz#ff79e56cee92615a304a1c2fa4f2bd056c0a1d29"- integrity sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w==- dependencies:- "@babel/runtime" "^7.12.5"-version "0.3.0"resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748"@@ -9849,11 +9444,6 @@ mz@^2.7.0:object-assign "^4.0.1"thenify-all "^1.0.0"-nanoid@^3.3.4:- version "3.3.4"- resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab"- integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==-nanomatch@^1.2.9:version "1.2.13"resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"@@ -10206,11 +9796,6 @@ os-tmpdir@~1.0.2:resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==-outdent@^0.8.0:- version "0.8.0"- resolved "https://registry.yarnpkg.com/outdent/-/outdent-0.8.0.tgz#2ebc3e77bf49912543f1008100ff8e7f44428eb0"- integrity sha512-KiOAIsdpUTcAXuykya5fnVVT+/5uS0Q1mrkRHcF89tpieSmY33O/tmc54CqwA+bfhbtEfZUNLHaPUiB9X3jt1A==-p-cancelable@^2.0.0:version "2.1.1"resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf"@@ -10484,11 +10069,6 @@ posix-character-classes@^0.1.0:resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==-postcss-discard-duplicates@^5.1.0:- version "5.1.0"- resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-5.1.0.tgz#9eb4fe8456706a4eebd6d3b7b777d07bad03e848"- integrity sha512-zmX3IoSI2aoenxHV6C7plngHWWhUOV3sP1T8y2ifzxzbtnuhk1EdPwm0S1bIUNaJ2eNbWeGLEwzw8huPD67aQw==-postcss-load-config@^3.0.1:version "3.1.4"resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855"@@ -10497,70 +10077,6 @@ postcss-load-config@^3.0.1:lilconfig "^2.0.5"yaml "^1.10.2"-postcss-modules-extract-imports@^3.0.0:- version "3.0.0"- resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.0.0.tgz#cda1f047c0ae80c97dbe28c3e76a43b88025741d"- integrity sha512-bdHleFnP3kZ4NYDhuGlVK+CMrQ/pqUm8bx/oGL93K6gVwiclvX5x0n76fYMKuIGKzlABOy13zsvqjb0f92TEXw==--postcss-modules-local-by-default@^4.0.0:- version "4.0.0"- resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.0.0.tgz#ebbb54fae1598eecfdf691a02b3ff3b390a5a51c"- integrity sha512-sT7ihtmGSF9yhm6ggikHdV0hlziDTX7oFoXtuVWeDd3hHObNkcHRo9V3yg7vCAY7cONyxJC/XXCmmiHHcvX7bQ==- dependencies:- icss-utils "^5.0.0"- postcss-selector-parser "^6.0.2"- postcss-value-parser "^4.1.0"--postcss-modules-scope@^3.0.0:- version "3.0.0"- resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.0.0.tgz#9ef3151456d3bbfa120ca44898dfca6f2fa01f06"- integrity sha512-hncihwFA2yPath8oZ15PZqvWGkWf+XUfQgUGamS4LqoP1anQLOsOJw0vr7J7IwLpoY9fatA2qiGUGmuZL0Iqlg==- dependencies:- postcss-selector-parser "^6.0.4"--postcss-modules-values@^4.0.0:- version "4.0.0"- resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c"- integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==- dependencies:- icss-utils "^5.0.0"--postcss-modules@^6.0.0:- version "6.0.0"- resolved "https://registry.yarnpkg.com/postcss-modules/-/postcss-modules-6.0.0.tgz#cac283dbabbbdc2558c45391cbd0e2df9ec50118"- integrity sha512-7DGfnlyi/ju82BRzTIjWS5C4Tafmzl3R79YP/PASiocj+aa6yYphHhhKUOEoXQToId5rgyFgJ88+ccOUydjBXQ==- dependencies:- generic-names "^4.0.0"- icss-utils "^5.1.0"- lodash.camelcase "^4.3.0"- postcss-modules-extract-imports "^3.0.0"- postcss-modules-local-by-default "^4.0.0"- postcss-modules-scope "^3.0.0"- postcss-modules-values "^4.0.0"- string-hash "^1.1.1"--postcss-selector-parser@^6.0.2, postcss-selector-parser@^6.0.4:- version "6.0.11"- resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.0.11.tgz#2e41dc39b7ad74046e1615185185cd0b17d0c8dc"- integrity sha512-zbARubNdogI9j7WY4nQJBiNqQf3sLS3wCP4WfOidu+p28LofJqDH1tcXypGrcmMHhDk2t9wGhCsYe/+szLTy1g==- dependencies:- cssesc "^3.0.0"- util-deprecate "^1.0.2"--postcss-value-parser@^4.1.0:- version "4.2.0"- resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514"- integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==--postcss@^8.4.19:- version "8.4.21"- resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.21.tgz#c639b719a57efc3187b13a1d765675485f4134f4"- integrity sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==- dependencies:- nanoid "^3.3.4"- picocolors "^1.0.0"- source-map-js "^1.0.2"-prelude-ls@^1.2.1:version "1.2.1"resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"@@ -10824,20 +10340,20 @@ react-remove-scroll@^2.5.4:use-callback-ref "^1.3.0"use-sidecar "^1.1.2"- version "6.7.0"- resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.7.0.tgz#0249f4ca4eb704562b8b0ff29caeb928c3a6ed38"- integrity sha512-jQtXUJyhso3kFw430+0SPCbmCmY1/kJv8iRffGHwHy3CkoomGxeYzMkmeSPYo6Egzh3FKJZRAL22yg5p2tXtfg==+ version "6.5.0"+ resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.5.0.tgz#3970bdcaa7c710a6e0b478a833ba0b4b8ae61a6f"+ integrity sha512-/XzRc5fq80gW1ctiIGilyKFZC/j4kfe75uivMsTChFbkvrK4ZrF3P3cGIc1f/SSkQ4JiJozPrf+AwUHHWVehVg==dependencies:- "@remix-run/router" "1.3.0"- react-router "6.7.0"+ "@remix-run/router" "1.1.0"+ react-router "6.5.0"- version "6.7.0"- resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.7.0.tgz#db262684c13b5c2970694084ae9e8531718a0681"- integrity sha512-KNWlG622ddq29MAM159uUsNMdbX8USruoKnwMMQcs/QWZgFUayICSn2oB7reHce1zPj6CG18kfkZIunSSRyGHg==+ version "6.5.0"+ resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.5.0.tgz#b53f15543a60750c925609d2e38037ac5aed6dd3"+ integrity sha512-fqqUSU0NC0tSX0sZbyuxzuAzvGqbjiZItBQnyicWlOUmzhAU8YuLgRbaCL2hf3sJdtRy4LP/WBrWtARkMvdGPQ==dependencies:- "@remix-run/router" "1.3.0"+ "@remix-run/router" "1.1.0"react-select@^5.5.1:version "5.5.4"@@ -11168,11 +10684,6 @@ require-from-string@^2.0.2:resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==-"require-like@>= 0.1.1":- version "0.1.2"- resolved "https://registry.yarnpkg.com/require-like/-/require-like-0.1.2.tgz#ad6f30c13becd797010c468afa775c0c0a6b47fa"- integrity sha512-oyrU88skkMtDdauHDuKVrgR+zuItqr6/c//FXzvmxRGMexSDc6hNvJInGW3LL46n+8b50RykrvwSUIIQH2LQ5A==-require-main-filename@^2.0.0:version "2.0.0"resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"@@ -11619,11 +11130,6 @@ sort-package-json@^1.55.0:is-plain-obj "2.1.0"sort-object-keys "^1.1.3"-source-map-js@^1.0.2:- version "1.0.2"- resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"- integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==-source-map-resolve@^0.5.0:version "0.5.3"resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"@@ -11760,11 +11266,6 @@ stream-slice@^0.1.2:resolved "https://registry.yarnpkg.com/stream-slice/-/stream-slice-0.1.2.tgz#2dc4f4e1b936fb13f3eb39a2def1932798d07a4b"integrity sha512-QzQxpoacatkreL6jsxnVb7X5R/pGw9OUv2qWTYWnmLpg4NdN31snPy/f3TdQE1ZUXaThRvj1Zw4/OGg0ZkaLMA==-string-hash@^1.1.1:- version "1.1.3"- resolved "https://registry.yarnpkg.com/string-hash/-/string-hash-1.1.3.tgz#e8aafc0ac1855b4666929ed7dd1275df5d6c811b"- integrity sha512-kJUvRUFK49aub+a7T1nNE66EJbZBMnBgoC1UbCZ5n6bsZKBRga4KgBRTMn/pFkeCZSYtNeSyMxPDM0AXWELk2A==-string-length@^4.0.1:version "4.0.2"resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a"@@ -12687,7 +12188,7 @@ utf-8-validate@^5.0.2:dependencies:node-gyp-build "^4.3.0"-util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:+util-deprecate@^1.0.1, util-deprecate@~1.0.1:version "1.0.2"resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==