@ps-aux/api-client-gen 0.7.0-rc.5 → 0.7.0-rc.7
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/README.md +22 -9
- package/dist/bin.cjs +5 -6
- package/dist/bin.mjs +3 -4
- package/dist/generate.cjs +14297 -0
- package/dist/generate.mjs +14272 -0
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +52 -16
- package/dist/index.d.mts +52 -16
- package/dist/index.d.ts +52 -16
- package/dist/index.mjs +6 -6
- package/package.json +4 -3
- package/templates/{http-client.eta → legacy/http-client.eta} +4 -4
- package/templates/{procedure-call.ejs → legacy/procedure-call.ejs} +4 -4
- package/dist/generateApiClient.cjs +0 -7050
- package/dist/generateApiClient.mjs +0 -7025
- /package/templates/{api.ejs → legacy/api.ejs} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var generate = require('./generate.cjs');
|
|
4
|
+
require('node:fs');
|
|
5
|
+
require('node:path');
|
|
6
|
+
require('c12');
|
|
4
7
|
require('path');
|
|
5
8
|
require('fs');
|
|
6
|
-
require('
|
|
7
|
-
require('node:
|
|
9
|
+
require('ts-to-zod');
|
|
10
|
+
require('node:fs/promises');
|
|
8
11
|
require('swagger-typescript-api');
|
|
9
12
|
require('node:url');
|
|
10
|
-
require('node:fs/promises');
|
|
11
|
-
require('node:fs');
|
|
12
|
-
require('ts-to-zod');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
exports.defineConfig =
|
|
17
|
-
exports.generateApiClient =
|
|
16
|
+
exports.defineConfig = generate.defineConfig;
|
|
17
|
+
exports.generateApiClient = generate.generateApiClient;
|
package/dist/index.d.cts
CHANGED
|
@@ -2068,16 +2068,26 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
2068
2068
|
unwrap(): T;
|
|
2069
2069
|
}
|
|
2070
2070
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2071
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
2072
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2073
|
+
}
|
|
2074
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
2071
2075
|
|
|
2072
2076
|
declare const profileConfigSchema: ZodObject<{
|
|
2073
2077
|
srcSpec: ZodString;
|
|
2074
|
-
|
|
2078
|
+
outputDir: ZodString;
|
|
2075
2079
|
apiName: ZodString;
|
|
2076
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2080
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2077
2081
|
selection: ZodOptional<ZodObject<{
|
|
2078
2082
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2079
2083
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2080
2084
|
}, $strict>>;
|
|
2085
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2086
|
+
type: ZodDefault<ZodEnum<{
|
|
2087
|
+
promise: "promise";
|
|
2088
|
+
rxjs: "rxjs";
|
|
2089
|
+
}>>;
|
|
2090
|
+
}, $strict>>;
|
|
2081
2091
|
codegen: ZodPrefault<ZodObject<{
|
|
2082
2092
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2083
2093
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2108,27 +2118,43 @@ declare const profileConfigSchema: ZodObject<{
|
|
|
2108
2118
|
}, $strict>, ZodObject<{
|
|
2109
2119
|
legacy: ZodObject<{
|
|
2110
2120
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2121
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2122
|
+
symbol: ZodString;
|
|
2123
|
+
import: ZodOptional<ZodString>;
|
|
2124
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2125
|
+
}, $strict>>;
|
|
2111
2126
|
}, $strict>;
|
|
2112
|
-
}, $strict>]
|
|
2113
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2114
|
-
symbol: ZodString;
|
|
2115
|
-
import: ZodOptional<ZodString>;
|
|
2116
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2117
|
-
}, $strict>>;
|
|
2127
|
+
}, $strict>]>>;
|
|
2118
2128
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2119
2129
|
enabled: ZodOptional<ZodBoolean>;
|
|
2120
2130
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2121
2131
|
}, $strict>>;
|
|
2132
|
+
files: ZodOptional<ZodObject<{
|
|
2133
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2134
|
+
name: string;
|
|
2135
|
+
ext: string;
|
|
2136
|
+
}) => string, (req: {
|
|
2137
|
+
name: string;
|
|
2138
|
+
ext: string;
|
|
2139
|
+
}) => string>>;
|
|
2140
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2141
|
+
}, $strict>>;
|
|
2122
2142
|
}, $strict>;
|
|
2123
2143
|
declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
2124
2144
|
srcSpec: ZodString;
|
|
2125
|
-
|
|
2145
|
+
outputDir: ZodString;
|
|
2126
2146
|
apiName: ZodString;
|
|
2127
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2147
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2128
2148
|
selection: ZodOptional<ZodObject<{
|
|
2129
2149
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2130
2150
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2131
2151
|
}, $strict>>;
|
|
2152
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2153
|
+
type: ZodDefault<ZodEnum<{
|
|
2154
|
+
promise: "promise";
|
|
2155
|
+
rxjs: "rxjs";
|
|
2156
|
+
}>>;
|
|
2157
|
+
}, $strict>>;
|
|
2132
2158
|
codegen: ZodPrefault<ZodObject<{
|
|
2133
2159
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2134
2160
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2159,17 +2185,27 @@ declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
|
2159
2185
|
}, $strict>, ZodObject<{
|
|
2160
2186
|
legacy: ZodObject<{
|
|
2161
2187
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2188
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2189
|
+
symbol: ZodString;
|
|
2190
|
+
import: ZodOptional<ZodString>;
|
|
2191
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2192
|
+
}, $strict>>;
|
|
2162
2193
|
}, $strict>;
|
|
2163
|
-
}, $strict>]
|
|
2164
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2165
|
-
symbol: ZodString;
|
|
2166
|
-
import: ZodOptional<ZodString>;
|
|
2167
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2168
|
-
}, $strict>>;
|
|
2194
|
+
}, $strict>]>>;
|
|
2169
2195
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2170
2196
|
enabled: ZodOptional<ZodBoolean>;
|
|
2171
2197
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2172
2198
|
}, $strict>>;
|
|
2199
|
+
files: ZodOptional<ZodObject<{
|
|
2200
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2201
|
+
name: string;
|
|
2202
|
+
ext: string;
|
|
2203
|
+
}) => string, (req: {
|
|
2204
|
+
name: string;
|
|
2205
|
+
ext: string;
|
|
2206
|
+
}) => string>>;
|
|
2207
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2208
|
+
}, $strict>>;
|
|
2173
2209
|
}, $strict>>;
|
|
2174
2210
|
type ProfileConfigInput = input<typeof profileConfigSchema>;
|
|
2175
2211
|
type ProfileConfig = output<typeof profileConfigSchema>;
|
package/dist/index.d.mts
CHANGED
|
@@ -2068,16 +2068,26 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
2068
2068
|
unwrap(): T;
|
|
2069
2069
|
}
|
|
2070
2070
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2071
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
2072
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2073
|
+
}
|
|
2074
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
2071
2075
|
|
|
2072
2076
|
declare const profileConfigSchema: ZodObject<{
|
|
2073
2077
|
srcSpec: ZodString;
|
|
2074
|
-
|
|
2078
|
+
outputDir: ZodString;
|
|
2075
2079
|
apiName: ZodString;
|
|
2076
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2080
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2077
2081
|
selection: ZodOptional<ZodObject<{
|
|
2078
2082
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2079
2083
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2080
2084
|
}, $strict>>;
|
|
2085
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2086
|
+
type: ZodDefault<ZodEnum<{
|
|
2087
|
+
promise: "promise";
|
|
2088
|
+
rxjs: "rxjs";
|
|
2089
|
+
}>>;
|
|
2090
|
+
}, $strict>>;
|
|
2081
2091
|
codegen: ZodPrefault<ZodObject<{
|
|
2082
2092
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2083
2093
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2108,27 +2118,43 @@ declare const profileConfigSchema: ZodObject<{
|
|
|
2108
2118
|
}, $strict>, ZodObject<{
|
|
2109
2119
|
legacy: ZodObject<{
|
|
2110
2120
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2121
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2122
|
+
symbol: ZodString;
|
|
2123
|
+
import: ZodOptional<ZodString>;
|
|
2124
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2125
|
+
}, $strict>>;
|
|
2111
2126
|
}, $strict>;
|
|
2112
|
-
}, $strict>]
|
|
2113
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2114
|
-
symbol: ZodString;
|
|
2115
|
-
import: ZodOptional<ZodString>;
|
|
2116
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2117
|
-
}, $strict>>;
|
|
2127
|
+
}, $strict>]>>;
|
|
2118
2128
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2119
2129
|
enabled: ZodOptional<ZodBoolean>;
|
|
2120
2130
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2121
2131
|
}, $strict>>;
|
|
2132
|
+
files: ZodOptional<ZodObject<{
|
|
2133
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2134
|
+
name: string;
|
|
2135
|
+
ext: string;
|
|
2136
|
+
}) => string, (req: {
|
|
2137
|
+
name: string;
|
|
2138
|
+
ext: string;
|
|
2139
|
+
}) => string>>;
|
|
2140
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2141
|
+
}, $strict>>;
|
|
2122
2142
|
}, $strict>;
|
|
2123
2143
|
declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
2124
2144
|
srcSpec: ZodString;
|
|
2125
|
-
|
|
2145
|
+
outputDir: ZodString;
|
|
2126
2146
|
apiName: ZodString;
|
|
2127
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2147
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2128
2148
|
selection: ZodOptional<ZodObject<{
|
|
2129
2149
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2130
2150
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2131
2151
|
}, $strict>>;
|
|
2152
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2153
|
+
type: ZodDefault<ZodEnum<{
|
|
2154
|
+
promise: "promise";
|
|
2155
|
+
rxjs: "rxjs";
|
|
2156
|
+
}>>;
|
|
2157
|
+
}, $strict>>;
|
|
2132
2158
|
codegen: ZodPrefault<ZodObject<{
|
|
2133
2159
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2134
2160
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2159,17 +2185,27 @@ declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
|
2159
2185
|
}, $strict>, ZodObject<{
|
|
2160
2186
|
legacy: ZodObject<{
|
|
2161
2187
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2188
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2189
|
+
symbol: ZodString;
|
|
2190
|
+
import: ZodOptional<ZodString>;
|
|
2191
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2192
|
+
}, $strict>>;
|
|
2162
2193
|
}, $strict>;
|
|
2163
|
-
}, $strict>]
|
|
2164
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2165
|
-
symbol: ZodString;
|
|
2166
|
-
import: ZodOptional<ZodString>;
|
|
2167
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2168
|
-
}, $strict>>;
|
|
2194
|
+
}, $strict>]>>;
|
|
2169
2195
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2170
2196
|
enabled: ZodOptional<ZodBoolean>;
|
|
2171
2197
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2172
2198
|
}, $strict>>;
|
|
2199
|
+
files: ZodOptional<ZodObject<{
|
|
2200
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2201
|
+
name: string;
|
|
2202
|
+
ext: string;
|
|
2203
|
+
}) => string, (req: {
|
|
2204
|
+
name: string;
|
|
2205
|
+
ext: string;
|
|
2206
|
+
}) => string>>;
|
|
2207
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2208
|
+
}, $strict>>;
|
|
2173
2209
|
}, $strict>>;
|
|
2174
2210
|
type ProfileConfigInput = input<typeof profileConfigSchema>;
|
|
2175
2211
|
type ProfileConfig = output<typeof profileConfigSchema>;
|
package/dist/index.d.ts
CHANGED
|
@@ -2068,16 +2068,26 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
|
|
|
2068
2068
|
unwrap(): T;
|
|
2069
2069
|
}
|
|
2070
2070
|
declare const ZodReadonly: $constructor<ZodReadonly>;
|
|
2071
|
+
interface ZodCustom<O = unknown, I = unknown> extends _ZodType<$ZodCustomInternals<O, I>>, $ZodCustom<O, I> {
|
|
2072
|
+
"~standard": ZodStandardSchemaWithJSON<this>;
|
|
2073
|
+
}
|
|
2074
|
+
declare const ZodCustom: $constructor<ZodCustom>;
|
|
2071
2075
|
|
|
2072
2076
|
declare const profileConfigSchema: ZodObject<{
|
|
2073
2077
|
srcSpec: ZodString;
|
|
2074
|
-
|
|
2078
|
+
outputDir: ZodString;
|
|
2075
2079
|
apiName: ZodString;
|
|
2076
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2080
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2077
2081
|
selection: ZodOptional<ZodObject<{
|
|
2078
2082
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2079
2083
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2080
2084
|
}, $strict>>;
|
|
2085
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2086
|
+
type: ZodDefault<ZodEnum<{
|
|
2087
|
+
promise: "promise";
|
|
2088
|
+
rxjs: "rxjs";
|
|
2089
|
+
}>>;
|
|
2090
|
+
}, $strict>>;
|
|
2081
2091
|
codegen: ZodPrefault<ZodObject<{
|
|
2082
2092
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2083
2093
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2108,27 +2118,43 @@ declare const profileConfigSchema: ZodObject<{
|
|
|
2108
2118
|
}, $strict>, ZodObject<{
|
|
2109
2119
|
legacy: ZodObject<{
|
|
2110
2120
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2121
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2122
|
+
symbol: ZodString;
|
|
2123
|
+
import: ZodOptional<ZodString>;
|
|
2124
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2125
|
+
}, $strict>>;
|
|
2111
2126
|
}, $strict>;
|
|
2112
|
-
}, $strict>]
|
|
2113
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2114
|
-
symbol: ZodString;
|
|
2115
|
-
import: ZodOptional<ZodString>;
|
|
2116
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2117
|
-
}, $strict>>;
|
|
2127
|
+
}, $strict>]>>;
|
|
2118
2128
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2119
2129
|
enabled: ZodOptional<ZodBoolean>;
|
|
2120
2130
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2121
2131
|
}, $strict>>;
|
|
2132
|
+
files: ZodOptional<ZodObject<{
|
|
2133
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2134
|
+
name: string;
|
|
2135
|
+
ext: string;
|
|
2136
|
+
}) => string, (req: {
|
|
2137
|
+
name: string;
|
|
2138
|
+
ext: string;
|
|
2139
|
+
}) => string>>;
|
|
2140
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2141
|
+
}, $strict>>;
|
|
2122
2142
|
}, $strict>;
|
|
2123
2143
|
declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
2124
2144
|
srcSpec: ZodString;
|
|
2125
|
-
|
|
2145
|
+
outputDir: ZodString;
|
|
2126
2146
|
apiName: ZodString;
|
|
2127
|
-
openApiGenerator: ZodUnion<readonly [ZodObject<{
|
|
2147
|
+
openApiGenerator: ZodPrefault<ZodUnion<readonly [ZodObject<{
|
|
2128
2148
|
selection: ZodOptional<ZodObject<{
|
|
2129
2149
|
ignoreOperationsWithTags: ZodDefault<ZodArray<ZodString>>;
|
|
2130
2150
|
allSchemas: ZodDefault<ZodBoolean>;
|
|
2131
2151
|
}, $strict>>;
|
|
2152
|
+
httpClient: ZodPrefault<ZodObject<{
|
|
2153
|
+
type: ZodDefault<ZodEnum<{
|
|
2154
|
+
promise: "promise";
|
|
2155
|
+
rxjs: "rxjs";
|
|
2156
|
+
}>>;
|
|
2157
|
+
}, $strict>>;
|
|
2132
2158
|
codegen: ZodPrefault<ZodObject<{
|
|
2133
2159
|
unwrap: ZodDefault<ZodBoolean>;
|
|
2134
2160
|
withRequestParams: ZodDefault<ZodBoolean>;
|
|
@@ -2159,17 +2185,27 @@ declare const configSchema: ZodRecord<ZodString, ZodObject<{
|
|
|
2159
2185
|
}, $strict>, ZodObject<{
|
|
2160
2186
|
legacy: ZodObject<{
|
|
2161
2187
|
ignoreOperationsWithTags: ZodOptional<ZodArray<ZodString>>;
|
|
2188
|
+
responseWrapper: ZodOptional<ZodObject<{
|
|
2189
|
+
symbol: ZodString;
|
|
2190
|
+
import: ZodOptional<ZodString>;
|
|
2191
|
+
unwrapExpr: ZodOptional<ZodString>;
|
|
2192
|
+
}, $strict>>;
|
|
2162
2193
|
}, $strict>;
|
|
2163
|
-
}, $strict>]
|
|
2164
|
-
responseWrapper: ZodOptional<ZodObject<{
|
|
2165
|
-
symbol: ZodString;
|
|
2166
|
-
import: ZodOptional<ZodString>;
|
|
2167
|
-
unwrapExpr: ZodOptional<ZodString>;
|
|
2168
|
-
}, $strict>>;
|
|
2194
|
+
}, $strict>]>>;
|
|
2169
2195
|
zodSchemas: ZodOptional<ZodObject<{
|
|
2170
2196
|
enabled: ZodOptional<ZodBoolean>;
|
|
2171
2197
|
localDateTimes: ZodOptional<ZodBoolean>;
|
|
2172
2198
|
}, $strict>>;
|
|
2199
|
+
files: ZodOptional<ZodObject<{
|
|
2200
|
+
transformFileName: ZodOptional<ZodCustom<(req: {
|
|
2201
|
+
name: string;
|
|
2202
|
+
ext: string;
|
|
2203
|
+
}) => string, (req: {
|
|
2204
|
+
name: string;
|
|
2205
|
+
ext: string;
|
|
2206
|
+
}) => string>>;
|
|
2207
|
+
generatedFileSuffix: ZodOptional<ZodNullable<ZodString>>;
|
|
2208
|
+
}, $strict>>;
|
|
2173
2209
|
}, $strict>>;
|
|
2174
2210
|
type ProfileConfigInput = input<typeof profileConfigSchema>;
|
|
2175
2211
|
type ProfileConfig = output<typeof profileConfigSchema>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { d as defineConfig, g as generateApiClient } from './
|
|
1
|
+
export { d as defineConfig, g as generateApiClient } from './generate.mjs';
|
|
2
|
+
import 'node:fs';
|
|
3
|
+
import 'node:path';
|
|
4
|
+
import 'c12';
|
|
2
5
|
import 'path';
|
|
3
6
|
import 'fs';
|
|
4
|
-
import '
|
|
5
|
-
import 'node:
|
|
7
|
+
import 'ts-to-zod';
|
|
8
|
+
import 'node:fs/promises';
|
|
6
9
|
import 'swagger-typescript-api';
|
|
7
10
|
import 'node:url';
|
|
8
|
-
import 'node:fs/promises';
|
|
9
|
-
import 'node:fs';
|
|
10
|
-
import 'ts-to-zod';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ps-aux/api-client-gen",
|
|
3
|
-
"version": "0.7.0-rc.
|
|
3
|
+
"version": "0.7.0-rc.7",
|
|
4
4
|
"main": "dist/index.cjs",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"lint": "eslint",
|
|
14
14
|
"pack:tarball": "npm run build && npm pack",
|
|
15
15
|
"prepublishOnly": "echo \"Publishing disabled for this repo. Use CI workflow.\" && exit 1",
|
|
16
|
-
"test": "npm run test:
|
|
17
|
-
"test:
|
|
16
|
+
"test": "npm run test:main && npm run test:generated-code && npm run tc:after-gen",
|
|
17
|
+
"test:main": "vitest run --project main",
|
|
18
18
|
"test:generated-code": "vitest run --project generated-code",
|
|
19
19
|
"tc": "echo 'No typecheck'",
|
|
20
20
|
"tc:after-gen": "tsc",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"prettier": "^3.8.1",
|
|
30
30
|
"swagger-typescript-api": "13.0.23",
|
|
31
31
|
"ts-to-zod": "5.1.0",
|
|
32
|
+
"yaml": "^2.8.4",
|
|
32
33
|
"zod": "^4.3.6"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
@@ -18,14 +18,14 @@ export type QueryValue =
|
|
|
18
18
|
|
|
19
19
|
export type QueryParams = Record<string, QueryValue>
|
|
20
20
|
|
|
21
|
-
export type
|
|
21
|
+
export type HttpRequest = {
|
|
22
22
|
path: string
|
|
23
23
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE'
|
|
24
|
-
|
|
24
|
+
responseFormat?: 'json' | 'document'
|
|
25
25
|
headers?: Record<string, string>
|
|
26
26
|
query?: QueryParams
|
|
27
27
|
body?: any
|
|
28
|
-
|
|
28
|
+
contentType?: RequestContentType
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export type HttpResponse<Data> = {
|
|
@@ -38,7 +38,7 @@ export type QuerySerializer = (params: QueryParams) => string
|
|
|
38
38
|
|
|
39
39
|
export type HttpClient<RequestParams = never> = {
|
|
40
40
|
request: <Data>(
|
|
41
|
-
req:
|
|
41
|
+
req: HttpRequest,
|
|
42
42
|
params?: RequestParams
|
|
43
43
|
) => Promise<HttpResponse<Data>>
|
|
44
44
|
}
|
|
@@ -42,14 +42,14 @@ const wrapperArgs = _
|
|
|
42
42
|
.map(argToTmpl)
|
|
43
43
|
.join(', ')
|
|
44
44
|
|
|
45
|
-
//
|
|
45
|
+
// HttpRequest["contentType"]
|
|
46
46
|
const requestContentKind = {
|
|
47
47
|
"JSON": '"application/json"',
|
|
48
48
|
"URL_ENCODED": '"application/x-www-form-urlencoded"',
|
|
49
49
|
"FORM_DATA": '"multipart/form-data"',
|
|
50
50
|
"TEXT": '"text/plain"',
|
|
51
51
|
}
|
|
52
|
-
//
|
|
52
|
+
// HttpRequest["responseFormat"]
|
|
53
53
|
const responseContentKind = {
|
|
54
54
|
"JSON": '"json"',
|
|
55
55
|
"IMAGE": '"blob"',
|
|
@@ -101,6 +101,6 @@ const describeReturnType = () => {
|
|
|
101
101
|
method: '<%~ _.upperCase(method) %>',
|
|
102
102
|
<%~ queryTmpl ? `query: ${queryTmpl},` : '' %>
|
|
103
103
|
<%~ bodyTmpl ? `body: ${bodyTmpl},` : '' %>
|
|
104
|
-
<%~ bodyContentKindTmpl ? `
|
|
105
|
-
<%~ responseFormatTmpl ? `
|
|
104
|
+
<%~ bodyContentKindTmpl ? `contentType: ${bodyContentKindTmpl},` : '' %>
|
|
105
|
+
<%~ responseFormatTmpl ? `responseFormat: ${responseFormatTmpl},` : '' %>
|
|
106
106
|
}, params).then(res => res.body)<%~ route.namespace ? ',' : '' %>
|