Skip to content

Commit

Permalink
Use 0.1398.0 (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw authored Dec 6, 2024
1 parent e321b83 commit 990742a
Show file tree
Hide file tree
Showing 730 changed files with 18,983 additions and 1,380 deletions.
32 changes: 23 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Copyright 2024 yu-iskw
#
# Licensed 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
#
# https://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.

# The latest version in the main branch
LIGHTDASH_VERSION ?= main

# Set up an environment
.PHONEY: setup
setup: setup-python setup-pre-commit
Expand Down Expand Up @@ -38,20 +55,17 @@ test-publish:

generate-client:
rm -fr "lightdash_client/api/" "lightdash_client/models/"
bash dev/generate_clients.sh --skip-validate-spec 1
bash dev/generate_clients.sh

prepare-schema: download-swagger-json dereference-swagger-json

download-swagger-json: check-lightdash-version
bash dev/download_swagger_json.sh --version "$(VERSION)"
update-client: download-swagger-json dereference-swagger-json generate-client lint

dereference-swagger-json: build-swagger-cli-image
download-swagger-json:
bash dev/download_swagger_json.sh --version "$(LIGHTDASH_VERSION)"

dereference-swagger-json: build-swagger-cli-image/
bash dev/dereference_swagger_json.sh

build-swagger-cli-image:
docker build -t "swagger-cli:latest" -f "docker/swagger-cli/Dockerfile" .

check-lightdash-version:
ifndef VERSION
$(error VERSION is undefined)
endif
15 changes: 9 additions & 6 deletions dev/generate_clients.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ schema_json="${PROJECT_DIR}/dev/schemas/rebuilt-swagger.json"
config_yaml="${PROJECT_DIR}/dev/openapi-python-client.yml"
output_dir="${PROJECT_DIR}"
meta="setup"
skip_validate_spec=1
while (($# > 0)); do
if [[ "$1" == "--schema-json" ]]; then
schema_json="${2:?}"
Expand All @@ -40,9 +39,6 @@ while (($# > 0)); do
elif [[ "$1" == "--meta" ]]; then
meta="${2:?}"
shift 2
elif [[ "$1" == "--skip-validate-spec" ]]; then
skip_validate_spec="${2:?}"
shift 2
else
echo "ERROR: Unrecognized argument ${1}" >&2
exit 1
Expand All @@ -60,10 +56,17 @@ openapi-python-client generate \
--meta "${meta:?}" \
"${options[@]}"

ls -la "${temp_dir:?}/lightdash-client-python"
# Check the generated project
generated_project_dir="${temp_dir:?}/lightdash-client-python"
ls -la "${generated_project_dir:?}"

# Replace the default auth method from Bearer to ApiKey
sed -i -e "s/Bearer/ApiKey/" "${generated_project_dir:?}/lightdash_client/client.py"

# Copy the files
cp -apR "${temp_dir:?}/lightdash-client-python/"* "${output_dir:?}"
rsync -a -r --delete-after "${generated_project_dir:?}/lightdash_client/models/" "${output_dir:?}/lightdash_client/models/"
rsync -a -r --delete-after "${generated_project_dir:?}/lightdash_client/api/" "${output_dir:?}/lightdash_client/api/"
rsync -a -r --delete-after "${generated_project_dir:?}/lightdash_client/client.py" "${output_dir:?}/lightdash_client/client.py"

# Remove the temporary directory
rm -fr "${temp_dir:?}"
4 changes: 4 additions & 0 deletions dev/openapi-python-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ package_name_override: lightdash_client
package_version_override: 0.2.0

http_timeout: 30

# Format code using the pre-commit hooks of ruff
# SEE https://github.com/openapi-generators/openapi-python-client
post_hooks: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"properties": {
"results": {
"items": {
"$ref": "./ChartAsCode.json"
},
"type": "array"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./PromotionChanges.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./Dashboard.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./GroupWithMembers.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"properties": {
"results": {
"properties": {
"tagUuid": {
"type": "string"
}
},
"required": [
"tagUuid"
],
"type": "object"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./Pick_Explore.name_.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"properties": {
"results": {
"items": {
"$ref": "./DashboardAsCode.json"
},
"type": "array"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./PromotionChanges.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"properties": {
"results": {
"items": {
"$ref": "./DashboardBasicDetailsWithTileTypes.json"
},
"type": "array"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
19 changes: 19 additions & 0 deletions dev/schemas/split-swagger/components/schemas/ApiGetMetricPeek.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./MetricWithAssociatedTimeDimension.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"properties": {
"results": {
"properties": {
"edges": {
"items": {
"$ref": "./CatalogMetricsTreeEdge.json"
},
"type": "array"
}
},
"required": [
"edges"
],
"type": "object"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"properties": {
"results": {
"items": {
"$ref": "./Tag.json"
},
"type": "array"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"properties": {
"results": {
"$ref": "./PullRequestCreated.json"
},
"status": {
"type": "string",
"enum": [
"ok"
],
"nullable": false
}
},
"required": [
"results",
"status"
],
"type": "object"
}
Loading

0 comments on commit 990742a

Please sign in to comment.