New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jsonpang/openapi-react-query-code-generator

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsonpang/openapi-react-query-code-generator - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

2

dist/package.json
{
"name": "@jsonpang/openapi-react-query-code-generator",
"description": "Uses openapi-typescript-codegen under the hood, and then analyzes the TypeScript AST of the generated files to create TanStack React Query hooks. Supports server-sided rendering w/ NextJS by using client instances of openapi-typescript-codegen.",
"version": "0.1.7",
"version": "0.1.8",
"dependencies": {

@@ -6,0 +6,0 @@ "@tanstack/react-query": "^5.17.15",

@@ -113,2 +113,3 @@ "use strict";

useQuery,
useQueryClient,
} from "@tanstack/react-query";

@@ -130,3 +131,6 @@ ${modelsFileNames.map((fileName) => `import { ${fileName} } from "./models/${fileName}";`).join("\n")}

export const QueryKey${(0, exports.capitalizeFirstLetter)(method.name)} = '${method.name}';
export const invalidateQuery${(0, exports.capitalizeFirstLetter)(method.name)} = async (params: { ${method.params.map((param) => `${param.name}?: ${param.type};`).join("\n ")} }) => {
const queryClient = useQueryClient();
return queryClient.invalidateQueries({ queryKey: [QueryKey${(0, exports.capitalizeFirstLetter)(method.name)}, params] });
};
export const use${(0, exports.capitalizeFirstLetter)(method.name)} = <

@@ -133,0 +137,0 @@ TData = Awaited<ReturnType<typeof DefaultService.prototype.${method.name}>>,

{
"name": "@jsonpang/openapi-react-query-code-generator",
"description": "Uses openapi-typescript-codegen under the hood, and then analyzes the TypeScript AST of the generated files to create TanStack React Query hooks. Supports server-sided rendering w/ NextJS by using client instances of openapi-typescript-codegen.",
"version": "0.1.8",
"version": "0.1.9",
"dependencies": {

@@ -6,0 +6,0 @@ "@tanstack/react-query": "^5.17.15",

@@ -172,2 +172,3 @@ import { generate as openapiTypescriptCodegenWriter } from "openapi-typescript-codegen";

useQuery,
useQueryClient,
} from "@tanstack/react-query";

@@ -190,3 +191,6 @@ ${modelsFileNames.map((fileName) => `import { ${fileName} } from "./models/${fileName}";`).join("\n")}

export const QueryKey${capitalizeFirstLetter(method.name)} = '${method.name}';
export const invalidateQuery${capitalizeFirstLetter(method.name)} = async (params: { ${method.params.map((param) => `${param.name}?: ${param.type};`).join("\n ")} }) => {
const queryClient = useQueryClient();
return queryClient.invalidateQueries({ queryKey: [QueryKey${capitalizeFirstLetter(method.name)}, params] });
};
export const use${capitalizeFirstLetter(method.name)} = <

@@ -193,0 +197,0 @@ TData = Awaited<ReturnType<typeof DefaultService.prototype.${method.name}>>,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc