@backstage/plugin-scaffolder 1.0.1 → 1.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.
- package/CHANGELOG.md +98 -0
- package/README.md +1 -2
- package/alpha/package.json +6 -0
- package/dist/esm/{Router-773d053b.esm.js → Router-8305dc47.esm.js} +89 -48
- package/dist/esm/Router-8305dc47.esm.js.map +1 -0
- package/dist/esm/default-bae303a0.esm.js +33 -0
- package/dist/esm/default-bae303a0.esm.js.map +1 -0
- package/dist/esm/index-bd4ce41a.esm.js +337 -0
- package/dist/esm/index-bd4ce41a.esm.js.map +1 -0
- package/dist/esm/{index-25fdb62e.esm.js → index-e7455fc8.esm.js} +18 -6
- package/dist/esm/index-e7455fc8.esm.js.map +1 -0
- package/dist/index.alpha.d.ts +507 -0
- package/dist/index.beta.d.ts +484 -0
- package/dist/index.d.ts +286 -226
- package/dist/index.esm.js +1 -1
- package/package.json +25 -23
- package/dist/esm/Router-773d053b.esm.js.map +0 -1
- package/dist/esm/index-25fdb62e.esm.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,38 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Backstage plugin that helps you create new things
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import React, { ComponentType } from 'react';
|
|
9
|
-
import { FieldValidation, FieldProps } from '@rjsf/core';
|
|
8
|
+
|
|
9
|
+
import { ApiHolder } from '@backstage/core-plugin-api';
|
|
10
|
+
import { ApiRef } from '@backstage/core-plugin-api';
|
|
11
|
+
import { BackstagePlugin } from '@backstage/core-plugin-api';
|
|
12
|
+
import { ComponentType } from 'react';
|
|
13
|
+
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
|
10
14
|
import { Entity } from '@backstage/catalog-model';
|
|
15
|
+
import { Extension } from '@backstage/core-plugin-api';
|
|
16
|
+
import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
|
17
|
+
import { FetchApi } from '@backstage/core-plugin-api';
|
|
18
|
+
import { FieldProps } from '@rjsf/core';
|
|
19
|
+
import { FieldValidation } from '@rjsf/core';
|
|
20
|
+
import { JsonObject } from '@backstage/types';
|
|
21
|
+
import { JSONSchema7 } from 'json-schema';
|
|
22
|
+
import { JsonValue } from '@backstage/types';
|
|
23
|
+
import { Observable } from '@backstage/types';
|
|
24
|
+
import { PropsWithChildren } from 'react';
|
|
25
|
+
import { default as React_2 } from 'react';
|
|
26
|
+
import { RouteRef } from '@backstage/core-plugin-api';
|
|
27
|
+
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
28
|
+
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
|
29
|
+
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
11
30
|
|
|
12
31
|
/**
|
|
13
|
-
*
|
|
32
|
+
* Method for creating field extensions that can be used in the scaffolder
|
|
33
|
+
* frontend form.
|
|
34
|
+
* @public
|
|
35
|
+
*/
|
|
36
|
+
export declare function createScaffolderFieldExtension<TReturnValue = unknown, TInputProps = unknown>(options: FieldExtensionOptions<TReturnValue, TInputProps>): Extension<FieldExtensionComponent<TReturnValue, TInputProps>>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Field validation type for Custom Field Extensions.
|
|
14
40
|
*
|
|
15
41
|
* @public
|
|
16
42
|
*/
|
|
17
|
-
declare type
|
|
43
|
+
export declare type CustomFieldValidator<TFieldReturnValue> = (data: TFieldReturnValue, field: FieldValidation, context: {
|
|
44
|
+
apiHolder: ApiHolder;
|
|
45
|
+
}) => void;
|
|
46
|
+
|
|
18
47
|
/**
|
|
19
|
-
* The
|
|
48
|
+
* The field extension for selecting a name for a new Entity in the Catalog.
|
|
20
49
|
*
|
|
21
50
|
* @public
|
|
22
51
|
*/
|
|
23
|
-
declare
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
export declare const EntityNamePickerFieldExtension: FieldExtensionComponent<string, {}>;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* A field extension for selecting an Entity that exists in the Catalog.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export declare const EntityPickerFieldExtension: FieldExtensionComponent<string, EntityPickerUiOptions>;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The input props that can be specified under `ui:options` for the
|
|
63
|
+
* `EntityPicker` field extension.
|
|
64
|
+
*
|
|
65
|
+
* @public
|
|
66
|
+
*/
|
|
67
|
+
export declare interface EntityPickerUiOptions {
|
|
68
|
+
allowedKinds?: string[];
|
|
69
|
+
defaultKind?: string;
|
|
70
|
+
allowArbitraryValues?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* EntityTagsPickerFieldExtension
|
|
75
|
+
* @public
|
|
76
|
+
*/
|
|
77
|
+
export declare const EntityTagsPickerFieldExtension: FieldExtensionComponent<string[], EntityTagsPickerUiOptions>;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* The input props that can be specified under `ui:options` for the
|
|
81
|
+
* `EntityTagsPicker` field extension.
|
|
82
|
+
*
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
export declare interface EntityTagsPickerUiOptions {
|
|
86
|
+
kinds?: string[];
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps
|
|
91
|
+
*
|
|
92
|
+
* @public
|
|
93
|
+
*/
|
|
94
|
+
export declare type FieldExtensionComponent<_TReturnValue, _TInputProps> = () => null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Type for field extensions and being able to type
|
|
98
|
+
* incoming props easier.
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
export declare interface FieldExtensionComponentProps<TFieldReturnValue, TUiOptions extends {} = {}> extends FieldProps<TFieldReturnValue> {
|
|
103
|
+
uiSchema: FieldProps['uiSchema'] & {
|
|
104
|
+
'ui:options'?: TUiOptions;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Type for the Custom Field Extension with the
|
|
110
|
+
* name and components and validation function.
|
|
111
|
+
*
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
export declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputProps = unknown> = {
|
|
115
|
+
name: string;
|
|
116
|
+
component: (props: FieldExtensionComponentProps<TFieldReturnValue, TInputProps>) => JSX.Element | null;
|
|
117
|
+
validation?: CustomFieldValidator<TFieldReturnValue>;
|
|
29
118
|
};
|
|
119
|
+
|
|
30
120
|
/**
|
|
31
121
|
* The response shape for the `listActions` call to the `scaffolder-backend`
|
|
32
122
|
*
|
|
33
123
|
* @public
|
|
34
124
|
*/
|
|
35
|
-
declare type ListActionsResponse = Array<{
|
|
125
|
+
export declare type ListActionsResponse = Array<{
|
|
36
126
|
id: string;
|
|
37
127
|
description?: string;
|
|
38
128
|
schema?: {
|
|
@@ -40,38 +130,13 @@ declare type ListActionsResponse = Array<{
|
|
|
40
130
|
output?: JSONSchema7;
|
|
41
131
|
};
|
|
42
132
|
}>;
|
|
43
|
-
|
|
44
|
-
declare type ScaffolderOutputLink = {
|
|
45
|
-
title?: string;
|
|
46
|
-
icon?: string;
|
|
47
|
-
url?: string;
|
|
48
|
-
entityRef?: string;
|
|
49
|
-
};
|
|
50
|
-
/** @public */
|
|
51
|
-
declare type ScaffolderTaskOutput = {
|
|
52
|
-
links?: ScaffolderOutputLink[];
|
|
53
|
-
} & {
|
|
54
|
-
[key: string]: unknown;
|
|
55
|
-
};
|
|
56
|
-
/**
|
|
57
|
-
* The shape of each entry of parameters which gets rendered
|
|
58
|
-
* as a separate step in the wizard input
|
|
59
|
-
*
|
|
60
|
-
* @public
|
|
61
|
-
*/
|
|
62
|
-
declare type TemplateParameterSchema = {
|
|
63
|
-
title: string;
|
|
64
|
-
steps: Array<{
|
|
65
|
-
title: string;
|
|
66
|
-
schema: JsonObject;
|
|
67
|
-
}>;
|
|
68
|
-
};
|
|
133
|
+
|
|
69
134
|
/**
|
|
70
135
|
* The shape of a `LogEvent` message from the `scaffolder-backend`
|
|
71
136
|
*
|
|
72
137
|
* @public
|
|
73
138
|
*/
|
|
74
|
-
declare type LogEvent = {
|
|
139
|
+
export declare type LogEvent = {
|
|
75
140
|
type: 'log' | 'completion';
|
|
76
141
|
body: {
|
|
77
142
|
message: string;
|
|
@@ -82,59 +147,118 @@ declare type LogEvent = {
|
|
|
82
147
|
id: string;
|
|
83
148
|
taskId: string;
|
|
84
149
|
};
|
|
150
|
+
|
|
151
|
+
/* Excluded from this release type: NextRouterProps */
|
|
152
|
+
|
|
153
|
+
/* Excluded from this release type: NextScaffolderPage */
|
|
154
|
+
|
|
85
155
|
/**
|
|
86
|
-
*
|
|
156
|
+
* A field extension to show all the Entities that are owned by the current logged-in User for use in templates.
|
|
87
157
|
*
|
|
88
158
|
* @public
|
|
89
159
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
values: Record<string, JsonValue>;
|
|
93
|
-
secrets?: Record<string, string>;
|
|
94
|
-
}
|
|
160
|
+
export declare const OwnedEntityPickerFieldExtension: FieldExtensionComponent<string, OwnedEntityPickerUiOptions>;
|
|
161
|
+
|
|
95
162
|
/**
|
|
96
|
-
* The
|
|
163
|
+
* The input props that can be specified under `ui:options` for the
|
|
164
|
+
* `OwnedEntityPicker` field extension.
|
|
97
165
|
*
|
|
98
166
|
* @public
|
|
99
167
|
*/
|
|
100
|
-
interface
|
|
101
|
-
|
|
168
|
+
export declare interface OwnedEntityPickerUiOptions {
|
|
169
|
+
allowedKinds?: string[];
|
|
170
|
+
defaultKind?: string;
|
|
102
171
|
}
|
|
172
|
+
|
|
103
173
|
/**
|
|
104
|
-
*
|
|
174
|
+
* A field extension for picking users and groups out of the Catalog.
|
|
105
175
|
*
|
|
106
176
|
* @public
|
|
107
177
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
178
|
+
export declare const OwnerPickerFieldExtension: FieldExtensionComponent<string, OwnerPickerUiOptions>;
|
|
179
|
+
|
|
111
180
|
/**
|
|
112
|
-
* The
|
|
181
|
+
* The input props that can be specified under `ui:options` for the
|
|
182
|
+
* `OwnerPicker` field extension.
|
|
113
183
|
*
|
|
114
184
|
* @public
|
|
115
185
|
*/
|
|
116
|
-
interface
|
|
117
|
-
|
|
118
|
-
type: string;
|
|
119
|
-
title: string;
|
|
120
|
-
host: string;
|
|
121
|
-
}[];
|
|
186
|
+
export declare interface OwnerPickerUiOptions {
|
|
187
|
+
allowedKinds?: string[];
|
|
122
188
|
}
|
|
189
|
+
|
|
123
190
|
/**
|
|
124
|
-
* The
|
|
191
|
+
* The validation function for the `repoUrl` that is returned from the
|
|
192
|
+
* field extension. Ensures that you have all the required fields filled for
|
|
193
|
+
* the different providers that exist.
|
|
125
194
|
*
|
|
126
195
|
* @public
|
|
127
196
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
197
|
+
export declare const repoPickerValidation: (value: string, validation: FieldValidation, context: {
|
|
198
|
+
apiHolder: ApiHolder;
|
|
199
|
+
}) => void;
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* The field extension which provides the ability to select a RepositoryUrl.
|
|
203
|
+
* Currently this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
export declare const RepoUrlPickerFieldExtension: FieldExtensionComponent<string, RepoUrlPickerUiOptions>;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* The input props that can be specified under `ui:options` for the
|
|
211
|
+
* `RepoUrlPicker` field extension.
|
|
212
|
+
*
|
|
213
|
+
* @public
|
|
214
|
+
*/
|
|
215
|
+
export declare interface RepoUrlPickerUiOptions {
|
|
216
|
+
allowedHosts?: string[];
|
|
217
|
+
allowedOwners?: string[];
|
|
218
|
+
requestUserCredentials?: {
|
|
219
|
+
secretsKey: string;
|
|
220
|
+
additionalScopes?: {
|
|
221
|
+
github?: string[];
|
|
222
|
+
gitlab?: string[];
|
|
223
|
+
bitbucket?: string[];
|
|
224
|
+
azure?: string[];
|
|
225
|
+
};
|
|
226
|
+
};
|
|
131
227
|
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* The props for the entrypoint `ScaffolderPage` component the plugin.
|
|
231
|
+
* @public
|
|
232
|
+
*/
|
|
233
|
+
export declare type RouterProps = {
|
|
234
|
+
components?: {
|
|
235
|
+
TemplateCardComponent?: ComponentType<{
|
|
236
|
+
template: TemplateEntityV1beta3;
|
|
237
|
+
}> | undefined;
|
|
238
|
+
TaskPageComponent?: ComponentType<{}>;
|
|
239
|
+
};
|
|
240
|
+
groups?: Array<{
|
|
241
|
+
title?: React_2.ReactNode;
|
|
242
|
+
filter: (entity: Entity) => boolean;
|
|
243
|
+
}>;
|
|
244
|
+
defaultPreviewTemplate?: string;
|
|
245
|
+
/**
|
|
246
|
+
* Options for the context menu on the scaffolder page.
|
|
247
|
+
*/
|
|
248
|
+
contextMenu?: {
|
|
249
|
+
/** Whether to show a link to the template editor */
|
|
250
|
+
editor?: boolean;
|
|
251
|
+
/** Whether to show a link to the actions documentation */
|
|
252
|
+
actions?: boolean;
|
|
253
|
+
};
|
|
254
|
+
};
|
|
255
|
+
|
|
132
256
|
/**
|
|
133
257
|
* An API to interact with the scaffolder backend.
|
|
134
258
|
*
|
|
135
259
|
* @public
|
|
136
260
|
*/
|
|
137
|
-
interface ScaffolderApi {
|
|
261
|
+
export declare interface ScaffolderApi {
|
|
138
262
|
getTemplateParameterSchema(templateRef: string): Promise<TemplateParameterSchema>;
|
|
139
263
|
/**
|
|
140
264
|
* Executes the scaffolding of a component, given a template and its
|
|
@@ -157,13 +281,14 @@ interface ScaffolderApi {
|
|
|
157
281
|
*
|
|
158
282
|
* @public
|
|
159
283
|
*/
|
|
160
|
-
declare const scaffolderApiRef:
|
|
284
|
+
export declare const scaffolderApiRef: ApiRef<ScaffolderApi>;
|
|
285
|
+
|
|
161
286
|
/**
|
|
162
287
|
* An API to interact with the scaffolder backend.
|
|
163
288
|
*
|
|
164
289
|
* @public
|
|
165
290
|
*/
|
|
166
|
-
declare class ScaffolderClient implements ScaffolderApi {
|
|
291
|
+
export declare class ScaffolderClient implements ScaffolderApi {
|
|
167
292
|
private readonly discoveryApi;
|
|
168
293
|
private readonly scmIntegrationsApi;
|
|
169
294
|
private readonly fetchApi;
|
|
@@ -191,234 +316,169 @@ declare class ScaffolderClient implements ScaffolderApi {
|
|
|
191
316
|
}
|
|
192
317
|
|
|
193
318
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @public
|
|
197
|
-
*/
|
|
198
|
-
declare type CustomFieldValidator<TFieldReturnValue> = (data: TFieldReturnValue, field: FieldValidation, context: {
|
|
199
|
-
apiHolder: ApiHolder;
|
|
200
|
-
}) => void;
|
|
201
|
-
/**
|
|
202
|
-
* Type for the Custom Field Extension with the
|
|
203
|
-
* name and components and validation function.
|
|
204
|
-
*
|
|
205
|
-
* @public
|
|
206
|
-
*/
|
|
207
|
-
declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputProps = unknown> = {
|
|
208
|
-
name: string;
|
|
209
|
-
component: (props: FieldExtensionComponentProps<TFieldReturnValue, TInputProps>) => JSX.Element | null;
|
|
210
|
-
validation?: CustomFieldValidator<TFieldReturnValue>;
|
|
211
|
-
};
|
|
212
|
-
/**
|
|
213
|
-
* Type for field extensions and being able to type
|
|
214
|
-
* incoming props easier.
|
|
319
|
+
* The Wrapping component for defining fields extensions inside
|
|
215
320
|
*
|
|
216
321
|
* @public
|
|
217
322
|
*/
|
|
218
|
-
|
|
219
|
-
uiSchema: FieldProps['uiSchema'] & {
|
|
220
|
-
'ui:options'?: TUiOptions;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
323
|
+
export declare const ScaffolderFieldExtensions: React_2.ComponentType;
|
|
223
324
|
|
|
224
325
|
/**
|
|
225
|
-
* The
|
|
226
|
-
* `RepoUrlPicker` field extension.
|
|
326
|
+
* The arguments for `getIntegrationsList`.
|
|
227
327
|
*
|
|
228
328
|
* @public
|
|
229
329
|
*/
|
|
230
|
-
interface
|
|
231
|
-
allowedHosts
|
|
232
|
-
allowedOwners?: string[];
|
|
233
|
-
requestUserCredentials?: {
|
|
234
|
-
secretsKey: string;
|
|
235
|
-
additionalScopes?: {
|
|
236
|
-
github?: string[];
|
|
237
|
-
gitlab?: string[];
|
|
238
|
-
bitbucket?: string[];
|
|
239
|
-
azure?: string[];
|
|
240
|
-
};
|
|
241
|
-
};
|
|
330
|
+
export declare interface ScaffolderGetIntegrationsListOptions {
|
|
331
|
+
allowedHosts: string[];
|
|
242
332
|
}
|
|
243
333
|
|
|
244
334
|
/**
|
|
245
|
-
* The
|
|
246
|
-
* `EntityTagsPicker` field extension.
|
|
335
|
+
* The response shape for `getIntegrationsList`.
|
|
247
336
|
*
|
|
248
337
|
* @public
|
|
249
338
|
*/
|
|
250
|
-
interface
|
|
251
|
-
|
|
339
|
+
export declare interface ScaffolderGetIntegrationsListResponse {
|
|
340
|
+
integrations: {
|
|
341
|
+
type: string;
|
|
342
|
+
title: string;
|
|
343
|
+
host: string;
|
|
344
|
+
}[];
|
|
252
345
|
}
|
|
253
346
|
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
allowedKinds?: string[];
|
|
262
|
-
defaultKind?: string;
|
|
263
|
-
allowArbitraryValues?: boolean;
|
|
264
|
-
}
|
|
347
|
+
/** @public */
|
|
348
|
+
export declare type ScaffolderOutputLink = {
|
|
349
|
+
title?: string;
|
|
350
|
+
icon?: string;
|
|
351
|
+
url?: string;
|
|
352
|
+
entityRef?: string;
|
|
353
|
+
};
|
|
265
354
|
|
|
266
355
|
/**
|
|
267
|
-
*
|
|
356
|
+
* The Router and main entrypoint to the Scaffolder plugin.
|
|
268
357
|
*
|
|
269
358
|
* @public
|
|
270
359
|
*/
|
|
271
|
-
declare
|
|
272
|
-
|
|
273
|
-
* Method for creating field extensions that can be used in the scaffolder
|
|
274
|
-
* frontend form.
|
|
275
|
-
* @public
|
|
276
|
-
*/
|
|
277
|
-
declare function createScaffolderFieldExtension<TReturnValue = unknown, TInputProps = unknown>(options: FieldExtensionOptions<TReturnValue, TInputProps>): Extension<FieldExtensionComponent<TReturnValue, TInputProps>>;
|
|
360
|
+
export declare const ScaffolderPage: (props: RouterProps) => JSX.Element;
|
|
361
|
+
|
|
278
362
|
/**
|
|
279
|
-
* The
|
|
280
|
-
*
|
|
363
|
+
* The main plugin export for the scaffolder.
|
|
281
364
|
* @public
|
|
282
365
|
*/
|
|
283
|
-
declare const
|
|
366
|
+
export declare const scaffolderPlugin: BackstagePlugin< {
|
|
367
|
+
root: RouteRef<undefined>;
|
|
368
|
+
}, {
|
|
369
|
+
registerComponent: ExternalRouteRef<undefined, true>;
|
|
370
|
+
}>;
|
|
284
371
|
|
|
285
372
|
/**
|
|
286
|
-
* The input
|
|
287
|
-
* `OwnedEntityPicker` field extension.
|
|
373
|
+
* The input options to the `scaffold` method of the `ScaffolderClient`.
|
|
288
374
|
*
|
|
289
375
|
* @public
|
|
290
376
|
*/
|
|
291
|
-
interface
|
|
292
|
-
|
|
293
|
-
|
|
377
|
+
export declare interface ScaffolderScaffoldOptions {
|
|
378
|
+
templateRef: string;
|
|
379
|
+
values: Record<string, JsonValue>;
|
|
380
|
+
secrets?: Record<string, string>;
|
|
294
381
|
}
|
|
295
382
|
|
|
296
383
|
/**
|
|
297
|
-
* The
|
|
298
|
-
* @public
|
|
299
|
-
*/
|
|
300
|
-
declare type RouterProps = {
|
|
301
|
-
components?: {
|
|
302
|
-
TemplateCardComponent?: ComponentType<{
|
|
303
|
-
template: TemplateEntityV1beta3;
|
|
304
|
-
}> | undefined;
|
|
305
|
-
TaskPageComponent?: ComponentType<{}>;
|
|
306
|
-
};
|
|
307
|
-
groups?: Array<{
|
|
308
|
-
title?: React.ReactNode;
|
|
309
|
-
filter: (entity: Entity) => boolean;
|
|
310
|
-
}>;
|
|
311
|
-
defaultPreviewTemplate?: string;
|
|
312
|
-
};
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* The input props that can be specified under `ui:options` for the
|
|
316
|
-
* `OwnerPicker` field extension.
|
|
384
|
+
* The response shape of the `scaffold` method of the `ScaffolderClient`.
|
|
317
385
|
*
|
|
318
386
|
* @public
|
|
319
387
|
*/
|
|
320
|
-
interface
|
|
321
|
-
|
|
388
|
+
export declare interface ScaffolderScaffoldResponse {
|
|
389
|
+
taskId: string;
|
|
322
390
|
}
|
|
323
391
|
|
|
324
392
|
/**
|
|
325
|
-
* The
|
|
326
|
-
* field extension. Ensures that you have all the required fields filled for
|
|
327
|
-
* the different providers that exist.
|
|
393
|
+
* The input options to the `streamLogs` method of the `ScaffolderClient`.
|
|
328
394
|
*
|
|
329
395
|
* @public
|
|
330
396
|
*/
|
|
331
|
-
declare
|
|
332
|
-
|
|
333
|
-
|
|
397
|
+
export declare interface ScaffolderStreamLogsOptions {
|
|
398
|
+
taskId: string;
|
|
399
|
+
after?: number;
|
|
400
|
+
}
|
|
334
401
|
|
|
335
402
|
/**
|
|
336
|
-
* The
|
|
337
|
-
* @public
|
|
338
|
-
*/
|
|
339
|
-
declare const scaffolderPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
340
|
-
root: _backstage_core_plugin_api.RouteRef<undefined>;
|
|
341
|
-
}, {
|
|
342
|
-
registerComponent: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
|
|
343
|
-
}>;
|
|
344
|
-
/**
|
|
345
|
-
* A field extension for selecting an Entity that exists in the Catalog.
|
|
403
|
+
* The shape of each task returned from the `scaffolder-backend`
|
|
346
404
|
*
|
|
347
405
|
* @public
|
|
348
406
|
*/
|
|
349
|
-
declare
|
|
407
|
+
export declare type ScaffolderTask = {
|
|
408
|
+
id: string;
|
|
409
|
+
spec: TaskSpec;
|
|
410
|
+
status: 'failed' | 'completed' | 'processing' | 'open' | 'cancelled';
|
|
411
|
+
lastHeartbeatAt: string;
|
|
412
|
+
createdAt: string;
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
/** @public */
|
|
416
|
+
export declare type ScaffolderTaskOutput = {
|
|
417
|
+
links?: ScaffolderOutputLink[];
|
|
418
|
+
} & {
|
|
419
|
+
[key: string]: unknown;
|
|
420
|
+
};
|
|
421
|
+
|
|
350
422
|
/**
|
|
351
|
-
* The
|
|
423
|
+
* The status of each task in a Scaffolder Job
|
|
352
424
|
*
|
|
353
425
|
* @public
|
|
354
426
|
*/
|
|
355
|
-
declare
|
|
427
|
+
export declare type ScaffolderTaskStatus = 'open' | 'processing' | 'failed' | 'completed' | 'skipped';
|
|
428
|
+
|
|
356
429
|
/**
|
|
357
|
-
* The
|
|
358
|
-
* Currently this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.
|
|
359
|
-
*
|
|
430
|
+
* The return type from the useTemplateSecrets hook.
|
|
360
431
|
* @public
|
|
361
432
|
*/
|
|
362
|
-
declare
|
|
433
|
+
export declare interface ScaffolderUseTemplateSecrets {
|
|
434
|
+
setSecrets: (input: Record<string, string>) => void;
|
|
435
|
+
}
|
|
436
|
+
|
|
363
437
|
/**
|
|
364
|
-
*
|
|
438
|
+
* TaskPage for showing the status of the taskId provided as a param
|
|
439
|
+
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
365
440
|
*
|
|
366
441
|
* @public
|
|
367
442
|
*/
|
|
368
|
-
declare const
|
|
443
|
+
export declare const TaskPage: ({ loadingText }: TaskPageProps) => JSX.Element;
|
|
444
|
+
|
|
369
445
|
/**
|
|
370
|
-
*
|
|
446
|
+
* TaskPageProps for constructing a TaskPage
|
|
447
|
+
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
371
448
|
*
|
|
372
449
|
* @public
|
|
373
450
|
*/
|
|
374
|
-
declare
|
|
451
|
+
export declare type TaskPageProps = {
|
|
452
|
+
loadingText?: string;
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
/* Excluded from this release type: TemplateGroupFilter */
|
|
456
|
+
|
|
375
457
|
/**
|
|
376
|
-
*
|
|
458
|
+
* The shape of each entry of parameters which gets rendered
|
|
459
|
+
* as a separate step in the wizard input
|
|
377
460
|
*
|
|
378
461
|
* @public
|
|
379
462
|
*/
|
|
380
|
-
declare
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
463
|
+
export declare type TemplateParameterSchema = {
|
|
464
|
+
title: string;
|
|
465
|
+
steps: Array<{
|
|
466
|
+
title: string;
|
|
467
|
+
schema: JsonObject;
|
|
468
|
+
}>;
|
|
469
|
+
};
|
|
386
470
|
|
|
387
471
|
/**
|
|
388
472
|
* The component to select the `type` of `Template` that you will see in the table.
|
|
389
473
|
*
|
|
390
474
|
* @public
|
|
391
475
|
*/
|
|
392
|
-
declare const TemplateTypePicker: () => JSX.Element | null;
|
|
476
|
+
export declare const TemplateTypePicker: () => JSX.Element | null;
|
|
393
477
|
|
|
394
|
-
/**
|
|
395
|
-
* The return type from the useTemplateSecrets hook.
|
|
396
|
-
* @public
|
|
397
|
-
*/
|
|
398
|
-
interface ScaffolderUseTemplateSecrets {
|
|
399
|
-
setSecrets: (input: Record<string, string>) => void;
|
|
400
|
-
}
|
|
401
478
|
/**
|
|
402
479
|
* Hook to access the secrets context.
|
|
403
480
|
* @public
|
|
404
481
|
*/
|
|
405
|
-
declare const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* TaskPageProps for constructing a TaskPage
|
|
409
|
-
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
410
|
-
*
|
|
411
|
-
* @public
|
|
412
|
-
*/
|
|
413
|
-
declare type TaskPageProps = {
|
|
414
|
-
loadingText?: string;
|
|
415
|
-
};
|
|
416
|
-
/**
|
|
417
|
-
* TaskPage for showing the status of the taskId provided as a param
|
|
418
|
-
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
419
|
-
*
|
|
420
|
-
* @public
|
|
421
|
-
*/
|
|
422
|
-
declare const TaskPage: ({ loadingText }: TaskPageProps) => JSX.Element;
|
|
482
|
+
export declare const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
|
423
483
|
|
|
424
|
-
export {
|
|
484
|
+
export { }
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { t as EntityNamePickerFieldExtension, q as EntityPickerFieldExtension, u as EntityTagsPickerFieldExtension, N as NextScaffolderPage, w as OwnedEntityPickerFieldExtension, v as OwnerPickerFieldExtension, x as RepoUrlPickerFieldExtension, n as ScaffolderClient, p as ScaffolderFieldExtensions, y as ScaffolderPage, h as TaskPage, T as TemplateTypePicker, o as createScaffolderFieldExtension, l as repoPickerValidation, b as scaffolderApiRef, z as scaffolderPlugin, A as useTemplateSecrets } from './esm/index-e7455fc8.esm.js';
|
|
2
2
|
import '@backstage/catalog-model';
|
|
3
3
|
import '@backstage/core-plugin-api';
|
|
4
4
|
import '@backstage/errors';
|