import { FetchResult } from "@apollo/client/core"; import { CustomQuery, GenerateCustomerTokenMutation } from "@vue-storefront/magento-types"; import type { CustomHeaders } from "@vue-storefront/magento-types"; import { Context } from "../../types/context"; /** * Generate customer token * * @example * Simple usage: * ```ts * import { sdk } from '~/sdk.config.ts'; * * // fetch token * const result = await sdk.magento.generateCustomerToken({ * email: 'some-email', * password: 'some-password' * }); * * // Token is now available in result.data.generateCustomerToken.token * ``` * * * @example * Creating a custom GraphQL query to fetch additional data: * * ```ts * module.exports = { * integrations: { * magento: { * customQueries: { * 'generate-customer-token-custom-query': ({ variables, metadata }) => ({ * variables, * query: ` * mutation generateCustomerToken($email: String!, $password: String!) { * generateCustomerToken(email: $email, password: $password) { * ${metadata.fields} * } * } * }` * }), * }, * } * } * }; * ``` * * @example * Using a custom GraphQL query created in the previous example. * * ```ts * import { sdk } from '~/sdk.config.ts'; * * // reduce the amount of fields returned by the query, when compared to the default query * const customQuery = { * route: 'generate-customer-token-custom-query', * metadata: { * fields: 'token additional_field' * } * }; * * // data will contain only the fields specified in the custom query. * const result = await sdk.magento.generateCustomerToken({ * email: 'some-email', * password: 'some-password' * }, customQuery); * ``` */ export declare function generateCustomerToken(context: Context, params: { email: string; password: string; recaptchaToken: string; }, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise>; //# sourceMappingURL=index.d.ts.map