@backstage/plugin-scaffolder-backend 2.1.0-next.2 → 2.2.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router.cjs.js","sources":["../../../../src/schema/openapi/generated/router.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';\nimport { EndpointMap } from './apis';\n\nexport const spec = {\n openapi: '3.0.3',\n info: {\n title: 'scaffolder',\n version: '1',\n description:\n 'The Backstage backend plugin that helps you create new things',\n license: {\n name: 'Apache-2.0',\n url: 'http://www.apache.org/licenses/LICENSE-2.0.html',\n },\n contact: {},\n },\n servers: [\n {\n url: '/',\n },\n ],\n components: {\n examples: {},\n headers: {},\n parameters: {\n createdBy: {\n name: 'createdBy',\n in: 'query',\n description: 'Created by',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n eventsAfter: {\n name: 'after',\n in: 'query',\n description: 'Offset event ID to stream events after.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n },\n },\n kind: {\n name: 'kind',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n limit: {\n name: 'limit',\n in: 'query',\n description: 'Number of records to return in the response.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n namespace: {\n name: 'namespace',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n name: {\n name: 'name',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n offset: {\n name: 'offset',\n in: 'query',\n description: 'Number of records to skip in the query page.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n order: {\n name: 'order',\n in: 'query',\n description: 'Order',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n status: {\n name: 'status',\n in: 'query',\n description: 'Status',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n taskId: {\n name: 'taskId',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n },\n requestBodies: {},\n responses: {\n ErrorResponse: {\n description: 'An error response from the backend.',\n content: {\n 'application/json; charset=utf-8': {\n schema: {\n $ref: '#/components/schemas/Error',\n },\n },\n },\n },\n },\n schemas: {\n Action: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n \"'examples'\": {\n type: 'array',\n items: {\n $ref: '#/components/schemas/ActionExample',\n },\n },\n schema: {\n type: 'object',\n properties: {\n input: {\n $ref: '#/components/schemas/JsonObject',\n },\n output: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n },\n },\n required: ['id'],\n description:\n 'The response shape for a single action in the `listActions` call to the `scaffolder-backend`',\n },\n ActionExample: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n },\n example: {\n type: 'string',\n },\n },\n required: ['description', 'example'],\n description: 'A single action example',\n },\n DryRunResult: {\n type: 'object',\n properties: {\n log: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n body: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n message: {\n type: 'string',\n },\n status: {\n $ref: '#/components/schemas/TaskStatus',\n },\n stepId: {\n type: 'string',\n },\n },\n required: ['message'],\n },\n ],\n },\n },\n required: ['body'],\n },\n },\n directoryContents: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/SerializedFile',\n },\n },\n output: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n required: ['log', 'directoryContents', 'output'],\n },\n Error: {\n type: 'object',\n properties: {\n error: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n stack: {\n type: 'string',\n },\n code: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n },\n request: {\n type: 'object',\n properties: {\n method: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n required: ['method', 'url'],\n },\n response: {\n type: 'object',\n properties: {\n statusCode: {\n type: 'number',\n },\n },\n required: ['statusCode'],\n },\n },\n required: ['error', 'response'],\n additionalProperties: {},\n },\n JsonArray: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/JsonValue',\n },\n description: 'A type representing all allowed JSON array values.',\n },\n JsonObject: {\n type: 'object',\n properties: {},\n description: 'A type representing all allowed JSON object values.',\n additionalProperties: {},\n },\n JsonPrimitive: {\n oneOf: [\n {\n type: 'boolean',\n },\n {\n type: 'number',\n },\n {\n type: 'string',\n },\n {\n type: 'object',\n nullable: true,\n },\n ],\n description: 'A type representing all allowed JSON primitive values.',\n },\n JsonValue: {\n oneOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n $ref: '#/components/schemas/JsonArray',\n },\n {\n $ref: '#/components/schemas/JsonPrimitive',\n },\n ],\n description: 'A type representing all allowed JSON values.',\n },\n ListActionsResponse: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Action',\n },\n description:\n 'The response shape for the `listActions` call to the `scaffolder-backend`',\n },\n ListTasksResponse: {\n type: 'object',\n properties: {\n tasks: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/SerializedTask',\n },\n },\n totalTasks: {\n type: 'number',\n },\n },\n required: ['tasks'],\n description:\n 'The response shape for the `listTasks` call to the `scaffolder-backend`',\n },\n ListTemplatingExtensionsResponse: {\n type: 'object',\n properties: {\n filters: {\n type: 'object',\n additionalProperties: {\n $ref: '#/components/schemas/TemplateFilter',\n },\n },\n globals: {\n type: 'object',\n properties: {\n functions: {\n type: 'object',\n additionalProperties: {\n $ref: '#/components/schemas/TemplateGlobalFunction',\n },\n },\n values: {\n type: 'object',\n additionalProperties: {\n $ref: '#/components/schemas/TemplateGlobalValue',\n },\n },\n },\n required: ['functions', 'values'],\n },\n },\n required: ['filters', 'globals'],\n description:\n 'The response shape for the `listTemplatingExtensions` call to the `scaffolder-backend`',\n },\n ScaffolderScaffoldOptions: {\n type: 'object',\n properties: {\n templateRef: {\n type: 'string',\n },\n values: {\n type: 'object',\n additionalProperties: {},\n },\n secrets: {\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n },\n },\n required: ['templateRef', 'values'],\n description:\n 'The input options to the `scaffold` method of the `ScaffolderClient`.',\n },\n ScaffolderUsageExample: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n },\n example: {\n type: 'string',\n },\n notes: {\n type: 'string',\n },\n },\n required: ['example'],\n description: 'A single scaffolder usage example',\n },\n SerializedFile: {\n type: 'object',\n properties: {\n path: {\n type: 'string',\n },\n content: {\n type: 'string',\n },\n executable: {\n type: 'boolean',\n },\n symlink: {\n type: 'boolean',\n },\n },\n required: ['path', 'content'],\n },\n SerializedTaskEvent: {\n type: 'object',\n properties: {\n id: {\n type: 'integer',\n },\n isTaskRecoverable: {\n type: 'boolean',\n },\n taskId: {\n type: 'string',\n },\n body: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n message: {\n type: 'string',\n },\n status: {\n $ref: '#/components/schemas/TaskStatus',\n },\n stepId: {\n type: 'string',\n },\n },\n required: ['message'],\n },\n ],\n },\n type: {\n $ref: '#/components/schemas/TaskEventType',\n },\n createdAt: {\n type: 'string',\n },\n },\n required: ['id', 'taskId', 'body', 'type', 'createdAt'],\n description: 'SerializedTaskEvent',\n },\n SerializedTask: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n },\n spec: {\n type: 'object',\n },\n status: {\n $ref: '#/components/schemas/TaskStatus',\n },\n createdAt: {\n type: 'string',\n },\n lastHeartbeatAt: {\n type: 'string',\n },\n createdBy: {\n type: 'string',\n },\n secrets: {\n $ref: '#/components/schemas/TaskSecrets',\n },\n state: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n required: ['id', 'spec', 'status', 'createdAt'],\n description: 'SerializedTask',\n },\n TaskEventType: {\n type: 'string',\n description: 'TaskEventType',\n enum: ['cancelled', 'completion', 'log', 'recovered'],\n },\n TaskSecrets: {\n allOf: [\n {\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n },\n {\n type: 'object',\n properties: {\n backstageToken: {\n type: 'string',\n },\n },\n },\n ],\n description: 'TaskSecrets',\n },\n TaskStatus: {\n type: 'string',\n enum: [\n 'cancelled',\n 'completed',\n 'failed',\n 'open',\n 'processing',\n 'skipped',\n ],\n description: 'The status of each step of the Task',\n },\n TemplateGlobalFunction: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n },\n schema: {\n type: 'object',\n properties: {\n arguments: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n output: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n },\n \"'examples'\": {\n type: 'array',\n items: {\n $ref: '#/components/schemas/ScaffolderUsageExample',\n },\n },\n },\n description:\n 'The response shape for a single global function in the `listTemplatingExtensions` call to the `scaffolder-backend`',\n },\n TemplateGlobalValue: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n },\n value: {\n type: 'object',\n nullable: true,\n },\n },\n required: ['value'],\n description:\n 'The response shape for a single global value in the `listTemplatingExtensions` call to the `scaffolder-backend`',\n },\n TemplateFilter: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n },\n schema: {\n type: 'object',\n properties: {\n input: {\n $ref: '#/components/schemas/JsonObject',\n },\n arguments: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n output: {\n $ref: '#/components/schemas/JsonObject',\n },\n },\n },\n \"'examples'\": {\n type: 'array',\n items: {\n $ref: '#/components/schemas/ScaffolderUsageExample',\n },\n },\n },\n description:\n 'The response shape for a single filter in the `listTemplatingExtensions` call to the `scaffolder-backend`',\n },\n TemplateParameterSchema: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n steps: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n },\n description: {\n type: 'string',\n },\n schema: {\n type: 'object',\n },\n },\n required: ['title', 'schema'],\n },\n },\n },\n required: ['title', 'steps'],\n description:\n 'The shape of each entry of parameters which gets rendered\\nas a separate step in the wizard input',\n additionalProperties: {},\n },\n ValidationError: {\n type: 'object',\n properties: {\n path: {\n type: 'array',\n items: {\n oneOf: [\n {\n type: 'string',\n },\n {\n type: 'integer',\n },\n ],\n },\n },\n property: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n instance: {\n type: 'object',\n },\n name: {\n type: 'string',\n },\n argument: {\n oneOf: [\n {\n type: 'boolean',\n },\n {\n type: 'number',\n },\n {\n type: 'object',\n },\n {\n type: 'string',\n },\n ],\n },\n stack: {\n type: 'string',\n },\n },\n required: [\n 'path',\n 'property',\n 'message',\n 'schema',\n 'instance',\n 'name',\n 'argument',\n 'stack',\n ],\n additionalProperties: {},\n },\n },\n securitySchemes: {\n JWT: {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n },\n },\n },\n paths: {\n '/v2/templates/{namespace}/{kind}/{name}/parameter-schema': {\n get: {\n operationId: 'GetTemplateParameterSchema',\n description: 'Get template parameter schema.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/TemplateParameterSchema',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/v2/actions': {\n get: {\n operationId: 'ListActions',\n description: 'Returns a list of all installed actions.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/ListActionsResponse',\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/v2/tasks': {\n get: {\n operationId: 'ListTasks',\n description:\n 'Returns a list of tasks, filtering by ownership and/or status if given.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/ListTasksResponse',\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/createdBy',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/order',\n },\n {\n $ref: '#/components/parameters/status',\n },\n ],\n },\n post: {\n operationId: 'Scaffold',\n description:\n 'Executes the scaffolding of a component, given a template and its\\nparameter values.',\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/ScaffolderScaffoldOptions',\n },\n },\n },\n },\n responses: {\n '201': {\n description: 'Created',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n },\n },\n required: ['id'],\n },\n },\n },\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/ValidationError',\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/v2/tasks/{taskId}': {\n get: {\n operationId: 'GetTask',\n description: 'Get a task by ID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/SerializedTask',\n },\n },\n },\n },\n '403': {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/taskId',\n },\n ],\n },\n },\n '/v2/tasks/{taskId}/cancel': {\n post: {\n operationId: 'CancelTask',\n description:\n 'Sends a signal to a task broker to cancel the running task by taskId.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n status: {\n $ref: '#/components/schemas/TaskStatus',\n },\n },\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/taskId',\n },\n ],\n },\n },\n '/v2/tasks/{taskId}/retry': {\n post: {\n operationId: 'Retry',\n description: 'Starts the task again from the point where it failed.',\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n secrets: {\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n },\n },\n },\n },\n },\n },\n responses: {\n '201': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n },\n },\n required: ['id'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/taskId',\n },\n ],\n },\n },\n '/v2/tasks/{taskId}/events': {\n get: {\n operationId: 'StreamLogsPolling',\n description: 'Get events for a task by ID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/SerializedTaskEvent',\n },\n },\n },\n },\n },\n '403': {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n parameters: [\n {\n $ref: '#/components/parameters/eventsAfter',\n },\n {\n $ref: '#/components/parameters/taskId',\n },\n ],\n },\n },\n '/v2/dry-run': {\n post: {\n operationId: 'DryRun',\n description: 'Perform a dry-run of a template',\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n template: {\n type: 'object',\n },\n values: {\n $ref: '#/components/schemas/JsonObject',\n },\n secrets: {\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n },\n directoryContents: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: {\n type: 'string',\n },\n base64Content: {\n type: 'string',\n },\n },\n },\n },\n },\n required: ['template', 'values', 'directoryContents'],\n },\n },\n },\n },\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n allOf: [\n {\n $ref: '#/components/schemas/DryRunResult',\n },\n {\n type: 'object',\n properties: {\n steps: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n id: {\n type: 'string',\n },\n name: {\n type: 'string',\n },\n action: {\n type: 'string',\n },\n },\n required: ['id', 'name', 'action'],\n additionalProperties: {},\n },\n },\n directoryContents: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n path: {\n type: 'string',\n },\n executable: {\n type: 'boolean',\n },\n base64Content: {\n type: 'string',\n },\n },\n required: ['path', 'base64Content'],\n },\n },\n },\n required: ['steps'],\n },\n ],\n },\n },\n },\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/ValidationError',\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n parameters: [],\n },\n },\n '/v2/autocomplete/{provider}/{resource}': {\n post: {\n operationId: 'Autocomplete',\n description:\n 'Perform an autocomplete for the given provider and resource.',\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n context: {\n type: 'object',\n additionalProperties: {\n type: 'string',\n },\n },\n token: {\n type: 'string',\n },\n },\n required: ['context', 'token'],\n },\n },\n },\n },\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n results: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n title: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['id'],\n },\n },\n },\n required: ['results'],\n },\n },\n },\n },\n '400': {\n description: 'Unsupported provider.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n message: {\n type: 'string',\n },\n name: {\n type: 'string',\n },\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n in: 'path',\n name: 'provider',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'resource',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/v2/templating-extensions': {\n get: {\n operationId: 'ListTemplatingExtensions',\n description:\n 'Returns a structure describing the available templating extensions.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/ListTemplatingExtensionsResponse',\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n },\n} as const;\nexport const createOpenApiRouter = async (\n options?: Parameters<\n typeof createValidatedOpenApiRouterFromGeneratedEndpointMap\n >['1'],\n) =>\n createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(\n spec,\n options,\n );\n"],"names":["createValidatedOpenApiRouterFromGeneratedEndpointMap"],"mappings":";;;;AAsBO,MAAM,IAAO,GAAA;AAAA,EAClB,OAAS,EAAA,OAAA;AAAA,EACT,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,YAAA;AAAA,IACP,OAAS,EAAA,GAAA;AAAA,IACT,WACE,EAAA,+DAAA;AAAA,IACF,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,YAAA;AAAA,MACN,GAAK,EAAA;AAAA,KACP;AAAA,IACA,SAAS;AAAC,GACZ;AAAA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EAAA,QAAA;AAAA,kBACN,UAAY,EAAA;AAAA,oBACV,OAAS,EAAA;AAAA,sBACP,IAAM,EAAA;AAAA,qBACR;AAAA,oBACA,IAAM,EAAA;AAAA,sBACJ,IAAM,EAAA;AAAA;AACR;AACF;AACF;AACF;AACF;AACF,SACF;AAAA,QACA,UAAY,EAAA;AAAA,UACV;AAAA,YACE,EAAI,EAAA,MAAA;AAAA,YACJ,IAAM,EAAA,UAAA;AAAA,YACN,QAAU,EAAA,IAAA;AAAA,YACV,aAAe,EAAA,IAAA;AAAA,YACf,MAAQ,EAAA;AAAA,cACN,IAAM,EAAA;AAAA;AACR,WACF;AAAA,UACA;AAAA,YACE,EAAI,EAAA,MAAA;AAAA,YACJ,IAAM,EAAA,UAAA;AAAA,YACN,QAAU,EAAA,IAAA;AAAA,YACV,aAAe,EAAA,IAAA;AAAA,YACf,MAAQ,EAAA;AAAA,cACN,IAAM,EAAA;AAAA;AACR;AACF;AACF;AACF,KACF;AAAA,IACA,2BAA6B,EAAA;AAAA,MAC3B,GAAK,EAAA;AAAA,QACH,WAAa,EAAA,0BAAA;AAAA,QACb,WACE,EAAA,qEAAA;AAAA,QACF,SAAW,EAAA;AAAA,UACT,KAAO,EAAA;AAAA,YACL,WAAa,EAAA,IAAA;AAAA,YACb,OAAS,EAAA;AAAA,cACP,kBAAoB,EAAA;AAAA,gBAClB,MAAQ,EAAA;AAAA,kBACN,IAAM,EAAA;AAAA;AACR;AACF;AACF;AACF,SACF;AAAA,QACA,QAAU,EAAA;AAAA,UACR,EAAC;AAAA,UACD;AAAA,YACE,KAAK;AAAC;AACR,SACF;AAAA,QACA,YAAY;AAAC;AACf;AACF;AAEJ;AACa,MAAA,mBAAA,GAAsB,OACjC,OAIA,KAAAA,wEAAA;AAAA,EACE,IAAA;AAAA,EACA;AACF;;;;;"}
@@ -70,17 +70,6 @@ function parseStringsParam(param, paramName) {
70
70
  }
