diff --git a/.github/workflows/superset-docs-deploy.yml b/.github/workflows/superset-docs-deploy.yml index b827889eb15..19e0430f0a3 100644 --- a/.github/workflows/superset-docs-deploy.yml +++ b/.github/workflows/superset-docs-deploy.yml @@ -47,10 +47,12 @@ jobs: java-version: '21' - name: Install Graphviz run: sudo apt-get install -y graphviz - - name: Compute Entity Relationship diagram (ERD) + - name: Generate documentation artifacts env: SUPERSET_SECRET_KEY: not-a-secret + CI: true run: | + # Generate ERD python scripts/erd/erd.py curl -L http://sourceforge.net/projects/plantuml/files/1.2023.7/plantuml.1.2023.7.jar/download > ~/plantuml.jar java -jar ~/plantuml.jar -v -tsvg -r -o "${{ github.workspace }}/docs/static/img/" "${{ github.workspace }}/scripts/erd/erd.puml" diff --git a/.github/workflows/superset-docs-verify.yml b/.github/workflows/superset-docs-verify.yml index 2862541e32d..bf2f260931e 100644 --- a/.github/workflows/superset-docs-verify.yml +++ b/.github/workflows/superset-docs-verify.yml @@ -64,6 +64,11 @@ jobs: uses: actions/setup-node@v4 with: node-version-file: './docs/.nvmrc' + - name: Setup Python Backend + uses: ./.github/actions/setup-backend + with: + python-version: 'current' + requirements-type: 'base' - name: yarn install run: | yarn install --check-cache diff --git a/docs/package.json b/docs/package.json index 15ba8dd901a..5aebfdfced4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -6,7 +6,7 @@ "scripts": { "docusaurus": "docusaurus", "_init": "cat src/intro_header.txt ../README.md > docs/intro.md", - "_update-config": "bash scripts/update_docs.sh", + "_update-config": "bash scripts/generate_docs.sh", "start": "yarn run _init && yarn run _update-config && docusaurus start", "build": "yarn run _init && yarn run _update-config && DEBUG=docusaurus:* docusaurus build", "swizzle": "docusaurus swizzle", diff --git a/docs/scripts/export_config_metadata.py b/docs/scripts/export_config_metadata.py index 15f93dda6ab..e2260836cae 100644 --- a/docs/scripts/export_config_metadata.py +++ b/docs/scripts/export_config_metadata.py @@ -4,6 +4,9 @@ Export configuration metadata to JSON for documentation generation. This script extracts configuration metadata from SupersetConfig and generates JSON files that can be imported into the documentation site. + +This script is called by docs/scripts/generate_docs.sh as part of the +unified documentation generation process. """ import sys diff --git a/docs/scripts/update_docs.sh b/docs/scripts/update_docs.sh deleted file mode 100755 index d91e687c0b5..00000000000 --- a/docs/scripts/update_docs.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache 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 -# -# http://www.apache.org/licenses/LICENSE-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. - -# Update documentation with latest configuration metadata -# This script should be run before building the documentation - -set -e - -echo "Updating configuration metadata for documentation..." - -# Navigate to the docs directory -cd "$(dirname "$0")/.." - -# Export configuration metadata -echo "Exporting configuration metadata..." -python scripts/export_config_metadata.py - -echo "Configuration metadata updated successfully!" -echo "The following files were updated:" -echo "- src/resources/config_metadata.json" -echo "" -echo "To build the documentation with the latest metadata:" -echo " npm install" -echo " npm run build" diff --git a/docs/static/resources/openapi.json b/docs/static/resources/openapi.json index bb8858fb6cc..616e1e39144 100644 --- a/docs/static/resources/openapi.json +++ b/docs/static/resources/openapi.json @@ -258,7 +258,8 @@ "", "opacityLow", "opacityMedium", - "opacityHigh" + "opacityHigh", + null ], "nullable": true, "type": "string" @@ -1030,7 +1031,8 @@ "1969-12-28T00:00:00Z/P1W", "1969-12-29T00:00:00Z/P1W", "P1W/1970-01-03T00:00:00Z", - "P1W/1970-01-04T00:00:00Z" + "P1W/1970-01-04T00:00:00Z", + null ], "example": "P1D", "nullable": true, @@ -1512,7 +1514,8 @@ "samples", "timegrains", "post_processed", - "drill_detail" + "drill_detail", + null ], "nullable": true }, @@ -2232,7 +2235,8 @@ "dataset", "query", "saved_query", - "view" + "view", + null ], "nullable": true, "type": "string" @@ -3057,7 +3061,8 @@ "dataset", "query", "saved_query", - "view" + "view", + null ], "nullable": true, "type": "string" @@ -3291,6 +3296,27 @@ }, "type": "object" }, + "CurrentUserPutSchema": { + "properties": { + "first_name": { + "description": "The current user's first name", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + "last_name": { + "description": "The current user's last name", + "maxLength": 64, + "minLength": 1, + "type": "string" + }, + "password": { + "description": "The current user's password for authentication", + "type": "string" + } + }, + "type": "object" + }, "DashboardCacheScreenshotResponseSchema": { "properties": { "cache_key": { @@ -5145,6 +5171,21 @@ ], "type": "object" }, + "DatasetMetricCurrencyPut": { + "properties": { + "symbol": { + "maxLength": 128, + "minLength": 1, + "type": "string" + }, + "symbolPosition": { + "maxLength": 128, + "minLength": 1, + "type": "string" + } + }, + "type": "object" + }, "DatasetMetricRestApi.get": { "properties": { "id": { @@ -5180,10 +5221,12 @@ "DatasetMetricsPut": { "properties": { "currency": { - "maxLength": 128, - "minLength": 1, - "nullable": true, - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/DatasetMetricCurrencyPut" + } + ], + "nullable": true }, "d3format": { "maxLength": 128, @@ -5862,6 +5905,10 @@ "maxLength": 250, "minLength": 1, "type": "string" + }, + "template_params": { + "nullable": true, + "type": "string" } }, "required": [ @@ -6434,6 +6481,290 @@ ], "type": "object" }, + "GroupApi.get": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + }, + "roles": { + "$ref": "#/components/schemas/GroupApi.get.Role" + }, + "users": { + "$ref": "#/components/schemas/GroupApi.get.User" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get.Role": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get.User": { + "properties": { + "id": { + "type": "integer" + }, + "username": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + }, + "GroupApi.get_list": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + }, + "roles": { + "$ref": "#/components/schemas/GroupApi.get_list.Role" + }, + "users": { + "$ref": "#/components/schemas/GroupApi.get_list.User" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get_list.Role": { + "properties": { + "id": { + "type": "integer" + }, + "name": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.get_list.User": { + "properties": { + "id": { + "type": "integer" + }, + "username": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "username" + ], + "type": "object" + }, + "GroupApi.post": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupApi.put": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + }, + "GroupPostSchema": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "name" + ], + "type": "object" + }, + "GroupPutSchema": { + "properties": { + "description": { + "description": "Group description", + "maxLength": 512, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "label": { + "description": "Group label", + "maxLength": 150, + "minLength": 0, + "nullable": true, + "type": "string" + }, + "name": { + "description": "Group name", + "maxLength": 100, + "minLength": 1, + "type": "string" + }, + "roles": { + "description": "Group roles", + "items": { + "type": "integer" + }, + "type": "array" + }, + "users": { + "description": "Group users", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "type": "object" + }, "GuestTokenCreate": { "properties": { "resources": { @@ -6621,21 +6952,68 @@ "user": { "$ref": "#/components/schemas/LogRestApi.get.User" }, - "user_id": { - "nullable": true, - "type": "integer" - } + "user_id": {} }, "type": "object" }, "LogRestApi.get.User": { "properties": { + "active": { + "nullable": true, + "type": "boolean" + }, + "changed_on": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "created_on": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "email": { + "maxLength": 320, + "type": "string" + }, + "fail_login_count": { + "nullable": true, + "type": "integer" + }, + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_login": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "login_count": { + "nullable": true, + "type": "integer" + }, + "password": { + "maxLength": 256, + "nullable": true, + "type": "string" + }, "username": { "maxLength": 64, "type": "string" } }, "required": [ + "email", + "first_name", + "last_name", "username" ], "type": "object" @@ -6676,21 +7054,68 @@ "user": { "$ref": "#/components/schemas/LogRestApi.get_list.User" }, - "user_id": { - "nullable": true, - "type": "integer" - } + "user_id": {} }, "type": "object" }, "LogRestApi.get_list.User": { "properties": { + "active": { + "nullable": true, + "type": "boolean" + }, + "changed_on": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "created_on": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "email": { + "maxLength": 320, + "type": "string" + }, + "fail_login_count": { + "nullable": true, + "type": "integer" + }, + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_login": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "login_count": { + "nullable": true, + "type": "integer" + }, + "password": { + "maxLength": 256, + "nullable": true, + "type": "string" + }, "username": { "maxLength": 64, "type": "string" } }, "required": [ + "email", + "first_name", + "last_name", "username" ], "type": "object" @@ -6857,27 +7282,15 @@ }, "PermissionViewMenuApi.post": { "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } + "permission_id": {}, + "view_menu_id": {} }, "type": "object" }, "PermissionViewMenuApi.put": { "properties": { - "permission_id": { - "nullable": true, - "type": "integer" - }, - "view_menu_id": { - "nullable": true, - "type": "integer" - } + "permission_id": {}, + "view_menu_id": {} }, "type": "object" }, @@ -7871,10 +8284,7 @@ "changed_on_delta_humanized": { "readOnly": true }, - "chart_id": { - "nullable": true, - "type": "integer" - }, + "chart_id": {}, "created_by": { "$ref": "#/components/schemas/ReportScheduleRestApi.get_list.User1" }, @@ -7895,10 +8305,7 @@ "crontab_humanized": { "readOnly": true }, - "dashboard_id": { - "nullable": true, - "type": "integer" - }, + "dashboard_id": {}, "description": { "nullable": true, "type": "string" @@ -8230,6 +8637,7 @@ "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -8782,7 +9190,8 @@ "enum": [ "charts", "dashboards", - "alerts_reports" + "alerts_reports", + null ], "nullable": true }, @@ -8971,6 +9380,7 @@ "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", + "America/Coyhaique", "America/Creston", "America/Cuiaba", "America/Curacao", @@ -9486,7 +9896,8 @@ "description": "Determines when to trigger alert based off value from alert query. Alerts will be triggered with these validator types:\n- Not Null - When the return value is Not NULL, Empty, or 0\n- Operator - When `sql_return_value comparison_operator threshold` is True e.g. `50 <= 75`
Supports the comparison operators <, <=, >, >=, ==, and !=", "enum": [ "not null", - "operator" + "operator", + null ], "nullable": true, "type": "string" @@ -9532,6 +9943,21 @@ ], "type": "object" }, + "RoleGroupPutSchema": { + "properties": { + "group_ids": { + "description": "List of group ids", + "items": { + "type": "integer" + }, + "type": "array" + } + }, + "required": [ + "group_ids" + ], + "type": "object" + }, "RolePermissionListSchema": { "properties": { "id": { @@ -9806,10 +10232,7 @@ "database": { "$ref": "#/components/schemas/SavedQueryRestApi.get_list.Database" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -9933,10 +10356,7 @@ "nullable": true, "type": "string" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -9973,10 +10393,7 @@ "nullable": true, "type": "string" }, - "db_id": { - "nullable": true, - "type": "integer" - }, + "db_id": {}, "description": { "nullable": true, "type": "string" @@ -10027,6 +10444,54 @@ }, "type": "object" }, + "SettingsRestApi.get": { + "properties": { + "key": { + "maxLength": 255, + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, + "SettingsRestApi.get_list": { + "properties": { + "key": { + "maxLength": 255, + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, + "SettingsRestApi.post": { + "properties": { + "key": { + "maxLength": 255, + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, + "SettingsRestApi.put": { + "properties": { + "key": { + "maxLength": 255, + "type": "string" + } + }, + "required": [ + "key" + ], + "type": "object" + }, "Slice": { "properties": { "cache_timeout": { @@ -10240,6 +10705,9 @@ "maxLength": 64, "type": "string" }, + "groups": { + "$ref": "#/components/schemas/SupersetUserApi.get.Group" + }, "id": { "type": "integer" }, @@ -10272,6 +10740,31 @@ ], "type": "object" }, + "SupersetUserApi.get.Group": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "SupersetUserApi.get.Role": { "properties": { "id": { @@ -10337,6 +10830,9 @@ "maxLength": 64, "type": "string" }, + "groups": { + "$ref": "#/components/schemas/SupersetUserApi.get_list.Group" + }, "id": { "type": "integer" }, @@ -10369,6 +10865,31 @@ ], "type": "object" }, + "SupersetUserApi.get_list.Group": { + "properties": { + "description": { + "maxLength": 512, + "nullable": true, + "type": "string" + }, + "id": { + "type": "integer" + }, + "label": { + "maxLength": 150, + "nullable": true, + "type": "string" + }, + "name": { + "maxLength": 100, + "type": "string" + } + }, + "required": [ + "name" + ], + "type": "object" + }, "SupersetUserApi.get_list.Role": { "properties": { "id": { @@ -10414,6 +10935,13 @@ "description": "The user's first name", "type": "string" }, + "groups": { + "description": "The user's roles", + "items": { + "type": "integer" + }, + "type": "array" + }, "last_name": { "description": "The user's last name", "type": "string" @@ -10427,7 +10955,6 @@ "items": { "type": "integer" }, - "minItems": 1, "type": "array" }, "username": { @@ -10442,7 +10969,6 @@ "first_name", "last_name", "password", - "roles", "username" ], "type": "object" @@ -10461,6 +10987,13 @@ "description": "The user's first name", "type": "string" }, + "groups": { + "description": "The user's roles", + "items": { + "type": "integer" + }, + "type": "array" + }, "last_name": { "description": "The user's last name", "type": "string" @@ -10474,7 +11007,6 @@ "items": { "type": "integer" }, - "minItems": 1, "type": "array" }, "username": { @@ -11364,6 +11896,70 @@ }, "type": "object" }, + "UserRegistrationsRestAPI.get": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, + "UserRegistrationsRestAPI.get_list": { + "properties": { + "email": { + "maxLength": 64, + "type": "string" + }, + "first_name": { + "maxLength": 64, + "type": "string" + }, + "id": { + "type": "integer" + }, + "last_name": { + "maxLength": 64, + "type": "string" + }, + "registration_date": { + "format": "date-time", + "nullable": true, + "type": "string" + }, + "registration_hash": { + "maxLength": 256, + "nullable": true, + "type": "string" + }, + "username": { + "maxLength": 64, + "type": "string" + } + }, + "required": [ + "email", + "first_name", + "last_name", + "username" + ], + "type": "object" + }, + "UserRegistrationsRestAPI.post": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, + "UserRegistrationsRestAPI.put": { + "properties": { + "id": { + "type": "integer" + } + }, + "type": "object" + }, "UserResponseSchema": { "properties": { "email": { @@ -11384,6 +11980,9 @@ "last_name": { "type": "string" }, + "login_count": { + "type": "integer" + }, "username": { "type": "string" } @@ -21370,6 +21969,46 @@ "tags": [ "Current User" ] + }, + "put": { + "description": "Updates the current user's first name, last name, or password.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CurrentUserPutSchema" + } + } + }, + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/UserResponseSchema" + } + }, + "type": "object" + } + } + }, + "description": "User updated successfully" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + } + }, + "summary": "Update the current user", + "tags": [ + "Current User" + ] } }, "/api/v1/me/roles/": { @@ -24115,6 +24754,462 @@ ] } }, + "/api/v1/security/groups/": { + "get": { + "description": "Get a list of models", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_list_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total record count on the backend", + "type": "number" + }, + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "ids": { + "description": "A list of item ids, useful when you don't know the column id", + "items": { + "type": "string" + }, + "type": "array" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "list_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "list_title": { + "description": "A title to render. Will be translated by babel", + "example": "List Items", + "type": "string" + }, + "order_columns": { + "description": "A list of allowed columns to sort", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "description": "The result from the get list query", + "items": { + "$ref": "#/components/schemas/GroupApi.get_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Items from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupPostSchema" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/GroupPostSchema" + } + }, + "type": "object" + } + } + }, + "description": "Group created" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + } + }, + "/api/v1/security/groups/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + } + }, + "/api/v1/security/groups/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item deleted" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "get": { + "description": "Get an item model", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The item id", + "type": "string" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "$ref": "#/components/schemas/GroupApi.get" + }, + "show_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "show_title": { + "description": "A title to render. Will be translated by babel", + "example": "Show Item Details", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + }, + "put": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GroupPutSchema" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/GroupPutSchema" + } + }, + "type": "object" + } + } + }, + "description": "Group updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Groups" + ] + } + }, "/api/v1/security/guest_token/": { "post": { "requestBody": { @@ -26059,6 +27154,71 @@ ] } }, + "/api/v1/security/roles/{role_id}/groups": { + "put": { + "parameters": [ + { + "in": "path", + "name": "role_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RoleGroupPutSchema" + } + } + }, + "description": "Update role groups schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/RoleGroupPutSchema" + } + }, + "type": "object" + } + } + }, + "description": "Role groups updated" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "Security Roles" + ] + } + }, "/api/v1/security/roles/{role_id}/permissions": { "post": { "parameters": [ @@ -26243,6 +27403,581 @@ ] } }, + "/api/v1/security/user_registrations/": { + "get": { + "description": "Get a list of models", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_list_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total record count on the backend", + "type": "number" + }, + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "ids": { + "description": "A list of item ids, useful when you don't know the column id", + "items": { + "type": "string" + }, + "type": "array" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "list_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "list_title": { + "description": "A title to render. Will be translated by babel", + "example": "List Items", + "type": "string" + }, + "order_columns": { + "description": "A list of allowed columns to sort", + "items": { + "type": "string" + }, + "type": "array" + }, + "result": { + "description": "The result from the get list query", + "items": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.get_list" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Items from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "post": { + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.post" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string" + }, + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.post" + } + }, + "type": "object" + } + } + }, + "description": "Item inserted" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/distinct/{column_name}": { + "get": { + "parameters": [ + { + "in": "path", + "name": "column_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_related_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DistincResponseSchema" + } + } + }, + "description": "Distinct field data" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get distinct values from field data", + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/related/{column_name}": { + "get": { + "parameters": [ + { + "in": "path", + "name": "column_name", + "required": true, + "schema": { + "type": "string" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_related_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RelatedResponseSchema" + } + } + }, + "description": "Related column data" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "summary": "Get related fields data", + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, + "/api/v1/security/user_registrations/{pk}": { + "delete": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item deleted" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "get": { + "description": "Get an item model", + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_item_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "description_columns": { + "properties": { + "column_name": { + "description": "The description for the column name. Will be translated by babel", + "example": "A Nice description for the column", + "type": "string" + } + }, + "type": "object" + }, + "id": { + "description": "The item id", + "type": "string" + }, + "label_columns": { + "properties": { + "column_name": { + "description": "The label for the column name. Will be translated by babel", + "example": "A Nice label for the column", + "type": "string" + } + }, + "type": "object" + }, + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.get" + }, + "show_columns": { + "description": "A list of columns", + "items": { + "type": "string" + }, + "type": "array" + }, + "show_title": { + "description": "A title to render. Will be translated by babel", + "example": "Show Item Details", + "type": "string" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + }, + "put": { + "parameters": [ + { + "in": "path", + "name": "pk", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.put" + } + } + }, + "description": "Model schema", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "result": { + "$ref": "#/components/schemas/UserRegistrationsRestAPI.put" + } + }, + "type": "object" + } + } + }, + "description": "Item changed" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "UserRegistrationsRestAPI" + ] + } + }, "/api/v1/security/users/": { "get": { "description": "Get a list of models", @@ -26702,6 +28437,121 @@ ] } }, + "/api/v1/settings/": { + "get": { + "tags": [ + "SettingsRestApi" + ] + }, + "post": { + "tags": [ + "SettingsRestApi" + ] + } + }, + "/api/v1/settings/_info": { + "get": { + "description": "Get metadata information about this API resource", + "parameters": [ + { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/get_info_schema" + } + } + }, + "in": "query", + "name": "q" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "properties": { + "add_columns": { + "type": "object" + }, + "edit_columns": { + "type": "object" + }, + "filters": { + "properties": { + "column_name": { + "items": { + "properties": { + "name": { + "description": "The filter name. Will be translated by babel", + "type": "string" + }, + "operator": { + "description": "The filter operation key to use on list filters", + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + } + }, + "type": "object" + }, + "permissions": { + "description": "The user permissions for this API resource", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + } + } + }, + "description": "Item from Model" + }, + "400": { + "$ref": "#/components/responses/400" + }, + "401": { + "$ref": "#/components/responses/401" + }, + "422": { + "$ref": "#/components/responses/422" + }, + "500": { + "$ref": "#/components/responses/500" + } + }, + "security": [ + { + "jwt": [] + } + ], + "tags": [ + "SettingsRestApi" + ] + } + }, + "/api/v1/settings/{pk}": { + "delete": { + "tags": [ + "SettingsRestApi" + ] + }, + "get": { + "tags": [ + "SettingsRestApi" + ] + }, + "put": { + "tags": [ + "SettingsRestApi" + ] + } + }, "/api/v1/sqllab/": { "get": { "description": "Assembles SQLLab bootstrap data (active_tab, databases, queries, tab_state_ids) in a single endpoint. The data can be assembled from the current user's id.", diff --git a/superset/db_engine_specs/singlestore.py b/superset/db_engine_specs/singlestore.py index 27df97ff9b9..9dba3e452a5 100644 --- a/superset/db_engine_specs/singlestore.py +++ b/superset/db_engine_specs/singlestore.py @@ -21,7 +21,7 @@ from datetime import datetime from typing import Any, Optional from urllib import parse -from flask import current_app as app +from flask import current_app from sqlalchemy import types from sqlalchemy.engine import URL @@ -498,8 +498,8 @@ class SingleStoreSpec(BasicParametersMixin, BaseEngineSpec): "conn_attrs", { "_connector_name": "SingleStore Superset Database Engine", - "_connector_version": app.config.get("VERSION_STRING", "dev"), - "_product_version": app.config.get("VERSION_STRING", "dev"), + "_connector_version": current_app.config.get("VERSION_STRING", "dev"), + "_product_version": current_app.config.get("VERSION_STRING", "dev"), }, ) return uri, connect_args