diff --git a/packages/backend-openapi-utils/src/types/generated.ts b/packages/backend-openapi-utils/src/types/generated.ts index e4d5dada72..ffbabb6f92 100644 --- a/packages/backend-openapi-utils/src/types/generated.ts +++ b/packages/backend-openapi-utils/src/types/generated.ts @@ -21,7 +21,12 @@ import { PathTemplate, ValueOf } from './common'; */ export type EndpointMap = Record< string, - { query?: object; body?: object; response?: object | void; path?: object } + { + query?: object; + body?: object; + response?: object | string | void; + path?: object; + } >; // OpenAPI generator doesn't emit regular lowercase 'delete'. diff --git a/plugins/scaffolder-backend/package.json b/plugins/scaffolder-backend/package.json index 6cef18efce..86a361c9dd 100644 --- a/plugins/scaffolder-backend/package.json +++ b/plugins/scaffolder-backend/package.json @@ -54,6 +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", "lint": "backstage-cli package lint", "prepack": "backstage-cli package prepack", "postpack": "backstage-cli package postpack", @@ -62,6 +63,7 @@ }, "dependencies": { "@backstage/backend-defaults": "workspace:^", + "@backstage/backend-openapi-utils": "workspace:^", "@backstage/backend-plugin-api": "workspace:^", "@backstage/catalog-model": "workspace:^", "@backstage/config": "workspace:^", @@ -89,7 +91,6 @@ "@types/luxon": "^3.0.0", "concat-stream": "^2.0.0", "express": "^4.17.1", - "express-promise-router": "^4.1.0", "fs-extra": "^11.2.0", "globby": "^11.0.0", "isbinaryfile": "^5.0.0", diff --git a/plugins/scaffolder-backend/src/schema/openapi.yaml b/plugins/scaffolder-backend/src/schema/openapi.yaml index 26253d404f..1e4e372810 100644 --- a/plugins/scaffolder-backend/src/schema/openapi.yaml +++ b/plugins/scaffolder-backend/src/schema/openapi.yaml @@ -13,6 +13,14 @@ components: examples: {} headers: {} parameters: + createdBy: + name: createdBy + in: query + description: Created by + required: false + allowReserved: true + schema: + type: string eventsAfter: name: after in: query @@ -26,6 +34,15 @@ components: allowReserved: true schema: type: string + limit: + name: limit + in: query + description: Number of records to return in the response. + required: false + allowReserved: true + schema: + type: integer + minimum: 0 namespace: name: namespace in: path @@ -40,6 +57,34 @@ components: allowReserved: true schema: type: string + offset: + name: offset + in: query + description: Number of records to skip in the query page. + required: false + allowReserved: true + schema: + type: integer + minimum: 0 + order: + name: order + in: query + description: Order + required: false + allowReserved: true + schema: + type: string + enum: + - asc + - desc + status: + name: status + in: query + description: Status + required: false + allowReserved: true + schema: + type: string taskId: name: taskId in: path @@ -55,62 +100,6 @@ components: application/json; charset=utf-8: schema: $ref: '#/components/schemas/Error' - ValidationError: - description: Validation errors. - content: - application/json: - schema: - type: object - properties: - errors: - type: array - items: - type: object - properties: - path: - type: array - items: - oneOf: - - type: string - - type: integer - property: - type: string - schema: - $ref: '#/components/schemas/Schema' - stack: - type: string - instance: - oneOf: - - type: string - - type: number - - type: boolean - - type: array - - type: object - nullable: true - argument: - oneOf: - - type: string - - type: number - - type: boolean - - type: array - - type: object - nullable: true - name: - type: string - message: - type: string - required: - - path - - property - - schema - - instance - - name - - message - - argument - - stack - additionalProperties: {} - required: - - errors schemas: Action: type: object @@ -160,6 +149,143 @@ components: $ref: '#/components/schemas/SerializedFile' output: $ref: '#/components/schemas/JsonObject' + required: + - log + - directoryContents + - output + EntityLink: + type: object + properties: + type: + type: string + description: An optional value to categorize links into specific groups + icon: + type: string + description: An optional semantic key that represents a visual icon. + title: + type: string + description: An optional descriptive title for the link. + url: + type: string + description: The url to the external site, document, etc. + required: + - url + description: A link to external information that is related to the entity. + additionalProperties: false + EntityMeta: + type: object + properties: + links: + type: array + items: + $ref: '#/components/schemas/EntityLink' + description: A list of external hyperlinks related to the entity. + tags: + type: array + items: + type: string + description: |- + A list of single-valued strings, to for example classify catalog entities in + various ways. + annotations: + $ref: '#/components/schemas/MapStringString' + labels: + $ref: '#/components/schemas/MapStringString' + description: + type: string + description: |- + A short (typically relatively few words, on one line) description of the + entity. + title: + type: string + description: |- + 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. + namespace: + type: string + description: The namespace that the entity belongs to. + name: + type: string + description: |- + 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. + etag: + type: string + description: |- + 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. + uid: + type: string + description: |- + 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. + required: + - name + description: Metadata fields common to all versions/kinds of entity. + additionalProperties: {} + EntityRelation: + type: object + properties: + targetRef: + type: string + description: The entity ref of the target of this relation. + type: + type: string + description: The type of the relation. + required: + - targetRef + - type + description: A relation of a specific type to another entity in the catalog. + additionalProperties: false + Entity: + type: object + properties: + relations: + type: array + items: + $ref: '#/components/schemas/EntityRelation' + description: The relations that this entity has with other entities. + spec: + $ref: '#/components/schemas/JsonObject' + metadata: + $ref: '#/components/schemas/EntityMeta' + kind: + type: string + description: The high level entity type being described. + apiVersion: + type: string + description: |- + The version of specification format for this particular entity that + this is written against. + required: + - metadata + - kind + - apiVersion + description: The parts of the format that's common to all versions/kinds of entity. Error: type: object properties: @@ -210,10 +336,10 @@ components: additionalProperties: {} JsonPrimitive: oneOf: + - type: boolean - type: number - type: string - - type: boolean - - type: null + - nullable: true description: A type representing all allowed JSON primitive values. JsonValue: oneOf: @@ -234,43 +360,12 @@ components: items: $ref: '#/components/schemas/SerializedTask' description: The response shape for the `listTasks` call to the `scaffolder-backend` - SerializedFile: + MapStringString: type: object - properties: - path: - type: string - content: - type: string - format: byte - executable: - type: boolean - symlink: - type: boolean - required: - - path - - content - SerializedTaskEvent: - type: object - properties: - id: - type: integer - isTaskRecoverable: - type: boolean - taskId: - type: string - body: - $ref: '#/components/schemas/JsonObject' - type: - $ref: '#/components/schemas/TaskEventType' - createdAt: - type: string - required: - - id - - taskId - - body - - type - - createdAt - description: SerializedTaskEvent + properties: {} + additionalProperties: + type: string + description: Construct a type with a set of properties K of type T ScaffolderScaffoldOptions: type: object properties: @@ -288,17 +383,19 @@ components: - templateRef - values description: The input options to the `scaffold` method of the `ScaffolderClient`. + # come back to this one - done + # check generated - done Schema: type: object properties: - $id: - type: string + # $id: + # type: string id: type: string - $schema: - type: string - $ref: - type: string + # $schema: + # type: string + # $ref: + # type: string title: type: string description: @@ -322,7 +419,7 @@ components: minLength: type: integer pattern: - type: string + type: object additionalItems: oneOf: - type: boolean @@ -373,24 +470,12 @@ components: - type: array items: type: string - const: - oneOf: - - type: string - - type: number - - type: boolean - - type: array - - type: object - nullable: true - enum: - type: array - items: - oneOf: - - type: string - - type: number - - type: boolean - - type: array - - type: object - nullable: true + # const: + # type: object + # enum: + # type: array + # items: + # type: object type: oneOf: - type: string @@ -413,12 +498,50 @@ components: $ref: '#/components/schemas/Schema' not: $ref: '#/components/schemas/Schema' - if: - $ref: '#/components/schemas/Schema' + # if: + # $ref: '#/components/schemas/Schema' then: $ref: '#/components/schemas/Schema' - else: - $ref: '#/components/schemas/Schema' + # else: + # $ref: '#/components/schemas/Schema' + additionalProperties: {} + SerializedFile: + type: object + properties: + path: + type: string + content: + type: string + format: byte + executable: + type: boolean + symlink: + type: boolean + required: + - path + - content + SerializedTaskEvent: + type: object + properties: + id: + type: integer + isTaskRecoverable: + type: boolean + taskId: + type: string + body: + $ref: '#/components/schemas/JsonObject' + type: + $ref: '#/components/schemas/TaskEventType' + createdAt: + type: string + required: + - id + - taskId + - body + - type + - createdAt + description: SerializedTaskEvent SerializedTask: type: object properties: @@ -454,14 +577,17 @@ components: - recovered TaskRecovery: type: object - properties: - EXPERIMENTAL_strategy: - $ref: '#/components/schemas/TaskRecoverStrategy' + # properties: + # come back to this one - done + # EXPERIMENTAL_strategy: + # $ref: '#/components/schemas/TaskRecoverStrategy' description: |- When task didn't have a chance to complete due to system restart you can define the strategy what to do with such tasks, by defining a strategy. By default, it is none, what means to not recover but updating the status from 'processing' to 'failed'. + additionalProperties: + $ref: '#/components/schemas/TaskRecoverStrategy' TaskRecoverStrategy: type: string description: | @@ -475,9 +601,8 @@ components: properties: backstageToken: type: string - additionalProperties: - type: string description: TaskSecrets + additionalProperties: {} TaskSpec: $ref: '#/components/schemas/TaskSpecV1beta3' TaskSpecV1beta3: @@ -522,9 +647,10 @@ components: type: string description: An entity ref for the author of the task description: Some decoration of the author of the task that should be available in the context - EXPERIMENTAL_recovery: - $ref: '#/components/schemas/TaskRecovery' - description: How to recover the task after system restart or system crash. + # come back to this one - done + # EXPERIMENTAL_recovery: + # $ref: '#/components/schemas/TaskRecovery' + # description: How to recover the task after system restart or system crash. required: - apiVersion - parameters @@ -533,6 +659,8 @@ components: description: |- A scaffolder task as stored in the database, generated from a v1beta3 apiVersion Template. + additionalProperties: + $ref: '#/components/schemas/TaskRecovery' TaskStatus: type: string enum: @@ -557,11 +685,11 @@ components: input: $ref: '#/components/schemas/JsonObject' description: Additional data that will be passed to the action. - if: - oneOf: - - type: string - - type: boolean - description: When this is false, or if the templated value string evaluates to something that is falsy the step will be skipped. + # if: + # oneOf: + # - type: string + # - type: boolean + # description: When this is false, or if the templated value string evaluates to something that is falsy the step will be skipped. each: oneOf: - type: string @@ -572,6 +700,7 @@ components: - name - action description: An individual step of a scaffolder task, as stored in the database. + additionalProperties: {} TemplateEntityStepV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' @@ -585,18 +714,21 @@ components: type: string input: $ref: '#/components/schemas/JsonObject' - if: - oneOf: - - type: string - - type: boolean - backstage:permissions: - $ref: '#/components/schemas/TemplatePermissionsV1beta3' + # if: + # oneOf: + # - type: string + # - type: boolean + # come back to this one - done + # backstage:permissions: + # $ref: '#/components/schemas/TemplatePermissionsV1beta3' required: - action description: Step that is part of a Template Entity. + additionalProperties: {} TemplateEntityV1beta3: allOf: - - $ref: '../../../catalog-backend/src/schema/openapi.yaml#/components/schemas/Entity' + # come back to this one - done + - $ref: '#/components/schemas/Entity' - type: object properties: apiVersion: @@ -616,9 +748,10 @@ components: presentation: $ref: '#/components/schemas/TemplatePresentationV1beta3' description: Template specific configuration of the presentation layer. - EXPERIMENTAL_recovery: - $ref: '#/components/schemas/TemplateRecoveryV1beta3' - description: Recovery strategy for the template + # come back to this one - done + # EXPERIMENTAL_recovery: + # $ref: '#/components/schemas/TemplateRecoveryV1beta3' + # description: Recovery strategy for the template parameters: oneOf: - $ref: '#/components/schemas/TemplateParametersV1beta3' @@ -648,6 +781,7 @@ components: - type - steps description: The specification of the Template Entity + additionalProperties: {} required: - apiVersion - kind @@ -669,7 +803,8 @@ components: description: The Template entity. properties: metadata: - $ref: '../../../catalog-backend/src/schema/openapi.yaml#/components/schemas/EntityMeta' + # come back to this one - done + $ref: '#/components/schemas/EntityMeta' description: The metadata of the Template. required: - entityRef @@ -681,37 +816,56 @@ components: properties: title: type: string - description: - type: string presentation: $ref: '#/components/schemas/TemplatePresentationV1beta3' + description: + type: string + # come back to this one - done + # 'ui:options': + # $ref: '#/components/schemas/JsonValue' steps: type: array items: type: object properties: title: - type: string + $ref: '#/components/schemas/JsonValue' description: - type: string + $ref: '#/components/schemas/JsonValue' schema: - $ref: '#/components/schemas/JsonObject' + $ref: '#/components/schemas/TemplateParametersV1beta3' required: - title - schema + # come back to this one - done + # EXPERIMENTAL_formDecorators: + # type: array + # items: + # - type: object + # properties: + # id: + # type: string + # input: + # $ref: '#/components/schemas/JsonObject' required: - title - steps description: |- The shape of each entry of parameters which gets rendered as a separate step in the wizard input + additionalProperties: {} + # check generated TemplateParametersV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' + # - type: object + # properties: + # # come back to this one - done + # backstage:permissions: + # $ref: '#/components/schemas/TemplatePermissionsV1beta3' - type: object - properties: - backstage:permissions: - $ref: '#/components/schemas/TemplatePermissionsV1beta3' + additionalProperties: + $ref: '#/components/schemas/TemplatePermissionsV1beta3' description: Parameter that is part of a Template Entity. TemplatePermissionsV1beta3: allOf: @@ -742,17 +896,64 @@ components: additionalProperties: false description: The presentation of the template. additionalProperties: {} + # check generated TemplateRecoveryV1beta3: allOf: - $ref: '#/components/schemas/JsonObject' - - type: string - enum: - - none - - startOver - description: |- - none - not recover, let the task be marked as failed - startOver - do recover, start the execution of the task from the first step. + - type: object + # properties: + # # come back to this one - done + # EXPERIMENTAL_strategy: + # type: string + # enum: + # - none + # - startOver + # description: |- + # none - not recover, let the task be marked as failed + # startOver - do recover, start the execution of the task from the first step. + additionalProperties: + type: string + enum: + - none + - startOver + description: |- + none - not recover, let the task be marked as failed + startOver - do recover, start the execution of the task from the first step. description: Depends on how you designed your task you might tailor the behaviour for each of them. + ValidationError: + type: object + properties: + path: + type: array + items: + oneOf: + - type: string + - type: integer + property: + type: string + message: + type: string + schema: + oneOf: + - type: string + - $ref: '#/components/schemas/Schema' + instance: + type: object + name: + type: string + argument: + type: object + stack: + type: string + required: + - path + - property + - message + - schema + - instance + - name + - argument + - stack securitySchemes: JWT: type: http @@ -812,7 +1013,12 @@ paths: security: - {} - JWT: [] - parameters: [] + parameters: + - $ref: '#/components/parameters/createdBy' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/order' + - $ref: '#/components/parameters/status' post: operationId: Scaffold description: |- @@ -835,7 +1041,18 @@ paths: id: type: string '400': - $ref: '#/components/responses/ValidationError' + description: Validation errors. + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/ValidationError' + required: + - errors security: - {} - JWT: [] @@ -966,48 +1183,51 @@ paths: content: application/json: schema: - type: object allOf: - $ref: '#/components/schemas/DryRunResult' - type: object properties: steps: + type: array + items: + allOf: + - $ref: '#/components/schemas/TemplateEntityStepV1beta3' + - type: object + properties: + id: + type: string + name: + type: string + required: + - id + - name + directoryContents: type: array items: type: object properties: - id: + path: type: string - name: + executable: + type: boolean + base64Content: type: string - action: - type: string - input: - $ref: '#/components/schemas/JsonObject' - if: - oneOf: - - type: string - - type: boolean - backstage:permissions: - $ref: '#/components/schemas/TemplatePermissionsV1beta3' required: - - id - - name - - action - directoryContents: - type: object - properties: - path: - type: string - executable: - type: boolean - base64Content: - type: string - required: - - path - - base64Content + - path + - base64Content '400': - $ref: '#/components/responses/ValidationError' + description: Validation errors. + content: + application/json: + schema: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/ValidationError' + required: + - errors parameters: [] /v2/autocomplete/{provider}/{resource}: @@ -1027,6 +1247,9 @@ paths: type: string token: type: string + required: + - context + - token responses: '200': 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/DefaultApi.server.ts new file mode 100644 index 0000000000..76c18a22f0 --- /dev/null +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/DefaultApi.server.ts @@ -0,0 +1,167 @@ +/* + * 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 { 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 { Scaffold201Response } from '../models/Scaffold201Response.model'; +import { Scaffold400Response } from '../models/Scaffold400Response.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'; + +/** + * @public + */ +export type Autocomplete = { + path: { + provider: string; + resource: string; + }; + body: AutocompleteRequest; + response: Autocomplete200Response; +}; +/** + * @public + */ +export type CancelTask = { + path: { + taskId: string; + }; + response: CancelTask200Response; +}; +/** + * @public + */ +export type DryRun = { + body: DryRunRequest; + response: DryRun200Response | Scaffold400Response; +}; +/** + * @public + */ +export type GetTask = { + path: { + taskId: string; + }; + response: SerializedTask; +}; +/** + * @public + */ +export type GetTemplateParameterSchema = { + path: { + namespace: string; + kind: string; + name: string; + }; + response: TemplateParameterSchema | Error | Error; +}; +/** + * @public + */ +export type ListActions = { + response: Array; +}; +/** + * @public + */ +export type ListTasks = { + query: { + createdBy?: string; + limit?: number; + offset?: number; + order?: 'asc' | 'desc'; + status?: string; + }; + response: ListTasksResponse; +}; +/** + * @public + */ +export type Retry = { + path: { + taskId: string; + }; + response: Scaffold201Response; +}; +/** + * @public + */ +export type Scaffold = { + body: ScaffolderScaffoldOptions; + response: Scaffold201Response | Scaffold400Response; +}; +/** + * @public + */ +export type StreamLogsEventStream = { + path: { + taskId: string; + }; + query: { + after?: number; + }; + response: string; +}; +/** + * @public + */ +export type StreamLogsPolling = { + path: { + taskId: string; + }; + query: { + after?: number; + }; + response: Array; +}; + +/** + * no description + */ + +export type EndpointMap = { + '#post|/v2/autocomplete/{provider}/{resource}': Autocomplete; + + '#post|/v2/tasks/{taskId}/cancel': CancelTask; + + '#post|/v2/dry-run': DryRun; + + '#get|/v2/tasks/{taskId}': GetTask; + + '#get|/v2/templates/{namespace}/{kind}/{name}/parameter-schema': GetTemplateParameterSchema; + + '#get|/v2/actions': ListActions; + + '#get|/v2/tasks': ListTasks; + + '#post|/v2/tasks/{taskId}/retry': Retry; + + '#post|/v2/tasks': Scaffold; + + '#get|/v2/tasks/{taskId}/eventstream': StreamLogsEventStream; + + '#get|/v2/tasks/{taskId}/events': StreamLogsPolling; +}; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/apis/index.ts new file mode 100644 index 0000000000..79855a6fc8 --- /dev/null +++ b/plugins/scaffolder-backend/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 './DefaultApi.server'; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/index.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/index.ts new file mode 100644 index 0000000000..69c39313c6 --- /dev/null +++ b/plugins/scaffolder-backend/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 './router'; diff --git a/plugins/scaffolder-backend/src/schema/openapi/generated/models/Action.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Action.model.ts new file mode 100644 index 0000000000..8e86b8b338 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ActionExample.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ActionExample.model.ts new file mode 100644 index 0000000000..cf2ffeaf8a --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ActionSchema.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ActionSchema.model.ts new file mode 100644 index 0000000000..037d2fff44 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Autocomplete200Response.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Autocomplete200Response.model.ts new file mode 100644 index 0000000000..cad9a0dd29 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Autocomplete200ResponseResultsInner.model.ts new file mode 100644 index 0000000000..bc8ea23cbb --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/AutocompleteRequest.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/AutocompleteRequest.model.ts new file mode 100644 index 0000000000..d9ab409224 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/CancelTask200Response.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/CancelTask200Response.model.ts new file mode 100644 index 0000000000..745ca8074e --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRun200Response.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRun200Response.model.ts new file mode 100644 index 0000000000..92b8d723a0 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOf.model.ts new file mode 100644 index 0000000000..553c6f765a --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfDirectoryContentsInner.model.ts new file mode 100644 index 0000000000..27174b9b0e --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInner.model.ts new file mode 100644 index 0000000000..229860f81a --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRun200ResponseAllOfStepsInnerAllOf.model.ts new file mode 100644 index 0000000000..6416143493 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRunRequest.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRunRequest.model.ts new file mode 100644 index 0000000000..510e7fa353 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRunRequestDirectoryContentsInner.model.ts new file mode 100644 index 0000000000..edf90d403d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRunResult.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRunResult.model.ts new file mode 100644 index 0000000000..66e35bd9e5 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/DryRunResultLogInner.model.ts new file mode 100644 index 0000000000..0f987091c0 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Entity.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Entity.model.ts new file mode 100644 index 0000000000..f386f3dd17 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/EntityLink.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/EntityLink.model.ts new file mode 100644 index 0000000000..53d7d1f9ff --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/EntityMeta.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/EntityMeta.model.ts new file mode 100644 index 0000000000..cc8dd555a6 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/EntityRelation.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/EntityRelation.model.ts new file mode 100644 index 0000000000..fe98a84481 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ErrorError.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ErrorError.model.ts new file mode 100644 index 0000000000..fe5811628d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ErrorRequest.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ErrorRequest.model.ts new file mode 100644 index 0000000000..d44dcb66d9 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ErrorResponse.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ErrorResponse.model.ts new file mode 100644 index 0000000000..91c120483d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/JsonPrimitive.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/JsonPrimitive.model.ts new file mode 100644 index 0000000000..6ca5d5144b --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/JsonValue.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/JsonValue.model.ts new file mode 100644 index 0000000000..9527b6828d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ListTasksResponse.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ListTasksResponse.model.ts new file mode 100644 index 0000000000..65a3a04bec --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ModelError.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ModelError.model.ts new file mode 100644 index 0000000000..5526d703e6 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Scaffold201Response.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Scaffold201Response.model.ts new file mode 100644 index 0000000000..9ff2cc8494 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Scaffold400Response.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Scaffold400Response.model.ts new file mode 100644 index 0000000000..515c5b6de3 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ScaffolderScaffoldOptions.model.ts new file mode 100644 index 0000000000..68b9927966 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/Schema.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/Schema.model.ts new file mode 100644 index 0000000000..0e24d46c30 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaAdditionalItems.model.ts new file mode 100644 index 0000000000..2039e2f9bb --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaDependenciesValue.model.ts new file mode 100644 index 0000000000..97609dda50 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaExclusiveMaximum.model.ts new file mode 100644 index 0000000000..c22a44e80b --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaItems.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaItems.model.ts new file mode 100644 index 0000000000..c63c6700aa --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaRequired.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaRequired.model.ts new file mode 100644 index 0000000000..b1b879cb3b --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SchemaType.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SchemaType.model.ts new file mode 100644 index 0000000000..dd0cbb93db --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SerializedFile.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SerializedFile.model.ts new file mode 100644 index 0000000000..d2bdfc72de --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SerializedTask.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SerializedTask.model.ts new file mode 100644 index 0000000000..7ba1196cab --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/SerializedTaskEvent.model.ts new file mode 100644 index 0000000000..484688e324 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskEventType.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskEventType.model.ts new file mode 100644 index 0000000000..8531d19de8 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskRecoverStrategy.model.ts new file mode 100644 index 0000000000..e00b2dfa88 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskSecrets.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskSecrets.model.ts new file mode 100644 index 0000000000..ae7c6a891c --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskSpecV1beta3.model.ts new file mode 100644 index 0000000000..bb32940062 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskSpecV1beta3User.model.ts new file mode 100644 index 0000000000..7f36a3f171 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskStatus.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskStatus.model.ts new file mode 100644 index 0000000000..42f8137fb3 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskStep.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskStep.model.ts new file mode 100644 index 0000000000..c36049b9a6 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TaskStepEach.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TaskStepEach.model.ts new file mode 100644 index 0000000000..398a19ee88 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityStepV1beta3.model.ts new file mode 100644 index 0000000000..e125c46f1d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityStepV1beta3AllOf.model.ts new file mode 100644 index 0000000000..dfba72bf8d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3.model.ts new file mode 100644 index 0000000000..efe325cfeb --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOf.model.ts new file mode 100644 index 0000000000..acc9f8c991 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpec.model.ts new file mode 100644 index 0000000000..3fa0063e08 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateEntityV1beta3AllOfSpecParameters.model.ts new file mode 100644 index 0000000000..1444a74e19 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateInfo.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateInfo.model.ts new file mode 100644 index 0000000000..ea5b9da6e9 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateInfoEntity.model.ts new file mode 100644 index 0000000000..b59414f80f --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateParameterSchema.model.ts new file mode 100644 index 0000000000..aab495d098 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateParameterSchemaStepsInner.model.ts new file mode 100644 index 0000000000..2f170b6fc6 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateParametersV1beta3.model.ts new file mode 100644 index 0000000000..e106f9a1de --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplatePermissionsV1beta3.model.ts new file mode 100644 index 0000000000..68c2df70a8 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplatePermissionsV1beta3AllOf.model.ts new file mode 100644 index 0000000000..c7eda5cd8a --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplatePresentationV1beta3.model.ts new file mode 100644 index 0000000000..83405f15aa --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplatePresentationV1beta3ButtonLabels.model.ts new file mode 100644 index 0000000000..37015a5468 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/TemplateRecoveryV1beta3.model.ts new file mode 100644 index 0000000000..3613718ac0 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ValidationError.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ValidationError.model.ts new file mode 100644 index 0000000000..e37d3b4af9 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ValidationErrorPathInner.model.ts new file mode 100644 index 0000000000..397ccab3f2 --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/ValidationErrorSchema.model.ts new file mode 100644 index 0000000000..851b031d8d --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/schema/openapi/generated/models/index.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts new file mode 100644 index 0000000000..2d6d6228d7 --- /dev/null +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/models/index.ts @@ -0,0 +1,83 @@ +/* + * 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/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-backend/src/schema/openapi/generated/router.ts b/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts new file mode 100644 index 0000000000..2e11c7e7c5 --- /dev/null +++ b/plugins/scaffolder-backend/src/schema/openapi/generated/router.ts @@ -0,0 +1,1738 @@ +/* + * 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 { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils'; +import { EndpointMap } from './'; + +export const spec = { + openapi: '3.0.3', + info: { + title: 'scaffolder', + version: '1', + description: + 'The Backstage backend plugin that helps you create new things', + license: { + name: 'Apache-2.0', + url: 'http://www.apache.org/licenses/LICENSE-2.0.html', + }, + contact: {}, + }, + servers: [ + { + url: '/', + }, + ], + components: { + examples: {}, + headers: {}, + parameters: { + createdBy: { + name: 'createdBy', + in: 'query', + description: 'Created by', + required: false, + allowReserved: true, + schema: { + type: 'string', + }, + }, + eventsAfter: { + name: 'after', + in: 'query', + description: 'Offset event ID to stream events after.', + schema: { + type: 'integer', + }, + }, + kind: { + name: 'kind', + in: 'path', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + limit: { + name: 'limit', + in: 'query', + description: 'Number of records to return in the response.', + required: false, + allowReserved: true, + schema: { + type: 'integer', + minimum: 0, + }, + }, + namespace: { + name: 'namespace', + in: 'path', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + name: { + name: 'name', + in: 'path', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + offset: { + name: 'offset', + in: 'query', + description: 'Number of records to skip in the query page.', + required: false, + allowReserved: true, + schema: { + type: 'integer', + minimum: 0, + }, + }, + order: { + name: 'order', + in: 'query', + description: 'Order', + required: false, + allowReserved: true, + schema: { + type: 'string', + enum: ['asc', 'desc'], + }, + }, + status: { + name: 'status', + in: 'query', + description: 'Status', + required: false, + allowReserved: true, + schema: { + type: 'string', + }, + }, + taskId: { + name: 'taskId', + in: 'path', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + }, + requestBodies: {}, + responses: { + ErrorResponse: { + description: 'An error response from the backend.', + content: { + 'application/json; charset=utf-8': { + schema: { + $ref: '#/components/schemas/Error', + }, + }, + }, + }, + }, + schemas: { + Action: { + type: 'object', + properties: { + id: { + type: 'string', + }, + description: { + type: 'string', + }, + examples: { + type: 'array', + items: { + $ref: '#/components/schemas/ActionExample', + }, + }, + schema: { + type: 'object', + properties: { + input: { + $ref: '#/components/schemas/JsonObject', + }, + output: { + $ref: '#/components/schemas/JsonObject', + }, + }, + }, + }, + required: ['id'], + description: + 'The response shape for a single action in the `listActions` call to the `scaffolder-backend`', + }, + ActionExample: { + type: 'object', + properties: { + description: { + type: 'string', + }, + example: { + type: 'string', + }, + }, + required: ['description', 'example'], + description: 'A single action example', + }, + DryRunResult: { + type: 'object', + properties: { + log: { + type: 'array', + items: { + type: 'object', + properties: { + body: { + $ref: '#/components/schemas/JsonObject', + }, + }, + }, + }, + directoryContents: { + type: 'array', + items: { + $ref: '#/components/schemas/SerializedFile', + }, + }, + output: { + $ref: '#/components/schemas/JsonObject', + }, + }, + required: ['log', 'directoryContents', 'output'], + }, + EntityLink: { + type: 'object', + properties: { + type: { + type: 'string', + description: + 'An optional value to categorize links into specific groups', + }, + icon: { + type: 'string', + description: + 'An optional semantic key that represents a visual icon.', + }, + title: { + type: 'string', + description: 'An optional descriptive title for the link.', + }, + url: { + type: 'string', + description: 'The url to the external site, document, etc.', + }, + }, + required: ['url'], + description: + 'A link to external information that is related to the entity.', + additionalProperties: false, + }, + EntityMeta: { + type: 'object', + properties: { + links: { + type: 'array', + items: { + $ref: '#/components/schemas/EntityLink', + }, + description: 'A list of external hyperlinks related to the entity.', + }, + tags: { + type: 'array', + items: { + type: 'string', + }, + description: + 'A list of single-valued strings, to for example classify catalog entities in\nvarious ways.', + }, + annotations: { + $ref: '#/components/schemas/MapStringString', + }, + labels: { + $ref: '#/components/schemas/MapStringString', + }, + description: { + type: 'string', + description: + 'A short (typically relatively few words, on one line) description of the\nentity.', + }, + title: { + type: 'string', + description: + 'A display name of the entity, to be presented in user interfaces instead\nof the `name` property above, when available.\nThis field is sometimes useful when the `name` is cumbersome or ends up\nbeing perceived as overly technical. The title generally does not have\nas stringent format requirements on it, so it may contain special\ncharacters and be more explanatory. Do keep it very short though, and\navoid situations where a title can be confused with the name of another\nentity, or where two entities share a title.\nNote that this is only for display purposes, and may be ignored by some\nparts of the code. Entity references still always make use of the `name`\nproperty, not the title.', + }, + namespace: { + type: 'string', + description: 'The namespace that the entity belongs to.', + }, + name: { + type: 'string', + description: + 'The name of the entity.\nMust be unique within the catalog at any given point in time, for any\ngiven namespace + kind pair. This value is part of the technical\nidentifier of the entity, and as such it will appear in URLs, database\ntables, entity references, and similar. It is subject to restrictions\nregarding what characters are allowed.\nIf you want to use a different, more human readable string with fewer\nrestrictions on it in user interfaces, see the `title` field below.', + }, + etag: { + type: 'string', + description: + 'An opaque string that changes for each update operation to any part of\nthe entity, including metadata.\nThis field can not be set by the user at creation time, and the server\nwill reject an attempt to do so. The field will be populated in read\noperations. The field can (optionally) be specified when performing\nupdate or delete operations, and the server will then reject the\noperation if it does not match the current stored value.', + }, + uid: { + type: 'string', + description: + 'A globally unique ID for the entity.\nThis field can not be set by the user at creation time, and the server\nwill reject an attempt to do so. The field will be populated in read\noperations. The field can (optionally) be specified when performing\nupdate or delete operations, but the server is free to reject requests\nthat do so in such a way that it breaks semantics.', + }, + }, + required: ['name'], + description: 'Metadata fields common to all versions/kinds of entity.', + additionalProperties: {}, + }, + EntityRelation: { + type: 'object', + properties: { + targetRef: { + type: 'string', + description: 'The entity ref of the target of this relation.', + }, + type: { + type: 'string', + description: 'The type of the relation.', + }, + }, + required: ['targetRef', 'type'], + description: + 'A relation of a specific type to another entity in the catalog.', + additionalProperties: false, + }, + Entity: { + type: 'object', + properties: { + relations: { + type: 'array', + items: { + $ref: '#/components/schemas/EntityRelation', + }, + description: + 'The relations that this entity has with other entities.', + }, + spec: { + $ref: '#/components/schemas/JsonObject', + }, + metadata: { + $ref: '#/components/schemas/EntityMeta', + }, + kind: { + type: 'string', + description: 'The high level entity type being described.', + }, + apiVersion: { + type: 'string', + description: + 'The version of specification format for this particular entity that\nthis is written against.', + }, + }, + required: ['metadata', 'kind', 'apiVersion'], + description: + "The parts of the format that's common to all versions/kinds of entity.", + }, + Error: { + type: 'object', + properties: { + error: { + type: 'object', + properties: { + name: { + type: 'string', + }, + message: { + type: 'string', + }, + stack: { + type: 'string', + }, + code: { + type: 'string', + }, + }, + required: ['name', 'message'], + }, + request: { + type: 'object', + properties: { + method: { + type: 'string', + }, + url: { + type: 'string', + }, + }, + required: ['method', 'url'], + }, + response: { + type: 'object', + properties: { + statusCode: { + type: 'number', + }, + }, + required: ['statusCode'], + }, + }, + required: ['error', 'response'], + additionalProperties: {}, + }, + JsonArray: { + type: 'array', + items: { + $ref: '#/components/schemas/JsonValue', + }, + description: 'A type representing all allowed JSON array values.', + }, + JsonObject: { + type: 'object', + properties: {}, + description: 'A type representing all allowed JSON object values.', + additionalProperties: {}, + }, + JsonPrimitive: { + oneOf: [ + { + type: 'boolean', + }, + { + type: 'number', + }, + { + type: 'string', + }, + { + nullable: true, + }, + ], + description: 'A type representing all allowed JSON primitive values.', + }, + JsonValue: { + oneOf: [ + { + $ref: '#/components/schemas/JsonObject', + }, + { + $ref: '#/components/schemas/JsonArray', + }, + { + $ref: '#/components/schemas/JsonPrimitive', + }, + ], + description: 'A type representing all allowed JSON values.', + }, + ListActionsResponse: { + type: 'array', + items: { + $ref: '#/components/schemas/Action', + }, + description: + 'The response shape for the `listActions` call to the `scaffolder-backend`', + }, + ListTasksResponse: { + type: 'object', + properties: { + tasks: { + type: 'array', + items: { + $ref: '#/components/schemas/SerializedTask', + }, + }, + }, + description: + 'The response shape for the `listTasks` call to the `scaffolder-backend`', + }, + MapStringString: { + type: 'object', + properties: {}, + additionalProperties: { + type: 'string', + }, + description: 'Construct a type with a set of properties K of type T', + }, + ScaffolderScaffoldOptions: { + type: 'object', + properties: { + templateRef: { + type: 'string', + }, + values: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/JsonValue', + }, + }, + secrets: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + }, + required: ['templateRef', 'values'], + description: + 'The input options to the `scaffold` method of the `ScaffolderClient`.', + }, + Schema: { + type: 'object', + properties: { + id: { + type: 'string', + }, + title: { + type: 'string', + }, + description: { + type: 'string', + }, + multipleOf: { + type: 'number', + }, + maximum: { + type: 'number', + }, + exclusiveMaximum: { + oneOf: [ + { + type: 'number', + }, + { + type: 'boolean', + }, + ], + }, + minimum: { + type: 'number', + }, + exclusiveMinimum: { + oneOf: [ + { + type: 'number', + }, + { + type: 'boolean', + }, + ], + }, + maxLength: { + type: 'integer', + }, + minLength: { + type: 'integer', + }, + pattern: { + type: 'object', + }, + additionalItems: { + oneOf: [ + { + type: 'boolean', + }, + { + $ref: '#/components/schemas/Schema', + }, + ], + }, + items: { + oneOf: [ + { + $ref: '#/components/schemas/Schema', + }, + { + type: 'array', + items: { + $ref: '#/components/schemas/Schema', + }, + }, + ], + }, + maxItems: { + type: 'integer', + }, + minItems: { + type: 'integer', + }, + uniqueItems: { + type: 'boolean', + }, + maxProperties: { + type: 'integer', + }, + minProperties: { + type: 'integer', + }, + required: { + oneOf: [ + { + type: 'array', + items: { + type: 'string', + }, + }, + { + type: 'boolean', + }, + ], + }, + additionalProperties: { + oneOf: [ + { + type: 'boolean', + }, + { + $ref: '#/components/schemas/Schema', + }, + ], + }, + definitions: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/Schema', + }, + }, + properties: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/Schema', + }, + }, + patternProperties: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/Schema', + }, + }, + dependencies: { + type: 'object', + additionalProperties: { + oneOf: [ + { + $ref: '#/components/schemas/Schema', + }, + { + type: 'array', + items: { + type: 'string', + }, + }, + ], + }, + }, + type: { + oneOf: [ + { + type: 'string', + }, + { + type: 'array', + items: { + type: 'string', + }, + }, + ], + }, + format: { + type: 'string', + }, + allOf: { + type: 'array', + items: { + $ref: '#/components/schemas/Schema', + }, + }, + anyOf: { + type: 'array', + items: { + $ref: '#/components/schemas/Schema', + }, + }, + oneOf: { + type: 'array', + items: { + $ref: '#/components/schemas/Schema', + }, + }, + not: { + $ref: '#/components/schemas/Schema', + }, + then: { + $ref: '#/components/schemas/Schema', + }, + }, + additionalProperties: {}, + }, + SerializedFile: { + type: 'object', + properties: { + path: { + type: 'string', + }, + content: { + type: 'string', + format: 'byte', + }, + executable: { + type: 'boolean', + }, + symlink: { + type: 'boolean', + }, + }, + required: ['path', 'content'], + }, + SerializedTaskEvent: { + type: 'object', + properties: { + id: { + type: 'integer', + }, + isTaskRecoverable: { + type: 'boolean', + }, + taskId: { + type: 'string', + }, + body: { + $ref: '#/components/schemas/JsonObject', + }, + type: { + $ref: '#/components/schemas/TaskEventType', + }, + createdAt: { + type: 'string', + }, + }, + required: ['id', 'taskId', 'body', 'type', 'createdAt'], + description: 'SerializedTaskEvent', + }, + SerializedTask: { + type: 'object', + properties: { + id: { + type: 'string', + }, + spec: { + $ref: '#/components/schemas/TaskSpec', + }, + status: { + $ref: '#/components/schemas/TaskStatus', + }, + createdAt: { + type: 'string', + }, + lastHeartbeatAt: { + type: 'string', + }, + createdBy: { + type: 'string', + }, + secrets: { + $ref: '#/components/schemas/TaskSecrets', + }, + state: { + $ref: '#/components/schemas/JsonObject', + }, + }, + required: ['id', 'spec', 'status', 'createdAt'], + description: 'SerializedTask', + }, + TaskEventType: { + type: 'string', + description: 'TaskEventType', + enum: ['completion', 'log', 'cancelled', 'recovered'], + }, + TaskRecovery: { + type: 'object', + description: + "When task didn't have a chance to complete due to system restart you can define the strategy what to do with such tasks,\nby defining a strategy.\n\nBy default, it is none, what means to not recover but updating the status from 'processing' to 'failed'.", + additionalProperties: { + $ref: '#/components/schemas/TaskRecoverStrategy', + }, + }, + TaskRecoverStrategy: { + type: 'string', + description: + '- none: not recover, let the task be marked as failed\n- startOver: do recover, start the execution of the task from the first step.\n', + enum: ['none', 'startOver'], + }, + TaskSecrets: { + type: 'object', + properties: { + backstageToken: { + type: 'string', + }, + }, + description: 'TaskSecrets', + additionalProperties: {}, + }, + TaskSpec: { + $ref: '#/components/schemas/TaskSpecV1beta3', + }, + TaskSpecV1beta3: { + type: 'object', + properties: { + apiVersion: { + type: 'string', + enum: ['scaffolder.backstage.io/v1beta3'], + description: 'The apiVersion string of the TaskSpec.', + }, + parameters: { + $ref: '#/components/schemas/JsonObject', + description: + 'This is a JSONSchema which is used to render a form in the frontend\nto collect user input and validate it against that schema. This can then be used in the `steps` part below to template\nvariables passed from the user into each action in the template.\n', + }, + steps: { + type: 'array', + items: { + $ref: '#/components/schemas/TaskStep', + }, + description: + 'A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\njavascript action and some optional input parameters that may or may not have been collected from the end user.\n', + }, + output: { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/JsonValue', + }, + description: + 'The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n', + }, + templateInfo: { + $ref: '#/components/schemas/TemplateInfo', + description: + 'Some information about the template that is stored on the task spec.', + }, + user: { + type: 'object', + properties: { + entity: { + type: 'object', + properties: {}, + description: 'The decorated entity from the Catalog', + additionalProperties: {}, + }, + ref: { + type: 'string', + description: 'An entity ref for the author of the task', + }, + }, + description: + 'Some decoration of the author of the task that should be available in the context', + }, + }, + required: ['apiVersion', 'parameters', 'steps', 'output'], + description: + 'A scaffolder task as stored in the database, generated from a v1beta3\napiVersion Template.', + additionalProperties: { + $ref: '#/components/schemas/TaskRecovery', + }, + }, + TaskStatus: { + type: 'string', + enum: ['cancelled', 'completed', 'failed', 'open', 'processing'], + description: 'The status of each step of the Task', + }, + TaskStep: { + type: 'object', + properties: { + id: { + type: 'string', + description: 'A unique identifier for this step.', + }, + name: { + type: 'string', + description: 'A display name to show the user.', + }, + action: { + type: 'string', + description: + 'The underlying action ID that will be called as part of running this step.', + }, + input: { + $ref: '#/components/schemas/JsonObject', + description: 'Additional data that will be passed to the action.', + }, + each: { + oneOf: [ + { + type: 'string', + }, + { + $ref: '#/components/schemas/JsonArray', + }, + ], + description: 'Run step repeatedly.', + }, + }, + required: ['id', 'name', 'action'], + description: + 'An individual step of a scaffolder task, as stored in the database.', + additionalProperties: {}, + }, + TemplateEntityStepV1beta3: { + allOf: [ + { + $ref: '#/components/schemas/JsonObject', + }, + { + type: 'object', + properties: { + id: { + type: 'string', + }, + name: { + type: 'string', + }, + action: { + type: 'string', + }, + input: { + $ref: '#/components/schemas/JsonObject', + }, + }, + required: ['action'], + }, + ], + description: 'Step that is part of a Template Entity.', + additionalProperties: {}, + }, + TemplateEntityV1beta3: { + allOf: [ + { + $ref: '#/components/schemas/Entity', + }, + { + type: 'object', + properties: { + apiVersion: { + type: 'string', + enum: ['scaffolder.backstage.io/v1beta3'], + description: 'The apiVersion string of the TaskSpec.', + }, + kind: { + type: 'string', + enum: ['Template'], + description: 'The kind of the entity', + }, + spec: { + type: 'object', + properties: { + type: { + type: 'string', + description: + 'The type that the Template will create. For example service, website or library.', + }, + presentation: { + $ref: '#/components/schemas/TemplatePresentationV1beta3', + description: + 'Template specific configuration of the presentation layer.', + }, + parameters: { + oneOf: [ + { + $ref: '#/components/schemas/TemplateParametersV1beta3', + }, + { + type: 'array', + items: { + $ref: '#/components/schemas/TemplateParametersV1beta3', + }, + }, + ], + description: + "This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\nto collect user input and validate it against that schema. This can then be used in the `steps` part below to template\nvariables passed from the user into each action in the template.", + }, + steps: { + type: 'array', + items: { + $ref: '#/components/schemas/TemplateEntityStepV1beta3', + }, + description: + 'A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\njavascript action and some optional input parameters that may or may not have been collected from the end user.', + }, + output: { + type: 'object', + additionalProperties: { + type: 'string', + }, + description: + 'The output is an object where template authors can pull out information from template actions and return them in a known standard way.', + }, + owner: { + type: 'string', + description: 'The owner entityRef of the TemplateEntity', + }, + }, + required: ['type', 'steps'], + description: 'The specification of the Template Entity', + additionalProperties: {}, + }, + }, + required: ['apiVersion', 'kind', 'spec'], + }, + ], + description: + 'Backstage catalog Template kind Entity. Templates are used by the Scaffolder\nplugin to create new entities, such as Components.', + }, + TemplateInfo: { + type: 'object', + properties: { + entityRef: { + type: 'string', + description: 'The entityRef of the template.', + }, + baseUrl: { + type: 'string', + description: + 'Where the template is stored, so we can resolve relative paths for things like `fetch:template` paths.', + }, + entity: { + type: 'object', + description: 'The Template entity.', + properties: { + metadata: { + $ref: '#/components/schemas/EntityMeta', + description: 'The metadata of the Template.', + }, + }, + }, + }, + required: ['entityRef'], + description: + 'Information about a template that is stored on a task specification.\nIncludes a stringified entityRef, and the baseUrl which is usually the relative path of the template definition', + }, + TemplateParameterSchema: { + type: 'object', + properties: { + title: { + type: 'string', + }, + presentation: { + $ref: '#/components/schemas/TemplatePresentationV1beta3', + }, + description: { + type: 'string', + }, + steps: { + type: 'array', + items: { + type: 'object', + properties: { + title: { + $ref: '#/components/schemas/JsonValue', + }, + description: { + $ref: '#/components/schemas/JsonValue', + }, + schema: { + $ref: '#/components/schemas/TemplateParametersV1beta3', + }, + }, + required: ['title', 'schema'], + }, + }, + }, + required: ['title', 'steps'], + description: + 'The shape of each entry of parameters which gets rendered\nas a separate step in the wizard input', + additionalProperties: {}, + }, + TemplateParametersV1beta3: { + allOf: [ + { + $ref: '#/components/schemas/JsonObject', + }, + { + type: 'object', + additionalProperties: { + $ref: '#/components/schemas/TemplatePermissionsV1beta3', + }, + }, + ], + description: 'Parameter that is part of a Template Entity.', + }, + TemplatePermissionsV1beta3: { + allOf: [ + { + $ref: '#/components/schemas/JsonObject', + }, + { + type: 'object', + properties: { + tags: { + type: 'array', + items: { + type: 'string', + }, + }, + }, + }, + ], + description: 'Access control properties for parts of a template.', + }, + TemplatePresentationV1beta3: { + type: 'object', + properties: { + buttonLabels: { + type: 'object', + properties: { + backButtonText: { + type: 'string', + description: + 'The text for the button which leads to the previous template page', + }, + createButtonText: { + type: 'string', + description: + 'The text for the button which starts the execution of the template', + }, + reviewButtonText: { + type: 'string', + description: + "The text for the button which opens template's review/summary", + }, + }, + description: "Overrides default buttons' text", + additionalProperties: false, + }, + }, + description: 'The presentation of the template.', + additionalProperties: {}, + }, + TemplateRecoveryV1beta3: { + allOf: [ + { + $ref: '#/components/schemas/JsonObject', + }, + { + type: 'object', + additionalProperties: { + type: 'string', + enum: ['none', 'startOver'], + description: + 'none - not recover, let the task be marked as failed\nstartOver - do recover, start the execution of the task from the first step.', + }, + }, + ], + description: + 'Depends on how you designed your task you might tailor the behaviour for each of them.', + }, + ValidationError: { + type: 'object', + properties: { + path: { + type: 'array', + items: { + oneOf: [ + { + type: 'string', + }, + { + type: 'integer', + }, + ], + }, + }, + property: { + type: 'string', + }, + message: { + type: 'string', + }, + schema: { + oneOf: [ + { + type: 'string', + }, + { + $ref: '#/components/schemas/Schema', + }, + ], + }, + instance: { + type: 'object', + }, + name: { + type: 'string', + }, + argument: { + type: 'object', + }, + stack: { + type: 'string', + }, + }, + required: [ + 'path', + 'property', + 'message', + 'schema', + 'instance', + 'name', + 'argument', + 'stack', + ], + }, + }, + securitySchemes: { + JWT: { + type: 'http', + scheme: 'bearer', + bearerFormat: 'JWT', + }, + }, + }, + paths: { + '/v2/templates/{namespace}/{kind}/{name}/parameter-schema': { + get: { + operationId: 'GetTemplateParameterSchema', + description: 'Get template parameter schema.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/TemplateParameterSchema', + }, + }, + }, + }, + '400': { + $ref: '#/components/responses/ErrorResponse', + }, + default: { + $ref: '#/components/responses/ErrorResponse', + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [ + { + $ref: '#/components/parameters/namespace', + }, + { + $ref: '#/components/parameters/kind', + }, + { + $ref: '#/components/parameters/name', + }, + ], + }, + }, + '/v2/actions': { + get: { + operationId: 'ListActions', + description: 'Returns a list of all installed actions.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ListActionsResponse', + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [], + }, + }, + '/v2/tasks': { + get: { + operationId: 'ListTasks', + description: + 'Returns a list of tasks, filtering by ownership and/or status if given.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ListTasksResponse', + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [ + { + $ref: '#/components/parameters/createdBy', + }, + { + $ref: '#/components/parameters/limit', + }, + { + $ref: '#/components/parameters/offset', + }, + { + $ref: '#/components/parameters/order', + }, + { + $ref: '#/components/parameters/status', + }, + ], + }, + post: { + operationId: 'Scaffold', + description: + 'Executes the scaffolding of a component, given a template and its\nparameter values.', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/ScaffolderScaffoldOptions', + }, + }, + }, + }, + responses: { + '201': { + description: 'Created', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + id: { + type: 'string', + }, + }, + }, + }, + }, + }, + '400': { + description: 'Validation errors.', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + errors: { + type: 'array', + items: { + $ref: '#/components/schemas/ValidationError', + }, + }, + }, + required: ['errors'], + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [], + }, + }, + '/v2/tasks/{taskId}': { + get: { + operationId: 'GetTask', + description: 'Get a task by ID.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + $ref: '#/components/schemas/SerializedTask', + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [ + { + $ref: '#/components/parameters/taskId', + }, + ], + }, + }, + '/v2/tasks/{taskId}/cancel': { + post: { + operationId: 'CancelTask', + description: + 'Sends a signal to a task broker to cancel the running task by taskId.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + status: { + $ref: '#/components/schemas/TaskStatus', + }, + }, + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [ + { + $ref: '#/components/parameters/taskId', + }, + ], + }, + }, + '/v2/tasks/{taskId}/retry': { + post: { + operationId: 'Retry', + description: 'Starts the task again from the point where it failed.', + responses: { + '201': { + description: 'Ok', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + id: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + security: [ + {}, + { + JWT: [], + }, + ], + parameters: [ + { + $ref: '#/components/parameters/taskId', + }, + ], + }, + }, + '/v2/tasks/{taskId}/eventstream': { + get: { + operationId: 'StreamLogsEventStream', + description: 'Get event stream for a task by ID.', + responses: { + '200': { + description: 'Ok', + content: { + 'text/event-stream': { + schema: { + type: 'string', + }, + }, + }, + }, + }, + parameters: [ + { + $ref: '#/components/parameters/eventsAfter', + }, + { + $ref: '#/components/parameters/taskId', + }, + ], + }, + }, + '/v2/tasks/{taskId}/events': { + get: { + operationId: 'StreamLogsPolling', + description: 'Get events for a task by ID.', + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + type: 'array', + items: { + $ref: '#/components/schemas/SerializedTaskEvent', + }, + }, + }, + }, + }, + }, + parameters: [ + { + $ref: '#/components/parameters/eventsAfter', + }, + { + $ref: '#/components/parameters/taskId', + }, + ], + }, + }, + '/v2/dry-run': { + post: { + operationId: 'DryRun', + description: 'Perform a dry-run of a template', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + template: { + $ref: '#/components/schemas/TemplateEntityV1beta3', + }, + values: { + type: 'object', + }, + secrets: { + type: 'object', + }, + directoryContents: { + type: 'array', + items: { + type: 'object', + properties: { + path: { + type: 'string', + }, + base64Content: { + type: 'string', + }, + }, + }, + }, + }, + required: ['template', 'values', 'directoryContents'], + }, + }, + }, + }, + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + allOf: [ + { + $ref: '#/components/schemas/DryRunResult', + }, + { + type: 'object', + properties: { + steps: { + type: 'array', + items: { + allOf: [ + { + $ref: '#/components/schemas/TemplateEntityStepV1beta3', + }, + { + type: 'object', + properties: { + id: { + type: 'string', + }, + name: { + type: 'string', + }, + }, + required: ['id', 'name'], + }, + ], + }, + }, + directoryContents: { + type: 'array', + items: { + type: 'object', + properties: { + path: { + type: 'string', + }, + executable: { + type: 'boolean', + }, + base64Content: { + type: 'string', + }, + }, + required: ['path', 'base64Content'], + }, + }, + }, + }, + ], + }, + }, + }, + }, + '400': { + description: 'Validation errors.', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + errors: { + type: 'array', + items: { + $ref: '#/components/schemas/ValidationError', + }, + }, + }, + required: ['errors'], + }, + }, + }, + }, + }, + parameters: [], + }, + }, + '/v2/autocomplete/{provider}/{resource}': { + post: { + operationId: 'Autocomplete', + description: + 'Perform an autocomplete for the given provider and resource.', + requestBody: { + required: true, + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + context: { + type: 'object', + additionalProperties: { + type: 'string', + }, + }, + token: { + type: 'string', + }, + }, + required: ['context', 'token'], + }, + }, + }, + }, + responses: { + '200': { + description: 'Ok', + content: { + 'application/json': { + schema: { + type: 'object', + properties: { + results: { + type: 'array', + items: { + type: 'object', + properties: { + title: { + type: 'string', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + parameters: [ + { + in: 'path', + name: 'provider', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + { + in: 'path', + name: 'resource', + required: true, + allowReserved: true, + schema: { + type: 'string', + }, + }, + ], + }, + }, + }, +} as const; +export const createOpenApiRouter = async ( + options?: Parameters< + typeof createValidatedOpenApiRouterFromGeneratedEndpointMap + >['1'], +) => + createValidatedOpenApiRouterFromGeneratedEndpointMap( + spec, + options, + ); diff --git a/plugins/scaffolder-backend/src/schema/openapi/index.ts b/plugins/scaffolder-backend/src/schema/openapi/index.ts new file mode 100644 index 0000000000..db98243cbf --- /dev/null +++ b/plugins/scaffolder-backend/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-backend/src/service/router.ts b/plugins/scaffolder-backend/src/service/router.ts index 6e476d9a19..19dfd8274d 100644 --- a/plugins/scaffolder-backend/src/service/router.ts +++ b/plugins/scaffolder-backend/src/service/router.ts @@ -79,7 +79,6 @@ import { } from '@backstage/plugin-scaffolder-node/alpha'; import { HumanDuration, JsonObject } from '@backstage/types'; import express from 'express'; -import Router from 'express-promise-router'; import { validate } from 'jsonschema'; import { Duration } from 'luxon'; import { pathToFileURL } from 'url'; @@ -93,6 +92,7 @@ import { import { createDryRunner } from '../scaffolder/dryrun'; import { StorageTaskBroker } from '../scaffolder/tasks/StorageTaskBroker'; import { InternalTaskSecrets } from '../scaffolder/tasks/types'; +import { createOpenApiRouter } from '../schema/openapi'; import { checkPermission, checkTaskPermission, @@ -187,7 +187,7 @@ const readDuration = ( export async function createRouter( options: RouterOptions, ): Promise { - const router = Router(); + const router = await createOpenApiRouter(); // Be generous in upload size to support a wide range of templates in dry-run mode. router.use(express.json({ limit: '10MB' })); diff --git a/yarn.lock b/yarn.lock index 72dceeed70..855748a4e4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7323,6 +7323,7 @@ __metadata: dependencies: "@backstage/backend-app-api": "workspace:^" "@backstage/backend-defaults": "workspace:^" + "@backstage/backend-openapi-utils": "workspace:^" "@backstage/backend-plugin-api": "workspace:^" "@backstage/backend-test-utils": "workspace:^" "@backstage/catalog-model": "workspace:^" @@ -7359,7 +7360,6 @@ __metadata: concat-stream: "npm:^2.0.0" esbuild: "npm:^0.25.0" express: "npm:^4.17.1" - express-promise-router: "npm:^4.1.0" fs-extra: "npm:^11.2.0" globby: "npm:^11.0.0" isbinaryfile: "npm:^5.0.0"