import { type ILocale } from "../base/localization.js"; import { type IEntitlementsName } from "../entitlements/index.js"; import { type IWorkspacePermissions } from "../permissions/index.js"; import { type IFeatureFlags, type IPermanentSettings } from "../settings/settings.js"; /** * Workspace permission keys supported by the pluggable application manifest. * * These map directly to the Tiger backend workspace permission levels, replacing the legacy * fine-grained Bear-era permissions with their real Tiger equivalents. * * @alpha */ export type PluggableApplicationWorkspacePermission = /** * Whether the user can view the workspace and its contents. * Maps to Tiger `VIEW` permission. */ "canViewWorkspace" /** * Whether the user can create and edit analytical objects (visualizations, dashboards, metrics). * Maps to Tiger `ANALYZE` permission. */ | "canAnalyze" /** * Whether the user can manage workspace-level settings and metadata objects. * Maps to Tiger `MANAGE` permission. */ | "canManageWorkspace" /** * Whether the user can export reports. * Maps to Tiger `EXPORT` permission. */ | "canExport" /** * Whether the user can export tabular reports. * Maps to Tiger `EXPORT_TABULAR` permission. */ | "canExportTabular" /** * Whether the user can export PDF documents. * Maps to Tiger `EXPORT_PDF` permission. */ | "canExportPdf" /** * Whether the user can create dashboard filter views. * Maps to Tiger `CREATE_FILTER_VIEW` permission. */ | "canCreateFilterView" /** * Whether the user can create automations. * Maps to Tiger `CREATE_AUTOMATION` permission. */ | "canCreateAutomation" /** * Whether the user can use AI Assistant. * Maps to Tiger `USE_AI_ASSISTANT` permission. */ | "canUseAiAssistant"; /** * Dictionary of workspace permissions supported by the pluggable application manifest. * * @alpha */ export type IPluggableApplicationWorkspacePermissions = { [permission in PluggableApplicationWorkspacePermission]: boolean; }; /** * Converts the full workspace permissions (as returned by the backend SPI) to the * reduced set used by the pluggable application manifest. * * @alpha */ export declare function toPluggableApplicationWorkspacePermissions(permissions: IWorkspacePermissions): IPluggableApplicationWorkspacePermissions; /** * Organization permission keys supported by the pluggable application manifest. * * These map directly to the Tiger backend organization permission levels. * * @alpha */ export type PluggableApplicationOrganizationPermission = /** * Whether the user can manage the organization (settings, users, etc.). * Maps to Tiger `MANAGE` permission. */ "canManageOrganization" /** * Whether the user can create API tokens. * Maps to Tiger `SELF_CREATE_TOKEN` permission. */ | "canCreateDevToken" /** * Whether the user has access to the base UI. * Maps to Tiger `BASE_UI_ACCESS` permission. */ | "hasBaseUiAccess"; /** * Dictionary of organization permissions supported by the pluggable application manifest. * * @alpha */ export type IPluggableApplicationOrganizationPermissions = { [permission in PluggableApplicationOrganizationPermission]: boolean; }; /** * Defines in which scope the application should be registered. * * The default UI uses this information to determine if the application is visible in * the organization or workspace portal. * * @alpha */ export type ApplicationScope = "organization" | "workspace"; /** * Localized titles of pluggable application. * * @alpha */ export type LocalizedTitle = { [locale in ILocale]: string; }; /** * Logical condition for evaluating requirement properties. * * Supports composable AND/OR logic for determining whether an application should be accessible. * Conditions can be nested arbitrarily to express complex boolean expressions. * * There are three forms: * * 1. **Plain object (implicit AND)** — all specified properties must match their expected values. * This is the simplest form and is backwards compatible with the original flat object types. * Example: * \{ canInitData: true, canRefreshData: true \} // both must be true * * 2. **$or condition** — at least one of the nested conditions must be satisfied. * Example: * \{ \$or: [\{ canInitData: true \}, \{ canRefreshData: true \}] \} // either one suffices * * 3. **$and condition** — all nested conditions must be satisfied. Useful when composing * with $or at deeper levels to express grouped AND clauses. * Example: * \{ * \$or: [ * \{ \$and: [\{ canInitData: true \}, \{ canManageProject: true \}] \}, * \{ canRefreshData: true \}, * ] * \} * * @alpha */ export type Condition = T | IConditionOr | IConditionAnd; /** * OR condition — at least one of the nested conditions must be satisfied. * * @alpha */ export interface IConditionOr { $or: Array>; } /** * AND condition — all nested conditions must be satisfied. * * @alpha */ export interface IConditionAnd { $and: Array>; } /** * Settings and their values that must be set for the pluggable application to be accessible for the currently * logged user. * * @alpha */ export type RequiredSettings = Condition>; /** * Entitlements and their values that must be set for the pluggable application to be accessible for * the currently logged user. * * @alpha */ export type RequiredEntitlements = Condition>; /** * Workspace permissions and their values that must be set for the pluggable application to be accessible for * the currently logged user. * * @alpha */ export type RequiredWorkspacePermissions = Condition>; /** * Organization permissions that must be set for the pluggable application to be accessible for * the currently logged user. * * @alpha */ export type RequiredOrganizationPermissions = Condition>; /** * Pluggable application meta-information, v1. * * @alpha */ export interface IPluggableApplicationMetaV1 { /** * The version of the application API. * * Explicit version is specified here as the applications list will be passed down the contract, * for example, to shell application UI rendered, that can use 3rd party module for rendering. * The local and remote registry manifest is versioned, but these types will not be passed down once * the resulting list of the application is constructed from both of these manifests. */ apiVersion: "1.0"; /** * Unique ID of the application. * * Used when the application is referenced by the remote registry override and in any other case * when the application needs to be referenced. */ id: string; /** * States if the application is enabled and should be allowed to load by the shell application. * * Used mainly by the remote registry override to disable the standard application. */ isEnabled?: boolean; /** * Title of the application. * * Used, for example, in Application Header, when the localized title variant is not provided. */ title: string; /** * Optional localized titles map keyed by supported locale. * * It is used in the Application Header to display a localized name of the application. Each application * has its own locale bundle, but it can't be used to store the localized name of the application. * The application bundle is loaded and parsed only after the user clicks on the application link. */ localizedTitle?: LocalizedTitle; /** * Defines in which scope the application should be registered. * * The default UI uses this information to determine if the application is visible in * the organization or workspace portal. */ applicationScope: ApplicationScope; /** * Order of the application in the menu. * * Applications are sorted and rendered in the default UI according to this value, from smallest * to the highest. */ menuOrder: number; /** * Maintainer of the application. * The name of the team, person, email, or other information about the maintainer. */ maintainer?: string; /** * Settings (and feature flags) and their values that must be set for the pluggable application to be * accessible for the currently * logged user. */ requiredSettings?: RequiredSettings; /** * Entitlements and their values that must be set for the pluggable application to be accessible for * the currently logged user. */ requiredEntitlements?: RequiredEntitlements; /** * Workspace permissions and their values that must be set for the pluggable application to be * accessible for the currently logged user. */ requiredWorkspacePermissions?: RequiredWorkspacePermissions; /** * Organization permissions that must be set for the pluggable application to be accessible for * the currently logged user. */ requiredOrganizationPermissions?: RequiredOrganizationPermissions; } /** * Pluggable application meta-information. * * @alpha */ export type PluggableApplicationMeta = IPluggableApplicationMetaV1; /** * Definition of the remote pluggable application. * The application is loaded via Module Federation. * * @alpha */ export interface IRemotePluggableApplicationModule { /** * Full URL of the remote federated module with the application bundle. * * @example * https://my-remote-federated-module.com/remoteEntry.js */ url: string; /** * Unique module federation scope value (must match the remote module definition during build) * Must be unique within the same remote federation to not share dependencies and scope with another * application. * * @example * "my-remote-federated-module" */ scope: string; /** * Exposed module name. Must match the remote module definition. * Maps to internal application module (e.g. "./src/remote-entry.tsx") * * @example * "./AppModule" */ module: string; /** * Base route of the application. * It is relative to the shell application route. * * @example * "/my-application" * * When the application is registered to "organization" scope, the application will be hosted at * /organization/my-application. * When the application is registered to the "workspace" scope, the application will be hosted at * /workspace/\{workspaceId\}/my-application. */ routeBase: string; } /** * Remote pluggable application registry item, v1. * Loaded via Module Federation. * * @alpha */ export interface IRemotePluggableApplicationRegistryItemV1 extends IPluggableApplicationMetaV1 { /** * Defines how the remote-federated module should be loaded. */ remote: IRemotePluggableApplicationModule; } /** * Remote pluggable application registry item. * Loaded via Module Federation. * * @alpha */ export type RemotePluggableApplicationRegistryItem = IRemotePluggableApplicationRegistryItemV1; /** * Definition of the pluggable application deployed locally with the shell application. * The application is loaded from the host bundle asynchronously via lazy-loaded import. * * @alpha */ export interface ILocalPluggableApplicationModule { /** * Base route of the application. * It is relative to the shell application route. * * @example * "/my-application * * When the application is registered to "organization" scope, the application will be hosted at * /organization/my-application. * When the application is registered to "workspace" scope, the application will be hosted at * /workspace/\{workspaceId\}/my-application. */ routeBase: string; } /** * Local pluggable application registry item, v1. * Loaded from the host bundle asynchronously. * * @alpha */ export interface ILocalPluggableApplicationRegistryItemV1 extends IPluggableApplicationMetaV1 { /** * Defines the local application module reference and route registration. * * The loader strategy is intentionally not part of this data contract. The host resolves * the loader implementation from application metadata (typically by `app.id`). */ local: ILocalPluggableApplicationModule; } /** * Local pluggable application registry item. * Loaded from the host bundle asynchronously. * * @alpha */ export type LocalPluggableApplicationRegistryItem = ILocalPluggableApplicationRegistryItemV1; /** * Definition of the pluggable application that is just a URL link. * The default UI will replace the application window with the URL link. * * @alpha */ export interface IExternalUrlPluggableApplicationModule { /** * URL of the external application. * * @example * https://google.com */ url: string; } /** * External pluggable application registry item, v1. * * Loaded from an external application hosted module outside the shell, i.e., external link that will * replace the application window. * * @alpha */ export interface IExternalPluggableApplicationRegistryItemV1 extends IPluggableApplicationMetaV1 { /** * Defines where the web application should be redirected. */ external: IExternalUrlPluggableApplicationModule; } /** * External pluggable application registry item. * * Loaded from an external application hosted module outside the shell, i.e., external link that will * replace the application window. * * @alpha */ export type ExternalPluggableApplicationRegistryItem = IExternalPluggableApplicationRegistryItemV1; /** * Pluggable application registry item * * @alpha */ export type PluggableApplicationRegistryItem = RemotePluggableApplicationRegistryItem | LocalPluggableApplicationRegistryItem | ExternalPluggableApplicationRegistryItem; /** * Pluggable application registry, v1. * * @alpha */ export interface ILocalPluggableApplicationsRegistryV1 { /** * The version of the API used by the application manifest */ apiVersion: "1.0"; /** * The list of pluggable applications deployed in the shell application by default. */ applications: PluggableApplicationRegistryItem[]; } /** * Pluggable application registry * * @alpha */ export type LocalPluggableApplicationsRegistry = ILocalPluggableApplicationsRegistryV1; /** * Pluggable application remote registry, v1. * * @alpha */ export interface IRemotePluggableApplicationsRegistryV1 { /** * The version of the API used by the application manifest */ apiVersion: "1.0"; /** * The overrides of the pluggable applications deployed in the shell application by default. * * Each override is mapped to a key that is the well-documented ID of the default pluggable application, * e.g., gdc-analytical-designer, gdc-dashboards, etc. The property can be used, for example, to disable * one of these applications or changing the order under which it is added to the Application Header menu. */ overrides?: { [applicationId: string]: Partial; }; /** * The optional list of allowed standard applications. * * The array of well-documented IDs of the standard applications that are deployed in the shell * application by default. The property can be used to stabilize which of the standard applications * will be available in the Application Header menu. When a new standard application is deployed in * the shell application, it will not appear in the menu until it is added to the list of allowed * standard applications. */ allowedStandardApplications?: string[]; /** * The list of additional pluggable applications registered to the shell application. * * Mainly used to register 3rd party hosted remote module federated applications. */ applications?: PluggableApplicationRegistryItem[]; /** * Optional remote module federation definition for a custom host UI module. * * @remarks * When set, the shell application loads the UI module from this remote instead of using the * built-in default host UI. The loaded module must conform to the {@link @gooddata/sdk-pluggable-application-model#IHostUiModule} * interface. * * This allows organizations to fully replace the application chrome (header, navigation, layout) * with a custom implementation while keeping the pluggable application loading and lifecycle * management intact. */ uiModule?: IRemotePluggableApplicationModule; } /** * Pluggable application remote registry * * @alpha */ export type RemotePluggableApplicationsRegistry = IRemotePluggableApplicationsRegistryV1; /** * Type guard for ExternalPluggableApplicationRegistryItem * * @alpha */ export declare function isExternalPluggableApplicationRegistryItem(app: PluggableApplicationRegistryItem): app is ExternalPluggableApplicationRegistryItem; /** * Type guard for LocalPluggableApplicationRegistryItem * * @alpha */ export declare function isLocalPluggableApplicationRegistryItem(app: PluggableApplicationRegistryItem): app is LocalPluggableApplicationRegistryItem; /** * Type guard for RemotePluggableApplicationRegistryItem * * @alpha */ export declare function isRemotePluggableApplicationRegistryItem(app: PluggableApplicationRegistryItem): app is RemotePluggableApplicationRegistryItem; //# sourceMappingURL=index.d.ts.map