Skip to content

Commit

Permalink
feat(core): Add options to string custom field config
Browse files Browse the repository at this point in the history
Relates to #85
  • Loading branch information
michaelbromley committed Jul 16, 2019
1 parent 80eba9d commit bc0813e
Show file tree
Hide file tree
Showing 11 changed files with 309 additions and 97 deletions.
28 changes: 27 additions & 1 deletion packages/common/src/generated-shop-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,14 @@ export type Product = Node & {
facetValues: Array<FacetValue>;
translations: Array<ProductTranslation>;
collections: Array<Collection>;
customFields?: Maybe<Scalars['JSON']>;
customFields?: Maybe<ProductCustomFields>;
};

export type ProductCustomFields = {
__typename?: 'ProductCustomFields';
nickname?: Maybe<Scalars['String']>;
localNickname?: Maybe<Scalars['String']>;
expires?: Maybe<Scalars['DateTime']>;
};

export type ProductFilterParameter = {
Expand All @@ -1661,6 +1668,9 @@ export type ProductFilterParameter = {
name?: Maybe<StringOperators>;
slug?: Maybe<StringOperators>;
description?: Maybe<StringOperators>;
nickname?: Maybe<StringOperators>;
localNickname?: Maybe<StringOperators>;
expires?: Maybe<DateOperators>;
};

export type ProductList = PaginatedList & {
Expand Down Expand Up @@ -1727,6 +1737,9 @@ export type ProductSortParameter = {
name?: Maybe<SortOrder>;
slug?: Maybe<SortOrder>;
description?: Maybe<SortOrder>;
nickname?: Maybe<SortOrder>;
localNickname?: Maybe<SortOrder>;
expires?: Maybe<SortOrder>;
};

export type ProductTranslation = {
Expand All @@ -1738,6 +1751,12 @@ export type ProductTranslation = {
name: Scalars['String'];
slug: Scalars['String'];
description: Scalars['String'];
customFields?: Maybe<ProductTranslationCustomFields>;
};

export type ProductTranslationCustomFields = {
__typename?: 'ProductTranslationCustomFields';
localNickname?: Maybe<Scalars['String']>;
};

export type ProductVariant = Node & {
Expand Down Expand Up @@ -2082,6 +2101,13 @@ export type StringCustomFieldConfig = CustomField & {
label?: Maybe<Array<LocalizedString>>;
description?: Maybe<Array<LocalizedString>>;
pattern?: Maybe<Scalars['String']>;
options?: Maybe<Array<StringFieldOption>>;
};

export type StringFieldOption = {
__typename?: 'StringFieldOption';
value: Scalars['String'];
label?: Maybe<Array<LocalizedString>>;
};

export type StringOperators = {
Expand Down
106 changes: 73 additions & 33 deletions packages/common/src/generated-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,12 +471,17 @@ export type CreateGroupOptionInput = {
translations: Array<ProductOptionGroupTranslationInput>,
};

export type CreateProductCustomFieldsInput = {
nickname?: Maybe<Scalars['String']>,
expires?: Maybe<Scalars['DateTime']>,
};

export type CreateProductInput = {
featuredAssetId?: Maybe<Scalars['ID']>,
assetIds?: Maybe<Array<Scalars['ID']>>,
facetValueIds?: Maybe<Array<Scalars['ID']>>,
translations: Array<ProductTranslationInput>,
customFields?: Maybe<Scalars['JSON']>,
customFields?: Maybe<CreateProductCustomFieldsInput>,
};

export type CreateProductOptionGroupInput = {
Expand Down Expand Up @@ -1697,6 +1702,8 @@ export type Mutation = {
refundOrder: Refund,
settleRefund: Refund,
addNoteToOrder: Order,
/** Update an existing PaymentMethod */
updatePaymentMethod: PaymentMethod,
/** Create a new ProductOptionGroup */
createProductOptionGroup: ProductOptionGroup,
/** Update an existing ProductOptionGroup */
Expand All @@ -1705,8 +1712,7 @@ export type Mutation = {
createProductOption: ProductOption,
/** Create a new ProductOption within a ProductOptionGroup */
updateProductOption: ProductOption,
/** Update an existing PaymentMethod */
updatePaymentMethod: PaymentMethod,
reindex: JobInfo,
/** Create a new Product */
createProduct: Product,
/** Update an existing Product */
Expand All @@ -1723,7 +1729,6 @@ export type Mutation = {
updateProductVariants: Array<Maybe<ProductVariant>>,
/** Delete a ProductVariant */
deleteProductVariant: DeletionResponse,
reindex: JobInfo,
createPromotion: Promotion,
updatePromotion: Promotion,
deletePromotion: DeletionResponse,
Expand Down Expand Up @@ -1955,6 +1960,11 @@ export type MutationAddNoteToOrderArgs = {
};


export type MutationUpdatePaymentMethodArgs = {
input: UpdatePaymentMethodInput
};


export type MutationCreateProductOptionGroupArgs = {
input: CreateProductOptionGroupInput
};
Expand All @@ -1975,11 +1985,6 @@ export type MutationUpdateProductOptionArgs = {
};


export type MutationUpdatePaymentMethodArgs = {
input: UpdatePaymentMethodInput
};


export type MutationCreateProductArgs = {
input: CreateProductInput
};
Expand Down Expand Up @@ -2358,7 +2363,14 @@ export type Product = Node & {
translations: Array<ProductTranslation>,
collections: Array<Collection>,
enabled: Scalars['Boolean'],
customFields?: Maybe<Scalars['JSON']>,
customFields?: Maybe<ProductCustomFields>,
};

export type ProductCustomFields = {
__typename?: 'ProductCustomFields',
nickname?: Maybe<Scalars['String']>,
localNickname?: Maybe<Scalars['String']>,
expires?: Maybe<Scalars['DateTime']>,
};

export type ProductFilterParameter = {
Expand All @@ -2369,6 +2381,9 @@ export type ProductFilterParameter = {
slug?: Maybe<StringOperators>,
description?: Maybe<StringOperators>,
enabled?: Maybe<BooleanOperators>,
nickname?: Maybe<StringOperators>,
localNickname?: Maybe<StringOperators>,
expires?: Maybe<DateOperators>,
};

export type ProductList = PaginatedList & {
Expand Down Expand Up @@ -2449,6 +2464,9 @@ export type ProductSortParameter = {
name?: Maybe<SortOrder>,
slug?: Maybe<SortOrder>,
description?: Maybe<SortOrder>,
nickname?: Maybe<SortOrder>,
localNickname?: Maybe<SortOrder>,
expires?: Maybe<SortOrder>,
};

export type ProductTranslation = {
Expand All @@ -2460,6 +2478,16 @@ export type ProductTranslation = {
name: Scalars['String'],
slug: Scalars['String'],
description: Scalars['String'],
customFields?: Maybe<ProductTranslationCustomFields>,
};

export type ProductTranslationCustomFields = {
__typename?: 'ProductTranslationCustomFields',
localNickname?: Maybe<Scalars['String']>,
};

export type ProductTranslationCustomFieldsInput = {
localNickname?: Maybe<Scalars['String']>,
};

export type ProductTranslationInput = {
Expand All @@ -2468,7 +2496,7 @@ export type ProductTranslationInput = {
name?: Maybe<Scalars['String']>,
slug?: Maybe<Scalars['String']>,
description?: Maybe<Scalars['String']>,
customFields?: Maybe<Scalars['JSON']>,
customFields?: Maybe<ProductTranslationCustomFieldsInput>,
};

export type ProductVariant = Node & {
Expand Down Expand Up @@ -2619,18 +2647,18 @@ export type Query = {
facets: FacetList,
facet?: Maybe<Facet>,
globalSettings: GlobalSettings,
order?: Maybe<Order>,
orders: OrderList,
job?: Maybe<JobInfo>,
jobs: Array<JobInfo>,
productOptionGroups: Array<ProductOptionGroup>,
productOptionGroup?: Maybe<ProductOptionGroup>,
order?: Maybe<Order>,
orders: OrderList,
paymentMethods: PaymentMethodList,
paymentMethod?: Maybe<PaymentMethod>,
productOptionGroups: Array<ProductOptionGroup>,
productOptionGroup?: Maybe<ProductOptionGroup>,
search: SearchResponse,
products: ProductList,
/** Get a Product either by id or slug. If neither id nor slug is speicified, an error will result. */
product?: Maybe<Product>,
search: SearchResponse,
promotion?: Maybe<Promotion>,
promotions: PromotionList,
adjustmentOperations: AdjustmentOperations,
Expand Down Expand Up @@ -2723,6 +2751,16 @@ export type QueryFacetArgs = {
};


export type QueryJobArgs = {
jobId: Scalars['String']
};


export type QueryJobsArgs = {
input?: Maybe<JobListInput>
};


export type QueryOrderArgs = {
id: Scalars['ID']
};
Expand All @@ -2733,13 +2771,13 @@ export type QueryOrdersArgs = {
};


export type QueryJobArgs = {
jobId: Scalars['String']
export type QueryPaymentMethodsArgs = {
options?: Maybe<PaymentMethodListOptions>
};


export type QueryJobsArgs = {
input?: Maybe<JobListInput>
export type QueryPaymentMethodArgs = {
id: Scalars['ID']
};


Expand All @@ -2755,13 +2793,8 @@ export type QueryProductOptionGroupArgs = {
};


export type QueryPaymentMethodsArgs = {
options?: Maybe<PaymentMethodListOptions>
};


export type QueryPaymentMethodArgs = {
id: Scalars['ID']
export type QuerySearchArgs = {
input: SearchInput
};


Expand All @@ -2778,11 +2811,6 @@ export type QueryProductArgs = {
};


export type QuerySearchArgs = {
input: SearchInput
};


export type QueryPromotionArgs = {
id: Scalars['ID']
};
Expand Down Expand Up @@ -3090,6 +3118,13 @@ export type StringCustomFieldConfig = CustomField & {
label?: Maybe<Array<LocalizedString>>,
description?: Maybe<Array<LocalizedString>>,
pattern?: Maybe<Scalars['String']>,
options?: Maybe<Array<StringFieldOption>>,
};

export type StringFieldOption = {
__typename?: 'StringFieldOption',
value: Scalars['String'],
label?: Maybe<Array<LocalizedString>>,
};

export type StringOperators = {
Expand Down Expand Up @@ -3244,14 +3279,19 @@ export type UpdatePaymentMethodInput = {
configArgs?: Maybe<Array<ConfigArgInput>>,
};

export type UpdateProductCustomFieldsInput = {
nickname?: Maybe<Scalars['String']>,
expires?: Maybe<Scalars['DateTime']>,
};

export type UpdateProductInput = {
id: Scalars['ID'],
enabled?: Maybe<Scalars['Boolean']>,
featuredAssetId?: Maybe<Scalars['ID']>,
assetIds?: Maybe<Array<Scalars['ID']>>,
facetValueIds?: Maybe<Array<Scalars['ID']>>,
translations?: Maybe<Array<ProductTranslationInput>>,
customFields?: Maybe<Scalars['JSON']>,
customFields?: Maybe<UpdateProductCustomFieldsInput>,
};

export type UpdateProductOptionGroupInput = {
Expand Down
Loading

0 comments on commit bc0813e

Please sign in to comment.