From 04caeff9c513ac0d59e65051953cb96d8cdd9b0a Mon Sep 17 00:00:00 2001 From: Alex Batalov Date: Tue, 6 Aug 2024 03:17:45 +0400 Subject: [PATCH] chore: apply `@ianvs/prettier-plugin-sort-imports` to files --- packages/cli/eslint.config.js | 1 - packages/cli/src/bin.spec.ts | 1 - packages/cli/src/bin.ts | 6 ++---- .../openapi-typescript-plugin/eslint.config.js | 1 - .../src/generateSchemaTypes.ts | 11 +++-------- .../src/lib/createOpenapiTypesImportPath.test.ts | 1 - .../openapi-typescript-plugin/src/plugin.test.ts | 2 -- packages/openapi-typescript-plugin/src/plugin.ts | 2 -- packages/plugin/eslint.config.js | 1 - packages/plugin/src/lib/QraftCommand.test.ts | 3 +-- packages/plugin/src/lib/QraftCommand.ts | 11 ++++++----- .../plugin/src/lib/filterDocumentPaths.spec.ts | 3 +-- packages/plugin/src/lib/filterDocumentPaths.ts | 1 - packages/plugin/src/lib/handleSchemaInput.ts | 2 +- .../src/lib/open-api/getOperationName.spec.ts | 3 +-- .../src/lib/open-api/getServiceName.spec.ts | 1 - .../open-api/getServiceNamesByEndpoint.spec.ts | 1 - .../getServiceNamesByOperationTags.spec.ts | 1 - .../plugin/src/lib/open-api/getServices.spec.ts | 2 -- packages/plugin/src/lib/open-api/getServices.ts | 3 +-- packages/plugin/src/lib/open-api/readSchema.ts | 3 +-- .../src/lib/predefineSchemaParameters.test.ts | 4 +--- .../plugin/src/lib/predefineSchemaParameters.ts | 3 +-- packages/plugin/src/lib/writeGeneratorFiles.ts | 3 +-- packages/react-client/eslint.config.js | 1 - packages/react-client/rollup.config.mjs | 1 - packages/react-client/src/QraftContext.ts | 4 +--- packages/react-client/src/ServiceOperation.ts | 3 +-- .../src/Unstable_QraftSecureRequestFn.ts | 14 ++++---------- .../react-client/src/callbacks/cancelQueries.ts | 2 +- .../src/callbacks/fetchInfiniteQuery.ts | 2 +- packages/react-client/src/callbacks/fetchQuery.ts | 2 +- .../src/callbacks/getInfiniteQueryData.ts | 3 +-- .../src/callbacks/getInfiniteQueryKey.ts | 2 +- .../src/callbacks/getInfiniteQueryState.ts | 2 +- .../react-client/src/callbacks/getMutationKey.ts | 2 +- .../react-client/src/callbacks/getQueriesData.ts | 2 +- .../react-client/src/callbacks/getQueryData.ts | 2 +- .../react-client/src/callbacks/getQueryKey.ts | 2 +- .../react-client/src/callbacks/getQueryState.ts | 2 +- .../src/callbacks/invalidateQueries.ts | 2 +- packages/react-client/src/callbacks/isFetching.ts | 2 +- packages/react-client/src/callbacks/isMutating.ts | 2 +- .../src/callbacks/prefetchInfiniteQuery.ts | 2 +- .../react-client/src/callbacks/prefetchQuery.ts | 2 +- .../react-client/src/callbacks/refetchQueries.ts | 2 +- .../react-client/src/callbacks/removeQueries.ts | 2 +- .../react-client/src/callbacks/resetQueries.ts | 2 +- .../src/callbacks/setInfiniteQueryData.ts | 5 ++--- .../react-client/src/callbacks/setQueriesData.ts | 2 +- .../react-client/src/callbacks/setQueryData.ts | 2 +- .../src/callbacks/useInfiniteQuery.ts | 9 +++------ .../react-client/src/callbacks/useIsFetching.ts | 7 +++---- .../react-client/src/callbacks/useIsMutating.ts | 7 +++---- .../react-client/src/callbacks/useMutation.ts | 12 +++++------- .../src/callbacks/useMutationState.ts | 5 ++--- packages/react-client/src/callbacks/useQueries.ts | 8 +++----- packages/react-client/src/callbacks/useQuery.ts | 9 +++------ .../src/callbacks/useSuspenseInfiniteQuery.ts | 9 +++------ .../src/callbacks/useSuspenseQueries.ts | 8 +++----- .../src/callbacks/useSuspenseQuery.ts | 9 +++------ .../src/lib/callQueryClientFetchMethod.ts | 3 +-- .../callQueryClientMethodWithMutationFilters.ts | 3 +-- .../lib/callQueryClientMethodWithQueryFilters.ts | 3 +-- .../src/lib/callQueryClientMethodWithQueryKey.ts | 3 +-- .../src/lib/composeInfiniteQueryKey.ts | 2 +- .../src/lib/composeMutationFilters.ts | 2 +- .../react-client/src/lib/composeQueryFilters.ts | 2 +- packages/react-client/src/lib/composeQueryKey.ts | 2 +- .../react-client/src/lib/jwt-decode/index.test.ts | 5 ++--- .../src/lib/useComposeUseQueryOptions.ts | 8 +++----- packages/react-client/src/lib/useQueryClient.ts | 6 ++---- packages/react-client/src/qraftAPIClient.ts | 3 +-- .../service-operation/OperationInfiniteData.ts | 1 - .../src/service-operation/QueryFilters.ts | 1 - .../src/service-operation/ServiceOperation.ts | 1 - .../ServiceOperationCancelQueries.ts | 1 - .../ServiceOperationFetchInfiniteQuery.ts | 1 - .../ServiceOperationFetchQuery.ts | 1 - .../ServiceOperationGetInfiniteQueryData.ts | 1 - .../ServiceOperationGetQueriesData.ts | 1 - .../ServiceOperationGetQueryData.ts | 1 - .../ServiceOperationGetQueryState.ts | 1 - .../ServiceOperationInvalidateQueries.ts | 1 - .../ServiceOperationIsFetchingQueries.ts | 1 - .../ServiceOperationIsMutatingQueries.ts | 1 - .../ServiceOperationRefetchQueries.ts | 1 - .../ServiceOperationRemoveQueries.ts | 1 - .../ServiceOperationResetQueries.ts | 1 - .../ServiceOperationSetInfiniteQueryData.ts | 1 - .../ServiceOperationSetQueriesData.ts | 1 - .../ServiceOperationSetQueryData.ts | 1 - .../ServiceOperationUseInfiniteQuery.ts | 1 - .../ServiceOperationUseIsFetchingQueries.ts | 1 - .../ServiceOperationUseIsMutating.ts | 1 - .../ServiceOperationUseMutation.ts | 1 - .../ServiceOperationUseMutationState.ts | 1 - .../ServiceOperationUseQueries.ts | 5 ++--- .../service-operation/ServiceOperationUseQuery.ts | 3 +-- .../ServiceOperationUseSuspenseInfiniteQuery.ts | 1 - .../ServiceOperationUseSuspenseQueries.ts | 1 - .../ServiceOperationUseSuspenseQuery.ts | 1 - .../src/tests/QraftSecureRequestFn.test.tsx | 8 +++----- .../src/tests/callQueryClientFetchMethod.test.ts | 1 - .../react-client/src/tests/createTestJwt.test.ts | 1 - packages/react-client/src/tests/msw/handlers.ts | 1 - packages/react-client/src/tests/msw/node.ts | 1 - .../src/tests/qraftAPIClient.test.tsx | 15 ++++++--------- packages/react-client/src/tests/setupTests.ts | 2 -- packages/react-client/vitest.config.ts | 3 +-- .../tanstack-query-react-plugin/eslint.config.js | 1 - .../src/generateCode.ts | 4 +--- .../src/plugin.spec.ts | 1 - .../tanstack-query-react-plugin/src/plugin.ts | 1 - .../src/ts-factory/getIndexFactory.spec.ts | 1 - .../src/ts-factory/getIndexFactory.ts | 3 +-- .../src/ts-factory/getServiceFactory.ts | 1 - .../src/ts-factory/getServiceIndexFactory.ts | 1 - 118 files changed, 111 insertions(+), 235 deletions(-) diff --git a/packages/cli/eslint.config.js b/packages/cli/eslint.config.js index 518641c2..d8f66c5f 100644 --- a/packages/cli/eslint.config.js +++ b/packages/cli/eslint.config.js @@ -1,5 +1,4 @@ import openAPIQraftConfig from '@openapi-qraft/eslint-config/eslint.vanilla.config'; - import globals from 'globals'; export default [ diff --git a/packages/cli/src/bin.spec.ts b/packages/cli/src/bin.spec.ts index 3ba36f0e..d5995fd0 100644 --- a/packages/cli/src/bin.spec.ts +++ b/packages/cli/src/bin.spec.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; - import { extractArgvPluginOptions } from './bin.js'; describe('bin', () => { diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts index 46b6e5f6..220f58fd 100644 --- a/packages/cli/src/bin.ts +++ b/packages/cli/src/bin.ts @@ -1,10 +1,8 @@ #!/usr/bin/env node -import { QraftCommand } from '@openapi-qraft/plugin/lib/QraftCommand'; import type { QraftCommandPlugin } from '@openapi-qraft/plugin/lib/QraftCommandPlugin'; - -import { Option } from 'commander'; import process from 'node:process'; - +import { QraftCommand } from '@openapi-qraft/plugin/lib/QraftCommand'; +import { Option } from 'commander'; import { builtInPlugins } from './builtInPlugins.js'; export async function main() { diff --git a/packages/openapi-typescript-plugin/eslint.config.js b/packages/openapi-typescript-plugin/eslint.config.js index 518641c2..d8f66c5f 100644 --- a/packages/openapi-typescript-plugin/eslint.config.js +++ b/packages/openapi-typescript-plugin/eslint.config.js @@ -1,5 +1,4 @@ import openAPIQraftConfig from '@openapi-qraft/eslint-config/eslint.vanilla.config'; - import globals from 'globals'; export default [ diff --git a/packages/openapi-typescript-plugin/src/generateSchemaTypes.ts b/packages/openapi-typescript-plugin/src/generateSchemaTypes.ts index 50347ec5..fb6e81cd 100644 --- a/packages/openapi-typescript-plugin/src/generateSchemaTypes.ts +++ b/packages/openapi-typescript-plugin/src/generateSchemaTypes.ts @@ -1,12 +1,7 @@ -import { createConfig } from '@redocly/openapi-core'; - import type { Readable } from 'node:stream'; -import openapiTS, { - astToString, - type OpenAPI3, - type OpenAPITSOptions, - SchemaObject, -} from 'openapi-typescript'; +import type { OpenAPI3, OpenAPITSOptions } from 'openapi-typescript'; +import { createConfig } from '@redocly/openapi-core'; +import openapiTS, { astToString, SchemaObject } from 'openapi-typescript'; import ts from 'typescript'; export async function generateSchemaTypes( diff --git a/packages/openapi-typescript-plugin/src/lib/createOpenapiTypesImportPath.test.ts b/packages/openapi-typescript-plugin/src/lib/createOpenapiTypesImportPath.test.ts index a799e117..cf73ebcf 100644 --- a/packages/openapi-typescript-plugin/src/lib/createOpenapiTypesImportPath.test.ts +++ b/packages/openapi-typescript-plugin/src/lib/createOpenapiTypesImportPath.test.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; - import { createOpenapiTypesImportPath } from './createOpenapiTypesImportPath.js'; describe('createOpenapiTypesImportPath', () => { diff --git a/packages/openapi-typescript-plugin/src/plugin.test.ts b/packages/openapi-typescript-plugin/src/plugin.test.ts index af694169..1bc413b8 100644 --- a/packages/openapi-typescript-plugin/src/plugin.test.ts +++ b/packages/openapi-typescript-plugin/src/plugin.test.ts @@ -1,9 +1,7 @@ import '@openapi-qraft/plugin/lib/vitestFsMock'; - import fs from 'node:fs'; import { createRequire } from 'node:module'; import { describe, expect, it, test } from 'vitest'; - import { openapiTypesFileNameOptionParser } from './plugin.js'; describe('openapi-typescript types generation', () => { diff --git a/packages/openapi-typescript-plugin/src/plugin.ts b/packages/openapi-typescript-plugin/src/plugin.ts index 66920c35..b53759a0 100644 --- a/packages/openapi-typescript-plugin/src/plugin.ts +++ b/packages/openapi-typescript-plugin/src/plugin.ts @@ -1,9 +1,7 @@ import { fileHeader } from '@openapi-qraft/plugin/lib/fileHeader'; import { formatFileHeader } from '@openapi-qraft/plugin/lib/formatFileHeader'; import { QraftCommandPlugin } from '@openapi-qraft/plugin/lib/QraftCommandPlugin'; - import { CommanderError } from 'commander'; - import { generateSchemaTypes } from './generateSchemaTypes.js'; import { createOpenapiTypesImportPath, diff --git a/packages/plugin/eslint.config.js b/packages/plugin/eslint.config.js index 518641c2..d8f66c5f 100644 --- a/packages/plugin/eslint.config.js +++ b/packages/plugin/eslint.config.js @@ -1,5 +1,4 @@ import openAPIQraftConfig from '@openapi-qraft/eslint-config/eslint.vanilla.config'; - import globals from 'globals'; export default [ diff --git a/packages/plugin/src/lib/QraftCommand.test.ts b/packages/plugin/src/lib/QraftCommand.test.ts index f3390860..65c4dbae 100644 --- a/packages/plugin/src/lib/QraftCommand.test.ts +++ b/packages/plugin/src/lib/QraftCommand.test.ts @@ -1,5 +1,4 @@ -import { describe, it, expect } from 'vitest'; - +import { describe, expect, it } from 'vitest'; import { QraftCommand, splitOptionFlags } from './QraftCommand.js'; describe('QraftCommand', () => { diff --git a/packages/plugin/src/lib/QraftCommand.ts b/packages/plugin/src/lib/QraftCommand.ts index 621dfe25..56e56deb 100644 --- a/packages/plugin/src/lib/QraftCommand.ts +++ b/packages/plugin/src/lib/QraftCommand.ts @@ -1,22 +1,23 @@ -import c from 'ansi-colors'; -import { Command, type Option } from 'commander'; +import type { Option } from 'commander'; +import type { Service } from './open-api/getServices.js'; import * as console from 'node:console'; import { sep } from 'node:path'; import process from 'node:process'; import { pathToFileURL, URL } from 'node:url'; +import c from 'ansi-colors'; +import { Command } from 'commander'; import ora, { Ora } from 'ora'; - import { parsePathGlobs } from './createServicePathMatch.js'; import { filterDocumentPaths } from './filterDocumentPaths.js'; import { GeneratorFile } from './GeneratorFile.js'; import { handleSchemaInput } from './handleSchemaInput.js'; -import { getServices, type Service } from './open-api/getServices.js'; +import { getServices } from './open-api/getServices.js'; import { OpenAPISchemaType } from './open-api/OpenAPISchemaType.js'; import { readSchema } from './open-api/readSchema.js'; import { OutputOptions } from './OutputOptions.js'; import { - parseOperationPredefinedParametersOption, createPredefinedParametersGlobMap, + parseOperationPredefinedParametersOption, predefineSchemaParameters, } from './predefineSchemaParameters.js'; import { writeGeneratorFiles } from './writeGeneratorFiles.js'; diff --git a/packages/plugin/src/lib/filterDocumentPaths.spec.ts b/packages/plugin/src/lib/filterDocumentPaths.spec.ts index f798d3cd..cd35cb27 100644 --- a/packages/plugin/src/lib/filterDocumentPaths.spec.ts +++ b/packages/plugin/src/lib/filterDocumentPaths.spec.ts @@ -1,5 +1,4 @@ -import { describe, it, expect } from 'vitest'; - +import { describe, expect, it } from 'vitest'; import { createServicePathMatch } from './createServicePathMatch.js'; describe('createServicePathMatch', () => { diff --git a/packages/plugin/src/lib/filterDocumentPaths.ts b/packages/plugin/src/lib/filterDocumentPaths.ts index dd817237..5ce43368 100644 --- a/packages/plugin/src/lib/filterDocumentPaths.ts +++ b/packages/plugin/src/lib/filterDocumentPaths.ts @@ -1,5 +1,4 @@ import { type OpenAPI3 } from 'openapi-typescript/src/types.js'; - import { createServicePathMatch } from './createServicePathMatch.js'; /** diff --git a/packages/plugin/src/lib/handleSchemaInput.ts b/packages/plugin/src/lib/handleSchemaInput.ts index 864470c9..1f97bdaa 100644 --- a/packages/plugin/src/lib/handleSchemaInput.ts +++ b/packages/plugin/src/lib/handleSchemaInput.ts @@ -1,6 +1,6 @@ +import type { Ora } from 'ora'; import process from 'node:process'; import { URL } from 'node:url'; -import type { Ora } from 'ora'; /** * Validates Schema's `input` and return `Readable` stream or `URL` diff --git a/packages/plugin/src/lib/open-api/getOperationName.spec.ts b/packages/plugin/src/lib/open-api/getOperationName.spec.ts index 4e221fff..79539011 100644 --- a/packages/plugin/src/lib/open-api/getOperationName.spec.ts +++ b/packages/plugin/src/lib/open-api/getOperationName.spec.ts @@ -1,5 +1,4 @@ -import { describe, it, expect } from 'vitest'; - +import { describe, expect, it } from 'vitest'; import { getOperationName } from './getOperationName.js'; describe('getOperationName', () => { diff --git a/packages/plugin/src/lib/open-api/getServiceName.spec.ts b/packages/plugin/src/lib/open-api/getServiceName.spec.ts index 4aee3a4b..11afa8bd 100644 --- a/packages/plugin/src/lib/open-api/getServiceName.spec.ts +++ b/packages/plugin/src/lib/open-api/getServiceName.spec.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; - import { getServiceName } from './getServiceName.js'; describe('getServiceName', () => { diff --git a/packages/plugin/src/lib/open-api/getServiceNamesByEndpoint.spec.ts b/packages/plugin/src/lib/open-api/getServiceNamesByEndpoint.spec.ts index 3ae17349..4b04ef49 100644 --- a/packages/plugin/src/lib/open-api/getServiceNamesByEndpoint.spec.ts +++ b/packages/plugin/src/lib/open-api/getServiceNamesByEndpoint.spec.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; - import { getEndpointPartIndex, getServiceBaseNameByOperationEndpoint, diff --git a/packages/plugin/src/lib/open-api/getServiceNamesByOperationTags.spec.ts b/packages/plugin/src/lib/open-api/getServiceNamesByOperationTags.spec.ts index f9f56266..d0ac0f6b 100644 --- a/packages/plugin/src/lib/open-api/getServiceNamesByOperationTags.spec.ts +++ b/packages/plugin/src/lib/open-api/getServiceNamesByOperationTags.spec.ts @@ -1,5 +1,4 @@ import { describe, expect, it } from 'vitest'; - import { getServiceNamesByOperationTags } from './getServiceNamesByOperationTags.js'; describe('getServiceNamesByOperationTags(...)', () => { diff --git a/packages/plugin/src/lib/open-api/getServices.spec.ts b/packages/plugin/src/lib/open-api/getServices.spec.ts index 03807980..2a8c9310 100644 --- a/packages/plugin/src/lib/open-api/getServices.spec.ts +++ b/packages/plugin/src/lib/open-api/getServices.spec.ts @@ -1,7 +1,5 @@ import openAPI from '@openapi-qraft/test-fixtures/openapi.json' with { type: 'json' }; - import { describe, expect, it } from 'vitest'; - import { filterDocumentPaths } from '../filterDocumentPaths.js'; import { getServices } from './getServices.js'; diff --git a/packages/plugin/src/lib/open-api/getServices.ts b/packages/plugin/src/lib/open-api/getServices.ts index f40cc414..c61a77c9 100644 --- a/packages/plugin/src/lib/open-api/getServices.ts +++ b/packages/plugin/src/lib/open-api/getServices.ts @@ -1,5 +1,5 @@ +import type { OpenAPISchemaType } from './OpenAPISchemaType.js'; import camelCase from 'camelcase'; - import { getContentMediaType } from './getContent.js'; import { getOperationName } from './getOperationName.js'; import { @@ -7,7 +7,6 @@ import { ServiceBaseNameByEndpointOption, } from './getServiceNamesByOperationEndpoint.js'; import { getServiceNamesByOperationTags } from './getServiceNamesByOperationTags.js'; -import type { OpenAPISchemaType } from './OpenAPISchemaType.js'; export type ServiceBaseName = ServiceBaseNameByEndpointOption | 'tags'; diff --git a/packages/plugin/src/lib/open-api/readSchema.ts b/packages/plugin/src/lib/open-api/readSchema.ts index 80522f7d..558f30b9 100644 --- a/packages/plugin/src/lib/open-api/readSchema.ts +++ b/packages/plugin/src/lib/open-api/readSchema.ts @@ -1,7 +1,6 @@ -import { createConfig } from '@redocly/openapi-core'; - import type { Readable } from 'node:stream'; import type { OpenAPI3 } from 'openapi-typescript'; +import { createConfig } from '@redocly/openapi-core'; import { validateAndBundle } from 'openapi-typescript/dist/lib/redoc.js'; export const readSchema = async ( diff --git a/packages/plugin/src/lib/predefineSchemaParameters.test.ts b/packages/plugin/src/lib/predefineSchemaParameters.test.ts index bc1d55ce..685cb75a 100644 --- a/packages/plugin/src/lib/predefineSchemaParameters.test.ts +++ b/packages/plugin/src/lib/predefineSchemaParameters.test.ts @@ -1,7 +1,5 @@ import openAPI from '@openapi-qraft/test-fixtures/openapi.json' with { type: 'json' }; - -import { describe, it, expect } from 'vitest'; - +import { describe, expect, it } from 'vitest'; import { assertIsOperationObject, assertIsParameterObjects, diff --git a/packages/plugin/src/lib/predefineSchemaParameters.ts b/packages/plugin/src/lib/predefineSchemaParameters.ts index 16047049..6a17ad32 100644 --- a/packages/plugin/src/lib/predefineSchemaParameters.ts +++ b/packages/plugin/src/lib/predefineSchemaParameters.ts @@ -1,10 +1,9 @@ +import type { OpenAPI3 } from 'openapi-typescript/src/types.js'; import { OperationObject, ParameterObject } from 'openapi-typescript'; import { - type OpenAPI3, PathItemObject, ReferenceObject, } from 'openapi-typescript/src/types.js'; - import { createServicePathMatch, parsePathGlobs, diff --git a/packages/plugin/src/lib/writeGeneratorFiles.ts b/packages/plugin/src/lib/writeGeneratorFiles.ts index 9975624f..4b52cf80 100644 --- a/packages/plugin/src/lib/writeGeneratorFiles.ts +++ b/packages/plugin/src/lib/writeGeneratorFiles.ts @@ -1,7 +1,6 @@ -import c from 'ansi-colors'; import fs from 'node:fs'; +import c from 'ansi-colors'; import { Ora } from 'ora'; - import { GeneratorFile } from './GeneratorFile.js'; export const writeGeneratorFiles = async ({ diff --git a/packages/react-client/eslint.config.js b/packages/react-client/eslint.config.js index f4bdf78c..ea8ae536 100644 --- a/packages/react-client/eslint.config.js +++ b/packages/react-client/eslint.config.js @@ -1,5 +1,4 @@ import openAPIQraftConfig from '@openapi-qraft/eslint-config/eslint.vanilla.config'; - import globals from 'globals'; export default [ diff --git a/packages/react-client/rollup.config.mjs b/packages/react-client/rollup.config.mjs index 436de3d9..e2721c01 100644 --- a/packages/react-client/rollup.config.mjs +++ b/packages/react-client/rollup.config.mjs @@ -1,5 +1,4 @@ import { rollupConfig } from '@openapi-qraft/rollup-config'; - import packageJson from './package.json' with { type: 'json' }; const moduleDist = { diff --git a/packages/react-client/src/QraftContext.ts b/packages/react-client/src/QraftContext.ts index ea7e0290..2cc923d1 100644 --- a/packages/react-client/src/QraftContext.ts +++ b/packages/react-client/src/QraftContext.ts @@ -1,10 +1,8 @@ 'use client'; -import { createContext } from 'react'; - import type { QueryClient } from '@tanstack/react-query'; - import type { OperationSchema, RequestFnPayload } from './lib/requestFn.js'; +import { createContext } from 'react'; interface QraftContextValueBase { /** diff --git a/packages/react-client/src/ServiceOperation.ts b/packages/react-client/src/ServiceOperation.ts index 200b0ed5..11891f75 100644 --- a/packages/react-client/src/ServiceOperation.ts +++ b/packages/react-client/src/ServiceOperation.ts @@ -1,8 +1,7 @@ import type { DefaultError } from '@tanstack/query-core'; - import type { - ServiceOperationQuery as ServiceOperationQueryBase, ServiceOperationMutation as ServiceOperationMutationBase, + ServiceOperationQuery as ServiceOperationQueryBase, } from './service-operation/ServiceOperation.js'; import type { ServiceOperationInfiniteQueryKey as ServiceOperationInfiniteQueryKeyBase, diff --git a/packages/react-client/src/Unstable_QraftSecureRequestFn.ts b/packages/react-client/src/Unstable_QraftSecureRequestFn.ts index 81bf64df..c4c824d6 100644 --- a/packages/react-client/src/Unstable_QraftSecureRequestFn.ts +++ b/packages/react-client/src/Unstable_QraftSecureRequestFn.ts @@ -1,20 +1,14 @@ 'use client'; -import { createElement, Fragment, ReactNode, useEffect, useMemo } from 'react'; - -import { - QueryClient, - type QueryFunctionContext, - type QueryKey, - useQueries, -} from '@tanstack/react-query'; - -import { jwtDecode } from './lib/jwt-decode/index.js'; +import type { QueryFunctionContext, QueryKey } from '@tanstack/react-query'; import type { OperationSchema, RequestFnInfo, RequestFnOptions, } from './lib/requestFn.js'; +import { QueryClient, useQueries } from '@tanstack/react-query'; +import { createElement, Fragment, ReactNode, useEffect, useMemo } from 'react'; +import { jwtDecode } from './lib/jwt-decode/index.js'; interface QraftSecureRequestFnBaseProps { requestFn( diff --git a/packages/react-client/src/callbacks/cancelQueries.ts b/packages/react-client/src/callbacks/cancelQueries.ts index e9150ee5..88e48e98 100644 --- a/packages/react-client/src/callbacks/cancelQueries.ts +++ b/packages/react-client/src/callbacks/cancelQueries.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationCancelQueriesCallback } from '../service-operation/ServiceOperationCancelQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function cancelQueries( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/fetchInfiniteQuery.ts b/packages/react-client/src/callbacks/fetchInfiniteQuery.ts index c3b32474..2bae5f11 100644 --- a/packages/react-client/src/callbacks/fetchInfiniteQuery.ts +++ b/packages/react-client/src/callbacks/fetchInfiniteQuery.ts @@ -1,5 +1,5 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const fetchInfiniteQuery: < diff --git a/packages/react-client/src/callbacks/fetchQuery.ts b/packages/react-client/src/callbacks/fetchQuery.ts index ac10542d..1d28f62f 100644 --- a/packages/react-client/src/callbacks/fetchQuery.ts +++ b/packages/react-client/src/callbacks/fetchQuery.ts @@ -1,5 +1,5 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const fetchQuery: < diff --git a/packages/react-client/src/callbacks/getInfiniteQueryData.ts b/packages/react-client/src/callbacks/getInfiniteQueryData.ts index c0e8c44b..a8249d71 100644 --- a/packages/react-client/src/callbacks/getInfiniteQueryData.ts +++ b/packages/react-client/src/callbacks/getInfiniteQueryData.ts @@ -1,9 +1,8 @@ import type { InfiniteData } from '@tanstack/query-core'; - -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function getInfiniteQueryData( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/getInfiniteQueryKey.ts b/packages/react-client/src/callbacks/getInfiniteQueryKey.ts index d303f5a7..47e40443 100644 --- a/packages/react-client/src/callbacks/getInfiniteQueryKey.ts +++ b/packages/react-client/src/callbacks/getInfiniteQueryKey.ts @@ -1,6 +1,6 @@ -import { composeInfiniteQueryKey } from '../lib/composeInfiniteQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { composeInfiniteQueryKey } from '../lib/composeInfiniteQueryKey.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const getInfiniteQueryKey = ( diff --git a/packages/react-client/src/callbacks/getInfiniteQueryState.ts b/packages/react-client/src/callbacks/getInfiniteQueryState.ts index b3482b79..0a2170e1 100644 --- a/packages/react-client/src/callbacks/getInfiniteQueryState.ts +++ b/packages/react-client/src/callbacks/getInfiniteQueryState.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function getInfiniteQueryState( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/getMutationKey.ts b/packages/react-client/src/callbacks/getMutationKey.ts index b9eaf492..8f8f168a 100644 --- a/packages/react-client/src/callbacks/getMutationKey.ts +++ b/packages/react-client/src/callbacks/getMutationKey.ts @@ -1,6 +1,6 @@ -import { composeMutationKey } from '../lib/composeMutationKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { composeMutationKey } from '../lib/composeMutationKey.js'; import { ServiceOperationMutation } from '../service-operation/ServiceOperation.js'; export const getMutationKey = ( diff --git a/packages/react-client/src/callbacks/getQueriesData.ts b/packages/react-client/src/callbacks/getQueriesData.ts index 2f1d42f0..858c4797 100644 --- a/packages/react-client/src/callbacks/getQueriesData.ts +++ b/packages/react-client/src/callbacks/getQueriesData.ts @@ -1,6 +1,6 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export function getQueriesData( diff --git a/packages/react-client/src/callbacks/getQueryData.ts b/packages/react-client/src/callbacks/getQueryData.ts index 5fa29cbc..78f09401 100644 --- a/packages/react-client/src/callbacks/getQueryData.ts +++ b/packages/react-client/src/callbacks/getQueryData.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function getQueryData( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/getQueryKey.ts b/packages/react-client/src/callbacks/getQueryKey.ts index 9f761177..9ba98b34 100644 --- a/packages/react-client/src/callbacks/getQueryKey.ts +++ b/packages/react-client/src/callbacks/getQueryKey.ts @@ -1,6 +1,6 @@ -import { composeQueryKey } from '../lib/composeQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { composeQueryKey } from '../lib/composeQueryKey.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const getQueryKey = ( diff --git a/packages/react-client/src/callbacks/getQueryState.ts b/packages/react-client/src/callbacks/getQueryState.ts index 55990802..fd4898db 100644 --- a/packages/react-client/src/callbacks/getQueryState.ts +++ b/packages/react-client/src/callbacks/getQueryState.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function getQueryState( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/invalidateQueries.ts b/packages/react-client/src/callbacks/invalidateQueries.ts index f5493443..7df5c75f 100644 --- a/packages/react-client/src/callbacks/invalidateQueries.ts +++ b/packages/react-client/src/callbacks/invalidateQueries.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationInvalidateQueriesCallback } from '../service-operation/ServiceOperationInvalidateQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function invalidateQueries( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/isFetching.ts b/packages/react-client/src/callbacks/isFetching.ts index 2f99c9a3..e8b4a201 100644 --- a/packages/react-client/src/callbacks/isFetching.ts +++ b/packages/react-client/src/callbacks/isFetching.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationIsFetchingQueriesCallback } from '../service-operation/ServiceOperationIsFetchingQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function isFetching( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/isMutating.ts b/packages/react-client/src/callbacks/isMutating.ts index c2aa15e5..1b880b47 100644 --- a/packages/react-client/src/callbacks/isMutating.ts +++ b/packages/react-client/src/callbacks/isMutating.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithMutationFilters } from '../lib/callQueryClientMethodWithMutationFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationIsMutatingQueriesCallback } from '../service-operation/ServiceOperationIsMutatingQueries.js'; +import { callQueryClientMethodWithMutationFilters } from '../lib/callQueryClientMethodWithMutationFilters.js'; export function isMutating( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/prefetchInfiniteQuery.ts b/packages/react-client/src/callbacks/prefetchInfiniteQuery.ts index d6892bec..dc73a309 100644 --- a/packages/react-client/src/callbacks/prefetchInfiniteQuery.ts +++ b/packages/react-client/src/callbacks/prefetchInfiniteQuery.ts @@ -1,5 +1,5 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const prefetchInfiniteQuery: < diff --git a/packages/react-client/src/callbacks/prefetchQuery.ts b/packages/react-client/src/callbacks/prefetchQuery.ts index 2161fd64..f03f5cae 100644 --- a/packages/react-client/src/callbacks/prefetchQuery.ts +++ b/packages/react-client/src/callbacks/prefetchQuery.ts @@ -1,5 +1,5 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; export const prefetchQuery: < diff --git a/packages/react-client/src/callbacks/refetchQueries.ts b/packages/react-client/src/callbacks/refetchQueries.ts index 82944063..40a3c994 100644 --- a/packages/react-client/src/callbacks/refetchQueries.ts +++ b/packages/react-client/src/callbacks/refetchQueries.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationRefetchQueriesCallback } from '../service-operation/ServiceOperationRefetchQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function refetchQueries( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/removeQueries.ts b/packages/react-client/src/callbacks/removeQueries.ts index 9d82e7d5..ca323330 100644 --- a/packages/react-client/src/callbacks/removeQueries.ts +++ b/packages/react-client/src/callbacks/removeQueries.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationRemoveQueriesCallback } from '../service-operation/ServiceOperationRemoveQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function removeQueries( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/resetQueries.ts b/packages/react-client/src/callbacks/resetQueries.ts index 78bb5fc7..aef511e1 100644 --- a/packages/react-client/src/callbacks/resetQueries.ts +++ b/packages/react-client/src/callbacks/resetQueries.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationResetQueriesCallback } from '../service-operation/ServiceOperationResetQueries.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function resetQueries( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/setInfiniteQueryData.ts b/packages/react-client/src/callbacks/setInfiniteQueryData.ts index 119679bc..1b0a4748 100644 --- a/packages/react-client/src/callbacks/setInfiniteQueryData.ts +++ b/packages/react-client/src/callbacks/setInfiniteQueryData.ts @@ -1,9 +1,8 @@ -import { InfiniteData } from '@tanstack/query-core'; - -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { InfiniteData } from '@tanstack/query-core'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function setInfiniteQueryData( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/setQueriesData.ts b/packages/react-client/src/callbacks/setQueriesData.ts index 082ccff3..0972b8f2 100644 --- a/packages/react-client/src/callbacks/setQueriesData.ts +++ b/packages/react-client/src/callbacks/setQueriesData.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationSetQueriesDataCallback } from '../service-operation/ServiceOperationSetQueriesData.js'; +import { callQueryClientMethodWithQueryFilters } from '../lib/callQueryClientMethodWithQueryFilters.js'; export function setQueriesData( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/setQueryData.ts b/packages/react-client/src/callbacks/setQueryData.ts index d1481813..e84d63f0 100644 --- a/packages/react-client/src/callbacks/setQueryData.ts +++ b/packages/react-client/src/callbacks/setQueryData.ts @@ -1,7 +1,7 @@ -import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; import type { OperationSchema } from '../lib/requestFn.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationSetQueryDataCallback } from '../service-operation/ServiceOperationSetQueryData.js'; +import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientMethodWithQueryKey.js'; export function setQueryData( _: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/useInfiniteQuery.ts b/packages/react-client/src/callbacks/useInfiniteQuery.ts index 82ee0e35..787bfb42 100644 --- a/packages/react-client/src/callbacks/useInfiniteQuery.ts +++ b/packages/react-client/src/callbacks/useInfiniteQuery.ts @@ -1,15 +1,12 @@ 'use client'; import type { DefaultError, InfiniteData } from '@tanstack/query-core'; -import { - useInfiniteQuery as useInfiniteQueryBase, - type UseInfiniteQueryResult, -} from '@tanstack/react-query'; - +import type { UseInfiniteQueryResult } from '@tanstack/react-query'; import type { OperationSchema } from '../lib/requestFn.js'; -import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { useInfiniteQuery as useInfiniteQueryBase } from '@tanstack/react-query'; +import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; export const useInfiniteQuery: < TQueryFnData, diff --git a/packages/react-client/src/callbacks/useIsFetching.ts b/packages/react-client/src/callbacks/useIsFetching.ts index db76ff54..1bcfbf11 100644 --- a/packages/react-client/src/callbacks/useIsFetching.ts +++ b/packages/react-client/src/callbacks/useIsFetching.ts @@ -1,12 +1,11 @@ 'use client'; -import { useIsFetching as useIsFetchingTanstack } from '@tanstack/react-query'; - -import { composeQueryFilters } from '../lib/composeQueryFilters.js'; import type { OperationSchema } from '../lib/requestFn.js'; -import { useQueryClient } from '../lib/useQueryClient.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { useIsFetching as useIsFetchingTanstack } from '@tanstack/react-query'; +import { composeQueryFilters } from '../lib/composeQueryFilters.js'; +import { useQueryClient } from '../lib/useQueryClient.js'; export const useIsFetching: ( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/useIsMutating.ts b/packages/react-client/src/callbacks/useIsMutating.ts index 375e58d7..5399fd05 100644 --- a/packages/react-client/src/callbacks/useIsMutating.ts +++ b/packages/react-client/src/callbacks/useIsMutating.ts @@ -1,15 +1,14 @@ 'use client'; import type { DefaultError } from '@tanstack/query-core'; +import type { OperationSchema } from '../lib/requestFn.js'; +import type { QraftClientOptions } from '../qraftAPIClient.js'; import { - UseMutationResult, useIsMutating as useIsMutatingStateTanstack, + UseMutationResult, } from '@tanstack/react-query'; - import { composeMutationFilters } from '../lib/composeMutationFilters.js'; -import type { OperationSchema } from '../lib/requestFn.js'; import { useQueryClient } from '../lib/useQueryClient.js'; -import type { QraftClientOptions } from '../qraftAPIClient.js'; import { ServiceOperationMutation } from '../service-operation/ServiceOperation.js'; export const useIsMutating: < diff --git a/packages/react-client/src/callbacks/useMutation.ts b/packages/react-client/src/callbacks/useMutation.ts index 233a30e4..b0763e20 100644 --- a/packages/react-client/src/callbacks/useMutation.ts +++ b/packages/react-client/src/callbacks/useMutation.ts @@ -1,20 +1,18 @@ 'use client'; -import { useContext } from 'react'; - import type { DefaultError } from '@tanstack/query-core'; +import type { OperationSchema } from '../lib/requestFn.js'; +import type { QraftClientOptions } from '../qraftAPIClient.js'; +import type { ServiceOperationMutation } from '../service-operation/ServiceOperation.js'; +import type { ServiceOperationMutationKey } from '../service-operation/ServiceOperationKey.js'; import { useMutation as useMutationBase, UseMutationResult, } from '@tanstack/react-query'; - +import { useContext } from 'react'; import { composeMutationKey } from '../lib/composeMutationKey.js'; -import type { OperationSchema } from '../lib/requestFn.js'; import { useQueryClient } from '../lib/useQueryClient.js'; -import type { QraftClientOptions } from '../qraftAPIClient.js'; import { QraftContext } from '../QraftContext.js'; -import type { ServiceOperationMutation } from '../service-operation/ServiceOperation.js'; -import type { ServiceOperationMutationKey } from '../service-operation/ServiceOperationKey.js'; export const useMutation: < TData = unknown, diff --git a/packages/react-client/src/callbacks/useMutationState.ts b/packages/react-client/src/callbacks/useMutationState.ts index 0935eaf2..8baa85b3 100644 --- a/packages/react-client/src/callbacks/useMutationState.ts +++ b/packages/react-client/src/callbacks/useMutationState.ts @@ -1,15 +1,14 @@ 'use client'; import type { DefaultError } from '@tanstack/query-core'; +import type { OperationSchema } from '../lib/requestFn.js'; +import type { QraftClientOptions } from '../qraftAPIClient.js'; import { UseMutationResult, useMutationState as useMutationStateTanstack, } from '@tanstack/react-query'; - import { composeMutationFilters } from '../lib/composeMutationFilters.js'; -import type { OperationSchema } from '../lib/requestFn.js'; import { useQueryClient } from '../lib/useQueryClient.js'; -import type { QraftClientOptions } from '../qraftAPIClient.js'; import { ServiceOperationMutation } from '../service-operation/ServiceOperation.js'; export const useMutationState: < diff --git a/packages/react-client/src/callbacks/useQueries.ts b/packages/react-client/src/callbacks/useQueries.ts index 72cd2605..b837a8c5 100644 --- a/packages/react-client/src/callbacks/useQueries.ts +++ b/packages/react-client/src/callbacks/useQueries.ts @@ -1,16 +1,14 @@ 'use client'; -import { useContext } from 'react'; - +import type { OperationSchema } from '../lib/requestFn.js'; +import type { QraftClientOptions } from '../qraftAPIClient.js'; import { QueriesResults, useQueries as useQueriesTanstack, } from '@tanstack/react-query'; - +import { useContext } from 'react'; import { composeQueryKey } from '../lib/composeQueryKey.js'; -import type { OperationSchema } from '../lib/requestFn.js'; import { useQueryClient } from '../lib/useQueryClient.js'; -import type { QraftClientOptions } from '../qraftAPIClient.js'; import { QraftContext } from '../QraftContext.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; diff --git a/packages/react-client/src/callbacks/useQuery.ts b/packages/react-client/src/callbacks/useQuery.ts index 32206ead..66cedd45 100644 --- a/packages/react-client/src/callbacks/useQuery.ts +++ b/packages/react-client/src/callbacks/useQuery.ts @@ -1,15 +1,12 @@ 'use client'; import type { DefaultError } from '@tanstack/query-core'; -import { - useQuery as useQueryTanstack, - type UseQueryResult, -} from '@tanstack/react-query'; - +import type { UseQueryResult } from '@tanstack/react-query'; import type { OperationSchema } from '../lib/requestFn.js'; -import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { useQuery as useQueryTanstack } from '@tanstack/react-query'; +import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; export const useQuery: ( qraftOptions: QraftClientOptions | undefined, diff --git a/packages/react-client/src/callbacks/useSuspenseInfiniteQuery.ts b/packages/react-client/src/callbacks/useSuspenseInfiniteQuery.ts index f24b7a11..411bed7e 100644 --- a/packages/react-client/src/callbacks/useSuspenseInfiniteQuery.ts +++ b/packages/react-client/src/callbacks/useSuspenseInfiniteQuery.ts @@ -1,15 +1,12 @@ 'use client'; import type { DefaultError, InfiniteData } from '@tanstack/query-core'; -import { - useSuspenseInfiniteQuery as useSuspenseInfiniteQueryTanstack, - type UseSuspenseInfiniteQueryResult, -} from '@tanstack/react-query'; - +import type { UseSuspenseInfiniteQueryResult } from '@tanstack/react-query'; import type { OperationSchema } from '../lib/requestFn.js'; -import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { useSuspenseInfiniteQuery as useSuspenseInfiniteQueryTanstack } from '@tanstack/react-query'; +import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; export const useSuspenseInfiniteQuery: < TQueryFnData, diff --git a/packages/react-client/src/callbacks/useSuspenseQueries.ts b/packages/react-client/src/callbacks/useSuspenseQueries.ts index 07b4210d..99092196 100644 --- a/packages/react-client/src/callbacks/useSuspenseQueries.ts +++ b/packages/react-client/src/callbacks/useSuspenseQueries.ts @@ -1,16 +1,14 @@ 'use client'; -import { useContext } from 'react'; - +import type { OperationSchema } from '../lib/requestFn.js'; +import type { QraftClientOptions } from '../qraftAPIClient.js'; import { SuspenseQueriesResults, useSuspenseQueries as useSuspenseQueriesTanstack, } from '@tanstack/react-query'; - +import { useContext } from 'react'; import { composeQueryKey } from '../lib/composeQueryKey.js'; -import type { OperationSchema } from '../lib/requestFn.js'; import { useQueryClient } from '../lib/useQueryClient.js'; -import type { QraftClientOptions } from '../qraftAPIClient.js'; import { QraftContext } from '../QraftContext.js'; import { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; diff --git a/packages/react-client/src/callbacks/useSuspenseQuery.ts b/packages/react-client/src/callbacks/useSuspenseQuery.ts index e26b4b1a..5b4377e8 100644 --- a/packages/react-client/src/callbacks/useSuspenseQuery.ts +++ b/packages/react-client/src/callbacks/useSuspenseQuery.ts @@ -1,15 +1,12 @@ 'use client'; import type { DefaultError } from '@tanstack/query-core'; -import { - type UseQueryResult, - useSuspenseQuery as useSuspenseQueryTanstack, -} from '@tanstack/react-query'; - +import type { UseQueryResult } from '@tanstack/react-query'; import type { OperationSchema } from '../lib/requestFn.js'; -import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; import type { QraftClientOptions } from '../qraftAPIClient.js'; import type { ServiceOperationQuery } from '../service-operation/ServiceOperation.js'; +import { useSuspenseQuery as useSuspenseQueryTanstack } from '@tanstack/react-query'; +import { useComposeUseQueryOptions } from '../lib/useComposeUseQueryOptions.js'; export const useSuspenseQuery: < TQueryFnData = unknown, diff --git a/packages/react-client/src/lib/callQueryClientFetchMethod.ts b/packages/react-client/src/lib/callQueryClientFetchMethod.ts index 4629ecf6..f2b30eaa 100644 --- a/packages/react-client/src/lib/callQueryClientFetchMethod.ts +++ b/packages/react-client/src/lib/callQueryClientFetchMethod.ts @@ -1,8 +1,7 @@ import type { QueryClient } from '@tanstack/query-core'; - +import type { OperationSchema, RequestFn } from './requestFn.js'; import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js'; import { composeQueryKey } from './composeQueryKey.js'; -import type { OperationSchema, RequestFn } from './requestFn.js'; import { shelfMerge } from './shelfMerge.js'; /** diff --git a/packages/react-client/src/lib/callQueryClientMethodWithMutationFilters.ts b/packages/react-client/src/lib/callQueryClientMethodWithMutationFilters.ts index 89619e98..7b1a63ed 100644 --- a/packages/react-client/src/lib/callQueryClientMethodWithMutationFilters.ts +++ b/packages/react-client/src/lib/callQueryClientMethodWithMutationFilters.ts @@ -1,7 +1,6 @@ import type { QueryClient } from '@tanstack/query-core'; - -import { composeMutationFilters } from './composeMutationFilters.js'; import type { OperationSchema } from './requestFn.js'; +import { composeMutationFilters } from './composeMutationFilters.js'; /** * Calls a query client method with mutation filters and options, diff --git a/packages/react-client/src/lib/callQueryClientMethodWithQueryFilters.ts b/packages/react-client/src/lib/callQueryClientMethodWithQueryFilters.ts index 7b9827a7..69fc2abe 100644 --- a/packages/react-client/src/lib/callQueryClientMethodWithQueryFilters.ts +++ b/packages/react-client/src/lib/callQueryClientMethodWithQueryFilters.ts @@ -1,7 +1,6 @@ import type { QueryClient } from '@tanstack/query-core'; - -import { composeQueryFilters } from './composeQueryFilters.js'; import type { OperationSchema } from './requestFn.js'; +import { composeQueryFilters } from './composeQueryFilters.js'; /** * Calls a query client method with query filters and options, diff --git a/packages/react-client/src/lib/callQueryClientMethodWithQueryKey.ts b/packages/react-client/src/lib/callQueryClientMethodWithQueryKey.ts index 3e806b5a..399fd570 100644 --- a/packages/react-client/src/lib/callQueryClientMethodWithQueryKey.ts +++ b/packages/react-client/src/lib/callQueryClientMethodWithQueryKey.ts @@ -1,8 +1,7 @@ import type { QueryClient } from '@tanstack/query-core'; - +import type { OperationSchema } from './requestFn.js'; import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js'; import { composeQueryKey } from './composeQueryKey.js'; -import type { OperationSchema } from './requestFn.js'; /** * Calls a query client method with parameters and options, diff --git a/packages/react-client/src/lib/composeInfiniteQueryKey.ts b/packages/react-client/src/lib/composeInfiniteQueryKey.ts index 8d77662c..6d128530 100644 --- a/packages/react-client/src/lib/composeInfiniteQueryKey.ts +++ b/packages/react-client/src/lib/composeInfiniteQueryKey.ts @@ -1,6 +1,6 @@ import type { ServiceOperationInfiniteQueryKey } from '../service-operation/ServiceOperationKey.js'; -import { composeBaseQueryKey } from './composeBaseQueryKey.js'; import type { OperationSchema } from './requestFn.js'; +import { composeBaseQueryKey } from './composeBaseQueryKey.js'; export function composeInfiniteQueryKey< TSchema extends OperationSchema, diff --git a/packages/react-client/src/lib/composeMutationFilters.ts b/packages/react-client/src/lib/composeMutationFilters.ts index cf2e8620..8f19132d 100644 --- a/packages/react-client/src/lib/composeMutationFilters.ts +++ b/packages/react-client/src/lib/composeMutationFilters.ts @@ -1,5 +1,5 @@ -import { composeMutationKey } from './composeMutationKey.js'; import type { OperationSchema } from './requestFn.js'; +import { composeMutationKey } from './composeMutationKey.js'; /** * Replaces the `parameters` field in the filters with a `mutationKey` field based on the schema. diff --git a/packages/react-client/src/lib/composeQueryFilters.ts b/packages/react-client/src/lib/composeQueryFilters.ts index 5330b550..8f5d08ca 100644 --- a/packages/react-client/src/lib/composeQueryFilters.ts +++ b/packages/react-client/src/lib/composeQueryFilters.ts @@ -1,7 +1,7 @@ +import type { OperationSchema } from './requestFn.js'; import { composeBaseQueryKey } from './composeBaseQueryKey.js'; import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js'; import { composeQueryKey } from './composeQueryKey.js'; -import type { OperationSchema } from './requestFn.js'; /** * Replaces the `parameters` field in the filters with a `queryKey` field based on the schema. diff --git a/packages/react-client/src/lib/composeQueryKey.ts b/packages/react-client/src/lib/composeQueryKey.ts index bbeebcb6..13810add 100644 --- a/packages/react-client/src/lib/composeQueryKey.ts +++ b/packages/react-client/src/lib/composeQueryKey.ts @@ -1,6 +1,6 @@ import type { ServiceOperationQueryKey } from '../service-operation/ServiceOperationKey.js'; -import { composeBaseQueryKey } from './composeBaseQueryKey.js'; import type { OperationSchema } from './requestFn.js'; +import { composeBaseQueryKey } from './composeBaseQueryKey.js'; export function composeQueryKey( schema: TSchema, diff --git a/packages/react-client/src/lib/jwt-decode/index.test.ts b/packages/react-client/src/lib/jwt-decode/index.test.ts index 7cd71bb1..322b58a0 100644 --- a/packages/react-client/src/lib/jwt-decode/index.test.ts +++ b/packages/react-client/src/lib/jwt-decode/index.test.ts @@ -1,10 +1,9 @@ import { describe, expect, it } from 'vitest'; - import { - jwtDecode, + b64DecodeUnicode, InvalidTokenError, + jwtDecode, JwtPayload, - b64DecodeUnicode, } from './index.js'; const token = diff --git a/packages/react-client/src/lib/useComposeUseQueryOptions.ts b/packages/react-client/src/lib/useComposeUseQueryOptions.ts index 965aed82..82823e40 100644 --- a/packages/react-client/src/lib/useComposeUseQueryOptions.ts +++ b/packages/react-client/src/lib/useComposeUseQueryOptions.ts @@ -1,16 +1,14 @@ 'use client'; -import { useContext } from 'react'; - import type { QueryClient } from '@tanstack/query-core'; import type { UseQueryOptions } from '@tanstack/react-query'; - import type { QraftClientOptions } from '../qraftAPIClient.js'; -import { QraftContext } from '../QraftContext.js'; import type { ServiceOperationQueryKey } from '../service-operation/ServiceOperationKey.js'; +import type { OperationSchema } from './requestFn.js'; +import { useContext } from 'react'; +import { QraftContext } from '../QraftContext.js'; import { composeInfiniteQueryKey } from './composeInfiniteQueryKey.js'; import { composeQueryKey } from './composeQueryKey.js'; -import type { OperationSchema } from './requestFn.js'; import { shelfMerge } from './shelfMerge.js'; import { useQueryClient } from './useQueryClient.js'; diff --git a/packages/react-client/src/lib/useQueryClient.ts b/packages/react-client/src/lib/useQueryClient.ts index 9d7c37cb..b21a4b6b 100644 --- a/packages/react-client/src/lib/useQueryClient.ts +++ b/packages/react-client/src/lib/useQueryClient.ts @@ -1,13 +1,11 @@ 'use client'; -import { useContext } from 'react'; - +import type { QraftClientOptions } from '../qraftAPIClient.js'; import { QueryClient, useQueryClient as useQueryClientTanstack, } from '@tanstack/react-query'; - -import type { QraftClientOptions } from '../qraftAPIClient.js'; +import { useContext } from 'react'; import { QraftContext } from '../QraftContext.js'; /** diff --git a/packages/react-client/src/qraftAPIClient.ts b/packages/react-client/src/qraftAPIClient.ts index 6210e31b..8119b8a0 100644 --- a/packages/react-client/src/qraftAPIClient.ts +++ b/packages/react-client/src/qraftAPIClient.ts @@ -1,9 +1,8 @@ import type { Context } from 'react'; - import type * as operationInvokeModule from './callbacks/operationInvokeFn.js'; -import { createRecursiveProxy } from './lib/createRecursiveProxy.js'; import type { OperationSchema } from './lib/requestFn.js'; import type { QraftContextValue } from './QraftContext.js'; +import { createRecursiveProxy } from './lib/createRecursiveProxy.js'; export interface QraftClientOptions { context?: Context; diff --git a/packages/react-client/src/service-operation/OperationInfiniteData.ts b/packages/react-client/src/service-operation/OperationInfiniteData.ts index cc3e17be..4d9f97ae 100644 --- a/packages/react-client/src/service-operation/OperationInfiniteData.ts +++ b/packages/react-client/src/service-operation/OperationInfiniteData.ts @@ -1,5 +1,4 @@ import type { InfiniteData } from '@tanstack/query-core'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; export type OperationInfiniteData = InfiniteData< diff --git a/packages/react-client/src/service-operation/QueryFilters.ts b/packages/react-client/src/service-operation/QueryFilters.ts index 00ca2fc7..05f27f9e 100644 --- a/packages/react-client/src/service-operation/QueryFilters.ts +++ b/packages/react-client/src/service-operation/QueryFilters.ts @@ -1,5 +1,4 @@ import type { DefaultError, FetchStatus, Query } from '@tanstack/query-core'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { diff --git a/packages/react-client/src/service-operation/ServiceOperation.ts b/packages/react-client/src/service-operation/ServiceOperation.ts index c6ef6377..97653f0f 100644 --- a/packages/react-client/src/service-operation/ServiceOperation.ts +++ b/packages/react-client/src/service-operation/ServiceOperation.ts @@ -1,5 +1,4 @@ import type { DefaultError } from '@tanstack/query-core'; - import type { ServiceOperationCancelQueries } from './ServiceOperationCancelQueries.js'; import type { ServiceOperationFetchInfiniteQuery } from './ServiceOperationFetchInfiniteQuery.js'; import type { ServiceOperationFetchQuery } from './ServiceOperationFetchQuery.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationCancelQueries.ts b/packages/react-client/src/service-operation/ServiceOperationCancelQueries.ts index f15ca29f..7ab75a5d 100644 --- a/packages/react-client/src/service-operation/ServiceOperationCancelQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationCancelQueries.ts @@ -3,7 +3,6 @@ import type { DefaultError, QueryClient, } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationFetchInfiniteQuery.ts b/packages/react-client/src/service-operation/ServiceOperationFetchInfiniteQuery.ts index 0a2bffb1..59172a1c 100644 --- a/packages/react-client/src/service-operation/ServiceOperationFetchInfiniteQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationFetchInfiniteQuery.ts @@ -6,7 +6,6 @@ import type { QueryClient, QueryFunction, } from '@tanstack/query-core'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; import type { RequestFn } from '../lib/requestFn.js'; import type { OperationInfiniteData } from './OperationInfiniteData.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationFetchQuery.ts b/packages/react-client/src/service-operation/ServiceOperationFetchQuery.ts index 190baa5b..77f546a6 100644 --- a/packages/react-client/src/service-operation/ServiceOperationFetchQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationFetchQuery.ts @@ -4,7 +4,6 @@ import type { QueryClient, QueryFunction, } from '@tanstack/query-core'; - import type { RequestFn } from '../lib/requestFn.js'; import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationGetInfiniteQueryData.ts b/packages/react-client/src/service-operation/ServiceOperationGetInfiniteQueryData.ts index d396da57..e3f8bc72 100644 --- a/packages/react-client/src/service-operation/ServiceOperationGetInfiniteQueryData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationGetInfiniteQueryData.ts @@ -1,5 +1,4 @@ import type { QueryClient } from '@tanstack/query-core'; - import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { ServiceOperationInfiniteQueryKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationGetQueriesData.ts b/packages/react-client/src/service-operation/ServiceOperationGetQueriesData.ts index 3f86a112..a010dec4 100644 --- a/packages/react-client/src/service-operation/ServiceOperationGetQueriesData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationGetQueriesData.ts @@ -1,5 +1,4 @@ import type { DefaultError, NoInfer, QueryClient } from '@tanstack/query-core'; - import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { QueryFiltersByParameters, diff --git a/packages/react-client/src/service-operation/ServiceOperationGetQueryData.ts b/packages/react-client/src/service-operation/ServiceOperationGetQueryData.ts index 5828bb03..996d9801 100644 --- a/packages/react-client/src/service-operation/ServiceOperationGetQueryData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationGetQueryData.ts @@ -1,5 +1,4 @@ import type { QueryClient } from '@tanstack/query-core'; - import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; export interface ServiceOperationGetQueryData< diff --git a/packages/react-client/src/service-operation/ServiceOperationGetQueryState.ts b/packages/react-client/src/service-operation/ServiceOperationGetQueryState.ts index d86fc2f9..1d5f5d93 100644 --- a/packages/react-client/src/service-operation/ServiceOperationGetQueryState.ts +++ b/packages/react-client/src/service-operation/ServiceOperationGetQueryState.ts @@ -3,7 +3,6 @@ import type { QueryClient, QueryState, } from '@tanstack/query-core'; - import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { ServiceOperationInfiniteQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationInvalidateQueries.ts b/packages/react-client/src/service-operation/ServiceOperationInvalidateQueries.ts index 686ab381..6ca7e584 100644 --- a/packages/react-client/src/service-operation/ServiceOperationInvalidateQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationInvalidateQueries.ts @@ -3,7 +3,6 @@ import type { InvalidateOptions, QueryClient, } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationIsFetchingQueries.ts b/packages/react-client/src/service-operation/ServiceOperationIsFetchingQueries.ts index a782daf1..fc14f224 100644 --- a/packages/react-client/src/service-operation/ServiceOperationIsFetchingQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationIsFetchingQueries.ts @@ -1,5 +1,4 @@ import type { DefaultError, QueryClient } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationIsMutatingQueries.ts b/packages/react-client/src/service-operation/ServiceOperationIsMutatingQueries.ts index b1c48e8e..4aa275d3 100644 --- a/packages/react-client/src/service-operation/ServiceOperationIsMutatingQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationIsMutatingQueries.ts @@ -1,5 +1,4 @@ import type { DefaultError, QueryClient } from '@tanstack/query-core'; - import type { MutationFiltersByMutationKey, MutationFiltersByParameters, diff --git a/packages/react-client/src/service-operation/ServiceOperationRefetchQueries.ts b/packages/react-client/src/service-operation/ServiceOperationRefetchQueries.ts index 089375c7..7b5b0a2b 100644 --- a/packages/react-client/src/service-operation/ServiceOperationRefetchQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationRefetchQueries.ts @@ -4,7 +4,6 @@ import type { RefetchOptions, ResetOptions, } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationRemoveQueries.ts b/packages/react-client/src/service-operation/ServiceOperationRemoveQueries.ts index a0dafd85..9b829211 100644 --- a/packages/react-client/src/service-operation/ServiceOperationRemoveQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationRemoveQueries.ts @@ -1,5 +1,4 @@ import type { DefaultError, QueryClient } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationResetQueries.ts b/packages/react-client/src/service-operation/ServiceOperationResetQueries.ts index 9df6c7c8..2c0a1cc8 100644 --- a/packages/react-client/src/service-operation/ServiceOperationResetQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationResetQueries.ts @@ -3,7 +3,6 @@ import type { QueryClient, ResetOptions, } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationSetInfiniteQueryData.ts b/packages/react-client/src/service-operation/ServiceOperationSetInfiniteQueryData.ts index 99147247..83c5c9d8 100644 --- a/packages/react-client/src/service-operation/ServiceOperationSetInfiniteQueryData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationSetInfiniteQueryData.ts @@ -4,7 +4,6 @@ import type { SetDataOptions, Updater, } from '@tanstack/query-core'; - import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { ServiceOperationInfiniteQueryKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationSetQueriesData.ts b/packages/react-client/src/service-operation/ServiceOperationSetQueriesData.ts index 4cfef151..9546b3f2 100644 --- a/packages/react-client/src/service-operation/ServiceOperationSetQueriesData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationSetQueriesData.ts @@ -5,7 +5,6 @@ import type { SetDataOptions, Updater, } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationSetQueryData.ts b/packages/react-client/src/service-operation/ServiceOperationSetQueryData.ts index faceb794..98a5c2c3 100644 --- a/packages/react-client/src/service-operation/ServiceOperationSetQueryData.ts +++ b/packages/react-client/src/service-operation/ServiceOperationSetQueryData.ts @@ -4,7 +4,6 @@ import type { SetDataOptions, Updater, } from '@tanstack/query-core'; - import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; export interface ServiceOperationSetQueryData< diff --git a/packages/react-client/src/service-operation/ServiceOperationUseInfiniteQuery.ts b/packages/react-client/src/service-operation/ServiceOperationUseInfiniteQuery.ts index 43ad67ff..edea4323 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseInfiniteQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseInfiniteQuery.ts @@ -9,7 +9,6 @@ import type { UndefinedInitialDataInfiniteOptions, UseInfiniteQueryResult, } from '@tanstack/react-query'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { ServiceOperationInfiniteQueryKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationUseIsFetchingQueries.ts b/packages/react-client/src/service-operation/ServiceOperationUseIsFetchingQueries.ts index a1494b9f..b629d0ac 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseIsFetchingQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseIsFetchingQueries.ts @@ -1,5 +1,4 @@ import type { DefaultError, QueryClient } from '@tanstack/query-core'; - import type { QueryFiltersByParameters, QueryFiltersByQueryKey, diff --git a/packages/react-client/src/service-operation/ServiceOperationUseIsMutating.ts b/packages/react-client/src/service-operation/ServiceOperationUseIsMutating.ts index 93e4b61f..94c6a243 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseIsMutating.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseIsMutating.ts @@ -1,5 +1,4 @@ import type { DefaultError, QueryClient } from '@tanstack/query-core'; - import type { MutationFiltersByMutationKey, MutationFiltersByParameters, diff --git a/packages/react-client/src/service-operation/ServiceOperationUseMutation.ts b/packages/react-client/src/service-operation/ServiceOperationUseMutation.ts index f729ba7b..c00388dc 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseMutation.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseMutation.ts @@ -3,7 +3,6 @@ import type { UseMutationOptions, UseMutationResult, } from '@tanstack/react-query'; - import type { AreAllOptional } from '../lib/AreAllOptional.js'; import type { ServiceOperationMutationKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationUseMutationState.ts b/packages/react-client/src/service-operation/ServiceOperationUseMutationState.ts index 00e874d0..a74fd663 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseMutationState.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseMutationState.ts @@ -5,7 +5,6 @@ import type { MutationStatus, QueryClient, } from '@tanstack/query-core'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; import type { ServiceOperationMutationKey } from './ServiceOperationKey.js'; import type { MutationVariables } from './ServiceOperationUseMutation.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationUseQueries.ts b/packages/react-client/src/service-operation/ServiceOperationUseQueries.ts index 628036a3..d1f99f1b 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseQueries.ts @@ -1,11 +1,10 @@ +import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; +import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; import { DefaultError, QueriesPlaceholderDataFunction, QueryClient, } from '@tanstack/query-core'; -import type { UseQueryOptions, UseQueryResult } from '@tanstack/react-query'; - -import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; type UseQueryOptionsForUseQueries< TSchema extends { url: string; method: string }, diff --git a/packages/react-client/src/service-operation/ServiceOperationUseQuery.ts b/packages/react-client/src/service-operation/ServiceOperationUseQuery.ts index 52d75b46..3df0b312 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseQuery.ts @@ -5,9 +5,8 @@ import type { UndefinedInitialDataOptions, UseQueryResult, } from '@tanstack/react-query'; - -import { AreAllOptional } from '../lib/AreAllOptional.js'; import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; +import { AreAllOptional } from '../lib/AreAllOptional.js'; export interface ServiceOperationUseQuery< TSchema extends { url: string; method: string }, diff --git a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseInfiniteQuery.ts b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseInfiniteQuery.ts index fdea7c6a..477ab204 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseInfiniteQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseInfiniteQuery.ts @@ -7,7 +7,6 @@ import type { UseSuspenseInfiniteQueryOptions, UseSuspenseInfiniteQueryResult, } from '@tanstack/react-query'; - import type { PartialParameters } from '../lib/PartialParameters.type.js'; import type { OperationInfiniteData } from './OperationInfiniteData.js'; import type { ServiceOperationInfiniteQueryKey } from './ServiceOperationKey.js'; diff --git a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQueries.ts b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQueries.ts index 29d48514..db25cd89 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQueries.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQueries.ts @@ -3,7 +3,6 @@ import type { UseQueryOptions, UseSuspenseQueryResult, } from '@tanstack/react-query'; - import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; type UseQueryOptionsForUseSuspenseQuery< diff --git a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQuery.ts b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQuery.ts index 731d35fd..ec047f35 100644 --- a/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQuery.ts +++ b/packages/react-client/src/service-operation/ServiceOperationUseSuspenseQuery.ts @@ -3,7 +3,6 @@ import type { UseSuspenseQueryOptions, UseSuspenseQueryResult, } from '@tanstack/react-query'; - import type { ServiceOperationQueryKey } from './ServiceOperationKey.js'; export interface ServiceOperationUseSuspenseQuery< diff --git a/packages/react-client/src/tests/QraftSecureRequestFn.test.tsx b/packages/react-client/src/tests/QraftSecureRequestFn.test.tsx index 9b9d4192..efdf6282 100644 --- a/packages/react-client/src/tests/QraftSecureRequestFn.test.tsx +++ b/packages/react-client/src/tests/QraftSecureRequestFn.test.tsx @@ -1,12 +1,10 @@ -import React, { ReactNode } from 'react'; - +import type { RequestFn } from '../lib/requestFn.js'; import { QraftContext as QraftContextDist } from '@openapi-qraft/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; import { act, renderHook, waitFor } from '@testing-library/react'; - +import React, { ReactNode } from 'react'; import { vi } from 'vitest'; - -import { type RequestFn, requestFn } from '../lib/requestFn.js'; +import { requestFn } from '../lib/requestFn.js'; import { QraftSecureRequestFn } from '../Unstable_QraftSecureRequestFn.js'; import { createTestJwt } from './createTestJwt.js'; import { createAPIClient } from './fixtures/api/index.js'; diff --git a/packages/react-client/src/tests/callQueryClientFetchMethod.test.ts b/packages/react-client/src/tests/callQueryClientFetchMethod.test.ts index d5eef2d9..8d9717dd 100644 --- a/packages/react-client/src/tests/callQueryClientFetchMethod.test.ts +++ b/packages/react-client/src/tests/callQueryClientFetchMethod.test.ts @@ -1,5 +1,4 @@ import { QueryClient } from '@tanstack/react-query'; - import { callQueryClientMethodWithQueryKey } from '../lib/callQueryClientFetchMethod.js'; describe('callQueryClientFetchMethod', () => { diff --git a/packages/react-client/src/tests/createTestJwt.test.ts b/packages/react-client/src/tests/createTestJwt.test.ts index 9d95c2a5..23adf0b9 100644 --- a/packages/react-client/src/tests/createTestJwt.test.ts +++ b/packages/react-client/src/tests/createTestJwt.test.ts @@ -1,5 +1,4 @@ import { expect } from 'vitest'; - import { jwtDecode } from '../lib/jwt-decode/index.js'; import { createTestJwt } from './createTestJwt.js'; diff --git a/packages/react-client/src/tests/msw/handlers.ts b/packages/react-client/src/tests/msw/handlers.ts index f1560095..41a18a5d 100644 --- a/packages/react-client/src/tests/msw/handlers.ts +++ b/packages/react-client/src/tests/msw/handlers.ts @@ -1,6 +1,5 @@ import { http, HttpResponse } from 'msw'; import queryString from 'query-string'; - import { Services, services } from '../fixtures/api/index.js'; export const handlers = [ diff --git a/packages/react-client/src/tests/msw/node.ts b/packages/react-client/src/tests/msw/node.ts index 9ea8d0aa..f10a6b64 100644 --- a/packages/react-client/src/tests/msw/node.ts +++ b/packages/react-client/src/tests/msw/node.ts @@ -1,5 +1,4 @@ import { setupServer } from 'msw/node'; - import { handlers } from './handlers.js'; export const server = setupServer(...handlers); diff --git a/packages/react-client/src/tests/qraftAPIClient.test.tsx b/packages/react-client/src/tests/qraftAPIClient.test.tsx index ca6567bb..8e0ff78b 100644 --- a/packages/react-client/src/tests/qraftAPIClient.test.tsx +++ b/packages/react-client/src/tests/qraftAPIClient.test.tsx @@ -1,5 +1,8 @@ -import React, { createContext, ReactNode, useEffect } from 'react'; - +import type { + OperationSchema, + RequestFn, + RequestFnInfo, +} from '../lib/requestFn.js'; import { QraftContext as QraftContextDist } from '@openapi-qraft/react'; import { QueryClient, @@ -7,20 +10,14 @@ import { useQueryClient, } from '@tanstack/react-query'; import { act, renderHook, waitFor } from '@testing-library/react'; - +import React, { createContext, ReactNode, useEffect } from 'react'; import { vi } from 'vitest'; - import { bodySerializer, QraftContextValue, requestFn, urlSerializer, } from '../index.js'; -import type { - OperationSchema, - RequestFn, - RequestFnInfo, -} from '../lib/requestFn.js'; import { createAPIClient } from './fixtures/api/index.js'; const qraft = createAPIClient(); diff --git a/packages/react-client/src/tests/setupTests.ts b/packages/react-client/src/tests/setupTests.ts index fda6926c..2918d4ac 100644 --- a/packages/react-client/src/tests/setupTests.ts +++ b/packages/react-client/src/tests/setupTests.ts @@ -1,7 +1,5 @@ import '@testing-library/jest-dom'; - import { afterAll, afterEach, beforeAll } from 'vitest'; - import { server } from './msw/node.js'; beforeAll(() => { diff --git a/packages/react-client/vitest.config.ts b/packages/react-client/vitest.config.ts index cb95b426..5daf88e4 100644 --- a/packages/react-client/vitest.config.ts +++ b/packages/react-client/vitest.config.ts @@ -1,6 +1,5 @@ -import react from '@vitejs/plugin-react'; - import { fileURLToPath } from 'node:url'; +import react from '@vitejs/plugin-react'; import { defineConfig } from 'vitest/config'; export default defineConfig({ diff --git a/packages/tanstack-query-react-plugin/eslint.config.js b/packages/tanstack-query-react-plugin/eslint.config.js index 518641c2..d8f66c5f 100644 --- a/packages/tanstack-query-react-plugin/eslint.config.js +++ b/packages/tanstack-query-react-plugin/eslint.config.js @@ -1,5 +1,4 @@ import openAPIQraftConfig from '@openapi-qraft/eslint-config/eslint.vanilla.config'; - import globals from 'globals'; export default [ diff --git a/packages/tanstack-query-react-plugin/src/generateCode.ts b/packages/tanstack-query-react-plugin/src/generateCode.ts index 87432f2d..bf532340 100644 --- a/packages/tanstack-query-react-plugin/src/generateCode.ts +++ b/packages/tanstack-query-react-plugin/src/generateCode.ts @@ -1,12 +1,10 @@ +import { URL } from 'node:url'; import { formatFileHeader } from '@openapi-qraft/plugin/lib/formatFileHeader'; import { GeneratorFile } from '@openapi-qraft/plugin/lib/GeneratorFile'; import { Service } from '@openapi-qraft/plugin/lib/open-api/getServices'; import { OutputOptions as OutputOptionsBase } from '@openapi-qraft/plugin/lib/OutputOptions'; - import c from 'ansi-colors'; -import { URL } from 'node:url'; import { Ora } from 'ora'; - import { astToString } from './ts-factory/astToString.js'; import { getClientFactory } from './ts-factory/getClientFactory.js'; import { getIndexFactory } from './ts-factory/getIndexFactory.js'; diff --git a/packages/tanstack-query-react-plugin/src/plugin.spec.ts b/packages/tanstack-query-react-plugin/src/plugin.spec.ts index 4038f1b3..0a723229 100644 --- a/packages/tanstack-query-react-plugin/src/plugin.spec.ts +++ b/packages/tanstack-query-react-plugin/src/plugin.spec.ts @@ -1,5 +1,4 @@ import '@openapi-qraft/plugin/lib/vitestFsMock'; - import fs from 'node:fs'; import { createRequire } from 'node:module'; import { beforeAll, describe, expect, test } from 'vitest'; diff --git a/packages/tanstack-query-react-plugin/src/plugin.ts b/packages/tanstack-query-react-plugin/src/plugin.ts index 703ff94e..e5c63d8f 100644 --- a/packages/tanstack-query-react-plugin/src/plugin.ts +++ b/packages/tanstack-query-react-plugin/src/plugin.ts @@ -1,7 +1,6 @@ import { fileHeader } from '@openapi-qraft/plugin/lib/fileHeader'; import { QraftCommand } from '@openapi-qraft/plugin/lib/QraftCommand'; import { QraftCommandPlugin } from '@openapi-qraft/plugin/lib/QraftCommandPlugin'; - import { generateCode } from './generateCode.js'; export const plugin: QraftCommandPlugin = { diff --git a/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.spec.ts b/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.spec.ts index 2f9be54c..4643442a 100644 --- a/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.spec.ts +++ b/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.spec.ts @@ -1,5 +1,4 @@ import { describe, expect, test } from 'vitest'; - import { maybeResolveImport } from './getIndexFactory.js'; describe('maybeResolveImport', () => { diff --git a/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.ts b/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.ts index 2694be0c..53bcef46 100644 --- a/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.ts +++ b/packages/tanstack-query-react-plugin/src/ts-factory/getIndexFactory.ts @@ -1,6 +1,5 @@ -import ts from 'typescript'; - import type { ServiceImportsFactoryOptions } from './getServiceFactory.js'; +import ts from 'typescript'; export const getIndexFactory = ({ openapiTypesImportPath, diff --git a/packages/tanstack-query-react-plugin/src/ts-factory/getServiceFactory.ts b/packages/tanstack-query-react-plugin/src/ts-factory/getServiceFactory.ts index a98283d6..3af892a2 100644 --- a/packages/tanstack-query-react-plugin/src/ts-factory/getServiceFactory.ts +++ b/packages/tanstack-query-react-plugin/src/ts-factory/getServiceFactory.ts @@ -1,5 +1,4 @@ import { ServiceOperation } from '@openapi-qraft/plugin/lib/open-api/getServices'; - import ts from 'typescript'; const SERVICE_OPERATION_QUERY = 'ServiceOperationQuery'; diff --git a/packages/tanstack-query-react-plugin/src/ts-factory/getServiceIndexFactory.ts b/packages/tanstack-query-react-plugin/src/ts-factory/getServiceIndexFactory.ts index e0bb5261..75ab09ed 100644 --- a/packages/tanstack-query-react-plugin/src/ts-factory/getServiceIndexFactory.ts +++ b/packages/tanstack-query-react-plugin/src/ts-factory/getServiceIndexFactory.ts @@ -1,5 +1,4 @@ import { Service } from '@openapi-qraft/plugin/lib/open-api/getServices'; - import ts from 'typescript'; type Options = { explicitImportExtensions: boolean };