/*! * Copyright 2022, Staffbase GmbH and contributors. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * File type entity */ export interface SBFileType { default: string; ppt: string; xls: string; doc: string; pdf: string; img: string; } /** * Detailed colors entity definition * @param clientForeground This color is meant to be used for foreground elements and is either black or white depending * on which gives the better contrast when used as a foreground color for {@link clientPrimary} * @param clientPrimary The customer's primary color (previously `bgColor`) * @param clientPrimaryA11y This is {@link clientPrimary} adjusted in contrast to give a good contrast when used as a * foreground color on a white background. * @param clientSecondary The customer's secondary color (previously `textColor`). * @param clientSecondaryA11y This is {@link clientSecondary} adjusted in contrast to give a good contrast when used as * a foreground color on a white background. * @param pressedState Active action component states for components with white background: Hover, Pressed, etc... * */ export interface SBColors { fileType: SBFileType; backdrop: string; backgroundField: string; backgroundFieldLight: string; backgroundPrimary: string; backgroundSecondary: string; backgroundTertiary: string; black: string; borderSolid: string; borderTranslucent: string; clientForeground: string; clientPrimary: string; clientPrimaryA11y: string; clientSecondary: string; clientSecondaryA11y: string; textPlaceholder: string; textPrimary: string; textSecondary: string; textTertiary: string; pressedState: string; hoverState: string; backgroundBase: string; backgroundLevel1: string; backgroundLevel2: string; backgroundLevel3: string; backgroundLevel4: string; blue: string; blueDark: string; blueLight: string; green: string; greenDark: string; greenLight: string; grey: string; greyDark: string; greyLight: string; hairline: string; hairlineDark: string; neutral: string; neutralDark: string; neutralLight: string; orange: string; orangeDark: string; orangeLight: string; overlay: string; overlayDark: string; red: string; redDark: string; redLight: string; text: string; textGreyBase: string; textGreyLevel1: string; textGreyLevel2: string; textGreyLevel3: string; textGreyLevel4: string; textLight: string; warningYellow: string; } /** * The color theme allows the widget to mimic the look * and feel of the Staffbase ecosystem it was added to. */ export interface ColorTheme { bgColor: string; textColor: string; colors: SBColors; bgColorDarkened1?: string; bgColorDarkened2?: string; bgColorDarkened2Opaque?: string; bgColorLum?: string; outlineColor?: string; } /** * Image entity definition */ export interface SBImageEntity { format?: string; height: number; mimeType?: string; size?: number; url: string; width: number; } /** * User avatar definition */ export interface SBUserAvatar { icon: SBImageEntity; original: SBImageEntity; publicID: string; thumb: SBImageEntity; } /** * User profile data */ export interface SBUserProfile { id: string; externalID?: string; firstName: string; lastName: string; phoneNumber?: string; publicEmailAddress?: string; location?: string; position?: string; avatar?: SBUserAvatar; department?: string; groupIDs?: string[]; /** The access needs to be enabled by Customer Success Manager */ primaryEmail?: string; /** The access needs to be enabled by Customer Success Manager */ primaryUsername?: string; } /** * The sorting order of the user list. * * @param lastname sort response by lastName_ASC_firstName_ASC (default) * @param created sort by date of creation descending * @param updated sort by date of last update descending */ export type UserListSorting = 'lastname' | 'created' | 'updated'; /** * User list request parameters */ export interface UserListRequestQuery { limit?: number; offset?: number; sort?: UserListSorting; filter?: string; } /** * Single user item */ export interface UserListItem { id?: string; firstName?: string; lastName?: string; entityType?: string; } /** * Responded user list */ export interface UserListResponse { data: UserListItem[]; offset: number; limit: number; total: number; } export type IntegrationType = `${IntegrationNames}`; export declare enum IntegrationNames { MS365 = "ms365", GoogleWorkspace = "googleWorkspace", ServiceNow = "serviceNow", Atlassian = "atlassian", Box = "box" } /** * Integration Token including the expiration time */ export interface IntegrationToken { accessToken: string; accessTokenExpiresAt?: Date; } /** * All available states the integration can take */ export declare const IntegrationStates: { readonly UNAVAILABLE: "unavailable"; readonly AVAILABLE: "available"; readonly LOGGED_OUT: "loggedOut"; }; export type IntegrationState = typeof IntegrationStates[keyof typeof IntegrationStates]; /** * Information about the requested Integration target */ export interface IntegrationInformation { status: IntegrationState; enabledFeatures: string[]; supportedFeatures: string[]; token?: IntegrationToken; signIn?: () => void; } /** * Branch information */ export interface BranchInformation { slug: string; branchId: string; webUrl: string; flags: string[]; }