From 756f6cc5ef23e8ff343b7f69f199a7c3efc1997b Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 18 Feb 2022 16:22:18 +0100 Subject: [PATCH] chore: added some more deprecations and fixing some more of the api-report Signed-off-by: blam --- plugins/scaffolder-backend/api-report.md | 8 +++----- .../src/scaffolder/actions/builtin/fetch/helpers.ts | 6 ++++++ .../src/scaffolder/tasks/StorageTaskBroker.ts | 4 ++-- plugins/scaffolder-backend/src/scaffolder/tasks/types.ts | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 1bc39ea909..aea6689183 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -365,9 +365,7 @@ export class DatabaseTaskStore implements TaskStore { // @public @deprecated export type DispatchResult = TaskBrokerDispatchResult; -// Warning: (ae-missing-release-tag) "fetchContents" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// -// @public (undocumented) +// @public export function fetchContents({ reader, integrations, @@ -378,7 +376,7 @@ export function fetchContents({ reader: UrlReader; integrations: ScmIntegrations; baseUrl?: string; - fetchUrl?: JsonValue; + fetchUrl?: string; outputPath: string; }): Promise; @@ -496,7 +494,7 @@ export interface TaskBroker { unsubscribe: () => void; }; // (undocumented) - vacuumTasks(timeoutS: { timeoutS: number }): Promise; + vacuumTasks(options: { timeoutS: number }): Promise; } // @public diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts index 89d9b0171a..a01fcee6f7 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/helpers.ts @@ -20,6 +20,12 @@ import { ScmIntegrations } from '@backstage/integration'; import fs from 'fs-extra'; import path from 'path'; +/** + * A helper function that reads the contents of a directory from the given URL. + * Can be used in your own actions, and also used behind fetch:template and fetch:plain + * + * @public + */ export async function fetchContents({ reader, integrations, diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts index 49c1056727..e7fd76ea9a 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/StorageTaskBroker.ts @@ -207,8 +207,8 @@ export class StorageTaskBroker implements TaskBroker { return { unsubscribe }; } - async vacuumTasks(timeoutS: { timeoutS: number }): Promise { - const { tasks } = await this.storage.listStaleTasks(timeoutS); + async vacuumTasks(options: { timeoutS: number }): Promise { + const { tasks } = await this.storage.listStaleTasks(options); await Promise.all( tasks.map(async task => { try { diff --git a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts index c75b85f7b5..6cc3eabdc7 100644 --- a/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts +++ b/plugins/scaffolder-backend/src/scaffolder/tasks/types.ts @@ -161,7 +161,7 @@ export interface TaskBroker { dispatch( options: TaskBrokerDispatchOptions, ): Promise; - vacuumTasks(timeoutS: { timeoutS: number }): Promise; + vacuumTasks(options: { timeoutS: number }): Promise; observe( options: { taskId: string;