Add ability to link Slack <-> Outline accounts (#6682)

This commit is contained in:
Tom Moor
2024-03-18 19:21:38 -06:00
committed by GitHub
parent e294fafd4f
commit cbdacc7cfd
23 changed files with 647 additions and 421 deletions

View File

@@ -51,7 +51,7 @@ export enum MentionType {
export type PublicEnv = {
ROOT_SHARE_ID?: string;
analytics: {
service?: IntegrationService | UserCreatableIntegrationService;
service?: IntegrationService;
settings?: IntegrationSettings<IntegrationType.Analytics>;
};
};
@@ -64,10 +64,16 @@ export enum AttachmentPreset {
}
export enum IntegrationType {
/** An integration that posts updates to an external system. */
Post = "post",
/** An integration that listens for commands from an external system. */
Command = "command",
/** An integration that embeds content from an external system. */
Embed = "embed",
/** An integration that captures analytics data. */
Analytics = "analytics",
/** An integration that maps an Outline user to an external service. */
LinkedAccount = "linkedAccount",
}
export enum IntegrationService {
@@ -77,11 +83,18 @@ export enum IntegrationService {
GoogleAnalytics = "google-analytics",
}
export enum UserCreatableIntegrationService {
Diagrams = "diagrams",
Grist = "grist",
GoogleAnalytics = "google-analytics",
}
export type UserCreatableIntegrationService = Extract<
IntegrationService,
| IntegrationService.Diagrams
| IntegrationService.Grist
| IntegrationService.GoogleAnalytics
>;
export const UserCreatableIntegrationService = {
Diagrams: IntegrationService.Diagrams,
Grist: IntegrationService.Grist,
GoogleAnalytics: IntegrationService.GoogleAnalytics,
} as const;
export enum CollectionPermission {
Read = "read",
@@ -107,6 +120,7 @@ export type IntegrationSettings<T> = T extends IntegrationType.Embed
| { url: string; channel: string; channelId: string }
| { serviceTeamId: string }
| { measurementId: string }
| { slack: { serviceTeamId: string; serviceUserId: string } }
| undefined;
export enum UserPreference {