Skip to content

Commit

Permalink
feat(core): Add validation parameters to custom fields
Browse files Browse the repository at this point in the history
Relates to #85
  • Loading branch information
michaelbromley committed Jul 16, 2019
1 parent b1722d8 commit b6b13a5
Show file tree
Hide file tree
Showing 17 changed files with 928 additions and 188 deletions.
74 changes: 72 additions & 2 deletions packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,14 @@ export enum AssetType {
BINARY = 'BINARY',
}

export type BooleanCustomFieldConfig = CustomField & {
__typename?: 'BooleanCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
};

export type BooleanOperators = {
eq?: Maybe<Scalars['Boolean']>;
};
Expand Down Expand Up @@ -655,14 +663,22 @@ export type CustomerList = PaginatedList & {
totalItems: Scalars['Int'];
};

export type CustomFieldConfig = {
__typename?: 'CustomFieldConfig';
export type CustomField = {
__typename?: 'CustomField';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
};

export type CustomFieldConfig =
| StringCustomFieldConfig
| LocaleStringCustomFieldConfig
| IntCustomFieldConfig
| FloatCustomFieldConfig
| BooleanCustomFieldConfig
| DateTimeCustomFieldConfig;

export type CustomFields = {
__typename?: 'CustomFields';
Address: Array<CustomFieldConfig>;
Expand Down Expand Up @@ -691,6 +707,20 @@ export type DateRange = {
end: Scalars['DateTime'];
};

/** Expects the same validation formats as the <input type="datetime-local"> HTML element.
* See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes
*/
export type DateTimeCustomFieldConfig = CustomField & {
__typename?: 'DateTimeCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
min?: Maybe<Scalars['String']>;
max?: Maybe<Scalars['String']>;
step?: Maybe<Scalars['Int']>;
};

export type DeletionResponse = {
__typename?: 'DeletionResponse';
result: DeletionResult;
Expand Down Expand Up @@ -763,6 +793,17 @@ export type FacetValueTranslation = {
name: Scalars['String'];
};

export type FloatCustomFieldConfig = CustomField & {
__typename?: 'FloatCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
min?: Maybe<Scalars['Float']>;
max?: Maybe<Scalars['Float']>;
step?: Maybe<Scalars['Float']>;
};

export type Fulfillment = Node & {
__typename?: 'Fulfillment';
id: Scalars['ID'];
Expand Down Expand Up @@ -835,6 +876,17 @@ export type ImportInfo = {
imported: Scalars['Int'];
};

export type IntCustomFieldConfig = CustomField & {
__typename?: 'IntCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
min?: Maybe<Scalars['Int']>;
max?: Maybe<Scalars['Int']>;
step?: Maybe<Scalars['Int']>;
};

/** ISO 639-1 language code */
export enum LanguageCode {
/** Afar */
Expand Down Expand Up @@ -1207,6 +1259,15 @@ export enum LanguageCode {
zu = 'zu',
}

export type LocaleStringCustomFieldConfig = CustomField & {
__typename?: 'LocaleStringCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
pattern?: Maybe<Scalars['String']>;
};

export type LocalizedString = {
__typename?: 'LocalizedString';
languageCode: LanguageCode;
Expand Down Expand Up @@ -2014,6 +2075,15 @@ export enum StockMovementType {
RETURN = 'RETURN',
}

export type StringCustomFieldConfig = CustomField & {
__typename?: 'StringCustomFieldConfig';
name: Scalars['String'];
type: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
pattern?: Maybe<Scalars['String']>;
};

export type StringOperators = {
eq?: Maybe<Scalars['String']>;
contains?: Maybe<Scalars['String']>;
Expand Down
Loading

0 comments on commit b6b13a5

Please sign in to comment.