Merge remote-tracking branch 'origin/main' into issue-12986

# Conflicts:
#	plugins/oidc/server/auth/oidcRouter.ts
This commit is contained in:
Tom Moor committed 2026-07-16 22:51:11 -04:00
commit 55acf243e1
47 files changed
+1628 -845

No files matched your search

+2
View File
@@ -23,3 +23,5 @@ node_modules
**/*.test.jsx
**/__tests__
**/__mocks__
**/__snapshots__
**/test/fixtures
+1
View File
@@ -10,6 +10,7 @@ type Props = {
};
const Container = styled.div<Props>`
position: relative;
width: 100%;
max-width: 100vw;
padding: ${(props) => (props.withStickyHeader ? "4px 16px" : "60px 16px")};
+7 -2
View File
@@ -3,6 +3,7 @@ import { observer } from "mobx-react";
import { CommentIcon } from "outline-icons";
import styled from "styled-components";
import { s } from "@shared/styles";
import { EditorStyleHelper } from "@shared/editor/styles/EditorStyleHelper";
import stores from "~/stores";
type IconProps = {
@@ -60,7 +61,11 @@ export function CommentGutter({
onHoverCommentMark,
}: Props) {
return (
<Gutter contentEditable={false} suppressContentEditableWarning>
<Gutter
className={EditorStyleHelper.commentGutter}
contentEditable={false}
suppressContentEditableWarning
>
{commentIds.map((commentId) => (
<CommentGutterIcon
key={commentId}
@@ -75,7 +80,7 @@ export function CommentGutter({
const Gutter = styled.div`
position: absolute;
inset-inline-start: 100%;
inset-inline-start: calc(100% + ${EditorStyleHelper.padding}px);
margin-inline-start: 8px;
display: flex;
flex-direction: column;
+8 -6
View File
@@ -189,18 +189,20 @@ export function MediaDimension() {
[handleBlur, reset]
);
// Sync dimension changes from outside.
// Sync dimension changes from outside, without clobbering in-progress edits
// to the inputs (which also change `localDimension`).
const prevSizeRef = useRef({ width, height });
useEffect(() => {
const prev = prevSizeRef.current;
prevSizeRef.current = { width, height };
if (isDraggingRef.current) {
return;
}
if (
width !== Number(localDimension.width) ||
height !== Number(localDimension.height)
) {
if (prev.width !== width || prev.height !== height) {
reset();
}
}, [width, height, reset, localDimension.width, localDimension.height]);
}, [width, height, reset]);
// Listen to drag resize updates in real-time.
useEffect(() => {
+12 -1
View File
@@ -11,9 +11,16 @@ export interface PortalRenderer {
readonly content: ReactNode;
}
let nextRendererId = 0;
export class NodeViewRenderer<T extends object> implements PortalRenderer {
@observable public props: T;
/**
* Stable identity used as the React key when renderers are rendered
*/
public readonly key = `renderer-${nextRendererId++}`;
public constructor(
public element: HTMLElement,
private Component: FunctionComponent<T>,
@@ -24,7 +31,11 @@ export class NodeViewRenderer<T extends object> implements PortalRenderer {
@computed
public get content() {
return createPortal(<this.Component {...this.props} />, this.element);
return createPortal(
<this.Component {...this.props} />,
this.element,
this.key
);
}
@action
+12 -11
View File
@@ -4,8 +4,7 @@ import { Plugin, PluginKey } from "prosemirror-state";
import { Decoration, DecorationSet } from "prosemirror-view";
import Extension from "@shared/editor/lib/Extension";
import { changedDescendants } from "@shared/editor/lib/changedDescendants";
import { isRemoteTransaction } from "@shared/editor/lib/multiplayer";
import { EditorStyleHelper } from "@shared/editor/styles/EditorStyleHelper";
import { mapDecorations } from "@shared/editor/lib/multiplayer";
import { UserPreferenceDefaults } from "@shared/constants";
import { UserPreference } from "@shared/types";
import { CommentGutter as CommentGutterComponent } from "../components/CommentGutter";
@@ -32,14 +31,8 @@ export default class CommentGutter extends Extension {
const handleClickCommentMark = (commentId: string) =>
this.editor.props.onClickCommentMark?.(commentId);
// Mirror the comment mark's hover state when its gutter indicator is
// hovered, by toggling a class on the matching mark(s) in the document.
const handleHoverCommentMark = (commentId: string, hovered: boolean) => {
this.editor.view?.dom
.querySelectorAll(`[id="comment-${commentId}"]`)
.forEach((element) =>
element.classList.toggle(EditorStyleHelper.commentHovered, hovered)
);
this.editor.setHoveredCommentId(hovered ? commentId : null);
};
const handlers = {
@@ -63,14 +56,20 @@ export default class CommentGutter extends Extension {
return pluginState;
}
if (isRemoteTransaction(tr) || this.hasCommentChange(tr)) {
// Only rebuild when the comments themselves change. Otherwise map
// the existing decorations, preserving each widget's identity so
// the React-rendered indicators are not torn down and recreated on
// every remote edit — churn that leaves their event handlers dead.
// mapDecorations handles remote (Yjs) transactions, whose mapping
// cannot be applied naively.
if (this.hasCommentChange(tr)) {
return {
decorations: this.createDecorations(newState, handlers),
};
}
return {
decorations: pluginState.decorations.map(tr.mapping, tr.doc),
decorations: mapDecorations(pluginState.decorations, tr),
};
},
},
@@ -194,6 +193,8 @@ export default class CommentGutter extends Extension {
key: `comment-gutter-${anchor}-${[...commentIds].sort().join("-")}`,
side: -1,
ignoreSelection: true,
// Keep interactions on the indicator from reaching ProseMirror
stopEvent: () => true,
destroy: (node: HTMLElement) => {
// Clear any forced hover state, otherwise it can remain stuck
commentIds.forEach((commentId) =>
+36
View File
@@ -182,6 +182,8 @@ type State = {
isEditorFocused: boolean;
/** Image that's being currently viewed in Lightbox */
activeLightboxImage: LightboxImage | null;
/** The comment thread currently highlighted from its gutter indicator */
hoveredCommentId: string | null;
};
/**
@@ -212,6 +214,7 @@ export class Editor extends React.PureComponent<
isRTL: false,
isEditorFocused: false,
activeLightboxImage: null,
hoveredCommentId: null,
};
isInitialized = false;
@@ -933,6 +936,19 @@ export class Editor extends React.PureComponent<
this.portalDestroyers.delete(element);
}
/**
* Highlight (or clear) the comment thread whose gutter indicator is hovered.
* Applied as container CSS rather than by mutating the mark's DOM directly,
* which would trip ProseMirror's mutation observer and force a redraw.
*
* @param commentId - The comment thread id to highlight, or null to clear.
*/
public setHoveredCommentId = (commentId: string | null) => {
if (this.state.hoveredCommentId !== commentId) {
this.setState({ hoveredCommentId: commentId });
}
};
public render() {
const { readOnly, canUpdate, grow, style, className, onKeyDown } =
this.props;
@@ -956,6 +972,7 @@ export class Editor extends React.PureComponent<
readOnly={readOnly}
readOnlyWriteCheckboxes={canUpdate}
focusedCommentId={this.props.focusedCommentId}
hoveredCommentId={this.state.hoveredCommentId ?? undefined}
userId={this.props.userId}
editorStyle={this.props.editorStyle}
commenting={!!this.props.onClickCommentMark}
@@ -1001,6 +1018,7 @@ export class Editor extends React.PureComponent<
const EditorContainer = styled(Styles)<{
userId?: string;
focusedCommentId?: string;
hoveredCommentId?: string;
}>`
${(props) =>
props.focusedCommentId &&
@@ -1020,6 +1038,24 @@ const EditorContainer = styled(Styles)<{
}
`}
${(props) =>
props.hoveredCommentId &&
props.hoveredCommentId !== props.focusedCommentId &&
css`
span#comment-${props.hoveredCommentId} {
background: ${props.theme.commentMarkBackground};
* {
background: transparent !important;
}
}
a#comment-${props.hoveredCommentId}
~ span.component-image
div.image-wrapper {
outline: ${props.theme.commentedImageOutlineDark} solid 2px;
}
`}
${(props) =>
props.userId &&
css`
+2 -1
View File
@@ -37,7 +37,8 @@ export default function codeMenuItems(ctx: SelectionContext): MenuItem[] {
const remainingLangMenuItems = Object.entries(codeLanguages)
.filter(
([value]) =>
([value, item]) =>
!item.alias &&
!frequentLanguages.includes(value as keyof typeof codeLanguages)
)
.map(([value, item]) => langToMenuItem({ node, value, label: item.label }));
@@ -25,6 +25,7 @@ import useCurrentUser from "~/hooks/useCurrentUser";
import { sidebarAppearDuration } from "~/styles/animations";
import CommentForm from "./CommentForm";
import CommentThreadItem from "./CommentThreadItem";
import { EditorStyleHelper } from "@shared/editor/styles/EditorStyleHelper";
type Props = {
/** The document that this comment thread belongs to */
@@ -56,7 +57,6 @@ function CommentThread({
const { editor, setFocusedCommentId } = useDocumentContext();
const { comments } = useStores();
const topRef = React.useRef<HTMLDivElement>(null);
const replyRef = React.useRef<HTMLDivElement>(null);
const { t } = useTranslation();
const [autoFocus, setAutoFocusOn, setAutoFocusOff] = useBoolean(thread.isNew);
const user = useCurrentUser();
@@ -104,6 +104,7 @@ function CommentThread({
// click handler, so skip deselecting here to avoid a flash of the
// deselected state (and the new comment form) in between.
!target.closest("[data-comment-thread]") &&
!target.closest("." + EditorStyleHelper.commentGutter) &&
event.defaultPrevented === false
) {
setFocusedCommentId(null);
@@ -193,13 +194,14 @@ function CommentThread({
}, sidebarAppearDuration);
} else {
setTimeout(() => {
if (!replyRef.current) {
if (!topRef.current) {
return;
}
scrollIntoView(replyRef.current, {
// Scroll the whole into view when its mark is clicked
scrollIntoView(topRef.current, {
scrollMode: "if-needed",
behavior: "smooth",
block: "center",
block: "nearest",
boundary: (parent) =>
// Prevents body and other parent elements from being scrolled
parent.id !== "comments",
@@ -278,7 +280,7 @@ function CommentThread({
);
})}
<ResizingHeightContainer hideOverflow={false} ref={replyRef}>
<ResizingHeightContainer hideOverflow={false}>
{(focused || draft || commentsInThread.length === 0) && canReply && (
<Fade timing={100}>
<CommentForm
+3 -4
View File
@@ -6,7 +6,7 @@ import { useRef, useState } from "react";
import * as React from "react";
import { useTranslation, Trans } from "react-i18next";
import { toast } from "sonner";
import { ThemeProvider, useTheme } from "styled-components";
import { ThemeProvider } from "styled-components";
import { errToString } from "@shared/utils/error";
import { buildDarkTheme, buildLightTheme } from "@shared/styles/theme";
import type { CustomTheme } from "@shared/types";
@@ -37,7 +37,6 @@ function Details() {
const { dialogs, ui } = useStores();
const { t } = useTranslation();
const team = useCurrentTeam();
const theme = useTheme();
const can = usePolicy(team);
const form = useRef<HTMLFormElement>(null);
@@ -267,14 +266,14 @@ function Details() {
>
<InputColor
id="accent"
value={accent ?? theme.accent}
value={accent ?? newTheme.accent}
label={t("Accent color")}
onChange={setAccent}
flex
/>
<InputColor
id="accentText"
value={accentText ?? theme.accentText}
value={accentText ?? newTheme.accentText}
label={t("Accent text color")}
onChange={setAccentText}
flex
+14 -14
View File
@@ -80,7 +80,7 @@
"@hocuspocus/server": "1.1.3",
"@juggle/resize-observer": "^3.4.0",
"@linear/sdk": "^58.1.0",
"@mermaid-js/layout-elk": "^0.2.1",
"@mermaid-js/layout-elk": "^0.2.2",
"@modelcontextprotocol/sdk": "^1.25.3",
"@node-oauth/oauth2-server": "^5.3.0",
"@notionhq/client": "^2.3.0",
@@ -88,19 +88,19 @@
"@octokit/webhooks-types": "^7.6.1",
"@outlinewiki/koa-passport": "^4.2.1",
"@outlinewiki/passport-azure-ad-oauth2": "^0.1.0",
"@radix-ui/react-collapsible": "^1.1.15",
"@radix-ui/react-context-menu": "^2.3.2",
"@radix-ui/react-dialog": "^1.1.18",
"@radix-ui/react-collapsible": "^1.1.16",
"@radix-ui/react-context-menu": "^2.3.3",
"@radix-ui/react-dialog": "^1.1.19",
"@radix-ui/react-direction": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.19",
"@radix-ui/react-one-time-password-field": "^0.1.11",
"@radix-ui/react-popover": "^1.1.18",
"@radix-ui/react-select": "^2.3.2",
"@radix-ui/react-dropdown-menu": "^2.1.20",
"@radix-ui/react-one-time-password-field": "^0.1.12",
"@radix-ui/react-popover": "^1.1.19",
"@radix-ui/react-select": "^2.3.3",
"@radix-ui/react-slot": "^1.3.0",
"@radix-ui/react-switch": "^1.3.2",
"@radix-ui/react-tabs": "^1.1.16",
"@radix-ui/react-toolbar": "^1.1.14",
"@radix-ui/react-tooltip": "^1.2.11",
"@radix-ui/react-switch": "^1.3.3",
"@radix-ui/react-tabs": "^1.1.17",
"@radix-ui/react-toolbar": "^1.1.15",
"@radix-ui/react-tooltip": "^1.2.12",
"@radix-ui/react-visually-hidden": "^1.2.7",
"@sentry/node": "^10.63.0",
"@sentry/react": "^10.63.0",
@@ -112,7 +112,7 @@
"@types/mailparser": "^3.4.6",
"@types/pako": "^2.0.4",
"@types/sanitize-filename": "^1.6.3",
"@vitejs/plugin-react": "^6.0.2",
"@vitejs/plugin-react": "^6.0.3",
"addressparser": "^1.0.1",
"async-sema": "^3.1.1",
"bull": "^4.16.5",
@@ -173,7 +173,7 @@
"markdown-it": "^14.3.0",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^3.0.0",
"mermaid": "11.15.0",
"mermaid": "11.16.0",
"mime-types": "^3.0.2",
"mobx": "^4.15.7",
"mobx-react": "^6.3.1",
+2 -1
View File
@@ -19,6 +19,7 @@ import {
getClientFromOAuthState,
getUserFromOAuthState,
startOAuthFlow,
withProxyAgent,
} from "@server/utils/passport";
import config from "../../plugin.json";
import env from "../env";
@@ -232,7 +233,7 @@ if (env.AZURE_CLIENT_ID && env.AZURE_CLIENT_SECRET) {
}
}
);
passport.use(strategy);
passport.use(withProxyAgent(strategy));
router.get(
config.id,
startOAuthFlow,
+168 -164
View File
@@ -26,6 +26,7 @@ import {
getUserFromOAuthState,
request,
startOAuthFlow,
withProxyAgent,
} from "@server/utils/passport";
import config from "../../plugin.json";
import env from "../env";
@@ -43,188 +44,191 @@ if (env.DISCORD_SERVER_ID) {
if (env.DISCORD_CLIENT_ID && env.DISCORD_CLIENT_SECRET) {
passport.use(
config.id,
new Strategy(
{
clientID: env.DISCORD_CLIENT_ID,
clientSecret: env.DISCORD_CLIENT_SECRET,
passReqToCallback: true,
scope,
// @ts-expect-error custom state store
store: new StateStore(),
state: true,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
authorizationURL:
"https://discord.com/api/oauth2/authorize?prompt=none",
tokenURL: "https://discord.com/api/oauth2/token",
pkce: false,
},
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number },
_profile: unknown,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
const team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
/** Fetch the user's profile */
const profile: RESTGetAPICurrentUserResult = await request(
"GET",
"https://discord.com/api/users/@me",
accessToken
);
const email = profile.email;
if (!email) {
/** We have the email scope, so this should never happen */
throw InvalidRequestError("Discord profile email is missing");
}
const { domain } = parseEmail(email);
if (!domain) {
throw TeamDomainRequiredError();
}
/** Determine the user's language from the locale */
const { locale } = profile;
const language = locale
? languages.find((l) => l.startsWith(locale))
: undefined;
/** Default user and team names metadata */
let userName = profile.username;
let teamName;
let userAvatarUrl: string = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.png`;
let teamAvatarUrl: string | undefined = undefined;
let subdomain = slugifyDomain(domain);
/**
* If a Discord server is configured, we will check if the user is a member of the server
* Additionally, we can get the user's nickname in the server if it exists
*/
if (env.DISCORD_SERVER_ID) {
/** Fetch the guilds a user is in */
const guilds: RESTGetAPICurrentUserGuildsResult = await request(
withProxyAgent(
new Strategy(
{
clientID: env.DISCORD_CLIENT_ID,
clientSecret: env.DISCORD_CLIENT_SECRET,
passReqToCallback: true,
scope,
// @ts-expect-error custom state store
store: new StateStore(),
state: true,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
authorizationURL:
"https://discord.com/api/oauth2/authorize?prompt=none",
tokenURL: "https://discord.com/api/oauth2/token",
pkce: false,
},
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number },
_profile: unknown,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
const team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
/** Fetch the user's profile */
const profile: RESTGetAPICurrentUserResult = await request(
"GET",
"https://discord.com/api/users/@me/guilds",
"https://discord.com/api/users/@me",
accessToken
);
/** Find the guild that matches the configured server ID */
const guild = guilds?.find((g) => g.id === env.DISCORD_SERVER_ID);
/** If the user is not in the server, throw an error */
if (!guild) {
throw DiscordGuildError();
const email = profile.email;
if (!email) {
/** We have the email scope, so this should never happen */
throw InvalidRequestError("Discord profile email is missing");
}
const { domain } = parseEmail(email);
if (!domain) {
throw TeamDomainRequiredError();
}
/** Determine the user's language from the locale */
const { locale } = profile;
const language = locale
? languages.find((l) => l.startsWith(locale))
: undefined;
/** Default user and team names metadata */
let userName = profile.username;
let teamName;
let userAvatarUrl: string = `https://cdn.discordapp.com/avatars/${profile.id}/${profile.avatar}.png`;
let teamAvatarUrl: string | undefined = undefined;
let subdomain = slugifyDomain(domain);
/**
* Get the guild's icon
* https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
**/
if (guild.icon) {
const isGif = guild.icon.startsWith("a_");
if (isGif) {
teamAvatarUrl = `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.gif`;
} else {
teamAvatarUrl = `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.png`;
}
}
teamName = guild.name;
subdomain = slugify(guild.name);
/** If the guild name is a URL, use the subdomain instead – we do not allow URLs in names. */
if (
isURL(teamName, {
require_host: false,
require_protocol: false,
})
) {
teamName = subdomain;
}
/** Fetch the user's member object in the server for nickname and roles */
const guildMember: RESTGetCurrentUserGuildMemberResult =
await request(
* If a Discord server is configured, we will check if the user is a member of the server
* Additionally, we can get the user's nickname in the server if it exists
*/
if (env.DISCORD_SERVER_ID) {
/** Fetch the guilds a user is in */
const guilds: RESTGetAPICurrentUserGuildsResult = await request(
"GET",
`https://discord.com/api/users/@me/guilds/${env.DISCORD_SERVER_ID}/member`,
"https://discord.com/api/users/@me/guilds",
accessToken
);
/** If the user has a nickname in the server, use that as the name */
if (guildMember.nick) {
userName = guildMember.nick;
}
/** Find the guild that matches the configured server ID */
const guild = guilds?.find((g) => g.id === env.DISCORD_SERVER_ID);
/** If the user has a custom avatar in the server, use that as the avatar */
if (guildMember.avatar) {
userAvatarUrl = `https://cdn.discordapp.com/guilds/${guild.id}/users/${profile.id}/avatars/${guildMember.avatar}.png`;
}
/** If the user is not in the server, throw an error */
if (!guild) {
throw DiscordGuildError();
}
/** If server roles are configured, check if the user has any of the roles */
if (env.DISCORD_SERVER_ROLES) {
const { roles } = guildMember;
const hasRole = roles?.some((role) =>
env.DISCORD_SERVER_ROLES?.includes(role)
);
/**
* Get the guild's icon
* https://discord.com/developers/docs/reference#image-formatting-cdn-endpoints
**/
if (guild.icon) {
const isGif = guild.icon.startsWith("a_");
if (isGif) {
teamAvatarUrl = `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.gif`;
} else {
teamAvatarUrl = `https://cdn.discordapp.com/icons/${guild.id}/${guild.icon}.png`;
}
}
/** If the user does not have any of the roles, throw an error */
if (!hasRole) {
throw DiscordGuildRoleError();
teamName = guild.name;
subdomain = slugify(guild.name);
/** If the guild name is a URL, use the subdomain instead – we do not allow URLs in names. */
if (
isURL(teamName, {
require_host: false,
require_protocol: false,
})
) {
teamName = subdomain;
}
/** Fetch the user's member object in the server for nickname and roles */
const guildMember: RESTGetCurrentUserGuildMemberResult =
await request(
"GET",
`https://discord.com/api/users/@me/guilds/${env.DISCORD_SERVER_ID}/member`,
accessToken
);
/** If the user has a nickname in the server, use that as the name */
if (guildMember.nick) {
userName = guildMember.nick;
}
/** If the user has a custom avatar in the server, use that as the avatar */
if (guildMember.avatar) {
userAvatarUrl = `https://cdn.discordapp.com/guilds/${guild.id}/users/${profile.id}/avatars/${guildMember.avatar}.png`;
}
/** If server roles are configured, check if the user has any of the roles */
if (env.DISCORD_SERVER_ROLES) {
const { roles } = guildMember;
const hasRole = roles?.some((role) =>
env.DISCORD_SERVER_ROLES?.includes(role)
);
/** If the user does not have any of the roles, throw an error */
if (!hasRole) {
throw DiscordGuildRoleError();
}
}
}
}
const user =
context.state?.auth?.user ?? (await getUserFromOAuthState(context));
const user =
context.state?.auth?.user ??
(await getUserFromOAuthState(context));
// if a team can be inferred, we assume the user is only interested in signing into
// that team in particular; otherwise, we will do a best effort at finding their account
// or provisioning a new one (within AccountProvisioner)
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: teamName,
domain,
subdomain,
avatarUrl: teamAvatarUrl,
},
user: {
email,
emailVerified: profile.verified,
name: userName,
language,
avatarUrl: userAvatarUrl,
},
authenticationProvider: {
name: config.id,
providerId: env.DISCORD_SERVER_ID ?? "",
},
authentication: {
providerId: profile.id,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: scope,
},
});
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
// if a team can be inferred, we assume the user is only interested in signing into
// that team in particular; otherwise, we will do a best effort at finding their account
// or provisioning a new one (within AccountProvisioner)
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: teamName,
domain,
subdomain,
avatarUrl: teamAvatarUrl,
},
user: {
email,
emailVerified: profile.verified,
name: userName,
language,
avatarUrl: userAvatarUrl,
},
authenticationProvider: {
name: config.id,
providerId: env.DISCORD_SERVER_ID ?? "",
},
authentication: {
providerId: profile.id,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: scope,
},
});
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
}
}
}
)
)
);
+116 -115
View File
@@ -21,6 +21,7 @@ import {
getClientFromOAuthState,
getUserFromOAuthState,
startOAuthFlow,
withProxyAgent,
} from "@server/utils/passport";
import config from "../../plugin.json";
import env from "../env";
@@ -43,130 +44,130 @@ type GoogleProfile = Profile & {
};
if (env.GOOGLE_CLIENT_ID && env.GOOGLE_CLIENT_SECRET) {
passport.use(
new GoogleStrategy(
{
clientID: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
passReqToCallback: true,
// @ts-expect-error StateStore
store: new StateStore(),
scope: scopes,
},
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number; scope?: string },
profile: GoogleProfile,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
// "domain" is the Google Workspaces domain
const domain = profile._json.hd;
let team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
const user =
context.state?.auth?.user ?? (await getUserFromOAuthState(context));
const strategy = new GoogleStrategy(
{
clientID: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
passReqToCallback: true,
// @ts-expect-error StateStore
store: new StateStore(),
scope: scopes,
},
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number; scope?: string },
profile: GoogleProfile,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
// "domain" is the Google Workspaces domain
const domain = profile._json.hd;
let team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
const user =
context.state?.auth?.user ?? (await getUserFromOAuthState(context));
// No profile domain means a personal gmail account, and no team means
// the request came from the apex domain rather than a workspace
// subdomain. We can't infer the workspace from the domain, so resolve
// it from the verified email's existing accounts instead.
if (!domain && !team) {
const existingAccounts = await User.findAll({
attributes: ["id", "teamId"],
where: { email: profile.email.toLowerCase() },
include: [
{
association: "team",
required: true,
},
],
});
const teamIds = new Set(
existingAccounts.map((account) => account.teamId)
);
// No profile domain means a personal gmail account, and no team means
// the request came from the apex domain rather than a workspace
// subdomain. We can't infer the workspace from the domain, so resolve
// it from the verified email's existing accounts instead.
if (!domain && !team) {
const existingAccounts = await User.findAll({
attributes: ["id", "teamId"],
where: { email: profile.email.toLowerCase() },
include: [
{
association: "team",
required: true,
},
],
});
const teamIds = new Set(
existingAccounts.map((account) => account.teamId)
);
// A personal gmail account cannot be used to create a new workspace.
if (teamIds.size === 0) {
throw GmailAccountCreationError();
}
// When the email belongs to more than one workspace it is ambiguous
// which to sign into, so the user must start from its subdomain.
if (teamIds.size > 1) {
throw TeamDomainRequiredError();
}
// Belongs to exactly one workspace — resolve it and sign in there.
team = existingAccounts[0].team;
// A personal gmail account cannot be used to create a new workspace.
if (teamIds.size === 0) {
throw GmailAccountCreationError();
}
// remove the TLD and form a subdomain from the remaining
// subdomains of the form "foo.bar.com" are allowed as primary Google Workspaces domains
// see https://support.google.com/nonprofits/thread/19685140/using-a-subdomain-as-a-primary-domain
const subdomain = domain ? slugifyDomain(domain) : "";
const teamName = capitalize(subdomain);
// When the email belongs to more than one workspace it is ambiguous
// which to sign into, so the user must start from its subdomain.
if (teamIds.size > 1) {
throw TeamDomainRequiredError();
}
// Request a larger size profile picture than the default by tweaking
// the query parameter.
const avatarUrl = profile.picture.replace("=s96-c", "=s128-c");
const locale = profile._json.locale;
const language = locale
? languages.find((l) => l.startsWith(locale))
: undefined;
// if a team can be inferred, we assume the user is only interested in signing into
// that team in particular; otherwise, we will do a best effort at finding their account
// or provisioning a new one (within AccountProvisioner)
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: teamName,
domain,
subdomain,
},
user: {
email: profile.email,
// Google only returns confirmed workspace email addresses.
emailVerified: true,
name: profile.displayName,
language,
avatarUrl,
},
authenticationProvider: {
name: config.id,
providerId: domain ?? "",
},
authentication: {
providerId: profile.id,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: params.scope ? params.scope.split(" ") : scopes,
},
});
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
// Belongs to exactly one workspace — resolve it and sign in there.
team = existingAccounts[0].team;
}
// remove the TLD and form a subdomain from the remaining
// subdomains of the form "foo.bar.com" are allowed as primary Google Workspaces domains
// see https://support.google.com/nonprofits/thread/19685140/using-a-subdomain-as-a-primary-domain
const subdomain = domain ? slugifyDomain(domain) : "";
const teamName = capitalize(subdomain);
// Request a larger size profile picture than the default by tweaking
// the query parameter.
const avatarUrl = profile.picture.replace("=s96-c", "=s128-c");
const locale = profile._json.locale;
const language = locale
? languages.find((l) => l.startsWith(locale))
: undefined;
// if a team can be inferred, we assume the user is only interested in signing into
// that team in particular; otherwise, we will do a best effort at finding their account
// or provisioning a new one (within AccountProvisioner)
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: teamName,
domain,
subdomain,
},
user: {
email: profile.email,
// Google only returns confirmed workspace email addresses.
emailVerified: true,
name: profile.displayName,
language,
avatarUrl,
},
authenticationProvider: {
name: config.id,
providerId: domain ?? "",
},
authentication: {
providerId: profile.id,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: params.scope ? params.scope.split(" ") : scopes,
},
});
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
}
)
}
);
passport.use(withProxyAgent(strategy));
router.get(config.id, startOAuthFlow, async (ctx, next) => {
const team = await getTeamFromContext(ctx, {
includeHostQueryParam: true,
-14
View File
@@ -1,6 +1,4 @@
import type { Request } from "express";
import { HttpsProxyAgent } from "https-proxy-agent";
import type OAuth2Strategy from "passport-oauth2";
import { Strategy } from "passport-oauth2";
interface AuthenticateOptions {
@@ -9,18 +7,6 @@ interface AuthenticateOptions {
}
export class OIDCStrategy extends Strategy {
constructor(
options: OAuth2Strategy.StrategyOptionsWithRequest,
verify: OAuth2Strategy.VerifyFunctionWithRequest
) {
super(options, verify);
if (process.env.https_proxy) {
const httpsProxyAgent = new HttpsProxyAgent(process.env.https_proxy);
this._oauth2.setAgent(httpsProxyAgent);
}
}
authenticate(req: Request, options: AuthenticateOptions) {
options.originalQuery = req.query;
super.authenticate(req, options);
+221 -211
View File
@@ -28,6 +28,7 @@ import {
getUserFromOAuthState,
request,
startOAuthFlow,
withProxyAgent,
} from "@server/utils/passport";
import config from "../../plugin.json";
import env from "../env";
@@ -59,228 +60,237 @@ export function createOIDCRouter(
passport.use(
config.id,
new OIDCStrategy(
{
authorizationURL: endpoints.authorizationURL,
tokenURL: endpoints.tokenURL,
clientID: env.OIDC_CLIENT_ID!,
clientSecret: env.OIDC_CLIENT_SECRET!,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
passReqToCallback: true,
scope: env.OIDC_SCOPES,
// @ts-expect-error custom state store
store: new StateStore(endpoints.pkce),
state: true,
pkce: endpoints.pkce ?? false,
},
// OpenID Connect standard profile claims can be found in the official
// specification.
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
// Non-standard claims may be configured by individual identity providers.
// Any claim supplied in response to the userinfo request will be
// available on the `profile` parameter
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number; id_token: string; scope?: string },
_profile: unknown,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
// Some providers require a POST request to the userinfo endpoint, add them as exceptions here.
const usePostMethod = [
"https://api.dropboxapi.com/2/openid/userinfo",
];
withProxyAgent(
new OIDCStrategy(
{
authorizationURL: endpoints.authorizationURL,
tokenURL: endpoints.tokenURL,
clientID: env.OIDC_CLIENT_ID!,
clientSecret: env.OIDC_CLIENT_SECRET!,
callbackURL: `${env.URL}/auth/${config.id}.callback`,
passReqToCallback: true,
scope: env.OIDC_SCOPES,
// @ts-expect-error custom state store
store: new StateStore(endpoints.pkce),
state: true,
pkce: endpoints.pkce ?? false,
},
// OpenID Connect standard profile claims can be found in the official
// specification.
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
// Non-standard claims may be configured by individual identity providers.
// Any claim supplied in response to the userinfo request will be
// available on the `profile` parameter
async function (
req: Request,
accessToken: string,
refreshToken: string,
params: { expires_in: number; id_token: string; scope?: string },
_profile: unknown,
done: (
err: Error | null,
user: User | null,
result?: AuthenticationResult
) => void
) {
const context = req.ctx;
try {
// Some providers require a POST request to the userinfo endpoint, add them as exceptions here.
const usePostMethod = [
"https://api.dropboxapi.com/2/openid/userinfo",
];
const profile = await request(
usePostMethod.includes(endpoints.userInfoURL) ? "POST" : "GET",
endpoints.userInfoURL,
accessToken
);
const profile = await request(
usePostMethod.includes(endpoints.userInfoURL) ? "POST" : "GET",
endpoints.userInfoURL,
accessToken
);
// Some providers, namely ADFS, don't provide anything more than the `sub` claim in the userinfo endpoint
// So, we'll decode the params.id_token and see if that contains what we need.
const token = (() => {
try {
const decoded = JWT.decode(params.id_token);
// Some providers, namely ADFS, don't provide anything more than the `sub` claim in the userinfo endpoint
// So, we'll decode the params.id_token and see if that contains what we need.
const token = (() => {
try {
const decoded = JWT.decode(params.id_token);
if (!decoded || typeof decoded !== "object") {
Logger.warn("Decoded id_token is not a valid object");
if (!decoded || typeof decoded !== "object") {
Logger.warn("Decoded id_token is not a valid object");
return {};
}
return decoded as {
email?: string;
email_verified?: boolean | string;
preferred_username?: string;
sub?: string;
};
} catch (err) {
Logger.error("id_token decode threw error: ", toError(err));
return {};
}
})();
return decoded as {
email?: string;
email_verified?: boolean | string;
preferred_username?: string;
sub?: string;
};
} catch (err) {
Logger.error("id_token decode threw error: ", toError(err));
return {};
}
})();
const email = profile.email ?? token.email ?? null;
const email = profile.email ?? token.email ?? null;
if (!email) {
throw AuthenticationError(
`An email field was not returned in the profile or id_token parameter, but is required.`
);
}
// The email_verified claim is part of the OIDC standard claims.
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
const emailVerifiedClaim =
profile.email_verified ?? token.email_verified;
const emailVerified =
emailVerifiedClaim === undefined
? undefined
: emailVerifiedClaim === true || emailVerifiedClaim === "true";
const team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
const user =
context.state?.auth?.user ?? (await getUserFromOAuthState(context));
const { domain } = parseEmail(email);
// Only a single OIDC provider is supported – find the existing, if any.
const authenticationProvider = team
? ((await AuthenticationProvider.findOne({
where: {
name: "oidc",
teamId: team.id,
providerId: domain,
},
})) ??
(await AuthenticationProvider.findOne({
where: {
name: "oidc",
teamId: team.id,
},
})))
: undefined;
// Derive a providerId from the OIDC location if there is no existing provider.
const oidcURL = new URL(endpoints.authorizationURL);
const providerId =
authenticationProvider?.providerId ?? oidcURL.hostname;
if (!domain) {
throw OIDCMalformedUserInfoError();
}
// remove the TLD and form a subdomain from the remaining
const subdomain = slugifyDomain(domain);
// Claim name can be overriden using an env variable.
// Default is 'preferred_username' as per OIDC spec.
// This will default to the profile.preferred_username, but will fall back to preferred_username from the id_token
const username =
get(profile, env.OIDC_USERNAME_CLAIM) ??
get(token, env.OIDC_USERNAME_CLAIM);
const name = profile.name || username || profile.username;
const profileId = profile.sub ?? token.sub ?? profile.id;
if (!name) {
throw AuthenticationError(
`Neither a ${env.OIDC_USERNAME_CLAIM}, "name" or "username" was returned in the profile loaded from ${endpoints.userInfoURL}, but at least one is required.`
);
}
if (!profileId) {
throw AuthenticationError(
`A user id was not returned in the profile loaded from ${endpoints.userInfoURL}, searched in "sub" and "id" fields.`
);
}
// Check if the picture field is a Base64 data URL and filter it out
// to avoid validation errors in the User model
let avatarUrl = profile.picture;
if (profile.picture && isBase64Url(profile.picture)) {
Logger.debug(
"authentication",
"Filtering out Base64 data URL from avatar",
{
email,
}
);
avatarUrl = null;
}
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: env.APP_NAME,
domain,
subdomain,
},
user: {
name,
email,
emailVerified,
avatarUrl,
},
authenticationProvider: {
name: config.id,
providerId,
},
authentication: {
providerId: profileId,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: params.scope ? params.scope.split(" ") : scopes,
},
});
// Persist the id_token so a later RP-initiated logout can pass it as
// the `id_token_hint`, allowing the provider to scope the logout to
// this session rather than terminating its global SSO session. The
// token is stored server-side keyed by a short session identifier;
// only that identifier goes in the cookie.
if (endpoints.logoutURL && params.id_token) {
try {
const sessionId = crypto.randomBytes(16).toString("hex");
await Redis.defaultClient.set(
RedisPrefixHelper.getLogoutTokenKey(sessionId),
params.id_token,
"EX",
OIDC_LOGOUT_TOKEN_TTL_SECONDS
if (!email) {
throw AuthenticationError(
`An email field was not returned in the profile or id_token parameter, but is required.`
);
context.cookies.set(OIDC_SESSION_COOKIE, sessionId, {
httpOnly: true,
sameSite: "lax",
secure: env.isProduction,
path: OIDC_LOGOUT_PATH,
domain: getCookieDomain(
context.request.hostname,
env.isCloudHosted
),
expires: addSeconds(new Date(), OIDC_LOGOUT_TOKEN_TTL_SECONDS),
});
} catch (err) {
Logger.warn("Failed to persist OIDC logout token hint", {
error: toError(err).message,
});
}
}
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
// The email_verified claim is part of the OIDC standard claims.
// https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
const emailVerifiedClaim =
profile.email_verified ?? token.email_verified;
const emailVerified =
emailVerifiedClaim === undefined
? undefined
: emailVerifiedClaim === true || emailVerifiedClaim === "true";
const team = await getTeamFromContext(context);
const client = getClientFromOAuthState(context);
const user =
context.state?.auth?.user ??
(await getUserFromOAuthState(context));
const { domain } = parseEmail(email);
// Only a single OIDC provider is supported – find the existing, if any.
const authenticationProvider = team
? ((await AuthenticationProvider.findOne({
where: {
name: "oidc",
teamId: team.id,
providerId: domain,
},
})) ??
(await AuthenticationProvider.findOne({
where: {
name: "oidc",
teamId: team.id,
},
})))
: undefined;
// Derive a providerId from the OIDC location if there is no existing provider.
const oidcURL = new URL(endpoints.authorizationURL);
const providerId =
authenticationProvider?.providerId ?? oidcURL.hostname;
if (!domain) {
throw OIDCMalformedUserInfoError();
}
// remove the TLD and form a subdomain from the remaining
const subdomain = slugifyDomain(domain);
// Claim name can be overriden using an env variable.
// Default is 'preferred_username' as per OIDC spec.
// This will default to the profile.preferred_username, but will fall back to preferred_username from the id_token
const username =
get(profile, env.OIDC_USERNAME_CLAIM) ??
get(token, env.OIDC_USERNAME_CLAIM);
const name = profile.name || username || profile.username;
const profileId = profile.sub ?? token.sub ?? profile.id;
if (!name) {
throw AuthenticationError(
`Neither a ${env.OIDC_USERNAME_CLAIM}, "name" or "username" was returned in the profile loaded from ${endpoints.userInfoURL}, but at least one is required.`
);
}
if (!profileId) {
throw AuthenticationError(
`A user id was not returned in the profile loaded from ${endpoints.userInfoURL}, searched in "sub" and "id" fields.`
);
}
// Check if the picture field is a Base64 data URL and filter it out
// to avoid validation errors in the User model
let avatarUrl = profile.picture;
if (profile.picture && isBase64Url(profile.picture)) {
Logger.debug(
"authentication",
"Filtering out Base64 data URL from avatar",
{
email,
}
);
avatarUrl = null;
}
const ctx = createContext({
ip: context.ip,
user,
authType: context.state?.auth?.type,
});
const result = await accountProvisioner(ctx, {
team: {
teamId: team?.id,
name: env.APP_NAME,
domain,
subdomain,
},
user: {
name,
email,
emailVerified,
avatarUrl,
},
authenticationProvider: {
name: config.id,
providerId,
},
authentication: {
providerId: profileId,
accessToken,
refreshToken,
expiresIn: params.expires_in,
scopes: params.scope ? params.scope.split(" ") : scopes,
},
});
// Persist the id_token so a later RP-initiated logout can pass it as
// the `id_token_hint`, allowing the provider to scope the logout to
// this session rather than terminating its global SSO session. The
// token is stored server-side keyed by a short session identifier;
// only that identifier goes in the cookie. id_tokens can be large and
// storing one directly in the cookie inflates response headers enough
// to exceed reverse proxy buffers, resulting in a 502 on sign-in.
// This is best-effort: a Redis failure must not block sign-in, the
// logout simply falls back to omitting the `id_token_hint`.
if (endpoints.logoutURL && params.id_token) {
try {
const sessionId = crypto.randomBytes(16).toString("hex");
await Redis.defaultClient.set(
RedisPrefixHelper.getLogoutTokenKey(sessionId),
params.id_token,
"EX",
OIDC_LOGOUT_TOKEN_TTL_SECONDS
);
context.cookies.set(OIDC_SESSION_COOKIE, sessionId, {
httpOnly: true,
sameSite: "lax",
secure: env.isProduction,
path: OIDC_LOGOUT_PATH,
domain: getCookieDomain(
context.request.hostname,
env.isCloudHosted
),
expires: addSeconds(
new Date(),
OIDC_LOGOUT_TOKEN_TTL_SECONDS
),
});
} catch (err) {
Logger.warn("Failed to persist OIDC logout token hint", {
error: toError(err).message,
});
}
}
return done(null, result.user, { ...result, client });
} catch (err) {
return done(toError(err), null);
}
}
}
)
)
);
+2 -1
View File
@@ -24,6 +24,7 @@ import {
AuthenticationProvider,
Comment,
} from "@server/models";
import { SearchQuerySource } from "@server/models/SearchQuery";
import SearchProviderManager from "@server/utils/SearchProviderManager";
import { can } from "@server/policies";
import type { APIContext } from "@server/types";
@@ -245,7 +246,7 @@ router.post(
await SearchQuery.create({
userId: user ? user.id : null,
teamId: user.teamId,
source: "slack",
source: SearchQuerySource.Slack,
query: text,
results: total,
});
+2 -1
View File
@@ -27,6 +27,7 @@ import {
getUserFromOAuthState,
StateStore,
startOAuthFlow,
withProxyAgent,
} from "@server/utils/passport";
import { parseEmail } from "@shared/utils/email";
import env from "../env";
@@ -137,7 +138,7 @@ if (env.SLACK_CLIENT_ID && env.SLACK_CLIENT_SECRET) {
// For some reason the author made the strategy name capatilised, I don't know
// why but we need everything lowercase so we just monkey-patch it here.
strategy.name = providerName;
passport.use(strategy);
passport.use(withProxyAgent(strategy));
router.get("slack", startOAuthFlow, passport.authenticate(providerName));
router.get("slack.callback", passportMiddleware(providerName));
+105
View File
@@ -3,6 +3,7 @@ import { readFile } from "node:fs/promises";
import path from "node:path";
import FormData from "form-data";
import { ensureDirSync } from "fs-extra";
import JWT from "jsonwebtoken";
import { FileOperationState, FileOperationType } from "@shared/types";
import env from "@server/env";
import AttachmentHelper, {
@@ -194,6 +195,110 @@ describe("#files.create", () => {
existsSync(path.join(env.FILE_STORAGE_LOCAL_ROOT_DIR, attachment.key))
).toBe(true);
});
it("should succeed with a valid upload signature and no session", async () => {
const user = await buildUser();
const fileName = "images.docx";
const attachment = await buildAttachment(
{
teamId: user.teamId,
userId: user.id,
contentType:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
},
fileName
);
const sig = JWT.sign(
{ key: attachment.key, type: "attachment-upload" },
env.SECRET_KEY,
{ expiresIn: 3600 }
);
const content = await readFile(
path.resolve(__dirname, "..", "test", "fixtures", fileName)
);
const form = new FormData();
form.append("key", attachment.key);
form.append("file", content, fileName);
form.append("sig", sig);
const res = await server.post(`/api/files.create`, {
headers: form.getHeaders(),
body: form,
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.success).toEqual(true);
expect(
existsSync(path.join(env.FILE_STORAGE_LOCAL_ROOT_DIR, attachment.key))
).toBe(true);
});
it("should fail with a signature scoped to a different key", async () => {
const user = await buildUser();
const fileName = "images.docx";
const attachment = await buildAttachment(
{
teamId: user.teamId,
userId: user.id,
contentType:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
},
fileName
);
const sig = JWT.sign(
{ key: "public/foo/bar/other.png", type: "attachment-upload" },
env.SECRET_KEY,
{ expiresIn: 3600 }
);
const content = await readFile(
path.resolve(__dirname, "..", "test", "fixtures", fileName)
);
const form = new FormData();
form.append("key", attachment.key);
form.append("file", content, fileName);
form.append("sig", sig);
const res = await server.post(`/api/files.create`, {
headers: form.getHeaders(),
body: form,
});
expect(res.status).toEqual(401);
expect(
existsSync(path.join(env.FILE_STORAGE_LOCAL_ROOT_DIR, attachment.key))
).toBe(false);
});
it("should fail with status 401 when neither session nor signature is provided", async () => {
const user = await buildUser();
const fileName = "images.docx";
const attachment = await buildAttachment(
{
teamId: user.teamId,
userId: user.id,
contentType:
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
},
fileName
);
const content = await readFile(
path.resolve(__dirname, "..", "test", "fixtures", fileName)
);
const form = new FormData();
form.append("key", attachment.key);
form.append("file", content, fileName);
const res = await server.post(`/api/files.create`, {
headers: form.getHeaders(),
body: form,
});
expect(res.status).toEqual(401);
});
});
describe("#files.get", () => {
+33 -3
View File
@@ -30,7 +30,7 @@ const router = new Router();
router.post(
"files.create",
rateLimiter(RateLimiterStrategy.TwentyFivePerMinute),
auth(),
auth({ optional: true }),
validate(T.FilesCreateSchema),
timeout(30 * 60 * 1000), // 30 minutes for large file uploads
multipart({
@@ -41,19 +41,27 @@ router.post(
}),
async (ctx: APIContext<T.FilesCreateReq>) => {
const actor = ctx.state.auth.user;
const { key } = ctx.input.body;
const { key, sig } = ctx.input.body;
const file = ctx.input.file;
if (!file) {
throw ValidationError("Request must include a file parameter");
}
// A short-lived signature authorizes the upload to this key without a session.
if (sig) {
verifyUploadSignature(sig, key);
} else if (!actor) {
throw AuthenticationError("Authentication required");
}
const attachment = await Attachment.findOne({
where: { key },
rejectOnEmpty: true,
});
if (attachment.userId !== actor.id) {
// For session-based uploads, ensure the attachment belongs to the actor.
if (!sig && actor && attachment.userId !== actor.id) {
throw AuthorizationError("Invalid key");
}
@@ -186,6 +194,28 @@ function getByteRange(
return { start, end };
}
/**
* Verifies a short-lived signature authorizing an upload to a single key.
*
* @param sig The signature to verify.
* @param key The key the upload is being made to.
* @throws AuthenticationError if the signature is invalid, expired, or scoped
* to a different key.
*/
function verifyUploadSignature(sig: string, key: string) {
const payload = getJWTPayload(sig);
if (payload.type !== "attachment-upload" || payload.key !== key) {
throw AuthenticationError("Invalid signature");
}
try {
JWT.verify(sig, env.SECRET_KEY);
} catch (_err) {
throw AuthenticationError("Invalid signature");
}
}
function getKeyFromContext(ctx: APIContext<T.FilesGetReq>): string {
const { key, sig } = ctx.input.query;
if (sig) {
+1
View File
@@ -9,6 +9,7 @@ export const FilesCreateSchema = z.object({
.string()
.refine(ValidateKey.isValid, { message: ValidateKey.message })
.transform(ValidateKey.sanitize),
sig: z.string().optional(),
}),
file: z.custom<formidable.File>().optional(),
});
@@ -0,0 +1,16 @@
"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.sequelize.query(
"ALTER TYPE enum_search_queries_source ADD VALUE 'mcp'"
);
},
async down(queryInterface, Sequelize) {
// Note: PostgreSQL doesn't support removing enum values easily
// This would require recreating the enum type and updating all references
throw new Error("Cannot rollback adding enum value to PostgreSQL");
},
};
+75 -1
View File
@@ -1,4 +1,4 @@
import { EmptyResultError } from "sequelize";
import { EmptyResultError, Op } from "sequelize";
import { CollectionPermission } from "@shared/types";
import slugify from "@shared/utils/slugify";
import { parser } from "@server/editor";
@@ -181,6 +181,80 @@ describe("#findAllChildDocumentIds", () => {
expect(results[0]).toBe(document2.id);
expect(results[1]).toBe(document3.id);
});
test("should apply where filter and prune unmatched branches", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const document = await buildDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
title: "test",
});
const publishedChild = await buildDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
parentDocumentId: document.id,
title: "published",
});
// A draft (unpublished) child, with its own nested child.
const draftChild = await buildDraftDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
parentDocumentId: document.id,
title: "draft",
});
await buildDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
parentDocumentId: draftChild.id,
title: "published under draft",
});
const results = await document.findAllChildDocumentIds({
publishedAt: {
[Op.ne]: null,
},
});
// Only the published child is returned; the draft branch is pruned so its
// descendants are not traversed.
expect(results).toEqual([publishedChild.id]);
});
test("should include soft-deleted children when paranoid is false", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const document = await buildDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
title: "test",
});
const child = await buildDocument({
userId: user.id,
teamId: team.id,
collectionId: collection.id,
parentDocumentId: document.id,
title: "child",
});
await child.destroy();
expect(await document.findAllChildDocumentIds()).toEqual([]);
expect(
await document.findAllChildDocumentIds(undefined, { paranoid: false })
).toEqual([child.id]);
});
});
describe("#findByPk", () => {
+53 -25
View File
@@ -10,7 +10,13 @@ import type {
FindOptions,
WhereOptions,
} from "sequelize";
import { Transaction, Op, EmptyResultError, Sequelize } from "sequelize";
import {
Transaction,
Op,
EmptyResultError,
Sequelize,
QueryTypes,
} from "sequelize";
import {
ForeignKey,
BelongsTo,
@@ -96,6 +102,16 @@ type AdditionalFindOptions = {
rejectOnEmpty?: boolean | Error;
};
/** Sequelize types the query generator as unknown; this narrows to the single
* method used to build a raw SQL filter fragment. */
interface QueryGeneratorWithWhere {
getWhereConditions(
where: WhereOptions<Document>,
tableName: string,
factory: typeof Document
): string;
}
// @ts-expect-error Type 'Literal' is not assignable to type 'string | ProjectionAlias'.
@DefaultScope(() => ({
include: [
@@ -984,34 +1000,46 @@ class Document extends ArchivableModel<
where?: Omit<WhereOptions<Document>, "parentDocumentId">,
options?: FindOptions<Document>
): Promise<string[]> => {
const findAllChildDocumentIds = async (
...parentDocumentId: string[]
): Promise<string[]> => {
// Unscoped as this method only ever reads the id column
const childDocuments = await (this.constructor as typeof Document)
.unscoped()
.findAll({
attributes: ["id"],
where: {
parentDocumentId,
...where,
},
...options,
});
const model = this.constructor as typeof Document;
const queryGenerator = this.sequelize!.getQueryInterface()
.queryGenerator as QueryGeneratorWithWhere;
const childDocumentIds = childDocuments.map((doc) => doc.id);
const paranoid = options?.paranoid ?? true;
const whereConditions = queryGenerator.getWhereConditions(
{ ...(paranoid ? { deletedAt: null } : {}), ...where },
"documents",
model
);
const anchorFilter = whereConditions ? `AND (${whereConditions})` : "";
const recursiveFilter = whereConditions ? `WHERE (${whereConditions})` : "";
if (childDocumentIds.length > 0) {
return [
...childDocumentIds,
...(await findAllChildDocumentIds(...childDocumentIds)),
];
// A single recursive CTE walks the entire subtree in one round-trip rather
// than issuing one query per level of nesting (N+1). Rows are ordered by
// depth to ensure breadth-first result ordering. UNION ALL is safe as the
// tree is acyclic, so each descendant id is reached exactly once.
const rows = await this.sequelize!.query<{ id: string }>(
`
WITH RECURSIVE children AS (
SELECT documents.id, 1 AS depth
FROM documents
WHERE documents."parentDocumentId" = :parentDocumentId
${anchorFilter}
UNION ALL
SELECT documents.id, children.depth + 1
FROM documents
INNER JOIN children ON documents."parentDocumentId" = children.id
${recursiveFilter}
)
SELECT id FROM children ORDER BY depth
`,
{
replacements: { parentDocumentId: this.id },
transaction: options?.transaction,
type: QueryTypes.SELECT,
}
);
return childDocumentIds;
};
return findAllChildDocumentIds(this.id);
return rows.map((row) => row.id);
};
publish = async (
+5 -3
View File
@@ -15,14 +15,16 @@ const dayStr = (d: Date) => format(d, "yyyy-MM-dd");
describe("DocumentInsight.rollupPeriod", () => {
it("writes nothing when no source activity exists in the window", async () => {
const team = await buildTeam();
await buildDocument({ teamId: team.id });
const document = await buildDocument({ teamId: team.id });
// Scope the partition to just this document so the global rollup count
// isn't affected by activity from other tests sharing the database.
const upserted = await DocumentInsight.rollupPeriod({
periodStart: dayStr(subDays(new Date(), 1)),
intervalDays: 1,
period: DocumentInsightPeriod.Day,
startUuid: FULL_UUID_RANGE[0],
endUuid: FULL_UUID_RANGE[1],
startUuid: document.id,
endUuid: document.id,
});
expect(upserted).toBe(0);
+168
View File
@@ -0,0 +1,168 @@
import { buildTeam, buildUser } from "@server/test/factories";
import SearchQuery, { SearchQuerySource } from "./SearchQuery";
describe("SearchQuery.record", () => {
it("updates the existing record when a query extends a recent one", async () => {
const user = await buildUser();
const teamId = user.teamId;
const first = await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conf",
results: 3,
duration: 10,
});
const second = await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conflue",
results: 5,
duration: 12,
});
expect(second.id).toEqual(first.id);
expect(second.query).toEqual("conflue");
expect(second.results).toEqual(5);
expect(await SearchQuery.count({ where: { teamId } })).toEqual(1);
});
it("updates the existing record when a query is shortened", async () => {
const user = await buildUser();
const teamId = user.teamId;
const first = await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conflue",
results: 5,
duration: 12,
});
const second = await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conf",
results: 3,
duration: 10,
});
expect(second.id).toEqual(first.id);
expect(second.query).toEqual("conf");
expect(await SearchQuery.count({ where: { teamId } })).toEqual(1);
});
it("creates a new record for an unrelated query", async () => {
const user = await buildUser();
const teamId = user.teamId;
await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conflue",
results: 5,
duration: 12,
});
await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "database",
results: 2,
duration: 8,
});
expect(await SearchQuery.count({ where: { teamId } })).toEqual(2);
});
it("does not collapse queries from different scopes", async () => {
const team = await buildTeam();
const userA = await buildUser({ teamId: team.id });
const userB = await buildUser({ teamId: team.id });
await SearchQuery.record({
userId: userA.id,
teamId: team.id,
source: SearchQuerySource.App,
query: "conf",
results: 1,
duration: 5,
});
await SearchQuery.record({
userId: userB.id,
teamId: team.id,
source: SearchQuerySource.App,
query: "conflue",
results: 1,
duration: 5,
});
expect(await SearchQuery.count({ where: { teamId: team.id } })).toEqual(2);
});
it("does not collapse when there is no user or share to scope by", async () => {
const team = await buildTeam();
await SearchQuery.record({
teamId: team.id,
source: SearchQuerySource.API,
query: "conf",
results: 1,
duration: 5,
});
await SearchQuery.record({
teamId: team.id,
source: SearchQuerySource.API,
query: "conflue",
results: 1,
duration: 5,
});
expect(await SearchQuery.count({ where: { teamId: team.id } })).toEqual(2);
});
it("creates a new record once the recency window has passed", async () => {
const user = await buildUser();
const teamId = user.teamId;
const first = await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conf",
results: 1,
duration: 5,
});
// Backdate the first record beyond the recency window.
await SearchQuery.sequelize!.query(
`UPDATE search_queries SET "createdAt" = :createdAt WHERE id = :id`,
{
replacements: {
createdAt: new Date(Date.now() - SearchQuery.recencyWindow - 1000),
id: first.id,
},
}
);
await SearchQuery.record({
userId: user.id,
teamId,
source: SearchQuerySource.App,
query: "conflue",
results: 1,
duration: 5,
});
expect(await SearchQuery.count({ where: { teamId } })).toEqual(2);
});
});
+82 -2
View File
@@ -1,3 +1,4 @@
import { Op } from "sequelize";
import type { InferAttributes, InferCreationAttributes } from "sequelize";
import {
Table,
@@ -10,12 +11,24 @@ import {
DataType,
Default,
} from "sequelize-typescript";
import { Second } from "@shared/utils/time";
import Share from "@server/models/Share";
import Team from "@server/models/Team";
import User from "@server/models/User";
import Model from "@server/models/base/Model";
import Fix from "./decorators/Fix";
/**
* Where a search query originated.
*/
export enum SearchQuerySource {
Slack = "slack",
App = "app",
API = "api",
OAuth = "oauth",
MCP = "mcp",
}
@Table({
tableName: "search_queries",
modelName: "search_query",
@@ -26,6 +39,73 @@ class SearchQuery extends Model<
InferAttributes<SearchQuery>,
Partial<InferCreationAttributes<SearchQuery>>
> {
/**
* The window during which a follow-up query for the same scope is treated as
* a continuation of the same "search as you type" session rather than a new
* search.
*/
public static recencyWindow = Second.ms * 30;
/**
* Records a search query, collapsing rapid "search as you type" keystrokes
* into a single record. If a query was recorded for the same scope within the
* recency window and one query is a prefix of the other (i.e. the visitor kept
* typing or edited their term), the existing record is updated in place rather
* than inserting a new row.
*
* @param attrs the attributes of the search to record.
* @returns the created or updated search query record.
*/
public static async record(attrs: {
userId?: string | null;
teamId: string;
shareId?: string | null;
source: SearchQuerySource;
query: string;
results: number;
duration: number;
}): Promise<SearchQuery> {
const { userId, teamId, shareId, source, query, results, duration } = attrs;
// Without a user or share to scope by, collapsing would merge unrelated
// searches across the team, so only ever record a new row.
const existing =
userId || shareId
? await this.findOne({
where: {
teamId,
userId: userId ?? null,
shareId: shareId ?? null,
source,
createdAt: {
[Op.gte]: new Date(Date.now() - SearchQuery.recencyWindow),
},
},
order: [["createdAt", "DESC"]],
})
: null;
if (
existing &&
(query.startsWith(existing.query) || existing.query.startsWith(query))
) {
existing.query = query;
existing.results = results;
existing.duration = duration;
return existing.save();
}
return this.create({
userId,
teamId,
shareId,
source,
query,
results,
duration,
});
}
@IsUUID(4)
@PrimaryKey
@Default(DataType.UUIDV4)
@@ -38,8 +118,8 @@ class SearchQuery extends Model<
/**
* Where the query originated.
*/
@Column(DataType.ENUM("slack", "app", "api", "oauth"))
source: string;
@Column(DataType.ENUM(...Object.values(SearchQuerySource)))
source: SearchQuerySource;
/**
* The number of results returned for this query.
+4 -1
View File
@@ -1041,7 +1041,10 @@ More install detail.
Usage instructions here.`,
});
const result = DocumentHelper.getAnchorContent(document, "h-installation");
const result = DocumentHelper.getAnchorContent(
document,
"h-installation"
);
expect(result).toBe(
`## Installation
+6 -2
View File
@@ -63,6 +63,7 @@ import {
GroupMembership,
FileOperation,
} from "@server/models";
import { SearchQuerySource } from "@server/models/SearchQuery";
import AttachmentHelper from "@server/models/helpers/AttachmentHelper";
import { DocumentHelper } from "@server/models/helpers/DocumentHelper";
import { ProsemirrorHelper } from "@server/models/helpers/ProsemirrorHelper";
@@ -1173,11 +1174,14 @@ router.post(
// duplicate search query records
if (query && offset === 0) {
const duration = Date.now() - searchStartedAt;
await SearchQuery.create({
await SearchQuery.record({
userId: user?.id,
teamId,
shareId: share?.id,
source: ctx.state.auth.type || "app", // we'll consider anything that isn't "api" to be "app"
// auth.type values are a subset of search sources; unauthenticated share searches default to "app"
source:
(ctx.state.auth.type as unknown as SearchQuerySource) ||
SearchQuerySource.App,
query,
results: total,
duration,
+3 -2
View File
@@ -1,5 +1,6 @@
import type { User } from "@server/models";
import { SearchQuery } from "@server/models";
import { SearchQuerySource } from "@server/models/SearchQuery";
import { buildSearchQuery, buildUser } from "@server/test/factories";
import { getTestServer } from "@server/test/support";
@@ -25,7 +26,7 @@ describe("#searches.list", () => {
userId: user.id,
teamId: user.teamId,
query: "bar",
source: "api",
source: SearchQuerySource.API,
}),
]);
});
@@ -44,7 +45,7 @@ describe("#searches.list", () => {
it("should allow filtering by source", async () => {
const res = await server.post("/api/searches.list", user, {
body: {
source: "api",
source: SearchQuerySource.API,
},
});
const body = await res.json();
+3
View File
@@ -29,6 +29,9 @@ export const TemplatesListSchema = BaseSchema.extend({
body: TemplatesSortParamsSchema.extend({
/** Id of the collection to which the template belongs */
collectionId: z.string().uuid().optional(),
/** Search query to filter templates by title */
query: z.string().optional(),
}),
});
@@ -53,6 +53,32 @@ describe("#templates.list", () => {
expect(body.data[0].id).toEqual(template.id);
});
it("should filter templates by query", async () => {
const user = await buildUser();
const template = await buildTemplate({
userId: user.id,
teamId: user.teamId,
title: "Meeting notes",
});
await buildTemplate({
userId: user.id,
teamId: user.teamId,
title: "Project plan",
});
const res = await server.post("/api/templates.list", user, {
body: {
query: "meeting",
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.length).toEqual(1);
expect(body.data[0].id).toEqual(template.id);
expect(body.pagination.total).toEqual(1);
});
it("should require authentication", async () => {
const res = await server.post("/api/templates.list");
expect(res.status).toEqual(401);
+18 -3
View File
@@ -1,6 +1,6 @@
import Router from "koa-router";
import type { WhereOptions } from "sequelize";
import { Op } from "sequelize";
import { Op, Sequelize } from "sequelize";
import auth from "@server/middlewares/authentication";
import { rateLimiter } from "@server/middlewares/rateLimiter";
import { transaction } from "@server/middlewares/transaction";
@@ -72,7 +72,7 @@ router.post(
pagination(),
validate(T.TemplatesListSchema),
async (ctx: APIContext<T.TemplatesListReq>) => {
const { sort, direction, collectionId } = ctx.input.body;
const { sort, direction, collectionId, query } = ctx.input.body;
const { user } = ctx.state.auth;
const where: WhereOptions<Template> & {
[Op.and]: WhereOptions<Template>[];
@@ -109,6 +109,16 @@ router.post(
});
}
if (query) {
where[Op.and].push(
Sequelize.literal(
`unaccent(LOWER("template"."title")) like unaccent(LOWER(:query))`
)
);
}
const replacements = { query: `%${query}%` };
const [templates, total] = await Promise.all([
Template.scope([
"defaultScope",
@@ -117,11 +127,16 @@ router.post(
},
]).findAll({
where,
replacements,
order: [[sort, direction]],
offset: ctx.state.pagination.offset,
limit: ctx.state.pagination.limit,
}),
Template.count({ where }),
Template.count({
where,
// @ts-expect-error Types are incorrect for count
replacements,
}),
]);
const data = templates.map((template) => presentTemplate(template));
+5 -14
View File
@@ -1,5 +1,6 @@
import type { Blob } from "node:buffer";
import type { Readable } from "node:stream";
import { buffer } from "node:stream/consumers";
import type { PresignedPost } from "@aws-sdk/s3-presigned-post";
import { omit } from "es-toolkit/compat";
import { toError, errToString } from "@shared/utils/error";
@@ -141,20 +142,10 @@ export default abstract class BaseStorage {
*/
public async getFileBuffer(key: string) {
const stream = await this.getFileStream(key);
return new Promise<Buffer>((resolve, reject) => {
const chunks: Buffer[] = [];
if (!stream) {
return reject(new Error("No stream available"));
}
stream.on("data", (d) => {
chunks.push(d);
});
stream.once("end", () => {
resolve(Buffer.concat(chunks));
});
stream.once("error", reject);
});
if (!stream) {
throw new Error("No stream available");
}
return buffer(stream);
}
/**
+6
View File
@@ -23,6 +23,11 @@ export default class LocalStorage extends BaseStorage {
maxUploadSize: number,
contentType = "image"
): Promise<Partial<PresignedPost>> {
// A short-lived signature that authorizes uploading to this key only
const sig = JWT.sign({ key, type: "attachment-upload" }, env.SECRET_KEY, {
expiresIn: 3600,
});
return Promise.resolve({
url: this.getUrlForKey(key),
fields: {
@@ -30,6 +35,7 @@ export default class LocalStorage extends BaseStorage {
acl,
maxUploadSize: String(maxUploadSize),
contentType,
sig,
[CSRF.fieldName]: ctx.cookies.get(CSRF.cookieName) || "",
},
});
+2 -1
View File
@@ -52,6 +52,7 @@ import {
Template,
} from "@server/models";
import { RelationshipType } from "@server/models/Relationship";
import { SearchQuerySource } from "@server/models/SearchQuery";
import AttachmentHelper from "@server/models/helpers/AttachmentHelper";
import { hash } from "@server/utils/crypto";
import { OAuthInterface } from "@server/utils/oauth/OAuthInterface";
@@ -763,7 +764,7 @@ export async function buildSearchQuery(
}
if (!overrides.source) {
overrides.source = "app";
overrides.source = SearchQuerySource.App;
}
if (isNil(overrides.query)) {
+5 -1
View File
@@ -1,6 +1,10 @@
import { buildCollection, buildUser } from "@server/test/factories";
import { getTestServer } from "@server/test/support";
import { buildOAuthUser, callMcpTool, parseMcpListContent } from "@server/test/McpHelper";
import {
buildOAuthUser,
callMcpTool,
parseMcpListContent,
} from "@server/test/McpHelper";
const server = getTestServer();
+50 -1
View File
@@ -12,10 +12,16 @@ import {
Attachment,
Document,
GroupMembership,
SearchQuery,
UserMembership,
} from "@server/models";
import { SearchQuerySource } from "@server/models/SearchQuery";
import { getTestServer } from "@server/test/support";
import { buildOAuthUser, callMcpTool, parseMcpListContent } from "@server/test/McpHelper";
import {
buildOAuthUser,
callMcpTool,
parseMcpListContent,
} from "@server/test/McpHelper";
const server = getTestServer();
@@ -244,6 +250,49 @@ describe("list_documents", () => {
expect(ids).toContain(document.id);
});
it("records the search query with an mcp source", async () => {
const { user, accessToken } = await buildOAuthUser();
const collection = await buildCollection({
teamId: user.teamId,
userId: user.id,
});
await buildDocument({
teamId: user.teamId,
userId: user.id,
collectionId: collection.id,
title: "Metaphysics",
});
await callMcpTool(server, accessToken, "list_documents", {
query: "Metaphysics",
});
const searchQuery = await SearchQuery.findOne({
where: { teamId: user.teamId, userId: user.id },
});
expect(searchQuery?.source).toEqual(SearchQuerySource.MCP);
expect(searchQuery?.query).toEqual("Metaphysics");
});
it("does not record a search query when listing recent documents", async () => {
const { user, accessToken } = await buildOAuthUser();
const collection = await buildCollection({
teamId: user.teamId,
userId: user.id,
});
await buildDocument({
teamId: user.teamId,
userId: user.id,
collectionId: collection.id,
});
await callMcpTool(server, accessToken, "list_documents");
expect(await SearchQuery.count({ where: { teamId: user.teamId } })).toEqual(
0
);
});
});
describe("create_document", () => {
+25 -7
View File
@@ -9,7 +9,8 @@ import documentImporter from "@server/commands/documentImporter";
import documentMover from "@server/commands/documentMover";
import documentRestorer from "@server/commands/documentRestorer";
import documentUpdater from "@server/commands/documentUpdater";
import { Collection, Document, Template } from "@server/models";
import { Collection, Document, SearchQuery, Template } from "@server/models";
import { SearchQuerySource } from "@server/models/SearchQuery";
import { sequelize } from "@server/storage/database";
import { authorize, can } from "@server/policies";
import {
@@ -140,12 +141,29 @@ export function documentTools(server: McpServer, scopes: string[]) {
}
}
const { results } = await searchProvider.searchForUser(user, {
query,
collectionId,
offset: effectiveOffset,
limit: effectiveLimit,
});
const searchStartedAt = Date.now();
const { results, total } = await searchProvider.searchForUser(
user,
{
query,
collectionId,
offset: effectiveOffset,
limit: effectiveLimit,
}
);
// Only record the first page of results to avoid duplicate
// records as the client pages through results.
if (effectiveOffset === 0) {
await SearchQuery.record({
userId: user.id,
teamId: user.teamId,
source: SearchQuerySource.MCP,
query,
results: total,
duration: Date.now() - searchStartedAt,
});
}
const filteredResults = results.filter(
(result) => result.document.id !== exactMatch?.id
+36
View File
@@ -1,7 +1,9 @@
import crypto from "node:crypto";
import { addMinutes, subMinutes } from "date-fns";
import { HttpsProxyAgent } from "https-proxy-agent";
import type { JwtPayload } from "jsonwebtoken";
import type { Context, Next } from "koa";
import type { Strategy } from "@outlinewiki/koa-passport";
import type {
StateStoreStoreCallback,
StateStoreVerifyCallback,
@@ -11,6 +13,7 @@ import { errToString, toError } from "@shared/utils/error";
import { Client } from "@shared/types";
import { getCookieDomain, parseDomain } from "@shared/utils/domains";
import env from "@server/env";
import Logger from "@server/logging/Logger";
import { Team, User } from "@server/models";
import Redis from "@server/storage/redis";
import { InternalError, OAuthStateMismatchError } from "../errors";
@@ -94,6 +97,39 @@ export async function startOAuthFlow(ctx: Context, next: Next) {
return next();
}
/**
* Routes a passport OAuth2 strategy's outbound token and userinfo requests
* through the HTTPS proxy configured in the environment, when present.
*
* Passport OAuth2 strategies build their own HTTP client and do not honor the
* standard proxy environment variables, so the agent must be attached to the
* strategy's internal `_oauth2` client explicitly. This is a no-op when no
* proxy is configured.
*
* @param strategy the OAuth2-based passport strategy to configure.
* @returns the same strategy instance, for convenient chaining.
*/
export function withProxyAgent<T extends Strategy>(strategy: T): T {
const proxy = process.env.https_proxy ?? process.env.HTTPS_PROXY;
if (!proxy) {
return strategy;
}
// `_oauth2` is a private internal, so degrade gracefully if upstream removes it.
// @ts-expect-error _oauth2 is not part of the public strategy type
const client = strategy._oauth2;
if (typeof client?.setAgent !== "function") {
Logger.warn(
"Unable to apply HTTPS proxy to auth strategy; the OAuth2 client is not available",
{ strategy: strategy.name }
);
return strategy;
}
client.setAgent(new HttpsProxyAgent(proxy));
return strategy;
}
/**
* Passport OAuth state store backed by signed state and a CSRF nonce cookie.
*/
+7 -2
View File
@@ -1,6 +1,6 @@
import copy from "copy-to-clipboard";
import { CheckmarkIcon, CopyIcon } from "outline-icons";
import { useState, useRef, useCallback } from "react";
import { useState, useRef, useCallback, useEffect } from "react";
import {
HexColorInput,
HexAlphaColorPicker,
@@ -22,9 +22,14 @@ const DEFAULT_COLOR = "#7e3d3db3";
function ColorPicker({ activeColor, onSelect, alpha }: Props) {
const [color, setColor] = useState(activeColor || DEFAULT_COLOR);
const [copied, setCopied] = useState(false);
const theme = useTheme();
const wrapperRef = useRef<HTMLDivElement>(null);
const buttonRef = useRef<HTMLButtonElement>(null);
const theme = useTheme();
// Keep the internal color in sync when the active color is changed externally
useEffect(() => {
setColor(activeColor || DEFAULT_COLOR);
}, [activeColor]);
const applyColor = useCallback(
(newColor: string) => {
+3 -1
View File
@@ -100,7 +100,9 @@ const Image = (props: Props) => {
const widthStyle = isFullWidth
? { width: "var(--container-width)" }
: { width: width ? `min(${width}px, 100%)` : "auto" };
: width
? { ["--image-width"]: `${width}px` }
: { width: "auto" };
const handleImageTouchStart = (ev: React.TouchEvent<HTMLDivElement>) => {
const currentTime = Date.now();
+38 -10
View File
@@ -82,8 +82,7 @@ const mathStyle = (props: Props) => css`
.ProseMirror-focused {
border-radius: 2px;
outline: 2px solid
${props.readOnly ? "transparent" : props.theme.selected};
outline: none;
}
}
@@ -773,6 +772,19 @@ iframe.embed {
}
}
.image .image-wrapper,
.image .image-wrapper img {
width: var(--image-width, auto);
}
/* Inside auto-layout table cells the plain pixel width would expand the cell */
td .image .image-wrapper,
th .image .image-wrapper,
td .image .image-wrapper img,
th .image .image-wrapper img {
width: min(var(--image-width), 100%);
}
.image.placeholder,
.video.placeholder {
position: relative;
@@ -1205,7 +1217,7 @@ ${
text-decoration: underline 2px ${props.theme.commentMarkBackground};
transition: background 100ms ease-in-out;
&:hover, &.${EditorStyleHelper.commentHovered} {
&:hover {
${props.readOnly ? "cursor: var(--pointer);" : ""}
background: ${props.theme.commentMarkBackground};
@@ -1215,10 +1227,6 @@ ${
}
}
}
a.${EditorStyleHelper.commentHovered} ~ span.component-image div.image-wrapper {
outline: ${props.theme.commentedImageOutlineDark} solid 2px;
}
`
: `
.${EditorStyleHelper.comment} {
@@ -1231,6 +1239,7 @@ a.${EditorStyleHelper.commentHovered} ~ span.component-image div.image-wrapper {
.notice-block {
display: flex;
align-items: center;
position: relative;
background: ${transparentize(0.9, props.theme.noticeInfoBackground)};
border-left: 4px solid ${props.theme.noticeInfoBackground};
color: ${props.theme.noticeInfoText};
@@ -1360,10 +1369,25 @@ p {
min-height: 1.6em;
}
/* Make top-level paragraphs a positioning context so the comment gutter anchors
to them (flush with the content column) */
.ProseMirror > p {
position: relative;
}
.heading-content {
position: relative;
}
/* The heading is taller than the line, so pin the gutter vertically to center
its indicators against the text. Horizontal alignment is handled by the
gutter's own rule. */
.heading-content .${EditorStyleHelper.commentGutter} {
top: 0;
bottom: 0;
justify-content: center;
}
.heading-content a,
p a {
color: ${props.theme.text};
@@ -1773,7 +1797,8 @@ mark {
`
}
&:is(.code-active) + .mermaid-diagram-wrapper {
&:is(.code-active)
+ .mermaid-diagram-wrapper:not(.parse-error):not(.empty) {
cursor: zoom-in;
}
@@ -1789,7 +1814,7 @@ mark {
outline: none;
& + .mermaid-diagram-wrapper {
&:not(.empty) {
&:not(.parse-error):not(.empty) {
cursor: zoom-in;
}
outline: 2px solid ${props.theme.selected};
@@ -1802,7 +1827,7 @@ mark {
height: 0;
overflow: hidden;
& + .mermaid-diagram-wrapper {
& + .mermaid-diagram-wrapper:not(.parse-error):not(.empty) {
cursor: zoom-in;
}
}
@@ -2621,6 +2646,9 @@ li > .${EditorStyleHelper.toggleBlock} {
.${EditorStyleHelper.toggleBlock} {
display: flex;
/* Establish a positioning context so comment gutters on nested content anchor
here (flush with the content column) rather than the padded .ProseMirror. */
position: relative;
&:focus-within {
transition-delay: 0.1s;
+11 -3
View File
@@ -530,7 +530,11 @@ export default function Mermaid({
return this.getState(state)?.decorationSet;
},
handleKeyDown(view, event) {
if (event.key === "Enter" && isModKey(event) && !editor.props.readOnly) {
if (
event.key === "Enter" &&
isModKey(event) &&
!editor.props.readOnly
) {
const { selection } = view.state;
const isNodeSel = selection instanceof NodeSelection;
const isMermaidNode =
@@ -591,8 +595,12 @@ export default function Mermaid({
event.preventDefault();
if (isSelected || editor.props.readOnly) {
// Already selected or read-only, open lightbox
if (node && node.textContent.trim().length > 0) {
// Already selected or read-only, open lightbox unless the diagram
// failed to render (no valid image to show)
const hasError =
diagram.classList.contains("parse-error") ||
diagram.classList.contains("empty");
if (!hasError && node && node.textContent.trim().length > 0) {
editor.updateActiveLightboxImage(
LightboxImageFactory.createLightboxImage(view, nodePos)
);
+13
View File
@@ -6,10 +6,22 @@ const StorageKey = "frequent-code-languages";
const frequentLanguagesToGet = 5;
const frequentLanguagesToTrack = 10;
/**
* Describes a code language supported by the editor.
*/
type CodeLanguage = {
/** The language identifier used by Refractor for syntax highlighting. */
lang: string;
/** The human-readable label shown in the language selector. */
label: string;
/** Lazily loads the Refractor syntax definition for the language. */
loader?: () => Promise<RefractorSyntax>;
/**
* Whether this entry is a backwards-compatible alias for another language.
* Aliases remain resolvable for existing documents but are hidden from the
* language selector to avoid duplicate options.
*/
alias?: boolean;
};
/**
@@ -186,6 +198,7 @@ export const codeLanguages: Record<string, CodeLanguage> = {
mermaidjs: {
lang: "mermaid",
label: "Mermaid",
alias: true,
// @ts-expect-error Mermaid is not in types but exists
loader: () => import("refractor/lang/mermaid").then((m) => m.default),
},
+2 -2
View File
@@ -25,8 +25,8 @@ export class EditorStyleHelper {
static readonly comment = "comment-marker";
/** Applied to a comment mark to force its hover state (e.g. from the gutter) */
static readonly commentHovered = "comment-marker-hovered";
/** Container for the comment indicators shown in the gutter beside a line */
static readonly commentGutter = "comment-gutter";
// Multiplayer
+212 -210
View File
@@ -1582,10 +1582,10 @@ __metadata:
languageName: node
linkType: hard
"@braintree/sanitize-url@npm:^7.1.1":
version: 7.1.1
resolution: "@braintree/sanitize-url@npm:7.1.1"
checksum: 10c0/fdfc1759c4244e287693ce1e9d42d649423e7c203fdccf27a571f8951ddfe34baa5273b7e6a8dd3007d7676859c7a0a9819be0ab42a3505f8505ad0eefecf7c1
"@braintree/sanitize-url@npm:^7.1.2":
version: 7.1.2
resolution: "@braintree/sanitize-url@npm:7.1.2"
checksum: 10c0/62f2aa0cf58626e3880b2dc1025c42064b4639abd157ae4e1c35f4c2f5031e9273772046a423979845069c814e27ff818e8e669280dc53585e6f033d5b7a59cb
languageName: node
linkType: hard
@@ -1648,7 +1648,7 @@ __metadata:
languageName: node
linkType: hard
"@chevrotain/types@npm:~11.1.1":
"@chevrotain/types@npm:~11.1.2":
version: 11.1.2
resolution: "@chevrotain/types@npm:11.1.2"
checksum: 10c0/c0c4679a3d407df34e18d5adfa7ac599b4a2bfddbf68da6e43678b9b3e16ab911de7766b37b9fc466261c3dead3db1b620e2e344f800fa9f0f381720475eda8f
@@ -2802,24 +2802,24 @@ __metadata:
languageName: node
linkType: hard
"@mermaid-js/layout-elk@npm:^0.2.1":
version: 0.2.1
resolution: "@mermaid-js/layout-elk@npm:0.2.1"
"@mermaid-js/layout-elk@npm:^0.2.2":
version: 0.2.2
resolution: "@mermaid-js/layout-elk@npm:0.2.2"
dependencies:
d3: "npm:^7.9.0"
elkjs: "npm:^0.9.3"
peerDependencies:
mermaid: ^11.0.2
checksum: 10c0/3594aa2dde6f3f0243af0cfe6ea47dbee2b66276ef8c90e638114d78c9856f511e33e574b378005ab6dfb46eb5ed27fd1ab281641c6f90bfa431245acc57b498
checksum: 10c0/5cd6ab42326f307b48494dc30d2eebf6ef9821cdcbda3fa128f442d312166b7f2dd0abcff559899a0b29ee6993ede0afdeafc4e72a974fbb5ef5b71262b6bee7
languageName: node
linkType: hard
"@mermaid-js/parser@npm:^1.1.1":
version: 1.1.1
resolution: "@mermaid-js/parser@npm:1.1.1"
"@mermaid-js/parser@npm:^1.2.0":
version: 1.2.0
resolution: "@mermaid-js/parser@npm:1.2.0"
dependencies:
"@chevrotain/types": "npm:~11.1.1"
checksum: 10c0/66414d9d66f3a86a6751427cb8890a00beaaee2b7eba34c21b34b60cdaf9237d21e9b50b9bf1f560a01a600ee332d33b949fd8f12cbda3238aba50edc0dfdf15
"@chevrotain/types": "npm:~11.1.2"
checksum: 10c0/907d41167b23160c88f292b0dd79162d2543445ecf1d784ed09747467705666669f818e3ab91e1182da2127720fb40cb707e6fd56e8a445020fd3e7b8b16f013
languageName: node
linkType: hard
@@ -4306,10 +4306,10 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/primitive@npm:1.1.4":
version: 1.1.4
resolution: "@radix-ui/primitive@npm:1.1.4"
checksum: 10c0/f366fa15b721a466ad78f9b5b966f7129fb6932f6f33ab117253ce8c6a13f4895dce4a1fd483d3f15859623d3bfd964a4b172fe1d6ccc3a1a3c4de4c2b861119
"@radix-ui/primitive@npm:1.1.5":
version: 1.1.5
resolution: "@radix-ui/primitive@npm:1.1.5"
checksum: 10c0/1d1ed3b1150ca2020f0b098bb7636357c122d775ec6b5ba5c8a04ea94dfcf6a5bddcd6cceeea7a63d2354489c8eeeb66828611f56eaa1682cb7b551429d083de
languageName: node
linkType: hard
@@ -4332,15 +4332,15 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-collapsible@npm:^1.1.15":
version: 1.1.15
resolution: "@radix-ui/react-collapsible@npm:1.1.15"
"@radix-ui/react-collapsible@npm:^1.1.16":
version: 1.1.16
resolution: "@radix-ui/react-collapsible@npm:1.1.16"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
"@radix-ui/react-use-layout-effect": "npm:1.1.2"
@@ -4354,16 +4354,16 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/b568f1cc583dbb6530caa9ffa8893f148661e5515964440b8392989f38e7d7e30c3594385768e374fb529f79e8793f8540e5fb647391205ed413e85e394608f2
checksum: 10c0/f04da7d653a54589ea76b9b44d1ec7bc1eee7c961f883d100c34f1de4fe3d2a43472d062f1c14ea8d98696bad9783f88ab2c7330400d7742c7e7e067bc246ef6
languageName: node
linkType: hard
"@radix-ui/react-collection@npm:1.1.11":
version: 1.1.11
resolution: "@radix-ui/react-collection@npm:1.1.11"
"@radix-ui/react-collection@npm:1.1.12":
version: 1.1.12
resolution: "@radix-ui/react-collection@npm:1.1.12"
dependencies:
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-slot": "npm:1.3.0"
peerDependencies:
@@ -4376,7 +4376,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/529325b57e5ec347c91d19e23e94bb0a78d01f8cf1f4f74bfc7683467656bb05f82b60e51937e7b17c89d58a129170e6825ce383dfc8408a1de9ae120cbdfe53
checksum: 10c0/2c8eb66bb32d03332ffa2ceedbb87aa75f208bd784457d50a70621952a45d454857a248ec8806fd6129d9048ceb3f9f410aed5fe8be6ae9978b2663f6d2a169e
languageName: node
linkType: hard
@@ -4393,13 +4393,13 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-context-menu@npm:^2.3.2":
version: 2.3.2
resolution: "@radix-ui/react-context-menu@npm:2.3.2"
"@radix-ui/react-context-menu@npm:^2.3.3":
version: 2.3.3
resolution: "@radix-ui/react-context-menu@npm:2.3.3"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-menu": "npm:2.1.19"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-menu": "npm:2.1.20"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
peerDependencies:
@@ -4412,36 +4412,36 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/ae423e564cdf03412e89ea4fb9b50c3b15a7b5048908b431ff3787744abb4f6ea72c9053c48ef36cb5cfeac10e6731da64d9170b2d18ef308d7b8762f0669cc0
checksum: 10c0/f0f4bbed3dcc185d5a9101c27227d1521fb612fdf97fee4dcd183b0b723dacc18acf6b38254b5e0ca94327753d14086e3041d48e74bcfd1ef66ed30263b88999
languageName: node
linkType: hard
"@radix-ui/react-context@npm:1.1.4":
version: 1.1.4
resolution: "@radix-ui/react-context@npm:1.1.4"
"@radix-ui/react-context@npm:1.2.0":
version: 1.2.0
resolution: "@radix-ui/react-context@npm:1.2.0"
peerDependencies:
"@types/react": "*"
react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc
peerDependenciesMeta:
"@types/react":
optional: true
checksum: 10c0/917be4dcb9fd9f465ab18f6982879daf83a5ca298a22504fa3bc4abd8dea963a57abb9ad38c099dd756ba2cddff0edde680bf8369012f44dedede20912702c8f
checksum: 10c0/54079fc32fd5b20434bb5d1447f318f914cab5c15b76e984df7b5787476a38460a6e0a04cbcdca847813060fa16f76eb1087b048c9ad461418642e2db4bbe075
languageName: node
linkType: hard
"@radix-ui/react-dialog@npm:^1.1.1, @radix-ui/react-dialog@npm:^1.1.18":
version: 1.1.18
resolution: "@radix-ui/react-dialog@npm:1.1.18"
"@radix-ui/react-dialog@npm:^1.1.1, @radix-ui/react-dialog@npm:^1.1.19":
version: 1.1.19
resolution: "@radix-ui/react-dialog@npm:1.1.19"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-dismissable-layer": "npm:1.1.14"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-dismissable-layer": "npm:1.1.15"
"@radix-ui/react-focus-guards": "npm:1.1.4"
"@radix-ui/react-focus-scope": "npm:1.1.11"
"@radix-ui/react-focus-scope": "npm:1.1.12"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-portal": "npm:1.1.13"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-slot": "npm:1.3.0"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
@@ -4457,7 +4457,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/679ffabf212dc481cfdeec114044b7ead8f3879ecc0e1c025025ec6dba303a824f6221dfe254eb94b4c7b31cfaf0d18be0047c65479608274b044e498b0fafca
checksum: 10c0/6f6defc2a690dc0124dd86793f168a58402a51e402104396fed2d0a5a607d02a6d30ef5bc137c420fc069e72e09f0e4c09b949a6bbf95b8d72e3777d145f586a
languageName: node
linkType: hard
@@ -4474,11 +4474,11 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-dismissable-layer@npm:1.1.14":
version: 1.1.14
resolution: "@radix-ui/react-dismissable-layer@npm:1.1.14"
"@radix-ui/react-dismissable-layer@npm:1.1.15":
version: 1.1.15
resolution: "@radix-ui/react-dismissable-layer@npm:1.1.15"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-callback-ref": "npm:1.1.2"
@@ -4493,19 +4493,19 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/371ec716e2029c503739a9efe2f85afca8d158474023a670fc546a1104824c5d78fcaba1484c652832fa006050fde2a8b52c851cd41d02cf8d564d8937aec027
checksum: 10c0/488870c8dd91e59bf7b838a69d285a651d9680a9af9ef314776e404ee97e6ed51a80389020de96a799941a3862e680d923f11f3c314aa9893e63568a2f68c3c6
languageName: node
linkType: hard
"@radix-ui/react-dropdown-menu@npm:^2.1.19":
version: 2.1.19
resolution: "@radix-ui/react-dropdown-menu@npm:2.1.19"
"@radix-ui/react-dropdown-menu@npm:^2.1.20":
version: 2.1.20
resolution: "@radix-ui/react-dropdown-menu@npm:2.1.20"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-menu": "npm:2.1.19"
"@radix-ui/react-menu": "npm:2.1.20"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
peerDependencies:
@@ -4518,7 +4518,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/901a290f3542163403dd6d5439cc43c37ee8e8b3949e3b017784660f6c5bf477165d9fb5f483f52fd5914d72aa84275778312502257ce045b8c6fd553f758234
checksum: 10c0/fd1a965b49d02845fc29c3717f8c8b1caa40fa156e16b7062ee8000ef5b971c828a7d8fcb9b847a5fbfee7c2243813d032b9aa145a2797536c1372404982b491
languageName: node
linkType: hard
@@ -4535,9 +4535,9 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-focus-scope@npm:1.1.11":
version: 1.1.11
resolution: "@radix-ui/react-focus-scope@npm:1.1.11"
"@radix-ui/react-focus-scope@npm:1.1.12":
version: 1.1.12
resolution: "@radix-ui/react-focus-scope@npm:1.1.12"
dependencies:
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-primitive": "npm:2.1.7"
@@ -4552,7 +4552,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/e773dfbe4c3907067db4d96082bf9a4dad730ad7396dc181f09fc79e054c4a7382dee6a3b948efef97904ae0387dc81b7733e479af69f5a22de2649c99847561
checksum: 10c0/3902835aab3915e52f58d74cc4796cc6892eaf4498f1780b06eed0d5d1b963d8a1100f7c760345df064efe748c4a2e15488d6bd0967b988b7713250f23c9532a
languageName: node
linkType: hard
@@ -4571,24 +4571,24 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-menu@npm:2.1.19":
version: 2.1.19
resolution: "@radix-ui/react-menu@npm:2.1.19"
"@radix-ui/react-menu@npm:2.1.20":
version: 2.1.20
resolution: "@radix-ui/react-menu@npm:2.1.20"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-collection": "npm:1.1.11"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-collection": "npm:1.1.12"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-dismissable-layer": "npm:1.1.14"
"@radix-ui/react-dismissable-layer": "npm:1.1.15"
"@radix-ui/react-focus-guards": "npm:1.1.4"
"@radix-ui/react-focus-scope": "npm:1.1.11"
"@radix-ui/react-focus-scope": "npm:1.1.12"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-popper": "npm:1.3.2"
"@radix-ui/react-popper": "npm:1.3.3"
"@radix-ui/react-portal": "npm:1.1.13"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-roving-focus": "npm:1.1.14"
"@radix-ui/react-roving-focus": "npm:1.1.15"
"@radix-ui/react-slot": "npm:1.3.0"
"@radix-ui/react-use-callback-ref": "npm:1.1.2"
aria-hidden: "npm:^1.2.4"
@@ -4603,22 +4603,22 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/25a625a2d0e08b60ce29c015f19c582e2729f25321c07b03b9b2ffe0a538628fbea50353f9d447077c3c224b09c21cda64d6e24e8cbbdb52d041b5cd6b0253ca
checksum: 10c0/7330cbbe52f0e11da77fd9246ec1705e02fa379275cd00813b0d66f9588c25c24b9041c2ebce1180b4c7db57658f84e0f35b26a64cb3351fb55dab0cc56def2e
languageName: node
linkType: hard
"@radix-ui/react-one-time-password-field@npm:^0.1.11":
version: 0.1.11
resolution: "@radix-ui/react-one-time-password-field@npm:0.1.11"
"@radix-ui/react-one-time-password-field@npm:^0.1.12":
version: 0.1.12
resolution: "@radix-ui/react-one-time-password-field@npm:0.1.12"
dependencies:
"@radix-ui/number": "npm:1.1.2"
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-collection": "npm:1.1.11"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-collection": "npm:1.1.12"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-roving-focus": "npm:1.1.14"
"@radix-ui/react-roving-focus": "npm:1.1.15"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
"@radix-ui/react-use-effect-event": "npm:0.0.3"
"@radix-ui/react-use-is-hydrated": "npm:0.1.1"
@@ -4633,24 +4633,24 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/99b2a29a81083e163c4dda5221399499d3f164c029d2fde0481307d523f7a57a3a70949995ae700b4c36c49c164f09942725912f9aac59e64be6b980be171c23
checksum: 10c0/4b8138ca7848680096a848e9d9768f19c92bab191359fc944e4e3d073305b29a7010129e2d2640385890d4ef9d072281200d19620f53bef1912132ee30429678
languageName: node
linkType: hard
"@radix-ui/react-popover@npm:^1.1.18":
version: 1.1.18
resolution: "@radix-ui/react-popover@npm:1.1.18"
"@radix-ui/react-popover@npm:^1.1.19":
version: 1.1.19
resolution: "@radix-ui/react-popover@npm:1.1.19"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-dismissable-layer": "npm:1.1.14"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-dismissable-layer": "npm:1.1.15"
"@radix-ui/react-focus-guards": "npm:1.1.4"
"@radix-ui/react-focus-scope": "npm:1.1.11"
"@radix-ui/react-focus-scope": "npm:1.1.12"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-popper": "npm:1.3.2"
"@radix-ui/react-popper": "npm:1.3.3"
"@radix-ui/react-portal": "npm:1.1.13"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-slot": "npm:1.3.0"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
@@ -4666,18 +4666,18 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/abcabc6ee2166a4729ea8698df65881fe18ddc279df967348400556257ba4d9dcd56efe61e1d447c9684319baacf61ff91005995c22d59f05f8d3553b177132c
checksum: 10c0/6f73aa4ca1bca46f5c16d2c381f72b320be5731c989b04478811b36ebd2694eedc34b71dc9b2c217cf7c720ee5c47f3f2556287eefa2dfa3e469cac0edb4521b
languageName: node
linkType: hard
"@radix-ui/react-popper@npm:1.3.2":
version: 1.3.2
resolution: "@radix-ui/react-popper@npm:1.3.2"
"@radix-ui/react-popper@npm:1.3.3":
version: 1.3.3
resolution: "@radix-ui/react-popper@npm:1.3.3"
dependencies:
"@floating-ui/react-dom": "npm:^2.0.0"
"@radix-ui/react-arrow": "npm:1.1.11"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-callback-ref": "npm:1.1.2"
"@radix-ui/react-use-layout-effect": "npm:1.1.2"
@@ -4694,7 +4694,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/84d6ed24c0fe36acecd09b7b8c3343eaa2bdc7500cf28dec18c8236d4ebb12d7df48df2b866232bd035ccbc42be57fff1144454ae9cab6a6a3a75b073e9d022d
checksum: 10c0/0567f64f146fbbb3b05cb69d03e21508feb9903d0401e3fa1c06a8320727668708c16444e0d84e57c74b3639c61ce04ec43083b310c0a8eaee579597d3e378d3
languageName: node
linkType: hard
@@ -4718,9 +4718,9 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-presence@npm:1.1.6":
version: 1.1.6
resolution: "@radix-ui/react-presence@npm:1.1.6"
"@radix-ui/react-presence@npm:1.1.7":
version: 1.1.7
resolution: "@radix-ui/react-presence@npm:1.1.7"
dependencies:
"@radix-ui/react-use-layout-effect": "npm:1.1.2"
peerDependencies:
@@ -4733,7 +4733,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/8b96ba32eae20162005f7e818b07e1e6e351da03f4753a79403ec58d27c4965e881a506960283fd7ded5b8ecf5ccb6a58bbc1d6799f5254a6cd4e5ae8837e345
checksum: 10c0/84184e64f718bd60cc5eb3e1dd4d178f238678887593073c172accee584403ea69e4854eaaf40c7bec0a82c3dd3252f86dce06796e085f0554a003fe105eb0f0
languageName: node
linkType: hard
@@ -4756,19 +4756,21 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-roving-focus@npm:1.1.14":
version: 1.1.14
resolution: "@radix-ui/react-roving-focus@npm:1.1.14"
"@radix-ui/react-roving-focus@npm:1.1.15":
version: 1.1.15
resolution: "@radix-ui/react-roving-focus@npm:1.1.15"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-collection": "npm:1.1.11"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-collection": "npm:1.1.12"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-callback-ref": "npm:1.1.2"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
"@radix-ui/react-use-is-hydrated": "npm:0.1.1"
"@radix-ui/react-use-layout-effect": "npm:1.1.2"
peerDependencies:
"@types/react": "*"
"@types/react-dom": "*"
@@ -4779,27 +4781,27 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/76be4ec8ba0c86b6115be02d2b5377af78f2871a323199887f1746ae5e7937656e9e4a79ceff08f4ee0984a222de5b343444d989e424ea56cf1a2a52cd8a6969
checksum: 10c0/2f6f3a87a123df24c9259f2cf2828762ba10fe700101495213bc328c09683f98d74386404ceefd7ad73094e0e212403bd227f948fd1f2268e1b5e4b107f1b48d
languageName: node
linkType: hard
"@radix-ui/react-select@npm:^2.3.2":
version: 2.3.2
resolution: "@radix-ui/react-select@npm:2.3.2"
"@radix-ui/react-select@npm:^2.3.3":
version: 2.3.3
resolution: "@radix-ui/react-select@npm:2.3.3"
dependencies:
"@radix-ui/number": "npm:1.1.2"
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-collection": "npm:1.1.11"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-collection": "npm:1.1.12"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-dismissable-layer": "npm:1.1.14"
"@radix-ui/react-dismissable-layer": "npm:1.1.15"
"@radix-ui/react-focus-guards": "npm:1.1.4"
"@radix-ui/react-focus-scope": "npm:1.1.11"
"@radix-ui/react-focus-scope": "npm:1.1.12"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-popper": "npm:1.3.2"
"@radix-ui/react-popper": "npm:1.3.3"
"@radix-ui/react-portal": "npm:1.1.13"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-slot": "npm:1.3.0"
"@radix-ui/react-use-callback-ref": "npm:1.1.2"
@@ -4819,7 +4821,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/959dc727e39e9c16582bb3cb6360cca0a3466dde064d096f67bcd66e03d257e7719f72b96be846a12c255fbf3f25aedc6eb4727f61ca914b3fcf51172331fffe
checksum: 10c0/2582e8777b40ff272145914203b3e4dbfe0ddd6e0c5289328bd6c8bddffdf4b46a703a4c2365fc213004cf896cb3db7d1aaef68ea624ca2e900951cd56fedb4b
languageName: node
linkType: hard
@@ -4857,13 +4859,13 @@ __metadata:
languageName: node
linkType: hard
"@radix-ui/react-switch@npm:^1.3.2":
version: 1.3.2
resolution: "@radix-ui/react-switch@npm:1.3.2"
"@radix-ui/react-switch@npm:^1.3.3":
version: 1.3.3
resolution: "@radix-ui/react-switch@npm:1.3.3"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
"@radix-ui/react-use-previous": "npm:1.1.2"
@@ -4878,21 +4880,21 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/94487d06b7a06fe4cb3acef303491d3ee31dc5aa4bd4ff2828b2b43654972e307ae69b13d35254f79bc42581e9f0f897254c2c0940a097dc66b601690630341e
checksum: 10c0/773763efb62a482f80366bdc3734d900085746c4f2fa9053dfe7554ee53ce858af1f249368edd397cb6d460a787c2aaefceccc1ce7f76cbdf5ad3219c8504e14
languageName: node
linkType: hard
"@radix-ui/react-tabs@npm:^1.1.16":
version: 1.1.16
resolution: "@radix-ui/react-tabs@npm:1.1.16"
"@radix-ui/react-tabs@npm:^1.1.17":
version: 1.1.17
resolution: "@radix-ui/react-tabs@npm:1.1.17"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-roving-focus": "npm:1.1.14"
"@radix-ui/react-roving-focus": "npm:1.1.15"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
peerDependencies:
"@types/react": "*"
@@ -4904,20 +4906,20 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/916016bad44e18f450cdd46704b2455e5767c45f268386f8c02486caef10d808373282c5cc44bd5865696d5e686268299d64a429396f05bf55d283a7eddf2f69
checksum: 10c0/2321b54586552c51a01a91dc2496072fab9634b89212ccdfcb1b35a21814ca4820110be76d45c147fadd0ad37739fde7d64dd9aa0805b07ac2d12bcfad99b842
languageName: node
linkType: hard
"@radix-ui/react-toggle-group@npm:1.1.14":
version: 1.1.14
resolution: "@radix-ui/react-toggle-group@npm:1.1.14"
"@radix-ui/react-toggle-group@npm:1.1.15":
version: 1.1.15
resolution: "@radix-ui/react-toggle-group@npm:1.1.15"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-roving-focus": "npm:1.1.14"
"@radix-ui/react-toggle": "npm:1.1.13"
"@radix-ui/react-roving-focus": "npm:1.1.15"
"@radix-ui/react-toggle": "npm:1.1.14"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
peerDependencies:
"@types/react": "*"
@@ -4929,15 +4931,15 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/cfda263e0f61dfad3b57dd3d0307296d31c6371a789f5d3157893a08e57438fead6d308bf236a0e505298df156eaedf468a79643866da5654ae9ec19a6ef8426
checksum: 10c0/89c56302f50f7a10c18e8913c1e501e85ba56a959fb4e6e767130fe8d11d831f98b4cec7d14458058209b3912050b99b5b48155a2afb9d5dc6a604b0185d0cd7
languageName: node
linkType: hard
"@radix-ui/react-toggle@npm:1.1.13":
version: 1.1.13
resolution: "@radix-ui/react-toggle@npm:1.1.13"
"@radix-ui/react-toggle@npm:1.1.14":
version: 1.1.14
resolution: "@radix-ui/react-toggle@npm:1.1.14"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
peerDependencies:
@@ -4950,21 +4952,21 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/a54efd399db23d540b1a7e14c85d1e912a27cbd93c0d75ff30a0cb3c4a74f85465559536e6c624c4608d2be8ee7678a13f9780b92acf054d5347f6b93db713a7
checksum: 10c0/ea169316a2cce7202731bd25effc84790aa4e43f19c5d9c1bc5377d92879f09fc9f8da77e8a66721785205061e6145923bc7fde02dea64a109588c95d09fa83b
languageName: node
linkType: hard
"@radix-ui/react-toolbar@npm:^1.1.14":
version: 1.1.14
resolution: "@radix-ui/react-toolbar@npm:1.1.14"
"@radix-ui/react-toolbar@npm:^1.1.15":
version: 1.1.15
resolution: "@radix-ui/react-toolbar@npm:1.1.15"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-direction": "npm:1.1.2"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-roving-focus": "npm:1.1.14"
"@radix-ui/react-roving-focus": "npm:1.1.15"
"@radix-ui/react-separator": "npm:1.1.11"
"@radix-ui/react-toggle-group": "npm:1.1.14"
"@radix-ui/react-toggle-group": "npm:1.1.15"
peerDependencies:
"@types/react": "*"
"@types/react-dom": "*"
@@ -4975,22 +4977,22 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/10e7f458a63365fb1373fc16be5ffa5fd3486480b27f43d7d84eb538d6b23e129335ab6ee9917250109ae7e69bebee0b07d6a17744edf151e3d841b84fce24a9
checksum: 10c0/c98398470c1e1e2ed10ef751af95ae263c1acaaa8829ea15b64b6584145d81aebd1e27ad1f4ce3031a1732a79de5ebb4a55ec133e583cca2d1297d630e289af4
languageName: node
linkType: hard
"@radix-ui/react-tooltip@npm:^1.2.11":
version: 1.2.11
resolution: "@radix-ui/react-tooltip@npm:1.2.11"
"@radix-ui/react-tooltip@npm:^1.2.12":
version: 1.2.12
resolution: "@radix-ui/react-tooltip@npm:1.2.12"
dependencies:
"@radix-ui/primitive": "npm:1.1.4"
"@radix-ui/primitive": "npm:1.1.5"
"@radix-ui/react-compose-refs": "npm:1.1.3"
"@radix-ui/react-context": "npm:1.1.4"
"@radix-ui/react-dismissable-layer": "npm:1.1.14"
"@radix-ui/react-context": "npm:1.2.0"
"@radix-ui/react-dismissable-layer": "npm:1.1.15"
"@radix-ui/react-id": "npm:1.1.2"
"@radix-ui/react-popper": "npm:1.3.2"
"@radix-ui/react-popper": "npm:1.3.3"
"@radix-ui/react-portal": "npm:1.1.13"
"@radix-ui/react-presence": "npm:1.1.6"
"@radix-ui/react-presence": "npm:1.1.7"
"@radix-ui/react-primitive": "npm:2.1.7"
"@radix-ui/react-slot": "npm:1.3.0"
"@radix-ui/react-use-controllable-state": "npm:1.2.3"
@@ -5005,7 +5007,7 @@ __metadata:
optional: true
"@types/react-dom":
optional: true
checksum: 10c0/c2733cafc6a9b551e39c8d8a9a088dbfdb752c2d5f8daf2ddd8cd3b2135fa5f0f2122e200a4e54df649cef33af5f46393a381227bd450a9a0172dd36daf373aa
checksum: 10c0/0a4463a7bed08c0bba5f21d126b859dde6861c287c32f32dc86369a36d3bf450f50c25e1ce0504538555cd4af76d53ec8cf62c72db14798caaace2c630b832af
languageName: node
linkType: hard
@@ -5312,7 +5314,7 @@ __metadata:
languageName: node
linkType: hard
"@rolldown/pluginutils@npm:^1.0.0":
"@rolldown/pluginutils@npm:^1.0.0, @rolldown/pluginutils@npm:^1.0.1":
version: 1.0.1
resolution: "@rolldown/pluginutils@npm:1.0.1"
checksum: 10c0/99d9b06d90196823e4d8c841f258db7a16e5dbba5824a2962b05d907b79f1ba929d56f22dd744fd530936e568c865ee56a719dc31e57e13bc0a8eb4764a8d8dd
@@ -7505,11 +7507,11 @@ __metadata:
languageName: node
linkType: hard
"@vitejs/plugin-react@npm:^6.0.2":
version: 6.0.2
resolution: "@vitejs/plugin-react@npm:6.0.2"
"@vitejs/plugin-react@npm:^6.0.3":
version: 6.0.3
resolution: "@vitejs/plugin-react@npm:6.0.3"
dependencies:
"@rolldown/pluginutils": "npm:^1.0.0"
"@rolldown/pluginutils": "npm:^1.0.1"
peerDependencies:
"@rolldown/plugin-babel": ^0.1.7 || ^0.2.0
babel-plugin-react-compiler: ^1.0.0
@@ -7519,7 +7521,7 @@ __metadata:
optional: true
babel-plugin-react-compiler:
optional: true
checksum: 10c0/6e2d90974e05f2a9aefafad1d137b75c3b3b4bf3f2affdbfe77c6b11b24832cff22dd8852430c6341e2fb5b00a4513fb00db306a6abdbec6f0f5841e93bbcfba
checksum: 10c0/592a93178c0eec420759d529a2c964a7103860808f549f72993b96a38c287c929a0d371cacbd932c37ee2118b830348db752cc01a31d688c71d19d74567251fa
languageName: node
linkType: hard
@@ -9478,10 +9480,10 @@ __metadata:
languageName: node
linkType: hard
"cytoscape@npm:^3.33.1":
version: 3.33.1
resolution: "cytoscape@npm:3.33.1"
checksum: 10c0/dffcf5f74df4d91517c4faf394df880d8283ce76edef19edba0c762941cf4f18daf7c4c955ec50c794f476ace39ad4394f8c98483222bd2682e1fd206e976411
"cytoscape@npm:^3.33.3":
version: 3.34.0
resolution: "cytoscape@npm:3.34.0"
checksum: 10c0/cb17b3dcacb9492f058cff653debf7b5a713e7532a9866cc72ae79d207757e8a9b68430874fe986f2a6404a8161b4fb5c1a2f1ca9ac5b1a21e316f57ed9d1243
languageName: node
linkType: hard
@@ -9908,10 +9910,10 @@ __metadata:
languageName: node
linkType: hard
"dayjs@npm:^1.11.19":
version: 1.11.20
resolution: "dayjs@npm:1.11.20"
checksum: 10c0/8af525e2aa100c8db9923d706c42b2b2d30579faf89456619413a5c10916efc92c2b166e193c27c02eb3174b30aa440ee1e7b72b0a2876b3da651d204db848a0
"dayjs@npm:^1.11.20":
version: 1.11.21
resolution: "dayjs@npm:1.11.21"
checksum: 10c0/bd97dfdc4bfea3c66268635690313828b386faa040fbc1f829ff42a2bd748b72c9d9b3c8f9616ce9e61fcb78923f1461a462c969c54b1084458ae1b715898fb0
languageName: node
linkType: hard
@@ -10234,15 +10236,15 @@ __metadata:
languageName: node
linkType: hard
"dompurify@npm:^3.3.1":
version: 3.4.10
resolution: "dompurify@npm:3.4.10"
"dompurify@npm:^3.3.3":
version: 3.4.11
resolution: "dompurify@npm:3.4.11"
dependencies:
"@types/trusted-types": "npm:^2.0.7"
dependenciesMeta:
"@types/trusted-types":
optional: true
checksum: 10c0/6ffbc564c09ae11f9e1ab97040d556f8fafb0a5221248fca02539378d442f4fbe737ebb72dd34309c46896f1093714622895cc6815a7a57599c4511e30e234ae
checksum: 10c0/31439481c7e8fc3805d40c376936fd66936620fb1b1a31a2ec097f6165412c37f2d868e082c9ceba62bb37661c1ea132a5db4d5213434317e30df68d4aca9cc9
languageName: node
linkType: hard
@@ -13501,7 +13503,7 @@ __metadata:
languageName: node
linkType: hard
"katex@npm:^0.16.25, katex@npm:^0.16.45":
"katex@npm:^0.16.45":
version: 0.16.45
resolution: "katex@npm:0.16.45"
dependencies:
@@ -14460,32 +14462,32 @@ __metadata:
languageName: node
linkType: hard
"mermaid@npm:11.15.0":
version: 11.15.0
resolution: "mermaid@npm:11.15.0"
"mermaid@npm:11.16.0":
version: 11.16.0
resolution: "mermaid@npm:11.16.0"
dependencies:
"@braintree/sanitize-url": "npm:^7.1.1"
"@braintree/sanitize-url": "npm:^7.1.2"
"@iconify/utils": "npm:^3.0.2"
"@mermaid-js/parser": "npm:^1.1.1"
"@mermaid-js/parser": "npm:^1.2.0"
"@types/d3": "npm:^7.4.3"
"@upsetjs/venn.js": "npm:^2.0.0"
cytoscape: "npm:^3.33.1"
cytoscape: "npm:^3.33.3"
cytoscape-cose-bilkent: "npm:^4.1.0"
cytoscape-fcose: "npm:^2.2.0"
d3: "npm:^7.9.0"
d3-sankey: "npm:^0.12.3"
dagre-d3-es: "npm:7.0.14"
dayjs: "npm:^1.11.19"
dompurify: "npm:^3.3.1"
dayjs: "npm:^1.11.20"
dompurify: "npm:^3.3.3"
es-toolkit: "npm:^1.45.1"
katex: "npm:^0.16.25"
katex: "npm:^0.16.45"
khroma: "npm:^2.1.0"
marked: "npm:^16.3.0"
roughjs: "npm:^4.6.6"
stylis: "npm:^4.3.6"
ts-dedent: "npm:^2.2.0"
uuid: "npm:^11.1.0 || ^12 || ^13 || ^14.0.0"
checksum: 10c0/9085b47c30b66a1e94e07c93951d9e53e5c89ec8c9fff8814233bddeecf6b8eaf9036d3168e4d1360c3f5d07cd051c666da96860eb0f22f064bd749499a0c83f
checksum: 10c0/a14f9bc9db7f1dea65b0d6c0b920236d12ad2812f2a1b11c8b39b3dfb3c22bfce39c77f6a69493203b85880d8008d345c539efe7ae6a31d3dad512833ccfb517
languageName: node
linkType: hard
@@ -15405,7 +15407,7 @@ __metadata:
"@hocuspocus/server": "npm:1.1.3"
"@juggle/resize-observer": "npm:^3.4.0"
"@linear/sdk": "npm:^58.1.0"
"@mermaid-js/layout-elk": "npm:^0.2.1"
"@mermaid-js/layout-elk": "npm:^0.2.2"
"@modelcontextprotocol/sdk": "npm:^1.25.3"
"@node-oauth/oauth2-server": "npm:^5.3.0"
"@notionhq/client": "npm:^2.3.0"
@@ -15413,19 +15415,19 @@ __metadata:
"@octokit/webhooks-types": "npm:^7.6.1"
"@outlinewiki/koa-passport": "npm:^4.2.1"
"@outlinewiki/passport-azure-ad-oauth2": "npm:^0.1.0"
"@radix-ui/react-collapsible": "npm:^1.1.15"
"@radix-ui/react-context-menu": "npm:^2.3.2"
"@radix-ui/react-dialog": "npm:^1.1.18"
"@radix-ui/react-collapsible": "npm:^1.1.16"
"@radix-ui/react-context-menu": "npm:^2.3.3"
"@radix-ui/react-dialog": "npm:^1.1.19"
"@radix-ui/react-direction": "npm:^1.1.2"
"@radix-ui/react-dropdown-menu": "npm:^2.1.19"
"@radix-ui/react-one-time-password-field": "npm:^0.1.11"
"@radix-ui/react-popover": "npm:^1.1.18"
"@radix-ui/react-select": "npm:^2.3.2"
"@radix-ui/react-dropdown-menu": "npm:^2.1.20"
"@radix-ui/react-one-time-password-field": "npm:^0.1.12"
"@radix-ui/react-popover": "npm:^1.1.19"
"@radix-ui/react-select": "npm:^2.3.3"
"@radix-ui/react-slot": "npm:^1.3.0"
"@radix-ui/react-switch": "npm:^1.3.2"
"@radix-ui/react-tabs": "npm:^1.1.16"
"@radix-ui/react-toolbar": "npm:^1.1.14"
"@radix-ui/react-tooltip": "npm:^1.2.11"
"@radix-ui/react-switch": "npm:^1.3.3"
"@radix-ui/react-tabs": "npm:^1.1.17"
"@radix-ui/react-toolbar": "npm:^1.1.15"
"@radix-ui/react-tooltip": "npm:^1.2.12"
"@radix-ui/react-visually-hidden": "npm:^1.2.7"
"@relative-ci/agent": "npm:^4.3.1"
"@sentry/node": "npm:^10.63.0"
@@ -15503,7 +15505,7 @@ __metadata:
"@types/validator": "npm:^13.15.10"
"@types/yauzl": "npm:^2.10.3"
"@types/yazl": "npm:^2.4.6"
"@vitejs/plugin-react": "npm:^6.0.2"
"@vitejs/plugin-react": "npm:^6.0.3"
"@vitest/ui": "npm:^4.1.8"
addressparser: "npm:^1.0.1"
async-sema: "npm:^3.1.1"
@@ -15572,7 +15574,7 @@ __metadata:
markdown-it: "npm:^14.3.0"
markdown-it-container: "npm:^3.0.0"
markdown-it-emoji: "npm:^3.0.0"
mermaid: "npm:11.15.0"
mermaid: "npm:11.16.0"
mime-types: "npm:^3.0.2"
mobx: "npm:^4.15.7"
mobx-react: "npm:^6.3.1"