Skip to content
Snippets Groups Projects
Select Git revision
  • 907d4cebfd22c5dccabd6052c590508df1e69af5
  • master default protected
  • gitkeep
  • dev protected
  • Issue/2464-invalidateMeta
  • Issue/2309-docs
  • Issue/2462-removeTraces
  • Hotfix/2459-EncodingPath
  • Hotfix/2452-linkedDeletion
  • Issue/1792-newMetadataStructure
  • Hotfix/2371-fixGitLabinRCV
  • Fix/xxxx-activateGitlab
  • Issue/2349-gitlabHttps
  • Issue/2287-guestRole
  • Issue/2102-gitLabResTypeRCV
  • Hotfix/2254-fixContentLenghtCalculation
  • Fix/xxxx-resourceVisibility
  • Issue/1951-quotaImplementation
  • Issue/2162-fixFolderResponse
  • Issue/2158-emailServicedesk
  • Hotfix/2141-fileUploadErrors
  • v3.3.4
  • v3.3.3
  • v3.3.2
  • v3.3.1
  • v3.3.0
  • v3.2.3
  • v3.2.2
  • v3.2.1
  • v3.2.0
  • v3.1.2
  • v3.1.1
  • v3.1.0
  • v3.0.6
  • v3.0.5
  • v3.0.4
  • v3.0.3
  • v3.0.2
  • v3.0.1
  • v3.0.0
  • v2.8.2
41 results

nunit3-junit.xslt

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    generate-api-client.sh 2.34 KiB
    #!/bin/bash
    
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # Generate TypeScript API Client using OpenAPI Generator:
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # This script generates a TypeScript API client based on the OpenAPI specification.
    #
    # The actions performed are:
    # - Generating the API client code using podman (make sure it's available).
    # - Deleting existing API client source files.
    # - Copying the newly generated API client source to the project directory.
    # - Cleaning up temporary files.
    #
    # Defined variables:
    OUTPUT_DIR="temp"                                     # The temporary directory for generated files
    PACKAGE_NAME="Coscine.Api"                            # The package name for the API client
    API_SPEC_URL="https://coscine-hristov.web.vulcanus.otc.coscine.dev/coscine/api/swagger/v2/swagger.json" # URL to the OpenAPI spec file
    # --------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    # ANSI color codes for styling
    GREEN='\033[0;32m'
    YELLOW='\033[0;33m'
    CYAN='\033[0;36m'
    NC='\033[0m' # No Color
    
    # Run the OpenAPI generator
    echo -e "${CYAN}Running the OpenAPI generator...${NC}"
    podman run --rm \
      -v ${PWD}:/local openapitools/openapi-generator-cli generate \
      -i "$API_SPEC_URL" \
      -g typescript-axios \
      -o /local/$OUTPUT_DIR \
      --additional-properties=useSingleRequestParameter=true,apiPackage=@coscine/api,modelPackage=@coscine/model,withSeparateModelsAndApi=true,enumPropertyNaming=original \
      --skip-validate-spec
    
    echo -e "${GREEN}API client generation complete.${NC}"
    
    # Delete the current API client source
    echo -e "${YELLOW}Deleting current API client source...${NC}"
    rm -rf "src/$PACKAGE_NAME"
    
    # Copy the generated API client source to the src directory
    echo -e "${CYAN}Copying generated API client source to src directory...${NC}"
    cp -r "$OUTPUT_DIR/" "src/$PACKAGE_NAME"
    
    # Remove the temp directory
    echo -e "${YELLOW}Cleaning up...${NC}"
    rm -rf "$OUTPUT_DIR"
    
    echo -e "${GREEN}Finished.${NC}"
    
    echo -e "${YELLOW}Don't forget to add newly generated apis to apis.ts and index.ts!!${NC}"