typed-openapi 1.1.2 → 1.3.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.
|
@@ -685,8 +685,8 @@ var getTransitiveDependencies = (directDependencies) => {
|
|
|
685
685
|
|
|
686
686
|
// src/ts-factory.ts
|
|
687
687
|
var tsFactory = createFactory({
|
|
688
|
-
union: (types) => types.map(unwrap).join(" | ")
|
|
689
|
-
intersection: (types) => types.map(unwrap).join(" & ")
|
|
688
|
+
union: (types) => `(${types.map(unwrap).join(" | ")})`,
|
|
689
|
+
intersection: (types) => `(${types.map(unwrap).join(" & ")})`,
|
|
690
690
|
array: (type2) => `Array<${unwrap(type2)}>`,
|
|
691
691
|
optional: (type2) => `${unwrap(type2)} | undefined`,
|
|
692
692
|
reference: (name, typeArgs) => `${name}${typeArgs ? `<${typeArgs.map(unwrap).join(", ")}>` : ""}`,
|
|
@@ -918,7 +918,7 @@ var generateTanstackQueryFile = async (ctx) => {
|
|
|
918
918
|
/** type-only property if you need easy access to the endpoint params */
|
|
919
919
|
"~endpoint": {} as TEndpoint,
|
|
920
920
|
queryKey,
|
|
921
|
-
|
|
921
|
+
queryOptions: queryOptions({
|
|
922
922
|
queryFn: async ({ queryKey, signal, }) => {
|
|
923
923
|
const res = await this.client.${method}(path, {
|
|
924
924
|
...params,
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -78,7 +78,7 @@ export const generateTanstackQueryFile = async (ctx: GeneratorContext & { relati
|
|
|
78
78
|
/** type-only property if you need easy access to the endpoint params */
|
|
79
79
|
"~endpoint": {} as TEndpoint,
|
|
80
80
|
queryKey,
|
|
81
|
-
|
|
81
|
+
queryOptions: queryOptions({
|
|
82
82
|
queryFn: async ({ queryKey, signal, }) => {
|
|
83
83
|
const res = await this.client.${method}(path, {
|
|
84
84
|
...params,
|
package/src/ts-factory.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { createFactory, unwrap } from "./box-factory.ts";
|
|
|
3
3
|
import { wrapWithQuotesIfNeeded } from "./string-utils.ts";
|
|
4
4
|
|
|
5
5
|
export const tsFactory = createFactory({
|
|
6
|
-
union: (types) => types.map(unwrap).join(" | ")
|
|
7
|
-
intersection: (types) => types.map(unwrap).join(" & ")
|
|
6
|
+
union: (types) => `(${types.map(unwrap).join(" | ")})`,
|
|
7
|
+
intersection: (types) => `(${types.map(unwrap).join(" & ")})`,
|
|
8
8
|
array: (type) => `Array<${unwrap(type)}>`,
|
|
9
9
|
optional: (type) => `${unwrap(type)} | undefined`,
|
|
10
10
|
reference: (name, typeArgs) => `${name}${typeArgs ? `<${typeArgs.map(unwrap).join(", ")}>` : ""}`,
|