mirror of
https://github.com/outline/outline.git
synced 2026-11-30 00:50:41 +03:00
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
export function signin(service = "slack"): string {
|
|
return `/auth/${service}`;
|
|
}
|
|
|
|
/**
|
|
* Returns the path to a settings screen.
|
|
*
|
|
* @param args optional path segments appended to the settings path.
|
|
* @returns the settings path.
|
|
*/
|
|
export function settingsPath(...args: string[]): string {
|
|
return "/settings" + (args.length > 0 ? `/${args.join("/")}` : "");
|
|
}
|
|
|
|
export function integrationSettingsPath(id: string): string {
|
|
return `/settings/integrations/${id}`;
|
|
}
|
|
|
|
/**
|
|
* Returns the public path for a shared model.
|
|
*
|
|
* @param shareId the identifier of the share.
|
|
* @param modelPath an optional path to the model within the share.
|
|
* @param rootShareId the workspace root share id, if the share is served from "/".
|
|
* @returns the path to the shared model.
|
|
*/
|
|
export function sharedModelPath(
|
|
shareId: string,
|
|
modelPath?: string,
|
|
rootShareId?: string
|
|
): string {
|
|
if (shareId === rootShareId) {
|
|
return modelPath ? modelPath : "/";
|
|
}
|
|
|
|
return modelPath ? `/s/${shareId}${modelPath}` : `/s/${shareId}`;
|
|
}
|