@ir-kit/openapi-kotlin 2.0.0 → 2.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/README.md +13 -13
- package/dist/ast/index.d.ts +168 -0
- package/dist/ast/index.d.ts.map +1 -0
- package/dist/ast/index.js +194 -0
- package/dist/ast/index.js.map +1 -0
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +7 -7
- package/dist/generate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ir/identifiers.d.ts +7 -0
- package/dist/ir/identifiers.d.ts.map +1 -1
- package/dist/ir/identifiers.js +92 -3
- package/dist/ir/identifiers.js.map +1 -1
- package/dist/ir/impl/body.d.ts +4 -3
- package/dist/ir/impl/body.d.ts.map +1 -1
- package/dist/ir/impl/body.js +11 -8
- package/dist/ir/impl/body.js.map +1 -1
- package/dist/ir/impl/decode.d.ts +3 -2
- package/dist/ir/impl/decode.d.ts.map +1 -1
- package/dist/ir/impl/decode.js +16 -16
- package/dist/ir/impl/decode.js.map +1 -1
- package/dist/ir/impl/headers.d.ts +1 -1
- package/dist/ir/impl/headers.d.ts.map +1 -1
- package/dist/ir/impl/headers.js +3 -3
- package/dist/ir/impl/headers.js.map +1 -1
- package/dist/ir/impl/index.d.ts +5 -2
- package/dist/ir/impl/index.d.ts.map +1 -1
- package/dist/ir/impl/index.js +6 -7
- package/dist/ir/impl/index.js.map +1 -1
- package/dist/ir/impl/request.d.ts +6 -6
- package/dist/ir/impl/request.d.ts.map +1 -1
- package/dist/ir/impl/request.js +18 -8
- package/dist/ir/impl/request.js.map +1 -1
- package/dist/ir/impl/serializer.d.ts +4 -2
- package/dist/ir/impl/serializer.d.ts.map +1 -1
- package/dist/ir/impl/serializer.js +41 -60
- package/dist/ir/impl/serializer.js.map +1 -1
- package/dist/ir/impl/url.d.ts +1 -1
- package/dist/ir/impl/url.d.ts.map +1 -1
- package/dist/ir/impl/url.js +4 -4
- package/dist/ir/impl/url.js.map +1 -1
- package/dist/ir/index.d.ts +1 -1
- package/dist/ir/index.d.ts.map +1 -1
- package/dist/ir/index.js +1 -1
- package/dist/ir/index.js.map +1 -1
- package/dist/ir/operation/body.d.ts +1 -1
- package/dist/ir/operation/body.d.ts.map +1 -1
- package/dist/ir/operation/body.js +3 -3
- package/dist/ir/operation/body.js.map +1 -1
- package/dist/ir/operation/params.d.ts +1 -1
- package/dist/ir/operation/params.d.ts.map +1 -1
- package/dist/ir/operation/params.js +3 -3
- package/dist/ir/operation/params.js.map +1 -1
- package/dist/ir/operation/response.d.ts +3 -1
- package/dist/ir/operation/response.d.ts.map +1 -1
- package/dist/ir/operation/response.js +3 -4
- package/dist/ir/operation/response.js.map +1 -1
- package/dist/ir/operation/signature.d.ts +4 -2
- package/dist/ir/operation/signature.d.ts.map +1 -1
- package/dist/ir/operation/signature.js +5 -4
- package/dist/ir/operation/signature.js.map +1 -1
- package/dist/ir/operations.d.ts +7 -1
- package/dist/ir/operations.d.ts.map +1 -1
- package/dist/ir/operations.js +13 -7
- package/dist/ir/operations.js.map +1 -1
- package/dist/ir/runtime/index.d.ts +1 -1
- package/dist/ir/runtime/index.d.ts.map +1 -1
- package/dist/ir/runtime/index.js +1 -1
- package/dist/ir/runtime/index.js.map +1 -1
- package/dist/ir/runtime/templates.d.ts +1 -21
- package/dist/ir/runtime/templates.d.ts.map +1 -1
- package/dist/ir/runtime/templates.js +24 -428
- package/dist/ir/runtime/templates.js.map +1 -1
- package/dist/ir/schema.d.ts +3 -2
- package/dist/ir/schema.d.ts.map +1 -1
- package/dist/ir/schema.js +24 -11
- package/dist/ir/schema.js.map +1 -1
- package/dist/ir/type/context.d.ts +1 -1
- package/dist/ir/type/context.d.ts.map +1 -1
- package/dist/ir/type/index.d.ts +5 -3
- package/dist/ir/type/index.d.ts.map +1 -1
- package/dist/ir/type/index.js +12 -8
- package/dist/ir/type/index.js.map +1 -1
- package/dist/ir/type/primitive.d.ts +1 -1
- package/dist/ir/type/primitive.d.ts.map +1 -1
- package/dist/ir/type/primitive.js +1 -1
- package/dist/ir/type/primitive.js.map +1 -1
- package/dist/ir/type-ops.d.ts +2 -2
- package/dist/ir/type-ops.d.ts.map +1 -1
- package/dist/ir/type-ops.js +13 -17
- package/dist/ir/type-ops.js.map +1 -1
- package/dist/kt-compiler/index.d.ts +3 -6
- package/dist/kt-compiler/index.d.ts.map +1 -1
- package/dist/kt-compiler/index.js +7 -22
- package/dist/kt-compiler/index.js.map +1 -1
- package/dist/project/build.d.ts +1 -1
- package/dist/project/build.d.ts.map +1 -1
- package/dist/project/build.js +6 -8
- package/dist/project/build.js.map +1 -1
- package/dist/project/imports.d.ts +12 -12
- package/dist/project/imports.d.ts.map +1 -1
- package/dist/project/imports.js +60 -138
- package/dist/project/imports.js.map +1 -1
- package/dist/project/layout.d.ts +1 -1
- package/dist/project/layout.d.ts.map +1 -1
- package/dist/project/layout.js +1 -3
- package/dist/project/layout.js.map +1 -1
- package/package.json +11 -9
- package/runtime/APIClient.kt +140 -0
- package/runtime/APIError.kt +42 -0
- package/runtime/APIInterceptors.kt +14 -0
- package/runtime/APIKeyLocation.kt +7 -0
- package/runtime/Auth.kt +86 -0
- package/runtime/MultipartFormBody.kt +41 -0
- package/runtime/QueryStyle.kt +12 -0
- package/runtime/RequestOptions.kt +29 -0
- package/runtime/URLEncoding.kt +45 -0
- package/dist/kt-compiler/decl/class.d.ts +0 -6
- package/dist/kt-compiler/decl/class.d.ts.map +0 -1
- package/dist/kt-compiler/decl/class.js +0 -38
- package/dist/kt-compiler/decl/class.js.map +0 -1
- package/dist/kt-compiler/decl/dataClass.d.ts +0 -3
- package/dist/kt-compiler/decl/dataClass.d.ts.map +0 -1
- package/dist/kt-compiler/decl/dataClass.js +0 -18
- package/dist/kt-compiler/decl/dataClass.js.map +0 -1
- package/dist/kt-compiler/decl/enum.d.ts +0 -3
- package/dist/kt-compiler/decl/enum.d.ts.map +0 -1
- package/dist/kt-compiler/decl/enum.js +0 -32
- package/dist/kt-compiler/decl/enum.js.map +0 -1
- package/dist/kt-compiler/decl/fun.d.ts +0 -11
- package/dist/kt-compiler/decl/fun.d.ts.map +0 -1
- package/dist/kt-compiler/decl/fun.js +0 -69
- package/dist/kt-compiler/decl/fun.js.map +0 -1
- package/dist/kt-compiler/decl/index.d.ts +0 -13
- package/dist/kt-compiler/decl/index.d.ts.map +0 -1
- package/dist/kt-compiler/decl/index.js +0 -39
- package/dist/kt-compiler/decl/index.js.map +0 -1
- package/dist/kt-compiler/decl/interface.d.ts +0 -3
- package/dist/kt-compiler/decl/interface.d.ts.map +0 -1
- package/dist/kt-compiler/decl/interface.js +0 -15
- package/dist/kt-compiler/decl/interface.js.map +0 -1
- package/dist/kt-compiler/decl/object.d.ts +0 -3
- package/dist/kt-compiler/decl/object.d.ts.map +0 -1
- package/dist/kt-compiler/decl/object.js +0 -19
- package/dist/kt-compiler/decl/object.js.map +0 -1
- package/dist/kt-compiler/decl/prop.d.ts +0 -20
- package/dist/kt-compiler/decl/prop.d.ts.map +0 -1
- package/dist/kt-compiler/decl/prop.js +0 -42
- package/dist/kt-compiler/decl/prop.js.map +0 -1
- package/dist/kt-compiler/decl/sealedClass.d.ts +0 -3
- package/dist/kt-compiler/decl/sealedClass.d.ts.map +0 -1
- package/dist/kt-compiler/decl/sealedClass.js +0 -32
- package/dist/kt-compiler/decl/sealedClass.js.map +0 -1
- package/dist/kt-compiler/decl/topLevel.d.ts +0 -3
- package/dist/kt-compiler/decl/topLevel.d.ts.map +0 -1
- package/dist/kt-compiler/decl/topLevel.js +0 -5
- package/dist/kt-compiler/decl/topLevel.js.map +0 -1
- package/dist/kt-compiler/decl/typeAlias.d.ts +0 -3
- package/dist/kt-compiler/decl/typeAlias.d.ts.map +0 -1
- package/dist/kt-compiler/decl/typeAlias.js +0 -6
- package/dist/kt-compiler/decl/typeAlias.js.map +0 -1
- package/dist/kt-compiler/expr.d.ts +0 -4
- package/dist/kt-compiler/expr.d.ts.map +0 -1
- package/dist/kt-compiler/expr.js +0 -123
- package/dist/kt-compiler/expr.js.map +0 -1
- package/dist/kt-compiler/format.d.ts +0 -20
- package/dist/kt-compiler/format.d.ts.map +0 -1
- package/dist/kt-compiler/format.js +0 -27
- package/dist/kt-compiler/format.js.map +0 -1
- package/dist/kt-compiler/stmt.d.ts +0 -4
- package/dist/kt-compiler/stmt.d.ts.map +0 -1
- package/dist/kt-compiler/stmt.js +0 -72
- package/dist/kt-compiler/stmt.js.map +0 -1
- package/dist/kt-compiler/type.d.ts +0 -3
- package/dist/kt-compiler/type.d.ts.map +0 -1
- package/dist/kt-compiler/type.js +0 -28
- package/dist/kt-compiler/type.js.map +0 -1
- package/dist/kt-dsl/decl/class.d.ts +0 -50
- package/dist/kt-dsl/decl/class.d.ts.map +0 -1
- package/dist/kt-dsl/decl/class.js +0 -33
- package/dist/kt-dsl/decl/class.js.map +0 -1
- package/dist/kt-dsl/decl/dataClass.d.ts +0 -36
- package/dist/kt-dsl/decl/dataClass.d.ts.map +0 -1
- package/dist/kt-dsl/decl/dataClass.js +0 -25
- package/dist/kt-dsl/decl/dataClass.js.map +0 -1
- package/dist/kt-dsl/decl/enum.d.ts +0 -60
- package/dist/kt-dsl/decl/enum.d.ts.map +0 -1
- package/dist/kt-dsl/decl/enum.js +0 -38
- package/dist/kt-dsl/decl/enum.js.map +0 -1
- package/dist/kt-dsl/decl/index.d.ts +0 -11
- package/dist/kt-dsl/decl/index.d.ts.map +0 -1
- package/dist/kt-dsl/decl/index.js +0 -11
- package/dist/kt-dsl/decl/index.js.map +0 -1
- package/dist/kt-dsl/decl/interface.d.ts +0 -33
- package/dist/kt-dsl/decl/interface.d.ts.map +0 -1
- package/dist/kt-dsl/decl/interface.js +0 -24
- package/dist/kt-dsl/decl/interface.js.map +0 -1
- package/dist/kt-dsl/decl/object.d.ts +0 -34
- package/dist/kt-dsl/decl/object.d.ts.map +0 -1
- package/dist/kt-dsl/decl/object.js +0 -24
- package/dist/kt-dsl/decl/object.js.map +0 -1
- package/dist/kt-dsl/decl/prop.d.ts +0 -47
- package/dist/kt-dsl/decl/prop.d.ts.map +0 -1
- package/dist/kt-dsl/decl/prop.js +0 -28
- package/dist/kt-dsl/decl/prop.js.map +0 -1
- package/dist/kt-dsl/decl/sealedClass.d.ts +0 -68
- package/dist/kt-dsl/decl/sealedClass.d.ts.map +0 -1
- package/dist/kt-dsl/decl/sealedClass.js +0 -52
- package/dist/kt-dsl/decl/sealedClass.js.map +0 -1
- package/dist/kt-dsl/decl/topLevel.d.ts +0 -19
- package/dist/kt-dsl/decl/topLevel.d.ts.map +0 -1
- package/dist/kt-dsl/decl/topLevel.js +0 -17
- package/dist/kt-dsl/decl/topLevel.js.map +0 -1
- package/dist/kt-dsl/decl/typeAlias.d.ts +0 -23
- package/dist/kt-dsl/decl/typeAlias.d.ts.map +0 -1
- package/dist/kt-dsl/decl/typeAlias.js +0 -18
- package/dist/kt-dsl/decl/typeAlias.js.map +0 -1
- package/dist/kt-dsl/decl/types.d.ts +0 -10
- package/dist/kt-dsl/decl/types.d.ts.map +0 -1
- package/dist/kt-dsl/decl/types.js +0 -2
- package/dist/kt-dsl/decl/types.js.map +0 -1
- package/dist/kt-dsl/expr/access.d.ts +0 -48
- package/dist/kt-dsl/expr/access.d.ts.map +0 -1
- package/dist/kt-dsl/expr/access.js +0 -59
- package/dist/kt-dsl/expr/access.js.map +0 -1
- package/dist/kt-dsl/expr/call.d.ts +0 -38
- package/dist/kt-dsl/expr/call.d.ts.map +0 -1
- package/dist/kt-dsl/expr/call.js +0 -38
- package/dist/kt-dsl/expr/call.js.map +0 -1
- package/dist/kt-dsl/expr/index.d.ts +0 -7
- package/dist/kt-dsl/expr/index.d.ts.map +0 -1
- package/dist/kt-dsl/expr/index.js +0 -7
- package/dist/kt-dsl/expr/index.js.map +0 -1
- package/dist/kt-dsl/expr/literal.d.ts +0 -100
- package/dist/kt-dsl/expr/literal.d.ts.map +0 -1
- package/dist/kt-dsl/expr/literal.js +0 -108
- package/dist/kt-dsl/expr/literal.js.map +0 -1
- package/dist/kt-dsl/expr/misc.d.ts +0 -45
- package/dist/kt-dsl/expr/misc.d.ts.map +0 -1
- package/dist/kt-dsl/expr/misc.js +0 -63
- package/dist/kt-dsl/expr/misc.js.map +0 -1
- package/dist/kt-dsl/expr/op.d.ts +0 -25
- package/dist/kt-dsl/expr/op.d.ts.map +0 -1
- package/dist/kt-dsl/expr/op.js +0 -24
- package/dist/kt-dsl/expr/op.js.map +0 -1
- package/dist/kt-dsl/expr/types.d.ts +0 -93
- package/dist/kt-dsl/expr/types.d.ts.map +0 -1
- package/dist/kt-dsl/expr/types.js +0 -2
- package/dist/kt-dsl/expr/types.js.map +0 -1
- package/dist/kt-dsl/file.d.ts +0 -14
- package/dist/kt-dsl/file.d.ts.map +0 -1
- package/dist/kt-dsl/file.js +0 -9
- package/dist/kt-dsl/file.js.map +0 -1
- package/dist/kt-dsl/fun.d.ts +0 -73
- package/dist/kt-dsl/fun.d.ts.map +0 -1
- package/dist/kt-dsl/fun.js +0 -50
- package/dist/kt-dsl/fun.js.map +0 -1
- package/dist/kt-dsl/index.d.ts +0 -8
- package/dist/kt-dsl/index.d.ts.map +0 -1
- package/dist/kt-dsl/index.js +0 -8
- package/dist/kt-dsl/index.js.map +0 -1
- package/dist/kt-dsl/stmt/binding.d.ts +0 -56
- package/dist/kt-dsl/stmt/binding.d.ts.map +0 -1
- package/dist/kt-dsl/stmt/binding.js +0 -70
- package/dist/kt-dsl/stmt/binding.js.map +0 -1
- package/dist/kt-dsl/stmt/control.d.ts +0 -80
- package/dist/kt-dsl/stmt/control.d.ts.map +0 -1
- package/dist/kt-dsl/stmt/control.js +0 -77
- package/dist/kt-dsl/stmt/control.js.map +0 -1
- package/dist/kt-dsl/stmt/index.d.ts +0 -4
- package/dist/kt-dsl/stmt/index.d.ts.map +0 -1
- package/dist/kt-dsl/stmt/index.js +0 -4
- package/dist/kt-dsl/stmt/index.js.map +0 -1
- package/dist/kt-dsl/stmt/types.d.ts +0 -62
- package/dist/kt-dsl/stmt/types.d.ts.map +0 -1
- package/dist/kt-dsl/stmt/types.js +0 -2
- package/dist/kt-dsl/stmt/types.js.map +0 -1
- package/dist/kt-dsl/type/builders.d.ts +0 -75
- package/dist/kt-dsl/type/builders.d.ts.map +0 -1
- package/dist/kt-dsl/type/builders.js +0 -83
- package/dist/kt-dsl/type/builders.js.map +0 -1
- package/dist/kt-dsl/type/index.d.ts +0 -3
- package/dist/kt-dsl/type/index.d.ts.map +0 -1
- package/dist/kt-dsl/type/index.js +0 -3
- package/dist/kt-dsl/type/index.js.map +0 -1
- package/dist/kt-dsl/type/types.d.ts +0 -25
- package/dist/kt-dsl/type/types.d.ts.map +0 -1
- package/dist/kt-dsl/type/types.js +0 -2
- package/dist/kt-dsl/type/types.js.map +0 -1
- package/dist/kt-dsl/visibility.d.ts +0 -2
- package/dist/kt-dsl/visibility.d.ts.map +0 -1
- package/dist/kt-dsl/visibility.js +0 -2
- package/dist/kt-dsl/visibility.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type KtExpr, type KtType } from "../../
|
|
1
|
+
import { type KtExpr, type KtType } from "../../ast/index.js";
|
|
2
2
|
/**
|
|
3
3
|
* Build the kotlinx-serialization `KSerializer<T>` expression for a
|
|
4
4
|
* `KtType`. Used wherever the impl needs to feed a serializer to
|
|
@@ -16,5 +16,7 @@ import { type KtExpr, type KtType } from "../../kt-dsl/index.js";
|
|
|
16
16
|
* The orchestrator tracks which builtin imports are needed and emits
|
|
17
17
|
* the right `import kotlinx.serialization.builtins.*` line.
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
/** Type aliases by name, so `X.serializer()` is only emitted for real classes. */
|
|
20
|
+
export type SerializerAliases = ReadonlyMap<string, KtType>;
|
|
21
|
+
export declare function serializerFor(t: KtType, aliases?: SerializerAliases): KtExpr;
|
|
20
22
|
//# sourceMappingURL=serializer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/ir/impl/serializer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../../src/ir/impl/serializer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,MAAM,EAOZ,MAAM,oBAAoB,CAAC;AAI5B;;;;;;;;;;;;;;;;GAgBG;AACH,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5D,wBAAgB,aAAa,CAC3B,CAAC,EAAE,MAAM,EACT,OAAO,GAAE,iBAA6B,GACrC,MAAM,CAsBR"}
|
|
@@ -1,62 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return ktCall(ktIdent("MapSerializer"), [
|
|
31
|
-
ktArg(serializerFor(t.key)),
|
|
32
|
-
ktArg(serializerFor(t.value)),
|
|
33
|
-
]);
|
|
34
|
-
case "ref":
|
|
35
|
-
return ktCall(ktMember(ktIdent(t.name), "serializer"), []);
|
|
36
|
-
case "func":
|
|
37
|
-
// No good serializer for closure types; falls back to JsonElement.
|
|
38
|
-
return ktCall(ktMember(ktIdent("JsonElement"), "serializer"), []);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
function primitiveSerializer(name) {
|
|
42
|
-
switch (name) {
|
|
43
|
-
case "String":
|
|
44
|
-
case "Int":
|
|
45
|
-
case "Long":
|
|
46
|
-
case "Short":
|
|
47
|
-
case "Byte":
|
|
48
|
-
case "Double":
|
|
49
|
-
case "Float":
|
|
50
|
-
case "Boolean":
|
|
51
|
-
return ktCall(ktMember(ktIdent(name), "serializer"), []);
|
|
52
|
-
case "ByteArray":
|
|
53
|
-
// ByteArraySerializer is a top-level value, not a fun.
|
|
54
|
-
return ktIdent("ByteArraySerializer()");
|
|
55
|
-
case "Unit":
|
|
56
|
-
case "Any":
|
|
57
|
-
case "Nothing":
|
|
58
|
-
default:
|
|
59
|
-
return ktCall(ktMember(ktIdent("JsonElement"), "serializer"), []);
|
|
60
|
-
}
|
|
1
|
+
import { kt } from "@ir-kit/compiler-kotlin";
|
|
2
|
+
import { ktArg, ktCall, ktIdent, ktMember, typeArgs, typeName, } from "../../ast/index.js";
|
|
3
|
+
const K = kt.KotlinNodeKind;
|
|
4
|
+
export function serializerFor(t, aliases = new Map()) {
|
|
5
|
+
if (t.kind === K.NullableType)
|
|
6
|
+
return ktMember(serializerFor(t.type, aliases), "nullable");
|
|
7
|
+
const name = typeName(t);
|
|
8
|
+
if (name === undefined)
|
|
9
|
+
return jsonElementSerializer();
|
|
10
|
+
const [first, second] = typeArgs(t);
|
|
11
|
+
if (name === "List" && first)
|
|
12
|
+
return ktCall(ktIdent("ListSerializer"), [
|
|
13
|
+
ktArg(serializerFor(first, aliases)),
|
|
14
|
+
]);
|
|
15
|
+
if (name === "Map" && first && second)
|
|
16
|
+
return ktCall(ktIdent("MapSerializer"), [
|
|
17
|
+
ktArg(serializerFor(first, aliases)),
|
|
18
|
+
ktArg(serializerFor(second, aliases)),
|
|
19
|
+
]);
|
|
20
|
+
if (BUILTIN_SERIALIZERS.has(name))
|
|
21
|
+
return ktCall(ktMember(ktIdent(name), "serializer"), []);
|
|
22
|
+
if (name === "ByteArray")
|
|
23
|
+
return ktCall(ktIdent("ByteArraySerializer"), []);
|
|
24
|
+
if (OPAQUE.has(name))
|
|
25
|
+
return jsonElementSerializer();
|
|
26
|
+
const target = aliases.get(name);
|
|
27
|
+
if (target)
|
|
28
|
+
return serializerFor(target, aliases);
|
|
29
|
+
return ktCall(ktMember(ktIdent(name), "serializer"), []);
|
|
61
30
|
}
|
|
31
|
+
const BUILTIN_SERIALIZERS = new Set([
|
|
32
|
+
"String",
|
|
33
|
+
"Int",
|
|
34
|
+
"Long",
|
|
35
|
+
"Short",
|
|
36
|
+
"Byte",
|
|
37
|
+
"Double",
|
|
38
|
+
"Float",
|
|
39
|
+
"Boolean",
|
|
40
|
+
]);
|
|
41
|
+
const OPAQUE = new Set(["Unit", "Any", "Nothing"]);
|
|
42
|
+
const jsonElementSerializer = () => ktCall(ktMember(ktIdent("JsonElement"), "serializer"), []);
|
|
62
43
|
//# sourceMappingURL=serializer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/ir/impl/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,GACT,MAAM,
|
|
1
|
+
{"version":3,"file":"serializer.js","sourceRoot":"","sources":["../../../src/ir/impl/serializer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,yBAAyB,CAAC;AAE7C,OAAO,EAGL,KAAK,EACL,MAAM,EACN,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC;AAsB5B,MAAM,UAAU,aAAa,CAC3B,CAAS,EACT,UAA6B,IAAI,GAAG,EAAE;IAEtC,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,YAAY;QAC3B,OAAO,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,CAAC;IAC9D,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AAwB,IAAI,GAAG,CAAC;IACvD,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,MAAM;IACN,QAAQ;IACR,OAAO;IACP,SAAS;CACV,CAAC,CAAC;AAEH,MAAM,MAAM,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC;AAExE,MAAM,qBAAqB,GAAG,GAAW,EAAE,CACzC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC"}
|
package/dist/ir/impl/url.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type LocatedParam } from "@ir-kit/openapi";
|
|
2
|
-
import { type KtStmt } from "../../
|
|
2
|
+
import { type KtStmt } from "../../ast/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* Statements that build an `HttpUrl` from `baseUrl`, the path template,
|
|
5
5
|
* and query parameters. The result is bound to `url`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/ir/impl/url.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,MAAM,EAWZ,MAAM,
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/ir/impl/url.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,KAAK,MAAM,EAWZ,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;GAWG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,GACnC,aAAa,CAAC,MAAM,CAAC,CAuBvB"}
|
package/dist/ir/impl/url.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { paramsAt, parseTemplatedSegment, splitPathSegments, } from "@ir-kit/openapi";
|
|
2
|
-
import { ktArg, ktBoolLit, ktCall, ktExprStmt, ktIdent, ktInterp, ktMember, ktStr, ktVal, ktVar, } from "../../
|
|
3
|
-
import {
|
|
2
|
+
import { ktArg, ktBoolLit, ktCall, ktExprStmt, ktIdent, ktInterp, ktMember, ktStr, ktVal, ktVar, } from "../../ast/index.js";
|
|
3
|
+
import { operationParamIdent } from "../identifiers.js";
|
|
4
4
|
/**
|
|
5
5
|
* Statements that build an `HttpUrl` from `baseUrl`, the path template,
|
|
6
6
|
* and query parameters. The result is bound to `url`.
|
|
@@ -34,7 +34,7 @@ function segmentExpr(seg, pathParams) {
|
|
|
34
34
|
const parts = parseTemplatedSegment(seg, pathParams).map((p) => p.kind === "literal"
|
|
35
35
|
? p.text
|
|
36
36
|
: {
|
|
37
|
-
expr: ktIdent(
|
|
37
|
+
expr: ktIdent(operationParamIdent(p.param ? p.param.name : p.name)),
|
|
38
38
|
isString: p.param?.schema.type === "string",
|
|
39
39
|
});
|
|
40
40
|
if (parts.length === 0)
|
|
@@ -50,7 +50,7 @@ function segmentExpr(seg, pathParams) {
|
|
|
50
50
|
return ktInterp(parts.map((p) => (typeof p === "string" ? p : p.expr)));
|
|
51
51
|
}
|
|
52
52
|
function buildQueryStmt(p) {
|
|
53
|
-
const id =
|
|
53
|
+
const id = operationParamIdent(p.name);
|
|
54
54
|
const isArray = p.schema.type === "array";
|
|
55
55
|
const helper = isArray ? "addArray" : "addScalar";
|
|
56
56
|
const args = [
|
package/dist/ir/impl/url.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.js","sourceRoot":"","sources":["../../../src/ir/impl/url.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,QAAQ,EACR,qBAAqB,EACrB,iBAAiB,GAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIL,KAAK,EACL,SAAS,EACT,MAAM,EACN,UAAU,E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B,CAAC;AACH,CAAC"}
|
package/dist/ir/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export type { OperationsOptions, OperationsResult } from "./operations.js";
|
|
2
|
-
export { operationsToDecls } from "./operations.js";
|
|
2
|
+
export { aliasesOf, operationsToDecls } from "./operations.js";
|
|
3
3
|
export { schemasToDecls } from "./schema.js";
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ir/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/ir/index.js
CHANGED
package/dist/ir/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ir/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IR } from "@hey-api/shared";
|
|
2
|
-
import { type KtFunParam } from "../../
|
|
2
|
+
import { type KtFunParam } from "../../ast/index.js";
|
|
3
3
|
import type { TypeCtx } from "../type/index.js";
|
|
4
4
|
/**
|
|
5
5
|
* Resolve an `IR.BodyObject` into function parameters for both the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAO1C,OAAO,EACL,KAAK,UAAU,EAIhB,MAAM,
|
|
1
|
+
{"version":3,"file":"body.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAO1C,OAAO,EACL,KAAK,UAAU,EAIhB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,EAAE,CAAC,UAAU,EACnB,GAAG,EAAE,OAAO,GACX,aAAa,CAAC,UAAU,CAAC,CAoB3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { classifyBody, iterateObjectProperties, } from "@ir-kit/openapi";
|
|
2
|
-
import { ktByteArray, ktFunParam, ktNullable, } from "../../
|
|
3
|
-
import {
|
|
2
|
+
import { ktByteArray, ktFunParam, ktNullable, } from "../../ast/index.js";
|
|
3
|
+
import { operationParamIdent } from "../identifiers.js";
|
|
4
4
|
import { schemaToType } from "../type/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Resolve an `IR.BodyObject` into function parameters for both the
|
|
@@ -39,7 +39,7 @@ function objectBodyToFlatParams(schema, ctx, binaryAsByteArray) {
|
|
|
39
39
|
? ktByteArray
|
|
40
40
|
: schemaToType(propSchema, { ...ctx, propPath: ["body", propName] });
|
|
41
41
|
return ktFunParam({
|
|
42
|
-
name:
|
|
42
|
+
name: operationParamIdent(propName),
|
|
43
43
|
type: required ? t : ktNullable(t),
|
|
44
44
|
default: required ? undefined : "null",
|
|
45
45
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/ir/operation/body.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,uBAAuB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,
|
|
1
|
+
{"version":3,"file":"body.js","sourceRoot":"","sources":["../../../src/ir/operation/body.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,uBAAuB,GAExB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAEL,WAAW,EACX,UAAU,EACV,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAC7B,IAAmB,EACnB,GAAY;IAEZ,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAE7C,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;QAC3D,KAAK,YAAY;YACf,OAAO;gBACL,UAAU,CAAC;oBACT,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,YAAY,CAAC,MAAM,EAAE,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC;iBAC3D,CAAC;aACH,CAAC;QACJ,KAAK,kBAAkB;YACrB,OAAO,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAC;QAC3E,KAAK,wBAAwB;YAC3B,OAAO,sBAAsB,CAAC,MAAM,EAAE,GAAG,EAAE,uBAAuB,CAAC,KAAK,CAAC,CAAC;QAC5E,KAAK,QAAQ;YACX,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC;AAED,SAAS,sBAAsB,CAC7B,MAAc,EACd,GAAY,EACZ,iBAA0B;IAE1B,OAAO,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CACpD,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;QAChE,MAAM,CAAC,GACL,iBAAiB,IAAI,QAAQ;YAC3B,CAAC,CAAC,WAAW;YACb,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,GAAG,GAAG,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QACzE,OAAO,UAAU,CAAC;YAChB,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC;YACnC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YAClC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;SACvC,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IR } from "@hey-api/shared";
|
|
2
2
|
import { type LocatedParam } from "@ir-kit/openapi";
|
|
3
|
-
import { type KtFunParam } from "../../
|
|
3
|
+
import { type KtFunParam } from "../../ast/index.js";
|
|
4
4
|
import type { TypeCtx } from "../type/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Produce the function parameters for path/query/header parameters in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,oBAAoB,CAAC;AAE7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,EAAE,CAAC,eAAe,EACtB,GAAG,EAAE,OAAO,GACX;IAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,OAAO,EAAE,YAAY,EAAE,CAAA;CAAE,CAiBnD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { collectLocatedParams, fromHeyApi, } from "@ir-kit/openapi";
|
|
2
|
-
import { ktFunParam, ktNullable } from "../../
|
|
3
|
-
import {
|
|
2
|
+
import { ktFunParam, ktNullable } from "../../ast/index.js";
|
|
3
|
+
import { operationParamIdent } from "../identifiers.js";
|
|
4
4
|
import { schemaToType } from "../type/index.js";
|
|
5
5
|
/**
|
|
6
6
|
* Produce the function parameters for path/query/header parameters in
|
|
@@ -18,7 +18,7 @@ export function buildNonBodyParams(op, ctx) {
|
|
|
18
18
|
propPath: ["param", p.name],
|
|
19
19
|
});
|
|
20
20
|
return ktFunParam({
|
|
21
|
-
name:
|
|
21
|
+
name: operationParamIdent(p.name),
|
|
22
22
|
type: p.required ? t : ktNullable(t),
|
|
23
23
|
default: p.required ? undefined : "null",
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/ir/operation/params.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,UAAU,GAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAmB,UAAU,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"params.js","sourceRoot":"","sources":["../../../src/ir/operation/params.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,UAAU,GAEX,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAmB,UAAU,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,EAAsB,EACtB,GAAY;IAEZ,MAAM,OAAO,GAAG,oBAAoB,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC;IAC3E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE;QAC1C,MAAM,CAAC,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;YAC3C,GAAG,GAAG;YACN,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC;SAC5B,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;YAChB,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,IAAI,CAAC;YACjC,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;YACpC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;SACzC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IR } from "@hey-api/shared";
|
|
2
|
-
import { type KtType } from "../../
|
|
2
|
+
import { type KtType } from "../../ast/index.js";
|
|
3
3
|
import type { TypeCtx } from "../type/index.js";
|
|
4
4
|
import type { ResponseCase } from "./signature.js";
|
|
5
5
|
export interface ResolvedReturn {
|
|
@@ -11,6 +11,8 @@ export interface ResolvedReturn {
|
|
|
11
11
|
* dispatches on `response.code`.
|
|
12
12
|
*/
|
|
13
13
|
cases: ReadonlyArray<ResponseCase>;
|
|
14
|
+
/** Name of the emitted sealed class, for multi-2xx ops. */
|
|
15
|
+
sealedName?: string;
|
|
14
16
|
}
|
|
15
17
|
export declare function returnTypeFor(op: IR.OperationObject, ctx: TypeCtx): ResolvedReturn;
|
|
16
18
|
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAI1C,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAI1C,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,KAAK,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACnC,2DAA2D;IAC3D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,aAAa,CAC3B,EAAE,EAAE,EAAE,CAAC,eAAe,EACtB,GAAG,EAAE,OAAO,GACX,cAAc,CA6ChB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { synthName } from "@ir-kit/codegen-core";
|
|
2
2
|
import { classifyReturnShape } from "@ir-kit/openapi";
|
|
3
|
-
import { ktProp, ktRef, ktSealedClass, ktSealedSubclass, ktUnit, } from "../../
|
|
3
|
+
import { ktProp, ktRef, ktSealedClass, ktSealedSubclass, ktUnit, } from "../../ast/index.js";
|
|
4
4
|
import { schemaToType } from "../type/index.js";
|
|
5
5
|
export function returnTypeFor(op, ctx) {
|
|
6
6
|
const shape = classifyReturnShape(op);
|
|
@@ -10,7 +10,7 @@ export function returnTypeFor(op, ctx) {
|
|
|
10
10
|
case "single":
|
|
11
11
|
return { type: schemaToType(shape.schema, ctx), cases: [] };
|
|
12
12
|
case "multi": {
|
|
13
|
-
const sealedName = synthName(ctx.ownerName, ["response"]);
|
|
13
|
+
const sealedName = ctx.names.claim(`synth:${ctx.ownerName}/response`, synthName(ctx.ownerName, ["response"]));
|
|
14
14
|
const cases = shape.cases.map(({ statusCode, schema }) => {
|
|
15
15
|
const caseName = `Status${statusCode}`;
|
|
16
16
|
if (!schema)
|
|
@@ -31,13 +31,12 @@ export function returnTypeFor(op, ctx) {
|
|
|
31
31
|
ktProp({
|
|
32
32
|
name: "value",
|
|
33
33
|
type: c.payloadType,
|
|
34
|
-
inPrimary: true,
|
|
35
34
|
}),
|
|
36
35
|
],
|
|
37
36
|
})
|
|
38
37
|
: ktSealedSubclass({ variant: "object", name: c.caseName })),
|
|
39
38
|
}));
|
|
40
|
-
return { type: ktRef(sealedName), cases };
|
|
39
|
+
return { type: ktRef(sealedName), cases, sealedName };
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/ir/operation/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAEL,MAAM,EACN,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,MAAM,GACP,MAAM,
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../../src/ir/operation/response.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAEL,MAAM,EACN,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,MAAM,GACP,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgBhD,MAAM,UAAU,aAAa,CAC3B,EAAsB,EACtB,GAAY;IAEZ,MAAM,KAAK,GAAG,mBAAmB,CAAC,EAAE,CAAC,CAAC;IACtC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK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AAC,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAC9D;aACF,CAAC,CACH,CAAC;YACF,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;QACxD,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IR } from "@hey-api/shared";
|
|
2
|
+
import type { Namespace } from "@ir-kit/codegen-core";
|
|
2
3
|
import type { HttpMethod } from "@ir-kit/openapi";
|
|
3
4
|
import { type LocatedParam } from "@ir-kit/openapi";
|
|
4
|
-
import { type KtFunParam, type KtType } from "../../
|
|
5
|
+
import { type KtFunParam, type KtType } from "../../ast/index.js";
|
|
5
6
|
import type { TypeCtx } from "../type/index.js";
|
|
6
7
|
export interface OperationSignature {
|
|
7
8
|
name: string;
|
|
@@ -15,6 +16,7 @@ export interface OperationSignature {
|
|
|
15
16
|
pathStr: string;
|
|
16
17
|
securitySchemeNames: ReadonlyArray<string>;
|
|
17
18
|
responseCases: ReadonlyArray<ResponseCase>;
|
|
19
|
+
sealedName?: string;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* One arm of a multi-2xx sum-type return. Populated by `returnTypeFor`
|
|
@@ -32,5 +34,5 @@ export interface ResponseCase {
|
|
|
32
34
|
* One source of truth for `params + returnType + doc` so the interface
|
|
33
35
|
* declaration and the impl class share the same signature shape.
|
|
34
36
|
*/
|
|
35
|
-
export declare function operationSignature(op: IR.OperationObject, method: HttpMethod, pathStr: string, emit: TypeCtx["emit"], schemeNames
|
|
37
|
+
export declare function operationSignature(op: IR.OperationObject, method: HttpMethod, pathStr: string, emit: TypeCtx["emit"], schemeNames: ReadonlyArray<string>, names: Namespace): OperationSignature;
|
|
36
38
|
//# sourceMappingURL=signature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"signature.d.ts","sourceRoot":"","sources":["../../../src/ir/operation/signature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAEL,KAAK,YAAY,EAElB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,MAAM,EAGZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAKhD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,EAAE,EAAE,EAAE,CAAC,eAAe,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC3C,aAAa,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,EAAE,CAAC,eAAe,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,EACrB,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,KAAK,EAAE,SAAS,GACf,kBAAkB,CA+BpB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { camel, pascal } from "@ir-kit/codegen-core";
|
|
2
2
|
import { deriveBaseName, operationDocLine, } from "@ir-kit/openapi";
|
|
3
|
-
import { ktFunParam, ktRef, } from "../../
|
|
3
|
+
import { ktFunParam, ktRef, } from "../../ast/index.js";
|
|
4
4
|
import { buildBodyParams } from "./body.js";
|
|
5
5
|
import { buildNonBodyParams } from "./params.js";
|
|
6
6
|
import { returnTypeFor } from "./response.js";
|
|
@@ -8,14 +8,14 @@ import { returnTypeFor } from "./response.js";
|
|
|
8
8
|
* One source of truth for `params + returnType + doc` so the interface
|
|
9
9
|
* declaration and the impl class share the same signature shape.
|
|
10
10
|
*/
|
|
11
|
-
export function operationSignature(op, method, pathStr, emit, schemeNames
|
|
11
|
+
export function operationSignature(op, method, pathStr, emit, schemeNames, names) {
|
|
12
12
|
const name = deriveBaseName(op, method, pathStr);
|
|
13
13
|
const ownerName = pascal(name);
|
|
14
|
-
const ctx = { emit, ownerName, propPath: [] };
|
|
14
|
+
const ctx = { emit, names, ownerName, propPath: [] };
|
|
15
15
|
const { params: nonBody, located } = buildNonBodyParams(op, ctx);
|
|
16
16
|
const bodyParams = op.body ? buildBodyParams(op.body, ctx) : [];
|
|
17
17
|
const params = [...nonBody, ...bodyParams, optionsParam()];
|
|
18
|
-
const { type: returnType, cases: responseCases } = returnTypeFor(op, {
|
|
18
|
+
const { type: returnType, cases: responseCases, sealedName, } = returnTypeFor(op, {
|
|
19
19
|
...ctx,
|
|
20
20
|
propPath: ["response"],
|
|
21
21
|
});
|
|
@@ -24,6 +24,7 @@ export function operationSignature(op, method, pathStr, emit, schemeNames = [])
|
|
|
24
24
|
ownerName,
|
|
25
25
|
params,
|
|
26
26
|
returnType,
|
|
27
|
+
sealedName,
|
|
27
28
|
doc: operationDocLine(method, pathStr),
|
|
28
29
|
locatedParams: located,
|
|
29
30
|
op,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/ir/operation/signature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/ir/operation/signature.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EACL,cAAc,EAEd,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,UAAU,EACV,KAAK,GACN,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AA8B9C;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAChC,EAAsB,EACtB,MAAkB,EAClB,OAAe,EACf,IAAqB,EACrB,WAAkC,EAClC,KAAgB;IAEhB,MAAM,IAAI,GAAG,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,GAAG,GAAY,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;IAE9D,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjE,MAAM,UAAU,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,EAAE,GAAG,UAAU,EAAE,YAAY,EAAE,CAAC,CAAC;IAC3D,MAAM,EACJ,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,aAAa,EACpB,UAAU,GACX,GAAG,aAAa,CAAC,EAAE,EAAE;QACpB,GAAG,GAAG;QACN,QAAQ,EAAE,CAAC,UAAU,CAAC;KACvB,CAAC,CAAC;IAEH,OAAO;QACL,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;QACjB,SAAS;QACT,MAAM;QACN,UAAU;QACV,UAAU;QACV,GAAG,EAAE,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC;QACtC,aAAa,EAAE,OAAO;QACtB,EAAE;QACF,MAAM;QACN,OAAO;QACP,mBAAmB,EAAE,WAAW;QAChC,aAAa;KACd,CAAC;AACJ,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,YAAY;IACnB,OAAO,UAAU,CAAC;QAChB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,KAAK,CAAC,gBAAgB,CAAC;KAC9B,CAAC,CAAC;AACL,CAAC"}
|
package/dist/ir/operations.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IR } from "@hey-api/shared";
|
|
2
|
-
import { type
|
|
2
|
+
import { type Namespace } from "@ir-kit/codegen-core";
|
|
3
|
+
import { type KtDecl, type KtType } from "../ast/index.js";
|
|
3
4
|
export interface OperationsOptions {
|
|
4
5
|
/** Default: `"Default"`. */
|
|
5
6
|
defaultTag?: string;
|
|
@@ -21,6 +22,10 @@ export interface OperationsOptions {
|
|
|
21
22
|
* here. Empty / missing entries → no auto-auth wiring for that op.
|
|
22
23
|
*/
|
|
23
24
|
securitySchemeNames?: ReadonlyMap<string, ReadonlyArray<string>>;
|
|
25
|
+
/** Shared type-name owner; pass the one used for `schemasToDecls`. */
|
|
26
|
+
names?: Namespace;
|
|
27
|
+
/** Type aliases declared outside these operations (component schemas). */
|
|
28
|
+
aliases?: ReadonlyMap<string, KtType>;
|
|
24
29
|
}
|
|
25
30
|
export interface OperationsResult {
|
|
26
31
|
decls: KtDecl[];
|
|
@@ -40,4 +45,5 @@ export interface OperationsResult {
|
|
|
40
45
|
* in the same output array.
|
|
41
46
|
*/
|
|
42
47
|
export declare function operationsToDecls(paths: IR.PathsObject | undefined, opts?: OperationsOptions): OperationsResult;
|
|
48
|
+
export declare function aliasesOf(decls: ReadonlyArray<KtDecl>): Array<[string, KtType]>;
|
|
43
49
|
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/ir/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/ir/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,KAAK,SAAS,EAAU,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAEL,KAAK,MAAM,EAEX,KAAK,MAAM,EAWZ,MAAM,iBAAiB,CAAC;AAQzB,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,8DAA8D;IAC9D,eAAe,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACpD,6DAA6D;IAC7D,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;IACjE,sEAAsE;IACtE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;;wBAEoB;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB;;mEAE+D;IAC/D,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,EAAE,CAAC,WAAW,GAAG,SAAS,EACjC,IAAI,GAAE,iBAAsB,GAC3B,gBAAgB,CA8DlB;AAiFD,wBAAgB,SAAS,CACvB,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,GAC3B,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAIzB"}
|
package/dist/ir/operations.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { pascal } from "@ir-kit/codegen-core";
|
|
2
2
|
import { iterOperations } from "@ir-kit/openapi";
|
|
3
|
-
import { ktArg, ktCall, ktExprStmt, ktFun, ktIdent, ktInterface, ktMember, ktRef, ktReturn, ktTopLevelFun, } from "../
|
|
3
|
+
import { isUnit, ktArg, ktCall, ktExprStmt, ktFun, ktIdent, ktInterface, ktMember, ktRef, ktReturn, ktTopLevelFun, } from "../ast/index.js";
|
|
4
|
+
import { kotlinTypeIdent, newTypeNames } from "./identifiers.js";
|
|
4
5
|
import { buildClientClass } from "./impl/index.js";
|
|
5
6
|
import { operationSignature, } from "./operation/index.js";
|
|
6
7
|
/**
|
|
@@ -11,13 +12,14 @@ import { operationSignature, } from "./operation/index.js";
|
|
|
11
12
|
*/
|
|
12
13
|
export function operationsToDecls(paths, opts = {}) {
|
|
13
14
|
const defaultTag = opts.defaultTag ?? "Default";
|
|
14
|
-
const interfaceName = opts.interfaceName ?? ((tag) => `${
|
|
15
|
+
const interfaceName = opts.interfaceName ?? ((tag) => kotlinTypeIdent(`${tag} Api`));
|
|
15
16
|
const clientClassName = opts.clientClassName ?? ((p) => `OkHttp${p}`);
|
|
16
17
|
const decls = [];
|
|
17
18
|
const emit = (d) => decls.push(d);
|
|
18
19
|
const byTag = new Map();
|
|
20
|
+
const names = opts.names ?? newTypeNames();
|
|
19
21
|
for (const { pathStr, method, op, schemeNames } of iterOperations(paths, opts.securitySchemeNames)) {
|
|
20
|
-
const sig = operationSignature(op, method, pathStr, emit, schemeNames);
|
|
22
|
+
const sig = operationSignature(op, method, pathStr, emit, schemeNames, names);
|
|
21
23
|
const tag = op.tags?.[0] ?? defaultTag;
|
|
22
24
|
const list = byTag.get(tag);
|
|
23
25
|
if (list)
|
|
@@ -45,6 +47,7 @@ export function operationsToDecls(paths, opts = {}) {
|
|
|
45
47
|
if (!opts.interfaceOnly) {
|
|
46
48
|
const result = buildClientClass(clientClassName(ifaceName), ifaceName, allSigs, {
|
|
47
49
|
open: opts.openImpl,
|
|
50
|
+
aliases: new Map([...(opts.aliases ?? []), ...aliasesOf(decls)]),
|
|
48
51
|
});
|
|
49
52
|
decls.push(result.class);
|
|
50
53
|
if (result.needsMultipart)
|
|
@@ -67,8 +70,8 @@ function withResponseSignature(sig) {
|
|
|
67
70
|
};
|
|
68
71
|
}
|
|
69
72
|
function withResponseReturnType(t) {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
73
|
+
const unit = isUnit(t);
|
|
74
|
+
return unit ? ktRef("Response") : ktRef("Pair", [t, ktRef("Response")]);
|
|
72
75
|
}
|
|
73
76
|
function hasSecurity(sig) {
|
|
74
77
|
return sig.securitySchemeNames.length > 0;
|
|
@@ -110,7 +113,7 @@ function signatureToConvenienceFun(sig, receiverName) {
|
|
|
110
113
|
const callArgs = baseParams.map((p) => ktArg(ktIdent(p.name), p.name));
|
|
111
114
|
callArgs.push(ktArg(ktCall(ktIdent("RequestOptions"), []), "options"));
|
|
112
115
|
const forwarded = ktCall(ktMember(ktIdent("this"), sig.name), callArgs);
|
|
113
|
-
const
|
|
116
|
+
const unit = isUnit(sig.returnType);
|
|
114
117
|
return ktFun({
|
|
115
118
|
name: sig.name,
|
|
116
119
|
params: baseParams,
|
|
@@ -118,7 +121,10 @@ function signatureToConvenienceFun(sig, receiverName) {
|
|
|
118
121
|
modifiers: ["suspend"],
|
|
119
122
|
doc: sig.doc,
|
|
120
123
|
receiver: ktRef(receiverName),
|
|
121
|
-
body: [
|
|
124
|
+
body: [unit ? ktExprStmt(forwarded) : ktReturn(forwarded)],
|
|
122
125
|
});
|
|
123
126
|
}
|
|
127
|
+
export function aliasesOf(decls) {
|
|
128
|
+
return decls.flatMap((d) => d.aliasOf ? [[d.name, d.aliasOf]] : []);
|
|
129
|
+
}
|
|
124
130
|
//# sourceMappingURL=operations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/ir/operations.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../src/ir/operations.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EACL,MAAM,EAIN,KAAK,EACL,MAAM,EACN,UAAU,EACV,KAAK,EACL,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAEL,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAyC9B;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,KAAiC,EACjC,OAA0B,E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CAAqB,CAAC,CAAC,CAAC,CAAC,EAAE,CAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ir/runtime/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/ir/runtime/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { buildRuntimeFiles } from "./templates.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|