71
71
  return array;
72
72
  }
73
- function parseNumberParam(param, paramName) {
74
- return parseStringsParam(param, paramName)?.map((val) => {
75
- const ret = Number.parseInt(val, 10);
76
- if (isNaN(ret)) {
77
- throw new errors.InputError(
78
- `Invalid ${paramName} parameter "${val}", expected a number or array of numbers`
79
- );
80
- }
81
- return ret;
82
- });
83
- }
84
73
  function flattenParams(...params) {
85
74
  return [...params].flat().filter(Boolean);
86
75
  }
@@ -89,6 +78,5 @@ exports.findTemplate = findTemplate;
89
78
  exports.flattenParams = flattenParams;
90
79
  exports.getEntityBaseUrl = getEntityBaseUrl;
91
80
  exports.getWorkingDirectory = getWorkingDirectory;
92
- exports.parseNumberParam = parseNumberParam;
93
81
  exports.parseStringsParam = parseStringsParam;
94
82
  //# sourceMappingURL=helpers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.cjs.js","sources":["../../src/service/helpers.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackstageCredentials,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport {\n ANNOTATION_LOCATION,\n ANNOTATION_SOURCE_LOCATION,\n CompoundEntityRef,\n Entity,\n parseLocationRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { assertError, InputError, NotFoundError } from '@backstage/errors';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport fs from 'fs-extra';\nimport os from 'os';\n\nexport async function getWorkingDirectory(\n config: Config,\n logger: LoggerService,\n): Promise<string> {\n if (!config.has('backend.workingDirectory')) {\n return os.tmpdir();\n }\n\n const workingDirectory = config.getString('backend.workingDirectory');\n try {\n // Check if working directory exists and is writable\n await fs.access(workingDirectory, fs.constants.F_OK | fs.constants.W_OK);\n logger.info(`using working directory: ${workingDirectory}`);\n } catch (err) {\n assertError(err);\n logger.error(\n `working directory ${workingDirectory} ${\n err.code === 'ENOENT' ? 'does not exist' : 'is not writable'\n }`,\n );\n throw err;\n }\n return workingDirectory;\n}\n\n/**\n * Gets the base URL of the entity location that points to the source location\n * of the entity description within a repo. If there is not source location\n * or if it has an invalid type, undefined will be returned instead.\n *\n * For file locations this will return a `file://` URL.\n */\nexport function getEntityBaseUrl(entity: Entity): string | undefined {\n let location = entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];\n if (!location) {\n location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n }\n if (!location) {\n return undefined;\n }\n\n const { type, target } = parseLocationRef(location);\n if (type === 'url') {\n return target;\n } else if (type === 'file') {\n return `file://${target}`;\n }\n\n // Only url and file location are handled, as we otherwise don't know if\n // what the url is pointing to makes sense to use as a baseUrl\n return undefined;\n}\n\n/**\n * Will use the provided CatalogApi to go find the given template entity with an additional token.\n * Returns the matching template, or throws a NotFoundError if no such template existed.\n */\nexport async function findTemplate(options: {\n entityRef: CompoundEntityRef;\n catalog: CatalogService;\n credentials: BackstageCredentials;\n}): Promise<TemplateEntityV1beta3> {\n const { entityRef, catalog, credentials } = options;\n\n if (entityRef.kind.toLocaleLowerCase('en-US') !== 'template') {\n throw new InputError(`Invalid kind, only 'Template' kind is supported`);\n }\n\n const template = await catalog.getEntityByRef(entityRef, {\n credentials,\n });\n if (!template) {\n throw new NotFoundError(\n `Template ${stringifyEntityRef(entityRef)} not found`,\n );\n }\n\n return template as TemplateEntityV1beta3;\n}\n\n/**\n * Takes a single unknown parameter and makes sure that it's a single string or\n * an array of strings, and returns as an array.\n */\nexport function parseStringsParam(\n param: unknown,\n paramName: string,\n): string[] | undefined {\n if (param === undefined) {\n return undefined;\n }\n\n const array = [param].flat();\n if (array.some(p => typeof p !== 'string')) {\n throw new InputError(\n `Invalid ${paramName}, not a string or array of strings`,\n );\n }\n\n return array as string[];\n}\n\nexport function parseNumberParam(\n param: unknown,\n paramName: string,\n): number[] | undefined {\n return parseStringsParam(param, paramName)?.map(val => {\n const ret = Number.parseInt(val, 10);\n if (isNaN(ret)) {\n throw new InputError(\n `Invalid ${paramName} parameter \"${val}\", expected a number or array of numbers`,\n );\n }\n return ret;\n });\n}\n\nexport function flattenParams<T>(...params: (undefined | T | T[])[]): T[] {\n return [...params].flat().filter(Boolean) as T[];\n}\n"],"names":["os","fs","assertError","ANNOTATION_SOURCE_LOCATION","ANNOTATION_LOCATION","parseLocationRef","InputError","NotFoundError","stringifyEntityRef"],"mappings":";;;;;;;;;;;;AAmCsB,eAAA,mBAAA,CACpB,QACA,MACiB,EAAA;AACjB,EAAA,IAAI,CAAC,MAAA,CAAO,GAAI,CAAA,0BAA0B,CAAG,EAAA;AAC3C,IAAA,OAAOA,oBAAG,MAAO,EAAA;AAAA;AAGnB,EAAM,MAAA,gBAAA,GAAmB,MAAO,CAAA,SAAA,CAAU,0BAA0B,CAAA;AACpE,EAAI,IAAA;AAEF,IAAM,MAAAC,mBAAA,CAAG,OAAO,gBAAkB,EAAAA,mBAAA,CAAG,UAAU,IAAO,GAAAA,mBAAA,CAAG,UAAU,IAAI,CAAA;AACvE,IAAO,MAAA,CAAA,IAAA,CAAK,CAA4B,yBAAA,EAAA,gBAAgB,CAAE,CAAA,CAAA;AAAA,WACnD,GAAK,EAAA;AACZ,IAAAC,kBAAA,CAAY,GAAG,CAAA;AACf,IAAO,MAAA,CAAA,KAAA;AAAA,MACL,qBAAqB,gBAAgB,CAAA,CAAA,EACnC,IAAI,IAAS,KAAA,QAAA,GAAW,mBAAmB,iBAC7C,CAAA;AAAA,KACF;AACA,IAAM,MAAA,GAAA;AAAA;AAER,EAAO,OAAA,gBAAA;AACT;AASO,SAAS,iBAAiB,MAAoC,EAAA;AACnE,EAAA,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CAAE,IAAK,EAAA;AAC3B,EAAA,IAAI,MAAM,IAAK,CAAA,CAAA,CAAA,KAAK,OAAO,CAAA,KAAM,QAAQ,CAAG,EAAA;AAC1C,IAAA,MAAM,IAAIF,iBAAA;AAAA,MACR,WAAW,SAAS,CAAA,kCAAA;AAAA,KACtB;AAAA;AAGF,EAAO,OAAA,KAAA;AACT;AAEgB,SAAA,gBAAA,CACd,OACA,SACsB,EAAA;AACtB,EAAA,OAAO,iBAAkB,CAAA,KAAA,EAAO,SAAS,CAAA,EAAG,IAAI,CAAO,GAAA,KAAA;AACrD,IAAA,MAAM,GAAM,GAAA,MAAA,CAAO,QAAS,CAAA,GAAA,EAAK,EAAE,CAAA;AACnC,IAAI,IAAA,KAAA,CAAM,GAAG,CAAG,EAAA;AACd,MAAA,MAAM,IAAIA,iBAAA;AAAA,QACR,CAAA,QAAA,EAAW,SAAS,CAAA,YAAA,EAAe,GAAG,CAAA,wCAAA;AAAA,OACxC;AAAA;AAEF,IAAO,OAAA,GAAA;AAAA,GACR,CAAA;AACH;AAEO,SAAS,iBAAoB,MAAsC,EAAA;AACxE,EAAA,OAAO,CAAC,GAAG,MAAM,EAAE,IAAK,EAAA,CAAE,OAAO,OAAO,CAAA;AAC1C;;;;;;;;;"}
