Skip to content

Commit d09d5fc

Browse files
author
awstools
committed
feat(client-amplifyuibuilder): Amplify Studio UIBuilder is introducing forms functionality. Forms can be configured from Data Store models, JSON, or from scratch. These forms can then be generated in your project and used like any other React components.
1 parent 272b997 commit d09d5fc

17 files changed

+5240
-194
lines changed

clients/client-amplifyuibuilder/src/AmplifyUIBuilder.ts

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import {
77
CreateComponentCommandInput,
88
CreateComponentCommandOutput,
99
} from "./commands/CreateComponentCommand";
10+
import { CreateFormCommand, CreateFormCommandInput, CreateFormCommandOutput } from "./commands/CreateFormCommand";
1011
import { CreateThemeCommand, CreateThemeCommandInput, CreateThemeCommandOutput } from "./commands/CreateThemeCommand";
1112
import {
1213
DeleteComponentCommand,
1314
DeleteComponentCommandInput,
1415
DeleteComponentCommandOutput,
1516
} from "./commands/DeleteComponentCommand";
17+
import { DeleteFormCommand, DeleteFormCommandInput, DeleteFormCommandOutput } from "./commands/DeleteFormCommand";
1618
import { DeleteThemeCommand, DeleteThemeCommandInput, DeleteThemeCommandOutput } from "./commands/DeleteThemeCommand";
1719
import {
1820
ExchangeCodeForTokenCommand,
@@ -24,6 +26,7 @@ import {
2426
ExportComponentsCommandInput,
2527
ExportComponentsCommandOutput,
2628
} from "./commands/ExportComponentsCommand";
29+
import { ExportFormsCommand, ExportFormsCommandInput, ExportFormsCommandOutput } from "./commands/ExportFormsCommand";
2730
import {
2831
ExportThemesCommand,
2932
ExportThemesCommandInput,
@@ -34,13 +37,21 @@ import {
3437
GetComponentCommandInput,
3538
GetComponentCommandOutput,
3639
} from "./commands/GetComponentCommand";
40+
import { GetFormCommand, GetFormCommandInput, GetFormCommandOutput } from "./commands/GetFormCommand";
41+
import { GetMetadataCommand, GetMetadataCommandInput, GetMetadataCommandOutput } from "./commands/GetMetadataCommand";
3742
import { GetThemeCommand, GetThemeCommandInput, GetThemeCommandOutput } from "./commands/GetThemeCommand";
3843
import {
3944
ListComponentsCommand,
4045
ListComponentsCommandInput,
4146
ListComponentsCommandOutput,
4247
} from "./commands/ListComponentsCommand";
48+
import { ListFormsCommand, ListFormsCommandInput, ListFormsCommandOutput } from "./commands/ListFormsCommand";
4349
import { ListThemesCommand, ListThemesCommandInput, ListThemesCommandOutput } from "./commands/ListThemesCommand";
50+
import {
51+
PutMetadataFlagCommand,
52+
PutMetadataFlagCommandInput,
53+
PutMetadataFlagCommandOutput,
54+
} from "./commands/PutMetadataFlagCommand";
4455
import {
4556
RefreshTokenCommand,
4657
RefreshTokenCommandInput,
@@ -51,6 +62,7 @@ import {
5162
UpdateComponentCommandInput,
5263
UpdateComponentCommandOutput,
5364
} from "./commands/UpdateComponentCommand";
65+
import { UpdateFormCommand, UpdateFormCommandInput, UpdateFormCommandOutput } from "./commands/UpdateFormCommand";
5466
import { UpdateThemeCommand, UpdateThemeCommandInput, UpdateThemeCommandOutput } from "./commands/UpdateThemeCommand";
5567

5668
/**
@@ -97,6 +109,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
97109
}
98110
}
99111

112+
/**
113+
* <p>Creates a new form for an Amplify app.</p>
114+
*/
115+
public createForm(args: CreateFormCommandInput, options?: __HttpHandlerOptions): Promise<CreateFormCommandOutput>;
116+
public createForm(args: CreateFormCommandInput, cb: (err: any, data?: CreateFormCommandOutput) => void): void;
117+
public createForm(
118+
args: CreateFormCommandInput,
119+
options: __HttpHandlerOptions,
120+
cb: (err: any, data?: CreateFormCommandOutput) => void
121+
): void;
122+
public createForm(
123+
args: CreateFormCommandInput,
124+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateFormCommandOutput) => void),
125+
cb?: (err: any, data?: CreateFormCommandOutput) => void
126+
): Promise<CreateFormCommandOutput> | void {
127+
const command = new CreateFormCommand(args);
128+
if (typeof optionsOrCb === "function") {
129+
this.send(command, optionsOrCb);
130+
} else if (typeof cb === "function") {
131+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
132+
this.send(command, optionsOrCb || {}, cb);
133+
} else {
134+
return this.send(command, optionsOrCb);
135+
}
136+
}
137+
100138
/**
101139
* <p>Creates a theme to apply to the components in an Amplify app.</p>
102140
*/
@@ -155,6 +193,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
155193
}
156194
}
157195

