diff --git a/packages/vendure/schema.d.ts b/packages/vendure/schema.d.ts index 9d6b53c52..6cad2a485 100644 --- a/packages/vendure/schema.d.ts +++ b/packages/vendure/schema.d.ts @@ -1,11 +1,14 @@ export type Maybe = T | null +export type InputMaybe = Maybe export type Exact = { [K in keyof T]: T[K] } -export type MakeOptional = Omit & - { [SubKey in K]?: Maybe } -export type MakeMaybe = Omit & - { [SubKey in K]: Maybe } +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe +} +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe +} /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { ID: string @@ -13,331 +16,86 @@ export type Scalars = { Boolean: boolean Int: number Float: number - /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ - JSON: any /** A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. */ DateTime: any + /** The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). */ + JSON: any /** The `Upload` scalar type represents a file upload. */ Upload: any } -export type Query = { - __typename?: 'Query' - /** The active Channel */ - activeChannel: Channel - /** The active Customer */ - activeCustomer?: Maybe - /** - * The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the - * state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this - * query will once again return `null`. - */ - activeOrder?: Maybe - /** An array of supported Countries */ - availableCountries: Array - /** A list of Collections available to the shop */ - collections: CollectionList - /** Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result. */ - collection?: Maybe - /** Returns a list of eligible shipping methods based on the current active Order */ - eligibleShippingMethods: Array - /** Returns a list of payment methods and their eligibility based on the current active Order */ - eligiblePaymentMethods: Array - /** Returns information about the current authenticated User */ - me?: Maybe - /** Returns the possible next states that the activeOrder can transition to */ - nextOrderStates: Array - /** - * Returns an Order based on the id. Note that in the Shop API, only orders belonging to the - * currently-authenticated User may be queried. - */ - order?: Maybe - /** - * Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) - * this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation - * screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing - * general anonymous access to Order data. - */ - orderByCode?: Maybe - /** Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result. */ - product?: Maybe - /** Get a list of Products */ - products: ProductList - /** Search Products based on the criteria set by the `SearchInput` */ - search: SearchResponse -} +export type ActiveOrderResult = NoActiveOrderError | Order -export type QueryCollectionsArgs = { - options?: Maybe -} - -export type QueryCollectionArgs = { - id?: Maybe - slug?: Maybe -} - -export type QueryOrderArgs = { - id: Scalars['ID'] -} - -export type QueryOrderByCodeArgs = { - code: Scalars['String'] -} - -export type QueryProductArgs = { - id?: Maybe - slug?: Maybe -} - -export type QueryProductsArgs = { - options?: Maybe -} - -export type QuerySearchArgs = { - input: SearchInput -} - -export type Mutation = { - __typename?: 'Mutation' - /** Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. */ - addItemToOrder: UpdateOrderItemsResult - /** Remove an OrderLine from the Order */ - removeOrderLine: RemoveOrderItemsResult - /** Remove all OrderLine from the Order */ - removeAllOrderLines: RemoveOrderItemsResult - /** Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. */ - adjustOrderLine: UpdateOrderItemsResult - /** Applies the given coupon code to the active Order */ - applyCouponCode: ApplyCouponCodeResult - /** Removes the given coupon code from the active Order */ - removeCouponCode?: Maybe - /** Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` */ - transitionOrderToState?: Maybe - /** Sets the shipping address for this order */ - setOrderShippingAddress: ActiveOrderResult - /** Sets the billing address for this order */ - setOrderBillingAddress: ActiveOrderResult - /** Allows any custom fields to be set for the active order */ - setOrderCustomFields: ActiveOrderResult - /** Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query */ - setOrderShippingMethod: SetOrderShippingMethodResult - /** Add a Payment to the Order */ - addPaymentToOrder: AddPaymentToOrderResult - /** Set the Customer for the Order. Required only if the Customer is not currently logged in */ - setCustomerForOrder: SetCustomerForOrderResult - /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */ - login: NativeAuthenticationResult - /** Authenticates the user using a named authentication strategy */ - authenticate: AuthenticationResult - /** End the current authenticated session */ - logout: Success - /** - * Register a Customer account with the given credentials. There are three possible registration flows: - * - * _If `authOptions.requireVerification` is set to `true`:_ - * - * 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That - * verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then - * verified and authenticated in one step. - * 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That - * verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosed password of the Customer. The Customer is then - * verified and authenticated in one step. - * - * _If `authOptions.requireVerification` is set to `false`:_ - * - * 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. - */ - registerCustomerAccount: RegisterCustomerAccountResult - /** Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. */ - refreshCustomerVerification: RefreshCustomerVerificationResult - /** Update an existing Customer */ - updateCustomer: Customer - /** Create a new Customer Address */ - createCustomerAddress: Address - /** Update an existing Address */ - updateCustomerAddress: Address - /** Delete an existing Address */ - deleteCustomerAddress: Success - /** - * Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. - * - * If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be - * provided here. - */ - verifyCustomerAccount: VerifyCustomerAccountResult - /** Update the password of the active Customer */ - updateCustomerPassword: UpdateCustomerPasswordResult - /** - * Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled - * (as is the default), then the `identifierChangeToken` will be assigned to the current User and - * a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email - * that verification token to the Customer, which is then used to verify the change of email address. - */ - requestUpdateCustomerEmailAddress: RequestUpdateCustomerEmailAddressResult - /** - * Confirm the update of the emailAddress with the provided token, which has been generated by the - * `requestUpdateCustomerEmailAddress` mutation. - */ - updateCustomerEmailAddress: UpdateCustomerEmailAddressResult - /** Requests a password reset email to be sent */ - requestPasswordReset?: Maybe - /** Resets a Customer's password based on the provided token */ - resetPassword: ResetPasswordResult -} - -export type MutationAddItemToOrderArgs = { - productVariantId: Scalars['ID'] - quantity: Scalars['Int'] -} - -export type MutationRemoveOrderLineArgs = { - orderLineId: Scalars['ID'] -} - -export type MutationAdjustOrderLineArgs = { - orderLineId: Scalars['ID'] - quantity: Scalars['Int'] -} - -export type MutationApplyCouponCodeArgs = { - couponCode: Scalars['String'] -} - -export type MutationRemoveCouponCodeArgs = { - couponCode: Scalars['String'] -} - -export type MutationTransitionOrderToStateArgs = { - state: Scalars['String'] -} - -export type MutationSetOrderShippingAddressArgs = { - input: CreateAddressInput -} - -export type MutationSetOrderBillingAddressArgs = { - input: CreateAddressInput -} - -export type MutationSetOrderCustomFieldsArgs = { - input: UpdateOrderInput -} - -export type MutationSetOrderShippingMethodArgs = { - shippingMethodId: Scalars['ID'] -} - -export type MutationAddPaymentToOrderArgs = { - input: PaymentInput -} - -export type MutationSetCustomerForOrderArgs = { - input: CreateCustomerInput -} - -export type MutationLoginArgs = { - username: Scalars['String'] - password: Scalars['String'] - rememberMe?: Maybe -} - -export type MutationAuthenticateArgs = { - input: AuthenticationInput - rememberMe?: Maybe -} - -export type MutationRegisterCustomerAccountArgs = { - input: RegisterCustomerInput -} - -export type MutationRefreshCustomerVerificationArgs = { - emailAddress: Scalars['String'] -} - -export type MutationUpdateCustomerArgs = { - input: UpdateCustomerInput -} - -export type MutationCreateCustomerAddressArgs = { - input: CreateAddressInput -} - -export type MutationUpdateCustomerAddressArgs = { - input: UpdateAddressInput -} - -export type MutationDeleteCustomerAddressArgs = { - id: Scalars['ID'] -} - -export type MutationVerifyCustomerAccountArgs = { - token: Scalars['String'] - password?: Maybe -} - -export type MutationUpdateCustomerPasswordArgs = { - currentPassword: Scalars['String'] - newPassword: Scalars['String'] -} - -export type MutationRequestUpdateCustomerEmailAddressArgs = { - password: Scalars['String'] - newEmailAddress: Scalars['String'] -} - -export type MutationUpdateCustomerEmailAddressArgs = { - token: Scalars['String'] -} - -export type MutationRequestPasswordResetArgs = { - emailAddress: Scalars['String'] -} - -export type MutationResetPasswordArgs = { - token: Scalars['String'] - password: Scalars['String'] -} +export type AddPaymentToOrderResult = + | IneligiblePaymentMethodError + | NoActiveOrderError + | Order + | OrderPaymentStateError + | OrderStateTransitionError + | PaymentDeclinedError + | PaymentFailedError export type Address = Node & { __typename?: 'Address' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - fullName?: Maybe + city?: Maybe company?: Maybe + country: Country + createdAt: Scalars['DateTime'] + customFields?: Maybe + defaultBillingAddress?: Maybe + defaultShippingAddress?: Maybe + fullName?: Maybe + id: Scalars['ID'] + phoneNumber?: Maybe + postalCode?: Maybe + province?: Maybe streetLine1: Scalars['String'] streetLine2?: Maybe - city?: Maybe - province?: Maybe - postalCode?: Maybe - country: Country - phoneNumber?: Maybe - defaultShippingAddress?: Maybe - defaultBillingAddress?: Maybe - customFields?: Maybe + updatedAt: Scalars['DateTime'] } +export type Adjustment = { + __typename?: 'Adjustment' + adjustmentSource: Scalars['String'] + amount: Scalars['Int'] + description: Scalars['String'] + type: AdjustmentType +} + +export enum AdjustmentType { + DistributedOrderPromotion = 'DISTRIBUTED_ORDER_PROMOTION', + Other = 'OTHER', + Promotion = 'PROMOTION', +} + +/** Returned when attempting to set the Customer for an Order when already logged in. */ +export type AlreadyLoggedInError = ErrorResult & { + __typename?: 'AlreadyLoggedInError' + errorCode: ErrorCode + message: Scalars['String'] +} + +export type ApplyCouponCodeResult = + | CouponCodeExpiredError + | CouponCodeInvalidError + | CouponCodeLimitError + | Order + export type Asset = Node & { __typename?: 'Asset' - id: Scalars['ID'] createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - name: Scalars['String'] - type: AssetType - fileSize: Scalars['Int'] - mimeType: Scalars['String'] - width: Scalars['Int'] - height: Scalars['Int'] - source: Scalars['String'] - preview: Scalars['String'] - focalPoint?: Maybe customFields?: Maybe -} - -export type Coordinate = { - __typename?: 'Coordinate' - x: Scalars['Float'] - y: Scalars['Float'] + fileSize: Scalars['Int'] + focalPoint?: Maybe + height: Scalars['Int'] + id: Scalars['ID'] + mimeType: Scalars['String'] + name: Scalars['String'] + preview: Scalars['String'] + source: Scalars['String'] + type: AssetType + updatedAt: Scalars['DateTime'] + width: Scalars['Int'] } export type AssetList = PaginatedList & { @@ -347,64 +105,89 @@ export type AssetList = PaginatedList & { } export enum AssetType { + Binary = 'BINARY', Image = 'IMAGE', Video = 'VIDEO', - Binary = 'BINARY', } -export type CurrentUser = { - __typename?: 'CurrentUser' - id: Scalars['ID'] - identifier: Scalars['String'] - channels: Array +export type AuthenticationInput = { + native?: InputMaybe } -export type CurrentUserChannel = { - __typename?: 'CurrentUserChannel' +export type AuthenticationMethod = Node & { + __typename?: 'AuthenticationMethod' + createdAt: Scalars['DateTime'] id: Scalars['ID'] - token: Scalars['String'] - code: Scalars['String'] - permissions: Array + strategy: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type AuthenticationResult = + | CurrentUser + | InvalidCredentialsError + | NotVerifiedError + +export type BooleanCustomFieldConfig = CustomField & { + __typename?: 'BooleanCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +/** Operators for filtering on a list of Boolean fields */ +export type BooleanListOperators = { + inList: Scalars['Boolean'] +} + +/** Operators for filtering on a Boolean field */ +export type BooleanOperators = { + eq?: InputMaybe } export type Channel = Node & { __typename?: 'Channel' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] code: Scalars['String'] - token: Scalars['String'] - defaultTaxZone?: Maybe - defaultShippingZone?: Maybe - defaultLanguageCode: LanguageCode + createdAt: Scalars['DateTime'] currencyCode: CurrencyCode - pricesIncludeTax: Scalars['Boolean'] customFields?: Maybe + defaultLanguageCode: LanguageCode + defaultShippingZone?: Maybe + defaultTaxZone?: Maybe + id: Scalars['ID'] + pricesIncludeTax: Scalars['Boolean'] + token: Scalars['String'] + updatedAt: Scalars['DateTime'] } export type Collection = Node & { __typename?: 'Collection' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode?: Maybe - name: Scalars['String'] - slug: Scalars['String'] + assets: Array breadcrumbs: Array - position: Scalars['Int'] + children?: Maybe> + createdAt: Scalars['DateTime'] + customFields?: Maybe description: Scalars['String'] featuredAsset?: Maybe - assets: Array - parent?: Maybe - children?: Maybe> filters: Array - translations: Array + id: Scalars['ID'] + languageCode?: Maybe + name: Scalars['String'] + parent?: Maybe + position: Scalars['Int'] productVariants: ProductVariantList - customFields?: Maybe + slug: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] } export type CollectionProductVariantsArgs = { - options?: Maybe + options?: InputMaybe } export type CollectionBreadcrumb = { @@ -414,15 +197,15 @@ export type CollectionBreadcrumb = { slug: Scalars['String'] } -export type CollectionTranslation = { - __typename?: 'CollectionTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] - slug: Scalars['String'] - description: Scalars['String'] +export type CollectionFilterParameter = { + createdAt?: InputMaybe + description?: InputMaybe + id?: InputMaybe + languageCode?: InputMaybe + name?: InputMaybe + position?: InputMaybe + slug?: InputMaybe + updatedAt?: InputMaybe } export type CollectionList = PaginatedList & { @@ -431,341 +214,48 @@ export type CollectionList = PaginatedList & { totalItems: Scalars['Int'] } -export type ProductVariantList = PaginatedList & { - __typename?: 'ProductVariantList' - items: Array - totalItems: Scalars['Int'] -} - -export type ProductVariantListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe -} - -export enum GlobalFlag { - True = 'TRUE', - False = 'FALSE', - Inherit = 'INHERIT', -} - -export enum AdjustmentType { - Promotion = 'PROMOTION', - DistributedOrderPromotion = 'DISTRIBUTED_ORDER_PROMOTION', -} - -export enum DeletionResult { - /** The entity was successfully deleted */ - Deleted = 'DELETED', - /** Deletion did not take place, reason given in message */ - NotDeleted = 'NOT_DELETED', +export type CollectionListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe } /** - * @description - * Permissions for administrators and customers. Used to control access to - * GraphQL resolvers via the {@link Allow} decorator. - * - * @docsCategory common + * Which Collections are present in the products returned + * by the search, and in what quantity. */ -export enum Permission { - Placeholder = 'Placeholder', - /** Authenticated means simply that the user is logged in */ - Authenticated = 'Authenticated', - /** SuperAdmin has unrestricted access to all operations */ - SuperAdmin = 'SuperAdmin', - /** Owner means the user owns this entity, e.g. a Customer's own Order */ - Owner = 'Owner', - /** Public means any unauthenticated user may perform the operation */ - Public = 'Public', - /** Grants permission to update GlobalSettings */ - UpdateGlobalSettings = 'UpdateGlobalSettings', - /** Grants permission to create Products, Facets, Assets, Collections */ - CreateCatalog = 'CreateCatalog', - /** Grants permission to read Products, Facets, Assets, Collections */ - ReadCatalog = 'ReadCatalog', - /** Grants permission to update Products, Facets, Assets, Collections */ - UpdateCatalog = 'UpdateCatalog', - /** Grants permission to delete Products, Facets, Assets, Collections */ - DeleteCatalog = 'DeleteCatalog', - /** Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ - CreateSettings = 'CreateSettings', - /** Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ - ReadSettings = 'ReadSettings', - /** Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ - UpdateSettings = 'UpdateSettings', - /** Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ - DeleteSettings = 'DeleteSettings', - /** Grants permission to create Administrator */ - CreateAdministrator = 'CreateAdministrator', - /** Grants permission to read Administrator */ - ReadAdministrator = 'ReadAdministrator', - /** Grants permission to update Administrator */ - UpdateAdministrator = 'UpdateAdministrator', - /** Grants permission to delete Administrator */ - DeleteAdministrator = 'DeleteAdministrator', - /** Grants permission to create Asset */ - CreateAsset = 'CreateAsset', - /** Grants permission to read Asset */ - ReadAsset = 'ReadAsset', - /** Grants permission to update Asset */ - UpdateAsset = 'UpdateAsset', - /** Grants permission to delete Asset */ - DeleteAsset = 'DeleteAsset', - /** Grants permission to create Channel */ - CreateChannel = 'CreateChannel', - /** Grants permission to read Channel */ - ReadChannel = 'ReadChannel', - /** Grants permission to update Channel */ - UpdateChannel = 'UpdateChannel', - /** Grants permission to delete Channel */ - DeleteChannel = 'DeleteChannel', - /** Grants permission to create Collection */ - CreateCollection = 'CreateCollection', - /** Grants permission to read Collection */ - ReadCollection = 'ReadCollection', - /** Grants permission to update Collection */ - UpdateCollection = 'UpdateCollection', - /** Grants permission to delete Collection */ - DeleteCollection = 'DeleteCollection', - /** Grants permission to create Country */ - CreateCountry = 'CreateCountry', - /** Grants permission to read Country */ - ReadCountry = 'ReadCountry', - /** Grants permission to update Country */ - UpdateCountry = 'UpdateCountry', - /** Grants permission to delete Country */ - DeleteCountry = 'DeleteCountry', - /** Grants permission to create Customer */ - CreateCustomer = 'CreateCustomer', - /** Grants permission to read Customer */ - ReadCustomer = 'ReadCustomer', - /** Grants permission to update Customer */ - UpdateCustomer = 'UpdateCustomer', - /** Grants permission to delete Customer */ - DeleteCustomer = 'DeleteCustomer', - /** Grants permission to create CustomerGroup */ - CreateCustomerGroup = 'CreateCustomerGroup', - /** Grants permission to read CustomerGroup */ - ReadCustomerGroup = 'ReadCustomerGroup', - /** Grants permission to update CustomerGroup */ - UpdateCustomerGroup = 'UpdateCustomerGroup', - /** Grants permission to delete CustomerGroup */ - DeleteCustomerGroup = 'DeleteCustomerGroup', - /** Grants permission to create Facet */ - CreateFacet = 'CreateFacet', - /** Grants permission to read Facet */ - ReadFacet = 'ReadFacet', - /** Grants permission to update Facet */ - UpdateFacet = 'UpdateFacet', - /** Grants permission to delete Facet */ - DeleteFacet = 'DeleteFacet', - /** Grants permission to create Order */ - CreateOrder = 'CreateOrder', - /** Grants permission to read Order */ - ReadOrder = 'ReadOrder', - /** Grants permission to update Order */ - UpdateOrder = 'UpdateOrder', - /** Grants permission to delete Order */ - DeleteOrder = 'DeleteOrder', - /** Grants permission to create PaymentMethod */ - CreatePaymentMethod = 'CreatePaymentMethod', - /** Grants permission to read PaymentMethod */ - ReadPaymentMethod = 'ReadPaymentMethod', - /** Grants permission to update PaymentMethod */ - UpdatePaymentMethod = 'UpdatePaymentMethod', - /** Grants permission to delete PaymentMethod */ - DeletePaymentMethod = 'DeletePaymentMethod', - /** Grants permission to create Product */ - CreateProduct = 'CreateProduct', - /** Grants permission to read Product */ - ReadProduct = 'ReadProduct', - /** Grants permission to update Product */ - UpdateProduct = 'UpdateProduct', - /** Grants permission to delete Product */ - DeleteProduct = 'DeleteProduct', - /** Grants permission to create Promotion */ - CreatePromotion = 'CreatePromotion', - /** Grants permission to read Promotion */ - ReadPromotion = 'ReadPromotion', - /** Grants permission to update Promotion */ - UpdatePromotion = 'UpdatePromotion', - /** Grants permission to delete Promotion */ - DeletePromotion = 'DeletePromotion', - /** Grants permission to create ShippingMethod */ - CreateShippingMethod = 'CreateShippingMethod', - /** Grants permission to read ShippingMethod */ - ReadShippingMethod = 'ReadShippingMethod', - /** Grants permission to update ShippingMethod */ - UpdateShippingMethod = 'UpdateShippingMethod', - /** Grants permission to delete ShippingMethod */ - DeleteShippingMethod = 'DeleteShippingMethod', - /** Grants permission to create Tag */ - CreateTag = 'CreateTag', - /** Grants permission to read Tag */ - ReadTag = 'ReadTag', - /** Grants permission to update Tag */ - UpdateTag = 'UpdateTag', - /** Grants permission to delete Tag */ - DeleteTag = 'DeleteTag', - /** Grants permission to create TaxCategory */ - CreateTaxCategory = 'CreateTaxCategory', - /** Grants permission to read TaxCategory */ - ReadTaxCategory = 'ReadTaxCategory', - /** Grants permission to update TaxCategory */ - UpdateTaxCategory = 'UpdateTaxCategory', - /** Grants permission to delete TaxCategory */ - DeleteTaxCategory = 'DeleteTaxCategory', - /** Grants permission to create TaxRate */ - CreateTaxRate = 'CreateTaxRate', - /** Grants permission to read TaxRate */ - ReadTaxRate = 'ReadTaxRate', - /** Grants permission to update TaxRate */ - UpdateTaxRate = 'UpdateTaxRate', - /** Grants permission to delete TaxRate */ - DeleteTaxRate = 'DeleteTaxRate', - /** Grants permission to create System */ - CreateSystem = 'CreateSystem', - /** Grants permission to read System */ - ReadSystem = 'ReadSystem', - /** Grants permission to update System */ - UpdateSystem = 'UpdateSystem', - /** Grants permission to delete System */ - DeleteSystem = 'DeleteSystem', - /** Grants permission to create Zone */ - CreateZone = 'CreateZone', - /** Grants permission to read Zone */ - ReadZone = 'ReadZone', - /** Grants permission to update Zone */ - UpdateZone = 'UpdateZone', - /** Grants permission to delete Zone */ - DeleteZone = 'DeleteZone', +export type CollectionResult = { + __typename?: 'CollectionResult' + collection: Collection + count: Scalars['Int'] } -export enum SortOrder { - Asc = 'ASC', - Desc = 'DESC', +export type CollectionSortParameter = { + createdAt?: InputMaybe + description?: InputMaybe + id?: InputMaybe + name?: InputMaybe + position?: InputMaybe + slug?: InputMaybe + updatedAt?: InputMaybe } -export enum ErrorCode { - UnknownError = 'UNKNOWN_ERROR', - NativeAuthStrategyError = 'NATIVE_AUTH_STRATEGY_ERROR', - InvalidCredentialsError = 'INVALID_CREDENTIALS_ERROR', - OrderStateTransitionError = 'ORDER_STATE_TRANSITION_ERROR', - EmailAddressConflictError = 'EMAIL_ADDRESS_CONFLICT_ERROR', - OrderLimitError = 'ORDER_LIMIT_ERROR', - NegativeQuantityError = 'NEGATIVE_QUANTITY_ERROR', - InsufficientStockError = 'INSUFFICIENT_STOCK_ERROR', - OrderModificationError = 'ORDER_MODIFICATION_ERROR', - IneligibleShippingMethodError = 'INELIGIBLE_SHIPPING_METHOD_ERROR', - OrderPaymentStateError = 'ORDER_PAYMENT_STATE_ERROR', - IneligiblePaymentMethodError = 'INELIGIBLE_PAYMENT_METHOD_ERROR', - PaymentFailedError = 'PAYMENT_FAILED_ERROR', - PaymentDeclinedError = 'PAYMENT_DECLINED_ERROR', - CouponCodeInvalidError = 'COUPON_CODE_INVALID_ERROR', - CouponCodeExpiredError = 'COUPON_CODE_EXPIRED_ERROR', - CouponCodeLimitError = 'COUPON_CODE_LIMIT_ERROR', - AlreadyLoggedInError = 'ALREADY_LOGGED_IN_ERROR', - MissingPasswordError = 'MISSING_PASSWORD_ERROR', - PasswordAlreadySetError = 'PASSWORD_ALREADY_SET_ERROR', - VerificationTokenInvalidError = 'VERIFICATION_TOKEN_INVALID_ERROR', - VerificationTokenExpiredError = 'VERIFICATION_TOKEN_EXPIRED_ERROR', - IdentifierChangeTokenInvalidError = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR', - IdentifierChangeTokenExpiredError = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR', - PasswordResetTokenInvalidError = 'PASSWORD_RESET_TOKEN_INVALID_ERROR', - PasswordResetTokenExpiredError = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR', - NotVerifiedError = 'NOT_VERIFIED_ERROR', - NoActiveOrderError = 'NO_ACTIVE_ORDER_ERROR', -} - -export enum LogicalOperator { - And = 'AND', - Or = 'OR', -} - -/** Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */ -export type NativeAuthStrategyError = ErrorResult & { - __typename?: 'NativeAuthStrategyError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Returned if the user authentication credentials are not valid */ -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 */ -export type OrderStateTransitionError = ErrorResult & { - __typename?: 'OrderStateTransitionError' - errorCode: ErrorCode - message: Scalars['String'] - transitionError: Scalars['String'] - fromState: Scalars['String'] - toState: Scalars['String'] -} - -/** Retured when attemting to create a Customer with an email address already registered to an existing User. */ -export type EmailAddressConflictError = ErrorResult & { - __typename?: 'EmailAddressConflictError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Retured when the maximum order size limit has been reached. */ -export type OrderLimitError = ErrorResult & { - __typename?: 'OrderLimitError' - errorCode: ErrorCode - message: Scalars['String'] - maxItems: Scalars['Int'] -} - -/** Retured when attemting to set a negative OrderLine quantity. */ -export type NegativeQuantityError = ErrorResult & { - __typename?: 'NegativeQuantityError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Returned when attempting to add more items to the Order than are available */ -export type InsufficientStockError = ErrorResult & { - __typename?: 'InsufficientStockError' - errorCode: ErrorCode - message: Scalars['String'] - quantityAvailable: Scalars['Int'] - order: Order -} - -export type PaginatedList = { - items: Array - totalItems: Scalars['Int'] -} - -export type Node = { +export type CollectionTranslation = { + __typename?: 'CollectionTranslation' + createdAt: Scalars['DateTime'] + description: Scalars['String'] id: Scalars['ID'] -} - -export type ErrorResult = { - errorCode: ErrorCode - message: Scalars['String'] -} - -export type Adjustment = { - __typename?: 'Adjustment' - adjustmentSource: Scalars['String'] - type: AdjustmentType - description: Scalars['String'] - amount: Scalars['Int'] -} - -export type TaxLine = { - __typename?: 'TaxLine' - description: Scalars['String'] - taxRate: Scalars['Float'] + languageCode: LanguageCode + name: Scalars['String'] + slug: Scalars['String'] + updatedAt: Scalars['DateTime'] } export type ConfigArg = { @@ -776,204 +266,57 @@ export type ConfigArg = { export type ConfigArgDefinition = { __typename?: 'ConfigArgDefinition' - name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - required: Scalars['Boolean'] defaultValue?: Maybe - label?: Maybe description?: Maybe + label?: Maybe + list: Scalars['Boolean'] + name: Scalars['String'] + required: Scalars['Boolean'] + type: Scalars['String'] ui?: Maybe } -export type ConfigurableOperation = { - __typename?: 'ConfigurableOperation' - code: Scalars['String'] - args: Array -} - -export type ConfigurableOperationDefinition = { - __typename?: 'ConfigurableOperationDefinition' - code: Scalars['String'] - args: Array - description: Scalars['String'] -} - -export type DeletionResponse = { - __typename?: 'DeletionResponse' - result: DeletionResult - message?: Maybe -} - export type ConfigArgInput = { name: Scalars['String'] /** A JSON stringified representation of the actual value */ value: Scalars['String'] } +export type ConfigurableOperation = { + __typename?: 'ConfigurableOperation' + args: Array + code: Scalars['String'] +} + +export type ConfigurableOperationDefinition = { + __typename?: 'ConfigurableOperationDefinition' + args: Array + code: Scalars['String'] + description: Scalars['String'] +} + export type ConfigurableOperationInput = { - code: Scalars['String'] arguments: Array -} - -export type StringOperators = { - eq?: Maybe - notEq?: Maybe - contains?: Maybe - notContains?: Maybe - in?: Maybe> - notIn?: Maybe> - regex?: Maybe -} - -export type BooleanOperators = { - eq?: Maybe -} - -export type NumberRange = { - start: Scalars['Float'] - end: Scalars['Float'] -} - -export type NumberOperators = { - eq?: Maybe - lt?: Maybe - lte?: Maybe - gt?: Maybe - gte?: Maybe - between?: Maybe -} - -export type DateRange = { - start: Scalars['DateTime'] - end: Scalars['DateTime'] -} - -export type DateOperators = { - eq?: Maybe - before?: Maybe - after?: Maybe - between?: Maybe -} - -/** - * Used to construct boolean expressions for filtering search results - * by FacetValue ID. Examples: - * - * * ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` - * * ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` - * * ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` - */ -export type FacetValueFilterInput = { - and?: Maybe - or?: Maybe> -} - -export type SearchInput = { - term?: Maybe - facetValueIds?: Maybe> - facetValueOperator?: Maybe - facetValueFilters?: Maybe> - collectionId?: Maybe - collectionSlug?: Maybe - groupByProduct?: Maybe - take?: Maybe - skip?: Maybe - sort?: Maybe -} - -export type SearchResultSortParameter = { - name?: Maybe - price?: Maybe -} - -export type CreateCustomerInput = { - title?: Maybe - firstName: Scalars['String'] - lastName: Scalars['String'] - phoneNumber?: Maybe - emailAddress: Scalars['String'] - customFields?: Maybe -} - -export type CreateAddressInput = { - fullName?: Maybe - company?: Maybe - streetLine1: Scalars['String'] - streetLine2?: Maybe - city?: Maybe - province?: Maybe - postalCode?: Maybe - countryCode: Scalars['String'] - phoneNumber?: Maybe - defaultShippingAddress?: Maybe - defaultBillingAddress?: Maybe - customFields?: Maybe -} - -export type UpdateAddressInput = { - id: Scalars['ID'] - fullName?: Maybe - company?: Maybe - streetLine1?: Maybe - streetLine2?: Maybe - city?: Maybe - province?: Maybe - postalCode?: Maybe - countryCode?: Maybe - phoneNumber?: Maybe - defaultShippingAddress?: Maybe - defaultBillingAddress?: Maybe - customFields?: Maybe -} - -/** Indicates that an operation succeeded, where we do not want to return any more specific information. */ -export type Success = { - __typename?: 'Success' - success: Scalars['Boolean'] -} - -export type ShippingMethodQuote = { - __typename?: 'ShippingMethodQuote' - id: Scalars['ID'] - price: Scalars['Int'] - priceWithTax: Scalars['Int'] code: Scalars['String'] - name: Scalars['String'] - description: Scalars['String'] - /** Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult */ - metadata?: Maybe } -export type PaymentMethodQuote = { - __typename?: 'PaymentMethodQuote' - id: Scalars['ID'] - code: Scalars['String'] - name: Scalars['String'] - description: Scalars['String'] - isEligible: Scalars['Boolean'] - eligibilityMessage?: Maybe +export type Coordinate = { + __typename?: 'Coordinate' + x: Scalars['Float'] + y: Scalars['Float'] } export type Country = Node & { __typename?: 'Country' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode code: Scalars['String'] - name: Scalars['String'] - enabled: Scalars['Boolean'] - translations: Array -} - -export type CountryTranslation = { - __typename?: 'CountryTranslation' - id: Scalars['ID'] createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] + customFields?: Maybe + enabled: Scalars['Boolean'] + id: Scalars['ID'] languageCode: LanguageCode name: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] } export type CountryList = PaginatedList & { @@ -982,6 +325,64 @@ export type CountryList = PaginatedList & { totalItems: Scalars['Int'] } +export type CountryTranslation = { + __typename?: 'CountryTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeExpiredError = ErrorResult & { + __typename?: 'CouponCodeExpiredError' + couponCode: Scalars['String'] + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeInvalidError = ErrorResult & { + __typename?: 'CouponCodeInvalidError' + couponCode: Scalars['String'] + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned if the provided coupon code is invalid */ +export type CouponCodeLimitError = ErrorResult & { + __typename?: 'CouponCodeLimitError' + couponCode: Scalars['String'] + errorCode: ErrorCode + limit: Scalars['Int'] + message: Scalars['String'] +} + +export type CreateAddressInput = { + city?: InputMaybe + company?: InputMaybe + countryCode: Scalars['String'] + customFields?: InputMaybe + defaultBillingAddress?: InputMaybe + defaultShippingAddress?: InputMaybe + fullName?: InputMaybe + phoneNumber?: InputMaybe + postalCode?: InputMaybe + province?: InputMaybe + streetLine1: Scalars['String'] + streetLine2?: InputMaybe +} + +export type CreateCustomerInput = { + customFields?: InputMaybe + emailAddress: Scalars['String'] + firstName: Scalars['String'] + lastName: Scalars['String'] + phoneNumber?: InputMaybe + title?: InputMaybe +} + /** * @description * ISO 4217 currency code @@ -1305,172 +706,86 @@ export enum CurrencyCode { Zwl = 'ZWL', } +export type CurrentUser = { + __typename?: 'CurrentUser' + channels: Array + id: Scalars['ID'] + identifier: Scalars['String'] +} + +export type CurrentUserChannel = { + __typename?: 'CurrentUserChannel' + code: Scalars['String'] + id: Scalars['ID'] + permissions: Array + token: Scalars['String'] +} + export type CustomField = { - name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - label?: Maybe> description?: Maybe> - readonly?: Maybe internal?: Maybe -} - -export type StringCustomFieldConfig = CustomField & { - __typename?: 'StringCustomFieldConfig' - name: Scalars['String'] - type: Scalars['String'] + label?: Maybe> list: Scalars['Boolean'] - length?: Maybe - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe - pattern?: Maybe - options?: Maybe> -} - -export type StringFieldOption = { - __typename?: 'StringFieldOption' - value: Scalars['String'] - label?: Maybe> -} - -export type LocaleStringCustomFieldConfig = CustomField & { - __typename?: 'LocaleStringCustomFieldConfig' name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - length?: Maybe - label?: Maybe> - description?: Maybe> + nullable?: Maybe readonly?: Maybe - internal?: Maybe - pattern?: Maybe -} - -export type IntCustomFieldConfig = CustomField & { - __typename?: 'IntCustomFieldConfig' - name: Scalars['String'] type: Scalars['String'] - list: Scalars['Boolean'] - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe - min?: Maybe - max?: Maybe - step?: Maybe -} - -export type FloatCustomFieldConfig = CustomField & { - __typename?: 'FloatCustomFieldConfig' - name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe - min?: Maybe - max?: Maybe - step?: Maybe -} - -export type BooleanCustomFieldConfig = CustomField & { - __typename?: 'BooleanCustomFieldConfig' - name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe -} - -/** - * Expects the same validation formats as the `` 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'] - list: Scalars['Boolean'] - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe - min?: Maybe - max?: Maybe - step?: Maybe -} - -export type RelationCustomFieldConfig = CustomField & { - __typename?: 'RelationCustomFieldConfig' - name: Scalars['String'] - type: Scalars['String'] - list: Scalars['Boolean'] - label?: Maybe> - description?: Maybe> - readonly?: Maybe - internal?: Maybe - entity: Scalars['String'] - scalarFields: Array -} - -export type LocalizedString = { - __typename?: 'LocalizedString' - languageCode: LanguageCode - value: Scalars['String'] + ui?: Maybe } export type CustomFieldConfig = - | StringCustomFieldConfig - | LocaleStringCustomFieldConfig - | IntCustomFieldConfig - | FloatCustomFieldConfig | BooleanCustomFieldConfig | DateTimeCustomFieldConfig + | FloatCustomFieldConfig + | IntCustomFieldConfig + | LocaleStringCustomFieldConfig | RelationCustomFieldConfig - -export type CustomerGroup = Node & { - __typename?: 'CustomerGroup' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - name: Scalars['String'] - customers: CustomerList -} - -export type CustomerGroupCustomersArgs = { - options?: Maybe -} - -export type CustomerListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe -} + | StringCustomFieldConfig + | TextCustomFieldConfig export type Customer = Node & { __typename?: 'Customer' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - title?: Maybe - firstName: Scalars['String'] - lastName: Scalars['String'] - phoneNumber?: Maybe - emailAddress: Scalars['String'] addresses?: Maybe> - orders: OrderList - user?: Maybe + createdAt: Scalars['DateTime'] customFields?: Maybe + emailAddress: Scalars['String'] + firstName: Scalars['String'] + id: Scalars['ID'] + lastName: Scalars['String'] + orders: OrderList + phoneNumber?: Maybe + title?: Maybe + updatedAt: Scalars['DateTime'] + user?: Maybe } export type CustomerOrdersArgs = { - options?: Maybe + options?: InputMaybe +} + +export type CustomerFilterParameter = { + createdAt?: InputMaybe + emailAddress?: InputMaybe + firstName?: InputMaybe + id?: InputMaybe + lastName?: InputMaybe + phoneNumber?: InputMaybe + title?: InputMaybe + updatedAt?: InputMaybe +} + +export type CustomerGroup = Node & { + __typename?: 'CustomerGroup' + createdAt: Scalars['DateTime'] + customFields?: Maybe + customers: CustomerList + id: Scalars['ID'] + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type CustomerGroupCustomersArgs = { + options?: InputMaybe } export type CustomerList = PaginatedList & { @@ -1479,48 +794,154 @@ export type CustomerList = PaginatedList & { totalItems: Scalars['Int'] } -export type FacetValue = Node & { - __typename?: 'FacetValue' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - facet: Facet - name: Scalars['String'] - code: Scalars['String'] - translations: Array - customFields?: Maybe +export type CustomerListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe } -export type FacetValueTranslation = { - __typename?: 'FacetValueTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode +export type CustomerSortParameter = { + createdAt?: InputMaybe + emailAddress?: InputMaybe + firstName?: InputMaybe + id?: InputMaybe + lastName?: InputMaybe + phoneNumber?: InputMaybe + title?: InputMaybe + updatedAt?: InputMaybe +} + +/** Operators for filtering on a list of Date fields */ +export type DateListOperators = { + inList: Scalars['DateTime'] +} + +/** Operators for filtering on a DateTime field */ +export type DateOperators = { + after?: InputMaybe + before?: InputMaybe + between?: InputMaybe + eq?: InputMaybe +} + +export type DateRange = { + end: Scalars['DateTime'] + start: Scalars['DateTime'] +} + +/** + * Expects the same validation formats as the `` HTML element. + * See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes + */ +export type DateTimeCustomFieldConfig = CustomField & { + __typename?: 'DateTimeCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + max?: Maybe + min?: Maybe name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + step?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +export type DeletionResponse = { + __typename?: 'DeletionResponse' + message?: Maybe + result: DeletionResult +} + +export enum DeletionResult { + /** The entity was successfully deleted */ + Deleted = 'DELETED', + /** Deletion did not take place, reason given in message */ + NotDeleted = 'NOT_DELETED', +} + +export type Discount = { + __typename?: 'Discount' + adjustmentSource: Scalars['String'] + amount: Scalars['Int'] + amountWithTax: Scalars['Int'] + description: Scalars['String'] + type: AdjustmentType +} + +/** Returned when attempting to create a Customer with an email address already registered to an existing User. */ +export type EmailAddressConflictError = ErrorResult & { + __typename?: 'EmailAddressConflictError' + errorCode: ErrorCode + message: Scalars['String'] +} + +export enum ErrorCode { + AlreadyLoggedInError = 'ALREADY_LOGGED_IN_ERROR', + CouponCodeExpiredError = 'COUPON_CODE_EXPIRED_ERROR', + CouponCodeInvalidError = 'COUPON_CODE_INVALID_ERROR', + CouponCodeLimitError = 'COUPON_CODE_LIMIT_ERROR', + EmailAddressConflictError = 'EMAIL_ADDRESS_CONFLICT_ERROR', + IdentifierChangeTokenExpiredError = 'IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR', + IdentifierChangeTokenInvalidError = 'IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR', + IneligiblePaymentMethodError = 'INELIGIBLE_PAYMENT_METHOD_ERROR', + IneligibleShippingMethodError = 'INELIGIBLE_SHIPPING_METHOD_ERROR', + InsufficientStockError = 'INSUFFICIENT_STOCK_ERROR', + InvalidCredentialsError = 'INVALID_CREDENTIALS_ERROR', + MissingPasswordError = 'MISSING_PASSWORD_ERROR', + NativeAuthStrategyError = 'NATIVE_AUTH_STRATEGY_ERROR', + NegativeQuantityError = 'NEGATIVE_QUANTITY_ERROR', + NotVerifiedError = 'NOT_VERIFIED_ERROR', + NoActiveOrderError = 'NO_ACTIVE_ORDER_ERROR', + OrderLimitError = 'ORDER_LIMIT_ERROR', + OrderModificationError = 'ORDER_MODIFICATION_ERROR', + OrderPaymentStateError = 'ORDER_PAYMENT_STATE_ERROR', + OrderStateTransitionError = 'ORDER_STATE_TRANSITION_ERROR', + PasswordAlreadySetError = 'PASSWORD_ALREADY_SET_ERROR', + PasswordResetTokenExpiredError = 'PASSWORD_RESET_TOKEN_EXPIRED_ERROR', + PasswordResetTokenInvalidError = 'PASSWORD_RESET_TOKEN_INVALID_ERROR', + PasswordValidationError = 'PASSWORD_VALIDATION_ERROR', + PaymentDeclinedError = 'PAYMENT_DECLINED_ERROR', + PaymentFailedError = 'PAYMENT_FAILED_ERROR', + UnknownError = 'UNKNOWN_ERROR', + VerificationTokenExpiredError = 'VERIFICATION_TOKEN_EXPIRED_ERROR', + VerificationTokenInvalidError = 'VERIFICATION_TOKEN_INVALID_ERROR', +} + +export type ErrorResult = { + errorCode: ErrorCode + message: Scalars['String'] } export type Facet = Node & { __typename?: 'Facet' - id: Scalars['ID'] + code: Scalars['String'] createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] languageCode: LanguageCode name: Scalars['String'] - code: Scalars['String'] - values: Array translations: Array - customFields?: Maybe + updatedAt: Scalars['DateTime'] + values: Array } -export type FacetTranslation = { - __typename?: 'FacetTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] +export type FacetFilterParameter = { + code?: InputMaybe + createdAt?: InputMaybe + id?: InputMaybe + languageCode?: InputMaybe + name?: InputMaybe + updatedAt?: InputMaybe } export type FacetList = PaginatedList & { @@ -1529,40 +950,129 @@ export type FacetList = PaginatedList & { totalItems: Scalars['Int'] } -export type HistoryEntry = Node & { - __typename?: 'HistoryEntry' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - type: HistoryEntryType - data: Scalars['JSON'] +export type FacetListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe } -export enum HistoryEntryType { - CustomerRegistered = 'CUSTOMER_REGISTERED', - CustomerVerified = 'CUSTOMER_VERIFIED', - CustomerDetailUpdated = 'CUSTOMER_DETAIL_UPDATED', - CustomerAddedToGroup = 'CUSTOMER_ADDED_TO_GROUP', - CustomerRemovedFromGroup = 'CUSTOMER_REMOVED_FROM_GROUP', - CustomerAddressCreated = 'CUSTOMER_ADDRESS_CREATED', - CustomerAddressUpdated = 'CUSTOMER_ADDRESS_UPDATED', - CustomerAddressDeleted = 'CUSTOMER_ADDRESS_DELETED', - CustomerPasswordUpdated = 'CUSTOMER_PASSWORD_UPDATED', - CustomerPasswordResetRequested = 'CUSTOMER_PASSWORD_RESET_REQUESTED', - CustomerPasswordResetVerified = 'CUSTOMER_PASSWORD_RESET_VERIFIED', - CustomerEmailUpdateRequested = 'CUSTOMER_EMAIL_UPDATE_REQUESTED', - CustomerEmailUpdateVerified = 'CUSTOMER_EMAIL_UPDATE_VERIFIED', - CustomerNote = 'CUSTOMER_NOTE', - OrderStateTransition = 'ORDER_STATE_TRANSITION', - OrderPaymentTransition = 'ORDER_PAYMENT_TRANSITION', - OrderFulfillment = 'ORDER_FULFILLMENT', - OrderCancellation = 'ORDER_CANCELLATION', - OrderRefundTransition = 'ORDER_REFUND_TRANSITION', - OrderFulfillmentTransition = 'ORDER_FULFILLMENT_TRANSITION', - OrderNote = 'ORDER_NOTE', - OrderCouponApplied = 'ORDER_COUPON_APPLIED', - OrderCouponRemoved = 'ORDER_COUPON_REMOVED', - OrderModified = 'ORDER_MODIFIED', +export type FacetSortParameter = { + code?: InputMaybe + createdAt?: InputMaybe + id?: InputMaybe + name?: InputMaybe + updatedAt?: InputMaybe +} + +export type FacetTranslation = { + __typename?: 'FacetTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type FacetValue = Node & { + __typename?: 'FacetValue' + code: Scalars['String'] + createdAt: Scalars['DateTime'] + customFields?: Maybe + facet: Facet + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] +} + +/** + * Used to construct boolean expressions for filtering search results + * by FacetValue ID. Examples: + * + * * ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` + * * ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` + * * ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` + */ +export type FacetValueFilterInput = { + and?: InputMaybe + or?: InputMaybe> +} + +/** + * Which FacetValues are present in the products returned + * by the search, and in what quantity. + */ +export type FacetValueResult = { + __typename?: 'FacetValueResult' + count: Scalars['Int'] + facetValue: FacetValue +} + +export type FacetValueTranslation = { + __typename?: 'FacetValueTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type FloatCustomFieldConfig = CustomField & { + __typename?: 'FloatCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + max?: Maybe + min?: Maybe + name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + step?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +export type Fulfillment = Node & { + __typename?: 'Fulfillment' + createdAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] + method: Scalars['String'] + orderItems: Array + state: Scalars['String'] + trackingCode?: Maybe + updatedAt: Scalars['DateTime'] +} + +export enum GlobalFlag { + False = 'FALSE', + Inherit = 'INHERIT', + True = 'TRUE', +} + +export type HistoryEntry = Node & { + __typename?: 'HistoryEntry' + createdAt: Scalars['DateTime'] + data: Scalars['JSON'] + id: Scalars['ID'] + type: HistoryEntryType + updatedAt: Scalars['DateTime'] +} + +export type HistoryEntryFilterParameter = { + createdAt?: InputMaybe + id?: InputMaybe + type?: InputMaybe + updatedAt?: InputMaybe } export type HistoryEntryList = PaginatedList & { @@ -1572,10 +1082,130 @@ export type HistoryEntryList = PaginatedList & { } export type HistoryEntryListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe +} + +export type HistoryEntrySortParameter = { + createdAt?: InputMaybe + id?: InputMaybe + updatedAt?: InputMaybe +} + +export enum HistoryEntryType { + CustomerAddedToGroup = 'CUSTOMER_ADDED_TO_GROUP', + CustomerAddressCreated = 'CUSTOMER_ADDRESS_CREATED', + CustomerAddressDeleted = 'CUSTOMER_ADDRESS_DELETED', + CustomerAddressUpdated = 'CUSTOMER_ADDRESS_UPDATED', + CustomerDetailUpdated = 'CUSTOMER_DETAIL_UPDATED', + CustomerEmailUpdateRequested = 'CUSTOMER_EMAIL_UPDATE_REQUESTED', + CustomerEmailUpdateVerified = 'CUSTOMER_EMAIL_UPDATE_VERIFIED', + CustomerNote = 'CUSTOMER_NOTE', + CustomerPasswordResetRequested = 'CUSTOMER_PASSWORD_RESET_REQUESTED', + CustomerPasswordResetVerified = 'CUSTOMER_PASSWORD_RESET_VERIFIED', + CustomerPasswordUpdated = 'CUSTOMER_PASSWORD_UPDATED', + CustomerRegistered = 'CUSTOMER_REGISTERED', + CustomerRemovedFromGroup = 'CUSTOMER_REMOVED_FROM_GROUP', + CustomerVerified = 'CUSTOMER_VERIFIED', + OrderCancellation = 'ORDER_CANCELLATION', + OrderCouponApplied = 'ORDER_COUPON_APPLIED', + OrderCouponRemoved = 'ORDER_COUPON_REMOVED', + OrderFulfillment = 'ORDER_FULFILLMENT', + OrderFulfillmentTransition = 'ORDER_FULFILLMENT_TRANSITION', + OrderModified = 'ORDER_MODIFIED', + OrderNote = 'ORDER_NOTE', + OrderPaymentTransition = 'ORDER_PAYMENT_TRANSITION', + OrderRefundTransition = 'ORDER_REFUND_TRANSITION', + OrderStateTransition = 'ORDER_STATE_TRANSITION', +} + +/** Operators for filtering on a list of ID fields */ +export type IdListOperators = { + inList: Scalars['ID'] +} + +/** Operators for filtering on an ID field */ +export type IdOperators = { + eq?: InputMaybe + in?: InputMaybe> + notEq?: InputMaybe + notIn?: InputMaybe> +} + +/** + * Returned if the token used to change a Customer's email address is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type IdentifierChangeTokenExpiredError = ErrorResult & { + __typename?: 'IdentifierChangeTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if the token used to change a Customer's email address is either + * invalid or does not match any expected tokens. + */ +export type IdentifierChangeTokenInvalidError = ErrorResult & { + __typename?: 'IdentifierChangeTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. */ +export type IneligiblePaymentMethodError = ErrorResult & { + __typename?: 'IneligiblePaymentMethodError' + eligibilityCheckerMessage?: Maybe + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to set a ShippingMethod for which the Order is not eligible */ +export type IneligibleShippingMethodError = ErrorResult & { + __typename?: 'IneligibleShippingMethodError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add more items to the Order than are available */ +export type InsufficientStockError = ErrorResult & { + __typename?: 'InsufficientStockError' + errorCode: ErrorCode + message: Scalars['String'] + order: Order + quantityAvailable: Scalars['Int'] +} + +export type IntCustomFieldConfig = CustomField & { + __typename?: 'IntCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + max?: Maybe + min?: Maybe + name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + step?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +/** Returned if the user authentication credentials are not valid */ +export type InvalidCredentialsError = ErrorResult & { + __typename?: 'InvalidCredentialsError' + authenticationError: Scalars['String'] + errorCode: ErrorCode + message: Scalars['String'] } /** @@ -1592,62 +1222,54 @@ export enum LanguageCode { Af = 'af', /** Akan */ Ak = 'ak', - /** Albanian */ - Sq = 'sq', /** Amharic */ Am = 'am', /** Arabic */ Ar = 'ar', - /** Armenian */ - Hy = 'hy', /** Assamese */ As = 'as', /** Azerbaijani */ Az = 'az', + /** Belarusian */ + Be = 'be', + /** Bulgarian */ + Bg = 'bg', /** Bambara */ Bm = 'bm', /** Bangla */ Bn = 'bn', - /** Basque */ - Eu = 'eu', - /** Belarusian */ - Be = 'be', - /** Bosnian */ - Bs = 'bs', + /** Tibetan */ + Bo = 'bo', /** Breton */ Br = 'br', - /** Bulgarian */ - Bg = 'bg', - /** Burmese */ - My = 'my', + /** Bosnian */ + Bs = 'bs', /** Catalan */ Ca = 'ca', /** Chechen */ Ce = 'ce', - /** Chinese */ - Zh = 'zh', - /** Simplified Chinese */ - ZhHans = 'zh_Hans', - /** Traditional Chinese */ - ZhHant = 'zh_Hant', - /** Church Slavic */ - Cu = 'cu', - /** Cornish */ - Kw = 'kw', /** Corsican */ Co = 'co', - /** Croatian */ - Hr = 'hr', /** Czech */ Cs = 'cs', + /** Church Slavic */ + Cu = 'cu', + /** Welsh */ + Cy = 'cy', /** Danish */ Da = 'da', - /** Dutch */ - Nl = 'nl', - /** Flemish */ - NlBe = 'nl_BE', + /** German */ + De = 'de', + /** Austrian German */ + DeAt = 'de_AT', + /** Swiss High German */ + DeCh = 'de_CH', /** Dzongkha */ Dz = 'dz', + /** Ewe */ + Ee = 'ee', + /** Greek */ + El = 'el', /** English */ En = 'en', /** Australian English */ @@ -1660,238 +1282,240 @@ export enum LanguageCode { EnUs = 'en_US', /** Esperanto */ Eo = 'eo', - /** Estonian */ - Et = 'et', - /** Ewe */ - Ee = 'ee', - /** Faroese */ - Fo = 'fo', - /** Finnish */ - Fi = 'fi', - /** French */ - Fr = 'fr', - /** Canadian French */ - FrCa = 'fr_CA', - /** Swiss French */ - FrCh = 'fr_CH', - /** Fulah */ - Ff = 'ff', - /** Galician */ - Gl = 'gl', - /** Ganda */ - Lg = 'lg', - /** Georgian */ - Ka = 'ka', - /** German */ - De = 'de', - /** Austrian German */ - DeAt = 'de_AT', - /** Swiss High German */ - DeCh = 'de_CH', - /** Greek */ - El = 'el', - /** Gujarati */ - Gu = 'gu', - /** Haitian Creole */ - Ht = 'ht', - /** Hausa */ - Ha = 'ha', - /** Hebrew */ - He = 'he', - /** Hindi */ - Hi = 'hi', - /** Hungarian */ - Hu = 'hu', - /** Icelandic */ - Is = 'is', - /** Igbo */ - Ig = 'ig', - /** Indonesian */ - Id = 'id', - /** Interlingua */ - Ia = 'ia', - /** Irish */ - Ga = 'ga', - /** Italian */ - It = 'it', - /** Japanese */ - Ja = 'ja', - /** Javanese */ - Jv = 'jv', - /** Kalaallisut */ - Kl = 'kl', - /** Kannada */ - Kn = 'kn', - /** Kashmiri */ - Ks = 'ks', - /** Kazakh */ - Kk = 'kk', - /** Khmer */ - Km = 'km', - /** Kikuyu */ - Ki = 'ki', - /** Kinyarwanda */ - Rw = 'rw', - /** Korean */ - Ko = 'ko', - /** Kurdish */ - Ku = 'ku', - /** Kyrgyz */ - Ky = 'ky', - /** Lao */ - Lo = 'lo', - /** Latin */ - La = 'la', - /** Latvian */ - Lv = 'lv', - /** Lingala */ - Ln = 'ln', - /** Lithuanian */ - Lt = 'lt', - /** Luba-Katanga */ - Lu = 'lu', - /** Luxembourgish */ - Lb = 'lb', - /** Macedonian */ - Mk = 'mk', - /** Malagasy */ - Mg = 'mg', - /** Malay */ - Ms = 'ms', - /** Malayalam */ - Ml = 'ml', - /** Maltese */ - Mt = 'mt', - /** Manx */ - Gv = 'gv', - /** Maori */ - Mi = 'mi', - /** Marathi */ - Mr = 'mr', - /** Mongolian */ - Mn = 'mn', - /** Nepali */ - Ne = 'ne', - /** North Ndebele */ - Nd = 'nd', - /** Northern Sami */ - Se = 'se', - /** Norwegian Bokmål */ - Nb = 'nb', - /** Norwegian Nynorsk */ - Nn = 'nn', - /** Nyanja */ - Ny = 'ny', - /** Odia */ - Or = 'or', - /** Oromo */ - Om = 'om', - /** Ossetic */ - Os = 'os', - /** Pashto */ - Ps = 'ps', - /** Persian */ - Fa = 'fa', - /** Dari */ - FaAf = 'fa_AF', - /** Polish */ - Pl = 'pl', - /** Portuguese */ - Pt = 'pt', - /** Brazilian Portuguese */ - PtBr = 'pt_BR', - /** European Portuguese */ - PtPt = 'pt_PT', - /** Punjabi */ - Pa = 'pa', - /** Quechua */ - Qu = 'qu', - /** Romanian */ - Ro = 'ro', - /** Moldavian */ - RoMd = 'ro_MD', - /** Romansh */ - Rm = 'rm', - /** Rundi */ - Rn = 'rn', - /** Russian */ - Ru = 'ru', - /** Samoan */ - Sm = 'sm', - /** Sango */ - Sg = 'sg', - /** Sanskrit */ - Sa = 'sa', - /** Scottish Gaelic */ - Gd = 'gd', - /** Serbian */ - Sr = 'sr', - /** Shona */ - Sn = 'sn', - /** Sichuan Yi */ - Ii = 'ii', - /** Sindhi */ - Sd = 'sd', - /** Sinhala */ - Si = 'si', - /** Slovak */ - Sk = 'sk', - /** Slovenian */ - Sl = 'sl', - /** Somali */ - So = 'so', - /** Southern Sotho */ - St = 'st', /** Spanish */ Es = 'es', /** European Spanish */ EsEs = 'es_ES', /** Mexican Spanish */ EsMx = 'es_MX', + /** Estonian */ + Et = 'et', + /** Basque */ + Eu = 'eu', + /** Persian */ + Fa = 'fa', + /** Dari */ + FaAf = 'fa_AF', + /** Fulah */ + Ff = 'ff', + /** Finnish */ + Fi = 'fi', + /** Faroese */ + Fo = 'fo', + /** French */ + Fr = 'fr', + /** Canadian French */ + FrCa = 'fr_CA', + /** Swiss French */ + FrCh = 'fr_CH', + /** Western Frisian */ + Fy = 'fy', + /** Irish */ + Ga = 'ga', + /** Scottish Gaelic */ + Gd = 'gd', + /** Galician */ + Gl = 'gl', + /** Gujarati */ + Gu = 'gu', + /** Manx */ + Gv = 'gv', + /** Hausa */ + Ha = 'ha', + /** Hebrew */ + He = 'he', + /** Hindi */ + Hi = 'hi', + /** Croatian */ + Hr = 'hr', + /** Haitian Creole */ + Ht = 'ht', + /** Hungarian */ + Hu = 'hu', + /** Armenian */ + Hy = 'hy', + /** Interlingua */ + Ia = 'ia', + /** Indonesian */ + Id = 'id', + /** Igbo */ + Ig = 'ig', + /** Sichuan Yi */ + Ii = 'ii', + /** Icelandic */ + Is = 'is', + /** Italian */ + It = 'it', + /** Japanese */ + Ja = 'ja', + /** Javanese */ + Jv = 'jv', + /** Georgian */ + Ka = 'ka', + /** Kikuyu */ + Ki = 'ki', + /** Kazakh */ + Kk = 'kk', + /** Kalaallisut */ + Kl = 'kl', + /** Khmer */ + Km = 'km', + /** Kannada */ + Kn = 'kn', + /** Korean */ + Ko = 'ko', + /** Kashmiri */ + Ks = 'ks', + /** Kurdish */ + Ku = 'ku', + /** Cornish */ + Kw = 'kw', + /** Kyrgyz */ + Ky = 'ky', + /** Latin */ + La = 'la', + /** Luxembourgish */ + Lb = 'lb', + /** Ganda */ + Lg = 'lg', + /** Lingala */ + Ln = 'ln', + /** Lao */ + Lo = 'lo', + /** Lithuanian */ + Lt = 'lt', + /** Luba-Katanga */ + Lu = 'lu', + /** Latvian */ + Lv = 'lv', + /** Malagasy */ + Mg = 'mg', + /** Maori */ + Mi = 'mi', + /** Macedonian */ + Mk = 'mk', + /** Malayalam */ + Ml = 'ml', + /** Mongolian */ + Mn = 'mn', + /** Marathi */ + Mr = 'mr', + /** Malay */ + Ms = 'ms', + /** Maltese */ + Mt = 'mt', + /** Burmese */ + My = 'my', + /** Norwegian Bokmål */ + Nb = 'nb', + /** North Ndebele */ + Nd = 'nd', + /** Nepali */ + Ne = 'ne', + /** Dutch */ + Nl = 'nl', + /** Flemish */ + NlBe = 'nl_BE', + /** Norwegian Nynorsk */ + Nn = 'nn', + /** Nyanja */ + Ny = 'ny', + /** Oromo */ + Om = 'om', + /** Odia */ + Or = 'or', + /** Ossetic */ + Os = 'os', + /** Punjabi */ + Pa = 'pa', + /** Polish */ + Pl = 'pl', + /** Pashto */ + Ps = 'ps', + /** Portuguese */ + Pt = 'pt', + /** Brazilian Portuguese */ + PtBr = 'pt_BR', + /** European Portuguese */ + PtPt = 'pt_PT', + /** Quechua */ + Qu = 'qu', + /** Romansh */ + Rm = 'rm', + /** Rundi */ + Rn = 'rn', + /** Romanian */ + Ro = 'ro', + /** Moldavian */ + RoMd = 'ro_MD', + /** Russian */ + Ru = 'ru', + /** Kinyarwanda */ + Rw = 'rw', + /** Sanskrit */ + Sa = 'sa', + /** Sindhi */ + Sd = 'sd', + /** Northern Sami */ + Se = 'se', + /** Sango */ + Sg = 'sg', + /** Sinhala */ + Si = 'si', + /** Slovak */ + Sk = 'sk', + /** Slovenian */ + Sl = 'sl', + /** Samoan */ + Sm = 'sm', + /** Shona */ + Sn = 'sn', + /** Somali */ + So = 'so', + /** Albanian */ + Sq = 'sq', + /** Serbian */ + Sr = 'sr', + /** Southern Sotho */ + St = 'st', /** Sundanese */ Su = 'su', + /** Swedish */ + Sv = 'sv', /** Swahili */ Sw = 'sw', /** Congo Swahili */ SwCd = 'sw_CD', - /** Swedish */ - Sv = 'sv', - /** Tajik */ - Tg = 'tg', /** Tamil */ Ta = 'ta', - /** Tatar */ - Tt = 'tt', /** Telugu */ Te = 'te', + /** Tajik */ + Tg = 'tg', /** Thai */ Th = 'th', - /** Tibetan */ - Bo = 'bo', /** Tigrinya */ Ti = 'ti', + /** Turkmen */ + Tk = 'tk', /** Tongan */ To = 'to', /** Turkish */ Tr = 'tr', - /** Turkmen */ - Tk = 'tk', + /** Tatar */ + Tt = 'tt', + /** Uyghur */ + Ug = 'ug', /** Ukrainian */ Uk = 'uk', /** Urdu */ Ur = 'ur', - /** Uyghur */ - Ug = 'ug', /** Uzbek */ Uz = 'uz', /** Vietnamese */ Vi = 'vi', /** Volapük */ Vo = 'vo', - /** Welsh */ - Cy = 'cy', - /** Western Frisian */ - Fy = 'fy', /** Wolof */ Wo = 'wo', /** Xhosa */ @@ -1900,761 +1524,271 @@ export enum LanguageCode { Yi = 'yi', /** Yoruba */ Yo = 'yo', + /** Chinese */ + Zh = 'zh', + /** Simplified Chinese */ + ZhHans = 'zh_Hans', + /** Traditional Chinese */ + ZhHant = 'zh_Hant', /** Zulu */ Zu = 'zu', } -export type Order = Node & { - __typename?: 'Order' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - /** - * The date & time that the Order was placed, i.e. the Customer - * completed the checkout and the Order is no longer "active" - */ - orderPlacedAt?: Maybe - /** A unique code for the Order */ - code: Scalars['String'] - state: Scalars['String'] - /** An order is active as long as the payment process has not been completed */ - active: Scalars['Boolean'] - customer?: Maybe - shippingAddress?: Maybe - billingAddress?: Maybe - lines: Array - /** - * Surcharges are arbitrary modifications to the Order total which are neither - * ProductVariants nor discounts resulting from applied Promotions. For example, - * one-off discounts based on customer interaction, or surcharges based on payment - * methods. - */ - surcharges: Array - discounts: Array - /** An array of all coupon codes applied to the Order */ - couponCodes: Array - /** Promotions applied to the order. Only gets populated after the payment process has completed. */ - promotions: Array - payments?: Maybe> - fulfillments?: Maybe> - totalQuantity: Scalars['Int'] - /** - * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level - * discounts which have been prorated (proportionally distributed) amongst the OrderItems. - * To get a total of all OrderLines which does not account for prorated discounts, use the - * sum of `OrderLine.discountedLinePrice` values. - */ - subTotal: Scalars['Int'] - /** Same as subTotal, but inclusive of tax */ - subTotalWithTax: Scalars['Int'] - currencyCode: CurrencyCode - shippingLines: Array - shipping: Scalars['Int'] - shippingWithTax: Scalars['Int'] - /** Equal to subTotal plus shipping */ - total: Scalars['Int'] - /** The final payable amount. Equal to subTotalWithTax plus shippingWithTax */ - totalWithTax: Scalars['Int'] - /** A summary of the taxes being applied to this Order */ - taxSummary: Array - history: HistoryEntryList - customFields?: Maybe +export type LocaleStringCustomFieldConfig = CustomField & { + __typename?: 'LocaleStringCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + length?: Maybe + list: Scalars['Boolean'] + name: Scalars['String'] + nullable?: Maybe + pattern?: Maybe + readonly?: Maybe + type: Scalars['String'] + ui?: Maybe } -export type OrderHistoryArgs = { - options?: Maybe -} - -/** - * A summary of the taxes being applied to this order, grouped - * by taxRate. - */ -export type OrderTaxSummary = { - __typename?: 'OrderTaxSummary' - /** A description of this tax */ - description: Scalars['String'] - /** The taxRate as a percentage */ - taxRate: Scalars['Float'] - /** The total net price or OrderItems to which this taxRate applies */ - taxBase: Scalars['Int'] - /** The total tax being applied to the Order at this taxRate */ - taxTotal: Scalars['Int'] -} - -export type OrderAddress = { - __typename?: 'OrderAddress' - fullName?: Maybe - company?: Maybe - streetLine1?: Maybe - streetLine2?: Maybe - city?: Maybe - province?: Maybe - postalCode?: Maybe - country?: Maybe - countryCode?: Maybe - phoneNumber?: Maybe - customFields?: Maybe -} - -export type OrderList = PaginatedList & { - __typename?: 'OrderList' - items: Array - totalItems: Scalars['Int'] -} - -export type ShippingLine = { - __typename?: 'ShippingLine' - shippingMethod: ShippingMethod - price: Scalars['Int'] - priceWithTax: Scalars['Int'] - discountedPrice: Scalars['Int'] - discountedPriceWithTax: Scalars['Int'] - discounts: Array -} - -export type Discount = { - __typename?: 'Discount' - adjustmentSource: Scalars['String'] - type: AdjustmentType - description: Scalars['String'] - amount: Scalars['Int'] - amountWithTax: Scalars['Int'] -} - -export type OrderItem = Node & { - __typename?: 'OrderItem' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - cancelled: Scalars['Boolean'] - /** The price of a single unit, excluding tax and discounts */ - unitPrice: Scalars['Int'] - /** The price of a single unit, including tax but excluding discounts */ - unitPriceWithTax: Scalars['Int'] - /** - * The price of a single unit including discounts, excluding tax. - * - * If Order-level discounts have been applied, this will not be the - * actual taxable unit price (see `proratedUnitPrice`), but is generally the - * correct price to display to customers to avoid confusion - * about the internal handling of distributed Order-level discounts. - */ - discountedUnitPrice: Scalars['Int'] - /** The price of a single unit including discounts and tax */ - discountedUnitPriceWithTax: Scalars['Int'] - /** - * The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) - * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax - * and refund calculations. - */ - proratedUnitPrice: Scalars['Int'] - /** The proratedUnitPrice including tax */ - proratedUnitPriceWithTax: Scalars['Int'] - unitTax: Scalars['Int'] - taxRate: Scalars['Float'] - adjustments: Array - taxLines: Array - fulfillment?: Maybe - refundId?: Maybe -} - -export type OrderLine = Node & { - __typename?: 'OrderLine' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - productVariant: ProductVariant - featuredAsset?: Maybe - /** The price of a single unit, excluding tax and discounts */ - unitPrice: Scalars['Int'] - /** The price of a single unit, including tax but excluding discounts */ - unitPriceWithTax: Scalars['Int'] - /** Non-zero if the unitPrice has changed since it was initially added to Order */ - unitPriceChangeSinceAdded: Scalars['Int'] - /** Non-zero if the unitPriceWithTax has changed since it was initially added to Order */ - unitPriceWithTaxChangeSinceAdded: Scalars['Int'] - /** - * The price of a single unit including discounts, excluding tax. - * - * If Order-level discounts have been applied, this will not be the - * actual taxable unit price (see `proratedUnitPrice`), but is generally the - * correct price to display to customers to avoid confusion - * about the internal handling of distributed Order-level discounts. - */ - discountedUnitPrice: Scalars['Int'] - /** The price of a single unit including discounts and tax */ - discountedUnitPriceWithTax: Scalars['Int'] - /** - * The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) - * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax - * and refund calculations. - */ - proratedUnitPrice: Scalars['Int'] - /** The proratedUnitPrice including tax */ - proratedUnitPriceWithTax: Scalars['Int'] - quantity: Scalars['Int'] - items: Array - taxRate: Scalars['Float'] - /** The total price of the line excluding tax and discounts. */ - linePrice: Scalars['Int'] - /** The total price of the line including tax bit excluding discounts. */ - linePriceWithTax: Scalars['Int'] - /** The price of the line including discounts, excluding tax */ - discountedLinePrice: Scalars['Int'] - /** The price of the line including discounts and tax */ - discountedLinePriceWithTax: Scalars['Int'] - /** - * The actual line price, taking into account both item discounts _and_ prorated (proportially-distributed) - * Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax - * and refund calculations. - */ - proratedLinePrice: Scalars['Int'] - /** The proratedLinePrice including tax */ - proratedLinePriceWithTax: Scalars['Int'] - /** The total tax on this line */ - lineTax: Scalars['Int'] - discounts: Array - taxLines: Array - order: Order - customFields?: Maybe -} - -export type Payment = Node & { - __typename?: 'Payment' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - method: Scalars['String'] - amount: Scalars['Int'] - state: Scalars['String'] - transactionId?: Maybe - errorMessage?: Maybe - refunds: Array - metadata?: Maybe -} - -export type Refund = Node & { - __typename?: 'Refund' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - items: Scalars['Int'] - shipping: Scalars['Int'] - adjustment: Scalars['Int'] - total: Scalars['Int'] - method?: Maybe - state: Scalars['String'] - transactionId?: Maybe - reason?: Maybe - orderItems: Array - paymentId: Scalars['ID'] - metadata?: Maybe -} - -export type Fulfillment = Node & { - __typename?: 'Fulfillment' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - orderItems: Array - state: Scalars['String'] - method: Scalars['String'] - trackingCode?: Maybe - customFields?: Maybe -} - -export type Surcharge = Node & { - __typename?: 'Surcharge' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - description: Scalars['String'] - sku?: Maybe - taxLines: Array - price: Scalars['Int'] - priceWithTax: Scalars['Int'] - taxRate: Scalars['Float'] -} - -export type ProductOptionGroup = Node & { - __typename?: 'ProductOptionGroup' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] +export type LocalizedString = { + __typename?: 'LocalizedString' languageCode: LanguageCode - code: Scalars['String'] - name: Scalars['String'] - options: Array - translations: Array - customFields?: Maybe -} - -export type ProductOptionGroupTranslation = { - __typename?: 'ProductOptionGroupTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] -} - -export type ProductOption = Node & { - __typename?: 'ProductOption' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - code: Scalars['String'] - name: Scalars['String'] - groupId: Scalars['ID'] - group: ProductOptionGroup - translations: Array - customFields?: Maybe -} - -export type ProductOptionTranslation = { - __typename?: 'ProductOptionTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] -} - -export type SearchReindexResponse = { - __typename?: 'SearchReindexResponse' - success: Scalars['Boolean'] -} - -export type SearchResponse = { - __typename?: 'SearchResponse' - items: Array - totalItems: Scalars['Int'] - facetValues: Array -} - -/** - * Which FacetValues are present in the products returned - * by the search, and in what quantity. - */ -export type FacetValueResult = { - __typename?: 'FacetValueResult' - facetValue: FacetValue - count: Scalars['Int'] -} - -export type SearchResultAsset = { - __typename?: 'SearchResultAsset' - id: Scalars['ID'] - preview: Scalars['String'] - focalPoint?: Maybe -} - -export type SearchResult = { - __typename?: 'SearchResult' - sku: Scalars['String'] - slug: Scalars['String'] - productId: Scalars['ID'] - productName: Scalars['String'] - productAsset?: Maybe - productVariantId: Scalars['ID'] - productVariantName: Scalars['String'] - productVariantAsset?: Maybe - price: SearchResultPrice - priceWithTax: SearchResultPrice - currencyCode: CurrencyCode - description: Scalars['String'] - facetIds: Array - facetValueIds: Array - /** An array of ids of the Collections in which this result appears */ - collectionIds: Array - /** A relevence score for the result. Differs between database implementations */ - score: Scalars['Float'] -} - -/** The price of a search result product, either as a range or as a single price */ -export type SearchResultPrice = PriceRange | SinglePrice - -/** The price value where the result has a single price */ -export type SinglePrice = { - __typename?: 'SinglePrice' - value: Scalars['Int'] -} - -/** The price range where the result has more than one price */ -export type PriceRange = { - __typename?: 'PriceRange' - min: Scalars['Int'] - max: Scalars['Int'] -} - -export type Product = Node & { - __typename?: 'Product' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] - slug: Scalars['String'] - description: Scalars['String'] - featuredAsset?: Maybe - assets: Array - variants: Array - optionGroups: Array - facetValues: Array - translations: Array - collections: Array - customFields?: Maybe -} - -export type ProductTranslation = { - __typename?: 'ProductTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] - slug: Scalars['String'] - description: Scalars['String'] -} - -export type ProductList = PaginatedList & { - __typename?: 'ProductList' - items: Array - totalItems: Scalars['Int'] -} - -export type ProductVariant = Node & { - __typename?: 'ProductVariant' - id: Scalars['ID'] - product: Product - productId: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - sku: Scalars['String'] - name: Scalars['String'] - featuredAsset?: Maybe - assets: Array - price: Scalars['Int'] - currencyCode: CurrencyCode - priceWithTax: Scalars['Int'] - stockLevel: Scalars['String'] - taxRateApplied: TaxRate - taxCategory: TaxCategory - options: Array - facetValues: Array - translations: Array - customFields?: Maybe -} - -export type ProductVariantTranslation = { - __typename?: 'ProductVariantTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] -} - -export type Promotion = Node & { - __typename?: 'Promotion' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - startsAt?: Maybe - endsAt?: Maybe - couponCode?: Maybe - perCustomerUsageLimit?: Maybe - name: Scalars['String'] - enabled: Scalars['Boolean'] - conditions: Array - actions: Array -} - -export type PromotionList = PaginatedList & { - __typename?: 'PromotionList' - items: Array - totalItems: Scalars['Int'] -} - -export type Role = Node & { - __typename?: 'Role' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - code: Scalars['String'] - description: Scalars['String'] - permissions: Array - channels: Array -} - -export type RoleList = PaginatedList & { - __typename?: 'RoleList' - items: Array - totalItems: Scalars['Int'] -} - -export type ShippingMethod = Node & { - __typename?: 'ShippingMethod' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - code: Scalars['String'] - name: Scalars['String'] - description: Scalars['String'] - fulfillmentHandlerCode: Scalars['String'] - checker: ConfigurableOperation - calculator: ConfigurableOperation - translations: Array - customFields?: Maybe -} - -export type ShippingMethodTranslation = { - __typename?: 'ShippingMethodTranslation' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - languageCode: LanguageCode - name: Scalars['String'] - description: Scalars['String'] -} - -export type ShippingMethodList = PaginatedList & { - __typename?: 'ShippingMethodList' - items: Array - totalItems: Scalars['Int'] -} - -export type Tag = Node & { - __typename?: 'Tag' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] value: Scalars['String'] } -export type TagList = PaginatedList & { - __typename?: 'TagList' - items: Array - totalItems: Scalars['Int'] +export enum LogicalOperator { + And = 'AND', + Or = 'OR', } -export type TaxCategory = Node & { - __typename?: 'TaxCategory' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - name: Scalars['String'] - isDefault: Scalars['Boolean'] -} - -export type TaxRate = Node & { - __typename?: 'TaxRate' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - name: Scalars['String'] - enabled: Scalars['Boolean'] - value: Scalars['Float'] - category: TaxCategory - zone: Zone - customerGroup?: Maybe -} - -export type TaxRateList = PaginatedList & { - __typename?: 'TaxRateList' - items: Array - totalItems: Scalars['Int'] -} - -export type User = Node & { - __typename?: 'User' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - identifier: Scalars['String'] - verified: Scalars['Boolean'] - roles: Array - lastLogin?: Maybe - authenticationMethods: Array - customFields?: Maybe -} - -export type AuthenticationMethod = Node & { - __typename?: 'AuthenticationMethod' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - strategy: Scalars['String'] -} - -export type Zone = Node & { - __typename?: 'Zone' - id: Scalars['ID'] - createdAt: Scalars['DateTime'] - updatedAt: Scalars['DateTime'] - name: Scalars['String'] - members: Array -} - -/** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */ -export type OrderModificationError = ErrorResult & { - __typename?: 'OrderModificationError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Returned when attempting to set a ShippingMethod for which the Order is not eligible */ -export type IneligibleShippingMethodError = ErrorResult & { - __typename?: 'IneligibleShippingMethodError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */ -export type OrderPaymentStateError = ErrorResult & { - __typename?: 'OrderPaymentStateError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. */ -export type IneligiblePaymentMethodError = ErrorResult & { - __typename?: 'IneligiblePaymentMethodError' - errorCode: ErrorCode - message: Scalars['String'] - eligibilityCheckerMessage?: Maybe -} - -/** Returned when a Payment fails due to an error. */ -export type PaymentFailedError = ErrorResult & { - __typename?: 'PaymentFailedError' - errorCode: ErrorCode - message: Scalars['String'] - paymentErrorMessage: Scalars['String'] -} - -/** Returned when a Payment is declined by the payment provider. */ -export type PaymentDeclinedError = ErrorResult & { - __typename?: 'PaymentDeclinedError' - errorCode: ErrorCode - message: Scalars['String'] - paymentErrorMessage: Scalars['String'] -} - -/** Returned if the provided coupon code is invalid */ -export type CouponCodeInvalidError = ErrorResult & { - __typename?: 'CouponCodeInvalidError' - errorCode: ErrorCode - message: Scalars['String'] - couponCode: Scalars['String'] -} - -/** Returned if the provided coupon code is invalid */ -export type CouponCodeExpiredError = ErrorResult & { - __typename?: 'CouponCodeExpiredError' - errorCode: ErrorCode - message: Scalars['String'] - couponCode: Scalars['String'] -} - -/** Returned if the provided coupon code is invalid */ -export type CouponCodeLimitError = ErrorResult & { - __typename?: 'CouponCodeLimitError' - errorCode: ErrorCode - message: Scalars['String'] - couponCode: Scalars['String'] - limit: Scalars['Int'] -} - -/** Retured when attemting to set the Customer for an Order when already logged in. */ -export type AlreadyLoggedInError = ErrorResult & { - __typename?: 'AlreadyLoggedInError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** Retured when attemting to register or verify a customer account without a password, when one is required. */ +/** Returned when attempting to register or verify a customer account without a password, when one is required. */ export type MissingPasswordError = ErrorResult & { __typename?: 'MissingPasswordError' errorCode: ErrorCode message: Scalars['String'] } -/** Retured when attemting to verify a customer account with a password, when a password has already been set. */ -export type PasswordAlreadySetError = ErrorResult & { - __typename?: 'PasswordAlreadySetError' +export type Mutation = { + __typename?: 'Mutation' + /** Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. */ + addItemToOrder: UpdateOrderItemsResult + /** Add a Payment to the Order */ + addPaymentToOrder: AddPaymentToOrderResult + /** Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. */ + adjustOrderLine: UpdateOrderItemsResult + /** Applies the given coupon code to the active Order */ + applyCouponCode: ApplyCouponCodeResult + /** Authenticates the user using a named authentication strategy */ + authenticate: AuthenticationResult + /** Create a new Customer Address */ + createCustomerAddress: Address + /** Delete an existing Address */ + deleteCustomerAddress: Success + /** Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` */ + login: NativeAuthenticationResult + /** End the current authenticated session */ + logout: Success + /** Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. */ + refreshCustomerVerification: RefreshCustomerVerificationResult + /** + * Register a Customer account with the given credentials. There are three possible registration flows: + * + * _If `authOptions.requireVerification` is set to `true`:_ + * + * 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + * verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then + * verified and authenticated in one step. + * 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + * verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosen password of the Customer. The Customer is then + * verified and authenticated in one step. + * + * _If `authOptions.requireVerification` is set to `false`:_ + * + * 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. + */ + registerCustomerAccount: RegisterCustomerAccountResult + /** Remove all OrderLine from the Order */ + removeAllOrderLines: RemoveOrderItemsResult + /** Removes the given coupon code from the active Order */ + removeCouponCode?: Maybe + /** Remove an OrderLine from the Order */ + removeOrderLine: RemoveOrderItemsResult + /** Requests a password reset email to be sent */ + requestPasswordReset?: Maybe + /** + * Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled + * (as is the default), then the `identifierChangeToken` will be assigned to the current User and + * a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email + * that verification token to the Customer, which is then used to verify the change of email address. + */ + requestUpdateCustomerEmailAddress: RequestUpdateCustomerEmailAddressResult + /** Resets a Customer's password based on the provided token */ + resetPassword: ResetPasswordResult + /** Set the Customer for the Order. Required only if the Customer is not currently logged in */ + setCustomerForOrder: SetCustomerForOrderResult + /** Sets the billing address for this order */ + setOrderBillingAddress: ActiveOrderResult + /** Allows any custom fields to be set for the active order */ + setOrderCustomFields: ActiveOrderResult + /** Sets the shipping address for this order */ + setOrderShippingAddress: ActiveOrderResult + /** Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query */ + setOrderShippingMethod: SetOrderShippingMethodResult + /** Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` */ + transitionOrderToState?: Maybe + /** Update an existing Customer */ + updateCustomer: Customer + /** Update an existing Address */ + updateCustomerAddress: Address + /** + * Confirm the update of the emailAddress with the provided token, which has been generated by the + * `requestUpdateCustomerEmailAddress` mutation. + */ + updateCustomerEmailAddress: UpdateCustomerEmailAddressResult + /** Update the password of the active Customer */ + updateCustomerPassword: UpdateCustomerPasswordResult + /** + * Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. + * + * If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the password _must_ be + * provided here. + */ + verifyCustomerAccount: VerifyCustomerAccountResult +} + +export type MutationAddItemToOrderArgs = { + productVariantId: Scalars['ID'] + quantity: Scalars['Int'] +} + +export type MutationAddPaymentToOrderArgs = { + input: PaymentInput +} + +export type MutationAdjustOrderLineArgs = { + orderLineId: Scalars['ID'] + quantity: Scalars['Int'] +} + +export type MutationApplyCouponCodeArgs = { + couponCode: Scalars['String'] +} + +export type MutationAuthenticateArgs = { + input: AuthenticationInput + rememberMe?: InputMaybe +} + +export type MutationCreateCustomerAddressArgs = { + input: CreateAddressInput +} + +export type MutationDeleteCustomerAddressArgs = { + id: Scalars['ID'] +} + +export type MutationLoginArgs = { + password: Scalars['String'] + rememberMe?: InputMaybe + username: Scalars['String'] +} + +export type MutationRefreshCustomerVerificationArgs = { + emailAddress: Scalars['String'] +} + +export type MutationRegisterCustomerAccountArgs = { + input: RegisterCustomerInput +} + +export type MutationRemoveCouponCodeArgs = { + couponCode: Scalars['String'] +} + +export type MutationRemoveOrderLineArgs = { + orderLineId: Scalars['ID'] +} + +export type MutationRequestPasswordResetArgs = { + emailAddress: Scalars['String'] +} + +export type MutationRequestUpdateCustomerEmailAddressArgs = { + newEmailAddress: Scalars['String'] + password: Scalars['String'] +} + +export type MutationResetPasswordArgs = { + password: Scalars['String'] + token: Scalars['String'] +} + +export type MutationSetCustomerForOrderArgs = { + input: CreateCustomerInput +} + +export type MutationSetOrderBillingAddressArgs = { + input: CreateAddressInput +} + +export type MutationSetOrderCustomFieldsArgs = { + input: UpdateOrderInput +} + +export type MutationSetOrderShippingAddressArgs = { + input: CreateAddressInput +} + +export type MutationSetOrderShippingMethodArgs = { + shippingMethodId: Scalars['ID'] +} + +export type MutationTransitionOrderToStateArgs = { + state: Scalars['String'] +} + +export type MutationUpdateCustomerArgs = { + input: UpdateCustomerInput +} + +export type MutationUpdateCustomerAddressArgs = { + input: UpdateAddressInput +} + +export type MutationUpdateCustomerEmailAddressArgs = { + token: Scalars['String'] +} + +export type MutationUpdateCustomerPasswordArgs = { + currentPassword: Scalars['String'] + newPassword: Scalars['String'] +} + +export type MutationVerifyCustomerAccountArgs = { + password?: InputMaybe + token: Scalars['String'] +} + +export type NativeAuthInput = { + password: Scalars['String'] + username: Scalars['String'] +} + +/** Returned when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. */ +export type NativeAuthStrategyError = ErrorResult & { + __typename?: 'NativeAuthStrategyError' errorCode: ErrorCode message: Scalars['String'] } -/** - * Retured if the verification token (used to verify a Customer's email address) is either - * invalid or does not match any expected tokens. - */ -export type VerificationTokenInvalidError = ErrorResult & { - __typename?: 'VerificationTokenInvalidError' - errorCode: ErrorCode - message: Scalars['String'] -} +export type NativeAuthenticationResult = + | CurrentUser + | InvalidCredentialsError + | NativeAuthStrategyError + | NotVerifiedError -/** - * Returned if the verification token (used to verify a Customer's email address) is valid, but has - * expired according to the `verificationTokenDuration` setting in the AuthOptions. - */ -export type VerificationTokenExpiredError = ErrorResult & { - __typename?: 'VerificationTokenExpiredError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** - * Retured if the token used to change a Customer's email address is either - * invalid or does not match any expected tokens. - */ -export type IdentifierChangeTokenInvalidError = ErrorResult & { - __typename?: 'IdentifierChangeTokenInvalidError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** - * Retured if the token used to change a Customer's email address is valid, but has - * expired according to the `verificationTokenDuration` setting in the AuthOptions. - */ -export type IdentifierChangeTokenExpiredError = ErrorResult & { - __typename?: 'IdentifierChangeTokenExpiredError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** - * Retured if the token used to reset a Customer's password is either - * invalid or does not match any expected tokens. - */ -export type PasswordResetTokenInvalidError = ErrorResult & { - __typename?: 'PasswordResetTokenInvalidError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** - * Retured if the token used to reset a Customer's password is valid, but has - * expired according to the `verificationTokenDuration` setting in the AuthOptions. - */ -export type PasswordResetTokenExpiredError = ErrorResult & { - __typename?: 'PasswordResetTokenExpiredError' - errorCode: ErrorCode - message: Scalars['String'] -} - -/** - * Returned if `authOptions.requireVerification` is set to `true` (which is the default) - * and an unverified user attempts to authenticate. - */ -export type NotVerifiedError = ErrorResult & { - __typename?: 'NotVerifiedError' +/** Returned when attempting to set a negative OrderLine quantity. */ +export type NegativeQuantityError = ErrorResult & { + __typename?: 'NegativeQuantityError' errorCode: ErrorCode message: Scalars['String'] } @@ -2669,382 +1803,1709 @@ export type NoActiveOrderError = ErrorResult & { message: Scalars['String'] } -export type AuthenticationInput = { - native?: Maybe +export type Node = { + id: Scalars['ID'] } -export type RegisterCustomerInput = { - emailAddress: Scalars['String'] - title?: Maybe - firstName?: Maybe - lastName?: Maybe - phoneNumber?: Maybe - password?: Maybe +/** + * Returned if `authOptions.requireVerification` is set to `true` (which is the default) + * and an unverified user attempts to authenticate. + */ +export type NotVerifiedError = ErrorResult & { + __typename?: 'NotVerifiedError' + errorCode: ErrorCode + message: Scalars['String'] } -export type UpdateCustomerInput = { - title?: Maybe - firstName?: Maybe - lastName?: Maybe - phoneNumber?: Maybe +/** Operators for filtering on a list of Number fields */ +export type NumberListOperators = { + inList: Scalars['Float'] +} + +/** Operators for filtering on a Int or Float field */ +export type NumberOperators = { + between?: InputMaybe + eq?: InputMaybe + gt?: InputMaybe + gte?: InputMaybe + lt?: InputMaybe + lte?: InputMaybe +} + +export type NumberRange = { + end: Scalars['Float'] + start: Scalars['Float'] +} + +export type Order = Node & { + __typename?: 'Order' + /** An order is active as long as the payment process has not been completed */ + active: Scalars['Boolean'] + billingAddress?: Maybe + /** A unique code for the Order */ + code: Scalars['String'] + /** An array of all coupon codes applied to the Order */ + couponCodes: Array + createdAt: Scalars['DateTime'] + currencyCode: CurrencyCode customFields?: Maybe + customer?: Maybe + discounts: Array + fulfillments?: Maybe> + history: HistoryEntryList + id: Scalars['ID'] + lines: Array + /** + * The date & time that the Order was placed, i.e. the Customer + * completed the checkout and the Order is no longer "active" + */ + orderPlacedAt?: Maybe + payments?: Maybe> + /** Promotions applied to the order. Only gets populated after the payment process has completed. */ + promotions: Array + shipping: Scalars['Int'] + shippingAddress?: Maybe + shippingLines: Array + shippingWithTax: Scalars['Int'] + state: Scalars['String'] + /** + * The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level + * discounts which have been prorated (proportionally distributed) amongst the OrderItems. + * To get a total of all OrderLines which does not account for prorated discounts, use the + * sum of `OrderLine.discountedLinePrice` values. + */ + subTotal: Scalars['Int'] + /** Same as subTotal, but inclusive of tax */ + subTotalWithTax: Scalars['Int'] + /** + * Surcharges are arbitrary modifications to the Order total which are neither + * ProductVariants nor discounts resulting from applied Promotions. For example, + * one-off discounts based on customer interaction, or surcharges based on payment + * methods. + */ + surcharges: Array + /** A summary of the taxes being applied to this Order */ + taxSummary: Array + /** Equal to subTotal plus shipping */ + total: Scalars['Int'] + totalQuantity: Scalars['Int'] + /** The final payable amount. Equal to subTotalWithTax plus shippingWithTax */ + totalWithTax: Scalars['Int'] + updatedAt: Scalars['DateTime'] } -export type UpdateOrderInput = { +export type OrderHistoryArgs = { + options?: InputMaybe +} + +export type OrderAddress = { + __typename?: 'OrderAddress' + city?: Maybe + company?: Maybe + country?: Maybe + countryCode?: Maybe customFields?: Maybe + fullName?: Maybe + phoneNumber?: Maybe + postalCode?: Maybe + province?: Maybe + streetLine1?: Maybe + streetLine2?: Maybe +} + +export type OrderFilterParameter = { + active?: InputMaybe + code?: InputMaybe + createdAt?: InputMaybe + currencyCode?: InputMaybe + id?: InputMaybe + orderPlacedAt?: InputMaybe + shipping?: InputMaybe + shippingWithTax?: InputMaybe + state?: InputMaybe + subTotal?: InputMaybe + subTotalWithTax?: InputMaybe + total?: InputMaybe + totalQuantity?: InputMaybe + totalWithTax?: InputMaybe + updatedAt?: InputMaybe +} + +export type OrderItem = Node & { + __typename?: 'OrderItem' + adjustments: Array + cancelled: Scalars['Boolean'] + createdAt: Scalars['DateTime'] + /** + * The price of a single unit including discounts, excluding tax. + * + * If Order-level discounts have been applied, this will not be the + * actual taxable unit price (see `proratedUnitPrice`), but is generally the + * correct price to display to customers to avoid confusion + * about the internal handling of distributed Order-level discounts. + */ + discountedUnitPrice: Scalars['Int'] + /** The price of a single unit including discounts and tax */ + discountedUnitPriceWithTax: Scalars['Int'] + fulfillment?: Maybe + id: Scalars['ID'] + /** + * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed) + * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + * and refund calculations. + */ + proratedUnitPrice: Scalars['Int'] + /** The proratedUnitPrice including tax */ + proratedUnitPriceWithTax: Scalars['Int'] + refundId?: Maybe + taxLines: Array + taxRate: Scalars['Float'] + /** The price of a single unit, excluding tax and discounts */ + unitPrice: Scalars['Int'] + /** The price of a single unit, including tax but excluding discounts */ + unitPriceWithTax: Scalars['Int'] + unitTax: Scalars['Int'] + updatedAt: Scalars['DateTime'] +} + +/** Returned when the maximum order size limit has been reached. */ +export type OrderLimitError = ErrorResult & { + __typename?: 'OrderLimitError' + errorCode: ErrorCode + maxItems: Scalars['Int'] + message: Scalars['String'] +} + +export type OrderLine = Node & { + __typename?: 'OrderLine' + createdAt: Scalars['DateTime'] + customFields?: Maybe + /** The price of the line including discounts, excluding tax */ + discountedLinePrice: Scalars['Int'] + /** The price of the line including discounts and tax */ + discountedLinePriceWithTax: Scalars['Int'] + /** + * The price of a single unit including discounts, excluding tax. + * + * If Order-level discounts have been applied, this will not be the + * actual taxable unit price (see `proratedUnitPrice`), but is generally the + * correct price to display to customers to avoid confusion + * about the internal handling of distributed Order-level discounts. + */ + discountedUnitPrice: Scalars['Int'] + /** The price of a single unit including discounts and tax */ + discountedUnitPriceWithTax: Scalars['Int'] + discounts: Array + featuredAsset?: Maybe + id: Scalars['ID'] + items: Array + /** The total price of the line excluding tax and discounts. */ + linePrice: Scalars['Int'] + /** The total price of the line including tax but excluding discounts. */ + linePriceWithTax: Scalars['Int'] + /** The total tax on this line */ + lineTax: Scalars['Int'] + order: Order + productVariant: ProductVariant + /** + * The actual line price, taking into account both item discounts _and_ prorated (proportionally-distributed) + * Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax + * and refund calculations. + */ + proratedLinePrice: Scalars['Int'] + /** The proratedLinePrice including tax */ + proratedLinePriceWithTax: Scalars['Int'] + /** + * The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed) + * Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + * and refund calculations. + */ + proratedUnitPrice: Scalars['Int'] + /** The proratedUnitPrice including tax */ + proratedUnitPriceWithTax: Scalars['Int'] + quantity: Scalars['Int'] + taxLines: Array + taxRate: Scalars['Float'] + /** The price of a single unit, excluding tax and discounts */ + unitPrice: Scalars['Int'] + /** Non-zero if the unitPrice has changed since it was initially added to Order */ + unitPriceChangeSinceAdded: Scalars['Int'] + /** The price of a single unit, including tax but excluding discounts */ + unitPriceWithTax: Scalars['Int'] + /** Non-zero if the unitPriceWithTax has changed since it was initially added to Order */ + unitPriceWithTaxChangeSinceAdded: Scalars['Int'] + updatedAt: Scalars['DateTime'] +} + +export type OrderList = PaginatedList & { + __typename?: 'OrderList' + items: Array + totalItems: Scalars['Int'] +} + +export type OrderListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe +} + +/** Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. */ +export type OrderModificationError = ErrorResult & { + __typename?: 'OrderModificationError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. */ +export type OrderPaymentStateError = ErrorResult & { + __typename?: 'OrderPaymentStateError' + errorCode: ErrorCode + message: Scalars['String'] +} + +export type OrderSortParameter = { + code?: InputMaybe + createdAt?: InputMaybe + id?: InputMaybe + orderPlacedAt?: InputMaybe + shipping?: InputMaybe + shippingWithTax?: InputMaybe + state?: InputMaybe + subTotal?: InputMaybe + subTotalWithTax?: InputMaybe + total?: InputMaybe + totalQuantity?: InputMaybe + totalWithTax?: InputMaybe + updatedAt?: InputMaybe +} + +/** Returned if there is an error in transitioning the Order state */ +export type OrderStateTransitionError = ErrorResult & { + __typename?: 'OrderStateTransitionError' + errorCode: ErrorCode + fromState: Scalars['String'] + message: Scalars['String'] + toState: Scalars['String'] + transitionError: Scalars['String'] +} + +/** + * A summary of the taxes being applied to this order, grouped + * by taxRate. + */ +export type OrderTaxSummary = { + __typename?: 'OrderTaxSummary' + /** A description of this tax */ + description: Scalars['String'] + /** The total net price or OrderItems to which this taxRate applies */ + taxBase: Scalars['Int'] + /** The taxRate as a percentage */ + taxRate: Scalars['Float'] + /** The total tax being applied to the Order at this taxRate */ + taxTotal: Scalars['Int'] +} + +export type PaginatedList = { + items: Array + totalItems: Scalars['Int'] +} + +/** Returned when attempting to verify a customer account with a password, when a password has already been set. */ +export type PasswordAlreadySetError = ErrorResult & { + __typename?: 'PasswordAlreadySetError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if the token used to reset a Customer's password is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type PasswordResetTokenExpiredError = ErrorResult & { + __typename?: 'PasswordResetTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if the token used to reset a Customer's password is either + * invalid or does not match any expected tokens. + */ +export type PasswordResetTokenInvalidError = ErrorResult & { + __typename?: 'PasswordResetTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** Returned when attempting to register or verify a customer account where the given password fails password validation. */ +export type PasswordValidationError = ErrorResult & { + __typename?: 'PasswordValidationError' + errorCode: ErrorCode + message: Scalars['String'] + validationErrorMessage: Scalars['String'] +} + +export type Payment = Node & { + __typename?: 'Payment' + amount: Scalars['Int'] + createdAt: Scalars['DateTime'] + errorMessage?: Maybe + id: Scalars['ID'] + metadata?: Maybe + method: Scalars['String'] + refunds: Array + state: Scalars['String'] + transactionId?: Maybe + updatedAt: Scalars['DateTime'] +} + +/** Returned when a Payment is declined by the payment provider. */ +export type PaymentDeclinedError = ErrorResult & { + __typename?: 'PaymentDeclinedError' + errorCode: ErrorCode + message: Scalars['String'] + paymentErrorMessage: Scalars['String'] +} + +/** Returned when a Payment fails due to an error. */ +export type PaymentFailedError = ErrorResult & { + __typename?: 'PaymentFailedError' + errorCode: ErrorCode + message: Scalars['String'] + paymentErrorMessage: Scalars['String'] } /** Passed as input to the `addPaymentToOrder` mutation. */ export type PaymentInput = { - /** This field should correspond to the `code` property of a PaymentMethodHandler. */ - method: Scalars['String'] /** * This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method * as the "metadata" argument. For example, it could contain an ID for the payment and other * data generated by the payment provider. */ metadata: Scalars['JSON'] + /** This field should correspond to the `code` property of a PaymentMethod. */ + method: Scalars['String'] } -export type CollectionListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe +export type PaymentMethod = Node & { + __typename?: 'PaymentMethod' + checker?: Maybe + code: Scalars['String'] + createdAt: Scalars['DateTime'] + customFields?: Maybe + description: Scalars['String'] + enabled: Scalars['Boolean'] + handler: ConfigurableOperation + id: Scalars['ID'] + name: Scalars['String'] + updatedAt: Scalars['DateTime'] } -export type OrderListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe +export type PaymentMethodQuote = { + __typename?: 'PaymentMethodQuote' + code: Scalars['String'] + customFields?: Maybe + description: Scalars['String'] + eligibilityMessage?: Maybe + id: Scalars['ID'] + isEligible: Scalars['Boolean'] + name: Scalars['String'] } -export type ProductListOptions = { - skip?: Maybe - take?: Maybe - sort?: Maybe - filter?: Maybe +/** + * @description + * Permissions for administrators and customers. Used to control access to + * GraphQL resolvers via the {@link Allow} decorator. + * + * ## Understanding Permission.Owner + * + * `Permission.Owner` is a special permission which is used in some of the Vendure resolvers to indicate that that resolver should only + * be accessible to the "owner" of that resource. + * + * For example, the Shop API `activeCustomer` query resolver should only return the Customer object for the "owner" of that Customer, i.e. + * based on the activeUserId of the current session. As a result, the resolver code looks like this: + * + * @example + * ```TypeScript + * \@Query() + * \@Allow(Permission.Owner) + * async activeCustomer(\@Ctx() ctx: RequestContext): Promise { + * const userId = ctx.activeUserId; + * if (userId) { + * return this.customerService.findOneByUserId(ctx, userId); + * } + * } + * ``` + * + * Here we can see that the "ownership" must be enforced by custom logic inside the resolver. Since "ownership" cannot be defined generally + * nor statically encoded at build-time, any resolvers using `Permission.Owner` **must** include logic to enforce that only the owner + * of the resource has access. If not, then it is the equivalent of using `Permission.Public`. + * + * + * @docsCategory common + */ +export enum Permission { + /** Authenticated means simply that the user is logged in */ + Authenticated = 'Authenticated', + /** Grants permission to create Administrator */ + CreateAdministrator = 'CreateAdministrator', + /** Grants permission to create Asset */ + CreateAsset = 'CreateAsset', + /** Grants permission to create Products, Facets, Assets, Collections */ + CreateCatalog = 'CreateCatalog', + /** Grants permission to create Channel */ + CreateChannel = 'CreateChannel', + /** Grants permission to create Collection */ + CreateCollection = 'CreateCollection', + /** Grants permission to create Country */ + CreateCountry = 'CreateCountry', + /** Grants permission to create Customer */ + CreateCustomer = 'CreateCustomer', + /** Grants permission to create CustomerGroup */ + CreateCustomerGroup = 'CreateCustomerGroup', + /** Grants permission to create Facet */ + CreateFacet = 'CreateFacet', + /** Grants permission to create Order */ + CreateOrder = 'CreateOrder', + /** Grants permission to create PaymentMethod */ + CreatePaymentMethod = 'CreatePaymentMethod', + /** Grants permission to create Product */ + CreateProduct = 'CreateProduct', + /** Grants permission to create Promotion */ + CreatePromotion = 'CreatePromotion', + /** Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + CreateSettings = 'CreateSettings', + /** Grants permission to create ShippingMethod */ + CreateShippingMethod = 'CreateShippingMethod', + /** Grants permission to create System */ + CreateSystem = 'CreateSystem', + /** Grants permission to create Tag */ + CreateTag = 'CreateTag', + /** Grants permission to create TaxCategory */ + CreateTaxCategory = 'CreateTaxCategory', + /** Grants permission to create TaxRate */ + CreateTaxRate = 'CreateTaxRate', + /** Grants permission to create Zone */ + CreateZone = 'CreateZone', + /** Grants permission to delete Administrator */ + DeleteAdministrator = 'DeleteAdministrator', + /** Grants permission to delete Asset */ + DeleteAsset = 'DeleteAsset', + /** Grants permission to delete Products, Facets, Assets, Collections */ + DeleteCatalog = 'DeleteCatalog', + /** Grants permission to delete Channel */ + DeleteChannel = 'DeleteChannel', + /** Grants permission to delete Collection */ + DeleteCollection = 'DeleteCollection', + /** Grants permission to delete Country */ + DeleteCountry = 'DeleteCountry', + /** Grants permission to delete Customer */ + DeleteCustomer = 'DeleteCustomer', + /** Grants permission to delete CustomerGroup */ + DeleteCustomerGroup = 'DeleteCustomerGroup', + /** Grants permission to delete Facet */ + DeleteFacet = 'DeleteFacet', + /** Grants permission to delete Order */ + DeleteOrder = 'DeleteOrder', + /** Grants permission to delete PaymentMethod */ + DeletePaymentMethod = 'DeletePaymentMethod', + /** Grants permission to delete Product */ + DeleteProduct = 'DeleteProduct', + /** Grants permission to delete Promotion */ + DeletePromotion = 'DeletePromotion', + /** Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + DeleteSettings = 'DeleteSettings', + /** Grants permission to delete ShippingMethod */ + DeleteShippingMethod = 'DeleteShippingMethod', + /** Grants permission to delete System */ + DeleteSystem = 'DeleteSystem', + /** Grants permission to delete Tag */ + DeleteTag = 'DeleteTag', + /** Grants permission to delete TaxCategory */ + DeleteTaxCategory = 'DeleteTaxCategory', + /** Grants permission to delete TaxRate */ + DeleteTaxRate = 'DeleteTaxRate', + /** Grants permission to delete Zone */ + DeleteZone = 'DeleteZone', + /** Owner means the user owns this entity, e.g. a Customer's own Order */ + Owner = 'Owner', + /** Public means any unauthenticated user may perform the operation */ + Public = 'Public', + /** Grants permission to read Administrator */ + ReadAdministrator = 'ReadAdministrator', + /** Grants permission to read Asset */ + ReadAsset = 'ReadAsset', + /** Grants permission to read Products, Facets, Assets, Collections */ + ReadCatalog = 'ReadCatalog', + /** Grants permission to read Channel */ + ReadChannel = 'ReadChannel', + /** Grants permission to read Collection */ + ReadCollection = 'ReadCollection', + /** Grants permission to read Country */ + ReadCountry = 'ReadCountry', + /** Grants permission to read Customer */ + ReadCustomer = 'ReadCustomer', + /** Grants permission to read CustomerGroup */ + ReadCustomerGroup = 'ReadCustomerGroup', + /** Grants permission to read Facet */ + ReadFacet = 'ReadFacet', + /** Grants permission to read Order */ + ReadOrder = 'ReadOrder', + /** Grants permission to read PaymentMethod */ + ReadPaymentMethod = 'ReadPaymentMethod', + /** Grants permission to read Product */ + ReadProduct = 'ReadProduct', + /** Grants permission to read Promotion */ + ReadPromotion = 'ReadPromotion', + /** Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + ReadSettings = 'ReadSettings', + /** Grants permission to read ShippingMethod */ + ReadShippingMethod = 'ReadShippingMethod', + /** Grants permission to read System */ + ReadSystem = 'ReadSystem', + /** Grants permission to read Tag */ + ReadTag = 'ReadTag', + /** Grants permission to read TaxCategory */ + ReadTaxCategory = 'ReadTaxCategory', + /** Grants permission to read TaxRate */ + ReadTaxRate = 'ReadTaxRate', + /** Grants permission to read Zone */ + ReadZone = 'ReadZone', + /** SuperAdmin has unrestricted access to all operations */ + SuperAdmin = 'SuperAdmin', + /** Grants permission to update Administrator */ + UpdateAdministrator = 'UpdateAdministrator', + /** Grants permission to update Asset */ + UpdateAsset = 'UpdateAsset', + /** Grants permission to update Products, Facets, Assets, Collections */ + UpdateCatalog = 'UpdateCatalog', + /** Grants permission to update Channel */ + UpdateChannel = 'UpdateChannel', + /** Grants permission to update Collection */ + UpdateCollection = 'UpdateCollection', + /** Grants permission to update Country */ + UpdateCountry = 'UpdateCountry', + /** Grants permission to update Customer */ + UpdateCustomer = 'UpdateCustomer', + /** Grants permission to update CustomerGroup */ + UpdateCustomerGroup = 'UpdateCustomerGroup', + /** Grants permission to update Facet */ + UpdateFacet = 'UpdateFacet', + /** Grants permission to update GlobalSettings */ + UpdateGlobalSettings = 'UpdateGlobalSettings', + /** Grants permission to update Order */ + UpdateOrder = 'UpdateOrder', + /** Grants permission to update PaymentMethod */ + UpdatePaymentMethod = 'UpdatePaymentMethod', + /** Grants permission to update Product */ + UpdateProduct = 'UpdateProduct', + /** Grants permission to update Promotion */ + UpdatePromotion = 'UpdatePromotion', + /** Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings */ + UpdateSettings = 'UpdateSettings', + /** Grants permission to update ShippingMethod */ + UpdateShippingMethod = 'UpdateShippingMethod', + /** Grants permission to update System */ + UpdateSystem = 'UpdateSystem', + /** Grants permission to update Tag */ + UpdateTag = 'UpdateTag', + /** Grants permission to update TaxCategory */ + UpdateTaxCategory = 'UpdateTaxCategory', + /** Grants permission to update TaxRate */ + UpdateTaxRate = 'UpdateTaxRate', + /** Grants permission to update Zone */ + UpdateZone = 'UpdateZone', } -export type UpdateOrderItemsResult = - | Order - | OrderModificationError - | OrderLimitError - | NegativeQuantityError - | InsufficientStockError - -export type RemoveOrderItemsResult = Order | OrderModificationError - -export type SetOrderShippingMethodResult = - | Order - | OrderModificationError - | IneligibleShippingMethodError - | NoActiveOrderError - -export type ApplyCouponCodeResult = - | Order - | CouponCodeExpiredError - | CouponCodeInvalidError - | CouponCodeLimitError - -export type AddPaymentToOrderResult = - | Order - | OrderPaymentStateError - | IneligiblePaymentMethodError - | PaymentFailedError - | PaymentDeclinedError - | OrderStateTransitionError - | NoActiveOrderError - -export type TransitionOrderToStateResult = Order | OrderStateTransitionError - -export type SetCustomerForOrderResult = - | Order - | AlreadyLoggedInError - | EmailAddressConflictError - | NoActiveOrderError - -export type RegisterCustomerAccountResult = - | Success - | MissingPasswordError - | NativeAuthStrategyError - -export type RefreshCustomerVerificationResult = - | Success - | NativeAuthStrategyError - -export type VerifyCustomerAccountResult = - | CurrentUser - | VerificationTokenInvalidError - | VerificationTokenExpiredError - | MissingPasswordError - | PasswordAlreadySetError - | NativeAuthStrategyError - -export type UpdateCustomerPasswordResult = - | Success - | InvalidCredentialsError - | NativeAuthStrategyError - -export type RequestUpdateCustomerEmailAddressResult = - | Success - | InvalidCredentialsError - | EmailAddressConflictError - | NativeAuthStrategyError - -export type UpdateCustomerEmailAddressResult = - | Success - | IdentifierChangeTokenInvalidError - | IdentifierChangeTokenExpiredError - | NativeAuthStrategyError - -export type RequestPasswordResetResult = Success | NativeAuthStrategyError - -export type ResetPasswordResult = - | CurrentUser - | PasswordResetTokenInvalidError - | PasswordResetTokenExpiredError - | NativeAuthStrategyError - -export type NativeAuthenticationResult = - | CurrentUser - | InvalidCredentialsError - | NotVerifiedError - | NativeAuthStrategyError - -export type AuthenticationResult = - | CurrentUser - | InvalidCredentialsError - | NotVerifiedError - -export type ActiveOrderResult = Order | NoActiveOrderError - -export type CollectionFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - languageCode?: Maybe - name?: Maybe - slug?: Maybe - position?: Maybe - description?: Maybe +/** The price range where the result has more than one price */ +export type PriceRange = { + __typename?: 'PriceRange' + max: Scalars['Int'] + min: Scalars['Int'] } -export type CollectionSortParameter = { - id?: Maybe - createdAt?: Maybe - updatedAt?: Maybe - name?: Maybe - slug?: Maybe - position?: Maybe - description?: Maybe +export type Product = Node & { + __typename?: 'Product' + assets: Array + collections: Array + createdAt: Scalars['DateTime'] + customFields?: Maybe + description: Scalars['String'] + facetValues: Array + featuredAsset?: Maybe + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + optionGroups: Array + slug: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] + /** Returns a paginated, sortable, filterable list of ProductVariants */ + variantList: ProductVariantList + /** Returns all ProductVariants */ + variants: Array +} + +export type ProductVariantListArgs = { + options?: InputMaybe } export type ProductFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - languageCode?: Maybe - name?: Maybe - slug?: Maybe - description?: Maybe + createdAt?: InputMaybe + description?: InputMaybe + id?: InputMaybe + languageCode?: InputMaybe + name?: InputMaybe + slug?: InputMaybe + updatedAt?: InputMaybe +} + +export type ProductList = PaginatedList & { + __typename?: 'ProductList' + items: Array + totalItems: Scalars['Int'] +} + +export type ProductListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe +} + +export type ProductOption = Node & { + __typename?: 'ProductOption' + code: Scalars['String'] + createdAt: Scalars['DateTime'] + customFields?: Maybe + group: ProductOptionGroup + groupId: Scalars['ID'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] +} + +export type ProductOptionGroup = Node & { + __typename?: 'ProductOptionGroup' + code: Scalars['String'] + createdAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + options: Array + translations: Array + updatedAt: Scalars['DateTime'] +} + +export type ProductOptionGroupTranslation = { + __typename?: 'ProductOptionGroupTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type ProductOptionTranslation = { + __typename?: 'ProductOptionTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] } export type ProductSortParameter = { - id?: Maybe - createdAt?: Maybe - updatedAt?: Maybe - name?: Maybe - slug?: Maybe - description?: Maybe + createdAt?: InputMaybe + description?: InputMaybe + id?: InputMaybe + name?: InputMaybe + slug?: InputMaybe + updatedAt?: InputMaybe +} + +export type ProductTranslation = { + __typename?: 'ProductTranslation' + createdAt: Scalars['DateTime'] + description: Scalars['String'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + slug: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type ProductVariant = Node & { + __typename?: 'ProductVariant' + assets: Array + createdAt: Scalars['DateTime'] + currencyCode: CurrencyCode + customFields?: Maybe + facetValues: Array + featuredAsset?: Maybe + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + options: Array + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + product: Product + productId: Scalars['ID'] + sku: Scalars['String'] + stockLevel: Scalars['String'] + taxCategory: TaxCategory + taxRateApplied: TaxRate + translations: Array + updatedAt: Scalars['DateTime'] } export type ProductVariantFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - languageCode?: Maybe - sku?: Maybe - name?: Maybe - price?: Maybe - currencyCode?: Maybe - priceWithTax?: Maybe - stockLevel?: Maybe - discountPrice?: Maybe + createdAt?: InputMaybe + currencyCode?: InputMaybe + id?: InputMaybe + languageCode?: InputMaybe + name?: InputMaybe + price?: InputMaybe + priceWithTax?: InputMaybe + productId?: InputMaybe + sku?: InputMaybe + stockLevel?: InputMaybe + updatedAt?: InputMaybe +} + +export type ProductVariantList = PaginatedList & { + __typename?: 'ProductVariantList' + items: Array + totalItems: Scalars['Int'] +} + +export type ProductVariantListOptions = { + /** Allows the results to be filtered */ + filter?: InputMaybe + /** Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. */ + filterOperator?: InputMaybe + /** Skips the first n results, for use in pagination */ + skip?: InputMaybe + /** Specifies which properties to sort the results by */ + sort?: InputMaybe + /** Takes n results, for use in pagination */ + take?: InputMaybe } export type ProductVariantSortParameter = { - id?: Maybe - productId?: Maybe - createdAt?: Maybe - updatedAt?: Maybe - sku?: Maybe - name?: Maybe - price?: Maybe - priceWithTax?: Maybe - stockLevel?: Maybe - discountPrice?: Maybe + createdAt?: InputMaybe + id?: InputMaybe + name?: InputMaybe + price?: InputMaybe + priceWithTax?: InputMaybe + productId?: InputMaybe + sku?: InputMaybe + stockLevel?: InputMaybe + updatedAt?: InputMaybe } -export type CustomerFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - title?: Maybe - firstName?: Maybe - lastName?: Maybe - phoneNumber?: Maybe - emailAddress?: Maybe +export type ProductVariantTranslation = { + __typename?: 'ProductVariantTranslation' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] } -export type CustomerSortParameter = { - id?: Maybe - createdAt?: Maybe - updatedAt?: Maybe - title?: Maybe - firstName?: Maybe - lastName?: Maybe - phoneNumber?: Maybe - emailAddress?: Maybe +export type Promotion = Node & { + __typename?: 'Promotion' + actions: Array + conditions: Array + couponCode?: Maybe + createdAt: Scalars['DateTime'] + customFields?: Maybe + enabled: Scalars['Boolean'] + endsAt?: Maybe + id: Scalars['ID'] + name: Scalars['String'] + perCustomerUsageLimit?: Maybe + startsAt?: Maybe + updatedAt: Scalars['DateTime'] } -export type OrderFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - orderPlacedAt?: Maybe - code?: Maybe - state?: Maybe - active?: Maybe - totalQuantity?: Maybe - subTotal?: Maybe - subTotalWithTax?: Maybe - currencyCode?: Maybe - shipping?: Maybe - shippingWithTax?: Maybe - total?: Maybe - totalWithTax?: Maybe +export type PromotionList = PaginatedList & { + __typename?: 'PromotionList' + items: Array + totalItems: Scalars['Int'] } -export type OrderSortParameter = { - id?: Maybe - createdAt?: Maybe - updatedAt?: Maybe - orderPlacedAt?: Maybe - code?: Maybe - state?: Maybe - totalQuantity?: Maybe - subTotal?: Maybe - subTotalWithTax?: Maybe - shipping?: Maybe - shippingWithTax?: Maybe - total?: Maybe - totalWithTax?: Maybe +export type Query = { + __typename?: 'Query' + /** The active Channel */ + activeChannel: Channel + /** The active Customer */ + activeCustomer?: Maybe + /** + * The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the + * state of `PaymentAuthorized` or `PaymentSettled`, then that Order is no longer considered "active" and this + * query will once again return `null`. + */ + activeOrder?: Maybe + /** An array of supported Countries */ + availableCountries: Array + /** Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is specified, an error will result. */ + collection?: Maybe + /** A list of Collections available to the shop */ + collections: CollectionList + /** Returns a list of payment methods and their eligibility based on the current active Order */ + eligiblePaymentMethods: Array + /** Returns a list of eligible shipping methods based on the current active Order */ + eligibleShippingMethods: Array + /** Returns a Facet by its id */ + facet?: Maybe + /** A list of Facets available to the shop */ + facets: FacetList + /** Returns information about the current authenticated User */ + me?: Maybe + /** Returns the possible next states that the activeOrder can transition to */ + nextOrderStates: Array + /** + * Returns an Order based on the id. Note that in the Shop API, only orders belonging to the + * currently-authenticated User may be queried. + */ + order?: Maybe + /** + * Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) + * this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation + * screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing + * general anonymous access to Order data. + */ + orderByCode?: Maybe + /** Get a Product either by id or slug. If neither 'id' nor 'slug' is specified, an error will result. */ + product?: Maybe + /** Get a list of Products */ + products: ProductList + /** Search Products based on the criteria set by the `SearchInput` */ + search: SearchResponse } -export type HistoryEntryFilterParameter = { - createdAt?: Maybe - updatedAt?: Maybe - type?: Maybe +export type QueryCollectionArgs = { + id?: InputMaybe + slug?: InputMaybe } -export type HistoryEntrySortParameter = { - id?: Maybe - createdAt?: Maybe - updatedAt?: Maybe +export type QueryCollectionsArgs = { + options?: InputMaybe } -export type ProductVariantCustomFields = { - __typename?: 'ProductVariantCustomFields' - discountPrice?: Maybe +export type QueryFacetArgs = { + id: Scalars['ID'] } -export type NativeAuthInput = { - username: Scalars['String'] - password: Scalars['String'] +export type QueryFacetsArgs = { + options?: InputMaybe } -export type CartFragment = { __typename?: 'Order' } & Pick< - Order, - | 'id' - | 'code' - | 'createdAt' - | 'totalQuantity' - | 'subTotal' - | 'subTotalWithTax' - | 'total' - | 'totalWithTax' - | 'currencyCode' -> & { - customer?: Maybe<{ __typename?: 'Customer' } & Pick> - lines: Array< - { __typename?: 'OrderLine' } & Pick< - OrderLine, - | 'id' - | 'quantity' - | 'linePriceWithTax' - | 'discountedLinePriceWithTax' - | 'unitPriceWithTax' - | 'discountedUnitPriceWithTax' - > & { - featuredAsset?: Maybe< - { __typename?: 'Asset' } & Pick - > - discounts: Array< - { __typename?: 'Discount' } & Pick< - Discount, - 'description' | 'amount' - > - > - productVariant: { __typename?: 'ProductVariant' } & Pick< - ProductVariant, - | 'id' - | 'name' - | 'sku' - | 'price' - | 'priceWithTax' - | 'stockLevel' - | 'productId' - > & { product: { __typename?: 'Product' } & Pick } - } - > - } +export type QueryOrderArgs = { + id: Scalars['ID'] +} -export type SearchResultFragment = { __typename?: 'SearchResult' } & Pick< - SearchResult, - 'productId' | 'productName' | 'description' | 'slug' | 'sku' | 'currencyCode' -> & { - productAsset?: Maybe< - { __typename?: 'SearchResultAsset' } & Pick< - SearchResultAsset, - 'id' | 'preview' - > - > - priceWithTax: - | ({ __typename?: 'PriceRange' } & Pick) - | ({ __typename?: 'SinglePrice' } & Pick) - } +export type QueryOrderByCodeArgs = { + code: Scalars['String'] +} + +export type QueryProductArgs = { + id?: InputMaybe + slug?: InputMaybe +} + +export type QueryProductsArgs = { + options?: InputMaybe +} + +export type QuerySearchArgs = { + input: SearchInput +} + +export type RefreshCustomerVerificationResult = + | NativeAuthStrategyError + | Success + +export type Refund = Node & { + __typename?: 'Refund' + adjustment: Scalars['Int'] + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + items: Scalars['Int'] + metadata?: Maybe + method?: Maybe + orderItems: Array + paymentId: Scalars['ID'] + reason?: Maybe + shipping: Scalars['Int'] + state: Scalars['String'] + total: Scalars['Int'] + transactionId?: Maybe + updatedAt: Scalars['DateTime'] +} + +export type RegisterCustomerAccountResult = + | MissingPasswordError + | NativeAuthStrategyError + | PasswordValidationError + | Success + +export type RegisterCustomerInput = { + emailAddress: Scalars['String'] + firstName?: InputMaybe + lastName?: InputMaybe + password?: InputMaybe + phoneNumber?: InputMaybe + title?: InputMaybe +} + +export type RelationCustomFieldConfig = CustomField & { + __typename?: 'RelationCustomFieldConfig' + description?: Maybe> + entity: Scalars['String'] + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + scalarFields: Array + type: Scalars['String'] + ui?: Maybe +} + +export type RemoveOrderItemsResult = Order | OrderModificationError + +export type RequestPasswordResetResult = NativeAuthStrategyError | Success + +export type RequestUpdateCustomerEmailAddressResult = + | EmailAddressConflictError + | InvalidCredentialsError + | NativeAuthStrategyError + | Success + +export type ResetPasswordResult = + | CurrentUser + | NativeAuthStrategyError + | NotVerifiedError + | PasswordResetTokenExpiredError + | PasswordResetTokenInvalidError + | PasswordValidationError + +export type Role = Node & { + __typename?: 'Role' + channels: Array + code: Scalars['String'] + createdAt: Scalars['DateTime'] + description: Scalars['String'] + id: Scalars['ID'] + permissions: Array + updatedAt: Scalars['DateTime'] +} + +export type RoleList = PaginatedList & { + __typename?: 'RoleList' + items: Array + totalItems: Scalars['Int'] +} + +export type SearchInput = { + collectionId?: InputMaybe + collectionSlug?: InputMaybe + facetValueFilters?: InputMaybe> + facetValueIds?: InputMaybe> + facetValueOperator?: InputMaybe + groupByProduct?: InputMaybe + inStock?: InputMaybe + skip?: InputMaybe + sort?: InputMaybe + take?: InputMaybe + term?: InputMaybe +} + +export type SearchReindexResponse = { + __typename?: 'SearchReindexResponse' + success: Scalars['Boolean'] +} + +export type SearchResponse = { + __typename?: 'SearchResponse' + collections: Array + facetValues: Array + items: Array + totalItems: Scalars['Int'] +} + +export type SearchResult = { + __typename?: 'SearchResult' + /** An array of ids of the Collections in which this result appears */ + collectionIds: Array + currencyCode: CurrencyCode + description: Scalars['String'] + facetIds: Array + facetValueIds: Array + inStock: Scalars['Boolean'] + price: SearchResultPrice + priceWithTax: SearchResultPrice + productAsset?: Maybe + productId: Scalars['ID'] + productName: Scalars['String'] + productVariantAsset?: Maybe + productVariantId: Scalars['ID'] + productVariantName: Scalars['String'] + /** A relevance score for the result. Differs between database implementations */ + score: Scalars['Float'] + sku: Scalars['String'] + slug: Scalars['String'] +} + +export type SearchResultAsset = { + __typename?: 'SearchResultAsset' + focalPoint?: Maybe + id: Scalars['ID'] + preview: Scalars['String'] +} + +/** The price of a search result product, either as a range or as a single price */ +export type SearchResultPrice = PriceRange | SinglePrice + +export type SearchResultSortParameter = { + name?: InputMaybe + price?: InputMaybe +} + +export type SetCustomerForOrderResult = + | AlreadyLoggedInError + | EmailAddressConflictError + | NoActiveOrderError + | Order + +export type SetOrderShippingMethodResult = + | IneligibleShippingMethodError + | NoActiveOrderError + | Order + | OrderModificationError + +export type ShippingLine = { + __typename?: 'ShippingLine' + discountedPrice: Scalars['Int'] + discountedPriceWithTax: Scalars['Int'] + discounts: Array + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + shippingMethod: ShippingMethod +} + +export type ShippingMethod = Node & { + __typename?: 'ShippingMethod' + calculator: ConfigurableOperation + checker: ConfigurableOperation + code: Scalars['String'] + createdAt: Scalars['DateTime'] + customFields?: Maybe + description: Scalars['String'] + fulfillmentHandlerCode: Scalars['String'] + id: Scalars['ID'] + name: Scalars['String'] + translations: Array + updatedAt: Scalars['DateTime'] +} + +export type ShippingMethodList = PaginatedList & { + __typename?: 'ShippingMethodList' + items: Array + totalItems: Scalars['Int'] +} + +export type ShippingMethodQuote = { + __typename?: 'ShippingMethodQuote' + code: Scalars['String'] + customFields?: Maybe + description: Scalars['String'] + id: Scalars['ID'] + /** Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult */ + metadata?: Maybe + name: Scalars['String'] + price: Scalars['Int'] + priceWithTax: Scalars['Int'] +} + +export type ShippingMethodTranslation = { + __typename?: 'ShippingMethodTranslation' + createdAt: Scalars['DateTime'] + description: Scalars['String'] + id: Scalars['ID'] + languageCode: LanguageCode + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +/** The price value where the result has a single price */ +export type SinglePrice = { + __typename?: 'SinglePrice' + value: Scalars['Int'] +} + +export enum SortOrder { + Asc = 'ASC', + Desc = 'DESC', +} + +export type StringCustomFieldConfig = CustomField & { + __typename?: 'StringCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + length?: Maybe + list: Scalars['Boolean'] + name: Scalars['String'] + nullable?: Maybe + options?: Maybe> + pattern?: Maybe + readonly?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +export type StringFieldOption = { + __typename?: 'StringFieldOption' + label?: Maybe> + value: Scalars['String'] +} + +/** Operators for filtering on a list of String fields */ +export type StringListOperators = { + inList: Scalars['String'] +} + +/** Operators for filtering on a String field */ +export type StringOperators = { + contains?: InputMaybe + eq?: InputMaybe + in?: InputMaybe> + notContains?: InputMaybe + notEq?: InputMaybe + notIn?: InputMaybe> + regex?: InputMaybe +} + +/** Indicates that an operation succeeded, where we do not want to return any more specific information. */ +export type Success = { + __typename?: 'Success' + success: Scalars['Boolean'] +} + +export type Surcharge = Node & { + __typename?: 'Surcharge' + createdAt: Scalars['DateTime'] + description: Scalars['String'] + id: Scalars['ID'] + price: Scalars['Int'] + priceWithTax: Scalars['Int'] + sku?: Maybe + taxLines: Array + taxRate: Scalars['Float'] + updatedAt: Scalars['DateTime'] +} + +export type Tag = Node & { + __typename?: 'Tag' + createdAt: Scalars['DateTime'] + id: Scalars['ID'] + updatedAt: Scalars['DateTime'] + value: Scalars['String'] +} + +export type TagList = PaginatedList & { + __typename?: 'TagList' + items: Array + totalItems: Scalars['Int'] +} + +export type TaxCategory = Node & { + __typename?: 'TaxCategory' + createdAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] + isDefault: Scalars['Boolean'] + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type TaxLine = { + __typename?: 'TaxLine' + description: Scalars['String'] + taxRate: Scalars['Float'] +} + +export type TaxRate = Node & { + __typename?: 'TaxRate' + category: TaxCategory + createdAt: Scalars['DateTime'] + customFields?: Maybe + customerGroup?: Maybe + enabled: Scalars['Boolean'] + id: Scalars['ID'] + name: Scalars['String'] + updatedAt: Scalars['DateTime'] + value: Scalars['Float'] + zone: Zone +} + +export type TaxRateList = PaginatedList & { + __typename?: 'TaxRateList' + items: Array + totalItems: Scalars['Int'] +} + +export type TextCustomFieldConfig = CustomField & { + __typename?: 'TextCustomFieldConfig' + description?: Maybe> + internal?: Maybe + label?: Maybe> + list: Scalars['Boolean'] + name: Scalars['String'] + nullable?: Maybe + readonly?: Maybe + type: Scalars['String'] + ui?: Maybe +} + +export type TransitionOrderToStateResult = Order | OrderStateTransitionError + +export type UpdateAddressInput = { + city?: InputMaybe + company?: InputMaybe + countryCode?: InputMaybe + customFields?: InputMaybe + defaultBillingAddress?: InputMaybe + defaultShippingAddress?: InputMaybe + fullName?: InputMaybe + id: Scalars['ID'] + phoneNumber?: InputMaybe + postalCode?: InputMaybe + province?: InputMaybe + streetLine1?: InputMaybe + streetLine2?: InputMaybe +} + +export type UpdateCustomerEmailAddressResult = + | IdentifierChangeTokenExpiredError + | IdentifierChangeTokenInvalidError + | NativeAuthStrategyError + | Success + +export type UpdateCustomerInput = { + customFields?: InputMaybe + firstName?: InputMaybe + lastName?: InputMaybe + phoneNumber?: InputMaybe + title?: InputMaybe +} + +export type UpdateCustomerPasswordResult = + | InvalidCredentialsError + | NativeAuthStrategyError + | PasswordValidationError + | Success + +export type UpdateOrderInput = { + customFields?: InputMaybe +} + +export type UpdateOrderItemsResult = + | InsufficientStockError + | NegativeQuantityError + | Order + | OrderLimitError + | OrderModificationError + +export type User = Node & { + __typename?: 'User' + authenticationMethods: Array + createdAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] + identifier: Scalars['String'] + lastLogin?: Maybe + roles: Array + updatedAt: Scalars['DateTime'] + verified: Scalars['Boolean'] +} + +/** + * Returned if the verification token (used to verify a Customer's email address) is valid, but has + * expired according to the `verificationTokenDuration` setting in the AuthOptions. + */ +export type VerificationTokenExpiredError = ErrorResult & { + __typename?: 'VerificationTokenExpiredError' + errorCode: ErrorCode + message: Scalars['String'] +} + +/** + * Returned if the verification token (used to verify a Customer's email address) is either + * invalid or does not match any expected tokens. + */ +export type VerificationTokenInvalidError = ErrorResult & { + __typename?: 'VerificationTokenInvalidError' + errorCode: ErrorCode + message: Scalars['String'] +} + +export type VerifyCustomerAccountResult = + | CurrentUser + | MissingPasswordError + | NativeAuthStrategyError + | PasswordAlreadySetError + | PasswordValidationError + | VerificationTokenExpiredError + | VerificationTokenInvalidError + +export type Zone = Node & { + __typename?: 'Zone' + createdAt: Scalars['DateTime'] + customFields?: Maybe + id: Scalars['ID'] + members: Array + name: Scalars['String'] + updatedAt: Scalars['DateTime'] +} + +export type CartFragment = { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> +} + +export type OrderAddressFragmentFragment = { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined +} + +export type SearchResultFragment = { + __typename?: 'SearchResult' + productId: string + productName: string + description: string + slug: string + sku: string + currencyCode: CurrencyCode + productAsset?: + | { __typename?: 'SearchResultAsset'; id: string; preview: string } + | null + | undefined + priceWithTax: + | { __typename?: 'PriceRange'; min: number; max: number } + | { __typename?: 'SinglePrice'; value: number } +} export type AddItemToOrderMutationVariables = Exact<{ variantId: Scalars['ID'] quantity: Scalars['Int'] }> -export type AddItemToOrderMutation = { __typename?: 'Mutation' } & { +export type AddItemToOrderMutation = { + __typename?: 'Mutation' addItemToOrder: - | ({ __typename: 'Order' } & CartFragment) - | ({ __typename: 'OrderModificationError' } & Pick< - OrderModificationError, - 'errorCode' | 'message' - >) - | ({ __typename: 'OrderLimitError' } & Pick< - OrderLimitError, - 'errorCode' | 'message' - >) - | ({ __typename: 'NegativeQuantityError' } & Pick< - NegativeQuantityError, - 'errorCode' | 'message' - >) - | ({ __typename: 'InsufficientStockError' } & Pick< - InsufficientStockError, - 'errorCode' | 'message' - >) + | { + __typename: 'InsufficientStockError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'NegativeQuantityError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { __typename: 'OrderLimitError'; errorCode: ErrorCode; message: string } + | { + __typename: 'OrderModificationError' + errorCode: ErrorCode + message: string + } +} + +export type AddPaymentToOrderMutationVariables = Exact<{ + input: PaymentInput +}> + +export type AddPaymentToOrderMutation = { + __typename?: 'Mutation' + addPaymentToOrder: + | { + __typename?: 'IneligiblePaymentMethodError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'NoActiveOrderError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { + __typename?: 'OrderPaymentStateError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'OrderStateTransitionError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'PaymentDeclinedError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'PaymentFailedError' + errorCode: ErrorCode + message: string + } } export type AdjustOrderLineMutationVariables = Exact<{ @@ -3052,25 +3513,99 @@ export type AdjustOrderLineMutationVariables = Exact<{ quantity: Scalars['Int'] }> -export type AdjustOrderLineMutation = { __typename?: 'Mutation' } & { +export type AdjustOrderLineMutation = { + __typename?: 'Mutation' adjustOrderLine: - | ({ __typename: 'Order' } & CartFragment) - | ({ __typename: 'OrderModificationError' } & Pick< - OrderModificationError, - 'errorCode' | 'message' - >) - | ({ __typename: 'OrderLimitError' } & Pick< - OrderLimitError, - 'errorCode' | 'message' - >) - | ({ __typename: 'NegativeQuantityError' } & Pick< - NegativeQuantityError, - 'errorCode' | 'message' - >) - | ({ __typename: 'InsufficientStockError' } & Pick< - InsufficientStockError, - 'errorCode' | 'message' - >) + | { + __typename: 'InsufficientStockError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'NegativeQuantityError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { __typename: 'OrderLimitError'; errorCode: ErrorCode; message: string } + | { + __typename: 'OrderModificationError' + errorCode: ErrorCode + message: string + } } export type LoginMutationVariables = Exact<{ @@ -3078,77 +3613,644 @@ export type LoginMutationVariables = Exact<{ password: Scalars['String'] }> -export type LoginMutation = { __typename?: 'Mutation' } & { +export type LoginMutation = { + __typename?: 'Mutation' login: - | ({ __typename: 'CurrentUser' } & Pick) - | ({ __typename: 'InvalidCredentialsError' } & Pick< - InvalidCredentialsError, - 'errorCode' | 'message' - >) - | ({ __typename: 'NotVerifiedError' } & Pick< - NotVerifiedError, - 'errorCode' | 'message' - >) - | ({ __typename: 'NativeAuthStrategyError' } & Pick< - NativeAuthStrategyError, - 'errorCode' | 'message' - >) + | { __typename: 'CurrentUser'; id: string } + | { + __typename: 'InvalidCredentialsError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'NativeAuthStrategyError' + errorCode: ErrorCode + message: string + } + | { __typename: 'NotVerifiedError'; errorCode: ErrorCode; message: string } } export type LogoutMutationVariables = Exact<{ [key: string]: never }> -export type LogoutMutation = { __typename?: 'Mutation' } & { - logout: { __typename?: 'Success' } & Pick +export type LogoutMutation = { + __typename?: 'Mutation' + logout: { __typename?: 'Success'; success: boolean } } export type RemoveOrderLineMutationVariables = Exact<{ orderLineId: Scalars['ID'] }> -export type RemoveOrderLineMutation = { __typename?: 'Mutation' } & { +export type RemoveOrderLineMutation = { + __typename?: 'Mutation' removeOrderLine: - | ({ __typename: 'Order' } & CartFragment) - | ({ __typename: 'OrderModificationError' } & Pick< - OrderModificationError, - 'errorCode' | 'message' - >) + | { + __typename: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { + __typename: 'OrderModificationError' + errorCode: ErrorCode + message: string + } +} + +export type SetOrderBillingAddressMutationVariables = Exact<{ + input: CreateAddressInput +}> + +export type SetOrderBillingAddressMutation = { + __typename?: 'Mutation' + setOrderBillingAddress: + | { + __typename?: 'NoActiveOrderError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } +} + +export type SetCustomerForOrderMutationVariables = Exact<{ + input: CreateCustomerInput +}> + +export type SetCustomerForOrderMutation = { + __typename?: 'Mutation' + setCustomerForOrder: + | { __typename?: 'AlreadyLoggedInError' } + | { __typename?: 'EmailAddressConflictError' } + | { __typename?: 'NoActiveOrderError' } + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } +} + +export type SetOrderShippingAddressMutationVariables = Exact<{ + input: CreateAddressInput +}> + +export type SetOrderShippingAddressMutation = { + __typename?: 'Mutation' + setOrderShippingAddress: + | { + __typename?: 'NoActiveOrderError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } +} + +export type SetOrderShippingMethodMutationVariables = Exact<{ + shippingMethodId: Scalars['ID'] +}> + +export type SetOrderShippingMethodMutation = { + __typename?: 'Mutation' + setOrderShippingMethod: + | { + __typename?: 'IneligibleShippingMethodError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'NoActiveOrderError' + errorCode: ErrorCode + message: string + } + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { + __typename?: 'OrderModificationError' + errorCode: ErrorCode + message: string + } } export type SignupMutationVariables = Exact<{ input: RegisterCustomerInput }> -export type SignupMutation = { __typename?: 'Mutation' } & { +export type SignupMutation = { + __typename?: 'Mutation' registerCustomerAccount: - | ({ __typename: 'Success' } & Pick) - | ({ __typename: 'MissingPasswordError' } & Pick< - MissingPasswordError, - 'errorCode' | 'message' - >) - | ({ __typename: 'NativeAuthStrategyError' } & Pick< - NativeAuthStrategyError, - 'errorCode' | 'message' - >) + | { + __typename: 'MissingPasswordError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'NativeAuthStrategyError' + errorCode: ErrorCode + message: string + } + | { + __typename: 'PasswordValidationError' + errorCode: ErrorCode + message: string + } + | { __typename: 'Success'; success: boolean } +} + +export type TransitionOrderToStateMutationVariables = Exact<{ + state: Scalars['String'] +}> + +export type TransitionOrderToStateMutation = { + __typename?: 'Mutation' + transitionOrderToState?: + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | { + __typename?: 'OrderStateTransitionError' + errorCode: ErrorCode + message: string + } + | null + | undefined } export type ActiveCustomerQueryVariables = Exact<{ [key: string]: never }> -export type ActiveCustomerQuery = { __typename?: 'Query' } & { - activeCustomer?: Maybe< - { __typename?: 'Customer' } & Pick< - Customer, - 'id' | 'firstName' | 'lastName' | 'emailAddress' - > - > +export type ActiveCustomerQuery = { + __typename?: 'Query' + activeCustomer?: + | { + __typename?: 'Customer' + id: string + firstName: string + lastName: string + emailAddress: string + } + | null + | undefined +} + +export type EligiblePaymentMethodsQueryVariables = Exact<{ + [key: string]: never +}> + +export type EligiblePaymentMethodsQuery = { + __typename?: 'Query' + eligiblePaymentMethods: Array<{ + __typename?: 'PaymentMethodQuote' + id: string + code: string + }> +} + +export type EligibleShippingMethodsQueryVariables = Exact<{ + [key: string]: never +}> + +export type EligibleShippingMethodsQuery = { + __typename?: 'Query' + eligibleShippingMethods: Array<{ + __typename?: 'ShippingMethodQuote' + id: string + code: string + }> } export type GetAllProductPathsQueryVariables = Exact<{ - first?: Maybe + first?: InputMaybe }> -export type GetAllProductPathsQuery = { __typename?: 'Query' } & { - products: { __typename?: 'ProductList' } & { - items: Array<{ __typename?: 'Product' } & Pick> +export type GetAllProductPathsQuery = { + __typename?: 'Query' + products: { + __typename?: 'ProductList' + items: Array<{ __typename?: 'Product'; slug: string }> } } @@ -3156,37 +4258,131 @@ export type GetAllProductsQueryVariables = Exact<{ input: SearchInput }> -export type GetAllProductsQuery = { __typename?: 'Query' } & { - search: { __typename?: 'SearchResponse' } & { - items: Array<{ __typename?: 'SearchResult' } & SearchResultFragment> +export type GetAllProductsQuery = { + __typename?: 'Query' + search: { + __typename?: 'SearchResponse' + items: Array<{ + __typename?: 'SearchResult' + productId: string + productName: string + description: string + slug: string + sku: string + currencyCode: CurrencyCode + productAsset?: + | { __typename?: 'SearchResultAsset'; id: string; preview: string } + | null + | undefined + priceWithTax: + | { __typename?: 'PriceRange'; min: number; max: number } + | { __typename?: 'SinglePrice'; value: number } + }> } } export type ActiveOrderQueryVariables = Exact<{ [key: string]: never }> -export type ActiveOrderQuery = { __typename?: 'Query' } & { - activeOrder?: Maybe<{ __typename?: 'Order' } & CartFragment> +export type ActiveOrderQuery = { + __typename?: 'Query' + activeOrder?: + | { + __typename?: 'Order' + id: string + code: string + createdAt: any + totalQuantity: number + subTotal: number + subTotalWithTax: number + total: number + totalWithTax: number + currencyCode: CurrencyCode + customer?: { __typename?: 'Customer'; id: string } | null | undefined + shippingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + billingAddress?: + | { + __typename?: 'OrderAddress' + fullName?: string | null | undefined + company?: string | null | undefined + streetLine1?: string | null | undefined + streetLine2?: string | null | undefined + city?: string | null | undefined + province?: string | null | undefined + postalCode?: string | null | undefined + country?: string | null | undefined + countryCode?: string | null | undefined + phoneNumber?: string | null | undefined + } + | null + | undefined + lines: Array<{ + __typename?: 'OrderLine' + id: string + quantity: number + linePriceWithTax: number + discountedLinePriceWithTax: number + unitPriceWithTax: number + discountedUnitPriceWithTax: number + featuredAsset?: + | { __typename?: 'Asset'; id: string; preview: string } + | null + | undefined + discounts: Array<{ + __typename?: 'Discount' + description: string + amount: number + }> + productVariant: { + __typename?: 'ProductVariant' + id: string + name: string + sku: string + price: number + priceWithTax: number + stockLevel: string + productId: string + product: { __typename?: 'Product'; slug: string } + } + }> + } + | null + | undefined } export type GetCollectionsQueryVariables = Exact<{ [key: string]: never }> -export type GetCollectionsQuery = { __typename?: 'Query' } & { - collections: { __typename?: 'CollectionList' } & { - items: Array< - { __typename?: 'Collection' } & Pick< - Collection, - 'id' | 'name' | 'description' | 'slug' - > & { - productVariants: { __typename?: 'ProductVariantList' } & Pick< - ProductVariantList, - 'totalItems' - > - parent?: Maybe<{ __typename?: 'Collection' } & Pick> - children?: Maybe< - Array<{ __typename?: 'Collection' } & Pick> - > - } - > +export type GetCollectionsQuery = { + __typename?: 'Query' + collections: { + __typename?: 'CollectionList' + items: Array<{ + __typename?: 'Collection' + id: string + name: string + description: string + slug: string + productVariants: { __typename?: 'ProductVariantList'; totalItems: number } + parent?: { __typename?: 'Collection'; id: string } | null | undefined + children?: + | Array<{ __typename?: 'Collection'; id: string }> + | null + | undefined + }> } } @@ -3194,64 +4390,79 @@ export type GetProductQueryVariables = Exact<{ slug: Scalars['String'] }> -export type GetProductQuery = { __typename?: 'Query' } & { - product?: Maybe< - { __typename?: 'Product' } & Pick< - Product, - 'id' | 'name' | 'slug' | 'description' - > & { - assets: Array< - { __typename?: 'Asset' } & Pick - > - variants: Array< - { __typename?: 'ProductVariant' } & Pick< - ProductVariant, - 'id' | 'priceWithTax' | 'currencyCode' - > & { - options: Array< - { __typename?: 'ProductOption' } & Pick< - ProductOption, - 'id' | 'name' | 'code' | 'groupId' - > & { - group: { __typename?: 'ProductOptionGroup' } & Pick< - ProductOptionGroup, - 'id' - > & { - options: Array< - { __typename?: 'ProductOption' } & Pick< - ProductOption, - 'name' - > - > - } - } - > +export type GetProductQuery = { + __typename?: 'Query' + product?: + | { + __typename?: 'Product' + id: string + name: string + slug: string + description: string + assets: Array<{ + __typename?: 'Asset' + id: string + preview: string + name: string + }> + variants: Array<{ + __typename?: 'ProductVariant' + id: string + priceWithTax: number + currencyCode: CurrencyCode + options: Array<{ + __typename?: 'ProductOption' + id: string + name: string + code: string + groupId: string + group: { + __typename?: 'ProductOptionGroup' + id: string + options: Array<{ __typename?: 'ProductOption'; name: string }> } - > - optionGroups: Array< - { __typename?: 'ProductOptionGroup' } & Pick< - ProductOptionGroup, - 'id' | 'code' | 'name' - > & { - options: Array< - { __typename?: 'ProductOption' } & Pick< - ProductOption, - 'id' | 'name' - > - > - } - > + }> + }> + optionGroups: Array<{ + __typename?: 'ProductOptionGroup' + id: string + code: string + name: string + options: Array<{ + __typename?: 'ProductOption' + id: string + name: string + }> + }> } - > + | null + | undefined } export type SearchQueryVariables = Exact<{ input: SearchInput }> -export type SearchQuery = { __typename?: 'Query' } & { - search: { __typename?: 'SearchResponse' } & Pick< - SearchResponse, - 'totalItems' - > & { items: Array<{ __typename?: 'SearchResult' } & SearchResultFragment> } +export type SearchQuery = { + __typename?: 'Query' + search: { + __typename?: 'SearchResponse' + totalItems: number + items: Array<{ + __typename?: 'SearchResult' + productId: string + productName: string + description: string + slug: string + sku: string + currencyCode: CurrencyCode + productAsset?: + | { __typename?: 'SearchResultAsset'; id: string; preview: string } + | null + | undefined + priceWithTax: + | { __typename?: 'PriceRange'; min: number; max: number } + | { __typename?: 'SinglePrice'; value: number } + }> + } } diff --git a/packages/vendure/schema.graphql b/packages/vendure/schema.graphql index 326e2bca5..d04d0ed3d 100644 --- a/packages/vendure/schema.graphql +++ b/packages/vendure/schema.graphql @@ -1,305 +1,73 @@ -type Query { - """ - The active Channel - """ - activeChannel: Channel! +union ActiveOrderResult = NoActiveOrderError | Order - """ - The active Customer - """ - activeCustomer: Customer - - """ - The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the - state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this - query will once again return `null`. - """ - activeOrder: Order - - """ - An array of supported Countries - """ - availableCountries: [Country!]! - - """ - A list of Collections available to the shop - """ - collections(options: CollectionListOptions): CollectionList! - - """ - Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result. - """ - collection(id: ID, slug: String): Collection - - """ - Returns a list of eligible shipping methods based on the current active Order - """ - eligibleShippingMethods: [ShippingMethodQuote!]! - - """ - Returns a list of payment methods and their eligibility based on the current active Order - """ - eligiblePaymentMethods: [PaymentMethodQuote!]! - - """ - Returns information about the current authenticated User - """ - me: CurrentUser - - """ - Returns the possible next states that the activeOrder can transition to - """ - nextOrderStates: [String!]! - - """ - Returns an Order based on the id. Note that in the Shop API, only orders belonging to the - currently-authenticated User may be queried. - """ - order(id: ID!): Order - - """ - Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) - this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation - screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing - general anonymous access to Order data. - """ - orderByCode(code: String!): Order - - """ - Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result. - """ - product(id: ID, slug: String): Product - - """ - Get a list of Products - """ - products(options: ProductListOptions): ProductList! - - """ - Search Products based on the criteria set by the `SearchInput` - """ - search(input: SearchInput!): SearchResponse! -} - -type Mutation { - """ - Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. - """ - addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult! - - """ - Remove an OrderLine from the Order - """ - removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult! - - """ - Remove all OrderLine from the Order - """ - removeAllOrderLines: RemoveOrderItemsResult! - - """ - Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. - """ - adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult! - - """ - Applies the given coupon code to the active Order - """ - applyCouponCode(couponCode: String!): ApplyCouponCodeResult! - - """ - Removes the given coupon code from the active Order - """ - removeCouponCode(couponCode: String!): Order - - """ - Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` - """ - transitionOrderToState(state: String!): TransitionOrderToStateResult - - """ - Sets the shipping address for this order - """ - setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult! - - """ - Sets the billing address for this order - """ - setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult! - - """ - Allows any custom fields to be set for the active order - """ - setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult! - - """ - Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query - """ - setOrderShippingMethod(shippingMethodId: ID!): SetOrderShippingMethodResult! - - """ - Add a Payment to the Order - """ - addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult! - - """ - Set the Customer for the Order. Required only if the Customer is not currently logged in - """ - setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult! - - """ - Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` - """ - login( - username: String! - password: String! - rememberMe: Boolean - ): NativeAuthenticationResult! - - """ - Authenticates the user using a named authentication strategy - """ - authenticate( - input: AuthenticationInput! - rememberMe: Boolean - ): AuthenticationResult! - - """ - End the current authenticated session - """ - logout: Success! - - """ - Register a Customer account with the given credentials. There are three possible registration flows: - - _If `authOptions.requireVerification` is set to `true`:_ - - 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That - verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then - verified and authenticated in one step. - 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That - verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosed password of the Customer. The Customer is then - verified and authenticated in one step. - - _If `authOptions.requireVerification` is set to `false`:_ - - 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. - """ - registerCustomerAccount( - input: RegisterCustomerInput! - ): RegisterCustomerAccountResult! - - """ - Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. - """ - refreshCustomerVerification( - emailAddress: String! - ): RefreshCustomerVerificationResult! - - """ - Update an existing Customer - """ - updateCustomer(input: UpdateCustomerInput!): Customer! - - """ - Create a new Customer Address - """ - createCustomerAddress(input: CreateAddressInput!): Address! - - """ - Update an existing Address - """ - updateCustomerAddress(input: UpdateAddressInput!): Address! - - """ - Delete an existing Address - """ - deleteCustomerAddress(id: ID!): Success! - - """ - Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. - - If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be - provided here. - """ - verifyCustomerAccount( - token: String! - password: String - ): VerifyCustomerAccountResult! - - """ - Update the password of the active Customer - """ - updateCustomerPassword( - currentPassword: String! - newPassword: String! - ): UpdateCustomerPasswordResult! - - """ - Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled - (as is the default), then the `identifierChangeToken` will be assigned to the current User and - a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email - that verification token to the Customer, which is then used to verify the change of email address. - """ - requestUpdateCustomerEmailAddress( - password: String! - newEmailAddress: String! - ): RequestUpdateCustomerEmailAddressResult! - - """ - Confirm the update of the emailAddress with the provided token, which has been generated by the - `requestUpdateCustomerEmailAddress` mutation. - """ - updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult! - - """ - Requests a password reset email to be sent - """ - requestPasswordReset(emailAddress: String!): RequestPasswordResetResult - - """ - Resets a Customer's password based on the provided token - """ - resetPassword(token: String!, password: String!): ResetPasswordResult! -} +union AddPaymentToOrderResult = + IneligiblePaymentMethodError + | NoActiveOrderError + | Order + | OrderPaymentStateError + | OrderStateTransitionError + | PaymentDeclinedError + | PaymentFailedError type Address implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - fullName: String + city: String company: String + country: Country! + createdAt: DateTime! + customFields: JSON + defaultBillingAddress: Boolean + defaultShippingAddress: Boolean + fullName: String + id: ID! + phoneNumber: String + postalCode: String + province: String streetLine1: String! streetLine2: String - city: String - province: String - postalCode: String - country: Country! - phoneNumber: String - defaultShippingAddress: Boolean - defaultBillingAddress: Boolean - customFields: JSON + updatedAt: DateTime! } +type Adjustment { + adjustmentSource: String! + amount: Int! + description: String! + type: AdjustmentType! +} + +enum AdjustmentType { + DISTRIBUTED_ORDER_PROMOTION + OTHER + PROMOTION +} + +""" +Returned when attempting to set the Customer for an Order when already logged in. +""" +type AlreadyLoggedInError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +union ApplyCouponCodeResult = + CouponCodeExpiredError + | CouponCodeInvalidError + | CouponCodeLimitError + | Order + type Asset implements Node { - id: ID! createdAt: DateTime! - updatedAt: DateTime! - name: String! - type: AssetType! - fileSize: Int! - mimeType: String! - width: Int! - height: Int! - source: String! - preview: String! - focalPoint: Coordinate customFields: JSON -} - -type Coordinate { - x: Float! - y: Float! + fileSize: Int! + focalPoint: Coordinate + height: Int! + id: ID! + mimeType: String! + name: String! + preview: String! + source: String! + type: AssetType! + updatedAt: DateTime! + width: Int! } type AssetList implements PaginatedList { @@ -308,56 +76,85 @@ type AssetList implements PaginatedList { } enum AssetType { + BINARY IMAGE VIDEO - BINARY } -type CurrentUser { - id: ID! - identifier: String! - channels: [CurrentUserChannel!]! +input AuthenticationInput { + native: NativeAuthInput } -type CurrentUserChannel { +type AuthenticationMethod implements Node { + createdAt: DateTime! id: ID! - token: String! - code: String! - permissions: [Permission!]! + strategy: String! + updatedAt: DateTime! +} + +union AuthenticationResult = + CurrentUser + | InvalidCredentialsError + | NotVerifiedError + +type BooleanCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + list: Boolean! + name: String! + nullable: Boolean + readonly: Boolean + type: String! + ui: JSON +} + +""" +Operators for filtering on a list of Boolean fields +""" +input BooleanListOperators { + inList: Boolean! +} + +""" +Operators for filtering on a Boolean field +""" +input BooleanOperators { + eq: Boolean } type Channel implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! code: String! - token: String! - defaultTaxZone: Zone - defaultShippingZone: Zone - defaultLanguageCode: LanguageCode! + createdAt: DateTime! currencyCode: CurrencyCode! - pricesIncludeTax: Boolean! customFields: JSON + defaultLanguageCode: LanguageCode! + defaultShippingZone: Zone + defaultTaxZone: Zone + id: ID! + pricesIncludeTax: Boolean! + token: String! + updatedAt: DateTime! } type Collection implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode - name: String! - slug: String! + assets: [Asset!]! breadcrumbs: [CollectionBreadcrumb!]! - position: Int! + children: [Collection!] + createdAt: DateTime! + customFields: JSON description: String! featuredAsset: Asset - assets: [Asset!]! - parent: Collection - children: [Collection!] filters: [ConfigurableOperation!]! - translations: [CollectionTranslation!]! + id: ID! + languageCode: LanguageCode + name: String! + parent: Collection + position: Int! productVariants(options: ProductVariantListOptions): ProductVariantList! - customFields: JSON + slug: String! + translations: [CollectionTranslation!]! + updatedAt: DateTime! } type CollectionBreadcrumb { @@ -366,14 +163,15 @@ type CollectionBreadcrumb { slug: String! } -type CollectionTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! - slug: String! - description: String! +input CollectionFilterParameter { + createdAt: DateOperators + description: StringOperators + id: IDOperators + languageCode: StringOperators + name: StringOperators + position: NumberOperators + slug: StringOperators + updatedAt: DateOperators } type CollectionList implements PaginatedList { @@ -381,620 +179,60 @@ type CollectionList implements PaginatedList { totalItems: Int! } -type ProductVariantList implements PaginatedList { - items: [ProductVariant!]! - totalItems: Int! -} +input CollectionListOptions { + """ + Allows the results to be filtered + """ + filter: CollectionFilterParameter -input ProductVariantListOptions { + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: CollectionSortParameter + + """ + Takes n results, for use in pagination + """ take: Int - sort: ProductVariantSortParameter - filter: ProductVariantFilterParameter -} - -enum GlobalFlag { - TRUE - FALSE - INHERIT -} - -enum AdjustmentType { - PROMOTION - DISTRIBUTED_ORDER_PROMOTION -} - -enum DeletionResult { - """ - The entity was successfully deleted - """ - DELETED - - """ - Deletion did not take place, reason given in message - """ - NOT_DELETED } """ -@description -Permissions for administrators and customers. Used to control access to -GraphQL resolvers via the {@link Allow} decorator. - -@docsCategory common +Which Collections are present in the products returned +by the search, and in what quantity. """ -enum Permission { - Placeholder - - """ - Authenticated means simply that the user is logged in - """ - Authenticated - - """ - SuperAdmin has unrestricted access to all operations - """ - SuperAdmin - - """ - Owner means the user owns this entity, e.g. a Customer's own Order - """ - Owner - - """ - Public means any unauthenticated user may perform the operation - """ - Public - - """ - Grants permission to update GlobalSettings - """ - UpdateGlobalSettings - - """ - Grants permission to create Products, Facets, Assets, Collections - """ - CreateCatalog - - """ - Grants permission to read Products, Facets, Assets, Collections - """ - ReadCatalog - - """ - Grants permission to update Products, Facets, Assets, Collections - """ - UpdateCatalog - - """ - Grants permission to delete Products, Facets, Assets, Collections - """ - DeleteCatalog - - """ - Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings - """ - CreateSettings - - """ - Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings - """ - ReadSettings - - """ - Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings - """ - UpdateSettings - - """ - Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings - """ - DeleteSettings - - """ - Grants permission to create Administrator - """ - CreateAdministrator - - """ - Grants permission to read Administrator - """ - ReadAdministrator - - """ - Grants permission to update Administrator - """ - UpdateAdministrator - - """ - Grants permission to delete Administrator - """ - DeleteAdministrator - - """ - Grants permission to create Asset - """ - CreateAsset - - """ - Grants permission to read Asset - """ - ReadAsset - - """ - Grants permission to update Asset - """ - UpdateAsset - - """ - Grants permission to delete Asset - """ - DeleteAsset - - """ - Grants permission to create Channel - """ - CreateChannel - - """ - Grants permission to read Channel - """ - ReadChannel - - """ - Grants permission to update Channel - """ - UpdateChannel - - """ - Grants permission to delete Channel - """ - DeleteChannel - - """ - Grants permission to create Collection - """ - CreateCollection - - """ - Grants permission to read Collection - """ - ReadCollection - - """ - Grants permission to update Collection - """ - UpdateCollection - - """ - Grants permission to delete Collection - """ - DeleteCollection - - """ - Grants permission to create Country - """ - CreateCountry - - """ - Grants permission to read Country - """ - ReadCountry - - """ - Grants permission to update Country - """ - UpdateCountry - - """ - Grants permission to delete Country - """ - DeleteCountry - - """ - Grants permission to create Customer - """ - CreateCustomer - - """ - Grants permission to read Customer - """ - ReadCustomer - - """ - Grants permission to update Customer - """ - UpdateCustomer - - """ - Grants permission to delete Customer - """ - DeleteCustomer - - """ - Grants permission to create CustomerGroup - """ - CreateCustomerGroup - - """ - Grants permission to read CustomerGroup - """ - ReadCustomerGroup - - """ - Grants permission to update CustomerGroup - """ - UpdateCustomerGroup - - """ - Grants permission to delete CustomerGroup - """ - DeleteCustomerGroup - - """ - Grants permission to create Facet - """ - CreateFacet - - """ - Grants permission to read Facet - """ - ReadFacet - - """ - Grants permission to update Facet - """ - UpdateFacet - - """ - Grants permission to delete Facet - """ - DeleteFacet - - """ - Grants permission to create Order - """ - CreateOrder - - """ - Grants permission to read Order - """ - ReadOrder - - """ - Grants permission to update Order - """ - UpdateOrder - - """ - Grants permission to delete Order - """ - DeleteOrder - - """ - Grants permission to create PaymentMethod - """ - CreatePaymentMethod - - """ - Grants permission to read PaymentMethod - """ - ReadPaymentMethod - - """ - Grants permission to update PaymentMethod - """ - UpdatePaymentMethod - - """ - Grants permission to delete PaymentMethod - """ - DeletePaymentMethod - - """ - Grants permission to create Product - """ - CreateProduct - - """ - Grants permission to read Product - """ - ReadProduct - - """ - Grants permission to update Product - """ - UpdateProduct - - """ - Grants permission to delete Product - """ - DeleteProduct - - """ - Grants permission to create Promotion - """ - CreatePromotion - - """ - Grants permission to read Promotion - """ - ReadPromotion - - """ - Grants permission to update Promotion - """ - UpdatePromotion - - """ - Grants permission to delete Promotion - """ - DeletePromotion - - """ - Grants permission to create ShippingMethod - """ - CreateShippingMethod - - """ - Grants permission to read ShippingMethod - """ - ReadShippingMethod - - """ - Grants permission to update ShippingMethod - """ - UpdateShippingMethod - - """ - Grants permission to delete ShippingMethod - """ - DeleteShippingMethod - - """ - Grants permission to create Tag - """ - CreateTag - - """ - Grants permission to read Tag - """ - ReadTag - - """ - Grants permission to update Tag - """ - UpdateTag - - """ - Grants permission to delete Tag - """ - DeleteTag - - """ - Grants permission to create TaxCategory - """ - CreateTaxCategory - - """ - Grants permission to read TaxCategory - """ - ReadTaxCategory - - """ - Grants permission to update TaxCategory - """ - UpdateTaxCategory - - """ - Grants permission to delete TaxCategory - """ - DeleteTaxCategory - - """ - Grants permission to create TaxRate - """ - CreateTaxRate - - """ - Grants permission to read TaxRate - """ - ReadTaxRate - - """ - Grants permission to update TaxRate - """ - UpdateTaxRate - - """ - Grants permission to delete TaxRate - """ - DeleteTaxRate - - """ - Grants permission to create System - """ - CreateSystem - - """ - Grants permission to read System - """ - ReadSystem - - """ - Grants permission to update System - """ - UpdateSystem - - """ - Grants permission to delete System - """ - DeleteSystem - - """ - Grants permission to create Zone - """ - CreateZone - - """ - Grants permission to read Zone - """ - ReadZone - - """ - Grants permission to update Zone - """ - UpdateZone - - """ - Grants permission to delete Zone - """ - DeleteZone +type CollectionResult { + collection: Collection! + count: Int! } -enum SortOrder { - ASC - DESC +input CollectionSortParameter { + createdAt: SortOrder + description: SortOrder + id: SortOrder + name: SortOrder + position: SortOrder + slug: SortOrder + updatedAt: SortOrder } -enum ErrorCode { - UNKNOWN_ERROR - NATIVE_AUTH_STRATEGY_ERROR - INVALID_CREDENTIALS_ERROR - ORDER_STATE_TRANSITION_ERROR - EMAIL_ADDRESS_CONFLICT_ERROR - ORDER_LIMIT_ERROR - NEGATIVE_QUANTITY_ERROR - INSUFFICIENT_STOCK_ERROR - ORDER_MODIFICATION_ERROR - INELIGIBLE_SHIPPING_METHOD_ERROR - ORDER_PAYMENT_STATE_ERROR - INELIGIBLE_PAYMENT_METHOD_ERROR - PAYMENT_FAILED_ERROR - PAYMENT_DECLINED_ERROR - COUPON_CODE_INVALID_ERROR - COUPON_CODE_EXPIRED_ERROR - COUPON_CODE_LIMIT_ERROR - ALREADY_LOGGED_IN_ERROR - MISSING_PASSWORD_ERROR - PASSWORD_ALREADY_SET_ERROR - VERIFICATION_TOKEN_INVALID_ERROR - VERIFICATION_TOKEN_EXPIRED_ERROR - IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR - IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR - PASSWORD_RESET_TOKEN_INVALID_ERROR - PASSWORD_RESET_TOKEN_EXPIRED_ERROR - NOT_VERIFIED_ERROR - NO_ACTIVE_ORDER_ERROR -} - -enum LogicalOperator { - AND - OR -} - -""" -Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. -""" -type NativeAuthStrategyError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned if the user authentication credentials are not valid -""" -type InvalidCredentialsError implements ErrorResult { - errorCode: ErrorCode! - message: String! - authenticationError: String! -} - -""" -Returned if there is an error in transitioning the Order state -""" -type OrderStateTransitionError implements ErrorResult { - errorCode: ErrorCode! - message: String! - transitionError: String! - fromState: String! - toState: String! -} - -""" -Retured when attemting to create a Customer with an email address already registered to an existing User. -""" -type EmailAddressConflictError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured when the maximum order size limit has been reached. -""" -type OrderLimitError implements ErrorResult { - errorCode: ErrorCode! - message: String! - maxItems: Int! -} - -""" -Retured when attemting to set a negative OrderLine quantity. -""" -type NegativeQuantityError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned when attempting to add more items to the Order than are available -""" -type InsufficientStockError implements ErrorResult { - errorCode: ErrorCode! - message: String! - quantityAvailable: Int! - order: Order! -} - -""" -The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). -""" -scalar JSON - -""" -A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. -""" -scalar DateTime - -""" -The `Upload` scalar type represents a file upload. -""" -scalar Upload - -interface PaginatedList { - items: [Node!]! - totalItems: Int! -} - -interface Node { +type CollectionTranslation { + createdAt: DateTime! + description: String! id: ID! -} - -interface ErrorResult { - errorCode: ErrorCode! - message: String! -} - -type Adjustment { - adjustmentSource: String! - type: AdjustmentType! - description: String! - amount: Int! -} - -type TaxLine { - description: String! - taxRate: Float! + languageCode: LanguageCode! + name: String! + slug: String! + updatedAt: DateTime! } type ConfigArg { @@ -1003,32 +241,16 @@ type ConfigArg { } type ConfigArgDefinition { - name: String! - type: String! - list: Boolean! - required: Boolean! defaultValue: JSON - label: String description: String + label: String + list: Boolean! + name: String! + required: Boolean! + type: String! ui: JSON } -type ConfigurableOperation { - code: String! - args: [ConfigArg!]! -} - -type ConfigurableOperationDefinition { - code: String! - args: [ConfigArgDefinition!]! - description: String! -} - -type DeletionResponse { - result: DeletionResult! - message: String -} - input ConfigArgInput { name: String! @@ -1038,169 +260,37 @@ input ConfigArgInput { value: String! } +type ConfigurableOperation { + args: [ConfigArg!]! + code: String! +} + +type ConfigurableOperationDefinition { + args: [ConfigArgDefinition!]! + code: String! + description: String! +} + input ConfigurableOperationInput { - code: String! arguments: [ConfigArgInput!]! -} - -input StringOperators { - eq: String - notEq: String - contains: String - notContains: String - in: [String!] - notIn: [String!] - regex: String -} - -input BooleanOperators { - eq: Boolean -} - -input NumberRange { - start: Float! - end: Float! -} - -input NumberOperators { - eq: Float - lt: Float - lte: Float - gt: Float - gte: Float - between: NumberRange -} - -input DateRange { - start: DateTime! - end: DateTime! -} - -input DateOperators { - eq: DateTime - before: DateTime - after: DateTime - between: DateRange -} - -""" -Used to construct boolean expressions for filtering search results -by FacetValue ID. Examples: - -* ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` -* ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` -* ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` -""" -input FacetValueFilterInput { - and: ID - or: [ID!] -} - -input SearchInput { - term: String - facetValueIds: [ID!] - facetValueOperator: LogicalOperator - facetValueFilters: [FacetValueFilterInput!] - collectionId: ID - collectionSlug: String - groupByProduct: Boolean - take: Int - skip: Int - sort: SearchResultSortParameter -} - -input SearchResultSortParameter { - name: SortOrder - price: SortOrder -} - -input CreateCustomerInput { - title: String - firstName: String! - lastName: String! - phoneNumber: String - emailAddress: String! - customFields: JSON -} - -input CreateAddressInput { - fullName: String - company: String - streetLine1: String! - streetLine2: String - city: String - province: String - postalCode: String - countryCode: String! - phoneNumber: String - defaultShippingAddress: Boolean - defaultBillingAddress: Boolean - customFields: JSON -} - -input UpdateAddressInput { - id: ID! - fullName: String - company: String - streetLine1: String - streetLine2: String - city: String - province: String - postalCode: String - countryCode: String - phoneNumber: String - defaultShippingAddress: Boolean - defaultBillingAddress: Boolean - customFields: JSON -} - -""" -Indicates that an operation succeeded, where we do not want to return any more specific information. -""" -type Success { - success: Boolean! -} - -type ShippingMethodQuote { - id: ID! - price: Int! - priceWithTax: Int! code: String! - name: String! - description: String! - - """ - Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult - """ - metadata: JSON } -type PaymentMethodQuote { - id: ID! - code: String! - name: String! - description: String! - isEligible: Boolean! - eligibilityMessage: String +type Coordinate { + x: Float! + y: Float! } type Country implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! code: String! - name: String! - enabled: Boolean! - translations: [CountryTranslation!]! -} - -type CountryTranslation { - id: ID! createdAt: DateTime! - updatedAt: DateTime! + customFields: JSON + enabled: Boolean! + id: ID! languageCode: LanguageCode! name: String! + translations: [CountryTranslation!]! + updatedAt: DateTime! } type CountryList implements PaginatedList { @@ -1208,6 +298,66 @@ type CountryList implements PaginatedList { totalItems: Int! } +type CountryTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeExpiredError implements ErrorResult { + couponCode: String! + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeInvalidError implements ErrorResult { + couponCode: String! + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the provided coupon code is invalid +""" +type CouponCodeLimitError implements ErrorResult { + couponCode: String! + errorCode: ErrorCode! + limit: Int! + message: String! +} + +input CreateAddressInput { + city: String + company: String + countryCode: String! + customFields: JSON + defaultBillingAddress: Boolean + defaultShippingAddress: Boolean + fullName: String + phoneNumber: String + postalCode: String + province: String + streetLine1: String! + streetLine2: String +} + +input CreateCustomerInput { + customFields: JSON + emailAddress: String! + firstName: String! + lastName: String! + phoneNumber: String + title: String +} + """ @description ISO 4217 currency code @@ -2001,153 +1151,74 @@ enum CurrencyCode { ZWL } +type CurrentUser { + channels: [CurrentUserChannel!]! + id: ID! + identifier: String! +} + +type CurrentUserChannel { + code: String! + id: ID! + permissions: [Permission!]! + token: String! +} + interface CustomField { - name: String! - type: String! - list: Boolean! - label: [LocalizedString!] description: [LocalizedString!] - readonly: Boolean internal: Boolean -} - -type StringCustomFieldConfig implements CustomField { - name: String! - type: String! + label: [LocalizedString!] list: Boolean! - length: Int - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean - pattern: String - options: [StringFieldOption!] -} - -type StringFieldOption { - value: String! - label: [LocalizedString!] -} - -type LocaleStringCustomFieldConfig implements CustomField { name: String! - type: String! - list: Boolean! - length: Int - label: [LocalizedString!] - description: [LocalizedString!] + nullable: Boolean readonly: Boolean - internal: Boolean - pattern: String -} - -type IntCustomFieldConfig implements CustomField { - name: String! type: String! - list: Boolean! - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean - min: Int - max: Int - step: Int -} - -type FloatCustomFieldConfig implements CustomField { - name: String! - type: String! - list: Boolean! - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean - min: Float - max: Float - step: Float -} - -type BooleanCustomFieldConfig implements CustomField { - name: String! - type: String! - list: Boolean! - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean -} - -""" -Expects the same validation formats as the `` HTML element. -See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes -""" -type DateTimeCustomFieldConfig implements CustomField { - name: String! - type: String! - list: Boolean! - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean - min: String - max: String - step: Int -} - -type RelationCustomFieldConfig implements CustomField { - name: String! - type: String! - list: Boolean! - label: [LocalizedString!] - description: [LocalizedString!] - readonly: Boolean - internal: Boolean - entity: String! - scalarFields: [String!]! -} - -type LocalizedString { - languageCode: LanguageCode! - value: String! + ui: JSON } union CustomFieldConfig = - StringCustomFieldConfig - | LocaleStringCustomFieldConfig - | IntCustomFieldConfig - | FloatCustomFieldConfig - | BooleanCustomFieldConfig + BooleanCustomFieldConfig | DateTimeCustomFieldConfig + | FloatCustomFieldConfig + | IntCustomFieldConfig + | LocaleStringCustomFieldConfig | RelationCustomFieldConfig - -type CustomerGroup implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - name: String! - customers(options: CustomerListOptions): CustomerList! -} - -input CustomerListOptions { - skip: Int - take: Int - sort: CustomerSortParameter - filter: CustomerFilterParameter -} + | StringCustomFieldConfig + | TextCustomFieldConfig type Customer implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - title: String - firstName: String! - lastName: String! - phoneNumber: String - emailAddress: String! addresses: [Address!] - orders(options: OrderListOptions): OrderList! - user: User + createdAt: DateTime! customFields: JSON + emailAddress: String! + firstName: String! + id: ID! + lastName: String! + orders(options: OrderListOptions): OrderList! + phoneNumber: String + title: String + updatedAt: DateTime! + user: User +} + +input CustomerFilterParameter { + createdAt: DateOperators + emailAddress: StringOperators + firstName: StringOperators + id: IDOperators + lastName: StringOperators + phoneNumber: StringOperators + title: StringOperators + updatedAt: DateOperators +} + +type CustomerGroup implements Node { + createdAt: DateTime! + customFields: JSON + customers(options: CustomerListOptions): CustomerList! + id: ID! + name: String! + updatedAt: DateTime! } type CustomerList implements PaginatedList { @@ -2155,44 +1226,179 @@ type CustomerList implements PaginatedList { totalItems: Int! } -type FacetValue implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - facet: Facet! - name: String! - code: String! - translations: [FacetValueTranslation!]! - customFields: JSON +input CustomerListOptions { + """ + Allows the results to be filtered + """ + filter: CustomerFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: CustomerSortParameter + + """ + Takes n results, for use in pagination + """ + take: Int } -type FacetValueTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! +input CustomerSortParameter { + createdAt: SortOrder + emailAddress: SortOrder + firstName: SortOrder + id: SortOrder + lastName: SortOrder + phoneNumber: SortOrder + title: SortOrder + updatedAt: SortOrder +} + +""" +Operators for filtering on a list of Date fields +""" +input DateListOperators { + inList: DateTime! +} + +""" +Operators for filtering on a DateTime field +""" +input DateOperators { + after: DateTime + before: DateTime + between: DateRange + eq: DateTime +} + +input DateRange { + end: DateTime! + start: DateTime! +} + +""" +A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar. +""" +scalar DateTime + +""" +Expects the same validation formats as the `` HTML element. +See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes +""" +type DateTimeCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + list: Boolean! + max: String + min: String name: String! + nullable: Boolean + readonly: Boolean + step: Int + type: String! + ui: JSON +} + +type DeletionResponse { + message: String + result: DeletionResult! +} + +enum DeletionResult { + """ + The entity was successfully deleted + """ + DELETED + + """ + Deletion did not take place, reason given in message + """ + NOT_DELETED +} + +type Discount { + adjustmentSource: String! + amount: Int! + amountWithTax: Int! + description: String! + type: AdjustmentType! +} + +""" +Returned when attempting to create a Customer with an email address already registered to an existing User. +""" +type EmailAddressConflictError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +enum ErrorCode { + ALREADY_LOGGED_IN_ERROR + COUPON_CODE_EXPIRED_ERROR + COUPON_CODE_INVALID_ERROR + COUPON_CODE_LIMIT_ERROR + EMAIL_ADDRESS_CONFLICT_ERROR + IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR + IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR + INELIGIBLE_PAYMENT_METHOD_ERROR + INELIGIBLE_SHIPPING_METHOD_ERROR + INSUFFICIENT_STOCK_ERROR + INVALID_CREDENTIALS_ERROR + MISSING_PASSWORD_ERROR + NATIVE_AUTH_STRATEGY_ERROR + NEGATIVE_QUANTITY_ERROR + NOT_VERIFIED_ERROR + NO_ACTIVE_ORDER_ERROR + ORDER_LIMIT_ERROR + ORDER_MODIFICATION_ERROR + ORDER_PAYMENT_STATE_ERROR + ORDER_STATE_TRANSITION_ERROR + PASSWORD_ALREADY_SET_ERROR + PASSWORD_RESET_TOKEN_EXPIRED_ERROR + PASSWORD_RESET_TOKEN_INVALID_ERROR + PASSWORD_VALIDATION_ERROR + PAYMENT_DECLINED_ERROR + PAYMENT_FAILED_ERROR + UNKNOWN_ERROR + VERIFICATION_TOKEN_EXPIRED_ERROR + VERIFICATION_TOKEN_INVALID_ERROR +} + +interface ErrorResult { + errorCode: ErrorCode! + message: String! } type Facet implements Node { - id: ID! + code: String! createdAt: DateTime! - updatedAt: DateTime! + customFields: JSON + id: ID! languageCode: LanguageCode! name: String! - code: String! - values: [FacetValue!]! translations: [FacetTranslation!]! - customFields: JSON + updatedAt: DateTime! + values: [FacetValue!]! } -type FacetTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! +input FacetFilterParameter { + code: StringOperators + createdAt: DateOperators + id: IDOperators + languageCode: StringOperators + name: StringOperators + updatedAt: DateOperators } type FacetList implements PaginatedList { @@ -2200,39 +1406,136 @@ type FacetList implements PaginatedList { totalItems: Int! } -type HistoryEntry implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - type: HistoryEntryType! - data: JSON! +input FacetListOptions { + """ + Allows the results to be filtered + """ + filter: FacetFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: FacetSortParameter + + """ + Takes n results, for use in pagination + """ + take: Int } -enum HistoryEntryType { - CUSTOMER_REGISTERED - CUSTOMER_VERIFIED - CUSTOMER_DETAIL_UPDATED - CUSTOMER_ADDED_TO_GROUP - CUSTOMER_REMOVED_FROM_GROUP - CUSTOMER_ADDRESS_CREATED - CUSTOMER_ADDRESS_UPDATED - CUSTOMER_ADDRESS_DELETED - CUSTOMER_PASSWORD_UPDATED - CUSTOMER_PASSWORD_RESET_REQUESTED - CUSTOMER_PASSWORD_RESET_VERIFIED - CUSTOMER_EMAIL_UPDATE_REQUESTED - CUSTOMER_EMAIL_UPDATE_VERIFIED - CUSTOMER_NOTE - ORDER_STATE_TRANSITION - ORDER_PAYMENT_TRANSITION - ORDER_FULFILLMENT - ORDER_CANCELLATION - ORDER_REFUND_TRANSITION - ORDER_FULFILLMENT_TRANSITION - ORDER_NOTE - ORDER_COUPON_APPLIED - ORDER_COUPON_REMOVED - ORDER_MODIFIED +input FacetSortParameter { + code: SortOrder + createdAt: SortOrder + id: SortOrder + name: SortOrder + updatedAt: SortOrder +} + +type FacetTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! +} + +type FacetValue implements Node { + code: String! + createdAt: DateTime! + customFields: JSON + facet: Facet! + id: ID! + languageCode: LanguageCode! + name: String! + translations: [FacetValueTranslation!]! + updatedAt: DateTime! +} + +""" +Used to construct boolean expressions for filtering search results +by FacetValue ID. Examples: + +* ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }` +* ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }` +* ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }` +""" +input FacetValueFilterInput { + and: ID + or: [ID!] +} + +""" +Which FacetValues are present in the products returned +by the search, and in what quantity. +""" +type FacetValueResult { + count: Int! + facetValue: FacetValue! +} + +type FacetValueTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! +} + +type FloatCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + list: Boolean! + max: Float + min: Float + name: String! + nullable: Boolean + readonly: Boolean + step: Float + type: String! + ui: JSON +} + +type Fulfillment implements Node { + createdAt: DateTime! + customFields: JSON + id: ID! + method: String! + orderItems: [OrderItem!]! + state: String! + trackingCode: String + updatedAt: DateTime! +} + +enum GlobalFlag { + FALSE + INHERIT + TRUE +} + +type HistoryEntry implements Node { + createdAt: DateTime! + data: JSON! + id: ID! + type: HistoryEntryType! + updatedAt: DateTime! +} + +input HistoryEntryFilterParameter { + createdAt: DateOperators + id: IDOperators + type: StringOperators + updatedAt: DateOperators } type HistoryEntryList implements PaginatedList { @@ -2241,12 +1544,156 @@ type HistoryEntryList implements PaginatedList { } input HistoryEntryListOptions { - skip: Int - take: Int - sort: HistoryEntrySortParameter + """ + Allows the results to be filtered + """ filter: HistoryEntryFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: HistoryEntrySortParameter + + """ + Takes n results, for use in pagination + """ + take: Int } +input HistoryEntrySortParameter { + createdAt: SortOrder + id: SortOrder + updatedAt: SortOrder +} + +enum HistoryEntryType { + CUSTOMER_ADDED_TO_GROUP + CUSTOMER_ADDRESS_CREATED + CUSTOMER_ADDRESS_DELETED + CUSTOMER_ADDRESS_UPDATED + CUSTOMER_DETAIL_UPDATED + CUSTOMER_EMAIL_UPDATE_REQUESTED + CUSTOMER_EMAIL_UPDATE_VERIFIED + CUSTOMER_NOTE + CUSTOMER_PASSWORD_RESET_REQUESTED + CUSTOMER_PASSWORD_RESET_VERIFIED + CUSTOMER_PASSWORD_UPDATED + CUSTOMER_REGISTERED + CUSTOMER_REMOVED_FROM_GROUP + CUSTOMER_VERIFIED + ORDER_CANCELLATION + ORDER_COUPON_APPLIED + ORDER_COUPON_REMOVED + ORDER_FULFILLMENT + ORDER_FULFILLMENT_TRANSITION + ORDER_MODIFIED + ORDER_NOTE + ORDER_PAYMENT_TRANSITION + ORDER_REFUND_TRANSITION + ORDER_STATE_TRANSITION +} + +""" +Operators for filtering on a list of ID fields +""" +input IDListOperators { + inList: ID! +} + +""" +Operators for filtering on an ID field +""" +input IDOperators { + eq: String + in: [String!] + notEq: String + notIn: [String!] +} + +""" +Returned if the token used to change a Customer's email address is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type IdentifierChangeTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the token used to change a Customer's email address is either +invalid or does not match any expected tokens. +""" +type IdentifierChangeTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. +""" +type IneligiblePaymentMethodError implements ErrorResult { + eligibilityCheckerMessage: String + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to set a ShippingMethod for which the Order is not eligible +""" +type IneligibleShippingMethodError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add more items to the Order than are available +""" +type InsufficientStockError implements ErrorResult { + errorCode: ErrorCode! + message: String! + order: Order! + quantityAvailable: Int! +} + +type IntCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + list: Boolean! + max: Int + min: Int + name: String! + nullable: Boolean + readonly: Boolean + step: Int + type: String! + ui: JSON +} + +""" +Returned if the user authentication credentials are not valid +""" +type InvalidCredentialsError implements ErrorResult { + authenticationError: String! + errorCode: ErrorCode! + message: String! +} + +""" +The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf). +""" +scalar JSON + """ @description Languages in the form of a ISO 639-1 language code with optional @@ -2267,11 +1714,6 @@ enum LanguageCode { """ ak - """ - Albanian - """ - sq - """ Amharic """ @@ -2282,11 +1724,6 @@ enum LanguageCode { """ ar - """ - Armenian - """ - hy - """ Assamese """ @@ -2297,6 +1734,16 @@ enum LanguageCode { """ az + """ + Belarusian + """ + be + + """ + Bulgarian + """ + bg + """ Bambara """ @@ -2308,19 +1755,9 @@ enum LanguageCode { bn """ - Basque + Tibetan """ - eu - - """ - Belarusian - """ - be - - """ - Bosnian - """ - bs + bo """ Breton @@ -2328,14 +1765,9 @@ enum LanguageCode { br """ - Bulgarian + Bosnian """ - bg - - """ - Burmese - """ - my + bs """ Catalan @@ -2347,66 +1779,61 @@ enum LanguageCode { """ ce - """ - Chinese - """ - zh - - """ - Simplified Chinese - """ - zh_Hans - - """ - Traditional Chinese - """ - zh_Hant - - """ - Church Slavic - """ - cu - - """ - Cornish - """ - kw - """ Corsican """ co - """ - Croatian - """ - hr - """ Czech """ cs + """ + Church Slavic + """ + cu + + """ + Welsh + """ + cy + """ Danish """ da """ - Dutch + German """ - nl + de """ - Flemish + Austrian German """ - nl_BE + de_AT + + """ + Swiss High German + """ + de_CH """ Dzongkha """ dz + """ + Ewe + """ + ee + + """ + Greek + """ + el + """ English """ @@ -2437,26 +1864,56 @@ enum LanguageCode { """ eo + """ + Spanish + """ + es + + """ + European Spanish + """ + es_ES + + """ + Mexican Spanish + """ + es_MX + """ Estonian """ et """ - Ewe + Basque """ - ee + eu """ - Faroese + Persian """ - fo + fa + + """ + Dari + """ + fa_AF + + """ + Fulah + """ + ff """ Finnish """ fi + """ + Faroese + """ + fo + """ French """ @@ -2473,54 +1930,34 @@ enum LanguageCode { fr_CH """ - Fulah + Western Frisian """ - ff + fy + + """ + Irish + """ + ga + + """ + Scottish Gaelic + """ + gd """ Galician """ gl - """ - Ganda - """ - lg - - """ - Georgian - """ - ka - - """ - German - """ - de - - """ - Austrian German - """ - de_AT - - """ - Swiss High German - """ - de_CH - - """ - Greek - """ - el - """ Gujarati """ gu """ - Haitian Creole + Manx """ - ht + gv """ Hausa @@ -2537,25 +1974,25 @@ enum LanguageCode { """ hi + """ + Croatian + """ + hr + + """ + Haitian Creole + """ + ht + """ Hungarian """ hu """ - Icelandic + Armenian """ - is - - """ - Igbo - """ - ig - - """ - Indonesian - """ - id + hy """ Interlingua @@ -2563,9 +2000,24 @@ enum LanguageCode { ia """ - Irish + Indonesian """ - ga + id + + """ + Igbo + """ + ig + + """ + Sichuan Yi + """ + ii + + """ + Icelandic + """ + is """ Italian @@ -2583,29 +2035,9 @@ enum LanguageCode { jv """ - Kalaallisut + Georgian """ - kl - - """ - Kannada - """ - kn - - """ - Kashmiri - """ - ks - - """ - Kazakh - """ - kk - - """ - Khmer - """ - km + ka """ Kikuyu @@ -2613,45 +2045,75 @@ enum LanguageCode { ki """ - Kinyarwanda + Kazakh """ - rw + kk + + """ + Kalaallisut + """ + kl + + """ + Khmer + """ + km + + """ + Kannada + """ + kn """ Korean """ ko + """ + Kashmiri + """ + ks + """ Kurdish """ ku + """ + Cornish + """ + kw + """ Kyrgyz """ ky - """ - Lao - """ - lo - """ Latin """ la """ - Latvian + Luxembourgish """ - lv + lb + + """ + Ganda + """ + lg """ Lingala """ ln + """ + Lao + """ + lo + """ Lithuanian """ @@ -2663,14 +2125,9 @@ enum LanguageCode { lu """ - Luxembourgish + Latvian """ - lb - - """ - Macedonian - """ - mk + lv """ Malagasy @@ -2678,9 +2135,14 @@ enum LanguageCode { mg """ - Malay + Maori """ - ms + mi + + """ + Macedonian + """ + mk """ Malayalam @@ -2688,19 +2150,9 @@ enum LanguageCode { ml """ - Maltese + Mongolian """ - mt - - """ - Manx - """ - gv - - """ - Maori - """ - mi + mn """ Marathi @@ -2708,14 +2160,24 @@ enum LanguageCode { mr """ - Mongolian + Malay """ - mn + ms """ - Nepali + Maltese """ - ne + mt + + """ + Burmese + """ + my + + """ + Norwegian Bokmål + """ + nb """ North Ndebele @@ -2723,14 +2185,19 @@ enum LanguageCode { nd """ - Northern Sami + Nepali """ - se + ne """ - Norwegian Bokmål + Dutch """ - nb + nl + + """ + Flemish + """ + nl_BE """ Norwegian Nynorsk @@ -2742,41 +2209,36 @@ enum LanguageCode { """ ny - """ - Odia - """ - or - """ Oromo """ om + """ + Odia + """ + or + """ Ossetic """ os """ - Pashto + Punjabi """ - ps - - """ - Persian - """ - fa - - """ - Dari - """ - fa_AF + pa """ Polish """ pl + """ + Pashto + """ + ps + """ Portuguese """ @@ -2792,26 +2254,11 @@ enum LanguageCode { """ pt_PT - """ - Punjabi - """ - pa - """ Quechua """ qu - """ - Romanian - """ - ro - - """ - Moldavian - """ - ro_MD - """ Romansh """ @@ -2822,51 +2269,46 @@ enum LanguageCode { """ rn + """ + Romanian + """ + ro + + """ + Moldavian + """ + ro_MD + """ Russian """ ru """ - Samoan + Kinyarwanda """ - sm - - """ - Sango - """ - sg + rw """ Sanskrit """ sa - """ - Scottish Gaelic - """ - gd - - """ - Serbian - """ - sr - - """ - Shona - """ - sn - - """ - Sichuan Yi - """ - ii - """ Sindhi """ sd + """ + Northern Sami + """ + se + + """ + Sango + """ + sg + """ Sinhala """ @@ -2882,36 +2324,46 @@ enum LanguageCode { """ sl + """ + Samoan + """ + sm + + """ + Shona + """ + sn + """ Somali """ so + """ + Albanian + """ + sq + + """ + Serbian + """ + sr + """ Southern Sotho """ st - """ - Spanish - """ - es - - """ - European Spanish - """ - es_ES - - """ - Mexican Spanish - """ - es_MX - """ Sundanese """ su + """ + Swedish + """ + sv + """ Swahili """ @@ -2922,46 +2374,36 @@ enum LanguageCode { """ sw_CD - """ - Swedish - """ - sv - - """ - Tajik - """ - tg - """ Tamil """ ta - """ - Tatar - """ - tt - """ Telugu """ te + """ + Tajik + """ + tg + """ Thai """ th - """ - Tibetan - """ - bo - """ Tigrinya """ ti + """ + Turkmen + """ + tk + """ Tongan """ @@ -2973,9 +2415,14 @@ enum LanguageCode { tr """ - Turkmen + Tatar """ - tk + tt + + """ + Uyghur + """ + ug """ Ukrainian @@ -2987,11 +2434,6 @@ enum LanguageCode { """ ur - """ - Uyghur - """ - ug - """ Uzbek """ @@ -3007,16 +2449,6 @@ enum LanguageCode { """ vo - """ - Welsh - """ - cy - - """ - Western Frisian - """ - fy - """ Wolof """ @@ -3037,824 +2469,264 @@ enum LanguageCode { """ yo + """ + Chinese + """ + zh + + """ + Simplified Chinese + """ + zh_Hans + + """ + Traditional Chinese + """ + zh_Hant + """ Zulu """ zu } -type Order implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - - """ - The date & time that the Order was placed, i.e. the Customer - completed the checkout and the Order is no longer "active" - """ - orderPlacedAt: DateTime - - """ - A unique code for the Order - """ - code: String! - state: String! - - """ - An order is active as long as the payment process has not been completed - """ - active: Boolean! - customer: Customer - shippingAddress: OrderAddress - billingAddress: OrderAddress - lines: [OrderLine!]! - - """ - Surcharges are arbitrary modifications to the Order total which are neither - ProductVariants nor discounts resulting from applied Promotions. For example, - one-off discounts based on customer interaction, or surcharges based on payment - methods. - """ - surcharges: [Surcharge!]! - discounts: [Discount!]! - - """ - An array of all coupon codes applied to the Order - """ - couponCodes: [String!]! - - """ - Promotions applied to the order. Only gets populated after the payment process has completed. - """ - promotions: [Promotion!]! - payments: [Payment!] - fulfillments: [Fulfillment!] - totalQuantity: Int! - - """ - The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level - discounts which have been prorated (proportionally distributed) amongst the OrderItems. - To get a total of all OrderLines which does not account for prorated discounts, use the - sum of `OrderLine.discountedLinePrice` values. - """ - subTotal: Int! - - """ - Same as subTotal, but inclusive of tax - """ - subTotalWithTax: Int! - currencyCode: CurrencyCode! - shippingLines: [ShippingLine!]! - shipping: Int! - shippingWithTax: Int! - - """ - Equal to subTotal plus shipping - """ - total: Int! - - """ - The final payable amount. Equal to subTotalWithTax plus shippingWithTax - """ - totalWithTax: Int! - - """ - A summary of the taxes being applied to this Order - """ - taxSummary: [OrderTaxSummary!]! - history(options: HistoryEntryListOptions): HistoryEntryList! - customFields: JSON +type LocaleStringCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + length: Int + list: Boolean! + name: String! + nullable: Boolean + pattern: String + readonly: Boolean + type: String! + ui: JSON } -""" -A summary of the taxes being applied to this order, grouped -by taxRate. -""" -type OrderTaxSummary { - """ - A description of this tax - """ - description: String! - - """ - The taxRate as a percentage - """ - taxRate: Float! - - """ - The total net price or OrderItems to which this taxRate applies - """ - taxBase: Int! - - """ - The total tax being applied to the Order at this taxRate - """ - taxTotal: Int! -} - -type OrderAddress { - fullName: String - company: String - streetLine1: String - streetLine2: String - city: String - province: String - postalCode: String - country: String - countryCode: String - phoneNumber: String - customFields: JSON -} - -type OrderList implements PaginatedList { - items: [Order!]! - totalItems: Int! -} - -type ShippingLine { - shippingMethod: ShippingMethod! - price: Int! - priceWithTax: Int! - discountedPrice: Int! - discountedPriceWithTax: Int! - discounts: [Discount!]! -} - -type Discount { - adjustmentSource: String! - type: AdjustmentType! - description: String! - amount: Int! - amountWithTax: Int! -} - -type OrderItem implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - cancelled: Boolean! - - """ - The price of a single unit, excluding tax and discounts - """ - unitPrice: Int! - - """ - The price of a single unit, including tax but excluding discounts - """ - unitPriceWithTax: Int! - - """ - The price of a single unit including discounts, excluding tax. - - If Order-level discounts have been applied, this will not be the - actual taxable unit price (see `proratedUnitPrice`), but is generally the - correct price to display to customers to avoid confusion - about the internal handling of distributed Order-level discounts. - """ - discountedUnitPrice: Int! - - """ - The price of a single unit including discounts and tax - """ - discountedUnitPriceWithTax: Int! - - """ - The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) - Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax - and refund calculations. - """ - proratedUnitPrice: Int! - - """ - The proratedUnitPrice including tax - """ - proratedUnitPriceWithTax: Int! - unitTax: Int! - taxRate: Float! - adjustments: [Adjustment!]! - taxLines: [TaxLine!]! - fulfillment: Fulfillment - refundId: ID -} - -type OrderLine implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - productVariant: ProductVariant! - featuredAsset: Asset - - """ - The price of a single unit, excluding tax and discounts - """ - unitPrice: Int! - - """ - The price of a single unit, including tax but excluding discounts - """ - unitPriceWithTax: Int! - - """ - Non-zero if the unitPrice has changed since it was initially added to Order - """ - unitPriceChangeSinceAdded: Int! - - """ - Non-zero if the unitPriceWithTax has changed since it was initially added to Order - """ - unitPriceWithTaxChangeSinceAdded: Int! - - """ - The price of a single unit including discounts, excluding tax. - - If Order-level discounts have been applied, this will not be the - actual taxable unit price (see `proratedUnitPrice`), but is generally the - correct price to display to customers to avoid confusion - about the internal handling of distributed Order-level discounts. - """ - discountedUnitPrice: Int! - - """ - The price of a single unit including discounts and tax - """ - discountedUnitPriceWithTax: Int! - - """ - The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed) - Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax - and refund calculations. - """ - proratedUnitPrice: Int! - - """ - The proratedUnitPrice including tax - """ - proratedUnitPriceWithTax: Int! - quantity: Int! - items: [OrderItem!]! - taxRate: Float! - - """ - The total price of the line excluding tax and discounts. - """ - linePrice: Int! - - """ - The total price of the line including tax bit excluding discounts. - """ - linePriceWithTax: Int! - - """ - The price of the line including discounts, excluding tax - """ - discountedLinePrice: Int! - - """ - The price of the line including discounts and tax - """ - discountedLinePriceWithTax: Int! - - """ - The actual line price, taking into account both item discounts _and_ prorated (proportially-distributed) - Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax - and refund calculations. - """ - proratedLinePrice: Int! - - """ - The proratedLinePrice including tax - """ - proratedLinePriceWithTax: Int! - - """ - The total tax on this line - """ - lineTax: Int! - discounts: [Discount!]! - taxLines: [TaxLine!]! - order: Order! - customFields: JSON -} - -type Payment implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - method: String! - amount: Int! - state: String! - transactionId: String - errorMessage: String - refunds: [Refund!]! - metadata: JSON -} - -type Refund implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - items: Int! - shipping: Int! - adjustment: Int! - total: Int! - method: String - state: String! - transactionId: String - reason: String - orderItems: [OrderItem!]! - paymentId: ID! - metadata: JSON -} - -type Fulfillment implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - orderItems: [OrderItem!]! - state: String! - method: String! - trackingCode: String - customFields: JSON -} - -type Surcharge implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - description: String! - sku: String - taxLines: [TaxLine!]! - price: Int! - priceWithTax: Int! - taxRate: Float! -} - -type ProductOptionGroup implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! +type LocalizedString { languageCode: LanguageCode! - code: String! - name: String! - options: [ProductOption!]! - translations: [ProductOptionGroupTranslation!]! - customFields: JSON -} - -type ProductOptionGroupTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! -} - -type ProductOption implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - code: String! - name: String! - groupId: ID! - group: ProductOptionGroup! - translations: [ProductOptionTranslation!]! - customFields: JSON -} - -type ProductOptionTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! -} - -type SearchReindexResponse { - success: Boolean! -} - -type SearchResponse { - items: [SearchResult!]! - totalItems: Int! - facetValues: [FacetValueResult!]! -} - -""" -Which FacetValues are present in the products returned -by the search, and in what quantity. -""" -type FacetValueResult { - facetValue: FacetValue! - count: Int! -} - -type SearchResultAsset { - id: ID! - preview: String! - focalPoint: Coordinate -} - -type SearchResult { - sku: String! - slug: String! - productId: ID! - productName: String! - productAsset: SearchResultAsset - productVariantId: ID! - productVariantName: String! - productVariantAsset: SearchResultAsset - price: SearchResultPrice! - priceWithTax: SearchResultPrice! - currencyCode: CurrencyCode! - description: String! - facetIds: [ID!]! - facetValueIds: [ID!]! - - """ - An array of ids of the Collections in which this result appears - """ - collectionIds: [ID!]! - - """ - A relevence score for the result. Differs between database implementations - """ - score: Float! -} - -""" -The price of a search result product, either as a range or as a single price -""" -union SearchResultPrice = PriceRange | SinglePrice - -""" -The price value where the result has a single price -""" -type SinglePrice { - value: Int! -} - -""" -The price range where the result has more than one price -""" -type PriceRange { - min: Int! - max: Int! -} - -type Product implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! - slug: String! - description: String! - featuredAsset: Asset - assets: [Asset!]! - variants: [ProductVariant!]! - optionGroups: [ProductOptionGroup!]! - facetValues: [FacetValue!]! - translations: [ProductTranslation!]! - collections: [Collection!]! - customFields: JSON -} - -type ProductTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! - slug: String! - description: String! -} - -type ProductList implements PaginatedList { - items: [Product!]! - totalItems: Int! -} - -type ProductVariant implements Node { - id: ID! - product: Product! - productId: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - sku: String! - name: String! - featuredAsset: Asset - assets: [Asset!]! - price: Int! - currencyCode: CurrencyCode! - priceWithTax: Int! - stockLevel: String! - taxRateApplied: TaxRate! - taxCategory: TaxCategory! - options: [ProductOption!]! - facetValues: [FacetValue!]! - translations: [ProductVariantTranslation!]! - customFields: ProductVariantCustomFields -} - -type ProductVariantTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! -} - -type Promotion implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - startsAt: DateTime - endsAt: DateTime - couponCode: String - perCustomerUsageLimit: Int - name: String! - enabled: Boolean! - conditions: [ConfigurableOperation!]! - actions: [ConfigurableOperation!]! -} - -type PromotionList implements PaginatedList { - items: [Promotion!]! - totalItems: Int! -} - -type Role implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - code: String! - description: String! - permissions: [Permission!]! - channels: [Channel!]! -} - -type RoleList implements PaginatedList { - items: [Role!]! - totalItems: Int! -} - -type ShippingMethod implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - code: String! - name: String! - description: String! - fulfillmentHandlerCode: String! - checker: ConfigurableOperation! - calculator: ConfigurableOperation! - translations: [ShippingMethodTranslation!]! - customFields: JSON -} - -type ShippingMethodTranslation { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - languageCode: LanguageCode! - name: String! - description: String! -} - -type ShippingMethodList implements PaginatedList { - items: [ShippingMethod!]! - totalItems: Int! -} - -type Tag implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! value: String! } -type TagList implements PaginatedList { - items: [Tag!]! - totalItems: Int! -} - -type TaxCategory implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - name: String! - isDefault: Boolean! -} - -type TaxRate implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - name: String! - enabled: Boolean! - value: Float! - category: TaxCategory! - zone: Zone! - customerGroup: CustomerGroup -} - -type TaxRateList implements PaginatedList { - items: [TaxRate!]! - totalItems: Int! -} - -type User implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - identifier: String! - verified: Boolean! - roles: [Role!]! - lastLogin: DateTime - authenticationMethods: [AuthenticationMethod!]! - customFields: JSON -} - -type AuthenticationMethod implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - strategy: String! -} - -type Zone implements Node { - id: ID! - createdAt: DateTime! - updatedAt: DateTime! - name: String! - members: [Country!]! +enum LogicalOperator { + AND + OR } """ -Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. -""" -type OrderModificationError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned when attempting to set a ShippingMethod for which the Order is not eligible -""" -type IneligibleShippingMethodError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. -""" -type OrderPaymentStateError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible. -""" -type IneligiblePaymentMethodError implements ErrorResult { - errorCode: ErrorCode! - message: String! - eligibilityCheckerMessage: String -} - -""" -Returned when a Payment fails due to an error. -""" -type PaymentFailedError implements ErrorResult { - errorCode: ErrorCode! - message: String! - paymentErrorMessage: String! -} - -""" -Returned when a Payment is declined by the payment provider. -""" -type PaymentDeclinedError implements ErrorResult { - errorCode: ErrorCode! - message: String! - paymentErrorMessage: String! -} - -""" -Returned if the provided coupon code is invalid -""" -type CouponCodeInvalidError implements ErrorResult { - errorCode: ErrorCode! - message: String! - couponCode: String! -} - -""" -Returned if the provided coupon code is invalid -""" -type CouponCodeExpiredError implements ErrorResult { - errorCode: ErrorCode! - message: String! - couponCode: String! -} - -""" -Returned if the provided coupon code is invalid -""" -type CouponCodeLimitError implements ErrorResult { - errorCode: ErrorCode! - message: String! - couponCode: String! - limit: Int! -} - -""" -Retured when attemting to set the Customer for an Order when already logged in. -""" -type AlreadyLoggedInError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured when attemting to register or verify a customer account without a password, when one is required. +Returned when attempting to register or verify a customer account without a password, when one is required. """ type MissingPasswordError implements ErrorResult { errorCode: ErrorCode! message: String! } +type Mutation { + """ + Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available. + """ + addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult! + + """ + Add a Payment to the Order + """ + addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult! + + """ + Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available. + """ + adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult! + + """ + Applies the given coupon code to the active Order + """ + applyCouponCode(couponCode: String!): ApplyCouponCodeResult! + + """ + Authenticates the user using a named authentication strategy + """ + authenticate( + input: AuthenticationInput! + rememberMe: Boolean + ): AuthenticationResult! + + """ + Create a new Customer Address + """ + createCustomerAddress(input: CreateAddressInput!): Address! + + """ + Delete an existing Address + """ + deleteCustomerAddress(id: ID!): Success! + + """ + Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})` + """ + login( + password: String! + rememberMe: Boolean + username: String! + ): NativeAuthenticationResult! + + """ + End the current authenticated session + """ + logout: Success! + + """ + Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true. + """ + refreshCustomerVerification( + emailAddress: String! + ): RefreshCustomerVerificationResult! + + """ + Register a Customer account with the given credentials. There are three possible registration flows: + + _If `authOptions.requireVerification` is set to `true`:_ + + 1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then + verified and authenticated in one step. + 2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That + verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosen password of the Customer. The Customer is then + verified and authenticated in one step. + + _If `authOptions.requireVerification` is set to `false`:_ + + 3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately. + """ + registerCustomerAccount( + input: RegisterCustomerInput! + ): RegisterCustomerAccountResult! + + """ + Remove all OrderLine from the Order + """ + removeAllOrderLines: RemoveOrderItemsResult! + + """ + Removes the given coupon code from the active Order + """ + removeCouponCode(couponCode: String!): Order + + """ + Remove an OrderLine from the Order + """ + removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult! + + """ + Requests a password reset email to be sent + """ + requestPasswordReset(emailAddress: String!): RequestPasswordResetResult + + """ + Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled + (as is the default), then the `identifierChangeToken` will be assigned to the current User and + a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email + that verification token to the Customer, which is then used to verify the change of email address. + """ + requestUpdateCustomerEmailAddress( + newEmailAddress: String! + password: String! + ): RequestUpdateCustomerEmailAddressResult! + + """ + Resets a Customer's password based on the provided token + """ + resetPassword(password: String!, token: String!): ResetPasswordResult! + + """ + Set the Customer for the Order. Required only if the Customer is not currently logged in + """ + setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult! + + """ + Sets the billing address for this order + """ + setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult! + + """ + Allows any custom fields to be set for the active order + """ + setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult! + + """ + Sets the shipping address for this order + """ + setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult! + + """ + Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query + """ + setOrderShippingMethod(shippingMethodId: ID!): SetOrderShippingMethodResult! + + """ + Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates` + """ + transitionOrderToState(state: String!): TransitionOrderToStateResult + + """ + Update an existing Customer + """ + updateCustomer(input: UpdateCustomerInput!): Customer! + + """ + Update an existing Address + """ + updateCustomerAddress(input: UpdateAddressInput!): Address! + + """ + Confirm the update of the emailAddress with the provided token, which has been generated by the + `requestUpdateCustomerEmailAddress` mutation. + """ + updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult! + + """ + Update the password of the active Customer + """ + updateCustomerPassword( + currentPassword: String! + newPassword: String! + ): UpdateCustomerPasswordResult! + + """ + Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true. + + If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the password _must_ be + provided here. + """ + verifyCustomerAccount( + password: String + token: String! + ): VerifyCustomerAccountResult! +} + +input NativeAuthInput { + password: String! + username: String! +} + """ -Retured when attemting to verify a customer account with a password, when a password has already been set. +Returned when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured. """ -type PasswordAlreadySetError implements ErrorResult { +type NativeAuthStrategyError implements ErrorResult { errorCode: ErrorCode! message: String! } -""" -Retured if the verification token (used to verify a Customer's email address) is either -invalid or does not match any expected tokens. -""" -type VerificationTokenInvalidError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} +union NativeAuthenticationResult = + CurrentUser + | InvalidCredentialsError + | NativeAuthStrategyError + | NotVerifiedError """ -Returned if the verification token (used to verify a Customer's email address) is valid, but has -expired according to the `verificationTokenDuration` setting in the AuthOptions. +Returned when attempting to set a negative OrderLine quantity. """ -type VerificationTokenExpiredError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured if the token used to change a Customer's email address is either -invalid or does not match any expected tokens. -""" -type IdentifierChangeTokenInvalidError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured if the token used to change a Customer's email address is valid, but has -expired according to the `verificationTokenDuration` setting in the AuthOptions. -""" -type IdentifierChangeTokenExpiredError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured if the token used to reset a Customer's password is either -invalid or does not match any expected tokens. -""" -type PasswordResetTokenInvalidError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Retured if the token used to reset a Customer's password is valid, but has -expired according to the `verificationTokenDuration` setting in the AuthOptions. -""" -type PasswordResetTokenExpiredError implements ErrorResult { - errorCode: ErrorCode! - message: String! -} - -""" -Returned if `authOptions.requireVerification` is set to `true` (which is the default) -and an unverified user attempts to authenticate. -""" -type NotVerifiedError implements ErrorResult { +type NegativeQuantityError implements ErrorResult { errorCode: ErrorCode! message: String! } @@ -3868,295 +2740,1763 @@ type NoActiveOrderError implements ErrorResult { message: String! } -input AuthenticationInput { - native: NativeAuthInput +interface Node { + id: ID! } -input RegisterCustomerInput { - emailAddress: String! - title: String - firstName: String - lastName: String - phoneNumber: String - password: String +""" +Returned if `authOptions.requireVerification` is set to `true` (which is the default) +and an unverified user attempts to authenticate. +""" +type NotVerifiedError implements ErrorResult { + errorCode: ErrorCode! + message: String! } -input UpdateCustomerInput { - title: String - firstName: String - lastName: String - phoneNumber: String +""" +Operators for filtering on a list of Number fields +""" +input NumberListOperators { + inList: Float! +} + +""" +Operators for filtering on a Int or Float field +""" +input NumberOperators { + between: NumberRange + eq: Float + gt: Float + gte: Float + lt: Float + lte: Float +} + +input NumberRange { + end: Float! + start: Float! +} + +type Order implements Node { + """ + An order is active as long as the payment process has not been completed + """ + active: Boolean! + billingAddress: OrderAddress + + """ + A unique code for the Order + """ + code: String! + + """ + An array of all coupon codes applied to the Order + """ + couponCodes: [String!]! + createdAt: DateTime! + currencyCode: CurrencyCode! customFields: JSON + customer: Customer + discounts: [Discount!]! + fulfillments: [Fulfillment!] + history(options: HistoryEntryListOptions): HistoryEntryList! + id: ID! + lines: [OrderLine!]! + + """ + The date & time that the Order was placed, i.e. the Customer + completed the checkout and the Order is no longer "active" + """ + orderPlacedAt: DateTime + payments: [Payment!] + + """ + Promotions applied to the order. Only gets populated after the payment process has completed. + """ + promotions: [Promotion!]! + shipping: Int! + shippingAddress: OrderAddress + shippingLines: [ShippingLine!]! + shippingWithTax: Int! + state: String! + + """ + The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level + discounts which have been prorated (proportionally distributed) amongst the OrderItems. + To get a total of all OrderLines which does not account for prorated discounts, use the + sum of `OrderLine.discountedLinePrice` values. + """ + subTotal: Int! + + """ + Same as subTotal, but inclusive of tax + """ + subTotalWithTax: Int! + + """ + Surcharges are arbitrary modifications to the Order total which are neither + ProductVariants nor discounts resulting from applied Promotions. For example, + one-off discounts based on customer interaction, or surcharges based on payment + methods. + """ + surcharges: [Surcharge!]! + + """ + A summary of the taxes being applied to this Order + """ + taxSummary: [OrderTaxSummary!]! + + """ + Equal to subTotal plus shipping + """ + total: Int! + totalQuantity: Int! + + """ + The final payable amount. Equal to subTotalWithTax plus shippingWithTax + """ + totalWithTax: Int! + updatedAt: DateTime! } -input UpdateOrderInput { +type OrderAddress { + city: String + company: String + country: String + countryCode: String customFields: JSON + fullName: String + phoneNumber: String + postalCode: String + province: String + streetLine1: String + streetLine2: String +} + +input OrderFilterParameter { + active: BooleanOperators + code: StringOperators + createdAt: DateOperators + currencyCode: StringOperators + id: IDOperators + orderPlacedAt: DateOperators + shipping: NumberOperators + shippingWithTax: NumberOperators + state: StringOperators + subTotal: NumberOperators + subTotalWithTax: NumberOperators + total: NumberOperators + totalQuantity: NumberOperators + totalWithTax: NumberOperators + updatedAt: DateOperators +} + +type OrderItem implements Node { + adjustments: [Adjustment!]! + cancelled: Boolean! + createdAt: DateTime! + + """ + The price of a single unit including discounts, excluding tax. + + If Order-level discounts have been applied, this will not be the + actual taxable unit price (see `proratedUnitPrice`), but is generally the + correct price to display to customers to avoid confusion + about the internal handling of distributed Order-level discounts. + """ + discountedUnitPrice: Int! + + """ + The price of a single unit including discounts and tax + """ + discountedUnitPriceWithTax: Int! + fulfillment: Fulfillment + id: ID! + + """ + The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed) + Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + and refund calculations. + """ + proratedUnitPrice: Int! + + """ + The proratedUnitPrice including tax + """ + proratedUnitPriceWithTax: Int! + refundId: ID + taxLines: [TaxLine!]! + taxRate: Float! + + """ + The price of a single unit, excluding tax and discounts + """ + unitPrice: Int! + + """ + The price of a single unit, including tax but excluding discounts + """ + unitPriceWithTax: Int! + unitTax: Int! + updatedAt: DateTime! +} + +""" +Returned when the maximum order size limit has been reached. +""" +type OrderLimitError implements ErrorResult { + errorCode: ErrorCode! + maxItems: Int! + message: String! +} + +type OrderLine implements Node { + createdAt: DateTime! + customFields: JSON + + """ + The price of the line including discounts, excluding tax + """ + discountedLinePrice: Int! + + """ + The price of the line including discounts and tax + """ + discountedLinePriceWithTax: Int! + + """ + The price of a single unit including discounts, excluding tax. + + If Order-level discounts have been applied, this will not be the + actual taxable unit price (see `proratedUnitPrice`), but is generally the + correct price to display to customers to avoid confusion + about the internal handling of distributed Order-level discounts. + """ + discountedUnitPrice: Int! + + """ + The price of a single unit including discounts and tax + """ + discountedUnitPriceWithTax: Int! + discounts: [Discount!]! + featuredAsset: Asset + id: ID! + items: [OrderItem!]! + + """ + The total price of the line excluding tax and discounts. + """ + linePrice: Int! + + """ + The total price of the line including tax but excluding discounts. + """ + linePriceWithTax: Int! + + """ + The total tax on this line + """ + lineTax: Int! + order: Order! + productVariant: ProductVariant! + + """ + The actual line price, taking into account both item discounts _and_ prorated (proportionally-distributed) + Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax + and refund calculations. + """ + proratedLinePrice: Int! + + """ + The proratedLinePrice including tax + """ + proratedLinePriceWithTax: Int! + + """ + The actual unit price, taking into account both item discounts _and_ prorated (proportionally-distributed) + Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax + and refund calculations. + """ + proratedUnitPrice: Int! + + """ + The proratedUnitPrice including tax + """ + proratedUnitPriceWithTax: Int! + quantity: Int! + taxLines: [TaxLine!]! + taxRate: Float! + + """ + The price of a single unit, excluding tax and discounts + """ + unitPrice: Int! + + """ + Non-zero if the unitPrice has changed since it was initially added to Order + """ + unitPriceChangeSinceAdded: Int! + + """ + The price of a single unit, including tax but excluding discounts + """ + unitPriceWithTax: Int! + + """ + Non-zero if the unitPriceWithTax has changed since it was initially added to Order + """ + unitPriceWithTaxChangeSinceAdded: Int! + updatedAt: DateTime! +} + +type OrderList implements PaginatedList { + items: [Order!]! + totalItems: Int! +} + +input OrderListOptions { + """ + Allows the results to be filtered + """ + filter: OrderFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: OrderSortParameter + + """ + Takes n results, for use in pagination + """ + take: Int +} + +""" +Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state. +""" +type OrderModificationError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state. +""" +type OrderPaymentStateError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +input OrderSortParameter { + code: SortOrder + createdAt: SortOrder + id: SortOrder + orderPlacedAt: SortOrder + shipping: SortOrder + shippingWithTax: SortOrder + state: SortOrder + subTotal: SortOrder + subTotalWithTax: SortOrder + total: SortOrder + totalQuantity: SortOrder + totalWithTax: SortOrder + updatedAt: SortOrder +} + +""" +Returned if there is an error in transitioning the Order state +""" +type OrderStateTransitionError implements ErrorResult { + errorCode: ErrorCode! + fromState: String! + message: String! + toState: String! + transitionError: String! +} + +""" +A summary of the taxes being applied to this order, grouped +by taxRate. +""" +type OrderTaxSummary { + """ + A description of this tax + """ + description: String! + + """ + The total net price or OrderItems to which this taxRate applies + """ + taxBase: Int! + + """ + The taxRate as a percentage + """ + taxRate: Float! + + """ + The total tax being applied to the Order at this taxRate + """ + taxTotal: Int! +} + +interface PaginatedList { + items: [Node!]! + totalItems: Int! +} + +""" +Returned when attempting to verify a customer account with a password, when a password has already been set. +""" +type PasswordAlreadySetError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the token used to reset a Customer's password is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type PasswordResetTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the token used to reset a Customer's password is either +invalid or does not match any expected tokens. +""" +type PasswordResetTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned when attempting to register or verify a customer account where the given password fails password validation. +""" +type PasswordValidationError implements ErrorResult { + errorCode: ErrorCode! + message: String! + validationErrorMessage: String! +} + +type Payment implements Node { + amount: Int! + createdAt: DateTime! + errorMessage: String + id: ID! + metadata: JSON + method: String! + refunds: [Refund!]! + state: String! + transactionId: String + updatedAt: DateTime! +} + +""" +Returned when a Payment is declined by the payment provider. +""" +type PaymentDeclinedError implements ErrorResult { + errorCode: ErrorCode! + message: String! + paymentErrorMessage: String! +} + +""" +Returned when a Payment fails due to an error. +""" +type PaymentFailedError implements ErrorResult { + errorCode: ErrorCode! + message: String! + paymentErrorMessage: String! } """ Passed as input to the `addPaymentToOrder` mutation. """ input PaymentInput { - """ - This field should correspond to the `code` property of a PaymentMethodHandler. - """ - method: String! - """ This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method as the "metadata" argument. For example, it could contain an ID for the payment and other data generated by the payment provider. """ metadata: JSON! + + """ + This field should correspond to the `code` property of a PaymentMethod. + """ + method: String! } -input CollectionListOptions { - skip: Int - take: Int - sort: CollectionSortParameter - filter: CollectionFilterParameter +type PaymentMethod implements Node { + checker: ConfigurableOperation + code: String! + createdAt: DateTime! + customFields: JSON + description: String! + enabled: Boolean! + handler: ConfigurableOperation! + id: ID! + name: String! + updatedAt: DateTime! } -input OrderListOptions { - skip: Int - take: Int - sort: OrderSortParameter - filter: OrderFilterParameter +type PaymentMethodQuote { + code: String! + customFields: JSON + description: String! + eligibilityMessage: String + id: ID! + isEligible: Boolean! + name: String! } -input ProductListOptions { - skip: Int - take: Int - sort: ProductSortParameter - filter: ProductFilterParameter +""" +@description +Permissions for administrators and customers. Used to control access to +GraphQL resolvers via the {@link Allow} decorator. + +## Understanding Permission.Owner + +`Permission.Owner` is a special permission which is used in some of the Vendure resolvers to indicate that that resolver should only +be accessible to the "owner" of that resource. + +For example, the Shop API `activeCustomer` query resolver should only return the Customer object for the "owner" of that Customer, i.e. +based on the activeUserId of the current session. As a result, the resolver code looks like this: + +@example +```TypeScript +\@Query() +\@Allow(Permission.Owner) +async activeCustomer(\@Ctx() ctx: RequestContext): Promise { + const userId = ctx.activeUserId; + if (userId) { + return this.customerService.findOneByUserId(ctx, userId); + } +} +``` + +Here we can see that the "ownership" must be enforced by custom logic inside the resolver. Since "ownership" cannot be defined generally +nor statically encoded at build-time, any resolvers using `Permission.Owner` **must** include logic to enforce that only the owner +of the resource has access. If not, then it is the equivalent of using `Permission.Public`. + + +@docsCategory common +""" +enum Permission { + """ + Authenticated means simply that the user is logged in + """ + Authenticated + + """ + Grants permission to create Administrator + """ + CreateAdministrator + + """ + Grants permission to create Asset + """ + CreateAsset + + """ + Grants permission to create Products, Facets, Assets, Collections + """ + CreateCatalog + + """ + Grants permission to create Channel + """ + CreateChannel + + """ + Grants permission to create Collection + """ + CreateCollection + + """ + Grants permission to create Country + """ + CreateCountry + + """ + Grants permission to create Customer + """ + CreateCustomer + + """ + Grants permission to create CustomerGroup + """ + CreateCustomerGroup + + """ + Grants permission to create Facet + """ + CreateFacet + + """ + Grants permission to create Order + """ + CreateOrder + + """ + Grants permission to create PaymentMethod + """ + CreatePaymentMethod + + """ + Grants permission to create Product + """ + CreateProduct + + """ + Grants permission to create Promotion + """ + CreatePromotion + + """ + Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + CreateSettings + + """ + Grants permission to create ShippingMethod + """ + CreateShippingMethod + + """ + Grants permission to create System + """ + CreateSystem + + """ + Grants permission to create Tag + """ + CreateTag + + """ + Grants permission to create TaxCategory + """ + CreateTaxCategory + + """ + Grants permission to create TaxRate + """ + CreateTaxRate + + """ + Grants permission to create Zone + """ + CreateZone + + """ + Grants permission to delete Administrator + """ + DeleteAdministrator + + """ + Grants permission to delete Asset + """ + DeleteAsset + + """ + Grants permission to delete Products, Facets, Assets, Collections + """ + DeleteCatalog + + """ + Grants permission to delete Channel + """ + DeleteChannel + + """ + Grants permission to delete Collection + """ + DeleteCollection + + """ + Grants permission to delete Country + """ + DeleteCountry + + """ + Grants permission to delete Customer + """ + DeleteCustomer + + """ + Grants permission to delete CustomerGroup + """ + DeleteCustomerGroup + + """ + Grants permission to delete Facet + """ + DeleteFacet + + """ + Grants permission to delete Order + """ + DeleteOrder + + """ + Grants permission to delete PaymentMethod + """ + DeletePaymentMethod + + """ + Grants permission to delete Product + """ + DeleteProduct + + """ + Grants permission to delete Promotion + """ + DeletePromotion + + """ + Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + DeleteSettings + + """ + Grants permission to delete ShippingMethod + """ + DeleteShippingMethod + + """ + Grants permission to delete System + """ + DeleteSystem + + """ + Grants permission to delete Tag + """ + DeleteTag + + """ + Grants permission to delete TaxCategory + """ + DeleteTaxCategory + + """ + Grants permission to delete TaxRate + """ + DeleteTaxRate + + """ + Grants permission to delete Zone + """ + DeleteZone + + """ + Owner means the user owns this entity, e.g. a Customer's own Order + """ + Owner + + """ + Public means any unauthenticated user may perform the operation + """ + Public + + """ + Grants permission to read Administrator + """ + ReadAdministrator + + """ + Grants permission to read Asset + """ + ReadAsset + + """ + Grants permission to read Products, Facets, Assets, Collections + """ + ReadCatalog + + """ + Grants permission to read Channel + """ + ReadChannel + + """ + Grants permission to read Collection + """ + ReadCollection + + """ + Grants permission to read Country + """ + ReadCountry + + """ + Grants permission to read Customer + """ + ReadCustomer + + """ + Grants permission to read CustomerGroup + """ + ReadCustomerGroup + + """ + Grants permission to read Facet + """ + ReadFacet + + """ + Grants permission to read Order + """ + ReadOrder + + """ + Grants permission to read PaymentMethod + """ + ReadPaymentMethod + + """ + Grants permission to read Product + """ + ReadProduct + + """ + Grants permission to read Promotion + """ + ReadPromotion + + """ + Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + ReadSettings + + """ + Grants permission to read ShippingMethod + """ + ReadShippingMethod + + """ + Grants permission to read System + """ + ReadSystem + + """ + Grants permission to read Tag + """ + ReadTag + + """ + Grants permission to read TaxCategory + """ + ReadTaxCategory + + """ + Grants permission to read TaxRate + """ + ReadTaxRate + + """ + Grants permission to read Zone + """ + ReadZone + + """ + SuperAdmin has unrestricted access to all operations + """ + SuperAdmin + + """ + Grants permission to update Administrator + """ + UpdateAdministrator + + """ + Grants permission to update Asset + """ + UpdateAsset + + """ + Grants permission to update Products, Facets, Assets, Collections + """ + UpdateCatalog + + """ + Grants permission to update Channel + """ + UpdateChannel + + """ + Grants permission to update Collection + """ + UpdateCollection + + """ + Grants permission to update Country + """ + UpdateCountry + + """ + Grants permission to update Customer + """ + UpdateCustomer + + """ + Grants permission to update CustomerGroup + """ + UpdateCustomerGroup + + """ + Grants permission to update Facet + """ + UpdateFacet + + """ + Grants permission to update GlobalSettings + """ + UpdateGlobalSettings + + """ + Grants permission to update Order + """ + UpdateOrder + + """ + Grants permission to update PaymentMethod + """ + UpdatePaymentMethod + + """ + Grants permission to update Product + """ + UpdateProduct + + """ + Grants permission to update Promotion + """ + UpdatePromotion + + """ + Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings + """ + UpdateSettings + + """ + Grants permission to update ShippingMethod + """ + UpdateShippingMethod + + """ + Grants permission to update System + """ + UpdateSystem + + """ + Grants permission to update Tag + """ + UpdateTag + + """ + Grants permission to update TaxCategory + """ + UpdateTaxCategory + + """ + Grants permission to update TaxRate + """ + UpdateTaxRate + + """ + Grants permission to update Zone + """ + UpdateZone } -union UpdateOrderItemsResult = - Order - | OrderModificationError - | OrderLimitError - | NegativeQuantityError - | InsufficientStockError - -union RemoveOrderItemsResult = Order | OrderModificationError - -union SetOrderShippingMethodResult = - Order - | OrderModificationError - | IneligibleShippingMethodError - | NoActiveOrderError - -union ApplyCouponCodeResult = - Order - | CouponCodeExpiredError - | CouponCodeInvalidError - | CouponCodeLimitError - -union AddPaymentToOrderResult = - Order - | OrderPaymentStateError - | IneligiblePaymentMethodError - | PaymentFailedError - | PaymentDeclinedError - | OrderStateTransitionError - | NoActiveOrderError - -union TransitionOrderToStateResult = Order | OrderStateTransitionError - -union SetCustomerForOrderResult = - Order - | AlreadyLoggedInError - | EmailAddressConflictError - | NoActiveOrderError - -union RegisterCustomerAccountResult = - Success - | MissingPasswordError - | NativeAuthStrategyError - -union RefreshCustomerVerificationResult = Success | NativeAuthStrategyError - -union VerifyCustomerAccountResult = - CurrentUser - | VerificationTokenInvalidError - | VerificationTokenExpiredError - | MissingPasswordError - | PasswordAlreadySetError - | NativeAuthStrategyError - -union UpdateCustomerPasswordResult = - Success - | InvalidCredentialsError - | NativeAuthStrategyError - -union RequestUpdateCustomerEmailAddressResult = - Success - | InvalidCredentialsError - | EmailAddressConflictError - | NativeAuthStrategyError - -union UpdateCustomerEmailAddressResult = - Success - | IdentifierChangeTokenInvalidError - | IdentifierChangeTokenExpiredError - | NativeAuthStrategyError - -union RequestPasswordResetResult = Success | NativeAuthStrategyError - -union ResetPasswordResult = - CurrentUser - | PasswordResetTokenInvalidError - | PasswordResetTokenExpiredError - | NativeAuthStrategyError - -union NativeAuthenticationResult = - CurrentUser - | InvalidCredentialsError - | NotVerifiedError - | NativeAuthStrategyError - -union AuthenticationResult = - CurrentUser - | InvalidCredentialsError - | NotVerifiedError - -union ActiveOrderResult = Order | NoActiveOrderError - -input CollectionFilterParameter { - createdAt: DateOperators - updatedAt: DateOperators - languageCode: StringOperators - name: StringOperators - slug: StringOperators - position: NumberOperators - description: StringOperators +""" +The price range where the result has more than one price +""" +type PriceRange { + max: Int! + min: Int! } -input CollectionSortParameter { - id: SortOrder - createdAt: SortOrder - updatedAt: SortOrder - name: SortOrder - slug: SortOrder - position: SortOrder - description: SortOrder +type Product implements Node { + assets: [Asset!]! + collections: [Collection!]! + createdAt: DateTime! + customFields: JSON + description: String! + facetValues: [FacetValue!]! + featuredAsset: Asset + id: ID! + languageCode: LanguageCode! + name: String! + optionGroups: [ProductOptionGroup!]! + slug: String! + translations: [ProductTranslation!]! + updatedAt: DateTime! + + """ + Returns a paginated, sortable, filterable list of ProductVariants + """ + variantList(options: ProductVariantListOptions): ProductVariantList! + + """ + Returns all ProductVariants + """ + variants: [ProductVariant!]! } input ProductFilterParameter { createdAt: DateOperators - updatedAt: DateOperators + description: StringOperators + id: IDOperators languageCode: StringOperators name: StringOperators slug: StringOperators - description: StringOperators + updatedAt: DateOperators +} + +type ProductList implements PaginatedList { + items: [Product!]! + totalItems: Int! +} + +input ProductListOptions { + """ + Allows the results to be filtered + """ + filter: ProductFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: ProductSortParameter + + """ + Takes n results, for use in pagination + """ + take: Int +} + +type ProductOption implements Node { + code: String! + createdAt: DateTime! + customFields: JSON + group: ProductOptionGroup! + groupId: ID! + id: ID! + languageCode: LanguageCode! + name: String! + translations: [ProductOptionTranslation!]! + updatedAt: DateTime! +} + +type ProductOptionGroup implements Node { + code: String! + createdAt: DateTime! + customFields: JSON + id: ID! + languageCode: LanguageCode! + name: String! + options: [ProductOption!]! + translations: [ProductOptionGroupTranslation!]! + updatedAt: DateTime! +} + +type ProductOptionGroupTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! +} + +type ProductOptionTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! } input ProductSortParameter { - id: SortOrder createdAt: SortOrder - updatedAt: SortOrder + description: SortOrder + id: SortOrder name: SortOrder slug: SortOrder - description: SortOrder + updatedAt: SortOrder +} + +type ProductTranslation { + createdAt: DateTime! + description: String! + id: ID! + languageCode: LanguageCode! + name: String! + slug: String! + updatedAt: DateTime! +} + +type ProductVariant implements Node { + assets: [Asset!]! + createdAt: DateTime! + currencyCode: CurrencyCode! + customFields: JSON + facetValues: [FacetValue!]! + featuredAsset: Asset + id: ID! + languageCode: LanguageCode! + name: String! + options: [ProductOption!]! + price: Int! + priceWithTax: Int! + product: Product! + productId: ID! + sku: String! + stockLevel: String! + taxCategory: TaxCategory! + taxRateApplied: TaxRate! + translations: [ProductVariantTranslation!]! + updatedAt: DateTime! } input ProductVariantFilterParameter { createdAt: DateOperators - updatedAt: DateOperators + currencyCode: StringOperators + id: IDOperators languageCode: StringOperators - sku: StringOperators name: StringOperators price: NumberOperators - currencyCode: StringOperators priceWithTax: NumberOperators + productId: IDOperators + sku: StringOperators stockLevel: StringOperators - discountPrice: NumberOperators + updatedAt: DateOperators +} + +type ProductVariantList implements PaginatedList { + items: [ProductVariant!]! + totalItems: Int! +} + +input ProductVariantListOptions { + """ + Allows the results to be filtered + """ + filter: ProductVariantFilterParameter + + """ + Specifies whether multiple "filter" arguments should be combines with a logical AND or OR operation. Defaults to AND. + """ + filterOperator: LogicalOperator + + """ + Skips the first n results, for use in pagination + """ + skip: Int + + """ + Specifies which properties to sort the results by + """ + sort: ProductVariantSortParameter + + """ + Takes n results, for use in pagination + """ + take: Int } input ProductVariantSortParameter { - id: SortOrder - productId: SortOrder createdAt: SortOrder - updatedAt: SortOrder - sku: SortOrder + id: SortOrder name: SortOrder price: SortOrder priceWithTax: SortOrder + productId: SortOrder + sku: SortOrder stockLevel: SortOrder - discountPrice: SortOrder -} - -input CustomerFilterParameter { - createdAt: DateOperators - updatedAt: DateOperators - title: StringOperators - firstName: StringOperators - lastName: StringOperators - phoneNumber: StringOperators - emailAddress: StringOperators -} - -input CustomerSortParameter { - id: SortOrder - createdAt: SortOrder - updatedAt: SortOrder - title: SortOrder - firstName: SortOrder - lastName: SortOrder - phoneNumber: SortOrder - emailAddress: SortOrder -} - -input OrderFilterParameter { - createdAt: DateOperators - updatedAt: DateOperators - orderPlacedAt: DateOperators - code: StringOperators - state: StringOperators - active: BooleanOperators - totalQuantity: NumberOperators - subTotal: NumberOperators - subTotalWithTax: NumberOperators - currencyCode: StringOperators - shipping: NumberOperators - shippingWithTax: NumberOperators - total: NumberOperators - totalWithTax: NumberOperators -} - -input OrderSortParameter { - id: SortOrder - createdAt: SortOrder - updatedAt: SortOrder - orderPlacedAt: SortOrder - code: SortOrder - state: SortOrder - totalQuantity: SortOrder - subTotal: SortOrder - subTotalWithTax: SortOrder - shipping: SortOrder - shippingWithTax: SortOrder - total: SortOrder - totalWithTax: SortOrder -} - -input HistoryEntryFilterParameter { - createdAt: DateOperators - updatedAt: DateOperators - type: StringOperators -} - -input HistoryEntrySortParameter { - id: SortOrder - createdAt: SortOrder updatedAt: SortOrder } -type ProductVariantCustomFields { - discountPrice: Int +type ProductVariantTranslation { + createdAt: DateTime! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! } -input NativeAuthInput { - username: String! - password: String! +type Promotion implements Node { + actions: [ConfigurableOperation!]! + conditions: [ConfigurableOperation!]! + couponCode: String + createdAt: DateTime! + customFields: JSON + enabled: Boolean! + endsAt: DateTime + id: ID! + name: String! + perCustomerUsageLimit: Int + startsAt: DateTime + updatedAt: DateTime! +} + +type PromotionList implements PaginatedList { + items: [Promotion!]! + totalItems: Int! +} + +type Query { + """ + The active Channel + """ + activeChannel: Channel! + + """ + The active Customer + """ + activeCustomer: Customer + + """ + The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the + state of `PaymentAuthorized` or `PaymentSettled`, then that Order is no longer considered "active" and this + query will once again return `null`. + """ + activeOrder: Order + + """ + An array of supported Countries + """ + availableCountries: [Country!]! + + """ + Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is specified, an error will result. + """ + collection(id: ID, slug: String): Collection + + """ + A list of Collections available to the shop + """ + collections(options: CollectionListOptions): CollectionList! + + """ + Returns a list of payment methods and their eligibility based on the current active Order + """ + eligiblePaymentMethods: [PaymentMethodQuote!]! + + """ + Returns a list of eligible shipping methods based on the current active Order + """ + eligibleShippingMethods: [ShippingMethodQuote!]! + + """ + Returns a Facet by its id + """ + facet(id: ID!): Facet + + """ + A list of Facets available to the shop + """ + facets(options: FacetListOptions): FacetList! + + """ + Returns information about the current authenticated User + """ + me: CurrentUser + + """ + Returns the possible next states that the activeOrder can transition to + """ + nextOrderStates: [String!]! + + """ + Returns an Order based on the id. Note that in the Shop API, only orders belonging to the + currently-authenticated User may be queried. + """ + order(id: ID!): Order + + """ + Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers) + this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation + screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing + general anonymous access to Order data. + """ + orderByCode(code: String!): Order + + """ + Get a Product either by id or slug. If neither 'id' nor 'slug' is specified, an error will result. + """ + product(id: ID, slug: String): Product + + """ + Get a list of Products + """ + products(options: ProductListOptions): ProductList! + + """ + Search Products based on the criteria set by the `SearchInput` + """ + search(input: SearchInput!): SearchResponse! +} + +union RefreshCustomerVerificationResult = NativeAuthStrategyError | Success + +type Refund implements Node { + adjustment: Int! + createdAt: DateTime! + id: ID! + items: Int! + metadata: JSON + method: String + orderItems: [OrderItem!]! + paymentId: ID! + reason: String + shipping: Int! + state: String! + total: Int! + transactionId: String + updatedAt: DateTime! +} + +union RegisterCustomerAccountResult = + MissingPasswordError + | NativeAuthStrategyError + | PasswordValidationError + | Success + +input RegisterCustomerInput { + emailAddress: String! + firstName: String + lastName: String + password: String + phoneNumber: String + title: String +} + +type RelationCustomFieldConfig implements CustomField { + description: [LocalizedString!] + entity: String! + internal: Boolean + label: [LocalizedString!] + list: Boolean! + name: String! + nullable: Boolean + readonly: Boolean + scalarFields: [String!]! + type: String! + ui: JSON +} + +union RemoveOrderItemsResult = Order | OrderModificationError + +union RequestPasswordResetResult = NativeAuthStrategyError | Success + +union RequestUpdateCustomerEmailAddressResult = + EmailAddressConflictError + | InvalidCredentialsError + | NativeAuthStrategyError + | Success + +union ResetPasswordResult = + CurrentUser + | NativeAuthStrategyError + | NotVerifiedError + | PasswordResetTokenExpiredError + | PasswordResetTokenInvalidError + | PasswordValidationError + +type Role implements Node { + channels: [Channel!]! + code: String! + createdAt: DateTime! + description: String! + id: ID! + permissions: [Permission!]! + updatedAt: DateTime! +} + +type RoleList implements PaginatedList { + items: [Role!]! + totalItems: Int! +} + +input SearchInput { + collectionId: ID + collectionSlug: String + facetValueFilters: [FacetValueFilterInput!] + facetValueIds: [ID!] + facetValueOperator: LogicalOperator + groupByProduct: Boolean + inStock: Boolean + skip: Int + sort: SearchResultSortParameter + take: Int + term: String +} + +type SearchReindexResponse { + success: Boolean! +} + +type SearchResponse { + collections: [CollectionResult!]! + facetValues: [FacetValueResult!]! + items: [SearchResult!]! + totalItems: Int! +} + +type SearchResult { + """ + An array of ids of the Collections in which this result appears + """ + collectionIds: [ID!]! + currencyCode: CurrencyCode! + description: String! + facetIds: [ID!]! + facetValueIds: [ID!]! + inStock: Boolean! + price: SearchResultPrice! + priceWithTax: SearchResultPrice! + productAsset: SearchResultAsset + productId: ID! + productName: String! + productVariantAsset: SearchResultAsset + productVariantId: ID! + productVariantName: String! + + """ + A relevance score for the result. Differs between database implementations + """ + score: Float! + sku: String! + slug: String! +} + +type SearchResultAsset { + focalPoint: Coordinate + id: ID! + preview: String! +} + +""" +The price of a search result product, either as a range or as a single price +""" +union SearchResultPrice = PriceRange | SinglePrice + +input SearchResultSortParameter { + name: SortOrder + price: SortOrder +} + +union SetCustomerForOrderResult = + AlreadyLoggedInError + | EmailAddressConflictError + | NoActiveOrderError + | Order + +union SetOrderShippingMethodResult = + IneligibleShippingMethodError + | NoActiveOrderError + | Order + | OrderModificationError + +type ShippingLine { + discountedPrice: Int! + discountedPriceWithTax: Int! + discounts: [Discount!]! + price: Int! + priceWithTax: Int! + shippingMethod: ShippingMethod! +} + +type ShippingMethod implements Node { + calculator: ConfigurableOperation! + checker: ConfigurableOperation! + code: String! + createdAt: DateTime! + customFields: JSON + description: String! + fulfillmentHandlerCode: String! + id: ID! + name: String! + translations: [ShippingMethodTranslation!]! + updatedAt: DateTime! +} + +type ShippingMethodList implements PaginatedList { + items: [ShippingMethod!]! + totalItems: Int! +} + +type ShippingMethodQuote { + code: String! + customFields: JSON + description: String! + id: ID! + + """ + Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult + """ + metadata: JSON + name: String! + price: Int! + priceWithTax: Int! +} + +type ShippingMethodTranslation { + createdAt: DateTime! + description: String! + id: ID! + languageCode: LanguageCode! + name: String! + updatedAt: DateTime! +} + +""" +The price value where the result has a single price +""" +type SinglePrice { + value: Int! +} + +enum SortOrder { + ASC + DESC +} + +type StringCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + length: Int + list: Boolean! + name: String! + nullable: Boolean + options: [StringFieldOption!] + pattern: String + readonly: Boolean + type: String! + ui: JSON +} + +type StringFieldOption { + label: [LocalizedString!] + value: String! +} + +""" +Operators for filtering on a list of String fields +""" +input StringListOperators { + inList: String! +} + +""" +Operators for filtering on a String field +""" +input StringOperators { + contains: String + eq: String + in: [String!] + notContains: String + notEq: String + notIn: [String!] + regex: String +} + +""" +Indicates that an operation succeeded, where we do not want to return any more specific information. +""" +type Success { + success: Boolean! +} + +type Surcharge implements Node { + createdAt: DateTime! + description: String! + id: ID! + price: Int! + priceWithTax: Int! + sku: String + taxLines: [TaxLine!]! + taxRate: Float! + updatedAt: DateTime! +} + +type Tag implements Node { + createdAt: DateTime! + id: ID! + updatedAt: DateTime! + value: String! +} + +type TagList implements PaginatedList { + items: [Tag!]! + totalItems: Int! +} + +type TaxCategory implements Node { + createdAt: DateTime! + customFields: JSON + id: ID! + isDefault: Boolean! + name: String! + updatedAt: DateTime! +} + +type TaxLine { + description: String! + taxRate: Float! +} + +type TaxRate implements Node { + category: TaxCategory! + createdAt: DateTime! + customFields: JSON + customerGroup: CustomerGroup + enabled: Boolean! + id: ID! + name: String! + updatedAt: DateTime! + value: Float! + zone: Zone! +} + +type TaxRateList implements PaginatedList { + items: [TaxRate!]! + totalItems: Int! +} + +type TextCustomFieldConfig implements CustomField { + description: [LocalizedString!] + internal: Boolean + label: [LocalizedString!] + list: Boolean! + name: String! + nullable: Boolean + readonly: Boolean + type: String! + ui: JSON +} + +union TransitionOrderToStateResult = Order | OrderStateTransitionError + +input UpdateAddressInput { + city: String + company: String + countryCode: String + customFields: JSON + defaultBillingAddress: Boolean + defaultShippingAddress: Boolean + fullName: String + id: ID! + phoneNumber: String + postalCode: String + province: String + streetLine1: String + streetLine2: String +} + +union UpdateCustomerEmailAddressResult = + IdentifierChangeTokenExpiredError + | IdentifierChangeTokenInvalidError + | NativeAuthStrategyError + | Success + +input UpdateCustomerInput { + customFields: JSON + firstName: String + lastName: String + phoneNumber: String + title: String +} + +union UpdateCustomerPasswordResult = + InvalidCredentialsError + | NativeAuthStrategyError + | PasswordValidationError + | Success + +input UpdateOrderInput { + customFields: JSON +} + +union UpdateOrderItemsResult = + InsufficientStockError + | NegativeQuantityError + | Order + | OrderLimitError + | OrderModificationError + +""" +The `Upload` scalar type represents a file upload. +""" +scalar Upload + +type User implements Node { + authenticationMethods: [AuthenticationMethod!]! + createdAt: DateTime! + customFields: JSON + id: ID! + identifier: String! + lastLogin: DateTime + roles: [Role!]! + updatedAt: DateTime! + verified: Boolean! +} + +""" +Returned if the verification token (used to verify a Customer's email address) is valid, but has +expired according to the `verificationTokenDuration` setting in the AuthOptions. +""" +type VerificationTokenExpiredError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +""" +Returned if the verification token (used to verify a Customer's email address) is either +invalid or does not match any expected tokens. +""" +type VerificationTokenInvalidError implements ErrorResult { + errorCode: ErrorCode! + message: String! +} + +union VerifyCustomerAccountResult = + CurrentUser + | MissingPasswordError + | NativeAuthStrategyError + | PasswordAlreadySetError + | PasswordValidationError + | VerificationTokenExpiredError + | VerificationTokenInvalidError + +type Zone implements Node { + createdAt: DateTime! + customFields: JSON + id: ID! + members: [Country!]! + name: String! + updatedAt: DateTime! }