1
+ {"version":3,"file":"helpers.cjs.js","sources":["../../src/service/helpers.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BackstageCredentials,\n LoggerService,\n} from '@backstage/backend-plugin-api';\nimport {\n ANNOTATION_LOCATION,\n ANNOTATION_SOURCE_LOCATION,\n CompoundEntityRef,\n Entity,\n parseLocationRef,\n stringifyEntityRef,\n} from '@backstage/catalog-model';\nimport { Config } from '@backstage/config';\nimport { assertError, InputError, NotFoundError } from '@backstage/errors';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\nimport { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';\nimport fs from 'fs-extra';\nimport os from 'os';\n\nexport async function getWorkingDirectory(\n config: Config,\n logger: LoggerService,\n): Promise<string> {\n if (!config.has('backend.workingDirectory')) {\n return os.tmpdir();\n }\n\n const workingDirectory = config.getString('backend.workingDirectory');\n try {\n // Check if working directory exists and is writable\n await fs.access(workingDirectory, fs.constants.F_OK | fs.constants.W_OK);\n logger.info(`using working directory: ${workingDirectory}`);\n } catch (err) {\n assertError(err);\n logger.error(\n `working directory ${workingDirectory} ${\n err.code === 'ENOENT' ? 'does not exist' : 'is not writable'\n }`,\n );\n throw err;\n }\n return workingDirectory;\n}\n\n/**\n * Gets the base URL of the entity location that points to the source location\n * of the entity description within a repo. If there is not source location\n * or if it has an invalid type, undefined will be returned instead.\n *\n * For file locations this will return a `file://` URL.\n */\nexport function getEntityBaseUrl(entity: Entity): string | undefined {\n let location = entity.metadata.annotations?.[ANNOTATION_SOURCE_LOCATION];\n if (!location) {\n location = entity.metadata.annotations?.[ANNOTATION_LOCATION];\n }\n if (!location) {\n return undefined;\n }\n\n const { type, target } = parseLocationRef(location);\n if (type === 'url') {\n return target;\n } else if (type === 'file') {\n return `file://${target}`;\n }\n\n // Only url and file location are handled, as we otherwise don't know if\n // what the url is pointing to makes sense to use as a baseUrl\n return undefined;\n}\n\n/**\n * Will use the provided CatalogApi to go find the given template entity with an additional token.\n * Returns the matching template, or throws a NotFoundError if no such template existed.\n */\nexport async function findTemplate(options: {\n entityRef: CompoundEntityRef;\n catalog: CatalogService;\n credentials: BackstageCredentials;\n}): Promise<TemplateEntityV1beta3> {\n const { entityRef, catalog, credentials } = options;\n\n if (entityRef.kind.toLocaleLowerCase('en-US') !== 'template') {\n throw new InputError(`Invalid kind, only 'Template' kind is supported`);\n }\n\n const template = await catalog.getEntityByRef(entityRef, {\n credentials,\n });\n if (!template) {\n throw new NotFoundError(\n `Template ${stringifyEntityRef(entityRef)} not found`,\n );\n }\n\n return template as TemplateEntityV1beta3;\n}\n\n/**\n * Takes a single unknown parameter and makes sure that it's a single string or\n * an array of strings, and returns as an array.\n */\nexport function parseStringsParam(\n param: unknown,\n paramName: string,\n): string[] | undefined {\n if (param === undefined) {\n return undefined;\n }\n\n const array = [param].flat();\n if (array.some(p => typeof p !== 'string')) {\n throw new InputError(\n `Invalid ${paramName}, not a string or array of strings`,\n );\n }\n\n return array as string[];\n}\n\nexport function parseNumberParam(\n param: unknown,\n paramName: string,\n): number[] | undefined {\n return parseStringsParam(param, paramName)?.map(val => {\n const ret = Number.parseInt(val, 10);\n if (isNaN(ret)) {\n throw new InputError(\n `Invalid ${paramName} parameter \"${val}\", expected a number or array of numbers`,\n );\n }\n return ret;\n });\n}\n\nexport function flattenParams<T>(...params: (undefined | T | T[])[]): T[] {\n return [...params].flat().filter(Boolean) as T[];\n}\n"],"names":["os","fs","assertError","ANNOTATION_SOURCE_LOCATION","ANNOTATION_LOCATION","parseLocationRef","InputError","NotFoundError","stringifyEntityRef"],"mappings":";;;;;;;;;;;;AAmCsB,eAAA,mBAAA,CACpB,QACA,MACiB,EAAA;AACjB,EAAA,IAAI,CAAC,MAAA,CAAO,GAAI,CAAA,0BAA0B,CAAG,EAAA;AAC3C,IAAA,OAAOA,oBAAG,MAAO,EAAA;AAAA;AAGnB,EAAM,MAAA,gBAAA,GAAmB,MAAO,CAAA,SAAA,CAAU,0BAA0B,CAAA;AACpE,EAAI,IAAA;AAEF,IAAM,MAAAC,mBAAA,CAAG,OAAO,gBAAkB,EAAAA,mBAAA,CAAG,UAAU,IAAO,GAAAA,mBAAA,CAAG,UAAU,IAAI,CAAA;AACvE,IAAO,MAAA,CAAA,IAAA,CAAK,CAA4B,yBAAA,EAAA,gB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AU,EAAA;AACb,IAAA,MAAM,IAAIC,oBAAA;AAAA,MACR,CAAA,SAAA,EAAYC,+BAAmB,CAAA,SAAS,CAAC,CAAA,UAAA;AAAA,KAC3C;AAAA;AAGF,EAAO,OAAA,QAAA;AACT;AAMgB,SAAA,iBAAA,CACd,OACA,SACsB,EAAA;AACtB,EAAA,IAAI,UAAU,KAAW,CAAA,EAAA;AACvB,IAAO,OAAA,KAAA,CAAA;AAAA;AAGT,EAAA,MAAM,KAAQ,GAAA,CAAC,KAAK,CAAA,CAAE,IAAK,EAAA;AAC3B,EAAA,IAAI,MAAM,IAAK,CAAA,CAAA,CAAA,KAAK,OAAO,CAAA,KAAM,QAAQ,CAAG,EAAA;AAC1C,IAAA,MAAM,IAAIF,iBAAA;AAAA,MACR,WAAW,SAAS,CAAA,kCAAA;AAAA,KACtB;AAAA;AAGF,EAAO,OAAA,KAAA;AACT;AAiBO,SAAS,iBAAoB,MAAsC,EAAA;AACxE,EAAA,OAAO,CAAC,GAAG,MAAM,EAAE,IAAK,EAAA,CAAE,OAAO,OAAO,CAAA;AAC1C;;;;;;;;"}
@@ -9,7 +9,6 @@ var pluginPermissionNode = require('@backstage/plugin-permission-node');
9
9
  var pluginScaffolderCommon = require('@backstage/plugin-scaffolder-common');
