/** This is spectacularly generated code by spectacular based on Qlik Cloud Services APIs */ import Auth from '../auth/auth.js'; import ListableResource from '../listable.js'; import type { Config } from '../types/types.js'; export declare enum Analysis { Breakdown = "breakdown", ChangePoint = "changePoint", Comparison = "comparison", Contribution = "contribution", Correlation = "correlation", Fact = "fact", MutualInfo = "mutualInfo", Rank = "rank", Spike = "spike", Trend = "trend", Values = "values" } export declare enum AnalysisGroup { Anomaly = "anomaly", Brekadown = "brekadown", Comparison = "comparison", Correl = "correl", Fact = "fact", List = "list", MutualInfo = "mutualInfo", Rank = "rank" } export declare enum ChartType { Barchart = "barchart", Combochart = "combochart", Distributionplot = "distributionplot", Kpi = "kpi", Linechart = "linechart", Map = "map", Scatterplot = "scatterplot", Table = "table" } export type AppMetadata = { id?: string; last_reload_date?: string; limited_access?: boolean; name?: string; space_id?: string; space_name?: string; space_type?: string; [key: string]: any; }; export type ConversationalResponsePart = { errorMessage?: string; followupSentence?: string; imageUrl?: string; infoType?: string; infoValues?: Array; narrative?: NarrativeResponse; renderVisualization?: RenderVisualization; sentence?: { text?: string; }; type?: string; [key: string]: any; }; export type Error = { /** The error code. */ code: string; /** A human-readable explanation specific to this occurrence of the problem. */ detail?: string; /** Additional properties relating to the error. */ meta?: object; /** References to the source of the error. */ source?: { parameter?: string; pointer?: string; }; /** Summary of the problem. */ title: string; [key: string]: any; }; export type NarrativeResponse = { text?: string; [key: string]: any; }; export type NLMetricRecommendation = { analysis?: Analysis; analysisGroup?: AnalysisGroup; /** Chart type given to current recommendation */ chartType?: ChartType; /** Dimension(s) considered for recommendation */ dims?: Array; /** Measure(s) considered for recommendation */ msrs?: Array; relevance?: number; [key: string]: any; }; export type NLMetricRecord = { /** Qlik sense app id that is being used to answer the question */ appId: string; /** Qlik sense app name that is being used to answer the question */ appName?: string; apps?: Array; /** Source from which conversation is happening */ channelId?: string; /** Chart type for given query. For insight advisor it would be 'native' and for insight advisor chat, it could be 'static' or 'responsive' */ chartType?: string; /** Record created date */ createdAt: string; /** Qlik sense user id who is interacting with insight advisor or insight advisor chat or third party api */ createdBy?: string; feedback?: Array; /** Unique record id stored in database */ id: string; /** Boolean value indicates whether given query is contextual or not. It would be false for insight advisor */ isContextualQuery?: boolean; /** language selected for query from insight advisor or insight advisor chat or third party api */ lang?: string; nluInfo?: Array; queryError?: boolean; /** Refers to source from where narrative request is called @defaultValue "askQuestion" */ queryOrigin?: 'askQuestion' | 'iaAnalysis' | 'iaAssetsPanel' | string; /** Query asked by user in insight advisor or insight advisor or third party api */ queryText?: string; /** Nature of query being asked during the conversation e.g. query, applist, measurelist, dimensionlist */ queryType?: 'appList' | 'appSuggested' | 'dimensionList' | 'exploreThisFurther' | 'followup' | 'greetings' | 'measureList' | 'query' | 'sampleQuestion' | string; /** Unique id assigned to user query */ questionId: string; recommendations?: Array; /** Provides info what was included in response for given query */ responses?: NLResponses; /** Tokens from question parsed which are ignored */ stopWords?: Array; /** Qlik sense tenant Id */ tenantId?: string; /** Tokens parsed as entities but not matched with app's field/dimension/measure */ unmatchedEntities?: Array; /** Record modified date */ updatedAt: string; /** Version of the metric model */ version: string; [key: string]: any; }; export type NLMetricsRequest = { /** The advanced filtering to use for the query. Refer to RFC 7644 https://www.rfc-editor.org/rfc/rfc7644section-3.4.2.2 for the syntax.: Filter on createdAt and updatedAt fields are encouraged and support `eq`, `ne`, `gt`, `ge`, `lt`, `le` comparison operators along with `and` and `or` logical operators. Filter on tenantId field is not supported. `co`, `sw` and `ew` operators are not supported. Examples: ``` appId eq "appId1" ``` ``` (appId eq "appId1" or appId eq "appId2") ``` ``` (appId eq "appId1" or appId eq "appId2") and (createdAt gt "2022-08-03T00:00:00.000Z" and createdAt lt "2022-08-04T00:00:00.000Z") ``` ``` (appId eq "appId1") and (createdAt ge "2022-08-03T00:00:00.000Z") ``` ``` (appId eq "appId1") and (createdAt le "2022-08-23:59:59.000Z") ``` ``` (appId eq "appId1") and (questionId eq "12345") ``` */ filter: string; [key: string]: any; }; export type NLResponses = { /** Chart was provided */ hasChart?: boolean; /** Narrative was provided */ hasInsights?: boolean; /** App list was provided */ hasMetadataApps?: boolean; /** Dimensions list was provided */ hasMetadataDimensions?: boolean; /** Measures list was provided */ hasMetadataMeasures?: boolean; /** Sample questions was provided */ hasSampleQueries?: boolean; /** Suggestion questions was provided */ hasSuggestions?: boolean; [key: string]: any; }; export type NluInfo = { elements?: Array; [key: string]: any; }; export type NluInfoElements = { entity?: boolean; errorText?: string; filterFieldName?: string; filterText?: string; isFilter?: boolean; text?: string; type?: string; typeName?: string; typeTranslated?: string; [key: string]: any; }; export type PartialNluInfo = { /** Qlik sense application field selected for given token or phrase */ fieldName?: string; /** Filter value found from query */ fieldValue?: string; /** Role of the token or phrase from query */ role?: 'dimension' | 'measure' | 'date' | string; /** Matching token or phrase from query */ text?: string; /** Type of token from query */ type?: 'field' | 'filter' | 'master_dimension' | 'master_measure' | 'custom_analysis' | string; [key: string]: any; }; export type QlikApp = { id?: string; name?: string; [key: string]: any; }; export type QueryCreate = { app?: QlikApp; /** Flag that clears the entity context. */ clearEntityContext?: boolean; /** Flag that specifies either to enable converastion context. */ disableConversationContext?: boolean; /** The flag specifies whether to disable follow-up recommendations. */ disableFollowups?: boolean; /** Flag that specifies whether the narratives should be generated for the user query or not. */ disableNarrative?: boolean; /** Flag that specifies whether visualization object should be provided or not. */ enableVisualizations?: boolean; /** The language to assume when parsing, specified as an ISO-639-1 code. Defaults to 'en' (English). */ lang?: string; /** property that contains the Id of the recommendation for which the response should be generated. */ recommendationId?: string; /** The sentence that will be parsed. */ text: string; /** Specify visualizationTypes for only which visualization object should be provided if enableVisualizations is set to true. For eg. ['linechart', 'barchart'] */ visualizationTypes?: Array; [key: string]: any; }; export type QueryNotCreated = { apps?: Array; conversationalResponse?: QueryResponse; errors?: Array; nluInfo?: NluInfo; [key: string]: any; }; export type QueryResponse = { apps?: Array; /** For contextual responses, this string contains a list of entities that are used to produce the response. */ contextInfo?: string; /** The URL with the query injected to insight advisor of the app to which the query belongs. */ drillDownURI?: string; responses?: Array; sentenceWithMatches?: string; [key: string]: any; }; export type RecFeedback = { analysisType?: string; chartType?: string; comment?: string; recommendationAddedToHub: boolean; recommendationAddedToSheet: boolean; recommendationDisliked: boolean; recommendationLiked: boolean; [key: string]: any; }; export type RenderVisualization = { /** Data object should be used to render visualization */ data?: object; language?: string; [key: string]: any; }; export declare class Questions { auth: Auth; config: Config; constructor(config: Config | Auth); /** Returns the generated response for parsed chat queries, if no app was specified nor present in conversation context, suggests matching apps. @param qlik-web-integration-id - This header is only required for external clients or mashups for QCS, this value of this property should be the id of the web integration set up for the external client/mashup @param data - */ ask(data: QueryCreate, qlikWebIntegrationId?: string): Promise; /** Returns NL metrics based on provided app IDs the user has access to. @param limit - The preferred number of entries returned @param page - A cursor pointing to the page of data to retrieve. @param sort - A single field from the data model on which to sort the response. The '+' or '-' operator may be used to specify ascending or desending order. @param data - */ filter(data: NLMetricsRequest, queryParams?: { limit?: number; page?: string; sort?: 'createdAt' | 'updatedAt' | '+createdAt' | '+updatedAt' | '-createdAt' | '-updatedAt'; }): Promise>; }