Skip to content

Commit

Permalink
feat(core): Add custom error result on AuthenticationStrategy
Browse files Browse the repository at this point in the history
Closes #499
  • Loading branch information
macabeus authored Oct 19, 2020
1 parent 04a49bf commit d3ddb96
Show file tree
Hide file tree
Showing 20 changed files with 14,088 additions and 14,496 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,7 @@ export type InvalidCredentialsError = ErrorResult & {
__typename?: 'InvalidCredentialsError';
errorCode: ErrorCode;
message: Scalars['String'];
authenticationError: Scalars['String'];
};

/** Returned if there is an error in transitioning the Order state */
Expand Down
361 changes: 209 additions & 152 deletions packages/admin-ui/src/lib/core/src/common/introspection-result.ts
Original file line number Diff line number Diff line change
@@ -1,155 +1,212 @@
// tslint:disable

export interface PossibleTypesResultData {
possibleTypes: {
[key: string]: string[];
};
}
const result: PossibleTypesResultData = {
possibleTypes: {
CreateAssetResult: ['Asset', 'MimeTypeError'],
NativeAuthenticationResult: ['CurrentUser', 'InvalidCredentialsError', 'NativeAuthStrategyError'],
AuthenticationResult: ['CurrentUser', 'InvalidCredentialsError'],
CreateChannelResult: ['Channel', 'LanguageNotAvailableError'],
UpdateChannelResult: ['Channel', 'LanguageNotAvailableError'],
CreateCustomerResult: ['Customer', 'EmailAddressConflictError'],
UpdateCustomerResult: ['Customer', 'EmailAddressConflictError'],
UpdateGlobalSettingsResult: ['GlobalSettings', 'ChannelDefaultLanguageError'],
TransitionOrderToStateResult: ['Order', 'OrderStateTransitionError'],
SettlePaymentResult: [
'Payment',
'SettlePaymentError',
'PaymentStateTransitionError',
'OrderStateTransitionError',
],
AddFulfillmentToOrderResult: [
'Fulfillment',
'EmptyOrderLineSelectionError',
'ItemsAlreadyFulfilledError',
],
CancelOrderResult: [
'Order',
'EmptyOrderLineSelectionError',
'QuantityTooGreatError',
'MultipleOrderError',
'CancelActiveOrderError',
'OrderStateTransitionError',
],
RefundOrderResult: [
'Refund',
'QuantityTooGreatError',
'NothingToRefundError',
'OrderStateTransitionError',
'MultipleOrderError',
'PaymentOrderMismatchError',
'RefundOrderStateError',
'AlreadyRefundedError',
'RefundStateTransitionError',
],
SettleRefundResult: ['Refund', 'RefundStateTransitionError'],
TransitionFulfillmentToStateResult: ['Fulfillment', 'FulfillmentStateTransitionError'],
RemoveOptionGroupFromProductResult: ['Product', 'ProductOptionInUseError'],
CreatePromotionResult: ['Promotion', 'MissingConditionsError'],
UpdatePromotionResult: ['Promotion', 'MissingConditionsError'],
PaginatedList: [
'CustomerGroupList',
'JobList',
'PaymentMethodList',
'AdministratorList',
'AssetList',
'CollectionList',
'ProductVariantList',
'CountryList',
'CustomerList',
'FacetList',
'HistoryEntryList',
'OrderList',
'ProductList',
'PromotionList',
'RoleList',
'ShippingMethodList',
'TaxRateList',
],
Node: [
'Collection',
'Customer',
'Facet',
'Fulfillment',
'Job',
'Order',
'Product',
'ProductVariant',
'Address',
'Administrator',
'Asset',
'Channel',
'Country',
'CustomerGroup',
'FacetValue',
'HistoryEntry',
'OrderItem',
'OrderLine',
'Payment',
'Refund',
'PaymentMethod',
'ProductOptionGroup',
'ProductOption',
'Promotion',
'Role',
'ShippingMethod',
'StockAdjustment',
'Sale',
'Cancellation',
'Return',
'TaxCategory',
'TaxRate',
'User',
'AuthenticationMethod',
'Zone',
],
ErrorResult: [
'MimeTypeError',
'LanguageNotAvailableError',
'ChannelDefaultLanguageError',
'SettlePaymentError',
'EmptyOrderLineSelectionError',
'ItemsAlreadyFulfilledError',
'MultipleOrderError',
'CancelActiveOrderError',
'PaymentOrderMismatchError',
'RefundOrderStateError',
'NothingToRefundError',
'AlreadyRefundedError',
'QuantityTooGreatError',
'RefundStateTransitionError',
'PaymentStateTransitionError',
'FulfillmentStateTransitionError',
'ProductOptionInUseError',
'MissingConditionsError',
'NativeAuthStrategyError',
'InvalidCredentialsError',
'OrderStateTransitionError',
'EmailAddressConflictError',
],
CustomField: [
'StringCustomFieldConfig',
'LocaleStringCustomFieldConfig',
'IntCustomFieldConfig',
'FloatCustomFieldConfig',
'BooleanCustomFieldConfig',
'DateTimeCustomFieldConfig',
],
CustomFieldConfig: [
'StringCustomFieldConfig',
'LocaleStringCustomFieldConfig',
'IntCustomFieldConfig',
'FloatCustomFieldConfig',
'BooleanCustomFieldConfig',
'DateTimeCustomFieldConfig',
],
SearchResultPrice: ['PriceRange', 'SinglePrice'],
StockMovement: ['StockAdjustment', 'Sale', 'Cancellation', 'Return'],
StockMovementItem: ['StockAdjustment', 'Sale', 'Cancellation', 'Return'],
},
export interface PossibleTypesResultData {
possibleTypes: {
[key: string]: string[]
}
}
const result: PossibleTypesResultData = {
"possibleTypes": {
"CreateAssetResult": [
"Asset",
"MimeTypeError"
],
"NativeAuthenticationResult": [
"CurrentUser",
"InvalidCredentialsError",
"NativeAuthStrategyError"
],
"AuthenticationResult": [
"CurrentUser",
"InvalidCredentialsError"
],
"CreateChannelResult": [
"Channel",
"LanguageNotAvailableError"
],
"UpdateChannelResult": [
"Channel",
"LanguageNotAvailableError"
],
"CreateCustomerResult": [
"Customer",
"EmailAddressConflictError"
],
"UpdateCustomerResult": [
"Customer",
"EmailAddressConflictError"
],
"UpdateGlobalSettingsResult": [
"GlobalSettings",
"ChannelDefaultLanguageError"
],
"TransitionOrderToStateResult": [
"Order",
"OrderStateTransitionError"
],
"SettlePaymentResult": [
"Payment",
"SettlePaymentError",
"PaymentStateTransitionError",
"OrderStateTransitionError"
],
"AddFulfillmentToOrderResult": [
"Fulfillment",
"EmptyOrderLineSelectionError",
"ItemsAlreadyFulfilledError"
],
"CancelOrderResult": [
"Order",
"EmptyOrderLineSelectionError",
"QuantityTooGreatError",
"MultipleOrderError",
"CancelActiveOrderError",
"OrderStateTransitionError"
],
"RefundOrderResult": [
"Refund",
"QuantityTooGreatError",
"NothingToRefundError",
"OrderStateTransitionError",
"MultipleOrderError",
"PaymentOrderMismatchError",
"RefundOrderStateError",
"AlreadyRefundedError",
"RefundStateTransitionError"
],
"SettleRefundResult": [
"Refund",
"RefundStateTransitionError"
],
"TransitionFulfillmentToStateResult": [
"Fulfillment",
"FulfillmentStateTransitionError"
],
"RemoveOptionGroupFromProductResult": [
"Product",
"ProductOptionInUseError"
],
"CreatePromotionResult": [
"Promotion",
"MissingConditionsError"
],
"UpdatePromotionResult": [
"Promotion",
"MissingConditionsError"
],
"PaginatedList": [
"CustomerGroupList",
"JobList",
"PaymentMethodList",
"AdministratorList",
"AssetList",
"CollectionList",
"ProductVariantList",
"CountryList",
"CustomerList",
"FacetList",
"HistoryEntryList",
"OrderList",
"ProductList",
"PromotionList",
"RoleList",
"ShippingMethodList",
"TaxRateList"
],
"Node": [
"Collection",
"Customer",
"Facet",
"Fulfillment",
"Job",
"Order",
"Product",
"ProductVariant",
"Address",
"Administrator",
"Asset",
"Channel",
"Country",
"CustomerGroup",
"FacetValue",
"HistoryEntry",
"OrderItem",
"OrderLine",
"Payment",
"Refund",
"PaymentMethod",
"ProductOptionGroup",
"ProductOption",
"Promotion",
"Role",
"ShippingMethod",
"StockAdjustment",
"Sale",
"Cancellation",
"Return",
"TaxCategory",
"TaxRate",
"User",
"AuthenticationMethod",
"Zone"
],
"ErrorResult": [
"MimeTypeError",
"LanguageNotAvailableError",
"ChannelDefaultLanguageError",
"SettlePaymentError",
"EmptyOrderLineSelectionError",
"ItemsAlreadyFulfilledError",
"MultipleOrderError",
"CancelActiveOrderError",
"PaymentOrderMismatchError",
"RefundOrderStateError",
"NothingToRefundError",
"AlreadyRefundedError",
"QuantityTooGreatError",
"RefundStateTransitionError",
"PaymentStateTransitionError",
"FulfillmentStateTransitionError",
"ProductOptionInUseError",
"MissingConditionsError",
"NativeAuthStrategyError",
"InvalidCredentialsError",
"OrderStateTransitionError",
"EmailAddressConflictError"
],
"CustomField": [
"StringCustomFieldConfig",
"LocaleStringCustomFieldConfig",
"IntCustomFieldConfig",
"FloatCustomFieldConfig",
"BooleanCustomFieldConfig",
"DateTimeCustomFieldConfig"
],
"CustomFieldConfig": [
"StringCustomFieldConfig",
"LocaleStringCustomFieldConfig",
"IntCustomFieldConfig",
"FloatCustomFieldConfig",
"BooleanCustomFieldConfig",
"DateTimeCustomFieldConfig"
],
"SearchResultPrice": [
"PriceRange",
"SinglePrice"
],
"StockMovement": [
"StockAdjustment",
"Sale",
"Cancellation",
"Return"
],
"StockMovementItem": [
"StockAdjustment",
"Sale",
"Cancellation",
"Return"
]
}
};
export default result;
export default result;

Loading

0 comments on commit d3ddb96

Please sign in to comment.