From 7e76e7dc123975781f39d4a19e09a8dd665b9c65 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 20 Jan 2022 09:02:46 +0100 Subject: [PATCH] chore: adjusting the types a little bit and regenerating api-docs Signed-off-by: blam --- plugins/scaffolder-backend/api-report.md | 2 +- plugins/scaffolder-backend/src/scaffolder/tasks/types.ts | 2 +- plugins/scaffolder/api-report.md | 4 ++-- plugins/scaffolder/src/api.ts | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index ca6d6ac38e..12b29cae39 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -440,7 +440,7 @@ export class TaskManager implements TaskContext { } // @public -export type TaskSecrets = JsonObject & { +export type TaskSecrets = Record & { token?: string; backstageToken?: string; }; diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts index 7a2afcbaed..8caee87f57 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts @@ -89,7 +89,7 @@ export type SerializedTaskEvent = { * * @public */ -export type TaskSecrets = JsonObject & { +export type TaskSecrets = Record & { /** @deprecated Use `backstageToken` instead */ token?: string; backstageToken?: string; diff --git a/plugins/scaffolder/api-report.md b/plugins/scaffolder/api-report.md index 7145df8097..d2bbb2a5e1 100644 --- a/plugins/scaffolder/api-report.md +++ b/plugins/scaffolder/api-report.md @@ -195,7 +195,7 @@ export interface ScaffolderApi { scaffold( templateName: string, values: Record, - secrets?: JsonObject, + secrets?: Record, ): Promise; // Warning: (ae-forgotten-export) The symbol "LogEvent" needs to be exported by the entry point index.d.ts // @@ -243,7 +243,7 @@ export class ScaffolderClient implements ScaffolderApi { scaffold( templateName: string, values: Record, - secrets?: JsonObject, + secrets?: Record, ): Promise; // (undocumented) streamLogs(opts: { taskId: string; after?: number }): Observable; diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index d93cdb4924..7f096a02f7 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -69,11 +69,12 @@ export interface ScaffolderApi { * * @param templateName - Name of the Template entity for the scaffolder to use. New project is going to be created out of this template. * @param values - Parameters for the template, e.g. name, description + * @param secrets - Optional secrets to pass to as the secrets parameter to the template. */ scaffold( templateName: string, values: Record, - secrets?: JsonObject, + secrets?: Record, ): Promise; getTask(taskId: string): Promise; @@ -155,11 +156,12 @@ export class ScaffolderClient implements ScaffolderApi { * * @param templateName - Template name for the scaffolder to use. New project is going to be created out of this template. * @param values - Parameters for the template, e.g. name, description + * @param secrets - Optional secrets to pass to as the secrets parameter to the template. */ async scaffold( templateName: string, values: Record, - secrets: JsonObject = {}, + secrets: Record = {}, ): Promise { const { token } = await this.identityApi.getCredentials(); const url = `${await this.discoveryApi.getBaseUrl('scaffolder')}/v2/tasks`;