export type DataSourceProviderType = 'Csv' | 'Excel' | 'Json' | 'MongoDB' | 'MySql' | 'OData' | 'ODBC' | 'Oracle' | 'Postgres' | 'Salesforce' | 'SQLite' | 'SqlServer' | 'WebData' | 'Xml'; export type DocumentMeta = { 'DSC_ALLOW_APPEND_DATA'?: 'True' | 'False'; 'DSC_PROVIDER'?: DataSourceProviderType; }; export interface DesignerAPI { hasPaddingChanges?: () => boolean | PromiseLike; } export interface Window { token: string; hasReportLicense: boolean; hasDashboardLicense: boolean; datasetDesigner: any; isDevMode: boolean; WynView: WynView; PathBase?: string; } export interface Window { inverted: boolean; SemanticMessageQueue: ISemanticMessageQueue; SemanticModelId: string; } export interface ISemanticMessageQueue { isEmpty: () => boolean; enqueue: (message: SemanticMessage) => void; dequeue: () => SemanticMessage; peek: (predicate: (message: SemanticMessage) => boolean) => SemanticMessage; } export interface SemanticMessage { name: string; process: () => IterableIterator; } export interface UpdateMessageData { key: string; value: any; } export interface JSONDataSourceParameterData { column: string; type: string; defaultValue: string; } export interface JSONDataSourceSchemaData { column: string; type: string; path: string; tableName: string; } export interface Query { dataSources: DataSource[]; parameters: QueryParameter[]; commandText: string; commandType: string; commandModel: TableJoinQuery; } export interface DataSource { id: string; name: string; fileName: string; provider: string; useAdvancedConfig: boolean; connectionString: string; useUserContext: boolean; useMultiTenant: boolean; isExtracted: boolean; filter: FilterExpression[]; } export interface QueryParameter { name: string; parameterType: string; parameterValue: string; dataType: string; multivalue: boolean; } export interface Table { id: string; tableType: 'NativeTable' | 'CustomSqlTable' | 'UnionTable'; tableName: string; sql: string; dataSourceId: string; unionType: 'unionAll' | 'union' | 'None'; unionMap: Dictionary[]; filters: FilterExpression[]; tables: Table[]; } export interface JoinColumn { columnName: string; tableName: string; } export interface JoinCondition { leftColumn: JoinColumn; operator: string; rightColumn: JoinColumn; } export interface JoinRelation { joinType: string; table: Table; conditions: JoinCondition[]; } export interface TableJoinQuery { firstTable: Table; joinRelations: JoinRelation[]; } export interface Field { table: string; column: string; alias: string; description: string; dataType: string; format: string; fieldType: string; aggregation: string; } export type ConditionType_And = 0; export type ConditionType_Or = 1; export type ConditionType_Rule = 2; export type ConditionType = ConditionType_And | ConditionType_Or | ConditionType_Rule; export interface FilterCondition extends FilterExpression { conditionType: ConditionType; } export interface FilterExpression { type: 'Datasource' | 'Dataset' | 'Table'; table: string; column: string; expression: string; operator: string; value: string[] | string; valueType: 'Constant' | 'Parameter'; multivalue: boolean; index?: number; dataSourceId?: string; } export interface Dictionary { [key: string]: T; } export interface WrappedDataSourceConnectionInstance { onNext: () => void; onBack: () => void; createDataSourceConnection: () => DataSourceConnectionString | PromiseLike; } export interface RowData { data: string[]; } export type ColumnDataType = 'String' | 'Boolean' | 'Double' | 'DateTime'; export interface ColumnDefinition { originColumnName: string; newColumnName: string; dataType: ColumnDataType; } export interface TableDefinition { originTableName: string; newTableName: string; columns: ColumnDefinition[]; rows?: RowData[]; checked?: boolean; } export interface SchemaDefinition { tables: TableDefinition[]; } export interface DataSourceConnectionString { Name?: string; Provider?: string; ConnectionString?: string; UseAdvancedConfig?: boolean; SourceType?: string; } export interface WynView { loader: { show: (type: WynViewLoaderType) => void; hide: () => void; }; create: (option: WynViewOption) => void; destroy: (domId: string) => void; } export interface WynViewOption { domId: string; scripts: (string | ScriptOption)[]; styles: string[]; type: WynViewType; afterCreating?: (option: WynViewOption, attachedDom: HTMLDivElement) => void; onDestroy?: (option: WynViewOption, attachedDom: HTMLDivElement) => void; manuallyOperateLoader?: boolean; transparent?: boolean; document: { type: string; title?: string; }; } export type WynViewType = 'designer' | 'preview'; export type WynViewLoaderType = WynViewType | 'none'; export interface ScriptOption { content: string; } export interface BackendServer { /** * Wyn Server URL. * @example * url: 'http://localhost:51980/' */ url: string; /** * The token needed to access the Wyn API. * @example * token: 'DA3CF35403BF9B0823A63CB2663D58E88B0B85FB588A1068753E0BDEF935B7C2' */ token: string; /** * Set if the token should be sent in the request header instead of the query parameter.\ * default value: false * @example * useTokenInHeader: true, */ useTokenInHeader?: boolean; } export interface InitOptionBase { /** * The designer or viewer version * @example * version: '1.0.0' */ version?: string; /** * The designer or viewer theme * @example * theme: 'red' */ theme?: string; /** * The designer or viewer language * @example * language: 'zh' */ language?: string; /** * The web tab title * @example * siteTitle: 'dataset' */ siteTitle?: string; } export interface InitOption extends InitOptionBase { /** * The dom contain designer or viewer. * @example * parentSelector: () => document.querySelector('#root') */ parentSelector: () => HTMLElement; backendServer: BackendServer; } export interface EventsOptionBase { /** * The callback after save. * @example * afterDocumentSave: () => {} */ afterDocumentSave?: (success: boolean, documentId?: string) => void; } export type DatasetDesignerInitOptionCore = { /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; /** * The dataset id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId?: string; /** * The dataset usage type. * @example * type: 'dashboard' */ type?: 'report' | 'dashboard'; events?: EventsOptionBase; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; /** Dataset designer instance initialization parameter configuration */ export type DatasetDesignerInitOption = InitOptionBase & DatasetDesignerInitOptionCore; export type DatasetDesignerInitOptionFull = InitOption & DatasetDesignerInitOptionCore; export type DatasetPreviewInitOptionCore = { /** * The dataset id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId: string; /** * The dataset parameters. * @example * parameters: [{ name: 'param1', value: 'value1' }] */ parameters?: Parameters[]; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; export interface Parameters { /** * The parameter name. * @example * name: 'param1' */ name: string; /** * The parameter value. * @example * value: 'value1' */ value: any[]; } /** Dataset preview instance initialization parameter configuration */ export type DatasetPreviewInitOption = InitOptionBase & DatasetPreviewInitOptionCore; export type DatasetPreviewInitOptionFull = InitOption & DatasetPreviewInitOptionCore; export type DatasourceDesignerInitOptionCore = { /** * A flag specifying whether to open datasource designer in dataset designer. * @example * inDataset: false */ inDataset?: boolean; /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; /** * The callback after close designer. * @example * afterDocumentSave: () => {} */ afterClose?: (document: any) => void; /** * The datasource id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId?: string; events?: EventsOptionBase; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; /** * `specifiedDatasourceType` is matched case-insensitively against the provider `name` returned by `/api/v2/data/datasources/providers`, * not the UI display name. If no provider matches, it is treated as invalid. * Even when a match exists, the create datasource panel opens only if the provider is not marked as unavailable by `api/dataprovider/unavailableproviders`, * and not included in `disabledDataProviders` from `admin/api/settings/data/dataProviders`. * To avoid mismatches, pass the original provider `name` from the providers API. * @example * specifiedDatasourceType: 'SqlServer' */ specifiedDatasourceType?: string; }; /** Datasource designer instance initialization parameter configuration */ export type DatasourceDesignerInitOption = InitOptionBase & DatasourceDesignerInitOptionCore; export type DatasourceDesignerInitOptionFull = InitOption & DatasourceDesignerInitOptionCore; /** Datasource preview instance initialization parameter configuration */ export type DatasourcePreviewInitOption = InitOptionBase & DatasourcePreviewInitOptionCore; export type DatasourcePreviewInitOptionFull = InitOption & DatasourcePreviewInitOptionCore; export type DatasourcePreviewInitOptionCore = { /** * The datasource id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId: string; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; export type SemanticModelDesignerInitOptionCore = { /** * The data model id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId?: string; /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; events?: EventsOptionBase; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; /** Semantic model designer instance initialization parameter configuration */ export type SemanticModelDesignerInitOption = InitOptionBase & SemanticModelDesignerInitOptionCore; export type SemanticModelDesignerInitOptionFull = InitOption & SemanticModelDesignerInitOptionCore; /** Analysis mode */ export declare enum AnalysisMode { directQuery = "directQuery", cacheMode = "cacheMode" } export type AnalysisDesignerInitOptionCore = { /** * The data model id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId?: string; /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; events?: EventsOptionBase; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; export type AnalysisDesignerInitOptionFull = InitOption & AnalysisDesignerInitOptionCore & { /** * The data model mode, direct query or cache. * @example * mode: AnalysisMode.directQuery */ mode: AnalysisMode; /** * The data model name. * @example * name: 'AnalysisModel' */ name?: string; }; export type CacheAnalysisDesignerInitOption = InitOptionBase & AnalysisDesignerInitOptionCore & { /** * The data model name. * @example * name: 'AnalysisModel' */ name?: string; }; export type DirectAnalysisDesignerInitOption = InitOptionBase & AnalysisDesignerInitOptionCore; export type ModelTypeSelectorOption = InitOption & { /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; initSemantic: () => void; initAnalysis: () => void; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; export type destroyAble = { destroy: () => void; }; export interface Dataset { designer?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: DatasetPreviewInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface Datasource { designer?: { init: (option: DatasourceDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: DatasourcePreviewInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface SemanticModel { designer?: { init: (option: SemanticModelDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; selector?: { init: (option: ModelTypeSelectorOption) => Element; destroy: (element: Element) => void; }; } export interface Analysis { designer?: { init: (option: AnalysisDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: AnalysisPreviewInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface StreamingDataset { designer?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface PushDataset { designer?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface NativeQueryDataset { designer?: { init: (option: DatasetDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; preview?: { init: (option: DatasetPreviewInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface ETL { designer?: { init: (option: ETLDesignerInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface DataFileEntry { preview?: { init: (option: DataFileEntryPreviewInitOptionFull) => Element; destroy: (element: Element) => void; }; } export interface AnalysisPreviewInitOptionCore { /** * The data model id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId: string; } export type AnalysisPreviewInitOption = InitOptionBase & AnalysisPreviewInitOptionCore; export type AnalysisPreviewInitOptionFull = InitOption & AnalysisPreviewInitOptionCore; export interface ETLDesignerInitOptionCore { /** * A flag specifying whether to show the showCloseButton. * @example * showCloseButton: true */ showCloseButton?: boolean; /** * The document id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId?: string; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; } export type ETLDesignerInitOption = InitOptionBase & ETLDesignerInitOptionCore; export type ETLDesignerInitOptionFull = InitOption & ETLDesignerInitOptionCore & { /** * The ETL designer type. * @example * etlDesignerType: 'etlQuery' */ etlDesignerType?: 'etlQuery' | 'dataflow'; }; export type DataFileEntryPreviewInitOptionCore = { /** * The data file id. * @example * documentId: '1f183c3f-64f9-4b4c-ac92-cd37580bde21' */ documentId: string; /** * The parameter name for the token used in URL integration (default is 'token') * @example * integrationTokenName: 'token' */ integrationTokenName?: string; }; export type DataFileEntryPreviewInitOption = InitOptionBase & DataFileEntryPreviewInitOptionCore; export type DataFileEntryPreviewInitOptionFull = InitOption & DataFileEntryPreviewInitOptionCore;