196+
/**
197+
* <p>Deletes a form from an Amplify app.</p>
198+
*/
199+
public deleteForm(args: DeleteFormCommandInput, options?: __HttpHandlerOptions): Promise<DeleteFormCommandOutput>;
200+
public deleteForm(args: DeleteFormCommandInput, cb: (err: any, data?: DeleteFormCommandOutput) => void): void;
201+
public deleteForm(
202+
args: DeleteFormCommandInput,
203+
options: __HttpHandlerOptions,
204+
cb: (err: any, data?: DeleteFormCommandOutput) => void
205+
): void;
206+
public deleteForm(
207+
args: DeleteFormCommandInput,
208+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteFormCommandOutput) => void),
209+
cb?: (err: any, data?: DeleteFormCommandOutput) => void
210+
): Promise<DeleteFormCommandOutput> | void {
211+
const command = new DeleteFormCommand(args);
212+
if (typeof optionsOrCb === "function") {
213+
this.send(command, optionsOrCb);
214+
} else if (typeof cb === "function") {
215+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
216+
this.send(command, optionsOrCb || {}, cb);
217+
} else {
218+
return this.send(command, optionsOrCb);
219+
}
220+
}
221+
158222
/**
159223
* <p>Deletes a theme from an Amplify app.</p>
160224
*/
@@ -245,6 +309,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
245309
}
246310
}
247311

312+
/**
313+
* <p>Exports form configurations to code that is ready to integrate into an Amplify app.</p>
314+
*/
315+
public exportForms(args: ExportFormsCommandInput, options?: __HttpHandlerOptions): Promise<ExportFormsCommandOutput>;
316+
public exportForms(args: ExportFormsCommandInput, cb: (err: any, data?: ExportFormsCommandOutput) => void): void;
317+
public exportForms(
318+
args: ExportFormsCommandInput,
319+
options: __HttpHandlerOptions,
320+
cb: (err: any, data?: ExportFormsCommandOutput) => void
321+
): void;
322+
public exportForms(
323+
args: ExportFormsCommandInput,
324+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ExportFormsCommandOutput) => void),
325+
cb?: (err: any, data?: ExportFormsCommandOutput) => void
326+
): Promise<ExportFormsCommandOutput> | void {
327+
const command = new ExportFormsCommand(args);
328+
if (typeof optionsOrCb === "function") {
329+
this.send(command, optionsOrCb);
330+
} else if (typeof cb === "function") {
331+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
332+
this.send(command, optionsOrCb || {}, cb);
333+
} else {
334+
return this.send(command, optionsOrCb);
335+
}
336+
}
337+
248338
/**
249339
* <p>Exports theme configurations to code that is ready to integrate into an Amplify app.</p>
250340
*/
@@ -303,6 +393,58 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
303393
}
304394
}
305395

