Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Team (#952)

Goldflagf2ef9c41af55
diff --git a/client/messages/cs.json b/client/messages/cs.json
index 45fa2f605..4caf15693 100644
--- a/client/messages/cs.json
+++ b/client/messages/cs.json
@@ -597,8 +597,8 @@
"zINlao": "Vlastník",
"iHN12u": "Administrátor",
"7L86Z5": "Člen",
- "v+BwPW": "Přidat do organizace",
"Nvr5Ce": "Přidávám...",
+ "v+BwPW": "Přidat do organizace",
"Msn3jj": "Filtrovat podle emailu...",
"gO9HzB": "Filtrovat podle role",
"9nrF+x": "Všechny role",
@@ -763,64 +763,67 @@
"hxZIZ2": "Tuto akci nelze vrátit zpět. Trvale se smaže tvůj účet a odstraní všechna tvá data z našich serverů.",
"NQgbYA": "Nastavení účtu",
"xrcdXO": "Spravuj nastavení svého osobního účtu",
- "soeWeh": "Nastavení organizace",
- "BX8PCh": "Spravuj nastavení a členy své organizace",
- "L1FoVW": "Nemáš oprávnění zobrazit nastavení organizace.",
- "cU/aSG": "Email je povinný",
- "nY0P01": "Uživatel úspěšně vytvořen",
- "9tjZ7S": "Nepodařilo se vytvořit uživatele",
- "nVYMBG": "Vytvořit uživatele",
- "nIe+Wv": "Vytvořit nového uživatele",
- "Hj0Og1": "Vytvoř nového uživatele pro tuto organizaci.",
- "aUHRPX": "Pro potvrzení smazání zadej prosím název organizace",
- "BhlBsq": "Organizace úspěšně smazána",
- "aJPdOp": "Nepodařilo se smazat organizaci",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Smazat organizaci",
- "6Z97iS": "Organizaci nelze smazat",
- "hlRoFR": "Smazat tvou organizaci?",
- "ebEqgQ": "Máš aktivní předplatné. Před smazáním organizace prosím zruš své předplatné.",
- "onG0m+": "Tuto akci nelze vrátit zpět. Trvale se smaže organizace a odstraní všechna přidružená data.",
- "U3dHSt": "Pro potvrzení zadej prosím {name}.",
- "EQ6bAU": "Pozvánka zrušena",
- "maVOcA": "Nepodařilo se zrušit pozvánku",
- "CYCKhR": "Pozvánka znovu odeslána na {email}",
- "vPBvvX": "Nepodařilo se znovu odeslat pozvánku",
- "HyiDcy": "Pozvánky",
- "xhQMeQ": "Vyprší",
- "eKEL/g": "Čekající",
- "aFyFm0": "Přijato",
- "5qaD7s": "Odmítnuto",
- "PFtMy9": "Zrušeno",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Zpracovávám...",
- "IXycMo": "Odeslat znovu",
- "ou8jxS": "Žádné čekající pozvánky",
- "4gXpPi": "Pozvánka odeslána na {email}",
- "CHTM5p": "Nepodařilo se odeslat pozvánku",
- "vCL+NV": "Vyber prosím alespoň jeden web nebo vypni omezení webů",
- "GwX3m4": "Upgraduj na Pro pro přidání více členů",
- "hncBRq": "Pozvat člena",
- "bV5L3t": "Dosáhl jsi limitu {limit} členů. Upgraduj pro přidání dalších členů",
- "+kHMr5": "Pozvat nového člena",
- "lXZjmr": "Pozvi nového člena do této organizace.",
- "B3uRNN": "Omezit přístup na konkrétní weby",
- "cEIr3W": "Tento člen bude mít přístup pouze k vybraným webům.",
- "ptwP96": "Odesílám pozvánku...",
- "hYOE+U": "Pozvat",
- "x8CB7X": "Přístup k webům úspěšně aktualizován",
- "Qf3sJJ": "Nepodařilo se aktualizovat přístup k webům",
- "np+cff": "Přístup k webům pro {name}",
- "gAmHPq": "Nastav, ke kterým webům má tento člen přístup.",
- "XkF2/1": "Role administrátor a vlastník mají přístup ke všem webům a nelze je omezit.",
- "/EBXiO": "Tento člen má přístup ke všem webům v organizaci.",
- "IZ9nkN": "Vlastníci organizace",
- "yAaNQA": "Administrátoři",
- "AS5k+b": "mají automaticky přístup ke všem webům.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} webů",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Uložit změny",
- "F9OK6H": "Člen úspěšně odebrán",
- "g8H9Vw": "Nepodařilo se odebrat člena",
- "qhbBD7": "Odebrat člena",
- "acsXQE": "Opravdu chceš odebrat {name} z organizace?",
- "RC2XA4": "Odebírám...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "Název organizace nemůže být prázdný",
"xIB8Kg": "Nepodařilo se aktualizovat název organizace",
"fTWodj": "Název organizace",
@@ -828,14 +831,41 @@
"i7B/4+": "Trvale smaž tuto organizaci a všechna její data",
"O8Sc7E": "Přístup k webům",
"l8wanU": "Připojen",
- "OtSSs+": "{count} webů",
"iv7EVe": "Všechny weby",
"qrWOxx": "Žádní členové nenalezeni",
"Q5kEny": "Načítám organizaci...",
"8g8bMC": "Před správou členů musíš vytvořit organizaci nebo být do ní přidán.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Pro správu předplatného musíš vybrat organizaci.",
"JgKGg8": "Nejsi vlastník",
"siqsij": "Předplatné může spravovat pouze vlastník organizace.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Registrace",
"acrOoz": "Pokračovat",
"uCk8r+": "Už máš účet?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Napiš nový štítek...",
"wXpKtu": "Existující štítky:",
"jvo0vs": "Uložit",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Využití za {period}",
"zQvVDJ": "Vše",
"GEs+cY": "Kontroluji instalaci...",
diff --git a/client/messages/de.json b/client/messages/de.json
index d1ea5bf69..7e8852106 100644
--- a/client/messages/de.json
+++ b/client/messages/de.json
@@ -597,8 +597,8 @@
"zINlao": "Inhaber",
"iHN12u": "Administrator",
"7L86Z5": "Mitglied",
- "v+BwPW": "Zur Organisation hinzufügen",
"Nvr5Ce": "Wird hinzugefügt...",
+ "v+BwPW": "Zur Organisation hinzufügen",
"Msn3jj": "Nach E-Mail filtern...",
"gO9HzB": "Nach Rolle filtern",
"9nrF+x": "Alle Rollen",
@@ -763,64 +763,67 @@
"hxZIZ2": "Diese Aktion kann nicht rückgängig gemacht werden. Ihr Konto und alle Daten werden dauerhaft von unseren Servern gelöscht.",
"NQgbYA": "Kontoeinstellungen",
"xrcdXO": "Verwalten Sie Ihre persönlichen Kontoeinstellungen",
- "soeWeh": "Organisationseinstellungen",
- "BX8PCh": "Verwalten Sie Ihre Organisationseinstellungen und Mitglieder",
- "L1FoVW": "Sie haben keine Berechtigung, die Organisationseinstellungen anzuzeigen.",
- "cU/aSG": "E-Mail ist erforderlich",
- "nY0P01": "Benutzer erfolgreich erstellt",
- "9tjZ7S": "Benutzer konnte nicht erstellt werden",
- "nVYMBG": "Benutzer erstellen",
- "nIe+Wv": "Neuen Benutzer erstellen",
- "Hj0Og1": "Erstellen Sie einen neuen Benutzer für diese Organisation.",
- "aUHRPX": "Bitte geben Sie den Organisationsnamen zur Bestätigung der Löschung ein",
- "BhlBsq": "Organisation erfolgreich gelöscht",
- "aJPdOp": "Organisation konnte nicht gelöscht werden",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Organisation löschen",
- "6Z97iS": "Organisation kann nicht gelöscht werden",
- "hlRoFR": "Organisation löschen?",
- "ebEqgQ": "Sie haben ein aktives Abonnement. Bitte kündigen Sie Ihr Abonnement, bevor Sie die Organisation löschen.",
- "onG0m+": "Diese Aktion kann nicht rückgängig gemacht werden. Die Organisation und alle zugehörigen Daten werden dauerhaft gelöscht.",
- "U3dHSt": "Bitte geben Sie {name} zur Bestätigung ein.",
- "EQ6bAU": "Einladung storniert",
- "maVOcA": "Einladung konnte nicht storniert werden",
- "CYCKhR": "Einladung erneut an {email} gesendet",
- "vPBvvX": "Einladung konnte nicht erneut gesendet werden",
- "HyiDcy": "Einladungen",
- "xhQMeQ": "Läuft ab",
- "eKEL/g": "Ausstehend",
- "aFyFm0": "Akzeptiert",
- "5qaD7s": "Abgelehnt",
- "PFtMy9": "Abgebrochen",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Wird verarbeitet...",
- "IXycMo": "Erneut senden",
- "ou8jxS": "Keine ausstehenden Einladungen",
- "4gXpPi": "Einladung an {email} gesendet",
- "CHTM5p": "Einladung konnte nicht gesendet werden",
- "vCL+NV": "Bitte wählen Sie mindestens eine Website aus oder deaktivieren Sie die Website-Beschränkungen",
- "GwX3m4": "Upgrade auf Pro, um weitere Mitglieder hinzuzufügen",
- "hncBRq": "Mitglied einladen",
- "bV5L3t": "Sie haben das Limit von {limit} Mitgliedern erreicht. Upgraden Sie, um weitere hinzuzufügen",
- "+kHMr5": "Neues Mitglied einladen",
- "lXZjmr": "Laden Sie ein neues Mitglied in diese Organisation ein.",
- "B3uRNN": "Zugriff auf bestimmte Websites beschränken",
- "cEIr3W": "Dieses Mitglied hat nur Zugriff auf die ausgewählten Websites.",
- "ptwP96": "Wird eingeladen...",
- "hYOE+U": "Einladen",
- "x8CB7X": "Website-Zugriff erfolgreich aktualisiert",
- "Qf3sJJ": "Website-Zugriff konnte nicht aktualisiert werden",
- "np+cff": "Website-Zugriff für {name}",
- "gAmHPq": "Konfigurieren Sie, auf welche Websites dieses Mitglied zugreifen kann.",
- "XkF2/1": "Administrator- und Inhaberrollen haben Zugriff auf alle Websites und können nicht eingeschränkt werden.",
- "/EBXiO": "Dieses Mitglied hat Zugriff auf alle Websites der Organisation.",
- "IZ9nkN": "Organisationsinhaber",
- "yAaNQA": "Administratoren",
- "AS5k+b": "haben automatisch Zugriff auf alle Websites.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} Websites",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Änderungen speichern",
- "F9OK6H": "Mitglied erfolgreich entfernt",
- "g8H9Vw": "Mitglied konnte nicht entfernt werden",
- "qhbBD7": "Mitglied entfernen",
- "acsXQE": "Sind Sie sicher, dass Sie {name} aus der Organisation entfernen möchten?",
- "RC2XA4": "Wird entfernt...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "Organisationsname darf nicht leer sein",
"xIB8Kg": "Organisationsname konnte nicht aktualisiert werden",
"fTWodj": "Organisationsname",
@@ -828,14 +831,41 @@
"i7B/4+": "Diese Organisation und alle zugehörigen Daten dauerhaft löschen",
"O8Sc7E": "Website-Zugriff",
"l8wanU": "Beigetreten",
- "OtSSs+": "{count} Websites",
"iv7EVe": "Alle Websites",
"qrWOxx": "Keine Mitglieder gefunden",
"Q5kEny": "Organisation wird geladen...",
"8g8bMC": "Sie müssen eine Organisation erstellen oder einer beitreten, bevor Sie Mitglieder verwalten können.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Sie müssen eine Organisation auswählen, um Ihr Abonnement zu verwalten.",
"JgKGg8": "Kein Inhaber",
"siqsij": "Nur der Inhaber der Organisation kann das Abonnement verwalten.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Registrierung",
"acrOoz": "Weiter",
"uCk8r+": "Haben Sie bereits ein Konto?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Neuen Tag eingeben...",
"wXpKtu": "Vorhandene Tags:",
"jvo0vs": "Speichern",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "{period}-Nutzung",
"zQvVDJ": "Alle",
"GEs+cY": "Installation wird überprüft...",
diff --git a/client/messages/en.json b/client/messages/en.json
index 9521f5836..663a29a07 100644
--- a/client/messages/en.json
+++ b/client/messages/en.json
@@ -763,9 +763,6 @@
"hxZIZ2": "This action cannot be undone. This will permanently delete your account and remove all your data from our servers.",
"NQgbYA": "Account Settings",
"xrcdXO": "Manage your personal account settings",
- "soeWeh": "Organization Settings",
- "BX8PCh": "Manage your organization settings and members",
- "L1FoVW": "You don't have permission to view organization settings.",
"cU/aSG": "Email is required",
"nY0P01": "User created successfully",
"9tjZ7S": "Failed to create user",
@@ -804,6 +801,9 @@
"lXZjmr": "Invite a new member to this organization.",
"B3uRNN": "Restrict access to specific sites",
"cEIr3W": "This member will only have access to the selected sites.",
+ "DNeuzb": "Teams",
+ "wMcv1G": "Optionally add this member to teams when they accept the invitation.",
+ "OtSSs+": "{count} sites",
"ptwP96": "Inviting...",
"hYOE+U": "Invite",
"x8CB7X": "Site access updated successfully",
@@ -821,6 +821,9 @@
"qhbBD7": "Remove Member",
"acsXQE": "Are you sure you want to remove {name} from the organization?",
"RC2XA4": "Removing...",
+ "soeWeh": "Organization Settings",
+ "BX8PCh": "Manage your organization settings and members",
+ "L1FoVW": "You don't have permission to view organization settings.",
"fhx8xT": "Organization name cannot be empty",
"xIB8Kg": "Failed to update organization name",
"fTWodj": "Organization Name",
@@ -828,14 +831,41 @@
"i7B/4+": "Permanently delete this organization and all its data",
"O8Sc7E": "Site Access",
"l8wanU": "Joined",
- "OtSSs+": "{count} sites",
"iv7EVe": "All sites",
"qrWOxx": "No members found",
"Q5kEny": "Loading organization...",
"8g8bMC": "You need to create or be added to an organization before you can manage members.",
+ "ZcBC7s": "Manage your subscription and billing.",
+ "oemoXC": "You don't have permission to view subscription settings.",
"GH6rlO": "You need to select an organization to manage your subscription.",
"JgKGg8": "Not an owner",
"siqsij": "Only the owner of the organization can manage the subscription.",
+ "L8DzHm": "Team name is required",
+ "21Ef1P": "Team updated successfully",
+ "EjE0iv": "Team created successfully",
+ "hfiE8k": "Failed to update team",
+ "DswPK3": "Failed to create team",
+ "97DGta": "Create Team",
+ "U01dmA": "Edit Team",
+ "03IKqU": "Update team name, members, and site assignments.",
+ "Ps71bZ": "Create a new team to group sites and control member access.",
+ "k+kHlN": "Team Name",
+ "Tqx+zH": "Enter team name",
+ "wNwwpZ": "Select which members belong to this team.",
+ "94Fg25": "Select all",
+ "pW35eH": "No members in this organization",
+ "20rO2E": "Select which sites belong to this team. Only team members (and admins/owners) will be able to access these sites.",
+ "Y8E+so": "No sites in this organization",
+ "IWfwim": "Team deleted successfully",
+ "iSNlf0": "Failed to delete team",
+ "oSW2J5": "Delete Team",
+ "+WnNru": "Are you sure you want to delete the team \"{name}\"? Sites assigned to this team will become unassigned and visible to all members.",
+ "f7uwif": "Organize sites into teams to control which members can access them.",
+ "cPbI/I": "You don't have permission to view team settings.",
+ "xA1LY9": "You need to create or be added to an organization before you can manage teams.",
+ "68djwb": "No teams yet",
+ "S5IFjk": "Create a team to group sites and manage member access.",
+ "StUScz": "{count} members",
"RNCPOG": "Signup",
"acrOoz": "Continue",
"uCk8r+": "Already have an account?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Type a new tag...",
"wXpKtu": "Existing tags:",
"jvo0vs": "Save",
+ "DoskyC": "All Teams",
+ "t6nrnE": "No Team",
"mHABbN": "{period} Usage",
"zQvVDJ": "All",
"GEs+cY": "Checking installation...",
diff --git a/client/messages/es.json b/client/messages/es.json
index d3569a151..31989ee5f 100644
--- a/client/messages/es.json
+++ b/client/messages/es.json
@@ -597,8 +597,8 @@
"zINlao": "Propietario",
"iHN12u": "Administrador",
"7L86Z5": "Miembro",
- "v+BwPW": "Añadir a la organización",
"Nvr5Ce": "Añadiendo...",
+ "v+BwPW": "Añadir a la organización",
"Msn3jj": "Filtrar por correo electrónico...",
"gO9HzB": "Filtrar por rol",
"9nrF+x": "Todos los roles",
@@ -763,64 +763,67 @@
"hxZIZ2": "Esta acción no se puede deshacer. Se eliminará permanentemente tu cuenta y todos tus datos de nuestros servidores.",
"NQgbYA": "Configuración de la cuenta",
"xrcdXO": "Administra la configuración de tu cuenta personal",
- "soeWeh": "Configuración de la organización",
- "BX8PCh": "Administra la configuración de tu organización y los miembros",
- "L1FoVW": "No tienes permiso para ver la configuración de la organización.",
- "cU/aSG": "El correo electrónico es obligatorio",
- "nY0P01": "Usuario creado correctamente",
- "9tjZ7S": "Error al crear usuario",
- "nVYMBG": "Crear usuario",
- "nIe+Wv": "Crear un nuevo usuario",
- "Hj0Og1": "Crea un nuevo usuario para esta organización.",
- "aUHRPX": "Por favor, escribe el nombre de la organización para confirmar la eliminación",
- "BhlBsq": "Organización eliminada correctamente",
- "aJPdOp": "Error al eliminar organización",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Eliminar organización",
- "6Z97iS": "No se puede eliminar la organización",
- "hlRoFR": "¿Eliminar tu organización?",
- "ebEqgQ": "Tienes una suscripción activa. Por favor, cancela tu suscripción antes de eliminar tu organización.",
- "onG0m+": "Esta acción no se puede deshacer. Eliminará permanentemente la organización y todos los datos asociados.",
- "U3dHSt": "Por favor, escribe {name} para confirmar.",
- "EQ6bAU": "Invitación cancelada",
- "maVOcA": "Error al cancelar la invitación",
- "CYCKhR": "Invitación reenviada a {email}",
- "vPBvvX": "Error al reenviar invitación",
- "HyiDcy": "Invitaciones",
- "xhQMeQ": "Caduca",
- "eKEL/g": "Pendiente",
- "aFyFm0": "Aceptada",
- "5qaD7s": "Rechazada",
- "PFtMy9": "Cancelada",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Procesando...",
- "IXycMo": "Reenviar",
- "ou8jxS": "No hay invitaciones pendientes",
- "4gXpPi": "Invitación enviada a {email}",
- "CHTM5p": "Error al enviar invitación",
- "vCL+NV": "Por favor, selecciona al menos un sitio o desactiva las restricciones del sitio",
- "GwX3m4": "Actualiza a Pro para añadir más miembros",
- "hncBRq": "Invitar miembro",
- "bV5L3t": "Has alcanzado el límite de {limit} miembros. Actualiza para añadir más miembros",
- "+kHMr5": "Invitar a un nuevo miembro",
- "lXZjmr": "Invita a un nuevo miembro a esta organización.",
- "B3uRNN": "Restringir el acceso a sitios específicos",
- "cEIr3W": "Este miembro solo tendrá acceso a los sitios seleccionados.",
- "ptwP96": "Invitando...",
- "hYOE+U": "Invitar",
- "x8CB7X": "Acceso al sitio actualizado correctamente",
- "Qf3sJJ": "Error al actualizar el acceso al sitio",
- "np+cff": "Acceso al sitio para {name}",
- "gAmHPq": "Configura a qué sitios puede acceder este miembro.",
- "XkF2/1": "Los roles de administrador y propietario tienen acceso a todos los sitios y no se pueden restringir.",
- "/EBXiO": "Este miembro tiene acceso a todos los sitios en la organización.",
- "IZ9nkN": "Propietarios de la organización",
- "yAaNQA": "Administradores",
- "AS5k+b": "automáticamente tienen acceso a todos los sitios.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} sitios",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Guardar cambios",
- "F9OK6H": "Miembro eliminado correctamente",
- "g8H9Vw": "Error al eliminar miembro",
- "qhbBD7": "Eliminar miembro",
- "acsXQE": "¿Estás seguro de que quieres eliminar a {name} de la organización?",
- "RC2XA4": "Eliminando...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "El nombre de la organización no puede estar vacío",
"xIB8Kg": "Error al actualizar el nombre de la organización",
"fTWodj": "Nombre de la organización",
@@ -828,14 +831,41 @@
"i7B/4+": "Elimina permanentemente esta organización y todos sus datos",
"O8Sc7E": "Acceso al sitio",
"l8wanU": "Unido",
- "OtSSs+": "{count} sitios",
"iv7EVe": "Todos los sitios",
"qrWOxx": "No se encontraron miembros",
"Q5kEny": "Cargando organización...",
"8g8bMC": "Necesitas crear o ser añadido a una organización antes de poder gestionar miembros.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Necesitas seleccionar una organización para gestionar tu suscripción.",
"JgKGg8": "No eres propietario",
"siqsij": "Solo el propietario de la organización puede gestionar la suscripción.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Registro",
"acrOoz": "Continuar",
"uCk8r+": "¿Ya tienes una cuenta?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Escribe una nueva etiqueta...",
"wXpKtu": "Etiquetas existentes:",
"jvo0vs": "Guardar",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Uso del {period}",
"zQvVDJ": "Todos",
"GEs+cY": "Comprobando instalación...",
diff --git a/client/messages/fr.json b/client/messages/fr.json
index 265134998..54272d345 100644
--- a/client/messages/fr.json
+++ b/client/messages/fr.json
@@ -597,8 +597,8 @@
"zINlao": "Propriétaire",
"iHN12u": "Administrateur",
"7L86Z5": "Membre",
- "v+BwPW": "Ajouter à l'organisation",
"Nvr5Ce": "Ajout en cours...",
+ "v+BwPW": "Ajouter à l'organisation",
"Msn3jj": "Filtrer par e-mail...",
"gO9HzB": "Filtrer par rôle",
"9nrF+x": "Tous les rôles",
@@ -763,64 +763,67 @@
"hxZIZ2": "Cette action est irréversible. Votre compte et toutes vos données seront définitivement supprimés de nos serveurs.",
"NQgbYA": "Paramètres du compte",
"xrcdXO": "Gérez vos paramètres personnels de compte",
- "soeWeh": "Paramètres de l'organisation",
- "BX8PCh": "Gérez les paramètres de votre organisation et les membres",
- "L1FoVW": "Vous n'avez pas la permission de voir les paramètres de l'organisation.",
- "cU/aSG": "L'e-mail est requis",
- "nY0P01": "Utilisateur créé avec succès",
- "9tjZ7S": "Échec de la création de l'utilisateur",
- "nVYMBG": "Créer un utilisateur",
- "nIe+Wv": "Créer un nouvel utilisateur",
- "Hj0Og1": "Créez un nouvel utilisateur pour cette organisation.",
- "aUHRPX": "Veuillez saisir le nom de l'organisation pour confirmer la suppression",
- "BhlBsq": "Organisation supprimée avec succès",
- "aJPdOp": "Échec de la suppression de l'organisation",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Supprimer l'organisation",
- "6Z97iS": "Impossible de supprimer l'organisation",
- "hlRoFR": "Supprimer votre organisation ?",
- "ebEqgQ": "Vous avez un abonnement actif. Veuillez annuler votre abonnement avant de supprimer l'organisation.",
- "onG0m+": "Cette action est irréversible. L'organisation et toutes les données associées seront définitivement supprimées.",
- "U3dHSt": "Veuillez saisir {name} pour confirmer.",
- "EQ6bAU": "Invitation annulée",
- "maVOcA": "Échec de l'annulation de l'invitation",
- "CYCKhR": "Invitation renvoyée à {email}",
- "vPBvvX": "Échec du renvoi de l'invitation",
- "HyiDcy": "Invitations",
- "xhQMeQ": "Expire",
- "eKEL/g": "En attente",
- "aFyFm0": "Acceptée",
- "5qaD7s": "Rejetée",
- "PFtMy9": "Annulée",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Traitement en cours...",
- "IXycMo": "Renvoyer",
- "ou8jxS": "Aucune invitation en attente",
- "4gXpPi": "Invitation envoyée à {email}",
- "CHTM5p": "Échec de l'envoi de l'invitation",
- "vCL+NV": "Veuillez sélectionner au moins un site ou désactiver les restrictions de site",
- "GwX3m4": "Passez à Pro pour ajouter plus de membres",
- "hncBRq": "Inviter un membre",
- "bV5L3t": "Vous avez atteint la limite de {limit} membres. Passez à un plan supérieur pour en ajouter plus",
- "+kHMr5": "Inviter un nouveau membre",
- "lXZjmr": "Invitez un nouveau membre dans cette organisation.",
- "B3uRNN": "Restreindre l'accès à des sites spécifiques",
- "cEIr3W": "Ce membre n'aura accès qu'aux sites sélectionnés.",
- "ptwP96": "Invitation en cours...",
- "hYOE+U": "Inviter",
- "x8CB7X": "Accès au site mis à jour avec succès",
- "Qf3sJJ": "Échec de la mise à jour de l'accès au site",
- "np+cff": "Accès au site pour {name}",
- "gAmHPq": "Configurez les sites auxquels ce membre peut accéder.",
- "XkF2/1": "Les rôles administrateur et propriétaire ont accès à tous les sites et ne peuvent pas être restreints.",
- "/EBXiO": "Ce membre a accès à tous les sites de l'organisation.",
- "IZ9nkN": "Propriétaires d'organisation",
- "yAaNQA": "Administrateurs",
- "AS5k+b": "ont automatiquement accès à tous les sites.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} sites",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Enregistrer les modifications",
- "F9OK6H": "Membre retiré avec succès",
- "g8H9Vw": "Échec du retrait du membre",
- "qhbBD7": "Retirer le membre",
- "acsXQE": "Êtes-vous sûr de vouloir retirer {name} de l'organisation ?",
- "RC2XA4": "Retrait en cours...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "Le nom de l'organisation ne peut pas être vide",
"xIB8Kg": "Échec de la mise à jour du nom de l'organisation",
"fTWodj": "Nom de l'organisation",
@@ -828,14 +831,41 @@
"i7B/4+": "Supprimer définitivement cette organisation et toutes ses données",
"O8Sc7E": "Accès au site",
"l8wanU": "Rejoint",
- "OtSSs+": "{count} sites",
"iv7EVe": "Tous les sites",
"qrWOxx": "Aucun membre trouvé",
"Q5kEny": "Chargement de l'organisation...",
"8g8bMC": "Vous devez créer ou rejoindre une organisation avant de pouvoir gérer les membres.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Vous devez sélectionner une organisation pour gérer votre abonnement.",
"JgKGg8": "Pas propriétaire",
"siqsij": "Seul le propriétaire de l'organisation peut gérer l'abonnement.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Inscription",
"acrOoz": "Continuer",
"uCk8r+": "Vous avez déjà un compte ?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Saisir un nouveau tag...",
"wXpKtu": "Tags existants :",
"jvo0vs": "Enregistrer",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Utilisation {period}",
"zQvVDJ": "Tous",
"GEs+cY": "Vérification de l'installation...",
diff --git a/client/messages/it.json b/client/messages/it.json
index 12a1e3ad0..7bf065798 100644
--- a/client/messages/it.json
+++ b/client/messages/it.json
@@ -597,8 +597,8 @@
"zINlao": "Proprietario",
"iHN12u": "Amministratore",
"7L86Z5": "Membro",
- "v+BwPW": "Aggiungi all'Organizzazione",
"Nvr5Ce": "Aggiunta in corso...",
+ "v+BwPW": "Aggiungi all'Organizzazione",
"Msn3jj": "Filtra per email...",
"gO9HzB": "Filtra per ruolo",
"9nrF+x": "Tutti i Ruoli",
@@ -763,64 +763,67 @@
"hxZIZ2": "Questa azione non può essere annullata. Questo eliminerà permanentemente il tuo account e rimuoverà tutti i tuoi dati dai nostri server.",
"NQgbYA": "Impostazioni Account",
"xrcdXO": "Gestisci le impostazioni del tuo account personale",
- "soeWeh": "Impostazioni organizzazione",
- "BX8PCh": "Gestisci le impostazioni della tua organizzazione e i membri",
- "L1FoVW": "Non hai il permesso di visualizzare le impostazioni dell'organizzazione.",
- "cU/aSG": "L'email è obbligatoria",
- "nY0P01": "Utente creato con successo",
- "9tjZ7S": "Impossibile creare l'utente",
- "nVYMBG": "Crea Utente",
- "nIe+Wv": "Crea un nuovo utente",
- "Hj0Og1": "Crea un nuovo utente per questa organizzazione.",
- "aUHRPX": "Digita il nome dell'organizzazione per confermare l'eliminazione",
- "BhlBsq": "Organizzazione eliminata con successo",
- "aJPdOp": "Impossibile eliminare l'organizzazione",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Elimina Organizzazione",
- "6Z97iS": "Impossibile eliminare l'organizzazione",
- "hlRoFR": "Eliminare la tua organizzazione?",
- "ebEqgQ": "Hai un abbonamento attivo. Cancella il tuo abbonamento prima di eliminare la tua organizzazione.",
- "onG0m+": "Questa azione non può essere annullata. Questo eliminerà permanentemente l'organizzazione e rimuoverà tutti i dati associati.",
- "U3dHSt": "Digita {name} per confermare.",
- "EQ6bAU": "Invito annullato",
- "maVOcA": "Impossibile annullare l'invito",
- "CYCKhR": "Invito inviato di nuovo a {email}",
- "vPBvvX": "Impossibile inviare di nuovo l'invito",
- "HyiDcy": "Inviti",
- "xhQMeQ": "Scade il",
- "eKEL/g": "In attesa",
- "aFyFm0": "Accettata",
- "5qaD7s": "Rifiutata",
- "PFtMy9": "Annullata",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Elaborazione in corso...",
- "IXycMo": "Invia di nuovo",
- "ou8jxS": "Nessun invito in sospeso",
- "4gXpPi": "Invito inviato a {email}",
- "CHTM5p": "Impossibile inviare l'invito",
- "vCL+NV": "Seleziona almeno un sito o disabilita le restrizioni del sito",
- "GwX3m4": "Passa a Pro per aggiungere più membri",
- "hncBRq": "Invita Membro",
- "bV5L3t": "Hai raggiunto il limite di {limit} membri. Aggiorna per aggiungere più membri",
- "+kHMr5": "Invita un nuovo membro",
- "lXZjmr": "Invita un nuovo membro in questa organizzazione.",
- "B3uRNN": "Limita l'accesso a siti specifici",
- "cEIr3W": "Questo membro avrà accesso solo ai siti selezionati.",
- "ptwP96": "Invito in corso...",
- "hYOE+U": "Invita",
- "x8CB7X": "Accesso al sito aggiornato con successo",
- "Qf3sJJ": "Impossibile aggiornare l'accesso al sito",
- "np+cff": "Accesso al Sito per {name}",
- "gAmHPq": "Configura a quali siti questo membro può accedere.",
- "XkF2/1": "I ruoli di amministratore e proprietario hanno accesso a tutti i siti e non possono essere limitati.",
- "/EBXiO": "Questo membro ha accesso a tutti i siti nell'organizzazione.",
- "IZ9nkN": "I proprietari dell'organizzazione",
- "yAaNQA": "Gli amministratori",
- "AS5k+b": "hanno automaticamente accesso a tutti i siti.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} siti",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Salva Modifiche",
- "F9OK6H": "Membro rimosso con successo",
- "g8H9Vw": "Impossibile rimuovere il membro",
- "qhbBD7": "Rimuovi Membro",
- "acsXQE": "Sei sicuro di voler rimuovere {name} dall'organizzazione?",
- "RC2XA4": "Rimozione in corso...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "Il nome dell'organizzazione non può essere vuoto",
"xIB8Kg": "Impossibile aggiornare il nome dell'organizzazione",
"fTWodj": "Nome Organizzazione",
@@ -828,14 +831,41 @@
"i7B/4+": "Elimina permanentemente questa organizzazione e tutti i suoi dati",
"O8Sc7E": "Accesso al Sito",
"l8wanU": "Unito il",
- "OtSSs+": "{count} siti",
"iv7EVe": "Tutti i siti",
"qrWOxx": "Nessun membro trovato",
"Q5kEny": "Caricamento organizzazione...",
"8g8bMC": "Devi creare o essere aggiunto a un'organizzazione prima di poter gestire i membri.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Devi selezionare un'organizzazione per gestire il tuo abbonamento.",
"JgKGg8": "Non sei un proprietario",
"siqsij": "Solo il proprietario dell'organizzazione può gestire l'abbonamento.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Registrazione",
"acrOoz": "Continua",
"uCk8r+": "Hai già un account?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Digita un nuovo tag...",
"wXpKtu": "Tag esistenti:",
"jvo0vs": "Salva",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Utilizzo {period}",
"zQvVDJ": "Tutto",
"GEs+cY": "Controllo installazione...",
diff --git a/client/messages/ja.json b/client/messages/ja.json
index 7c524c71f..f6ab7d1ed 100644
--- a/client/messages/ja.json
+++ b/client/messages/ja.json
@@ -597,8 +597,8 @@
"zINlao": "オーナー",
"iHN12u": "管理者",
"7L86Z5": "メンバー",
- "v+BwPW": "組織に追加",
"Nvr5Ce": "追加中...",
+ "v+BwPW": "組織に追加",
"Msn3jj": "メールでフィルター...",
"gO9HzB": "ロールでフィルター",
"9nrF+x": "すべてのロール",
@@ -763,64 +763,67 @@
"hxZIZ2": "この操作は元に戻せません。アカウントとすべてのデータがサーバーから完全に削除されます。",
"NQgbYA": "アカウント設定",
"xrcdXO": "個人のアカウント設定を管理",
- "soeWeh": "組織設定",
- "BX8PCh": "組織の設定とメンバーを管理します",
- "L1FoVW": "組織の設定を表示する権限がありません。",
- "cU/aSG": "メールアドレスは必須です",
- "nY0P01": "ユーザーを作成しました",
- "9tjZ7S": "ユーザーの作成に失敗しました",
- "nVYMBG": "ユーザーを作成",
- "nIe+Wv": "新しいユーザーを作成",
- "Hj0Og1": "この組織に新しいユーザーを作成します。",
- "aUHRPX": "削除を確認するために組織名を入力してください",
- "BhlBsq": "組織を削除しました",
- "aJPdOp": "組織の削除に失敗しました",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "組織を削除",
- "6Z97iS": "組織を削除できません",
- "hlRoFR": "組織を削除しますか?",
- "ebEqgQ": "アクティブなサブスクリプションがあります。組織を削除する前にサブスクリプションをキャンセルしてください。",
- "onG0m+": "この操作は元に戻せません。組織とすべての関連データが完全に削除されます。",
- "U3dHSt": "確認のため{name}と入力してください。",
- "EQ6bAU": "招待をキャンセルしました",
- "maVOcA": "招待のキャンセルに失敗しました",
- "CYCKhR": "{email}に招待を再送しました",
- "vPBvvX": "招待の再送に失敗しました",
- "HyiDcy": "招待",
- "xhQMeQ": "有効期限",
- "eKEL/g": "保留中",
- "aFyFm0": "承認済み",
- "5qaD7s": "拒否済み",
- "PFtMy9": "キャンセル済み",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "処理中...",
- "IXycMo": "再送",
- "ou8jxS": "保留中の招待はありません",
- "4gXpPi": "{email}に招待を送信しました",
- "CHTM5p": "招待の送信に失敗しました",
- "vCL+NV": "少なくとも1つのサイトを選択するか、サイト制限を無効にしてください",
- "GwX3m4": "Proにアップグレードしてメンバーを追加",
- "hncBRq": "メンバーを招待",
- "bV5L3t": "メンバーの上限{limit}に達しました。アップグレードしてメンバーを追加してください",
- "+kHMr5": "新しいメンバーを招待",
- "lXZjmr": "この組織に新しいメンバーを招待します。",
- "B3uRNN": "特定のサイトへのアクセスを制限",
- "cEIr3W": "このメンバーは選択したサイトにのみアクセスできます。",
- "ptwP96": "招待中...",
- "hYOE+U": "招待",
- "x8CB7X": "サイトアクセスを更新しました",
- "Qf3sJJ": "サイトアクセスの更新に失敗しました",
- "np+cff": "{name}のサイトアクセス",
- "gAmHPq": "このメンバーがアクセスできるサイトを設定します。",
- "XkF2/1": "管理者とオーナーのロールはすべてのサイトにアクセスでき、制限できません。",
- "/EBXiO": "このメンバーは組織のすべてのサイトにアクセスできます。",
- "IZ9nkN": "組織オーナー",
- "yAaNQA": "管理者",
- "AS5k+b": "はすべてのサイトに自動的にアクセスできます。",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count}サイト",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "変更を保存",
- "F9OK6H": "メンバーを削除しました",
- "g8H9Vw": "メンバーの削除に失敗しました",
- "qhbBD7": "メンバーを削除",
- "acsXQE": "{name}を組織から削除してもよろしいですか?",
- "RC2XA4": "削除中...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "組織名を空にすることはできません",
"xIB8Kg": "組織名の更新に失敗しました",
"fTWodj": "組織名",
@@ -828,14 +831,41 @@
"i7B/4+": "この組織とすべてのデータを完全に削除",
"O8Sc7E": "サイトアクセス",
"l8wanU": "参加日",
- "OtSSs+": "{count}サイト",
"iv7EVe": "すべてのサイト",
"qrWOxx": "メンバーが見つかりません",
"Q5kEny": "組織を読み込み中...",
"8g8bMC": "メンバーを管理する前に、組織を作成するか組織に追加される必要があります。",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "サブスクリプションを管理するには組織を選択する必要があります。",
"JgKGg8": "オーナーではありません",
"siqsij": "サブスクリプションを管理できるのは組織のオーナーのみです。",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "サインアップ",
"acrOoz": "続行",
"uCk8r+": "すでにアカウントをお持ちですか?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "新しいタグを入力...",
"wXpKtu": "既存のタグ:",
"jvo0vs": "保存",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "{period}の使用量",
"zQvVDJ": "すべて",
"GEs+cY": "インストールを確認中...",
diff --git a/client/messages/ko.json b/client/messages/ko.json
index a3948d4d4..4c90e3718 100644
--- a/client/messages/ko.json
+++ b/client/messages/ko.json
@@ -597,8 +597,8 @@
"zINlao": "소유자",
"iHN12u": "관리자",
"7L86Z5": "멤버",
- "v+BwPW": "조직에 추가",
"Nvr5Ce": "추가 중...",
+ "v+BwPW": "조직에 추가",
"Msn3jj": "이메일로 필터...",
"gO9HzB": "역할로 필터",
"9nrF+x": "모든 역할",
@@ -763,64 +763,67 @@
"hxZIZ2": "이 작업은 취소할 수 없습니다. 계정이 영구적으로 삭제되고 서버에서 모든 데이터가 제거됩니다.",
"NQgbYA": "계정 설정",
"xrcdXO": "개인 계정 설정을 관리하세요",
- "soeWeh": "조직 설정",
- "BX8PCh": "조직 설정 및 멤버를 관리합니다",
- "L1FoVW": "조직 설정을 볼 수 있는 권한이 없습니다.",
- "cU/aSG": "이메일은 필수입니다",
- "nY0P01": "사용자가 성공적으로 생성되었습니다",
- "9tjZ7S": "사용자 생성 실패",
- "nVYMBG": "사용자 만들기",
- "nIe+Wv": "새 사용자 만들기",
- "Hj0Og1": "이 조직에 새 사용자를 만듭니다.",
- "aUHRPX": "삭제를 확인하려면 조직 이름을 입력하세요",
- "BhlBsq": "조직이 성공적으로 삭제되었습니다",
- "aJPdOp": "조직 삭제 실패",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "조직 삭제",
- "6Z97iS": "조직을 삭제할 수 없습니다",
- "hlRoFR": "조직을 삭제하시겠습니까?",
- "ebEqgQ": "활성 구독이 있습니다. 조직을 삭제하기 전에 구독을 취소해 주세요.",
- "onG0m+": "이 작업은 취소할 수 없습니다. 조직이 영구적으로 삭제되고 관련된 모든 데이터가 제거됩니다.",
- "U3dHSt": "확인하려면 {name}을(를) 입력하세요.",
- "EQ6bAU": "초대가 취소되었습니다",
- "maVOcA": "초대 취소 실패",
- "CYCKhR": "{email}로 초대가 다시 전송되었습니다",
- "vPBvvX": "초대 다시 전송 실패",
- "HyiDcy": "초대",
- "xhQMeQ": "만료일",
- "eKEL/g": "대기 중",
- "aFyFm0": "수락됨",
- "5qaD7s": "거절됨",
- "PFtMy9": "취소됨",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "처리 중...",
- "IXycMo": "다시 보내기",
- "ou8jxS": "대기 중인 초대 없음",
- "4gXpPi": "{email}로 초대가 전송되었습니다",
- "CHTM5p": "초대 전송 실패",
- "vCL+NV": "최소 하나의 사이트를 선택하거나 사이트 제한을 비활성화하세요",
- "GwX3m4": "더 많은 멤버를 추가하려면 Pro로 업그레이드하세요",
- "hncBRq": "멤버 초대",
- "bV5L3t": "멤버 {limit}명 한도에 도달했습니다. 더 많은 멤버를 추가하려면 업그레이드하세요",
- "+kHMr5": "새 멤버 초대",
- "lXZjmr": "이 조직에 새 멤버를 초대합니다.",
- "B3uRNN": "특정 사이트에 대한 접근 제한",
- "cEIr3W": "이 멤버는 선택된 사이트에만 접근할 수 있습니다.",
- "ptwP96": "초대 중...",
- "hYOE+U": "초대",
- "x8CB7X": "사이트 접근이 성공적으로 업데이트되었습니다",
- "Qf3sJJ": "사이트 접근 업데이트 실패",
- "np+cff": "{name}의 사이트 접근",
- "gAmHPq": "이 멤버가 접근할 수 있는 사이트를 구성하세요.",
- "XkF2/1": "관리자 및 소유자 역할은 모든 사이트에 접근할 수 있으며 제한할 수 없습니다.",
- "/EBXiO": "이 멤버는 조직의 모든 사이트에 접근할 수 있습니다.",
- "IZ9nkN": "조직 소유자",
- "yAaNQA": "관리자",
- "AS5k+b": "는 자동으로 모든 사이트에 접근할 수 있습니다.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count}개 사이트",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "변경사항 저장",
- "F9OK6H": "멤버가 성공적으로 제거되었습니다",
- "g8H9Vw": "멤버 제거 실패",
- "qhbBD7": "멤버 제거",
- "acsXQE": "조직에서 {name}을(를) 제거하시겠습니까?",
- "RC2XA4": "제거 중...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "조직 이름은 비워둘 수 없습니다",
"xIB8Kg": "조직 이름 업데이트 실패",
"fTWodj": "조직 이름",
@@ -828,14 +831,41 @@
"i7B/4+": "이 조직과 모든 데이터를 영구적으로 삭제합니다",
"O8Sc7E": "사이트 접근",
"l8wanU": "가입일",
- "OtSSs+": "{count}개 사이트",
"iv7EVe": "모든 사이트",
"qrWOxx": "멤버를 찾을 수 없음",
"Q5kEny": "조직 로딩 중...",
"8g8bMC": "멤버를 관리하기 전에 조직을 만들거나 조직에 추가되어야 합니다.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "구독을 관리하려면 조직을 선택해야 합니다.",
"JgKGg8": "소유자가 아님",
"siqsij": "조직 소유자만 구독을 관리할 수 있습니다.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "가입",
"acrOoz": "계속",
"uCk8r+": "이미 계정이 있으신가요?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "새 태그 입력...",
"wXpKtu": "기존 태그:",
"jvo0vs": "저장",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "{period} 사용량",
"zQvVDJ": "전체",
"GEs+cY": "설치 확인 중...",
diff --git a/client/messages/pl.json b/client/messages/pl.json
index 64af1c0ff..938eb82ea 100644
--- a/client/messages/pl.json
+++ b/client/messages/pl.json
@@ -597,8 +597,8 @@
"zINlao": "Właściciel",
"iHN12u": "Administrator",
"7L86Z5": "Członek",
- "v+BwPW": "Dodaj do organizacji",
"Nvr5Ce": "Dodawanie...",
+ "v+BwPW": "Dodaj do organizacji",
"Msn3jj": "Filtruj po e-mailu...",
"gO9HzB": "Filtruj po roli",
"9nrF+x": "Wszystkie role",
@@ -763,64 +763,67 @@
"hxZIZ2": "Tej czynności nie można cofnąć. Spowoduje to trwałe usunięcie konta i usunięcie wszystkich danych z naszych serwerów.",
"NQgbYA": "Ustawienia konta",
"xrcdXO": "Zarządzaj osobistymi ustawieniami konta",
- "soeWeh": "Ustawienia organizacji",
- "BX8PCh": "Zarządzaj ustawieniami organizacji i członkami",
- "L1FoVW": "Nie masz uprawnień do wyświetlania ustawień organizacji.",
- "cU/aSG": "E-mail jest wymagany",
- "nY0P01": "Użytkownik utworzony pomyślnie",
- "9tjZ7S": "Nie udało się utworzyć użytkownika",
- "nVYMBG": "Utwórz użytkownika",
- "nIe+Wv": "Utwórz nowego użytkownika",
- "Hj0Og1": "Utwórz nowego użytkownika dla tej organizacji.",
- "aUHRPX": "Wpisz nazwę organizacji, aby potwierdzić usunięcie",
- "BhlBsq": "Organizacja usunięta pomyślnie",
- "aJPdOp": "Nie udało się usunąć organizacji",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Usuń organizację",
- "6Z97iS": "Nie można usunąć organizacji",
- "hlRoFR": "Usunąć organizację?",
- "ebEqgQ": "Masz aktywną subskrypcję. Anuluj subskrypcję przed usunięciem organizacji.",
- "onG0m+": "Tej czynności nie można cofnąć. Spowoduje to trwałe usunięcie organizacji i wszystkich powiązanych danych.",
- "U3dHSt": "Wpisz {name}, aby potwierdzić.",
- "EQ6bAU": "Zaproszenie anulowane",
- "maVOcA": "Nie udało się anulować zaproszenia",
- "CYCKhR": "Zaproszenie ponownie wysłane do {email}",
- "vPBvvX": "Nie udało się ponownie wysłać zaproszenia",
- "HyiDcy": "Zaproszenia",
- "xhQMeQ": "Wygasa",
- "eKEL/g": "Oczekujące",
- "aFyFm0": "Zaakceptowane",
- "5qaD7s": "Odrzucone",
- "PFtMy9": "Anulowane",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Przetwarzanie...",
- "IXycMo": "Wyślij ponownie",
- "ou8jxS": "Brak oczekujących zaproszeń",
- "4gXpPi": "Zaproszenie wysłane do {email}",
- "CHTM5p": "Nie udało się wysłać zaproszenia",
- "vCL+NV": "Wybierz co najmniej jedną stronę lub wyłącz ograniczenia stron",
- "GwX3m4": "Ulepsz do Pro, aby dodać więcej członków",
- "hncBRq": "Zaproś członka",
- "bV5L3t": "Osiągnięto limit {limit} członków. Ulepsz plan, aby dodać więcej członków",
- "+kHMr5": "Zaproś nowego członka",
- "lXZjmr": "Zaproś nowego członka do tej organizacji.",
- "B3uRNN": "Ogranicz dostęp do określonych stron",
- "cEIr3W": "Ten członek będzie miał dostęp tylko do wybranych stron.",
- "ptwP96": "Zapraszanie...",
- "hYOE+U": "Zaproś",
- "x8CB7X": "Dostęp do stron zaktualizowany pomyślnie",
- "Qf3sJJ": "Nie udało się zaktualizować dostępu do stron",
- "np+cff": "Dostęp do stron dla {name}",
- "gAmHPq": "Skonfiguruj, do których stron ten członek ma dostęp.",
- "XkF2/1": "Role administratora i właściciela mają dostęp do wszystkich stron i nie mogą być ograniczone.",
- "/EBXiO": "Ten członek ma dostęp do wszystkich stron w organizacji.",
- "IZ9nkN": "Właściciele organizacji",
- "yAaNQA": "Administratorzy",
- "AS5k+b": "automatycznie mają dostęp do wszystkich stron.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} stron",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Zapisz zmiany",
- "F9OK6H": "Członek usunięty pomyślnie",
- "g8H9Vw": "Nie udało się usunąć członka",
- "qhbBD7": "Usuń członka",
- "acsXQE": "Czy na pewno chcesz usunąć {name} z organizacji?",
- "RC2XA4": "Usuwanie...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "Nazwa organizacji nie może być pusta",
"xIB8Kg": "Nie udało się zaktualizować nazwy organizacji",
"fTWodj": "Nazwa organizacji",
@@ -828,14 +831,41 @@
"i7B/4+": "Trwale usuń tę organizację i wszystkie jej dane",
"O8Sc7E": "Dostęp do stron",
"l8wanU": "Dołączył",
- "OtSSs+": "{count} stron",
"iv7EVe": "Wszystkie strony",
"qrWOxx": "Nie znaleziono członków",
"Q5kEny": "Ładowanie organizacji...",
"8g8bMC": "Musisz utworzyć lub zostać dodanym do organizacji, zanim będziesz mógł zarządzać członkami.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Musisz wybrać organizację, aby zarządzać subskrypcją.",
"JgKGg8": "Nie jesteś właścicielem",
"siqsij": "Tylko właściciel organizacji może zarządzać subskrypcją.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Rejestracja",
"acrOoz": "Kontynuuj",
"uCk8r+": "Masz już konto?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Wpisz nowy tag...",
"wXpKtu": "Istniejące tagi:",
"jvo0vs": "Zapisz",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Wykorzystanie za {period}",
"zQvVDJ": "Wszystko",
"GEs+cY": "Sprawdzanie instalacji...",
diff --git a/client/messages/pt.json b/client/messages/pt.json
index f5a96cfd8..9e69befda 100644
--- a/client/messages/pt.json
+++ b/client/messages/pt.json
@@ -597,8 +597,8 @@
"zINlao": "Proprietário",
"iHN12u": "Administrador",
"7L86Z5": "Membro",
- "v+BwPW": "Adicionar à Organização",
"Nvr5Ce": "Adicionando...",
+ "v+BwPW": "Adicionar à Organização",
"Msn3jj": "Filtrar por email...",
"gO9HzB": "Filtrar por papel",
"9nrF+x": "Todos os Papéis",
@@ -763,64 +763,67 @@
"hxZIZ2": "Esta ação não pode ser desfeita. Isso excluirá permanentemente sua conta e removerá todos os seus dados dos nossos servidores.",
"NQgbYA": "Configurações da Conta",
"xrcdXO": "Gerencie suas configurações pessoais de conta",
- "soeWeh": "Configurações da organização",
- "BX8PCh": "Gerencie as configurações da sua organização e membros",
- "L1FoVW": "Você não tem permissão para ver as configurações da organização.",
- "cU/aSG": "Email é obrigatório",
- "nY0P01": "Usuário criado com sucesso",
- "9tjZ7S": "Falha ao criar usuário",
- "nVYMBG": "Criar Usuário",
- "nIe+Wv": "Criar um novo usuário",
- "Hj0Og1": "Crie um novo usuário para esta organização.",
- "aUHRPX": "Por favor, digite o nome da organização para confirmar a exclusão",
- "BhlBsq": "Organização excluída com sucesso",
- "aJPdOp": "Falha ao excluir organização",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "Excluir Organização",
- "6Z97iS": "Não é possível excluir a organização",
- "hlRoFR": "Excluir sua organização?",
- "ebEqgQ": "Você tem uma assinatura ativa. Por favor, cancele sua assinatura antes de excluir sua organização.",
- "onG0m+": "Esta ação não pode ser desfeita. Isso excluirá permanentemente a organização e removerá todos os dados associados.",
- "U3dHSt": "Por favor, digite {name} para confirmar.",
- "EQ6bAU": "Convite cancelado",
- "maVOcA": "Falha ao cancelar convite",
- "CYCKhR": "Convite reenviado para {email}",
- "vPBvvX": "Falha ao reenviar convite",
- "HyiDcy": "Convites",
- "xhQMeQ": "Expira",
- "eKEL/g": "Pendente",
- "aFyFm0": "Aceito",
- "5qaD7s": "Rejeitado",
- "PFtMy9": "Cancelado",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "Processando...",
- "IXycMo": "Reenviar",
- "ou8jxS": "Nenhum convite pendente",
- "4gXpPi": "Convite enviado para {email}",
- "CHTM5p": "Falha ao enviar convite",
- "vCL+NV": "Por favor, selecione pelo menos um site ou desative as restrições de site",
- "GwX3m4": "Atualize para Pro para adicionar mais membros",
- "hncBRq": "Convidar Membro",
- "bV5L3t": "Você atingiu o limite de {limit} membros. Atualize para adicionar mais membros",
- "+kHMr5": "Convidar um novo membro",
- "lXZjmr": "Convide um novo membro para esta organização.",
- "B3uRNN": "Restringir acesso a sites específicos",
- "cEIr3W": "Este membro terá acesso apenas aos sites selecionados.",
- "ptwP96": "Convidando...",
- "hYOE+U": "Convidar",
- "x8CB7X": "Acesso ao site atualizado com sucesso",
- "Qf3sJJ": "Falha ao atualizar acesso ao site",
- "np+cff": "Acesso ao Site para {name}",
- "gAmHPq": "Configure quais sites este membro pode acessar.",
- "XkF2/1": "Papéis de administrador e proprietário têm acesso a todos os sites e não podem ser restritos.",
- "/EBXiO": "Este membro tem acesso a todos os sites da organização.",
- "IZ9nkN": "Proprietários da organização",
- "yAaNQA": "Administradores",
- "AS5k+b": "automaticamente têm acesso a todos os sites.",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} sites",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "Salvar Alterações",
- "F9OK6H": "Membro removido com sucesso",
- "g8H9Vw": "Falha ao remover membro",
- "qhbBD7": "Remover Membro",
- "acsXQE": "Tem certeza de que deseja remover {name} da organização?",
- "RC2XA4": "Removendo...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "O nome da organização não pode estar vazio",
"xIB8Kg": "Falha ao atualizar nome da organização",
"fTWodj": "Nome da Organização",
@@ -828,14 +831,41 @@
"i7B/4+": "Excluir permanentemente esta organização e todos os seus dados",
"O8Sc7E": "Acesso ao Site",
"l8wanU": "Entrou",
- "OtSSs+": "{count} sites",
"iv7EVe": "Todos os sites",
"qrWOxx": "Nenhum membro encontrado",
"Q5kEny": "Carregando organização...",
"8g8bMC": "Você precisa criar ou ser adicionado a uma organização antes de gerenciar membros.",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "Você precisa selecionar uma organização para gerenciar sua assinatura.",
"JgKGg8": "Não é proprietário",
"siqsij": "Apenas o proprietário da organização pode gerenciar a assinatura.",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "Cadastro",
"acrOoz": "Continuar",
"uCk8r+": "Já tem uma conta?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "Digite uma nova tag...",
"wXpKtu": "Tags existentes:",
"jvo0vs": "Salvar",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "Uso {period}",
"zQvVDJ": "Todos",
"GEs+cY": "Verificando instalação...",
diff --git a/client/messages/zh.json b/client/messages/zh.json
index b319b4bdc..188823129 100644
--- a/client/messages/zh.json
+++ b/client/messages/zh.json
@@ -597,8 +597,8 @@
"zINlao": "所有者",
"iHN12u": "管理员",
"7L86Z5": "成员",
- "v+BwPW": "添加到组织",
"Nvr5Ce": "正在添加...",
+ "v+BwPW": "添加到组织",
"Msn3jj": "按电子邮件过滤...",
"gO9HzB": "按角色过滤",
"9nrF+x": "所有角色",
@@ -763,64 +763,67 @@
"hxZIZ2": "此操作无法撤销。这将永久删除您的帐户,并从我们的服务器中删除您的所有数据。",
"NQgbYA": "帐户设置",
"xrcdXO": "管理您的个人帐户设置",
- "soeWeh": "组织设置",
- "BX8PCh": "管理您的组织设置和成员",
- "L1FoVW": "您没有权限查看组织设置。",
- "cU/aSG": "需要提供电子邮件",
- "nY0P01": "用户创建成功",
- "9tjZ7S": "创建用户失败",
- "nVYMBG": "创建用户",
- "nIe+Wv": "创建一个新用户",
- "Hj0Og1": "为此组织创建一个新用户。",
- "aUHRPX": "请键入组织名称以确认删除",
- "BhlBsq": "组织删除成功",
- "aJPdOp": "删除组织失败",
+ "cU/aSG": "",
+ "nY0P01": "",
+ "9tjZ7S": "",
+ "nVYMBG": "",
+ "nIe+Wv": "",
+ "Hj0Og1": "",
+ "aUHRPX": "",
+ "BhlBsq": "",
+ "aJPdOp": "",
"/8v8/t": "删除组织",
- "6Z97iS": "无法删除组织",
- "hlRoFR": "删除您的组织?",
- "ebEqgQ": "您有一个活动的订阅。请在删除组织之前取消您的订阅。",
- "onG0m+": "此操作无法撤销。这将永久删除该组织,并移除所有关联数据。",
- "U3dHSt": "请键入 {name} 以确认。",
- "EQ6bAU": "邀请已取消",
- "maVOcA": "取消邀请失败",
- "CYCKhR": "已重新发送邀请至 {email}",
- "vPBvvX": "重新发送邀请失败",
- "HyiDcy": "邀请",
- "xhQMeQ": "过期",
- "eKEL/g": "待处理",
- "aFyFm0": "已接受",
- "5qaD7s": "已拒绝",
- "PFtMy9": "已取消",
+ "6Z97iS": "",
+ "hlRoFR": "",
+ "ebEqgQ": "",
+ "onG0m+": "",
+ "U3dHSt": "",
+ "EQ6bAU": "",
+ "maVOcA": "",
+ "CYCKhR": "",
+ "vPBvvX": "",
+ "HyiDcy": "",
+ "xhQMeQ": "",
+ "eKEL/g": "",
+ "aFyFm0": "",
+ "5qaD7s": "",
+ "PFtMy9": "",
"6OWS4p": "正在处理...",
- "IXycMo": "重新发送",
- "ou8jxS": "没有未决的邀请",
- "4gXpPi": "邀请已发送至 {email}",
- "CHTM5p": "发送邀请失败",
- "vCL+NV": "请选择至少一个网站,或者禁用网站限制",
- "GwX3m4": "升级到 Pro 以添加更多成员",
- "hncBRq": "邀请成员",
- "bV5L3t": "您已达到 {limit} 个成员的限制。请升级以添加更多成员",
- "+kHMr5": "邀请新成员",
- "lXZjmr": "邀请一名新成员加入此组织。",
- "B3uRNN": "限制对特定网站的访问",
- "cEIr3W": "此成员将仅可访问选定的网站。",
- "ptwP96": "正在邀请...",
- "hYOE+U": "邀请",
- "x8CB7X": "网站访问权限已成功更新",
- "Qf3sJJ": "更新网站访问权限失败",
- "np+cff": "{name} 的网站访问权限",
- "gAmHPq": "配置该成员可以访问哪些网站。",
- "XkF2/1": "管理员和所有者角色有权访问所有网站,无法被限制。",
- "/EBXiO": "该成员可以访问组织内的所有网站。",
- "IZ9nkN": "组织所有者",
- "yAaNQA": "管理员",
- "AS5k+b": "自动获得访问所有网站的权限。",
+ "IXycMo": "",
+ "ou8jxS": "",
+ "4gXpPi": "",
+ "CHTM5p": "",
+ "vCL+NV": "",
+ "GwX3m4": "",
+ "hncBRq": "",
+ "bV5L3t": "",
+ "+kHMr5": "",
+ "lXZjmr": "",
+ "B3uRNN": "",
+ "cEIr3W": "",
+ "DNeuzb": "",
+ "wMcv1G": "",
+ "OtSSs+": "{count} 个网站",
+ "ptwP96": "",
+ "hYOE+U": "",
+ "x8CB7X": "",
+ "Qf3sJJ": "",
+ "np+cff": "",
+ "gAmHPq": "",
+ "XkF2/1": "",
+ "/EBXiO": "",
+ "IZ9nkN": "",
+ "yAaNQA": "",
+ "AS5k+b": "",
"3VI9mt": "保存更改",
- "F9OK6H": "成员移除成功",
- "g8H9Vw": "移除成员失败",
- "qhbBD7": "移除成员",
- "acsXQE": "您确定要从组织中移除 {name} 吗?",
- "RC2XA4": "正在移除...",
+ "F9OK6H": "",
+ "g8H9Vw": "",
+ "qhbBD7": "",
+ "acsXQE": "",
+ "RC2XA4": "",
+ "soeWeh": "",
+ "BX8PCh": "",
+ "L1FoVW": "",
"fhx8xT": "组织名称不能为空",
"xIB8Kg": "更新组织名称失败",
"fTWodj": "组织名称",
@@ -828,14 +831,41 @@
"i7B/4+": "永久删除此组织及其所有数据",
"O8Sc7E": "网站访问权限",
"l8wanU": "已加入",
- "OtSSs+": "{count} 个网站",
"iv7EVe": "所有网站",
"qrWOxx": "未找到成员",
"Q5kEny": "正在加载组织...",
"8g8bMC": "您需要创建或被添加到某个组织,然后才能管理成员。",
+ "ZcBC7s": "",
+ "oemoXC": "",
"GH6rlO": "您需要选择一个组织以管理您的订阅。",
"JgKGg8": "不是所有者",
"siqsij": "只有组织的所有者才能管理订阅。",
+ "L8DzHm": "",
+ "21Ef1P": "",
+ "EjE0iv": "",
+ "hfiE8k": "",
+ "DswPK3": "",
+ "97DGta": "",
+ "U01dmA": "",
+ "03IKqU": "",
+ "Ps71bZ": "",
+ "k+kHlN": "",
+ "Tqx+zH": "",
+ "wNwwpZ": "",
+ "94Fg25": "",
+ "pW35eH": "",
+ "20rO2E": "",
+ "Y8E+so": "",
+ "IWfwim": "",
+ "iSNlf0": "",
+ "oSW2J5": "",
+ "+WnNru": "",
+ "f7uwif": "",
+ "cPbI/I": "",
+ "xA1LY9": "",
+ "68djwb": "",
+ "S5IFjk": "",
+ "StUScz": "",
"RNCPOG": "注册",
"acrOoz": "继续",
"uCk8r+": "已经有账户了?",
@@ -1157,6 +1187,8 @@
"B1SDE1": "输入新标签...",
"wXpKtu": "现有标签:",
"jvo0vs": "保存",
+ "DoskyC": "",
+ "t6nrnE": "",
"mHABbN": "{period} 使用情况",
"zQvVDJ": "全部",
"GEs+cY": "正在检查安装...",
diff --git a/client/src/api/admin/endpoints/index.ts b/client/src/api/admin/endpoints/index.ts
index c79abae77..19ebbf874 100644
--- a/client/src/api/admin/endpoints/index.ts
+++ b/client/src/api/admin/endpoints/index.ts
@@ -81,6 +81,22 @@ export type { GetSiteImportsResponse, CreateSiteImportResponse } from "./import"
export { getOrganizationMembers } from "./auth";
export type { GetOrganizationMembersResponse } from "./auth";
+// Teams endpoints
+export {
+ fetchTeams,
+ createTeam,
+ updateTeam,
+ deleteTeam,
+} from "./teams";
+export type {
+ Team,
+ TeamMember,
+ TeamSite,
+ ListTeamsResponse,
+ CreateTeamInput,
+ UpdateTeamInput,
+} from "./teams";
+
// ClickHouse Stats endpoints
export { getClickhouseStats, getClickhouseQueryLog } from "./clickhouseStats";
export type {
diff --git a/client/src/api/admin/endpoints/sites.ts b/client/src/api/admin/endpoints/sites.ts
index dcd34c6b1..57a23e279 100644
--- a/client/src/api/admin/endpoints/sites.ts
+++ b/client/src/api/admin/endpoints/sites.ts
@@ -55,6 +55,7 @@ export type GetSitesFromOrgResponse = {
sessionsLast24Hours: number;
isOwner: boolean;
tags?: string[] | null;
+ teams?: { id: string; name: string }[];
}>;
subscription: {
monthlyEventCount: number;
diff --git a/client/src/api/admin/endpoints/teams.ts b/client/src/api/admin/endpoints/teams.ts
new file mode 100644
index 000000000..f1e9e6e5f
--- /dev/null
+++ b/client/src/api/admin/endpoints/teams.ts
@@ -0,0 +1,77 @@
+import { authedFetch } from "../../utils";
+
+export type TeamMember = {
+ userId: string;
+ userName: string | null;
+ userEmail: string;
+};
+
+export type TeamSite = {
+ siteId: number;
+ domain: string;
+ name: string;
+};
+
+export type Team = {
+ id: string;
+ name: string;
+ organizationId: string;
+ createdAt: string;
+ updatedAt: string | null;
+ members: TeamMember[];
+ sites: TeamSite[];
+};
+
+export type ListTeamsResponse = {
+ teams: Team[];
+};
+
+export type CreateTeamInput = {
+ name: string;
+ memberUserIds?: string[];
+ siteIds?: number[];
+};
+
+export type UpdateTeamInput = {
+ name?: string;
+ memberUserIds?: string[];
+ siteIds?: number[];
+};
+
+export function fetchTeams(organizationId: string) {
+ return authedFetch<ListTeamsResponse>(
+ `/organizations/${organizationId}/teams`
+ );
+}
+
+export function createTeam(organizationId: string, data: CreateTeamInput) {
+ return authedFetch<Team>(`/organizations/${organizationId}/teams`, undefined, {
+ method: "POST",
+ data,
+ headers: { "Content-Type": "application/json" },
+ });
+}
+
+export function updateTeam(
+ organizationId: string,
+ teamId: string,
+ data: UpdateTeamInput
+) {
+ return authedFetch<{ success: boolean }>(
+ `/organizations/${organizationId}/teams/${teamId}`,
+ undefined,
+ {
+ method: "PUT",
+ data,
+ headers: { "Content-Type": "application/json" },
+ }
+ );
+}
+
+export function deleteTeam(organizationId: string, teamId: string) {
+ return authedFetch<{ success: boolean }>(
+ `/organizations/${organizationId}/teams/${teamId}`,
+ undefined,
+ { method: "DELETE" }
+ );
+}
diff --git a/client/src/api/admin/hooks/useTeams.ts b/client/src/api/admin/hooks/useTeams.ts
new file mode 100644
index 000000000..a66348627
--- /dev/null
+++ b/client/src/api/admin/hooks/useTeams.ts
@@ -0,0 +1,76 @@
+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
+import {
+ fetchTeams,
+ createTeam,
+ updateTeam,
+ deleteTeam,
+ CreateTeamInput,
+ UpdateTeamInput,
+ ListTeamsResponse,
+} from "../endpoints/teams";
+
+export const TEAMS_QUERY_KEY = "teams";
+
+export function useTeams(organizationId?: string) {
+ return useQuery<ListTeamsResponse>({
+ queryKey: [TEAMS_QUERY_KEY, organizationId],
+ queryFn: () => fetchTeams(organizationId!),
+ enabled: !!organizationId,
+ });
+}
+
+export function useCreateTeam() {
+ const queryClient = useQueryClient();
+
+ return useMutation({
+ mutationFn: ({
+ organizationId,
+ data,
+ }: {
+ organizationId: string;
+ data: CreateTeamInput;
+ }) => createTeam(organizationId, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: [TEAMS_QUERY_KEY] });
+ queryClient.invalidateQueries({ queryKey: ["get-sites-from-org"] });
+ },
+ });
+}
+
+export function useUpdateTeam() {
+ const queryClient = useQueryClient();
+
+ return useMutation({
+ mutationFn: ({
+ organizationId,
+ teamId,
+ data,
+ }: {
+ organizationId: string;
+ teamId: string;
+ data: UpdateTeamInput;
+ }) => updateTeam(organizationId, teamId, data),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: [TEAMS_QUERY_KEY] });
+ queryClient.invalidateQueries({ queryKey: ["get-sites-from-org"] });
+ },
+ });
+}
+
+export function useDeleteTeam() {
+ const queryClient = useQueryClient();
+
+ return useMutation({
+ mutationFn: ({
+ organizationId,
+ teamId,
+ }: {
+ organizationId: string;
+ teamId: string;
+ }) => deleteTeam(organizationId, teamId),
+ onSuccess: () => {
+ queryClient.invalidateQueries({ queryKey: [TEAMS_QUERY_KEY] });
+ queryClient.invalidateQueries({ queryKey: ["get-sites-from-org"] });
+ },
+ });
+}
diff --git a/client/src/app/[site]/components/Header/UsageBanners.tsx b/client/src/app/[site]/components/Header/UsageBanners.tsx
index e07b409ae..74c9c25a0 100644
--- a/client/src/app/[site]/components/Header/UsageBanners.tsx
+++ b/client/src/app/[site]/components/Header/UsageBanners.tsx
@@ -42,7 +42,7 @@ export function UsageBanners() {
</div>
{site.isOwner && (
<Button variant="success" size="sm" asChild>
- <Link href="/settings/organization/subscription">
+ <Link href="/settings/subscription">
{t("Upgrade")} <ArrowRight className="ml-1 h-3 w-3" />
</Link>
</Button>
@@ -67,7 +67,7 @@ export function UsageBanners() {
</div>
{site.isOwner && (
<Button variant="success" size="sm" asChild>
- <Link href="/settings/organization/subscription">
+ <Link href="/settings/subscription">
{t("Upgrade")} <ArrowRight className="ml-1 h-3 w-3" />
</Link>
</Button>
diff --git a/client/src/app/page.tsx b/client/src/app/page.tsx
index 62f4cf945..06aeba5f2 100644
--- a/client/src/app/page.tsx
+++ b/client/src/app/page.tsx
@@ -1,16 +1,21 @@
"use client";
-import { useExtracted } from "next-intl";
+import { useWindowSize } from "@uidotdev/usehooks";
import { ChevronLeft, ChevronRight, Plus, Search } from "lucide-react";
+import { useExtracted } from "next-intl";
import { useEffect, useMemo, useState } from "react";
import { useUserOrganizations } from "../api/admin/hooks/useOrganizations";
import { useGetSitesFromOrg } from "../api/admin/hooks/useSites";
+import { useTeams } from "../api/admin/hooks/useTeams";
+import { AppSidebar } from "../components/AppSidebar";
import { CreateOrganizationDialog } from "../components/CreateOrganizationDialog";
import { DateSelector } from "../components/DateSelector/DateSelector";
import { NoOrganization } from "../components/NoOrganization";
import { OrganizationSelector } from "../components/OrganizationSelector";
+import { NavigationSidebar } from "../components/sidebar/NavigationSidebar";
import { SiteCard } from "../components/SiteCard";
import { StandardPage } from "../components/StandardPage";
+import { TeamSelector } from "../components/TeamSelector";
import { Button } from "../components/ui/button";
import { Card, CardDescription, CardTitle } from "../components/ui/card";
import { Input } from "../components/ui/input";
@@ -24,10 +29,18 @@ export default function Home() {
const t = useExtracted();
useSetPageTitle("Home");
+ const { width } = useWindowSize();
+ const isDesktop = width !== null && width >= 768;
+
const { time, setTime } = useStore();
- const { data: activeOrganization, isPending } = authClient.useActiveOrganization();
+ const { data: activeOrganization, isPending } =
+ authClient.useActiveOrganization();
- const { data: sites, refetch: refetchSites, isLoading: isLoadingSites } = useGetSitesFromOrg(activeOrganization?.id);
+ const {
+ data: sites,
+ refetch: refetchSites,
+ isLoading: isLoadingSites,
+ } = useGetSitesFromOrg(activeOrganization?.id);
const {
data: userOrganizationsData,
@@ -39,26 +52,33 @@ export default function Home() {
const isLoading = isLoadingOrganizations || isPending || isLoadingSites;
// Check if user has organizations
- const hasOrganizations = Array.isArray(userOrganizationsData) && userOrganizationsData.length > 0;
+ const hasOrganizations =
+ Array.isArray(userOrganizationsData) && userOrganizationsData.length > 0;
const hasNoOrganizations = !isLoading && !hasOrganizations;
// Check user permissions for the active organization
- const activeOrgMembership = userOrganizationsData?.find(org => org.id === activeOrganization?.id);
+ const activeOrgMembership = userOrganizationsData?.find(
+ (org) => org.id === activeOrganization?.id
+ );
const isUserMember = activeOrgMembership?.role === "member";
const canAddSites = hasOrganizations && !isUserMember;
// Check if we should show sites content
const shouldShowSites = hasOrganizations && !isLoading;
- const hasNoSites = shouldShowSites && (!sites?.sites || sites.sites.length === 0);
+ const hasNoSites =
+ shouldShowSites && (!sites?.sites || sites.sites.length === 0);
+
+ const { data: teamsData } = useTeams(activeOrganization?.id);
const [createOrgDialogOpen, setCreateOrgDialogOpen] = useState(false);
const [domainFilter, setDomainFilter] = useState("");
const [selectedTags, setSelectedTags] = useState<string[]>([]);
+ const [selectedTeamFilter, setSelectedTeamFilter] = useState<string>("all");
// Compute unique tags from all sites
const allTags = useMemo(() => {
- const tags = sites?.sites?.flatMap(s => s.tags || []) || [];
+ const tags = sites?.sites?.flatMap((s) => s.tags || []) || [];
return [...new Set(tags)].sort();
}, [sites?.sites]);
@@ -66,11 +86,24 @@ export default function Home() {
const [isMounted, setIsMounted] = useState(false);
useEffect(() => setIsMounted(true), []);
- // Filter sites by domain and tags
- const filteredSites = sites?.sites?.filter(site => {
- const matchesDomain = site.domain.toLowerCase().includes(domainFilter.toLowerCase());
- const matchesTags = selectedTags.length === 0 || selectedTags.some(tag => site.tags?.includes(tag));
- return matchesDomain && matchesTags;
+ const teams = teamsData?.teams || [];
+
+ // Filter sites by domain, tags, and team
+ const filteredSites = sites?.sites?.filter((site) => {
+ const matchesDomain = site.domain
+ .toLowerCase()
+ .includes(domainFilter.toLowerCase());
+ const matchesTags =
+ selectedTags.length === 0 ||
+ selectedTags.some((tag) => site.tags?.includes(tag));
+ let matchesTeam = true;
+ if (selectedTeamFilter === "unassigned") {
+ matchesTeam = !site.teams || site.teams.length === 0;
+ } else if (selectedTeamFilter !== "all") {
+ matchesTeam =
+ site.teams?.some((t) => t.id === selectedTeamFilter) || false;
+ }
+ return matchesDomain && matchesTags && matchesTeam;
});
// Handle successful organization creation
@@ -81,106 +114,154 @@ export default function Home() {
// Handle tag click to toggle filter
const handleTagClick = (tag: string) => {
- setSelectedTags(prev =>
- prev.includes(tag) ? prev.filter(t => t !== tag) : [...prev, tag]
+ setSelectedTags((prev) =>
+ prev.includes(tag) ? prev.filter((t) => t !== tag) : [...prev, tag]
);
};
- return (
- <StandardPage>
- <div className="flex justify-between items-center my-4">
- <div>
- <OrganizationSelector />
- </div>
- <div className="flex items-center gap-2">
- <DateSelector time={time} setTime={setTime} />
- <div className="flex items-center">
- <Button
- variant="secondary"
- size="icon"
- onClick={goBack}
- disabled={time.mode === "past-minutes"}
- className="rounded-r-none h-8 w-8"
- >
- <ChevronLeft />
- </Button>
- <Button
- variant="secondary"
- size="icon"
- onClick={goForward}
- disabled={!isMounted || !canGoForward(time)}
- className="rounded-l-none -ml-px h-8 w-8"
- >
- <ChevronRight />
- </Button>
- </div>
- </div>
+ const hasSites = shouldShowSites && sites?.sites && sites.sites.length > 0;
+
+ const teamSelector = (
+ <TeamSelector
+ teams={teams}
+ value={selectedTeamFilter}
+ onValueChange={setSelectedTeamFilter}
+ canCreateTeam={!isUserMember && hasOrganizations}
+ />
+ );
+
+ const dateControls = (
+ <div className="flex items-center gap-2">
+ <DateSelector time={time} setTime={setTime} />
+ <div className="flex items-center">
+ <Button
+ variant="secondary"
+ size="icon"
+ onClick={goBack}
+ disabled={time.mode === "past-minutes"}
+ className="rounded-r-none h-8 w-8"
+ >
+ <ChevronLeft />
+ </Button>
+ <Button
+ variant="secondary"
+ size="icon"
+ onClick={goForward}
+ disabled={!isMounted || !canGoForward(time)}
+ className="rounded-l-none -ml-px h-8 w-8"
+ >
+ <ChevronRight />
+ </Button>
</div>
- {hasNoOrganizations && <NoOrganization />}
- {shouldShowSites && sites?.sites && sites.sites.length > 0 && (
- <div className="flex gap-2 mb-4">
- <div className="relative flex-1">
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral-500" />
- <Input
- placeholder={t("Filter by domain...")}
- value={domainFilter}
- onChange={e => setDomainFilter(e.target.value)}
- className="pl-9"
- />
- </div>
- {allTags.length > 0 && (
- <div className="w-[200px]">
- <MultiSelect
- options={allTags.map(tag => ({ value: tag, label: tag }))}
- value={selectedTags}
- onValueChange={setSelectedTags}
- placeholder={t("Filter by tags...")}
- searchPlaceholder={t("Search tags...")}
- emptyText={t("No tags found.")}
- className="border-neutral-150 dark:border-neutral-800"
- />
- </div>
- )}
- <div className="hidden md:block">
- <AddSite disabled={!canAddSites} />
- </div>
+ </div>
+ );
+
+ const filterBar = hasSites ? (
+ <div className="flex gap-2 mb-4">
+ <div className="relative flex-1">
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-neutral-500" />
+ <Input
+ placeholder={t("Filter by domain...")}
+ value={domainFilter}
+ onChange={(e) => setDomainFilter(e.target.value)}
+ className="pl-9"
+ />
+ </div>
+ {!isDesktop && teamSelector}
+ {allTags.length > 0 && (
+ <div className="w-[200px]">
+ <MultiSelect
+ options={allTags.map((tag) => ({ value: tag, label: tag }))}
+ value={selectedTags}
+ onValueChange={setSelectedTags}
+ placeholder={t("Filter by tags...")}
+ searchPlaceholder={t("Search tags...")}
+ emptyText={t("No tags found.")}
+ className="border-neutral-150 dark:border-neutral-800"
+ />
</div>
)}
- <div className="flex flex-col gap-2">
- {filteredSites?.map(site => {
- return (
- <SiteCard
- key={site.siteId}
- siteId={site.siteId}
- domain={site.domain}
- tags={site.tags || []}
- allTags={allTags}
- onTagsUpdated={refetchSites}
- selectedTags={selectedTags}
- onTagClick={handleTagClick}
- />
- );
- })}
- {hasNoSites ? (
- <Card className="p-6 flex flex-col items-center text-center">
- <CardTitle className="mb-2 text-xl">{t("No websites yet")}</CardTitle>
- <CardDescription className="mb-4">{t("Add your first website to start tracking analytics")}</CardDescription>
- <AddSite
- trigger={
- <Button variant="success" disabled={!canAddSites}>
- <Plus className="h-4 w-4" />
- {t("Add Website")}
- </Button>
- }
- />
- </Card>
- ) : null}
+ <div className="hidden md:block">
+ <AddSite disabled={!canAddSites} />
</div>
+ </div>
+ ) : null;
+
+ const siteCards = (
+ <div className="flex flex-col gap-2">
+ {filteredSites?.map((site) => {
+ return (
+ <SiteCard
+ key={site.siteId}
+ siteId={site.siteId}
+ domain={site.domain}
+ tags={site.tags || []}
+ allTags={allTags}
+ onTagsUpdated={refetchSites}
+ selectedTags={selectedTags}
+ onTagClick={handleTagClick}
+ />
+ );
+ })}
+ {hasNoSites ? (
+ <Card className="p-6 flex flex-col items-center text-center">
+ <CardTitle className="mb-2 text-xl">
+ {t("No websites yet")}
+ </CardTitle>
+ <CardDescription className="mb-4">
+ {t("Add your first website to start tracking analytics")}
+ </CardDescription>
+ <AddSite
+ trigger={
+ <Button variant="success" disabled={!canAddSites}>
+ <Plus className="h-4 w-4" />
+ {t("Add Website")}
+ </Button>
+ }
+ />
+ </Card>
+ ) : null}
+ </div>
+ );
+
+ const content = (
+ <>
+ {hasNoOrganizations && <NoOrganization />}
+ {filterBar}
+ {siteCards}
<CreateOrganizationDialog
open={createOrgDialogOpen}
onOpenChange={setCreateOrgDialogOpen}
onSuccess={handleOrganizationCreated}
/>
- </StandardPage>
+ </>
+ );
+
+ if (!isDesktop) {
+ return (
+ <StandardPage>
+ <div className="flex justify-between items-center my-4">
+ <div>
+ <OrganizationSelector />
+ </div>
+ {dateControls}
+ </div>
+ {content}
+ </StandardPage>
+ );
+ }
+
+ return (
+ <div className="flex h-full">
+ <AppSidebar />
+ <NavigationSidebar />
+ <StandardPage showSidebar={false}>
+ <div className="flex justify-between items-center my-4">
+ <div>{teamSelector}</div>
+ {dateControls}
+ </div>
+ {content}
+ </StandardPage>
+ </div>
);
}
diff --git a/client/src/app/settings/components/MobileSidebar.tsx b/client/src/app/settings/components/MobileSidebar.tsx
index 973dd16b0..3475efdba 100644
--- a/client/src/app/settings/components/MobileSidebar.tsx
+++ b/client/src/app/settings/components/MobileSidebar.tsx
@@ -6,7 +6,7 @@ import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../.
import { Menu } from "lucide-react";
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
import { AppSidebar } from "../../../components/AppSidebar";
-import { SettingsSidebar } from "./SettingsSidebar";
+import { NavigationSidebar } from "../../../components/sidebar/NavigationSidebar";
export function MobileSidebar() {
return (
@@ -24,7 +24,7 @@ export function MobileSidebar() {
</VisuallyHidden>
<SheetContent side="left" className="p-0 w-[240px] flex gap-0" showClose={false}>
<AppSidebar />
- <SettingsSidebar />
+ <NavigationSidebar />
</SheetContent>
</Sheet>
</div>
diff --git a/client/src/app/settings/components/SettingsSidebar.tsx b/client/src/app/settings/components/SettingsSidebar.tsx
deleted file mode 100644
index 44977551d..000000000
--- a/client/src/app/settings/components/SettingsSidebar.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-"use client";
-import { Building2, CreditCard, UserCircle } from "lucide-react";
-import { useExtracted } from "next-intl";
-import { usePathname } from "next/navigation";
-import { Sidebar } from "../../../components/sidebar/Sidebar";
-import { IS_CLOUD } from "../../../lib/const";
-
-export function SettingsSidebar() {
- const t = useExtracted();
- const pathname = usePathname();
-
- return (
- <Sidebar.Root>
- <Sidebar.Title>{t("Settings")}</Sidebar.Title>
- <Sidebar.Items>
- <Sidebar.Item
- label={t("Account")}
- active={pathname.startsWith("/settings/account")}
- href={"/settings/account"}
- icon={<UserCircle className="w-4 h-4" />}
- />
- <Sidebar.Item
- label={t("Organization")}
- active={pathname.startsWith("/settings/organization/members")}
- href={"/settings/organization"}
- icon={<Building2 className="w-4 h-4" />}
- />
- {IS_CLOUD && (
- <Sidebar.Item
- label={t("Subscription")}
- active={pathname.startsWith("/settings/organization/subscription")}
- href={"/settings/organization/subscription"}
- icon={<CreditCard className="w-4 h-4" />}
- />
- )}
- </Sidebar.Items>
- </Sidebar.Root>
- );
-}
diff --git a/client/src/app/settings/layout.tsx b/client/src/app/settings/layout.tsx
index d34c042b7..547c25831 100644
--- a/client/src/app/settings/layout.tsx
+++ b/client/src/app/settings/layout.tsx
@@ -3,8 +3,8 @@
import { useWindowSize } from "@uidotdev/usehooks";
import { AppSidebar } from "../../components/AppSidebar";
import { StandardPage } from "../../components/StandardPage";
+import { NavigationSidebar } from "../../components/sidebar/NavigationSidebar";
import { MobileSidebar } from "./components/MobileSidebar";
-import { SettingsSidebar } from "./components/SettingsSidebar";
export default function SettingsLayout({ children }: { children: React.ReactNode }) {
const { width } = useWindowSize();
@@ -21,7 +21,7 @@ export default function SettingsLayout({ children }: { children: React.ReactNode
return (
<div className="flex h-full">
<AppSidebar />
- <SettingsSidebar />
+ <NavigationSidebar />
<StandardPage showSidebar={false}>
<div className="flex-1 overflow-auto mt-4">{children}</div>
</StandardPage>
diff --git a/client/src/app/settings/organization/members/components/CreateUserDialog.tsx b/client/src/app/settings/organization/components/CreateUserDialog.tsx
similarity index 94%
rename from client/src/app/settings/organization/members/components/CreateUserDialog.tsx
rename to client/src/app/settings/organization/components/CreateUserDialog.tsx
index 27527dbba..8cb411f23 100644
--- a/client/src/app/settings/organization/members/components/CreateUserDialog.tsx
+++ b/client/src/app/settings/organization/components/CreateUserDialog.tsx
@@ -17,10 +17,10 @@ import { UserPlus } from "lucide-react";
import { useExtracted } from "next-intl";
import { useState } from "react";
import { toast } from "@/components/ui/sonner";
-import { Alert } from "../../../../../components/ui/alert";
-import { authClient } from "../../../../../lib/auth";
-import { validateEmail } from "../../../../../lib/auth-utils";
-import { useAddUserToOrganization } from "../../../../../api/admin/hooks/useOrganizations";
+import { Alert } from "../../../../components/ui/alert";
+import { authClient } from "../../../../lib/auth";
+import { validateEmail } from "../../../../lib/auth-utils";
+import { useAddUserToOrganization } from "../../../../api/admin/hooks/useOrganizations";
interface CreateUserDialogProps {
organizationId: string;
diff --git a/client/src/app/settings/organization/members/components/DeleteOrganizationDialog.tsx b/client/src/app/settings/organization/components/DeleteOrganizationDialog.tsx
similarity index 97%
rename from client/src/app/settings/organization/members/components/DeleteOrganizationDialog.tsx
rename to client/src/app/settings/organization/components/DeleteOrganizationDialog.tsx
index 6c26490ee..b6a5fa3b3 100644
--- a/client/src/app/settings/organization/members/components/DeleteOrganizationDialog.tsx
+++ b/client/src/app/settings/organization/components/DeleteOrganizationDialog.tsx
@@ -20,7 +20,7 @@ import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { authClient } from "@/lib/auth";
import { useStripeSubscription } from "@/lib/subscription/useStripeSubscription";
-import { USER_ORGANIZATIONS_QUERY_KEY } from "../../../../../api/admin/hooks/useOrganizations";
+import { USER_ORGANIZATIONS_QUERY_KEY } from "../../../../api/admin/hooks/useOrganizations";
import { Organization } from "../page";
interface DeleteOrganizationDialogProps {
diff --git a/client/src/app/settings/organization/members/components/Invitations.tsx b/client/src/app/settings/organization/components/Invitations.tsx
similarity index 95%
rename from client/src/app/settings/organization/members/components/Invitations.tsx
rename to client/src/app/settings/organization/components/Invitations.tsx
index f2ba236ed..b1ba4dabc 100644
--- a/client/src/app/settings/organization/members/components/Invitations.tsx
+++ b/client/src/app/settings/organization/components/Invitations.tsx
@@ -3,12 +3,12 @@ import { DateTime } from "luxon";
import { useExtracted } from "next-intl";
import { useState } from "react";
import { toast } from "@/components/ui/sonner";
-import { useOrganizationInvitations } from "../../../../../api/admin/hooks/useOrganizations";
-import { Badge } from "../../../../../components/ui/badge";
-import { Button } from "../../../../../components/ui/button";
-import { Card, CardContent, CardHeader, CardTitle } from "../../../../../components/ui/card";
-import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../../../components/ui/table";
-import { authClient } from "../../../../../lib/auth";
+import { useOrganizationInvitations } from "../../../../api/admin/hooks/useOrganizations";
+import { Badge } from "../../../../components/ui/badge";
+import { Button } from "../../../../components/ui/button";
+import { Card, CardContent, CardHeader, CardTitle } from "../../../../components/ui/card";
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../../components/ui/table";
+import { authClient } from "../../../../lib/auth";
interface InvitationsProps {
organizationId: string;
diff --git a/client/src/app/settings/organization/members/components/InviteMemberDialog.tsx b/client/src/app/settings/organization/components/InviteMemberDialog.tsx
similarity index 77%
rename from client/src/app/settings/organization/members/components/InviteMemberDialog.tsx
rename to client/src/app/settings/organization/components/InviteMemberDialog.tsx
index 225ba8147..c3388faf2 100644
--- a/client/src/app/settings/organization/members/components/InviteMemberDialog.tsx
+++ b/client/src/app/settings/organization/components/InviteMemberDialog.tsx
@@ -6,6 +6,7 @@ import { useExtracted } from "next-intl";
import { useMemo, useState } from "react";
import { toast } from "@/components/ui/sonner";
+import { useTeams } from "@/api/admin/hooks/useTeams";
import { authedFetch } from "@/api/utils";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
@@ -47,10 +48,14 @@ export function InviteMemberDialog({ organizationId, onSuccess, memberCount }: I
return memberCount >= memberLimit;
}, [memberLimit, memberCount]);
+ const { data: teamsData } = useTeams(organizationId);
+ const teams = teamsData?.teams || [];
+
const [email, setEmail] = useState("");
const [role, setRole] = useState<"admin" | "member" | "owner">("member");
const [restrictSiteAccess, setRestrictSiteAccess] = useState(false);
const [selectedSiteIds, setSelectedSiteIds] = useState<number[]>([]);
+ const [selectedTeamIds, setSelectedTeamIds] = useState<string[]>([]);
const [open, setOpen] = useState(false);
const [error, setError] = useState("");
@@ -64,13 +69,17 @@ export function InviteMemberDialog({ organizationId, onSuccess, memberCount }: I
resend: true,
});
- // If role is "member" and site access is restricted, update the invitation
- if (role === "member" && restrictSiteAccess && result.data?.id) {
+ // Update invitation with site access restrictions and/or team assignments
+ const hasTeamAssignments = selectedTeamIds.length > 0;
+ const hasSiteRestrictions = role === "member" && restrictSiteAccess;
+
+ if ((hasSiteRestrictions || hasTeamAssignments) && result.data?.id) {
await authedFetch(`/organizations/${organizationId}/invitations/${result.data.id}/sites`, undefined, {
method: "PUT",
data: {
- hasRestrictedSiteAccess: true,
- siteIds: selectedSiteIds,
+ hasRestrictedSiteAccess: hasSiteRestrictions,
+ siteIds: hasSiteRestrictions ? selectedSiteIds : [],
+ teamIds: selectedTeamIds,
},
});
}
@@ -86,6 +95,7 @@ export function InviteMemberDialog({ organizationId, onSuccess, memberCount }: I
setRole("member");
setRestrictSiteAccess(false);
setSelectedSiteIds([]);
+ setSelectedTeamIds([]);
setError("");
},
onError: (err: any) => {
@@ -202,6 +212,38 @@ export function InviteMemberDialog({ organizationId, onSuccess, memberCount }: I
</div>
)}
+ {teams.length > 0 && (
+ <div className="grid gap-2">
+ <Label>{t("Teams")}</Label>
+ <p className="text-xs text-muted-foreground">
+ {t("Optionally add this member to teams when they accept the invitation.")}
+ </p>
+ <div className="border rounded-lg divide-y max-h-40 overflow-y-auto">
+ {teams.map(team => (
+ <div key={team.id} className="flex items-center space-x-3 p-2.5 hover:bg-muted/50">
+ <Checkbox
+ id={`team-${team.id}`}
+ checked={selectedTeamIds.includes(team.id)}
+ onCheckedChange={() => {
+ setSelectedTeamIds(prev =>
+ prev.includes(team.id)
+ ? prev.filter(id => id !== team.id)
+ : [...prev, team.id]
+ );
+ }}
+ />
+ <Label htmlFor={`team-${team.id}`} className="flex-1 cursor-pointer text-sm">
+ <span className="font-medium">{team.name}</span>
+ <span className="text-muted-foreground ml-2">
+ {t("{count} sites", { count: String(team.sites.length) })}
+ </span>
+ </Label>
+ </div>
+ ))}
+ </div>
+ </div>
+ )}
+
{error && <Alert variant="destructive">{error}</Alert>}
</div>
<DialogFooter>
diff --git a/client/src/app/settings/organization/members/components/MemberSiteAccessDialog.tsx b/client/src/app/settings/organization/components/MemberSiteAccessDialog.tsx
similarity index 100%
rename from client/src/app/settings/organization/members/components/MemberSiteAccessDialog.tsx
rename to client/src/app/settings/organization/components/MemberSiteAccessDialog.tsx
diff --git a/client/src/app/settings/organization/members/components/RemoveMemberDialog.tsx b/client/src/app/settings/organization/components/RemoveMemberDialog.tsx
similarity index 100%
rename from client/src/app/settings/organization/members/components/RemoveMemberDialog.tsx
rename to client/src/app/settings/organization/components/RemoveMemberDialog.tsx
diff --git a/client/src/app/settings/organization/members/components/SiteAccessMultiSelect.tsx b/client/src/app/settings/organization/components/SiteAccessMultiSelect.tsx
similarity index 100%
rename from client/src/app/settings/organization/members/components/SiteAccessMultiSelect.tsx
rename to client/src/app/settings/organization/components/SiteAccessMultiSelect.tsx
diff --git a/client/src/app/settings/organization/layout.tsx b/client/src/app/settings/organization/layout.tsx
index 900d80de1..d1379541a 100644
--- a/client/src/app/settings/organization/layout.tsx
+++ b/client/src/app/settings/organization/layout.tsx
@@ -1,19 +1,14 @@
"use client";
-import { CreditCard, Plus, Users } from "lucide-react";
+import { Plus } from "lucide-react";
import { useExtracted } from "next-intl";
-import { usePathname, useRouter } from "next/navigation";
import { useState } from "react";
import { CreateOrganizationDialog } from "../../../components/CreateOrganizationDialog";
import { OrganizationSelector } from "../../../components/OrganizationSelector";
import { Button } from "../../../components/ui/button";
-import { Tabs, TabsList, TabsTrigger } from "../../../components/ui/tabs";
import { authClient } from "../../../lib/auth";
-import { IS_CLOUD } from "../../../lib/const";
export default function OrganizationLayout({ children }: { children: React.ReactNode }) {
- const router = useRouter();
- const pathname = usePathname();
const [createOrgDialogOpen, setCreateOrgDialogOpen] = useState(false);
const t = useExtracted();
@@ -24,17 +19,6 @@ export default function OrganizationLayout({ children }: { children: React.React
);
const isMember = currentMember?.role === "member";
- // Determine active tab from pathname
- const activeTab = pathname.includes("/subscription") ? "subscription" : "organization";
-
- const handleTabChange = (value: string) => {
- if (value === "organization") {
- router.push("/settings/organization/members");
- } else if (value === "subscription") {
- router.push("/settings/organization/subscription");
- }
- };
-
return (
<>
<div className="space-y-5">
@@ -62,21 +46,6 @@ export default function OrganizationLayout({ children }: { children: React.React
</div>
) : (
<>
- <Tabs value={activeTab} onValueChange={handleTabChange}>
- <TabsList>
- <TabsTrigger value="organization" className="flex items-center gap-2">
- <Users size={16} />
- {t("Organization")}
- </TabsTrigger>
- {IS_CLOUD && (
- <TabsTrigger value="subscription" className="flex items-center gap-2">
- <CreditCard size={16} />
- {t("Subscription")}
- </TabsTrigger>
- )}
- </TabsList>
- </Tabs>
-
<div className="mt-6">{children}</div>
</>
)}
diff --git a/client/src/app/settings/organization/members/page.tsx b/client/src/app/settings/organization/members/page.tsx
deleted file mode 100644
index 3b1d7fdbe..000000000
--- a/client/src/app/settings/organization/members/page.tsx
+++ /dev/null
@@ -1,294 +0,0 @@
-"use client";
-import { DateTime } from "luxon";
-import { getTimezone } from "../../../../lib/store";
-import { Card, CardContent, CardHeader, CardTitle } from "../../../../components/ui/card";
-import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../../components/ui/table";
-import { Badge } from "../../../../components/ui/badge";
-import { authClient } from "../../../../lib/auth";
-
-import { useExtracted } from "next-intl";
-import { useEffect, useState } from "react";
-import { toast } from "@/components/ui/sonner";
-import { useOrganizationMembers } from "../../../../api/admin/hooks/useOrganizationMembers";
-import { useOrganizationInvitations } from "../../../../api/admin/hooks/useOrganizations";
-import { NoOrganization } from "../../../../components/NoOrganization";
-import { Button } from "../../../../components/ui/button";
-import { Input } from "../../../../components/ui/input";
-import { useSetPageTitle } from "../../../../hooks/useSetPageTitle";
-import { IS_CLOUD } from "../../../../lib/const";
-import { CreateUserDialog } from "./components/CreateUserDialog";
-import { DeleteOrganizationDialog } from "./components/DeleteOrganizationDialog";
-import { Invitations } from "./components/Invitations";
-import { InviteMemberDialog } from "./components/InviteMemberDialog";
-import { MemberSiteAccessDialog } from "./components/MemberSiteAccessDialog";
-import { RemoveMemberDialog } from "./components/RemoveMemberDialog";
-import { GetOrganizationMembersResponse } from "../../../../api/admin/endpoints/auth";
-
-// Types for our component
-export type Organization = {
- id: string;
- name: string;
- createdAt: Date;
- slug: string;
-};
-
-export type Member = {
- id: string;
- role: string;
- userId: string;
- organizationId: string;
- createdAt: string;
- user: {
- id: string;
- name: string | null;
- email: string;
- };
- siteAccess?: {
- hasRestrictedSiteAccess: boolean;
- siteIds: number[];
- };
-};
-
-// Organization Component with Members Table
-type MemberData = GetOrganizationMembersResponse["data"][0];
-
-function Organization({
- org,
-}: {
- org: {
- id: string;
- name: string;
- slug: string;
- createdAt: Date;
- };
-}) {
- const t = useExtracted();
- const [name, setName] = useState(org.name);
- const [isUpdating, setIsUpdating] = useState(false);
- const [selectedMemberForAccess, setSelectedMemberForAccess] = useState<MemberData | null>(null);
-
- useEffect(() => {
- setName(org.name);
- }, [org.name]);
-
- const { data: members, refetch, isLoading: membersLoading } = useOrganizationMembers(org.id);
- const { refetch: refetchInvitations } = useOrganizationInvitations(org.id);
- const { data } = authClient.useSession();
-
- const isOwner = members?.data.find(member => member.role === "owner" && member.userId === data?.user?.id);
- const isAdmin = members?.data.find(member => member.role === "admin" && member.userId === data?.user?.id) || isOwner;
-
- const handleRefresh = () => {
- refetch();
- refetchInvitations();
- };
-
- const handleOrganizationNameUpdate = async () => {
- if (!name) {
- toast.error(t("Organization name cannot be empty"));
- return;
- }
-
- try {
- setIsUpdating(true);
- const response = await authClient.organization.update({
- organizationId: org.id,
- data: {
- name,
- },
- });
-
- if (response.error) {
- throw new Error(response.error.message || t("Failed to update organization name"));
- }
-
- toast.success(t("Name updated successfully"));
- window.location.reload();
- } catch (error) {
- console.error("Error updating organization name:", error);
- toast.error(error instanceof Error ? error.message : t("Failed to update organization name"));
- } finally {
- setIsUpdating(false);
- }
- };
-
- return (
- <>
- {isOwner && (
- <Card>
- <CardHeader>
- <CardTitle className="text-xl">{t("Organization")}</CardTitle>
- </CardHeader>
- <CardContent>
- <div className="space-y-2">
- <h4 className="text-sm font-medium">{t("Organization Name")}</h4>
- <p className="text-xs text-neutral-500">{t("Update your organization name")}</p>
- <div className="flex space-x-2">
- <Input id="name" value={name} onChange={({ target }) => setName(target.value)} placeholder="name" />
- <Button variant="outline" onClick={handleOrganizationNameUpdate} disabled={name === org.name}>
- {isUpdating ? t("Updating...") : t("Update")}
- </Button>
- </div>
- </div>
- <div className="pt-4 border-t mt-4 space-y-2">
- <h4 className="text-sm font-medium">{t("Delete Organization")}</h4>
- <p className="text-xs text-neutral-500">{t("Permanently delete this organization and all its data")}</p>
- <div className="w-[200px]">
- <DeleteOrganizationDialog organization={org} onSuccess={handleRefresh} />
- </div>
- </div>
- </CardContent>
- </Card>
- )}
- <Card className="w-full">
- <CardHeader className="pb-2">
- <div className="flex items-center justify-between flex-wrap gap-2">
- <CardTitle className="text-xl">{t("Members")}</CardTitle>
-
- <div className="flex items-center gap-2">
- {isOwner && (
- <>
- {IS_CLOUD ? (
- <InviteMemberDialog
- organizationId={org.id}
- onSuccess={handleRefresh}
- memberCount={members?.data?.length || 0}
- />
- ) : (
- <CreateUserDialog organizationId={org.id} onSuccess={handleRefresh} />
- )}
- </>
- )}
- </div>
- </div>
- </CardHeader>
- <CardContent>
- <Table>
- <TableHeader>
- <TableRow>
- <TableHead>{t("Name")}</TableHead>
- <TableHead>{t("Email")}</TableHead>
- <TableHead>{t("Role")}</TableHead>
- <TableHead>{t("Site Access")}</TableHead>
- <TableHead>{t("Joined")}</TableHead>
- {isOwner && <TableHead className="w-12">{t("Actions")}</TableHead>}
- </TableRow>
- </TableHeader>
- <TableBody>
- {membersLoading ? (
- // Loading skeleton rows
- Array.from({ length: 3 }).map((_, index) => (
- <TableRow key={`loading-${index}`}>
- <TableCell>
- <div className="h-4 bg-muted animate-pulse rounded w-24"></div>
- </TableCell>
- <TableCell>
- <div className="h-4 bg-muted animate-pulse rounded w-32"></div>
- </TableCell>
- <TableCell>
- <div className="h-4 bg-muted animate-pulse rounded w-16"></div>
- </TableCell>
- <TableCell>
- <div className="h-4 bg-muted animate-pulse rounded w-16"></div>
- </TableCell>
- <TableCell>
- <div className="h-4 bg-muted animate-pulse rounded w-20"></div>
- </TableCell>
- {isOwner && (
- <TableCell>
- <div className="h-8 bg-muted animate-pulse rounded w-16 ml-auto"></div>
- </TableCell>
- )}
- </TableRow>
- ))
- ) : (
- <>
- {members?.data?.map((member: MemberData) => (
- <TableRow key={member.id}>
- <TableCell>{member.user?.name || "—"}</TableCell>
- <TableCell>{member.user?.email}</TableCell>
- <TableCell className="capitalize">
- {member.role === "admin" ? t("Admin") : member.role === "owner" ? t("Owner") : t("Member")}
- </TableCell>
- <TableCell>
- {member.role === "member" ? (
- <Badge
- variant={member.siteAccess?.hasRestrictedSiteAccess ? "default" : "secondary"}
- className={isAdmin ? "cursor-pointer hover:opacity-80" : ""}
- onClick={() => isAdmin && setSelectedMemberForAccess(member)}
- >
- {member.siteAccess?.hasRestrictedSiteAccess
- ? t("{count} sites", { count: String(member.siteAccess.siteIds.length) })
- : t("All sites")}
- </Badge>
- ) : (
- <Badge variant="outline">{t("All sites")}</Badge>
- )}
- </TableCell>
- <TableCell>
- {DateTime.fromSQL(member.createdAt, { zone: "utc" })
- .setZone(getTimezone())
- .toLocaleString(DateTime.DATE_SHORT)}
- </TableCell>
- {isAdmin && (
- <TableCell className="text-right">
- {(isOwner || member.role !== "owner") && (
- <RemoveMemberDialog member={member} organizationId={org.id} onSuccess={handleRefresh} />
- )}
- </TableCell>
- )}
- </TableRow>
- ))}
- {(!members?.data || members.data.length === 0) && (
- <TableRow>
- <TableCell colSpan={isOwner ? 6 : 5} className="text-center py-6 text-muted-foreground">
- {t("No members found")}
- </TableCell>
- </TableRow>
- )}
- </>
- )}
- </TableBody>
- </Table>
-
- {/* Member Site Access Dialog */}
- <MemberSiteAccessDialog
- member={selectedMemberForAccess}
- open={!!selectedMemberForAccess}
- onClose={() => setSelectedMemberForAccess(null)}
- onSuccess={handleRefresh}
- />
- </CardContent>
- </Card>
-
- <Invitations organizationId={org.id} isOwner={!!isOwner} />
- </>
- );
-}
-
-// Main Organizations component
-export default function MembersPage() {
- useSetPageTitle("Organization Members");
- const t = useExtracted();
- const { data: activeOrganization, isPending } = authClient.useActiveOrganization();
-
- if (isPending) {
- return (
- <div className="flex justify-center py-8">
- <div className="animate-pulse">{t("Loading organization...")}</div>
- </div>
- );
- }
-
- if (!activeOrganization) {
- return (
- <NoOrganization message={t("You need to create or be added to an organization before you can manage members.")} />
- );
- }
-
- return (
- <div className="flex flex-col gap-6">
- <Organization key={activeOrganization.id} org={activeOrganization} />
- </div>
- );
-}
diff --git a/client/src/app/settings/organization/page.tsx b/client/src/app/settings/organization/page.tsx
index dfad57080..098197f6b 100644
--- a/client/src/app/settings/organization/page.tsx
+++ b/client/src/app/settings/organization/page.tsx
@@ -1,15 +1,294 @@
"use client";
+import { DateTime } from "luxon";
+import { getTimezone } from "../../../lib/store";
+import { Card, CardContent, CardHeader, CardTitle } from "../../../components/ui/card";
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../components/ui/table";
+import { Badge } from "../../../components/ui/badge";
+import { authClient } from "../../../lib/auth";
-import { useEffect } from "react";
-import { useRouter } from "next/navigation";
+import { useExtracted } from "next-intl";
+import { useEffect, useState } from "react";
+import { toast } from "@/components/ui/sonner";
+import { useOrganizationMembers } from "../../../api/admin/hooks/useOrganizationMembers";
+import { useOrganizationInvitations } from "../../../api/admin/hooks/useOrganizations";
+import { NoOrganization } from "../../../components/NoOrganization";
+import { Button } from "../../../components/ui/button";
+import { Input } from "../../../components/ui/input";
+import { useSetPageTitle } from "../../../hooks/useSetPageTitle";
+import { IS_CLOUD } from "../../../lib/const";
+import { CreateUserDialog } from "./components/CreateUserDialog";
+import { DeleteOrganizationDialog } from "./components/DeleteOrganizationDialog";
+import { Invitations } from "./components/Invitations";
+import { InviteMemberDialog } from "./components/InviteMemberDialog";
+import { MemberSiteAccessDialog } from "./components/MemberSiteAccessDialog";
+import { RemoveMemberDialog } from "./components/RemoveMemberDialog";
+import { GetOrganizationMembersResponse } from "../../../api/admin/endpoints/auth";
-export default function OrganizationPage() {
- const router = useRouter();
+// Types for our component
+export type Organization = {
+ id: string;
+ name: string;
+ createdAt: Date;
+ slug: string;
+};
+
+export type Member = {
+ id: string;
+ role: string;
+ userId: string;
+ organizationId: string;
+ createdAt: string;
+ user: {
+ id: string;
+ name: string | null;
+ email: string;
+ };
+ siteAccess?: {
+ hasRestrictedSiteAccess: boolean;
+ siteIds: number[];
+ };
+};
+
+// Organization Component with Members Table
+type MemberData = GetOrganizationMembersResponse["data"][0];
+
+function Organization({
+ org,
+}: {
+ org: {
+ id: string;
+ name: string;
+ slug: string;
+ createdAt: Date;
+ };
+}) {
+ const t = useExtracted();
+ const [name, setName] = useState(org.name);
+ const [isUpdating, setIsUpdating] = useState(false);
+ const [selectedMemberForAccess, setSelectedMemberForAccess] = useState<MemberData | null>(null);
useEffect(() => {
- // Redirect to members page by default
- router.replace("/settings/organization/members");
- }, [router]);
+ setName(org.name);
+ }, [org.name]);
+
+ const { data: members, refetch, isLoading: membersLoading } = useOrganizationMembers(org.id);
+ const { refetch: refetchInvitations } = useOrganizationInvitations(org.id);
+ const { data } = authClient.useSession();
+
+ const isOwner = members?.data.find(member => member.role === "owner" && member.userId === data?.user?.id);
+ const isAdmin = members?.data.find(member => member.role === "admin" && member.userId === data?.user?.id) || isOwner;
+
+ const handleRefresh = () => {
+ refetch();
+ refetchInvitations();
+ };
+
+ const handleOrganizationNameUpdate = async () => {
+ if (!name) {
+ toast.error(t("Organization name cannot be empty"));
+ return;
+ }
+
+ try {
+ setIsUpdating(true);
+ const response = await authClient.organization.update({
+ organizationId: org.id,
+ data: {
+ name,
+ },
+ });
+
+ if (response.error) {
+ throw new Error(response.error.message || t("Failed to update organization name"));
+ }
+
+ toast.success(t("Name updated successfully"));
+ window.location.reload();
+ } catch (error) {
+ console.error("Error updating organization name:", error);
+ toast.error(error instanceof Error ? error.message : t("Failed to update organization name"));
+ } finally {
+ setIsUpdating(false);
+ }
+ };
+
+ return (
+ <>
+ {isOwner && (
+ <Card>
+ <CardHeader>
+ <CardTitle className="text-xl">{t("Organization")}</CardTitle>
+ </CardHeader>
+ <CardContent>
+ <div className="space-y-2">
+ <h4 className="text-sm font-medium">{t("Organization Name")}</h4>
+ <p className="text-xs text-neutral-500">{t("Update your organization name")}</p>
+ <div className="flex space-x-2">
+ <Input id="name" value={name} onChange={({ target }) => setName(target.value)} placeholder="name" />
+ <Button variant="outline" onClick={handleOrganizationNameUpdate} disabled={name === org.name}>
+ {isUpdating ? t("Updating...") : t("Update")}
+ </Button>
+ </div>
+ </div>
+ <div className="pt-4 border-t mt-4 space-y-2">
+ <h4 className="text-sm font-medium">{t("Delete Organization")}</h4>
+ <p className="text-xs text-neutral-500">{t("Permanently delete this organization and all its data")}</p>
+ <div className="w-[200px]">
+ <DeleteOrganizationDialog organization={org} onSuccess={handleRefresh} />
+ </div>
+ </div>
+ </CardContent>
+ </Card>
+ )}
+ <Card className="w-full">
+ <CardHeader className="pb-2">
+ <div className="flex items-center justify-between flex-wrap gap-2">
+ <CardTitle className="text-xl">{t("Members")}</CardTitle>
+
+ <div className="flex items-center gap-2">
+ {isOwner && (
+ <>
+ {IS_CLOUD ? (
+ <InviteMemberDialog
+ organizationId={org.id}
+ onSuccess={handleRefresh}
+ memberCount={members?.data?.length || 0}
+ />
+ ) : (
+ <CreateUserDialog organizationId={org.id} onSuccess={handleRefresh} />
+ )}
+ </>
+ )}
+ </div>
+ </div>
+ </CardHeader>
+ <CardContent>
+ <Table>
+ <TableHeader>
+ <TableRow>
+ <TableHead>{t("Name")}</TableHead>
+ <TableHead>{t("Email")}</TableHead>
+ <TableHead>{t("Role")}</TableHead>
+ <TableHead>{t("Site Access")}</TableHead>
+ <TableHead>{t("Joined")}</TableHead>
+ {isOwner && <TableHead className="w-12">{t("Actions")}</TableHead>}
+ </TableRow>
+ </TableHeader>
+ <TableBody>
+ {membersLoading ? (
+ // Loading skeleton rows
+ Array.from({ length: 3 }).map((_, index) => (
+ <TableRow key={`loading-${index}`}>
+ <TableCell>
+ <div className="h-4 bg-muted animate-pulse rounded w-24"></div>
+ </TableCell>
+ <TableCell>
+ <div className="h-4 bg-muted animate-pulse rounded w-32"></div>
+ </TableCell>
+ <TableCell>
+ <div className="h-4 bg-muted animate-pulse rounded w-16"></div>
+ </TableCell>
+ <TableCell>
+ <div className="h-4 bg-muted animate-pulse rounded w-16"></div>
+ </TableCell>
+ <TableCell>
+ <div className="h-4 bg-muted animate-pulse rounded w-20"></div>
+ </TableCell>
+ {isOwner && (
+ <TableCell>
+ <div className="h-8 bg-muted animate-pulse rounded w-16 ml-auto"></div>
+ </TableCell>
+ )}
+ </TableRow>
+ ))
+ ) : (
+ <>
+ {members?.data?.map((member: MemberData) => (
+ <TableRow key={member.id}>
+ <TableCell>{member.user?.name || "—"}</TableCell>
+ <TableCell>{member.user?.email}</TableCell>
+ <TableCell className="capitalize">
+ {member.role === "admin" ? t("Admin") : member.role === "owner" ? t("Owner") : t("Member")}
+ </TableCell>
+ <TableCell>
+ {member.role === "member" ? (
+ <Badge
+ variant={member.siteAccess?.hasRestrictedSiteAccess ? "default" : "secondary"}
+ className={isAdmin ? "cursor-pointer hover:opacity-80" : ""}
+ onClick={() => isAdmin && setSelectedMemberForAccess(member)}
+ >
+ {member.siteAccess?.hasRestrictedSiteAccess
+ ? t("{count} sites", { count: String(member.siteAccess.siteIds.length) })
+ : t("All sites")}
+ </Badge>
+ ) : (
+ <Badge variant="outline">{t("All sites")}</Badge>
+ )}
+ </TableCell>
+ <TableCell>
+ {DateTime.fromSQL(member.createdAt, { zone: "utc" })
+ .setZone(getTimezone())
+ .toLocaleString(DateTime.DATE_SHORT)}
+ </TableCell>
+ {isAdmin && (
+ <TableCell className="text-right">
+ {(isOwner || member.role !== "owner") && (
+ <RemoveMemberDialog member={member} organizationId={org.id} onSuccess={handleRefresh} />
+ )}
+ </TableCell>
+ )}
+ </TableRow>
+ ))}
+ {(!members?.data || members.data.length === 0) && (
+ <TableRow>
+ <TableCell colSpan={isOwner ? 6 : 5} className="text-center py-6 text-muted-foreground">
+ {t("No members found")}
+ </TableCell>
+ </TableRow>
+ )}
+ </>
+ )}
+ </TableBody>
+ </Table>
+
+ {/* Member Site Access Dialog */}
+ <MemberSiteAccessDialog
+ member={selectedMemberForAccess}
+ open={!!selectedMemberForAccess}
+ onClose={() => setSelectedMemberForAccess(null)}
+ onSuccess={handleRefresh}
+ />
+ </CardContent>
+ </Card>
+
+ <Invitations organizationId={org.id} isOwner={!!isOwner} />
+ </>
+ );
+}
+
+// Main Organizations component
+export default function MembersPage() {
+ useSetPageTitle("Organization Members");
+ const t = useExtracted();
+ const { data: activeOrganization, isPending } = authClient.useActiveOrganization();
+
+ if (isPending) {
+ return (
+ <div className="flex justify-center py-8">
+ <div className="animate-pulse">{t("Loading organization...")}</div>
+ </div>
+ );
+ }
+
+ if (!activeOrganization) {
+ return (
+ <NoOrganization message={t("You need to create or be added to an organization before you can manage members.")} />
+ );
+ }
- return null;
+ return (
+ <div className="flex flex-col gap-6">
+ <Organization key={activeOrganization.id} org={activeOrganization} />
+ </div>
+ );
}
diff --git a/client/src/app/settings/subscription/layout.tsx b/client/src/app/settings/subscription/layout.tsx
new file mode 100644
index 000000000..67012347f
--- /dev/null
+++ b/client/src/app/settings/subscription/layout.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import { authClient } from "../../../lib/auth";
+
+export default function SubscriptionLayout({ children }: { children: React.ReactNode }) {
+ const t = useExtracted();
+ const { data: session } = authClient.useSession();
+ const { data: activeOrg } = authClient.useActiveOrganization();
+ const currentMember = activeOrg?.members?.find(
+ (m) => m.userId === session?.user?.id
+ );
+ const isMember = currentMember?.role === "member";
+
+ return (
+ <div className="space-y-5">
+ <div>
+ <h1 className="text-3xl font-bold tracking-tight">{t("Subscription")}</h1>
+ <p className="text-neutral-500 dark:text-neutral-400">
+ {t("Manage your subscription and billing.")}
+ </p>
+ </div>
+
+ {isMember ? (
+ <div className="rounded-lg border border-neutral-200 dark:border-neutral-800 p-6 text-center text-neutral-500 dark:text-neutral-400">
+ {t("You don't have permission to view subscription settings.")}
+ </div>
+ ) : (
+ <div className="mt-6">{children}</div>
+ )}
+ </div>
+ );
+}
diff --git a/client/src/app/settings/organization/subscription/page.tsx b/client/src/app/settings/subscription/page.tsx
similarity index 81%
rename from client/src/app/settings/organization/subscription/page.tsx
rename to client/src/app/settings/subscription/page.tsx
index b96be2d16..ff44f1c6e 100644
--- a/client/src/app/settings/organization/subscription/page.tsx
+++ b/client/src/app/settings/subscription/page.tsx
@@ -2,19 +2,19 @@
import { Card, CardContent, CardDescription, CardTitle } from "@/components/ui/card";
import { Skeleton } from "@/components/ui/skeleton";
-import { PaidPlan } from "../../../../components/subscription/PaidPlain/PaidPlan";
-import { useStripeSubscription } from "../../../../lib/subscription/useStripeSubscription";
-import { NoOrganization } from "../../../../components/NoOrganization";
-import { ExpiredTrialPlan } from "../../../../components/subscription/ExpiredTrialPlan";
-import { useSetPageTitle } from "../../../../hooks/useSetPageTitle";
-import { FreePlan } from "../../../../components/subscription/FreePlan";
-import { OverridePlan } from "../../../../components/subscription/OverridePlan";
-import { CustomPlan } from "../../../../components/subscription/CustomPlan";
+import { PaidPlan } from "../../../components/subscription/PaidPlain/PaidPlan";
+import { useStripeSubscription } from "../../../lib/subscription/useStripeSubscription";
+import { NoOrganization } from "../../../components/NoOrganization";
+import { ExpiredTrialPlan } from "../../../components/subscription/ExpiredTrialPlan";
+import { useSetPageTitle } from "../../../hooks/useSetPageTitle";
+import { FreePlan } from "../../../components/subscription/FreePlan";
+import { OverridePlan } from "../../../components/subscription/OverridePlan";
+import { CustomPlan } from "../../../components/subscription/CustomPlan";
import { Building } from "lucide-react";
import { useExtracted } from "next-intl";
import { authClient } from "@/lib/auth";
import { useEffect } from "react";
-import { AppSumoPlan } from "../../../../components/subscription/AppSumoPlan";
+import { AppSumoPlan } from "../../../components/subscription/AppSumoPlan";
export default function OrganizationSubscriptionPage() {
useSetPageTitle("Organization Subscription");
diff --git a/client/src/app/settings/teams/components/CreateEditTeamDialog.tsx b/client/src/app/settings/teams/components/CreateEditTeamDialog.tsx
new file mode 100644
index 000000000..a018808bd
--- /dev/null
+++ b/client/src/app/settings/teams/components/CreateEditTeamDialog.tsx
@@ -0,0 +1,344 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import { useEffect, useState } from "react";
+import { toast } from "@/components/ui/sonner";
+
+import { Team } from "@/api/admin/endpoints/teams";
+import { useCreateTeam, useUpdateTeam } from "@/api/admin/hooks/useTeams";
+import { useOrganizationMembers } from "@/api/admin/hooks/useOrganizationMembers";
+import { useGetSitesFromOrg } from "@/api/admin/hooks/useSites";
+import { Button } from "@/components/ui/button";
+import { Checkbox } from "@/components/ui/checkbox";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { Input } from "@/components/ui/input";
+import { Label } from "@/components/ui/label";
+import { authClient } from "@/lib/auth";
+
+interface CreateEditTeamDialogProps {
+ team?: Team;
+ trigger?: React.ReactNode;
+ open?: boolean;
+ onOpenChange?: (open: boolean) => void;
+ onSuccess?: () => void;
+}
+
+export function CreateEditTeamDialog({
+ team: existingTeam,
+ trigger,
+ open: controlledOpen,
+ onOpenChange: controlledOnOpenChange,
+ onSuccess,
+}: CreateEditTeamDialogProps) {
+ const t = useExtracted();
+ const { data: activeOrganization } = authClient.useActiveOrganization();
+ const { data: membersData, isLoading: isLoadingMembers } = useOrganizationMembers(activeOrganization?.id || "");
+ const { data: sitesData, isLoading: isLoadingSites } = useGetSitesFromOrg(activeOrganization?.id);
+
+ const createTeam = useCreateTeam();
+ const updateTeam = useUpdateTeam();
+
+ const [internalOpen, setInternalOpen] = useState(false);
+ const open = controlledOpen ?? internalOpen;
+ const setOpen = controlledOnOpenChange ?? setInternalOpen;
+
+ const [name, setName] = useState("");
+ const [selectedMemberIds, setSelectedMemberIds] = useState<string[]>([]);
+ const [selectedSiteIds, setSelectedSiteIds] = useState<number[]>([]);
+
+ const isEditing = !!existingTeam;
+
+ // Reset form when dialog opens
+ useEffect(() => {
+ if (open) {
+ if (existingTeam) {
+ setName(existingTeam.name);
+ setSelectedMemberIds(existingTeam.members.map((m) => m.userId));
+ setSelectedSiteIds(existingTeam.sites.map((s) => s.siteId));
+ } else {
+ setName("");
+ setSelectedMemberIds([]);
+ setSelectedSiteIds([]);
+ }
+ }
+ }, [open, existingTeam]);
+
+ const members = membersData?.data || [];
+ const sites = sitesData?.sites || [];
+
+ const handleMemberToggle = (userId: string) => {
+ setSelectedMemberIds((prev) =>
+ prev.includes(userId)
+ ? prev.filter((id) => id !== userId)
+ : [...prev, userId]
+ );
+ };
+
+ const handleSiteToggle = (siteId: number) => {
+ setSelectedSiteIds((prev) =>
+ prev.includes(siteId)
+ ? prev.filter((id) => id !== siteId)
+ : [...prev, siteId]
+ );
+ };
+
+ const handleSelectAllMembers = () => {
+ if (selectedMemberIds.length === members.length) {
+ setSelectedMemberIds([]);
+ } else {
+ setSelectedMemberIds(members.map((m) => m.userId));
+ }
+ };
+
+ const handleSelectAllSites = () => {
+ if (selectedSiteIds.length === sites.length) {
+ setSelectedSiteIds([]);
+ } else {
+ setSelectedSiteIds(sites.map((s) => s.siteId));
+ }
+ };
+
+ const handleSubmit = async () => {
+ if (!name.trim()) {
+ toast.error(t("Team name is required"));
+ return;
+ }
+
+ if (!activeOrganization?.id) return;
+
+ try {
+ if (isEditing) {
+ await updateTeam.mutateAsync({
+ organizationId: activeOrganization.id,
+ teamId: existingTeam.id,
+ data: {
+ name: name.trim(),
+ memberUserIds: selectedMemberIds,
+ siteIds: selectedSiteIds,
+ },
+ });
+ toast.success(t("Team updated successfully"));
+ } else {
+ await createTeam.mutateAsync({
+ organizationId: activeOrganization.id,
+ data: {
+ name: name.trim(),
+ memberUserIds: selectedMemberIds,
+ siteIds: selectedSiteIds,
+ },
+ });
+ toast.success(t("Team created successfully"));
+ }
+ setOpen(false);
+ onSuccess?.();
+ } catch (error) {
+ toast.error(
+ error instanceof Error
+ ? error.message
+ : isEditing
+ ? t("Failed to update team")
+ : t("Failed to create team")
+ );
+ }
+ };
+
+ const isPending = createTeam.isPending || updateTeam.isPending;
+
+ const dialogContent = (
+ <DialogContent className="max-w-lg max-h-[85vh] overflow-y-auto">
+ <DialogHeader>
+ <DialogTitle>
+ {isEditing ? t("Edit Team") : t("Create Team")}
+ </DialogTitle>
+ <DialogDescription>
+ {isEditing
+ ? t("Update team name, members, and site assignments.")
+ : t(
+ "Create a new team to group sites and control member access."
+ )}
+ </DialogDescription>
+ </DialogHeader>
+
+ <div className="grid gap-4">
+ {/* Team Name */}
+ <div className="space-y-2">
+ <Label htmlFor="team-name">{t("Team Name")}</Label>
+ <Input
+ id="team-name"
+ value={name}
+ onChange={(e) => setName(e.target.value)}
+ placeholder={t("Enter team name")}
+ />
+ </div>
+
+ {/* Members */}
+ <div className="space-y-2">
+ <Label className="font-medium">{t("Members")}</Label>
+ <p className="text-xs text-muted-foreground">
+ {t("Select which members belong to this team.")}
+ </p>
+ <div className="space-y-2">
+ <div className="flex items-center space-x-2">
+ <Checkbox
+ id="select-all-members"
+ checked={
+ members.length > 0 &&
+ selectedMemberIds.length === members.length
+ }
+ onCheckedChange={handleSelectAllMembers}
+ />
+ <Label
+ htmlFor="select-all-members"
+ className="text-sm font-medium cursor-pointer"
+ >
+ {t("Select all")} ({members.length})
+ </Label>
+ </div>
+ <div className="border rounded-lg divide-y max-h-40 overflow-y-auto">
+ {isLoadingMembers ? (
+ Array.from({ length: 3 }).map((_, i) => (
+ <div key={i} className="flex items-center space-x-3 p-2.5 animate-pulse">
+ <div className="h-4 w-4 rounded bg-neutral-200 dark:bg-neutral-700" />
+ <div className="flex-1 flex items-center gap-2">
+ <div className="h-4 w-24 rounded bg-neutral-200 dark:bg-neutral-700" />
+ <div className="h-4 w-32 rounded bg-neutral-200 dark:bg-neutral-700" />
+ </div>
+ </div>
+ ))
+ ) : members.length === 0 ? (
+ <div className="p-3 text-sm text-muted-foreground text-center">
+ {t("No members in this organization")}
+ </div>
+ ) : (
+ members.map((m) => (
+ <div
+ key={m.userId}
+ className="flex items-center space-x-3 p-2.5 hover:bg-muted/50"
+ >
+ <Checkbox
+ id={`member-${m.userId}`}
+ checked={selectedMemberIds.includes(m.userId)}
+ onCheckedChange={() => handleMemberToggle(m.userId)}
+ />
+ <Label
+ htmlFor={`member-${m.userId}`}
+ className="flex-1 cursor-pointer text-sm"
+ >
+ <span className="font-medium">
+ {m.user?.name || m.user?.email}
+ </span>
+ {m.user?.name && (
+ <span className="text-muted-foreground ml-2">
+ {m.user.email}
+ </span>
+ )}
+ </Label>
+ </div>
+ ))
+ )}
+ </div>
+ </div>
+ </div>
+
+ {/* Sites */}
+ <div className="space-y-2">
+ <Label className="font-medium">{t("Sites")}</Label>
+ <p className="text-xs text-muted-foreground">
+ {t(
+ "Select which sites belong to this team. Only team members (and admins/owners) will be able to access these sites."
+ )}
+ </p>
+ <div className="space-y-2">
+ <div className="flex items-center space-x-2">
+ <Checkbox
+ id="select-all-sites"
+ checked={
+ sites.length > 0 &&
+ selectedSiteIds.length === sites.length
+ }
+ onCheckedChange={handleSelectAllSites}
+ />
+ <Label
+ htmlFor="select-all-sites"
+ className="text-sm font-medium cursor-pointer"
+ >
+ {t("Select all")} ({sites.length})
+ </Label>
+ </div>
+ <div className="border rounded-lg divide-y max-h-40 overflow-y-auto">
+ {isLoadingSites ? (
+ Array.from({ length: 3 }).map((_, i) => (
+ <div key={i} className="flex items-center space-x-3 p-2.5 animate-pulse">
+ <div className="h-4 w-4 rounded bg-neutral-200 dark:bg-neutral-700" />
+ <div className="h-4 w-36 rounded bg-neutral-200 dark:bg-neutral-700" />
+ </div>
+ ))
+ ) : sites.length === 0 ? (
+ <div className="p-3 text-sm text-muted-foreground text-center">
+ {t("No sites in this organization")}
+ </div>
+ ) : (
+ sites.map((site) => (
+ <div
+ key={site.siteId}
+ className="flex items-center space-x-3 p-2.5 hover:bg-muted/50"
+ >
+ <Checkbox
+ id={`site-${site.siteId}`}
+ checked={selectedSiteIds.includes(site.siteId)}
+ onCheckedChange={() => handleSiteToggle(site.siteId)}
+ />
+ <Label
+ htmlFor={`site-${site.siteId}`}
+ className="flex-1 cursor-pointer text-sm"
+ >
+ <span className="font-medium">{site.domain}</span>
+ </Label>
+ </div>
+ ))
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <DialogFooter>
+ <Button variant="outline" onClick={() => setOpen(false)}>
+ {t("Cancel")}
+ </Button>
+ <Button onClick={handleSubmit} disabled={isPending} variant="success">
+ {isPending
+ ? isEditing
+ ? t("Updating...")
+ : t("Creating...")
+ : isEditing
+ ? t("Save Changes")
+ : t("Create Team")}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ );
+
+ if (trigger) {
+ return (
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogTrigger asChild>{trigger}</DialogTrigger>
+ {dialogContent}
+ </Dialog>
+ );
+ }
+
+ return (
+ <Dialog open={open} onOpenChange={setOpen}>
+ {dialogContent}
+ </Dialog>
+ );
+}
diff --git a/client/src/app/settings/teams/components/DeleteTeamDialog.tsx b/client/src/app/settings/teams/components/DeleteTeamDialog.tsx
new file mode 100644
index 000000000..bc4edc0c1
--- /dev/null
+++ b/client/src/app/settings/teams/components/DeleteTeamDialog.tsx
@@ -0,0 +1,83 @@
+"use client";
+
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+import { toast } from "@/components/ui/sonner";
+
+import { Team } from "@/api/admin/endpoints/teams";
+import { useDeleteTeam } from "@/api/admin/hooks/useTeams";
+import { Button } from "@/components/ui/button";
+import {
+ Dialog,
+ DialogContent,
+ DialogDescription,
+ DialogFooter,
+ DialogHeader,
+ DialogTitle,
+ DialogTrigger,
+} from "@/components/ui/dialog";
+import { authClient } from "@/lib/auth";
+import { Trash2 } from "lucide-react";
+
+interface DeleteTeamDialogProps {
+ team: Team;
+ onSuccess?: () => void;
+}
+
+export function DeleteTeamDialog({ team, onSuccess }: DeleteTeamDialogProps) {
+ const t = useExtracted();
+ const { data: activeOrganization } = authClient.useActiveOrganization();
+ const deleteTeam = useDeleteTeam();
+ const [open, setOpen] = useState(false);
+
+ const handleDelete = async () => {
+ if (!activeOrganization?.id) return;
+
+ try {
+ await deleteTeam.mutateAsync({
+ organizationId: activeOrganization.id,
+ teamId: team.id,
+ });
+ toast.success(t("Team deleted successfully"));
+ setOpen(false);
+ onSuccess?.();
+ } catch (error) {
+ toast.error(
+ error instanceof Error ? error.message : t("Failed to delete team")
+ );
+ }
+ };
+
+ return (
+ <Dialog open={open} onOpenChange={setOpen}>
+ <DialogTrigger asChild>
+ <Button variant="ghost" size="smIcon">
+ <Trash2 className="h-3.5 w-3.5" />
+ </Button>
+ </DialogTrigger>
+ <DialogContent className="max-w-md">
+ <DialogHeader>
+ <DialogTitle>{t("Delete Team")}</DialogTitle>
+ <DialogDescription>
+ {t(
+ "Are you sure you want to delete the team \"{name}\"? Sites assigned to this team will become unassigned and visible to all members.",
+ { name: team.name }
+ )}
+ </DialogDescription>
+ </DialogHeader>
+ <DialogFooter>
+ <Button variant="outline" onClick={() => setOpen(false)}>
+ {t("Cancel")}
+ </Button>
+ <Button
+ variant="destructive"
+ onClick={handleDelete}
+ disabled={deleteTeam.isPending}
+ >
+ {deleteTeam.isPending ? t("Deleting...") : t("Delete Team")}
+ </Button>
+ </DialogFooter>
+ </DialogContent>
+ </Dialog>
+ );
+}
diff --git a/client/src/app/settings/teams/layout.tsx b/client/src/app/settings/teams/layout.tsx
new file mode 100644
index 000000000..6b4f8e825
--- /dev/null
+++ b/client/src/app/settings/teams/layout.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { Plus } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { Button } from "../../../components/ui/button";
+import { authClient } from "../../../lib/auth";
+import { CreateEditTeamDialog } from "./components/CreateEditTeamDialog";
+
+export default function TeamsLayout({ children }: { children: React.ReactNode }) {
+ const t = useExtracted();
+ const { data: session } = authClient.useSession();
+ const { data: activeOrg } = authClient.useActiveOrganization();
+ const currentMember = activeOrg?.members?.find(
+ (m) => m.userId === session?.user?.id
+ );
+ const isMember = currentMember?.role === "member";
+
+ return (
+ <div className="space-y-5">
+ <div className="flex items-end justify-between">
+ <div>
+ <h1 className="text-3xl font-bold tracking-tight">{t("Teams")}</h1>
+ <p className="text-neutral-500 dark:text-neutral-400">
+ {t("Organize sites into teams to control which members can access them.")}
+ </p>
+ </div>
+ {!isMember && (
+ <CreateEditTeamDialog
+ trigger={
+ <Button size="sm">
+ <Plus className="h-4 w-4 mr-1" />
+ {t("Create Team")}
+ </Button>
+ }
+ />
+ )}
+ </div>
+
+ {isMember ? (
+ <div className="rounded-lg border border-neutral-200 dark:border-neutral-800 p-6 text-center text-neutral-500 dark:text-neutral-400">
+ {t("You don't have permission to view team settings.")}
+ </div>
+ ) : (
+ <div className="mt-6">{children}</div>
+ )}
+ </div>
+ );
+}
diff --git a/client/src/app/settings/teams/page.tsx b/client/src/app/settings/teams/page.tsx
new file mode 100644
index 000000000..be13b7198
--- /dev/null
+++ b/client/src/app/settings/teams/page.tsx
@@ -0,0 +1,205 @@
+"use client";
+
+import { ChevronDown, Globe, Pencil, Users2 } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+
+import { Team } from "@/api/admin/endpoints/teams";
+import { useTeams } from "@/api/admin/hooks/useTeams";
+import { NoOrganization } from "@/components/NoOrganization";
+import { Button } from "@/components/ui/button";
+import { useSetPageTitle } from "@/hooks/useSetPageTitle";
+import { authClient } from "@/lib/auth";
+import { cn } from "@/lib/utils";
+import { CreateEditTeamDialog } from "./components/CreateEditTeamDialog";
+import { DeleteTeamDialog } from "./components/DeleteTeamDialog";
+
+export default function TeamsPage() {
+ useSetPageTitle("Organization Teams");
+ const t = useExtracted();
+ const { data: activeOrganization, isPending } =
+ authClient.useActiveOrganization();
+ const { data: teamsData, isLoading: teamsLoading } = useTeams(
+ activeOrganization?.id
+ );
+
+ const [editingTeam, setEditingTeam] = useState<Team | null>(null);
+ const [expandedTeams, setExpandedTeams] = useState<Set<string>>(new Set());
+
+ const toggleExpanded = (teamId: string) => {
+ setExpandedTeams((prev) => {
+ const next = new Set(prev);
+ if (next.has(teamId)) {
+ next.delete(teamId);
+ } else {
+ next.add(teamId);
+ }
+ return next;
+ });
+ };
+
+ if (isPending) {
+ return (
+ <div className="flex justify-center py-8">
+ <div className="animate-pulse">{t("Loading organization...")}</div>
+ </div>
+ );
+ }
+
+ if (!activeOrganization) {
+ return (
+ <NoOrganization
+ message={t(
+ "You need to create or be added to an organization before you can manage teams."
+ )}
+ />
+ );
+ }
+
+ const teams = teamsData?.teams || [];
+
+ return (
+ <div className="flex flex-col gap-4">
+ {teamsLoading ? (
+ <div className="space-y-3">
+ {Array.from({ length: 2 }).map((_, i) => (
+ <div
+ key={i}
+ className="h-20 bg-muted animate-pulse rounded-lg"
+ />
+ ))}
+ </div>
+ ) : teams.length === 0 ? (
+ <div className="text-center py-8 text-muted-foreground">
+ <Users2 className="h-10 w-10 mx-auto mb-3 opacity-50" />
+ <p className="font-medium">{t("No teams yet")}</p>
+ <p className="text-sm mt-1">
+ {t(
+ "Create a team to group sites and manage member access."
+ )}
+ </p>
+ </div>
+ ) : (
+ <div className="space-y-3">
+ {teams.map((team) => {
+ const isExpanded = expandedTeams.has(team.id);
+ return (
+ <div
+ key={team.id}
+ className="border rounded-lg transition-colors bg-white dark:bg-neutral-900/70"
+ >
+ <div
+ className="flex items-center justify-between p-4 cursor-pointer hover:bg-muted/50"
+ onClick={() => toggleExpanded(team.id)}
+ >
+ <div className="flex items-center gap-3 flex-1 min-w-0">
+ <ChevronDown
+ className={cn(
+ "h-4 w-4 shrink-0 text-muted-foreground transition-transform",
+ !isExpanded && "-rotate-90"
+ )}
+ />
+ <div className="flex-1 min-w-0">
+ <h3 className="font-medium truncate">{team.name}</h3>
+ <div className="flex items-center gap-3 mt-1 text-sm text-muted-foreground">
+ <span className="flex items-center gap-1">
+ <Users2 className="h-3.5 w-3.5" />
+ {t("{count} members", {
+ count: String(team.members.length),
+ })}
+ </span>
+ <span className="flex items-center gap-1">
+ <Globe className="h-3.5 w-3.5" />
+ {t("{count} sites", {
+ count: String(team.sites.length),
+ })}
+ </span>
+ </div>
+ </div>
+ </div>
+ <div
+ className="flex items-center gap-2 ml-4"
+ onClick={(e) => e.stopPropagation()}
+ >
+ <Button
+ variant="ghost"
+ size="smIcon"
+ onClick={() => setEditingTeam(team)}
+ >
+ <Pencil className="h-3.5 w-3.5" />
+ </Button>
+ <DeleteTeamDialog team={team} />
+ </div>
+ </div>
+ {isExpanded && (
+ <div className="border-t px-4 py-3">
+ <div className="grid grid-cols-1 md:grid-cols-2 gap-4">
+ <div>
+ <h4 className="text-sm font-medium mb-2 flex items-center gap-1.5">
+ <Users2 className="h-3.5 w-3.5" />
+ {t("Members")}
+ </h4>
+ {team.members.length === 0 ? (
+ <p className="text-sm text-muted-foreground">
+ {t("No members")}
+ </p>
+ ) : (
+ <div className="space-y-1">
+ {team.members.map((member) => (
+ <div
+ key={member.userId}
+ className="text-sm py-1 px-5 rounded hover:bg-muted/50"
+ >
+ <span>{member.userName || member.userEmail}</span>
+ {member.userName && (
+ <span className="text-muted-foreground ml-2 text-xs">
+ {member.userEmail}
+ </span>
+ )}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ <div>
+ <h4 className="text-sm font-medium mb-2 flex items-center gap-1.5">
+ <Globe className="h-3.5 w-3.5" />
+ {t("Sites")}
+ </h4>
+ {team.sites.length === 0 ? (
+ <p className="text-sm text-muted-foreground">
+ {t("No sites")}
+ </p>
+ ) : (
+ <div className="space-y-1">
+ {team.sites.map((site) => (
+ <div
+ key={site.siteId}
+ className="text-sm py-1 px-5 rounded hover:bg-muted/50"
+ >
+ {site.domain}
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ </div>
+ </div>
+ )}
+ </div>
+ );
+ })}
+ </div>
+ )}
+
+ {/* Edit Team Dialog */}
+ <CreateEditTeamDialog
+ team={editingTeam || undefined}
+ open={!!editingTeam}
+ onOpenChange={(open) => {
+ if (!open) setEditingTeam(null);
+ }}
+ />
+ </div>
+ );
+}
diff --git a/client/src/app/subscribe/components/PricingCards.tsx b/client/src/app/subscribe/components/PricingCards.tsx
index 7a191a3f3..bb3eda7eb 100644
--- a/client/src/app/subscribe/components/PricingCards.tsx
+++ b/client/src/app/subscribe/components/PricingCards.tsx
@@ -78,7 +78,7 @@ export function PricingCards({ isLoggedIn }: { isLoggedIn: boolean }) {
const baseUrl = window.location.origin;
const returnUrl = siteId
? `${baseUrl}/${siteId}?session_id={CHECKOUT_SESSION_ID}`
- : `${baseUrl}/settings/organization/subscription?session_id={CHECKOUT_SESSION_ID}`;
+ : `${baseUrl}/settings/subscription?session_id={CHECKOUT_SESSION_ID}`;
const response = await fetch(`${BACKEND_URL}/stripe/create-checkout-session`, {
method: "POST",
@@ -128,7 +128,7 @@ export function PricingCards({ isLoggedIn }: { isLoggedIn: boolean }) {
const baseUrl = window.location.origin;
const returnUrl = siteId
? `${baseUrl}/${siteId}?session_id={CHECKOUT_SESSION_ID}`
- : `${baseUrl}/settings/organization/subscription?session_id={CHECKOUT_SESSION_ID}`;
+ : `${baseUrl}/settings/subscription?session_id={CHECKOUT_SESSION_ID}`;
const response = await fetch(`${BACKEND_URL}/stripe/create-checkout-session`, {
method: "POST",
diff --git a/client/src/app/subscribe/page.tsx b/client/src/app/subscribe/page.tsx
index 7defc2db0..9676c217d 100644
--- a/client/src/app/subscribe/page.tsx
+++ b/client/src/app/subscribe/page.tsx
@@ -21,7 +21,7 @@ function SubscribeContent() {
// Redirect if already subscribed
// if (subscription?.status === "active" || subscription?.status === "trialing") {
- // router.push("/settings/organization/subscription");
+ // router.push("/settings/subscription");
// }
// Get the active organization ID
diff --git a/client/src/components/OrganizationSelector.tsx b/client/src/components/OrganizationSelector.tsx
index c43d8ffaa..93da80eb3 100644
--- a/client/src/components/OrganizationSelector.tsx
+++ b/client/src/components/OrganizationSelector.tsx
@@ -67,9 +67,9 @@ export function OrganizationSelector() {
<SelectContent>
{organizations?.map(org => (
<SelectItem key={org.id} value={org.id}>
- <div className="flex items-center">
- <Building2 className="h-4 w-4 mr-2 text-muted-foreground" />
- {org.name}
+ <div className="flex items-center min-w-0">
+ <Building2 className="h-4 w-4 mr-2 text-muted-foreground shrink-0" />
+ <span className="truncate">{org.name}</span>
</div>
</SelectItem>
))}
diff --git a/client/src/components/TeamSelector.tsx b/client/src/components/TeamSelector.tsx
new file mode 100644
index 000000000..8a6018124
--- /dev/null
+++ b/client/src/components/TeamSelector.tsx
@@ -0,0 +1,116 @@
+"use client";
+
+import { ChevronDown, Globe, Plus, Users } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { useState } from "react";
+import { Team } from "../api/admin/endpoints/teams";
+import { CreateEditTeamDialog } from "../app/settings/teams/components/CreateEditTeamDialog";
+import { cn } from "../lib/utils";
+import { Button } from "./ui/button";
+import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover";
+
+interface TeamSelectorProps {
+ teams: Team[];
+ value: string;
+ onValueChange: (value: string) => void;
+ canCreateTeam?: boolean;
+}
+
+export function TeamSelector({ teams, value, onValueChange, canCreateTeam = false }: TeamSelectorProps) {
+ const t = useExtracted();
+ const [open, setOpen] = useState(false);
+
+ const selectedTeam = teams.find((t) => t.id === value);
+ const displayLabel =
+ value === "all"
+ ? t("All Teams")
+ : value === "unassigned"
+ ? t("No Team")
+ : selectedTeam?.name || t("All Teams");
+
+ return (
+ <Popover open={open} onOpenChange={setOpen}>
+ <PopoverTrigger asChild>
+ <button className="flex gap-2 items-center border border-neutral-200 dark:border-neutral-800 rounded-lg py-1.5 px-3 justify-start cursor-pointer hover:bg-neutral-150 dark:hover:bg-neutral-800/50 transition-colors h-[36px] w-[200px]">
+ <Users className="w-4 h-4 text-neutral-600 dark:text-neutral-400 shrink-0" />
+ <div className="text-neutral-900 dark:text-white truncate text-sm flex-1 text-left">
+ {displayLabel}
+ </div>
+ <ChevronDown className="w-4 h-4 text-neutral-600 dark:text-neutral-400 shrink-0" />
+ </button>
+ </PopoverTrigger>
+ <PopoverContent align="start" className="w-72 p-2">
+ <div className="max-h-96 overflow-y-auto">
+ <div
+ onClick={() => {
+ onValueChange("all");
+ setOpen(false);
+ }}
+ className={cn(
+ "flex items-center p-2 cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-800/50 transition-colors rounded-md",
+ value === "all" && "bg-neutral-50 dark:bg-neutral-800"
+ )}
+ >
+ <span className="text-sm text-neutral-900 dark:text-white">
+ {t("All Teams")}
+ </span>
+ </div>
+ <div
+ onClick={() => {
+ onValueChange("unassigned");
+ setOpen(false);
+ }}
+ className={cn(
+ "flex items-center p-2 cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-800/50 transition-colors rounded-md",
+ value === "unassigned" && "bg-neutral-50 dark:bg-neutral-800"
+ )}
+ >
+ <span className="text-sm text-neutral-900 dark:text-white">
+ {t("No Team")}
+ </span>
+ </div>
+ {teams.map((team) => (
+ <div
+ key={team.id}
+ onClick={() => {
+ onValueChange(team.id);
+ setOpen(false);
+ }}
+ className={cn(
+ "flex items-center justify-between p-2 cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-800/50 transition-colors rounded-md border-t border-neutral-100 dark:border-neutral-800",
+ value === team.id && "bg-neutral-50 dark:bg-neutral-800"
+ )}
+ >
+ <span className="text-sm text-neutral-900 dark:text-white truncate">
+ {team.name}
+ </span>
+ <div className="flex items-center gap-3 shrink-0 ml-2">
+ <div className="flex items-center gap-1 text-xs text-neutral-500 dark:text-neutral-400">
+ <Globe className="w-3 h-3" />
+ {team.sites.length}
+ </div>
+ <div className="flex items-center gap-1 text-xs text-neutral-500 dark:text-neutral-400">
+ <Users className="w-3 h-3" />
+ {team.members.length}
+ </div>
+ </div>
+ </div>
+ ))}
+ </div>
+ {canCreateTeam && (
+ <div className="mt-2 border-t border-neutral-100 dark:border-neutral-800 pt-2">
+ <CreateEditTeamDialog
+ trigger={
+ <Button variant="ghost" className="w-full justify-start gap-2">
+ <Plus className="h-4 w-4" />
+ {t("Create Team")}
+ </Button>
+ }
+ onSuccess={() => setOpen(false)}
+ />
+ </div>
+ )}
+ </PopoverContent>
+ </Popover>
+ );
+}
diff --git a/client/src/components/sidebar/NavigationSidebar.tsx b/client/src/components/sidebar/NavigationSidebar.tsx
new file mode 100644
index 000000000..ee3973313
--- /dev/null
+++ b/client/src/components/sidebar/NavigationSidebar.tsx
@@ -0,0 +1,68 @@
+"use client";
+import { Building2, CreditCard, LayoutGrid, UserCircle, Users } from "lucide-react";
+import { useExtracted } from "next-intl";
+import { usePathname } from "next/navigation";
+import { useUserOrganizations } from "../../api/admin/hooks/useOrganizations";
+import { authClient } from "../../lib/auth";
+import { IS_CLOUD } from "../../lib/const";
+import { OrganizationSelector } from "../OrganizationSelector";
+import { Sidebar } from "./Sidebar";
+
+export function NavigationSidebar() {
+ const t = useExtracted();
+ const pathname = usePathname();
+ const { data: activeOrganization } = authClient.useActiveOrganization();
+ const { data: userOrganizations } = useUserOrganizations();
+
+ const currentMember = userOrganizations?.find(
+ (org) => org.id === activeOrganization?.id
+ );
+ const isAdminOrOwner =
+ currentMember?.role === "admin" || currentMember?.role === "owner";
+
+ return (
+ <Sidebar.Root>
+ <div className="p-3 pt-4 border-b border-neutral-300 dark:border-neutral-800">
+ <OrganizationSelector />
+ </div>
+ <Sidebar.Items>
+ <Sidebar.Item
+ label={t("Properties")}
+ active={pathname === "/"}
+ href="/"
+ icon={<LayoutGrid className="w-4 h-4" />}
+ />
+ <Sidebar.Item
+ label={t("Account")}
+ active={pathname.startsWith("/settings/account")}
+ href="/settings/account"
+ icon={<UserCircle className="w-4 h-4" />}
+ />
+ {isAdminOrOwner && (
+ <>
+ <Sidebar.Item
+ label={t("Organization")}
+ active={pathname === "/settings/organization"}
+ href="/settings/organization"
+ icon={<Building2 className="w-4 h-4" />}
+ />
+ <Sidebar.Item
+ label={t("Teams")}
+ active={pathname.startsWith("/settings/teams")}
+ href="/settings/teams"
+ icon={<Users className="w-4 h-4" />}
+ />
+ {IS_CLOUD && (
+ <Sidebar.Item
+ label={t("Subscription")}
+ active={pathname.startsWith("/settings/subscription")}
+ href="/settings/subscription"
+ icon={<CreditCard className="w-4 h-4" />}
+ />
+ )}
+ </>
+ )}
+ </Sidebar.Items>
+ </Sidebar.Root>
+ );
+}
diff --git a/client/src/components/subscription/components/PlanDialog.tsx b/client/src/components/subscription/components/PlanDialog.tsx
index bd1ab7fde..5820097e1 100644
--- a/client/src/components/subscription/components/PlanDialog.tsx
+++ b/client/src/components/subscription/components/PlanDialog.tsx
@@ -97,7 +97,7 @@ export function PlanDialog({ open, onOpenChange, currentPlanName, hasActiveSubsc
});
setShowProrationDialog(true);
} else {
- const returnUrl = `${baseUrl}/settings/organization/subscription?session_id={CHECKOUT_SESSION_ID}`;
+ const returnUrl = `${baseUrl}/settings/subscription?session_id={CHECKOUT_SESSION_ID}`;
const response = await fetch(`${BACKEND_URL}/stripe/create-checkout-session`, {
method: "POST",
diff --git a/client/src/lib/auth.ts b/client/src/lib/auth.ts
index 7527835de..d14a1ec0f 100644
--- a/client/src/lib/auth.ts
+++ b/client/src/lib/auth.ts
@@ -4,7 +4,11 @@ import { createAuthClient } from "better-auth/react";
export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BACKEND_URL,
- plugins: [adminClient(), organizationClient(), emailOTPClient(), apiKeyClient()],
+ plugins: [adminClient(), organizationClient({
+ teams: {
+ enabled: true,
+ },
+ }), emailOTPClient(), apiKeyClient()],
fetchOptions: {
credentials: "include",
},
diff --git a/server/drizzle/0000_premium_jubilee.sql b/server/drizzle/0000_premium_jubilee.sql
index 60389248b..faa198e4e 100644
--- a/server/drizzle/0000_premium_jubilee.sql
+++ b/server/drizzle/0000_premium_jubilee.sql
@@ -353,6 +353,62 @@ CREATE TABLE IF NOT EXISTS "verification" (
"updatedAt" timestamp
);
--> statement-breakpoint
+-- Idempotent column additions for existing installations upgrading from older versions.
+-- CREATE TABLE IF NOT EXISTS skips entirely when the table exists, so these ensure
+-- columns added after initial table creation are present.
+-- These are no-ops on fresh installs.
+
+-- organization
+ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "stripeCustomerId" text;--> statement-breakpoint
+ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "monthlyEventCount" integer DEFAULT 0;--> statement-breakpoint
+ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "overMonthlyLimit" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "planOverride" text;--> statement-breakpoint
+ALTER TABLE "organization" ADD COLUMN IF NOT EXISTS "custom_plan" jsonb;--> statement-breakpoint
+
+-- user
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "displayUsername" text;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "banned" boolean;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "banReason" text;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "banExpires" timestamp;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "stripeCustomerId" text;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "overMonthlyLimit" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "monthlyEventCount" integer DEFAULT 0;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "sendAutoEmailReports" boolean DEFAULT true;--> statement-breakpoint
+ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "scheduled_tip_email_ids" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
+
+-- sites
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "updated_at" timestamp DEFAULT now();--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "id" text;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "organization_id" text;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "public" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "saltUserIds" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "blockBots" boolean DEFAULT true NOT NULL;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "excluded_ips" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "excluded_countries" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "sessionReplay" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "webVitals" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackErrors" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackOutbound" boolean DEFAULT true;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackUrlParams" boolean DEFAULT true;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackInitialPageView" boolean DEFAULT true;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackSpaNavigation" boolean DEFAULT true;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackIp" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackButtonClicks" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackCopy" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "trackFormInteractions" boolean DEFAULT false;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "api_key" text;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "private_link_key" text;--> statement-breakpoint
+ALTER TABLE "sites" ADD COLUMN IF NOT EXISTS "tags" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
+
+-- member
+ALTER TABLE "member" ADD COLUMN IF NOT EXISTS "has_restricted_site_access" boolean DEFAULT false NOT NULL;--> statement-breakpoint
+
+-- invitation
+ALTER TABLE "invitation" ADD COLUMN IF NOT EXISTS "has_restricted_site_access" boolean DEFAULT false NOT NULL;--> statement-breakpoint
+ALTER TABLE "invitation" ADD COLUMN IF NOT EXISTS "site_ids" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
+
+-- verification
+ALTER TABLE "verification" ADD COLUMN IF NOT EXISTS "updatedAt" timestamp;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "account" ADD CONSTRAINT "account_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
diff --git a/server/drizzle/0002_short_bishop.sql b/server/drizzle/0002_short_bishop.sql
new file mode 100644
index 000000000..1ed30ed81
--- /dev/null
+++ b/server/drizzle/0002_short_bishop.sql
@@ -0,0 +1,73 @@
+CREATE TABLE IF NOT EXISTS "team" (
+ "id" text PRIMARY KEY NOT NULL,
+ "name" text NOT NULL,
+ "organizationId" text NOT NULL,
+ "createdAt" timestamp NOT NULL,
+ "updatedAt" timestamp
+);
+--> statement-breakpoint
+CREATE TABLE IF NOT EXISTS "teamMember" (
+ "id" text PRIMARY KEY NOT NULL,
+ "teamId" text NOT NULL,
+ "userId" text NOT NULL,
+ "createdAt" timestamp
+);
+--> statement-breakpoint
+CREATE TABLE IF NOT EXISTS "team_site_access" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "team_id" text NOT NULL,
+ "site_id" integer NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ CONSTRAINT "team_site_access_unique" UNIQUE("team_id","site_id")
+);
+--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.columns
+ WHERE table_name = 'invitation' AND column_name = 'team_ids'
+ ) THEN
+ ALTER TABLE "invitation" ADD COLUMN "team_ids" jsonb DEFAULT '[]'::jsonb;
+ END IF;
+END $$;--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.table_constraints
+ WHERE constraint_name = 'team_organizationId_organization_id_fk'
+ ) THEN
+ ALTER TABLE "team" ADD CONSTRAINT "team_organizationId_organization_id_fk" FOREIGN KEY ("organizationId") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;
+ END IF;
+END $$;--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.table_constraints
+ WHERE constraint_name = 'teamMember_teamId_team_id_fk'
+ ) THEN
+ ALTER TABLE "teamMember" ADD CONSTRAINT "teamMember_teamId_team_id_fk" FOREIGN KEY ("teamId") REFERENCES "public"."team"("id") ON DELETE cascade ON UPDATE no action;
+ END IF;
+END $$;--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.table_constraints
+ WHERE constraint_name = 'teamMember_userId_user_id_fk'
+ ) THEN
+ ALTER TABLE "teamMember" ADD CONSTRAINT "teamMember_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
+ END IF;
+END $$;--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.table_constraints
+ WHERE constraint_name = 'team_site_access_team_id_team_id_fk'
+ ) THEN
+ ALTER TABLE "team_site_access" ADD CONSTRAINT "team_site_access_team_id_team_id_fk" FOREIGN KEY ("team_id") REFERENCES "public"."team"("id") ON DELETE cascade ON UPDATE no action;
+ END IF;
+END $$;--> statement-breakpoint
+DO $$ BEGIN
+ IF NOT EXISTS (
+ SELECT 1 FROM information_schema.table_constraints
+ WHERE constraint_name = 'team_site_access_site_id_sites_site_id_fk'
+ ) THEN
+ ALTER TABLE "team_site_access" ADD CONSTRAINT "team_site_access_site_id_sites_site_id_fk" FOREIGN KEY ("site_id") REFERENCES "public"."sites"("site_id") ON DELETE cascade ON UPDATE no action;
+ END IF;
+END $$;--> statement-breakpoint
+CREATE INDEX IF NOT EXISTS "team_site_access_team_idx" ON "team_site_access" USING btree ("team_id");--> statement-breakpoint
+CREATE INDEX IF NOT EXISTS "team_site_access_site_idx" ON "team_site_access" USING btree ("site_id");
diff --git a/server/drizzle/meta/0002_snapshot.json b/server/drizzle/meta/0002_snapshot.json
new file mode 100644
index 000000000..aed0eb033
--- /dev/null
+++ b/server/drizzle/meta/0002_snapshot.json
@@ -0,0 +1,2857 @@
+{
+ "id": "372ba8dc-511d-480e-b745-28cdc242cea8",
+ "prevId": "baa8de49-1e74-469d-8311-ec3ec304fd1c",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.account": {
+ "name": "account",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "accountId": {
+ "name": "accountId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "providerId": {
+ "name": "providerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "accessToken": {
+ "name": "accessToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refreshToken": {
+ "name": "refreshToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "idToken": {
+ "name": "idToken",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accessTokenExpiresAt": {
+ "name": "accessTokenExpiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refreshTokenExpiresAt": {
+ "name": "refreshTokenExpiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scope": {
+ "name": "scope",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password": {
+ "name": "password",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "account_userId_user_id_fk": {
+ "name": "account_userId_user_id_fk",
+ "tableFrom": "account",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.active_sessions": {
+ "name": "active_sessions",
+ "schema": "",
+ "columns": {
+ "session_id": {
+ "name": "session_id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "last_activity": {
+ "name": "last_activity",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.agent_regions": {
+ "name": "agent_regions",
+ "schema": "",
+ "columns": {
+ "code": {
+ "name": "code",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endpoint_url": {
+ "name": "endpoint_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "last_health_check": {
+ "name": "last_health_check",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_healthy": {
+ "name": "is_healthy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.apikey": {
+ "name": "apikey",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start": {
+ "name": "start",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "prefix": {
+ "name": "prefix",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "key": {
+ "name": "key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "referenceId": {
+ "name": "referenceId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refillInterval": {
+ "name": "refillInterval",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "refillAmount": {
+ "name": "refillAmount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lastRefillAt": {
+ "name": "lastRefillAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "rateLimitEnabled": {
+ "name": "rateLimitEnabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "rateLimitTimeWindow": {
+ "name": "rateLimitTimeWindow",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rateLimitMax": {
+ "name": "rateLimitMax",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requestCount": {
+ "name": "requestCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "remaining": {
+ "name": "remaining",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lastRequest": {
+ "name": "lastRequest",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "configId": {
+ "name": "configId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "permissions": {
+ "name": "permissions",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "apikey_referenceId_user_id_fk": {
+ "name": "apikey_referenceId_user_id_fk",
+ "tableFrom": "apikey",
+ "tableTo": "user",
+ "columnsFrom": [
+ "referenceId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.cancellation_feedback": {
+ "name": "cancellation_feedback",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reason": {
+ "name": "reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reason_details": {
+ "name": "reason_details",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retention_offer_shown": {
+ "name": "retention_offer_shown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retention_offer_accepted": {
+ "name": "retention_offer_accepted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "outcome": {
+ "name": "outcome",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "plan_name_at_cancellation": {
+ "name": "plan_name_at_cancellation",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monthly_event_count_at_cancellation": {
+ "name": "monthly_event_count_at_cancellation",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.funnels": {
+ "name": "funnels",
+ "schema": "",
+ "columns": {
+ "report_id": {
+ "name": "report_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "data": {
+ "name": "data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "funnels_site_id_sites_site_id_fk": {
+ "name": "funnels_site_id_sites_site_id_fk",
+ "tableFrom": "funnels",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "funnels_user_id_user_id_fk": {
+ "name": "funnels_user_id_user_id_fk",
+ "tableFrom": "funnels",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.goals": {
+ "name": "goals",
+ "schema": "",
+ "columns": {
+ "goal_id": {
+ "name": "goal_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "goal_type": {
+ "name": "goal_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "goals_site_id_sites_site_id_fk": {
+ "name": "goals_site_id_sites_site_id_fk",
+ "tableFrom": "goals",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.gsc_connections": {
+ "name": "gsc_connections",
+ "schema": "",
+ "columns": {
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "access_token": {
+ "name": "access_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "refresh_token": {
+ "name": "refresh_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "gsc_property_url": {
+ "name": "gsc_property_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "gsc_connections_site_id_sites_site_id_fk": {
+ "name": "gsc_connections_site_id_sites_site_id_fk",
+ "tableFrom": "gsc_connections",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.import_status": {
+ "name": "import_status",
+ "schema": "",
+ "columns": {
+ "import_id": {
+ "name": "import_id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "platform": {
+ "name": "platform",
+ "type": "import_platform_enum",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "imported_events": {
+ "name": "imported_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "skipped_events": {
+ "name": "skipped_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "invalid_events": {
+ "name": "invalid_events",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "import_status_site_id_sites_site_id_fk": {
+ "name": "import_status_site_id_sites_site_id_fk",
+ "tableFrom": "import_status",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "import_status_organization_id_organization_id_fk": {
+ "name": "import_status_organization_id_organization_id_fk",
+ "tableFrom": "import_status",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.invitation": {
+ "name": "invitation",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "inviterId": {
+ "name": "inviterId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "organizationId": {
+ "name": "organizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_restricted_site_access": {
+ "name": "has_restricted_site_access",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "site_ids": {
+ "name": "site_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "team_ids": {
+ "name": "team_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "invitation_inviterId_user_id_fk": {
+ "name": "invitation_inviterId_user_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "user",
+ "columnsFrom": [
+ "inviterId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "invitation_organizationId_organization_id_fk": {
+ "name": "invitation_organizationId_organization_id_fk",
+ "tableFrom": "invitation",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organizationId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.member": {
+ "name": "member",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organizationId": {
+ "name": "organizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_restricted_site_access": {
+ "name": "has_restricted_site_access",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "member_organizationId_organization_id_fk": {
+ "name": "member_organizationId_organization_id_fk",
+ "tableFrom": "member",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organizationId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "member_userId_user_id_fk": {
+ "name": "member_userId_user_id_fk",
+ "tableFrom": "member",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.member_site_access": {
+ "name": "member_site_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "member_id": {
+ "name": "member_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "member_site_access_member_idx": {
+ "name": "member_site_access_member_idx",
+ "columns": [
+ {
+ "expression": "member_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "member_site_access_site_idx": {
+ "name": "member_site_access_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "member_site_access_member_id_member_id_fk": {
+ "name": "member_site_access_member_id_member_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "member",
+ "columnsFrom": [
+ "member_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "member_site_access_site_id_sites_site_id_fk": {
+ "name": "member_site_access_site_id_sites_site_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "member_site_access_created_by_user_id_fk": {
+ "name": "member_site_access_created_by_user_id_fk",
+ "tableFrom": "member_site_access",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "member_site_access_unique": {
+ "name": "member_site_access_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "member_id",
+ "site_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notification_channels": {
+ "name": "notification_channels",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "config": {
+ "name": "config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_ids": {
+ "name": "monitor_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "trigger_events": {
+ "name": "trigger_events",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[\"down\",\"recovery\"]'::jsonb"
+ },
+ "cooldown_minutes": {
+ "name": "cooldown_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 5
+ },
+ "last_notified_at": {
+ "name": "last_notified_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notification_channels_organization_id_organization_id_fk": {
+ "name": "notification_channels_organization_id_organization_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "notification_channels_created_by_user_id_fk": {
+ "name": "notification_channels_created_by_user_id_fk",
+ "tableFrom": "notification_channels",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.organization": {
+ "name": "organization",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "slug": {
+ "name": "slug",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "logo": {
+ "name": "logo",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stripeCustomerId": {
+ "name": "stripeCustomerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monthlyEventCount": {
+ "name": "monthlyEventCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "overMonthlyLimit": {
+ "name": "overMonthlyLimit",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "planOverride": {
+ "name": "planOverride",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "custom_plan": {
+ "name": "custom_plan",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "organization_slug_unique": {
+ "name": "organization_slug_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "slug"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.session": {
+ "name": "session",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ipAddress": {
+ "name": "ipAddress",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "userAgent": {
+ "name": "userAgent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "userId": {
+ "name": "userId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "impersonatedBy": {
+ "name": "impersonatedBy",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "activeOrganizationId": {
+ "name": "activeOrganizationId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "session_userId_user_id_fk": {
+ "name": "session_userId_user_id_fk",
+ "tableFrom": "session",
+ "tableTo": "user",
+ "columnsFrom": [
+ "userId"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "session_token_unique": {
+ "name": "session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "token"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sites": {
+ "name": "sites",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain": {
+ "name": "domain",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "public": {
+ "name": "public",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "saltUserIds": {
+ "name": "saltUserIds",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "blockBots": {
+ "name": "blockBots",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "excluded_ips": {
+ "name": "excluded_ips",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "excluded_countries": {
+ "name": "excluded_countries",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ },
+ "sessionReplay": {
+ "name": "sessionReplay",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "webVitals": {
+ "name": "webVitals",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackErrors": {
+ "name": "trackErrors",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackOutbound": {
+ "name": "trackOutbound",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackUrlParams": {
+ "name": "trackUrlParams",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackInitialPageView": {
+ "name": "trackInitialPageView",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackSpaNavigation": {
+ "name": "trackSpaNavigation",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "trackIp": {
+ "name": "trackIp",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackButtonClicks": {
+ "name": "trackButtonClicks",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackCopy": {
+ "name": "trackCopy",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "trackFormInteractions": {
+ "name": "trackFormInteractions",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "api_key": {
+ "name": "api_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "private_link_key": {
+ "name": "private_link_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tags": {
+ "name": "tags",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "sites_created_by_user_id_fk": {
+ "name": "sites_created_by_user_id_fk",
+ "tableFrom": "sites",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "sites_organization_id_organization_id_fk": {
+ "name": "sites_organization_id_organization_id_fk",
+ "tableFrom": "sites",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team": {
+ "name": "team",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "team_organization_id_organization_id_fk": {
+ "name": "team_organization_id_organization_id_fk",
+ "tableFrom": "team",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.teamMember": {
+ "name": "teamMember",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "teamMember_team_id_team_id_fk": {
+ "name": "teamMember_team_id_team_id_fk",
+ "tableFrom": "teamMember",
+ "tableTo": "team",
+ "columnsFrom": [
+ "team_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "teamMember_user_id_user_id_fk": {
+ "name": "teamMember_user_id_user_id_fk",
+ "tableFrom": "teamMember",
+ "tableTo": "user",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.team_site_access": {
+ "name": "team_site_access",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "team_id": {
+ "name": "team_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "team_site_access_team_idx": {
+ "name": "team_site_access_team_idx",
+ "columns": [
+ {
+ "expression": "team_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "team_site_access_site_idx": {
+ "name": "team_site_access_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "team_site_access_team_id_team_id_fk": {
+ "name": "team_site_access_team_id_team_id_fk",
+ "tableFrom": "team_site_access",
+ "tableTo": "team",
+ "columnsFrom": [
+ "team_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "team_site_access_site_id_sites_site_id_fk": {
+ "name": "team_site_access_site_id_sites_site_id_fk",
+ "tableFrom": "team_site_access",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "team_site_access_unique": {
+ "name": "team_site_access_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "team_id",
+ "site_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.telemetry": {
+ "name": "telemetry",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "instance_id": {
+ "name": "instance_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "timestamp": {
+ "name": "timestamp",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "version": {
+ "name": "version",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "table_counts": {
+ "name": "table_counts",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "clickhouse_size_gb": {
+ "name": "clickhouse_size_gb",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_alert_history": {
+ "name": "uptime_alert_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "alert_id": {
+ "name": "alert_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "triggered_at": {
+ "name": "triggered_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "alert_data": {
+ "name": "alert_data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_alert_history_alert_id_uptime_alerts_id_fk": {
+ "name": "uptime_alert_history_alert_id_uptime_alerts_id_fk",
+ "tableFrom": "uptime_alert_history",
+ "tableTo": "uptime_alerts",
+ "columnsFrom": [
+ "alert_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_alert_history_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_alert_history_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_alert_history",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_alerts": {
+ "name": "uptime_alerts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_type": {
+ "name": "alert_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "alert_config": {
+ "name": "alert_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "conditions": {
+ "name": "conditions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_alerts_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_alerts_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_alerts",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_incidents": {
+ "name": "uptime_incidents",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "region": {
+ "name": "region",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "start_time": {
+ "name": "start_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "end_time": {
+ "name": "end_time",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'active'"
+ },
+ "acknowledged_by": {
+ "name": "acknowledged_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "acknowledged_at": {
+ "name": "acknowledged_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_by": {
+ "name": "resolved_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "resolved_at": {
+ "name": "resolved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error": {
+ "name": "last_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_error_type": {
+ "name": "last_error_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_count": {
+ "name": "failure_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_incidents_organization_id_organization_id_fk": {
+ "name": "uptime_incidents_organization_id_organization_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_incidents_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_acknowledged_by_user_id_fk": {
+ "name": "uptime_incidents_acknowledged_by_user_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "user",
+ "columnsFrom": [
+ "acknowledged_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "uptime_incidents_resolved_by_user_id_fk": {
+ "name": "uptime_incidents_resolved_by_user_id_fk",
+ "tableFrom": "uptime_incidents",
+ "tableTo": "user",
+ "columnsFrom": [
+ "resolved_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.uptime_monitor_status": {
+ "name": "uptime_monitor_status",
+ "schema": "",
+ "columns": {
+ "monitor_id": {
+ "name": "monitor_id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "last_checked_at": {
+ "name": "last_checked_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_check_at": {
+ "name": "next_check_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_status": {
+ "name": "current_status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'unknown'"
+ },
+ "consecutive_failures": {
+ "name": "consecutive_failures",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "consecutive_successes": {
+ "name": "consecutive_successes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "uptime_percentage_24h": {
+ "name": "uptime_percentage_24h",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_percentage_7d": {
+ "name": "uptime_percentage_7d",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uptime_percentage_30d": {
+ "name": "uptime_percentage_30d",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "average_response_time_24h": {
+ "name": "average_response_time_24h",
+ "type": "real",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "uptime_monitor_status_updated_at_idx": {
+ "name": "uptime_monitor_status_updated_at_idx",
+ "columns": [
+ {
+ "expression": "updated_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "uptime_monitor_status_monitor_id_uptime_monitors_id_fk": {
+ "name": "uptime_monitor_status_monitor_id_uptime_monitors_id_fk",
+ "tableFrom": "uptime_monitor_status",
+ "tableTo": "uptime_monitors",
+ "columnsFrom": [
+ "monitor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "uptime_monitor_status_current_status_check": {
+ "name": "uptime_monitor_status_current_status_check",
+ "value": "current_status IN ('up', 'down', 'unknown')"
+ },
+ "uptime_monitor_status_uptime_24h_check": {
+ "name": "uptime_monitor_status_uptime_24h_check",
+ "value": "uptime_percentage_24h >= 0 AND uptime_percentage_24h <= 100"
+ },
+ "uptime_monitor_status_uptime_7d_check": {
+ "name": "uptime_monitor_status_uptime_7d_check",
+ "value": "uptime_percentage_7d >= 0 AND uptime_percentage_7d <= 100"
+ },
+ "uptime_monitor_status_uptime_30d_check": {
+ "name": "uptime_monitor_status_uptime_30d_check",
+ "value": "uptime_percentage_30d >= 0 AND uptime_percentage_30d <= 100"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.uptime_monitors": {
+ "name": "uptime_monitors",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "organization_id": {
+ "name": "organization_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "monitor_type": {
+ "name": "monitor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interval_seconds": {
+ "name": "interval_seconds",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "enabled": {
+ "name": "enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "http_config": {
+ "name": "http_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tcp_config": {
+ "name": "tcp_config",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "validation_rules": {
+ "name": "validation_rules",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'[]'::jsonb"
+ },
+ "monitoring_type": {
+ "name": "monitoring_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'local'"
+ },
+ "selected_regions": {
+ "name": "selected_regions",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[\"local\"]'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "uptime_monitors_organization_id_organization_id_fk": {
+ "name": "uptime_monitors_organization_id_organization_id_fk",
+ "tableFrom": "uptime_monitors",
+ "tableTo": "organization",
+ "columnsFrom": [
+ "organization_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "uptime_monitors_created_by_user_id_fk": {
+ "name": "uptime_monitors_created_by_user_id_fk",
+ "tableFrom": "uptime_monitors",
+ "tableTo": "user",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user": {
+ "name": "user",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "username": {
+ "name": "username",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "emailVerified": {
+ "name": "emailVerified",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "image": {
+ "name": "image",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role": {
+ "name": "role",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'user'"
+ },
+ "displayUsername": {
+ "name": "displayUsername",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banned": {
+ "name": "banned",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banReason": {
+ "name": "banReason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "banExpires": {
+ "name": "banExpires",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stripeCustomerId": {
+ "name": "stripeCustomerId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "overMonthlyLimit": {
+ "name": "overMonthlyLimit",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "monthlyEventCount": {
+ "name": "monthlyEventCount",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sendAutoEmailReports": {
+ "name": "sendAutoEmailReports",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "scheduled_tip_email_ids": {
+ "name": "scheduled_tip_email_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_username_unique": {
+ "name": "user_username_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "username"
+ ]
+ },
+ "user_email_unique": {
+ "name": "user_email_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_aliases": {
+ "name": "user_aliases",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "anonymous_id": {
+ "name": "anonymous_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_aliases_user_idx": {
+ "name": "user_aliases_user_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "user_aliases_anon_idx": {
+ "name": "user_aliases_anon_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "anonymous_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_aliases_site_id_sites_site_id_fk": {
+ "name": "user_aliases_site_id_sites_site_id_fk",
+ "tableFrom": "user_aliases",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "user_aliases_site_anon_unique": {
+ "name": "user_aliases_site_anon_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "site_id",
+ "anonymous_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_profiles": {
+ "name": "user_profiles",
+ "schema": "",
+ "columns": {
+ "site_id": {
+ "name": "site_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "traits": {
+ "name": "traits",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::jsonb"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "user_profiles_site_idx": {
+ "name": "user_profiles_site_idx",
+ "columns": [
+ {
+ "expression": "site_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "user_profiles_site_id_sites_site_id_fk": {
+ "name": "user_profiles_site_id_sites_site_id_fk",
+ "tableFrom": "user_profiles",
+ "tableTo": "sites",
+ "columnsFrom": [
+ "site_id"
+ ],
+ "columnsTo": [
+ "site_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "user_profiles_site_id_user_id_pk": {
+ "name": "user_profiles_site_id_user_id_pk",
+ "columns": [
+ "site_id",
+ "user_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.verification": {
+ "name": "verification",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "identifier": {
+ "name": "identifier",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "value": {
+ "name": "value",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expiresAt": {
+ "name": "expiresAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updatedAt": {
+ "name": "updatedAt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.import_platform_enum": {
+ "name": "import_platform_enum",
+ "schema": "public",
+ "values": [
+ "umami",
+ "simple_analytics"
+ ]
+ }
+ },
+ "schemas": {},
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {},
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+}
\ No newline at end of file
diff --git a/server/drizzle/meta/_journal.json b/server/drizzle/meta/_journal.json
index 791d8079b..32385ff9b 100644
--- a/server/drizzle/meta/_journal.json
+++ b/server/drizzle/meta/_journal.json
@@ -15,6 +15,13 @@
"when": 1774062736532,
"tag": "0001_workable_cable",
"breakpoints": true
+ },
+ {
+ "idx": 2,
+ "version": "7",
+ "when": 1774244342221,
+ "tag": "0002_short_bishop",
+ "breakpoints": true
}
]
}
\ No newline at end of file
diff --git a/server/src/api/memberAccess/updateInvitationSiteAccess.ts b/server/src/api/memberAccess/updateInvitationSiteAccess.ts
index 88cffa6d7..40df5b218 100644
--- a/server/src/api/memberAccess/updateInvitationSiteAccess.ts
+++ b/server/src/api/memberAccess/updateInvitationSiteAccess.ts
@@ -1,8 +1,8 @@
-import { and, eq } from "drizzle-orm";
+import { and, eq, inArray } from "drizzle-orm";
import { FastifyReply, FastifyRequest } from "fastify";
import { db } from "../../db/postgres/postgres.js";
-import { invitation, sites } from "../../db/postgres/schema.js";
+import { invitation, sites, team } from "../../db/postgres/schema.js";
interface UpdateInvitationSiteAccessParams {
organizationId: string;
@@ -12,6 +12,7 @@ interface UpdateInvitationSiteAccessParams {
interface UpdateInvitationSiteAccessBody {
hasRestrictedSiteAccess: boolean;
siteIds: number[];
+ teamIds?: string[];
}
export async function updateInvitationSiteAccess(
@@ -22,7 +23,7 @@ export async function updateInvitationSiteAccess(
reply: FastifyReply
) {
const { organizationId, invitationId } = request.params;
- const { hasRestrictedSiteAccess, siteIds } = request.body;
+ const { hasRestrictedSiteAccess, siteIds, teamIds } = request.body;
try {
// Verify the invitation exists and belongs to this organization
@@ -53,12 +54,30 @@ export async function updateInvitationSiteAccess(
}
}
- // Update the invitation with site access info
+ // Validate that all teamIds belong to this organization
+ if (teamIds && teamIds.length > 0) {
+ const validTeams = await db
+ .select({ id: team.id })
+ .from(team)
+ .where(and(eq(team.organizationId, organizationId), inArray(team.id, teamIds)));
+
+ const validTeamIds = new Set(validTeams.map(t => t.id));
+ const invalidTeamIds = teamIds.filter(id => !validTeamIds.has(id));
+
+ if (invalidTeamIds.length > 0) {
+ return reply.status(400).send({
+ error: `Invalid team IDs: ${invalidTeamIds.join(", ")}. Teams must belong to this organization.`,
+ });
+ }
+ }
+
+ // Update the invitation with site access and team info
await db
.update(invitation)
.set({
hasRestrictedSiteAccess,
siteIds: siteIds || [],
+ teamIds: teamIds || [],
})
.where(eq(invitation.id, invitationId));
@@ -67,6 +86,7 @@ export async function updateInvitationSiteAccess(
invitationId,
hasRestrictedSiteAccess,
siteIds,
+ teamIds,
});
} catch (error) {
console.error("Error updating invitation site access:", error);
diff --git a/server/src/api/sites/getSitesFromOrg.ts b/server/src/api/sites/getSitesFromOrg.ts
index 71e03367b..932088538 100644
--- a/server/src/api/sites/getSitesFromOrg.ts
+++ b/server/src/api/sites/getSitesFromOrg.ts
@@ -1,8 +1,8 @@
-import { eq, and } from "drizzle-orm";
+import { eq, and, inArray } from "drizzle-orm";
import { FastifyRequest, FastifyReply } from "fastify";
import { clickhouse } from "../../db/clickhouse/clickhouse.js";
import { db } from "../../db/postgres/postgres.js";
-import { sites, member, organization, memberSiteAccess } from "../../db/postgres/schema.js";
+import { sites, member, organization, memberSiteAccess, team, teamMember, teamSiteAccess } from "../../db/postgres/schema.js";
import { IS_CLOUD, DEFAULT_EVENT_LIMIT } from "../../lib/const.js";
import { getUserIdFromRequest } from "../../lib/auth-utils.js";
import { processResults } from "../analytics/utils/utils.js";
@@ -50,6 +50,46 @@ export async function getSitesFromOrg(
sitesData = allSitesData.filter(site => accessibleSiteIds.has(site.siteId));
}
+ // Team-based filtering for regular members
+ if (memberRecord?.role === "member" && userId) {
+ // Find all team-gated site IDs in this org
+ const allTeamSites = await db
+ .select({ siteId: teamSiteAccess.siteId })
+ .from(teamSiteAccess)
+ .innerJoin(team, eq(teamSiteAccess.teamId, team.id))
+ .where(eq(team.organizationId, organizationId));
+
+ const teamGatedSiteIds = new Set(allTeamSites.map(s => s.siteId));
+
+ if (teamGatedSiteIds.size > 0) {
+ // Find teams the user belongs to in this org
+ const userTeams = await db
+ .select({ teamId: teamMember.teamId })
+ .from(teamMember)
+ .innerJoin(team, eq(teamMember.teamId, team.id))
+ .where(and(eq(teamMember.userId, userId), eq(team.organizationId, organizationId)));
+
+ const userTeamIds = userTeams.map(t => t.teamId);
+
+ // Get sites accessible through user's teams
+ const userTeamSiteIds = new Set<number>();
+ if (userTeamIds.length > 0) {
+ const userTeamSites = await db
+ .select({ siteId: teamSiteAccess.siteId })
+ .from(teamSiteAccess)
+ .where(inArray(teamSiteAccess.teamId, userTeamIds));
+ for (const s of userTeamSites) {
+ userTeamSiteIds.add(s.siteId);
+ }
+ }
+
+ // Keep sites that are NOT team-gated OR are in the user's teams
+ sitesData = sitesData.filter(
+ site => !teamGatedSiteIds.has(site.siteId) || userTeamSiteIds.has(site.siteId)
+ );
+ }
+ }
+
// Query session counts for the sites
const sessionCountMap = new Map<number, number>();
@@ -93,11 +133,30 @@ export async function getSitesFromOrg(
eventLimit = subscription?.eventLimit || DEFAULT_EVENT_LIMIT;
}
+ // Get team info for all sites in this org
+ const teamSiteMappings = await db
+ .select({
+ siteId: teamSiteAccess.siteId,
+ teamId: team.id,
+ teamName: team.name,
+ })
+ .from(teamSiteAccess)
+ .innerJoin(team, eq(teamSiteAccess.teamId, team.id))
+ .where(eq(team.organizationId, organizationId));
+
+ const siteTeamMap = new Map<number, { id: string; name: string }[]>();
+ for (const mapping of teamSiteMappings) {
+ const existing = siteTeamMap.get(mapping.siteId) || [];
+ existing.push({ id: mapping.teamId, name: mapping.teamName });
+ siteTeamMap.set(mapping.siteId, existing);
+ }
+
// Enhance sites data with session counts and subscription info
const enhancedSitesData = sitesData.map(site => ({
...site,
sessionsLast24Hours: sessionCountMap.get(site.siteId) || 0,
isOwner: memberRecord?.role !== "member",
+ teams: siteTeamMap.get(site.siteId) || [],
}));
// Sort by sessions descending
diff --git a/server/src/api/teams/createTeam.ts b/server/src/api/teams/createTeam.ts
new file mode 100644
index 000000000..340aa90dd
--- /dev/null
+++ b/server/src/api/teams/createTeam.ts
@@ -0,0 +1,130 @@
+import { eq, and, inArray } from "drizzle-orm";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { db } from "../../db/postgres/postgres.js";
+import {
+ team,
+ teamMember,
+ teamSiteAccess,
+ member,
+ sites,
+} from "../../db/postgres/schema.js";
+import { invalidateSitesAccessCache } from "../../lib/auth-utils.js";
+
+interface CreateTeamBody {
+ name: string;
+ memberUserIds?: string[];
+ siteIds?: number[];
+}
+
+export async function createTeam(
+ request: FastifyRequest<{
+ Params: { organizationId: string };
+ Body: CreateTeamBody;
+ }>,
+ reply: FastifyReply
+) {
+ const { organizationId } = request.params;
+ const { name, memberUserIds, siteIds } = request.body;
+
+ if (!name || !name.trim()) {
+ return reply.status(400).send({ error: "Team name is required" });
+ }
+
+ try {
+ // Validate memberUserIds are org members
+ if (memberUserIds && memberUserIds.length > 0) {
+ const orgMembers = await db
+ .select({ userId: member.userId })
+ .from(member)
+ .where(
+ and(
+ eq(member.organizationId, organizationId),
+ inArray(member.userId, memberUserIds)
+ )
+ );
+ const validUserIds = new Set(orgMembers.map((m) => m.userId));
+ const invalidUserIds = memberUserIds.filter((id) => !validUserIds.has(id));
+ if (invalidUserIds.length > 0) {
+ return reply.status(400).send({
+ error: `Users not in organization: ${invalidUserIds.join(", ")}`,
+ });
+ }
+ }
+
+ // Validate siteIds belong to org
+ if (siteIds && siteIds.length > 0) {
+ const orgSites = await db
+ .select({ siteId: sites.siteId })
+ .from(sites)
+ .where(
+ and(
+ eq(sites.organizationId, organizationId),
+ inArray(sites.siteId, siteIds)
+ )
+ );
+ const validSiteIds = new Set(orgSites.map((s) => s.siteId));
+ const invalidSiteIds = siteIds.filter((id) => !validSiteIds.has(id));
+ if (invalidSiteIds.length > 0) {
+ return reply.status(400).send({
+ error: `Sites not in organization: ${invalidSiteIds.join(", ")}`,
+ });
+ }
+ }
+
+ const teamId = crypto.randomUUID();
+ const now = new Date().toISOString();
+
+ await db.transaction(async (tx) => {
+ // Insert team
+ await tx.insert(team).values({
+ id: teamId,
+ name: name.trim(),
+ organizationId,
+ createdAt: now,
+ updatedAt: now,
+ });
+
+ // Insert team members
+ if (memberUserIds && memberUserIds.length > 0) {
+ await tx.insert(teamMember).values(
+ memberUserIds.map((userId) => ({
+ id: crypto.randomUUID(),
+ teamId,
+ userId,
+ createdAt: now,
+ }))
+ );
+ }
+
+ // Insert team site access
+ if (siteIds && siteIds.length > 0) {
+ await tx.insert(teamSiteAccess).values(
+ siteIds.map((siteId) => ({
+ teamId,
+ siteId,
+ }))
+ );
+ }
+ });
+
+ // Invalidate cache for affected users
+ if (memberUserIds) {
+ for (const userId of memberUserIds) {
+ invalidateSitesAccessCache(userId);
+ }
+ }
+
+ return reply.status(201).send({
+ id: teamId,
+ name: name.trim(),
+ organizationId,
+ createdAt: now,
+ updatedAt: now,
+ members: memberUserIds || [],
+ siteIds: siteIds || [],
+ });
+ } catch (error) {
+ console.error("Error creating team:", error);
+ return reply.status(500).send({ error: "Failed to create team" });
+ }
+}
diff --git a/server/src/api/teams/deleteTeam.ts b/server/src/api/teams/deleteTeam.ts
new file mode 100644
index 000000000..f4c18b7d6
--- /dev/null
+++ b/server/src/api/teams/deleteTeam.ts
@@ -0,0 +1,48 @@
+import { eq, and } from "drizzle-orm";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { db } from "../../db/postgres/postgres.js";
+import { team, teamMember } from "../../db/postgres/schema.js";
+import { invalidateSitesAccessCache } from "../../lib/auth-utils.js";
+
+export async function deleteTeam(
+ request: FastifyRequest<{
+ Params: { organizationId: string; teamId: string };
+ }>,
+ reply: FastifyReply
+) {
+ const { organizationId, teamId } = request.params;
+
+ try {
+ // Verify team belongs to org
+ const teamRecord = await db
+ .select()
+ .from(team)
+ .where(and(eq(team.id, teamId), eq(team.organizationId, organizationId)))
+ .limit(1);
+
+ if (teamRecord.length === 0) {
+ return reply.status(404).send({ error: "Team not found" });
+ }
+
+ // Get affected user IDs before deleting
+ const affectedMembers = await db
+ .select({ userId: teamMember.userId })
+ .from(teamMember)
+ .where(eq(teamMember.teamId, teamId));
+
+ // Delete team (cascades to teamMember and teamSiteAccess)
+ await db
+ .delete(team)
+ .where(and(eq(team.id, teamId), eq(team.organizationId, organizationId)));
+
+ // Invalidate cache for affected users
+ for (const m of affectedMembers) {
+ invalidateSitesAccessCache(m.userId);
+ }
+
+ return reply.status(200).send({ success: true });
+ } catch (error) {
+ console.error("Error deleting team:", error);
+ return reply.status(500).send({ error: "Failed to delete team" });
+ }
+}
diff --git a/server/src/api/teams/index.ts b/server/src/api/teams/index.ts
new file mode 100644
index 000000000..7f84ce4d3
--- /dev/null
+++ b/server/src/api/teams/index.ts
@@ -0,0 +1,4 @@
+export { listTeams } from "./listTeams.js";
+export { createTeam } from "./createTeam.js";
+export { updateTeam } from "./updateTeam.js";
+export { deleteTeam } from "./deleteTeam.js";
diff --git a/server/src/api/teams/listTeams.ts b/server/src/api/teams/listTeams.ts
new file mode 100644
index 000000000..00a0ae1a7
--- /dev/null
+++ b/server/src/api/teams/listTeams.ts
@@ -0,0 +1,129 @@
+import { eq, and, inArray } from "drizzle-orm";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { db } from "../../db/postgres/postgres.js";
+import {
+ team,
+ teamMember,
+ teamSiteAccess,
+ sites,
+ member,
+ user,
+} from "../../db/postgres/schema.js";
+import { getUserIdFromRequest } from "../../lib/auth-utils.js";
+
+export async function listTeams(
+ request: FastifyRequest<{
+ Params: { organizationId: string };
+ }>,
+ reply: FastifyReply
+) {
+ try {
+ const { organizationId } = request.params;
+ const userId = request.user?.id ?? (await getUserIdFromRequest(request));
+
+ // Get user's membership in this org
+ const memberRecord = userId
+ ? await db
+ .select({ id: member.id, role: member.role })
+ .from(member)
+ .where(
+ and(
+ eq(member.organizationId, organizationId),
+ eq(member.userId, userId)
+ )
+ )
+ .limit(1)
+ : [];
+
+ const isAdminOrOwner =
+ memberRecord.length > 0 &&
+ (memberRecord[0].role === "admin" || memberRecord[0].role === "owner");
+
+ // Get all teams in the org
+ let teamsData = await db
+ .select()
+ .from(team)
+ .where(eq(team.organizationId, organizationId));
+
+ // If not admin/owner, filter to only teams the user belongs to
+ if (!isAdminOrOwner && userId) {
+ const userTeamIds = await db
+ .select({ teamId: teamMember.teamId })
+ .from(teamMember)
+ .where(eq(teamMember.userId, userId));
+
+ const userTeamIdSet = new Set(userTeamIds.map((t) => t.teamId));
+ teamsData = teamsData.filter((t) => userTeamIdSet.has(t.id));
+ }
+
+ if (teamsData.length === 0) {
+ return reply.send({ teams: [] });
+ }
+
+ const teamIds = teamsData.map((t) => t.id);
+
+ // Fetch members and sites for all teams in parallel
+ const [membersData, sitesData] = await Promise.all([
+ db
+ .select({
+ teamId: teamMember.teamId,
+ userId: teamMember.userId,
+ userName: user.name,
+ userEmail: user.email,
+ })
+ .from(teamMember)
+ .innerJoin(user, eq(teamMember.userId, user.id))
+ .where(inArray(teamMember.teamId, teamIds)),
+ db
+ .select({
+ teamId: teamSiteAccess.teamId,
+ siteId: sites.siteId,
+ domain: sites.domain,
+ name: sites.name,
+ })
+ .from(teamSiteAccess)
+ .innerJoin(sites, eq(teamSiteAccess.siteId, sites.siteId))
+ .where(inArray(teamSiteAccess.teamId, teamIds)),
+ ]);
+
+ // Build lookup maps
+ const membersMap = new Map<
+ string,
+ { userId: string; userName: string | null; userEmail: string }[]
+ >();
+ for (const m of membersData) {
+ const existing = membersMap.get(m.teamId) || [];
+ existing.push({
+ userId: m.userId,
+ userName: m.userName,
+ userEmail: m.userEmail,
+ });
+ membersMap.set(m.teamId, existing);
+ }
+
+ const sitesMap = new Map<
+ string,
+ { siteId: number; domain: string; name: string }[]
+ >();
+ for (const s of sitesData) {
+ const existing = sitesMap.get(s.teamId) || [];
+ existing.push({ siteId: s.siteId, domain: s.domain, name: s.name });
+ sitesMap.set(s.teamId, existing);
+ }
+
+ return reply.send({
+ teams: teamsData.map((t) => ({
+ id: t.id,
+ name: t.name,
+ organizationId: t.organizationId,
+ createdAt: t.createdAt,
+ updatedAt: t.updatedAt,
+ members: membersMap.get(t.id) || [],
+ sites: sitesMap.get(t.id) || [],
+ })),
+ });
+ } catch (error) {
+ console.error("Error listing teams:", error);
+ return reply.status(500).send({ error: "Failed to list teams" });
+ }
+}
diff --git a/server/src/api/teams/updateTeam.ts b/server/src/api/teams/updateTeam.ts
new file mode 100644
index 000000000..2cb5bd64e
--- /dev/null
+++ b/server/src/api/teams/updateTeam.ts
@@ -0,0 +1,143 @@
+import { eq, and, inArray } from "drizzle-orm";
+import { FastifyReply, FastifyRequest } from "fastify";
+import { db } from "../../db/postgres/postgres.js";
+import {
+ team,
+ teamMember,
+ teamSiteAccess,
+ member,
+ sites,
+} from "../../db/postgres/schema.js";
+import { invalidateSitesAccessCache } from "../../lib/auth-utils.js";
+
+interface UpdateTeamBody {
+ name?: string;
+ memberUserIds?: string[];
+ siteIds?: number[];
+}
+
+export async function updateTeam(
+ request: FastifyRequest<{
+ Params: { organizationId: string; teamId: string };
+ Body: UpdateTeamBody;
+ }>,
+ reply: FastifyReply
+) {
+ const { organizationId, teamId } = request.params;
+ const { name, memberUserIds, siteIds } = request.body;
+
+ try {
+ // Verify team belongs to org
+ const teamRecord = await db
+ .select()
+ .from(team)
+ .where(and(eq(team.id, teamId), eq(team.organizationId, organizationId)))
+ .limit(1);
+
+ if (teamRecord.length === 0) {
+ return reply.status(404).send({ error: "Team not found" });
+ }
+
+ // Get existing members before update (for cache invalidation)
+ const existingMembers = await db
+ .select({ userId: teamMember.userId })
+ .from(teamMember)
+ .where(eq(teamMember.teamId, teamId));
+ const existingUserIds = existingMembers.map((m) => m.userId);
+
+ // Validate memberUserIds are org members
+ if (memberUserIds && memberUserIds.length > 0) {
+ const orgMembers = await db
+ .select({ userId: member.userId })
+ .from(member)
+ .where(
+ and(
+ eq(member.organizationId, organizationId),
+ inArray(member.userId, memberUserIds)
+ )
+ );
+ const validUserIds = new Set(orgMembers.map((m) => m.userId));
+ const invalidUserIds = memberUserIds.filter((id) => !validUserIds.has(id));
+ if (invalidUserIds.length > 0) {
+ return reply.status(400).send({
+ error: `Users not in organization: ${invalidUserIds.join(", ")}`,
+ });
+ }
+ }
+
+ // Validate siteIds belong to org
+ if (siteIds && siteIds.length > 0) {
+ const orgSites = await db
+ .select({ siteId: sites.siteId })
+ .from(sites)
+ .where(
+ and(
+ eq(sites.organizationId, organizationId),
+ inArray(sites.siteId, siteIds)
+ )
+ );
+ const validSiteIds = new Set(orgSites.map((s) => s.siteId));
+ const invalidSiteIds = siteIds.filter((id) => !validSiteIds.has(id));
+ if (invalidSiteIds.length > 0) {
+ return reply.status(400).send({
+ error: `Sites not in organization: ${invalidSiteIds.join(", ")}`,
+ });
+ }
+ }
+
+ const now = new Date().toISOString();
+
+ await db.transaction(async (tx) => {
+ // Update team name
+ const updates: Record<string, string> = { updatedAt: now };
+ if (name !== undefined) {
+ updates.name = name.trim();
+ }
+ await tx.update(team).set(updates).where(eq(team.id, teamId));
+
+ // Replace members if provided
+ if (memberUserIds !== undefined) {
+ await tx.delete(teamMember).where(eq(teamMember.teamId, teamId));
+ if (memberUserIds.length > 0) {
+ await tx.insert(teamMember).values(
+ memberUserIds.map((userId) => ({
+ id: crypto.randomUUID(),
+ teamId,
+ userId,
+ createdAt: now,
+ }))
+ );
+ }
+ }
+
+ // Replace sites if provided
+ if (siteIds !== undefined) {
+ await tx
+ .delete(teamSiteAccess)
+ .where(eq(teamSiteAccess.teamId, teamId));
+ if (siteIds.length > 0) {
+ await tx.insert(teamSiteAccess).values(
+ siteIds.map((siteId) => ({
+ teamId,
+ siteId,
+ }))
+ );
+ }
+ }
+ });
+
+ // Invalidate cache for all affected users (old + new members)
+ const allAffectedUserIds = new Set([
+ ...existingUserIds,
+ ...(memberUserIds || []),
+ ]);
+ for (const userId of allAffectedUserIds) {
+ invalidateSitesAccessCache(userId);
+ }
+
+ return reply.status(200).send({ success: true });
+ } catch (error) {
+ console.error("Error updating team:", error);
+ return reply.status(500).send({ error: "Failed to update team" });
+ }
+}
diff --git a/server/src/db/postgres/schema.ts b/server/src/db/postgres/schema.ts
index 59f3deb4e..bec321b1e 100644
--- a/server/src/db/postgres/schema.ts
+++ b/server/src/db/postgres/schema.ts
@@ -178,6 +178,7 @@ export const invitation = pgTable("invitation", {
// Site access restriction for the invited member
hasRestrictedSiteAccess: boolean("has_restricted_site_access").default(false).notNull(),
siteIds: jsonb("site_ids").default([]).$type<number[]>(), // Array of site IDs to grant access to
+ teamIds: jsonb("team_ids").default([]).$type<string[]>(), // Array of team IDs to add the member to
});
// Member site access junction table - stores which sites a member has access to
@@ -202,6 +203,43 @@ export const memberSiteAccess = pgTable(
]
);
+// Team table (BetterAuth)
+export const team = pgTable("team", {
+ id: text().primaryKey(),
+ name: text().notNull(),
+ organizationId: text().notNull().references(() => organization.id, { onDelete: "cascade" }),
+ createdAt: timestamp({ mode: "string" }).notNull(),
+ updatedAt: timestamp({ mode: "string" }),
+});
+
+// Team member table (BetterAuth)
+export const teamMember = pgTable("teamMember", {
+ id: text().primaryKey(),
+ teamId: text().notNull().references(() => team.id, { onDelete: "cascade" }),
+ userId: text().notNull().references(() => user.id, { onDelete: "cascade" }),
+ createdAt: timestamp({ mode: "string" }),
+});
+
+// Team site access junction table - stores which sites belong to a team
+export const teamSiteAccess = pgTable(
+ "team_site_access",
+ {
+ id: serial("id").primaryKey().notNull(),
+ teamId: text("team_id")
+ .notNull()
+ .references(() => team.id, { onDelete: "cascade" }),
+ siteId: integer("site_id")
+ .notNull()
+ .references(() => sites.siteId, { onDelete: "cascade" }),
+ createdAt: timestamp("created_at", { mode: "string" }).defaultNow().notNull(),
+ },
+ (table) => [
+ unique("team_site_access_unique").on(table.teamId, table.siteId),
+ index("team_site_access_team_idx").on(table.teamId),
+ index("team_site_access_site_idx").on(table.siteId),
+ ]
+);
+
// Session table (BetterAuth)
export const session = pgTable(
"session",
diff --git a/server/src/index.ts b/server/src/index.ts
index b0d80ec88..9cc9f346c 100644
--- a/server/src/index.ts
+++ b/server/src/index.ts
@@ -66,6 +66,7 @@ import {
selectGSCProperty,
} from "./api/gsc/index.js";
import { updateInvitationSiteAccess, updateMemberSiteAccess } from "./api/memberAccess/index.js";
+import { listTeams, createTeam, updateTeam, deleteTeam } from "./api/teams/index.js";
import {
deleteSessionReplay,
getSessionReplayEvents,
@@ -325,6 +326,14 @@ async function organizationsRoutes(fastify: FastifyInstance) {
);
}
+async function teamsRoutes(fastify: FastifyInstance) {
+ // Teams
+ fastify.get("/organizations/:organizationId/teams", orgMember, listTeams);
+ fastify.post("/organizations/:organizationId/teams", orgAdminParams, createTeam);
+ fastify.put("/organizations/:organizationId/teams/:teamId", orgAdminParams, updateTeam);
+ fastify.delete("/organizations/:organizationId/teams/:teamId", orgAdminParams, deleteTeam);
+}
+
async function userRoutes(fastify: FastifyInstance) {
// User
fastify.get("/config", getConfig); // Public - returns app config
@@ -383,6 +392,7 @@ async function apiRoutes(fastify: FastifyInstance) {
await fastify.register(sessionReplayRoutes);
await fastify.register(sitesRoutes);
await fastify.register(organizationsRoutes);
+ await fastify.register(teamsRoutes);
await fastify.register(userRoutes);
await fastify.register(gscRoutes);
await fastify.register(stripeAdminRoutes);
diff --git a/server/src/lib/auth-utils.ts b/server/src/lib/auth-utils.ts
index 8171ec436..a54b5b67a 100644
--- a/server/src/lib/auth-utils.ts
+++ b/server/src/lib/auth-utils.ts
@@ -2,7 +2,7 @@ import { and, eq, inArray } from "drizzle-orm";
import { FastifyRequest } from "fastify";
import NodeCache from "node-cache";
import { db } from "../db/postgres/postgres.js";
-import { member, memberSiteAccess, sites, user } from "../db/postgres/schema.js";
+import { member, memberSiteAccess, sites, user, team, teamMember, teamSiteAccess } from "../db/postgres/schema.js";
import { auth } from "./auth.js";
import { siteConfig } from "./siteConfig.js";
import { logger } from "./logger/logger.js";
@@ -143,6 +143,69 @@ export async function getSitesUserHasAccessTo(req: FastifyRequest, adminOnly = f
}
}
+ // Apply team-based filtering for non-admin/owner members
+ // Members who have full org access (not restricted) still need team filtering
+ const memberOrgIds = memberRecords
+ .filter(r => r.role === "member")
+ .map(r => r.organizationId);
+
+ if (memberOrgIds.length > 0) {
+ // Find all team-gated sites in the member's orgs
+ const allTeamSites = await db
+ .select({ siteId: teamSiteAccess.siteId })
+ .from(teamSiteAccess)
+ .innerJoin(team, eq(teamSiteAccess.teamId, team.id))
+ .where(inArray(team.organizationId, memberOrgIds));
+
+ const teamGatedSiteIds = new Set(allTeamSites.map(s => s.siteId));
+
+ if (teamGatedSiteIds.size > 0) {
+ // Find teams the user belongs to
+ const userTeams = await db
+ .select({ teamId: teamMember.teamId })
+ .from(teamMember)
+ .where(eq(teamMember.userId, userId));
+
+ const userTeamSiteIds = new Set<number>();
+ if (userTeams.length > 0) {
+ const userTeamSites = await db
+ .select({ siteId: teamSiteAccess.siteId })
+ .from(teamSiteAccess)
+ .where(inArray(teamSiteAccess.teamId, userTeams.map(t => t.teamId)));
+ for (const s of userTeamSites) {
+ userTeamSiteIds.add(s.siteId);
+ }
+ }
+
+ // For sites from admin/owner orgs, keep all (no team filtering)
+ // For sites from member orgs, apply team filtering
+ const adminOrgSiteIds = new Set<number>();
+ if (fullAccessOrgIds.length > 0) {
+ // Sites from orgs where user is admin/owner should not be team-filtered
+ for (const record of memberRecords) {
+ if (record.role === "admin" || record.role === "owner") {
+ for (const [siteId, site] of siteMap) {
+ if (site.organizationId === record.organizationId) {
+ adminOrgSiteIds.add(siteId);
+ }
+ }
+ }
+ }
+ }
+
+ // Remove team-gated sites the user can't access (only for member-role orgs)
+ for (const [siteId] of siteMap) {
+ if (
+ teamGatedSiteIds.has(siteId) &&
+ !userTeamSiteIds.has(siteId) &&
+ !adminOrgSiteIds.has(siteId)
+ ) {
+ siteMap.delete(siteId);
+ }
+ }
+ }
+ }
+
return Array.from(siteMap.values());
} catch (error) {
console.error("Error getting sites user has access to:", error);
diff --git a/server/src/lib/auth.ts b/server/src/lib/auth.ts
index 959bf3e0b..19b39d788 100644
--- a/server/src/lib/auth.ts
+++ b/server/src/lib/auth.ts
@@ -9,7 +9,7 @@ import { apiKey } from "@better-auth/api-key"
import { db } from "../db/postgres/postgres.js";
import * as schema from "../db/postgres/schema.js";
-import { invitation, member, memberSiteAccess, user } from "../db/postgres/schema.js";
+import { invitation, member, memberSiteAccess, teamMember, user } from "../db/postgres/schema.js";
import { DISABLE_SIGNUP, IS_CLOUD } from "./const.js";
import { addContactToAudience, sendInvitationEmail, sendOtpEmail, sendWelcomeEmail } from "./email/email.js";
import { onboardingTipsService } from "../services/onboardingTips/onboardingTipsService.js";
@@ -23,6 +23,9 @@ const pluginList = [
organization({
allowUserToCreateOrganization: true,
creatorRole: "owner",
+ teams: {
+ enabled: true,
+ },
sendInvitationEmail: async invitationData => {
const inviteLink = `${process.env.BASE_URL}/invitation?invitationId=${invitationData.invitation.id}&organization=${invitationData.organization.name}&inviterEmail=${invitationData.inviter.user.email}`;
await sendInvitationEmail(
@@ -217,41 +220,41 @@ export const auth = betterAuth({
const invitationId = body?.invitationId;
if (invitationId) {
- // Query the invitation to get site access settings and org/email info
+ // Query the invitation to get site access settings, team assignments, and org/email info
const invitationRecord = await db
.select({
organizationId: invitation.organizationId,
email: invitation.email,
hasRestrictedSiteAccess: invitation.hasRestrictedSiteAccess,
siteIds: invitation.siteIds,
+ teamIds: invitation.teamIds,
})
.from(invitation)
.where(eq(invitation.id, invitationId))
.limit(1);
if (invitationRecord.length > 0) {
- const { organizationId, email, hasRestrictedSiteAccess, siteIds } = invitationRecord[0];
+ const { organizationId, email, hasRestrictedSiteAccess, siteIds, teamIds } = invitationRecord[0];
+ const userRecord = await db.select({ id: user.id }).from(user).where(eq(user.email, email)).limit(1);
- if (hasRestrictedSiteAccess) {
- // Find the user by email
- const userRecord = await db.select({ id: user.id }).from(user).where(eq(user.email, email)).limit(1);
+ if (userRecord.length > 0) {
+ const userId = userRecord[0].id;
- if (userRecord.length > 0) {
- await db.transaction(async tx => {
- // Find the member by organizationId + userId
- const memberRecord = await tx
- .select({ id: member.id })
- .from(member)
- .where(and(eq(member.organizationId, organizationId), eq(member.userId, userRecord[0].id)))
- .limit(1);
+ await db.transaction(async tx => {
+ // Find the member by organizationId + userId
+ const memberRecord = await tx
+ .select({ id: member.id })
+ .from(member)
+ .where(and(eq(member.organizationId, organizationId), eq(member.userId, userId)))
+ .limit(1);
- if (memberRecord.length > 0) {
- const memberId = memberRecord[0].id;
+ if (memberRecord.length > 0) {
+ const memberId = memberRecord[0].id;
- // Update member with hasRestrictedSiteAccess
+ // Copy site access restrictions
+ if (hasRestrictedSiteAccess) {
await tx.update(member).set({ hasRestrictedSiteAccess: true }).where(eq(member.id, memberId));
- // Insert site access entries
const siteIdArray = (siteIds || []) as number[];
if (siteIdArray.length > 0) {
await tx.insert(memberSiteAccess).values(
@@ -262,8 +265,21 @@ export const auth = betterAuth({
);
}
}
- });
- }
+
+ // Copy team assignments
+ const teamIdArray = (teamIds || []) as string[];
+ if (teamIdArray.length > 0) {
+ await tx.insert(teamMember).values(
+ teamIdArray.map(teamId => ({
+ id: crypto.randomUUID(),
+ teamId,
+ userId,
+ createdAt: new Date().toISOString(),
+ }))
+ );
+ }
+ }
+ });
}
}
}
diff --git a/server/src/lib/email/email.ts b/server/src/lib/email/email.ts
index 3a36593d0..411ac9655 100644
--- a/server/src/lib/email/email.ts
+++ b/server/src/lib/email/email.ts
@@ -128,7 +128,7 @@ export const sendLimitExceededEmail = async (
eventCount: number,
eventLimit: number
) => {
- const upgradeLink = "https://app.rybbit.io/settings/organization/subscription";
+ const upgradeLink = "https://app.rybbit.io/settings/subscription";
const html = await render(
LimitExceededEmail({