// // Copyright © 2020, 2021 Anticrm Platform Contributors. // // Licensed under the Eclipse Public 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 https://www.eclipse.org/legal/epl-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. // import type { Account, AccountRole, Blob, Class, Configuration, Doc, Mixin, Ref } from '@hcengineering/core' import type { Plugin } from '@hcengineering/platform' import { Asset, IntlString, Resource, plugin } from '@hcengineering/platform' import { TemplateField, TemplateFieldCategory } from '@hcengineering/templates' import { AnyComponent } from '@hcengineering/ui' import { SpaceTypeCreator, SpaceTypeEditor } from './spaceTypeEditor' export * from './spaceTypeEditor' export * from './utils' /** * @public */ export type Handler = Resource<(value: string) => Promise> /** * @public */ export interface IntegrationType extends Doc { label: IntlString description: IntlString icon: AnyComponent allowMultiple: boolean createComponent?: AnyComponent onDisconnect?: Handler reconnectComponent?: AnyComponent configureComponent?: AnyComponent } /** * @public */ export interface Integration extends Doc { type: Ref disabled: boolean value: string error?: IntlString | null shared?: Ref[] } /** * @public */ export interface Editable extends Class { value: boolean // true is editable, false is not } /** * @public * * Mixin to allow delete of Custom classes. */ export interface UserMixin extends Class {} /** * @public */ export interface SettingsCategory extends Doc { name: string label: IntlString icon: Asset component: AnyComponent props?: Record // If defined, will pass kind with key to component extraComponents?: Record group?: string // If defined, will sort using order. order?: number role: AccountRole expandable?: boolean adminOnly?: boolean } /** * @public */ export interface InviteSettings extends Configuration { expirationTime: number emailMask: string limit: number } /** * @public */ export interface WorkspaceSetting extends Doc { icon?: Ref | null } /** * @public */ export const settingId = 'setting' as Plugin export default plugin(settingId, { ids: { SettingApp: '' as Ref, Profile: '' as Ref, Password: '' as Ref, Setting: '' as Ref, Integrations: '' as Ref, Support: '' as Ref, Privacy: '' as Ref, Terms: '' as Ref, ClassSetting: '' as Ref, Owners: '' as Ref, InviteSettings: '' as Ref, WorkspaceSetting: '' as Ref, ManageSpaces: '' as Ref, Spaces: '' as Ref }, mixin: { Editable: '' as Ref>, UserMixin: '' as Ref>, SpaceTypeEditor: '' as Ref>, SpaceTypeCreator: '' as Ref> }, class: { SettingsCategory: '' as Ref>, WorkspaceSettingCategory: '' as Ref>, Integration: '' as Ref>, IntegrationType: '' as Ref>, InviteSettings: '' as Ref>, WorkspaceSetting: '' as Ref> }, component: { Settings: '' as AnyComponent, Profile: '' as AnyComponent, Password: '' as AnyComponent, WorkspaceSetting: '' as AnyComponent, WorkspaceSettings: '' as AnyComponent, Integrations: '' as AnyComponent, Support: '' as AnyComponent, Privacy: '' as AnyComponent, Terms: '' as AnyComponent, ClassSetting: '' as AnyComponent, PermissionPresenter: '' as AnyComponent, SpaceTypeDescriptorPresenter: '' as AnyComponent, SpaceTypeGeneralSectionEditor: '' as AnyComponent, SpaceTypePropertiesSectionEditor: '' as AnyComponent, SpaceTypeRolesSectionEditor: '' as AnyComponent, RoleEditor: '' as AnyComponent, RoleAssignmentEditor: '' as AnyComponent }, string: { Settings: '' as IntlString, Setting: '' as IntlString, Spaces: '' as IntlString, WorkspaceSettings: '' as IntlString, Branding: '' as IntlString, Integrations: '' as IntlString, Support: '' as IntlString, Privacy: '' as IntlString, Terms: '' as IntlString, Categories: '' as IntlString, Delete: '' as IntlString, Disconnect: '' as IntlString, Add: '' as IntlString, AccountSettings: '' as IntlString, ChangePassword: '' as IntlString, CurrentPassword: '' as IntlString, NewPassword: '' as IntlString, Saving: '' as IntlString, Saved: '' as IntlString, EnterCurrentPassword: '' as IntlString, EnterNewPassword: '' as IntlString, RepeatNewPassword: '' as IntlString, Signout: '' as IntlString, InviteWorkspace: '' as IntlString, SelectWorkspace: '' as IntlString, Reconnect: '' as IntlString, ClassSetting: '' as IntlString, Classes: '' as IntlString, Owners: '' as IntlString, Configure: '' as IntlString, InviteSettings: '' as IntlString, General: '' as IntlString, Properties: '' as IntlString, TaskTypes: '' as IntlString, Automations: '' as IntlString, Collections: '' as IntlString, SpaceTypes: '' as IntlString, Roles: '' as IntlString }, icon: { AccountSettings: '' as Asset, Owners: '' as Asset, Password: '' as Asset, Setting: '' as Asset, Integrations: '' as Asset, Support: '' as Asset, Privacy: '' as Asset, Terms: '' as Asset, Signout: '' as Asset, SelectWorkspace: '' as Asset, Clazz: '' as Asset, Enums: '' as Asset, InviteSettings: '' as Asset, InviteWorkspace: '' as Asset, Views: '' as Asset }, templateFieldCategory: { Integration: '' as Ref }, templateField: { OwnerFirstName: '' as Ref, OwnerLastName: '' as Ref, OwnerPosition: '' as Ref, Value: '' as Ref } })