@backstage/plugin-scaffolder-backend 1.33.0 → 2.0.0-next.1
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.
- package/CHANGELOG.md +110 -0
- package/dist/ScaffolderPlugin.cjs.js +0 -3
- package/dist/ScaffolderPlugin.cjs.js.map +1 -1
- package/dist/alpha.cjs.js +5 -9
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +1 -5
- package/dist/index.cjs.js +0 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +45 -355
- package/dist/lib/templating/SecureTemplater.cjs.js.map +1 -1
- package/dist/scaffolder/actions/TemplateActionRegistry.cjs.js.map +1 -1
- package/dist/scaffolder/actions/builtin/fetch/template.cjs.js.map +1 -1
- package/dist/scaffolder/actions/builtin/fetch/templateActionHandler.cjs.js +4 -19
- package/dist/scaffolder/actions/builtin/fetch/templateActionHandler.cjs.js.map +1 -1
- package/dist/scaffolder/tasks/DatabaseTaskStore.cjs.js.map +1 -1
- package/dist/scaffolder/tasks/StorageTaskBroker.cjs.js.map +1 -1
- package/dist/scaffolder/tasks/TaskWorker.cjs.js.map +1 -1
- package/dist/service/{conditionExports.cjs.js → alpha.cjs.js} +1 -1
- package/dist/service/alpha.cjs.js.map +1 -0
- package/dist/service/permissions.cjs.js +14 -0
- package/dist/service/permissions.cjs.js.map +1 -0
- package/dist/service/router.cjs.js +30 -95
- package/dist/service/router.cjs.js.map +1 -1
- package/package.json +33 -35
- package/dist/deprecated.cjs.js +0 -15
- package/dist/deprecated.cjs.js.map +0 -1
- package/dist/scaffolder/actions/deprecated.cjs.js +0 -48
- package/dist/scaffolder/actions/deprecated.cjs.js.map +0 -1
- package/dist/service/conditionExports.cjs.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,22 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
|
-
import { AuthService, UrlReaderService, DatabaseService, BackstageCredentials, AuditorService
|
|
2
|
+
import { AuthService, UrlReaderService, DatabaseService, BackstageCredentials, AuditorService } from '@backstage/backend-plugin-api';
|
|
3
3
|
import * as _backstage_plugin_scaffolder_node from '@backstage/plugin-scaffolder-node';
|
|
4
|
-
import { TemplateFilter
|
|
4
|
+
import { TemplateFilter, TemplateGlobal, TemplateAction, TaskSecrets, SerializedTask, TaskStatus, SerializedTaskEvent, TaskContext, TaskCompletionState, TaskBroker } from '@backstage/plugin-scaffolder-node';
|
|
5
5
|
import * as _backstage_types from '@backstage/types';
|
|
6
6
|
import { HumanDuration, JsonObject, JsonValue } from '@backstage/types';
|
|
7
|
-
import * as _backstage_integration from '@backstage/integration';
|
|
8
7
|
import { ScmIntegrations } from '@backstage/integration';
|
|
9
8
|
import { CatalogApi } from '@backstage/catalog-client';
|
|
10
9
|
import { Config } from '@backstage/config';
|
|
11
10
|
import { Duration } from 'luxon';
|
|
12
|
-
import { createGithubActionsDispatchAction as createGithubActionsDispatchAction$1, createGithubDeployKeyAction as createGithubDeployKeyAction$1, createGithubEnvironmentAction as createGithubEnvironmentAction$1, createGithubIssuesLabelAction as createGithubIssuesLabelAction$1, CreateGithubPullRequestActionOptions as CreateGithubPullRequestActionOptions$1, createGithubRepoCreateAction as createGithubRepoCreateAction$1, createGithubRepoPushAction as createGithubRepoPushAction$1, createGithubWebhookAction as createGithubWebhookAction$1, createPublishGithubAction as createPublishGithubAction$1 } from '@backstage/plugin-scaffolder-backend-module-github';
|
|
13
|
-
import { createPublishGitlabAction as createPublishGitlabAction$1 } from '@backstage/plugin-scaffolder-backend-module-gitlab';
|
|
14
|
-
import { createPublishAzureAction as createPublishAzureAction$1 } from '@backstage/plugin-scaffolder-backend-module-azure';
|
|
15
|
-
import { createPublishBitbucketAction as createPublishBitbucketAction$1 } from '@backstage/plugin-scaffolder-backend-module-bitbucket';
|
|
16
|
-
import { createPublishBitbucketCloudAction as createPublishBitbucketCloudAction$1 } from '@backstage/plugin-scaffolder-backend-module-bitbucket-cloud';
|
|
17
|
-
import { createPublishBitbucketServerAction as createPublishBitbucketServerAction$1, createPublishBitbucketServerPullRequestAction as createPublishBitbucketServerPullRequestAction$1 } from '@backstage/plugin-scaffolder-backend-module-bitbucket-server';
|
|
18
|
-
import { createPublishGerritAction as createPublishGerritAction$1, createPublishGerritReviewAction as createPublishGerritReviewAction$1 } from '@backstage/plugin-scaffolder-backend-module-gerrit';
|
|
19
11
|
import { Knex } from 'knex';
|
|
20
12
|
import * as _backstage_plugin_scaffolder_common from '@backstage/plugin-scaffolder-common';
|
|
21
13
|
import { TaskSpec, TaskRecovery, TemplateEntityStepV1beta3, TemplateParametersV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
22
14
|
import { EventsService } from '@backstage/plugin-events-node';
|
|
23
|
-
import { WorkspaceProvider
|
|
15
|
+
import { WorkspaceProvider } from '@backstage/plugin-scaffolder-node/alpha';
|
|
24
16
|
import { Logger } from 'winston';
|
|
25
17
|
import { PermissionEvaluator, PermissionRuleParams } from '@backstage/plugin-permission-common';
|
|
26
|
-
import { IdentityApi } from '@backstage/plugin-auth-node';
|
|
27
18
|
import { PermissionRule } from '@backstage/plugin-permission-node';
|
|
28
19
|
import { RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, RESOURCE_TYPE_SCAFFOLDER_ACTION } from '@backstage/plugin-scaffolder-common/alpha';
|
|
29
|
-
import express from 'express';
|
|
30
|
-
import { ScaffolderEntitiesProcessor as ScaffolderEntitiesProcessor$1 } from '@backstage/plugin-catalog-backend-module-scaffolder-entity-model';
|
|
31
20
|
|
|
32
21
|
/**
|
|
33
22
|
* Scaffolder plugin
|
|
@@ -110,8 +99,8 @@ interface CreateBuiltInActionsOptions {
|
|
|
110
99
|
* Additional custom filters that will be passed to the nunjucks template engine for use in
|
|
111
100
|
* Template Manifests and also template skeleton files when using `fetch:template`.
|
|
112
101
|
*/
|
|
113
|
-
additionalTemplateFilters?: Record<string, TemplateFilter
|
|
114
|
-
additionalTemplateGlobals?: Record<string, TemplateGlobal
|
|
102
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
103
|
+
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
|
115
104
|
}
|
|
116
105
|
/**
|
|
117
106
|
* A function to generate create a list of default actions that the scaffolder provides.
|
|
@@ -123,7 +112,7 @@ interface CreateBuiltInActionsOptions {
|
|
|
123
112
|
* @returns A list of actions that can be used in the scaffolder
|
|
124
113
|
*
|
|
125
114
|
*/
|
|
126
|
-
declare const createBuiltinActions: (options: CreateBuiltInActionsOptions) => TemplateAction
|
|
115
|
+
declare const createBuiltinActions: (options: CreateBuiltInActionsOptions) => TemplateAction[];
|
|
127
116
|
|
|
128
117
|
/**
|
|
129
118
|
* Writes a message into the log or lists all files in the workspace
|
|
@@ -189,17 +178,13 @@ declare function createFetchPlainFileAction(options: {
|
|
|
189
178
|
declare function createFetchTemplateAction(options: {
|
|
190
179
|
reader: UrlReaderService;
|
|
191
180
|
integrations: ScmIntegrations;
|
|
192
|
-
additionalTemplateFilters?: Record<string, TemplateFilter
|
|
193
|
-
additionalTemplateGlobals?: Record<string, TemplateGlobal
|
|
181
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
182
|
+
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
|
194
183
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
195
184
|
url: string;
|
|
196
185
|
targetPath?: string;
|
|
197
186
|
values: any;
|
|
198
187
|
templateFileExtension?: string | boolean;
|
|
199
|
-
/**
|
|
200
|
-
* @deprecated This field is deprecated in favor of copyWithoutTemplating.
|
|
201
|
-
*/
|
|
202
|
-
copyWithoutRender?: string[];
|
|
203
188
|
copyWithoutTemplating?: string[];
|
|
204
189
|
cookiecutterCompat?: boolean;
|
|
205
190
|
replace?: boolean;
|
|
@@ -217,8 +202,8 @@ declare function createFetchTemplateAction(options: {
|
|
|
217
202
|
declare function createFetchTemplateFileAction(options: {
|
|
218
203
|
reader: UrlReaderService;
|
|
219
204
|
integrations: ScmIntegrations;
|
|
220
|
-
additionalTemplateFilters?: Record<string, TemplateFilter
|
|
221
|
-
additionalTemplateGlobals?: Record<string, TemplateGlobal
|
|
205
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
206
|
+
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
|
222
207
|
}): _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
223
208
|
url: string;
|
|
224
209
|
targetPath: string;
|
|
@@ -270,217 +255,23 @@ declare const createFilesystemReadDirAction: () => _backstage_plugin_scaffolder_
|
|
|
270
255
|
}[];
|
|
271
256
|
}, "v1">;
|
|
272
257
|
|
|
273
|
-
/**
|
|
274
|
-
* @public
|
|
275
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
276
|
-
*/
|
|
277
|
-
declare const createGithubActionsDispatchAction: typeof createGithubActionsDispatchAction$1;
|
|
278
|
-
/**
|
|
279
|
-
* @public
|
|
280
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
281
|
-
*/
|
|
282
|
-
declare const createGithubDeployKeyAction: typeof createGithubDeployKeyAction$1;
|
|
283
|
-
/**
|
|
284
|
-
* @public
|
|
285
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
286
|
-
*/
|
|
287
|
-
declare const createGithubEnvironmentAction: typeof createGithubEnvironmentAction$1;
|
|
288
|
-
/**
|
|
289
|
-
* @public
|
|
290
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
291
|
-
*/
|
|
292
|
-
declare const createGithubIssuesLabelAction: typeof createGithubIssuesLabelAction$1;
|
|
293
|
-
/**
|
|
294
|
-
* @public
|
|
295
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
296
|
-
*/
|
|
297
|
-
type CreateGithubPullRequestActionOptions = CreateGithubPullRequestActionOptions$1;
|
|
298
|
-
/**
|
|
299
|
-
* @public
|
|
300
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
301
|
-
*/
|
|
302
|
-
declare const createGithubRepoCreateAction: typeof createGithubRepoCreateAction$1;
|
|
303
|
-
/**
|
|
304
|
-
* @public
|
|
305
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
306
|
-
*/
|
|
307
|
-
declare const createGithubRepoPushAction: typeof createGithubRepoPushAction$1;
|
|
308
|
-
/**
|
|
309
|
-
* @public
|
|
310
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
311
|
-
*/
|
|
312
|
-
declare const createGithubWebhookAction: typeof createGithubWebhookAction$1;
|
|
313
|
-
/**
|
|
314
|
-
* @public
|
|
315
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
316
|
-
*/
|
|
317
|
-
declare const createPublishGithubAction: typeof createPublishGithubAction$1;
|
|
318
|
-
/**
|
|
319
|
-
* @public
|
|
320
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-github` instead
|
|
321
|
-
*/
|
|
322
|
-
declare const createPublishGithubPullRequestAction: (options: CreateGithubPullRequestActionOptions$1) => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
323
|
-
title: string;
|
|
324
|
-
branchName: string;
|
|
325
|
-
targetBranchName?: string;
|
|
326
|
-
description: string;
|
|
327
|
-
repoUrl: string;
|
|
328
|
-
draft?: boolean;
|
|
329
|
-
targetPath?: string;
|
|
330
|
-
sourcePath?: string;
|
|
331
|
-
token?: string;
|
|
332
|
-
reviewers?: string[];
|
|
333
|
-
assignees?: string[];
|
|
334
|
-
teamReviewers?: string[];
|
|
335
|
-
commitMessage?: string;
|
|
336
|
-
update?: boolean;
|
|
337
|
-
forceFork?: boolean;
|
|
338
|
-
gitAuthorName?: string;
|
|
339
|
-
gitAuthorEmail?: string;
|
|
340
|
-
forceEmptyGitAuthor?: boolean;
|
|
341
|
-
createWhenEmpty?: boolean;
|
|
342
|
-
}, _backstage_types.JsonObject, "v1">;
|
|
343
|
-
/**
|
|
344
|
-
* @public @deprecated use "createPublishBitbucketCloudAction" from \@backstage/plugin-scaffolder-backend-module-bitbucket-cloud or "createPublishBitbucketServerAction" from \@backstage/plugin-scaffolder-backend-module-bitbucket-server instead
|
|
345
|
-
*/
|
|
346
|
-
declare const createPublishBitbucketAction: typeof createPublishBitbucketAction$1;
|
|
347
|
-
/**
|
|
348
|
-
* @public
|
|
349
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-cloud` instead
|
|
350
|
-
*/
|
|
351
|
-
declare const createPublishBitbucketCloudAction: typeof createPublishBitbucketCloudAction$1;
|
|
352
|
-
/**
|
|
353
|
-
* @public
|
|
354
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead
|
|
355
|
-
*/
|
|
356
|
-
declare const createPublishBitbucketServerAction: typeof createPublishBitbucketServerAction$1;
|
|
357
|
-
/**
|
|
358
|
-
* @public
|
|
359
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-bitbucket-server` instead
|
|
360
|
-
*/
|
|
361
|
-
declare const createPublishBitbucketServerPullRequestAction: typeof createPublishBitbucketServerPullRequestAction$1;
|
|
362
|
-
/**
|
|
363
|
-
* @public
|
|
364
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-azure` instead
|
|
365
|
-
*/
|
|
366
|
-
declare const createPublishAzureAction: typeof createPublishAzureAction$1;
|
|
367
|
-
/**
|
|
368
|
-
* @public
|
|
369
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-gerrit` instead
|
|
370
|
-
*/
|
|
371
|
-
declare const createPublishGerritAction: typeof createPublishGerritAction$1;
|
|
372
|
-
/**
|
|
373
|
-
* @public
|
|
374
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-gerrit` instead
|
|
375
|
-
*/
|
|
376
|
-
declare const createPublishGerritReviewAction: typeof createPublishGerritReviewAction$1;
|
|
377
|
-
/**
|
|
378
|
-
* @public
|
|
379
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-gitlab` instead
|
|
380
|
-
*/
|
|
381
|
-
declare const createPublishGitlabAction: typeof createPublishGitlabAction$1;
|
|
382
|
-
/**
|
|
383
|
-
* @public
|
|
384
|
-
* @deprecated use import from `@backstage/plugin-scaffolder-backend-module-gitlab` instead
|
|
385
|
-
*/
|
|
386
|
-
declare const createPublishGitlabMergeRequestAction: (options: {
|
|
387
|
-
integrations: _backstage_integration.ScmIntegrationRegistry;
|
|
388
|
-
}) => _backstage_plugin_scaffolder_node.TemplateAction<{
|
|
389
|
-
repoUrl: string;
|
|
390
|
-
title: string;
|
|
391
|
-
description: string;
|
|
392
|
-
branchName: string;
|
|
393
|
-
targetBranchName?: string;
|
|
394
|
-
sourcePath?: string;
|
|
395
|
-
targetPath?: string;
|
|
396
|
-
token?: string;
|
|
397
|
-
commitAction?: "create" | "delete" | "update" | "skip" | "auto";
|
|
398
|
-
projectid?: string;
|
|
399
|
-
removeSourceBranch?: boolean;
|
|
400
|
-
assignee?: string;
|
|
401
|
-
reviewers?: string[];
|
|
402
|
-
assignReviewersFromApprovalRules?: boolean;
|
|
403
|
-
}, _backstage_types.JsonObject, "v1">;
|
|
404
|
-
|
|
405
258
|
/**
|
|
406
259
|
* Registry of all registered template actions.
|
|
407
260
|
* @public
|
|
261
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
408
262
|
*/
|
|
409
263
|
declare class TemplateActionRegistry {
|
|
410
264
|
private readonly actions;
|
|
411
|
-
register(action: TemplateAction
|
|
412
|
-
get(actionId: string): TemplateAction
|
|
413
|
-
list(): TemplateAction
|
|
265
|
+
register(action: TemplateAction<any, any, any>): void;
|
|
266
|
+
get(actionId: string): TemplateAction<any, any, any>;
|
|
267
|
+
list(): TemplateAction<any, any, any>[];
|
|
414
268
|
}
|
|
415
269
|
|
|
416
|
-
/**
|
|
417
|
-
* The status of each step of the Task
|
|
418
|
-
*
|
|
419
|
-
* @public
|
|
420
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
421
|
-
*/
|
|
422
|
-
type TaskStatus = TaskStatus$1;
|
|
423
|
-
/**
|
|
424
|
-
* The state of a completed task.
|
|
425
|
-
*
|
|
426
|
-
* @public
|
|
427
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
428
|
-
*/
|
|
429
|
-
type TaskCompletionState = TaskCompletionState$1;
|
|
430
|
-
/**
|
|
431
|
-
* SerializedTask
|
|
432
|
-
*
|
|
433
|
-
* @public
|
|
434
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
435
|
-
*/
|
|
436
|
-
type SerializedTask = SerializedTask$1;
|
|
437
|
-
/**
|
|
438
|
-
* TaskEventType
|
|
439
|
-
*
|
|
440
|
-
* @public
|
|
441
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
442
|
-
*/
|
|
443
|
-
type TaskEventType = TaskEventType$1;
|
|
444
|
-
/**
|
|
445
|
-
* SerializedTaskEvent
|
|
446
|
-
*
|
|
447
|
-
* @public
|
|
448
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
449
|
-
*/
|
|
450
|
-
type SerializedTaskEvent = SerializedTaskEvent$1;
|
|
451
|
-
/**
|
|
452
|
-
* The result of `TaskBroker.dispatch`.
|
|
453
|
-
*
|
|
454
|
-
* @public
|
|
455
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
456
|
-
*/
|
|
457
|
-
type TaskBrokerDispatchResult = TaskBrokerDispatchResult$1;
|
|
458
|
-
/**
|
|
459
|
-
* The options passed to `TaskBroker.dispatch`.
|
|
460
|
-
* Currently a spec and optional secrets
|
|
461
|
-
*
|
|
462
|
-
* @public
|
|
463
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
464
|
-
*/
|
|
465
|
-
type TaskBrokerDispatchOptions = TaskBrokerDispatchOptions$1;
|
|
466
|
-
/**
|
|
467
|
-
* Task
|
|
468
|
-
*
|
|
469
|
-
* @public
|
|
470
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
471
|
-
*/
|
|
472
|
-
type TaskContext = TaskContext$1;
|
|
473
|
-
/**
|
|
474
|
-
* TaskBroker
|
|
475
|
-
*
|
|
476
|
-
* @public
|
|
477
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
478
|
-
*/
|
|
479
|
-
type TaskBroker = TaskBroker$1;
|
|
480
270
|
/**
|
|
481
271
|
* TaskStoreEmitOptions
|
|
482
272
|
*
|
|
483
273
|
* @public
|
|
274
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
484
275
|
*/
|
|
485
276
|
type TaskStoreEmitOptions<TBody = JsonObject> = {
|
|
486
277
|
taskId: string;
|
|
@@ -490,6 +281,7 @@ type TaskStoreEmitOptions<TBody = JsonObject> = {
|
|
|
490
281
|
* TaskStoreListEventsOptions
|
|
491
282
|
*
|
|
492
283
|
* @public
|
|
284
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
493
285
|
*/
|
|
494
286
|
type TaskStoreListEventsOptions = {
|
|
495
287
|
isTaskRecoverable?: boolean;
|
|
@@ -500,6 +292,7 @@ type TaskStoreListEventsOptions = {
|
|
|
500
292
|
* TaskStoreShutDownTaskOptions
|
|
501
293
|
*
|
|
502
294
|
* @public
|
|
295
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
503
296
|
*/
|
|
504
297
|
type TaskStoreShutDownTaskOptions = {
|
|
505
298
|
taskId: string;
|
|
@@ -507,15 +300,17 @@ type TaskStoreShutDownTaskOptions = {
|
|
|
507
300
|
/**
|
|
508
301
|
* The options passed to {@link TaskStore.createTask}
|
|
509
302
|
* @public
|
|
303
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
510
304
|
*/
|
|
511
305
|
type TaskStoreCreateTaskOptions = {
|
|
512
306
|
spec: TaskSpec;
|
|
513
307
|
createdBy?: string;
|
|
514
|
-
secrets?: TaskSecrets
|
|
308
|
+
secrets?: TaskSecrets;
|
|
515
309
|
};
|
|
516
310
|
/**
|
|
517
311
|
* The options passed to {@link TaskStore.recoverTasks}
|
|
518
312
|
* @public
|
|
313
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
519
314
|
*/
|
|
520
315
|
type TaskStoreRecoverTaskOptions = {
|
|
521
316
|
timeout: HumanDuration;
|
|
@@ -523,6 +318,7 @@ type TaskStoreRecoverTaskOptions = {
|
|
|
523
318
|
/**
|
|
524
319
|
* The response from {@link TaskStore.createTask}
|
|
525
320
|
* @public
|
|
321
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
526
322
|
*/
|
|
527
323
|
type TaskStoreCreateTaskResult = {
|
|
528
324
|
taskId: string;
|
|
@@ -531,12 +327,13 @@ type TaskStoreCreateTaskResult = {
|
|
|
531
327
|
* TaskStore
|
|
532
328
|
*
|
|
533
329
|
* @public
|
|
330
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
534
331
|
*/
|
|
535
332
|
interface TaskStore {
|
|
536
333
|
cancelTask?(options: TaskStoreEmitOptions): Promise<void>;
|
|
537
334
|
createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
|
|
538
335
|
retryTask?(options: {
|
|
539
|
-
secrets?: TaskSecrets
|
|
336
|
+
secrets?: TaskSecrets;
|
|
540
337
|
taskId: string;
|
|
541
338
|
}): Promise<void>;
|
|
542
339
|
recoverTasks?(options: TaskStoreRecoverTaskOptions): Promise<{
|
|
@@ -625,7 +422,7 @@ interface TaskStore {
|
|
|
625
422
|
|
|
626
423
|
/**
|
|
627
424
|
* DatabaseTaskStore
|
|
628
|
-
*
|
|
425
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
629
426
|
* @public
|
|
630
427
|
*/
|
|
631
428
|
type DatabaseTaskStoreOptions = {
|
|
@@ -634,7 +431,7 @@ type DatabaseTaskStoreOptions = {
|
|
|
634
431
|
};
|
|
635
432
|
/**
|
|
636
433
|
* DatabaseTaskStore
|
|
637
|
-
*
|
|
434
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
638
435
|
* @public
|
|
639
436
|
*/
|
|
640
437
|
declare class DatabaseTaskStore implements TaskStore {
|
|
@@ -650,10 +447,10 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
650
447
|
private getState;
|
|
651
448
|
list(options: {
|
|
652
449
|
createdBy?: string;
|
|
653
|
-
status?: TaskStatus
|
|
450
|
+
status?: TaskStatus;
|
|
654
451
|
filters?: {
|
|
655
452
|
createdBy?: string | string[];
|
|
656
|
-
status?: TaskStatus
|
|
453
|
+
status?: TaskStatus | TaskStatus[];
|
|
657
454
|
};
|
|
658
455
|
pagination?: {
|
|
659
456
|
limit?: number;
|
|
@@ -664,12 +461,12 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
664
461
|
field: string;
|
|
665
462
|
}[];
|
|
666
463
|
}): Promise<{
|
|
667
|
-
tasks: SerializedTask
|
|
464
|
+
tasks: SerializedTask[];
|
|
668
465
|
totalTasks?: number;
|
|
669
466
|
}>;
|
|
670
|
-
getTask(taskId: string): Promise<SerializedTask
|
|
467
|
+
getTask(taskId: string): Promise<SerializedTask>;
|
|
671
468
|
createTask(options: TaskStoreCreateTaskOptions): Promise<TaskStoreCreateTaskResult>;
|
|
672
|
-
claimTask(): Promise<SerializedTask
|
|
469
|
+
claimTask(): Promise<SerializedTask | undefined>;
|
|
673
470
|
heartbeatTask(taskId: string): Promise<void>;
|
|
674
471
|
listStaleTasks(options: {
|
|
675
472
|
timeoutS: number;
|
|
@@ -681,7 +478,7 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
681
478
|
}>;
|
|
682
479
|
completeTask(options: {
|
|
683
480
|
taskId: string;
|
|
684
|
-
status: TaskStatus
|
|
481
|
+
status: TaskStatus;
|
|
685
482
|
eventBody: JsonObject;
|
|
686
483
|
}): Promise<void>;
|
|
687
484
|
emitLogEvent(options: TaskStoreEmitOptions<{
|
|
@@ -697,7 +494,7 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
697
494
|
state?: JsonObject;
|
|
698
495
|
}): Promise<void>;
|
|
699
496
|
listEvents(options: TaskStoreListEventsOptions): Promise<{
|
|
700
|
-
events: SerializedTaskEvent
|
|
497
|
+
events: SerializedTaskEvent[];
|
|
701
498
|
}>;
|
|
702
499
|
shutdownTask(options: TaskStoreShutDownTaskOptions): Promise<void>;
|
|
703
500
|
rehydrateWorkspace(options: {
|
|
@@ -715,7 +512,7 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
715
512
|
message: string;
|
|
716
513
|
} & JsonObject>): Promise<void>;
|
|
717
514
|
retryTask?(options: {
|
|
718
|
-
secrets?: TaskSecrets
|
|
515
|
+
secrets?: TaskSecrets;
|
|
719
516
|
taskId: string;
|
|
720
517
|
}): Promise<void>;
|
|
721
518
|
recoverTasks(options: TaskStoreRecoverTaskOptions): Promise<{
|
|
@@ -725,10 +522,10 @@ declare class DatabaseTaskStore implements TaskStore {
|
|
|
725
522
|
|
|
726
523
|
/**
|
|
727
524
|
* TaskManager
|
|
728
|
-
*
|
|
525
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
729
526
|
* @public
|
|
730
527
|
*/
|
|
731
|
-
declare class TaskManager implements TaskContext
|
|
528
|
+
declare class TaskManager implements TaskContext {
|
|
732
529
|
private readonly task;
|
|
733
530
|
private readonly storage;
|
|
734
531
|
private readonly signal;
|
|
@@ -741,7 +538,7 @@ declare class TaskManager implements TaskContext$1 {
|
|
|
741
538
|
private constructor();
|
|
742
539
|
get spec(): _backstage_plugin_scaffolder_common.TaskSpecV1beta3;
|
|
743
540
|
get cancelSignal(): AbortSignal;
|
|
744
|
-
get secrets(): TaskSecrets
|
|
541
|
+
get secrets(): TaskSecrets | undefined;
|
|
745
542
|
get createdBy(): string | undefined;
|
|
746
543
|
getWorkspaceName(): Promise<string>;
|
|
747
544
|
rehydrateWorkspace?(options: {
|
|
@@ -766,7 +563,7 @@ declare class TaskManager implements TaskContext$1 {
|
|
|
766
563
|
path: string;
|
|
767
564
|
}): Promise<void>;
|
|
768
565
|
cleanWorkspace?(): Promise<void>;
|
|
769
|
-
complete(result: TaskCompletionState
|
|
566
|
+
complete(result: TaskCompletionState, metadata?: JsonObject): Promise<void>;
|
|
770
567
|
private startTimeout;
|
|
771
568
|
getInitiatorCredentials(): Promise<BackstageCredentials>;
|
|
772
569
|
}
|
|
@@ -787,7 +584,7 @@ interface CurrentClaimedTask {
|
|
|
787
584
|
/**
|
|
788
585
|
* The secrets that are stored with the task.
|
|
789
586
|
*/
|
|
790
|
-
secrets?: TaskSecrets
|
|
587
|
+
secrets?: TaskSecrets;
|
|
791
588
|
/**
|
|
792
589
|
* The state of checkpoints of the task.
|
|
793
590
|
*/
|
|
@@ -804,17 +601,17 @@ interface CurrentClaimedTask {
|
|
|
804
601
|
|
|
805
602
|
/**
|
|
806
603
|
* CreateWorkerOptions
|
|
807
|
-
*
|
|
604
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
808
605
|
* @public
|
|
809
606
|
*/
|
|
810
607
|
type CreateWorkerOptions = {
|
|
811
|
-
taskBroker: TaskBroker
|
|
608
|
+
taskBroker: TaskBroker;
|
|
812
609
|
actionRegistry: TemplateActionRegistry;
|
|
813
610
|
integrations: ScmIntegrations;
|
|
814
611
|
workingDirectory: string;
|
|
815
612
|
logger: Logger;
|
|
816
613
|
auditor?: AuditorService;
|
|
817
|
-
additionalTemplateFilters?: Record<string, TemplateFilter
|
|
614
|
+
additionalTemplateFilters?: Record<string, TemplateFilter>;
|
|
818
615
|
/**
|
|
819
616
|
* The number of tasks that can be executed at the same time by the worker
|
|
820
617
|
* @defaultValue 10
|
|
@@ -828,13 +625,13 @@ type CreateWorkerOptions = {
|
|
|
828
625
|
* ```
|
|
829
626
|
*/
|
|
830
627
|
concurrentTasksLimit?: number;
|
|
831
|
-
additionalTemplateGlobals?: Record<string, TemplateGlobal
|
|
628
|
+
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
|
|
832
629
|
permissions?: PermissionEvaluator;
|
|
833
630
|
gracefulShutdown?: boolean;
|
|
834
631
|
};
|
|
835
632
|
/**
|
|
836
633
|
* TaskWorker
|
|
837
|
-
*
|
|
634
|
+
* @deprecated this type is deprecated, and there will be a new way to create Workers in the next major version.
|
|
838
635
|
* @public
|
|
839
636
|
*/
|
|
840
637
|
declare class TaskWorker {
|
|
@@ -849,11 +646,10 @@ declare class TaskWorker {
|
|
|
849
646
|
start(): void;
|
|
850
647
|
stop(): Promise<void>;
|
|
851
648
|
protected onReadyToClaimTask(): Promise<void>;
|
|
852
|
-
runOneTask(task: TaskContext
|
|
649
|
+
runOneTask(task: TaskContext): Promise<void>;
|
|
853
650
|
}
|
|
854
651
|
|
|
855
652
|
/**
|
|
856
|
-
*
|
|
857
653
|
* @public
|
|
858
654
|
*/
|
|
859
655
|
type TemplatePermissionRuleInput<TParams extends PermissionRuleParams = PermissionRuleParams> = PermissionRule<TemplateEntityStepV1beta3 | TemplateParametersV1beta3, {}, typeof RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, TParams>;
|
|
@@ -862,111 +658,5 @@ type TemplatePermissionRuleInput<TParams extends PermissionRuleParams = Permissi
|
|
|
862
658
|
* @public
|
|
863
659
|
*/
|
|
864
660
|
type ActionPermissionRuleInput<TParams extends PermissionRuleParams = PermissionRuleParams> = PermissionRule<TemplateEntityStepV1beta3 | TemplateParametersV1beta3, {}, typeof RESOURCE_TYPE_SCAFFOLDER_ACTION, TParams>;
|
|
865
|
-
/**
|
|
866
|
-
* RouterOptions
|
|
867
|
-
*
|
|
868
|
-
* @public
|
|
869
|
-
* @deprecated Please migrate to the new backend system as this will be removed in the future.
|
|
870
|
-
*/
|
|
871
|
-
interface RouterOptions {
|
|
872
|
-
logger: Logger;
|
|
873
|
-
config: Config;
|
|
874
|
-
reader: UrlReaderService;
|
|
875
|
-
lifecycle?: LifecycleService;
|
|
876
|
-
database: DatabaseService;
|
|
877
|
-
catalogClient: CatalogApi;
|
|
878
|
-
scheduler?: SchedulerService;
|
|
879
|
-
actions?: TemplateAction$1<any, any, any>[];
|
|
880
|
-
/**
|
|
881
|
-
* @deprecated taskWorkers is deprecated in favor of concurrentTasksLimit option with a single TaskWorker
|
|
882
|
-
* @defaultValue 1
|
|
883
|
-
*/
|
|
884
|
-
taskWorkers?: number;
|
|
885
|
-
/**
|
|
886
|
-
* Sets the number of concurrent tasks that can be run at any given time on the TaskWorker
|
|
887
|
-
* @defaultValue 10
|
|
888
|
-
*/
|
|
889
|
-
concurrentTasksLimit?: number;
|
|
890
|
-
taskBroker?: TaskBroker$1;
|
|
891
|
-
additionalTemplateFilters?: Record<string, TemplateFilter$1> | CreatedTemplateFilter<any, any>[];
|
|
892
|
-
additionalTemplateGlobals?: Record<string, TemplateGlobal$1> | CreatedTemplateGlobal[];
|
|
893
|
-
additionalWorkspaceProviders?: Record<string, WorkspaceProvider>;
|
|
894
|
-
permissions?: PermissionsService;
|
|
895
|
-
permissionRules?: Array<TemplatePermissionRuleInput | ActionPermissionRuleInput>;
|
|
896
|
-
auth?: AuthService;
|
|
897
|
-
httpAuth?: HttpAuthService;
|
|
898
|
-
identity?: IdentityApi;
|
|
899
|
-
discovery?: DiscoveryService;
|
|
900
|
-
events?: EventsService;
|
|
901
|
-
auditor?: AuditorService;
|
|
902
|
-
autocompleteHandlers?: Record<string, AutocompleteHandler>;
|
|
903
|
-
}
|
|
904
|
-
/**
|
|
905
|
-
* A method to create a router for the scaffolder backend plugin.
|
|
906
|
-
* @public
|
|
907
|
-
* @deprecated Please migrate to the new backend system as this will be removed in the future.
|
|
908
|
-
*/
|
|
909
|
-
declare function createRouter(options: RouterOptions): Promise<express.Router>;
|
|
910
|
-
|
|
911
|
-
/**
|
|
912
|
-
* @public
|
|
913
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
914
|
-
*/
|
|
915
|
-
type TemplateFilter = TemplateFilter$1;
|
|
916
|
-
/**
|
|
917
|
-
* @public
|
|
918
|
-
* @deprecated Import from `@backstage/plugin-scaffolder-node` instead.
|
|
919
|
-
*/
|
|
920
|
-
type TemplateGlobal = TemplateGlobal$1;
|
|
921
|
-
|
|
922
|
-
/**
|
|
923
|
-
* @public
|
|
924
|
-
* @deprecated Import from {@link @backstage/plugin-scaffolder-node#ActionContext} instead
|
|
925
|
-
*/
|
|
926
|
-
type ActionContext<TInput extends JsonObject> = ActionContext$1<TInput>;
|
|
927
|
-
/**
|
|
928
|
-
* @public
|
|
929
|
-
* @deprecated Use `createTemplateAction` from `@backstage/plugin-scaffolder-node` instead
|
|
930
|
-
*/
|
|
931
|
-
declare const createTemplateAction: typeof createTemplateAction$1;
|
|
932
|
-
/**
|
|
933
|
-
* @public
|
|
934
|
-
* @deprecated Use `TaskSecrets` from `@backstage/plugin-scaffolder-node` instead
|
|
935
|
-
*/
|
|
936
|
-
type TaskSecrets = TaskSecrets$1;
|
|
937
|
-
/**
|
|
938
|
-
* @public
|
|
939
|
-
* @deprecated Use `TemplateAction` from `@backstage/plugin-scaffolder-node` instead
|
|
940
|
-
*/
|
|
941
|
-
type TemplateAction<TInput extends JsonObject> = TemplateAction$1<TInput>;
|
|
942
|
-
/**
|
|
943
|
-
* Options for {@link executeShellCommand}.
|
|
944
|
-
*
|
|
945
|
-
* @public
|
|
946
|
-
* @deprecated Use `ExecuteShellCommandOptions` from `@backstage/plugin-scaffolder-node` instead
|
|
947
|
-
*/
|
|
948
|
-
type RunCommandOptions = ExecuteShellCommandOptions;
|
|
949
|
-
/**
|
|
950
|
-
* Run a command in a sub-process, normally a shell command.
|
|
951
|
-
*
|
|
952
|
-
* @public
|
|
953
|
-
* @deprecated Use `executeShellCommand` from `@backstage/plugin-scaffolder-node` instead
|
|
954
|
-
*/
|
|
955
|
-
declare const executeShellCommand: typeof executeShellCommand$1;
|
|
956
|
-
/**
|
|
957
|
-
* A helper function that reads the contents of a directory from the given URL.
|
|
958
|
-
* Can be used in your own actions, and also used behind fetch:template and fetch:plain
|
|
959
|
-
*
|
|
960
|
-
* @public
|
|
961
|
-
* @deprecated Use `fetchContents` from `@backstage/plugin-scaffolder-node` instead
|
|
962
|
-
*/
|
|
963
|
-
declare const fetchContents: typeof fetchContents$1;
|
|
964
|
-
/**
|
|
965
|
-
* Adds support for scaffolder specific entity kinds to the catalog.
|
|
966
|
-
*
|
|
967
|
-
* @public
|
|
968
|
-
* @deprecated Import from `@backstage/plugin-catalog-backend-module-scaffolder-entity-model` instead
|
|
969
|
-
*/
|
|
970
|
-
declare const ScaffolderEntitiesProcessor: typeof ScaffolderEntitiesProcessor$1;
|
|
971
661
|
|
|
972
|
-
export { type
|
|
662
|
+
export { type ActionPermissionRuleInput, type CreateBuiltInActionsOptions, type CreateWorkerOptions, type CurrentClaimedTask, DatabaseTaskStore, type DatabaseTaskStoreOptions, TaskManager, type TaskStore, type TaskStoreCreateTaskOptions, type TaskStoreCreateTaskResult, type TaskStoreEmitOptions, type TaskStoreListEventsOptions, type TaskStoreRecoverTaskOptions, type TaskStoreShutDownTaskOptions, TaskWorker, TemplateActionRegistry, type TemplatePermissionRuleInput, createBuiltinActions, createCatalogRegisterAction, createCatalogWriteAction, createDebugLogAction, createFetchCatalogEntityAction, createFetchPlainAction, createFetchPlainFileAction, createFetchTemplateAction, createFetchTemplateFileAction, createFilesystemDeleteAction, createFilesystemReadDirAction, createFilesystemRenameAction, createWaitAction, scaffolderPlugin as default };
|