// (C) 2007-2021 GoodData Corporation import { ISchema } from "../model/Schema"; import * as HttpStatusCodes from "http-status-codes"; export const schema: ISchema = { analyticalDashboards: [ { identifier: "dash.a", title: "Dashboard A", widgets: [ { title: "FD FVW", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_a", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", }, { title: "FD SVW", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_b", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", }, { title: "FD FKPI", metricIdentifier: "simple_metric", }, { title: "FD SKPI", metricIdentifier: "4321", comparisonType: "lastYear", comparisonDirection: "growIsBad", }, { title: "FD SKPI Date", metricIdentifier: "4321", comparisonType: "lastYear", comparisonDirection: "growIsBad", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", }, { title: "FD FVW with properties", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_a", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", properties: '{ "controls": {}}', }, ], filterContext: { title: "FD FC", filters: [ { attributeFilter: { attributeElements: [], displayForm: "/gdc/md/mockproject/obj/fd_fc.df", negativeSelection: true, }, }, { dateFilter: { type: "relative", granularity: "GDC.time.year", }, }, ], }, }, { title: "Dashboard B", widgets: [ { title: "SD FVW", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_b", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", ignoreDashboardFilters: [ { attributeFilterReference: { displayForm: "attribute-displayForm-1" } }, { dateFilterReference: { dataSet: "date-dataSet-2" } }, ], }, { title: "SD SVW", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_a", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", }, { title: "SD FKPI", metricIdentifier: "4321", comparisonType: "previousPeriod", comparisonDirection: "growIsGood", }, { identifier: "overrides_title", title: "SD SKPI", metricIdentifier: "simple_metric", }, ], filterContext: { title: "SD FC", filters: [ { attributeFilter: { attributeElements: [], displayForm: "/gdc/md/mockproject/obj/sd_fc.df", negativeSelection: false, }, }, { dateFilter: { type: "relative", granularity: "GDC.time.week", }, }, ], }, }, { title: "Dashboard C", widgets: [ { title: "FOO", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_foo", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", }, ], dateFilterConfig: { filterName: "Date range", hideGranularities: ["GDC.time.date"], mode: "active", }, }, { title: "Dashboard D", widgets: [ { title: "FOO_drill", visualizationUri: "/gdc/md/mockproject/obj/my_visualization_foo_drill", dateDataSetUri: "/gdc/md/mockproject/obj/date.dataset", drills: [ { drillToVisualization: { target: "pop-up", from: "bbb", toVisualization: "sss", }, }, ], }, ], dateFilterConfig: { filterName: "Date range", hideGranularities: ["GDC.time.date"], mode: "active", }, }, ], groups: [ { attributes: [ { title: "Employee", elements: ["John Doe", "Jane Doe", "Jim Doe"], }, { identifier: 1234, title: "Customer", elements: ["Company A", "Company B"], }, { identifier: 5555, title: "No data", elements: [], }, { identifier: 2345, title: "Country", elements: ["Country 1", "Country 2", "Country 3", "Country 4"], }, { identifier: 2346, title: "Continent", elements: ["Europe", "North America", "Asia"], drillDownStepAttributeDF: "2345.df", }, { identifier: 2347, title: "Color", elements: ["Red", "Blue", "Yellow", "Green"], }, { identifier: 2348, title: "Geo Pushpin", elements: ["Red", "Blue", "Yellow", "Green"], defaultDisplayFormType: "GDC.geo.pin", }, { identifier: 2349, title: "Attribute with multiple display forms", elements: ["Red", "Blue", "Yellow", "Green"], additionalDisplayForms: [ { identifier: "df.text", type: "text", }, { identifier: "df.hyperlink", type: "hyperlink", }, { identifier: "df.geoPin", type: "geoPin", }, ], }, ], dateDataSets: [ { title: "Date", finalDate: "12-31-2015", }, ], facts: [ { title: "Amount", values: [1, 2, 3], }, ], metrics: [ { expression: "SELECT 1", title: "Simple metric", }, { expression: "SELECT 2", identifier: 4321, title: "Simple metric 2", }, { title: "Default metric", }, { title: "Metric with format", format: "#0", }, { title: "non computable metric", identifier: "too_large", }, { title: "# of Opportunities", identifier: "savedm_1", }, ], }, ], project: { title: "My secret project", identifier: "mockproject", }, visualizationClasses: [ { title: "Column", url: "local:column", }, { title: "Table", url: "local:table", }, ], visualizationObjects: [ { type: "local:table", title: "My Sorted table", identifier: "my_sorted_table", buckets: [ { localIdentifier: "attribute", items: [ { localIdentifier: "attr.employee", displayForm: "attr.employee.df", }, ], }, { localIdentifier: "measures", items: [ { identifier: "simple_metric", localIdentifier: "simple_metric", }, ], }, ], properties: '{"sortItems":[{"attributeSortItem":{"attributeIdentifier":"attr.employee","direction":"asc"}}]}', // tslint:disable-line:max-line-length }, { type: "local:table", title: "Table with popMeasureDefinition derived measure", identifier: "my_visualization_a", filters: [ { type: "attribute", identifier: "attr.employee", negative: true, elements: [1], }, { type: "date", identifier: "1235", relative: true, from: -6, to: 0, granularity: "GDC.time.date", dataset: "65345", }, ], buckets: [ { localIdentifier: "attribute", items: [ { localIdentifier: "attr.employee", displayForm: "attr.employee", }, ], }, { localIdentifier: "measures", items: [ { identifier: "simple_metric", localIdentifier: "simple_metric", computeRatio: true, isDerived: true, measureIdentifier: "simple_metric", popAttribute: "date.dataset.year", }, ], }, ], }, { type: "local:table", title: "Table with previousPeriodMeasure derived measure", identifier: "my_previous_period_visualization", filters: [ { type: "attribute", identifier: "attr.employee", negative: true, elements: [1], }, { type: "date", identifier: "1235", relative: true, from: -6, to: 0, granularity: "GDC.time.date", dataset: "65345", }, ], buckets: [ { localIdentifier: "attribute", items: [ { localIdentifier: "attr.employee", displayForm: "attr.employee", }, ], }, { localIdentifier: "measures", items: [ { identifier: "simple_metric", localIdentifier: "simple_metric", computeRatio: true, isDerived: true, measureIdentifier: "simple_metric", previousPeriod: { dateDataSets: [ { dataSet: "date.dataset", periodsAgo: 1, }, ], }, }, ], }, ], }, { type: "local:table", title: "Table with arithmetic measure", identifier: "arithmetic_measure_table", filters: [], buckets: [ { localIdentifier: "attribute", items: [], }, { localIdentifier: "measures", items: [ { identifier: "measure1", localIdentifier: "measure1_local_id", title: "Simple measure 1", }, { identifier: "measure2", localIdentifier: "measure2_local_id", title: "Simple measure 2", }, { identifier: "arithmetic_measure", localIdentifier: "arithmetic_measure_local_id", title: "Sum of measure 1 & 2", isArithmetic: true, operator: "sum", measureIdentifiers: ["measure1_local_id", "measure2_local_id"], }, ], }, ], }, { type: "local:column", title: "Column chart", identifier: "my_visualization_b", author: "me", buckets: [ { localIdentifier: "measures", items: [ { localIdentifier: "second_simple_metric", identifier: "second_simple_metric", }, ], }, ], }, { type: "local:column", title: "Column chart with relative measure date filter", identifier: "my_visualization_c", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "metric_with_df", localIdentifier: "metric_with_df", filters: [ { identifier: "720", type: "date", relative: true, granularity: "GDC.time.quarter", from: "-7", to: "-7", dataset: "727", }, ], }, ], }, ], }, { type: "local:table", title: "Pivot table with grand totals and subtotals", identifier: "pivot_table_with_totals", author: "me", buckets: [ { localIdentifier: "measures", items: [ { localIdentifier: "m1", identifier: "simple-measure", }, ], }, { localIdentifier: "attributes", items: [ { localIdentifier: "a1", identifier: "first-row-attribute", }, { localIdentifier: "a2", identifier: "second-row-attribute", }, ], totals: [ // grand totals { type: "sum", measureIdentifier: "m1", attributeIdentifier: "a1", }, { type: "avg", measureIdentifier: "m1", attributeIdentifier: "a1", }, { type: "max", measureIdentifier: "m1", attributeIdentifier: "a1", }, { type: "min", measureIdentifier: "m1", attributeIdentifier: "a1", }, { type: "med", measureIdentifier: "m1", attributeIdentifier: "a1", }, { type: "nat", measureIdentifier: "m1", attributeIdentifier: "a1", }, // sub totals { type: "sum", measureIdentifier: "m1", attributeIdentifier: "a2", }, { type: "avg", measureIdentifier: "m1", attributeIdentifier: "a2", }, { type: "max", measureIdentifier: "m1", attributeIdentifier: "a2", }, { type: "min", measureIdentifier: "m1", attributeIdentifier: "a2", }, { type: "med", measureIdentifier: "m1", attributeIdentifier: "a2", }, { type: "nat", measureIdentifier: "m1", attributeIdentifier: "a2", }, ], }, { localIdentifier: "columns", items: [ { localIdentifier: "a3", identifier: "column-attribute", }, ], }, ], }, { type: "local:table", title: "Table with comparison measure value filter", identifier: "visualization_with_comparison_measure_value_filter", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, ], filters: [ { type: "measureComparison", identifier: "m1", operator: "GREATER_THAN", value: -7, }, ], }, { type: "local:table", title: "Table with range measure value filter", identifier: "visualization_with_range_measure_value_filter", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, ], filters: [ { type: "measureRange", identifier: "m1", operator: "BETWEEN", from: 10, to: 42, }, ], }, { type: "local:table", title: "Table with comparison measure value filter with treatNullValuesAs", identifier: "visualization_with_comparison_measure_value_filter_treat_null_values_as", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, ], filters: [ { type: "measureComparison", identifier: "m1", operator: "GREATER_THAN", value: -7, treatNullValuesAs: 500, }, ], }, { type: "local:table", title: "Table with range measure value filter with treatNullValuesAs", identifier: "visualization_with_range_measure_value_filter_treat_null_values_as", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, ], filters: [ { type: "measureRange", identifier: "m1", operator: "BETWEEN", from: 10, to: 42, treatNullValuesAs: 0, }, ], }, { type: "local:table", title: "Table with ranking filter with attributes", identifier: "visualization_with_ranking_filter_with_attributes", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, { localIdentifier: "attribute", items: [ { localIdentifier: "a1", displayForm: "attr.employee", }, { localIdentifier: "a2", displayForm: "attr.customer", }, ], }, ], filters: [ { type: "ranking", identifier: "m1", attributes: ["a1", "a2"], operator: "TOP", value: 3, }, ], }, { type: "local:table", title: "Table with ranking filter without attributes", identifier: "visualization_with_ranking_filter_without_attributes", author: "me", buckets: [ { localIdentifier: "measures", items: [ { identifier: "some_metric_id", localIdentifier: "m1", }, ], }, { localIdentifier: "attribute", items: [ { localIdentifier: "a1", displayForm: "attr.employee", }, { localIdentifier: "a2", displayForm: "attr.customer", }, ], }, ], filters: [ { type: "ranking", identifier: "m1", operator: "BOTTOM", value: 10, }, ], }, ], kpiAlerts: [ { author: "john-doe", kpiId: "fds_kpi", dashboardId: "dash.a", threshold: 30, isTriggered: true, whenTriggered: "underThreshold", filterContext: { title: "FD FC", filters: [ { attributeFilter: { attributeElements: [], displayForm: "/gdc/md/mockproject/obj/attr.account.df", negativeSelection: true, }, }, ], }, }, ], afmExecutions: [ { _description: "Too large report", execution: { execution: { afm: { measures: [ { localIdentifier: "asdf", definition: { measure: { item: { identifier: "too_large", }, }, }, }, ], }, }, }, executionResult: HttpStatusCodes.REQUEST_TOO_LONG, }, { _description: "One measure report", execution: { execution: { afm: { measures: [ { localIdentifier: "m1", definition: { measure: { item: { identifier: "savedm_1", }, }, }, }, ], }, }, }, executionResult: { executionResult: { data: [112], paging: { count: [1], offset: [1], total: [1], }, }, }, }, { _description: "One measure report with resultSpec", execution: { execution: { afm: { measures: [ { definition: { measure: { item: { identifier: "savedm_1", }, }, }, alias: "Amount", localIdentifier: "measure1", format: "#,##0.00", }, ], }, resultSpec: { dimensions: [ { itemIdentifiers: ["measureGroup"], }, { itemIdentifiers: [], }, ], }, }, }, executionResult: { executionResult: { data: ["116625456.54"], paging: { count: [1], offset: [1], total: [1], }, }, }, }, { _description: "One measure and attribute report", execution: { execution: { afm: { measures: [ { definition: { measure: { item: { identifier: "savedm_1", }, }, }, alias: "Amount", localIdentifier: "measure1", }, ], attributes: [ { displayForm: { identifier: "employee", }, localIdentifier: "attribute1", }, ], }, resultSpec: { dimensions: [ { itemIdentifiers: ["attribute1"], }, { itemIdentifiers: ["measureGroup"], }, ], }, }, }, executionResponse: { executionResponse: { dimensions: [ { headers: [ { attributeHeader: { name: "Employee", localIdentifier: "attribute1", uri: "/gdc/md/mockproject/obj/1027", identifier: "employee", formOf: { name: "Employee", uri: "/gdc/md/mockproject/obj/1026", identifier: "employee", }, }, }, ], }, { headers: [ { measureGroupHeader: { items: [ { measureHeaderItem: { format: "#,##0.00", identifier: "savedm_1", localIdentifier: "measure1", name: "Amount", uri: "/gdc/md/mockproject/obj/savedm_1", }, }, ], }, }, ], }, ], links: { executionResult: "/gdc/app/projects/mockproject/executionResults/f4a12b5e174abe402d2de394f99a8b?dimensions=2", }, }, }, executionResult: { executionResult: { data: [["42"], ["20"]], paging: { count: [2, 1], offset: [1], total: [2, 1], }, }, }, }, { _description: "One measure and attribute report for measure value filter testing", execution: { execution: { afm: { measures: [ { localIdentifier: "613d56c3ab474d038329e5b067f1de69", definition: { measure: { item: { uri: "/gdc/md/mockproject/obj/cinemas", }, }, }, alias: "# Cinemas", }, ], attributes: [ { displayForm: { uri: "/gdc/md/mockproject/obj/attr.movie_genre.df", }, localIdentifier: "d0e108ae5b114fada742f5a494b962e8", }, ], }, resultSpec: { sorts: [ { attributeSortItem: { attributeIdentifier: "d0e108ae5b114fada742f5a494b962e8", direction: "asc", }, }, ], dimensions: [ { itemIdentifiers: ["d0e108ae5b114fada742f5a494b962e8"] }, { itemIdentifiers: ["measureGroup"] }, ], }, }, }, executionResponse: { executionResponse: { links: { executionResult: "/gdc/app/projects/mockproject/executionResults/20f3501cf94949556f5948f7556fa85b?dimensions=2", }, dimensions: [ { headers: [ { attributeHeader: { identifier: "attr.movie_genre.df", uri: "/gdc/md/mockproject/obj/attr.movie_genre.df", name: "Movie genre", localIdentifier: "d0e108ae5b114fada742f5a494b962e8", formOf: { uri: "/gdc/md/mockproject/obj/attr.movie_genre", identifier: "attr.movie_genre", name: "Movie genre", }, }, }, ], }, { headers: [ { measureGroupHeader: { items: [ { measureHeaderItem: { identifier: "cinemas", uri: "/gdc/md/mockproject/obj/cinemas", localIdentifier: "613d56c3ab474d038329e5b067f1de69", format: "#", name: "# Cinemas", }, }, ], }, }, ], }, ], }, }, executionResult: { executionResult: { data: [["505"], ["42"], ["560"], ["229"]], headerItems: [ [ [ { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=2", name: "Action", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=3", name: "Adventure", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=1", name: "Comedy", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=4", name: "Sci-Fi", }, }, ], ], [ [ { measureHeaderItem: { name: "# Cinemas", order: 0, }, }, ], ], ], paging: { count: [4, 1], offset: [0, 0], total: [4, 1], }, }, }, }, { _description: "", execution: { execution: { afm: { measures: [ { localIdentifier: "1a4aec6ebcfa4f28a3eb8dcdd036aad8", definition: { measure: { item: { uri: "/gdc/md/mockproject/obj/viewers", }, }, }, alias: "# Viewers", }, ], attributes: [ { displayForm: { uri: "/gdc/md/mockproject/obj/attr.movie_genre.df", }, localIdentifier: "d0e108ae5b114fada742f5a494b962e8", }, ], filters: [ { measureValueFilter: { measure: { uri: "/gdc/md/mockproject/obj/cinemas", }, condition: { comparison: { operator: "GREATER_THAN", value: 500, }, }, }, }, ], }, resultSpec: { sorts: [ { attributeSortItem: { attributeIdentifier: "d0e108ae5b114fada742f5a494b962e8", direction: "asc", }, }, ], dimensions: [ { itemIdentifiers: ["d0e108ae5b114fada742f5a494b962e8"] }, { itemIdentifiers: ["measureGroup"] }, ], }, }, }, executionResponse: { executionResponse: { links: { executionResult: "/gdc/app/projects/mockproject/executionResults/feb2023e93333be09d4af88910e01056?dimensions=2", }, dimensions: [ { headers: [ { attributeHeader: { identifier: "attr.movie_genre.df", uri: "/gdc/md/mockproject/obj/attr.movie_genre.df", name: "Movie genre", localIdentifier: "d0e108ae5b114fada742f5a494b962e8", formOf: { uri: "/gdc/md/mockproject/obj/attr.movie_genre", identifier: "attr.movie_genre", name: "Movie genre", }, }, }, ], }, { headers: [ { measureGroupHeader: { items: [ { measureHeaderItem: { identifier: "viewers", uri: "/gdc/md/mockproject/obj/viewers", localIdentifier: "1a4aec6ebcfa4f28a3eb8dcdd036aad8", format: "#k", name: "# Viewers", }, }, ], }, }, ], }, ], }, }, executionResult: { executionResult: { data: [["150"], ["145"], ["203"], ["715"]], headerItems: [ [ [ { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=2", name: "Action", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=3", name: "Adventure", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=1", name: "Comedy", }, }, { attributeHeaderItem: { uri: "/gdc/md/mockproject/obj/attr.movie_genre/elements?id=4", name: "Sci-Fi", }, }, ], ], [ [ { measureHeaderItem: { name: "# Viewers", order: 0, }, }, ], ], ], paging: { count: [4, 1], offset: [0, 0], total: [4, 1], }, }, }, }, { _description: "Error response execution", execution: { execution: { afm: { measures: [ { localIdentifier: "asdf", definition: { measure: { item: { identifier: "error_response", }, }, }, }, ], }, }, }, executionResponse: HttpStatusCodes.INTERNAL_SERVER_ERROR, }, ], endPoints: { loadDateDatasetsMocks: [ { request: { dateDataSetsRequest: { requiredDataSets: { type: "PRODUCTION", }, bucketItems: [], includeUnavailableDateDataSetsCount: true, }, }, response: { dateDataSetsResponse: { dateDataSets: [], unavailableDateDataSetsCount: 0, }, }, }, ], }, dateFilterConfig: { absoluteForm: { localIdentifier: "absoluteFormIdentifier", name: "testName", visible: true, }, absolutePresets: [ { from: "2017-01-01", localIdentifier: "my_identifier_absolute", name: "my_name2", to: "2018-01-01", visible: true, }, ], allTime: { localIdentifier: "allTimeIdentifier", name: "testName", visible: true, }, relativeForm: { granularities: ["GDC.time.date", "GDC.time.year"], localIdentifier: "relativeFormIdentifier", name: "testName", visible: true, }, relativePresets: [ { from: 1, granularity: "GDC.time.year", localIdentifier: "my_identifier_relative", name: "my_name", to: 2, visible: true, }, ], selectedOption: "allTimeIdentifier", identifier: "defaultDateFilterConfig", title: "Date filter", }, };