Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat(workspace): share link model methods and copy (#22246)

Rdmclin208e05c434572
diff --git a/locales/en-US/setting.json b/locales/en-US/setting.json
index 81e3989c526..da716e0373b 100644
--- a/locales/en-US/setting.json
+++ b/locales/en-US/setting.json
@@ -2379,6 +2379,8 @@
"workspace.auditLog.actions.integration.disabled": "Integration disabled",
"workspace.auditLog.actions.integration.disconnected": "Integration disconnected",
"workspace.auditLog.actions.integration.updated": "Integration updated",
+ "workspace.auditLog.actions.invitation.link_created": "Invite link created",
+ "workspace.auditLog.actions.invitation.link_revoked": "Invite link revoked",
"workspace.auditLog.actions.invitation.resent": "Invitation resent",
"workspace.auditLog.actions.invitation.revoked": "Invitation revoked",
"workspace.auditLog.actions.market_identity.published": "Market identity published",
@@ -3245,10 +3247,13 @@
"workspace.general.url.taken": "This URL is already taken.",
"workspace.general.url.title": "Workspace URL",
"workspace.invitePage.accept": "Accept Invitation",
+ "workspace.invitePage.acceptFailed": "Couldn't join the workspace. Please try again.",
"workspace.invitePage.acceptedSubtitle": "You have been added to the workspace.",
"workspace.invitePage.acceptedTitle": "Invitation Accepted",
"workspace.invitePage.alreadyAcceptedSubtitle": "This invitation has already been used. You should already be a member of the workspace.",
"workspace.invitePage.alreadyAcceptedTitle": "Invitation already accepted",
+ "workspace.invitePage.alreadyMemberSubtitle": "You're already in {{workspace}}. Open it to pick up where you left off.",
+ "workspace.invitePage.alreadyMemberTitle": "You're already a member",
"workspace.invitePage.decline": "Decline",
"workspace.invitePage.declineSubtitle": "You can close this window.",
"workspace.invitePage.declineTitle": "Invitation Declined",
@@ -3264,6 +3269,10 @@
"workspace.invitePage.invitedBy": "Invited by",
"workspace.invitePage.invitedEmail": "Invited email",
"workspace.invitePage.invitedTo": "{{inviter}} invited you to join the workspace",
+ "workspace.invitePage.linkExpiredSubtitle": "This invite link has expired. Ask a workspace admin for a new link.",
+ "workspace.invitePage.linkExpiredTitle": "Invite link expired",
+ "workspace.invitePage.linkRevokedSubtitle": "A workspace admin has revoked this link. Ask them for a new one if you still need to join.",
+ "workspace.invitePage.linkRevokedTitle": "Invite link revoked",
"workspace.invitePage.memberLimitSubtitle": "This workspace is full. Ask an owner to adjust seats in Billing or remove a member before joining.",
"workspace.invitePage.memberLimitTitle": "Workspace is full",
"workspace.invitePage.notFoundSubtitle": "This invitation link is invalid. Double-check the URL or ask the team owner to send a new one.",
@@ -3361,6 +3370,34 @@
"workspace.members.invite.success": "Invitations sent. Invitation links expire after 1 week.",
"workspace.members.invite.title": "Invite Members",
"workspace.members.invite.upgradePlanCta": "Upgrade plan",
+ "workspace.members.inviteLink.copied": "Invite link copied",
+ "workspace.members.inviteLink.copy": "Copy link",
+ "workspace.members.inviteLink.copyFailed": "Couldn't copy the link. Select it and copy it manually.",
+ "workspace.members.inviteLink.create": "Create invite link",
+ "workspace.members.inviteLink.createFailed": "Couldn't create the invite link. Try again.",
+ "workspace.members.inviteLink.created": "Invite link created and copied",
+ "workspace.members.inviteLink.description": "Anyone with the link can sign in and join with the chosen role until it expires or you revoke it.",
+ "workspace.members.inviteLink.empty": "No invite links yet",
+ "workspace.members.inviteLink.emptyHint": "Create a link and share it. Anyone who opens it can sign in and join.",
+ "workspace.members.inviteLink.expiresOn": "Expires {{date}}",
+ "workspace.members.inviteLink.expiry.30d": "30 days",
+ "workspace.members.inviteLink.expiry.7d": "7 days",
+ "workspace.members.inviteLink.expiry.never": "Never expires",
+ "workspace.members.inviteLink.expiryLabel": "Expires after",
+ "workspace.members.inviteLink.generate": "Generate",
+ "workspace.members.inviteLink.limitReached": "A workspace can keep up to {{limit}} active invite links. Revoke one you no longer use first.",
+ "workspace.members.inviteLink.loadFailed": "Couldn't load invite links.",
+ "workspace.members.inviteLink.neverExpires": "Never expires",
+ "workspace.members.inviteLink.retry": "Retry",
+ "workspace.members.inviteLink.revoke": "Revoke link",
+ "workspace.members.inviteLink.revokeConfirm.content": "The link stops working at once. Members who already joined through it stay.",
+ "workspace.members.inviteLink.revokeConfirm.title": "Revoke this invite link?",
+ "workspace.members.inviteLink.revokeFailed": "Couldn't revoke the invite link. Try again.",
+ "workspace.members.inviteLink.revoked": "Invite link revoked",
+ "workspace.members.inviteLink.roleLabel": "Joins as",
+ "workspace.members.inviteLink.title": "Invite link",
+ "workspace.members.inviteLink.uses_one": "{{count}} use",
+ "workspace.members.inviteLink.uses_other": "{{count}} uses",
"workspace.members.pending.columns.email": "Email",
"workspace.members.pending.columns.expiresAt": "Expires",
"workspace.members.pending.empty": "No pending invitations",
@@ -3380,6 +3417,7 @@
"workspace.members.seatUsage_one": "{{used}} / {{capacity}} seat",
"workspace.members.seatUsage_other": "{{used}} / {{capacity}} seats",
"workspace.members.subtitle": "Manage workspace members and invitations",
+ "workspace.members.tabs.links": "Invite links",
"workspace.members.tabs.members": "Members",
"workspace.members.tabs.pending": "Pending Invitations",
"workspace.members.title": "Members",
diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json
index ba357a59d3b..6bc925d1890 100644
--- a/locales/zh-CN/setting.json
+++ b/locales/zh-CN/setting.json
@@ -2379,6 +2379,8 @@
"workspace.auditLog.actions.integration.disabled": "禁用集成",
"workspace.auditLog.actions.integration.disconnected": "断开集成",
"workspace.auditLog.actions.integration.updated": "更新集成",
+ "workspace.auditLog.actions.invitation.link_created": "生成邀请链接",
+ "workspace.auditLog.actions.invitation.link_revoked": "撤销邀请链接",
"workspace.auditLog.actions.invitation.resent": "重新发送邀请",
"workspace.auditLog.actions.invitation.revoked": "撤销邀请",
"workspace.auditLog.actions.market_identity.published": "发布 Market 身份",
@@ -3245,10 +3247,13 @@
"workspace.general.url.taken": "此 URL 已被占用。",
"workspace.general.url.title": "工作区 URL",
"workspace.invitePage.accept": "接受邀请",
+ "workspace.invitePage.acceptFailed": "加入工作区失败,请稍后重试。",
"workspace.invitePage.acceptedSubtitle": "您已被添加到工作区。",
"workspace.invitePage.acceptedTitle": "邀请已接受",
"workspace.invitePage.alreadyAcceptedSubtitle": "此邀请已被使用。您应该已经是工作区的成员。",
"workspace.invitePage.alreadyAcceptedTitle": "邀请已被接受",
+ "workspace.invitePage.alreadyMemberSubtitle": "你已经在「{{workspace}}」中了,直接进入即可。",
+ "workspace.invitePage.alreadyMemberTitle": "你已是成员",
"workspace.invitePage.decline": "拒绝",
"workspace.invitePage.declineSubtitle": "您可以关闭此窗口。",
"workspace.invitePage.declineTitle": "邀请已拒绝",
@@ -3264,6 +3269,10 @@
"workspace.invitePage.invitedBy": "邀请者",
"workspace.invitePage.invitedEmail": "邀请邮箱",
"workspace.invitePage.invitedTo": "{{inviter}} 邀请您加入工作区",
+ "workspace.invitePage.linkExpiredSubtitle": "此邀请链接已过期,请向工作区管理员索取新链接。",
+ "workspace.invitePage.linkExpiredTitle": "邀请链接已过期",
+ "workspace.invitePage.linkRevokedSubtitle": "工作区管理员已撤销此链接。如仍需加入,请向管理员索取新链接。",
+ "workspace.invitePage.linkRevokedTitle": "邀请链接已撤销",
"workspace.invitePage.memberLimitSubtitle": "此工作区成员已满。请请求所有者在计费中调整席位或移除一名成员后再加入。",
"workspace.invitePage.memberLimitTitle": "工作区已满",
"workspace.invitePage.notFoundSubtitle": "此邀请链接无效。请检查 URL 或请求团队所有者发送一个新的邀请。",
@@ -3361,6 +3370,34 @@
"workspace.members.invite.success": "邀请已发送。邀请链接将在 1 周后过期。",
"workspace.members.invite.title": "邀请成员",
"workspace.members.invite.upgradePlanCta": "升级套餐",
+ "workspace.members.inviteLink.copied": "邀请链接已复制",
+ "workspace.members.inviteLink.copy": "复制链接",
+ "workspace.members.inviteLink.copyFailed": "复制失败,请选中链接后手动复制",
+ "workspace.members.inviteLink.create": "创建邀请链接",
+ "workspace.members.inviteLink.createFailed": "邀请链接生成失败,请重试",
+ "workspace.members.inviteLink.created": "邀请链接已生成并复制",
+ "workspace.members.inviteLink.description": "拿到链接的人登录后即可按所选角色加入,直到链接过期或被撤销。",
+ "workspace.members.inviteLink.empty": "还没有邀请链接",
+ "workspace.members.inviteLink.emptyHint": "创建一条链接分享出去,拿到的人登录后即可加入。",
+ "workspace.members.inviteLink.expiresOn": "{{date}} 到期",
+ "workspace.members.inviteLink.expiry.30d": "30 天",
+ "workspace.members.inviteLink.expiry.7d": "7 天",
+ "workspace.members.inviteLink.expiry.never": "永久有效",
+ "workspace.members.inviteLink.expiryLabel": "有效期",
+ "workspace.members.inviteLink.generate": "生成",
+ "workspace.members.inviteLink.limitReached": "每个工作区最多保留 {{limit}} 条有效的邀请链接,请先撤销不再使用的链接。",
+ "workspace.members.inviteLink.loadFailed": "邀请链接加载失败",
+ "workspace.members.inviteLink.neverExpires": "永久有效",
+ "workspace.members.inviteLink.retry": "重试",
+ "workspace.members.inviteLink.revoke": "撤销链接",
+ "workspace.members.inviteLink.revokeConfirm.content": "这条链接会立即失效,已通过它加入的成员不受影响。",
+ "workspace.members.inviteLink.revokeConfirm.title": "撤销这条邀请链接?",
+ "workspace.members.inviteLink.revokeFailed": "邀请链接撤销失败,请重试",
+ "workspace.members.inviteLink.revoked": "邀请链接已撤销",
+ "workspace.members.inviteLink.roleLabel": "加入后的角色",
+ "workspace.members.inviteLink.title": "邀请链接",
+ "workspace.members.inviteLink.uses_one": "已使用 {{count}} 次",
+ "workspace.members.inviteLink.uses_other": "已使用 {{count}} 次",
"workspace.members.pending.columns.email": "邮箱",
"workspace.members.pending.columns.expiresAt": "到期时间",
"workspace.members.pending.empty": "尚无待处理邀请",
@@ -3380,6 +3417,7 @@
"workspace.members.seatUsage_one": "{{used}} / {{capacity}} 个席位",
"workspace.members.seatUsage_other": "{{used}} / {{capacity}} 个席位",
"workspace.members.subtitle": "管理工作区成员和邀请",
+ "workspace.members.tabs.links": "邀请链接",
"workspace.members.tabs.members": "成员",
"workspace.members.tabs.pending": "待处理邀请",
"workspace.members.title": "成员",
diff --git a/packages/database/src/models/__tests__/workspaceMember.test.ts b/packages/database/src/models/__tests__/workspaceMember.test.ts
index 99fce205b09..b394ba84531 100644
--- a/packages/database/src/models/__tests__/workspaceMember.test.ts
+++ b/packages/database/src/models/__tests__/workspaceMember.test.ts
@@ -16,6 +16,7 @@ import {
workspaceTeams,
} from '../../schemas';
import type { LobeChatDatabase } from '../../type';
+import { WorkspaceAuditLogModel } from '../workspaceAuditLog';
import { WorkspaceMemberModel } from '../workspaceMember';
const serverDB: LobeChatDatabase = await getTestDB();
@@ -639,7 +640,7 @@ describe('WorkspaceMemberModel', () => {
expect(result.role).toBe('admin');
expect(result.email).toBeNull();
const expectedMs = INVITATION_EXPIRY_DAYS * 24 * 60 * 60 * 1000;
- const diff = result.expiresAt.getTime() - before;
+ const diff = result.expiresAt!.getTime() - before;
// allow generous slack for test execution time
expect(diff).toBeGreaterThan(expectedMs - 60_000);
expect(diff).toBeLessThan(expectedMs + 60_000);
@@ -694,6 +695,115 @@ describe('WorkspaceMemberModel', () => {
});
});
+ describe('share link invitations', () => {
+ it('createLinkInvitation creates reusable links; several can be live at once', async () => {
+ const model = new WorkspaceMemberModel(serverDB, inviterId);
+
+ const first = await model.createLinkInvitation({ expiresAt: null, workspaceId });
+ expect(first).toMatchObject({
+ email: null,
+ expiresAt: null,
+ inviterId,
+ reusable: true,
+ role: 'member',
+ status: 'pending',
+ });
+ expect(first.token).toHaveLength(32);
+
+ const expiresAt = new Date(Date.now() + 7 * 24 * 60 * 60 * 1000);
+ const second = await model.createLinkInvitation({ expiresAt, role: 'viewer', workspaceId });
+ expect(second.token).not.toBe(first.token);
+ expect(second.expiresAt?.getTime()).toBe(expiresAt.getTime());
+
+ // Both stay live: creating a link does not revoke the others.
+ expect((await model.listLinkInvitations(workspaceId)).map((row) => row.id)).toEqual([
+ second.id,
+ first.id,
+ ]);
+ expect(await model.countLinkInvitations(workspaceId)).toBe(2);
+ });
+
+ it('listLinkInvitations leaves out revoked, expired, single-use and other workspaces', async () => {
+ const model = new WorkspaceMemberModel(serverDB, inviterId);
+ const live = await model.createLinkInvitation({ expiresAt: null, workspaceId });
+ const revoked = await model.createLinkInvitation({ expiresAt: null, workspaceId });
+ await model.revokeLinkInvitation(workspaceId, revoked.id);
+ await model.createLinkInvitation({ expiresAt: new Date(Date.now() - 1000), workspaceId });
+ await model.createInvitation({ workspaceId });
+ await new WorkspaceMemberModel(serverDB, otherUserId).createLinkInvitation({
+ expiresAt: null,
+ workspaceId: otherWorkspaceId,
+ });
+
+ expect((await model.listLinkInvitations(workspaceId)).map((row) => row.id)).toEqual([
+ live.id,
+ ]);
+ expect(await model.countLinkInvitations(workspaceId)).toBe(1);
+ });
+
+ it('revokeLinkInvitation revokes only that live link of that workspace', async () => {
+ const model = new WorkspaceMemberModel(serverDB, inviterId);
+ const a = await model.createLinkInvitation({ expiresAt: null, workspaceId });
+ const b = await model.createLinkInvitation({ expiresAt: null, workspaceId });
+ const single = await model.createInvitation({ workspaceId });
+
+ // Wrong workspace, single-use invitation and unknown id are no-ops.
+ expect(await model.revokeLinkInvitation(otherWorkspaceId, a.id)).toBe(false);
+ expect(await model.revokeLinkInvitation(workspaceId, single.id)).toBe(false);
+ expect(await model.revokeLinkInvitation(workspaceId, 'missing')).toBe(false);
+
+ expect(await model.revokeLinkInvitation(workspaceId, a.id)).toBe(true);
+ expect(await model.revokeLinkInvitation(workspaceId, a.id)).toBe(false);
+
+ expect((await model.findInvitationByToken(a.token))?.status).toBe('revoked');
+ expect((await model.findInvitationByToken(b.token))?.status).toBe('pending');
+ expect((await model.findInvitationByToken(single.token))?.status).toBe('pending');
+ });
+
+ it('listPendingInvitations excludes share links', async () => {
+ const model = new WorkspaceMemberModel(serverDB, inviterId);
+ const single = await model.createInvitation({ workspaceId });
+ await model.createLinkInvitation({ expiresAt: null, workspaceId });
+
+ const rows = await model.listPendingInvitations(workspaceId);
+
+ expect(rows.map((row) => row.id)).toEqual([single.id]);
+ });
+
+ it('countJoinsByInvitation counts member.joined entries per invitation', async () => {
+ const audit = new WorkspaceAuditLogModel(serverDB);
+ const join = (invitationId: string, userId: string) =>
+ audit.create({
+ action: 'member.joined',
+ metadata: { invitationId, source: 'link' },
+ resourceId: userId,
+ resourceType: 'member',
+ userId,
+ workspaceId,
+ });
+ await join('link-a', inviterId);
+ await join('link-a', otherUserId);
+ await join('link-b', inviterId);
+ await audit.create({
+ action: 'invitation.revoked',
+ metadata: { invitationId: 'link-a' },
+ resourceId: 'link-a',
+ resourceType: 'invitation',
+ userId: inviterId,
+ workspaceId,
+ });
+
+ const counts = await audit.countJoinsByInvitation(workspaceId, [
+ 'link-a',
+ 'link-b',
+ 'link-c',
+ ]);
+
+ expect(Object.fromEntries(counts)).toEqual({ 'link-a': 2, 'link-b': 1 });
+ expect((await audit.countJoinsByInvitation(workspaceId, [])).size).toBe(0);
+ });
+ });
+
describe('listPendingInvitations', () => {
it('lists only pending invitations for the workspace', async () => {
const model = new WorkspaceMemberModel(serverDB, inviterId);
diff --git a/packages/database/src/models/workspaceAuditLog.ts b/packages/database/src/models/workspaceAuditLog.ts
index 782b8ecb159..303f2c25afc 100644
--- a/packages/database/src/models/workspaceAuditLog.ts
+++ b/packages/database/src/models/workspaceAuditLog.ts
@@ -1,4 +1,4 @@
-import { and, desc, eq, gte, ilike, inArray, lt, lte, or } from 'drizzle-orm';
+import { and, count, desc, eq, gte, ilike, inArray, lt, lte, or, sql } from 'drizzle-orm';
import { workspaceAuditLogs } from '../schemas/workspace';
import type { LobeChatDatabase, Transaction } from '../type';
@@ -26,6 +26,8 @@ export type WorkspaceAuditAction =
| 'member.demoted_from_owner'
| 'invitation.revoked'
| 'invitation.resent'
+ | 'invitation.link_created'
+ | 'invitation.link_revoked'
| 'budget.default_member_limit_updated'
| 'budget.member_limit_updated'
| 'budget.member_override_created'
@@ -137,6 +139,30 @@ export class WorkspaceAuditLogModel {
return row;
};
+ /**
+ * How many members joined through each of the given invitations, read from
+ * `member.joined` entries (`metadata.invitationId`). Ids with no joins are
+ * absent from the map.
+ */
+ countJoinsByInvitation = async (workspaceId: string, invitationIds: string[]) => {
+ const result = new Map<string, number>();
+ if (invitationIds.length === 0) return result;
+ const invitationId = sql<string>`${workspaceAuditLogs.metadata}->>'invitationId'`;
+ const rows = await this.db
+ .select({ invitationId, value: count() })
+ .from(workspaceAuditLogs)
+ .where(
+ and(
+ eq(workspaceAuditLogs.workspaceId, workspaceId),
+ eq(workspaceAuditLogs.action, 'member.joined'),
+ inArray(invitationId, invitationIds),
+ ),
+ )
+ .groupBy(invitationId);
+ for (const row of rows) result.set(row.invitationId, row.value);
+ return result;
+ };
+
list = async (params: ListAuditLogParams) => {
const {
workspaceId,
diff --git a/packages/database/src/models/workspaceMember.ts b/packages/database/src/models/workspaceMember.ts
index 92888ac6dc6..6622712147b 100644
--- a/packages/database/src/models/workspaceMember.ts
+++ b/packages/database/src/models/workspaceMember.ts
@@ -1,6 +1,20 @@
import { INVITATION_EXPIRY_DAYS } from '@lobechat/const';
import { canWorkspaceRoleBeTaskAssignee } from '@lobechat/const/rbac';
-import { and, asc, count, eq, exists, inArray, isNotNull, isNull, or, sql } from 'drizzle-orm';
+import {
+ and,
+ asc,
+ count,
+ desc,
+ eq,
+ exists,
+ gt,
+ inArray,
+ isNotNull,
+ isNull,
+ or,
+ sql,
+} from 'drizzle-orm';
+import { nanoid as secureNanoid } from 'nanoid';
import { nanoid } from 'nanoid/non-secure';
import { devices } from '../schemas/device';
@@ -321,15 +335,96 @@ export class WorkspaceMemberModel {
});
};
+ /** Pending single-use invitations; reusable links are managed separately. */
listPendingInvitations = async (workspaceId: string) => {
return this.db.query.workspaceInvitations.findMany({
where: and(
eq(workspaceInvitations.workspaceId, workspaceId),
eq(workspaceInvitations.status, 'pending'),
+ eq(workspaceInvitations.reusable, false),
),
});
};
+ // ===== Reusable link invitations (share links) ===== //
+
+ /**
+ * The workspace's live share links, newest first: reusable, not revoked and
+ * not past `expiresAt`. A workspace may hold several at once.
+ */
+ listLinkInvitations = async (workspaceId: string, now = new Date()) => {
+ return this.db.query.workspaceInvitations.findMany({
+ orderBy: [desc(workspaceInvitations.createdAt)],
+ where: and(
+ eq(workspaceInvitations.workspaceId, workspaceId),
+ eq(workspaceInvitations.reusable, true),
+ eq(workspaceInvitations.status, 'pending'),
+ or(isNull(workspaceInvitations.expiresAt), gt(workspaceInvitations.expiresAt, now)),
+ ),
+ });
+ };
+
+ /** Number of live share links, for the per-workspace cap. */
+ countLinkInvitations = async (workspaceId: string, now = new Date()) => {
+ const [row] = await this.db
+ .select({ value: count() })
+ .from(workspaceInvitations)
+ .where(
+ and(
+ eq(workspaceInvitations.workspaceId, workspaceId),
+ eq(workspaceInvitations.reusable, true),
+ eq(workspaceInvitations.status, 'pending'),
+ or(isNull(workspaceInvitations.expiresAt), gt(workspaceInvitations.expiresAt, now)),
+ ),
+ );
+ return row?.value ?? 0;
+ };
+
+ /**
+ * Create a share link: a reusable invitation any signed-in user can accept
+ * until it expires or is revoked. `expiresAt: null` never expires.
+ */
+ createLinkInvitation = async (params: {
+ expiresAt: Date | null;
+ role?: MemberRole;
+ workspaceId: string;
+ }) => {
+ const [invitation] = await this.db
+ .insert(workspaceInvitations)
+ .values({
+ expiresAt: params.expiresAt,
+ inviterId: this.userId,
+ reusable: true,
+ role: params.role ?? 'member',
+ // Long-lived and shared publicly, so draw the token from a CSPRNG.
+ token: secureNanoid(32),
+ workspaceId: params.workspaceId,
+ })
+ .returning();
+ return invitation;
+ };
+
+ /**
+ * Revoke one share link of the workspace. Returns whether a live link was
+ * revoked (false for an unknown id, another workspace's link, a single-use
+ * invitation, or a link that was already revoked).
+ */
+ revokeLinkInvitation = async (workspaceId: string, id: string) => {
+ const rows = await this.db
+ .update(workspaceInvitations)
+ .set({ status: 'revoked', updatedAt: new Date() })
+ .where(
+ and(
+ eq(workspaceInvitations.id, id),
+ eq(workspaceInvitations.workspaceId, workspaceId),
+ eq(workspaceInvitations.reusable, true),
+ eq(workspaceInvitations.status, 'pending'),
+ ),
+ )
+ .returning({ id: workspaceInvitations.id });
+ return rows.length > 0;
+ };
+
revokeInvitation = async (id: string) => {
return this.db
.update(workspaceInvitations)
diff --git a/packages/locales/src/default/setting.ts b/packages/locales/src/default/setting.ts
index c7e5c356877..d1ef47751f1 100644
--- a/packages/locales/src/default/setting.ts
+++ b/packages/locales/src/default/setting.ts
@@ -2708,6 +2708,8 @@ When I am ___, I need ___
'workspace.auditLog.actions.integration.disabled': 'Integration disabled',
'workspace.auditLog.actions.integration.disconnected': 'Integration disconnected',
'workspace.auditLog.actions.integration.updated': 'Integration updated',
+ 'workspace.auditLog.actions.invitation.link_created': 'Invite link created',
+ 'workspace.auditLog.actions.invitation.link_revoked': 'Invite link revoked',
'workspace.auditLog.actions.invitation.resent': 'Invitation resent',
'workspace.auditLog.actions.invitation.revoked': 'Invitation revoked',
'workspace.auditLog.actions.market_identity.published': 'Market identity published',
@@ -3294,6 +3296,16 @@ When I am ___, I need ___
'workspace.invitePage.workspaceLimitSubtitle':
"You've reached the maximum of {{limit}} workspaces. Leave one before joining another.",
'workspace.invitePage.workspaceLimitTitle': 'Workspace limit reached',
+ 'workspace.invitePage.acceptFailed': "Couldn't join the workspace. Please try again.",
+ 'workspace.invitePage.alreadyMemberSubtitle':
+ "You're already in {{workspace}}. Open it to pick up where you left off.",
+ 'workspace.invitePage.alreadyMemberTitle': "You're already a member",
+ 'workspace.invitePage.linkExpiredSubtitle':
+ 'This invite link has expired. Ask a workspace admin for a new link.',
+ 'workspace.invitePage.linkExpiredTitle': 'Invite link expired',
+ 'workspace.invitePage.linkRevokedSubtitle':
+ 'A workspace admin has revoked this link. Ask them for a new one if you still need to join.',
+ 'workspace.invitePage.linkRevokedTitle': 'Invite link revoked',
'workspace.waitlistPage.badge': 'Workspace · Private Beta',
'workspace.waitlistPage.createWorkspaceCta': 'Create workspace',
'workspace.waitlistPage.enabledSubtitle': 'Workspace is already enabled for your account.',
@@ -3384,6 +3396,39 @@ When I am ___, I need ___
'{{success}} invited, {{failed}} failed. Check the addresses and try again.',
'workspace.members.invite.success': 'Invitations sent. Invitation links expire after 1 week.',
'workspace.members.invite.title': 'Invite Members',
+ 'workspace.members.inviteLink.copied': 'Invite link copied',
+ 'workspace.members.inviteLink.copy': 'Copy link',
+ 'workspace.members.inviteLink.copyFailed':
+ "Couldn't copy the link. Select it and copy it manually.",
+ 'workspace.members.inviteLink.create': 'Create invite link',
+ 'workspace.members.inviteLink.createFailed': "Couldn't create the invite link. Try again.",
+ 'workspace.members.inviteLink.created': 'Invite link created and copied',
+ 'workspace.members.inviteLink.description':
+ 'Anyone with the link can sign in and join with the chosen role until it expires or you revoke it.',
+ 'workspace.members.inviteLink.empty': 'No invite links yet',
+ 'workspace.members.inviteLink.emptyHint':
+ 'Create a link and share it. Anyone who opens it can sign in and join.',
+ 'workspace.members.inviteLink.expiresOn': 'Expires {{date}}',
+ 'workspace.members.inviteLink.expiry.30d': '30 days',
+ 'workspace.members.inviteLink.expiry.7d': '7 days',
+ 'workspace.members.inviteLink.expiry.never': 'Never expires',
+ 'workspace.members.inviteLink.expiryLabel': 'Expires after',
+ 'workspace.members.inviteLink.generate': 'Generate',
+ 'workspace.members.inviteLink.limitReached':
+ 'A workspace can keep up to {{limit}} active invite links. Revoke one you no longer use first.',
+ 'workspace.members.inviteLink.loadFailed': "Couldn't load invite links.",
+ 'workspace.members.inviteLink.neverExpires': 'Never expires',
+ 'workspace.members.inviteLink.retry': 'Retry',
+ 'workspace.members.inviteLink.revoke': 'Revoke link',
+ 'workspace.members.inviteLink.revokeConfirm.content':
+ 'The link stops working at once. Members who already joined through it stay.',
+ 'workspace.members.inviteLink.revokeConfirm.title': 'Revoke this invite link?',
+ 'workspace.members.inviteLink.revokeFailed': "Couldn't revoke the invite link. Try again.",
+ 'workspace.members.inviteLink.revoked': 'Invite link revoked',
+ 'workspace.members.inviteLink.roleLabel': 'Joins as',
+ 'workspace.members.inviteLink.title': 'Invite link',
+ 'workspace.members.inviteLink.uses_one': '{{count}} use',
+ 'workspace.members.inviteLink.uses_other': '{{count}} uses',
'workspace.members.pending.columns.email': 'Email',
'workspace.members.pending.columns.expiresAt': 'Expires',
'workspace.members.pending.empty': 'No pending invitations',
@@ -3406,6 +3451,7 @@ When I am ___, I need ___
'workspace.members.seatUsage_one': '{{used}} / {{capacity}} seat',
'workspace.members.seatUsage_other': '{{used}} / {{capacity}} seats',
'workspace.members.subtitle': 'Manage workspace members and invitations',
+ 'workspace.members.tabs.links': 'Invite links',
'workspace.members.tabs.members': 'Members',
'workspace.members.tabs.pending': 'Pending Invitations',
'workspace.members.title': 'Members',