@ir-kit/openapi-kotlin 0.1.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/LICENSE.md +21 -0
- package/README.md +259 -0
- package/dist/generate.d.ts +41 -0
- package/dist/generate.d.ts.map +1 -0
- package/dist/generate.js +64 -0
- package/dist/generate.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/ir/constants.d.ts +6 -0
- package/dist/ir/constants.d.ts.map +1 -0
- package/dist/ir/constants.js +6 -0
- package/dist/ir/constants.js.map +1 -0
- package/dist/ir/identifiers.d.ts +23 -0
- package/dist/ir/identifiers.d.ts.map +1 -0
- package/dist/ir/identifiers.js +71 -0
- package/dist/ir/identifiers.js.map +1 -0
- package/dist/ir/impl/body.d.ts +30 -0
- package/dist/ir/impl/body.d.ts.map +1 -0
- package/dist/ir/impl/body.js +116 -0
- package/dist/ir/impl/body.js.map +1 -0
- package/dist/ir/impl/decode.d.ts +14 -0
- package/dist/ir/impl/decode.d.ts.map +1 -0
- package/dist/ir/impl/decode.js +110 -0
- package/dist/ir/impl/decode.js.map +1 -0
- package/dist/ir/impl/headers.d.ts +8 -0
- package/dist/ir/impl/headers.d.ts.map +1 -0
- package/dist/ir/impl/headers.js +22 -0
- package/dist/ir/impl/headers.js.map +1 -0
- package/dist/ir/impl/index.d.ts +23 -0
- package/dist/ir/impl/index.d.ts.map +1 -0
- package/dist/ir/impl/index.js +141 -0
- package/dist/ir/impl/index.js.map +1 -0
- package/dist/ir/impl/request.d.ts +14 -0
- package/dist/ir/impl/request.d.ts.map +1 -0
- package/dist/ir/impl/request.js +25 -0
- package/dist/ir/impl/request.js.map +1 -0
- package/dist/ir/impl/serializer.d.ts +20 -0
- package/dist/ir/impl/serializer.d.ts.map +1 -0
- package/dist/ir/impl/serializer.js +62 -0
- package/dist/ir/impl/serializer.js.map +1 -0
- package/dist/ir/impl/url.d.ts +16 -0
- package/dist/ir/impl/url.d.ts.map +1 -0
- package/dist/ir/impl/url.js +77 -0
- package/dist/ir/impl/url.js.map +1 -0
- package/dist/ir/index.d.ts +4 -0
- package/dist/ir/index.d.ts.map +1 -0
- package/dist/ir/index.js +3 -0
- package/dist/ir/index.js.map +1 -0
- package/dist/ir/operation/body.d.ts +18 -0
- package/dist/ir/operation/body.d.ts.map +1 -0
- package/dist/ir/operation/body.js +51 -0
- package/dist/ir/operation/body.js.map +1 -0
- package/dist/ir/operation/index.d.ts +7 -0
- package/dist/ir/operation/index.d.ts.map +1 -0
- package/dist/ir/operation/index.js +5 -0
- package/dist/ir/operation/index.js.map +1 -0
- package/dist/ir/operation/params.d.ts +16 -0
- package/dist/ir/operation/params.d.ts.map +1 -0
- package/dist/ir/operation/params.js +28 -0
- package/dist/ir/operation/params.js.map +1 -0
- package/dist/ir/operation/response.d.ts +26 -0
- package/dist/ir/operation/response.d.ts.map +1 -0
- package/dist/ir/operation/response.js +58 -0
- package/dist/ir/operation/response.js.map +1 -0
- package/dist/ir/operation/signature.d.ts +32 -0
- package/dist/ir/operation/signature.d.ts.map +1 -0
- package/dist/ir/operation/signature.js +53 -0
- package/dist/ir/operation/signature.js.map +1 -0
- package/dist/ir/operations.d.ts +43 -0
- package/dist/ir/operations.d.ts.map +1 -0
- package/dist/ir/operations.js +124 -0
- package/dist/ir/operations.js.map +1 -0
- package/dist/ir/runtime/index.d.ts +3 -0
- package/dist/ir/runtime/index.d.ts.map +1 -0
- package/dist/ir/runtime/index.js +2 -0
- package/dist/ir/runtime/index.js.map +1 -0
- package/dist/ir/runtime/templates.d.ts +31 -0
- package/dist/ir/runtime/templates.d.ts.map +1 -0
- package/dist/ir/runtime/templates.js +431 -0
- package/dist/ir/runtime/templates.js.map +1 -0
- package/dist/ir/schema.d.ts +11 -0
- package/dist/ir/schema.d.ts.map +1 -0
- package/dist/ir/schema.js +51 -0
- package/dist/ir/schema.js.map +1 -0
- package/dist/ir/type/context.d.ts +4 -0
- package/dist/ir/type/context.d.ts.map +1 -0
- package/dist/ir/type/context.js +2 -0
- package/dist/ir/type/context.js.map +1 -0
- package/dist/ir/type/index.d.ts +27 -0
- package/dist/ir/type/index.d.ts.map +1 -0
- package/dist/ir/type/index.js +35 -0
- package/dist/ir/type/index.js.map +1 -0
- package/dist/ir/type/primitive.d.ts +9 -0
- package/dist/ir/type/primitive.d.ts.map +1 -0
- package/dist/ir/type/primitive.js +50 -0
- package/dist/ir/type/primitive.js.map +1 -0
- package/dist/ir/type/property-naming.d.ts +26 -0
- package/dist/ir/type/property-naming.d.ts.map +1 -0
- package/dist/ir/type/property-naming.js +27 -0
- package/dist/ir/type/property-naming.js.map +1 -0
- package/dist/ir/type-ops.d.ts +13 -0
- package/dist/ir/type-ops.d.ts.map +1 -0
- package/dist/ir/type-ops.js +80 -0
- package/dist/ir/type-ops.js.map +1 -0
- package/dist/kt-compiler/decl/class.d.ts +6 -0
- package/dist/kt-compiler/decl/class.d.ts.map +1 -0
- package/dist/kt-compiler/decl/class.js +38 -0
- package/dist/kt-compiler/decl/class.js.map +1 -0
- package/dist/kt-compiler/decl/dataClass.d.ts +3 -0
- package/dist/kt-compiler/decl/dataClass.d.ts.map +1 -0
- package/dist/kt-compiler/decl/dataClass.js +18 -0
- package/dist/kt-compiler/decl/dataClass.js.map +1 -0
- package/dist/kt-compiler/decl/enum.d.ts +3 -0
- package/dist/kt-compiler/decl/enum.d.ts.map +1 -0
- package/dist/kt-compiler/decl/enum.js +32 -0
- package/dist/kt-compiler/decl/enum.js.map +1 -0
- package/dist/kt-compiler/decl/fun.d.ts +11 -0
- package/dist/kt-compiler/decl/fun.d.ts.map +1 -0
- package/dist/kt-compiler/decl/fun.js +69 -0
- package/dist/kt-compiler/decl/fun.js.map +1 -0
- package/dist/kt-compiler/decl/index.d.ts +13 -0
- package/dist/kt-compiler/decl/index.d.ts.map +1 -0
- package/dist/kt-compiler/decl/index.js +39 -0
- package/dist/kt-compiler/decl/index.js.map +1 -0
- package/dist/kt-compiler/decl/interface.d.ts +3 -0
- package/dist/kt-compiler/decl/interface.d.ts.map +1 -0
- package/dist/kt-compiler/decl/interface.js +15 -0
- package/dist/kt-compiler/decl/interface.js.map +1 -0
- package/dist/kt-compiler/decl/object.d.ts +3 -0
- package/dist/kt-compiler/decl/object.d.ts.map +1 -0
- package/dist/kt-compiler/decl/object.js +19 -0
- package/dist/kt-compiler/decl/object.js.map +1 -0
- package/dist/kt-compiler/decl/prop.d.ts +20 -0
- package/dist/kt-compiler/decl/prop.d.ts.map +1 -0
- package/dist/kt-compiler/decl/prop.js +42 -0
- package/dist/kt-compiler/decl/prop.js.map +1 -0
- package/dist/kt-compiler/decl/sealedClass.d.ts +3 -0
- package/dist/kt-compiler/decl/sealedClass.d.ts.map +1 -0
- package/dist/kt-compiler/decl/sealedClass.js +32 -0
- package/dist/kt-compiler/decl/sealedClass.js.map +1 -0
- package/dist/kt-compiler/decl/topLevel.d.ts +3 -0
- package/dist/kt-compiler/decl/topLevel.d.ts.map +1 -0
- package/dist/kt-compiler/decl/topLevel.js +5 -0
- package/dist/kt-compiler/decl/topLevel.js.map +1 -0
- package/dist/kt-compiler/decl/typeAlias.d.ts +3 -0
- package/dist/kt-compiler/decl/typeAlias.d.ts.map +1 -0
- package/dist/kt-compiler/decl/typeAlias.js +6 -0
- package/dist/kt-compiler/decl/typeAlias.js.map +1 -0
- package/dist/kt-compiler/expr.d.ts +4 -0
- package/dist/kt-compiler/expr.d.ts.map +1 -0
- package/dist/kt-compiler/expr.js +123 -0
- package/dist/kt-compiler/expr.js.map +1 -0
- package/dist/kt-compiler/format.d.ts +20 -0
- package/dist/kt-compiler/format.d.ts.map +1 -0
- package/dist/kt-compiler/format.js +27 -0
- package/dist/kt-compiler/format.js.map +1 -0
- package/dist/kt-compiler/index.d.ts +7 -0
- package/dist/kt-compiler/index.d.ts.map +1 -0
- package/dist/kt-compiler/index.js +24 -0
- package/dist/kt-compiler/index.js.map +1 -0
- package/dist/kt-compiler/stmt.d.ts +4 -0
- package/dist/kt-compiler/stmt.d.ts.map +1 -0
- package/dist/kt-compiler/stmt.js +72 -0
- package/dist/kt-compiler/stmt.js.map +1 -0
- package/dist/kt-compiler/type.d.ts +3 -0
- package/dist/kt-compiler/type.d.ts.map +1 -0
- package/dist/kt-compiler/type.js +28 -0
- package/dist/kt-compiler/type.js.map +1 -0
- package/dist/kt-dsl/decl/class.d.ts +50 -0
- package/dist/kt-dsl/decl/class.d.ts.map +1 -0
- package/dist/kt-dsl/decl/class.js +33 -0
- package/dist/kt-dsl/decl/class.js.map +1 -0
- package/dist/kt-dsl/decl/dataClass.d.ts +36 -0
- package/dist/kt-dsl/decl/dataClass.d.ts.map +1 -0
- package/dist/kt-dsl/decl/dataClass.js +25 -0
- package/dist/kt-dsl/decl/dataClass.js.map +1 -0
- package/dist/kt-dsl/decl/enum.d.ts +60 -0
- package/dist/kt-dsl/decl/enum.d.ts.map +1 -0
- package/dist/kt-dsl/decl/enum.js +38 -0
- package/dist/kt-dsl/decl/enum.js.map +1 -0
- package/dist/kt-dsl/decl/index.d.ts +11 -0
- package/dist/kt-dsl/decl/index.d.ts.map +1 -0
- package/dist/kt-dsl/decl/index.js +11 -0
- package/dist/kt-dsl/decl/index.js.map +1 -0
- package/dist/kt-dsl/decl/interface.d.ts +33 -0
- package/dist/kt-dsl/decl/interface.d.ts.map +1 -0
- package/dist/kt-dsl/decl/interface.js +24 -0
- package/dist/kt-dsl/decl/interface.js.map +1 -0
- package/dist/kt-dsl/decl/object.d.ts +34 -0
- package/dist/kt-dsl/decl/object.d.ts.map +1 -0
- package/dist/kt-dsl/decl/object.js +24 -0
- package/dist/kt-dsl/decl/object.js.map +1 -0
- package/dist/kt-dsl/decl/prop.d.ts +47 -0
- package/dist/kt-dsl/decl/prop.d.ts.map +1 -0
- package/dist/kt-dsl/decl/prop.js +28 -0
- package/dist/kt-dsl/decl/prop.js.map +1 -0
- package/dist/kt-dsl/decl/sealedClass.d.ts +68 -0
- package/dist/kt-dsl/decl/sealedClass.d.ts.map +1 -0
- package/dist/kt-dsl/decl/sealedClass.js +52 -0
- package/dist/kt-dsl/decl/sealedClass.js.map +1 -0
- package/dist/kt-dsl/decl/topLevel.d.ts +19 -0
- package/dist/kt-dsl/decl/topLevel.d.ts.map +1 -0
- package/dist/kt-dsl/decl/topLevel.js +17 -0
- package/dist/kt-dsl/decl/topLevel.js.map +1 -0
- package/dist/kt-dsl/decl/typeAlias.d.ts +23 -0
- package/dist/kt-dsl/decl/typeAlias.d.ts.map +1 -0
- package/dist/kt-dsl/decl/typeAlias.js +18 -0
- package/dist/kt-dsl/decl/typeAlias.js.map +1 -0
- package/dist/kt-dsl/decl/types.d.ts +10 -0
- package/dist/kt-dsl/decl/types.d.ts.map +1 -0
- package/dist/kt-dsl/decl/types.js +2 -0
- package/dist/kt-dsl/decl/types.js.map +1 -0
- package/dist/kt-dsl/expr/access.d.ts +48 -0
- package/dist/kt-dsl/expr/access.d.ts.map +1 -0
- package/dist/kt-dsl/expr/access.js +59 -0
- package/dist/kt-dsl/expr/access.js.map +1 -0
- package/dist/kt-dsl/expr/call.d.ts +38 -0
- package/dist/kt-dsl/expr/call.d.ts.map +1 -0
- package/dist/kt-dsl/expr/call.js +38 -0
- package/dist/kt-dsl/expr/call.js.map +1 -0
- package/dist/kt-dsl/expr/index.d.ts +7 -0
- package/dist/kt-dsl/expr/index.d.ts.map +1 -0
- package/dist/kt-dsl/expr/index.js +7 -0
- package/dist/kt-dsl/expr/index.js.map +1 -0
- package/dist/kt-dsl/expr/literal.d.ts +100 -0
- package/dist/kt-dsl/expr/literal.d.ts.map +1 -0
- package/dist/kt-dsl/expr/literal.js +108 -0
- package/dist/kt-dsl/expr/literal.js.map +1 -0
- package/dist/kt-dsl/expr/misc.d.ts +45 -0
- package/dist/kt-dsl/expr/misc.d.ts.map +1 -0
- package/dist/kt-dsl/expr/misc.js +63 -0
- package/dist/kt-dsl/expr/misc.js.map +1 -0
- package/dist/kt-dsl/expr/op.d.ts +25 -0
- package/dist/kt-dsl/expr/op.d.ts.map +1 -0
- package/dist/kt-dsl/expr/op.js +24 -0
- package/dist/kt-dsl/expr/op.js.map +1 -0
- package/dist/kt-dsl/expr/types.d.ts +93 -0
- package/dist/kt-dsl/expr/types.d.ts.map +1 -0
- package/dist/kt-dsl/expr/types.js +2 -0
- package/dist/kt-dsl/expr/types.js.map +1 -0
- package/dist/kt-dsl/file.d.ts +14 -0
- package/dist/kt-dsl/file.d.ts.map +1 -0
- package/dist/kt-dsl/file.js +9 -0
- package/dist/kt-dsl/file.js.map +1 -0
- package/dist/kt-dsl/fun.d.ts +73 -0
- package/dist/kt-dsl/fun.d.ts.map +1 -0
- package/dist/kt-dsl/fun.js +50 -0
- package/dist/kt-dsl/fun.js.map +1 -0
- package/dist/kt-dsl/index.d.ts +8 -0
- package/dist/kt-dsl/index.d.ts.map +1 -0
- package/dist/kt-dsl/index.js +8 -0
- package/dist/kt-dsl/index.js.map +1 -0
- package/dist/kt-dsl/stmt/binding.d.ts +56 -0
- package/dist/kt-dsl/stmt/binding.d.ts.map +1 -0
- package/dist/kt-dsl/stmt/binding.js +70 -0
- package/dist/kt-dsl/stmt/binding.js.map +1 -0
- package/dist/kt-dsl/stmt/control.d.ts +80 -0
- package/dist/kt-dsl/stmt/control.d.ts.map +1 -0
- package/dist/kt-dsl/stmt/control.js +77 -0
- package/dist/kt-dsl/stmt/control.js.map +1 -0
- package/dist/kt-dsl/stmt/index.d.ts +4 -0
- package/dist/kt-dsl/stmt/index.d.ts.map +1 -0
- package/dist/kt-dsl/stmt/index.js +4 -0
- package/dist/kt-dsl/stmt/index.js.map +1 -0
- package/dist/kt-dsl/stmt/types.d.ts +62 -0
- package/dist/kt-dsl/stmt/types.d.ts.map +1 -0
- package/dist/kt-dsl/stmt/types.js +2 -0
- package/dist/kt-dsl/stmt/types.js.map +1 -0
- package/dist/kt-dsl/type/builders.d.ts +75 -0
- package/dist/kt-dsl/type/builders.d.ts.map +1 -0
- package/dist/kt-dsl/type/builders.js +83 -0
- package/dist/kt-dsl/type/builders.js.map +1 -0
- package/dist/kt-dsl/type/index.d.ts +3 -0
- package/dist/kt-dsl/type/index.d.ts.map +1 -0
- package/dist/kt-dsl/type/index.js +3 -0
- package/dist/kt-dsl/type/index.js.map +1 -0
- package/dist/kt-dsl/type/types.d.ts +25 -0
- package/dist/kt-dsl/type/types.d.ts.map +1 -0
- package/dist/kt-dsl/type/types.js +2 -0
- package/dist/kt-dsl/type/types.js.map +1 -0
- package/dist/kt-dsl/visibility.d.ts +2 -0
- package/dist/kt-dsl/visibility.d.ts.map +1 -0
- package/dist/kt-dsl/visibility.js +2 -0
- package/dist/kt-dsl/visibility.js.map +1 -0
- package/dist/project/build.d.ts +33 -0
- package/dist/project/build.d.ts.map +1 -0
- package/dist/project/build.js +73 -0
- package/dist/project/build.js.map +1 -0
- package/dist/project/gradle.d.ts +48 -0
- package/dist/project/gradle.d.ts.map +1 -0
- package/dist/project/gradle.js +46 -0
- package/dist/project/gradle.js.map +1 -0
- package/dist/project/imports.d.ts +21 -0
- package/dist/project/imports.d.ts.map +1 -0
- package/dist/project/imports.js +162 -0
- package/dist/project/imports.js.map +1 -0
- package/dist/project/index.d.ts +6 -0
- package/dist/project/index.d.ts.map +1 -0
- package/dist/project/index.js +3 -0
- package/dist/project/index.js.map +1 -0
- package/dist/project/layout.d.ts +30 -0
- package/dist/project/layout.d.ts.map +1 -0
- package/dist/project/layout.js +57 -0
- package/dist/project/layout.js.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { DEFAULT_PACKAGE } from "../ir/constants.js";
|
|
2
|
+
import { printDecl, printFile } from "../kt-compiler/index.js";
|
|
3
|
+
import { ktFile } from "../kt-dsl/index.js";
|
|
4
|
+
import { importsForSource, isApiSurface } from "./imports.js";
|
|
5
|
+
import { declFileName, placeDecl } from "./layout.js";
|
|
6
|
+
/**
|
|
7
|
+
* Project assembler: places each decl in a file, picks imports, prints
|
|
8
|
+
* one Kotlin source per group. Decls that share an output path
|
|
9
|
+
* (currently the per-receiver extension-fun bundle) collapse into one
|
|
10
|
+
* file; everything else lives in its own.
|
|
11
|
+
*
|
|
12
|
+
* The package directory layout (`com/example/petstore/...`) is built
|
|
13
|
+
* into `path` so the result drops directly into a `src/main/kotlin/`
|
|
14
|
+
* tree.
|
|
15
|
+
*/
|
|
16
|
+
export function buildKotlinProject(decls, opts = {}) {
|
|
17
|
+
const pkg = opts.packageName ?? DEFAULT_PACKAGE;
|
|
18
|
+
const pkgPath = pkg.replace(/\./g, "/");
|
|
19
|
+
const groups = new Map();
|
|
20
|
+
for (const decl of decls) {
|
|
21
|
+
const { dir } = placeDecl(decl, opts);
|
|
22
|
+
const fileName = declFileName(decl);
|
|
23
|
+
const subPath = dir === "." ? fileName : `${dir}/${fileName}`;
|
|
24
|
+
const path = `${pkgPath}/${subPath}`;
|
|
25
|
+
const subPkg = declPackage(pkg, dir);
|
|
26
|
+
const existing = groups.get(path);
|
|
27
|
+
if (existing)
|
|
28
|
+
existing.decls.push(decl);
|
|
29
|
+
else
|
|
30
|
+
groups.set(path, { decls: [decl], subPkg });
|
|
31
|
+
}
|
|
32
|
+
return [...groups.entries()].map(([path, group]) => {
|
|
33
|
+
// Print bodies first, scan the printed output for actually-used
|
|
34
|
+
// identifiers, then re-print with the right imports. Avoids
|
|
35
|
+
// shipping unused imports per file.
|
|
36
|
+
const bodyOnly = group.decls.map((d) => printDecl(d)).join("\n\n");
|
|
37
|
+
const apiSurface = group.decls.some(isApiSurface);
|
|
38
|
+
const imports = importsForSource(bodyOnly, {
|
|
39
|
+
isApiSurface: apiSurface,
|
|
40
|
+
rootPkg: pkg,
|
|
41
|
+
subPkg: group.subPkg,
|
|
42
|
+
});
|
|
43
|
+
return {
|
|
44
|
+
path,
|
|
45
|
+
content: printFile(ktFile({ pkg: group.subPkg, imports, decls: group.decls })),
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sub-package suffix for a decl based on its placement dir. Mirrors
|
|
51
|
+
* the kotlin convention where filesystem directories under
|
|
52
|
+
* `src/main/kotlin/` map to package suffixes — e.g. files placed in
|
|
53
|
+
* `api/` belong to `<root>.api`.
|
|
54
|
+
*/
|
|
55
|
+
function declPackage(rootPkg, dir) {
|
|
56
|
+
if (dir === "." || dir === "")
|
|
57
|
+
return rootPkg;
|
|
58
|
+
const suffix = dir.replace(/\//g, ".");
|
|
59
|
+
return `${rootPkg}.${suffix}`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Wrap a runtime-helper file (raw kotlin source) in a `BuiltFile`. The
|
|
63
|
+
* runtime templates already carry their own `package` directive, so we
|
|
64
|
+
* just route them through the layout.
|
|
65
|
+
*/
|
|
66
|
+
export function runtimeFileToBuilt(pkg, pkgDir, fileName, content) {
|
|
67
|
+
const pkgPath = pkg.replace(/\./g, "/");
|
|
68
|
+
return {
|
|
69
|
+
path: `${pkgPath}/${pkgDir}/${fileName}`,
|
|
70
|
+
content,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/project/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAe,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAyB,SAAS,EAAE,MAAM,aAAa,CAAC;AAiB7E;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA4B,EAC5B,OAAqB,EAAE;IAEvB,MAAM,GAAG,GAAG,IAAI,CAAC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AC,YAAY,CAAC,CAAC;QAClD,MAAM,OAAO,GAAG,gBAAgB,CAAC,QAAQ,EAAE;YACzC,YAAY,EAAE,UAAU;YACxB,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC,CAAC;QACH,OAAO;YACL,IAAI;YACJ,OAAO,EAAE,SAAS,CAChB,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAC3D;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,OAAe,EAAE,GAAW;IAC/C,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,OAAO,CAAC;IAC9C,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACvC,OAAO,GAAG,OAAO,IAAI,MAAM,EAAE,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAChC,GAAW,EACX,MAAc,EACd,QAAgB,EAChB,OAAe;IAEf,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACxC,OAAO;QACL,IAAI,EAAE,GAAG,OAAO,IAAI,MAAM,IAAI,QAAQ,EAAE;QACxC,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BuiltFile } from "./build.js";
|
|
2
|
+
/**
|
|
3
|
+
* `build.gradle.kts` emission for the standalone-library mode.
|
|
4
|
+
*
|
|
5
|
+
* Two consumption modes for the generated SDK:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Drop into an existing Gradle module.** Paste the package
|
|
8
|
+
* directory (e.g. `com/example/petstore/`) into your module's
|
|
9
|
+
* `src/main/kotlin/` tree. Make sure the surrounding module already
|
|
10
|
+
* applies `kotlin("plugin.serialization")` and depends on OkHttp +
|
|
11
|
+
* kotlinx-serialization-json. This is the default; nothing extra
|
|
12
|
+
* is emitted.
|
|
13
|
+
*
|
|
14
|
+
* 2. **Standalone Gradle module.** Pass `gradle: true` (or an options
|
|
15
|
+
* object) to `generate()` and a `build.gradle.kts` is emitted at
|
|
16
|
+
* the output root with the right plugins + dependencies.
|
|
17
|
+
*
|
|
18
|
+
* Mode 2 is the right choice when the SDK is shared across multiple
|
|
19
|
+
* apps, lives in its own repo, or you want a clean module boundary
|
|
20
|
+
* inside a monorepo.
|
|
21
|
+
*/
|
|
22
|
+
export interface GradleOptions {
|
|
23
|
+
/** Module group (Gradle's `group =`). Required for publishing; safe
|
|
24
|
+
* to omit otherwise. */
|
|
25
|
+
group?: string;
|
|
26
|
+
/** Module version. Default: `"0.1.0"`. */
|
|
27
|
+
version?: string;
|
|
28
|
+
/** Kotlin Gradle plugin version. Default: `"2.0.21"`. */
|
|
29
|
+
kotlinVersion?: string;
|
|
30
|
+
/** kotlinx-serialization version. Default: `"1.7.3"`. */
|
|
31
|
+
kotlinxSerializationVersion?: string;
|
|
32
|
+
/** OkHttp version. Default: `"4.12.0"`. */
|
|
33
|
+
okhttpVersion?: string;
|
|
34
|
+
/** kotlinx-coroutines version. Default: `"1.9.0"`. */
|
|
35
|
+
kotlinxCoroutinesVersion?: string;
|
|
36
|
+
/** kotlinx-datetime version (used by `Instant` / `LocalDate` model fields).
|
|
37
|
+
* Default: `"0.6.1"`. */
|
|
38
|
+
kotlinxDatetimeVersion?: string;
|
|
39
|
+
/** JVM target. Default: `"17"`. */
|
|
40
|
+
jvmTarget?: string;
|
|
41
|
+
}
|
|
42
|
+
export declare function buildGradleFile(opts?: GradleOptions): BuiltFile;
|
|
43
|
+
/**
|
|
44
|
+
* Minimal `settings.gradle.kts` so the directory works as a standalone
|
|
45
|
+
* Gradle build (`gradle build`).
|
|
46
|
+
*/
|
|
47
|
+
export declare function settingsGradleFile(name: string): BuiltFile;
|
|
48
|
+
//# sourceMappingURL=gradle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradle.d.ts","sourceRoot":"","sources":["../../src/project/gradle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,aAAa;IAC5B;6BACyB;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yDAAyD;IACzD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yDAAyD;IACzD,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,2CAA2C;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,sDAAsD;IACtD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC;8BAC0B;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,IAAI,GAAE,aAAkB,GAAG,SAAS,CAkCnE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAK1D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function buildGradleFile(opts = {}) {
|
|
2
|
+
const kotlin = opts.kotlinVersion ?? "2.0.21";
|
|
3
|
+
const serialization = opts.kotlinxSerializationVersion ?? "1.7.3";
|
|
4
|
+
const okhttp = opts.okhttpVersion ?? "4.12.0";
|
|
5
|
+
const coroutines = opts.kotlinxCoroutinesVersion ?? "1.9.0";
|
|
6
|
+
const datetime = opts.kotlinxDatetimeVersion ?? "0.6.1";
|
|
7
|
+
const jvmTarget = opts.jvmTarget ?? "17";
|
|
8
|
+
const version = opts.version ?? "0.1.0";
|
|
9
|
+
const groupLine = opts.group ? `group = "${opts.group}"\n` : "";
|
|
10
|
+
return {
|
|
11
|
+
path: "build.gradle.kts",
|
|
12
|
+
content: `plugins {
|
|
13
|
+
kotlin("jvm") version "${kotlin}"
|
|
14
|
+
kotlin("plugin.serialization") version "${kotlin}"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
${groupLine}version = "${version}"
|
|
18
|
+
|
|
19
|
+
repositories {
|
|
20
|
+
mavenCentral()
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
dependencies {
|
|
24
|
+
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${serialization}")
|
|
25
|
+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:${coroutines}")
|
|
26
|
+
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${datetime}")
|
|
27
|
+
implementation("com.squareup.okhttp3:okhttp:${okhttp}")
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
kotlin {
|
|
31
|
+
jvmToolchain(${jvmTarget})
|
|
32
|
+
}
|
|
33
|
+
`,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Minimal `settings.gradle.kts` so the directory works as a standalone
|
|
38
|
+
* Gradle build (`gradle build`).
|
|
39
|
+
*/
|
|
40
|
+
export function settingsGradleFile(name) {
|
|
41
|
+
return {
|
|
42
|
+
path: "settings.gradle.kts",
|
|
43
|
+
content: `rootProject.name = "${name}"\n`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=gradle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../src/project/gradle.ts"],"names":[],"mappings":"AA2CA,MAAM,UAAU,eAAe,CAAC,OAAsB,EAAE;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,2BAA2B,IAAI,OAAO,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,IAAI,QAAQ,CAAC;IAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,wBAAwB,IAAI,OAAO,CAAC;IAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,sBAAsB,IAAI,OAAO,CAAC;IACxD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC;IACzC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC;IACxC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE;6BACgB,MAAM;8CACW,MAAM;;;EAGlD,SAAS,cAAc,OAAO;;;;;;;uEAOuC,aAAa;oEAChB,UAAU;6DACjB,QAAQ;kDACnB,MAAM;;;;mBAIrC,SAAS;;CAE3B;KACE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO;QACL,IAAI,EAAE,qBAAqB;QAC3B,OAAO,EAAE,uBAAuB,IAAI,KAAK;KAC1C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { KtDecl } from "../kt-dsl/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Compute the import list for a single Kotlin file by walking the
|
|
4
|
+
* already-printed source and matching against known identifiers.
|
|
5
|
+
* Coarse-import-everything caused unused imports per file; the
|
|
6
|
+
* print-then-scan pattern is precise without needing a full type-tree
|
|
7
|
+
* walker.
|
|
8
|
+
*
|
|
9
|
+
* Identifiers that share names across packages (e.g. `Response` exists
|
|
10
|
+
* in both `okhttp3` and a hypothetical user model) are disambiguated
|
|
11
|
+
* by file kind: API-layer files always pull `okhttp3.Response`, model
|
|
12
|
+
* files never do.
|
|
13
|
+
*/
|
|
14
|
+
export declare function importsForSource(source: string, ctx: {
|
|
15
|
+
isApiSurface: boolean;
|
|
16
|
+
rootPkg: string;
|
|
17
|
+
subPkg: string;
|
|
18
|
+
}): ReadonlyArray<string>;
|
|
19
|
+
/** API-surface predicate, exposed for the build orchestrator. */
|
|
20
|
+
export declare function isApiSurface(decl: KtDecl): boolean;
|
|
21
|
+
//# sourceMappingURL=imports.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.d.ts","sourceRoot":"","sources":["../../src/project/imports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9D,aAAa,CAAC,MAAM,CAAC,CAmEvB;AAwED,iEAAiE;AACjE,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWlD"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compute the import list for a single Kotlin file by walking the
|
|
3
|
+
* already-printed source and matching against known identifiers.
|
|
4
|
+
* Coarse-import-everything caused unused imports per file; the
|
|
5
|
+
* print-then-scan pattern is precise without needing a full type-tree
|
|
6
|
+
* walker.
|
|
7
|
+
*
|
|
8
|
+
* Identifiers that share names across packages (e.g. `Response` exists
|
|
9
|
+
* in both `okhttp3` and a hypothetical user model) are disambiguated
|
|
10
|
+
* by file kind: API-layer files always pull `okhttp3.Response`, model
|
|
11
|
+
* files never do.
|
|
12
|
+
*/
|
|
13
|
+
export function importsForSource(source, ctx) {
|
|
14
|
+
const set = new Set();
|
|
15
|
+
// kotlinx-serialization annotations.
|
|
16
|
+
if (/@Serializable\b/.test(source)) {
|
|
17
|
+
set.add("kotlinx.serialization.Serializable");
|
|
18
|
+
}
|
|
19
|
+
if (/@SerialName\b/.test(source)) {
|
|
20
|
+
set.add("kotlinx.serialization.SerialName");
|
|
21
|
+
}
|
|
22
|
+
// kotlinx-datetime model fields.
|
|
23
|
+
if (/\bInstant\b/.test(source))
|
|
24
|
+
set.add("kotlinx.datetime.Instant");
|
|
25
|
+
if (/\bLocalDate\b/.test(source))
|
|
26
|
+
set.add("kotlinx.datetime.LocalDate");
|
|
27
|
+
// kotlinx-serialization builtins (only when actually mentioned).
|
|
28
|
+
if (/\bListSerializer\(/.test(source)) {
|
|
29
|
+
set.add("kotlinx.serialization.builtins.ListSerializer");
|
|
30
|
+
}
|
|
31
|
+
if (/\bMapSerializer\(/.test(source)) {
|
|
32
|
+
set.add("kotlinx.serialization.builtins.MapSerializer");
|
|
33
|
+
}
|
|
34
|
+
if (/\bByteArraySerializer\(\)/.test(source)) {
|
|
35
|
+
set.add("kotlinx.serialization.builtins.ByteArraySerializer");
|
|
36
|
+
}
|
|
37
|
+
if (/\.nullable\b/.test(source)) {
|
|
38
|
+
set.add("kotlinx.serialization.builtins.nullable");
|
|
39
|
+
}
|
|
40
|
+
if (/\bserializer\(\)/.test(source) && ctx.isApiSurface) {
|
|
41
|
+
// Built-in `String.serializer()`, `Int.serializer()`, etc. live
|
|
42
|
+
// under kotlinx.serialization.builtins. Only the API surface uses
|
|
43
|
+
// them — model files use the auto-generated companion form.
|
|
44
|
+
set.add("kotlinx.serialization.builtins.serializer");
|
|
45
|
+
}
|
|
46
|
+
if (/\bJsonElement\b/.test(source)) {
|
|
47
|
+
set.add("kotlinx.serialization.json.JsonElement");
|
|
48
|
+
}
|
|
49
|
+
// OkHttp types — only API-surface files reference them.
|
|
50
|
+
if (ctx.isApiSurface) {
|
|
51
|
+
if (/\bHttpUrl\b/.test(source))
|
|
52
|
+
set.add("okhttp3.HttpUrl");
|
|
53
|
+
if (/\bRequest\b/.test(source))
|
|
54
|
+
set.add("okhttp3.Request");
|
|
55
|
+
if (/\bResponse\b/.test(source))
|
|
56
|
+
set.add("okhttp3.Response");
|
|
57
|
+
if (/\bFormBody\b/.test(source))
|
|
58
|
+
set.add("okhttp3.FormBody");
|
|
59
|
+
if (/\.toMediaType\(\)/.test(source)) {
|
|
60
|
+
set.add("okhttp3.MediaType.Companion.toMediaType");
|
|
61
|
+
}
|
|
62
|
+
if (/\.toRequestBody\(/.test(source)) {
|
|
63
|
+
set.add("okhttp3.RequestBody.Companion.toRequestBody");
|
|
64
|
+
}
|
|
65
|
+
// Cross-package model refs. The API surface lives in `<root>.api`
|
|
66
|
+
// and references model types from `<root>.models`. Wildcard-import
|
|
67
|
+
// when the file mentions any PascalCased identifier that isn't a
|
|
68
|
+
// built-in (cheap heuristic; the alternative is walking every type
|
|
69
|
+
// ref through the decl tree).
|
|
70
|
+
if (ctx.subPkg === `${ctx.rootPkg}.api` &&
|
|
71
|
+
/\b[A-Z][A-Za-z0-9_]*\b/.test(source) &&
|
|
72
|
+
hasLikelyModelRef(source)) {
|
|
73
|
+
set.add(`${ctx.rootPkg}.models.*`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Drop self-package imports — Kotlin allows them but they're noise.
|
|
77
|
+
return [...set].filter((i) => !i.startsWith(`${ctx.subPkg}.`)).sort();
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Identifiers that ship in `kotlin.*` / `okhttp3.*` / kotlinx — and so
|
|
81
|
+
* do NOT trigger a `<root>.models.*` import. Used to keep the wildcard
|
|
82
|
+
* model import out of files that never actually reference user types.
|
|
83
|
+
*/
|
|
84
|
+
const NON_MODEL_TYPES = new Set([
|
|
85
|
+
// Kotlin stdlib
|
|
86
|
+
"Any",
|
|
87
|
+
"Unit",
|
|
88
|
+
"Nothing",
|
|
89
|
+
"String",
|
|
90
|
+
"Int",
|
|
91
|
+
"Long",
|
|
92
|
+
"Short",
|
|
93
|
+
"Byte",
|
|
94
|
+
"Double",
|
|
95
|
+
"Float",
|
|
96
|
+
"Boolean",
|
|
97
|
+
"ByteArray",
|
|
98
|
+
"List",
|
|
99
|
+
"Map",
|
|
100
|
+
"Pair",
|
|
101
|
+
"Triple",
|
|
102
|
+
"Throwable",
|
|
103
|
+
"Exception",
|
|
104
|
+
"RuntimeException",
|
|
105
|
+
"Result",
|
|
106
|
+
"Charsets",
|
|
107
|
+
"Base64",
|
|
108
|
+
"TimeUnit",
|
|
109
|
+
// kotlinx
|
|
110
|
+
"Instant",
|
|
111
|
+
"LocalDate",
|
|
112
|
+
"JsonElement",
|
|
113
|
+
"Json",
|
|
114
|
+
"Dispatchers",
|
|
115
|
+
"Serializable",
|
|
116
|
+
"SerialName",
|
|
117
|
+
"ListSerializer",
|
|
118
|
+
"MapSerializer",
|
|
119
|
+
"ByteArraySerializer",
|
|
120
|
+
// OkHttp
|
|
121
|
+
"HttpUrl",
|
|
122
|
+
"Request",
|
|
123
|
+
"Response",
|
|
124
|
+
"OkHttpClient",
|
|
125
|
+
"FormBody",
|
|
126
|
+
"MultipartBody",
|
|
127
|
+
"RequestBody",
|
|
128
|
+
"MediaType",
|
|
129
|
+
// Runtime helpers (same package)
|
|
130
|
+
"APIClient",
|
|
131
|
+
"APIError",
|
|
132
|
+
"APIInterceptors",
|
|
133
|
+
"Auth",
|
|
134
|
+
"APIKeyLocation",
|
|
135
|
+
"MultipartFormBody",
|
|
136
|
+
"QueryStyle",
|
|
137
|
+
"RequestOptions",
|
|
138
|
+
"URLEncoding",
|
|
139
|
+
]);
|
|
140
|
+
function hasLikelyModelRef(source) {
|
|
141
|
+
const matches = source.matchAll(/\b([A-Z][A-Za-z0-9_]*)\b/g);
|
|
142
|
+
for (const m of matches) {
|
|
143
|
+
if (!NON_MODEL_TYPES.has(m[1]))
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
/** API-surface predicate, exposed for the build orchestrator. */
|
|
149
|
+
export function isApiSurface(decl) {
|
|
150
|
+
if (decl.kind === "interface")
|
|
151
|
+
return true;
|
|
152
|
+
if (decl.kind === "class")
|
|
153
|
+
return true;
|
|
154
|
+
if (decl.kind === "topLevelFun")
|
|
155
|
+
return true;
|
|
156
|
+
return Boolean((decl.kind === "enum" ||
|
|
157
|
+
decl.kind === "sealedClass" ||
|
|
158
|
+
decl.kind === "dataClass" ||
|
|
159
|
+
decl.kind === "object") &&
|
|
160
|
+
decl.runtime);
|
|
161
|
+
}
|
|
162
|
+
//# sourceMappingURL=imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../../src/project/imports.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAc,EACd,GAA+D;IAE/D,MAAM,GAAG,GAAG,IAAI,GAAG,EAAU,CAAC;IAE9B,qCAAqC;IACrC,IAAI,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,GAAG,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACjC,GAAG,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;IAC9C,CAAC;IAED,iCAAiC;IACjC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACpE,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAExE,iEAAiE;IACjE,IAAI,oBAAoB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,GAAG,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACr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MAAM;IACN,gBAAgB;IAChB,mBAAmB;IACnB,YAAY;IACZ,gBAAgB;IAChB,aAAa;CACd,CAAC,CAAC;AAEH,SAAS,iBAAiB,CAAC,MAAc;IACvC,MAAM,OAAO,GAAG,MAAM,CAAC,QAAQ,CAAC,2BAA2B,CAAC,CAAC;IAC7D,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC;YAAE,OAAO,IAAI,CAAC;IAC/C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;QAAE,OAAO,IAAI,CAAC;IAC7C,OAAO,OAAO,CACZ,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;QACnB,IAAI,CAAC,IAAI,KAAK,aAAa;QAC3B,IAAI,CAAC,IAAI,KAAK,WAAW;QACzB,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC;QACvB,IAAI,CAAC,OAAO,CACf,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { BuildOptions, BuiltFile } from "./build.js";
|
|
2
|
+
export { buildKotlinProject, runtimeFileToBuilt } from "./build.js";
|
|
3
|
+
export type { GradleOptions } from "./gradle.js";
|
|
4
|
+
export { buildGradleFile, settingsGradleFile } from "./gradle.js";
|
|
5
|
+
export type { LayoutKind, PlacementOptions } from "./layout.js";
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAClE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/project/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { KtDecl } from "../kt-dsl/decl/types.js";
|
|
2
|
+
export type LayoutKind = "flat" | "split";
|
|
3
|
+
export interface PlacedDecl {
|
|
4
|
+
decl: KtDecl;
|
|
5
|
+
/** Output dir relative to the SDK root, using `/` separators. */
|
|
6
|
+
dir: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PlacementOptions {
|
|
9
|
+
/**
|
|
10
|
+
* `split` (default) → API-layer decls (interfaces, impl classes,
|
|
11
|
+
* top-level extension funs) live in `api/` and value types in
|
|
12
|
+
* `models/`. `flat` → everything in the SDK root (single package).
|
|
13
|
+
*/
|
|
14
|
+
layout?: LayoutKind;
|
|
15
|
+
/** Per-decl override; `undefined` falls back to layout default. */
|
|
16
|
+
fileLocation?: (decl: KtDecl) => {
|
|
17
|
+
dir: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}
|
|
20
|
+
export declare function placeDecl(decl: KtDecl, opts: PlacementOptions): PlacedDecl;
|
|
21
|
+
/**
|
|
22
|
+
* Pick the file name a decl renders into.
|
|
23
|
+
*
|
|
24
|
+
* Top-level extension funs don't have their own decl name — they're
|
|
25
|
+
* named for the function plus receiver. Convention: render them into
|
|
26
|
+
* `<ReceiverName>Extensions.kt`; when several share a receiver they
|
|
27
|
+
* collapse into the same file at orchestration time.
|
|
28
|
+
*/
|
|
29
|
+
export declare function declFileName(decl: KtDecl): string;
|
|
30
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/project/layout.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,mEAAmE;IACnE,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC9D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,UAAU,CAM1E;AAmCD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQjD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { posix as pathPosix } from "node:path";
|
|
2
|
+
export function placeDecl(decl, opts) {
|
|
3
|
+
const override = opts.fileLocation?.(decl);
|
|
4
|
+
if (override)
|
|
5
|
+
return { decl, dir: safeRelativeDir(override.dir) };
|
|
6
|
+
const layout = opts.layout ?? "split";
|
|
7
|
+
if (layout === "flat")
|
|
8
|
+
return { decl, dir: "." };
|
|
9
|
+
return { decl, dir: isApiDecl(decl) ? "api" : "models" };
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Reject absolute paths and any normalized form that escapes the SDK
|
|
13
|
+
* root via `..`. Generators write into the override dir; an unguarded
|
|
14
|
+
* `../..` could clobber files outside the output tree.
|
|
15
|
+
*/
|
|
16
|
+
function safeRelativeDir(dir) {
|
|
17
|
+
const normalized = pathPosix.normalize(dir || ".");
|
|
18
|
+
if (pathPosix.isAbsolute(normalized) ||
|
|
19
|
+
normalized === ".." ||
|
|
20
|
+
normalized.startsWith("../")) {
|
|
21
|
+
throw new Error(`fileLocation: invalid output directory: ${dir}`);
|
|
22
|
+
}
|
|
23
|
+
return normalized;
|
|
24
|
+
}
|
|
25
|
+
function isApiDecl(decl) {
|
|
26
|
+
if (decl.kind === "interface")
|
|
27
|
+
return true;
|
|
28
|
+
if (decl.kind === "class")
|
|
29
|
+
return true;
|
|
30
|
+
if (decl.kind === "topLevelFun")
|
|
31
|
+
return true;
|
|
32
|
+
if ((decl.kind === "enum" ||
|
|
33
|
+
decl.kind === "object" ||
|
|
34
|
+
decl.kind === "sealedClass" ||
|
|
35
|
+
decl.kind === "dataClass") &&
|
|
36
|
+
decl.runtime) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Pick the file name a decl renders into.
|
|
43
|
+
*
|
|
44
|
+
* Top-level extension funs don't have their own decl name — they're
|
|
45
|
+
* named for the function plus receiver. Convention: render them into
|
|
46
|
+
* `<ReceiverName>Extensions.kt`; when several share a receiver they
|
|
47
|
+
* collapse into the same file at orchestration time.
|
|
48
|
+
*/
|
|
49
|
+
export function declFileName(decl) {
|
|
50
|
+
if (decl.kind === "topLevelFun") {
|
|
51
|
+
const receiver = decl.fun.receiver;
|
|
52
|
+
const recvName = receiver && receiver.kind === "ref" ? receiver.name : "Extensions";
|
|
53
|
+
return `${recvName}Extensions.kt`;
|
|
54
|
+
}
|
|
55
|
+
return `${decl.name}.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OAAO;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;QAAE,OAAO,IAAI,CAAC;IAC7C,IACE,CAAC,IAAI,CAAC,IAAI,KAAK,MAAM;QACnB,IAAI,CAAC,IAAI,KAAK,QAAQ;QACtB,IAAI,CAAC,IAAI,KAAK,aAAa;QAC3B,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC;QAC5B,IAAI,CAAC,OAAO,EACZ,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnC,MAAM,QAAQ,GACZ,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC;QACrE,OAAO,GAAG,QAAQ,eAAe,CAAC;IACpC,CAAC;IACD,OAAO,GAAG,IAAI,CAAC,IAAI,KAAK,CAAC;AAC3B,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ir-kit/openapi-kotlin",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Generate idiomatic Kotlin (OkHttp + kotlinx-serialization + suspend) client SDKs from an OpenAPI 3.x spec.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"openapi",
|
|
7
|
+
"kotlin",
|
|
8
|
+
"android",
|
|
9
|
+
"okhttp",
|
|
10
|
+
"kotlinx-serialization",
|
|
11
|
+
"codegen",
|
|
12
|
+
"sdk",
|
|
13
|
+
"client"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/ir-kit/ir-kit/tree/main/packages/openapi/kotlin",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/ir-kit/ir-kit/issues"
|
|
18
|
+
},
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"author": {
|
|
21
|
+
"name": "Ahmed Rowaihi",
|
|
22
|
+
"email": "ahmedrowaihi@gmail.com"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/ir-kit/ir-kit.git",
|
|
27
|
+
"directory": "packages/openapi/kotlin"
|
|
28
|
+
},
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"main": "./dist/index.js",
|
|
32
|
+
"types": "./dist/index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./package.json": "./package.json"
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"dist",
|
|
42
|
+
"README.md",
|
|
43
|
+
"LICENSE.md"
|
|
44
|
+
],
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public",
|
|
47
|
+
"provenance": true
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@hey-api/shared": ">=0.3.0",
|
|
51
|
+
"@hey-api/spec-types": ">=0.2.0",
|
|
52
|
+
"@ir-kit/openapi-tools": ">=0.1.0"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@ir-kit/codegen-core": "0.1.0",
|
|
56
|
+
"@ir-kit/openapi": "0.1.0",
|
|
57
|
+
"@ir-kit/openapi-core": "0.1.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@hey-api/shared": "^0.4.2",
|
|
61
|
+
"@hey-api/spec-types": "^0.2.0",
|
|
62
|
+
"@types/node": "^22",
|
|
63
|
+
"vitest": "^4.0.0",
|
|
64
|
+
"@ir-kit/openapi-tools": "0.1.0",
|
|
65
|
+
"@ir-kit/tsconfig": "0.0.0"
|
|
66
|
+
},
|
|
67
|
+
"engines": {
|
|
68
|
+
"node": ">=20.19.0"
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "tsc -p tsconfig.build.json",
|
|
72
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
73
|
+
"typecheck": "tsc --noEmit",
|
|
74
|
+
"test": "vitest run --passWithNoTests"
|
|
75
|
+
}
|
|
76
|
+
}
|