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

@compas/code-gen

Package Overview
Dependencies
Maintainers
1
Versions
202
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@compas/code-gen - npm Package Compare versions

Comparing version 0.7.6 to 0.8.0

4

package.json
{
"name": "@compas/code-gen",
"version": "0.7.6",
"version": "0.8.0",
"description": "Generate various boring parts of your server",

@@ -24,3 +24,3 @@ "exports": {

"dependencies": {
"@compas/stdlib": "0.7.6"
"@compas/stdlib": "0.8.0"
},

@@ -27,0 +27,0 @@ "author": {

@@ -280,5 +280,5 @@ import { fileBlockEnd, fileBlockStart } from "../file/block.js";

withQueryOptions
? `{ queryOptions?: UseQueryOptions<${
? `{ queryOptions?: Omit<UseQueryOptions<${
contextNames.responseTypeName ?? "unknown"
}, AppErrorResponse, TData> }`
}, AppErrorResponse, TData>, "queryFn"|"queryKey"> }`
: undefined,

@@ -458,9 +458,10 @@ ].filter((it) => !!it);

file,
`return useQuery(${hookName}.queryKey(${
routeHasMandatoryInputs ? "opts" : ""
}),`,
`return useQuery({
queryKey: ${hookName}.queryKey(${
routeHasMandatoryInputs ? "opts" : ""
}),`,
);
fileWrite(
file,
`({ signal }) => {
`queryFn: ({ signal }) => {
${reactQueryCheckIfRequiredVariablesArePresent(

@@ -482,3 +483,3 @@ generateContext,

);
}, options);`,
}, ...options });`,
);

@@ -529,5 +530,5 @@

) => {
return queryClient.fetchQuery(
${hookName}.queryKey(${routeHasMandatoryInputs ? "opts" : ""}),
() => {
return queryClient.fetchQuery({
queryKey: ${hookName}.queryKey(${routeHasMandatoryInputs ? "opts" : ""}),
queryFn: () => {
${reactQueryCheckIfRequiredVariablesArePresent(

@@ -545,3 +546,3 @@ generateContext,

})}
); });
); }, });
}

@@ -561,5 +562,5 @@

) => {
return queryClient.prefetchQuery(
${hookName}.queryKey(${routeHasMandatoryInputs ? "opts" : ""}),
() => {
return queryClient.prefetchQuery({
queryKey: ${hookName}.queryKey(${routeHasMandatoryInputs ? "opts" : ""}),
queryFn: () => {
${reactQueryCheckIfRequiredVariablesArePresent(

@@ -579,3 +580,3 @@ generateContext,

);
});
}, });
}

@@ -597,5 +598,5 @@

}
) => queryClient.invalidateQueries(${hookName}.queryKey(${
) => queryClient.invalidateQueries({ queryKey: ${hookName}.queryKey(${
routeHasMandatoryInputs ? "opts" : ""
}));
}) });

@@ -647,5 +648,5 @@

file,
`export function ${hookName}(options: UseMutationOptions<${defaultedResponseType}, AppErrorResponse, ${upperCaseFirst(
`export function ${hookName}<Context = unknown>(options: UseMutationOptions<${defaultedResponseType}, AppErrorResponse, ${upperCaseFirst(
hookName,
)}Props> = {},`,
)}Props, Context> = {},`,
);

@@ -665,3 +666,3 @@

hookName,
)}Props, unknown> {`,
)}Props, Context> {`,
);

@@ -694,3 +695,3 @@

file,
`return useMutation((variables) => ${apiName}(
`return useMutation({ mutationFn: (variables) => ${apiName}(
${apiInstanceParameter}

@@ -702,3 +703,3 @@ ${parameterListWithExtraction({

})}
), options);
), ...options });
`,

@@ -854,3 +855,3 @@ );

file,
`queryClient.invalidateQueries(["${invalidation.target.group}",`,
`queryClient.invalidateQueries({ queryKey: ["${invalidation.target.group}",`,
);

@@ -866,3 +867,3 @@ if (invalidation.target.name) {

}
fileWrite(file, `]);`);
fileWrite(file, `] });`);
}

@@ -869,0 +870,0 @@

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