Skip to content

Commit

Permalink
feat(client-amplifyuibuilder): Amplify Studio UIBuilder is introducin…
Browse files Browse the repository at this point in the history
…g 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.
  • Loading branch information
awstools committed Sep 14, 2022
1 parent 272b997 commit d09d5fc
Show file tree
Hide file tree
Showing 17 changed files with 5,240 additions and 194 deletions.
226 changes: 226 additions & 0 deletions clients/client-amplifyuibuilder/src/AmplifyUIBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import {
CreateComponentCommandInput,
CreateComponentCommandOutput,
} from "./commands/CreateComponentCommand";
import { CreateFormCommand, CreateFormCommandInput, CreateFormCommandOutput } from "./commands/CreateFormCommand";
import { CreateThemeCommand, CreateThemeCommandInput, CreateThemeCommandOutput } from "./commands/CreateThemeCommand";
import {
DeleteComponentCommand,
DeleteComponentCommandInput,
DeleteComponentCommandOutput,
} from "./commands/DeleteComponentCommand";
import { DeleteFormCommand, DeleteFormCommandInput, DeleteFormCommandOutput } from "./commands/DeleteFormCommand";
import { DeleteThemeCommand, DeleteThemeCommandInput, DeleteThemeCommandOutput } from "./commands/DeleteThemeCommand";
import {
ExchangeCodeForTokenCommand,
Expand All @@ -24,6 +26,7 @@ import {
ExportComponentsCommandInput,
ExportComponentsCommandOutput,
} from "./commands/ExportComponentsCommand";
import { ExportFormsCommand, ExportFormsCommandInput, ExportFormsCommandOutput } from "./commands/ExportFormsCommand";
import {
ExportThemesCommand,
ExportThemesCommandInput,
Expand All @@ -34,13 +37,21 @@ import {
GetComponentCommandInput,
GetComponentCommandOutput,
} from "./commands/GetComponentCommand";
import { GetFormCommand, GetFormCommandInput, GetFormCommandOutput } from "./commands/GetFormCommand";
import { GetMetadataCommand, GetMetadataCommandInput, GetMetadataCommandOutput } from "./commands/GetMetadataCommand";
import { GetThemeCommand, GetThemeCommandInput, GetThemeCommandOutput } from "./commands/GetThemeCommand";
import {
ListComponentsCommand,
ListComponentsCommandInput,
ListComponentsCommandOutput,
} from "./commands/ListComponentsCommand";
import { ListFormsCommand, ListFormsCommandInput, ListFormsCommandOutput } from "./commands/ListFormsCommand";
import { ListThemesCommand, ListThemesCommandInput, ListThemesCommandOutput } from "./commands/ListThemesCommand";
import {
PutMetadataFlagCommand,
PutMetadataFlagCommandInput,
PutMetadataFlagCommandOutput,
} from "./commands/PutMetadataFlagCommand";
import {
RefreshTokenCommand,
RefreshTokenCommandInput,
Expand All @@ -51,6 +62,7 @@ import {
UpdateComponentCommandInput,
UpdateComponentCommandOutput,
} from "./commands/UpdateComponentCommand";
import { UpdateFormCommand, UpdateFormCommandInput, UpdateFormCommandOutput } from "./commands/UpdateFormCommand";
import { UpdateThemeCommand, UpdateThemeCommandInput, UpdateThemeCommandOutput } from "./commands/UpdateThemeCommand";

/**
Expand Down Expand Up @@ -97,6 +109,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Creates a new form for an Amplify app.</p>
*/
public createForm(args: CreateFormCommandInput, options?: __HttpHandlerOptions): Promise<CreateFormCommandOutput>;
public createForm(args: CreateFormCommandInput, cb: (err: any, data?: CreateFormCommandOutput) => void): void;
public createForm(
args: CreateFormCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateFormCommandOutput) => void
): void;
public createForm(
args: CreateFormCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateFormCommandOutput) => void),
cb?: (err: any, data?: CreateFormCommandOutput) => void
): Promise<CreateFormCommandOutput> | void {
const command = new CreateFormCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Creates a theme to apply to the components in an Amplify app.</p>
*/
Expand Down Expand Up @@ -155,6 +193,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Deletes a form from an Amplify app.</p>
*/
public deleteForm(args: DeleteFormCommandInput, options?: __HttpHandlerOptions): Promise<DeleteFormCommandOutput>;
public deleteForm(args: DeleteFormCommandInput, cb: (err: any, data?: DeleteFormCommandOutput) => void): void;
public deleteForm(
args: DeleteFormCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteFormCommandOutput) => void
): void;
public deleteForm(
args: DeleteFormCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteFormCommandOutput) => void),
cb?: (err: any, data?: DeleteFormCommandOutput) => void
): Promise<DeleteFormCommandOutput> | void {
const command = new DeleteFormCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Deletes a theme from an Amplify app.</p>
*/
Expand Down Expand Up @@ -245,6 +309,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Exports form configurations to code that is ready to integrate into an Amplify app.</p>
*/
public exportForms(args: ExportFormsCommandInput, options?: __HttpHandlerOptions): Promise<ExportFormsCommandOutput>;
public exportForms(args: ExportFormsCommandInput, cb: (err: any, data?: ExportFormsCommandOutput) => void): void;
public exportForms(
args: ExportFormsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ExportFormsCommandOutput) => void
): void;
public exportForms(
args: ExportFormsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ExportFormsCommandOutput) => void),
cb?: (err: any, data?: ExportFormsCommandOutput) => void
): Promise<ExportFormsCommandOutput> | void {
const command = new ExportFormsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Exports theme configurations to code that is ready to integrate into an Amplify app.</p>
*/
Expand Down Expand Up @@ -303,6 +393,58 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Returns an existing form for an Amplify app.</p>
*/
public getForm(args: GetFormCommandInput, options?: __HttpHandlerOptions): Promise<GetFormCommandOutput>;
public getForm(args: GetFormCommandInput, cb: (err: any, data?: GetFormCommandOutput) => void): void;
public getForm(
args: GetFormCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetFormCommandOutput) => void
): void;
public getForm(
args: GetFormCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetFormCommandOutput) => void),
cb?: (err: any, data?: GetFormCommandOutput) => void
): Promise<GetFormCommandOutput> | void {
const command = new GetFormCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Returns existing metadata for an Amplify app.</p>
*/
public getMetadata(args: GetMetadataCommandInput, options?: __HttpHandlerOptions): Promise<GetMetadataCommandOutput>;
public getMetadata(args: GetMetadataCommandInput, cb: (err: any, data?: GetMetadataCommandOutput) => void): void;
public getMetadata(
args: GetMetadataCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetMetadataCommandOutput) => void
): void;
public getMetadata(
args: GetMetadataCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetMetadataCommandOutput) => void),
cb?: (err: any, data?: GetMetadataCommandOutput) => void
): Promise<GetMetadataCommandOutput> | void {
const command = new GetMetadataCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Returns an existing theme for an Amplify app.</p>
*/
Expand Down Expand Up @@ -362,6 +504,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Retrieves a list of forms for a specified Amplify app and backend environment.</p>
*/
public listForms(args: ListFormsCommandInput, options?: __HttpHandlerOptions): Promise<ListFormsCommandOutput>;
public listForms(args: ListFormsCommandInput, cb: (err: any, data?: ListFormsCommandOutput) => void): void;
public listForms(
args: ListFormsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListFormsCommandOutput) => void
): void;
public listForms(
args: ListFormsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListFormsCommandOutput) => void),
cb?: (err: any, data?: ListFormsCommandOutput) => void
): Promise<ListFormsCommandOutput> | void {
const command = new ListFormsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Retrieves a list of themes for a specified Amplify app and backend
* environment.</p>
Expand Down Expand Up @@ -389,6 +557,38 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Stores the metadata information about a feature on a form or view.</p>
*/
public putMetadataFlag(
args: PutMetadataFlagCommandInput,
options?: __HttpHandlerOptions
): Promise<PutMetadataFlagCommandOutput>;
public putMetadataFlag(
args: PutMetadataFlagCommandInput,
cb: (err: any, data?: PutMetadataFlagCommandOutput) => void
): void;
public putMetadataFlag(
args: PutMetadataFlagCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutMetadataFlagCommandOutput) => void
): void;
public putMetadataFlag(
args: PutMetadataFlagCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutMetadataFlagCommandOutput) => void),
cb?: (err: any, data?: PutMetadataFlagCommandOutput) => void
): Promise<PutMetadataFlagCommandOutput> | void {
const command = new PutMetadataFlagCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Refreshes a previously issued access token that might have expired.</p>
*/
Expand Down Expand Up @@ -450,6 +650,32 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {
}
}

