@backstage/plugin-scaffolder 1.0.0 → 1.0.1-next.2
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 +43 -0
- package/README.md +1 -2
- package/alpha/package.json +6 -0
- package/dist/esm/{Router-773d053b.esm.js → Router-9a3e085b.esm.js} +6 -32
- package/dist/esm/Router-9a3e085b.esm.js.map +1 -0
- package/dist/esm/default-4cf122e1.esm.js +33 -0
- package/dist/esm/default-4cf122e1.esm.js.map +1 -0
- package/dist/esm/{index-25fdb62e.esm.js → index-ae0b91e4.esm.js} +8 -3
- package/dist/esm/index-ae0b91e4.esm.js.map +1 -0
- package/dist/esm/index-d6a70531.esm.js +338 -0
- package/dist/esm/index-d6a70531.esm.js.map +1 -0
- package/dist/index.alpha.d.ts +498 -0
- package/dist/index.beta.d.ts +475 -0
- package/dist/index.d.ts +277 -226
- package/dist/index.esm.js +1 -1
- package/package.json +22 -20
- 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,109 @@ 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
|
+
|
|
132
247
|
/**
|
|
133
248
|
* An API to interact with the scaffolder backend.
|
|
134
249
|
*
|
|
135
250
|
* @public
|
|
136
251
|
*/
|
|
137
|
-
interface ScaffolderApi {
|
|
252
|
+
export declare interface ScaffolderApi {
|
|
138
253
|
getTemplateParameterSchema(templateRef: string): Promise<TemplateParameterSchema>;
|
|
139
254
|
/**
|
|
140
255
|
* Executes the scaffolding of a component, given a template and its
|
|
@@ -157,13 +272,14 @@ interface ScaffolderApi {
|
|
|
157
272
|
*
|
|
158
273
|
* @public
|
|
159
274
|
*/
|
|
160
|
-
declare const scaffolderApiRef:
|
|
275
|
+
export declare const scaffolderApiRef: ApiRef<ScaffolderApi>;
|
|
276
|
+
|
|
161
277
|
/**
|
|
162
278
|
* An API to interact with the scaffolder backend.
|
|
163
279
|
*
|
|
164
280
|
* @public
|
|
165
281
|
*/
|
|
166
|
-
declare class ScaffolderClient implements ScaffolderApi {
|
|
282
|
+
export declare class ScaffolderClient implements ScaffolderApi {
|
|
167
283
|
private readonly discoveryApi;
|
|
168
284
|
private readonly scmIntegrationsApi;
|
|
169
285
|
private readonly fetchApi;
|
|
@@ -191,234 +307,169 @@ declare class ScaffolderClient implements ScaffolderApi {
|
|
|
191
307
|
}
|
|
192
308
|
|
|
193
309
|
/**
|
|
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.
|
|
310
|
+
* The Wrapping component for defining fields extensions inside
|
|
215
311
|
*
|
|
216
312
|
* @public
|
|
217
313
|
*/
|
|
218
|
-
|
|
219
|
-
uiSchema: FieldProps['uiSchema'] & {
|
|
220
|
-
'ui:options'?: TUiOptions;
|
|
221
|
-
};
|
|
222
|
-
}
|
|
314
|
+
export declare const ScaffolderFieldExtensions: React_2.ComponentType;
|
|
223
315
|
|
|
224
316
|
/**
|
|
225
|
-
* The
|
|
226
|
-
* `RepoUrlPicker` field extension.
|
|
317
|
+
* The arguments for `getIntegrationsList`.
|
|
227
318
|
*
|
|
228
319
|
* @public
|
|
229
320
|
*/
|
|
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
|
-
};
|
|
321
|
+
export declare interface ScaffolderGetIntegrationsListOptions {
|
|
322
|
+
allowedHosts: string[];
|
|
242
323
|
}
|
|
243
324
|
|
|
244
325
|
/**
|
|
245
|
-
* The
|
|
246
|
-
* `EntityTagsPicker` field extension.
|
|
326
|
+
* The response shape for `getIntegrationsList`.
|
|
247
327
|
*
|
|
248
328
|
* @public
|
|
249
329
|
*/
|
|
250
|
-
interface
|
|
251
|
-
|
|
330
|
+
export declare interface ScaffolderGetIntegrationsListResponse {
|
|
331
|
+
integrations: {
|
|
332
|
+
type: string;
|
|
333
|
+
title: string;
|
|
334
|
+
host: string;
|
|
335
|
+
}[];
|
|
252
336
|
}
|
|
253
337
|
|
|
254
|
-
/**
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
allowedKinds?: string[];
|
|
262
|
-
defaultKind?: string;
|
|
263
|
-
allowArbitraryValues?: boolean;
|
|
264
|
-
}
|
|
338
|
+
/** @public */
|
|
339
|
+
export declare type ScaffolderOutputLink = {
|
|
340
|
+
title?: string;
|
|
341
|
+
icon?: string;
|
|
342
|
+
url?: string;
|
|
343
|
+
entityRef?: string;
|
|
344
|
+
};
|
|
265
345
|
|
|
266
346
|
/**
|
|
267
|
-
*
|
|
347
|
+
* The Router and main entrypoint to the Scaffolder plugin.
|
|
268
348
|
*
|
|
269
349
|
* @public
|
|
270
350
|
*/
|
|
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>>;
|
|
351
|
+
export declare const ScaffolderPage: (props: RouterProps) => JSX.Element;
|
|
352
|
+
|
|
278
353
|
/**
|
|
279
|
-
* The
|
|
280
|
-
*
|
|
354
|
+
* The main plugin export for the scaffolder.
|
|
281
355
|
* @public
|
|
282
356
|
*/
|
|
283
|
-
declare const
|
|
357
|
+
export declare const scaffolderPlugin: BackstagePlugin< {
|
|
358
|
+
root: RouteRef<undefined>;
|
|
359
|
+
}, {
|
|
360
|
+
registerComponent: ExternalRouteRef<undefined, true>;
|
|
361
|
+
}>;
|
|
284
362
|
|
|
285
363
|
/**
|
|
286
|
-
* The input
|
|
287
|
-
* `OwnedEntityPicker` field extension.
|
|
364
|
+
* The input options to the `scaffold` method of the `ScaffolderClient`.
|
|
288
365
|
*
|
|
289
366
|
* @public
|
|
290
367
|
*/
|
|
291
|
-
interface
|
|
292
|
-
|
|
293
|
-
|
|
368
|
+
export declare interface ScaffolderScaffoldOptions {
|
|
369
|
+
templateRef: string;
|
|
370
|
+
values: Record<string, JsonValue>;
|
|
371
|
+
secrets?: Record<string, string>;
|
|
294
372
|
}
|
|
295
373
|
|
|
296
374
|
/**
|
|
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.
|
|
375
|
+
* The response shape of the `scaffold` method of the `ScaffolderClient`.
|
|
317
376
|
*
|
|
318
377
|
* @public
|
|
319
378
|
*/
|
|
320
|
-
interface
|
|
321
|
-
|
|
379
|
+
export declare interface ScaffolderScaffoldResponse {
|
|
380
|
+
taskId: string;
|
|
322
381
|
}
|
|
323
382
|
|
|
324
383
|
/**
|
|
325
|
-
* The
|
|
326
|
-
* field extension. Ensures that you have all the required fields filled for
|
|
327
|
-
* the different providers that exist.
|
|
384
|
+
* The input options to the `streamLogs` method of the `ScaffolderClient`.
|
|
328
385
|
*
|
|
329
386
|
* @public
|
|
330
387
|
*/
|
|
331
|
-
declare
|
|
332
|
-
|
|
333
|
-
|
|
388
|
+
export declare interface ScaffolderStreamLogsOptions {
|
|
389
|
+
taskId: string;
|
|
390
|
+
after?: number;
|
|
391
|
+
}
|
|
334
392
|
|
|
335
393
|
/**
|
|
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.
|
|
394
|
+
* The shape of each task returned from the `scaffolder-backend`
|
|
346
395
|
*
|
|
347
396
|
* @public
|
|
348
397
|
*/
|
|
349
|
-
declare
|
|
398
|
+
export declare type ScaffolderTask = {
|
|
399
|
+
id: string;
|
|
400
|
+
spec: TaskSpec;
|
|
401
|
+
status: 'failed' | 'completed' | 'processing' | 'open' | 'cancelled';
|
|
402
|
+
lastHeartbeatAt: string;
|
|
403
|
+
createdAt: string;
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
/** @public */
|
|
407
|
+
export declare type ScaffolderTaskOutput = {
|
|
408
|
+
links?: ScaffolderOutputLink[];
|
|
409
|
+
} & {
|
|
410
|
+
[key: string]: unknown;
|
|
411
|
+
};
|
|
412
|
+
|
|
350
413
|
/**
|
|
351
|
-
* The
|
|
414
|
+
* The status of each task in a Scaffolder Job
|
|
352
415
|
*
|
|
353
416
|
* @public
|
|
354
417
|
*/
|
|
355
|
-
declare
|
|
418
|
+
export declare type ScaffolderTaskStatus = 'open' | 'processing' | 'failed' | 'completed' | 'skipped';
|
|
419
|
+
|
|
356
420
|
/**
|
|
357
|
-
* The
|
|
358
|
-
* Currently this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.
|
|
359
|
-
*
|
|
421
|
+
* The return type from the useTemplateSecrets hook.
|
|
360
422
|
* @public
|
|
361
423
|
*/
|
|
362
|
-
declare
|
|
424
|
+
export declare interface ScaffolderUseTemplateSecrets {
|
|
425
|
+
setSecrets: (input: Record<string, string>) => void;
|
|
426
|
+
}
|
|
427
|
+
|
|
363
428
|
/**
|
|
364
|
-
*
|
|
429
|
+
* TaskPage for showing the status of the taskId provided as a param
|
|
430
|
+
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
365
431
|
*
|
|
366
432
|
* @public
|
|
367
433
|
*/
|
|
368
|
-
declare const
|
|
434
|
+
export declare const TaskPage: ({ loadingText }: TaskPageProps) => JSX.Element;
|
|
435
|
+
|
|
369
436
|
/**
|
|
370
|
-
*
|
|
437
|
+
* TaskPageProps for constructing a TaskPage
|
|
438
|
+
* @param loadingText - Optional loading text shown before a task begins executing.
|
|
371
439
|
*
|
|
372
440
|
* @public
|
|
373
441
|
*/
|
|
374
|
-
declare
|
|
442
|
+
export declare type TaskPageProps = {
|
|
443
|
+
loadingText?: string;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
/* Excluded from this release type: TemplateGroupFilter */
|
|
447
|
+
|
|
375
448
|
/**
|
|
376
|
-
*
|
|
449
|
+
* The shape of each entry of parameters which gets rendered
|
|
450
|
+
* as a separate step in the wizard input
|
|
377
451
|
*
|
|
378
452
|
* @public
|
|
379
453
|
*/
|
|
380
|
-
declare
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
454
|
+
export declare type TemplateParameterSchema = {
|
|
455
|
+
title: string;
|
|
456
|
+
steps: Array<{
|
|
457
|
+
title: string;
|
|
458
|
+
schema: JsonObject;
|
|
459
|
+
}>;
|
|
460
|
+
};
|
|
386
461
|
|
|
387
462
|
/**
|
|
388
463
|
* The component to select the `type` of `Template` that you will see in the table.
|
|
389
464
|
*
|
|
390
465
|
* @public
|
|
391
466
|
*/
|
|
392
|
-
declare const TemplateTypePicker: () => JSX.Element | null;
|
|
467
|
+
export declare const TemplateTypePicker: () => JSX.Element | null;
|
|
393
468
|
|
|
394
|
-
/**
|
|
395
|
-
* The return type from the useTemplateSecrets hook.
|
|
396
|
-
* @public
|
|
397
|
-
*/
|
|
398
|
-
interface ScaffolderUseTemplateSecrets {
|
|
399
|
-
setSecrets: (input: Record<string, string>) => void;
|
|
400
|
-
}
|
|
401
469
|
/**
|
|
402
470
|
* Hook to access the secrets context.
|
|
403
471
|
* @public
|
|
404
472
|
*/
|
|
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;
|
|
473
|
+
export declare const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
|
423
474
|
|
|
424
|
-
export {
|
|
475
|
+
export { }
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { p as EntityNamePickerFieldExtension, o as EntityPickerFieldExtension, q as EntityTagsPickerFieldExtension, u as OwnedEntityPickerFieldExtension, t as OwnerPickerFieldExtension, v as RepoUrlPickerFieldExtension, l as ScaffolderClient, n as ScaffolderFieldExtensions, w as ScaffolderPage,
|
|
1
|
+
export { p as EntityNamePickerFieldExtension, o as EntityPickerFieldExtension, q as EntityTagsPickerFieldExtension, N as NextScaffolderPage, u as OwnedEntityPickerFieldExtension, t as OwnerPickerFieldExtension, v as RepoUrlPickerFieldExtension, l as ScaffolderClient, n as ScaffolderFieldExtensions, w as ScaffolderPage, f as TaskPage, T as TemplateTypePicker, m as createScaffolderFieldExtension, j as repoPickerValidation, a as scaffolderApiRef, x as scaffolderPlugin, y as useTemplateSecrets } from './esm/index-ae0b91e4.esm.js';
|
|
2
2
|
import '@backstage/catalog-model';
|
|
3
3
|
import '@backstage/core-plugin-api';
|
|
4
4
|
import '@backstage/errors';
|