diff --git a/.circleci/config.yml b/.circleci/config.yml index 3df35c70..95c736fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -214,7 +214,7 @@ jobs: name: Install Maven & Curl command: | apt-get update - apt-get install maven curl --yes + apt-get install maven curl wget --yes - run: name: Checks generating sources from swagger command: | diff --git a/.gitignore b/.gitignore index 305ddde1..7231d6a1 100644 --- a/.gitignore +++ b/.gitignore @@ -102,4 +102,8 @@ SourceKitten/ # Junit junit.xml -tests.xml \ No newline at end of file +tests.xml + +Scripts/cloud.yml +Scripts/oss.yml +Scripts/influxdb-clients-apigen/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index d43a57fe..6fbf8dae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## 1.0.0 [unreleased] +### Bug Fixes +1. [#46](https://github.com/influxdata/influxdb-client-swift/pull/46): Add missing PermissionResources from Cloud API definition + ## 0.9.0 [2021-11-26] ### Documentation diff --git a/Scripts/generate-sources.sh b/Scripts/generate-sources.sh index 6b0d66f9..2e68d090 100755 --- a/Scripts/generate-sources.sh +++ b/Scripts/generate-sources.sh @@ -2,13 +2,22 @@ # # How to run script from ROOT path: -# docker run --rm -it -v "${PWD}":/code -v ~/.m2:/root/.m2 -w /code maven:3.6-slim /code/Scripts/generate-sources.sh +# docker run --rm -it -v "${PWD}":/code -v ~/.m2:/root/.m2 -w /code maven:3-openjdk-8 /code/Scripts/generate-sources.sh # SCRIPT_PATH="$( cd "$(dirname "$0")" || exit ; pwd -P )" rm -rf "${SCRIPT_PATH}"/generated +# Download and merge OSS and Cloud definition +rm -rf "${SCRIPT_PATH}"/oss.yml || true +rm -rf "${SCRIPT_PATH}"/cloud.yml || true +rm -rf "${SCRIPT_PATH}"/influxdb-clients-apigen || true +wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml -O "${SCRIPT_PATH}/oss.yml" +wget https://raw.githubusercontent.com/influxdata/openapi/master/contracts/cloud.yml -O "${SCRIPT_PATH}/cloud.yml" +git clone --single-branch --branch master https://github.com/bonitoo-io/influxdb-clients-apigen "${SCRIPT_PATH}/influxdb-clients-apigen" +mvn -f "$SCRIPT_PATH"/influxdb-clients-apigen/openapi-generator/pom.xml compile exec:java -Dexec.mainClass="com.influxdb.AppendCloudDefinitions" -Dexec.args="$SCRIPT_PATH/oss.yml $SCRIPT_PATH/cloud.yml" + # Generate client cd "${SCRIPT_PATH}"/ || exit mvn org.openapitools:openapi-generator-maven-plugin:generate diff --git a/Scripts/pom.xml b/Scripts/pom.xml index a9aeba96..1dcc0e3f 100644 --- a/Scripts/pom.xml +++ b/Scripts/pom.xml @@ -14,7 +14,7 @@ openapi-generator-maven-plugin 5.1.0 - https://raw.githubusercontent.com/influxdata/openapi/master/contracts/oss.yml + ./oss.yml swift5 InfluxDB2 diff --git a/Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift b/Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift index be8e54e3..d69a9734 100644 --- a/Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift +++ b/Sources/InfluxDBSwiftApis/Generated/Models/Resource.swift @@ -29,6 +29,11 @@ public struct Resource: Codable { case checks = "checks" case dbrp = "dbrp" case notebooks = "notebooks" + case annotations = "annotations" + case remotes = "remotes" + case replications = "replications" + case flows = "flows" + case functions = "functions" } public var type: ModelType /** If ID is set that is a permission for a specific resource. if it is not set it is a permission for all resources of that resource type. */