@openapi-qraft/react 2.0.1 → 2.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.cjs +1 -2
- package/dist/cjs/lib/callQueryClientMethodWithQueryFilters.cjs.map +1 -1
- package/dist/cjs/lib/jwt-decode/index.cjs +1 -1
- package/dist/cjs/lib/jwt-decode/index.cjs.map +1 -1
- package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js +1 -2
- package/dist/esm/lib/callQueryClientMethodWithQueryFilters.js.map +1 -1
- package/dist/esm/lib/jwt-decode/index.js +1 -1
- package/dist/esm/lib/jwt-decode/index.js.map +1 -1
- package/dist/types/lib/callQueryClientMethodWithQueryFilters.d.ts.map +1 -1
- package/package.json +37 -33
- package/src/lib/callQueryClientMethodWithQueryFilters.ts +0 -1
- package/src/lib/jwt-decode/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @openapi-qraft/react
|
|
2
2
|
|
|
3
|
+
## 2.1.0-beta.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3da985f: Added support for React 19.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- @openapi-qraft/tanstack-query-react-types@2.1.0-beta.0
|
|
12
|
+
|
|
13
|
+
## 2.0.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [45f756b]
|
|
18
|
+
- @openapi-qraft/tanstack-query-react-types@2.0.2
|
|
19
|
+
|
|
3
20
|
## 2.0.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -9,8 +9,7 @@ var composeQueryFilters = require('./composeQueryFilters.cjs');
|
|
|
9
9
|
const filters = args[0];
|
|
10
10
|
const queryClient = qraftOptions.queryClient;
|
|
11
11
|
// @ts-expect-error - Too complex to type
|
|
12
|
-
return queryClient[queryFilterMethod](composeQueryFilters.composeQueryFilters(schema, filters),
|
|
13
|
-
...args.slice(1, args.length));
|
|
12
|
+
return queryClient[queryFilterMethod](composeQueryFilters.composeQueryFilters(schema, filters), ...args.slice(1, args.length));
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
exports.callQueryClientMethodWithQueryFilters = callQueryClientMethodWithQueryFilters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callQueryClientMethodWithQueryFilters.cjs","sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\nimport type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';\nimport type { OperationSchema } from './requestFn.js';\nimport { composeQueryFilters } from './composeQueryFilters.js';\n\n/**\n * Calls a query client method with query filters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryFilters<\n QFMethod extends QueryFilterMethods,\n>(\n qraftOptions: CreateAPIQueryClientOptions,\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args[0];\n const queryClient = qraftOptions.queryClient;\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeQueryFilters(schema, filters as never),\n
|
|
1
|
+
{"version":3,"file":"callQueryClientMethodWithQueryFilters.cjs","sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\nimport type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';\nimport type { OperationSchema } from './requestFn.js';\nimport { composeQueryFilters } from './composeQueryFilters.js';\n\n/**\n * Calls a query client method with query filters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryFilters<\n QFMethod extends QueryFilterMethods,\n>(\n qraftOptions: CreateAPIQueryClientOptions,\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args[0];\n const queryClient = qraftOptions.queryClient;\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeQueryFilters(schema, filters as never),\n ...args.slice(1, args.length)\n );\n}\n\ntype QueryFiltersMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n\ntype QueryFilterMethods =\n | QueryFiltersMethod<'isFetching'>\n | QueryFiltersMethod<'getQueriesData'>\n | QueryFiltersMethod<'setQueriesData'>\n | QueryFiltersMethod<'removeQueries'>\n | QueryFiltersMethod<'resetQueries'>\n | QueryFiltersMethod<'cancelQueries'>\n | QueryFiltersMethod<'invalidateQueries'>\n | QueryFiltersMethod<'refetchQueries'>;\n"],"names":["callQueryClientMethodWithQueryFilters","qraftOptions","queryFilterMethod","schema","args","filters","queryClient","composeQueryFilters","slice","length"],"mappings":";;;;AAKA;;;IAIO,SAASA,qCAGdC,CAAAA,YAAyC,EACzCC,iBAA2B,EAC3BC,MAAuB,EACvBC,IAA4E,EAAA;IAE5E,MAAMC,OAAAA,GAAUD,IAAI,CAAC,CAAE,CAAA,CAAA;IACvB,MAAME,WAAAA,GAAcL,aAAaK,WAAW,CAAA;;AAG5C,IAAA,OAAOA,WAAW,CAACJ,iBAAkB,CAAA,CACnCK,uCAAoBJ,CAAAA,MAAAA,EAAQE,OACzBD,CAAAA,EAAAA,GAAAA,IAAAA,CAAKI,KAAK,CAAC,CAAGJ,EAAAA,IAAAA,CAAKK,MAAM,CAAA,CAAA,CAAA;AAEhC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/lib/jwt-decode/index.ts"],"sourcesContent":["export interface JwtDecodeOptions {\n header?: boolean;\n}\n\nexport interface JwtHeader {\n typ?: string;\n alg?: string;\n kid?: string;\n}\n\nexport interface JwtPayload {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n}\n\nexport class InvalidTokenError extends Error {}\n\nInvalidTokenError.prototype.name = 'InvalidTokenError';\n\n/**\n * Decode a base64 string to a UTF-8 string.\n * Could be used in Node.js or in the browser.\n */\nexport function b64DecodeUnicode(data: string): string {\n if (typeof atob === 'function')\n return decodeURIComponent(Array.from(atob(data), byteToPercent).join(''));\n\n return Buffer.from(data, 'base64').toString('utf-8');\n}\n\nfunction base64UrlDecode(str: string) {\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('base64 string is not of the correct length');\n }\n\n try {\n return b64DecodeUnicode(output);\n } catch (
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/lib/jwt-decode/index.ts"],"sourcesContent":["export interface JwtDecodeOptions {\n header?: boolean;\n}\n\nexport interface JwtHeader {\n typ?: string;\n alg?: string;\n kid?: string;\n}\n\nexport interface JwtPayload {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n}\n\nexport class InvalidTokenError extends Error {}\n\nInvalidTokenError.prototype.name = 'InvalidTokenError';\n\n/**\n * Decode a base64 string to a UTF-8 string.\n * Could be used in Node.js or in the browser.\n */\nexport function b64DecodeUnicode(data: string): string {\n if (typeof atob === 'function')\n return decodeURIComponent(Array.from(atob(data), byteToPercent).join(''));\n\n return Buffer.from(data, 'base64').toString('utf-8');\n}\n\nfunction base64UrlDecode(str: string) {\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('base64 string is not of the correct length');\n }\n\n try {\n return b64DecodeUnicode(output);\n } catch (_err) {\n return atob(output);\n }\n}\n\nexport function jwtDecode<T = JwtHeader>(\n token: string,\n options: JwtDecodeOptions & { header: true }\n): T;\nexport function jwtDecode<T = JwtPayload>(\n token: string,\n options?: JwtDecodeOptions\n): T;\nexport function jwtDecode<T = JwtHeader | JwtPayload>(\n token: string,\n options?: JwtDecodeOptions\n): T {\n if (typeof token !== 'string') {\n throw new InvalidTokenError('Invalid token specified: must be a string');\n }\n\n options ||= {};\n\n const pos = options.header === true ? 0 : 1;\n const part = token.split('.')[pos];\n\n if (typeof part !== 'string') {\n throw new InvalidTokenError(\n `Invalid token specified: missing part #${pos + 1}`\n );\n }\n\n let decoded: string;\n try {\n decoded = base64UrlDecode(part);\n } catch (e) {\n throw new InvalidTokenError(\n `Invalid token specified: invalid base64 for part #${pos + 1} (${(e as Error).message})`\n );\n }\n\n try {\n return JSON.parse(decoded) as T;\n } catch (e) {\n throw new InvalidTokenError(\n `Invalid token specified: invalid json for part #${pos + 1} (${(e as Error).message})`\n );\n }\n}\n\nfunction byteToPercent(b: string) {\n return `%${`00${b.charCodeAt(0).toString(16)}`.slice(-2)}`;\n}\n"],"names":["InvalidTokenError","Error","prototype","name","b64DecodeUnicode","data","atob","decodeURIComponent","Array","from","byteToPercent","join","Buffer","toString","base64UrlDecode","str","output","replace","length","_err","jwtDecode","token","options","pos","header","part","split","decoded","e","message","JSON","parse","b","charCodeAt","slice"],"mappings":";;AAoBO,MAAMA,iBAA0BC,SAAAA,KAAAA,CAAAA;AAAO,CAAA;AAE9CD,iBAAkBE,CAAAA,SAAS,CAACC,IAAI,GAAG,mBAAA,CAAA;AAEnC;;;IAIO,SAASC,gBAAAA,CAAiBC,IAAY,EAAA;AAC3C,IAAA,IAAI,OAAOC,IAAAA,KAAS,UAClB,EAAA,OAAOC,kBAAmBC,CAAAA,KAAAA,CAAMC,IAAI,CAACH,IAAKD,CAAAA,IAAAA,CAAAA,EAAOK,aAAeC,CAA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B,iBACR,CAAA,CAAC,uCAAuC,EAAEuB,GAAAA,GAAM,EAAE,CAAC,CAAA,CAAA;AAEvD,KAAA;IAEA,IAAII,OAAAA,CAAAA;IACJ,IAAI;AACFA,QAAAA,OAAAA,GAAUb,eAAgBW,CAAAA,IAAAA,CAAAA,CAAAA;AAC5B,KAAA,CAAE,OAAOG,CAAG,EAAA;AACV,QAAA,MAAM,IAAI5B,iBAAAA,CACR,CAAC,kDAAkD,EAAEuB,GAAM,GAAA,CAAA,CAAE,EAAE,EAAE,CAACK,CAAYC,OAAO,CAAC,CAAC,CAAC,CAAA,CAAA;AAE5F,KAAA;IAEA,IAAI;QACF,OAAOC,IAAAA,CAAKC,KAAK,CAACJ,OAAAA,CAAAA,CAAAA;AACpB,KAAA,CAAE,OAAOC,CAAG,EAAA;AACV,QAAA,MAAM,IAAI5B,iBAAAA,CACR,CAAC,gDAAgD,EAAEuB,GAAM,GAAA,CAAA,CAAE,EAAE,EAAE,CAACK,CAAYC,OAAO,CAAC,CAAC,CAAC,CAAA,CAAA;AAE1F,KAAA;AACF,CAAA;AAEA,SAASnB,cAAcsB,CAAS,EAAA;AAC9B,IAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAEA,EAAEC,UAAU,CAAC,GAAGpB,QAAQ,CAAC,IAAI,CAAC,CAACqB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAA;AAC5D;;;;;;"}
|
|
@@ -7,8 +7,7 @@ import { composeQueryFilters } from './composeQueryFilters.js';
|
|
|
7
7
|
const filters = args[0];
|
|
8
8
|
const queryClient = qraftOptions.queryClient;
|
|
9
9
|
// @ts-expect-error - Too complex to type
|
|
10
|
-
return queryClient[queryFilterMethod](composeQueryFilters(schema, filters),
|
|
11
|
-
...args.slice(1, args.length));
|
|
10
|
+
return queryClient[queryFilterMethod](composeQueryFilters(schema, filters), ...args.slice(1, args.length));
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
export { callQueryClientMethodWithQueryFilters };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callQueryClientMethodWithQueryFilters.js","sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\nimport type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';\nimport type { OperationSchema } from './requestFn.js';\nimport { composeQueryFilters } from './composeQueryFilters.js';\n\n/**\n * Calls a query client method with query filters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryFilters<\n QFMethod extends QueryFilterMethods,\n>(\n qraftOptions: CreateAPIQueryClientOptions,\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args[0];\n const queryClient = qraftOptions.queryClient;\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeQueryFilters(schema, filters as never),\n
|
|
1
|
+
{"version":3,"file":"callQueryClientMethodWithQueryFilters.js","sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"sourcesContent":["import type { QueryClient } from '@tanstack/query-core';\nimport type { CreateAPIQueryClientOptions } from '../qraftAPIClient.js';\nimport type { OperationSchema } from './requestFn.js';\nimport { composeQueryFilters } from './composeQueryFilters.js';\n\n/**\n * Calls a query client method with query filters and options,\n * and automatically composes the `QueryKey` based on the schema and parameters.\n */\nexport function callQueryClientMethodWithQueryFilters<\n QFMethod extends QueryFilterMethods,\n>(\n qraftOptions: CreateAPIQueryClientOptions,\n queryFilterMethod: QFMethod,\n schema: OperationSchema,\n args: [...Parameters<(typeof QueryClient.prototype)[QFMethod]>, QueryClient]\n): ReturnType<(typeof QueryClient.prototype)[QFMethod]> {\n const filters = args[0];\n const queryClient = qraftOptions.queryClient;\n\n // @ts-expect-error - Too complex to type\n return queryClient[queryFilterMethod](\n composeQueryFilters(schema, filters as never),\n ...args.slice(1, args.length)\n );\n}\n\ntype QueryFiltersMethod<QFMethod extends keyof typeof QueryClient.prototype> =\n QFMethod;\n\ntype QueryFilterMethods =\n | QueryFiltersMethod<'isFetching'>\n | QueryFiltersMethod<'getQueriesData'>\n | QueryFiltersMethod<'setQueriesData'>\n | QueryFiltersMethod<'removeQueries'>\n | QueryFiltersMethod<'resetQueries'>\n | QueryFiltersMethod<'cancelQueries'>\n | QueryFiltersMethod<'invalidateQueries'>\n | QueryFiltersMethod<'refetchQueries'>;\n"],"names":["callQueryClientMethodWithQueryFilters","qraftOptions","queryFilterMethod","schema","args","filters","queryClient","composeQueryFilters","slice","length"],"mappings":";;AAKA;;;IAIO,SAASA,qCAGdC,CAAAA,YAAyC,EACzCC,iBAA2B,EAC3BC,MAAuB,EACvBC,IAA4E,EAAA;IAE5E,MAAMC,OAAAA,GAAUD,IAAI,CAAC,CAAE,CAAA,CAAA;IACvB,MAAME,WAAAA,GAAcL,aAAaK,WAAW,CAAA;;AAG5C,IAAA,OAAOA,WAAW,CAACJ,iBAAkB,CAAA,CACnCK,mBAAoBJ,CAAAA,MAAAA,EAAQE,OACzBD,CAAAA,EAAAA,GAAAA,IAAAA,CAAKI,KAAK,CAAC,CAAGJ,EAAAA,IAAAA,CAAKK,MAAM,CAAA,CAAA,CAAA;AAEhC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/lib/jwt-decode/index.ts"],"sourcesContent":["export interface JwtDecodeOptions {\n header?: boolean;\n}\n\nexport interface JwtHeader {\n typ?: string;\n alg?: string;\n kid?: string;\n}\n\nexport interface JwtPayload {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n}\n\nexport class InvalidTokenError extends Error {}\n\nInvalidTokenError.prototype.name = 'InvalidTokenError';\n\n/**\n * Decode a base64 string to a UTF-8 string.\n * Could be used in Node.js or in the browser.\n */\nexport function b64DecodeUnicode(data: string): string {\n if (typeof atob === 'function')\n return decodeURIComponent(Array.from(atob(data), byteToPercent).join(''));\n\n return Buffer.from(data, 'base64').toString('utf-8');\n}\n\nfunction base64UrlDecode(str: string) {\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('base64 string is not of the correct length');\n }\n\n try {\n return b64DecodeUnicode(output);\n } catch (
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/lib/jwt-decode/index.ts"],"sourcesContent":["export interface JwtDecodeOptions {\n header?: boolean;\n}\n\nexport interface JwtHeader {\n typ?: string;\n alg?: string;\n kid?: string;\n}\n\nexport interface JwtPayload {\n iss?: string;\n sub?: string;\n aud?: string[] | string;\n exp?: number;\n nbf?: number;\n iat?: number;\n jti?: string;\n}\n\nexport class InvalidTokenError extends Error {}\n\nInvalidTokenError.prototype.name = 'InvalidTokenError';\n\n/**\n * Decode a base64 string to a UTF-8 string.\n * Could be used in Node.js or in the browser.\n */\nexport function b64DecodeUnicode(data: string): string {\n if (typeof atob === 'function')\n return decodeURIComponent(Array.from(atob(data), byteToPercent).join(''));\n\n return Buffer.from(data, 'base64').toString('utf-8');\n}\n\nfunction base64UrlDecode(str: string) {\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw new Error('base64 string is not of the correct length');\n }\n\n try {\n return b64DecodeUnicode(output);\n } catch (_err) {\n return atob(output);\n }\n}\n\nexport function jwtDecode<T = JwtHeader>(\n token: string,\n options: JwtDecodeOptions & { header: true }\n): T;\nexport function jwtDecode<T = JwtPayload>(\n token: string,\n options?: JwtDecodeOptions\n): T;\nexport function jwtDecode<T = JwtHeader | JwtPayload>(\n token: string,\n options?: JwtDecodeOptions\n): T {\n if (typeof token !== 'string') {\n throw new InvalidTokenError('Invalid token specified: must be a string');\n }\n\n options ||= {};\n\n const pos = options.header === true ? 0 : 1;\n const part = token.split('.')[pos];\n\n if (typeof part !== 'string') {\n throw new InvalidTokenError(\n `Invalid token specified: missing part #${pos + 1}`\n );\n }\n\n let decoded: string;\n try {\n decoded = base64UrlDecode(part);\n } catch (e) {\n throw new InvalidTokenError(\n `Invalid token specified: invalid base64 for part #${pos + 1} (${(e as Error).message})`\n );\n }\n\n try {\n return JSON.parse(decoded) as T;\n } catch (e) {\n throw new InvalidTokenError(\n `Invalid token specified: invalid json for part #${pos + 1} (${(e as Error).message})`\n );\n }\n}\n\nfunction byteToPercent(b: string) {\n return `%${`00${b.charCodeAt(0).toString(16)}`.slice(-2)}`;\n}\n"],"names":["InvalidTokenError","Error","prototype","name","b64DecodeUnicode","data","atob","decodeURIComponent","Array","from","byteToPercent","join","Buffer","toString","base64UrlDecode","str","output","replace","length","_err","jwtDecode","token","options","pos","header","part","split","decoded","e","message","JSON","parse","b","charCodeAt","slice"],"mappings":"AAoBO,MAAMA,iBAA0BC,SAAAA,KAAAA,CAAAA;AAAO,CAAA;AAE9CD,iBAAkBE,CAAAA,SAAS,CAACC,IAAI,GAAG,mBAAA,CAAA;AAEnC;;;IAIO,SAASC,gBAAAA,CAAiBC,IAAY,EAAA;AAC3C,IAAA,IAAI,OAAOC,IAAAA,KAAS,UAClB,EAAA,OAAOC,kBAAmBC,CAAAA,KAAAA,CAAMC,IAAI,CAACH,IAAKD,CAAAA,IAAAA,CAAAA,EAAOK,aAAeC,CAAAA,CAAAA,IAAI,CAAC,EAAA,CAAA,CAAA,CAAA;AAEvE,IAAA,OAAOC,OAAOH,IAAI,CAACJ,IAAM,EAAA,QAAA,CAAA,CAAUQ,QAAQ,CAAC,OAAA,CAAA,CAAA;AAC9C,CAAA;AAEA,SAASC,gBAAgBC,GAAW,EAAA;IAClC,IAAIC,MAAAA,GAASD,IAAIE,OAAO,CAAC,MAAM,GAAKA,CAAAA,CAAAA,OAAO,CAAC,IAAM,EAAA,GAAA,CA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1
|
+
{"version":3,"file":"callQueryClientMethodWithQueryFilters.d.ts","sourceRoot":"","sources":["../../../src/lib/callQueryClientMethodWithQueryFilters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGtD;;;GAGG;AACH,wBAAgB,qCAAqC,CACnD,QAAQ,SAAS,kBAAkB,EAEnC,YAAY,EAAE,2BAA2B,EACzC,iBAAiB,EAAE,QAAQ,EAC3B,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,GAC3E,UAAU,CAAC,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC,CAStD;AAED,KAAK,kBAAkB,CAAC,QAAQ,SAAS,MAAM,OAAO,WAAW,CAAC,SAAS,IACzE,QAAQ,CAAC;AAEX,KAAK,kBAAkB,GACnB,kBAAkB,CAAC,YAAY,CAAC,GAChC,kBAAkB,CAAC,gBAAgB,CAAC,GACpC,kBAAkB,CAAC,gBAAgB,CAAC,GACpC,kBAAkB,CAAC,eAAe,CAAC,GACnC,kBAAkB,CAAC,cAAc,CAAC,GAClC,kBAAkB,CAAC,eAAe,CAAC,GACnC,kBAAkB,CAAC,mBAAmB,CAAC,GACvC,kBAAkB,CAAC,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-qraft/react",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.1.0-beta.0",
|
|
4
4
|
"description": "OpenAPI client for React, providing type-safe requests and dynamic TanStack Query React Hooks via a modular, Proxy-based architecture.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "NODE_ENV=production rollup --config rollup.config.mjs && tsc --project tsconfig.build.json --emitDeclarationOnly",
|
|
@@ -15,39 +15,43 @@
|
|
|
15
15
|
},
|
|
16
16
|
"sideEffects": false,
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@openapi-qraft/tanstack-query-react-types": "2.0.
|
|
18
|
+
"@openapi-qraft/tanstack-query-react-types": "2.1.0-beta.0"
|
|
19
|
+
},
|
|
20
|
+
"peerDependencies": {
|
|
21
|
+
"@tanstack/query-core": "^5.0.0",
|
|
22
|
+
"@tanstack/react-query": "^5.0.0",
|
|
23
|
+
"react": "^18 || ^19"
|
|
19
24
|
},
|
|
20
25
|
"devDependencies": {
|
|
21
|
-
"@openapi-qraft/cli": "2.0.
|
|
26
|
+
"@openapi-qraft/cli": "2.1.0-beta.0",
|
|
22
27
|
"@openapi-qraft/eslint-config": "1.0.0",
|
|
23
|
-
"@openapi-qraft/openapi-typescript-plugin": "^1.2.
|
|
28
|
+
"@openapi-qraft/openapi-typescript-plugin": "^1.2.3-beta.0",
|
|
24
29
|
"@openapi-qraft/rollup-config": "1.1.0",
|
|
25
|
-
"@openapi-qraft/tanstack-query-react-plugin": "2.0.
|
|
30
|
+
"@openapi-qraft/tanstack-query-react-plugin": "2.1.0-beta.0",
|
|
26
31
|
"@openapi-qraft/test-fixtures": "1.0.0",
|
|
27
|
-
"@tanstack/
|
|
28
|
-
"@
|
|
29
|
-
"@testing-library/
|
|
30
|
-
"@testing-library/
|
|
32
|
+
"@tanstack/query-core": "^5.66.3",
|
|
33
|
+
"@tanstack/react-query": "^5.66.3",
|
|
34
|
+
"@testing-library/dom": "^10.4.0",
|
|
35
|
+
"@testing-library/react": "^16.2.0",
|
|
31
36
|
"@types/jscodeshift": "^0.11.11",
|
|
32
|
-
"@types/react": "^
|
|
33
|
-
"@
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
+
"@types/react": "^19.0.9",
|
|
38
|
+
"@types/react-dom": "^19.0.3",
|
|
39
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
40
|
+
"@vitest/coverage-v8": "^3.0.5",
|
|
41
|
+
"eslint": "^9.20.1",
|
|
42
|
+
"eslint-plugin-react-compiler": "19.0.0-beta-30d8a17-20250209",
|
|
43
|
+
"global-jsdom": "^26.0.0",
|
|
37
44
|
"jscodeshift": "^17.0.0",
|
|
38
|
-
"jsdom": "^
|
|
39
|
-
"msw": "^2.
|
|
45
|
+
"jsdom": "^26.0.0",
|
|
46
|
+
"msw": "^2.7.0",
|
|
40
47
|
"prettier": "^3.3.3",
|
|
41
48
|
"query-string": "^8.2.0",
|
|
42
|
-
"react": "^
|
|
49
|
+
"react": "^19.0.0",
|
|
50
|
+
"react-dom": "^19.0.0",
|
|
43
51
|
"rimraf": "^5.0.10",
|
|
44
52
|
"rollup": "~4.22.4",
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
"peerDependencies": {
|
|
48
|
-
"@tanstack/query-core": "^5.0.0",
|
|
49
|
-
"@tanstack/react-query": "^5.0.0",
|
|
50
|
-
"react": "^18.0.0"
|
|
53
|
+
"typescript": "^5.6.2",
|
|
54
|
+
"vitest": "^3.0.5"
|
|
51
55
|
},
|
|
52
56
|
"files": [
|
|
53
57
|
"dist",
|
|
@@ -58,29 +62,29 @@
|
|
|
58
62
|
"type": "module",
|
|
59
63
|
"exports": {
|
|
60
64
|
".": {
|
|
65
|
+
"types": "./dist/types/index.d.ts",
|
|
61
66
|
"import": "./dist/esm/index.js",
|
|
62
|
-
"require": "./dist/cjs/index.cjs"
|
|
63
|
-
"types": "./dist/types/index.d.ts"
|
|
67
|
+
"require": "./dist/cjs/index.cjs"
|
|
64
68
|
},
|
|
65
69
|
"./callbacks/*": {
|
|
70
|
+
"types": "./dist/types/callbacks/*.d.ts",
|
|
66
71
|
"import": "./dist/esm/callbacks/*.js",
|
|
67
|
-
"require": "./dist/cjs/callbacks/*.cjs"
|
|
68
|
-
"types": "./dist/types/callbacks/*.d.ts"
|
|
72
|
+
"require": "./dist/cjs/callbacks/*.cjs"
|
|
69
73
|
},
|
|
70
74
|
"./Unstable_QraftSecureRequestFn": {
|
|
75
|
+
"types": "./dist/types/Unstable_QraftSecureRequestFn.d.ts",
|
|
71
76
|
"import": "./dist/esm/Unstable_QraftSecureRequestFn.js",
|
|
72
|
-
"require": "./dist/cjs/Unstable_QraftSecureRequestFn.cjs"
|
|
73
|
-
"types": "./dist/types/Unstable_QraftSecureRequestFn.d.ts"
|
|
77
|
+
"require": "./dist/cjs/Unstable_QraftSecureRequestFn.cjs"
|
|
74
78
|
},
|
|
75
79
|
"./qraftPredefinedParametersRequestFn": {
|
|
80
|
+
"types": "./dist/types/qraftPredefinedParametersRequestFn.d.ts",
|
|
76
81
|
"import": "./dist/esm/qraftPredefinedParametersRequestFn.js",
|
|
77
|
-
"require": "./dist/cjs/qraftPredefinedParametersRequestFn.cjs"
|
|
78
|
-
"types": "./dist/types/qraftPredefinedParametersRequestFn.d.ts"
|
|
82
|
+
"require": "./dist/cjs/qraftPredefinedParametersRequestFn.cjs"
|
|
79
83
|
},
|
|
80
84
|
"./unstable__responseUtils": {
|
|
85
|
+
"types": "./dist/types/unstable__responseUtils.d.ts",
|
|
81
86
|
"import": "./dist/esm/unstable__responseUtils.js",
|
|
82
|
-
"require": "./dist/cjs/unstable__responseUtils.cjs"
|
|
83
|
-
"types": "./dist/types/unstable__responseUtils.d.ts"
|
|
87
|
+
"require": "./dist/cjs/unstable__responseUtils.cjs"
|
|
84
88
|
},
|
|
85
89
|
"./package.json": "./package.json"
|
|
86
90
|
},
|
|
@@ -21,7 +21,6 @@ export function callQueryClientMethodWithQueryFilters<
|
|
|
21
21
|
// @ts-expect-error - Too complex to type
|
|
22
22
|
return queryClient[queryFilterMethod](
|
|
23
23
|
composeQueryFilters(schema, filters as never),
|
|
24
|
-
// @ts-expect-error - Argument types are too complex
|
|
25
24
|
...args.slice(1, args.length)
|
|
26
25
|
);
|
|
27
26
|
}
|