import { GraphQLResponseOptions, GraphQLVariables } from './graphql.js'; import { AdminSession } from '../session.js'; import { RequestModeInput } from '../http.js'; import { Variables } from 'graphql-request'; import { TypedDocumentNode } from '@graphql-typed-document-node/core'; /** * Executes a GraphQL query against the Admin API. * * @param query - GraphQL query to execute. * @param session - Shopify admin session including token and Store FQDN. * @param variables - GraphQL variables to pass to the query. * @returns The response of the query of generic type . */ export declare function adminRequest(query: string, session: AdminSession, variables?: GraphQLVariables): Promise; export interface AdminRequestOptions { /** GraphQL query to execute. */ query: TypedDocumentNode; /** Shopify admin session including token and Store FQDN. */ session: AdminSession; /** GraphQL variables to pass to the query. */ variables?: TVariables; /** API version. */ version?: string; /** Control how API responses will be handled. */ responseOptions?: GraphQLResponseOptions; /** Custom request behaviour for retries and timeouts. */ preferredBehaviour?: RequestModeInput; } /** * Executes a GraphQL query against the Admin API. Uses typed documents. * * @param options - Admin request options. * @returns The response of the query of generic type . */ export declare function adminRequestDoc(options: AdminRequestOptions): Promise; /** * GraphQL query to retrieve all supported API versions. * * @param session - Shopify admin session including token and Store FQDN. * @param preferredBehaviour - Custom request behaviour for retries and timeouts. * @returns - An array of supported API versions. */ export declare function supportedApiVersions(session: AdminSession, preferredBehaviour?: RequestModeInput): Promise; /** * GraphQL query to retrieve all API versions. * * @param session - Shopify admin session including token and Store FQDN. * @param preferredBehaviour - Custom request behaviour for retries and timeouts. * @returns - An array of supported and unsupported API versions. */ export declare function fetchApiVersions(session: AdminSession, preferredBehaviour?: RequestModeInput): Promise; /** * Returns the Admin API URL for the given store and version. * * @param store - Store FQDN. * @param version - API version. * @param session - User session. * @returns - Admin API URL. */ export declare function adminUrl(store: string, version: string | undefined, session?: AdminSession): string; interface ApiVersion { handle: string; supported: boolean; } /** * Executes a REST request against the Admin API. * * @param method - Request's HTTP method. * @param path - Path of the REST resource. * @param session - Shopify Admin session including token and Store FQDN. * @param requestBody - Request body of including REST resource specific parameters. * @param searchParams - Search params, appended to the URL. * @param apiVersion - Admin API version. * @returns - The {@link RestResponse}. */ export declare function restRequest(method: string, path: string, session: AdminSession, requestBody?: T, searchParams?: Record, apiVersion?: string): Promise; /** * Respose of a REST request. */ export interface RestResponse { /** * REST JSON respose. */ json: any; /** * HTTP response status. */ status: number; /** * HTTP response headers. */ headers: Record; } export {};