From d3dd30cdc0f7b862733893a5d95d742eb4946efc Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 12 Feb 2025 12:46:16 +0100 Subject: [PATCH 1/3] fix: add script and workflow to generate core types - only from selected shipped apps, as defined by script Signed-off-by: Maksim Sukharev --- .../workflows/update-nextcloud-openapi.yml | 80 +++++++++++++++++++ package.json | 1 + src/types/generate-core-types.sh | 40 ++++++++++ 3 files changed, 121 insertions(+) create mode 100644 .github/workflows/update-nextcloud-openapi.yml create mode 100755 src/types/generate-core-types.sh diff --git a/.github/workflows/update-nextcloud-openapi.yml b/.github/workflows/update-nextcloud-openapi.yml new file mode 100644 index 00000000000..d3257f5a579 --- /dev/null +++ b/.github/workflows/update-nextcloud-openapi.yml @@ -0,0 +1,80 @@ +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: MIT + +name: Update nextcloud/openapi + +on: + workflow_dispatch: + schedule: + - cron: "5 4 * * 0" + +jobs: + update-nextcloud-openapi: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + branches: ['main', 'master', 'stable31', 'stable30'] + + name: Update Nextcloud OpenAPI types from core + + steps: + - name: Set app env + run: | + # Split and keep last + echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV + + - name: Checkout server + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + submodules: true + repository: nextcloud/server + ref: ${{ matrix.server-versions }} + + - name: Checkout app + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + with: + path: apps/${{ env.APP_NAME }} + ref: ${{ matrix.branches }} + + - name: Read package.json node and npm engines version + uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3 + id: versions + with: + fallbackNode: '^20' + fallbackNpm: '^10' + + - name: Set up node ${{ steps.versions.outputs.nodeVersion }} + uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3 + with: + node-version: ${{ steps.versions.outputs.nodeVersion }} + + - name: Set up npm ${{ steps.versions.outputs.npmVersion }} + run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}' + + - name: Install dependencies & generate types + working-directory: apps/${{ env.APP_NAME }} + env: + CYPRESS_INSTALL_BINARY: 0 + PUPPETEER_SKIP_DOWNLOAD: true + run: | + npm ci + npm run typescript:generate-core-types --if-present + + - name: Create Pull Request + if: steps.checkout.outcome == 'success' + uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6.1.0 + with: + token: ${{ secrets.COMMAND_BOT_PAT }} + commit-message: 'chore(ts): update OpenAPI types from core' + committer: GitHub + author: nextcloud-command + signoff: true + branch: 'automated/noid/${{ matrix.branches }}-update-nextcloud-openapi' + title: '[${{ matrix.branches }}] Update Nextcloud OpenAPI types' + body: | + Auto-generated update of Nextcloud OpenAPI types + labels: | + dependencies + 3. to review diff --git a/package.json b/package.json index 5abd8aaec92..07d48c8d8d4 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "serve": "node --max-old-space-size=4096 ./node_modules/webpack/bin/webpack.js serve --node-env development --progress --allowed-hosts all", "typescript:check": "vue-tsc --noEmit", "typescript:generate": "npx openapi-typescript -t", + "typescript:generate-core-types": "./src/types/generate-core-types.sh", "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage", diff --git a/src/types/generate-core-types.sh b/src/types/generate-core-types.sh new file mode 100755 index 00000000000..7ca6aad7572 --- /dev/null +++ b/src/types/generate-core-types.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# +# SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors +# SPDX-License-Identifier: AGPL-3.0-only +# + +# By default is expected that pwd returns //spreed +SERVER_DIR="${1:-$(dirname $(dirname $(pwd)))}" +TYPES_DIR="$(pwd)/src/types" +CORE_TYPES_OUTPUT_DIR="$TYPES_DIR/openapi/core" +TEMP_DIR="$TYPES_DIR/tmp" + +# Create the temporary directory if it doesn't exist +mkdir -p "$CORE_TYPES_OUTPUT_DIR" +mkdir -p "$TEMP_DIR" + +# Find and copy openapi.json files, then translate to ts types +generate_ts_files() { + local full_path=$1 + local file_name=$2 + local openapi_file="$SERVER_DIR/$full_path/$file_name" + local temp_file="$TEMP_DIR/openapi_${full_path#apps/}.json" + local ts_file="$CORE_TYPES_OUTPUT_DIR/openapi_${full_path#apps/}.ts" + + if [ -f "$openapi_file" ]; then + cp "$openapi_file" "$temp_file" + else + echo "Error: $openapi_file is not found" + return 1 + fi + + npx openapi-typescript --redocly $TYPES_DIR "$temp_file" -t -o "$ts_file" +} + +generate_ts_files "core" "openapi.json" +generate_ts_files "apps/files_sharing" "openapi.json" +generate_ts_files "apps/dav" "openapi.json" +generate_ts_files "apps/provisioning_api" "openapi.json" + +rm -rf "$TEMP_DIR" From ad2958acd8154b03e74c475ec7b63223aaafdc52 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 12 Feb 2025 14:04:47 +0100 Subject: [PATCH 2/3] chore: generate core types Signed-off-by: Maksim Sukharev --- src/types/openapi/core/openapi_core.ts | 4710 +++++++++++++++++ src/types/openapi/core/openapi_dav.ts | 494 ++ .../openapi/core/openapi_provisioning_api.ts | 1721 ++++++ 3 files changed, 6925 insertions(+) create mode 100644 src/types/openapi/core/openapi_core.ts create mode 100644 src/types/openapi/core/openapi_dav.ts create mode 100644 src/types/openapi/core/openapi_provisioning_api.ts diff --git a/src/types/openapi/core/openapi_core.ts b/src/types/openapi/core/openapi_core.ts new file mode 100644 index 00000000000..faa00d68d38 --- /dev/null +++ b/src/types/openapi/core/openapi_core.ts @@ -0,0 +1,4710 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export type paths = { + "/ocs/v2.php/core/getapppassword": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Create app password + * @description This endpoint requires password confirmation + */ + get: operations["app_password-get-app-password"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/apppassword": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Delete app password */ + delete: operations["app_password-delete-app-password"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/apppassword/rotate": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Rotate app password */ + post: operations["app_password-rotate-app-password"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/apppassword/confirm": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** Confirm the user password */ + put: operations["app_password-confirm-user-password"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/autocomplete/get": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Autocomplete a query */ + get: operations["auto_complete-get"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/collaboration/resources/collections/{collectionId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a collection */ + get: operations["collaboration_resources-list-collection"]; + /** Rename a collection */ + put: operations["collaboration_resources-rename-collection"]; + /** Add a resource to a collection */ + post: operations["collaboration_resources-add-resource"]; + /** Remove a resource from a collection */ + delete: operations["collaboration_resources-remove-resource"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/collaboration/resources/collections/search/{filter}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Search for collections */ + get: operations["collaboration_resources-search-collections"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/collaboration/resources/{resourceType}/{resourceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get collections by resource */ + get: operations["collaboration_resources-get-collections-by-resource"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/collaboration/resources/{baseResourceType}/{baseResourceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a collection for a resource */ + post: operations["collaboration_resources-create-collection-on-resource"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/hovercard/v1/{userId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the account details for a hovercard */ + get: operations["hover_card-get-user"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/navigation/apps": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the apps navigation */ + get: operations["navigation-get-apps-navigation"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/navigation/settings": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the settings navigation */ + get: operations["navigation-get-settings-navigation"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/capabilities": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the capabilities */ + get: operations["ocs-get-capabilities"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/profile/{targetUserId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Update the visibility of a parameter + * @description This endpoint requires password confirmation + */ + put: operations["profile_api-set-visibility"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/extract": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Extract references from a text */ + post: operations["reference_api-extract"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/extractPublic": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Extract references from a text */ + post: operations["reference_api-extract-public"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/resolve": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Resolve a reference */ + get: operations["reference_api-resolve-one"]; + put?: never; + /** Resolve multiple references */ + post: operations["reference_api-resolve"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/resolvePublic": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Resolve from a public page */ + get: operations["reference_api-resolve-one-public"]; + put?: never; + /** Resolve multiple references from a public page */ + post: operations["reference_api-resolve-public"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/providers": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the providers */ + get: operations["reference_api-get-providers-info"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/references/provider/{providerId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** Touch a provider */ + put: operations["reference_api-touch-provider"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/tasktypes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns all available TaskProcessing task types */ + get: operations["task_processing_api-task-types"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/schedule": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Schedules a task */ + post: operations["task_processing_api-schedule"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/task/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Gets a task including status and result + * @description Tasks are removed 1 week after receiving their last update + */ + get: operations["task_processing_api-get-task"]; + put?: never; + post?: never; + /** Deletes a task */ + delete: operations["task_processing_api-delete-task"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/tasks/app/{appId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns tasks for the current user filtered by the appId and optional customId */ + get: operations["task_processing_api-list-tasks-by-app"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/tasks": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns tasks for the current user filtered by the optional taskType and optional customId */ + get: operations["task_processing_api-list-tasks"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/tasks/{taskId}/file/{fileId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns the contents of a file referenced in a task */ + get: operations["task_processing_api-get-file-contents"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/taskprocessing/tasks/{taskId}/cancel": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Cancels a task */ + post: operations["task_processing_api-cancel-task"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/teams/{teamId}/resources": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all resources of a team */ + get: operations["teams_api-resolve-one"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/teams/resources/{providerId}/{resourceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get all teams of a resource */ + get: operations["teams_api-list-teams"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/textprocessing/tasktypes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint returns all available LanguageModel task types */ + get: operations["text_processing_api-task-types"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/textprocessing/schedule": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** This endpoint allows scheduling a language model task */ + post: operations["text_processing_api-schedule"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/textprocessing/task/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update. */ + get: operations["text_processing_api-get-task"]; + put?: never; + post?: never; + /** This endpoint allows to delete a scheduled task for a user */ + delete: operations["text_processing_api-delete-task"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/textprocessing/tasks/app/{appId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier */ + get: operations["text_processing_api-list-tasks-by-app"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/text2image/is_available": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Check whether this feature is available */ + get: operations["text_to_image_api-is-available"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/text2image/schedule": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** This endpoint allows scheduling a text to image task */ + post: operations["text_to_image_api-schedule"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/text2image/task/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint allows checking the status and results of a task. Tasks are removed 1 week after receiving their last update. */ + get: operations["text_to_image_api-get-task"]; + put?: never; + post?: never; + /** This endpoint allows to delete a scheduled task for a user */ + delete: operations["text_to_image_api-delete-task"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/text2image/task/{id}/image/{index}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint allows downloading the resulting image of a task */ + get: operations["text_to_image_api-get-image"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/text2image/tasks/app/{appId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** This endpoint returns a list of tasks of a user that are related with a specific appId and optionally with an identifier */ + get: operations["text_to_image_api-list-tasks-by-app"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/translation/languages": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the list of supported languages */ + get: operations["translation_api-languages"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/translation/translate": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Translate a text */ + post: operations["translation_api-translate"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/search/providers": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the providers for unified search */ + get: operations["unified_search-get-providers"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/search/providers/{providerId}/search": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Launch a search for a specific search provider. + * @description Additional filters are available for each provider. Send a request to /providers endpoint to list providers with their available filters. + */ + get: operations["unified_search-search"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/core/whatsnew": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the changes */ + get: operations["whats_new-get"]; + put?: never; + /** Dismiss the changes */ + post: operations["whats_new-dismiss"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/avatar/{userId}/{size}/dark": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the dark avatar */ + get: operations["avatar-get-avatar-dark"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/avatar/{userId}/{size}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the avatar */ + get: operations["avatar-get-avatar"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/csrftoken": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns a new CSRF token. */ + get: operations["csrf_token-index"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/login/v2/poll": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Poll the login flow credentials */ + post: operations["client_flow_login_v2-poll"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/login/v2": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Init a login flow */ + post: operations["client_flow_login_v2-init"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/avatar/guest/{guestName}/{size}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns a guest avatar image response */ + get: operations["guest_avatar-get-avatar"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/avatar/guest/{guestName}/{size}/dark": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Returns a dark guest avatar image response */ + get: operations["guest_avatar-get-avatar-dark"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/login/confirm": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Confirm the user password */ + post: operations["login-confirm-password"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/ocm-provider": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** generate a OCMProvider with local data and send it as DataResponse. This replaces the old PHP file ocm-provider/index.php */ + get: operations["ocm-discovery"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/preview.png": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a preview by file path */ + get: operations["preview-get-preview"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/preview": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a preview by file ID */ + get: operations["preview-get-preview-by-file-id"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/mimeicon": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a preview by mime */ + get: operations["preview-get-mime-icon-url"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/references/preview/{referenceId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a preview for a reference */ + get: operations["reference-preview"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/wipe/check": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Check if the device should be wiped */ + post: operations["wipe-check-wipe"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/index.php/core/wipe/success": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Finish the wipe */ + post: operations["wipe-wipe-done"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/status.php": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get: operations["get-status"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +}; +export type webhooks = Record; +export type components = { + schemas: { + AutocompleteResult: { + id: string; + label: string; + icon: string; + source: string; + status: { + status: string; + message: string | null; + icon: string | null; + /** Format: int64 */ + clearAt: number | null; + } | string; + subline: string; + shareWithDisplayNameUnique: string; + }; + Capabilities: { + core: { + /** Format: int64 */ + pollinterval: number; + "webdav-root": string; + "reference-api": boolean; + "reference-regex": string; + "mod-rewrite-working": boolean; + }; + }; + Collection: { + /** Format: int64 */ + id: number; + name: string; + resources: components["schemas"]["Resource"][]; + }; + ContactsAction: { + title: string; + icon: string; + hyperlink: string; + appId: string; + }; + LoginFlowV2: { + poll: { + token: string; + endpoint: string; + }; + login: string; + }; + LoginFlowV2Credentials: { + server: string; + loginName: string; + appPassword: string; + }; + NavigationEntry: { + id: string; + /** Format: int64 */ + order?: number; + href: string; + icon: string; + type: string; + name: string; + app?: string; + default?: boolean; + active: boolean; + classes: string; + /** Format: int64 */ + unread: number; + }; + OCSMeta: { + status: string; + statuscode: number; + message?: string; + totalitems?: string; + itemsperpage?: string; + }; + OpenGraphObject: { + id: string; + name: string; + description: string | null; + thumb: string | null; + link: string; + }; + PublicCapabilities: { + bruteforce: { + /** Format: int64 */ + delay: number; + "allow-listed": boolean; + }; + }; + Reference: { + richObjectType: string; + richObject: { + [key: string]: Record | null; + }; + openGraphObject: components["schemas"]["OpenGraphObject"]; + accessible: boolean; + }; + ReferenceProvider: { + id: string; + title: string; + icon_url: string; + /** Format: int64 */ + order: number; + search_providers_ids: string[] | null; + }; + Resource: { + richObjectType: string; + richObject: { + [key: string]: Record | null; + }; + openGraphObject: components["schemas"]["OpenGraphObject"]; + accessible: boolean; + }; + Status: { + installed: boolean; + maintenance: boolean; + needsDbUpgrade: boolean; + version: string; + versionstring: string; + edition: string; + productname: string; + extendedSupport: boolean; + }; + TaskProcessingIO: { + [key: string]: number | number[] | string | string[]; + }; + TaskProcessingShape: { + name: string; + description: string; + /** @enum {string} */ + type: "Number" | "Text" | "Audio" | "Image" | "Video" | "File" | "Enum" | "ListOfNumbers" | "ListOfTexts" | "ListOfImages" | "ListOfAudios" | "ListOfVideos" | "ListOfFiles"; + }; + TaskProcessingTask: { + /** Format: int64 */ + id: number; + /** Format: int64 */ + lastUpdated: number; + type: string; + /** @enum {string} */ + status: "STATUS_CANCELLED" | "STATUS_FAILED" | "STATUS_SUCCESSFUL" | "STATUS_RUNNING" | "STATUS_SCHEDULED" | "STATUS_UNKNOWN"; + userId: string | null; + appId: string; + input: components["schemas"]["TaskProcessingIO"]; + output: components["schemas"]["TaskProcessingIO"]; + customId: string | null; + /** Format: int64 */ + completionExpectedAt: number | null; + /** Format: double */ + progress: number | null; + /** Format: int64 */ + scheduledAt: number | null; + /** Format: int64 */ + startedAt: number | null; + /** Format: int64 */ + endedAt: number | null; + }; + TaskProcessingTaskType: { + name: string; + description: string; + inputShape: { + [key: string]: components["schemas"]["TaskProcessingShape"]; + }; + inputShapeEnumValues: { + [key: string]: { + name: string; + value: string; + }[]; + }; + inputShapeDefaults: { + [key: string]: number | string; + }; + optionalInputShape: { + [key: string]: components["schemas"]["TaskProcessingShape"]; + }; + optionalInputShapeEnumValues: { + [key: string]: { + name: string; + value: string; + }[]; + }; + optionalInputShapeDefaults: { + [key: string]: number | string; + }; + outputShape: { + [key: string]: components["schemas"]["TaskProcessingShape"]; + }; + outputShapeEnumValues: { + [key: string]: { + name: string; + value: string; + }[]; + }; + optionalOutputShape: { + [key: string]: components["schemas"]["TaskProcessingShape"]; + }; + optionalOutputShapeEnumValues: { + [key: string]: { + name: string; + value: string; + }[]; + }; + }; + Team: { + id: string; + name: string; + icon: string; + }; + TeamResource: { + /** Format: int64 */ + id: number; + label: string; + url: string; + iconSvg: string | null; + iconURL: string | null; + iconEmoji: string | null; + }; + TextProcessingTask: { + /** Format: int64 */ + id: number | null; + type: string; + /** + * Format: int64 + * @enum {integer} + */ + status: 0 | 1 | 2 | 3 | 4; + userId: string | null; + appId: string; + input: string; + output: string | null; + identifier: string; + /** Format: int64 */ + completionExpectedAt: number | null; + }; + TextToImageTask: { + /** Format: int64 */ + id: number | null; + /** + * Format: int64 + * @enum {integer} + */ + status: 0 | 1 | 2 | 3 | 4; + userId: string | null; + appId: string; + input: string; + identifier: string | null; + /** Format: int64 */ + numberOfImages: number; + /** Format: int64 */ + completionExpectedAt: number | null; + }; + UnifiedSearchProvider: { + id: string; + appId: string; + name: string; + icon: string; + /** Format: int64 */ + order: number; + triggers: string[]; + filters: { + [key: string]: string; + }; + inAppSearch: boolean; + }; + UnifiedSearchResult: { + name: string; + isPaginated: boolean; + entries: components["schemas"]["UnifiedSearchResultEntry"][]; + cursor: (number | string) | null; + }; + UnifiedSearchResultEntry: { + thumbnailUrl: string; + title: string; + subline: string; + resourceUrl: string; + icon: string; + rounded: boolean; + attributes: string[]; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +}; +export type $defs = Record; +export interface operations { + "app_password-get-app-password": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description App password returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + apppassword: string; + }; + }; + }; + }; + }; + /** @description Creating app password is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "app_password-delete-app-password": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description App password deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Deleting app password is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "app_password-rotate-app-password": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description App password returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + apppassword: string; + }; + }; + }; + }; + }; + /** @description Rotating app password is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "app_password-confirm-user-password": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description The password of the user */ + password: string; + }; + }; + }; + responses: { + /** @description Password confirmation succeeded */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** Format: int64 */ + lastLogin: number; + }; + }; + }; + }; + }; + /** @description Password confirmation failed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "auto_complete-get": { + parameters: { + query: { + /** @description Text to search for */ + search: string; + /** @description Type of the items to search for */ + itemType?: string | null; + /** @description ID of the items to search for */ + itemId?: string | null; + /** @description can be piped, top prio first, e.g.: "commenters|share-recipients" */ + sorter?: string | null; + /** @description Types of shares to search for */ + "shareTypes[]"?: number[]; + /** @description Maximum number of results to return */ + limit?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Autocomplete results returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["AutocompleteResult"][]; + }; + }; + }; + }; + }; + }; + "collaboration_resources-list-collection": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the collection */ + collectionId: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Collection returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"]; + }; + }; + }; + }; + /** @description Collection not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-rename-collection": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the collection */ + collectionId: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description New name */ + collectionName: string; + }; + }; + }; + responses: { + /** @description Collection returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"]; + }; + }; + }; + }; + /** @description Collection not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-add-resource": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the collection */ + collectionId: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Name of the resource */ + resourceType: string; + /** @description ID of the resource */ + resourceId: string; + }; + }; + }; + responses: { + /** @description Collection returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"]; + }; + }; + }; + }; + /** @description Collection not found or resource inaccessible */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-remove-resource": { + parameters: { + query: { + /** @description Name of the resource */ + resourceType: string; + /** @description ID of the resource */ + resourceId: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the collection */ + collectionId: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Collection returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"]; + }; + }; + }; + }; + /** @description Collection or resource not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-search-collections": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description Filter collections */ + filter: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Collections returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"][]; + }; + }; + }; + }; + /** @description Collection not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-get-collections-by-resource": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description Type of the resource */ + resourceType: string; + /** @description ID of the resource */ + resourceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Collections returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"][]; + }; + }; + }; + }; + /** @description Resource not accessible */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "collaboration_resources-create-collection-on-resource": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description Type of the base resource */ + baseResourceType: string; + /** @description ID of the base resource */ + baseResourceId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Name of the collection */ + name: string; + }; + }; + }; + responses: { + /** @description Collection returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["Collection"]; + }; + }; + }; + }; + /** @description Creating collection is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Resource inaccessible */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "hover_card-get-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Account details returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + userId: string; + displayName: string; + actions: components["schemas"]["ContactsAction"][]; + }; + }; + }; + }; + }; + /** @description Account not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "navigation-get-apps-navigation": { + parameters: { + query?: { + /** @description Rewrite URLs to absolute ones */ + absolute?: 0 | 1; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Apps navigation returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["NavigationEntry"][]; + }; + }; + }; + }; + /** @description No apps navigation changed */ + 304: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "navigation-get-settings-navigation": { + parameters: { + query?: { + /** @description Rewrite URLs to absolute ones */ + absolute?: 0 | 1; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Apps navigation returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["NavigationEntry"][]; + }; + }; + }; + }; + /** @description No apps navigation changed */ + 304: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "ocs-get-capabilities": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Capabilities returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + version: { + /** Format: int64 */ + major: number; + /** Format: int64 */ + minor: number; + /** Format: int64 */ + micro: number; + string: string; + edition: string; + extendedSupport: boolean; + }; + capabilities: { + [key: string]: Record; + }; + }; + }; + }; + }; + }; + }; + }; + "profile_api-set-visibility": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + targetUserId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description ID of the parameter */ + paramId: string; + /** @description New visibility */ + visibility: string; + }; + }; + }; + responses: { + /** @description Visibility updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Updating visibility is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Not allowed to edit other users visibility */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Account not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "reference_api-extract": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Text to extract from */ + text: string; + /** + * @description Resolve the references + * @default false + */ + resolve?: boolean; + /** + * Format: int64 + * @description Maximum amount of references to extract + * @default 1 + */ + limit?: number; + }; + }; + }; + responses: { + /** @description References returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-extract-public": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Text to extract from */ + text: string; + /** @description Token of the public share */ + sharingToken: string; + /** + * @description Resolve the references + * @default false + */ + resolve?: boolean; + /** + * Format: int64 + * @description Maximum amount of references to extract, limited to 15 + * @default 1 + */ + limit?: number; + }; + }; + }; + responses: { + /** @description References returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-resolve-one": { + parameters: { + query: { + /** @description Reference to resolve */ + reference: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Reference returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-resolve": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description References to resolve */ + references: string[]; + /** + * Format: int64 + * @description Maximum amount of references to resolve + * @default 1 + */ + limit?: number; + }; + }; + }; + responses: { + /** @description References returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-resolve-one-public": { + parameters: { + query: { + /** @description Reference to resolve */ + reference: string; + /** @description Token of the public share */ + sharingToken: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Reference returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-resolve-public": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description References to resolve */ + references: string[]; + /** @description Token of the public share */ + sharingToken: string; + /** + * Format: int64 + * @description Maximum amount of references to resolve, limited to 15 + * @default 1 + */ + limit?: number; + }; + }; + }; + responses: { + /** @description References returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + references: { + [key: string]: components["schemas"]["Reference"]; + }; + }; + }; + }; + }; + }; + }; + }; + "reference_api-get-providers-info": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Providers returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["ReferenceProvider"][]; + }; + }; + }; + }; + }; + }; + "reference_api-touch-provider": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the provider */ + providerId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * Format: int64 + * @description Timestamp of the last usage + */ + timestamp?: number | null; + }; + }; + }; + responses: { + /** @description Provider touched */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + success: boolean; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-task-types": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task types returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + types: { + [key: string]: components["schemas"]["TaskProcessingTaskType"]; + }; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-schedule": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Task's input parameters */ + input: { + [key: string]: Record; + }; + /** @description Type of the task */ + type: string; + /** @description ID of the app that will execute the task */ + appId: string; + /** + * @description An arbitrary identifier for the task + * @default + */ + customId?: string; + /** @description URI to be requested when the task finishes */ + webhookUri?: string | null; + /** @description Method used for the webhook request (HTTP:GET, HTTP:POST, HTTP:PUT, HTTP:DELETE or AppAPI:APP_ID:GET, AppAPI:APP_ID:POST...) */ + webhookMethod?: string | null; + }; + }; + }; + responses: { + /** @description Task scheduled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TaskProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Scheduling task is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Cannot schedule task because it references files in its input that the user doesn't have access to */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Scheduling task is not possible */ + 412: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-get-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TaskProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-delete-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-list-tasks-by-app": { + parameters: { + query?: { + /** @description An arbitrary identifier for the task */ + customId?: string | null; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Tasks returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + tasks: components["schemas"]["TaskProcessingTask"][]; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-list-tasks": { + parameters: { + query?: { + /** @description The task type to filter by */ + taskType?: string | null; + /** @description An arbitrary identifier for the task */ + customId?: string | null; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Tasks returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + tasks: components["schemas"]["TaskProcessingTask"][]; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-get-file-contents": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + taskId: number; + /** @description The file id of the file to retrieve */ + fileId: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description File content returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Task or file not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "task_processing_api-cancel-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + taskId: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task canceled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TaskProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "teams_api-resolve-one": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description Unique id of the team */ + teamId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Resources returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + resources: components["schemas"]["TeamResource"][]; + }; + }; + }; + }; + }; + }; + }; + "teams_api-list-teams": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description Identifier of the provider (e.g. deck, talk, collectives) */ + providerId: string; + /** @description Unique id of the resource to list teams for (e.g. deck board id) */ + resourceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Teams returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + teams: components["schemas"]["Team"][]; + }; + }; + }; + }; + }; + }; + }; + "text_processing_api-task-types": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task types returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + types: { + id: string; + name: string; + description: string; + }[]; + }; + }; + }; + }; + }; + }; + }; + "text_processing_api-schedule": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Input text */ + input: string; + /** @description Type of the task */ + type: string; + /** @description ID of the app that will execute the task */ + appId: string; + /** + * @description An arbitrary identifier for the task + * @default + */ + identifier?: string; + }; + }; + }; + responses: { + /** @description Task scheduled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Scheduling task is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + /** @description Scheduling task is not possible */ + 412: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_processing_api-get-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_processing_api-delete-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextProcessingTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_processing_api-list-tasks-by-app": { + parameters: { + query?: { + /** @description An arbitrary identifier for the task */ + identifier?: string | null; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task list returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + tasks: components["schemas"]["TextProcessingTask"][]; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-is-available": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Returns availability status */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + isAvailable: boolean; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-schedule": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Input text */ + input: string; + /** @description ID of the app that will execute the task */ + appId: string; + /** + * @description An arbitrary identifier for the task + * @default + */ + identifier?: string; + /** + * Format: int64 + * @description The number of images to generate + * @default 8 + */ + numberOfImages?: number; + }; + }; + }; + responses: { + /** @description Task scheduled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextToImageTask"]; + }; + }; + }; + }; + }; + /** @description Scheduling task is not possible */ + 412: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-get-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextToImageTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-delete-task": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + task: components["schemas"]["TextToImageTask"]; + }; + }; + }; + }; + }; + /** @description Task not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-get-image": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The id of the task */ + id: number; + /** @description The index of the image to retrieve */ + index: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Image returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Task or image not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "text_to_image_api-list-tasks-by-app": { + parameters: { + query?: { + /** @description An arbitrary identifier for the task */ + identifier?: string | null; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Task list returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + tasks: components["schemas"]["TextToImageTask"][]; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + "translation_api-languages": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Supported languages returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + languages: { + from: string; + fromLabel: string; + to: string; + toLabel: string; + }[]; + languageDetection: boolean; + }; + }; + }; + }; + }; + }; + }; + "translation_api-translate": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Text to be translated */ + text: string; + /** @description Language to translate from */ + fromLanguage?: string | null; + /** @description Language to translate to */ + toLanguage: string; + }; + }; + }; + responses: { + /** @description Translated text returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + text: string; + from: string | null; + }; + }; + }; + }; + }; + /** @description Language not detected or unable to translate */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + from?: string | null; + }; + }; + }; + }; + }; + /** @description Translating is not possible */ + 412: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + from?: string | null; + }; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + message: string; + from?: string | null; + }; + }; + }; + }; + }; + }; + }; + "unified_search-get-providers": { + parameters: { + query?: { + /** @description the url the user is currently at */ + from?: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Providers returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UnifiedSearchProvider"][]; + }; + }; + }; + }; + }; + }; + "unified_search-search": { + parameters: { + query?: { + /** @description Term to search */ + term?: string; + /** @description Order of entries */ + sortOrder?: number | null; + /** @description Maximum amount of entries, limited to 25 */ + limit?: number | null; + /** @description Offset for searching */ + cursor?: (number | string) | null; + /** @description The current user URL */ + from?: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the provider */ + providerId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Search entries returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UnifiedSearchResult"]; + }; + }; + }; + }; + /** @description Searching is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: string; + }; + }; + }; + }; + }; + }; + "whats_new-get": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Changes returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + changelogURL: string; + product: string; + version: string; + whatsNew?: { + regular: string[]; + admin: string[]; + }; + }; + }; + }; + }; + }; + /** @description No changes */ + 204: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "whats_new-dismiss": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Version to dismiss the changes for */ + version: string; + }; + }; + }; + responses: { + /** @description Changes dismissed */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "text/plain": string; + }; + }; + }; + }; + "avatar-get-avatar-dark": { + parameters: { + query?: { + /** @description Fallback to guest avatar if not found */ + guestFallback?: 0 | 1; + }; + header?: never; + path: { + /** @description ID of the user */ + userId: string; + /** @description Size of the avatar */ + size: 64 | 512; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Avatar returned */ + 200: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar returned */ + 201: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "avatar-get-avatar": { + parameters: { + query?: { + /** @description Fallback to guest avatar if not found */ + guestFallback?: 0 | 1; + }; + header?: never; + path: { + /** @description ID of the user */ + userId: string; + /** @description Size of the avatar */ + size: 64 | 512; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Avatar returned */ + 200: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar returned */ + 201: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "csrf_token-index": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description CSRF token returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + token: string; + }; + }; + }; + /** @description Strict cookie check failed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "client_flow_login_v2-poll": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Token of the flow */ + token: string; + }; + }; + }; + responses: { + /** @description Login flow credentials returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["LoginFlowV2Credentials"]; + }; + }; + /** @description Login flow not found or completed */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "client_flow_login_v2-init": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Login flow init returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["LoginFlowV2"]; + }; + }; + }; + }; + "guest_avatar-get-avatar": { + parameters: { + query?: { + /** @description Return dark avatar */ + darkTheme?: 0 | 1 | null; + }; + header?: never; + path: { + /** @description The guest name, e.g. "Albert" */ + guestName: string; + /** @description The desired avatar size, e.g. 64 for 64x64px */ + size: 64 | 512; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Custom avatar returned */ + 200: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar returned */ + 201: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "guest_avatar-get-avatar-dark": { + parameters: { + query?: never; + header?: never; + path: { + /** @description The guest name, e.g. "Albert" */ + guestName: string; + /** @description The desired avatar size, e.g. 64 for 64x64px */ + size: 64 | 512; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Custom avatar returned */ + 200: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Avatar returned */ + 201: { + headers: { + "X-NC-IsCustomAvatar"?: number; + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + 500: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "login-confirm-password": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description The password of the user */ + password: string; + }; + }; + }; + responses: { + /** @description Password confirmation succeeded */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + /** Format: int64 */ + lastLogin: number; + }; + }; + }; + /** @description Password confirmation failed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "ocm-discovery": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description OCM Provider details returned */ + 200: { + headers: { + "X-NEXTCLOUD-OCM-PROVIDERS"?: true; + [name: string]: unknown; + }; + content: { + "application/json": { + enabled: boolean; + apiVersion: string; + endPoint: string; + resourceTypes: { + name: string; + shareTypes: string[]; + protocols: { + webdav: string; + }; + }[]; + }; + }; + }; + /** @description OCM not supported */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + message: string; + }; + }; + }; + }; + }; + "preview-get-preview": { + parameters: { + query?: { + /** @description Path of the file */ + file?: string; + /** @description Width of the preview. A width of -1 will use the original image width. */ + x?: number; + /** @description Height of the preview. A height of -1 will use the original image height. */ + y?: number; + /** @description Preserve the aspect ratio */ + a?: 0 | 1; + /** @description Force returning an icon */ + forceIcon?: 0 | 1; + /** @description How to crop the image */ + mode?: "fill" | "cover"; + /** @description Whether to fallback to the mime icon if no preview is available */ + mimeFallback?: 0 | 1; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Preview returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Redirect to the mime icon url if mimeFallback is true */ + 303: { + headers: { + Location?: string; + [name: string]: unknown; + }; + content?: never; + }; + /** @description Getting preview is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + /** @description Getting preview is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + /** @description Preview not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "preview-get-preview-by-file-id": { + parameters: { + query?: { + /** @description ID of the file */ + fileId?: number; + /** @description Width of the preview. A width of -1 will use the original image width. */ + x?: number; + /** @description Height of the preview. A height of -1 will use the original image height. */ + y?: number; + /** @description Preserve the aspect ratio */ + a?: 0 | 1; + /** @description Force returning an icon */ + forceIcon?: 0 | 1; + /** @description How to crop the image */ + mode?: "fill" | "cover"; + /** @description Whether to fallback to the mime icon if no preview is available */ + mimeFallback?: 0 | 1; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Preview returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Redirect to the mime icon url if mimeFallback is true */ + 303: { + headers: { + Location?: string; + [name: string]: unknown; + }; + content?: never; + }; + /** @description Getting preview is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + /** @description Getting preview is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + /** @description Preview not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "preview-get-mime-icon-url": { + parameters: { + query?: { + /** @description Mime type */ + mime?: string; + }; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description The mime icon url */ + 303: { + headers: { + Location?: string; + [name: string]: unknown; + }; + content?: never; + }; + }; + }; + "reference-preview": { + parameters: { + query?: never; + header?: never; + path: { + /** @description the reference cache key */ + referenceId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Preview returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "*/*": string; + }; + }; + /** @description Reference not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": string; + }; + }; + }; + }; + "wipe-check-wipe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description App password */ + token: string; + }; + }; + }; + responses: { + /** @description Device should be wiped */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + wipe: boolean; + }; + }; + }; + /** @description Device should not be wiped */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "wipe-wipe-done": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description App password */ + token: string; + }; + }; + }; + responses: { + /** @description Wipe finished successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + /** @description Device should not be wiped */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": unknown; + }; + }; + }; + }; + "get-status": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Status returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Status"]; + }; + }; + }; + }; +} diff --git a/src/types/openapi/core/openapi_dav.ts b/src/types/openapi/core/openapi_dav.ts new file mode 100644 index 00000000000..51d30af600e --- /dev/null +++ b/src/types/openapi/core/openapi_dav.ts @@ -0,0 +1,494 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export type paths = { + "/ocs/v2.php/apps/dav/api/v1/direct": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Get a direct link to a file */ + post: operations["direct-get-url"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/dav/api/v1/events/upcoming": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get information about upcoming events */ + get: operations["upcoming_events-get-events"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}/now": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the currently configured out-of-office data of a user */ + get: operations["out_of_office-get-current-out-of-office-data"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/dav/api/v1/outOfOffice/{userId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the configured out-of-office data of a user. */ + get: operations["out_of_office-get-out-of-office"]; + put?: never; + /** Set out-of-office absence */ + post: operations["out_of_office-set-out-of-office"]; + /** Clear the out-of-office */ + delete: operations["out_of_office-clear-out-of-office"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +}; +export type webhooks = Record; +export type components = { + schemas: { + Capabilities: { + dav: { + chunking: string; + bulkupload?: string; + "absence-supported"?: boolean; + "absence-replacement"?: boolean; + }; + }; + CurrentOutOfOfficeData: components["schemas"]["OutOfOfficeDataCommon"] & { + id: string; + /** Format: int64 */ + startDate: number; + /** Format: int64 */ + endDate: number; + shortMessage: string; + }; + OCSMeta: { + status: string; + statuscode: number; + message?: string; + totalitems?: string; + itemsperpage?: string; + }; + OutOfOfficeData: components["schemas"]["OutOfOfficeDataCommon"] & { + /** Format: int64 */ + id: number; + firstDay: string; + lastDay: string; + status: string; + }; + OutOfOfficeDataCommon: { + userId: string; + message: string; + replacementUserId: string | null; + replacementUserDisplayName: string | null; + }; + UpcomingEvent: { + uri: string; + calendarUri: string; + /** Format: int64 */ + start: number | null; + summary: string | null; + location: string | null; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +}; +export type $defs = Record; +export interface operations { + "direct-get-url": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** + * Format: int64 + * @description ID of the file + */ + fileId: number; + /** + * Format: int64 + * @description Duration until the link expires + */ + expirationTime: number; + }; + }; + }; + responses: { + /** @description Direct link returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + url: string; + }; + }; + }; + }; + }; + /** @description Getting direct link is not possible */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Missing permissions to get direct link */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description File not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "upcoming_events-get-events": { + parameters: { + query?: { + /** @description location/URL to filter by */ + location?: string | null; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Upcoming events */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + events: components["schemas"]["UpcomingEvent"][]; + }; + }; + }; + }; + }; + /** @description When not authenticated */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "out_of_office-get-current-out-of-office-data": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The user id to get out-of-office data for. */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Out-of-office data */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["CurrentOutOfOfficeData"]; + }; + }; + }; + }; + /** @description No out-of-office data was found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "out_of_office-get-out-of-office": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description The user id to get out-of-office data for. */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Out-of-office data */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["OutOfOfficeData"]; + }; + }; + }; + }; + /** @description No out-of-office data was found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "out_of_office-set-out-of-office": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + userId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description First day of the absence in format `YYYY-MM-DD` */ + firstDay: string; + /** @description Last day of the absence in format `YYYY-MM-DD` */ + lastDay: string; + /** @description Short text that is set as user status during the absence */ + status: string; + /** @description Longer multiline message that is shown to others during the absence */ + message: string; + /** @description User id of the replacement user */ + replacementUserId?: string | null; + /** @description Display name of the replacement user */ + replacementUserDisplayName?: string | null; + }; + }; + }; + responses: { + /** @description Absence data */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["OutOfOfficeData"]; + }; + }; + }; + }; + /** @description When the first day is not before the last day */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + /** @enum {string} */ + error: "firstDay"; + }; + }; + }; + }; + }; + /** @description When the user is not logged in */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description When the replacementUserId was provided but replacement user was not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "out_of_office-clear-out-of-office": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description When the absence was cleared successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description When the user is not logged in */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; +} diff --git a/src/types/openapi/core/openapi_provisioning_api.ts b/src/types/openapi/core/openapi_provisioning_api.ts new file mode 100644 index 00000000000..c9cf85b530f --- /dev/null +++ b/src/types/openapi/core/openapi_provisioning_api.ts @@ -0,0 +1,1721 @@ +/** + * This file was auto-generated by openapi-typescript. + * Do not make direct changes to the file. + */ + +export type paths = { + "/ocs/v2.php/cloud/groups": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of groups */ + get: operations["groups-get-groups"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/groups/details": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of groups details */ + get: operations["groups-get-groups-details"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/groups/{groupId}/users": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of users in the specified group */ + get: operations["groups-get-group-users"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/groups/{groupId}/users/details": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of users details in the specified group */ + get: operations["groups-get-group-users-details"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/groups/{groupId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** + * Get a list of users in the specified group + * @deprecated + */ + get: operations["groups-get-group"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of users */ + get: operations["users-get-users"]; + put?: never; + /** + * Create a new user + * @description This endpoint requires password confirmation + */ + post: operations["users-add-user"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/details": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of users and their details */ + get: operations["users-get-users-details"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/disabled": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the list of disabled users and their details */ + get: operations["users-get-disabled-users-details"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/search/by-phone": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Search users by their phone numbers */ + post: operations["users-search-by-phone-numbers"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the details of a user */ + get: operations["users-get-user"]; + /** + * Update a value of the user's details + * @description This endpoint requires password confirmation + */ + put: operations["users-edit-user"]; + post?: never; + /** + * Delete a user + * @description This endpoint requires password confirmation + */ + delete: operations["users-delete-user"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/user": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get the details of the current user */ + get: operations["users-get-current-user"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/user/fields": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of fields that are editable for the current user */ + get: operations["users-get-editable-fields"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/user/fields/{userId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of fields that are editable for a user */ + get: operations["users-get-editable-fields-for-user"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/{collectionName}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Update multiple values of the user's details + * @description This endpoint requires password confirmation + */ + put: operations["users-edit-user-multi-value"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/wipe": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Wipe all devices of a user + * @description This endpoint requires password confirmation + */ + post: operations["users-wipe-user-devices"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/enable": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Enable a user + * @description This endpoint requires password confirmation + */ + put: operations["users-enable-user"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/disable": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + /** + * Disable a user + * @description This endpoint requires password confirmation + */ + put: operations["users-disable-user"]; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/groups": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a list of groups the user belongs to */ + get: operations["users-get-users-groups"]; + put?: never; + /** + * Add a user to a group + * @description This endpoint requires password confirmation + */ + post: operations["users-add-to-group"]; + /** + * Remove a user from a group + * @description This endpoint requires password confirmation + */ + delete: operations["users-remove-from-group"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/cloud/users/{userId}/welcome": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Resend the welcome message + * @description This endpoint requires password confirmation + */ + post: operations["users-resend-welcome-message"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/provisioning_api/api/v1/config/apps/{app}/{key}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** + * Update the config value of an app + * @description This endpoint requires password confirmation + */ + post: operations["app_config-set-value"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}/{configKey}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Update a preference value of an app */ + post: operations["preferences-set-preference"]; + /** Delete a preference for an app */ + delete: operations["preferences-delete-preference"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/ocs/v2.php/apps/provisioning_api/api/v1/config/users/{appId}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Update multiple preference values of an app */ + post: operations["preferences-set-multiple-preferences"]; + /** Delete multiple preferences for an app */ + delete: operations["preferences-delete-multiple-preference"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; +}; +export type webhooks = Record; +export type components = { + schemas: { + Capabilities: { + provisioning_api: { + version: string; + /** Format: int64 */ + AccountPropertyScopesVersion: number; + AccountPropertyScopesFederatedEnabled: boolean; + AccountPropertyScopesPublishedEnabled: boolean; + }; + }; + GroupDetails: { + id: string; + displayname: string; + usercount: boolean | number; + disabled: boolean | number; + canAdd: boolean; + canRemove: boolean; + }; + OCSMeta: { + status: string; + statuscode: number; + message?: string; + totalitems?: string; + itemsperpage?: string; + }; + UserDetails: { + additional_mail: string[]; + additional_mailScope?: components["schemas"]["UserDetailsScope"][]; + address: string; + addressScope?: components["schemas"]["UserDetailsScope"]; + avatarScope?: components["schemas"]["UserDetailsScope"]; + backend: string; + backendCapabilities: { + setDisplayName: boolean; + setPassword: boolean; + }; + biography: string; + biographyScope?: components["schemas"]["UserDetailsScope"]; + "display-name": string; + displayname: string; + displaynameScope?: components["schemas"]["UserDetailsScope"]; + email: string | null; + emailScope?: components["schemas"]["UserDetailsScope"]; + enabled?: boolean; + fediverse: string; + fediverseScope?: components["schemas"]["UserDetailsScope"]; + groups: string[]; + headline: string; + headlineScope?: components["schemas"]["UserDetailsScope"]; + id: string; + language: string; + /** Format: int64 */ + firstLoginTimestamp: number; + /** Format: int64 */ + lastLoginTimestamp: number; + /** Format: int64 */ + lastLogin: number; + locale: string; + manager: string; + notify_email: string | null; + organisation: string; + organisationScope?: components["schemas"]["UserDetailsScope"]; + phone: string; + phoneScope?: components["schemas"]["UserDetailsScope"]; + profile_enabled: string; + profile_enabledScope?: components["schemas"]["UserDetailsScope"]; + pronouns: string; + pronounsScope?: components["schemas"]["UserDetailsScope"]; + quota: components["schemas"]["UserDetailsQuota"]; + role: string; + roleScope?: components["schemas"]["UserDetailsScope"]; + storageLocation?: string; + subadmin: string[]; + twitter: string; + twitterScope?: components["schemas"]["UserDetailsScope"]; + website: string; + websiteScope?: components["schemas"]["UserDetailsScope"]; + }; + UserDetailsQuota: { + free?: number; + quota?: number | string; + relative?: number; + total?: number; + used?: number; + }; + /** @enum {string} */ + UserDetailsScope: "v2-private" | "v2-local" | "v2-federated" | "v2-published" | "private" | "contacts" | "public"; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; +}; +export type $defs = Record; +export interface operations { + "groups-get-groups": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of groups returned */ + limit?: number | null; + /** @description Offset for searching for groups */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Groups returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + groups: string[]; + }; + }; + }; + }; + }; + }; + }; + "groups-get-groups-details": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of groups returned */ + limit?: number | null; + /** @description Offset for searching for groups */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Groups details returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + groups: components["schemas"]["GroupDetails"][]; + }; + }; + }; + }; + }; + }; + }; + "groups-get-group-users": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the group */ + groupId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User IDs returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: string[]; + }; + }; + }; + }; + }; + /** @description Missing permissions to get users in the group */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Group not found */ + 404: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "groups-get-group-users-details": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of groups returned */ + limit?: number | null; + /** @description Offset for searching for groups */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the group */ + groupId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Group users details returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: { + [key: string]: components["schemas"]["UserDetails"] | { + id: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + "groups-get-group": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the group */ + groupId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Group users returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: string[]; + }; + }; + }; + }; + }; + }; + }; + "users-get-users": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of groups returned */ + limit?: number | null; + /** @description Offset for searching for groups */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Users returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: string[]; + }; + }; + }; + }; + }; + }; + }; + "users-add-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description ID of the user */ + userid: string; + /** + * @description Password of the user + * @default + */ + password?: string; + /** + * @description Display name of the user + * @default + */ + displayName?: string; + /** + * @description Email of the user + * @default + */ + email?: string; + /** + * @description Groups of the user + * @default [] + */ + groups?: string[]; + /** + * @description Groups where the user is subadmin + * @default [] + */ + subadmin?: string[]; + /** + * @description Quota of the user + * @default + */ + quota?: string; + /** + * @description Language of the user + * @default + */ + language?: string; + /** @description Manager of the user */ + manager?: string | null; + }; + }; + }; + responses: { + /** @description User added successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + id: string; + }; + }; + }; + }; + }; + /** @description Missing permissions to make user subadmin */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-get-users-details": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of groups returned */ + limit?: number | null; + /** @description Offset for searching for groups */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Users details returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: { + [key: string]: components["schemas"]["UserDetails"] | { + id: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + "users-get-disabled-users-details": { + parameters: { + query?: { + /** @description Text to search for */ + search?: string; + /** @description Limit the amount of users returned */ + limit?: number | null; + /** @description Offset */ + offset?: number; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Disabled users details returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + users: { + [key: string]: components["schemas"]["UserDetails"] | { + id: string; + }; + }; + }; + }; + }; + }; + }; + }; + }; + "users-search-by-phone-numbers": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Location of the phone number (for country code) */ + location: string; + /** @description Phone numbers to search for */ + search: { + [key: string]: string[]; + }; + }; + }; + }; + responses: { + /** @description Users returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + [key: string]: string; + }; + }; + }; + }; + }; + /** @description Invalid location */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-get-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UserDetails"]; + }; + }; + }; + }; + }; + }; + "users-edit-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Key that will be updated */ + key: string; + /** @description New value for the key */ + value: string; + }; + }; + }; + responses: { + /** @description User value edited successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-delete-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-get-current-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Current user returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: components["schemas"]["UserDetails"]; + }; + }; + }; + }; + }; + }; + "users-get-editable-fields": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Editable fields returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: string[]; + }; + }; + }; + }; + }; + }; + "users-get-editable-fields-for-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Editable fields for user returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: string[]; + }; + }; + }; + }; + }; + }; + "users-edit-user-multi-value": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + /** @description Collection to update */ + collectionName: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Key that will be updated */ + key: string; + /** @description New value for the key */ + value: string; + }; + }; + }; + responses: { + /** @description User values edited successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-wipe-user-devices": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Wiped all user devices successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-enable-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User enabled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-disable-user": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User disabled successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-get-users-groups": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Users groups returned */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + groups: string[]; + }; + }; + }; + }; + }; + }; + }; + "users-add-to-group": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: { + content: { + "application/json": { + /** + * @description ID of the group + * @default + */ + groupid?: string; + }; + }; + }; + responses: { + /** @description User added to group successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-remove-from-group": { + parameters: { + query: { + /** @description ID of the group */ + groupid: string; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description User removed from group successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "users-resend-welcome-message": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID if the user */ + userId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Resent welcome message successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "app_config-set-value": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + app: string; + /** @description Key to update */ + key: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description New value for the key */ + value: string; + }; + }; + }; + responses: { + /** @description Value updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description App or key is not allowed */ + 403: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: { + data: { + message: string; + }; + }; + }; + }; + }; + }; + }; + }; + "preferences-set-preference": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + /** @description Key of the preference */ + configKey: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description New value */ + configValue: string; + }; + }; + }; + responses: { + /** @description Preference updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Preference invalid */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "preferences-delete-preference": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + /** @description Key to delete */ + configKey: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Preference deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Preference invalid */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "preferences-set-multiple-preferences": { + parameters: { + query?: never; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + /** @description Key-value pairs of the preferences */ + configs: { + [key: string]: string; + }; + }; + }; + }; + responses: { + /** @description Preferences updated successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Preference invalid */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; + "preferences-delete-multiple-preference": { + parameters: { + query: { + /** @description Keys to delete */ + "configKeys[]": string[]; + }; + header: { + /** @description Required to be true for the API request to pass */ + "OCS-APIRequest": boolean; + }; + path: { + /** @description ID of the app */ + appId: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Preferences deleted successfully */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + /** @description Preference invalid */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + ocs: { + meta: components["schemas"]["OCSMeta"]; + data: unknown; + }; + }; + }; + }; + }; + }; +} From 201039fa8266606449c69d5c63461c5733b72602 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 12 Feb 2025 14:19:53 +0100 Subject: [PATCH 3/3] fix: replace core types Signed-off-by: Maksim Sukharev --- .../SearchMessages/SearchMessagesTab.vue | 10 +- src/services/coreService.ts | 11 +- src/services/settingsService.ts | 3 +- src/types/index.ts | 162 ++++-------------- src/types/openapi/core/index.ts | 106 ++++++++++++ 5 files changed, 155 insertions(+), 137 deletions(-) create mode 100644 src/types/openapi/core/index.ts diff --git a/src/components/RightSidebar/SearchMessages/SearchMessagesTab.vue b/src/components/RightSidebar/SearchMessages/SearchMessagesTab.vue index 07c7a024f12..f3520d05669 100644 --- a/src/components/RightSidebar/SearchMessages/SearchMessagesTab.vue +++ b/src/components/RightSidebar/SearchMessages/SearchMessagesTab.vue @@ -36,7 +36,7 @@ import { ATTENDEE } from '../../../constants.ts' import { searchMessages } from '../../../services/coreService.ts' import { EventBus } from '../../../services/EventBus.ts' import type { - CoreUnifiedSearchResultEntry, + UnifiedSearchResultEntry, UserFilterObject, SearchMessagePayload, UnifiedSearchResponse, @@ -56,7 +56,7 @@ const searchBox = ref | null>(null) const { initializeNavigation, resetNavigation } = useArrowNavigation(searchMessagesTab, searchBox) const isFocused = ref(false) -const searchResults = ref<(CoreUnifiedSearchResultEntry & +const searchResults = ref<(UnifiedSearchResultEntry & { to: { name: string; @@ -205,8 +205,8 @@ async function fetchSearchResults(isNew = true): Promise { }) const data = response?.data?.ocs?.data - if (data?.entries.length > 0) { - let entries = data?.entries + if (data && data.entries.length > 0) { + let entries = data.entries as UnifiedSearchResultEntry[] isSearchExhausted.value = entries.length < searchLimit.value searchCursor.value = data.cursor @@ -219,7 +219,7 @@ async function fetchSearchResults(isNew = true): Promise { } } - searchResults.value = searchResults.value.concat(entries.map((entry : CoreUnifiedSearchResultEntry) => { + searchResults.value = searchResults.value.concat(entries.map((entry: UnifiedSearchResultEntry) => { return { ...entry, to: { diff --git a/src/services/coreService.ts b/src/services/coreService.ts index 8e284344718..ee5ae595264 100644 --- a/src/services/coreService.ts +++ b/src/services/coreService.ts @@ -9,6 +9,8 @@ import { generateOcsUrl } from '@nextcloud/router' import { getTalkConfig, hasTalkFeature } from './CapabilitiesManager.ts' import { SHARE } from '../constants.ts' import type { + AutocompleteParams, + AutocompleteResponse, TaskProcessingResponse, UnifiedSearchResponse, SearchMessagePayload, @@ -36,7 +38,12 @@ type SearchPayload = { * @param [payload.forceTypes] Whether to force some types to be included in query * @param options options */ -const autocompleteQuery = async function({ searchText, token = 'new', onlyUsers = false, forceTypes = [] }: SearchPayload, options: object) { +const autocompleteQuery = async function({ + searchText, + token = 'new', + onlyUsers = false, + forceTypes = [], +}: SearchPayload, options: object): AutocompleteResponse { const shareTypes: ShareType[] = onlyUsers ? [SHARE.TYPE.USER] : [ @@ -54,7 +61,7 @@ const autocompleteQuery = async function({ searchText, token = 'new', onlyUsers itemType: 'call', itemId: token, shareTypes: shareTypes.concat(forceTypes), - }, + } as AutocompleteParams, }) } diff --git a/src/services/settingsService.ts b/src/services/settingsService.ts index 32d63105cd5..a6918bc24af 100644 --- a/src/services/settingsService.ts +++ b/src/services/settingsService.ts @@ -12,6 +12,7 @@ import type { setSipSettingsResponse, setUserSettingsParams, setUserSettingsResponse, + UserPreferencesParams, UserPreferencesResponse, } from '../types/index.ts' @@ -100,7 +101,7 @@ const setConversationsListStyle = async function(value: string) { const setUserConfig = async function(appId: string, configKey: string, configValue: string): UserPreferencesResponse { return axios.post(generateOcsUrl('apps/provisioning_api/api/v1/config/users/{appId}/{configKey}', { appId, configKey }), { configValue, - }) + } as UserPreferencesParams) } export { diff --git a/src/types/index.ts b/src/types/index.ts index 0e9a1433770..05bb92edbce 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -4,8 +4,8 @@ */ import type { AxiosError } from '@nextcloud/axios' +import type { AutocompleteResult } from './openapi/core/index.ts' import type { components, operations } from './openapi/openapi-full.ts' -import { TASK_PROCESSING } from '../constants.ts' // General type ApiResponse = Promise<{ data: T }> @@ -113,13 +113,7 @@ export type ParticipantStatus = { clearAt?: number | null, } export type Participant = components['schemas']['Participant'] -export type ParticipantSearchResult = { - id: string, - label: string, - icon: string, - source: string, - subline: string, - shareWithDisplayNameUnique: string, +export type ParticipantSearchResult = AutocompleteResult & { status: ParticipantStatus | '', } @@ -246,24 +240,9 @@ export type getMentionsParams = operations['chat-mentions']['parameters']['query export type getMentionsResponse = ApiResponse // AI Summary -export type TaskProcessingResponse = ApiResponseUnwrapped<{ - task: { - id: number, - lastUpdated: number, - type: string, - status: typeof TASK_PROCESSING.STATUS[keyof typeof TASK_PROCESSING.STATUS], - userId: string, - appId: string, - input: Record, - output: Record | null, - customId: string, - completionExpectedAt: number, - progress: number, - scheduledAt: number, - startedAt: number, - endedAt: number - } -}> +export type { + TaskProcessingResponse, +} from './openapi/core/index.ts' // Teams (circles) export type TeamProbe = { @@ -281,78 +260,25 @@ export type TeamProbe = { } export type getTeamsProbeResponse = ApiResponseUnwrapped -// Groupware -export type DavPrincipal = { - calendarHomes: string[], - calendarUserType: string, - displayname: string, - email: string, - language: string, - principalScheme: string, - principalUrl: string, - scheduleDefaultCalendarUrl: string, - scheduleInbox: string, - scheduleOutbox: string, - url: string, - userId: string, - [key: string]: unknown, -} -export type DavCalendar = { - displayname: string, - color?: string, - components: string[], - allowedSharingModes: string[], - currentUserPrivilegeSet: string[], - enabled?: boolean, - order: number, - owner: string, - resourcetype: string[], - timezone?: string, - transparency: string, - url: string, - [key: string]: unknown, - isWriteable: () => boolean, -} -export type DavCalendarHome = { - displayname: string, - url: string, - findAllCalendars: () => Promise, -} - -// Upcoming events response -// From https://github.com/nextcloud/server/blob/master/apps/dav/lib/CalDAV/UpcomingEvent.php -export type UpcomingEvent = { - uri: string, - calendarUri: string, - /** Format: int64 */ - start: number | null, - summary: string | null, - location: string | null, - recurrenceId?: number | null, - calendarAppUrl?: string | null, -}; -export type UpcomingEventsResponse = ApiResponseUnwrapped<{ events: UpcomingEvent[] }> - -// Out of office response -// From https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-out-of-office-api.html -export type OutOfOfficeResult = { - id: string, - userId: string, - startDate: number, - endDate: number, - shortMessage: string, - message: string, - replacementUserId?: string|null, - replacementUserDisplayName?: string|null, -} -export type OutOfOfficeResponse = ApiResponseUnwrapped +// Groupware | DAV API +export type { + DavCalendar, + DavCalendarHome, + DavPrincipal, + OutOfOfficeResult, + OutOfOfficeResponse, + UpcomingEvent, + UpcomingEventsResponse, +} from './openapi/core/index.ts' export type scheduleMeetingParams = Required['requestBody']['content']['application/json'] export type scheduleMeetingResponse = ApiResponse // User preferences response -// from https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/ocs-user-preferences-api.html -export type UserPreferencesResponse = ApiResponseUnwrapped +export type { + UserPreferencesParams, + UserPreferencesResponse, +} from './openapi/core/index.ts' // Settings export type setSipSettingsParams = Required['requestBody']['content']['application/json'] @@ -360,25 +286,7 @@ export type setSipSettingsResponse = ApiResponse['requestBody']['content']['application/json'] export type setUserSettingsResponse = ApiResponse -// Unified Search -export type MessageSearchResultAttributes = { - conversation: string, - messageId: string, - actorType: string, - actorId: string, - timestamp: string, -} - -export type CoreUnifiedSearchResultEntry = { - thumbnailUrl: string, - title: string, - subline: string, - resourceUrl: string, - icon: string, - rounded: boolean, - attributes: MessageSearchResultAttributes, -} - +// Payload for NcSelect with `user-select` export type UserFilterObject = { id: string, displayName: string, @@ -388,20 +296,16 @@ export type UserFilterObject = { showUserStatus: boolean, } -export type CoreUnifiedSearchResult = { - name: string, - isPaginated: boolean, - entries: CoreUnifiedSearchResultEntry[], - cursor: number | string | null, -} -export type UnifiedSearchResponse = ApiResponseUnwrapped - -export type SearchMessagePayload = { - term: string, - person?: string, - since?: string | null, - until?: string | null, - cursor?: number | string | null, - limit?: number, - from?: string -} +// Autocomplete API +export type { + AutocompleteResult, + AutocompleteParams, + AutocompleteResponse, +} from './openapi/core/index.ts' + +// Unified Search API +export type { + SearchMessagePayload, + UnifiedSearchResultEntry, + UnifiedSearchResponse, +} from './openapi/core/index.ts' diff --git a/src/types/openapi/core/index.ts b/src/types/openapi/core/index.ts new file mode 100644 index 00000000000..148077a33d5 --- /dev/null +++ b/src/types/openapi/core/index.ts @@ -0,0 +1,106 @@ +import type { + components as componentsCore, + operations as operationsCore, +} from './openapi_core.ts' +import type { + components as componentsDav, + operations as operationsDav, +} from './openapi_dav.ts' +import type { + components as componentsProv, + operations as operationsProv, +} from './openapi_provisioning_api.ts' + +type ApiResponse = Promise<{ data: T }> + +// Groupware | DAV API +export type DavPrincipal = { + calendarHomes: string[], + calendarUserType: string, + displayname: string, + email: string, + language: string, + principalScheme: string, + principalUrl: string, + scheduleDefaultCalendarUrl: string, + scheduleInbox: string, + scheduleOutbox: string, + url: string, + userId: string, + [key: string]: unknown, +} + +export type DavCalendar = { + displayname: string, + color?: string, + components: string[], + allowedSharingModes: string[], + currentUserPrivilegeSet: string[], + enabled?: boolean, + order: number, + owner: string, + resourcetype: string[], + timezone?: string, + transparency: string, + url: string, + [key: string]: unknown, + isWriteable: () => boolean, +} + +export type DavCalendarHome = { + displayname: string, + url: string, + findAllCalendars: () => Promise, +} + +export type OutOfOfficeResult = componentsDav['schemas']['CurrentOutOfOfficeData'] +export type OutOfOfficeResponse = ApiResponse + +// FIXME upstream: the `recurrenceId` and `calendarAppUrl` fields are not in the OpenAPI spec +export type UpcomingEvent = componentsDav['schemas']['UpcomingEvent'] & { + recurrenceId?: number | null, + calendarAppUrl?: string | null, +} +export type UpcomingEventsResponse = ApiResponse + +// Provisioning API +export type UserPreferencesParams = Required['requestBody']['content']['application/json'] +export type UserPreferencesResponse = ApiResponse + +// Task Processing API +export type TaskProcessingResponse = ApiResponse + + +// Autocomplete API +export type AutocompleteResult = componentsCore['schemas']['AutocompleteResult'] +export type AutocompleteParams = operationsCore['auto_complete-get']['parameters']['query'] +export type AutocompleteResponse = ApiResponse + +// Unified Search API +type MessageSearchResultAttributes = { + conversation: string, + messageId: string, + actorType: string, + actorId: string, + timestamp: string, +} +export type SearchMessagePayload = operationsCore['unified_search-search']['parameters']['query'] & { + person?: string, + since?: string | null, + until?: string | null, +} + +// FIXME upstream: the `attributes` field allows only string[] from OpenAPI spec +export type UnifiedSearchResultEntry = componentsCore['schemas']['UnifiedSearchResultEntry'] & { + attributes: MessageSearchResultAttributes, +} +export type UnifiedSearchResponse = ApiResponse