@backstage/plugin-scaffolder-react 1.1.0 → 1.2.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 +41 -0
- package/alpha/package.json +4 -3
- package/dist/alpha.d.ts +259 -0
- package/dist/alpha.esm.js +851 -0
- package/dist/alpha.esm.js.map +1 -0
- package/dist/index.d.ts +211 -272
- package/dist/index.esm.js +119 -647
- package/dist/index.esm.js.map +1 -1
- package/package.json +41 -23
- package/dist/index.alpha.d.ts +0 -591
- package/dist/index.beta.d.ts +0 -425
package/dist/index.d.ts
CHANGED
|
@@ -1,176 +1,175 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Dispatch } from 'react';
|
|
7
|
-
import { Extension } from '@backstage/core-plugin-api';
|
|
8
|
-
import { FieldProps } from '@rjsf/core';
|
|
9
|
-
import { FieldProps as FieldProps_2 } from '@rjsf/utils';
|
|
10
|
-
import { FieldValidation } from '@rjsf/core';
|
|
11
|
-
import { FieldValidation as FieldValidation_2 } from '@rjsf/utils';
|
|
12
|
-
import { FormProps as FormProps_2 } from '@rjsf/core-v5';
|
|
13
|
-
import { IconComponent } from '@backstage/core-plugin-api';
|
|
14
|
-
import { JsonObject } from '@backstage/types';
|
|
2
|
+
import React$1, { PropsWithChildren } from 'react';
|
|
3
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
4
|
+
import { ApiHolder, Extension } from '@backstage/core-plugin-api';
|
|
5
|
+
import { FieldValidation, FieldProps } from '@rjsf/core';
|
|
15
6
|
import { JSONSchema7 } from 'json-schema';
|
|
16
|
-
import { JsonValue } from '@backstage/types';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { default as React_2 } from 'react';
|
|
20
|
-
import { ReactNode } from 'react';
|
|
21
|
-
import { RJSFSchema } from '@rjsf/utils';
|
|
22
|
-
import { SetStateAction } from 'react';
|
|
23
|
-
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
|
24
|
-
import { TaskStep } from '@backstage/plugin-scaffolder-common';
|
|
25
|
-
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
|
26
|
-
import { UIOptionsType } from '@rjsf/utils';
|
|
27
|
-
import { UiSchema } from '@rjsf/utils';
|
|
7
|
+
import { JsonObject, JsonValue, Observable } from '@backstage/types';
|
|
8
|
+
import { TaskSpec, TaskStep } from '@backstage/plugin-scaffolder-common';
|
|
9
|
+
import { FormProps } from '@rjsf/core-v5';
|
|
28
10
|
|
|
29
11
|
/**
|
|
30
|
-
*
|
|
12
|
+
* Field validation type for Custom Field Extensions.
|
|
31
13
|
*
|
|
32
14
|
* @public
|
|
33
15
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
schema?: {
|
|
38
|
-
input?: JSONSchema7;
|
|
39
|
-
output?: JSONSchema7;
|
|
40
|
-
};
|
|
41
|
-
examples?: ActionExample[];
|
|
42
|
-
};
|
|
43
|
-
|
|
16
|
+
declare type CustomFieldValidator<TFieldReturnValue> = (data: TFieldReturnValue, field: FieldValidation, context: {
|
|
17
|
+
apiHolder: ApiHolder;
|
|
18
|
+
}) => void | Promise<void>;
|
|
44
19
|
/**
|
|
45
|
-
*
|
|
20
|
+
* Type for the Custom Field Extension schema.
|
|
46
21
|
*
|
|
47
22
|
* @public
|
|
48
23
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
24
|
+
declare type CustomFieldExtensionSchema = {
|
|
25
|
+
returnValue: JSONSchema7;
|
|
26
|
+
uiOptions?: JSONSchema7;
|
|
52
27
|
};
|
|
53
|
-
|
|
54
|
-
/* Excluded from this release type: createFieldValidation */
|
|
55
|
-
|
|
56
|
-
/* Excluded from this release type: createNextScaffolderFieldExtension */
|
|
57
|
-
|
|
58
28
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
29
|
+
* Type for the Custom Field Extension with the
|
|
30
|
+
* name and components and validation function.
|
|
31
|
+
*
|
|
61
32
|
* @public
|
|
62
33
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
34
|
+
declare type FieldExtensionOptions<TFieldReturnValue = unknown, TInputProps = unknown> = {
|
|
35
|
+
name: string;
|
|
36
|
+
component: (props: FieldExtensionComponentProps<TFieldReturnValue, TInputProps>) => JSX.Element | null;
|
|
37
|
+
validation?: CustomFieldValidator<TFieldReturnValue>;
|
|
38
|
+
schema?: CustomFieldExtensionSchema;
|
|
39
|
+
};
|
|
65
40
|
/**
|
|
66
|
-
*
|
|
41
|
+
* Type for field extensions and being able to type
|
|
42
|
+
* incoming props easier.
|
|
67
43
|
*
|
|
68
44
|
* @public
|
|
69
45
|
*/
|
|
70
|
-
|
|
46
|
+
interface FieldExtensionComponentProps<TFieldReturnValue, TUiOptions extends {} = {}> extends FieldProps<TFieldReturnValue> {
|
|
47
|
+
uiSchema: FieldProps['uiSchema'] & {
|
|
48
|
+
'ui:options'?: TUiOptions;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
71
51
|
|
|
72
52
|
/**
|
|
73
|
-
*
|
|
53
|
+
* The type used to wrap up the Layout and embed the input props
|
|
74
54
|
*
|
|
75
55
|
* @public
|
|
76
56
|
*/
|
|
77
|
-
|
|
78
|
-
returnValue: JSONSchema7;
|
|
79
|
-
uiOptions?: JSONSchema7;
|
|
80
|
-
};
|
|
81
|
-
|
|
57
|
+
declare type FieldExtensionComponent<_TReturnValue, _TInputProps> = () => null;
|
|
82
58
|
/**
|
|
83
|
-
*
|
|
59
|
+
* Method for creating field extensions that can be used in the scaffolder
|
|
60
|
+
* frontend form.
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
declare function createScaffolderFieldExtension<TReturnValue = unknown, TInputProps = unknown>(options: FieldExtensionOptions<TReturnValue, TInputProps>): Extension<FieldExtensionComponent<TReturnValue, TInputProps>>;
|
|
64
|
+
/**
|
|
65
|
+
* The Wrapping component for defining fields extensions inside
|
|
84
66
|
*
|
|
85
67
|
* @public
|
|
86
68
|
*/
|
|
87
|
-
|
|
88
|
-
apiHolder: ApiHolder;
|
|
89
|
-
}) => void | Promise<void>;
|
|
90
|
-
|
|
91
|
-
/* Excluded from this release type: DefaultTemplateOutputs */
|
|
92
|
-
|
|
93
|
-
/* Excluded from this release type: EmbeddableWorkflow */
|
|
94
|
-
|
|
95
|
-
/* Excluded from this release type: extractSchemaFromStep */
|
|
69
|
+
declare const ScaffolderFieldExtensions: React$1.ComponentType<React$1.PropsWithChildren<{}>>;
|
|
96
70
|
|
|
97
71
|
/**
|
|
98
|
-
* The
|
|
72
|
+
* The shape of each entry of parameters which gets rendered
|
|
73
|
+
* as a separate step in the wizard input
|
|
99
74
|
*
|
|
100
75
|
* @public
|
|
101
76
|
*/
|
|
102
|
-
|
|
77
|
+
declare type TemplateParameterSchema = {
|
|
78
|
+
title: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
steps: Array<{
|
|
81
|
+
title: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
schema: JsonObject;
|
|
84
|
+
}>;
|
|
85
|
+
};
|
|
103
86
|
|
|
104
87
|
/**
|
|
105
|
-
*
|
|
106
|
-
* incoming props easier.
|
|
107
|
-
*
|
|
88
|
+
* The Context Provider that holds the state for the secrets.
|
|
108
89
|
* @public
|
|
109
90
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
91
|
+
declare const SecretsContextProvider: ({ children }: PropsWithChildren<{}>) => JSX.Element;
|
|
92
|
+
/**
|
|
93
|
+
* The return type from the useTemplateSecrets hook.
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
interface ScaffolderUseTemplateSecrets {
|
|
97
|
+
setSecrets: (input: Record<string, string>) => void;
|
|
98
|
+
secrets: Record<string, string>;
|
|
114
99
|
}
|
|
115
|
-
|
|
116
100
|
/**
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
101
|
+
* Hook to access the secrets context to be able to set secrets that are
|
|
102
|
+
* passed to the Scaffolder backend.
|
|
120
103
|
* @public
|
|
121
104
|
*/
|
|
122
|
-
|
|
123
|
-
name: string;
|
|
124
|
-
component: (props: FieldExtensionComponentProps<TFieldReturnValue, TInputProps>) => JSX.Element | null;
|
|
125
|
-
validation?: CustomFieldValidator<TFieldReturnValue>;
|
|
126
|
-
schema?: CustomFieldExtensionSchema;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
/* Excluded from this release type: Form */
|
|
105
|
+
declare const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
|
130
106
|
|
|
131
107
|
/**
|
|
132
|
-
*
|
|
108
|
+
* The status of each task in a Scaffolder Job
|
|
133
109
|
*
|
|
134
110
|
* @public
|
|
135
111
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
112
|
+
declare type ScaffolderTaskStatus = 'open' | 'processing' | 'failed' | 'completed' | 'skipped';
|
|
138
113
|
/**
|
|
139
|
-
*
|
|
114
|
+
* The shape of each task returned from the `scaffolder-backend`
|
|
115
|
+
*
|
|
140
116
|
* @public
|
|
141
117
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
118
|
+
declare type ScaffolderTask = {
|
|
119
|
+
id: string;
|
|
120
|
+
spec: TaskSpec;
|
|
121
|
+
status: 'failed' | 'completed' | 'processing' | 'open' | 'cancelled';
|
|
122
|
+
lastHeartbeatAt: string;
|
|
123
|
+
createdAt: string;
|
|
124
|
+
};
|
|
144
125
|
/**
|
|
145
|
-
*
|
|
126
|
+
* A single action example
|
|
146
127
|
*
|
|
147
128
|
* @public
|
|
148
129
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
|
|
130
|
+
declare type ActionExample = {
|
|
131
|
+
description: string;
|
|
132
|
+
example: string;
|
|
133
|
+
};
|
|
154
134
|
/**
|
|
155
|
-
* The
|
|
135
|
+
* The response shape for a single action in the `listActions` call to the `scaffolder-backend`
|
|
156
136
|
*
|
|
157
137
|
* @public
|
|
158
138
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
139
|
+
declare type Action = {
|
|
140
|
+
id: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
schema?: {
|
|
143
|
+
input?: JSONSchema7;
|
|
144
|
+
output?: JSONSchema7;
|
|
145
|
+
};
|
|
146
|
+
examples?: ActionExample[];
|
|
147
|
+
};
|
|
161
148
|
/**
|
|
162
149
|
* The response shape for the `listActions` call to the `scaffolder-backend`
|
|
163
150
|
*
|
|
164
151
|
* @public
|
|
165
152
|
*/
|
|
166
|
-
|
|
167
|
-
|
|
153
|
+
declare type ListActionsResponse = Array<Action>;
|
|
154
|
+
/** @public */
|
|
155
|
+
declare type ScaffolderOutputLink = {
|
|
156
|
+
title?: string;
|
|
157
|
+
icon?: string;
|
|
158
|
+
url?: string;
|
|
159
|
+
entityRef?: string;
|
|
160
|
+
};
|
|
161
|
+
/** @public */
|
|
162
|
+
declare type ScaffolderTaskOutput = {
|
|
163
|
+
links?: ScaffolderOutputLink[];
|
|
164
|
+
} & {
|
|
165
|
+
[key: string]: unknown;
|
|
166
|
+
};
|
|
168
167
|
/**
|
|
169
168
|
* The shape of a `LogEvent` message from the `scaffolder-backend`
|
|
170
169
|
*
|
|
171
170
|
* @public
|
|
172
171
|
*/
|
|
173
|
-
|
|
172
|
+
declare type LogEvent = {
|
|
174
173
|
type: 'log' | 'completion';
|
|
175
174
|
body: {
|
|
176
175
|
message: string;
|
|
@@ -181,245 +180,185 @@ export declare type LogEvent = {
|
|
|
181
180
|
id: string;
|
|
182
181
|
taskId: string;
|
|
183
182
|
};
|
|
184
|
-
|
|
185
|
-
/* Excluded from this release type: NextCustomFieldValidator */
|
|
186
|
-
|
|
187
|
-
/* Excluded from this release type: NextFieldExtensionComponentProps */
|
|
188
|
-
|
|
189
|
-
/* Excluded from this release type: NextFieldExtensionOptions */
|
|
190
|
-
|
|
191
|
-
/* Excluded from this release type: ParsedTemplateSchema */
|
|
192
|
-
|
|
193
|
-
/* Excluded from this release type: ReviewState */
|
|
194
|
-
|
|
195
|
-
/* Excluded from this release type: ReviewStateProps */
|
|
196
|
-
|
|
197
183
|
/**
|
|
198
|
-
*
|
|
184
|
+
* The input options to the `scaffold` method of the `ScaffolderClient`.
|
|
199
185
|
*
|
|
200
186
|
* @public
|
|
201
187
|
*/
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
* Executes the scaffolding of a component, given a template and its
|
|
206
|
-
* parameter values.
|
|
207
|
-
*
|
|
208
|
-
* @param options - The {@link ScaffolderScaffoldOptions} the scaffolding.
|
|
209
|
-
*/
|
|
210
|
-
scaffold(options: ScaffolderScaffoldOptions): Promise<ScaffolderScaffoldResponse>;
|
|
211
|
-
getTask(taskId: string): Promise<ScaffolderTask>;
|
|
212
|
-
listTasks?(options: {
|
|
213
|
-
filterByOwnership: 'owned' | 'all';
|
|
214
|
-
}): Promise<{
|
|
215
|
-
tasks: ScaffolderTask[];
|
|
216
|
-
}>;
|
|
217
|
-
getIntegrationsList(options: ScaffolderGetIntegrationsListOptions): Promise<ScaffolderGetIntegrationsListResponse>;
|
|
218
|
-
/**
|
|
219
|
-
* Returns a list of all installed actions.
|
|
220
|
-
*/
|
|
221
|
-
listActions(): Promise<ListActionsResponse>;
|
|
222
|
-
streamLogs(options: ScaffolderStreamLogsOptions): Observable<LogEvent>;
|
|
223
|
-
dryRun?(options: ScaffolderDryRunOptions): Promise<ScaffolderDryRunResponse>;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/** @public */
|
|
227
|
-
export declare const scaffolderApiRef: ApiRef<ScaffolderApi>;
|
|
228
|
-
|
|
229
|
-
/** @public */
|
|
230
|
-
export declare interface ScaffolderDryRunOptions {
|
|
231
|
-
template: JsonValue;
|
|
232
|
-
values: JsonObject;
|
|
188
|
+
interface ScaffolderScaffoldOptions {
|
|
189
|
+
templateRef: string;
|
|
190
|
+
values: Record<string, JsonValue>;
|
|
233
191
|
secrets?: Record<string, string>;
|
|
234
|
-
directoryContents: {
|
|
235
|
-
path: string;
|
|
236
|
-
base64Content: string;
|
|
237
|
-
}[];
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/** @public */
|
|
241
|
-
export declare interface ScaffolderDryRunResponse {
|
|
242
|
-
directoryContents: Array<{
|
|
243
|
-
path: string;
|
|
244
|
-
base64Content: string;
|
|
245
|
-
executable: boolean;
|
|
246
|
-
}>;
|
|
247
|
-
log: Array<Pick<LogEvent, 'body'>>;
|
|
248
|
-
steps: TaskStep[];
|
|
249
|
-
output: ScaffolderTaskOutput;
|
|
250
192
|
}
|
|
251
|
-
|
|
252
193
|
/**
|
|
253
|
-
* The
|
|
194
|
+
* The response shape of the `scaffold` method of the `ScaffolderClient`.
|
|
254
195
|
*
|
|
255
196
|
* @public
|
|
256
197
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
198
|
+
interface ScaffolderScaffoldResponse {
|
|
199
|
+
taskId: string;
|
|
200
|
+
}
|
|
259
201
|
/**
|
|
260
202
|
* The arguments for `getIntegrationsList`.
|
|
261
203
|
*
|
|
262
204
|
* @public
|
|
263
205
|
*/
|
|
264
|
-
|
|
206
|
+
interface ScaffolderGetIntegrationsListOptions {
|
|
265
207
|
allowedHosts: string[];
|
|
266
208
|
}
|
|
267
|
-
|
|
268
209
|
/**
|
|
269
210
|
* The response shape for `getIntegrationsList`.
|
|
270
211
|
*
|
|
271
212
|
* @public
|
|
272
213
|
*/
|
|
273
|
-
|
|
214
|
+
interface ScaffolderGetIntegrationsListResponse {
|
|
274
215
|
integrations: {
|
|
275
216
|
type: string;
|
|
276
217
|
title: string;
|
|
277
218
|
host: string;
|
|
278
219
|
}[];
|
|
279
220
|
}
|
|
280
|
-
|
|
281
221
|
/**
|
|
282
|
-
* The
|
|
222
|
+
* The input options to the `streamLogs` method of the `ScaffolderClient`.
|
|
283
223
|
*
|
|
284
224
|
* @public
|
|
285
225
|
*/
|
|
286
|
-
|
|
287
|
-
|
|
226
|
+
interface ScaffolderStreamLogsOptions {
|
|
227
|
+
taskId: string;
|
|
228
|
+
after?: number;
|
|
229
|
+
}
|
|
288
230
|
/** @public */
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
url?: string;
|
|
293
|
-
entityRef?: string;
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* The input options to the `scaffold` method of the `ScaffolderClient`.
|
|
298
|
-
*
|
|
299
|
-
* @public
|
|
300
|
-
*/
|
|
301
|
-
export declare interface ScaffolderScaffoldOptions {
|
|
302
|
-
templateRef: string;
|
|
303
|
-
values: Record<string, JsonValue>;
|
|
231
|
+
interface ScaffolderDryRunOptions {
|
|
232
|
+
template: JsonValue;
|
|
233
|
+
values: JsonObject;
|
|
304
234
|
secrets?: Record<string, string>;
|
|
235
|
+
directoryContents: {
|
|
236
|
+
path: string;
|
|
237
|
+
base64Content: string;
|
|
238
|
+
}[];
|
|
239
|
+
}
|
|
240
|
+
/** @public */
|
|
241
|
+
interface ScaffolderDryRunResponse {
|
|
242
|
+
directoryContents: Array<{
|
|
243
|
+
path: string;
|
|
244
|
+
base64Content: string;
|
|
245
|
+
executable: boolean;
|
|
246
|
+
}>;
|
|
247
|
+
log: Array<Pick<LogEvent, 'body'>>;
|
|
248
|
+
steps: TaskStep[];
|
|
249
|
+
output: ScaffolderTaskOutput;
|
|
305
250
|
}
|
|
306
|
-
|
|
307
251
|
/**
|
|
308
|
-
*
|
|
252
|
+
* An API to interact with the scaffolder backend.
|
|
309
253
|
*
|
|
310
254
|
* @public
|
|
311
255
|
*/
|
|
312
|
-
|
|
313
|
-
|
|
256
|
+
interface ScaffolderApi {
|
|
257
|
+
getTemplateParameterSchema(templateRef: string): Promise<TemplateParameterSchema>;
|
|
258
|
+
/**
|
|
259
|
+
* Executes the scaffolding of a component, given a template and its
|
|
260
|
+
* parameter values.
|
|
261
|
+
*
|
|
262
|
+
* @param options - The {@link ScaffolderScaffoldOptions} the scaffolding.
|
|
263
|
+
*/
|
|
264
|
+
scaffold(options: ScaffolderScaffoldOptions): Promise<ScaffolderScaffoldResponse>;
|
|
265
|
+
getTask(taskId: string): Promise<ScaffolderTask>;
|
|
266
|
+
listTasks?(options: {
|
|
267
|
+
filterByOwnership: 'owned' | 'all';
|
|
268
|
+
}): Promise<{
|
|
269
|
+
tasks: ScaffolderTask[];
|
|
270
|
+
}>;
|
|
271
|
+
getIntegrationsList(options: ScaffolderGetIntegrationsListOptions): Promise<ScaffolderGetIntegrationsListResponse>;
|
|
272
|
+
/**
|
|
273
|
+
* Returns a list of all installed actions.
|
|
274
|
+
*/
|
|
275
|
+
listActions(): Promise<ListActionsResponse>;
|
|
276
|
+
streamLogs(options: ScaffolderStreamLogsOptions): Observable<LogEvent>;
|
|
277
|
+
dryRun?(options: ScaffolderDryRunOptions): Promise<ScaffolderDryRunResponse>;
|
|
314
278
|
}
|
|
315
279
|
|
|
280
|
+
/** @public */
|
|
281
|
+
declare const scaffolderApiRef: _backstage_core_plugin_api.ApiRef<ScaffolderApi>;
|
|
282
|
+
|
|
316
283
|
/**
|
|
317
|
-
*
|
|
318
|
-
*
|
|
284
|
+
* Hook that returns all custom field extensions from the current outlet.
|
|
319
285
|
* @public
|
|
320
286
|
*/
|
|
321
|
-
|
|
322
|
-
taskId: string;
|
|
323
|
-
after?: number;
|
|
324
|
-
}
|
|
287
|
+
declare const useCustomFieldExtensions: <TComponentDataType = FieldExtensionOptions<unknown, unknown>>(outlet: React.ReactNode) => TComponentDataType[];
|
|
325
288
|
|
|
326
289
|
/**
|
|
327
|
-
* The
|
|
290
|
+
* The field template from `@rjsf/core` which is a react component that gets passed `@rjsf/core` field related props.
|
|
328
291
|
*
|
|
329
292
|
* @public
|
|
330
293
|
*/
|
|
331
|
-
|
|
332
|
-
id: string;
|
|
333
|
-
spec: TaskSpec;
|
|
334
|
-
status: 'failed' | 'completed' | 'processing' | 'open' | 'cancelled';
|
|
335
|
-
lastHeartbeatAt: string;
|
|
336
|
-
createdAt: string;
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
/** @public */
|
|
340
|
-
export declare type ScaffolderTaskOutput = {
|
|
341
|
-
links?: ScaffolderOutputLink[];
|
|
342
|
-
} & {
|
|
343
|
-
[key: string]: unknown;
|
|
344
|
-
};
|
|
345
|
-
|
|
294
|
+
declare type LayoutTemplate<T = any> = NonNullable<FormProps<T>['uiSchema']>['ui:ObjectFieldTemplate'];
|
|
346
295
|
/**
|
|
347
|
-
* The
|
|
296
|
+
* The type of layouts that is passed to the TemplateForms
|
|
348
297
|
*
|
|
349
298
|
* @public
|
|
350
299
|
*/
|
|
351
|
-
|
|
352
|
-
|
|
300
|
+
interface LayoutOptions<P = any> {
|
|
301
|
+
name: string;
|
|
302
|
+
component: LayoutTemplate<P>;
|
|
303
|
+
}
|
|
353
304
|
/**
|
|
354
|
-
*
|
|
305
|
+
* A type used to wrap up the FieldExtension to embed the ReturnValue and the InputProps
|
|
355
306
|
* @public
|
|
356
307
|
*/
|
|
357
|
-
|
|
358
|
-
setSecrets: (input: Record<string, string>) => void;
|
|
359
|
-
secrets: Record<string, string>;
|
|
360
|
-
}
|
|
361
|
-
|
|
308
|
+
declare type LayoutComponent<_TInputProps> = () => null;
|
|
362
309
|
/**
|
|
363
|
-
*
|
|
310
|
+
* Method for creating custom Layouts that can be used in the scaffolder frontend form
|
|
311
|
+
*
|
|
364
312
|
* @public
|
|
365
313
|
*/
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
/* Excluded from this release type: Stepper */
|
|
369
|
-
|
|
370
|
-
/* Excluded from this release type: StepperProps */
|
|
371
|
-
|
|
372
|
-
/* Excluded from this release type: TemplateCard */
|
|
373
|
-
|
|
374
|
-
/* Excluded from this release type: TemplateCardProps */
|
|
375
|
-
|
|
376
|
-
/* Excluded from this release type: TemplateGroup */
|
|
377
|
-
|
|
378
|
-
/* Excluded from this release type: TemplateGroupProps */
|
|
379
|
-
|
|
314
|
+
declare function createScaffolderLayout<TInputProps = unknown>(options: LayoutOptions): Extension<LayoutComponent<TInputProps>>;
|
|
380
315
|
/**
|
|
381
|
-
* The
|
|
382
|
-
* as a separate step in the wizard input
|
|
316
|
+
* The wrapping component for defining scaffolder layouts as children
|
|
383
317
|
*
|
|
384
318
|
* @public
|
|
385
319
|
*/
|
|
386
|
-
|
|
387
|
-
title: string;
|
|
388
|
-
description?: string;
|
|
389
|
-
steps: Array<{
|
|
390
|
-
title: string;
|
|
391
|
-
description?: string;
|
|
392
|
-
schema: JsonObject;
|
|
393
|
-
}>;
|
|
394
|
-
};
|
|
320
|
+
declare const ScaffolderLayouts: React.ComponentType;
|
|
395
321
|
|
|
396
322
|
/**
|
|
397
323
|
* Hook that returns all custom field extensions from the current outlet.
|
|
398
324
|
* @public
|
|
399
325
|
*/
|
|
400
|
-
|
|
326
|
+
declare const useCustomLayouts: <TComponentDataType = LayoutOptions<any>>(outlet: React.ReactNode) => TComponentDataType[];
|
|
401
327
|
|
|
402
328
|
/**
|
|
403
|
-
*
|
|
329
|
+
* The status of the step being processed
|
|
330
|
+
*
|
|
404
331
|
* @public
|
|
405
332
|
*/
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
/* Excluded from this release type: useTemplateSchema */
|
|
413
|
-
|
|
333
|
+
declare type ScaffolderStep = {
|
|
334
|
+
id: string;
|
|
335
|
+
status: ScaffolderTaskStatus;
|
|
336
|
+
endedAt?: string;
|
|
337
|
+
startedAt?: string;
|
|
338
|
+
};
|
|
414
339
|
/**
|
|
415
|
-
*
|
|
416
|
-
*
|
|
340
|
+
* A task event from the event stream
|
|
341
|
+
*
|
|
417
342
|
* @public
|
|
418
343
|
*/
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
344
|
+
declare type TaskStream = {
|
|
345
|
+
loading: boolean;
|
|
346
|
+
error?: Error;
|
|
347
|
+
stepLogs: {
|
|
348
|
+
[stepId in string]: string[];
|
|
349
|
+
};
|
|
350
|
+
completed: boolean;
|
|
351
|
+
task?: ScaffolderTask;
|
|
352
|
+
steps: {
|
|
353
|
+
[stepId in string]: ScaffolderStep;
|
|
354
|
+
};
|
|
355
|
+
output?: ScaffolderTaskOutput;
|
|
356
|
+
};
|
|
357
|
+
/**
|
|
358
|
+
* A hook to stream the logs of a task being processed
|
|
359
|
+
*
|
|
360
|
+
* @public
|
|
361
|
+
*/
|
|
362
|
+
declare const useTaskEventStream: (taskId: string) => TaskStream;
|
|
424
363
|
|
|
425
|
-
export { }
|
|
364
|
+
export { Action, ActionExample, CustomFieldExtensionSchema, CustomFieldValidator, FieldExtensionComponent, FieldExtensionComponentProps, FieldExtensionOptions, LayoutComponent, LayoutOptions, LayoutTemplate, ListActionsResponse, LogEvent, ScaffolderApi, ScaffolderDryRunOptions, ScaffolderDryRunResponse, ScaffolderFieldExtensions, ScaffolderGetIntegrationsListOptions, ScaffolderGetIntegrationsListResponse, ScaffolderLayouts, ScaffolderOutputLink, ScaffolderScaffoldOptions, ScaffolderScaffoldResponse, ScaffolderStep, ScaffolderStreamLogsOptions, ScaffolderTask, ScaffolderTaskOutput, ScaffolderTaskStatus, ScaffolderUseTemplateSecrets, SecretsContextProvider, TaskStream, TemplateParameterSchema, createScaffolderFieldExtension, createScaffolderLayout, scaffolderApiRef, useCustomFieldExtensions, useCustomLayouts, useTaskEventStream, useTemplateSecrets };
|