@sohcah/openapi-generator 0.2.1 → 0.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.
- package/dist/{chunk-DYFKRlHt.js → chunk-BcJDCUAU.mjs} +24 -15
- package/dist/cli.d.mts +1 -0
- package/dist/{cli.js → cli.mjs} +8 -9
- package/dist/cli.mjs.map +1 -0
- package/dist/{config.d.ts → config.d.mts} +3 -3
- package/dist/config.d.mts.map +1 -0
- package/dist/{config.js → config.mjs} +1 -1
- package/dist/config.mjs.map +1 -0
- package/dist/generators/{index.d.ts → index.d.mts} +4 -4
- package/dist/generators/index.d.mts.map +1 -0
- package/dist/generators/index.mjs +739 -0
- package/dist/generators/index.mjs.map +1 -0
- package/dist/{helpers-CqzmoMek.js → helpers-BwQQbllq.mjs} +1944 -1901
- package/dist/helpers-BwQQbllq.mjs.map +1 -0
- package/dist/{index-DY2v-Q37.d.ts → index-D4xeswCF.d.mts} +5 -5
- package/dist/index-D4xeswCF.d.mts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.mjs +4 -0
- package/dist/{src-DhXSDR6J.js → src-9VHrwwX3.mjs} +1316 -1439
- package/dist/src-9VHrwwX3.mjs.map +1 -0
- package/dist/{types-DMB5w9Tt.d.ts → types-C83IhMq9.d.mts} +5 -4
- package/dist/types-C83IhMq9.d.mts.map +1 -0
- package/package.json +29 -29
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js.map +0 -1
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js.map +0 -1
- package/dist/generators/index.d.ts.map +0 -1
- package/dist/generators/index.js +0 -722
- package/dist/generators/index.js.map +0 -1
- package/dist/helpers-CqzmoMek.js.map +0 -1
- package/dist/index-DY2v-Q37.d.ts.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -4
- package/dist/src-DhXSDR6J.js.map +0 -1
- package/dist/types-DMB5w9Tt.d.ts.map +0 -1
|
@@ -7,22 +7,31 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
7
7
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
11
|
+
var __exportAll = (all, symbols) => {
|
|
12
|
+
let target = {};
|
|
13
|
+
for (var name in all) {
|
|
14
|
+
__defProp(target, name, {
|
|
15
|
+
get: all[name],
|
|
16
|
+
enumerable: true
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
if (symbols) {
|
|
20
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
21
|
+
}
|
|
22
|
+
return target;
|
|
18
23
|
};
|
|
19
24
|
var __copyProps = (to, from, except, desc) => {
|
|
20
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
27
|
+
key = keys[i];
|
|
28
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
29
|
+
__defProp(to, key, {
|
|
30
|
+
get: ((k) => from[k]).bind(null, key),
|
|
31
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
36
|
return to;
|
|
28
37
|
};
|
|
@@ -33,4 +42,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
42
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
34
43
|
|
|
35
44
|
//#endregion
|
|
36
|
-
export {
|
|
45
|
+
export { __toESM as i, __exportAll as n, __require as r, __commonJSMin as t };
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/{cli.js → cli.mjs}
RENAMED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { generateToFile } from "./src-
|
|
3
|
-
import "./helpers-
|
|
2
|
+
import { n as generateToFile } from "./src-9VHrwwX3.mjs";
|
|
3
|
+
import "./helpers-BwQQbllq.mjs";
|
|
4
|
+
import { Effect } from "effect";
|
|
4
5
|
import { Command, Options } from "@effect/cli";
|
|
5
6
|
import { NodeContext, NodeRuntime } from "@effect/platform-node";
|
|
6
|
-
import
|
|
7
|
+
import * as ParcelWatcher from "@effect/platform-node/NodeFileSystem/ParcelWatcher";
|
|
7
8
|
|
|
8
9
|
//#region src/cli.ts
|
|
9
10
|
const command = Command.make("@sohcah/openapi-generator", {}).pipe(Command.withSubcommands([Command.make("generate", {
|
|
10
11
|
watch: Options.boolean("watch").pipe(Options.withDefault(false)).pipe(Options.withAlias("w")),
|
|
11
12
|
config: Options.text("config").pipe(Options.withAlias("c")).pipe(Options.withDefault("openapi.config.ts"))
|
|
12
13
|
}, Effect.fn(function* (args) {
|
|
13
|
-
const config = yield* Effect.tryPromise(() => import(`file://${process.cwd()}/${args.config}`)).pipe(Effect.mapError((e) => /* @__PURE__ */ new Error(`Failed to load config: ${e.message}`)));
|
|
14
14
|
yield* generateToFile({
|
|
15
|
-
...config.default,
|
|
15
|
+
...(yield* Effect.tryPromise(() => import(`file://${process.cwd()}/${args.config}`)).pipe(Effect.mapError((cause) => new Error("Failed to load config", { cause })))).default,
|
|
16
16
|
watch: args.watch
|
|
17
17
|
});
|
|
18
18
|
}))]));
|
|
19
|
-
|
|
19
|
+
Command.run(command, {
|
|
20
20
|
name: "@sohcah/openapi-generator",
|
|
21
21
|
version: "v0.0.1"
|
|
22
|
-
});
|
|
23
|
-
cli(process.argv).pipe(Effect.provide(NodeContext.layer), NodeRuntime.runMain);
|
|
22
|
+
})(process.argv).pipe(Effect.provide(NodeContext.layer), Effect.provide(ParcelWatcher.layer), NodeRuntime.runMain);
|
|
24
23
|
|
|
25
24
|
//#endregion
|
|
26
25
|
export { };
|
|
27
|
-
//# sourceMappingURL=cli.
|
|
26
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command, Options } from \"@effect/cli\";\nimport { NodeContext, NodeRuntime } from \"@effect/platform-node\";\nimport * as ParcelWatcher from \"@effect/platform-node/NodeFileSystem/ParcelWatcher\";\nimport { Effect } from \"effect\";\nimport { generateToFile } from \"./index.js\";\n\n// Define the top-level command\nconst command = Command.make(\"@sohcah/openapi-generator\", {}).pipe(\n Command.withSubcommands([\n Command.make(\n \"generate\",\n {\n watch: Options.boolean(\"watch\")\n .pipe(Options.withDefault(false))\n .pipe(Options.withAlias(\"w\")),\n config: Options.text(\"config\")\n .pipe(Options.withAlias(\"c\"))\n .pipe(Options.withDefault(\"openapi.config.ts\")),\n },\n Effect.fn(function* (args) {\n const config = yield* Effect.tryPromise(\n () => import(`file://${process.cwd()}/${args.config}`)\n ).pipe(\n Effect.mapError(\n (cause) => new Error(\"Failed to load config\", { cause })\n )\n );\n yield* generateToFile({\n ...config.default,\n watch: args.watch,\n });\n })\n ),\n ])\n);\n\n// Set up the CLI application\nconst cli = Command.run(command, {\n name: \"@sohcah/openapi-generator\",\n version: \"v0.0.1\",\n});\n\n// Prepare and run the CLI application\ncli(process.argv).pipe(\n Effect.provide(NodeContext.layer),\n Effect.provide(ParcelWatcher.layer),\n NodeRuntime.runMain\n);\n"],"mappings":";;;;;;;;;AASA,MAAM,UAAU,QAAQ,KAAK,6BAA6B,EAAE,CAAC,CAAC,KAC5D,QAAQ,gBAAgB,CACtB,QAAQ,KACN,YACA;CACE,OAAO,QAAQ,QAAQ,QAAQ,CAC5B,KAAK,QAAQ,YAAY,MAAM,CAAC,CAChC,KAAK,QAAQ,UAAU,IAAI,CAAC;CAC/B,QAAQ,QAAQ,KAAK,SAAS,CAC3B,KAAK,QAAQ,UAAU,IAAI,CAAC,CAC5B,KAAK,QAAQ,YAAY,oBAAoB,CAAC;CAClD,EACD,OAAO,GAAG,WAAW,MAAM;AAQzB,QAAO,eAAe;EACpB,IARa,OAAO,OAAO,iBACrB,OAAO,UAAU,QAAQ,KAAK,CAAC,GAAG,KAAK,UAC9C,CAAC,KACA,OAAO,UACJ,UAAU,IAAI,MAAM,yBAAyB,EAAE,OAAO,CAAC,CACzD,CACF,EAEW;EACV,OAAO,KAAK;EACb,CAAC;EACF,CACH,CACF,CAAC,CACH;AAGW,QAAQ,IAAI,SAAS;CAC/B,MAAM;CACN,SAAS;CACV,CAAC,CAGE,QAAQ,KAAK,CAAC,KAChB,OAAO,QAAQ,YAAY,MAAM,EACjC,OAAO,QAAQ,cAAc,MAAM,EACnC,YAAY,QACb"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./types-
|
|
2
|
-
import { OpenapiGenerateToFileOptions } from "./index-
|
|
1
|
+
import "./types-C83IhMq9.mjs";
|
|
2
|
+
import { n as OpenapiGenerateToFileOptions } from "./index-D4xeswCF.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/config.d.ts
|
|
5
5
|
declare const defineConfig: (config: OpenapiGenerateToFileOptions) => OpenapiGenerateToFileOptions;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { defineConfig };
|
|
8
|
-
//# sourceMappingURL=config.d.
|
|
8
|
+
//# sourceMappingURL=config.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;cAEa,uBAAwB,iCAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.mjs","names":[],"sources":["../src/config.ts"],"sourcesContent":["import type { OpenapiGenerateToFileOptions } from \"./index.js\";\n\nexport const defineConfig = (config: OpenapiGenerateToFileOptions) => config;"],"mappings":";AAEA,MAAa,gBAAgB,WAAyC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as OpenApiResponseSchema, c as OperationKey, d as SchemaGeneratorOptions, f as createSchemaGenerator, g as NotImplementedError, i as OpenApiParametersSchema, l as helpers_d_exports, m as SchemaObject, n as OpenApiClientGenerator, o as OpenApiSchemaGenerator, p as OperationObject, r as OpenApiGenerator, s as HttpMethod, t as ImportReference, u as DocumentContext } from "../types-C83IhMq9.mjs";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
3
|
import * as t from "@babel/types";
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ declare const createEffectSchemaGenerator: (options: SchemaGeneratorOptions) =>
|
|
|
10
10
|
ensureParametersSchema: (operationKey: OperationKey, operation: OperationObject, path: string) => Effect.Effect<OpenApiParametersSchema, NotImplementedError, DocumentContext>;
|
|
11
11
|
ensureResponseSchema: (operationKey: OperationKey, operation: OperationObject) => Effect.Effect<OpenApiResponseSchema, NotImplementedError, DocumentContext>;
|
|
12
12
|
schemaType: t.TSEntityName;
|
|
13
|
-
processSchema
|
|
13
|
+
processSchema: (schema: SchemaObject) => Effect.Effect<void, NotImplementedError, DocumentContext>;
|
|
14
14
|
processOperation?: (operationKey: OperationKey, path: string, method: HttpMethod, operation: OperationObject) => Effect.Effect<void, NotImplementedError, DocumentContext>;
|
|
15
15
|
};
|
|
16
16
|
//#endregion
|
|
@@ -29,7 +29,7 @@ declare const createZodSchemaGenerator: ({
|
|
|
29
29
|
ensureParametersSchema: (operationKey: OperationKey, operation: OperationObject, path: string) => Effect.Effect<OpenApiParametersSchema, NotImplementedError, DocumentContext>;
|
|
30
30
|
ensureResponseSchema: (operationKey: OperationKey, operation: OperationObject) => Effect.Effect<OpenApiResponseSchema, NotImplementedError, DocumentContext>;
|
|
31
31
|
schemaType: t.TSEntityName;
|
|
32
|
-
processSchema
|
|
32
|
+
processSchema: (schema: SchemaObject) => Effect.Effect<void, NotImplementedError, DocumentContext>;
|
|
33
33
|
processOperation?: (operationKey: OperationKey, path: string, method: HttpMethod, operation: OperationObject) => Effect.Effect<void, NotImplementedError, DocumentContext>;
|
|
34
34
|
};
|
|
35
35
|
//#endregion
|
|
@@ -40,4 +40,4 @@ interface OpenApiClientGeneratorOptions {
|
|
|
40
40
|
declare function createReactQueryClientGenerator(options: OpenApiClientGeneratorOptions): OpenApiClientGenerator;
|
|
41
41
|
//#endregion
|
|
42
42
|
export { ImportReference, OpenApiClientGenerator, OpenApiGenerator, OpenApiParametersSchema, OpenApiResponseSchema, OpenApiSchemaGenerator, createEffectSchemaGenerator, createReactQueryClientGenerator, createSchemaGenerator, createZodSchemaGenerator, helpers_d_exports as generatorHelpers };
|
|
43
|
-
//# sourceMappingURL=index.d.
|
|
43
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/generators/effect.ts","../../src/generators/zod.ts","../../src/generators/client.ts"],"sourcesContent":[],"mappings":";;;;;cAQa,uCACF;EADE,UAAA,EAAA,GAAA,gBAwOX,CAAA,IAAA,EAAA,KAAA,EAvO+B,eAAA,CAuO/B;EAvOS,cAAA,EAAA,CAAA,MAAA,cAAA,EAAA,QAAA,cAAA,EAAA,gBAAA,aAAA,CAAA;EAAsB,gBAAA,EAAA,CAAA,MAAA,cAAA,EAAA,UAAA,cAAA,EAAA,gBAAA,aAAA,CAAA;;;;;;;;;UCDhB,yBAAA,SAAkC;EDAtC;EACF,IAAA,CAAA,EAAA,OAAA;;cCuBE;;;GAGV;+CAAyB,eAAA;;;;;;;;;;;UCzBX,6BAAA;UACP;;iBAGM,+BAAA,UACL,gCACR"}
|