/**
* <p>Updates an existing form.</p>
*/
public updateForm(args: UpdateFormCommandInput, options?: __HttpHandlerOptions): Promise<UpdateFormCommandOutput>;
public updateForm(args: UpdateFormCommandInput, cb: (err: any, data?: UpdateFormCommandOutput) => void): void;
public updateForm(
args: UpdateFormCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateFormCommandOutput) => void
): void;
public updateForm(
args: UpdateFormCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateFormCommandOutput) => void),
cb?: (err: any, data?: UpdateFormCommandOutput) => void
): Promise<UpdateFormCommandOutput> | void {
const command = new UpdateFormCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}

/**
* <p>Updates an existing theme.</p>
*/
Expand Down
24 changes: 24 additions & 0 deletions clients/client-amplifyuibuilder/src/AmplifyUIBuilderClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,54 +54,78 @@ import {
} from "@aws-sdk/types";

import { CreateComponentCommandInput, CreateComponentCommandOutput } from "./commands/CreateComponentCommand";
import { CreateFormCommandInput, CreateFormCommandOutput } from "./commands/CreateFormCommand";
import { CreateThemeCommandInput, CreateThemeCommandOutput } from "./commands/CreateThemeCommand";
import { DeleteComponentCommandInput, DeleteComponentCommandOutput } from "./commands/DeleteComponentCommand";
import { DeleteFormCommandInput, DeleteFormCommandOutput } from "./commands/DeleteFormCommand";
import { DeleteThemeCommandInput, DeleteThemeCommandOutput } from "./commands/DeleteThemeCommand";
import {
ExchangeCodeForTokenCommandInput,
ExchangeCodeForTokenCommandOutput,
} from "./commands/ExchangeCodeForTokenCommand";
import { ExportComponentsCommandInput, ExportComponentsCommandOutput } from "./commands/ExportComponentsCommand";
import { ExportFormsCommandInput, ExportFormsCommandOutput } from "./commands/ExportFormsCommand";
import { ExportThemesCommandInput, ExportThemesCommandOutput } from "./commands/ExportThemesCommand";
import { GetComponentCommandInput, GetComponentCommandOutput } from "./commands/GetComponentCommand";
import { GetFormCommandInput, GetFormCommandOutput } from "./commands/GetFormCommand";
import { GetMetadataCommandInput, GetMetadataCommandOutput } from "./commands/GetMetadataCommand";
import { GetThemeCommandInput, GetThemeCommandOutput } from "./commands/GetThemeCommand";
import { ListComponentsCommandInput, ListComponentsCommandOutput } from "./commands/ListComponentsCommand";
import { ListFormsCommandInput, ListFormsCommandOutput } from "./commands/ListFormsCommand";
import { ListThemesCommandInput, ListThemesCommandOutput } from "./commands/ListThemesCommand";
import { PutMetadataFlagCommandInput, PutMetadataFlagCommandOutput } from "./commands/PutMetadataFlagCommand";
import { RefreshTokenCommandInput, RefreshTokenCommandOutput } from "./commands/RefreshTokenCommand";
import { UpdateComponentCommandInput, UpdateComponentCommandOutput } from "./commands/UpdateComponentCommand";
import { UpdateFormCommandInput, UpdateFormCommandOutput } from "./commands/UpdateFormCommand";
import { UpdateThemeCommandInput, UpdateThemeCommandOutput } from "./commands/UpdateThemeCommand";
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";