396+
/**
397+
* <p>Returns an existing form for an Amplify app.</p>
398+
*/
399+
public getForm(args: GetFormCommandInput, options?: __HttpHandlerOptions): Promise<GetFormCommandOutput>;
400+
public getForm(args: GetFormCommandInput, cb: (err: any, data?: GetFormCommandOutput) => void): void;
401+
public getForm(
402+
args: GetFormCommandInput,
403+
options: __HttpHandlerOptions,
404+
cb: (err: any, data?: GetFormCommandOutput) => void
405+
): void;
406+
public getForm(
407+
args: GetFormCommandInput,
408+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetFormCommandOutput) => void),
409+
cb?: (err: any, data?: GetFormCommandOutput) => void
410+
): Promise<GetFormCommandOutput> | void {
411+
const command = new GetFormCommand(args);
412+
if (typeof optionsOrCb === "function") {
413+
this.send(command, optionsOrCb);
414+
} else if (typeof cb === "function") {
415+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
416+
this.send(command, optionsOrCb || {}, cb);
417+
} else {
418+
return this.send(command, optionsOrCb);
419+
}
420+
}
421+
422+
/**
423+
* <p>Returns existing metadata for an Amplify app.</p>
424+
*/
425+
public getMetadata(args: GetMetadataCommandInput, options?: __HttpHandlerOptions): Promise<GetMetadataCommandOutput>;
426+
public getMetadata(args: GetMetadataCommandInput, cb: (err: any, data?: GetMetadataCommandOutput) => void): void;
427+
public getMetadata(
428+
args: GetMetadataCommandInput,
429+
options: __HttpHandlerOptions,
430+
cb: (err: any, data?: GetMetadataCommandOutput) => void
431+
): void;
432+
public getMetadata(
433+
args: GetMetadataCommandInput,
434+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetMetadataCommandOutput) => void),
435+
cb?: (err: any, data?: GetMetadataCommandOutput) => void
436+
): Promise<GetMetadataCommandOutput> | void {
437+
const command = new GetMetadataCommand(args);
438+
if (typeof optionsOrCb === "function") {
439+
this.send(command, optionsOrCb);
440+
} else if (typeof cb === "function") {
441+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
442+
this.send(command, optionsOrCb || {}, cb);
443+
} else {
444+
return this.send(command, optionsOrCb);
445+
}
446+
}
447+
306448
/**
307449
* <p>Returns an existing theme for an Amplify app.</p>
308450
*/
@@ -362,6 +504,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
362504
}
363505
}
364506

