chore: adjusting the types a little bit and regenerating api-docs

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2022-01-20 09:02:46 +01:00
parent 783c435e46
commit 7e76e7dc12
4 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -440,7 +440,7 @@ export class TaskManager implements TaskContext {
}
// @public
export type TaskSecrets = JsonObject & {
export type TaskSecrets = Record<string, string> & {
token?: string;
backstageToken?: string;
};
@@ -89,7 +89,7 @@ export type SerializedTaskEvent = {
*
* @public
*/
export type TaskSecrets = JsonObject & {
export type TaskSecrets = Record<string, string> & {
/** @deprecated Use `backstageToken` instead */
token?: string;
backstageToken?: string;
+2 -2
View File
@@ -195,7 +195,7 @@ export interface ScaffolderApi {
scaffold(
templateName: string,
values: Record<string, any>,
secrets?: JsonObject,
secrets?: Record<string, string>,
): Promise<string>;
// 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<string, any>,
secrets?: JsonObject,
secrets?: Record<string, string>,
): Promise<string>;
// (undocumented)
streamLogs(opts: { taskId: string; after?: number }): Observable<LogEvent>;
+4 -2
View File
@@ -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<string, any>,
secrets?: JsonObject,
secrets?: Record<string, string>,
): Promise<string>;
getTask(taskId: string): Promise<ScaffolderTask>;
@@ -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<string, any>,
secrets: JsonObject = {},
secrets: Record<string, string> = {},
): Promise<string> {
const { token } = await this.identityApi.getCredentials();
const url = `${await this.discoveryApi.getBaseUrl('scaffolder')}/v2/tasks`;