From 0976e117faee0560da3c85e9ecd987b4a13b5001 Mon Sep 17 00:00:00 2001 From: solimant Date: Tue, 10 Dec 2024 22:01:36 +0000 Subject: [PATCH] Generate Scaffolder OpenAPI client Signed-off-by: solimant --- plugins/scaffolder-backend/package.json | 2 +- .../src/schema/openapi.yaml | 11 + .../{DefaultApi.server.ts => Api.server.ts} | 8 +- .../schema/openapi/generated/apis/index.ts | 8 +- .../generated/models/RetryRequest.model.ts | 26 + .../schema/openapi/generated/models/index.ts | 1 + .../src/schema/openapi/generated/router.ts | 18 + plugins/scaffolder-common/.eslintrc.js | 11 +- .../openapi/generated/apis/Api.client.ts | 465 ++++++++++++++++++ .../schema/openapi/generated/apis/index.ts | 17 + .../src/schema/openapi/generated/index.ts | 18 + .../openapi/generated/models/Action.model.ts | 32 ++ .../generated/models/ActionExample.model.ts | 28 ++ .../generated/models/ActionSchema.model.ts | 33 ++ .../models/Autocomplete200Response.model.ts | 27 + ...tocomplete200ResponseResultsInner.model.ts | 26 + .../models/AutocompleteRequest.model.ts | 27 + .../models/CancelTask200Response.model.ts | 27 + .../models/DryRun200Response.model.ts | 35 ++ .../models/DryRun200ResponseAllOf.model.ts | 29 ++ ...sponseAllOfDirectoryContentsInner.model.ts | 28 ++ .../DryRun200ResponseAllOfStepsInner.model.ts | 32 ++ ...un200ResponseAllOfStepsInnerAllOf.model.ts | 27 + .../generated/models/DryRunRequest.model.ts | 31 ++ ...yRunRequestDirectoryContentsInner.model.ts | 27 + .../generated/models/DryRunResult.model.ts | 33 ++ .../models/DryRunResultLogInner.model.ts | 29 ++ .../openapi/generated/models/Entity.model.ts | 45 ++ .../generated/models/EntityLink.model.ts | 42 ++ .../generated/models/EntityMeta.model.ts | 69 +++ .../generated/models/EntityRelation.model.ts | 34 ++ .../generated/models/ErrorError.model.ts | 29 ++ .../generated/models/ErrorRequest.model.ts | 27 + .../generated/models/ErrorResponse.model.ts | 26 + .../generated/models/JsonPrimitive.model.ts | 25 + .../generated/models/JsonValue.model.ts | 29 ++ .../models/ListTasksResponse.model.ts | 28 ++ .../generated/models/ModelError.model.ts | 33 ++ .../generated/models/RetryRequest.model.ts | 26 + .../models/Scaffold201Response.model.ts | 26 + .../models/Scaffold400Response.model.ts | 27 + .../models/ScaffolderScaffoldOptions.model.ts | 30 ++ .../openapi/generated/models/Schema.model.ts | 64 +++ .../models/SchemaAdditionalItems.model.ts | 25 + .../models/SchemaDependenciesValue.model.ts | 25 + .../models/SchemaExclusiveMaximum.model.ts | 24 + .../generated/models/SchemaItems.model.ts | 25 + .../generated/models/SchemaRequired.model.ts | 24 + .../generated/models/SchemaType.model.ts | 24 + .../generated/models/SerializedFile.model.ts | 29 ++ .../generated/models/SerializedTask.model.ts | 40 ++ .../models/SerializedTaskEvent.model.ts | 36 ++ .../generated/models/TaskEventType.model.ts | 34 ++ .../models/TaskRecoverStrategy.model.ts | 32 ++ .../generated/models/TaskSecrets.model.ts | 29 ++ .../generated/models/TaskSpecV1beta3.model.ts | 55 +++ .../models/TaskSpecV1beta3User.model.ts | 34 ++ .../generated/models/TaskStatus.model.ts | 40 ++ .../generated/models/TaskStep.model.ts | 46 ++ .../generated/models/TaskStepEach.model.ts | 26 + .../models/TemplateEntityStepV1beta3.model.ts | 35 ++ .../TemplateEntityStepV1beta3AllOf.model.ts | 32 ++ .../models/TemplateEntityV1beta3.model.ts | 53 ++ .../TemplateEntityV1beta3AllOf.model.ts | 45 ++ .../TemplateEntityV1beta3AllOfSpec.model.ts | 49 ++ ...eEntityV1beta3AllOfSpecParameters.model.ts | 28 ++ .../generated/models/TemplateInfo.model.ts | 36 ++ .../models/TemplateInfoEntity.model.ts | 28 ++ .../models/TemplateParameterSchema.model.ts | 34 ++ ...TemplateParameterSchemaStepsInner.model.ts | 30 ++ .../models/TemplateParametersV1beta3.model.ts | 25 + .../TemplatePermissionsV1beta3.model.ts | 27 + .../TemplatePermissionsV1beta3AllOf.model.ts | 26 + .../TemplatePresentationV1beta3.model.ts | 30 ++ ...tePresentationV1beta3ButtonLabels.model.ts | 38 ++ .../models/TemplateRecoveryV1beta3.model.ts | 25 + .../generated/models/ValidationError.model.ts | 35 ++ .../models/ValidationErrorPathInner.model.ts | 24 + .../models/ValidationErrorSchema.model.ts | 25 + .../schema/openapi/generated/models/index.ts | 84 ++++ .../src/schema/openapi/generated/pluginId.ts | 17 + .../openapi/generated/types/discovery.ts | 22 + .../schema/openapi/generated/types/fetch.ts | 22 + .../client/src/schema/openapi/index.ts | 17 + plugins/scaffolder-common/package.json | 4 +- 85 files changed, 2947 insertions(+), 8 deletions(-) rename plugins/scaffolder-backend/src/schema/openapi/generated/apis/{DefaultApi.server.ts => Api.server.ts} (97%) create mode 100644 plugins/scaffolder-backend/src/schema/openapi/generated/models/RetryRequest.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/apis/Api.client.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/apis/index.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/index.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Action.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionExample.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionSchema.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200Response.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/AutocompleteRequest.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/CancelTask200Response.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200Response.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequest.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResult.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Entity.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityLink.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityMeta.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityRelation.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorError.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorRequest.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorResponse.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonPrimitive.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonValue.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ListTasksResponse.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ModelError.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/RetryRequest.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold201Response.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold400Response.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/Schema.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaItems.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaRequired.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaType.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedFile.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTask.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskEventType.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSecrets.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStatus.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStep.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStepEach.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfo.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationError.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/models/index.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/pluginId.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/types/discovery.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/generated/types/fetch.ts create mode 100644 plugins/scaffolder-common/client/src/schema/openapi/index.ts diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 86a361c9dd..ad0e1c0ed3 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -54,7 +54,7 @@ "build": "backstage-cli package build", "build:assets": "node scripts/build-nunjucks.js", "clean": "backstage-cli package clean", - "generate": "backstage-repo-tools package schema openapi generate --server", + "generate": "backstage-repo-tools package schema openapi generate --server --client-package plugins/scaffolder-common", "lint": "backstage-cli package lint", "prepack": "backstage-cli package prepack", "postpack": "backstage-cli package postpack", diff --git a/plugins/scaffolder-backend/src/schema/openapi.yaml b/plugins/scaffolder-backend/src/schema/openapi.yaml index 1e4e372810..3b67678df1 100644 --- a/plugins/scaffolder-backend/src/schema/openapi.yaml +++ b/plugins/scaffolder-backend/src/schema/openapi.yaml @@ -1099,6 +1099,17 @@ paths: post: operationId: Retry description: Starts the task again from the point where it failed. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + secrets: + type: object + additionalProperties: + type: string responses: '201': description: Ok diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/apis/DefaultApi.server.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/Api.server.ts similarity index 97% rename from plugins/scaffolder-backend/src/schema/openapi/generated/apis/DefaultApi.server.ts rename to plugins/scaffolder-backend/src/schema/openapi/generated/apis/Api.server.ts index 76c18a22f0..a288266d2f 100644 --- a/plugins/scaffolder-backend/src/schema/openapi/generated/apis/DefaultApi.server.ts +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/Api.server.ts @@ -14,6 +14,8 @@ * limitations under the License. */ +// + // ****************************************************************** // * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * // ****************************************************************** @@ -24,6 +26,7 @@ import { CancelTask200Response } from '../models/CancelTask200Response.model'; import { DryRun200Response } from '../models/DryRun200Response.model'; import { DryRunRequest } from '../models/DryRunRequest.model'; import { ListTasksResponse } from '../models/ListTasksResponse.model'; +import { RetryRequest } from '../models/RetryRequest.model'; import { Scaffold201Response } from '../models/Scaffold201Response.model'; import { Scaffold400Response } from '../models/Scaffold400Response.model'; import { ScaffolderScaffoldOptions } from '../models/ScaffolderScaffoldOptions.model'; @@ -104,6 +107,7 @@ export type Retry = { path: { taskId: string; }; + body: RetryRequest; response: Scaffold201Response; }; /** @@ -138,10 +142,6 @@ export type StreamLogsPolling = { response: Array; }; -/** - * no description - */ - export type EndpointMap = { '#post|/v2/autocomplete/{provider}/{resource}': Autocomplete; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts index 79855a6fc8..a3cdbbebd2 100644 --- a/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts @@ -14,4 +14,10 @@ * limitations under the License. */ -export * from './DefaultApi.server'; +// + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +export * from './Api.server'; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/models/RetryRequest.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/RetryRequest.model.ts new file mode 100644 index 0000000000..858fa67566 --- /dev/null +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/models/RetryRequest.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface RetryRequest { + secrets?: { [key: string]: string }; +} diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts index 2d6d6228d7..598c41822b 100644 --- a/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts @@ -41,6 +41,7 @@ export * from '../models/JsonPrimitive.model'; export * from '../models/JsonValue.model'; export * from '../models/ListTasksResponse.model'; export * from '../models/ModelError.model'; +export * from '../models/RetryRequest.model'; export * from '../models/Scaffold201Response.model'; export * from '../models/Scaffold400Response.model'; export * from '../models/ScaffolderScaffoldOptions.model'; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts index 2e11c7e7c5..2bc56e28ad 100644 --- a/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts @@ -1443,6 +1443,24 @@ export const spec = { post: { operationId: 'Retry', description: 'Starts the task again from the point where it failed.', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, responses: { '201': { description: 'Ok', diff --git a/plugins/scaffolder-common/.eslintrc.js b/plugins/scaffolder-common/.eslintrc.js index e2a53a6ad2..a9d85200c7 100644 --- a/plugins/scaffolder-common/.eslintrc.js +++ b/plugins/scaffolder-common/.eslintrc.js @@ -1 +1,10 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); +module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, { + overrides: [ + { + files: ['client/src/schema/openapi/generated/models/*.model.ts'], + rules: { + '@typescript-eslint/no-redeclare': 'off', + }, + }, + ], +}); diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/Api.client.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/Api.client.ts new file mode 100644 index 0000000000..87a2cc94eb --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/Api.client.ts @@ -0,0 +1,465 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DiscoveryApi } from '../types/discovery'; +import { FetchApi } from '../types/fetch'; +import crossFetch from 'cross-fetch'; +import { pluginId } from '../pluginId'; +import * as parser from 'uri-template'; +import { Action } from '../models/Action.model'; +import { Autocomplete200Response } from '../models/Autocomplete200Response.model'; +import { AutocompleteRequest } from '../models/AutocompleteRequest.model'; +import { CancelTask200Response } from '../models/CancelTask200Response.model'; +import { DryRun200Response } from '../models/DryRun200Response.model'; +import { DryRunRequest } from '../models/DryRunRequest.model'; +import { ListTasksResponse } from '../models/ListTasksResponse.model'; +import { RetryRequest } from '../models/RetryRequest.model'; +import { Scaffold201Response } from '../models/Scaffold201Response.model'; +import { ScaffolderScaffoldOptions } from '../models/ScaffolderScaffoldOptions.model'; +import { SerializedTask } from '../models/SerializedTask.model'; +import { SerializedTaskEvent } from '../models/SerializedTaskEvent.model'; +import { TemplateParameterSchema } from '../models/TemplateParameterSchema.model'; + +/** + * Wraps the Response type to convey a type on the json call. + * + * @public + */ +export type TypedResponse = Omit & { + json: () => Promise; +}; + +/** + * Options you can pass into a request for additional information. + * + * @public + */ +export interface RequestOptions { + token?: string; +} +/** + * @public + */ +export type Autocomplete = { + path: { + provider: string; + resource: string; + }; + body: AutocompleteRequest; +}; +/** + * @public + */ +export type CancelTask = { + path: { + taskId: string; + }; +}; +/** + * @public + */ +export type DryRun = { + body: DryRunRequest; +}; +/** + * @public + */ +export type GetTask = { + path: { + taskId: string; + }; +}; +/** + * @public + */ +export type GetTemplateParameterSchema = { + path: { + namespace: string; + kind: string; + name: string; + }; +}; +/** + * @public + */ +export type ListActions = {}; +/** + * @public + */ +export type ListTasks = { + query: { + createdBy?: string; + limit?: number; + offset?: number; + order?: 'asc' | 'desc'; + status?: string; + }; +}; +/** + * @public + */ +export type Retry = { + path: { + taskId: string; + }; + body: RetryRequest; +}; +/** + * @public + */ +export type Scaffold = { + body: ScaffolderScaffoldOptions; +}; +/** + * @public + */ +export type StreamLogsEventStream = { + path: { + taskId: string; + }; + query: { + after?: number; + }; +}; +/** + * @public + */ +export type StreamLogsPolling = { + path: { + taskId: string; + }; + query: { + after?: number; + }; +}; + +/** + * @public + */ +export class DefaultApiClient { + private readonly discoveryApi: DiscoveryApi; + private readonly fetchApi: FetchApi; + + constructor(options: { + discoveryApi: { getBaseUrl(pluginId: string): Promise }; + fetchApi?: { fetch: typeof fetch }; + }) { + this.discoveryApi = options.discoveryApi; + this.fetchApi = options.fetchApi || { fetch: crossFetch }; + } + + /** + * Perform an autocomplete for the given provider and resource. + * @param provider - + * @param resource - + * @param autocompleteRequest - + */ + public async autocomplete( + // @ts-ignore + request: Autocomplete, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/autocomplete/{provider}/{resource}`; + + const uri = parser.parse(uriTemplate).expand({ + provider: request.path.provider, + resource: request.path.resource, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + body: JSON.stringify(request.body), + }); + } + + /** + * Sends a signal to a task broker to cancel the running task by taskId. + * @param taskId - + */ + public async cancelTask( + // @ts-ignore + request: CancelTask, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks/{taskId}/cancel`; + + const uri = parser.parse(uriTemplate).expand({ + taskId: request.path.taskId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + }); + } + + /** + * Perform a dry-run of a template + * @param dryRunRequest - + */ + public async dryRun( + // @ts-ignore + request: DryRun, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/dry-run`; + + const uri = parser.parse(uriTemplate).expand({}); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + body: JSON.stringify(request.body), + }); + } + + /** + * Get a task by ID. + * @param taskId - + */ + public async getTask( + // @ts-ignore + request: GetTask, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks/{taskId}`; + + const uri = parser.parse(uriTemplate).expand({ + taskId: request.path.taskId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Get template parameter schema. + * @param namespace - + * @param kind - + * @param name - + */ + public async getTemplateParameterSchema( + // @ts-ignore + request: GetTemplateParameterSchema, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/templates/{namespace}/{kind}/{name}/parameter-schema`; + + const uri = parser.parse(uriTemplate).expand({ + namespace: request.path.namespace, + kind: request.path.kind, + name: request.path.name, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Returns a list of all installed actions. + */ + public async listActions( + // @ts-ignore + request: ListActions, + options?: RequestOptions, + ): Promise>> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/actions`; + + const uri = parser.parse(uriTemplate).expand({}); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Returns a list of tasks, filtering by ownership and/or status if given. + * @param createdBy - Created by + * @param limit - Number of records to return in the response. + * @param offset - Number of records to skip in the query page. + * @param order - Order + * @param status - Status + */ + public async listTasks( + // @ts-ignore + request: ListTasks, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks{?createdBy,limit,offset,order,status}`; + + const uri = parser.parse(uriTemplate).expand({ + ...request.query, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Starts the task again from the point where it failed. + * @param taskId - + * @param retryRequest - + */ + public async retry( + // @ts-ignore + request: Retry, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks/{taskId}/retry`; + + const uri = parser.parse(uriTemplate).expand({ + taskId: request.path.taskId, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + body: JSON.stringify(request.body), + }); + } + + /** + * Executes the scaffolding of a component, given a template and its parameter values. + * @param scaffolderScaffoldOptions - + */ + public async scaffold( + // @ts-ignore + request: Scaffold, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks`; + + const uri = parser.parse(uriTemplate).expand({}); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'POST', + body: JSON.stringify(request.body), + }); + } + + /** + * Get event stream for a task by ID. + * @param taskId - + * @param after - Offset event ID to stream events after. + */ + public async streamLogsEventStream( + // @ts-ignore + request: StreamLogsEventStream, + options?: RequestOptions, + ): Promise> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks/{taskId}/eventstream{?after}`; + + const uri = parser.parse(uriTemplate).expand({ + taskId: request.path.taskId, + ...request.query, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } + + /** + * Get events for a task by ID. + * @param taskId - + * @param after - Offset event ID to stream events after. + */ + public async streamLogsPolling( + // @ts-ignore + request: StreamLogsPolling, + options?: RequestOptions, + ): Promise>> { + const baseUrl = await this.discoveryApi.getBaseUrl(pluginId); + + const uriTemplate = `/v2/tasks/{taskId}/events{?after}`; + + const uri = parser.parse(uriTemplate).expand({ + taskId: request.path.taskId, + ...request.query, + }); + + return await this.fetchApi.fetch(`${baseUrl}${uri}`, { + headers: { + 'Content-Type': 'application/json', + ...(options?.token && { Authorization: `Bearer ${options?.token}` }), + }, + method: 'GET', + }); + } +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/index.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/index.ts new file mode 100644 index 0000000000..af52f9db46 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/apis/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './Api.client'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/index.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/index.ts new file mode 100644 index 0000000000..bb399e97a0 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/index.ts @@ -0,0 +1,18 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './apis'; +export * from './models'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Action.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Action.model.ts new file mode 100644 index 0000000000..8e86b8b338 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Action.model.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { ActionExample } from '../models/ActionExample.model'; +import { ActionSchema } from '../models/ActionSchema.model'; + +/** + * The response shape for a single action in the `listActions` call to the `scaffolder-backend` + * @public + */ +export interface Action { + id: string; + description?: string; + examples?: Array; + schema?: ActionSchema; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionExample.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionExample.model.ts new file mode 100644 index 0000000000..cf2ffeaf8a --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionExample.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * A single action example + * @public + */ +export interface ActionExample { + description: string; + example: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionSchema.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionSchema.model.ts new file mode 100644 index 0000000000..037d2fff44 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ActionSchema.model.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ActionSchema { + /** + * A type representing all allowed JSON object values. + */ + input?: { [key: string]: any }; + /** + * A type representing all allowed JSON object values. + */ + output?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200Response.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200Response.model.ts new file mode 100644 index 0000000000..cad9a0dd29 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200Response.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { Autocomplete200ResponseResultsInner } from '../models/Autocomplete200ResponseResultsInner.model'; + +/** + * @public + */ +export interface Autocomplete200Response { + results?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts new file mode 100644 index 0000000000..bc8ea23cbb --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface Autocomplete200ResponseResultsInner { + title?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/AutocompleteRequest.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/AutocompleteRequest.model.ts new file mode 100644 index 0000000000..d9ab409224 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/AutocompleteRequest.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface AutocompleteRequest { + context: { [key: string]: string }; + token: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/CancelTask200Response.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/CancelTask200Response.model.ts new file mode 100644 index 0000000000..745ca8074e --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/CancelTask200Response.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TaskStatus } from '../models/TaskStatus.model'; + +/** + * @public + */ +export interface CancelTask200Response { + status?: TaskStatus; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200Response.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200Response.model.ts new file mode 100644 index 0000000000..92b8d723a0 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200Response.model.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DryRun200ResponseAllOfDirectoryContentsInner } from '../models/DryRun200ResponseAllOfDirectoryContentsInner.model'; +import { DryRun200ResponseAllOfStepsInner } from '../models/DryRun200ResponseAllOfStepsInner.model'; +import { DryRunResultLogInner } from '../models/DryRunResultLogInner.model'; + +/** + * @public + */ +export interface DryRun200Response { + log: Array; + directoryContents: Array; + /** + * A type representing all allowed JSON object values. + */ + output: { [key: string]: any }; + steps?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts new file mode 100644 index 0000000000..553c6f765a --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DryRun200ResponseAllOfDirectoryContentsInner } from '../models/DryRun200ResponseAllOfDirectoryContentsInner.model'; +import { DryRun200ResponseAllOfStepsInner } from '../models/DryRun200ResponseAllOfStepsInner.model'; + +/** + * @public + */ +export interface DryRun200ResponseAllOf { + steps?: Array; + directoryContents?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts new file mode 100644 index 0000000000..27174b9b0e --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface DryRun200ResponseAllOfDirectoryContentsInner { + path: string; + executable?: boolean; + base64Content: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts new file mode 100644 index 0000000000..229860f81a --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface DryRun200ResponseAllOfStepsInner { + id: string; + name: string; + action: string; + /** + * A type representing all allowed JSON object values. + */ + input?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts new file mode 100644 index 0000000000..6416143493 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface DryRun200ResponseAllOfStepsInnerAllOf { + id: string; + name: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequest.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequest.model.ts new file mode 100644 index 0000000000..510e7fa353 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequest.model.ts @@ -0,0 +1,31 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DryRunRequestDirectoryContentsInner } from '../models/DryRunRequestDirectoryContentsInner.model'; +import { TemplateEntityV1beta3 } from '../models/TemplateEntityV1beta3.model'; + +/** + * @public + */ +export interface DryRunRequest { + template: TemplateEntityV1beta3; + values: any; + secrets?: any; + directoryContents: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts new file mode 100644 index 0000000000..edf90d403d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface DryRunRequestDirectoryContentsInner { + path?: string; + base64Content?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResult.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResult.model.ts new file mode 100644 index 0000000000..66e35bd9e5 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResult.model.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { DryRunResultLogInner } from '../models/DryRunResultLogInner.model'; +import { SerializedFile } from '../models/SerializedFile.model'; + +/** + * @public + */ +export interface DryRunResult { + log: Array; + directoryContents: Array; + /** + * A type representing all allowed JSON object values. + */ + output: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts new file mode 100644 index 0000000000..0f987091c0 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface DryRunResultLogInner { + /** + * A type representing all allowed JSON object values. + */ + body?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Entity.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Entity.model.ts new file mode 100644 index 0000000000..f386f3dd17 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Entity.model.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { EntityMeta } from '../models/EntityMeta.model'; +import { EntityRelation } from '../models/EntityRelation.model'; + +/** + * The parts of the format that's common to all versions/kinds of entity. + * @public + */ +export interface Entity { + /** + * The relations that this entity has with other entities. + */ + relations?: Array; + /** + * A type representing all allowed JSON object values. + */ + spec?: { [key: string]: any }; + metadata: EntityMeta; + /** + * The high level entity type being described. + */ + kind: string; + /** + * The version of specification format for this particular entity that this is written against. + */ + apiVersion: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityLink.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityLink.model.ts new file mode 100644 index 0000000000..53d7d1f9ff --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityLink.model.ts @@ -0,0 +1,42 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * A link to external information that is related to the entity. + * @public + */ +export interface EntityLink { + /** + * An optional value to categorize links into specific groups + */ + type?: string; + /** + * An optional semantic key that represents a visual icon. + */ + icon?: string; + /** + * An optional descriptive title for the link. + */ + title?: string; + /** + * The url to the external site, document, etc. + */ + url: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityMeta.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityMeta.model.ts new file mode 100644 index 0000000000..cc8dd555a6 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityMeta.model.ts @@ -0,0 +1,69 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { EntityLink } from '../models/EntityLink.model'; + +/** + * Metadata fields common to all versions/kinds of entity. + * @public + */ +export interface EntityMeta { + [key: string]: any; + + /** + * A list of external hyperlinks related to the entity. + */ + links?: Array; + /** + * A list of single-valued strings, to for example classify catalog entities in various ways. + */ + tags?: Array; + /** + * Construct a type with a set of properties K of type T + */ + annotations?: { [key: string]: string }; + /** + * Construct a type with a set of properties K of type T + */ + labels?: { [key: string]: string }; + /** + * A short (typically relatively few words, on one line) description of the entity. + */ + description?: string; + /** + * A display name of the entity, to be presented in user interfaces instead of the `name` property above, when available. This field is sometimes useful when the `name` is cumbersome or ends up being perceived as overly technical. The title generally does not have as stringent format requirements on it, so it may contain special characters and be more explanatory. Do keep it very short though, and avoid situations where a title can be confused with the name of another entity, or where two entities share a title. Note that this is only for display purposes, and may be ignored by some parts of the code. Entity references still always make use of the `name` property, not the title. + */ + title?: string; + /** + * The namespace that the entity belongs to. + */ + namespace?: string; + /** + * The name of the entity. Must be unique within the catalog at any given point in time, for any given namespace + kind pair. This value is part of the technical identifier of the entity, and as such it will appear in URLs, database tables, entity references, and similar. It is subject to restrictions regarding what characters are allowed. If you want to use a different, more human readable string with fewer restrictions on it in user interfaces, see the `title` field below. + */ + name: string; + /** + * An opaque string that changes for each update operation to any part of the entity, including metadata. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, and the server will then reject the operation if it does not match the current stored value. + */ + etag?: string; + /** + * A globally unique ID for the entity. This field can not be set by the user at creation time, and the server will reject an attempt to do so. The field will be populated in read operations. The field can (optionally) be specified when performing update or delete operations, but the server is free to reject requests that do so in such a way that it breaks semantics. + */ + uid?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityRelation.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityRelation.model.ts new file mode 100644 index 0000000000..fe98a84481 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/EntityRelation.model.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * A relation of a specific type to another entity in the catalog. + * @public + */ +export interface EntityRelation { + /** + * The entity ref of the target of this relation. + */ + targetRef: string; + /** + * The type of the relation. + */ + type: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorError.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorError.model.ts new file mode 100644 index 0000000000..fe5811628d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorError.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ErrorError { + name: string; + message: string; + stack?: string; + code?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorRequest.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorRequest.model.ts new file mode 100644 index 0000000000..d44dcb66d9 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorRequest.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ErrorRequest { + method: string; + url: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorResponse.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorResponse.model.ts new file mode 100644 index 0000000000..91c120483d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ErrorResponse.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface ErrorResponse { + statusCode: number; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonPrimitive.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonPrimitive.model.ts new file mode 100644 index 0000000000..6ca5d5144b --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonPrimitive.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * A type representing all allowed JSON primitive values. + * @public + */ +export type JsonPrimitive = any | boolean | number | string; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonValue.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonValue.model.ts new file mode 100644 index 0000000000..9527b6828d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/JsonValue.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { JsonPrimitive } from '../models/JsonPrimitive.model'; + +/** + * A type representing all allowed JSON values. + * @public + */ +export type JsonValue = + | Array + | JsonPrimitive + | { [key: string]: any }; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ListTasksResponse.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ListTasksResponse.model.ts new file mode 100644 index 0000000000..65a3a04bec --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ListTasksResponse.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { SerializedTask } from '../models/SerializedTask.model'; + +/** + * The response shape for the `listTasks` call to the `scaffolder-backend` + * @public + */ +export interface ListTasksResponse { + tasks?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ModelError.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ModelError.model.ts new file mode 100644 index 0000000000..5526d703e6 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ModelError.model.ts @@ -0,0 +1,33 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { ErrorError } from '../models/ErrorError.model'; +import { ErrorRequest } from '../models/ErrorRequest.model'; +import { ErrorResponse } from '../models/ErrorResponse.model'; + +/** + * @public + */ +export interface ModelError { + [key: string]: any; + + error: ErrorError; + request?: ErrorRequest; + response: ErrorResponse; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/RetryRequest.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/RetryRequest.model.ts new file mode 100644 index 0000000000..858fa67566 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/RetryRequest.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2025 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface RetryRequest { + secrets?: { [key: string]: string }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold201Response.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold201Response.model.ts new file mode 100644 index 0000000000..9ff2cc8494 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold201Response.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface Scaffold201Response { + id?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold400Response.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold400Response.model.ts new file mode 100644 index 0000000000..515c5b6de3 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Scaffold400Response.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { ValidationError } from '../models/ValidationError.model'; + +/** + * @public + */ +export interface Scaffold400Response { + errors: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts new file mode 100644 index 0000000000..68b9927966 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts @@ -0,0 +1,30 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { JsonValue } from '../models/JsonValue.model'; + +/** + * The input options to the `scaffold` method of the `ScaffolderClient`. + * @public + */ +export interface ScaffolderScaffoldOptions { + templateRef: string; + values: { [key: string]: JsonValue }; + secrets?: { [key: string]: string }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Schema.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Schema.model.ts new file mode 100644 index 0000000000..0e24d46c30 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/Schema.model.ts @@ -0,0 +1,64 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { SchemaAdditionalItems } from '../models/SchemaAdditionalItems.model'; +import { SchemaDependenciesValue } from '../models/SchemaDependenciesValue.model'; +import { SchemaExclusiveMaximum } from '../models/SchemaExclusiveMaximum.model'; +import { SchemaItems } from '../models/SchemaItems.model'; +import { SchemaRequired } from '../models/SchemaRequired.model'; +import { SchemaType } from '../models/SchemaType.model'; + +/** + * @public + */ +export interface Schema { + [key: string]: any; + + id?: string; + title?: string; + description?: string; + multipleOf?: number; + maximum?: number; + exclusiveMaximum?: SchemaExclusiveMaximum; + minimum?: number; + exclusiveMinimum?: SchemaExclusiveMaximum; + maxLength?: number; + minLength?: number; + pattern?: any; + additionalItems?: SchemaAdditionalItems; + items?: SchemaItems; + maxItems?: number; + minItems?: number; + uniqueItems?: boolean; + maxProperties?: number; + minProperties?: number; + required?: SchemaRequired; + additionalProperties?: SchemaAdditionalItems; + definitions?: { [key: string]: Schema }; + properties?: { [key: string]: Schema }; + patternProperties?: { [key: string]: Schema }; + dependencies?: { [key: string]: SchemaDependenciesValue }; + type?: SchemaType; + format?: string; + allOf?: Array; + anyOf?: Array; + oneOf?: Array; + not?: Schema; + then?: Schema; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts new file mode 100644 index 0000000000..2039e2f9bb --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { Schema } from '../models/Schema.model'; + +/** + * @public + */ +export type SchemaAdditionalItems = Schema | boolean; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts new file mode 100644 index 0000000000..97609dda50 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { Schema } from '../models/Schema.model'; + +/** + * @public + */ +export type SchemaDependenciesValue = Array | Schema; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts new file mode 100644 index 0000000000..c22a44e80b --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type SchemaExclusiveMaximum = boolean | number; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaItems.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaItems.model.ts new file mode 100644 index 0000000000..c63c6700aa --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaItems.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { Schema } from '../models/Schema.model'; + +/** + * @public + */ +export type SchemaItems = Array | Schema; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaRequired.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaRequired.model.ts new file mode 100644 index 0000000000..b1b879cb3b --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaRequired.model.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type SchemaRequired = Array | boolean; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaType.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaType.model.ts new file mode 100644 index 0000000000..dd0cbb93db --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SchemaType.model.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type SchemaType = Array | string; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedFile.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedFile.model.ts new file mode 100644 index 0000000000..d2bdfc72de --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedFile.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface SerializedFile { + path: string; + content: string; + executable?: boolean; + symlink?: boolean; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTask.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTask.model.ts new file mode 100644 index 0000000000..7ba1196cab --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTask.model.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TaskSecrets } from '../models/TaskSecrets.model'; +import { TaskSpecV1beta3 } from '../models/TaskSpecV1beta3.model'; +import { TaskStatus } from '../models/TaskStatus.model'; + +/** + * SerializedTask + * @public + */ +export interface SerializedTask { + id: string; + spec: TaskSpecV1beta3; + status: TaskStatus; + createdAt: string; + lastHeartbeatAt?: string; + createdBy?: string; + secrets?: TaskSecrets; + /** + * A type representing all allowed JSON object values. + */ + state?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts new file mode 100644 index 0000000000..484688e324 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts @@ -0,0 +1,36 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TaskEventType } from '../models/TaskEventType.model'; + +/** + * SerializedTaskEvent + * @public + */ +export interface SerializedTaskEvent { + id: number; + isTaskRecoverable?: boolean; + taskId: string; + /** + * A type representing all allowed JSON object values. + */ + body: { [key: string]: any }; + type: TaskEventType; + createdAt: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskEventType.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskEventType.model.ts new file mode 100644 index 0000000000..8531d19de8 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskEventType.model.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type TaskEventType = 'completion' | 'log' | 'cancelled' | 'recovered'; + +/** + * @public + */ +export const TaskEventType = { + Completion: 'completion' as TaskEventType, + Log: 'log' as TaskEventType, + Cancelled: 'cancelled' as TaskEventType, + Recovered: 'recovered' as TaskEventType, +}; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts new file mode 100644 index 0000000000..e00b2dfa88 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type TaskRecoverStrategy = 'none' | 'startOver'; + +/** + * @public + */ +export const TaskRecoverStrategy = { + None: 'none' as TaskRecoverStrategy, + StartOver: 'startOver' as TaskRecoverStrategy, +}; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSecrets.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSecrets.model.ts new file mode 100644 index 0000000000..ae7c6a891c --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSecrets.model.ts @@ -0,0 +1,29 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * TaskSecrets + * @public + */ +export interface TaskSecrets { + [key: string]: any; + + backstageToken?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts new file mode 100644 index 0000000000..bb32940062 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts @@ -0,0 +1,55 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { JsonValue } from '../models/JsonValue.model'; +import { TaskSpecV1beta3User } from '../models/TaskSpecV1beta3User.model'; +import { TaskStep } from '../models/TaskStep.model'; +import { TemplateInfo } from '../models/TemplateInfo.model'; + +/** + * A scaffolder task as stored in the database, generated from a v1beta3 apiVersion Template. + * @public + */ +export interface TaskSpecV1beta3 { + [key: string]: any; + + /** + * The apiVersion string of the TaskSpec. + */ + apiVersion: TaskSpecV1beta3ApiVersionEnum; + /** + * A type representing all allowed JSON object values. + */ + parameters: { [key: string]: any }; + /** + * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying javascript action and some optional input parameters that may or may not have been collected from the end user. + */ + steps: Array; + /** + * The output is an object where template authors can pull out information from template actions and return them in a known standard way. + */ + output: { [key: string]: JsonValue }; + templateInfo?: TemplateInfo; + user?: TaskSpecV1beta3User; +} + +/** + * @public + */ +export type TaskSpecV1beta3ApiVersionEnum = 'scaffolder.backstage.io/v1beta3'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts new file mode 100644 index 0000000000..7f36a3f171 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Some decoration of the author of the task that should be available in the context + * @public + */ +export interface TaskSpecV1beta3User { + /** + * The decorated entity from the Catalog + */ + entity?: { [key: string]: any }; + /** + * An entity ref for the author of the task + */ + ref?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStatus.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStatus.model.ts new file mode 100644 index 0000000000..42f8137fb3 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStatus.model.ts @@ -0,0 +1,40 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type TaskStatus = + | 'cancelled' + | 'completed' + | 'failed' + | 'open' + | 'processing'; + +/** + * @public + */ +export const TaskStatus = { + Cancelled: 'cancelled' as TaskStatus, + Completed: 'completed' as TaskStatus, + Failed: 'failed' as TaskStatus, + Open: 'open' as TaskStatus, + Processing: 'processing' as TaskStatus, +}; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStep.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStep.model.ts new file mode 100644 index 0000000000..c36049b9a6 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStep.model.ts @@ -0,0 +1,46 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TaskStepEach } from '../models/TaskStepEach.model'; + +/** + * An individual step of a scaffolder task, as stored in the database. + * @public + */ +export interface TaskStep { + [key: string]: any; + + /** + * A unique identifier for this step. + */ + id: string; + /** + * A display name to show the user. + */ + name: string; + /** + * The underlying action ID that will be called as part of running this step. + */ + action: string; + /** + * A type representing all allowed JSON object values. + */ + input?: { [key: string]: any }; + each?: TaskStepEach; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStepEach.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStepEach.model.ts new file mode 100644 index 0000000000..398a19ee88 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TaskStepEach.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { JsonValue } from '../models/JsonValue.model'; + +/** + * Run step repeatedly. + * @public + */ +export type TaskStepEach = Array | string; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts new file mode 100644 index 0000000000..e125c46f1d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Step that is part of a Template Entity. + * @public + */ +export interface TemplateEntityStepV1beta3 { + [key: string]: any; + + id?: string; + name?: string; + action: string; + /** + * A type representing all allowed JSON object values. + */ + input?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts new file mode 100644 index 0000000000..dfba72bf8d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts @@ -0,0 +1,32 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface TemplateEntityStepV1beta3AllOf { + id?: string; + name?: string; + action: string; + /** + * A type representing all allowed JSON object values. + */ + input?: { [key: string]: any }; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts new file mode 100644 index 0000000000..efe325cfeb --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts @@ -0,0 +1,53 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { EntityMeta } from '../models/EntityMeta.model'; +import { EntityRelation } from '../models/EntityRelation.model'; +import { TemplateEntityV1beta3AllOfSpec } from '../models/TemplateEntityV1beta3AllOfSpec.model'; + +/** + * Backstage catalog Template kind Entity. Templates are used by the Scaffolder plugin to create new entities, such as Components. + * @public + */ +export interface TemplateEntityV1beta3 { + /** + * The relations that this entity has with other entities. + */ + relations?: Array; + spec: TemplateEntityV1beta3AllOfSpec; + metadata: EntityMeta; + /** + * The kind of the entity + */ + kind: TemplateEntityV1beta3KindEnum; + /** + * The apiVersion string of the TaskSpec. + */ + apiVersion: TemplateEntityV1beta3ApiVersionEnum; +} + +/** + * @public + */ +export type TemplateEntityV1beta3KindEnum = 'Template'; +/** + * @public + */ +export type TemplateEntityV1beta3ApiVersionEnum = + 'scaffolder.backstage.io/v1beta3'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts new file mode 100644 index 0000000000..acc9f8c991 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts @@ -0,0 +1,45 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplateEntityV1beta3AllOfSpec } from '../models/TemplateEntityV1beta3AllOfSpec.model'; + +/** + * @public + */ +export interface TemplateEntityV1beta3AllOf { + /** + * The apiVersion string of the TaskSpec. + */ + apiVersion: TemplateEntityV1beta3AllOfApiVersionEnum; + /** + * The kind of the entity + */ + kind: TemplateEntityV1beta3AllOfKindEnum; + spec: TemplateEntityV1beta3AllOfSpec; +} + +/** + * @public + */ +export type TemplateEntityV1beta3AllOfApiVersionEnum = + 'scaffolder.backstage.io/v1beta3'; +/** + * @public + */ +export type TemplateEntityV1beta3AllOfKindEnum = 'Template'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts new file mode 100644 index 0000000000..3fa0063e08 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts @@ -0,0 +1,49 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplateEntityStepV1beta3 } from '../models/TemplateEntityStepV1beta3.model'; +import { TemplateEntityV1beta3AllOfSpecParameters } from '../models/TemplateEntityV1beta3AllOfSpecParameters.model'; +import { TemplatePresentationV1beta3 } from '../models/TemplatePresentationV1beta3.model'; + +/** + * The specification of the Template Entity + * @public + */ +export interface TemplateEntityV1beta3AllOfSpec { + [key: string]: any; + + /** + * The type that the Template will create. For example service, website or library. + */ + type: string; + presentation?: TemplatePresentationV1beta3; + parameters?: TemplateEntityV1beta3AllOfSpecParameters; + /** + * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying javascript action and some optional input parameters that may or may not have been collected from the end user. + */ + steps: Array; + /** + * The output is an object where template authors can pull out information from template actions and return them in a known standard way. + */ + output?: { [key: string]: string }; + /** + * The owner entityRef of the TemplateEntity + */ + owner?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts new file mode 100644 index 0000000000..1444a74e19 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplateParametersV1beta3 } from '../models/TemplateParametersV1beta3.model'; + +/** + * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend to collect user input and validate it against that schema. This can then be used in the `steps` part below to template variables passed from the user into each action in the template. + * @public + */ +export type TemplateEntityV1beta3AllOfSpecParameters = + | Array + | TemplateParametersV1beta3; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfo.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfo.model.ts new file mode 100644 index 0000000000..ea5b9da6e9 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfo.model.ts @@ -0,0 +1,36 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplateInfoEntity } from '../models/TemplateInfoEntity.model'; + +/** + * Information about a template that is stored on a task specification. Includes a stringified entityRef, and the baseUrl which is usually the relative path of the template definition + * @public + */ +export interface TemplateInfo { + /** + * The entityRef of the template. + */ + entityRef: string; + /** + * Where the template is stored, so we can resolve relative paths for things like `fetch:template` paths. + */ + baseUrl?: string; + entity?: TemplateInfoEntity; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts new file mode 100644 index 0000000000..b59414f80f --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts @@ -0,0 +1,28 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { EntityMeta } from '../models/EntityMeta.model'; + +/** + * The Template entity. + * @public + */ +export interface TemplateInfoEntity { + metadata?: EntityMeta; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts new file mode 100644 index 0000000000..aab495d098 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts @@ -0,0 +1,34 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplateParameterSchemaStepsInner } from '../models/TemplateParameterSchemaStepsInner.model'; +import { TemplatePresentationV1beta3 } from '../models/TemplatePresentationV1beta3.model'; + +/** + * The shape of each entry of parameters which gets rendered as a separate step in the wizard input + * @public + */ +export interface TemplateParameterSchema { + [key: string]: any; + + title: string; + presentation?: TemplatePresentationV1beta3; + description?: string; + steps: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts new file mode 100644 index 0000000000..2f170b6fc6 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts @@ -0,0 +1,30 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { JsonValue } from '../models/JsonValue.model'; +import { TemplateParametersV1beta3 } from '../models/TemplateParametersV1beta3.model'; + +/** + * @public + */ +export interface TemplateParameterSchemaStepsInner { + title: JsonValue; + description?: JsonValue; + schema: TemplateParametersV1beta3; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts new file mode 100644 index 0000000000..e106f9a1de --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Parameter that is part of a Template Entity. + * @public + */ +export interface TemplateParametersV1beta3 {} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts new file mode 100644 index 0000000000..68c2df70a8 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts @@ -0,0 +1,27 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Access control properties for parts of a template. + * @public + */ +export interface TemplatePermissionsV1beta3 { + tags?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts new file mode 100644 index 0000000000..c7eda5cd8a --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts @@ -0,0 +1,26 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export interface TemplatePermissionsV1beta3AllOf { + tags?: Array; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts new file mode 100644 index 0000000000..83405f15aa --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts @@ -0,0 +1,30 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { TemplatePresentationV1beta3ButtonLabels } from '../models/TemplatePresentationV1beta3ButtonLabels.model'; + +/** + * The presentation of the template. + * @public + */ +export interface TemplatePresentationV1beta3 { + [key: string]: any; + + buttonLabels?: TemplatePresentationV1beta3ButtonLabels; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts new file mode 100644 index 0000000000..37015a5468 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts @@ -0,0 +1,38 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Overrides default buttons' text + * @public + */ +export interface TemplatePresentationV1beta3ButtonLabels { + /** + * The text for the button which leads to the previous template page + */ + backButtonText?: string; + /** + * The text for the button which starts the execution of the template + */ + createButtonText?: string; + /** + * The text for the button which opens template's review/summary + */ + reviewButtonText?: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts new file mode 100644 index 0000000000..3613718ac0 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * Depends on how you designed your task you might tailor the behaviour for each of them. + * @public + */ +export interface TemplateRecoveryV1beta3 {} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationError.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationError.model.ts new file mode 100644 index 0000000000..e37d3b4af9 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationError.model.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { ValidationErrorPathInner } from '../models/ValidationErrorPathInner.model'; +import { ValidationErrorSchema } from '../models/ValidationErrorSchema.model'; + +/** + * @public + */ +export interface ValidationError { + path: Array; + property: string; + message: string; + schema: ValidationErrorSchema; + instance: any; + name: string; + argument: any; + stack: string; +} diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts new file mode 100644 index 0000000000..397ccab3f2 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts @@ -0,0 +1,24 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** + +/** + * @public + */ +export type ValidationErrorPathInner = number | string; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts new file mode 100644 index 0000000000..851b031d8d --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts @@ -0,0 +1,25 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************************************** +// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. * +// ****************************************************************** +import { Schema } from '../models/Schema.model'; + +/** + * @public + */ +export type ValidationErrorSchema = Schema | string; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/models/index.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/index.ts new file mode 100644 index 0000000000..598c41822b --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/models/index.ts @@ -0,0 +1,84 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from '../models/Action.model'; +export * from '../models/ActionExample.model'; +export * from '../models/ActionSchema.model'; +export * from '../models/Autocomplete200Response.model'; +export * from '../models/Autocomplete200ResponseResultsInner.model'; +export * from '../models/AutocompleteRequest.model'; +export * from '../models/CancelTask200Response.model'; +export * from '../models/DryRun200Response.model'; +export * from '../models/DryRun200ResponseAllOf.model'; +export * from '../models/DryRun200ResponseAllOfDirectoryContentsInner.model'; +export * from '../models/DryRun200ResponseAllOfStepsInner.model'; +export * from '../models/DryRun200ResponseAllOfStepsInnerAllOf.model'; +export * from '../models/DryRunRequest.model'; +export * from '../models/DryRunRequestDirectoryContentsInner.model'; +export * from '../models/DryRunResult.model'; +export * from '../models/DryRunResultLogInner.model'; +export * from '../models/Entity.model'; +export * from '../models/EntityLink.model'; +export * from '../models/EntityMeta.model'; +export * from '../models/EntityRelation.model'; +export * from '../models/ErrorError.model'; +export * from '../models/ErrorRequest.model'; +export * from '../models/ErrorResponse.model'; +export * from '../models/JsonPrimitive.model'; +export * from '../models/JsonValue.model'; +export * from '../models/ListTasksResponse.model'; +export * from '../models/ModelError.model'; +export * from '../models/RetryRequest.model'; +export * from '../models/Scaffold201Response.model'; +export * from '../models/Scaffold400Response.model'; +export * from '../models/ScaffolderScaffoldOptions.model'; +export * from '../models/Schema.model'; +export * from '../models/SchemaAdditionalItems.model'; +export * from '../models/SchemaDependenciesValue.model'; +export * from '../models/SchemaExclusiveMaximum.model'; +export * from '../models/SchemaItems.model'; +export * from '../models/SchemaRequired.model'; +export * from '../models/SchemaType.model'; +export * from '../models/SerializedFile.model'; +export * from '../models/SerializedTask.model'; +export * from '../models/SerializedTaskEvent.model'; +export * from '../models/TaskEventType.model'; +export * from '../models/TaskRecoverStrategy.model'; +export * from '../models/TaskSecrets.model'; +export * from '../models/TaskSpecV1beta3.model'; +export * from '../models/TaskSpecV1beta3User.model'; +export * from '../models/TaskStatus.model'; +export * from '../models/TaskStep.model'; +export * from '../models/TaskStepEach.model'; +export * from '../models/TemplateEntityStepV1beta3.model'; +export * from '../models/TemplateEntityStepV1beta3AllOf.model'; +export * from '../models/TemplateEntityV1beta3.model'; +export * from '../models/TemplateEntityV1beta3AllOf.model'; +export * from '../models/TemplateEntityV1beta3AllOfSpec.model'; +export * from '../models/TemplateEntityV1beta3AllOfSpecParameters.model'; +export * from '../models/TemplateInfo.model'; +export * from '../models/TemplateInfoEntity.model'; +export * from '../models/TemplateParameterSchema.model'; +export * from '../models/TemplateParameterSchemaStepsInner.model'; +export * from '../models/TemplateParametersV1beta3.model'; +export * from '../models/TemplatePermissionsV1beta3.model'; +export * from '../models/TemplatePermissionsV1beta3AllOf.model'; +export * from '../models/TemplatePresentationV1beta3.model'; +export * from '../models/TemplatePresentationV1beta3ButtonLabels.model'; +export * from '../models/TemplateRecoveryV1beta3.model'; +export * from '../models/ValidationError.model'; +export * from '../models/ValidationErrorPathInner.model'; +export * from '../models/ValidationErrorSchema.model'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/pluginId.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/pluginId.ts new file mode 100644 index 0000000000..313bbbc7d5 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/pluginId.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const pluginId = 'scaffolder'; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/types/discovery.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/types/discovery.ts new file mode 100644 index 0000000000..a7f87d3780 --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/types/discovery.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This is a copy of the DiscoveryApi, to avoid importing core-plugin-api. + */ +export type DiscoveryApi = { + getBaseUrl(pluginId: string): Promise; +}; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/generated/types/fetch.ts b/plugins/scaffolder-common/client/src/schema/openapi/generated/types/fetch.ts new file mode 100644 index 0000000000..3de56c028e --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/generated/types/fetch.ts @@ -0,0 +1,22 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This is a copy of FetchApi, to avoid importing core-plugin-api. + */ +export type FetchApi = { + fetch: typeof fetch; +}; diff --git a/plugins/scaffolder-common/client/src/schema/openapi/index.ts b/plugins/scaffolder-common/client/src/schema/openapi/index.ts new file mode 100644 index 0000000000..db98243cbf --- /dev/null +++ b/plugins/scaffolder-common/client/src/schema/openapi/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2024 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './generated'; diff --git a/plugins/scaffolder-common/package.json b/plugins/scaffolder-common/package.json index 631c106ef3..50d695cdee 100644 --- a/plugins/scaffolder-common/package.json +++ b/plugins/scaffolder-common/package.json @@ -65,6 +65,8 @@ "@backstage/types": "workspace:^" }, "devDependencies": { - "@backstage/cli": "workspace:^" + "@backstage/cli": "workspace:^", + "cross-fetch": "^4.0.0", + "uri-template": "^2.0.0" } }