export type ServiceInputTypes =
| CreateComponentCommandInput
| CreateFormCommandInput
| CreateThemeCommandInput
| DeleteComponentCommandInput
| DeleteFormCommandInput
| DeleteThemeCommandInput
| ExchangeCodeForTokenCommandInput
| ExportComponentsCommandInput
| ExportFormsCommandInput
| ExportThemesCommandInput
| GetComponentCommandInput
| GetFormCommandInput
| GetMetadataCommandInput
| GetThemeCommandInput
| ListComponentsCommandInput
| ListFormsCommandInput
| ListThemesCommandInput
| PutMetadataFlagCommandInput
| RefreshTokenCommandInput
| UpdateComponentCommandInput
| UpdateFormCommandInput
| UpdateThemeCommandInput;

export type ServiceOutputTypes =
| CreateComponentCommandOutput
| CreateFormCommandOutput
| CreateThemeCommandOutput
| DeleteComponentCommandOutput
| DeleteFormCommandOutput
| DeleteThemeCommandOutput
| ExchangeCodeForTokenCommandOutput
| ExportComponentsCommandOutput
| ExportFormsCommandOutput
| ExportThemesCommandOutput
| GetComponentCommandOutput
| GetFormCommandOutput
| GetMetadataCommandOutput
| GetThemeCommandOutput
| ListComponentsCommandOutput
| ListFormsCommandOutput
| ListThemesCommandOutput
| PutMetadataFlagCommandOutput
| RefreshTokenCommandOutput
| UpdateComponentCommandOutput
| UpdateFormCommandOutput
| UpdateThemeCommandOutput;

export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
Expand Down
Loading

0 comments on commit d09d5fc

Please sign in to comment.