507+
/**
508+
* <p>Retrieves a list of forms for a specified Amplify app and backend environment.</p>
509+
*/
510+
public listForms(args: ListFormsCommandInput, options?: __HttpHandlerOptions): Promise<ListFormsCommandOutput>;
511+
public listForms(args: ListFormsCommandInput, cb: (err: any, data?: ListFormsCommandOutput) => void): void;
512+
public listForms(
513+
args: ListFormsCommandInput,
514+
options: __HttpHandlerOptions,
515+
cb: (err: any, data?: ListFormsCommandOutput) => void
516+
): void;
517+
public listForms(
518+
args: ListFormsCommandInput,
519+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListFormsCommandOutput) => void),
520+
cb?: (err: any, data?: ListFormsCommandOutput) => void
521+
): Promise<ListFormsCommandOutput> | void {
522+
const command = new ListFormsCommand(args);
523+
if (typeof optionsOrCb === "function") {
524+
this.send(command, optionsOrCb);
525+
} else if (typeof cb === "function") {
526+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
527+
this.send(command, optionsOrCb || {}, cb);
528+
} else {
529+
return this.send(command, optionsOrCb);
530+
}
531+
}
532+
365533
/**
366534
* <p>Retrieves a list of themes for a specified Amplify app and backend
367535
* environment.</p>
@@ -389,6 +557,38 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
389557
}
390558
}
391559

560+
/**
561+
* <p>Stores the metadata information about a feature on a form or view.</p>
562+
*/
563+
public putMetadataFlag(
564+
args: PutMetadataFlagCommandInput,
565+
options?: __HttpHandlerOptions
566+
): Promise<PutMetadataFlagCommandOutput>;
567+
public putMetadataFlag(
568+
args: PutMetadataFlagCommandInput,
569+
cb: (err: any, data?: PutMetadataFlagCommandOutput) => void
570+
): void;
571+
public putMetadataFlag(
572+
args: PutMetadataFlagCommandInput,
573+
options: __HttpHandlerOptions,
574+
cb: (err: any, data?: PutMetadataFlagCommandOutput) => void
575+
): void;
576+
public putMetadataFlag(
577+
args: PutMetadataFlagCommandInput,
578+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutMetadataFlagCommandOutput) => void),
579+
cb?: (err: any, data?: PutMetadataFlagCommandOutput) => void
580+
): Promise<PutMetadataFlagCommandOutput> | void {
581+
const command = new PutMetadataFlagCommand(args);
582+
if (typeof optionsOrCb === "function") {
583+
this.send(command, optionsOrCb);
584+
} else if (typeof cb === "function") {
585+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
586+
this.send(command, optionsOrCb || {}, cb);
587+
} else {
588+
return this.send(command, optionsOrCb);
589+
}
590+
}
591+
392592
/**
393593
* <p>Refreshes a previously issued access token that might have expired.</p>
394594
*/
@@ -450,6 +650,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
450650
}
451651
}
452652

653+
/**
654+
* <p>Updates an existing form.</p>
655+
*/
656+
public updateForm(args: UpdateFormCommandInput, options?: __HttpHandlerOptions): Promise<UpdateFormCommandOutput>;
657+
public updateForm(args: UpdateFormCommandInput, cb: (err: any, data?: UpdateFormCommandOutput) => void): void;
658+
public updateForm(
659+
args: UpdateFormCommandInput,
660+
options: __HttpHandlerOptions,
661+
cb: (err: any, data?: UpdateFormCommandOutput) => void
662+
): void;
663+
public updateForm(
664+
args: UpdateFormCommandInput,
665+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateFormCommandOutput) => void),
666+
cb?: (err: any, data?: UpdateFormCommandOutput) => void
667+
): Promise<UpdateFormCommandOutput> | void {
668+
const command = new UpdateFormCommand(args);
669+
if (typeof optionsOrCb === "function") {
670+
this.send(command, optionsOrCb);
671+
} else if (typeof cb === "function") {
672+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
673+
this.send(command, optionsOrCb || {}, cb);
674+
} else {
675+
return this.send(command, optionsOrCb);
676+
}
677+
}
678+
453679
/**
454680
* <p>Updates an existing theme.</p>
455681
*/

clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,54 +54,78 @@ import {
5454
} from "@aws-sdk/types";
5555

