Skip to content

Commit

Permalink
feat(client-amplifyuibuilder): Support StorageField and custom displa…
Browse files Browse the repository at this point in the history
…ys for data-bound options in form builder. Support non-string operands for predicates in collections. Support choosing client to get token from.
  • Loading branch information
awstools committed Apr 4, 2023
1 parent 8ee06d4 commit b24e527
Show file tree
Hide file tree
Showing 12 changed files with 1,703 additions and 1,443 deletions.
2 changes: 1 addition & 1 deletion clients/client-amplifyuibuilder/src/AmplifyUIBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ export class AmplifyUIBuilder extends AmplifyUIBuilderClient {

/**
* @public
* <p>Stores the metadata information about a feature on a form or view.</p>
* <p>Stores the metadata information about a feature on a form.</p>
*/
public putMetadataFlag(
args: PutMetadataFlagCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ export interface CreateComponentCommandOutput extends CreateComponentResponse, _
* field: "STRING_VALUE",
* operator: "STRING_VALUE",
* operand: "STRING_VALUE",
* operandType: "STRING_VALUE",
* },
* ],
* and: "<PredicateList>",
* field: "STRING_VALUE",
* operator: "STRING_VALUE",
* operand: "STRING_VALUE",
* operandType: "STRING_VALUE",
* },
* ],
* userAttribute: "STRING_VALUE",
Expand Down
42 changes: 38 additions & 4 deletions clients/client-amplifyuibuilder/src/commands/CreateFormCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,56 @@ export interface CreateFormCommandOutput extends CreateFormResponse, __MetadataB
* { // ValueMapping
* displayValue: { // FormInputValueProperty
* value: "STRING_VALUE",
* bindingProperties: { // FormInputValuePropertyBindingProperties
* property: "STRING_VALUE", // required
* field: "STRING_VALUE",
* },
* concat: [ // FormInputValuePropertyList
* {
* value: "STRING_VALUE",
* bindingProperties: {
* property: "STRING_VALUE", // required
* field: "STRING_VALUE",
* },
* concat: [
* "<FormInputValueProperty>",
* ],
* },
* ],
* },
* value: {
* value: "STRING_VALUE",
* },
* value: "<FormInputValueProperty>", // required
* },
* ],
* bindingProperties: { // FormInputBindingProperties
* "<keys>": { // FormInputBindingPropertiesValue
* type: "STRING_VALUE",
* bindingProperties: { // FormInputBindingPropertiesValueProperties
* model: "STRING_VALUE",
* },
* },
* },
* },
* name: "STRING_VALUE",
* minValue: Number("float"),
* maxValue: Number("float"),
* step: Number("float"),
* value: "STRING_VALUE",
* isArray: true || false,
* fileUploaderConfig: { // FileUploaderFieldConfig
* accessLevel: "STRING_VALUE", // required
* acceptedFileTypes: [ // StrValues // required
* "STRING_VALUE",
* ],
* showThumbnails: true || false,
* isResumable: true || false,
* maxFileCount: Number("int"),
* maxSize: Number("int"),
* },
* },
* validations: [ // ValidationsList
* { // FieldValidationConfiguration
* type: "STRING_VALUE", // required
* strValues: [ // StrValues
* strValues: [
* "STRING_VALUE",
* ],
* numValues: [ // NumValues
Expand Down Expand Up @@ -129,6 +161,7 @@ export interface CreateFormCommandOutput extends CreateFormResponse, __MetadataB
* text: "STRING_VALUE",
* level: Number("int"),
* orientation: "STRING_VALUE",
* excluded: true || false,
* },
* },
* schemaVersion: "STRING_VALUE", // required
Expand Down Expand Up @@ -165,6 +198,7 @@ export interface CreateFormCommandOutput extends CreateFormResponse, __MetadataB
* tags: { // Tags
* "<keys>": "STRING_VALUE",
* },
* labelDecorator: "STRING_VALUE",
* },
* };
* const command = new CreateFormCommand(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface ExchangeCodeForTokenCommandOutput extends ExchangeCodeForTokenR
* request: { // ExchangeCodeForTokenRequestBody
* code: "STRING_VALUE", // required
* redirectUri: "STRING_VALUE", // required
* clientId: "STRING_VALUE",
* },
* };
* const command = new ExchangeCodeForTokenCommand(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface PutMetadataFlagCommandOutput extends __MetadataBearer {}

/**
* @public
* <p>Stores the metadata information about a feature on a form or view.</p>
* <p>Stores the metadata information about a feature on a form.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface RefreshTokenCommandOutput extends RefreshTokenResponse, __Metad
* provider: "STRING_VALUE", // required
* refreshTokenBody: { // RefreshTokenRequestBody
* token: "STRING_VALUE", // required
* clientId: "STRING_VALUE",
* },
* };
* const command = new RefreshTokenCommand(input);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,14 @@ export interface UpdateComponentCommandOutput extends UpdateComponentResponse, _
* field: "STRING_VALUE",
* operator: "STRING_VALUE",
* operand: "STRING_VALUE",
* operandType: "STRING_VALUE",
* },
* ],
* and: "<PredicateList>",
* field: "STRING_VALUE",
* operator: "STRING_VALUE",
* operand: "STRING_VALUE",
* operandType: "STRING_VALUE",
* },
* ],
* userAttribute: "STRING_VALUE",
Expand Down
42 changes: 38 additions & 4 deletions clients/client-amplifyuibuilder/src/commands/UpdateFormCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,56 @@ export interface UpdateFormCommandOutput extends UpdateFormResponse, __MetadataB
* { // ValueMapping
* displayValue: { // FormInputValueProperty
* value: "STRING_VALUE",
* bindingProperties: { // FormInputValuePropertyBindingProperties
* property: "STRING_VALUE", // required
* field: "STRING_VALUE",
* },
* concat: [ // FormInputValuePropertyList
* {
* value: "STRING_VALUE",
* bindingProperties: {
* property: "STRING_VALUE", // required
* field: "STRING_VALUE",
* },
* concat: [
* "<FormInputValueProperty>",
* ],
* },
* ],
* },
* value: {
* value: "STRING_VALUE",
* },
* value: "<FormInputValueProperty>", // required
* },
* ],
* bindingProperties: { // FormInputBindingProperties
* "<keys>": { // FormInputBindingPropertiesValue
* type: "STRING_VALUE",
* bindingProperties: { // FormInputBindingPropertiesValueProperties
* model: "STRING_VALUE",
* },
* },
* },
* },
* name: "STRING_VALUE",
* minValue: Number("float"),
* maxValue: Number("float"),
* step: Number("float"),
* value: "STRING_VALUE",
* isArray: true || false,
* fileUploaderConfig: { // FileUploaderFieldConfig
* accessLevel: "STRING_VALUE", // required
* acceptedFileTypes: [ // StrValues // required
* "STRING_VALUE",
* ],
* showThumbnails: true || false,
* isResumable: true || false,
* maxFileCount: Number("int"),
* maxSize: Number("int"),
* },
* },
* validations: [ // ValidationsList
* { // FieldValidationConfiguration
* type: "STRING_VALUE", // required
* strValues: [ // StrValues
* strValues: [
* "STRING_VALUE",
* ],
* numValues: [ // NumValues
Expand Down Expand Up @@ -130,6 +162,7 @@ export interface UpdateFormCommandOutput extends UpdateFormResponse, __MetadataB
* text: "STRING_VALUE",
* level: Number("int"),
* orientation: "STRING_VALUE",
* excluded: true || false,
* },
* },
* schemaVersion: "STRING_VALUE",
Expand Down Expand Up @@ -163,6 +196,7 @@ export interface UpdateFormCommandOutput extends UpdateFormResponse, __MetadataB
* },
* },
* },
* labelDecorator: "STRING_VALUE",
* },
* };
* const command = new UpdateFormCommand(input);
Expand Down
35 changes: 18 additions & 17 deletions clients/client-amplifyuibuilder/src/endpoint/ruleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@ import { RuleSetObject } from "@aws-sdk/util-endpoints";
or see "smithy.rules#endpointRuleSet"
in codegen/sdk-codegen/aws-models/amplifyuibuilder.json */

const p="required",
q="fn",
r="argv",
s="ref";
const a="PartitionResult",
const q="required",
r="fn",
s="argv",
t="ref";
const a="isSet",
b="tree",
c="error",
d="endpoint",
e={[p]:false,"type":"String"},
f={[p]:true,"default":false,"type":"Boolean"},
g={[s]:"Endpoint"},
h={[q]:"booleanEquals",[r]:[{[s]:"UseFIPS"},true]},
i={[q]:"booleanEquals",[r]:[{[s]:"UseDualStack"},true]},
j={},
k={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsFIPS"]}]},
l={[q]:"booleanEquals",[r]:[true,{[q]:"getAttr",[r]:[{[s]:a},"supportsDualStack"]}]},
m=[g],
n=[h],
o=[i];
const _data={version:"1.0",parameters:{Region:e,UseDualStack:f,UseFIPS:f,Endpoint:e},rules:[{conditions:[{[q]:"aws.partition",[r]:[{[s]:"Region"}],assign:a}],type:b,rules:[{conditions:[{[q]:"isSet",[r]:m},{[q]:"parseURL",[r]:m,assign:"url"}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:g,properties:j,headers:j},type:d}]}]},{conditions:[h,i],type:b,rules:[{conditions:[k,l],type:b,rules:[{endpoint:{url:"https://amplifyuibuilder-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[k],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://amplifyuibuilder-fips.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[l],type:b,rules:[{endpoint:{url:"https://amplifyuibuilder.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:j,headers:j},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{endpoint:{url:"https://amplifyuibuilder.{Region}.{PartitionResult#dnsSuffix}",properties:j,headers:j},type:d}]}]};
e="PartitionResult",
f={[q]:false,"type":"String"},
g={[q]:true,"default":false,"type":"Boolean"},
h={[t]:"Endpoint"},
i={[r]:"booleanEquals",[s]:[{[t]:"UseFIPS"},true]},
j={[r]:"booleanEquals",[s]:[{[t]:"UseDualStack"},true]},
k={},
l={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsFIPS"]}]},
m={[r]:"booleanEquals",[s]:[true,{[r]:"getAttr",[s]:[{[t]:e},"supportsDualStack"]}]},
n=[i],
o=[j],
p=[{[t]:"Region"}];
const _data={version:"1.0",parameters:{Region:f,UseDualStack:g,UseFIPS:g,Endpoint:f},rules:[{conditions:[{[r]:a,[s]:[h]}],type:b,rules:[{conditions:n,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:o,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:h,properties:k,headers:k},type:d}]}]},{type:b,rules:[{conditions:[{[r]:a,[s]:p}],type:b,rules:[{conditions:[{[r]:"aws.partition",[s]:p,assign:e}],type:b,rules:[{conditions:[i,j],type:b,rules:[{conditions:[l,m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://amplifyuibuilder-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:n,type:b,rules:[{conditions:[l],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://amplifyuibuilder-fips.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:o,type:b,rules:[{conditions:[m],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://amplifyuibuilder.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:k,headers:k},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{endpoint:{url:"https://amplifyuibuilder.{Region}.{PartitionResult#dnsSuffix}",properties:k,headers:k},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
export const ruleSet: RuleSetObject = _data;
Loading

0 comments on commit b24e527

Please sign in to comment.