10
10
  var alpha = require('@backstage/plugin-scaffolder-common/alpha');
11
11
  var express = require('express');
12
- var Router = require('express-promise-router');
13
12
  var jsonschema = require('jsonschema');
14
13
  var luxon = require('luxon');
15
14
  var url = require('url');
@@ -42,6 +41,7 @@ var DatabaseTaskStore = require('../scaffolder/tasks/DatabaseTaskStore.cjs.js');
42
41
  var StorageTaskBroker = require('../scaffolder/tasks/StorageTaskBroker.cjs.js');
43
42
  var TaskWorker = require('../scaffolder/tasks/TaskWorker.cjs.js');
44
43
  var createDryRunner = require('../scaffolder/dryrun/createDryRunner.cjs.js');
44
+ var router = require('../schema/openapi/generated/router.cjs.js');
45
45
  var checkPermissions = require('../util/checkPermissions.cjs.js');
46
46
  var helpers = require('./helpers.cjs.js');
47
47
  var permissions = require('./permissions.cjs.js');
@@ -50,7 +50,6 @@ var rules = require('./rules.cjs.js');
50
50
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
51
51
 
52
52
  var express__default = /*#__PURE__*/_interopDefaultCompat(express);
53
- var Router__default = /*#__PURE__*/_interopDefaultCompat(Router);
54
53
 