5656
import { CreateComponentCommandInput, CreateComponentCommandOutput } from "./commands/CreateComponentCommand";
57+
import { CreateFormCommandInput, CreateFormCommandOutput } from "./commands/CreateFormCommand";
5758
import { CreateThemeCommandInput, CreateThemeCommandOutput } from "./commands/CreateThemeCommand";
5859
import { DeleteComponentCommandInput, DeleteComponentCommandOutput } from "./commands/DeleteComponentCommand";
60+
import { DeleteFormCommandInput, DeleteFormCommandOutput } from "./commands/DeleteFormCommand";
5961
import { DeleteThemeCommandInput, DeleteThemeCommandOutput } from "./commands/DeleteThemeCommand";
6062
import {
6163
ExchangeCodeForTokenCommandInput,
6264
ExchangeCodeForTokenCommandOutput,
6365
} from "./commands/ExchangeCodeForTokenCommand";
6466
import { ExportComponentsCommandInput, ExportComponentsCommandOutput } from "./commands/ExportComponentsCommand";
67+
import { ExportFormsCommandInput, ExportFormsCommandOutput } from "./commands/ExportFormsCommand";
6568
import { ExportThemesCommandInput, ExportThemesCommandOutput } from "./commands/ExportThemesCommand";
6669
import { GetComponentCommandInput, GetComponentCommandOutput } from "./commands/GetComponentCommand";
70+
import { GetFormCommandInput, GetFormCommandOutput } from "./commands/GetFormCommand";
71+
import { GetMetadataCommandInput, GetMetadataCommandOutput } from "./commands/GetMetadataCommand";
6772
import { GetThemeCommandInput, GetThemeCommandOutput } from "./commands/GetThemeCommand";
6873
import { ListComponentsCommandInput, ListComponentsCommandOutput } from "./commands/ListComponentsCommand";
74+
import { ListFormsCommandInput, ListFormsCommandOutput } from "./commands/ListFormsCommand";
6975
import { ListThemesCommandInput, ListThemesCommandOutput } from "./commands/ListThemesCommand";
76+
import { PutMetadataFlagCommandInput, PutMetadataFlagCommandOutput } from "./commands/PutMetadataFlagCommand";
7077
import { RefreshTokenCommandInput, RefreshTokenCommandOutput } from "./commands/RefreshTokenCommand";
7178
import { UpdateComponentCommandInput, UpdateComponentCommandOutput } from "./commands/UpdateComponentCommand";
79+
import { UpdateFormCommandInput, UpdateFormCommandOutput } from "./commands/UpdateFormCommand";
7280
import { UpdateThemeCommandInput, UpdateThemeCommandOutput } from "./commands/UpdateThemeCommand";
7381
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
7482

7583
export type ServiceInputTypes =
7684
| CreateComponentCommandInput
85+
| CreateFormCommandInput
7786
| CreateThemeCommandInput
7887
| DeleteComponentCommandInput
88+
| DeleteFormCommandInput
7989
| DeleteThemeCommandInput
8090
| ExchangeCodeForTokenCommandInput
8191
| ExportComponentsCommandInput
92+
| ExportFormsCommandInput
8293
| ExportThemesCommandInput
8394
| GetComponentCommandInput
95+
| GetFormCommandInput
96+
| GetMetadataCommandInput
8497
| GetThemeCommandInput
8598
| ListComponentsCommandInput
99+
| ListFormsCommandInput
86100
| ListThemesCommandInput
101+
| PutMetadataFlagCommandInput
87102
| RefreshTokenCommandInput
88103
| UpdateComponentCommandInput
104+
| UpdateFormCommandInput
89105
| UpdateThemeCommandInput;
90106

91107
export type ServiceOutputTypes =
92108
| CreateComponentCommandOutput
109+
| CreateFormCommandOutput
93110
| CreateThemeCommandOutput
94111
| DeleteComponentCommandOutput
112+
| DeleteFormCommandOutput
95113
| DeleteThemeCommandOutput
96114
| ExchangeCodeForTokenCommandOutput
97115
| ExportComponentsCommandOutput
116+
| ExportFormsCommandOutput
98117
| ExportThemesCommandOutput
99118
| GetComponentCommandOutput
119+
| GetFormCommandOutput
120+
| GetMetadataCommandOutput
100121
| GetThemeCommandOutput
101122
| ListComponentsCommandOutput
123+
| ListFormsCommandOutput
102124
| ListThemesCommandOutput
125+
| PutMetadataFlagCommandOutput
103126
| RefreshTokenCommandOutput
104127
| UpdateComponentCommandOutput
128+
| UpdateFormCommandOutput
105129
| UpdateThemeCommandOutput;
106130

107131
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {

0 commit comments

Comments
 (0)