From 657949e39368aac996379c631693e439c336856f Mon Sep 17 00:00:00 2001 From: Michael Bromley Date: Tue, 15 Sep 2020 13:59:42 +0200 Subject: [PATCH] chore: Move duplicated e2e definitions to shared file --- .../core/e2e/customer-channel.e2e-spec.ts | 157 +-- packages/core/e2e/customer-group.e2e-spec.ts | 74 +- packages/core/e2e/customer.e2e-spec.ts | 94 +- .../core/e2e/fulfillment-process.e2e-spec.ts | 10 - .../e2e/graphql/generated-e2e-admin-types.ts | 939 +++++++----------- .../core/e2e/graphql/shared-definitions.ts | 157 +++ packages/core/e2e/order-process.e2e-spec.ts | 13 +- 7 files changed, 534 insertions(+), 910 deletions(-) diff --git a/packages/core/e2e/customer-channel.e2e-spec.ts b/packages/core/e2e/customer-channel.e2e-spec.ts index e344b7d312..e5ebd2d8c8 100644 --- a/packages/core/e2e/customer-channel.e2e-spec.ts +++ b/packages/core/e2e/customer-channel.e2e-spec.ts @@ -1,12 +1,10 @@ /* tslint:disable:no-non-null-assertion */ import { createTestEnvironment, E2E_DEFAULT_CHANNEL_TOKEN } from '@vendure/testing'; -import gql from 'graphql-tag'; import path from 'path'; import { initialData } from '../../../e2e-common/e2e-initial-data'; import { TEST_SETUP_TIMEOUT_MS, testConfig } from '../../../e2e-common/test-config'; -import { CUSTOMER_FRAGMENT } from './graphql/fragments'; import { AddCustomersToGroup, CreateAddress, @@ -26,12 +24,18 @@ import { } from './graphql/generated-e2e-admin-types'; import { Register } from './graphql/generated-e2e-shop-types'; import { + ADD_CUSTOMERS_TO_GROUP, + CREATE_ADDRESS, CREATE_CHANNEL, + CREATE_CUSTOMER, CREATE_CUSTOMER_GROUP, - CUSTOMER_GROUP_FRAGMENT, + DELETE_CUSTOMER, + GET_CUSTOMER_GROUP, GET_CUSTOMER_LIST, ME, REMOVE_CUSTOMERS_FROM_GROUP, + UPDATE_ADDRESS, + UPDATE_CUSTOMER, } from './graphql/shared-definitions'; import { DELETE_ADDRESS, REGISTER_ACCOUNT } from './graphql/shop-definitions'; import { assertThrowsWithMessage } from './utils/assert-throws-with-message'; @@ -338,150 +342,3 @@ describe('ChannelAware Customers', () => { }); }); }); - -export const CREATE_ADDRESS = gql` - mutation CreateAddress($id: ID!, $input: CreateAddressInput!) { - createCustomerAddress(customerId: $id, input: $input) { - id - fullName - company - streetLine1 - streetLine2 - city - province - postalCode - country { - code - name - } - phoneNumber - defaultShippingAddress - defaultBillingAddress - } - } -`; - -export const UPDATE_ADDRESS = gql` - mutation UpdateAddress($input: UpdateAddressInput!) { - updateCustomerAddress(input: $input) { - id - defaultShippingAddress - defaultBillingAddress - country { - code - name - } - } - } -`; - -export const CREATE_CUSTOMER = gql` - mutation CreateCustomer($input: CreateCustomerInput!, $password: String) { - createCustomer(input: $input, password: $password) { - ...Customer - } - } - ${CUSTOMER_FRAGMENT} -`; - -export const UPDATE_CUSTOMER = gql` - mutation UpdateCustomer($input: UpdateCustomerInput!) { - updateCustomer(input: $input) { - ...Customer - } - } - ${CUSTOMER_FRAGMENT} -`; - -export const DELETE_CUSTOMER = gql` - mutation DeleteCustomer($id: ID!) { - deleteCustomer(id: $id) { - result - } - } -`; - -export const UPDATE_CUSTOMER_NOTE = gql` - mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) { - updateCustomerNote(input: $input) { - id - data - isPublic - } - } -`; - -export const DELETE_CUSTOMER_NOTE = gql` - mutation DeleteCustomerNote($id: ID!) { - deleteCustomerNote(id: $id) { - result - message - } - } -`; - -export const UPDATE_CUSTOMER_GROUP = gql` - mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) { - updateCustomerGroup(input: $input) { - ...CustomerGroup - } - } - ${CUSTOMER_GROUP_FRAGMENT} -`; - -export const DELETE_CUSTOMER_GROUP = gql` - mutation DeleteCustomerGroup($id: ID!) { - deleteCustomerGroup(id: $id) { - result - message - } - } -`; - -export const GET_CUSTOMER_GROUPS = gql` - query GetCustomerGroups($options: CustomerGroupListOptions) { - customerGroups(options: $options) { - items { - id - name - } - totalItems - } - } -`; - -export const GET_CUSTOMER_GROUP = gql` - query GetCustomerGroup($id: ID!, $options: CustomerListOptions) { - customerGroup(id: $id) { - id - name - customers(options: $options) { - items { - id - } - totalItems - } - } - } -`; - -export const ADD_CUSTOMERS_TO_GROUP = gql` - mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) { - addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) { - ...CustomerGroup - } - } - ${CUSTOMER_GROUP_FRAGMENT} -`; - -export const GET_CUSTOMER_WITH_GROUPS = gql` - query GetCustomerWithGroups($id: ID!) { - customer(id: $id) { - id - groups { - id - name - } - } - } -`; diff --git a/packages/core/e2e/customer-group.e2e-spec.ts b/packages/core/e2e/customer-group.e2e-spec.ts index 129fedb759..3d39ee11b9 100644 --- a/packages/core/e2e/customer-group.e2e-spec.ts +++ b/packages/core/e2e/customer-group.e2e-spec.ts @@ -1,6 +1,5 @@ import { pick } from '@vendure/common/lib/pick'; import { createTestEnvironment } from '@vendure/testing'; -import gql from 'graphql-tag'; import path from 'path'; import { initialData } from '../../../e2e-common/e2e-initial-data'; @@ -21,11 +20,16 @@ import { } from './graphql/generated-e2e-admin-types'; import { DeletionResult } from './graphql/generated-e2e-shop-types'; import { + ADD_CUSTOMERS_TO_GROUP, CREATE_CUSTOMER_GROUP, - CUSTOMER_GROUP_FRAGMENT, + DELETE_CUSTOMER_GROUP, + GET_CUSTOMER_GROUP, + GET_CUSTOMER_GROUPS, GET_CUSTOMER_HISTORY, GET_CUSTOMER_LIST, + GET_CUSTOMER_WITH_GROUPS, REMOVE_CUSTOMERS_FROM_GROUP, + UPDATE_CUSTOMER_GROUP, } from './graphql/shared-definitions'; import { assertThrowsWithMessage } from './utils/assert-throws-with-message'; import { sortById } from './utils/test-order-utils'; @@ -282,69 +286,3 @@ describe('CustomerGroup resolver', () => { expect(customerGroups.totalItems).toBe(0); }); }); - -export const UPDATE_CUSTOMER_GROUP = gql` - mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) { - updateCustomerGroup(input: $input) { - ...CustomerGroup - } - } - ${CUSTOMER_GROUP_FRAGMENT} -`; - -export const DELETE_CUSTOMER_GROUP = gql` - mutation DeleteCustomerGroup($id: ID!) { - deleteCustomerGroup(id: $id) { - result - message - } - } -`; - -export const GET_CUSTOMER_GROUPS = gql` - query GetCustomerGroups($options: CustomerGroupListOptions) { - customerGroups(options: $options) { - items { - id - name - } - totalItems - } - } -`; - -export const GET_CUSTOMER_GROUP = gql` - query GetCustomerGroup($id: ID!, $options: CustomerListOptions) { - customerGroup(id: $id) { - id - name - customers(options: $options) { - items { - id - } - totalItems - } - } - } -`; - -export const ADD_CUSTOMERS_TO_GROUP = gql` - mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) { - addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) { - ...CustomerGroup - } - } - ${CUSTOMER_GROUP_FRAGMENT} -`; - -export const GET_CUSTOMER_WITH_GROUPS = gql` - query GetCustomerWithGroups($id: ID!) { - customer(id: $id) { - id - groups { - id - name - } - } - } -`; diff --git a/packages/core/e2e/customer.e2e-spec.ts b/packages/core/e2e/customer.e2e-spec.ts index dc8b70d0fa..b25442524f 100644 --- a/packages/core/e2e/customer.e2e-spec.ts +++ b/packages/core/e2e/customer.e2e-spec.ts @@ -35,7 +35,18 @@ import { UpdateCustomerNote, } from './graphql/generated-e2e-admin-types'; import { AddItemToOrder } from './graphql/generated-e2e-shop-types'; -import { GET_CUSTOMER, GET_CUSTOMER_HISTORY, GET_CUSTOMER_LIST } from './graphql/shared-definitions'; +import { + CREATE_ADDRESS, + CREATE_CUSTOMER, + DELETE_CUSTOMER, + DELETE_CUSTOMER_NOTE, + GET_CUSTOMER, + GET_CUSTOMER_HISTORY, + GET_CUSTOMER_LIST, + UPDATE_ADDRESS, + UPDATE_CUSTOMER, + UPDATE_CUSTOMER_NOTE, +} from './graphql/shared-definitions'; import { ADD_ITEM_TO_ORDER } from './graphql/shop-definitions'; import { assertThrowsWithMessage } from './utils/assert-throws-with-message'; @@ -593,42 +604,6 @@ const GET_CUSTOMER_WITH_USER = gql` } `; -export const CREATE_ADDRESS = gql` - mutation CreateAddress($id: ID!, $input: CreateAddressInput!) { - createCustomerAddress(customerId: $id, input: $input) { - id - fullName - company - streetLine1 - streetLine2 - city - province - postalCode - country { - code - name - } - phoneNumber - defaultShippingAddress - defaultBillingAddress - } - } -`; - -export const UPDATE_ADDRESS = gql` - mutation UpdateAddress($input: UpdateAddressInput!) { - updateCustomerAddress(input: $input) { - id - defaultShippingAddress - defaultBillingAddress - country { - code - name - } - } - } -`; - const GET_CUSTOMER_ORDERS = gql` query GetCustomerOrders($id: ID!) { customer(id: $id) { @@ -642,32 +617,6 @@ const GET_CUSTOMER_ORDERS = gql` } `; -export const CREATE_CUSTOMER = gql` - mutation CreateCustomer($input: CreateCustomerInput!, $password: String) { - createCustomer(input: $input, password: $password) { - ...Customer - } - } - ${CUSTOMER_FRAGMENT} -`; - -export const UPDATE_CUSTOMER = gql` - mutation UpdateCustomer($input: UpdateCustomerInput!) { - updateCustomer(input: $input) { - ...Customer - } - } - ${CUSTOMER_FRAGMENT} -`; - -export const DELETE_CUSTOMER = gql` - mutation DeleteCustomer($id: ID!) { - deleteCustomer(id: $id) { - result - } - } -`; - const ADD_NOTE_TO_CUSTOMER = gql` mutation AddNoteToCustomer($input: AddNoteToCustomerInput!) { addNoteToCustomer(input: $input) { @@ -676,22 +625,3 @@ const ADD_NOTE_TO_CUSTOMER = gql` } ${CUSTOMER_FRAGMENT} `; - -export const UPDATE_CUSTOMER_NOTE = gql` - mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) { - updateCustomerNote(input: $input) { - id - data - isPublic - } - } -`; - -export const DELETE_CUSTOMER_NOTE = gql` - mutation DeleteCustomerNote($id: ID!) { - deleteCustomerNote(id: $id) { - result - message - } - } -`; diff --git a/packages/core/e2e/fulfillment-process.e2e-spec.ts b/packages/core/e2e/fulfillment-process.e2e-spec.ts index 53ec0417c8..baa9c8273f 100644 --- a/packages/core/e2e/fulfillment-process.e2e-spec.ts +++ b/packages/core/e2e/fulfillment-process.e2e-spec.ts @@ -230,13 +230,3 @@ describe('Fulfillment process', () => { }); }); }); - -export const ADMIN_TRANSITION_TO_STATE = gql` - mutation AdminTransition($id: ID!, $state: String!) { - transitionOrderToState(id: $id, state: $state) { - id - state - nextStates - } - } -`; diff --git a/packages/core/e2e/graphql/generated-e2e-admin-types.ts b/packages/core/e2e/graphql/generated-e2e-admin-types.ts index 06c92d2a57..8dbdf28b96 100644 --- a/packages/core/e2e/graphql/generated-e2e-admin-types.ts +++ b/packages/core/e2e/graphql/generated-e2e-admin-types.ts @@ -4039,204 +4039,6 @@ export type CreateCountryMutation = { __typename?: 'Mutation' } & { createCountry: { __typename?: 'Country' } & CountryFragment; }; -export type CreateAddressMutationVariables = { - id: Scalars['ID']; - input: CreateAddressInput; -}; - -export type CreateAddressMutation = { __typename?: 'Mutation' } & { - createCustomerAddress: { __typename?: 'Address' } & Pick< - Address, - | 'id' - | 'fullName' - | 'company' - | 'streetLine1' - | 'streetLine2' - | 'city' - | 'province' - | 'postalCode' - | 'phoneNumber' - | 'defaultShippingAddress' - | 'defaultBillingAddress' - > & { country: { __typename?: 'Country' } & Pick }; -}; - -export type UpdateAddressMutationVariables = { - input: UpdateAddressInput; -}; - -export type UpdateAddressMutation = { __typename?: 'Mutation' } & { - updateCustomerAddress: { __typename?: 'Address' } & Pick< - Address, - 'id' | 'defaultShippingAddress' | 'defaultBillingAddress' - > & { country: { __typename?: 'Country' } & Pick }; -}; - -export type CreateCustomerMutationVariables = { - input: CreateCustomerInput; - password?: Maybe; -}; - -export type CreateCustomerMutation = { __typename?: 'Mutation' } & { - createCustomer: { __typename?: 'Customer' } & CustomerFragment; -}; - -export type UpdateCustomerMutationVariables = { - input: UpdateCustomerInput; -}; - -export type UpdateCustomerMutation = { __typename?: 'Mutation' } & { - updateCustomer: { __typename?: 'Customer' } & CustomerFragment; -}; - -export type DeleteCustomerMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerMutation = { __typename?: 'Mutation' } & { - deleteCustomer: { __typename?: 'DeletionResponse' } & Pick; -}; - -export type UpdateCustomerNoteMutationVariables = { - input: UpdateCustomerNoteInput; -}; - -export type UpdateCustomerNoteMutation = { __typename?: 'Mutation' } & { - updateCustomerNote: { __typename?: 'HistoryEntry' } & Pick; -}; - -export type DeleteCustomerNoteMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerNoteMutation = { __typename?: 'Mutation' } & { - deleteCustomerNote: { __typename?: 'DeletionResponse' } & Pick; -}; - -export type UpdateCustomerGroupMutationVariables = { - input: UpdateCustomerGroupInput; -}; - -export type UpdateCustomerGroupMutation = { __typename?: 'Mutation' } & { - updateCustomerGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; -}; - -export type DeleteCustomerGroupMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerGroupMutation = { __typename?: 'Mutation' } & { - deleteCustomerGroup: { __typename?: 'DeletionResponse' } & Pick; -}; - -export type GetCustomerGroupsQueryVariables = { - options?: Maybe; -}; - -export type GetCustomerGroupsQuery = { __typename?: 'Query' } & { - customerGroups: { __typename?: 'CustomerGroupList' } & Pick & { - items: Array<{ __typename?: 'CustomerGroup' } & Pick>; - }; -}; - -export type GetCustomerGroupQueryVariables = { - id: Scalars['ID']; - options?: Maybe; -}; - -export type GetCustomerGroupQuery = { __typename?: 'Query' } & { - customerGroup?: Maybe< - { __typename?: 'CustomerGroup' } & Pick & { - customers: { __typename?: 'CustomerList' } & Pick & { - items: Array<{ __typename?: 'Customer' } & Pick>; - }; - } - >; -}; - -export type AddCustomersToGroupMutationVariables = { - groupId: Scalars['ID']; - customerIds: Array; -}; - -export type AddCustomersToGroupMutation = { __typename?: 'Mutation' } & { - addCustomersToGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; -}; - -export type GetCustomerWithGroupsQueryVariables = { - id: Scalars['ID']; -}; - -export type GetCustomerWithGroupsQuery = { __typename?: 'Query' } & { - customer?: Maybe< - { __typename?: 'Customer' } & Pick & { - groups: Array<{ __typename?: 'CustomerGroup' } & Pick>; - } - >; -}; - -export type UpdateCustomerGroupMutationVariables = { - input: UpdateCustomerGroupInput; -}; - -export type UpdateCustomerGroupMutation = { __typename?: 'Mutation' } & { - updateCustomerGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; -}; - -export type DeleteCustomerGroupMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerGroupMutation = { __typename?: 'Mutation' } & { - deleteCustomerGroup: { __typename?: 'DeletionResponse' } & Pick; -}; - -export type GetCustomerGroupsQueryVariables = { - options?: Maybe; -}; - -export type GetCustomerGroupsQuery = { __typename?: 'Query' } & { - customerGroups: { __typename?: 'CustomerGroupList' } & Pick & { - items: Array<{ __typename?: 'CustomerGroup' } & Pick>; - }; -}; - -export type GetCustomerGroupQueryVariables = { - id: Scalars['ID']; - options?: Maybe; -}; - -export type GetCustomerGroupQuery = { __typename?: 'Query' } & { - customerGroup?: Maybe< - { __typename?: 'CustomerGroup' } & Pick & { - customers: { __typename?: 'CustomerList' } & Pick & { - items: Array<{ __typename?: 'Customer' } & Pick>; - }; - } - >; -}; - -export type AddCustomersToGroupMutationVariables = { - groupId: Scalars['ID']; - customerIds: Array; -}; - -export type AddCustomersToGroupMutation = { __typename?: 'Mutation' } & { - addCustomersToGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; -}; - -export type GetCustomerWithGroupsQueryVariables = { - id: Scalars['ID']; -}; - -export type GetCustomerWithGroupsQuery = { __typename?: 'Query' } & { - customer?: Maybe< - { __typename?: 'Customer' } & Pick & { - groups: Array<{ __typename?: 'CustomerGroup' } & Pick>; - } - >; -}; - export type DeleteCustomerAddressMutationVariables = { id: Scalars['ID']; }; @@ -4258,39 +4060,6 @@ export type GetCustomerWithUserQuery = { __typename?: 'Query' } & { >; }; -export type CreateAddressMutationVariables = { - id: Scalars['ID']; - input: CreateAddressInput; -}; - -export type CreateAddressMutation = { __typename?: 'Mutation' } & { - createCustomerAddress: { __typename?: 'Address' } & Pick< - Address, - | 'id' - | 'fullName' - | 'company' - | 'streetLine1' - | 'streetLine2' - | 'city' - | 'province' - | 'postalCode' - | 'phoneNumber' - | 'defaultShippingAddress' - | 'defaultBillingAddress' - > & { country: { __typename?: 'Country' } & Pick }; -}; - -export type UpdateAddressMutationVariables = { - input: UpdateAddressInput; -}; - -export type UpdateAddressMutation = { __typename?: 'Mutation' } & { - updateCustomerAddress: { __typename?: 'Address' } & Pick< - Address, - 'id' | 'defaultShippingAddress' | 'defaultBillingAddress' - > & { country: { __typename?: 'Country' } & Pick }; -}; - export type GetCustomerOrdersQueryVariables = { id: Scalars['ID']; }; @@ -4305,31 +4074,6 @@ export type GetCustomerOrdersQuery = { __typename?: 'Query' } & { >; }; -export type CreateCustomerMutationVariables = { - input: CreateCustomerInput; - password?: Maybe; -}; - -export type CreateCustomerMutation = { __typename?: 'Mutation' } & { - createCustomer: { __typename?: 'Customer' } & CustomerFragment; -}; - -export type UpdateCustomerMutationVariables = { - input: UpdateCustomerInput; -}; - -export type UpdateCustomerMutation = { __typename?: 'Mutation' } & { - updateCustomer: { __typename?: 'Customer' } & CustomerFragment; -}; - -export type DeleteCustomerMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerMutation = { __typename?: 'Mutation' } & { - deleteCustomer: { __typename?: 'DeletionResponse' } & Pick; -}; - export type AddNoteToCustomerMutationVariables = { input: AddNoteToCustomerInput; }; @@ -4338,22 +4082,6 @@ export type AddNoteToCustomerMutation = { __typename?: 'Mutation' } & { addNoteToCustomer: { __typename?: 'Customer' } & CustomerFragment; }; -export type UpdateCustomerNoteMutationVariables = { - input: UpdateCustomerNoteInput; -}; - -export type UpdateCustomerNoteMutation = { __typename?: 'Mutation' } & { - updateCustomerNote: { __typename?: 'HistoryEntry' } & Pick; -}; - -export type DeleteCustomerNoteMutationVariables = { - id: Scalars['ID']; -}; - -export type DeleteCustomerNoteMutation = { __typename?: 'Mutation' } & { - deleteCustomerNote: { __typename?: 'DeletionResponse' } & Pick; -}; - export type ReindexMutationVariables = {}; export type ReindexMutation = { __typename?: 'Mutation' } & { @@ -4593,15 +4321,6 @@ export type UpdateFacetValuesMutation = { __typename?: 'Mutation' } & { updateFacetValues: Array<{ __typename?: 'FacetValue' } & FacetValueFragment>; }; -export type AdminTransitionMutationVariables = { - id: Scalars['ID']; - state: Scalars['String']; -}; - -export type AdminTransitionMutation = { __typename?: 'Mutation' } & { - transitionOrderToState?: Maybe<{ __typename?: 'Order' } & Pick>; -}; - export type AdministratorFragment = { __typename?: 'Administrator' } & Pick< Administrator, 'id' | 'firstName' | 'lastName' | 'emailAddress' @@ -5212,82 +4931,220 @@ export type GetCustomerHistoryQuery = { __typename?: 'Query' } & { >; }; -export type GetOrderQueryVariables = { +export type GetOrderQueryVariables = { + id: Scalars['ID']; +}; + +export type GetOrderQuery = { __typename?: 'Query' } & { + order?: Maybe<{ __typename?: 'Order' } & OrderWithLinesFragment>; +}; + +export type CustomerGroupFragment = { __typename?: 'CustomerGroup' } & Pick & { + customers: { __typename?: 'CustomerList' } & Pick & { + items: Array<{ __typename?: 'Customer' } & Pick>; + }; + }; + +export type CreateCustomerGroupMutationVariables = { + input: CreateCustomerGroupInput; +}; + +export type CreateCustomerGroupMutation = { __typename?: 'Mutation' } & { + createCustomerGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; +}; + +export type RemoveCustomersFromGroupMutationVariables = { + groupId: Scalars['ID']; + customerIds: Array; +}; + +export type RemoveCustomersFromGroupMutation = { __typename?: 'Mutation' } & { + removeCustomersFromGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; +}; + +export type CreateFulfillmentMutationVariables = { + input: FulfillOrderInput; +}; + +export type CreateFulfillmentMutation = { __typename?: 'Mutation' } & { + fulfillOrder: { __typename?: 'Fulfillment' } & Pick< + Fulfillment, + 'id' | 'method' | 'state' | 'trackingCode' + > & { orderItems: Array<{ __typename?: 'OrderItem' } & Pick> }; +}; + +export type TransitFulfillmentMutationVariables = { + id: Scalars['ID']; + state: Scalars['String']; +}; + +export type TransitFulfillmentMutation = { __typename?: 'Mutation' } & { + transitionFulfillmentToState: { __typename?: 'Fulfillment' } & Pick; +}; + +export type GetOrderFulfillmentsQueryVariables = { + id: Scalars['ID']; +}; + +export type GetOrderFulfillmentsQuery = { __typename?: 'Query' } & { + order?: Maybe< + { __typename?: 'Order' } & Pick & { + fulfillments?: Maybe< + Array< + { __typename?: 'Fulfillment' } & Pick< + Fulfillment, + 'id' | 'state' | 'nextStates' | 'method' + > + > + >; + } + >; +}; + +export type GetOrderListQueryVariables = { + options?: Maybe; +}; + +export type GetOrderListQuery = { __typename?: 'Query' } & { + orders: { __typename?: 'OrderList' } & Pick & { + items: Array<{ __typename?: 'Order' } & OrderFragment>; + }; +}; + +export type CreateAddressMutationVariables = { + id: Scalars['ID']; + input: CreateAddressInput; +}; + +export type CreateAddressMutation = { __typename?: 'Mutation' } & { + createCustomerAddress: { __typename?: 'Address' } & Pick< + Address, + | 'id' + | 'fullName' + | 'company' + | 'streetLine1' + | 'streetLine2' + | 'city' + | 'province' + | 'postalCode' + | 'phoneNumber' + | 'defaultShippingAddress' + | 'defaultBillingAddress' + > & { country: { __typename?: 'Country' } & Pick }; +}; + +export type UpdateAddressMutationVariables = { + input: UpdateAddressInput; +}; + +export type UpdateAddressMutation = { __typename?: 'Mutation' } & { + updateCustomerAddress: { __typename?: 'Address' } & Pick< + Address, + 'id' | 'defaultShippingAddress' | 'defaultBillingAddress' + > & { country: { __typename?: 'Country' } & Pick }; +}; + +export type CreateCustomerMutationVariables = { + input: CreateCustomerInput; + password?: Maybe; +}; + +export type CreateCustomerMutation = { __typename?: 'Mutation' } & { + createCustomer: { __typename?: 'Customer' } & CustomerFragment; +}; + +export type UpdateCustomerMutationVariables = { + input: UpdateCustomerInput; +}; + +export type UpdateCustomerMutation = { __typename?: 'Mutation' } & { + updateCustomer: { __typename?: 'Customer' } & CustomerFragment; +}; + +export type DeleteCustomerMutationVariables = { + id: Scalars['ID']; +}; + +export type DeleteCustomerMutation = { __typename?: 'Mutation' } & { + deleteCustomer: { __typename?: 'DeletionResponse' } & Pick; +}; + +export type UpdateCustomerNoteMutationVariables = { + input: UpdateCustomerNoteInput; +}; + +export type UpdateCustomerNoteMutation = { __typename?: 'Mutation' } & { + updateCustomerNote: { __typename?: 'HistoryEntry' } & Pick; +}; + +export type DeleteCustomerNoteMutationVariables = { id: Scalars['ID']; }; -export type GetOrderQuery = { __typename?: 'Query' } & { - order?: Maybe<{ __typename?: 'Order' } & OrderWithLinesFragment>; +export type DeleteCustomerNoteMutation = { __typename?: 'Mutation' } & { + deleteCustomerNote: { __typename?: 'DeletionResponse' } & Pick; }; -export type CustomerGroupFragment = { __typename?: 'CustomerGroup' } & Pick & { - customers: { __typename?: 'CustomerList' } & Pick & { - items: Array<{ __typename?: 'Customer' } & Pick>; - }; - }; - -export type CreateCustomerGroupMutationVariables = { - input: CreateCustomerGroupInput; +export type UpdateCustomerGroupMutationVariables = { + input: UpdateCustomerGroupInput; }; -export type CreateCustomerGroupMutation = { __typename?: 'Mutation' } & { - createCustomerGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; +export type UpdateCustomerGroupMutation = { __typename?: 'Mutation' } & { + updateCustomerGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; }; -export type RemoveCustomersFromGroupMutationVariables = { - groupId: Scalars['ID']; - customerIds: Array; +export type DeleteCustomerGroupMutationVariables = { + id: Scalars['ID']; }; -export type RemoveCustomersFromGroupMutation = { __typename?: 'Mutation' } & { - removeCustomersFromGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; +export type DeleteCustomerGroupMutation = { __typename?: 'Mutation' } & { + deleteCustomerGroup: { __typename?: 'DeletionResponse' } & Pick; }; -export type CreateFulfillmentMutationVariables = { - input: FulfillOrderInput; +export type GetCustomerGroupsQueryVariables = { + options?: Maybe; }; -export type CreateFulfillmentMutation = { __typename?: 'Mutation' } & { - fulfillOrder: { __typename?: 'Fulfillment' } & Pick< - Fulfillment, - 'id' | 'method' | 'state' | 'trackingCode' - > & { orderItems: Array<{ __typename?: 'OrderItem' } & Pick> }; +export type GetCustomerGroupsQuery = { __typename?: 'Query' } & { + customerGroups: { __typename?: 'CustomerGroupList' } & Pick & { + items: Array<{ __typename?: 'CustomerGroup' } & Pick>; + }; }; -export type TransitFulfillmentMutationVariables = { +export type GetCustomerGroupQueryVariables = { id: Scalars['ID']; - state: Scalars['String']; + options?: Maybe; }; -export type TransitFulfillmentMutation = { __typename?: 'Mutation' } & { - transitionFulfillmentToState: { __typename?: 'Fulfillment' } & Pick; +export type GetCustomerGroupQuery = { __typename?: 'Query' } & { + customerGroup?: Maybe< + { __typename?: 'CustomerGroup' } & Pick & { + customers: { __typename?: 'CustomerList' } & Pick & { + items: Array<{ __typename?: 'Customer' } & Pick>; + }; + } + >; }; -export type GetOrderFulfillmentsQueryVariables = { - id: Scalars['ID']; +export type AddCustomersToGroupMutationVariables = { + groupId: Scalars['ID']; + customerIds: Array; }; -export type GetOrderFulfillmentsQuery = { __typename?: 'Query' } & { - order?: Maybe< - { __typename?: 'Order' } & Pick & { - fulfillments?: Maybe< - Array< - { __typename?: 'Fulfillment' } & Pick< - Fulfillment, - 'id' | 'state' | 'nextStates' | 'method' - > - > - >; - } - >; +export type AddCustomersToGroupMutation = { __typename?: 'Mutation' } & { + addCustomersToGroup: { __typename?: 'CustomerGroup' } & CustomerGroupFragment; }; -export type UpdateOptionGroupMutationVariables = { - input: UpdateProductOptionGroupInput; +export type GetCustomerWithGroupsQueryVariables = { + id: Scalars['ID']; }; -export type UpdateOptionGroupMutation = { __typename?: 'Mutation' } & { - updateProductOptionGroup: { __typename?: 'ProductOptionGroup' } & Pick; +export type GetCustomerWithGroupsQuery = { __typename?: 'Query' } & { + customer?: Maybe< + { __typename?: 'Customer' } & Pick & { + groups: Array<{ __typename?: 'CustomerGroup' } & Pick>; + } + >; }; export type AdminTransitionMutationVariables = { @@ -5299,6 +5156,14 @@ export type AdminTransitionMutation = { __typename?: 'Mutation' } & { transitionOrderToState?: Maybe<{ __typename?: 'Order' } & Pick>; }; +export type UpdateOptionGroupMutationVariables = { + input: UpdateProductOptionGroupInput; +}; + +export type UpdateOptionGroupMutation = { __typename?: 'Mutation' } & { + updateProductOptionGroup: { __typename?: 'ProductOptionGroup' } & Pick; +}; + export type DeletePromotionAdHoc1MutationVariables = {}; export type DeletePromotionAdHoc1Mutation = { __typename?: 'Mutation' } & { @@ -5326,16 +5191,6 @@ export type GetPromoProductsQuery = { __typename?: 'Query' } & { }; }; -export type GetOrderListQueryVariables = { - options?: Maybe; -}; - -export type GetOrderListQuery = { __typename?: 'Query' } & { - orders: { __typename?: 'OrderList' } & Pick & { - items: Array<{ __typename?: 'Order' } & OrderFragment>; - }; -}; - export type SettlePaymentMutationVariables = { id: Scalars['ID']; }; @@ -6197,212 +6052,84 @@ export namespace GetCollectionProducts { NonNullable['productVariants']['items'][0] >; export type FacetValues = NonNullable< - NonNullable< - NonNullable['productVariants']['items'][0] - >['facetValues'][0] - >; -} - -export namespace CreateCollectionSelectVariants { - export type Variables = CreateCollectionSelectVariantsMutationVariables; - export type Mutation = CreateCollectionSelectVariantsMutation; - export type CreateCollection = CreateCollectionSelectVariantsMutation['createCollection']; - export type ProductVariants = CreateCollectionSelectVariantsMutation['createCollection']['productVariants']; - export type Items = NonNullable< - CreateCollectionSelectVariantsMutation['createCollection']['productVariants']['items'][0] - >; -} - -export namespace GetCollectionBreadcrumbs { - export type Variables = GetCollectionBreadcrumbsQueryVariables; - export type Query = GetCollectionBreadcrumbsQuery; - export type Collection = NonNullable; - export type Breadcrumbs = NonNullable< - NonNullable['breadcrumbs'][0] - >; -} - -export namespace GetCollectionsForProducts { - export type Variables = GetCollectionsForProductsQueryVariables; - export type Query = GetCollectionsForProductsQuery; - export type Products = GetCollectionsForProductsQuery['products']; - export type Items = NonNullable; - export type Collections = NonNullable< - NonNullable['collections'][0] - >; -} - -export namespace DeleteCollection { - export type Variables = DeleteCollectionMutationVariables; - export type Mutation = DeleteCollectionMutation; - export type DeleteCollection = DeleteCollectionMutation['deleteCollection']; -} - -export namespace GetProductCollections { - export type Variables = GetProductCollectionsQueryVariables; - export type Query = GetProductCollectionsQuery; - export type Product = NonNullable; - export type Collections = NonNullable< - NonNullable['collections'][0] - >; -} - -export namespace GetProductCollectionsWithParent { - export type Variables = GetProductCollectionsWithParentQueryVariables; - export type Query = GetProductCollectionsWithParentQuery; - export type Product = NonNullable; - export type Collections = NonNullable< - NonNullable['collections'][0] - >; - export type Parent = NonNullable< - NonNullable['collections'][0]>['parent'] - >; -} - -export namespace DeleteCountry { - export type Variables = DeleteCountryMutationVariables; - export type Mutation = DeleteCountryMutation; - export type DeleteCountry = DeleteCountryMutation['deleteCountry']; -} - -export namespace GetCountry { - export type Variables = GetCountryQueryVariables; - export type Query = GetCountryQuery; - export type Country = CountryFragment; -} - -export namespace CreateCountry { - export type Variables = CreateCountryMutationVariables; - export type Mutation = CreateCountryMutation; - export type CreateCountry = CountryFragment; -} - -export namespace CreateAddress { - export type Variables = CreateAddressMutationVariables; - export type Mutation = CreateAddressMutation; - export type CreateCustomerAddress = CreateAddressMutation['createCustomerAddress']; - export type Country = CreateAddressMutation['createCustomerAddress']['country']; -} - -export namespace UpdateAddress { - export type Variables = UpdateAddressMutationVariables; - export type Mutation = UpdateAddressMutation; - export type UpdateCustomerAddress = UpdateAddressMutation['updateCustomerAddress']; - export type Country = UpdateAddressMutation['updateCustomerAddress']['country']; -} - -export namespace CreateCustomer { - export type Variables = CreateCustomerMutationVariables; - export type Mutation = CreateCustomerMutation; - export type CreateCustomer = CustomerFragment; -} - -export namespace UpdateCustomer { - export type Variables = UpdateCustomerMutationVariables; - export type Mutation = UpdateCustomerMutation; - export type UpdateCustomer = CustomerFragment; -} - -export namespace DeleteCustomer { - export type Variables = DeleteCustomerMutationVariables; - export type Mutation = DeleteCustomerMutation; - export type DeleteCustomer = DeleteCustomerMutation['deleteCustomer']; -} - -export namespace UpdateCustomerNote { - export type Variables = UpdateCustomerNoteMutationVariables; - export type Mutation = UpdateCustomerNoteMutation; - export type UpdateCustomerNote = UpdateCustomerNoteMutation['updateCustomerNote']; -} - -export namespace DeleteCustomerNote { - export type Variables = DeleteCustomerNoteMutationVariables; - export type Mutation = DeleteCustomerNoteMutation; - export type DeleteCustomerNote = DeleteCustomerNoteMutation['deleteCustomerNote']; -} - -export namespace UpdateCustomerGroup { - export type Variables = UpdateCustomerGroupMutationVariables; - export type Mutation = UpdateCustomerGroupMutation; - export type UpdateCustomerGroup = CustomerGroupFragment; -} - -export namespace DeleteCustomerGroup { - export type Variables = DeleteCustomerGroupMutationVariables; - export type Mutation = DeleteCustomerGroupMutation; - export type DeleteCustomerGroup = DeleteCustomerGroupMutation['deleteCustomerGroup']; -} - -export namespace GetCustomerGroups { - export type Variables = GetCustomerGroupsQueryVariables; - export type Query = GetCustomerGroupsQuery; - export type CustomerGroups = GetCustomerGroupsQuery['customerGroups']; - export type Items = NonNullable; -} - -export namespace GetCustomerGroup { - export type Variables = GetCustomerGroupQueryVariables; - export type Query = GetCustomerGroupQuery; - export type CustomerGroup = NonNullable; - export type Customers = NonNullable['customers']; - export type Items = NonNullable< - NonNullable['customers']['items'][0] + NonNullable< + NonNullable['productVariants']['items'][0] + >['facetValues'][0] >; } -export namespace AddCustomersToGroup { - export type Variables = AddCustomersToGroupMutationVariables; - export type Mutation = AddCustomersToGroupMutation; - export type AddCustomersToGroup = CustomerGroupFragment; +export namespace CreateCollectionSelectVariants { + export type Variables = CreateCollectionSelectVariantsMutationVariables; + export type Mutation = CreateCollectionSelectVariantsMutation; + export type CreateCollection = CreateCollectionSelectVariantsMutation['createCollection']; + export type ProductVariants = CreateCollectionSelectVariantsMutation['createCollection']['productVariants']; + export type Items = NonNullable< + CreateCollectionSelectVariantsMutation['createCollection']['productVariants']['items'][0] + >; } -export namespace GetCustomerWithGroups { - export type Variables = GetCustomerWithGroupsQueryVariables; - export type Query = GetCustomerWithGroupsQuery; - export type Customer = NonNullable; - export type Groups = NonNullable['groups'][0]>; +export namespace GetCollectionBreadcrumbs { + export type Variables = GetCollectionBreadcrumbsQueryVariables; + export type Query = GetCollectionBreadcrumbsQuery; + export type Collection = NonNullable; + export type Breadcrumbs = NonNullable< + NonNullable['breadcrumbs'][0] + >; } -export namespace UpdateCustomerGroup { - export type Variables = UpdateCustomerGroupMutationVariables; - export type Mutation = UpdateCustomerGroupMutation; - export type UpdateCustomerGroup = CustomerGroupFragment; +export namespace GetCollectionsForProducts { + export type Variables = GetCollectionsForProductsQueryVariables; + export type Query = GetCollectionsForProductsQuery; + export type Products = GetCollectionsForProductsQuery['products']; + export type Items = NonNullable; + export type Collections = NonNullable< + NonNullable['collections'][0] + >; } -export namespace DeleteCustomerGroup { - export type Variables = DeleteCustomerGroupMutationVariables; - export type Mutation = DeleteCustomerGroupMutation; - export type DeleteCustomerGroup = DeleteCustomerGroupMutation['deleteCustomerGroup']; +export namespace DeleteCollection { + export type Variables = DeleteCollectionMutationVariables; + export type Mutation = DeleteCollectionMutation; + export type DeleteCollection = DeleteCollectionMutation['deleteCollection']; } -export namespace GetCustomerGroups { - export type Variables = GetCustomerGroupsQueryVariables; - export type Query = GetCustomerGroupsQuery; - export type CustomerGroups = GetCustomerGroupsQuery['customerGroups']; - export type Items = NonNullable; +export namespace GetProductCollections { + export type Variables = GetProductCollectionsQueryVariables; + export type Query = GetProductCollectionsQuery; + export type Product = NonNullable; + export type Collections = NonNullable< + NonNullable['collections'][0] + >; } -export namespace GetCustomerGroup { - export type Variables = GetCustomerGroupQueryVariables; - export type Query = GetCustomerGroupQuery; - export type CustomerGroup = NonNullable; - export type Customers = NonNullable['customers']; - export type Items = NonNullable< - NonNullable['customers']['items'][0] +export namespace GetProductCollectionsWithParent { + export type Variables = GetProductCollectionsWithParentQueryVariables; + export type Query = GetProductCollectionsWithParentQuery; + export type Product = NonNullable; + export type Collections = NonNullable< + NonNullable['collections'][0] + >; + export type Parent = NonNullable< + NonNullable['collections'][0]>['parent'] >; } -export namespace AddCustomersToGroup { - export type Variables = AddCustomersToGroupMutationVariables; - export type Mutation = AddCustomersToGroupMutation; - export type AddCustomersToGroup = CustomerGroupFragment; +export namespace DeleteCountry { + export type Variables = DeleteCountryMutationVariables; + export type Mutation = DeleteCountryMutation; + export type DeleteCountry = DeleteCountryMutation['deleteCountry']; } -export namespace GetCustomerWithGroups { - export type Variables = GetCustomerWithGroupsQueryVariables; - export type Query = GetCustomerWithGroupsQuery; - export type Customer = NonNullable; - export type Groups = NonNullable['groups'][0]>; +export namespace GetCountry { + export type Variables = GetCountryQueryVariables; + export type Query = GetCountryQuery; + export type Country = CountryFragment; +} + +export namespace CreateCountry { + export type Variables = CreateCountryMutationVariables; + export type Mutation = CreateCountryMutation; + export type CreateCountry = CountryFragment; } export namespace DeleteCustomerAddress { @@ -6417,20 +6144,6 @@ export namespace GetCustomerWithUser { export type User = NonNullable['user']>; } -export namespace CreateAddress { - export type Variables = CreateAddressMutationVariables; - export type Mutation = CreateAddressMutation; - export type CreateCustomerAddress = CreateAddressMutation['createCustomerAddress']; - export type Country = CreateAddressMutation['createCustomerAddress']['country']; -} - -export namespace UpdateAddress { - export type Variables = UpdateAddressMutationVariables; - export type Mutation = UpdateAddressMutation; - export type UpdateCustomerAddress = UpdateAddressMutation['updateCustomerAddress']; - export type Country = UpdateAddressMutation['updateCustomerAddress']['country']; -} - export namespace GetCustomerOrders { export type Variables = GetCustomerOrdersQueryVariables; export type Query = GetCustomerOrdersQuery; @@ -6439,42 +6152,12 @@ export namespace GetCustomerOrders { export type Items = NonNullable['orders']['items'][0]>; } -export namespace CreateCustomer { - export type Variables = CreateCustomerMutationVariables; - export type Mutation = CreateCustomerMutation; - export type CreateCustomer = CustomerFragment; -} - -export namespace UpdateCustomer { - export type Variables = UpdateCustomerMutationVariables; - export type Mutation = UpdateCustomerMutation; - export type UpdateCustomer = CustomerFragment; -} - -export namespace DeleteCustomer { - export type Variables = DeleteCustomerMutationVariables; - export type Mutation = DeleteCustomerMutation; - export type DeleteCustomer = DeleteCustomerMutation['deleteCustomer']; -} - export namespace AddNoteToCustomer { export type Variables = AddNoteToCustomerMutationVariables; export type Mutation = AddNoteToCustomerMutation; export type AddNoteToCustomer = CustomerFragment; } -export namespace UpdateCustomerNote { - export type Variables = UpdateCustomerNoteMutationVariables; - export type Mutation = UpdateCustomerNoteMutation; - export type UpdateCustomerNote = UpdateCustomerNoteMutation['updateCustomerNote']; -} - -export namespace DeleteCustomerNote { - export type Variables = DeleteCustomerNoteMutationVariables; - export type Mutation = DeleteCustomerNoteMutation; - export type DeleteCustomerNote = DeleteCustomerNoteMutation['deleteCustomerNote']; -} - export namespace Reindex { export type Variables = ReindexMutationVariables; export type Mutation = ReindexMutation; @@ -6650,12 +6333,6 @@ export namespace UpdateFacetValues { export type UpdateFacetValues = FacetValueFragment; } -export namespace AdminTransition { - export type Variables = AdminTransitionMutationVariables; - export type Mutation = AdminTransitionMutation; - export type TransitionOrderToState = NonNullable; -} - export namespace Administrator { export type Fragment = AdministratorFragment; export type User = AdministratorFragment['user']; @@ -7076,10 +6753,97 @@ export namespace GetOrderFulfillments { >; } -export namespace UpdateOptionGroup { - export type Variables = UpdateOptionGroupMutationVariables; - export type Mutation = UpdateOptionGroupMutation; - export type UpdateProductOptionGroup = UpdateOptionGroupMutation['updateProductOptionGroup']; +export namespace GetOrderList { + export type Variables = GetOrderListQueryVariables; + export type Query = GetOrderListQuery; + export type Orders = GetOrderListQuery['orders']; + export type Items = OrderFragment; +} + +export namespace CreateAddress { + export type Variables = CreateAddressMutationVariables; + export type Mutation = CreateAddressMutation; + export type CreateCustomerAddress = CreateAddressMutation['createCustomerAddress']; + export type Country = CreateAddressMutation['createCustomerAddress']['country']; +} + +export namespace UpdateAddress { + export type Variables = UpdateAddressMutationVariables; + export type Mutation = UpdateAddressMutation; + export type UpdateCustomerAddress = UpdateAddressMutation['updateCustomerAddress']; + export type Country = UpdateAddressMutation['updateCustomerAddress']['country']; +} + +export namespace CreateCustomer { + export type Variables = CreateCustomerMutationVariables; + export type Mutation = CreateCustomerMutation; + export type CreateCustomer = CustomerFragment; +} + +export namespace UpdateCustomer { + export type Variables = UpdateCustomerMutationVariables; + export type Mutation = UpdateCustomerMutation; + export type UpdateCustomer = CustomerFragment; +} + +export namespace DeleteCustomer { + export type Variables = DeleteCustomerMutationVariables; + export type Mutation = DeleteCustomerMutation; + export type DeleteCustomer = DeleteCustomerMutation['deleteCustomer']; +} + +export namespace UpdateCustomerNote { + export type Variables = UpdateCustomerNoteMutationVariables; + export type Mutation = UpdateCustomerNoteMutation; + export type UpdateCustomerNote = UpdateCustomerNoteMutation['updateCustomerNote']; +} + +export namespace DeleteCustomerNote { + export type Variables = DeleteCustomerNoteMutationVariables; + export type Mutation = DeleteCustomerNoteMutation; + export type DeleteCustomerNote = DeleteCustomerNoteMutation['deleteCustomerNote']; +} + +export namespace UpdateCustomerGroup { + export type Variables = UpdateCustomerGroupMutationVariables; + export type Mutation = UpdateCustomerGroupMutation; + export type UpdateCustomerGroup = CustomerGroupFragment; +} + +export namespace DeleteCustomerGroup { + export type Variables = DeleteCustomerGroupMutationVariables; + export type Mutation = DeleteCustomerGroupMutation; + export type DeleteCustomerGroup = DeleteCustomerGroupMutation['deleteCustomerGroup']; +} + +export namespace GetCustomerGroups { + export type Variables = GetCustomerGroupsQueryVariables; + export type Query = GetCustomerGroupsQuery; + export type CustomerGroups = GetCustomerGroupsQuery['customerGroups']; + export type Items = NonNullable; +} + +export namespace GetCustomerGroup { + export type Variables = GetCustomerGroupQueryVariables; + export type Query = GetCustomerGroupQuery; + export type CustomerGroup = NonNullable; + export type Customers = NonNullable['customers']; + export type Items = NonNullable< + NonNullable['customers']['items'][0] + >; +} + +export namespace AddCustomersToGroup { + export type Variables = AddCustomersToGroupMutationVariables; + export type Mutation = AddCustomersToGroupMutation; + export type AddCustomersToGroup = CustomerGroupFragment; +} + +export namespace GetCustomerWithGroups { + export type Variables = GetCustomerWithGroupsQueryVariables; + export type Query = GetCustomerWithGroupsQuery; + export type Customer = NonNullable; + export type Groups = NonNullable['groups'][0]>; } export namespace AdminTransition { @@ -7088,6 +6852,12 @@ export namespace AdminTransition { export type TransitionOrderToState = NonNullable; } +export namespace UpdateOptionGroup { + export type Variables = UpdateOptionGroupMutationVariables; + export type Mutation = UpdateOptionGroupMutation; + export type UpdateProductOptionGroup = UpdateOptionGroupMutation['updateProductOptionGroup']; +} + export namespace DeletePromotionAdHoc1 { export type Variables = DeletePromotionAdHoc1MutationVariables; export type Mutation = DeletePromotionAdHoc1Mutation; @@ -7109,13 +6879,6 @@ export namespace GetPromoProducts { >; } -export namespace GetOrderList { - export type Variables = GetOrderListQueryVariables; - export type Query = GetOrderListQuery; - export type Orders = GetOrderListQuery['orders']; - export type Items = OrderFragment; -} - export namespace SettlePayment { export type Variables = SettlePaymentMutationVariables; export type Mutation = SettlePaymentMutation; diff --git a/packages/core/e2e/graphql/shared-definitions.ts b/packages/core/e2e/graphql/shared-definitions.ts index d71f23ca19..0f5b368eeb 100644 --- a/packages/core/e2e/graphql/shared-definitions.ts +++ b/packages/core/e2e/graphql/shared-definitions.ts @@ -487,3 +487,160 @@ export const GET_ORDERS_LIST = gql` } ${ORDER_FRAGMENT} `; + +export const CREATE_ADDRESS = gql` + mutation CreateAddress($id: ID!, $input: CreateAddressInput!) { + createCustomerAddress(customerId: $id, input: $input) { + id + fullName + company + streetLine1 + streetLine2 + city + province + postalCode + country { + code + name + } + phoneNumber + defaultShippingAddress + defaultBillingAddress + } + } +`; + +export const UPDATE_ADDRESS = gql` + mutation UpdateAddress($input: UpdateAddressInput!) { + updateCustomerAddress(input: $input) { + id + defaultShippingAddress + defaultBillingAddress + country { + code + name + } + } + } +`; + +export const CREATE_CUSTOMER = gql` + mutation CreateCustomer($input: CreateCustomerInput!, $password: String) { + createCustomer(input: $input, password: $password) { + ...Customer + } + } + ${CUSTOMER_FRAGMENT} +`; + +export const UPDATE_CUSTOMER = gql` + mutation UpdateCustomer($input: UpdateCustomerInput!) { + updateCustomer(input: $input) { + ...Customer + } + } + ${CUSTOMER_FRAGMENT} +`; + +export const DELETE_CUSTOMER = gql` + mutation DeleteCustomer($id: ID!) { + deleteCustomer(id: $id) { + result + } + } +`; + +export const UPDATE_CUSTOMER_NOTE = gql` + mutation UpdateCustomerNote($input: UpdateCustomerNoteInput!) { + updateCustomerNote(input: $input) { + id + data + isPublic + } + } +`; + +export const DELETE_CUSTOMER_NOTE = gql` + mutation DeleteCustomerNote($id: ID!) { + deleteCustomerNote(id: $id) { + result + message + } + } +`; + +export const UPDATE_CUSTOMER_GROUP = gql` + mutation UpdateCustomerGroup($input: UpdateCustomerGroupInput!) { + updateCustomerGroup(input: $input) { + ...CustomerGroup + } + } + ${CUSTOMER_GROUP_FRAGMENT} +`; + +export const DELETE_CUSTOMER_GROUP = gql` + mutation DeleteCustomerGroup($id: ID!) { + deleteCustomerGroup(id: $id) { + result + message + } + } +`; + +export const GET_CUSTOMER_GROUPS = gql` + query GetCustomerGroups($options: CustomerGroupListOptions) { + customerGroups(options: $options) { + items { + id + name + } + totalItems + } + } +`; + +export const GET_CUSTOMER_GROUP = gql` + query GetCustomerGroup($id: ID!, $options: CustomerListOptions) { + customerGroup(id: $id) { + id + name + customers(options: $options) { + items { + id + } + totalItems + } + } + } +`; + +export const ADD_CUSTOMERS_TO_GROUP = gql` + mutation AddCustomersToGroup($groupId: ID!, $customerIds: [ID!]!) { + addCustomersToGroup(customerGroupId: $groupId, customerIds: $customerIds) { + ...CustomerGroup + } + } + ${CUSTOMER_GROUP_FRAGMENT} +`; + +export const GET_CUSTOMER_WITH_GROUPS = gql` + query GetCustomerWithGroups($id: ID!) { + customer(id: $id) { + id + groups { + id + name + } + } + } +`; + +export const ADMIN_TRANSITION_TO_STATE = gql` + mutation AdminTransition($id: ID!, $state: String!) { + transitionOrderToState(id: $id, state: $state) { + id + state + nextStates + } + } +`; diff --git a/packages/core/e2e/order-process.e2e-spec.ts b/packages/core/e2e/order-process.e2e-spec.ts index f8c6f48b71..f28cef2ed3 100644 --- a/packages/core/e2e/order-process.e2e-spec.ts +++ b/packages/core/e2e/order-process.e2e-spec.ts @@ -1,7 +1,6 @@ /* tslint:disable:no-non-null-assertion */ import { CustomOrderProcess, mergeConfig, OrderState } from '@vendure/core'; import { createTestEnvironment } from '@vendure/testing'; -import gql from 'graphql-tag'; import path from 'path'; import { initialData } from '../../../e2e-common/e2e-initial-data'; @@ -18,7 +17,7 @@ import { SetShippingMethod, TransitionToState, } from './graphql/generated-e2e-shop-types'; -import { GET_ORDER } from './graphql/shared-definitions'; +import { ADMIN_TRANSITION_TO_STATE, GET_ORDER } from './graphql/shared-definitions'; import { ADD_ITEM_TO_ORDER, ADD_PAYMENT, @@ -400,13 +399,3 @@ describe('Order process', () => { }); }); }); - -export const ADMIN_TRANSITION_TO_STATE = gql` - mutation AdminTransition($id: ID!, $state: String!) { - transitionOrderToState(id: $id, state: $state) { - id - state - nextStates - } - } -`;