55
54
  function isSupportedTemplate(entity) {
56
55
  return entity.apiVersion === "scaffolder.backstage.io/v1beta3";
@@ -62,8 +61,8 @@ const readDuration = (config$1, key, defaultValue) => {
62
61
  return defaultValue;
63
62
  };
64
63
  async function createRouter(options) {
65
- const router = Router__default.default();
66
- router.use(express__default.default.json({ limit: "10MB" }));
64
+ const router$1 = await router.createOpenApiRouter();
65
+ router$1.use(express__default.default.json({ limit: "10MB" }));
67
66
  const {
68
67
  logger: parentLogger,
69
68
  config,
@@ -216,8 +215,8 @@ async function createRouter(options) {
216
215
  ],
217
216
  permissions: alpha.scaffolderPermissions
218
217
  });
219
- router.use(permissionIntegrationRouter);
220
- router.get(
218
+ router$1.use(permissionIntegrationRouter);
219
+ router$1.get(
221
220
  "/v2/templates/:namespace/:kind/:name/parameter-schema",
222
221
  async (req, res) => {
223
222
  const requestedTemplateRef = `${req.params.kind}:${req.params.namespace}/${req.params.name}`;
@@ -389,8 +388,7 @@ async function createRouter(options) {
389
388
  field: match[2]
390
389
  };
391
390
  });
392
- const limit = helpers.parseNumberParam(req.query.limit, "limit");
393
- const offset = helpers.parseNumberParam(req.query.offset, "offset");
391
+ const { limit, offset } = req.query;
394
392
  const taskPermissionFilters = await checkPermissions.getAuthorizeConditions({
395
393
  credentials,
396
394
  permission: alpha.taskReadPermission,
@@ -404,8 +402,8 @@ async function createRouter(options) {
404
402
  },
405
403
  order,
406
404
  pagination: {
407
- limit: limit ? limit[0] : void 0,
408
- offset: offset ? offset[0] : void 0
405
+ limit,
406
+ offset
409
407
  },
410
408
  permissionFilters: taskPermissionFilters
411
409
  });
@@ -519,71 +517,76 @@ async function createRouter(options) {
519
517
  await auditorEvent?.fail({ error: err });
520
518
  throw err;
521
519
  }
522
- }).get("/v2/tasks/:taskId/eventstream", async (req, res) => {
523
- const { taskId } = req.params;
524
- const auditorEvent = await auditor?.createEvent({
525
- eventId: "task",
526
- request: req,
527
- meta: {
528
- actionType: "stream",
529
- taskId
530
- }
531
- });
532
- try {
533
- const credentials = await httpAuth.credentials(req);
534
- const task = await taskBroker.get(taskId);
535
- await checkPermissions.checkTaskPermission({
536
- credentials,
537
- permissions: [alpha.taskReadPermission],
538
- permissionService: permissions$1,
539
- task,
540
- isTaskAuthorized
541
- });
542
- const after = req.query.after !== void 0 ? Number(req.query.after) : void 0;
543
- logger.debug(`Event stream observing taskId '${taskId}' opened`);
544
- res.writeHead(200, {
545
- Connection: "keep-alive",
546
- "Cache-Control": "no-cache",
547
- "Content-Type": "text/event-stream"
520
+ });
521
+ router$1.get(
522
+ "/v2/tasks/:taskId/eventstream",
523
+ async (req, res) => {
524
+ const { taskId } = req.params;
525
+ const auditorEvent = await auditor?.createEvent({
526
+ eventId: "task",
527
+ request: req,
528
+ meta: {
529
+ actionType: "stream",
530
+ taskId
531
+ }
548
532
  });
549
- const subscription = taskBroker.event$({ taskId, after }).subscribe({
550
- error: async (error) => {
551
- logger.error(
552
- `Received error from event stream when observing taskId '${taskId}', ${error}`
553
- );
554
- await auditorEvent?.fail({ error });
555
- res.end();
556
- },
557
- next: ({ events }) => {
558
- let shouldUnsubscribe = false;
559
- for (const event of events) {
560
- res.write(
561
- `event: ${event.type}
533
+ try {
534
+ const credentials = await httpAuth.credentials(req);
535
+ const task = await taskBroker.get(taskId);
536
+ await checkPermissions.checkTaskPermission({
537
+ credentials,
538
+ permissions: [alpha.taskReadPermission],
539
+ permissionService: permissions$1,
540
+ task,
541
+ isTaskAuthorized
542
+ });
543
+ const after = req.query.after !== void 0 ? Number(req.query.after) : void 0;
544
+ logger.debug(`Event stream observing taskId '${taskId}' opened`);
545
+ res.writeHead(200, {
546
+ Connection: "keep-alive",
547
+ "Cache-Control": "no-cache",
548
+ "Content-Type": "text/event-stream"
549
+ });
550
+ const subscription = taskBroker.event$({ taskId, after }).subscribe({
551
+ error: async (error) => {
552
+ logger.error(
553
+ `Received error from event stream when observing taskId '${taskId}', ${error}`
554
+ );
555
+ await auditorEvent?.fail({ error });
556
+ res.end();
557
+ },
558
+ next: ({ events }) => {
559
+ let shouldUnsubscribe = false;
560
+ for (const event of events) {
561
+ res.write(
562
+ `event: ${event.type}
562
563
  data: ${JSON.stringify(event)}
563
564
 
564
565
  `
565
- );
566
- if (event.type === "completion" && !event.isTaskRecoverable) {
567
- shouldUnsubscribe = true;
566
+ );
567
+ if (event.type === "completion" && !event.isTaskRecoverable) {
568
+ shouldUnsubscribe = true;
569
+ }
570
+ }
571
+ res.flush?.();
572
+ if (shouldUnsubscribe) {
573
+ subscription.unsubscribe();
574
+ res.end();
568
575
  }
569
576
  }
570
- res.flush?.();
571
- if (shouldUnsubscribe) {
572
- subscription.unsubscribe();
573
- res.end();
574
- }
575
- }
576
- });
577
- req.on("close", async () => {
578
- subscription.unsubscribe();
579
- logger.debug(`Event stream observing taskId '${taskId}' closed`);
580
- await auditorEvent?.success();
581
- });
582
- } catch (err) {
583
- await auditorEvent?.fail({ error: err });
584
- throw err;
577
+ });
578
+ req.on("close", async () => {
579
+ subscription.unsubscribe();
580
+ logger.debug(`Event stream observing taskId '${taskId}' closed`);
581
+ await auditorEvent?.success();
582
+ });
583
+ } catch (err) {
584
+ await auditorEvent?.fail({ error: err });
585
+ throw err;
586
+ }
585
587
  }
586
- }).get("/v2/tasks/:taskId/events", async (req, res) => {
588
+ );
589
+ router$1.get("/v2/tasks/:taskId/events", async (req, res) => {
587
590
  const { taskId } = req.params;
588
591
  const auditorEvent = await auditor?.createEvent({
589
592
  eventId: "task",
@@ -767,7 +770,7 @@ data: ${JSON.stringify(event)}
767
770
  });
768
771
  const app = express__default.default();
769
772
  app.set("logger", logger);
770
- app.use("/", router);
773
+ app.use("/", router$1);
771
774
  async function authorizeTemplate(entityRef, credentials) {
772
775
  const template = await helpers.findTemplate({
773
776
  catalog,